ebay-mcp 1.17.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 +92 -53
- package/build/api/account-management/accountV2.js +347 -0
- package/build/api/account-management/finances.js +289 -0
- package/build/api/analytics-and-report/analytics.js +1 -1
- package/build/api/{client.js → client/ebayApiClient.js} +83 -36
- 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} +28 -4
- package/build/api/listing-management/feed.js +91 -0
- package/build/api/listing-management/feedReportTasks.js +107 -0
- package/build/api/listing-management/feedRequest.js +91 -0
- package/build/api/listing-management/feedSchedules.js +95 -0
- package/build/api/listing-management/feedTasks.js +91 -0
- 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 +22 -39
- 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 +203 -0
- package/build/api/listing-metadata/charity.js +76 -0
- package/build/api/listing-metadata/metadata.js +31 -11
- package/build/api/listing-metadata/metadataShipping.js +117 -0
- package/build/api/listing-metadata/taxonomy.js +52 -7
- package/build/api/marketing-and-promotions/ads.js +34 -34
- package/build/api/marketing-and-promotions/campaigns.js +21 -21
- package/build/api/marketing-and-promotions/promotions.js +24 -24
- package/build/api/marketing-and-promotions/reports.js +7 -7
- package/build/api/marketing-and-promotions/shared.js +0 -3
- 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 +150 -0
- 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 +79 -0
- package/build/api/shared/location.js +33 -0
- package/build/api/shared/request.js +69 -11
- 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 +24 -3
- package/build/auth/tokenVerifier.js +23 -23
- package/build/config/environment.js +10 -45
- package/build/config/oauthScopes.js +132 -0
- package/build/config/toolFamilies.js +4 -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 +294 -0
- package/build/schemas/account-management/finances.js +143 -0
- 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 +115 -0
- package/build/schemas/fulfillment/orders.js +2 -47
- package/build/schemas/inventory-management/feed.js +217 -0
- 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 +42 -0
- 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 +16 -0
- 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 +8 -0
- package/build/schemas/taxonomy/charity.js +41 -0
- 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 +34 -70
- 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 +55 -0
- 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/registrySnapshot.js +7 -3
- package/build/skills/render.js +2 -2
- package/build/tools/categories/accountV2.js +106 -0
- package/build/tools/categories/charity.js +21 -0
- package/build/tools/categories/communication.js +1 -1
- package/build/tools/categories/connector.js +19 -16
- package/build/tools/categories/feed.js +183 -0
- package/build/tools/categories/finances.js +86 -0
- package/build/tools/categories/fulfillment.js +4 -4
- package/build/tools/categories/index.js +12 -2
- package/build/tools/categories/inventory.js +1 -1
- package/build/tools/categories/logistics.js +52 -0
- package/build/tools/categories/metadata.js +38 -1
- package/build/tools/categories/stores.js +64 -0
- package/build/tools/categories/taxonomy.js +18 -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/fileResult.js +30 -0
- 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 +60 -41
- package/build/utils/localFeedFiles.js +61 -0
- package/build/utils/localMedia.js +18 -6
- package/build/utils/logRedaction.js +21 -0
- package/build/utils/logger.js +52 -33
- 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 +9 -12
- package/README.de.md +0 -422
- package/README.es.md +0 -422
- package/README.fr.md +0 -422
- package/README.ja.md +0 -422
- package/README.ko.md +0 -422
- package/README.pt-BR.md +0 -422
- package/README.ru.md +0 -422
- package/README.zh-CN.md +0 -422
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { buildEndpointParams, requestDeleteEffect, requestGetEffect, requestPostEffect, } from '../../api/shared/request.js';
|
|
2
|
-
import { MARKETING_BASE_PATH
|
|
1
|
+
import { buildEndpointParams, marketplaceHeader, requestDeleteEffect, requestGetEffect, requestPostEffect, } from '../../api/shared/request.js';
|
|
2
|
+
import { MARKETING_BASE_PATH } from './shared.js';
|
|
3
3
|
/** Marketing API — campaigns methods closed over a shared client. */
|
|
4
4
|
export const createMarketingCampaignsMethods = (client) => ({
|
|
5
5
|
/**
|
|
@@ -10,7 +10,7 @@ export const createMarketingCampaignsMethods = (client) => ({
|
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* ```ts
|
|
13
|
-
* const
|
|
13
|
+
* const clonedCampaign = await Effect.runPromise(marketingApi.cloneCampaign({ campaignId: 'campaign-1', request: { ... } }));
|
|
14
14
|
* ```
|
|
15
15
|
*
|
|
16
16
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/cloneCampaign
|
|
@@ -27,7 +27,7 @@ export const createMarketingCampaignsMethods = (client) => ({
|
|
|
27
27
|
*
|
|
28
28
|
* @example
|
|
29
29
|
* ```ts
|
|
30
|
-
* const
|
|
30
|
+
* const campaigns = await Effect.runPromise(marketingApi.getCampaigns());
|
|
31
31
|
* ```
|
|
32
32
|
*
|
|
33
33
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/getCampaigns
|
|
@@ -58,7 +58,7 @@ export const createMarketingCampaignsMethods = (client) => ({
|
|
|
58
58
|
*
|
|
59
59
|
* @example
|
|
60
60
|
* ```ts
|
|
61
|
-
* const
|
|
61
|
+
* const createdCampaign = await Effect.runPromise(marketingApi.createCampaign({ request: { ... } }));
|
|
62
62
|
* ```
|
|
63
63
|
*
|
|
64
64
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/createCampaign
|
|
@@ -75,7 +75,7 @@ export const createMarketingCampaignsMethods = (client) => ({
|
|
|
75
75
|
*
|
|
76
76
|
* @example
|
|
77
77
|
* ```ts
|
|
78
|
-
* const
|
|
78
|
+
* const campaign = await Effect.runPromise(marketingApi.getCampaign({ campaignId: 'campaign-1' }));
|
|
79
79
|
* ```
|
|
80
80
|
*
|
|
81
81
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/getCampaign
|
|
@@ -92,7 +92,7 @@ export const createMarketingCampaignsMethods = (client) => ({
|
|
|
92
92
|
*
|
|
93
93
|
* @example
|
|
94
94
|
* ```ts
|
|
95
|
-
*
|
|
95
|
+
* await Effect.runPromise(marketingApi.deleteCampaign({ campaignId: 'campaign-1' }));
|
|
96
96
|
* ```
|
|
97
97
|
*
|
|
98
98
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/deleteCampaign
|
|
@@ -109,7 +109,7 @@ export const createMarketingCampaignsMethods = (client) => ({
|
|
|
109
109
|
*
|
|
110
110
|
* @example
|
|
111
111
|
* ```ts
|
|
112
|
-
*
|
|
112
|
+
* await Effect.runPromise(marketingApi.endCampaign({ campaignId: 'campaign-1' }));
|
|
113
113
|
* ```
|
|
114
114
|
*
|
|
115
115
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/endCampaign
|
|
@@ -126,7 +126,7 @@ export const createMarketingCampaignsMethods = (client) => ({
|
|
|
126
126
|
*
|
|
127
127
|
* @example
|
|
128
128
|
* ```ts
|
|
129
|
-
* const
|
|
129
|
+
* const campaigns = await Effect.runPromise(marketingApi.findCampaignByAdReference());
|
|
130
130
|
* ```
|
|
131
131
|
*
|
|
132
132
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/findCampaignByAdReference
|
|
@@ -154,7 +154,7 @@ export const createMarketingCampaignsMethods = (client) => ({
|
|
|
154
154
|
*
|
|
155
155
|
* @example
|
|
156
156
|
* ```ts
|
|
157
|
-
* const
|
|
157
|
+
* const campaign = await Effect.runPromise(marketingApi.getCampaignByName({ campaignName: 'campaignName-1' }));
|
|
158
158
|
* ```
|
|
159
159
|
*
|
|
160
160
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/getCampaignByName
|
|
@@ -174,7 +174,7 @@ export const createMarketingCampaignsMethods = (client) => ({
|
|
|
174
174
|
*
|
|
175
175
|
* @example
|
|
176
176
|
* ```ts
|
|
177
|
-
*
|
|
177
|
+
* await Effect.runPromise(marketingApi.launchCampaign({ campaignId: 'campaign-1' }));
|
|
178
178
|
* ```
|
|
179
179
|
*
|
|
180
180
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/launchCampaign
|
|
@@ -191,7 +191,7 @@ export const createMarketingCampaignsMethods = (client) => ({
|
|
|
191
191
|
*
|
|
192
192
|
* @example
|
|
193
193
|
* ```ts
|
|
194
|
-
*
|
|
194
|
+
* await Effect.runPromise(marketingApi.pauseCampaign({ campaignId: 'campaign-1' }));
|
|
195
195
|
* ```
|
|
196
196
|
*
|
|
197
197
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/pauseCampaign
|
|
@@ -208,7 +208,7 @@ export const createMarketingCampaignsMethods = (client) => ({
|
|
|
208
208
|
*
|
|
209
209
|
* @example
|
|
210
210
|
* ```ts
|
|
211
|
-
*
|
|
211
|
+
* await Effect.runPromise(marketingApi.resumeCampaign({ campaignId: 'campaign-1' }));
|
|
212
212
|
* ```
|
|
213
213
|
*
|
|
214
214
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/resumeCampaign
|
|
@@ -225,7 +225,7 @@ export const createMarketingCampaignsMethods = (client) => ({
|
|
|
225
225
|
*
|
|
226
226
|
* @example
|
|
227
227
|
* ```ts
|
|
228
|
-
* const
|
|
228
|
+
* const quickCampaign = await Effect.runPromise(marketingApi.setupQuickCampaign({ request: { ... } }));
|
|
229
229
|
* ```
|
|
230
230
|
*
|
|
231
231
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/setupQuickCampaign
|
|
@@ -242,7 +242,7 @@ export const createMarketingCampaignsMethods = (client) => ({
|
|
|
242
242
|
*
|
|
243
243
|
* @example
|
|
244
244
|
* ```ts
|
|
245
|
-
* const
|
|
245
|
+
* const suggestedBudget = await Effect.runPromise(marketingApi.suggestBudget({ marketplaceId: 'EBAY_US' }));
|
|
246
246
|
* ```
|
|
247
247
|
*
|
|
248
248
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/suggestBudget
|
|
@@ -260,7 +260,7 @@ export const createMarketingCampaignsMethods = (client) => ({
|
|
|
260
260
|
*
|
|
261
261
|
* @example
|
|
262
262
|
* ```ts
|
|
263
|
-
* const
|
|
263
|
+
* const suggestedItems = await Effect.runPromise(marketingApi.suggestItems({ campaignId: 'campaign-1' }));
|
|
264
264
|
* ```
|
|
265
265
|
*
|
|
266
266
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/suggestItems
|
|
@@ -282,7 +282,7 @@ export const createMarketingCampaignsMethods = (client) => ({
|
|
|
282
282
|
*
|
|
283
283
|
* @example
|
|
284
284
|
* ```ts
|
|
285
|
-
* const
|
|
285
|
+
* const suggestedMaxCpc = await Effect.runPromise(marketingApi.suggestMaxCpc({ request: { ... } }));
|
|
286
286
|
* ```
|
|
287
287
|
*
|
|
288
288
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/suggestMaxCpc
|
|
@@ -299,7 +299,7 @@ export const createMarketingCampaignsMethods = (client) => ({
|
|
|
299
299
|
*
|
|
300
300
|
* @example
|
|
301
301
|
* ```ts
|
|
302
|
-
*
|
|
302
|
+
* await Effect.runPromise(marketingApi.updateAdRateStrategy({ campaignId: 'campaign-1', request: { ... } }));
|
|
303
303
|
* ```
|
|
304
304
|
*
|
|
305
305
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/updateAdRateStrategy
|
|
@@ -316,7 +316,7 @@ export const createMarketingCampaignsMethods = (client) => ({
|
|
|
316
316
|
*
|
|
317
317
|
* @example
|
|
318
318
|
* ```ts
|
|
319
|
-
*
|
|
319
|
+
* await Effect.runPromise(marketingApi.updateBiddingStrategy({ campaignId: 'campaign-1', request: { ... } }));
|
|
320
320
|
* ```
|
|
321
321
|
*
|
|
322
322
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/updateBiddingStrategy
|
|
@@ -333,7 +333,7 @@ export const createMarketingCampaignsMethods = (client) => ({
|
|
|
333
333
|
*
|
|
334
334
|
* @example
|
|
335
335
|
* ```ts
|
|
336
|
-
* const
|
|
336
|
+
* const updatedCampaignBudget = await Effect.runPromise(marketingApi.updateCampaignBudget({ campaignId: 'campaign-1', request: { ... } }));
|
|
337
337
|
* ```
|
|
338
338
|
*
|
|
339
339
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/updateCampaignBudget
|
|
@@ -350,7 +350,7 @@ export const createMarketingCampaignsMethods = (client) => ({
|
|
|
350
350
|
*
|
|
351
351
|
* @example
|
|
352
352
|
* ```ts
|
|
353
|
-
*
|
|
353
|
+
* await Effect.runPromise(marketingApi.updateCampaignIdentification({ campaignId: 'campaign-1', request: { ... } }));
|
|
354
354
|
* ```
|
|
355
355
|
*
|
|
356
356
|
* @see https://developer.ebay.com/api-docs/sell/marketing/resources/campaign/methods/updateCampaignIdentification
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { buildEndpointParams, requestDeleteEffect, requestGetEffect, requestPostEffect, requestPutEffect, } from '../../api/shared/request.js';
|
|
2
|
-
import { MARKETING_BASE_PATH
|
|
1
|
+
import { buildEndpointParams, marketplaceHeader, requestDeleteEffect, requestGetEffect, requestPostEffect, requestPutEffect, } from '../../api/shared/request.js';
|
|
2
|
+
import { MARKETING_BASE_PATH } from './shared.js';
|
|
3
3
|
/** Marketing API — promotions methods closed over a shared client. */
|
|
4
4
|
export const createMarketingPromotionsMethods = (client) => ({
|
|
5
5
|
/**
|
|
@@ -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
|
}
|