ebay-mcp-remote-edition 1.0.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 (129) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +755 -0
  3. package/build/api/account-management/account.js +301 -0
  4. package/build/api/analytics-and-report/analytics.js +102 -0
  5. package/build/api/client-trading.js +96 -0
  6. package/build/api/client.js +173 -0
  7. package/build/api/communication/feedback.js +119 -0
  8. package/build/api/communication/message.js +131 -0
  9. package/build/api/communication/negotiation.js +97 -0
  10. package/build/api/communication/notification.js +373 -0
  11. package/build/api/developer/developer.js +81 -0
  12. package/build/api/index.js +109 -0
  13. package/build/api/listing-management/inventory.js +640 -0
  14. package/build/api/listing-metadata/metadata.js +485 -0
  15. package/build/api/listing-metadata/taxonomy.js +58 -0
  16. package/build/api/marketing-and-promotions/marketing.js +768 -0
  17. package/build/api/marketing-and-promotions/recommendation.js +32 -0
  18. package/build/api/order-management/dispute.js +69 -0
  19. package/build/api/order-management/fulfillment.js +89 -0
  20. package/build/api/other/compliance.js +47 -0
  21. package/build/api/other/edelivery.js +219 -0
  22. package/build/api/other/identity.js +24 -0
  23. package/build/api/other/translation.js +22 -0
  24. package/build/api/other/vero.js +48 -0
  25. package/build/api/trading/trading.js +78 -0
  26. package/build/auth/kv-store.js +40 -0
  27. package/build/auth/multi-user-store.js +120 -0
  28. package/build/auth/oauth-metadata.js +59 -0
  29. package/build/auth/oauth-middleware.js +99 -0
  30. package/build/auth/oauth-types.js +4 -0
  31. package/build/auth/oauth.js +235 -0
  32. package/build/auth/scope-utils.js +304 -0
  33. package/build/auth/token-store.js +46 -0
  34. package/build/auth/token-verifier.js +172 -0
  35. package/build/config/environment.js +297 -0
  36. package/build/index.d.ts +1 -0
  37. package/build/index.js +129 -0
  38. package/build/schemas/account-management/account.js +375 -0
  39. package/build/schemas/analytics/analytics.js +191 -0
  40. package/build/schemas/communication/messages.js +345 -0
  41. package/build/schemas/fulfillment/orders.js +338 -0
  42. package/build/schemas/index.js +68 -0
  43. package/build/schemas/inventory-management/inventory.js +471 -0
  44. package/build/schemas/marketing/marketing.js +1103 -0
  45. package/build/schemas/metadata/metadata.js +618 -0
  46. package/build/schemas/other/other-apis.js +390 -0
  47. package/build/schemas/taxonomy/taxonomy.js +575 -0
  48. package/build/scripts/auto-setup.js +364 -0
  49. package/build/scripts/dev-sync.js +512 -0
  50. package/build/scripts/diagnostics.js +301 -0
  51. package/build/scripts/download-specs.js +116 -0
  52. package/build/scripts/interactive-setup.js +757 -0
  53. package/build/scripts/setup.js +1515 -0
  54. package/build/scripts/update-api-status-doc.js +44 -0
  55. package/build/server-http.d.ts +1 -0
  56. package/build/server-http.js +581 -0
  57. package/build/tools/definitions/account-with-schemas.js +170 -0
  58. package/build/tools/definitions/account.js +428 -0
  59. package/build/tools/definitions/analytics.js +66 -0
  60. package/build/tools/definitions/communication.js +394 -0
  61. package/build/tools/definitions/developer.js +195 -0
  62. package/build/tools/definitions/fulfillment.js +326 -0
  63. package/build/tools/definitions/index.js +41 -0
  64. package/build/tools/definitions/inventory.js +464 -0
  65. package/build/tools/definitions/marketing.js +1486 -0
  66. package/build/tools/definitions/metadata.js +188 -0
  67. package/build/tools/definitions/other.js +309 -0
  68. package/build/tools/definitions/taxonomy.js +64 -0
  69. package/build/tools/definitions/token-management.js +148 -0
  70. package/build/tools/definitions/trading.js +71 -0
  71. package/build/tools/index.js +1200 -0
  72. package/build/tools/schemas.js +667 -0
  73. package/build/tools/tool-definitions.js +3534 -0
  74. package/build/types/application-settings/developerAnalyticsV1BetaOas3.js +5 -0
  75. package/build/types/application-settings/developerClientRegistrationV1Oas3.js +5 -0
  76. package/build/types/application-settings/developerKeyManagementV1Oas3.js +5 -0
  77. package/build/types/ebay-enums.js +1330 -0
  78. package/build/types/ebay.js +123 -0
  79. package/build/types/index.js +10 -0
  80. package/build/types/sell-apps/account-management/sellAccountV1Oas3.js +5 -0
  81. package/build/types/sell-apps/analytics-and-report/sellAnalyticsV1Oas3.js +5 -0
  82. package/build/types/sell-apps/communication/commerceFeedbackV1BetaOas3.js +5 -0
  83. package/build/types/sell-apps/communication/commerceMessageV1Oas3.js +5 -0
  84. package/build/types/sell-apps/communication/commerceNotificationV1Oas3.js +5 -0
  85. package/build/types/sell-apps/communication/sellNegotiationV1Oas3.js +5 -0
  86. package/build/types/sell-apps/listing-management/sellInventoryV1Oas3.js +5 -0
  87. package/build/types/sell-apps/listing-metadata/sellMetadataV1Oas3.js +5 -0
  88. package/build/types/sell-apps/markeitng-and-promotions/sellMarketingV1Oas3.js +5 -0
  89. package/build/types/sell-apps/markeitng-and-promotions/sellRecommendationV1Oas3.js +5 -0
  90. package/build/types/sell-apps/order-management/sellFulfillmentV1Oas3.js +5 -0
  91. package/build/types/sell-apps/other-apis/commerceIdentityV1Oas3.js +5 -0
  92. package/build/types/sell-apps/other-apis/commerceTranslationV1BetaOas3.js +5 -0
  93. package/build/types/sell-apps/other-apis/commerceVeroV1Oas3.js +5 -0
  94. package/build/types/sell-apps/other-apis/sellComplianceV1Oas3.js +5 -0
  95. package/build/types/sell-apps/other-apis/sellEdeliveryInternationalShippingOas3.js +5 -0
  96. package/build/types/sell-apps/other-apis/sellMarketingV1Oas3.js +5 -0
  97. package/build/types/sell-apps/other-apis/sellRecommendationV1Oas3.js +5 -0
  98. package/build/utils/account-management/account.js +831 -0
  99. package/build/utils/api-status-feed.js +83 -0
  100. package/build/utils/communication/feedback.js +216 -0
  101. package/build/utils/communication/message.js +242 -0
  102. package/build/utils/communication/negotiation.js +150 -0
  103. package/build/utils/communication/notification.js +369 -0
  104. package/build/utils/date-converter.js +160 -0
  105. package/build/utils/llm-client-detector.js +758 -0
  106. package/build/utils/logger.js +198 -0
  107. package/build/utils/oauth-helper.js +315 -0
  108. package/build/utils/order-management/dispute.js +369 -0
  109. package/build/utils/order-management/fulfillment.js +205 -0
  110. package/build/utils/other/compliance.js +76 -0
  111. package/build/utils/other/edelivery.js +241 -0
  112. package/build/utils/other/identity.js +13 -0
  113. package/build/utils/other/translation.js +41 -0
  114. package/build/utils/other/vero.js +90 -0
  115. package/build/utils/scope-helper.js +207 -0
  116. package/build/utils/security-checker.js +248 -0
  117. package/build/utils/setup-validator.js +305 -0
  118. package/build/utils/token-utils.js +40 -0
  119. package/build/utils/version.js +56 -0
  120. package/docs/auth/production_scopes.json +111 -0
  121. package/docs/auth/sandbox_scopes.json +142 -0
  122. package/package.json +122 -0
  123. package/public/icons/1024x1024.png +0 -0
  124. package/public/icons/128x128.png +0 -0
  125. package/public/icons/16x16.png +0 -0
  126. package/public/icons/256x256.png +0 -0
  127. package/public/icons/32x32.png +0 -0
  128. package/public/icons/48x48.png +0 -0
  129. package/public/icons/512x512.png +0 -0
