ebay-mcp 1.14.0 → 1.14.2

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 (41) hide show
  1. package/README.de.md +5 -0
  2. package/README.es.md +5 -0
  3. package/README.fr.md +5 -0
  4. package/README.ja.md +5 -0
  5. package/README.ko.md +5 -0
  6. package/README.md +1 -0
  7. package/README.pt-BR.md +5 -0
  8. package/README.ru.md +5 -0
  9. package/README.zh-CN.md +5 -0
  10. package/build/api/clientTrading.js +2 -3
  11. package/build/api/listing-management/inventory.js +7 -888
  12. package/build/api/listing-management/items.js +408 -0
  13. package/build/api/listing-management/locations.js +172 -0
  14. package/build/api/listing-management/offers.js +284 -0
  15. package/build/api/listing-management/shared.js +1 -0
  16. package/build/api/marketing-and-promotions/ads.js +621 -0
  17. package/build/api/marketing-and-promotions/campaigns.js +362 -0
  18. package/build/api/marketing-and-promotions/marketing.js +8 -1530
  19. package/build/api/marketing-and-promotions/promotions.js +422 -0
  20. package/build/api/marketing-and-promotions/reports.js +137 -0
  21. package/build/api/marketing-and-promotions/shared.js +4 -0
  22. package/build/{utils → auth}/oauthHelper.js +1 -1
  23. package/build/config/environment.js +56 -0
  24. package/build/schemas/marketing/ads.js +769 -0
  25. package/build/schemas/marketing/campaigns.js +361 -0
  26. package/build/schemas/marketing/common.js +152 -0
  27. package/build/schemas/marketing/jsonSchemas.js +118 -0
  28. package/build/schemas/marketing/marketing.js +10 -2016
  29. package/build/schemas/marketing/promotions.js +480 -0
  30. package/build/schemas/marketing/reports.js +162 -0
  31. package/build/scripts/devSync.js +28 -23
  32. package/build/scripts/diagnostics.js +3 -3
  33. package/build/scripts/interactiveSetup.js +4 -4
  34. package/build/{utils → scripts}/scopeHelper.js +1 -1
  35. package/build/{utils → scripts}/securityChecker.js +1 -1
  36. package/build/scripts/setup.js +4 -4
  37. package/build/{utils → scripts}/setupValidator.js +2 -2
  38. package/build/{utils → scripts}/setupWizard.js +1 -1
  39. package/package.json +1 -1
  40. package/build/tools/tool-handlers/types.js +0 -1
  41. /package/build/tools/{definitions/types.js → types.js} +0 -0
