ebay-mcp 1.18.0 → 1.18.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.
- package/README.md +24 -35
- package/build/api/account-management/accountV2.js +22 -22
- package/build/api/account-management/finances.js +10 -10
- package/build/api/analytics-and-report/analytics.js +1 -1
- package/build/api/{client.js → client/ebayApiClient.js} +37 -41
- package/build/api/{clientTrading.js → client/tradingApiClient.js} +22 -22
- package/build/api/communication/feedback.js +21 -21
- package/build/api/communication/message.js +23 -23
- package/build/api/communication/negotiation.js +7 -7
- package/build/api/communication/notification.js +52 -52
- package/build/api/developer/developer.js +3 -3
- package/build/api/{index.js → ebaySellerApi.js} +4 -4
- package/build/api/listing-management/feedReportTasks.js +6 -6
- package/build/api/listing-management/feedRequest.js +6 -6
- package/build/api/listing-management/feedSchedules.js +4 -4
- package/build/api/listing-management/feedTasks.js +2 -2
- package/build/api/listing-management/items.js +22 -22
- package/build/api/listing-management/locations.js +4 -4
- package/build/api/listing-management/media.js +14 -14
- package/build/api/listing-management/mediaAttach.js +14 -14
- package/build/api/listing-management/mediaResources.js +15 -13
- package/build/api/listing-management/offerFormat.js +1 -1
- package/build/api/listing-management/offers.js +23 -23
- package/build/api/listing-management/stores.js +9 -9
- package/build/api/listing-metadata/metadata.js +10 -10
- package/build/api/marketing-and-promotions/ads.js +34 -34
- package/build/api/marketing-and-promotions/campaigns.js +19 -19
- package/build/api/marketing-and-promotions/promotions.js +22 -22
- package/build/api/marketing-and-promotions/reports.js +7 -7
- package/build/api/order-management/dispute.js +11 -9
- package/build/api/order-management/fulfillment.js +4 -4
- package/build/api/order-management/logistics.js +7 -7
- package/build/api/other/browseMappers.js +15 -13
- package/build/api/other/browseValidators.js +4 -4
- package/build/api/other/edelivery.js +19 -19
- package/build/api/other/finding.js +13 -13
- package/build/api/other/translation.js +2 -2
- package/build/api/other/vero.js +2 -2
- package/build/api/shared/download.js +7 -7
- package/build/api/shared/request.js +28 -19
- package/build/api/trading/listingFormat.js +37 -30
- package/build/api/trading/trading.js +33 -33
- package/build/auth/credentialSession.js +5 -5
- package/build/auth/oauth.js +3 -3
- package/build/auth/oauthHelper.js +24 -24
- package/build/auth/oauthMetadata.js +4 -4
- package/build/auth/oauthMiddleware.js +16 -16
- package/build/auth/scopeUtils.js +2 -2
- package/build/auth/tokenVerifier.js +23 -23
- package/build/config/environment.js +4 -45
- package/build/config/oauthScopes.js +132 -0
- package/build/index.js +5 -5
- package/build/mcp/httpTransport.js +32 -20
- package/build/mcp/runtime.js +12 -12
- package/build/mcp/toolGating.js +6 -12
- package/build/mcp/uiBridge.js +3 -3
- package/build/schemas/account-management/account.js +2 -52
- package/build/schemas/account-management/accountV2.js +2 -2
- package/build/schemas/account-management/finances.js +1 -1
- package/build/schemas/analytics/analytics.js +2 -48
- package/build/schemas/communication/messages.js +2 -46
- package/build/schemas/developer/developer.js +1 -27
- package/build/schemas/fulfillment/logistics.js +1 -1
- package/build/schemas/fulfillment/orders.js +2 -47
- package/build/schemas/inventory-management/feed.js +1 -1
- package/build/schemas/inventory-management/inventory.js +2 -50
- package/build/schemas/inventory-management/media.js +2 -2
- package/build/schemas/inventory-management/mediaDocuments.js +1 -1
- package/build/schemas/inventory-management/stores.js +1 -1
- package/build/schemas/marketing/ads.js +2 -2
- package/build/schemas/marketing/campaigns.js +2 -2
- package/build/schemas/marketing/common.js +2 -2
- package/build/schemas/marketing/marketing.js +0 -1
- package/build/schemas/marketing/promotions.js +2 -2
- package/build/schemas/marketing/reports.js +2 -2
- package/build/schemas/metadata/metadata.js +2 -90
- package/build/schemas/metadata/shipping.js +1 -1
- package/build/schemas/other/browse.js +2 -2
- package/build/schemas/other/finding.js +2 -2
- package/build/schemas/other/otherApis.js +2 -114
- package/build/schemas/taxonomy/categoryTree.js +1 -1
- package/build/schemas/taxonomy/charity.js +1 -1
- package/build/schemas/taxonomy/taxonomy.js +2 -69
- package/build/scripts/autoSetup.js +3 -3
- package/build/scripts/{buildUi.js → buildMcpApps.js} +13 -13
- package/build/scripts/devSync.js +19 -68
- package/build/scripts/diagnostics.js +15 -16
- package/build/scripts/interactiveSetup.js +25 -25
- package/build/scripts/scopeHelper.js +2 -2
- package/build/scripts/securityChecker.js +20 -20
- package/build/scripts/setup.js +76 -76
- package/build/scripts/setupShared.js +5 -30
- package/build/scripts/setupValidator.js +9 -9
- package/build/scripts/setupWizard.js +23 -23
- package/build/scripts/skills.js +14 -17
- package/build/scripts/specRefs.js +1 -1
- package/build/scripts/specSources.js +144 -0
- package/build/serverHttp.js +4 -7
- package/build/skills/content.js +13 -13
- package/build/skills/install.js +9 -9
- package/build/skills/render.js +2 -2
- package/build/tools/categories/communication.js +1 -1
- package/build/tools/categories/connector.js +19 -16
- package/build/tools/categories/fulfillment.js +4 -4
- package/build/tools/categories/inventory.js +1 -1
- package/build/tools/categories/metadata.js +1 -1
- package/build/tools/categories/taxonomy.js +1 -1
- package/build/tools/categories/tokenManagement.js +8 -8
- package/build/tools/contracts.js +2 -2
- package/build/tools/defineTool.js +27 -12
- package/build/tools/registry.js +2 -2
- package/build/tools/schemas.js +2 -2
- package/build/tools/ui/mapHelpers.js +12 -12
- package/build/tools/ui/maps.js +101 -97
- package/build/tools/ui/viewModels.js +2 -2
- package/build/utils/apiStatusFeed.js +12 -12
- package/build/utils/communication/feedback.js +3 -3
- package/build/utils/communication/message.js +3 -3
- package/build/utils/communication/negotiation.js +3 -3
- package/build/utils/communication/notification.js +3 -3
- package/build/utils/entryModule.js +33 -0
- package/build/utils/envFile.js +47 -0
- package/build/utils/envParser.js +5 -5
- package/build/utils/errors.js +4 -4
- package/build/utils/http.js +38 -38
- package/build/utils/localFeedFiles.js +3 -3
- package/build/utils/logRedaction.js +21 -0
- package/build/utils/logger.js +49 -35
- package/build/utils/other/compliance.js +3 -3
- package/build/utils/other/identity.js +3 -3
- package/build/utils/other/translation.js +3 -3
- package/build/utils/other/vero.js +3 -3
- package/build/utils/schemaHelpers.js +2 -2
- package/build/utils/tokenUtils.js +2 -2
- package/build/utils/trading/trading.js +1 -1
- package/build/utils/version.js +1 -1
- package/build/utils/zodIssues.js +14 -0
- package/package.json +8 -11
- package/README.de.md +0 -426
- package/README.es.md +0 -426
- package/README.fr.md +0 -426
- package/README.ja.md +0 -426
- package/README.ko.md +0 -426
- package/README.pt-BR.md +0 -426
- package/README.ru.md +0 -426
- package/README.zh-CN.md +0 -426
- package/build/schemas/index.js +0 -76
- package/build/schemas/marketing/jsonSchemas.js +0 -118
- package/build/scripts/downloadSpecs.js +0 -117
- package/build/scripts/updateApiStatusDoc.js +0 -71
- package/build/utils/effectSchema.js +0 -203
- package/build/utils/effectSchemaAdapter.js +0 -121
- package/build/utils/effectSchemaChainMethods.js +0 -146
- package/build/utils/effectSchemaRefinements.js +0 -104
- package/build/utils/effectSchemaStringMethods.js +0 -63
- package/build/utils/effectSchemaTypes.js +0 -47
- package/docs/auth/production_scopes.json +0 -111
- package/docs/auth/sandbox_scopes.json +0 -142
- /package/build/api/{clientRequestError.js → client/ebayClientRequestError.js} +0 -0
- /package/build/api/{rateLimitTracker.js → client/rateLimitTracker.js} +0 -0
- /package/build/api/{clientTradingError.js → client/tradingApiFailure.js} +0 -0
|
@@ -10,7 +10,7 @@ export const createMarketingPromotionsMethods = (client) => ({
|
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* ```ts
|
|
13
|
-
* const
|
|
13
|
+
* const createdItemPriceMarkdownPromotion = await Effect.runPromise(marketingApi.createItemPriceMarkdownPromotion({ request: { ... } }));
|
|
14
14
|
* ```
|
|
15
15
|
*
|
|
16
16
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/item_price_markdown/methods/createItemPriceMarkdownPromotion
|
|
@@ -27,7 +27,7 @@ export const createMarketingPromotionsMethods = (client) => ({
|
|
|
27
27
|
*
|
|
28
28
|
* @example
|
|
29
29
|
* ```ts
|
|
30
|
-
* const
|
|
30
|
+
* const itemPriceMarkdownPromotion = await Effect.runPromise(marketingApi.getItemPriceMarkdownPromotion({ promotionId: 'promotion-1' }));
|
|
31
31
|
* ```
|
|
32
32
|
*
|
|
33
33
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/item_price_markdown/methods/getItemPriceMarkdownPromotion
|
|
@@ -44,7 +44,7 @@ export const createMarketingPromotionsMethods = (client) => ({
|
|
|
44
44
|
*
|
|
45
45
|
* @example
|
|
46
46
|
* ```ts
|
|
47
|
-
* const
|
|
47
|
+
* const updatedItemPriceMarkdownPromotion = await Effect.runPromise(marketingApi.updateItemPriceMarkdownPromotion({ promotionId: 'promotion-1', request: { ... } }));
|
|
48
48
|
* ```
|
|
49
49
|
*
|
|
50
50
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/item_price_markdown/methods/updateItemPriceMarkdownPromotion
|
|
@@ -61,7 +61,7 @@ export const createMarketingPromotionsMethods = (client) => ({
|
|
|
61
61
|
*
|
|
62
62
|
* @example
|
|
63
63
|
* ```ts
|
|
64
|
-
*
|
|
64
|
+
* await Effect.runPromise(marketingApi.deleteItemPriceMarkdownPromotion({ promotionId: 'promotion-1' }));
|
|
65
65
|
* ```
|
|
66
66
|
*
|
|
67
67
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/item_price_markdown/methods/deleteItemPriceMarkdownPromotion
|
|
@@ -78,7 +78,7 @@ export const createMarketingPromotionsMethods = (client) => ({
|
|
|
78
78
|
*
|
|
79
79
|
* @example
|
|
80
80
|
* ```ts
|
|
81
|
-
* const
|
|
81
|
+
* const createdItemPromotion = await Effect.runPromise(marketingApi.createItemPromotion({ request: { ... } }));
|
|
82
82
|
* ```
|
|
83
83
|
*
|
|
84
84
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/item_promotion/methods/createItemPromotion
|
|
@@ -95,7 +95,7 @@ export const createMarketingPromotionsMethods = (client) => ({
|
|
|
95
95
|
*
|
|
96
96
|
* @example
|
|
97
97
|
* ```ts
|
|
98
|
-
* const
|
|
98
|
+
* const itemPromotion = await Effect.runPromise(marketingApi.getItemPromotion({ promotionId: 'promotion-1' }));
|
|
99
99
|
* ```
|
|
100
100
|
*
|
|
101
101
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/item_promotion/methods/getItemPromotion
|
|
@@ -112,7 +112,7 @@ export const createMarketingPromotionsMethods = (client) => ({
|
|
|
112
112
|
*
|
|
113
113
|
* @example
|
|
114
114
|
* ```ts
|
|
115
|
-
* const
|
|
115
|
+
* const updatedItemPromotion = await Effect.runPromise(marketingApi.updateItemPromotion({ promotionId: 'promotion-1', request: { ... } }));
|
|
116
116
|
* ```
|
|
117
117
|
*
|
|
118
118
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/item_promotion/methods/updateItemPromotion
|
|
@@ -129,7 +129,7 @@ export const createMarketingPromotionsMethods = (client) => ({
|
|
|
129
129
|
*
|
|
130
130
|
* @example
|
|
131
131
|
* ```ts
|
|
132
|
-
*
|
|
132
|
+
* await Effect.runPromise(marketingApi.deleteItemPromotion({ promotionId: 'promotion-1' }));
|
|
133
133
|
* ```
|
|
134
134
|
*
|
|
135
135
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/item_promotion/methods/deleteItemPromotion
|
|
@@ -146,7 +146,7 @@ export const createMarketingPromotionsMethods = (client) => ({
|
|
|
146
146
|
*
|
|
147
147
|
* @example
|
|
148
148
|
* ```ts
|
|
149
|
-
* const
|
|
149
|
+
* const listingSet = await Effect.runPromise(marketingApi.getListingSet({ promotionId: 'promotion-1' }));
|
|
150
150
|
* ```
|
|
151
151
|
*
|
|
152
152
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/promotion/methods/getListingSet
|
|
@@ -170,7 +170,7 @@ export const createMarketingPromotionsMethods = (client) => ({
|
|
|
170
170
|
*
|
|
171
171
|
* @example
|
|
172
172
|
* ```ts
|
|
173
|
-
* const
|
|
173
|
+
* const promotions = await Effect.runPromise(marketingApi.getPromotions({ marketplaceId: 'marketplace-1' }));
|
|
174
174
|
* ```
|
|
175
175
|
*
|
|
176
176
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/promotion/methods/getPromotions
|
|
@@ -196,7 +196,7 @@ export const createMarketingPromotionsMethods = (client) => ({
|
|
|
196
196
|
*
|
|
197
197
|
* @example
|
|
198
198
|
* ```ts
|
|
199
|
-
*
|
|
199
|
+
* await Effect.runPromise(marketingApi.pausePromotion({ promotionId: 'promotion-1' }));
|
|
200
200
|
* ```
|
|
201
201
|
*
|
|
202
202
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/promotion/methods/pausePromotion
|
|
@@ -213,7 +213,7 @@ export const createMarketingPromotionsMethods = (client) => ({
|
|
|
213
213
|
*
|
|
214
214
|
* @example
|
|
215
215
|
* ```ts
|
|
216
|
-
*
|
|
216
|
+
* await Effect.runPromise(marketingApi.resumePromotion({ promotionId: 'promotion-1' }));
|
|
217
217
|
* ```
|
|
218
218
|
*
|
|
219
219
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/promotion/methods/resumePromotion
|
|
@@ -230,7 +230,7 @@ export const createMarketingPromotionsMethods = (client) => ({
|
|
|
230
230
|
*
|
|
231
231
|
* @example
|
|
232
232
|
* ```ts
|
|
233
|
-
* const
|
|
233
|
+
* const promotionReports = await Effect.runPromise(marketingApi.getPromotionReports({ marketplaceId: 'marketplace-1' }));
|
|
234
234
|
* ```
|
|
235
235
|
*
|
|
236
236
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/promotion_report/methods/getPromotionReports
|
|
@@ -255,7 +255,7 @@ export const createMarketingPromotionsMethods = (client) => ({
|
|
|
255
255
|
*
|
|
256
256
|
* @example
|
|
257
257
|
* ```ts
|
|
258
|
-
* const
|
|
258
|
+
* const promotionSummaryReport = await Effect.runPromise(marketingApi.getPromotionSummaryReport({ marketplaceId: 'marketplace-1' }));
|
|
259
259
|
* ```
|
|
260
260
|
*
|
|
261
261
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/promotion_summary_report/methods/getPromotionSummaryReport
|
|
@@ -275,7 +275,7 @@ export const createMarketingPromotionsMethods = (client) => ({
|
|
|
275
275
|
*
|
|
276
276
|
* @example
|
|
277
277
|
* ```ts
|
|
278
|
-
* const
|
|
278
|
+
* const emailCampaigns = await Effect.runPromise(marketingApi.getEmailCampaigns());
|
|
279
279
|
* ```
|
|
280
280
|
*
|
|
281
281
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/email_campaign/methods/getEmailCampaigns
|
|
@@ -298,7 +298,7 @@ export const createMarketingPromotionsMethods = (client) => ({
|
|
|
298
298
|
*
|
|
299
299
|
* @example
|
|
300
300
|
* ```ts
|
|
301
|
-
* const
|
|
301
|
+
* const createdEmailCampaign = await Effect.runPromise(marketingApi.createEmailCampaign({ marketplaceId: 'EBAY_US', request: { ... } }));
|
|
302
302
|
* ```
|
|
303
303
|
*
|
|
304
304
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/email_campaign/methods/createEmailCampaign
|
|
@@ -316,7 +316,7 @@ export const createMarketingPromotionsMethods = (client) => ({
|
|
|
316
316
|
*
|
|
317
317
|
* @example
|
|
318
318
|
* ```ts
|
|
319
|
-
* const
|
|
319
|
+
* const emailCampaign = await Effect.runPromise(marketingApi.getEmailCampaign({ emailCampaignId: 'emailCampaign-1' }));
|
|
320
320
|
* ```
|
|
321
321
|
*
|
|
322
322
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/email_campaign/methods/getEmailCampaign
|
|
@@ -333,7 +333,7 @@ export const createMarketingPromotionsMethods = (client) => ({
|
|
|
333
333
|
*
|
|
334
334
|
* @example
|
|
335
335
|
* ```ts
|
|
336
|
-
* const
|
|
336
|
+
* const updatedEmailCampaign = await Effect.runPromise(marketingApi.updateEmailCampaign({ emailCampaignId: 'emailCampaign-1', request: { ... } }));
|
|
337
337
|
* ```
|
|
338
338
|
*
|
|
339
339
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/email_campaign/methods/updateEmailCampaign
|
|
@@ -350,7 +350,7 @@ export const createMarketingPromotionsMethods = (client) => ({
|
|
|
350
350
|
*
|
|
351
351
|
* @example
|
|
352
352
|
* ```ts
|
|
353
|
-
*
|
|
353
|
+
* await Effect.runPromise(marketingApi.deleteEmailCampaign({ emailCampaignId: 'emailCampaign-1' }));
|
|
354
354
|
* ```
|
|
355
355
|
*
|
|
356
356
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/email_campaign/methods/deleteEmailCampaign
|
|
@@ -367,7 +367,7 @@ export const createMarketingPromotionsMethods = (client) => ({
|
|
|
367
367
|
*
|
|
368
368
|
* @example
|
|
369
369
|
* ```ts
|
|
370
|
-
* const
|
|
370
|
+
* const audiences = await Effect.runPromise(marketingApi.getAudiences({ emailCampaignType: 'emailCampaignType-1' }));
|
|
371
371
|
* ```
|
|
372
372
|
*
|
|
373
373
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/email_campaign/methods/getAudiences
|
|
@@ -389,7 +389,7 @@ export const createMarketingPromotionsMethods = (client) => ({
|
|
|
389
389
|
*
|
|
390
390
|
* @example
|
|
391
391
|
* ```ts
|
|
392
|
-
* const
|
|
392
|
+
* const emailPreview = await Effect.runPromise(marketingApi.getEmailPreview({ emailCampaignId: 'emailCampaign-1' }));
|
|
393
393
|
* ```
|
|
394
394
|
*
|
|
395
395
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/email_campaign/methods/getEmailPreview
|
|
@@ -406,7 +406,7 @@ export const createMarketingPromotionsMethods = (client) => ({
|
|
|
406
406
|
*
|
|
407
407
|
* @example
|
|
408
408
|
* ```ts
|
|
409
|
-
* const
|
|
409
|
+
* const emailReport = await Effect.runPromise(marketingApi.getEmailReport({ endDate: 'endDate-1', startDate: 'startDate-1' }));
|
|
410
410
|
* ```
|
|
411
411
|
*
|
|
412
412
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/email_campaign/methods/getEmailReport
|
|
@@ -10,7 +10,7 @@ export const createMarketingReportsMethods = (client) => ({
|
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* ```ts
|
|
13
|
-
* const
|
|
13
|
+
* const report = await Effect.runPromise(marketingApi.getReport({ reportId: 'report-1' }));
|
|
14
14
|
* ```
|
|
15
15
|
*
|
|
16
16
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/ad_report/methods/getReport
|
|
@@ -27,7 +27,7 @@ export const createMarketingReportsMethods = (client) => ({
|
|
|
27
27
|
*
|
|
28
28
|
* @example
|
|
29
29
|
* ```ts
|
|
30
|
-
* const
|
|
30
|
+
* const reportMetadata = await Effect.runPromise(marketingApi.getReportMetadata());
|
|
31
31
|
* ```
|
|
32
32
|
*
|
|
33
33
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/ad_report_metadata/methods/getReportMetadata
|
|
@@ -48,7 +48,7 @@ export const createMarketingReportsMethods = (client) => ({
|
|
|
48
48
|
*
|
|
49
49
|
* @example
|
|
50
50
|
* ```ts
|
|
51
|
-
* const
|
|
51
|
+
* const reportMetadata = await Effect.runPromise(marketingApi.getReportMetadataForReportType({ reportType: 'reportType-1' }));
|
|
52
52
|
* ```
|
|
53
53
|
*
|
|
54
54
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/ad_report_metadata/methods/getReportMetadataForReportType
|
|
@@ -69,7 +69,7 @@ export const createMarketingReportsMethods = (client) => ({
|
|
|
69
69
|
*
|
|
70
70
|
* @example
|
|
71
71
|
* ```ts
|
|
72
|
-
* const
|
|
72
|
+
* const reportTasks = await Effect.runPromise(marketingApi.getReportTasks());
|
|
73
73
|
* ```
|
|
74
74
|
*
|
|
75
75
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/ad_report_task/methods/getReportTasks
|
|
@@ -91,7 +91,7 @@ export const createMarketingReportsMethods = (client) => ({
|
|
|
91
91
|
*
|
|
92
92
|
* @example
|
|
93
93
|
* ```ts
|
|
94
|
-
* const
|
|
94
|
+
* const createdReportTask = await Effect.runPromise(marketingApi.createReportTask({ request: { ... } }));
|
|
95
95
|
* ```
|
|
96
96
|
*
|
|
97
97
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/ad_report_task/methods/createReportTask
|
|
@@ -108,7 +108,7 @@ export const createMarketingReportsMethods = (client) => ({
|
|
|
108
108
|
*
|
|
109
109
|
* @example
|
|
110
110
|
* ```ts
|
|
111
|
-
* const
|
|
111
|
+
* const reportTask = await Effect.runPromise(marketingApi.getReportTask({ reportTaskId: 'reportTask-1' }));
|
|
112
112
|
* ```
|
|
113
113
|
*
|
|
114
114
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/ad_report_task/methods/getReportTask
|
|
@@ -125,7 +125,7 @@ export const createMarketingReportsMethods = (client) => ({
|
|
|
125
125
|
*
|
|
126
126
|
* @example
|
|
127
127
|
* ```ts
|
|
128
|
-
*
|
|
128
|
+
* await Effect.runPromise(marketingApi.deleteReportTask({ reportTaskId: 'reportTask-1' }));
|
|
129
129
|
* ```
|
|
130
130
|
*
|
|
131
131
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/ad_report_task/methods/deleteReportTask
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { buildEndpointParams, EndpointInputError, optionalNonNegativeNumberEffect, optionalPositiveNumberEffect, optionalStringEffect, requestGetEffect, requestPostEffect, requireObjectEffect, requireStringEffect, } from '../../api/shared/request.js';
|
|
2
2
|
import { isRecord } from '../../utils/typeGuards.js';
|
|
3
3
|
import { Effect } from 'effect';
|
|
4
|
-
const requireUploadEvidenceFileBodyEffect = (
|
|
5
|
-
if (
|
|
6
|
-
|
|
4
|
+
const requireUploadEvidenceFileBodyEffect = (evidenceFile) => {
|
|
5
|
+
if (evidenceFile instanceof ArrayBuffer ||
|
|
6
|
+
evidenceFile instanceof Uint8Array ||
|
|
7
|
+
isRecord(evidenceFile)) {
|
|
8
|
+
return Effect.succeed(evidenceFile);
|
|
7
9
|
}
|
|
8
10
|
return Effect.fail(new EndpointInputError({
|
|
9
11
|
parameter: 'body',
|
|
@@ -194,9 +196,9 @@ export class DisputeApi {
|
|
|
194
196
|
*/
|
|
195
197
|
uploadEvidenceFile = (input) => Effect.gen(this, function* () {
|
|
196
198
|
const paymentDisputeId = yield* requireStringEffect(input.paymentDisputeId, 'paymentDisputeId');
|
|
197
|
-
const
|
|
199
|
+
const evidenceFile = yield* requireUploadEvidenceFileBodyEffect(input.body);
|
|
198
200
|
const path = `${this.basePath}/payment_dispute/${paymentDisputeId}/upload_evidence_file`;
|
|
199
|
-
return yield* requestPostEffect(this.client, path,
|
|
201
|
+
return yield* requestPostEffect(this.client, path, evidenceFile, {
|
|
200
202
|
headers: { 'Content-Type': 'multipart/form-data' },
|
|
201
203
|
});
|
|
202
204
|
});
|
|
@@ -220,9 +222,9 @@ export class DisputeApi {
|
|
|
220
222
|
*/
|
|
221
223
|
addEvidence = (input) => Effect.gen(this, function* () {
|
|
222
224
|
const paymentDisputeId = yield* requireStringEffect(input.paymentDisputeId, 'paymentDisputeId');
|
|
223
|
-
const
|
|
225
|
+
const addEvidenceRequest = yield* requireObjectEffect(input.body, 'body');
|
|
224
226
|
const path = `${this.basePath}/payment_dispute/${paymentDisputeId}/add_evidence`;
|
|
225
|
-
return yield* requestPostEffect(this.client, path,
|
|
227
|
+
return yield* requestPostEffect(this.client, path, addEvidenceRequest);
|
|
226
228
|
});
|
|
227
229
|
/**
|
|
228
230
|
* Updates evidence on one payment dispute.
|
|
@@ -244,8 +246,8 @@ export class DisputeApi {
|
|
|
244
246
|
*/
|
|
245
247
|
updateEvidence = (input) => Effect.gen(this, function* () {
|
|
246
248
|
const paymentDisputeId = yield* requireStringEffect(input.paymentDisputeId, 'paymentDisputeId');
|
|
247
|
-
const
|
|
249
|
+
const updateEvidenceRequest = yield* requireObjectEffect(input.body, 'body');
|
|
248
250
|
const path = `${this.basePath}/payment_dispute/${paymentDisputeId}/update_evidence`;
|
|
249
|
-
return yield* requestPostEffect(this.client, path,
|
|
251
|
+
return yield* requestPostEffect(this.client, path, updateEvidenceRequest);
|
|
250
252
|
});
|
|
251
253
|
}
|
|
@@ -85,9 +85,9 @@ export class FulfillmentApi {
|
|
|
85
85
|
*/
|
|
86
86
|
createShippingFulfillment = (input) => Effect.gen(this, function* () {
|
|
87
87
|
const orderId = yield* requireStringEffect(input.orderId, 'orderId');
|
|
88
|
-
const
|
|
88
|
+
const fulfillmentDetails = yield* requireObjectEffect(input.body, 'body');
|
|
89
89
|
const path = `${this.basePath}/order/${orderId}/shipping_fulfillment`;
|
|
90
|
-
return yield* requestPostEffect(this.client, path,
|
|
90
|
+
return yield* requestPostEffect(this.client, path, fulfillmentDetails);
|
|
91
91
|
});
|
|
92
92
|
/**
|
|
93
93
|
* Retrieves all shipping fulfillments for one order.
|
|
@@ -156,8 +156,8 @@ export class FulfillmentApi {
|
|
|
156
156
|
*/
|
|
157
157
|
issueRefund = (input) => Effect.gen(this, function* () {
|
|
158
158
|
const orderId = yield* requireStringEffect(input.orderId, 'orderId');
|
|
159
|
-
const
|
|
159
|
+
const refundRequest = yield* requireObjectEffect(input.body, 'body');
|
|
160
160
|
const path = `${this.basePath}/order/${orderId}/issue_refund`;
|
|
161
|
-
return yield* requestPostEffect(this.client, path,
|
|
161
|
+
return yield* requestPostEffect(this.client, path, refundRequest);
|
|
162
162
|
});
|
|
163
163
|
}
|
|
@@ -10,7 +10,7 @@ const marketplaceConfig = (marketplaceId) => marketplaceId === undefined
|
|
|
10
10
|
: { headers: { 'X-EBAY-C-MARKETPLACE-ID': marketplaceId } };
|
|
11
11
|
/**
|
|
12
12
|
* Logistics API - shipping quotes, shipments, and shipping labels (limited release; needs the
|
|
13
|
-
* `sell.logistics` scope). Based on:
|
|
13
|
+
* `sell.logistics` scope). Based on: sell_logistics_v1_oas3.json
|
|
14
14
|
*/
|
|
15
15
|
export class LogisticsApi {
|
|
16
16
|
basePath = '/sell/logistics/v1_beta';
|
|
@@ -38,9 +38,9 @@ export class LogisticsApi {
|
|
|
38
38
|
const path = `${this.basePath}/shipping_quote`;
|
|
39
39
|
return Effect.gen(function* () {
|
|
40
40
|
const endpointInput = yield* requireObjectEffect(input, 'input');
|
|
41
|
-
const
|
|
41
|
+
const shippingQuoteRequest = yield* requireObjectEffect(endpointInput.shippingQuoteRequest, 'shippingQuoteRequest');
|
|
42
42
|
const marketplaceId = yield* optionalStringEffect(endpointInput.marketplaceId, 'marketplaceId');
|
|
43
|
-
return yield* requestPostEffect(client, path,
|
|
43
|
+
return yield* requestPostEffect(client, path, shippingQuoteRequest, marketplaceConfig(marketplaceId));
|
|
44
44
|
});
|
|
45
45
|
};
|
|
46
46
|
/**
|
|
@@ -90,11 +90,11 @@ export class LogisticsApi {
|
|
|
90
90
|
const path = `${this.basePath}/shipment/create_from_shipping_quote`;
|
|
91
91
|
return Effect.gen(function* () {
|
|
92
92
|
const endpointInput = yield* requireObjectEffect(input, 'input');
|
|
93
|
-
const
|
|
94
|
-
yield* requireStringEffect(
|
|
95
|
-
yield* requireStringEffect(
|
|
93
|
+
const shipmentRequest = yield* requireObjectEffect(endpointInput.shipmentRequest, 'shipmentRequest');
|
|
94
|
+
yield* requireStringEffect(shipmentRequest.shippingQuoteId, 'shipmentRequest.shippingQuoteId');
|
|
95
|
+
yield* requireStringEffect(shipmentRequest.rateId, 'shipmentRequest.rateId');
|
|
96
96
|
const marketplaceId = yield* optionalStringEffect(endpointInput.marketplaceId, 'marketplaceId');
|
|
97
|
-
return yield* requestPostEffect(client, path,
|
|
97
|
+
return yield* requestPostEffect(client, path, shipmentRequest, marketplaceConfig(marketplaceId));
|
|
98
98
|
});
|
|
99
99
|
};
|
|
100
100
|
/**
|
|
@@ -6,16 +6,16 @@
|
|
|
6
6
|
import { defined } from '../../utils/objects.js';
|
|
7
7
|
import { isRecord } from '../../utils/typeGuards.js';
|
|
8
8
|
/** Read a Browse money field ({ value, currency }). */
|
|
9
|
-
const parseBrowseMoney = (
|
|
10
|
-
if (!isRecord(
|
|
9
|
+
const parseBrowseMoney = (rawMoney) => {
|
|
10
|
+
if (!isRecord(rawMoney)) {
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
|
-
if (typeof
|
|
14
|
-
return { currency:
|
|
13
|
+
if (typeof rawMoney.value === 'string' && typeof rawMoney.currency === 'string') {
|
|
14
|
+
return { currency: rawMoney.currency, value: rawMoney.value };
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
/** Read a string property when present and non-empty. */
|
|
18
|
-
const optionalString = (
|
|
18
|
+
const optionalString = (rawField) => typeof rawField === 'string' && rawField.length > 0 ? rawField : undefined;
|
|
19
19
|
/** Read a string array property when present. */
|
|
20
20
|
/**
|
|
21
21
|
* Pick the availability container out of a Browse item payload.
|
|
@@ -23,16 +23,18 @@ const optionalString = (value) => typeof value === 'string' && value.length > 0
|
|
|
23
23
|
* eBay returns `estimatedAvailabilities` as either a bare object or a
|
|
24
24
|
* single-element array, depending on the listing.
|
|
25
25
|
*/
|
|
26
|
-
const pickAvailabilityContainer = (
|
|
27
|
-
if (isRecord(
|
|
28
|
-
return
|
|
26
|
+
const pickAvailabilityContainer = (estimatedAvailabilities) => {
|
|
27
|
+
if (isRecord(estimatedAvailabilities)) {
|
|
28
|
+
return estimatedAvailabilities;
|
|
29
29
|
}
|
|
30
|
-
if (Array.isArray(
|
|
31
|
-
return
|
|
30
|
+
if (Array.isArray(estimatedAvailabilities) && isRecord(estimatedAvailabilities[0])) {
|
|
31
|
+
return estimatedAvailabilities[0];
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
const optionalStringArray = (
|
|
35
|
-
|
|
34
|
+
const optionalStringArray = (rawField) => Array.isArray(rawField) &&
|
|
35
|
+
rawField.every((entry) => typeof entry === 'string') &&
|
|
36
|
+
rawField.length > 0
|
|
37
|
+
? rawField
|
|
36
38
|
: undefined;
|
|
37
39
|
/** Seller username and feedback score, both optional on a Browse payload. */
|
|
38
40
|
const pickSeller = (raw) => {
|
|
@@ -118,7 +120,7 @@ export const mapItemSummary = (raw) => {
|
|
|
118
120
|
*
|
|
119
121
|
* @example
|
|
120
122
|
* ```ts
|
|
121
|
-
* const
|
|
123
|
+
* const searchPage = mapSearchActiveItemsResponse(rawJson, { query: 'gpu', offset: 0, limit: 20 });
|
|
122
124
|
* ```
|
|
123
125
|
*/
|
|
124
126
|
export const mapSearchActiveItemsResponse = (raw, context) => {
|
|
@@ -45,17 +45,17 @@ const requireIntegerInRange = (value, parameter, min, max) => {
|
|
|
45
45
|
* are legitimately fractional) closes the gap the MCP schema's `.min(0)`
|
|
46
46
|
* already covers.
|
|
47
47
|
*
|
|
48
|
-
* @param
|
|
48
|
+
* @param priceBound - Optional price bound already validated as a number >= 0.
|
|
49
49
|
* @param parameter - Parameter name used in the tagged error.
|
|
50
50
|
* @returns A tagged input error when the bound is not finite, else undefined.
|
|
51
51
|
*/
|
|
52
|
-
const nonFinitePriceError = (
|
|
53
|
-
if (
|
|
52
|
+
const nonFinitePriceError = (priceBound, parameter) => {
|
|
53
|
+
if (priceBound === undefined || Number.isFinite(priceBound)) {
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
56
|
return new EndpointInputError({
|
|
57
57
|
parameter,
|
|
58
|
-
message: `${parameter} must be a finite number; got ${
|
|
58
|
+
message: `${parameter} must be a finite number; got ${priceBound}`,
|
|
59
59
|
});
|
|
60
60
|
};
|
|
61
61
|
/** Default page size when limit is omitted. */
|
|
@@ -75,8 +75,8 @@ export class EDeliveryApi {
|
|
|
75
75
|
const path = `${this.basePath}/address_preference`;
|
|
76
76
|
return Effect.gen(function* () {
|
|
77
77
|
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
78
|
-
const
|
|
79
|
-
return yield* requestPostEffect(client, path,
|
|
78
|
+
const addressPreference = yield* requireObjectEffect(validatedInput.body, 'body');
|
|
79
|
+
return yield* requestPostEffect(client, path, addressPreference);
|
|
80
80
|
});
|
|
81
81
|
};
|
|
82
82
|
/**
|
|
@@ -116,8 +116,8 @@ export class EDeliveryApi {
|
|
|
116
116
|
const path = `${this.basePath}/consign_preference`;
|
|
117
117
|
return Effect.gen(function* () {
|
|
118
118
|
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
119
|
-
const
|
|
120
|
-
return yield* requestPostEffect(client, path,
|
|
119
|
+
const consignPreference = yield* requireObjectEffect(validatedInput.body, 'body');
|
|
120
|
+
return yield* requestPostEffect(client, path, consignPreference);
|
|
121
121
|
});
|
|
122
122
|
};
|
|
123
123
|
/**
|
|
@@ -250,8 +250,8 @@ export class EDeliveryApi {
|
|
|
250
250
|
const path = `${this.basePath}/bundle`;
|
|
251
251
|
return Effect.gen(function* () {
|
|
252
252
|
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
253
|
-
const
|
|
254
|
-
return yield* requestPostEffect(client, path,
|
|
253
|
+
const bundleRequest = yield* requireObjectEffect(validatedInput.body, 'body');
|
|
254
|
+
return yield* requestPostEffect(client, path, bundleRequest);
|
|
255
255
|
});
|
|
256
256
|
};
|
|
257
257
|
/**
|
|
@@ -340,8 +340,8 @@ export class EDeliveryApi {
|
|
|
340
340
|
const path = `${this.basePath}/package`;
|
|
341
341
|
return Effect.gen(function* () {
|
|
342
342
|
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
343
|
-
const
|
|
344
|
-
return yield* requestPostEffect(client, path,
|
|
343
|
+
const packageRequest = yield* requireObjectEffect(validatedInput.body, 'body');
|
|
344
|
+
return yield* requestPostEffect(client, path, packageRequest);
|
|
345
345
|
});
|
|
346
346
|
};
|
|
347
347
|
/**
|
|
@@ -488,7 +488,7 @@ export class EDeliveryApi {
|
|
|
488
488
|
*
|
|
489
489
|
* @example
|
|
490
490
|
* ```ts
|
|
491
|
-
* const
|
|
491
|
+
* const cancelledPackages = await Effect.runPromise(
|
|
492
492
|
* edeliveryApi.bulkCancelPackages({ body: { requests: { packageIds: 'PKG123' } } }),
|
|
493
493
|
* );
|
|
494
494
|
* ```
|
|
@@ -500,8 +500,8 @@ export class EDeliveryApi {
|
|
|
500
500
|
const path = `${this.basePath}/package/bulk_cancel_packages`;
|
|
501
501
|
return Effect.gen(function* () {
|
|
502
502
|
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
503
|
-
const
|
|
504
|
-
return yield* requestPostEffect(client, path,
|
|
503
|
+
const cancelPackagesRequest = yield* requireObjectEffect(validatedInput.body, 'body');
|
|
504
|
+
return yield* requestPostEffect(client, path, cancelPackagesRequest);
|
|
505
505
|
});
|
|
506
506
|
};
|
|
507
507
|
/**
|
|
@@ -512,7 +512,7 @@ export class EDeliveryApi {
|
|
|
512
512
|
*
|
|
513
513
|
* @example
|
|
514
514
|
* ```ts
|
|
515
|
-
* const
|
|
515
|
+
* const confirmedPackages = await Effect.runPromise(
|
|
516
516
|
* edeliveryApi.bulkConfirmPackages({ body: { requests: { packageIds: 'PKG123' } } }),
|
|
517
517
|
* );
|
|
518
518
|
* ```
|
|
@@ -524,8 +524,8 @@ export class EDeliveryApi {
|
|
|
524
524
|
const path = `${this.basePath}/package/bulk_confirm_packages`;
|
|
525
525
|
return Effect.gen(function* () {
|
|
526
526
|
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
527
|
-
const
|
|
528
|
-
return yield* requestPostEffect(client, path,
|
|
527
|
+
const confirmPackagesRequest = yield* requireObjectEffect(validatedInput.body, 'body');
|
|
528
|
+
return yield* requestPostEffect(client, path, confirmPackagesRequest);
|
|
529
529
|
});
|
|
530
530
|
};
|
|
531
531
|
/**
|
|
@@ -536,7 +536,7 @@ export class EDeliveryApi {
|
|
|
536
536
|
*
|
|
537
537
|
* @example
|
|
538
538
|
* ```ts
|
|
539
|
-
* const
|
|
539
|
+
* const deletedPackages = await Effect.runPromise(
|
|
540
540
|
* edeliveryApi.bulkDeletePackages({ body: { requests: { packageIds: 'PKG123' } } }),
|
|
541
541
|
* );
|
|
542
542
|
* ```
|
|
@@ -548,8 +548,8 @@ export class EDeliveryApi {
|
|
|
548
548
|
const path = `${this.basePath}/package/bulk_delete_packages`;
|
|
549
549
|
return Effect.gen(function* () {
|
|
550
550
|
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
551
|
-
const
|
|
552
|
-
return yield* requestPostEffect(client, path,
|
|
551
|
+
const deletePackagesRequest = yield* requireObjectEffect(validatedInput.body, 'body');
|
|
552
|
+
return yield* requestPostEffect(client, path, deletePackagesRequest);
|
|
553
553
|
});
|
|
554
554
|
};
|
|
555
555
|
/**
|
|
@@ -657,8 +657,8 @@ export class EDeliveryApi {
|
|
|
657
657
|
const path = `${this.basePath}/complaint`;
|
|
658
658
|
return Effect.gen(function* () {
|
|
659
659
|
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
660
|
-
const
|
|
661
|
-
return yield* requestPostEffect(client, path,
|
|
660
|
+
const complaintRequest = yield* requireObjectEffect(validatedInput.body, 'body');
|
|
661
|
+
return yield* requestPostEffect(client, path, complaintRequest);
|
|
662
662
|
});
|
|
663
663
|
};
|
|
664
664
|
}
|
|
@@ -72,26 +72,26 @@ export const buildFindCompletedItemsParams = (input) => {
|
|
|
72
72
|
return params;
|
|
73
73
|
};
|
|
74
74
|
/** Read the first string from a Finding JSON array-or-string field. */
|
|
75
|
-
const firstString = (
|
|
76
|
-
if (typeof
|
|
77
|
-
return
|
|
75
|
+
const firstString = (rawField) => {
|
|
76
|
+
if (typeof rawField === 'string' && rawField.length > 0) {
|
|
77
|
+
return rawField;
|
|
78
78
|
}
|
|
79
|
-
if (Array.isArray(
|
|
80
|
-
return
|
|
79
|
+
if (Array.isArray(rawField) && typeof rawField[0] === 'string' && rawField[0].length > 0) {
|
|
80
|
+
return rawField[0];
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
83
|
/** Read the first object from a Finding JSON array-or-object field. */
|
|
84
|
-
const firstRecord = (
|
|
85
|
-
if (isRecord(
|
|
86
|
-
return
|
|
84
|
+
const firstRecord = (rawField) => {
|
|
85
|
+
if (isRecord(rawField)) {
|
|
86
|
+
return rawField;
|
|
87
87
|
}
|
|
88
|
-
if (Array.isArray(
|
|
89
|
-
return
|
|
88
|
+
if (Array.isArray(rawField) && isRecord(rawField[0])) {
|
|
89
|
+
return rawField[0];
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
92
|
/** Parse a Finding API money field (`@currencyId` + `__value__`). */
|
|
93
|
-
const parseMoney = (
|
|
94
|
-
const money = firstRecord(
|
|
93
|
+
const parseMoney = (rawMoney) => {
|
|
94
|
+
const money = firstRecord(rawMoney);
|
|
95
95
|
if (!money) {
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
@@ -155,7 +155,7 @@ export const mapFindingItem = (raw) => {
|
|
|
155
155
|
*
|
|
156
156
|
* @example
|
|
157
157
|
* ```ts
|
|
158
|
-
* const
|
|
158
|
+
* const soldListings = mapFindCompletedItemsResponse(rawJson, 'iphone 14');
|
|
159
159
|
* ```
|
|
160
160
|
*/
|
|
161
161
|
export const mapFindCompletedItemsResponse = (raw, keywords) => {
|
|
@@ -31,8 +31,8 @@ export class TranslationApi {
|
|
|
31
31
|
const client = this.client;
|
|
32
32
|
const path = `${this.basePath}/translate`;
|
|
33
33
|
return Effect.gen(function* () {
|
|
34
|
-
const
|
|
35
|
-
return yield* requestPostEffect(client, path,
|
|
34
|
+
const translateRequest = yield* requireObjectEffect(input, 'input');
|
|
35
|
+
return yield* requestPostEffect(client, path, translateRequest);
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
38
|
}
|
package/build/api/other/vero.js
CHANGED
|
@@ -31,8 +31,8 @@ export class VeroApi {
|
|
|
31
31
|
const path = `${this.basePath}/vero_report`;
|
|
32
32
|
return Effect.gen(function* () {
|
|
33
33
|
const endpointInput = yield* requireObjectEffect(input, 'input');
|
|
34
|
-
const
|
|
35
|
-
return yield* requestPostEffect(client, path,
|
|
34
|
+
const veroReport = yield* requireObjectEffect(endpointInput.reportData, 'reportData');
|
|
35
|
+
return yield* requestPostEffect(client, path, veroReport);
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
38
|
/**
|