@@ -0,0 +1,1103 @@
1
+ import { z } from 'zod';
2
+ import { zodToJsonSchema } from 'zod-to-json-schema';
3
+ /**
4
+ * Marketing API Schemas
5
+ *
6
+ * This file contains Zod schemas for all Marketing API endpoints including:
7
+ * - Campaign Management (create, get, update, pause, resume, end campaigns)
8
+ * - Ad Operations (bulk and single ad operations)
9
+ * - Ad Group Management
10
+ * - Keyword Management
11
+ * - Negative Keyword Management (campaign and ad group level)
12
+ * - Targeting schemas
13
+ * - Suggestion schemas (bids, keywords, budget)
14
+ * - Reporting schemas
15
+ * - Item Promotion schemas
16
+ * - Recommendation schemas
17
+ */
18
+ // ============================================================================
19
+ // Common/Shared Response Schemas
20
+ // ============================================================================
21
+ export const errorSchema = z.object({
22
+ errorId: z.number().optional(),
23
+ domain: z.string().optional(),
24
+ category: z.string().optional(),
25
+ message: z.string().optional(),
26
+ longMessage: z.string().optional(),
27
+ subdomain: z.string().optional(),
28
+ inputRefIds: z.array(z.string()).optional(),
29
+ outputRefIds: z.array(z.string()).optional(),
30
+ parameters: z
31
+ .array(z.object({
32
+ name: z.string().optional(),
33
+ value: z.string().optional(),
34
+ }))
35
+ .optional(),
36
+ });
37
+ export const errorParameterSchema = z.object({
38
+ name: z.string().optional(),
39
+ value: z.string().optional(),
40
+ });
41
+ export const amountSchema = z.object({
42
+ currency: z.string().optional(),
43
+ value: z.string().optional(),
44
+ });
45
+ export const alertSchema = z.object({
46
+ alertId: z.string().optional(),
47
+ message: z.string().optional(),
48
+ });
49
+ export const alertDetailsSchema = z.object({
50
+ alertId: z.string().optional(),
51
+ details: z.string().optional(),
52
+ });
53
+ export const alertDimensionSchema = z.object({
54
+ dimensionKey: z.string().optional(),
55
+ value: z.string().optional(),
56
+ });
57
+ export const baseResponseSchema = z.object({
58
+ warnings: z.array(errorSchema).optional(),
59
+ });
60
+ // ============================================================================
61
+ // Inventory Reference Schemas
62
+ // ============================================================================
63
+ export const marketingInventoryItemSchema = z.object({
64
+ inventoryReferenceId: z.string().optional(),
65
+ inventoryReferenceType: z.string().optional(),
66
+ });
67
+ export const inventoryReferenceSchema = z.object({
68
+ inventoryReferenceId: z.string().optional(),
69
+ inventoryReferenceType: z.string().optional(),
70
+ });
71
+ // ============================================================================
72
+ // Campaign Management Schemas
73
+ // ============================================================================
74
+ export const budgetSchema = z.object({
75
+ amount: z.string().optional(),
76
+ currency: z.string().optional(),
77
+ });
78
+ export const budgetRequestSchema = z.object({
79
+ amount: z.string().optional(),
80
+ currency: z.string().optional(),
81
+ });
82
+ export const campaignBudgetSchema = z.object({
83
+ daily: budgetSchema.optional(),
84
+ });
85
+ export const campaignBudgetRequestSchema = z.object({
86
+ daily: budgetRequestSchema.optional(),
87
+ });
88
+ export const fundingStrategySchema = z.object({
89
+ bidPercentage: z.string().optional(),
90
+ fundingModel: z.string().optional(),
91
+ });
92
+ export const selectionRuleSchema = z.object({
93
+ brands: z.array(z.string()).optional(),
94
+ categoryIds: z.array(z.string()).optional(),
95
+ categoryScope: z.string().optional(),
96
+ listingConditionIds: z.array(z.string()).optional(),
97
+ maxPrice: amountSchema.optional(),
98
+ minPrice: amountSchema.optional(),
99
+ });
100
+ export const campaignCriterionSchema = z.object({
101
+ autoSelectFutureInventory: z.boolean().optional(),
102
+ criterionType: z.string().optional(),
103
+ selectionRules: z.array(selectionRuleSchema).optional(),
104
+ });
105
+ export const campaignSchema = z.object({
106
+ alerts: z.array(alertSchema).optional(),
107
+ budget: campaignBudgetSchema.optional(),
108
+ campaignCriterion: campaignCriterionSchema.optional(),
109
+ campaignId: z.string().optional(),
110
+ campaignName: z.string().optional(),
111
+ campaignStatus: z.string().optional(),
112
+ campaignTargetingType: z.string().optional(),
113
+ channels: z.array(z.string()).optional(),
114
+ endDate: z.string().optional(),
115
+ fundingStrategy: fundingStrategySchema.optional(),
116
+ marketplaceId: z.string().optional(),
117
+ startDate: z.string().optional(),
118
+ });
119
+ export const createCampaignRequestSchema = z.object({
120
+ campaignCriterion: campaignCriterionSchema.optional(),
121
+ campaignName: z.string(),
122
+ budget: campaignBudgetRequestSchema.optional(),
123
+ channels: z.array(z.string()).optional(),
124
+ endDate: z.string().optional(),
125
+ fundingStrategy: fundingStrategySchema.optional(),
126
+ marketplaceId: z.string(),
127
+ startDate: z.string(),
128
+ });
129
+ export const cloneCampaignRequestSchema = z.object({
130
+ campaignName: z.string(),
131
+ endDate: z.string().optional(),
132
+ fundingStrategy: fundingStrategySchema.optional(),
133
+ startDate: z.string().optional(),
134
+ });
135
+ export const updateCampaignRequestSchema = z.object({
136
+ campaignName: z.string().optional(),
137
+ endDate: z.string().optional(),
138
+ fundingStrategy: fundingStrategySchema.optional(),
139
+ startDate: z.string().optional(),
140
+ });
141
+ export const updateCampaignBudgetRequestSchema = z.object({
142
+ budget: campaignBudgetRequestSchema.optional(),
143
+ });
144
+ export const updateCampaignIdentificationRequestSchema = z.object({
145
+ campaignName: z.string().optional(),
146
+ });
147
+ export const updateBidPercentageRequestSchema = z.object({
148
+ bidPercentage: z.string(),
149
+ });
150
+ export const updateBiddingStrategyRequestSchema = z.object({
151
+ bidPercentage: z.string().optional(),
152
+ biddingStrategy: z.string().optional(),
153
+ });
154
+ export const updateAdrateStrategyRequestSchema = z.object({
155
+ adRateStrategy: z.string().optional(),
156
+ });
157
+ export const campaignPagedCollectionResponseSchema = z.object({
158
+ campaigns: z.array(campaignSchema).optional(),
159
+ href: z.string().optional(),
160
+ limit: z.number().optional(),
161
+ next: z.string().optional(),
162
+ offset: z.number().optional(),
163
+ prev: z.string().optional(),
164
+ total: z.number().optional(),
165
+ });
166
+ export const campaignsSchema = z.object({
167
+ campaigns: z.array(campaignSchema).optional(),
168
+ });
169
+ // ============================================================================
170
+ // Ad Group Management Schemas
171
+ // ============================================================================
172
+ export const adGroupSchema = z.object({
173
+ adGroupId: z.string().optional(),
174
+ adGroupStatus: z.string().optional(),
175
+ defaultBid: amountSchema.optional(),
176
+ name: z.string().optional(),
177
+ });
178
+ export const createAdGroupRequestSchema = z.object({
179
+ defaultBid: amountSchema.optional(),
180
+ name: z.string(),
181
+ });
182
+ export const updateAdGroupRequestSchema = z.object({
183
+ adGroupStatus: z.string().optional(),
184
+ defaultBid: amountSchema.optional(),
185
+ name: z.string().optional(),
186
+ });
187
+ export const adGroupPagedCollectionResponseSchema = z.object({
188
+ adGroups: z.array(adGroupSchema).optional(),
189
+ href: z.string().optional(),
190
+ limit: z.number().optional(),
191
+ next: z.string().optional(),
192
+ offset: z.number().optional(),
193
+ prev: z.string().optional(),
194
+ total: z.number().optional(),
195
+ });
196
+ // ============================================================================
197
+ // Ad Operations Schemas
198
+ // ============================================================================
199
+ export const adSchema = z.object({
200
+ adGroupId: z.string().optional(),
201
+ adId: z.string().optional(),
202
+ adStatus: z.string().optional(),
203
+ alerts: z.array(alertSchema).optional(),
204
+ bidPercentage: z.string().optional(),
205
+ inventoryReferenceId: z.string().optional(),
206
+ inventoryReferenceType: z.string().optional(),
207
+ listingId: z.string().optional(),
208
+ });
209
+ export const createAdRequestSchema = z.object({
210
+ adGroupId: z.string().optional(),
211
+ bidPercentage: z.string().optional(),
212
+ listingId: z.string().optional(),
213
+ });
214
+ export const adsSchema = z.object({
215
+ ads: z.array(createAdRequestSchema).optional(),
216
+ });
217
+ export const createAdsByInventoryReferenceRequestSchema = z.object({
218
+ bidPercentage: z.string().optional(),
219
+ inventoryReferenceId: z.string().optional(),
220
+ inventoryReferenceType: z.string().optional(),
221
+ });
222
+ export const adReferenceSchema = z.object({
223
+ adId: z.string().optional(),
224
+ href: z.string().optional(),
225
+ });
226
+ export const adReferencesSchema = z.object({
227
+ ads: z.array(adReferenceSchema).optional(),
228
+ });
229
+ export const adResponseSchema = z.object({
230
+ adGroupId: z.string().optional(),
231
+ adId: z.string().optional(),
232
+ errors: z.array(errorSchema).optional(),
233
+ href: z.string().optional(),
234
+ listingId: z.string().optional(),
235
+ statusCode: z.number().optional(),
236
+ warnings: z.array(errorSchema).optional(),
237
+ });
238
+ export const createAdsByInventoryReferenceResponseSchema = z.object({
239
+ ads: z.array(adResponseSchema).optional(),
240
+ errors: z.array(errorSchema).optional(),
241
+ inventoryReferenceId: z.string().optional(),
242
+ inventoryReferenceType: z.string().optional(),
243
+ statusCode: z.number().optional(),
244
+ warnings: z.array(errorSchema).optional(),
245
+ });
246
+ export const adPagedCollectionResponseSchema = z.object({
247
+ ads: z.array(adSchema).optional(),
248
+ href: z.string().optional(),
249
+ limit: z.number().optional(),
250
+ next: z.string().optional(),
251
+ offset: z.number().optional(),
252
+ prev: z.string().optional(),
253
+ total: z.number().optional(),
254
+ });
255
+ // Ad Update Schemas
256
+ export const updateAdStatusRequestSchema = z.object({
257
+ adStatus: z.string(),
258
+ });
259
+ export const updateAdStatusByListingIdRequestSchema = z.object({
260
+ adStatus: z.string(),
261
+ listingId: z.string(),
262
+ });
263
+ export const adUpdateStatusResponseSchema = z.object({
264
+ adId: z.string().optional(),
265
+ errors: z.array(errorSchema).optional(),
266
+ href: z.string().optional(),
267
+ statusCode: z.number().optional(),
268
+ });
269
+ export const adUpdateStatusByListingIdResponseSchema = z.object({
270
+ errors: z.array(errorSchema).optional(),
271
+ href: z.string().optional(),
272
+ listingId: z.string().optional(),
273
+ statusCode: z.number().optional(),
274
+ });
275
+ export const adUpdateResponseSchema = z.object({
276
+ ads: z.array(adUpdateStatusResponseSchema).optional(),
277
+ });
278
+ // Bulk Ad Operations
279
+ export const bulkCreateAdRequestSchema = z.object({
280
+ requests: z.array(createAdRequestSchema).optional(),
281
+ });
282
+ export const bulkAdResponseSchema = z.object({
283
+ responses: z.array(adResponseSchema).optional(),
284
+ });
285
+ export const bulkCreateAdsByInventoryReferenceRequestSchema = z.object({
286
+ requests: z.array(createAdsByInventoryReferenceRequestSchema).optional(),
287
+ });
288
+ export const bulkCreateAdsByInventoryReferenceResponseSchema = z.object({
289
+ responses: z.array(createAdsByInventoryReferenceResponseSchema).optional(),
290
+ });
291
+ export const bulkUpdateAdStatusRequestSchema = z.object({
292
+ requests: z.array(updateAdStatusRequestSchema).optional(),
293
+ });
294
+ export const bulkUpdateAdStatusByListingIdRequestSchema = z.object({
295
+ requests: z.array(updateAdStatusByListingIdRequestSchema).optional(),
296
+ });
297
+ export const bulkAdUpdateStatusResponseSchema = z.object({
298
+ responses: z.array(adUpdateStatusResponseSchema).optional(),
299
+ });
300
+ export const bulkAdUpdateStatusByListingIdResponseSchema = z.object({
301
+ responses: z.array(adUpdateStatusByListingIdResponseSchema).optional(),
302
+ });
303
+ export const bulkAdUpdateResponseSchema = z.object({
304
+ responses: z.array(adUpdateResponseSchema).optional(),
305
+ });
306
+ // Delete Ad Schemas
307
+ export const adIdsSchema = z.object({
308
+ adIds: z.array(z.string()).optional(),
309
+ });
310
+ export const deleteAdRequestSchema = z.object({
311
+ adId: z.string().optional(),
312
+ });
313
+ export const deleteAdResponseSchema = z.object({
314
+ adId: z.string().optional(),
315
+ errors: z.array(errorSchema).optional(),
316
+ listingId: z.string().optional(),
317
+ statusCode: z.number().optional(),
318
+ });
319
+ export const bulkDeleteAdRequestSchema = z.object({
320
+ requests: z.array(deleteAdRequestSchema).optional(),
321
+ });
322
+ export const bulkDeleteAdResponseSchema = z.object({
323
+ responses: z.array(deleteAdResponseSchema).optional(),
324
+ });
325
+ export const deleteAdsByInventoryReferenceRequestSchema = z.object({
326
+ inventoryReferenceId: z.string().optional(),
327
+ inventoryReferenceType: z.string().optional(),
328
+ });
329
+ export const deleteAdsByInventoryReferenceResponseSchema = z.object({
330
+ ads: z.array(deleteAdResponseSchema).optional(),
331
+ errors: z.array(errorSchema).optional(),
332
+ inventoryReferenceId: z.string().optional(),
333
+ inventoryReferenceType: z.string().optional(),
334
+ statusCode: z.number().optional(),
335
+ });
336
+ export const bulkDeleteAdsByInventoryReferenceRequestSchema = z.object({
337
+ requests: z.array(deleteAdsByInventoryReferenceRequestSchema).optional(),
338
+ });
339
+ export const bulkDeleteAdsByInventoryReferenceResponseSchema = z.object({
340
+ responses: z.array(deleteAdsByInventoryReferenceResponseSchema).optional(),
341
+ });
342
+ export const updateAdsByInventoryReferenceResponseSchema = z.object({
343
+ ads: z.array(adUpdateStatusResponseSchema).optional(),
344
+ errors: z.array(errorSchema).optional(),
345
+ inventoryReferenceId: z.string().optional(),
346
+ inventoryReferenceType: z.string().optional(),
347
+ statusCode: z.number().optional(),
348
+ });
349
+ export const bulkUpdateAdsByInventoryReferenceResponseSchema = z.object({
350
+ responses: z.array(updateAdsByInventoryReferenceResponseSchema).optional(),
351
+ });
352
+ // ============================================================================
353
+ // Keyword Management Schemas
354
+ // ============================================================================
355
+ export const keywordSchema = z.object({
356
+ adGroupId: z.string().optional(),
357
+ bid: amountSchema.optional(),
358
+ keywordId: z.string().optional(),
359
+ keywordStatus: z.string().optional(),
360
+ keywordText: z.string().optional(),
361
+ matchType: z.string().optional(),
362
+ });
363
+ export const keywordRequestSchema = z.object({
364
+ keywordText: z.string().optional(),
365
+ matchType: z.string().optional(),
366
+ });
367
+ export const createKeywordRequestSchema = z.object({
368
+ adGroupId: z.string(),
369
+ bid: amountSchema.optional(),
370
+ keywordText: z.string(),
371
+ matchType: z.string(),
372
+ });
373
+ export const keywordResponseSchema = z.object({
374
+ adGroupId: z.string().optional(),
375
+ errors: z.array(errorSchema).optional(),
376
+ href: z.string().optional(),
377
+ keywordId: z.string().optional(),
378
+ keywordText: z.string().optional(),
379
+ matchType: z.string().optional(),
380
+ statusCode: z.number().optional(),
381
+ warnings: z.array(errorSchema).optional(),
382
+ });
383
+ export const updateKeywordRequestSchema = z.object({
384
+ bid: amountSchema.optional(),
385
+ keywordStatus: z.string().optional(),
386
+ });
387
+ export const updateKeywordByKeywordIdRequestSchema = z.object({
388
+ bid: amountSchema.optional(),
389
+ keywordStatus: z.string().optional(),
390
+ });
391
+ export const updateKeywordResponseSchema = z.object({
392
+ errors: z.array(errorSchema).optional(),
393
+ href: z.string().optional(),
394
+ keywordId: z.string().optional(),
395
+ statusCode: z.number().optional(),
396
+ warnings: z.array(errorSchema).optional(),
397
+ });
398
+ export const keywordPagedCollectionResponseSchema = z.object({
399
+ href: z.string().optional(),
400
+ keywords: z.array(keywordSchema).optional(),
401
+ limit: z.number().optional(),
402
+ next: z.string().optional(),
403
+ offset: z.number().optional(),
404
+ prev: z.string().optional(),
405
+ total: z.number().optional(),
406
+ });
407
+ // Bulk Keyword Operations
408
+ export const bulkCreateKeywordRequestSchema = z.object({
409
+ requests: z.array(createKeywordRequestSchema).optional(),
410
+ });
411
+ export const bulkCreateKeywordResponseSchema = z.object({
412
+ responses: z.array(keywordResponseSchema).optional(),
413
+ });
414
+ export const bulkUpdateKeywordRequestSchema = z.object({
415
+ requests: z
416
+ .array(z.object({
417
+ keywordId: z.string(),
418
+ bid: amountSchema.optional(),
419
+ keywordStatus: z.string().optional(),
420
+ }))
421
+ .optional(),
422
+ });
423
+ export const bulkUpdateKeywordResponseSchema = z.object({
424
+ responses: z.array(updateKeywordResponseSchema).optional(),
425
+ });
426
+ // ============================================================================
427
+ // Negative Keyword Management Schemas
428
+ // ============================================================================
429
+ export const negativeKeywordSchema = z.object({
430
+ adGroupId: z.string().optional(),
431
+ campaignId: z.string().optional(),
432
+ negativeKeywordId: z.string().optional(),
433
+ negativeKeywordMatchType: z.string().optional(),
434
+ negativeKeywordStatus: z.string().optional(),
435
+ negativeKeywordText: z.string().optional(),
436
+ });
437
+ export const createNegativeKeywordRequestSchema = z.object({
438
+ adGroupId: z.string().optional(),
439
+ campaignId: z.string().optional(),
440
+ negativeKeywordMatchType: z.string(),
441
+ negativeKeywordText: z.string(),
442
+ });
443
+ export const negativeKeywordResponseSchema = z.object({
444
+ adGroupId: z.string().optional(),
445
+ campaignId: z.string().optional(),
446
+ errors: z.array(errorSchema).optional(),
447
+ href: z.string().optional(),
448
+ negativeKeywordId: z.string().optional(),
449
+ negativeKeywordMatchType: z.string().optional(),
450
+ negativeKeywordText: z.string().optional(),
451
+ statusCode: z.number().optional(),
452
+ warnings: z.array(errorSchema).optional(),
453
+ });
454
+ export const updateNegativeKeywordRequestSchema = z.object({
455
+ negativeKeywordStatus: z.string().optional(),
456
+ });
457
+ export const updateNegativeKeywordIdRequestSchema = z.object({
458
+ negativeKeywordStatus: z.string().optional(),
459
+ });
460
+ export const updateNegativeKeywordResponseSchema = z.object({
461
+ errors: z.array(errorSchema).optional(),
462
+ href: z.string().optional(),
463
+ negativeKeywordId: z.string().optional(),
464
+ statusCode: z.number().optional(),
465
+ warnings: z.array(errorSchema).optional(),
466
+ });
467
+ export const negativeKeywordPagedCollectionResponseSchema = z.object({
468
+ href: z.string().optional(),
469
+ limit: z.number().optional(),
470
+ negativeKeywords: z.array(negativeKeywordSchema).optional(),
471
+ next: z.string().optional(),
472
+ offset: z.number().optional(),
473
+ prev: z.string().optional(),
474
+ total: z.number().optional(),
475
+ });
476
+ // Bulk Negative Keyword Operations
477
+ export const bulkCreateNegativeKeywordRequestSchema = z.object({
478
+ requests: z.array(createNegativeKeywordRequestSchema).optional(),
479
+ });
480
+ export const bulkCreateNegativeKeywordResponseSchema = z.object({
481
+ responses: z.array(negativeKeywordResponseSchema).optional(),
482
+ });
483
+ export const bulkUpdateNegativeKeywordRequestSchema = z.object({
484
+ requests: z
485
+ .array(z.object({
486
+ negativeKeywordId: z.string(),
487
+ negativeKeywordStatus: z.string().optional(),
488
+ }))
489
+ .optional(),
490
+ });
491
+ export const bulkUpdateNegativeKeywordResponseSchema = z.object({
492
+ responses: z.array(updateNegativeKeywordResponseSchema).optional(),
493
+ });
494
+ // ============================================================================
495
+ // Targeting and Bid Schemas
496
+ // ============================================================================
497
+ export const targetedBidRequestSchema = z.object({
498
+ bid: amountSchema.optional(),
499
+ listingId: z.string().optional(),
500
+ });
501
+ export const targetedKeywordRequestSchema = z.object({
502
+ adGroupId: z.string().optional(),
503
+ bid: amountSchema.optional(),
504
+ keywordText: z.string().optional(),
505
+ matchType: z.string().optional(),
506
+ });
507
+ export const targetedAdsPagedCollectionSchema = z.object({
508
+ ads: z.array(adSchema).optional(),
509
+ href: z.string().optional(),
510
+ limit: z.number().optional(),
511
+ next: z.string().optional(),
512
+ offset: z.number().optional(),
513
+ prev: z.string().optional(),
514
+ total: z.number().optional(),
515
+ });
516
+ export const targetedBidsPagedCollectionSchema = z.object({
517
+ bids: z.array(targetedBidRequestSchema).optional(),
518
+ href: z.string().optional(),
519
+ limit: z.number().optional(),
520
+ next: z.string().optional(),
521
+ offset: z.number().optional(),
522
+ prev: z.string().optional(),
523
+ total: z.number().optional(),
524
+ });
525
+ export const targetedKeywordsPagedCollectionSchema = z.object({
526
+ href: z.string().optional(),
527
+ keywords: z.array(targetedKeywordRequestSchema).optional(),
528
+ limit: z.number().optional(),
529
+ next: z.string().optional(),
530
+ offset: z.number().optional(),
531
+ prev: z.string().optional(),
532
+ total: z.number().optional(),
533
+ });
534
+ export const targetingItemsSchema = z.object({
535
+ inventoryCriterion: z
536
+ .array(z.object({
537
+ inventoryItems: z.array(marketingInventoryItemSchema).optional(),
538
+ listingIds: z.array(z.string()).optional(),
539
+ }))
540
+ .optional(),
541
+ });
542
+ // ============================================================================
543
+ // Suggestion Schemas (Bids, Keywords, Budget)
544
+ // ============================================================================
545
+ export const proposedBidSchema = z.object({
546
+ amount: amountSchema.optional(),
547
+ basis: z.string().optional(),
548
+ });
549
+ export const suggestedBidsSchema = z.object({
550
+ keywordText: z.string().optional(),
551
+ matchType: z.string().optional(),
552
+ proposedBid: proposedBidSchema.optional(),
553
+ });
554
+ export const additionalInfoDataSchema = z.object({
555
+ key: z.string().optional(),
556
+ value: z.string().optional(),
557
+ });
558
+ export const additionalInfoSchema = z.object({
559
+ data: z.array(additionalInfoDataSchema).optional(),
560
+ type: z.string().optional(),
561
+ });
562
+ export const suggestedKeywordsSchema = z.object({
563
+ additionalInfo: z.array(additionalInfoSchema).optional(),
564
+ keywordText: z.string().optional(),
565
+ matchType: z.string().optional(),
566
+ });
567
+ export const budgetRecommendationResponseSchema = z.object({
568
+ amount: amountSchema.optional(),
569
+ type: z.string().optional(),
570
+ });
571
+ export const suggestBudgetResponseSchema = z.object({
572
+ suggestedBudget: z.array(budgetRecommendationResponseSchema).optional(),
573
+ });
574
+ export const maxCpcSchema = z.object({
575
+ amount: amountSchema.optional(),
576
+ });
577
+ export const suggestMaxCpcRequestSchema = z.object({
578
+ listingIds: z.array(z.string()).optional(),
579
+ marketplaceId: z.string().optional(),
580
+ });
581
+ export const suggestMaxCpcResponseSchema = z.object({
582
+ amount: amountSchema.optional(),
583
+ marketplaceId: z.string().optional(),
584
+ });
585
+ export const bidPreferenceSchema = z.object({
586
+ bidPercentage: z.string().optional(),
587
+ });
588
+ export const dynamicAdRatePreferenceSchema = z.object({
589
+ maxAdRate: z.string().optional(),
590
+ minAdRate: z.string().optional(),
591
+ });
592
+ // Quick Setup Schema
593
+ export const quickSetupRequestSchema = z.object({
594
+ campaignName: z.string(),
595
+ dailyBudget: amountSchema.optional(),
596
+ endDate: z.string().optional(),
597
+ fundingStrategy: fundingStrategySchema.optional(),
598
+ listingIds: z.array(z.string()).optional(),
599
+ marketplaceId: z.string(),
600
+ startDate: z.string().optional(),
601
+ });
602
+ // ============================================================================
603
+ // Reporting Schemas
604
+ // ============================================================================
605
+ export const dimensionSchema = z.object({
606
+ dimensionKey: z.string().optional(),
607
+ dimensionValues: z.array(z.string()).optional(),
608
+ });
609
+ export const dimensionKeyAnnotationSchema = z.object({
610
+ annotationKey: z.string().optional(),
611
+ value: z.string().optional(),
612
+ });
613
+ export const dimensionMetadataSchema = z.object({
614
+ annotations: z.array(dimensionKeyAnnotationSchema).optional(),
615
+ dataType: z.string().optional(),
616
+ dimensionKey: z.string().optional(),
617
+ });
618
+ export const metricMetadataSchema = z.object({
619
+ dataType: z.string().optional(),
620
+ metricKey: z.string().optional(),
621
+ });
622
+ export const reportMetadataSchema = z.object({
623
+ dimensionMetadata: z.array(dimensionMetadataSchema).optional(),
624
+ maxNumberOfDimensionsToRequest: z.number().optional(),
625
+ maxNumberOfMetricsToRequest: z.number().optional(),
626
+ channel: z.string().optional(),
627
+ metricMetadata: z.array(metricMetadataSchema).optional(),
628
+ reportType: z.string().optional(),
629
+ });
630
+ export const reportMetadatasSchema = z.object({
631
+ reportMetadata: z.array(reportMetadataSchema).optional(),
632
+ });
633
+ export const createReportTaskSchema = z.object({
634
+ campaignIds: z.array(z.string()).optional(),
635
+ channels: z.array(z.string()).optional(),
636
+ dateFrom: z.string(),
637
+ dateTo: z.string(),
638
+ dimensions: z.array(dimensionSchema).optional(),
639
+ fundingModels: z.array(z.string()).optional(),
640
+ inventoryReferences: z.array(inventoryReferenceSchema).optional(),
641
+ listingIds: z.array(z.string()).optional(),
642
+ marketplaceId: z.string(),
643
+ metricKeys: z.array(z.string()).optional(),
644
+ reportFormat: z.string().optional(),
645
+ reportType: z.string(),
646
+ });
647
+ export const reportTaskSchema = z.object({
648
+ campaignIds: z.array(z.string()).optional(),
649
+ channels: z.array(z.string()).optional(),
650
+ dateFrom: z.string().optional(),
651
+ dateTo: z.string().optional(),
652
+ dimensions: z.array(dimensionSchema).optional(),
653
+ fundingModels: z.array(z.string()).optional(),
654
+ inventoryReferences: z.array(inventoryReferenceSchema).optional(),
655
+ listingIds: z.array(z.string()).optional(),
656
+ marketplaceId: z.string().optional(),
657
+ metricKeys: z.array(z.string()).optional(),
658
+ reportExpirationDate: z.string().optional(),
659
+ reportFormat: z.string().optional(),
660
+ reportHref: z.string().optional(),
661
+ reportId: z.string().optional(),
662
+ reportName: z.string().optional(),
663
+ reportTaskCompletionDate: z.string().optional(),
664
+ reportTaskCreationDate: z.string().optional(),
665
+ reportTaskExpectedCompletionDate: z.string().optional(),
666
+ reportTaskId: z.string().optional(),
667
+ reportTaskStatus: z.string().optional(),
668
+ reportTaskStatusMessage: z.string().optional(),
669
+ reportType: z.string().optional(),
670
+ });
671
+ export const reportTaskPagedCollectionSchema = z.object({
672
+ href: z.string().optional(),
673
+ limit: z.number().optional(),
674
+ next: z.string().optional(),
675
+ offset: z.number().optional(),
676
+ prev: z.string().optional(),
677
+ total: z.number().optional(),
678
+ reportTasks: z.array(reportTaskSchema).optional(),
679
+ });
680
+ export const summaryReportResponseSchema = z.object({
681
+ baseSale: amountSchema.optional(),
682
+ lastUpdated: z.string().optional(),
683
+ percentageSalesLift: z.string().optional(),
684
+ promotionHref: z.string().optional(),
685
+ promotionId: z.string().optional(),
686
+ promotionReportId: z.string().optional(),
687
+ promotionSale: amountSchema.optional(),
688
+ totalDiscount: amountSchema.optional(),
689
+ totalSale: amountSchema.optional(),
690
+ });
691
+ // ============================================================================
692
+ // Item Promotion (Discounts) Schemas
693
+ // ============================================================================
694
+ export const discountBenefitSchema = z.object({
695
+ amountOffItem: amountSchema.optional(),
696
+ amountOffOrder: amountSchema.optional(),
697
+ percentageOffItem: z.string().optional(),
698
+ percentageOffOrder: z.string().optional(),
699
+ });
700
+ export const priceRangeSchema = z.object({
701
+ maxPrice: amountSchema.optional(),
702
+ minPrice: amountSchema.optional(),
703
+ });
704
+ export const discountSpecificationSchema = z.object({
705
+ forEachAmount: amountSchema.optional(),
706
+ forEachQuantity: z.number().optional(),
707
+ minAmount: amountSchema.optional(),
708
+ minQuantity: z.number().optional(),
709
+ numberOfDiscountedItems: z.number().optional(),
710
+ });
711
+ export const discountRuleSchema = z.object({
712
+ discountBenefit: discountBenefitSchema.optional(),
713
+ discountSpecification: discountSpecificationSchema.optional(),
714
+ ruleOrder: z.number().optional(),
715
+ });
716
+ export const inventoryCriterionSchema = z.object({
717
+ inventoryCriterionType: z.string().optional(),
718
+ inventoryItems: z.array(marketingInventoryItemSchema).optional(),
719
+ listingIds: z.array(z.string()).optional(),
720
+ ruleCriteria: z
721
+ .object({
722
+ excludeInventoryItems: z.array(marketingInventoryItemSchema).optional(),
723
+ excludeListingIds: z.array(z.string()).optional(),
724
+ markupInventoryItems: z.array(marketingInventoryItemSchema).optional(),
725
+ markupListingIds: z.array(z.string()).optional(),
726
+ selectionRules: z.array(selectionRuleSchema).optional(),
727
+ })
728
+ .optional(),
729
+ });
730
+ export const couponConfigurationSchema = z.object({
731
+ couponCode: z.string().optional(),
732
+ couponType: z.string().optional(),
733
+ maxCouponRedemptionPerUser: z.number().optional(),
734
+ });
735
+ export const itemPromotionSchema = z.object({
736
+ applyDiscountToSingleItemOnly: z.boolean().optional(),
737
+ budget: amountSchema.optional(),
738
+ couponConfiguration: couponConfigurationSchema.optional(),
739
+ description: z.string().optional(),
740
+ discountRules: z.array(discountRuleSchema).optional(),
741
+ endDate: z.string().optional(),
742
+ inventoryCriterion: inventoryCriterionSchema.optional(),
743
+ marketplaceId: z.string().optional(),
744
+ name: z.string().optional(),
745
+ priority: z.string().optional(),
746
+ promotionImageUrl: z.string().optional(),
747
+ promotionStatus: z.string().optional(),
748
+ promotionType: z.string().optional(),
749
+ startDate: z.string().optional(),
750
+ });
751
+ export const itemPromotionResponseSchema = z.object({
752
+ applyDiscountToSingleItemOnly: z.boolean().optional(),
753
+ budget: amountSchema.optional(),
754
+ couponConfiguration: couponConfigurationSchema.optional(),
755
+ description: z.string().optional(),
756
+ discountRules: z.array(discountRuleSchema).optional(),
757
+ endDate: z.string().optional(),
758
+ inventoryCriterion: inventoryCriterionSchema.optional(),
759
+ marketplaceId: z.string().optional(),
760
+ name: z.string().optional(),
761
+ priority: z.string().optional(),
762
+ promotionId: z.string().optional(),
763
+ promotionImageUrl: z.string().optional(),
764
+ promotionStatus: z.string().optional(),
765
+ promotionType: z.string().optional(),
766
+ startDate: z.string().optional(),
767
+ });
768
+ export const selectedInventoryDiscountSchema = z.object({
769
+ discountBenefit: discountBenefitSchema.optional(),
770
+ discountId: z.string().optional(),
771
+ inventoryCriterion: inventoryCriterionSchema.optional(),
772
+ ruleOrder: z.number().optional(),
773
+ });
774
+ export const itemMarkdownStatusSchema = z.object({
775
+ listingPromotionStatus: z.string().optional(),
776
+ timestamp: z.string().optional(),
777
+ });
778
+ export const listingDetailSchema = z.object({
779
+ currentPrice: amountSchema.optional(),
780
+ freeShipping: z.boolean().optional(),
781
+ inventoryReferenceId: z.string().optional(),
782
+ inventoryReferenceType: z.string().optional(),
783
+ listingCategoryId: z.string().optional(),
784
+ listingCondition: z.string().optional(),
785
+ listingConditionId: z.string().optional(),
786
+ listingId: z.string().optional(),
787
+ listingPromotionStatuses: z.array(itemMarkdownStatusSchema).optional(),
788
+ quantity: z.number().optional(),
789
+ storeCategoryId: z.string().optional(),
790
+ title: z.string().optional(),
791
+ });
792
+ export const itemsPagedCollectionSchema = z.object({
793
+ href: z.string().optional(),
794
+ limit: z.number().optional(),
795
+ listings: z.array(listingDetailSchema).optional(),
796
+ next: z.string().optional(),
797
+ offset: z.number().optional(),
798
+ prev: z.string().optional(),
799
+ total: z.number().optional(),
800
+ warnings: z.array(errorSchema).optional(),
801
+ });
802
+ export const promotionsPagedCollectionSchema = z.object({
803
+ href: z.string().optional(),
804
+ limit: z.number().optional(),
805
+ next: z.string().optional(),
806
+ offset: z.number().optional(),
807
+ prev: z.string().optional(),
808
+ promotions: z.array(itemPromotionResponseSchema).optional(),
809
+ total: z.number().optional(),
810
+ });
811
+ export const promotionDetailSchema = z.object({
812
+ description: z.string().optional(),
813
+ endDate: z.string().optional(),
814
+ marketplaceId: z.string().optional(),
815
+ name: z.string().optional(),
816
+ priority: z.string().optional(),
817
+ promotionId: z.string().optional(),
818
+ promotionImageUrl: z.string().optional(),
819
+ promotionStatus: z.string().optional(),
820
+ promotionType: z.string().optional(),
821
+ startDate: z.string().optional(),
822
+ });
823
+ export const promotionReportDetailSchema = z.object({
824
+ averageItemDiscount: amountSchema.optional(),
825
+ averageItemRevenue: amountSchema.optional(),
826
+ averageOrderDiscount: amountSchema.optional(),
827
+ averageOrderRevenue: amountSchema.optional(),
828
+ averageOrderSize: z.string().optional(),
829
+ baseSale: amountSchema.optional(),
830
+ clicksToPromotion: z.number().optional(),
831
+ impressionsToPromotion: z.number().optional(),
832
+ numberOfItemsSoldInPromotion: z.number().optional(),
833
+ numberOfOrdersWithPromotion: z.number().optional(),
834
+ percentageSalesLift: z.string().optional(),
835
+ promotionHref: z.string().optional(),
836
+ promotionId: z.string().optional(),
837
+ promotionReportId: z.string().optional(),
838
+ promotionSale: amountSchema.optional(),
839
+ totalDiscount: amountSchema.optional(),
840
+ totalSale: amountSchema.optional(),
841
+ });
842
+ export const promotionsReportPagedCollectionSchema = z.object({
843
+ href: z.string().optional(),
844
+ limit: z.number().optional(),
845
+ next: z.string().optional(),
846
+ offset: z.number().optional(),
847
+ prev: z.string().optional(),
848
+ promotionReports: z.array(promotionReportDetailSchema).optional(),
849
+ total: z.number().optional(),
850
+ });
851
+ // Item Price Markdown Schemas
852
+ export const itemBasisSchema = z.object({
853
+ itemIds: z.array(z.string()).optional(),
854
+ priceRange: priceRangeSchema.optional(),
855
+ });
856
+ export const itemPriceMarkdownSchema = z.object({
857
+ applyFreeShipping: z.boolean().optional(),
858
+ autoSelectFutureInventory: z.boolean().optional(),
859
+ blockPriceIncreaseInItemRevision: z.boolean().optional(),
860
+ description: z.string().optional(),
861
+ endDate: z.string().optional(),
862
+ marketplaceId: z.string().optional(),
863
+ name: z.string().optional(),
864
+ priority: z.string().optional(),
865
+ promotionImageUrl: z.string().optional(),
866
+ promotionStatus: z.string().optional(),
867
+ selectedInventoryDiscounts: z.array(selectedInventoryDiscountSchema).optional(),
868
+ startDate: z.string().optional(),
869
+ });
870
+ // ============================================================================
871
+ // Email Campaign Schemas
872
+ // ============================================================================
873
+ export const campaignAudienceSchema = z.object({
874
+ audienceType: z.string().optional(),
875
+ code: z.string().optional(),
876
+ name: z.string().optional(),
877
+ });
878
+ export const campaignDTOSchema = z.object({
879
+ audiences: z.array(campaignAudienceSchema).optional(),
880
+ creationDate: z.string().optional(),
881
+ emailCampaignId: z.string().optional(),
882
+ emailCampaignStatus: z.string().optional(),
883
+ emailCampaignType: z.string().optional(),
884
+ marketplaceId: z.string().optional(),
885
+ modificationDate: z.string().optional(),
886
+ scheduleDate: z.string().optional(),
887
+ scheduleDateType: z.string().optional(),
888
+ sentDate: z.string().optional(),
889
+ subject: z.string().optional(),
890
+ });
891
+ export const createEmailCampaignRequestSchema = z.object({
892
+ audiences: z.array(campaignAudienceSchema).optional(),
893
+ emailCampaignType: z.string(),
894
+ itemIds: z.array(z.string()).optional(),
895
+ marketplaceId: z.string(),
896
+ scheduleDate: z.string().optional(),
897
+ scheduleDateType: z.string().optional(),
898
+ subject: z.string().optional(),
899
+ });
900
+ export const createEmailCampaignResponseSchema = z.object({
901
+ emailCampaignId: z.string().optional(),
902
+ href: z.string().optional(),
903
+ });
904
+ export const updateEmailCampaignResponseSchema = z.object({
905
+ emailCampaignId: z.string().optional(),
906
+ href: z.string().optional(),
907
+ });
908
+ export const deleteEmailCampaignResponseSchema = z.object({
909
+ emailCampaignId: z.string().optional(),
910
+ });
911
+ export const getEmailCampaignResponseSchema = z.object({
912
+ emailCampaign: campaignDTOSchema.optional(),
913
+ });
914
+ export const getEmailCampaignsResponseSchema = z.object({
915
+ emailCampaigns: z.array(campaignDTOSchema).optional(),
916
+ href: z.string().optional(),
917
+ limit: z.number().optional(),
918
+ next: z.string().optional(),
919
+ offset: z.number().optional(),
920
+ prev: z.string().optional(),
921
+ total: z.number().optional(),
922
+ });
923
+ export const getEmailCampaignAudiencesResponseSchema = z.object({
924
+ audiences: z.array(campaignAudienceSchema).optional(),
925
+ href: z.string().optional(),
926
+ limit: z.number().optional(),
927
+ next: z.string().optional(),
928
+ offset: z.number().optional(),
929
+ prev: z.string().optional(),
930
+ total: z.number().optional(),
931
+ });
932
+ export const getEmailPreviewResponseSchema = z.object({
933
+ emailPreviewHtml: z.string().optional(),
934
+ });
935
+ export const getEmailReportResponseSchema = z.object({
936
+ clickRate: z.string().optional(),
937
+ numberOfClicks: z.number().optional(),
938
+ numberOfOpens: z.number().optional(),
939
+ numberOfRecipients: z.number().optional(),
940
+ numberOfUnsubscribes: z.number().optional(),
941
+ openRate: z.string().optional(),
942
+ unsubscribeRate: z.string().optional(),
943
+ });
944
+ // ============================================================================
945
+ // Recommendation Schemas (from sellRecommendationV1Oas3.ts)
946
+ // ============================================================================
947
+ export const bidPercentagesSchema = z.object({
948
+ basis: z.string().optional(),
949
+ value: z.string().optional(),
950
+ });
951
+ export const adRecommendationSchema = z.object({
952
+ bidPercentages: z.array(bidPercentagesSchema).optional(),
953
+ promoteWithAd: z.string().optional(),
954
+ });
955
+ export const marketingRecommendationSchema = z.object({
956
+ ad: adRecommendationSchema.optional(),
957
+ message: z.string().optional(),
958
+ });
959
+ export const listingRecommendationSchema = z.object({
960
+ listingId: z.string().optional(),
961
+ marketing: marketingRecommendationSchema.optional(),
962
+ });
963
+ export const pagedListingRecommendationCollectionSchema = z.object({
964
+ href: z.string().optional(),
965
+ limit: z.number().optional(),
966
+ listingRecommendations: z.array(listingRecommendationSchema).optional(),
967
+ next: z.string().optional(),
968
+ offset: z.number().optional(),
969
+ prev: z.string().optional(),
970
+ total: z.number().optional(),
971
+ });
972
+ export const findListingRecommendationRequestSchema = z.object({
973
+ listingIds: z.array(z.string()).optional(),
974
+ });
975
+ // Input Schemas for Find Listing Recommendations
976
+ export const findListingRecommendationsInputSchema = z.object({
977
+ filter: z
978
+ .string()
979
+ .optional()
980
+ .describe('Filter by recommendation types (e.g., recommendationTypes:{AD})'),
981
+ limit: z
982
+ .string()
983
+ .optional()
984
+ .describe('Maximum number of ads to return per page (default: 10, max: 500)'),
985
+ offset: z
986
+ .string()
987
+ .optional()
988
+ .describe('Number of ads to skip before returning results (default: 0)'),
989
+ 'X-EBAY-C-MARKETPLACE-ID': z.string().describe('eBay marketplace ID where items are listed'),
990
+ body: findListingRecommendationRequestSchema.optional(),
991
+ });
992
+ // ============================================================================
993
+ // Aspect Schema
994
+ // ============================================================================
995
+ export const aspectSchema = z.object({
996
+ aspectValues: z.array(z.string()).optional(),
997
+ localizedAspectName: z.string().optional(),
998
+ });
999
+ // ============================================================================
1000
+ // JSON Schema Conversion Functions
1001
+ // ============================================================================
1002
+ /**
1003
+ * Convert Zod schemas to JSON Schema format for MCP tools
1004
+ */
1005
+ export function getMarketingJsonSchemas() {
1006
+ return {
1007
+ // Campaign Management
1008
+ getCampaignsOutput: zodToJsonSchema(campaignPagedCollectionResponseSchema, 'getCampaignsOutput'),
1009
+ getCampaignDetails: zodToJsonSchema(campaignSchema, 'getCampaignDetails'),
1010
+ createCampaignInput: zodToJsonSchema(createCampaignRequestSchema, 'createCampaignInput'),
1011
+ createCampaignOutput: zodToJsonSchema(z.object({
1012
+ campaignId: z.string().optional(),
1013
+ warnings: z.array(errorSchema).optional(),
1014
+ }), 'createCampaignOutput'),
1015
+ cloneCampaignInput: zodToJsonSchema(cloneCampaignRequestSchema, 'cloneCampaignInput'),
1016
+ updateCampaignInput: zodToJsonSchema(updateCampaignRequestSchema, 'updateCampaignInput'),
1017
+ updateCampaignBudgetInput: zodToJsonSchema(updateCampaignBudgetRequestSchema, 'updateCampaignBudgetInput'),
1018
+ updateBidPercentageInput: zodToJsonSchema(updateBidPercentageRequestSchema, 'updateBidPercentageInput'),
1019
+ // Ad Group Management
1020
+ getAdGroupsOutput: zodToJsonSchema(adGroupPagedCollectionResponseSchema, 'getAdGroupsOutput'),
1021
+ getAdGroupDetails: zodToJsonSchema(adGroupSchema, 'getAdGroupDetails'),
1022
+ createAdGroupInput: zodToJsonSchema(createAdGroupRequestSchema, 'createAdGroupInput'),
1023
+ updateAdGroupInput: zodToJsonSchema(updateAdGroupRequestSchema, 'updateAdGroupInput'),
1024
+ // Ad Operations
1025
+ getAdsOutput: zodToJsonSchema(adPagedCollectionResponseSchema, 'getAdsOutput'),
1026
+ getAdDetails: zodToJsonSchema(adSchema, 'getAdDetails'),
1027
+ createAdInput: zodToJsonSchema(createAdRequestSchema, 'createAdInput'),
1028
+ createAdOutput: zodToJsonSchema(adResponseSchema, 'createAdOutput'),
1029
+ createAdsByInventoryReferenceInput: zodToJsonSchema(createAdsByInventoryReferenceRequestSchema, 'createAdsByInventoryReferenceInput'),
1030
+ createAdsByInventoryReferenceOutput: zodToJsonSchema(createAdsByInventoryReferenceResponseSchema, 'createAdsByInventoryReferenceOutput'),
1031
+ updateAdStatusInput: zodToJsonSchema(updateAdStatusRequestSchema, 'updateAdStatusInput'),
1032
+ bulkCreateAdsInput: zodToJsonSchema(bulkCreateAdRequestSchema, 'bulkCreateAdsInput'),
1033
+ bulkCreateAdsOutput: zodToJsonSchema(bulkAdResponseSchema, 'bulkCreateAdsOutput'),
1034
+ bulkUpdateAdStatusInput: zodToJsonSchema(bulkUpdateAdStatusRequestSchema, 'bulkUpdateAdStatusInput'),
1035
+ bulkDeleteAdsInput: zodToJsonSchema(bulkDeleteAdRequestSchema, 'bulkDeleteAdsInput'),
1036
+ // Keyword Management
1037
+ getKeywordsOutput: zodToJsonSchema(keywordPagedCollectionResponseSchema, 'getKeywordsOutput'),
1038
+ getKeywordDetails: zodToJsonSchema(keywordSchema, 'getKeywordDetails'),
1039
+ createKeywordInput: zodToJsonSchema(createKeywordRequestSchema, 'createKeywordInput'),
1040
+ createKeywordOutput: zodToJsonSchema(keywordResponseSchema, 'createKeywordOutput'),
1041
+ updateKeywordInput: zodToJsonSchema(updateKeywordRequestSchema, 'updateKeywordInput'),
1042
+ bulkCreateKeywordsInput: zodToJsonSchema(bulkCreateKeywordRequestSchema, 'bulkCreateKeywordsInput'),
1043
+ bulkCreateKeywordsOutput: zodToJsonSchema(bulkCreateKeywordResponseSchema, 'bulkCreateKeywordsOutput'),
1044
+ bulkUpdateKeywordsInput: zodToJsonSchema(bulkUpdateKeywordRequestSchema, 'bulkUpdateKeywordsInput'),
1045
+ // Negative Keyword Management
1046
+ getNegativeKeywordsOutput: zodToJsonSchema(negativeKeywordPagedCollectionResponseSchema, 'getNegativeKeywordsOutput'),
1047
+ getNegativeKeywordDetails: zodToJsonSchema(negativeKeywordSchema, 'getNegativeKeywordDetails'),
1048
+ createNegativeKeywordInput: zodToJsonSchema(createNegativeKeywordRequestSchema, 'createNegativeKeywordInput'),
1049
+ createNegativeKeywordOutput: zodToJsonSchema(negativeKeywordResponseSchema, 'createNegativeKeywordOutput'),
1050
+ updateNegativeKeywordInput: zodToJsonSchema(updateNegativeKeywordRequestSchema, 'updateNegativeKeywordInput'),
1051
+ bulkCreateNegativeKeywordsInput: zodToJsonSchema(bulkCreateNegativeKeywordRequestSchema, 'bulkCreateNegativeKeywordsInput'),
1052
+ bulkCreateNegativeKeywordsOutput: zodToJsonSchema(bulkCreateNegativeKeywordResponseSchema, 'bulkCreateNegativeKeywordsOutput'),
1053
+ // Suggestions
1054
+ suggestBidsOutput: zodToJsonSchema(z.object({
1055
+ suggestedBids: z.array(suggestedBidsSchema).optional(),
1056
+ }), 'suggestBidsOutput'),
1057
+ suggestKeywordsOutput: zodToJsonSchema(z.object({
1058
+ suggestedKeywords: z.array(suggestedKeywordsSchema).optional(),
1059
+ }), 'suggestKeywordsOutput'),
1060
+ suggestBudgetOutput: zodToJsonSchema(suggestBudgetResponseSchema, 'suggestBudgetOutput'),
1061
+ suggestMaxCpcInput: zodToJsonSchema(suggestMaxCpcRequestSchema, 'suggestMaxCpcInput'),
1062
+ suggestMaxCpcOutput: zodToJsonSchema(suggestMaxCpcResponseSchema, 'suggestMaxCpcOutput'),
1063
+ // Reporting
1064
+ getReportMetadataOutput: zodToJsonSchema(reportMetadatasSchema, 'getReportMetadataOutput'),
1065
+ createReportTaskInput: zodToJsonSchema(createReportTaskSchema, 'createReportTaskInput'),
1066
+ createReportTaskOutput: zodToJsonSchema(z.object({
1067
+ reportTaskId: z.string().optional(),
1068
+ href: z.string().optional(),
1069
+ }), 'createReportTaskOutput'),
1070
+ getReportTasksOutput: zodToJsonSchema(reportTaskPagedCollectionSchema, 'getReportTasksOutput'),
1071
+ getReportTaskDetails: zodToJsonSchema(reportTaskSchema, 'getReportTaskDetails'),
1072
+ getSummaryReportOutput: zodToJsonSchema(summaryReportResponseSchema, 'getSummaryReportOutput'),
1073
+ // Item Promotions (Discounts)
1074
+ getPromotionsOutput: zodToJsonSchema(promotionsPagedCollectionSchema, 'getPromotionsOutput'),
1075
+ getPromotionDetails: zodToJsonSchema(itemPromotionResponseSchema, 'getPromotionDetails'),
1076
+ createItemPromotionInput: zodToJsonSchema(itemPromotionSchema, 'createItemPromotionInput'),
1077
+ createItemPromotionOutput: zodToJsonSchema(z.object({
1078
+ promotionId: z.string().optional(),
1079
+ href: z.string().optional(),
1080
+ }), 'createItemPromotionOutput'),
1081
+ updateItemPromotionInput: zodToJsonSchema(itemPromotionSchema, 'updateItemPromotionInput'),
1082
+ getPromotionListingsOutput: zodToJsonSchema(itemsPagedCollectionSchema, 'getPromotionListingsOutput'),
1083
+ getPromotionReportsOutput: zodToJsonSchema(promotionsReportPagedCollectionSchema, 'getPromotionReportsOutput'),
1084
+ createItemPriceMarkdownInput: zodToJsonSchema(itemPriceMarkdownSchema, 'createItemPriceMarkdownInput'),
1085
+ // Email Campaigns
1086
+ createEmailCampaignInput: zodToJsonSchema(createEmailCampaignRequestSchema, 'createEmailCampaignInput'),
1087
+ createEmailCampaignOutput: zodToJsonSchema(createEmailCampaignResponseSchema, 'createEmailCampaignOutput'),
1088
+ getEmailCampaignsOutput: zodToJsonSchema(getEmailCampaignsResponseSchema, 'getEmailCampaignsOutput'),
1089
+ getEmailCampaignDetails: zodToJsonSchema(getEmailCampaignResponseSchema, 'getEmailCampaignDetails'),
1090
+ getEmailCampaignAudiencesOutput: zodToJsonSchema(getEmailCampaignAudiencesResponseSchema, 'getEmailCampaignAudiencesOutput'),
1091
+ getEmailPreviewOutput: zodToJsonSchema(getEmailPreviewResponseSchema, 'getEmailPreviewOutput'),
1092
+ getEmailReportOutput: zodToJsonSchema(getEmailReportResponseSchema, 'getEmailReportOutput'),
1093
+ // Recommendations
1094
+ findListingRecommendationsInput: zodToJsonSchema(findListingRecommendationsInputSchema, 'findListingRecommendationsInput'),
1095
+ findListingRecommendationsOutput: zodToJsonSchema(pagedListingRecommendationCollectionSchema, 'findListingRecommendationsOutput'),
1096
+ listingRecommendationDetails: zodToJsonSchema(listingRecommendationSchema, 'listingRecommendationDetails'),
1097
+ // Quick Setup
1098
+ quickSetupInput: zodToJsonSchema(quickSetupRequestSchema, 'quickSetupInput'),
1099
+ // Common schemas
1100
+ error: zodToJsonSchema(errorSchema, 'error'),
1101
+ amount: zodToJsonSchema(amountSchema, 'amount'),
1102
+ };
1103
+ }