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.
- package/README.de.md +3 -3
- package/README.es.md +3 -3
- package/README.fr.md +3 -3
- package/README.ja.md +3 -3
- package/README.ko.md +3 -3
- package/README.md +163 -41
- package/README.pt-BR.md +3 -3
- package/README.ru.md +3 -3
- package/README.zh-CN.md +3 -3
- package/build/api/account-management/account.js +633 -297
- package/build/api/analytics-and-report/analytics.js +111 -65
- package/build/api/client.js +199 -140
- package/build/api/clientRequestError.js +23 -0
- package/build/api/clientTrading.js +213 -0
- package/build/api/clientTradingError.js +4 -0
- package/build/api/communication/feedback.js +147 -59
- package/build/api/communication/message.js +134 -81
- package/build/api/communication/negotiation.js +65 -53
- package/build/api/communication/notification.js +458 -164
- package/build/api/developer/developer.js +99 -45
- package/build/api/index.js +23 -8
- package/build/api/listing-management/inventory.js +884 -338
- package/build/api/listing-metadata/metadata.js +416 -170
- package/build/api/listing-metadata/taxonomy.js +187 -42
- package/build/api/marketing-and-promotions/marketing.js +1392 -598
- package/build/api/marketing-and-promotions/recommendation.js +49 -24
- package/build/api/order-management/dispute.js +226 -45
- package/build/api/order-management/fulfillment.js +144 -71
- package/build/api/order-management/orderIssueHelpers.js +61 -0
- package/build/api/other/compliance.js +50 -38
- package/build/api/other/edelivery.js +603 -159
- package/build/api/other/finding.js +280 -0
- package/build/api/other/identity.js +30 -15
- package/build/api/other/translation.js +29 -14
- package/build/api/other/vero.js +113 -27
- package/build/api/rateLimitTracker.js +55 -0
- package/build/api/shared/request.js +189 -98
- package/build/api/trading/trading.js +154 -87
- package/build/auth/credentialSession.js +250 -0
- package/build/auth/oauth.js +298 -171
- package/build/auth/{oauth-metadata.js → oauthMetadata.js} +22 -6
- package/build/auth/oauthMiddleware.js +104 -0
- package/build/auth/{scope-utils.js → scopeUtils.js} +101 -28
- package/build/auth/tokenVerifier.js +243 -0
- package/build/auth/tokenVerifierError.js +21 -0
- package/build/config/environment.js +148 -113
- package/build/config/{tool-families.js → toolFamilies.js} +30 -14
- package/build/index.js +25 -19
- package/build/mcp/{http-transport.js → httpTransport.js} +102 -52
- package/build/mcp/readOnlyFilter.js +67 -0
- package/build/mcp/runtime.js +31 -13
- package/build/mcp/{tool-gating.js → toolGating.js} +77 -49
- package/build/mcp/{ui-bridge.js → uiBridge.js} +80 -23
- package/build/schemas/account-management/account.js +144 -6
- package/build/schemas/analytics/analytics.js +33 -19
- package/build/schemas/communication/messages.js +12 -42
- package/build/schemas/developer/developer.js +135 -0
- package/build/schemas/fulfillment/orders.js +183 -21
- package/build/schemas/index.js +27 -19
- package/build/schemas/inventory-management/inventory.js +17 -9
- package/build/schemas/marketing/marketing.js +480 -25
- package/build/schemas/metadata/metadata.js +11 -6
- package/build/schemas/other/finding.js +27 -0
- package/build/schemas/other/otherApis.js +424 -0
- package/build/schemas/taxonomy/taxonomy.js +11 -5
- package/build/scripts/{auto-setup.js → autoSetup.js} +87 -74
- package/build/scripts/{build-ui.js → buildUi.js} +6 -1
- package/build/scripts/{dev-sync.js → devSync.js} +169 -110
- package/build/scripts/diagnostics.js +52 -44
- package/build/scripts/{download-specs.js → downloadSpecs.js} +29 -21
- package/build/scripts/{interactive-setup.js → interactiveSetup.js} +84 -78
- package/build/scripts/setup.js +241 -178
- package/build/scripts/{setup-shared.js → setupShared.js} +29 -7
- package/build/scripts/skills.js +35 -27
- package/build/scripts/updateApiStatusDoc.js +71 -0
- package/build/serverHttp.js +90 -0
- package/build/skills/content.js +124 -118
- package/build/skills/index.js +22 -10
- package/build/skills/install.js +21 -10
- package/build/skills/markers.js +50 -15
- package/build/skills/{registry-snapshot.js → registrySnapshot.js} +8 -2
- package/build/skills/render.js +41 -14
- package/build/skills/targets.js +49 -17
- package/build/tools/categories/account.js +166 -264
- package/build/tools/categories/analytics.js +11 -22
- package/build/tools/categories/browse.js +17 -0
- package/build/tools/categories/communication.js +124 -399
- package/build/tools/categories/connector.js +23 -20
- package/build/tools/categories/developer.js +46 -159
- package/build/tools/categories/fulfillment.js +84 -215
- package/build/tools/categories/index.js +6 -14
- package/build/tools/categories/inventory.js +238 -293
- package/build/tools/categories/marketing.js +677 -39
- package/build/tools/categories/metadata.js +190 -117
- package/build/tools/categories/other.js +81 -208
- package/build/tools/categories/taxonomy.js +29 -20
- package/build/tools/categories/{token-management.js → tokenManagement.js} +187 -192
- package/build/tools/categories/trading.js +16 -47
- package/build/tools/contracts.js +34 -24
- package/build/tools/{define-tool.js → defineTool.js} +44 -29
- package/build/tools/registry.js +87 -29
- package/build/tools/schemas.js +3 -57
- package/build/tools/ui/archetypes.js +1 -0
- package/build/tools/ui/{map-helpers.js → mapHelpers.js} +69 -19
- package/build/tools/ui/maps.js +294 -80
- package/build/types/index.js +1 -1
- package/build/ui/card.html +14 -14
- package/build/ui/chart.html +14 -14
- package/build/ui/stat.html +87 -0
- package/build/ui/table.html +14 -14
- package/build/utils/apiStatusFeed.js +95 -0
- package/build/utils/cliOutput.js +15 -0
- package/build/utils/cliUi.js +108 -0
- package/build/utils/communication/feedback.js +57 -77
- package/build/utils/communication/message.js +69 -98
- package/build/utils/communication/negotiation.js +30 -57
- package/build/utils/communication/notification.js +112 -252
- package/build/utils/{date-converter.js → dateConverter.js} +62 -30
- package/build/utils/effectSchema.js +203 -0
- package/build/utils/effectSchemaAdapter.js +121 -0
- package/build/utils/effectSchemaChainMethods.js +146 -0
- package/build/utils/effectSchemaRefinements.js +104 -0
- package/build/utils/effectSchemaStringMethods.js +63 -0
- package/build/utils/effectSchemaTypes.js +47 -0
- package/build/utils/{env-parser.js → envParser.js} +10 -2
- package/build/utils/errors.js +7 -3
- package/build/utils/http.js +148 -89
- package/build/utils/{llm-client-detector.js → llmClientDetector.js} +295 -274
- package/build/utils/logger.js +127 -51
- package/build/utils/{oauth-helper.js → oauthHelper.js} +127 -90
- package/build/utils/other/compliance.js +18 -38
- package/build/utils/other/identity.js +2 -2
- package/build/utils/other/translation.js +4 -4
- package/build/utils/other/vero.js +36 -20
- package/build/utils/schemaHelpers.js +22 -0
- package/build/utils/scopeHelper.js +270 -0
- package/build/utils/securityChecker.js +316 -0
- package/build/utils/{setup-validator.js → setupValidator.js} +113 -94
- package/build/utils/{setup-wizard.js → setupWizard.js} +57 -46
- package/build/utils/{token-utils.js → tokenUtils.js} +2 -2
- package/build/utils/trading/trading.js +35 -0
- package/build/utils/typeGuards.js +12 -0
- package/build/utils/version.js +65 -29
- package/package.json +10 -8
- package/build/api/client-trading.js +0 -124
- package/build/api/communication/shared.js +0 -59
- package/build/api/shared/query-params.js +0 -16
- package/build/auth/credential-session.js +0 -166
- package/build/auth/oauth-middleware.js +0 -100
- package/build/auth/token-verifier.js +0 -186
- package/build/schemas/other/other-apis.js +0 -390
- package/build/scripts/update-api-status-doc.js +0 -44
- package/build/server-http.js +0 -85
- package/build/tools/definitions/marketing.js +0 -1381
- package/build/tools/tool-handlers/marketing.js +0 -312
- package/build/utils/account-management/account.js +0 -818
- package/build/utils/api-status-feed.js +0 -84
- package/build/utils/cli-ui.js +0 -47
- package/build/utils/order-management/dispute.js +0 -369
- package/build/utils/order-management/fulfillment.js +0 -205
- package/build/utils/other/edelivery.js +0 -235
- package/build/utils/schema-helpers.js +0 -13
- package/build/utils/scope-helper.js +0 -207
- package/build/utils/security-checker.js +0 -248
- package/build/utils/type-guards.js +0 -6
- /package/build/auth/{oauth-types.js → oauthTypes.js} +0 -0
- /package/build/{server-http.d.ts → serverHttp.d.ts} +0 -0
- /package/build/tools/ui/{view-models.js → viewModels.js} +0 -0
- /package/build/types/{ebay-enums.js → ebayEnums.js} +0 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { z } from '../../utils/effectSchema.js';
|
|
2
|
+
import { zodToJsonSchema } from 'zod-to-json-schema';
|
|
3
|
+
/** Input accepted by the public eBay API status feed tool. */
|
|
4
|
+
export const getApiStatusInputSchema = z.object({
|
|
5
|
+
limit: z
|
|
6
|
+
.number()
|
|
7
|
+
.int()
|
|
8
|
+
.min(1)
|
|
9
|
+
.max(50)
|
|
10
|
+
.optional()
|
|
11
|
+
.describe('Maximum number of feed items to return'),
|
|
12
|
+
status: z.enum(['Resolved', 'Unresolved']).optional().describe('Optional incident status filter'),
|
|
13
|
+
api: z.string().optional().describe('Optional API-name substring filter'),
|
|
14
|
+
});
|
|
15
|
+
/** Input accepted by Developer Analytics API getRateLimits. */
|
|
16
|
+
export const getRateLimitsInputSchema = z.object({
|
|
17
|
+
apiContext: z
|
|
18
|
+
.string()
|
|
19
|
+
.optional()
|
|
20
|
+
.describe('Optional API context filter, e.g. buy, sell, commerce, developer, or tradingapi'),
|
|
21
|
+
apiName: z
|
|
22
|
+
.string()
|
|
23
|
+
.optional()
|
|
24
|
+
.describe('Optional API name filter, e.g. browse, inventory, taxonomy, or tradingapi'),
|
|
25
|
+
});
|
|
26
|
+
/** Input accepted by Developer Analytics API getUserRateLimits. */
|
|
27
|
+
export const getUserRateLimitsInputSchema = getRateLimitsInputSchema;
|
|
28
|
+
/** Generated client-registration request fields accepted by eBay. */
|
|
29
|
+
export const clientSettingsSchema = z.object({
|
|
30
|
+
client_name: z.string().optional().describe('User-friendly name for the application'),
|
|
31
|
+
contacts: z.array(z.string()).optional().describe('Contact email addresses for the registrant'),
|
|
32
|
+
policy_uri: z.string().optional().describe('HTTPS URL to the application privacy policy'),
|
|
33
|
+
redirect_uris: z.array(z.string()).optional().describe('OAuth redirect URIs'),
|
|
34
|
+
software_id: z.string().optional().describe('Stable identifier for the client software'),
|
|
35
|
+
software_statement: z
|
|
36
|
+
.string()
|
|
37
|
+
.optional()
|
|
38
|
+
.describe('Base64-encoded Software Statement Assertion JWT'),
|
|
39
|
+
});
|
|
40
|
+
/** Input accepted by Developer Client Registration API registerClient. */
|
|
41
|
+
export const registerClientInputSchema = z.object({
|
|
42
|
+
clientSettings: clientSettingsSchema.describe('Generated ClientSettings request body'),
|
|
43
|
+
});
|
|
44
|
+
/** Input accepted by Developer Key Management API getSigningKeys. */
|
|
45
|
+
export const getSigningKeysInputSchema = z.object({});
|
|
46
|
+
/** Generated create-signing-key request body accepted by eBay. */
|
|
47
|
+
export const createSigningKeyRequestSchema = z.object({
|
|
48
|
+
signingKeyCipher: z
|
|
49
|
+
.string()
|
|
50
|
+
.optional()
|
|
51
|
+
.describe('Cipher for the generated keypair, e.g. ED25519 or RSA'),
|
|
52
|
+
});
|
|
53
|
+
/** Input accepted by Developer Key Management API createSigningKey. */
|
|
54
|
+
export const createSigningKeyInputSchema = z.object({
|
|
55
|
+
request: createSigningKeyRequestSchema.optional().describe('Optional signing-key request body'),
|
|
56
|
+
});
|
|
57
|
+
/** Input accepted by Developer Key Management API getSigningKey. */
|
|
58
|
+
export const getSigningKeyInputSchema = z.object({
|
|
59
|
+
signingKeyId: z.string().describe('System-generated eBay signing key identifier'),
|
|
60
|
+
});
|
|
61
|
+
const rateSchema = z.object({
|
|
62
|
+
count: z.number().int().optional(),
|
|
63
|
+
limit: z.number().int().optional(),
|
|
64
|
+
remaining: z.number().int().optional(),
|
|
65
|
+
reset: z.string().optional(),
|
|
66
|
+
timeWindow: z.number().int().optional(),
|
|
67
|
+
});
|
|
68
|
+
const resourceSchema = z.object({
|
|
69
|
+
name: z.string().optional(),
|
|
70
|
+
rates: z.array(rateSchema).optional(),
|
|
71
|
+
});
|
|
72
|
+
const rateLimitSchema = z.object({
|
|
73
|
+
apiContext: z.string().optional(),
|
|
74
|
+
apiName: z.string().optional(),
|
|
75
|
+
apiVersion: z.string().optional(),
|
|
76
|
+
resources: z.array(resourceSchema).optional(),
|
|
77
|
+
});
|
|
78
|
+
/** Response returned by Developer Analytics rate-limit endpoints. */
|
|
79
|
+
export const rateLimitsResponseSchema = z.object({
|
|
80
|
+
rateLimits: z.array(rateLimitSchema).optional(),
|
|
81
|
+
});
|
|
82
|
+
/** Response returned by Developer Client Registration API registerClient. */
|
|
83
|
+
export const clientDetailsSchema = z.object({
|
|
84
|
+
client_id: z.string().optional(),
|
|
85
|
+
client_id_issued_at: z.number().int().optional(),
|
|
86
|
+
client_name: z.string().optional(),
|
|
87
|
+
client_secret: z.string().optional(),
|
|
88
|
+
client_secret_expires_at: z.number().int().optional(),
|
|
89
|
+
contacts: z.array(z.string()).optional(),
|
|
90
|
+
grant_types: z.array(z.string()).optional(),
|
|
91
|
+
policy_uri: z.string().optional(),
|
|
92
|
+
redirect_uris: z.array(z.string()).optional(),
|
|
93
|
+
scope: z.string().optional(),
|
|
94
|
+
software_id: z.string().optional(),
|
|
95
|
+
software_statement: z.string().optional(),
|
|
96
|
+
});
|
|
97
|
+
/** Response returned by Developer Key Management signing-key endpoints. */
|
|
98
|
+
export const signingKeySchema = z.object({
|
|
99
|
+
creationTime: z.number().int().optional(),
|
|
100
|
+
expirationTime: z.number().int().optional(),
|
|
101
|
+
jwe: z.string().optional(),
|
|
102
|
+
privateKey: z.string().optional(),
|
|
103
|
+
publicKey: z.string().optional(),
|
|
104
|
+
signingKeyCipher: z.string().optional(),
|
|
105
|
+
signingKeyId: z.string().optional(),
|
|
106
|
+
});
|
|
107
|
+
/** Response returned by Developer Key Management API getSigningKeys. */
|
|
108
|
+
export const querySigningKeysResponseSchema = z.object({
|
|
109
|
+
signingKeys: z.array(signingKeySchema).optional(),
|
|
110
|
+
});
|
|
111
|
+
/**
|
|
112
|
+
* Converts Developer API Effect-backed schemas to JSON Schema format for MCP tools.
|
|
113
|
+
*
|
|
114
|
+
* @returns Developer API JSON schemas keyed by endpoint or shared model name.
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```ts
|
|
118
|
+
* const schemas = getDeveloperJsonSchemas();
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
export const getDeveloperJsonSchemas = () => ({
|
|
122
|
+
getApiStatusInput: zodToJsonSchema(getApiStatusInputSchema, 'getApiStatusInput'),
|
|
123
|
+
getRateLimitsInput: zodToJsonSchema(getRateLimitsInputSchema, 'getRateLimitsInput'),
|
|
124
|
+
getRateLimitsOutput: zodToJsonSchema(rateLimitsResponseSchema, 'getRateLimitsOutput'),
|
|
125
|
+
getUserRateLimitsInput: zodToJsonSchema(getUserRateLimitsInputSchema, 'getUserRateLimitsInput'),
|
|
126
|
+
getUserRateLimitsOutput: zodToJsonSchema(rateLimitsResponseSchema, 'getUserRateLimitsOutput'),
|
|
127
|
+
registerClientInput: zodToJsonSchema(registerClientInputSchema, 'registerClientInput'),
|
|
128
|
+
registerClientOutput: zodToJsonSchema(clientDetailsSchema, 'registerClientOutput'),
|
|
129
|
+
getSigningKeysInput: zodToJsonSchema(getSigningKeysInputSchema, 'getSigningKeysInput'),
|
|
130
|
+
getSigningKeysOutput: zodToJsonSchema(querySigningKeysResponseSchema, 'getSigningKeysOutput'),
|
|
131
|
+
createSigningKeyInput: zodToJsonSchema(createSigningKeyInputSchema, 'createSigningKeyInput'),
|
|
132
|
+
createSigningKeyOutput: zodToJsonSchema(signingKeySchema, 'createSigningKeyOutput'),
|
|
133
|
+
getSigningKeyInput: zodToJsonSchema(getSigningKeyInputSchema, 'getSigningKeyInput'),
|
|
134
|
+
getSigningKeyOutput: zodToJsonSchema(signingKeySchema, 'getSigningKeyOutput'),
|
|
135
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { z } from '
|
|
1
|
+
import { z } from '../../utils/effectSchema.js';
|
|
2
2
|
import { zodToJsonSchema } from 'zod-to-json-schema';
|
|
3
|
-
import { ReasonForRefund } from '../../types/
|
|
3
|
+
import { ReasonForRefund } from '../../types/ebayEnums.js';
|
|
4
4
|
/**
|
|
5
5
|
* Fulfillment/Order Management API Schemas
|
|
6
6
|
*
|
|
7
|
-
* This file contains
|
|
7
|
+
* This file contains Effect-backed schemas for all Order Management and Fulfillment endpoints.
|
|
8
8
|
*/
|
|
9
9
|
// ============================================================================
|
|
10
10
|
// Common Schemas
|
|
@@ -179,6 +179,7 @@ const orderSchema = z.object({
|
|
|
179
179
|
* Validates the Fulfillment API get orders request payload.
|
|
180
180
|
*/
|
|
181
181
|
export const getOrdersInputSchema = z.object({
|
|
182
|
+
fieldGroups: z.string().optional().describe('Response field group, e.g. TAX_BREAKDOWN'),
|
|
182
183
|
filter: z
|
|
183
184
|
.string()
|
|
184
185
|
.optional()
|
|
@@ -187,6 +188,26 @@ export const getOrdersInputSchema = z.object({
|
|
|
187
188
|
offset: z.number().optional().describe('Number of orders to skip for pagination'),
|
|
188
189
|
orderIds: z.string().optional().describe('Comma-separated list of order IDs'),
|
|
189
190
|
});
|
|
191
|
+
/**
|
|
192
|
+
* Shared input for read-only order issue scanners (cancellation / refund helpers).
|
|
193
|
+
* Calls getOrders then filters client-side — no Post-Order API.
|
|
194
|
+
*/
|
|
195
|
+
export const scanOrderIssuesInputSchema = z.object({
|
|
196
|
+
filter: z
|
|
197
|
+
.string()
|
|
198
|
+
.optional()
|
|
199
|
+
.describe('Optional Fulfillment getOrders filter expression (e.g. creationdate:[2024-01-01T00:00:00.000Z..2024-12-31T23:59:59.999Z])'),
|
|
200
|
+
maxResults: z
|
|
201
|
+
.number()
|
|
202
|
+
.int()
|
|
203
|
+
.positive()
|
|
204
|
+
.optional()
|
|
205
|
+
.describe('Maximum orders to scan via getOrders (default 50)'),
|
|
206
|
+
});
|
|
207
|
+
/** Input for ebay_get_cancellation_requests. */
|
|
208
|
+
export const getCancellationRequestsInputSchema = scanOrderIssuesInputSchema;
|
|
209
|
+
/** Input for ebay_get_refunded_orders. */
|
|
210
|
+
export const getRefundedOrdersInputSchema = scanOrderIssuesInputSchema;
|
|
190
211
|
/**
|
|
191
212
|
* Validates the Fulfillment API get orders response payload.
|
|
192
213
|
*/
|
|
@@ -205,6 +226,7 @@ export const getOrdersOutputSchema = z.object({
|
|
|
205
226
|
*/
|
|
206
227
|
export const getOrderInputSchema = z.object({
|
|
207
228
|
orderId: z.string().describe('The unique identifier of the order'),
|
|
229
|
+
fieldGroups: z.string().optional().describe('Response field group, e.g. TAX_BREAKDOWN'),
|
|
208
230
|
});
|
|
209
231
|
/**
|
|
210
232
|
* Validates the Fulfillment API get order response payload.
|
|
@@ -220,7 +242,7 @@ export const getOrderOutputSchema = orderSchema.extend({
|
|
|
220
242
|
*/
|
|
221
243
|
export const createShippingFulfillmentInputSchema = z.object({
|
|
222
244
|
orderId: z.string().describe('The unique identifier of the order'),
|
|
223
|
-
|
|
245
|
+
body: z.object({
|
|
224
246
|
lineItems: z
|
|
225
247
|
.array(z.object({
|
|
226
248
|
lineItemId: z.string(),
|
|
@@ -235,10 +257,7 @@ export const createShippingFulfillmentInputSchema = z.object({
|
|
|
235
257
|
/**
|
|
236
258
|
* Validates the Fulfillment API create shipping fulfillment response payload.
|
|
237
259
|
*/
|
|
238
|
-
export const createShippingFulfillmentOutputSchema = z.object({
|
|
239
|
-
fulfillmentId: z.string().optional(),
|
|
240
|
-
warnings: z.array(errorSchema).optional(),
|
|
241
|
-
});
|
|
260
|
+
export const createShippingFulfillmentOutputSchema = z.object({});
|
|
242
261
|
/**
|
|
243
262
|
* Validates the Fulfillment API get shipping fulfillments request payload.
|
|
244
263
|
*/
|
|
@@ -252,6 +271,17 @@ export const getShippingFulfillmentsOutputSchema = z.object({
|
|
|
252
271
|
fulfillments: z.array(shippingFulfillmentSchema).optional(),
|
|
253
272
|
warnings: z.array(errorSchema).optional(),
|
|
254
273
|
});
|
|
274
|
+
/**
|
|
275
|
+
* Validates the Fulfillment API get one shipping fulfillment request payload.
|
|
276
|
+
*/
|
|
277
|
+
export const getShippingFulfillmentInputSchema = z.object({
|
|
278
|
+
orderId: z.string().describe('The unique identifier of the order'),
|
|
279
|
+
fulfillmentId: z.string().describe('The unique identifier of the shipping fulfillment'),
|
|
280
|
+
});
|
|
281
|
+
/**
|
|
282
|
+
* Validates the Fulfillment API get one shipping fulfillment response payload.
|
|
283
|
+
*/
|
|
284
|
+
export const getShippingFulfillmentOutputSchema = shippingFulfillmentSchema;
|
|
255
285
|
// ============================================================================
|
|
256
286
|
// Refund Schemas
|
|
257
287
|
// ============================================================================
|
|
@@ -270,7 +300,7 @@ const lineItemRefundSchema = z.object({
|
|
|
270
300
|
*/
|
|
271
301
|
export const issueRefundInputSchema = z.object({
|
|
272
302
|
orderId: z.string().describe('The unique identifier of the order'),
|
|
273
|
-
|
|
303
|
+
body: z.object({
|
|
274
304
|
reasonForRefund: z.nativeEnum(ReasonForRefund).describe('Reason for issuing the refund'),
|
|
275
305
|
comment: z.string().optional().describe('Optional comment about the refund'),
|
|
276
306
|
refundItems: z.array(lineItemRefundSchema).optional().describe('Line items to refund'),
|
|
@@ -295,7 +325,7 @@ const paymentDisputeSchema = z.object({
|
|
|
295
325
|
orderId: z.string().optional(),
|
|
296
326
|
openDate: z.string().optional(),
|
|
297
327
|
respondByDate: z.string().optional(),
|
|
298
|
-
|
|
328
|
+
paymentDisputeStatus: z.string().optional(),
|
|
299
329
|
reason: z.string().optional(),
|
|
300
330
|
amount: amountSchema.optional(),
|
|
301
331
|
buyer: buyerSchema.optional(),
|
|
@@ -319,22 +349,84 @@ const paymentDisputeSchema = z.object({
|
|
|
319
349
|
}))
|
|
320
350
|
.optional(),
|
|
321
351
|
});
|
|
352
|
+
const paymentDisputeSummarySchema = z.object({
|
|
353
|
+
paymentDisputeId: z.string().optional(),
|
|
354
|
+
orderId: z.string().optional(),
|
|
355
|
+
openDate: z.string().optional(),
|
|
356
|
+
respondByDate: z.string().optional(),
|
|
357
|
+
paymentDisputeStatus: z.string().optional(),
|
|
358
|
+
reason: z.string().optional(),
|
|
359
|
+
amount: amountSchema.optional(),
|
|
360
|
+
});
|
|
361
|
+
const paymentDisputeIdSchema = z.string().describe('The unique payment dispute ID');
|
|
362
|
+
const disputeReturnAddressSchema = z.object({
|
|
363
|
+
addressLine1: z.string().optional().describe('Street address line 1'),
|
|
364
|
+
addressLine2: z.string().optional().describe('Street address line 2'),
|
|
365
|
+
city: z.string().optional().describe('City name'),
|
|
366
|
+
country: z.string().optional().describe('Two-letter ISO 3166-1 country code'),
|
|
367
|
+
county: z.string().optional().describe('County name'),
|
|
368
|
+
fullName: z.string().optional().describe('Full name of the return address owner'),
|
|
369
|
+
postalCode: z.string().optional().describe('Postal or ZIP code'),
|
|
370
|
+
primaryPhone: z
|
|
371
|
+
.object({
|
|
372
|
+
countryCode: z.string().optional().describe('Two-letter ISO 3166-1 country code'),
|
|
373
|
+
number: z.string().optional().describe('Primary phone number'),
|
|
374
|
+
})
|
|
375
|
+
.optional()
|
|
376
|
+
.describe('Primary phone number for the return address'),
|
|
377
|
+
stateOrProvince: z.string().optional().describe('State or province'),
|
|
378
|
+
});
|
|
379
|
+
const acceptPaymentDisputeBodySchema = z.object({
|
|
380
|
+
returnAddress: disputeReturnAddressSchema.optional().describe('Return address for the buyer'),
|
|
381
|
+
revision: z.number().optional().describe('Payment dispute revision number'),
|
|
382
|
+
});
|
|
383
|
+
const contestPaymentDisputeBodySchema = acceptPaymentDisputeBodySchema.extend({
|
|
384
|
+
note: z.string().max(1000).optional().describe('Seller note for contesting the dispute'),
|
|
385
|
+
});
|
|
386
|
+
const disputeFileEvidenceSchema = z.object({
|
|
387
|
+
fileId: z.string().optional().describe('File ID from uploadEvidenceFile'),
|
|
388
|
+
});
|
|
389
|
+
const disputeLineItemSchema = z.object({
|
|
390
|
+
itemId: z.string().optional().describe('eBay item ID'),
|
|
391
|
+
lineItemId: z.string().optional().describe('Order line item ID'),
|
|
392
|
+
});
|
|
393
|
+
const addDisputeEvidenceBodySchema = z.object({
|
|
394
|
+
evidenceType: z.string().optional().describe('Evidence type, e.g. PROOF_OF_DELIVERY'),
|
|
395
|
+
files: z.array(disputeFileEvidenceSchema).optional().describe('Evidence files to attach'),
|
|
396
|
+
lineItems: z.array(disputeLineItemSchema).optional().describe('Line items this evidence covers'),
|
|
397
|
+
});
|
|
398
|
+
const updateDisputeEvidenceBodySchema = addDisputeEvidenceBodySchema.extend({
|
|
399
|
+
evidenceId: z.string().optional().describe('Evidence set ID to update'),
|
|
400
|
+
});
|
|
322
401
|
/**
|
|
323
|
-
* Validates the Fulfillment API
|
|
402
|
+
* Validates the Fulfillment API getPaymentDispute request payload.
|
|
324
403
|
*/
|
|
325
|
-
export const
|
|
326
|
-
|
|
404
|
+
export const getPaymentDisputeInputSchema = z.object({
|
|
405
|
+
paymentDisputeId: paymentDisputeIdSchema,
|
|
406
|
+
});
|
|
407
|
+
/**
|
|
408
|
+
* Validates the Fulfillment API getActivities request payload.
|
|
409
|
+
*/
|
|
410
|
+
export const getActivitiesInputSchema = z.object({
|
|
411
|
+
paymentDisputeId: paymentDisputeIdSchema,
|
|
412
|
+
});
|
|
413
|
+
/**
|
|
414
|
+
* Validates the Fulfillment API getPaymentDisputeSummaries request payload.
|
|
415
|
+
*/
|
|
416
|
+
export const getPaymentDisputeSummariesInputSchema = z.object({
|
|
417
|
+
orderId: z.string().optional().describe('Filter by one order ID'),
|
|
327
418
|
buyerUsername: z.string().optional().describe('Filter by buyer username'),
|
|
328
419
|
openDateFrom: z.string().optional().describe('Start date for dispute open date filter'),
|
|
329
420
|
openDateTo: z.string().optional().describe('End date for dispute open date filter'),
|
|
421
|
+
paymentDisputeStatus: z.string().optional().describe('Filter by payment dispute status'),
|
|
330
422
|
limit: z.number().optional().describe('Number of disputes to return'),
|
|
331
423
|
offset: z.number().optional().describe('Number of disputes to skip'),
|
|
332
424
|
});
|
|
333
425
|
/**
|
|
334
|
-
* Validates the Fulfillment API
|
|
426
|
+
* Validates the Fulfillment API getPaymentDisputeSummaries response payload.
|
|
335
427
|
*/
|
|
336
|
-
export const
|
|
337
|
-
|
|
428
|
+
export const getPaymentDisputeSummariesOutputSchema = z.object({
|
|
429
|
+
paymentDisputeSummaries: z.array(paymentDisputeSummarySchema).optional(),
|
|
338
430
|
href: z.string().optional(),
|
|
339
431
|
limit: z.number().optional(),
|
|
340
432
|
next: z.string().optional(),
|
|
@@ -343,13 +435,71 @@ export const getPaymentDisputesOutputSchema = z.object({
|
|
|
343
435
|
total: z.number().optional(),
|
|
344
436
|
warnings: z.array(errorSchema).optional(),
|
|
345
437
|
});
|
|
438
|
+
/**
|
|
439
|
+
* Validates the Fulfillment API acceptPaymentDispute request payload.
|
|
440
|
+
*/
|
|
441
|
+
export const acceptPaymentDisputeInputSchema = z.object({
|
|
442
|
+
paymentDisputeId: paymentDisputeIdSchema,
|
|
443
|
+
body: acceptPaymentDisputeBodySchema
|
|
444
|
+
.optional()
|
|
445
|
+
.describe('Generated acceptPaymentDispute request body'),
|
|
446
|
+
});
|
|
447
|
+
/**
|
|
448
|
+
* Validates the Fulfillment API contestPaymentDispute request payload.
|
|
449
|
+
*/
|
|
450
|
+
export const contestPaymentDisputeInputSchema = z.object({
|
|
451
|
+
paymentDisputeId: paymentDisputeIdSchema,
|
|
452
|
+
body: contestPaymentDisputeBodySchema
|
|
453
|
+
.optional()
|
|
454
|
+
.describe('Generated contestPaymentDispute request body'),
|
|
455
|
+
});
|
|
456
|
+
/**
|
|
457
|
+
* Validates the Fulfillment API addEvidence request payload.
|
|
458
|
+
*/
|
|
459
|
+
export const addEvidenceInputSchema = z.object({
|
|
460
|
+
paymentDisputeId: paymentDisputeIdSchema,
|
|
461
|
+
body: addDisputeEvidenceBodySchema.describe('Generated addEvidence request body'),
|
|
462
|
+
});
|
|
463
|
+
/**
|
|
464
|
+
* Validates the Fulfillment API updateEvidence request payload.
|
|
465
|
+
*/
|
|
466
|
+
export const updateEvidenceInputSchema = z.object({
|
|
467
|
+
paymentDisputeId: paymentDisputeIdSchema,
|
|
468
|
+
body: updateDisputeEvidenceBodySchema.describe('Generated updateEvidence request body'),
|
|
469
|
+
});
|
|
470
|
+
/**
|
|
471
|
+
* Validates the Fulfillment API uploadEvidenceFile request payload.
|
|
472
|
+
*/
|
|
473
|
+
export const uploadEvidenceFileInputSchema = z.object({
|
|
474
|
+
paymentDisputeId: paymentDisputeIdSchema,
|
|
475
|
+
body: z
|
|
476
|
+
.object({
|
|
477
|
+
data: z.string().describe('Base64-encoded file data'),
|
|
478
|
+
filename: z.string().describe('File name with extension'),
|
|
479
|
+
})
|
|
480
|
+
.describe('Multipart-compatible file body to upload'),
|
|
481
|
+
});
|
|
482
|
+
/**
|
|
483
|
+
* Validates the Fulfillment API fetchEvidenceContent request payload.
|
|
484
|
+
*/
|
|
485
|
+
export const fetchEvidenceContentInputSchema = z.object({
|
|
486
|
+
paymentDisputeId: paymentDisputeIdSchema,
|
|
487
|
+
evidenceId: z.string().describe('The evidence ID'),
|
|
488
|
+
fileId: z.string().describe('The file ID to download'),
|
|
489
|
+
});
|
|
346
490
|
// ============================================================================
|
|
347
491
|
// JSON Schema Conversion Functions
|
|
348
492
|
// ============================================================================
|
|
349
493
|
/**
|
|
350
|
-
*
|
|
494
|
+
* Converts Fulfillment API Effect-backed schemas to JSON Schema format for MCP tools.
|
|
495
|
+
*
|
|
496
|
+
* @returns Fulfillment API JSON schemas keyed by endpoint or shared model name.
|
|
497
|
+
* @example
|
|
498
|
+
* ```ts
|
|
499
|
+
* const schemas = getFulfillmentJsonSchemas();
|
|
500
|
+
* ```
|
|
351
501
|
*/
|
|
352
|
-
export
|
|
502
|
+
export const getFulfillmentJsonSchemas = () => {
|
|
353
503
|
return {
|
|
354
504
|
// Orders
|
|
355
505
|
getOrdersInput: zodToJsonSchema(getOrdersInputSchema, 'getOrdersInput'),
|
|
@@ -357,18 +507,30 @@ export function getFulfillmentJsonSchemas() {
|
|
|
357
507
|
getOrderInput: zodToJsonSchema(getOrderInputSchema, 'getOrderInput'),
|
|
358
508
|
getOrderOutput: zodToJsonSchema(getOrderOutputSchema, 'getOrderOutput'),
|
|
359
509
|
orderDetails: zodToJsonSchema(orderSchema, 'orderDetails'),
|
|
510
|
+
getCancellationRequestsInput: zodToJsonSchema(getCancellationRequestsInputSchema, 'getCancellationRequestsInput'),
|
|
511
|
+
getRefundedOrdersInput: zodToJsonSchema(getRefundedOrdersInputSchema, 'getRefundedOrdersInput'),
|
|
360
512
|
// Shipping Fulfillment
|
|
361
513
|
createShippingFulfillmentInput: zodToJsonSchema(createShippingFulfillmentInputSchema, 'createShippingFulfillmentInput'),
|
|
362
514
|
createShippingFulfillmentOutput: zodToJsonSchema(createShippingFulfillmentOutputSchema, 'createShippingFulfillmentOutput'),
|
|
363
515
|
getShippingFulfillmentsInput: zodToJsonSchema(getShippingFulfillmentsInputSchema, 'getShippingFulfillmentsInput'),
|
|
364
516
|
getShippingFulfillmentsOutput: zodToJsonSchema(getShippingFulfillmentsOutputSchema, 'getShippingFulfillmentsOutput'),
|
|
517
|
+
getShippingFulfillmentInput: zodToJsonSchema(getShippingFulfillmentInputSchema, 'getShippingFulfillmentInput'),
|
|
518
|
+
getShippingFulfillmentOutput: zodToJsonSchema(getShippingFulfillmentOutputSchema, 'getShippingFulfillmentOutput'),
|
|
365
519
|
shippingFulfillmentDetails: zodToJsonSchema(shippingFulfillmentSchema, 'shippingFulfillmentDetails'),
|
|
366
520
|
// Refunds
|
|
367
521
|
issueRefundInput: zodToJsonSchema(issueRefundInputSchema, 'issueRefundInput'),
|
|
368
522
|
issueRefundOutput: zodToJsonSchema(issueRefundOutputSchema, 'issueRefundOutput'),
|
|
369
523
|
// Payment Disputes
|
|
370
|
-
|
|
371
|
-
|
|
524
|
+
getPaymentDisputeInput: zodToJsonSchema(getPaymentDisputeInputSchema, 'getPaymentDisputeInput'),
|
|
525
|
+
getActivitiesInput: zodToJsonSchema(getActivitiesInputSchema, 'getActivitiesInput'),
|
|
526
|
+
getPaymentDisputeSummariesInput: zodToJsonSchema(getPaymentDisputeSummariesInputSchema, 'getPaymentDisputeSummariesInput'),
|
|
527
|
+
getPaymentDisputeSummariesOutput: zodToJsonSchema(getPaymentDisputeSummariesOutputSchema, 'getPaymentDisputeSummariesOutput'),
|
|
528
|
+
acceptPaymentDisputeInput: zodToJsonSchema(acceptPaymentDisputeInputSchema, 'acceptPaymentDisputeInput'),
|
|
529
|
+
contestPaymentDisputeInput: zodToJsonSchema(contestPaymentDisputeInputSchema, 'contestPaymentDisputeInput'),
|
|
530
|
+
addEvidenceInput: zodToJsonSchema(addEvidenceInputSchema, 'addEvidenceInput'),
|
|
531
|
+
updateEvidenceInput: zodToJsonSchema(updateEvidenceInputSchema, 'updateEvidenceInput'),
|
|
532
|
+
uploadEvidenceFileInput: zodToJsonSchema(uploadEvidenceFileInputSchema, 'uploadEvidenceFileInput'),
|
|
533
|
+
fetchEvidenceContentInput: zodToJsonSchema(fetchEvidenceContentInputSchema, 'fetchEvidenceContentInput'),
|
|
372
534
|
paymentDisputeDetails: zodToJsonSchema(paymentDisputeSchema, 'paymentDisputeDetails'),
|
|
373
535
|
};
|
|
374
|
-
}
|
|
536
|
+
};
|
package/build/schemas/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Central export for all eBay MCP API Schemas
|
|
3
3
|
*
|
|
4
|
-
* This file provides convenient access to all
|
|
5
|
-
* for use with MCP (Model Context Protocol) tools.
|
|
4
|
+
* This file provides convenient access to all Effect-backed schemas and their
|
|
5
|
+
* JSON Schema conversions for use with MCP (Model Context Protocol) tools.
|
|
6
6
|
*
|
|
7
7
|
* Usage:
|
|
8
8
|
* ```typescript
|
|
@@ -34,10 +34,14 @@ export * from './marketing/marketing.js';
|
|
|
34
34
|
export * from './metadata/metadata.js';
|
|
35
35
|
// Analytics (Reports, Metrics, Standards)
|
|
36
36
|
export * from './analytics/analytics.js';
|
|
37
|
+
// Developer (Rate limits, client registration, signing keys)
|
|
38
|
+
export * from './developer/developer.js';
|
|
37
39
|
// Taxonomy (Categories, Suggestions, Aspects)
|
|
38
40
|
export * from './taxonomy/taxonomy.js';
|
|
39
41
|
// Other APIs (Identity, Compliance, VERO, Translation, eDelivery)
|
|
40
|
-
export * from './other/
|
|
42
|
+
export * from './other/otherApis.js';
|
|
43
|
+
// Finding / Browse (sold comps)
|
|
44
|
+
export * from './other/finding.js';
|
|
41
45
|
// Re-export commonly used schema converters
|
|
42
46
|
import { getAccountManagementJsonSchemas } from './account-management/account.js';
|
|
43
47
|
import { getInventoryManagementJsonSchemas } from './inventory-management/inventory.js';
|
|
@@ -46,23 +50,27 @@ import { getFulfillmentJsonSchemas } from './fulfillment/orders.js';
|
|
|
46
50
|
import { getMarketingJsonSchemas } from './marketing/marketing.js';
|
|
47
51
|
import { getMetadataJsonSchemas } from './metadata/metadata.js';
|
|
48
52
|
import { getAnalyticsJsonSchemas } from './analytics/analytics.js';
|
|
53
|
+
import { getDeveloperJsonSchemas } from './developer/developer.js';
|
|
49
54
|
import { getTaxonomyJsonSchemas } from './taxonomy/taxonomy.js';
|
|
50
|
-
import { getOtherApisJsonSchemas } from './other/
|
|
55
|
+
import { getOtherApisJsonSchemas } from './other/otherApis.js';
|
|
51
56
|
/**
|
|
52
|
-
*
|
|
57
|
+
* Gets all JSON schemas for all eBay APIs.
|
|
53
58
|
*
|
|
54
|
-
* @returns
|
|
59
|
+
* @returns JSON schemas organized by API category.
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* const schemas = getAllJsonSchemas();
|
|
63
|
+
* ```
|
|
55
64
|
*/
|
|
56
|
-
export
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
65
|
+
export const getAllJsonSchemas = () => ({
|
|
66
|
+
accountManagement: getAccountManagementJsonSchemas(),
|
|
67
|
+
inventoryManagement: getInventoryManagementJsonSchemas(),
|
|
68
|
+
communication: getCommunicationJsonSchemas(),
|
|
69
|
+
fulfillment: getFulfillmentJsonSchemas(),
|
|
70
|
+
marketing: getMarketingJsonSchemas(),
|
|
71
|
+
metadata: getMetadataJsonSchemas(),
|
|
72
|
+
analytics: getAnalyticsJsonSchemas(),
|
|
73
|
+
developer: getDeveloperJsonSchemas(),
|
|
74
|
+
taxonomy: getTaxonomyJsonSchemas(),
|
|
75
|
+
otherApis: getOtherApisJsonSchemas(),
|
|
76
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { z } from '
|
|
1
|
+
import { z } from '../../utils/effectSchema.js';
|
|
2
2
|
import { zodToJsonSchema } from 'zod-to-json-schema';
|
|
3
|
-
import { Condition, LengthUnit, WeightUnit, PricingVisibility, FormatType, LocationType, MerchantLocationStatus, DayOfWeek, MarketplaceId, } from '../../types/
|
|
3
|
+
import { Condition, LengthUnit, WeightUnit, PricingVisibility, FormatType, LocationType, MerchantLocationStatus, DayOfWeek, MarketplaceId, } from '../../types/ebayEnums.js';
|
|
4
4
|
/**
|
|
5
5
|
* Inventory Management API Schemas
|
|
6
6
|
*
|
|
7
|
-
* This file contains
|
|
7
|
+
* This file contains Effect-backed schemas for all Inventory Management endpoints.
|
|
8
8
|
* Schemas are organized by endpoint and include both input and output validation.
|
|
9
9
|
*/
|
|
10
10
|
// ============================================================================
|
|
@@ -149,7 +149,7 @@ export const getInventoryItemOutputSchema = inventoryItemSchema.extend({
|
|
|
149
149
|
*/
|
|
150
150
|
export const createInventoryItemInputSchema = z.object({
|
|
151
151
|
sku: z.string().describe('The seller-defined SKU value for the inventory item'),
|
|
152
|
-
|
|
152
|
+
body: inventoryItemSchema,
|
|
153
153
|
});
|
|
154
154
|
/**
|
|
155
155
|
* Validates the Inventory Management API create inventory item response payload.
|
|
@@ -243,9 +243,11 @@ export const offerResponseSchema = offerSchema.extend({
|
|
|
243
243
|
* Validates the Inventory Management API get offers request payload.
|
|
244
244
|
*/
|
|
245
245
|
export const getOffersInputSchema = z.object({
|
|
246
|
+
format: z.string().optional().describe('Filter offers by listing format'),
|
|
246
247
|
sku: z.string().optional().describe('Filter offers by SKU'),
|
|
247
248
|
marketplaceId: z.nativeEnum(MarketplaceId).optional().describe('Filter offers by marketplace'),
|
|
248
249
|
limit: z.number().optional().describe('Number of offers to return'),
|
|
250
|
+
offset: z.number().optional().describe('Number of offers to skip'),
|
|
249
251
|
});
|
|
250
252
|
/**
|
|
251
253
|
* Validates the Inventory Management API get offers response payload.
|
|
@@ -265,7 +267,7 @@ export const getOffersOutputSchema = z.object({
|
|
|
265
267
|
* Validates the Inventory Management API create offer request payload.
|
|
266
268
|
*/
|
|
267
269
|
export const createOfferInputSchema = z.object({
|
|
268
|
-
|
|
270
|
+
body: offerSchema,
|
|
269
271
|
});
|
|
270
272
|
/**
|
|
271
273
|
* Validates the Inventory Management API create offer response payload.
|
|
@@ -370,7 +372,7 @@ export const getInventoryLocationsOutputSchema = z.object({
|
|
|
370
372
|
*/
|
|
371
373
|
export const createInventoryLocationInputSchema = z.object({
|
|
372
374
|
merchantLocationKey: z.string().describe('Unique merchant-defined key for the location'),
|
|
373
|
-
|
|
375
|
+
body: locationSchema,
|
|
374
376
|
});
|
|
375
377
|
/**
|
|
376
378
|
* Validates the Inventory Management API create inventory location response payload.
|
|
@@ -521,9 +523,15 @@ export const bulkPublishResponseSchema = z.object({
|
|
|
521
523
|
// JSON Schema Conversion Functions
|
|
522
524
|
// ============================================================================
|
|
523
525
|
/**
|
|
524
|
-
*
|
|
526
|
+
* Converts Inventory Management API Effect-backed schemas to JSON Schema format for MCP tools.
|
|
527
|
+
*
|
|
528
|
+
* @returns Inventory Management API JSON schemas keyed by endpoint or shared model name.
|
|
529
|
+
* @example
|
|
530
|
+
* ```ts
|
|
531
|
+
* const schemas = getInventoryManagementJsonSchemas();
|
|
532
|
+
* ```
|
|
525
533
|
*/
|
|
526
|
-
export
|
|
534
|
+
export const getInventoryManagementJsonSchemas = () => {
|
|
527
535
|
return {
|
|
528
536
|
// Inventory Items
|
|
529
537
|
getInventoryItemsInput: zodToJsonSchema(getInventoryItemsInputSchema, 'getInventoryItemsInput'),
|
|
@@ -560,4 +568,4 @@ export function getInventoryManagementJsonSchemas() {
|
|
|
560
568
|
bulkPublishRequest: zodToJsonSchema(bulkPublishRequestSchema, 'bulkPublishRequest'),
|
|
561
569
|
bulkPublishResponse: zodToJsonSchema(bulkPublishResponseSchema, 'bulkPublishResponse'),
|
|
562
570
|
};
|
|
563
|
-
}
|
|
571
|
+
};
|