@@ -0,0 +1,362 @@
1
+ import { buildEndpointParams, requestDeleteEffect, requestGetEffect, requestPostEffect, } from '../../api/shared/request.js';
2
+ import { MARKETING_BASE_PATH, marketplaceHeader, } from './shared.js';
3
+ /** Marketing API — campaigns methods closed over a shared client. */
4
+ export const createMarketingCampaignsMethods = (client) => ({
5
+ /**
6
+ * Clone campaign through the eBay Marketing API.
7
+ *
8
+ * @param input - Path, query, header, and request body values for cloneCampaign.
9
+ * @returns An Effect that succeeds with eBay's generated cloneCampaign response DTO.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const response = await Effect.runPromise(marketingApi.cloneCampaign({ campaignId: 'campaign-1', request: { ... } }));
14
+ * ```
15
+ *
16
+ * @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/cloneCampaign
17
+ */
18
+ cloneCampaign: (input) => {
19
+ const path = `${MARKETING_BASE_PATH}/ad_campaign/${input.campaignId}/clone`;
20
+ return requestPostEffect(client, path, input.request);
21
+ },
22
+ /**
23
+ * Get campaigns through the eBay Marketing API.
24
+ *
25
+ * @param input - Path, query, header, and request body values for getCampaigns.
26
+ * @returns An Effect that succeeds with eBay's generated getCampaigns response DTO.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * const response = await Effect.runPromise(marketingApi.getCampaigns());
31
+ * ```
32
+ *
33
+ * @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/getCampaigns
34
+ */
35
+ getCampaigns: (input = {}) => {
36
+ const path = `${MARKETING_BASE_PATH}/ad_campaign`;
37
+ const params = buildEndpointParams({
38
+ campaignName: { wireName: 'campaign_name', value: input.campaignName },
39
+ campaignStatus: { wireName: 'campaign_status', value: input.campaignStatus },
40
+ campaignTargetingTypes: {
41
+ wireName: 'campaign_targeting_types',
42
+ value: input.campaignTargetingTypes,
43
+ },
44
+ channels: { wireName: 'channels', value: input.channels },
45
+ endDateRange: { wireName: 'end_date_range', value: input.endDateRange },
46
+ fundingStrategy: { wireName: 'funding_strategy', value: input.fundingStrategy },
47
+ limit: { wireName: 'limit', value: input.limit },
48
+ offset: { wireName: 'offset', value: input.offset },
49
+ startDateRange: { wireName: 'start_date_range', value: input.startDateRange },
50
+ });
51
+ return requestGetEffect(client, path, params);
52
+ },
53
+ /**
54
+ * Create campaign through the eBay Marketing API.
55
+ *
56
+ * @param input - Path, query, header, and request body values for createCampaign.
57
+ * @returns An Effect that succeeds with eBay's generated createCampaign response DTO.
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * const response = await Effect.runPromise(marketingApi.createCampaign({ request: { ... } }));
62
+ * ```
63
+ *
64
+ * @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/createCampaign
65
+ */
66
+ createCampaign: (input) => {
67
+ const path = `${MARKETING_BASE_PATH}/ad_campaign`;
68
+ return requestPostEffect(client, path, input.request);
69
+ },
70
+ /**
71
+ * Get campaign through the eBay Marketing API.
72
+ *
73
+ * @param input - Path, query, header, and request body values for getCampaign.
74
+ * @returns An Effect that succeeds with eBay's generated getCampaign response DTO.
75
+ *
76
+ * @example
77
+ * ```ts
78
+ * const response = await Effect.runPromise(marketingApi.getCampaign({ campaignId: 'campaign-1' }));
79
+ * ```
80
+ *
81
+ * @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/getCampaign
82
+ */
83
+ getCampaign: (input) => {
84
+ const path = `${MARKETING_BASE_PATH}/ad_campaign/${input.campaignId}`;
85
+ return requestGetEffect(client, path);
86
+ },
87
+ /**
88
+ * Delete campaign through the eBay Marketing API.
89
+ *
90
+ * @param input - Path, query, header, and request body values for deleteCampaign.
91
+ * @returns An Effect that succeeds with eBay's generated deleteCampaign response DTO.
92
+ *
93
+ * @example
94
+ * ```ts
95
+ * const response = await Effect.runPromise(marketingApi.deleteCampaign({ campaignId: 'campaign-1' }));
96
+ * ```
97
+ *
98
+ * @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/deleteCampaign
99
+ */
100
+ deleteCampaign: (input) => {
101
+ const path = `${MARKETING_BASE_PATH}/ad_campaign/${input.campaignId}`;
102
+ return requestDeleteEffect(client, path);
103
+ },
104
+ /**
105
+ * End campaign through the eBay Marketing API.
106
+ *
107
+ * @param input - Path, query, header, and request body values for endCampaign.
108
+ * @returns An Effect that succeeds with eBay's generated endCampaign response DTO.
109
+ *
110
+ * @example
111
+ * ```ts
112
+ * const response = await Effect.runPromise(marketingApi.endCampaign({ campaignId: 'campaign-1' }));
113
+ * ```
114
+ *
115
+ * @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/endCampaign
116
+ */
117
+ endCampaign: (input) => {
118
+ const path = `${MARKETING_BASE_PATH}/ad_campaign/${input.campaignId}/end`;
119
+ return requestPostEffect(client, path);
120
+ },
121
+ /**
122
+ * Find campaign by ad reference through the eBay Marketing API.
123
+ *
124
+ * @param input - Path, query, header, and request body values for findCampaignByAdReference.
125
+ * @returns An Effect that succeeds with eBay's generated findCampaignByAdReference response DTO.
126
+ *
127
+ * @example
128
+ * ```ts
129
+ * const response = await Effect.runPromise(marketingApi.findCampaignByAdReference());
130
+ * ```
131
+ *
132
+ * @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/findCampaignByAdReference
133
+ */
134
+ findCampaignByAdReference: (input = {}) => {
135
+ const path = `${MARKETING_BASE_PATH}/ad_campaign/find_campaign_by_ad_reference`;
136
+ const params = buildEndpointParams({
137
+ inventoryReferenceId: {
138
+ wireName: 'inventory_reference_id',
139
+ value: input.inventoryReferenceId,
140
+ },
141
+ inventoryReferenceType: {
142
+ wireName: 'inventory_reference_type',
143
+ value: input.inventoryReferenceType,
144
+ },
145
+ listingId: { wireName: 'listing_id', value: input.listingId },
146
+ });
147
+ return requestGetEffect(client, path, params);
148
+ },
149
+ /**
150
+ * Get campaign by name through the eBay Marketing API.
151
+ *
152
+ * @param input - Path, query, header, and request body values for getCampaignByName.
153
+ * @returns An Effect that succeeds with eBay's generated getCampaignByName response DTO.
154
+ *
155
+ * @example
156
+ * ```ts
157
+ * const response = await Effect.runPromise(marketingApi.getCampaignByName({ campaignName: 'campaignName-1' }));
158
+ * ```
159
+ *
160
+ * @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/getCampaignByName
161
+ */
162
+ getCampaignByName: (input) => {
163
+ const path = `${MARKETING_BASE_PATH}/ad_campaign/get_campaign_by_name`;
164
+ const params = buildEndpointParams({
165
+ campaignName: { wireName: 'campaign_name', value: input.campaignName },
166
+ });
167
+ return requestGetEffect(client, path, params);
168
+ },
169
+ /**
170
+ * Launch campaign through the eBay Marketing API.
171
+ *
172
+ * @param input - Path, query, header, and request body values for launchCampaign.
173
+ * @returns An Effect that succeeds with eBay's generated launchCampaign response DTO.
174
+ *
175
+ * @example
176
+ * ```ts
177
+ * const response = await Effect.runPromise(marketingApi.launchCampaign({ campaignId: 'campaign-1' }));
178
+ * ```
179
+ *
180
+ * @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/launchCampaign
181
+ */
182
+ launchCampaign: (input) => {
183
+ const path = `${MARKETING_BASE_PATH}/ad_campaign/${input.campaignId}/launch`;
184
+ return requestPostEffect(client, path);
185
+ },
186
+ /**
187
+ * Pause campaign through the eBay Marketing API.
188
+ *
189
+ * @param input - Path, query, header, and request body values for pauseCampaign.
190
+ * @returns An Effect that succeeds with eBay's generated pauseCampaign response DTO.
191
+ *
192
+ * @example
193
+ * ```ts
194
+ * const response = await Effect.runPromise(marketingApi.pauseCampaign({ campaignId: 'campaign-1' }));
195
+ * ```
196
+ *
197
+ * @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/pauseCampaign
198
+ */
199
+ pauseCampaign: (input) => {
200
+ const path = `${MARKETING_BASE_PATH}/ad_campaign/${input.campaignId}/pause`;
201
+ return requestPostEffect(client, path);
202
+ },
203
+ /**
204
+ * Resume campaign through the eBay Marketing API.
205
+ *
206
+ * @param input - Path, query, header, and request body values for resumeCampaign.
207
+ * @returns An Effect that succeeds with eBay's generated resumeCampaign response DTO.
208
+ *
209
+ * @example
210
+ * ```ts
211
+ * const response = await Effect.runPromise(marketingApi.resumeCampaign({ campaignId: 'campaign-1' }));
212
+ * ```
213
+ *
214
+ * @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/resumeCampaign
215
+ */
216
+ resumeCampaign: (input) => {
217
+ const path = `${MARKETING_BASE_PATH}/ad_campaign/${input.campaignId}/resume`;
218
+ return requestPostEffect(client, path);
219
+ },
220
+ /**
221
+ * Setup quick campaign through the eBay Marketing API.
222
+ *
223
+ * @param input - Path, query, header, and request body values for setupQuickCampaign.
224
+ * @returns An Effect that succeeds with eBay's generated setupQuickCampaign response DTO.
225
+ *
226
+ * @example
227
+ * ```ts
228
+ * const response = await Effect.runPromise(marketingApi.setupQuickCampaign({ request: { ... } }));
229
+ * ```
230
+ *
231
+ * @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/setupQuickCampaign
232
+ */
233
+ setupQuickCampaign: (input) => {
234
+ const path = `${MARKETING_BASE_PATH}/ad_campaign/setup_quick_campaign`;
235
+ return requestPostEffect(client, path, input.request);
236
+ },
237
+ /**
238
+ * Suggest budget through the eBay Marketing API.
239
+ *
240
+ * @param input - Path, query, header, and request body values for suggestBudget.
241
+ * @returns An Effect that succeeds with eBay's generated suggestBudget response DTO.
242
+ *
243
+ * @example
244
+ * ```ts
245
+ * const response = await Effect.runPromise(marketingApi.suggestBudget({ marketplaceId: 'EBAY_US' }));
246
+ * ```
247
+ *
248
+ * @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/suggestBudget
249
+ */
250
+ suggestBudget: (input) => {
251
+ const path = `${MARKETING_BASE_PATH}/ad_campaign/suggest_budget`;
252
+ const config = marketplaceHeader(input.marketplaceId);
253
+ return requestGetEffect(client, path, undefined, config);
254
+ },
255
+ /**
256
+ * Suggest items through the eBay Marketing API.
257
+ *
258
+ * @param input - Path, query, header, and request body values for suggestItems.
259
+ * @returns An Effect that succeeds with eBay's generated suggestItems response DTO.
260
+ *
261
+ * @example
262
+ * ```ts
263
+ * const response = await Effect.runPromise(marketingApi.suggestItems({ campaignId: 'campaign-1' }));
264
+ * ```
265
+ *
266
+ * @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/suggestItems
267
+ */
268
+ suggestItems: (input) => {
269
+ const path = `${MARKETING_BASE_PATH}/ad_campaign/${input.campaignId}/suggest_items`;
270
+ const params = buildEndpointParams({
271
+ categoryIds: { wireName: 'category_ids', value: input.categoryIds },
272
+ limit: { wireName: 'limit', value: input.limit },
273
+ offset: { wireName: 'offset', value: input.offset },
274
+ });
275
+ return requestGetEffect(client, path, params);
276
+ },
277
+ /**
278
+ * Suggest max cpc through the eBay Marketing API.
279
+ *
280
+ * @param input - Path, query, header, and request body values for suggestMaxCpc.
281
+ * @returns An Effect that succeeds with eBay's generated suggestMaxCpc response DTO.
282
+ *
283
+ * @example
284
+ * ```ts
285
+ * const response = await Effect.runPromise(marketingApi.suggestMaxCpc({ request: { ... } }));
286
+ * ```
287
+ *
288
+ * @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/suggestMaxCpc
289
+ */
290
+ suggestMaxCpc: (input) => {
291
+ const path = `${MARKETING_BASE_PATH}/ad_campaign/suggest_max_cpc`;
292
+ return requestPostEffect(client, path, input.request);
293
+ },
294
+ /**
295
+ * Update ad rate strategy through the eBay Marketing API.
296
+ *
297
+ * @param input - Path, query, header, and request body values for updateAdRateStrategy.
298
+ * @returns An Effect that succeeds with eBay's generated updateAdRateStrategy response DTO.
299
+ *
300
+ * @example
301
+ * ```ts
302
+ * const response = await Effect.runPromise(marketingApi.updateAdRateStrategy({ campaignId: 'campaign-1', request: { ... } }));
303
+ * ```
304
+ *
305
+ * @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/updateAdRateStrategy
306
+ */
307
+ updateAdRateStrategy: (input) => {
308
+ const path = `${MARKETING_BASE_PATH}/ad_campaign/${input.campaignId}/update_ad_rate_strategy`;
309
+ return requestPostEffect(client, path, input.request);
310
+ },
311
+ /**
312
+ * Update bidding strategy through the eBay Marketing API.
313
+ *
314
+ * @param input - Path, query, header, and request body values for updateBiddingStrategy.
315
+ * @returns An Effect that succeeds with eBay's generated updateBiddingStrategy response DTO.
316
+ *
317
+ * @example
318
+ * ```ts
319
+ * const response = await Effect.runPromise(marketingApi.updateBiddingStrategy({ campaignId: 'campaign-1', request: { ... } }));
320
+ * ```
321
+ *
322
+ * @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/updateBiddingStrategy
323
+ */
324
+ updateBiddingStrategy: (input) => {
325
+ const path = `${MARKETING_BASE_PATH}/ad_campaign/${input.campaignId}/update_bidding_strategy`;
326
+ return requestPostEffect(client, path, input.request);
327
+ },
328
+ /**
329
+ * Update campaign budget through the eBay Marketing API.
330
+ *
331
+ * @param input - Path, query, header, and request body values for updateCampaignBudget.
332
+ * @returns An Effect that succeeds with eBay's generated updateCampaignBudget response DTO.
333
+ *
334
+ * @example
335
+ * ```ts
336
+ * const response = await Effect.runPromise(marketingApi.updateCampaignBudget({ campaignId: 'campaign-1', request: { ... } }));
337
+ * ```
338
+ *
339
+ * @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/updateCampaignBudget
340
+ */
341
+ updateCampaignBudget: (input) => {
342
+ const path = `${MARKETING_BASE_PATH}/ad_campaign/${input.campaignId}/update_campaign_budget`;
343
+ return requestPostEffect(client, path, input.request);
344
+ },
345
+ /**
346
+ * Update campaign identification through the eBay Marketing API.
347
+ *
348
+ * @param input - Path, query, header, and request body values for updateCampaignIdentification.
349
+ * @returns An Effect that succeeds with eBay's generated updateCampaignIdentification response DTO.
350
+ *
351
+ * @example
352
+ * ```ts
353
+ * const response = await Effect.runPromise(marketingApi.updateCampaignIdentification({ campaignId: 'campaign-1', request: { ... } }));
354
+ * ```
355
+ *
356
+ * @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/updateCampaignIdentification
357
+ */
358
+ updateCampaignIdentification: (input) => {
359
+ const path = `${MARKETING_BASE_PATH}/ad_campaign/${input.campaignId}/update_campaign_identification`;
360
+ return requestPostEffect(client, path, input.request);
361
+ },
362
+ });