ebay-mcp 1.4.3
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/LICENSE +201 -0
- package/README.md +586 -0
- package/build/api/account-management/account.d.ts +216 -0
- package/build/api/account-management/account.js +305 -0
- package/build/api/analytics-and-report/analytics.d.ts +33 -0
- package/build/api/analytics-and-report/analytics.js +102 -0
- package/build/api/client.d.ts +89 -0
- package/build/api/client.js +343 -0
- package/build/api/communication/feedback.d.ts +45 -0
- package/build/api/communication/feedback.js +119 -0
- package/build/api/communication/message.d.ts +55 -0
- package/build/api/communication/message.js +131 -0
- package/build/api/communication/negotiation.d.ts +39 -0
- package/build/api/communication/negotiation.js +97 -0
- package/build/api/communication/notification.d.ts +128 -0
- package/build/api/communication/notification.js +373 -0
- package/build/api/index.d.ts +96 -0
- package/build/api/index.js +121 -0
- package/build/api/listing-management/inventory.d.ts +216 -0
- package/build/api/listing-management/inventory.js +633 -0
- package/build/api/listing-metadata/metadata.d.ts +154 -0
- package/build/api/listing-metadata/metadata.js +485 -0
- package/build/api/listing-metadata/taxonomy.d.ts +38 -0
- package/build/api/listing-metadata/taxonomy.js +58 -0
- package/build/api/marketing-and-promotions/marketing.d.ts +395 -0
- package/build/api/marketing-and-promotions/marketing.js +565 -0
- package/build/api/marketing-and-promotions/recommendation.d.ts +20 -0
- package/build/api/marketing-and-promotions/recommendation.js +32 -0
- package/build/api/order-management/dispute.d.ts +65 -0
- package/build/api/order-management/dispute.js +69 -0
- package/build/api/order-management/fulfillment.d.ts +80 -0
- package/build/api/order-management/fulfillment.js +89 -0
- package/build/api/other/compliance.d.ts +26 -0
- package/build/api/other/compliance.js +47 -0
- package/build/api/other/edelivery.d.ts +153 -0
- package/build/api/other/edelivery.js +219 -0
- package/build/api/other/identity.d.ts +17 -0
- package/build/api/other/identity.js +24 -0
- package/build/api/other/translation.d.ts +14 -0
- package/build/api/other/translation.js +22 -0
- package/build/api/other/vero.d.ts +30 -0
- package/build/api/other/vero.js +48 -0
- package/build/auth/oauth-metadata.d.ts +46 -0
- package/build/auth/oauth-metadata.js +59 -0
- package/build/auth/oauth-middleware.d.ts +35 -0
- package/build/auth/oauth-middleware.js +99 -0
- package/build/auth/oauth-types.d.ts +66 -0
- package/build/auth/oauth-types.js +4 -0
- package/build/auth/oauth.d.ts +93 -0
- package/build/auth/oauth.js +383 -0
- package/build/auth/scope-utils.d.ts +70 -0
- package/build/auth/scope-utils.js +304 -0
- package/build/auth/token-verifier.d.ts +57 -0
- package/build/auth/token-verifier.js +172 -0
- package/build/config/environment.d.ts +61 -0
- package/build/config/environment.js +260 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +98 -0
- package/build/schemas/account-management/account.d.ts +5324 -0
- package/build/schemas/account-management/account.js +366 -0
- package/build/schemas/analytics/analytics.d.ts +167 -0
- package/build/schemas/analytics/analytics.js +191 -0
- package/build/schemas/communication/messages.d.ts +1872 -0
- package/build/schemas/communication/messages.js +348 -0
- package/build/schemas/fulfillment/orders.d.ts +4655 -0
- package/build/schemas/fulfillment/orders.js +317 -0
- package/build/schemas/index.d.ts +2100 -0
- package/build/schemas/index.js +68 -0
- package/build/schemas/inventory-management/inventory.d.ts +6419 -0
- package/build/schemas/inventory-management/inventory.js +450 -0
- package/build/schemas/marketing/marketing.d.ts +14181 -0
- package/build/schemas/marketing/marketing.js +1088 -0
- package/build/schemas/metadata/metadata.d.ts +5259 -0
- package/build/schemas/metadata/metadata.js +614 -0
- package/build/schemas/other/other-apis.d.ts +257 -0
- package/build/schemas/other/other-apis.js +372 -0
- package/build/schemas/taxonomy/taxonomy.d.ts +215 -0
- package/build/schemas/taxonomy/taxonomy.js +571 -0
- package/build/scripts/auto-setup.d.ts +12 -0
- package/build/scripts/auto-setup.js +277 -0
- package/build/scripts/diagnostics.d.ts +8 -0
- package/build/scripts/diagnostics.js +299 -0
- package/build/scripts/download-specs.d.ts +1 -0
- package/build/scripts/download-specs.js +116 -0
- package/build/scripts/interactive-setup.d.ts +21 -0
- package/build/scripts/interactive-setup.js +723 -0
- package/build/server-http.d.ts +11 -0
- package/build/server-http.js +361 -0
- package/build/tools/definitions/account-with-schemas.d.ts +39 -0
- package/build/tools/definitions/account-with-schemas.js +170 -0
- package/build/tools/definitions/account.d.ts +12 -0
- package/build/tools/definitions/account.js +428 -0
- package/build/tools/definitions/analytics.d.ts +25 -0
- package/build/tools/definitions/analytics.js +66 -0
- package/build/tools/definitions/communication.d.ts +12 -0
- package/build/tools/definitions/communication.js +151 -0
- package/build/tools/definitions/fulfillment.d.ts +12 -0
- package/build/tools/definitions/fulfillment.js +326 -0
- package/build/tools/definitions/index.d.ts +25 -0
- package/build/tools/definitions/index.js +37 -0
- package/build/tools/definitions/inventory.d.ts +12 -0
- package/build/tools/definitions/inventory.js +429 -0
- package/build/tools/definitions/marketing.d.ts +12 -0
- package/build/tools/definitions/marketing.js +1095 -0
- package/build/tools/definitions/metadata.d.ts +12 -0
- package/build/tools/definitions/metadata.js +188 -0
- package/build/tools/definitions/other.d.ts +13 -0
- package/build/tools/definitions/other.js +309 -0
- package/build/tools/definitions/taxonomy.d.ts +25 -0
- package/build/tools/definitions/taxonomy.js +64 -0
- package/build/tools/definitions/token-management.d.ts +35 -0
- package/build/tools/definitions/token-management.js +103 -0
- package/build/tools/index.d.ts +11 -0
- package/build/tools/index.js +1003 -0
- package/build/tools/schemas.d.ts +14764 -0
- package/build/tools/schemas.js +667 -0
- package/build/tools/tool-definitions.d.ts +35 -0
- package/build/tools/tool-definitions.js +3534 -0
- package/build/types/application-settings/developerAnalyticsV1BetaOas3.d.ts +197 -0
- package/build/types/application-settings/developerAnalyticsV1BetaOas3.js +5 -0
- package/build/types/application-settings/developerClientRegistrationV1Oas3.d.ts +155 -0
- package/build/types/application-settings/developerClientRegistrationV1Oas3.js +5 -0
- package/build/types/application-settings/developerKeyManagementV1Oas3.d.ts +246 -0
- package/build/types/application-settings/developerKeyManagementV1Oas3.js +5 -0
- package/build/types/ebay-enums.d.ts +1204 -0
- package/build/types/ebay-enums.js +1330 -0
- package/build/types/ebay.d.ts +143 -0
- package/build/types/ebay.js +123 -0
- package/build/types/index.d.ts +6 -0
- package/build/types/index.js +10 -0
- package/build/types/sell-apps/account-management/sellAccountV1Oas3.d.ts +2579 -0
- package/build/types/sell-apps/account-management/sellAccountV1Oas3.js +5 -0
- package/build/types/sell-apps/analytics-and-report/sellAnalyticsV1Oas3.d.ts +446 -0
- package/build/types/sell-apps/analytics-and-report/sellAnalyticsV1Oas3.js +5 -0
- package/build/types/sell-apps/communication/commerceFeedbackV1BetaOas3.d.ts +705 -0
- package/build/types/sell-apps/communication/commerceFeedbackV1BetaOas3.js +5 -0
- package/build/types/sell-apps/communication/commerceMessageV1Oas3.d.ts +590 -0
- package/build/types/sell-apps/communication/commerceMessageV1Oas3.js +5 -0
- package/build/types/sell-apps/communication/commerceNotificationV1Oas3.d.ts +1276 -0
- package/build/types/sell-apps/communication/commerceNotificationV1Oas3.js +5 -0
- package/build/types/sell-apps/communication/sellNegotiationV1Oas3.d.ts +277 -0
- package/build/types/sell-apps/communication/sellNegotiationV1Oas3.js +5 -0
- package/build/types/sell-apps/listing-management/sellInventoryV1Oas3.d.ts +3133 -0
- package/build/types/sell-apps/listing-management/sellInventoryV1Oas3.js +5 -0
- package/build/types/sell-apps/listing-metadata/sellMetadataV1Oas3.d.ts +2289 -0
- package/build/types/sell-apps/listing-metadata/sellMetadataV1Oas3.js +5 -0
- package/build/types/sell-apps/markeitng-and-promotions/sellMarketingV1Oas3.d.ts +6650 -0
- package/build/types/sell-apps/markeitng-and-promotions/sellMarketingV1Oas3.js +5 -0
- package/build/types/sell-apps/markeitng-and-promotions/sellRecommendationV1Oas3.d.ts +172 -0
- package/build/types/sell-apps/markeitng-and-promotions/sellRecommendationV1Oas3.js +5 -0
- package/build/types/sell-apps/order-management/sellFulfillmentV1Oas3.d.ts +1869 -0
- package/build/types/sell-apps/order-management/sellFulfillmentV1Oas3.js +5 -0
- package/build/types/sell-apps/other-apis/commerceIdentityV1Oas3.d.ts +178 -0
- package/build/types/sell-apps/other-apis/commerceIdentityV1Oas3.js +5 -0
- package/build/types/sell-apps/other-apis/commerceTranslationV1BetaOas3.d.ts +128 -0
- package/build/types/sell-apps/other-apis/commerceTranslationV1BetaOas3.js +5 -0
- package/build/types/sell-apps/other-apis/commerceVeroV1Oas3.d.ts +417 -0
- package/build/types/sell-apps/other-apis/commerceVeroV1Oas3.js +5 -0
- package/build/types/sell-apps/other-apis/sellComplianceV1Oas3.d.ts +273 -0
- package/build/types/sell-apps/other-apis/sellComplianceV1Oas3.js +5 -0
- package/build/types/sell-apps/other-apis/sellEdeliveryInternationalShippingOas3.d.ts +2537 -0
- package/build/types/sell-apps/other-apis/sellEdeliveryInternationalShippingOas3.js +5 -0
- package/build/types/sell-apps/other-apis/sellMarketingV1Oas3.d.ts +6650 -0
- package/build/types/sell-apps/other-apis/sellMarketingV1Oas3.js +5 -0
- package/build/types/sell-apps/other-apis/sellRecommendationV1Oas3.d.ts +172 -0
- package/build/types/sell-apps/other-apis/sellRecommendationV1Oas3.js +5 -0
- package/build/utils/account-management/account.d.ts +1094 -0
- package/build/utils/account-management/account.js +831 -0
- package/build/utils/communication/feedback.d.ts +152 -0
- package/build/utils/communication/feedback.js +216 -0
- package/build/utils/communication/message.d.ts +174 -0
- package/build/utils/communication/message.js +242 -0
- package/build/utils/communication/negotiation.d.ts +123 -0
- package/build/utils/communication/negotiation.js +150 -0
- package/build/utils/communication/notification.d.ts +370 -0
- package/build/utils/communication/notification.js +369 -0
- package/build/utils/date-converter.d.ts +59 -0
- package/build/utils/date-converter.js +160 -0
- package/build/utils/llm-client-detector.d.ts +54 -0
- package/build/utils/llm-client-detector.js +318 -0
- package/build/utils/oauth-helper.d.ts +37 -0
- package/build/utils/oauth-helper.js +315 -0
- package/build/utils/order-management/dispute.d.ts +346 -0
- package/build/utils/order-management/dispute.js +369 -0
- package/build/utils/order-management/fulfillment.d.ts +200 -0
- package/build/utils/order-management/fulfillment.js +205 -0
- package/build/utils/other/compliance.d.ts +49 -0
- package/build/utils/other/compliance.js +76 -0
- package/build/utils/other/edelivery.d.ts +310 -0
- package/build/utils/other/edelivery.js +241 -0
- package/build/utils/other/identity.d.ts +13 -0
- package/build/utils/other/identity.js +13 -0
- package/build/utils/other/translation.d.ts +28 -0
- package/build/utils/other/translation.js +41 -0
- package/build/utils/other/vero.d.ts +61 -0
- package/build/utils/other/vero.js +90 -0
- package/build/utils/scope-helper.d.ts +49 -0
- package/build/utils/scope-helper.js +207 -0
- package/build/utils/security-checker.d.ts +46 -0
- package/build/utils/security-checker.js +248 -0
- package/build/utils/setup-validator.d.ts +25 -0
- package/build/utils/setup-validator.js +305 -0
- package/build/utils/token-utils.d.ts +40 -0
- package/build/utils/token-utils.js +40 -0
- package/package.json +115 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Zod schemas for Message API input validation
|
|
4
|
+
* Based on: src/api/communication/message.ts
|
|
5
|
+
* OpenAPI spec: docs/sell-apps/communication/commerce_message_v1_oas3.json
|
|
6
|
+
* Types from: src/types/commerce_message_v1_oas3.ts
|
|
7
|
+
*/
|
|
8
|
+
// Reusable schema for filter parameter
|
|
9
|
+
const _filterSchema = z
|
|
10
|
+
.string({
|
|
11
|
+
message: 'Filter must be a string',
|
|
12
|
+
invalid_type_error: 'filter must be a string',
|
|
13
|
+
description: 'Filter criteria for the query',
|
|
14
|
+
})
|
|
15
|
+
.optional();
|
|
16
|
+
// Reusable schema for limit parameter (string in API)
|
|
17
|
+
const limitSchema = z
|
|
18
|
+
.string({
|
|
19
|
+
invalid_type_error: 'limit must be a string',
|
|
20
|
+
description: 'Maximum number of items to return (25-50)',
|
|
21
|
+
})
|
|
22
|
+
.optional();
|
|
23
|
+
// Reusable schema for offset parameter (string in API)
|
|
24
|
+
const offsetSchema = z
|
|
25
|
+
.string({
|
|
26
|
+
invalid_type_error: 'offset must be a string',
|
|
27
|
+
description: 'Number of items to skip',
|
|
28
|
+
})
|
|
29
|
+
.optional();
|
|
30
|
+
/**
|
|
31
|
+
* Schema for bulkUpdateConversation method
|
|
32
|
+
* Endpoint: POST /bulk_update_conversation
|
|
33
|
+
* Body: BulkUpdateConversationsRequest - conversations array
|
|
34
|
+
*/
|
|
35
|
+
export const bulkUpdateConversationSchema = z.object({
|
|
36
|
+
conversations: z
|
|
37
|
+
.array(z.object({
|
|
38
|
+
conversation_id: z
|
|
39
|
+
.string({
|
|
40
|
+
invalid_type_error: 'conversation_id must be a string',
|
|
41
|
+
description: 'The unique identifier of the conversation',
|
|
42
|
+
})
|
|
43
|
+
.optional(),
|
|
44
|
+
conversation_status: z
|
|
45
|
+
.string({
|
|
46
|
+
invalid_type_error: 'conversation_status must be a string',
|
|
47
|
+
description: 'The updated status: ACTIVE, ARCHIVE, DELETE, READ, UNREAD',
|
|
48
|
+
})
|
|
49
|
+
.optional(),
|
|
50
|
+
conversation_type: z
|
|
51
|
+
.string({
|
|
52
|
+
invalid_type_error: 'conversation_type must be a string',
|
|
53
|
+
description: 'The existing type: FROM_MEMBERS or FROM_EBAY (required but cannot be updated)',
|
|
54
|
+
})
|
|
55
|
+
.optional(),
|
|
56
|
+
}), {
|
|
57
|
+
invalid_type_error: 'conversations must be an array',
|
|
58
|
+
description: 'Array of conversations to update',
|
|
59
|
+
})
|
|
60
|
+
.optional(),
|
|
61
|
+
});
|
|
62
|
+
/**
|
|
63
|
+
* Schema for getConversations method
|
|
64
|
+
* Endpoint: GET /conversation
|
|
65
|
+
* Params: GetConversationsParams - conversation_type (required), conversation_status, end_time, limit, offset, other_party_username, reference_id, reference_type, start_time
|
|
66
|
+
*/
|
|
67
|
+
export const getConversationsSchema = z.object({
|
|
68
|
+
conversation_type: z.string({
|
|
69
|
+
message: 'Conversation type is required',
|
|
70
|
+
required_error: 'conversation_type is required',
|
|
71
|
+
invalid_type_error: 'conversation_type must be a string',
|
|
72
|
+
description: 'Type of conversation: FROM_EBAY or FROM_MEMBERS',
|
|
73
|
+
}),
|
|
74
|
+
conversation_status: z
|
|
75
|
+
.string({
|
|
76
|
+
invalid_type_error: 'conversation_status must be a string',
|
|
77
|
+
description: 'Filter by status: ACTIVE, ARCHIVE, DELETE, READ, UNREAD',
|
|
78
|
+
})
|
|
79
|
+
.optional(),
|
|
80
|
+
end_time: z
|
|
81
|
+
.string({
|
|
82
|
+
invalid_type_error: 'end_time must be a string',
|
|
83
|
+
description: 'End time for retrieving conversations (ISO 8601 format)',
|
|
84
|
+
})
|
|
85
|
+
.optional(),
|
|
86
|
+
limit: limitSchema,
|
|
87
|
+
offset: offsetSchema,
|
|
88
|
+
other_party_username: z
|
|
89
|
+
.string({
|
|
90
|
+
invalid_type_error: 'other_party_username must be a string',
|
|
91
|
+
description: 'Filter by specific eBay user',
|
|
92
|
+
})
|
|
93
|
+
.optional(),
|
|
94
|
+
reference_id: z
|
|
95
|
+
.string({
|
|
96
|
+
invalid_type_error: 'reference_id must be a string',
|
|
97
|
+
description: 'Filter by reference ID (e.g., listing ID)',
|
|
98
|
+
})
|
|
99
|
+
.optional(),
|
|
100
|
+
reference_type: z
|
|
101
|
+
.string({
|
|
102
|
+
invalid_type_error: 'reference_type must be a string',
|
|
103
|
+
description: 'Reference type (currently only LISTING is supported)',
|
|
104
|
+
})
|
|
105
|
+
.optional(),
|
|
106
|
+
start_time: z
|
|
107
|
+
.string({
|
|
108
|
+
invalid_type_error: 'start_time must be a string',
|
|
109
|
+
description: 'Start time for retrieving conversations (ISO 8601 format)',
|
|
110
|
+
})
|
|
111
|
+
.optional(),
|
|
112
|
+
});
|
|
113
|
+
/**
|
|
114
|
+
* Schema for getConversation method
|
|
115
|
+
* Endpoint: GET /conversation/{conversation_id}
|
|
116
|
+
* Path: conversation_id (required)
|
|
117
|
+
* Query: conversation_type (required), limit, offset
|
|
118
|
+
*/
|
|
119
|
+
export const getConversationSchema = z.object({
|
|
120
|
+
conversation_id: z.string({
|
|
121
|
+
message: 'Conversation ID is required',
|
|
122
|
+
required_error: 'conversation_id is required',
|
|
123
|
+
invalid_type_error: 'conversation_id must be a string',
|
|
124
|
+
description: 'The unique identifier for the conversation',
|
|
125
|
+
}),
|
|
126
|
+
conversation_type: z.string({
|
|
127
|
+
message: 'Conversation type is required',
|
|
128
|
+
required_error: 'conversation_type is required',
|
|
129
|
+
invalid_type_error: 'conversation_type must be a string',
|
|
130
|
+
description: 'Type of conversation: FROM_EBAY or FROM_MEMBERS',
|
|
131
|
+
}),
|
|
132
|
+
limit: limitSchema,
|
|
133
|
+
offset: offsetSchema,
|
|
134
|
+
});
|
|
135
|
+
/**
|
|
136
|
+
* Schema for sendMessage method
|
|
137
|
+
* Endpoint: POST /send_message
|
|
138
|
+
* Body: SendMessageRequest - conversationId, emailCopyToSender, messageMedia, messageText, otherPartyUsername, reference
|
|
139
|
+
*/
|
|
140
|
+
export const sendMessageSchema = z.object({
|
|
141
|
+
conversation_id: z
|
|
142
|
+
.string({
|
|
143
|
+
invalid_type_error: 'conversation_id must be a string',
|
|
144
|
+
description: 'ID of existing conversation (required if sending in existing conversation)',
|
|
145
|
+
})
|
|
146
|
+
.optional(),
|
|
147
|
+
email_copy_to_sender: z
|
|
148
|
+
.boolean({
|
|
149
|
+
invalid_type_error: 'email_copy_to_sender must be a boolean',
|
|
150
|
+
description: 'Whether to email a copy to the sender',
|
|
151
|
+
})
|
|
152
|
+
.optional(),
|
|
153
|
+
message_media: z
|
|
154
|
+
.array(z.object({
|
|
155
|
+
media_name: z
|
|
156
|
+
.string({
|
|
157
|
+
invalid_type_error: 'media_name must be a string',
|
|
158
|
+
description: 'Name of the media',
|
|
159
|
+
})
|
|
160
|
+
.optional(),
|
|
161
|
+
media_type: z
|
|
162
|
+
.string({
|
|
163
|
+
invalid_type_error: 'media_type must be a string',
|
|
164
|
+
description: 'Type of media: IMAGE, PDF, DOC, TXT',
|
|
165
|
+
})
|
|
166
|
+
.optional(),
|
|
167
|
+
media_url: z
|
|
168
|
+
.string({
|
|
169
|
+
invalid_type_error: 'media_url must be a string',
|
|
170
|
+
description: 'HTTPS URL of the self-hosted media',
|
|
171
|
+
})
|
|
172
|
+
.optional(),
|
|
173
|
+
}), {
|
|
174
|
+
invalid_type_error: 'message_media must be an array',
|
|
175
|
+
description: 'Array of up to 5 media attachments',
|
|
176
|
+
})
|
|
177
|
+
.max(5, 'Maximum 5 media attachments allowed')
|
|
178
|
+
.optional(),
|
|
179
|
+
message_text: z
|
|
180
|
+
.string({
|
|
181
|
+
invalid_type_error: 'message_text must be a string',
|
|
182
|
+
description: 'The text of the message (max 2000 characters)',
|
|
183
|
+
})
|
|
184
|
+
.max(2000, 'message_text must be 2000 characters or less')
|
|
185
|
+
.optional(),
|
|
186
|
+
other_party_username: z
|
|
187
|
+
.string({
|
|
188
|
+
invalid_type_error: 'other_party_username must be a string',
|
|
189
|
+
description: 'eBay username to send message to (required for new conversations)',
|
|
190
|
+
})
|
|
191
|
+
.optional(),
|
|
192
|
+
reference: z
|
|
193
|
+
.object({
|
|
194
|
+
reference_id: z
|
|
195
|
+
.string({
|
|
196
|
+
invalid_type_error: 'reference_id must be a string',
|
|
197
|
+
description: 'The reference ID (e.g., item ID for LISTING)',
|
|
198
|
+
})
|
|
199
|
+
.optional(),
|
|
200
|
+
reference_type: z
|
|
201
|
+
.string({
|
|
202
|
+
invalid_type_error: 'reference_type must be a string',
|
|
203
|
+
description: 'The reference type (currently only LISTING is supported)',
|
|
204
|
+
})
|
|
205
|
+
.optional(),
|
|
206
|
+
}, {
|
|
207
|
+
invalid_type_error: 'reference must be an object',
|
|
208
|
+
description: 'Reference to associate with the conversation',
|
|
209
|
+
})
|
|
210
|
+
.optional(),
|
|
211
|
+
});
|
|
212
|
+
/**
|
|
213
|
+
* Schema for updateConversation method
|
|
214
|
+
* Endpoint: POST /update_conversation
|
|
215
|
+
* Body: UpdateConversationRequest - conversationId, conversationStatus, conversationType, read
|
|
216
|
+
*/
|
|
217
|
+
export const updateConversationSchema = z.object({
|
|
218
|
+
conversation_id: z
|
|
219
|
+
.string({
|
|
220
|
+
invalid_type_error: 'conversation_id must be a string',
|
|
221
|
+
description: 'The unique identifier of the conversation',
|
|
222
|
+
})
|
|
223
|
+
.optional(),
|
|
224
|
+
conversation_status: z
|
|
225
|
+
.string({
|
|
226
|
+
invalid_type_error: 'conversation_status must be a string',
|
|
227
|
+
description: 'The updated status: ACTIVE, ARCHIVE, DELETE',
|
|
228
|
+
})
|
|
229
|
+
.optional(),
|
|
230
|
+
conversation_type: z
|
|
231
|
+
.string({
|
|
232
|
+
invalid_type_error: 'conversation_type must be a string',
|
|
233
|
+
description: 'The existing type: FROM_MEMBERS or FROM_EBAY (required but cannot be updated)',
|
|
234
|
+
})
|
|
235
|
+
.optional(),
|
|
236
|
+
read: z
|
|
237
|
+
.boolean({
|
|
238
|
+
invalid_type_error: 'read must be a boolean',
|
|
239
|
+
description: 'The read status to set (true = read, false = unread)',
|
|
240
|
+
})
|
|
241
|
+
.optional(),
|
|
242
|
+
});
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Schema for findEligibleItems method
|
|
4
|
+
* Endpoint: GET /find_eligible_items
|
|
5
|
+
* Query Params: FindEligibleItemsParams - limit, offset
|
|
6
|
+
* Headers: X-EBAY-C-MARKETPLACE-ID (required)
|
|
7
|
+
*/
|
|
8
|
+
export declare const findEligibleItemsSchema: z.ZodObject<{
|
|
9
|
+
limit: z.ZodOptional<z.ZodString>;
|
|
10
|
+
offset: z.ZodOptional<z.ZodString>;
|
|
11
|
+
marketplace_id: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
marketplace_id?: string | undefined;
|
|
14
|
+
limit?: string | undefined;
|
|
15
|
+
offset?: string | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
marketplace_id?: string | undefined;
|
|
18
|
+
limit?: string | undefined;
|
|
19
|
+
offset?: string | undefined;
|
|
20
|
+
}>;
|
|
21
|
+
/**
|
|
22
|
+
* Schema for sendOfferToInterestedBuyers method
|
|
23
|
+
* Endpoint: POST /send_offer_to_interested_buyers
|
|
24
|
+
* Body: CreateOffersRequest - allowCounterOffer, message, offerDuration, offeredItems
|
|
25
|
+
* Headers: X-EBAY-C-MARKETPLACE-ID (required)
|
|
26
|
+
*/
|
|
27
|
+
export declare const sendOfferToInterestedBuyersSchema: z.ZodObject<{
|
|
28
|
+
allow_counter_offer: z.ZodOptional<z.ZodBoolean>;
|
|
29
|
+
message: z.ZodOptional<z.ZodString>;
|
|
30
|
+
offer_duration: z.ZodOptional<z.ZodObject<{
|
|
31
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
32
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
value?: number | undefined;
|
|
35
|
+
unit?: string | undefined;
|
|
36
|
+
}, {
|
|
37
|
+
value?: number | undefined;
|
|
38
|
+
unit?: string | undefined;
|
|
39
|
+
}>>;
|
|
40
|
+
offered_items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
41
|
+
discount_percentage: z.ZodOptional<z.ZodString>;
|
|
42
|
+
listing_id: z.ZodOptional<z.ZodString>;
|
|
43
|
+
price: z.ZodOptional<z.ZodObject<{
|
|
44
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
45
|
+
value: z.ZodOptional<z.ZodString>;
|
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
|
47
|
+
value?: string | undefined;
|
|
48
|
+
currency?: string | undefined;
|
|
49
|
+
}, {
|
|
50
|
+
value?: string | undefined;
|
|
51
|
+
currency?: string | undefined;
|
|
52
|
+
}>>;
|
|
53
|
+
quantity: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
}, "strip", z.ZodTypeAny, {
|
|
55
|
+
listing_id?: string | undefined;
|
|
56
|
+
quantity?: number | undefined;
|
|
57
|
+
price?: {
|
|
58
|
+
value?: string | undefined;
|
|
59
|
+
currency?: string | undefined;
|
|
60
|
+
} | undefined;
|
|
61
|
+
discount_percentage?: string | undefined;
|
|
62
|
+
}, {
|
|
63
|
+
listing_id?: string | undefined;
|
|
64
|
+
quantity?: number | undefined;
|
|
65
|
+
price?: {
|
|
66
|
+
value?: string | undefined;
|
|
67
|
+
currency?: string | undefined;
|
|
68
|
+
} | undefined;
|
|
69
|
+
discount_percentage?: string | undefined;
|
|
70
|
+
}>, "many">>;
|
|
71
|
+
marketplace_id: z.ZodOptional<z.ZodString>;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
message?: string | undefined;
|
|
74
|
+
marketplace_id?: string | undefined;
|
|
75
|
+
allow_counter_offer?: boolean | undefined;
|
|
76
|
+
offer_duration?: {
|
|
77
|
+
value?: number | undefined;
|
|
78
|
+
unit?: string | undefined;
|
|
79
|
+
} | undefined;
|
|
80
|
+
offered_items?: {
|
|
81
|
+
listing_id?: string | undefined;
|
|
82
|
+
quantity?: number | undefined;
|
|
83
|
+
price?: {
|
|
84
|
+
value?: string | undefined;
|
|
85
|
+
currency?: string | undefined;
|
|
86
|
+
} | undefined;
|
|
87
|
+
discount_percentage?: string | undefined;
|
|
88
|
+
}[] | undefined;
|
|
89
|
+
}, {
|
|
90
|
+
message?: string | undefined;
|
|
91
|
+
marketplace_id?: string | undefined;
|
|
92
|
+
allow_counter_offer?: boolean | undefined;
|
|
93
|
+
offer_duration?: {
|
|
94
|
+
value?: number | undefined;
|
|
95
|
+
unit?: string | undefined;
|
|
96
|
+
} | undefined;
|
|
97
|
+
offered_items?: {
|
|
98
|
+
listing_id?: string | undefined;
|
|
99
|
+
quantity?: number | undefined;
|
|
100
|
+
price?: {
|
|
101
|
+
value?: string | undefined;
|
|
102
|
+
currency?: string | undefined;
|
|
103
|
+
} | undefined;
|
|
104
|
+
discount_percentage?: string | undefined;
|
|
105
|
+
}[] | undefined;
|
|
106
|
+
}>;
|
|
107
|
+
/**
|
|
108
|
+
* Schema for getOffersToBuyers method (deprecated)
|
|
109
|
+
* Note: This method does not match any endpoint in the OpenAPI spec
|
|
110
|
+
*/
|
|
111
|
+
export declare const getOffersToBuyersSchema: z.ZodObject<{
|
|
112
|
+
filter: z.ZodOptional<z.ZodString>;
|
|
113
|
+
limit: z.ZodOptional<z.ZodString>;
|
|
114
|
+
offset: z.ZodOptional<z.ZodString>;
|
|
115
|
+
}, "strip", z.ZodTypeAny, {
|
|
116
|
+
filter?: string | undefined;
|
|
117
|
+
limit?: string | undefined;
|
|
118
|
+
offset?: string | undefined;
|
|
119
|
+
}, {
|
|
120
|
+
filter?: string | undefined;
|
|
121
|
+
limit?: string | undefined;
|
|
122
|
+
offset?: string | undefined;
|
|
123
|
+
}>;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Zod schemas for Negotiation API input validation
|
|
4
|
+
* Based on: src/api/communication/negotiation.ts
|
|
5
|
+
* OpenAPI spec: docs/sell-apps/communication/sell_negotiation_v1_oas3.json
|
|
6
|
+
* Types from: src/types/sell_negotiation_v1_oas3.ts
|
|
7
|
+
*/
|
|
8
|
+
// Reusable schema for filter parameter
|
|
9
|
+
const filterSchema = z
|
|
10
|
+
.string({
|
|
11
|
+
message: 'Filter must be a string',
|
|
12
|
+
invalid_type_error: 'filter must be a string',
|
|
13
|
+
description: 'Filter criteria for the query',
|
|
14
|
+
})
|
|
15
|
+
.optional();
|
|
16
|
+
// Reusable schema for limit parameter (string in API)
|
|
17
|
+
const limitSchema = z
|
|
18
|
+
.string({
|
|
19
|
+
invalid_type_error: 'limit must be a string',
|
|
20
|
+
description: 'Maximum number of items to return (1-200)',
|
|
21
|
+
})
|
|
22
|
+
.optional();
|
|
23
|
+
// Reusable schema for offset parameter (string in API)
|
|
24
|
+
const offsetSchema = z
|
|
25
|
+
.string({
|
|
26
|
+
invalid_type_error: 'offset must be a string',
|
|
27
|
+
description: 'Number of items to skip',
|
|
28
|
+
})
|
|
29
|
+
.optional();
|
|
30
|
+
/**
|
|
31
|
+
* Schema for findEligibleItems method
|
|
32
|
+
* Endpoint: GET /find_eligible_items
|
|
33
|
+
* Query Params: FindEligibleItemsParams - limit, offset
|
|
34
|
+
* Headers: X-EBAY-C-MARKETPLACE-ID (required)
|
|
35
|
+
*/
|
|
36
|
+
export const findEligibleItemsSchema = z.object({
|
|
37
|
+
limit: limitSchema,
|
|
38
|
+
offset: offsetSchema,
|
|
39
|
+
marketplace_id: z
|
|
40
|
+
.string({
|
|
41
|
+
invalid_type_error: 'marketplace_id must be a string',
|
|
42
|
+
description: 'The eBay marketplace ID (X-EBAY-C-MARKETPLACE-ID header)',
|
|
43
|
+
})
|
|
44
|
+
.optional(),
|
|
45
|
+
});
|
|
46
|
+
/**
|
|
47
|
+
* Schema for sendOfferToInterestedBuyers method
|
|
48
|
+
* Endpoint: POST /send_offer_to_interested_buyers
|
|
49
|
+
* Body: CreateOffersRequest - allowCounterOffer, message, offerDuration, offeredItems
|
|
50
|
+
* Headers: X-EBAY-C-MARKETPLACE-ID (required)
|
|
51
|
+
*/
|
|
52
|
+
export const sendOfferToInterestedBuyersSchema = z.object({
|
|
53
|
+
allow_counter_offer: z
|
|
54
|
+
.boolean({
|
|
55
|
+
invalid_type_error: 'allow_counter_offer must be a boolean',
|
|
56
|
+
description: 'Whether to allow counter-offers (currently must be false)',
|
|
57
|
+
})
|
|
58
|
+
.optional(),
|
|
59
|
+
message: z
|
|
60
|
+
.string({
|
|
61
|
+
invalid_type_error: 'message must be a string',
|
|
62
|
+
description: 'Seller-defined message to buyers (max 2000 characters)',
|
|
63
|
+
})
|
|
64
|
+
.max(2000, 'message must be 2000 characters or less')
|
|
65
|
+
.optional(),
|
|
66
|
+
offer_duration: z
|
|
67
|
+
.object({
|
|
68
|
+
unit: z
|
|
69
|
+
.string({
|
|
70
|
+
invalid_type_error: 'unit must be a string',
|
|
71
|
+
description: 'Time unit (currently must be DAY)',
|
|
72
|
+
})
|
|
73
|
+
.optional(),
|
|
74
|
+
value: z
|
|
75
|
+
.number({
|
|
76
|
+
invalid_type_error: 'value must be a number',
|
|
77
|
+
description: 'Duration value (currently must be 2)',
|
|
78
|
+
})
|
|
79
|
+
.int({
|
|
80
|
+
message: 'value must be an integer',
|
|
81
|
+
})
|
|
82
|
+
.optional(),
|
|
83
|
+
}, {
|
|
84
|
+
invalid_type_error: 'offer_duration must be an object',
|
|
85
|
+
description: 'Duration the offer is valid (default: 2 days)',
|
|
86
|
+
})
|
|
87
|
+
.optional(),
|
|
88
|
+
offered_items: z
|
|
89
|
+
.array(z.object({
|
|
90
|
+
discount_percentage: z
|
|
91
|
+
.string({
|
|
92
|
+
invalid_type_error: 'discount_percentage must be a string',
|
|
93
|
+
description: 'Percentage discount (minimum 5)',
|
|
94
|
+
})
|
|
95
|
+
.optional(),
|
|
96
|
+
listing_id: z
|
|
97
|
+
.string({
|
|
98
|
+
invalid_type_error: 'listing_id must be a string',
|
|
99
|
+
description: 'The unique eBay listing ID',
|
|
100
|
+
})
|
|
101
|
+
.optional(),
|
|
102
|
+
price: z
|
|
103
|
+
.object({
|
|
104
|
+
currency: z
|
|
105
|
+
.string({
|
|
106
|
+
invalid_type_error: 'currency must be a string',
|
|
107
|
+
description: '3-letter ISO 4217 currency code',
|
|
108
|
+
})
|
|
109
|
+
.optional(),
|
|
110
|
+
value: z
|
|
111
|
+
.string({
|
|
112
|
+
invalid_type_error: 'value must be a string',
|
|
113
|
+
description: 'The monetary amount',
|
|
114
|
+
})
|
|
115
|
+
.optional(),
|
|
116
|
+
}, {
|
|
117
|
+
invalid_type_error: 'price must be an object',
|
|
118
|
+
description: 'The discounted price',
|
|
119
|
+
})
|
|
120
|
+
.optional(),
|
|
121
|
+
quantity: z
|
|
122
|
+
.number({
|
|
123
|
+
invalid_type_error: 'quantity must be a number',
|
|
124
|
+
description: 'Number of items (all-or-nothing offer)',
|
|
125
|
+
})
|
|
126
|
+
.int({
|
|
127
|
+
message: 'quantity must be an integer',
|
|
128
|
+
})
|
|
129
|
+
.optional(),
|
|
130
|
+
}), {
|
|
131
|
+
invalid_type_error: 'offered_items must be an array',
|
|
132
|
+
description: 'Array of items to offer (currently limited to one item)',
|
|
133
|
+
})
|
|
134
|
+
.optional(),
|
|
135
|
+
marketplace_id: z
|
|
136
|
+
.string({
|
|
137
|
+
invalid_type_error: 'marketplace_id must be a string',
|
|
138
|
+
description: 'The eBay marketplace ID (X-EBAY-C-MARKETPLACE-ID header)',
|
|
139
|
+
})
|
|
140
|
+
.optional(),
|
|
141
|
+
});
|
|
142
|
+
/**
|
|
143
|
+
* Schema for getOffersToBuyers method (deprecated)
|
|
144
|
+
* Note: This method does not match any endpoint in the OpenAPI spec
|
|
145
|
+
*/
|
|
146
|
+
export const getOffersToBuyersSchema = z.object({
|
|
147
|
+
filter: filterSchema,
|
|
148
|
+
limit: limitSchema,
|
|
149
|
+
offset: offsetSchema,
|
|
150
|
+
});
|