ebay-mcp 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +586 -0
- package/build/api/account-management/account.d.ts +216 -0
- package/build/api/account-management/account.js +305 -0
- package/build/api/analytics-and-report/analytics.d.ts +33 -0
- package/build/api/analytics-and-report/analytics.js +102 -0
- package/build/api/client.d.ts +89 -0
- package/build/api/client.js +343 -0
- package/build/api/communication/feedback.d.ts +45 -0
- package/build/api/communication/feedback.js +119 -0
- package/build/api/communication/message.d.ts +55 -0
- package/build/api/communication/message.js +131 -0
- package/build/api/communication/negotiation.d.ts +39 -0
- package/build/api/communication/negotiation.js +97 -0
- package/build/api/communication/notification.d.ts +128 -0
- package/build/api/communication/notification.js +373 -0
- package/build/api/index.d.ts +96 -0
- package/build/api/index.js +121 -0
- package/build/api/listing-management/inventory.d.ts +216 -0
- package/build/api/listing-management/inventory.js +633 -0
- package/build/api/listing-metadata/metadata.d.ts +154 -0
- package/build/api/listing-metadata/metadata.js +485 -0
- package/build/api/listing-metadata/taxonomy.d.ts +38 -0
- package/build/api/listing-metadata/taxonomy.js +58 -0
- package/build/api/marketing-and-promotions/marketing.d.ts +395 -0
- package/build/api/marketing-and-promotions/marketing.js +565 -0
- package/build/api/marketing-and-promotions/recommendation.d.ts +20 -0
- package/build/api/marketing-and-promotions/recommendation.js +32 -0
- package/build/api/order-management/dispute.d.ts +65 -0
- package/build/api/order-management/dispute.js +69 -0
- package/build/api/order-management/fulfillment.d.ts +80 -0
- package/build/api/order-management/fulfillment.js +89 -0
- package/build/api/other/compliance.d.ts +26 -0
- package/build/api/other/compliance.js +47 -0
- package/build/api/other/edelivery.d.ts +153 -0
- package/build/api/other/edelivery.js +219 -0
- package/build/api/other/identity.d.ts +17 -0
- package/build/api/other/identity.js +24 -0
- package/build/api/other/translation.d.ts +14 -0
- package/build/api/other/translation.js +22 -0
- package/build/api/other/vero.d.ts +30 -0
- package/build/api/other/vero.js +48 -0
- package/build/auth/oauth-metadata.d.ts +46 -0
- package/build/auth/oauth-metadata.js +59 -0
- package/build/auth/oauth-middleware.d.ts +35 -0
- package/build/auth/oauth-middleware.js +99 -0
- package/build/auth/oauth-types.d.ts +66 -0
- package/build/auth/oauth-types.js +4 -0
- package/build/auth/oauth.d.ts +93 -0
- package/build/auth/oauth.js +383 -0
- package/build/auth/scope-utils.d.ts +70 -0
- package/build/auth/scope-utils.js +304 -0
- package/build/auth/token-verifier.d.ts +57 -0
- package/build/auth/token-verifier.js +172 -0
- package/build/config/environment.d.ts +61 -0
- package/build/config/environment.js +260 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +98 -0
- package/build/schemas/account-management/account.d.ts +5324 -0
- package/build/schemas/account-management/account.js +366 -0
- package/build/schemas/analytics/analytics.d.ts +167 -0
- package/build/schemas/analytics/analytics.js +191 -0
- package/build/schemas/communication/messages.d.ts +1872 -0
- package/build/schemas/communication/messages.js +348 -0
- package/build/schemas/fulfillment/orders.d.ts +4655 -0
- package/build/schemas/fulfillment/orders.js +317 -0
- package/build/schemas/index.d.ts +2100 -0
- package/build/schemas/index.js +68 -0
- package/build/schemas/inventory-management/inventory.d.ts +6419 -0
- package/build/schemas/inventory-management/inventory.js +450 -0
- package/build/schemas/marketing/marketing.d.ts +14181 -0
- package/build/schemas/marketing/marketing.js +1088 -0
- package/build/schemas/metadata/metadata.d.ts +5259 -0
- package/build/schemas/metadata/metadata.js +614 -0
- package/build/schemas/other/other-apis.d.ts +257 -0
- package/build/schemas/other/other-apis.js +372 -0
- package/build/schemas/taxonomy/taxonomy.d.ts +215 -0
- package/build/schemas/taxonomy/taxonomy.js +571 -0
- package/build/scripts/auto-setup.d.ts +12 -0
- package/build/scripts/auto-setup.js +277 -0
- package/build/scripts/diagnostics.d.ts +8 -0
- package/build/scripts/diagnostics.js +299 -0
- package/build/scripts/download-specs.d.ts +1 -0
- package/build/scripts/download-specs.js +116 -0
- package/build/scripts/interactive-setup.d.ts +21 -0
- package/build/scripts/interactive-setup.js +723 -0
- package/build/server-http.d.ts +11 -0
- package/build/server-http.js +361 -0
- package/build/tools/definitions/account-with-schemas.d.ts +39 -0
- package/build/tools/definitions/account-with-schemas.js +170 -0
- package/build/tools/definitions/account.d.ts +12 -0
- package/build/tools/definitions/account.js +428 -0
- package/build/tools/definitions/analytics.d.ts +25 -0
- package/build/tools/definitions/analytics.js +66 -0
- package/build/tools/definitions/communication.d.ts +12 -0
- package/build/tools/definitions/communication.js +151 -0
- package/build/tools/definitions/fulfillment.d.ts +12 -0
- package/build/tools/definitions/fulfillment.js +326 -0
- package/build/tools/definitions/index.d.ts +25 -0
- package/build/tools/definitions/index.js +37 -0
- package/build/tools/definitions/inventory.d.ts +12 -0
- package/build/tools/definitions/inventory.js +429 -0
- package/build/tools/definitions/marketing.d.ts +12 -0
- package/build/tools/definitions/marketing.js +1095 -0
- package/build/tools/definitions/metadata.d.ts +12 -0
- package/build/tools/definitions/metadata.js +188 -0
- package/build/tools/definitions/other.d.ts +13 -0
- package/build/tools/definitions/other.js +309 -0
- package/build/tools/definitions/taxonomy.d.ts +25 -0
- package/build/tools/definitions/taxonomy.js +64 -0
- package/build/tools/definitions/token-management.d.ts +35 -0
- package/build/tools/definitions/token-management.js +103 -0
- package/build/tools/index.d.ts +11 -0
- package/build/tools/index.js +1003 -0
- package/build/tools/schemas.d.ts +14764 -0
- package/build/tools/schemas.js +667 -0
- package/build/tools/tool-definitions.d.ts +35 -0
- package/build/tools/tool-definitions.js +3534 -0
- package/build/types/application-settings/developerAnalyticsV1BetaOas3.d.ts +197 -0
- package/build/types/application-settings/developerAnalyticsV1BetaOas3.js +5 -0
- package/build/types/application-settings/developerClientRegistrationV1Oas3.d.ts +155 -0
- package/build/types/application-settings/developerClientRegistrationV1Oas3.js +5 -0
- package/build/types/application-settings/developerKeyManagementV1Oas3.d.ts +246 -0
- package/build/types/application-settings/developerKeyManagementV1Oas3.js +5 -0
- package/build/types/ebay-enums.d.ts +1204 -0
- package/build/types/ebay-enums.js +1330 -0
- package/build/types/ebay.d.ts +143 -0
- package/build/types/ebay.js +123 -0
- package/build/types/index.d.ts +6 -0
- package/build/types/index.js +10 -0
- package/build/types/sell-apps/account-management/sellAccountV1Oas3.d.ts +2579 -0
- package/build/types/sell-apps/account-management/sellAccountV1Oas3.js +5 -0
- package/build/types/sell-apps/analytics-and-report/sellAnalyticsV1Oas3.d.ts +446 -0
- package/build/types/sell-apps/analytics-and-report/sellAnalyticsV1Oas3.js +5 -0
- package/build/types/sell-apps/communication/commerceFeedbackV1BetaOas3.d.ts +705 -0
- package/build/types/sell-apps/communication/commerceFeedbackV1BetaOas3.js +5 -0
- package/build/types/sell-apps/communication/commerceMessageV1Oas3.d.ts +590 -0
- package/build/types/sell-apps/communication/commerceMessageV1Oas3.js +5 -0
- package/build/types/sell-apps/communication/commerceNotificationV1Oas3.d.ts +1276 -0
- package/build/types/sell-apps/communication/commerceNotificationV1Oas3.js +5 -0
- package/build/types/sell-apps/communication/sellNegotiationV1Oas3.d.ts +277 -0
- package/build/types/sell-apps/communication/sellNegotiationV1Oas3.js +5 -0
- package/build/types/sell-apps/listing-management/sellInventoryV1Oas3.d.ts +3133 -0
- package/build/types/sell-apps/listing-management/sellInventoryV1Oas3.js +5 -0
- package/build/types/sell-apps/listing-metadata/sellMetadataV1Oas3.d.ts +2289 -0
- package/build/types/sell-apps/listing-metadata/sellMetadataV1Oas3.js +5 -0
- package/build/types/sell-apps/markeitng-and-promotions/sellMarketingV1Oas3.d.ts +6650 -0
- package/build/types/sell-apps/markeitng-and-promotions/sellMarketingV1Oas3.js +5 -0
- package/build/types/sell-apps/markeitng-and-promotions/sellRecommendationV1Oas3.d.ts +172 -0
- package/build/types/sell-apps/markeitng-and-promotions/sellRecommendationV1Oas3.js +5 -0
- package/build/types/sell-apps/order-management/sellFulfillmentV1Oas3.d.ts +1869 -0
- package/build/types/sell-apps/order-management/sellFulfillmentV1Oas3.js +5 -0
- package/build/types/sell-apps/other-apis/commerceIdentityV1Oas3.d.ts +178 -0
- package/build/types/sell-apps/other-apis/commerceIdentityV1Oas3.js +5 -0
- package/build/types/sell-apps/other-apis/commerceTranslationV1BetaOas3.d.ts +128 -0
- package/build/types/sell-apps/other-apis/commerceTranslationV1BetaOas3.js +5 -0
- package/build/types/sell-apps/other-apis/commerceVeroV1Oas3.d.ts +417 -0
- package/build/types/sell-apps/other-apis/commerceVeroV1Oas3.js +5 -0
- package/build/types/sell-apps/other-apis/sellComplianceV1Oas3.d.ts +273 -0
- package/build/types/sell-apps/other-apis/sellComplianceV1Oas3.js +5 -0
- package/build/types/sell-apps/other-apis/sellEdeliveryInternationalShippingOas3.d.ts +2537 -0
- package/build/types/sell-apps/other-apis/sellEdeliveryInternationalShippingOas3.js +5 -0
- package/build/types/sell-apps/other-apis/sellMarketingV1Oas3.d.ts +6650 -0
- package/build/types/sell-apps/other-apis/sellMarketingV1Oas3.js +5 -0
- package/build/types/sell-apps/other-apis/sellRecommendationV1Oas3.d.ts +172 -0
- package/build/types/sell-apps/other-apis/sellRecommendationV1Oas3.js +5 -0
- package/build/utils/account-management/account.d.ts +1094 -0
- package/build/utils/account-management/account.js +831 -0
- package/build/utils/communication/feedback.d.ts +152 -0
- package/build/utils/communication/feedback.js +216 -0
- package/build/utils/communication/message.d.ts +174 -0
- package/build/utils/communication/message.js +242 -0
- package/build/utils/communication/negotiation.d.ts +123 -0
- package/build/utils/communication/negotiation.js +150 -0
- package/build/utils/communication/notification.d.ts +370 -0
- package/build/utils/communication/notification.js +369 -0
- package/build/utils/date-converter.d.ts +59 -0
- package/build/utils/date-converter.js +160 -0
- package/build/utils/llm-client-detector.d.ts +54 -0
- package/build/utils/llm-client-detector.js +318 -0
- package/build/utils/oauth-helper.d.ts +37 -0
- package/build/utils/oauth-helper.js +315 -0
- package/build/utils/order-management/dispute.d.ts +346 -0
- package/build/utils/order-management/dispute.js +369 -0
- package/build/utils/order-management/fulfillment.d.ts +200 -0
- package/build/utils/order-management/fulfillment.js +205 -0
- package/build/utils/other/compliance.d.ts +49 -0
- package/build/utils/other/compliance.js +76 -0
- package/build/utils/other/edelivery.d.ts +310 -0
- package/build/utils/other/edelivery.js +241 -0
- package/build/utils/other/identity.d.ts +13 -0
- package/build/utils/other/identity.js +13 -0
- package/build/utils/other/translation.d.ts +28 -0
- package/build/utils/other/translation.js +41 -0
- package/build/utils/other/vero.d.ts +61 -0
- package/build/utils/other/vero.js +90 -0
- package/build/utils/scope-helper.d.ts +49 -0
- package/build/utils/scope-helper.js +207 -0
- package/build/utils/security-checker.d.ts +46 -0
- package/build/utils/security-checker.js +248 -0
- package/build/utils/setup-validator.d.ts +25 -0
- package/build/utils/setup-validator.js +305 -0
- package/build/utils/token-utils.d.ts +40 -0
- package/build/utils/token-utils.js +40 -0
- package/package.json +115 -0
|
@@ -0,0 +1,633 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inventory API - Manage listings and inventory
|
|
3
|
+
* Based on: docs/sell-apps/listing-management/sell_inventory_v1_oas3.json
|
|
4
|
+
*/
|
|
5
|
+
export class InventoryApi {
|
|
6
|
+
client;
|
|
7
|
+
basePath = '/sell/inventory/v1';
|
|
8
|
+
constructor(client) {
|
|
9
|
+
this.client = client;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Get all inventory items
|
|
13
|
+
* @throws Error if parameters are invalid
|
|
14
|
+
*/
|
|
15
|
+
async getInventoryItems(limit, offset) {
|
|
16
|
+
const params = {};
|
|
17
|
+
if (limit !== undefined) {
|
|
18
|
+
if (typeof limit !== 'number' || limit < 1) {
|
|
19
|
+
throw new Error('limit must be a positive number when provided');
|
|
20
|
+
}
|
|
21
|
+
params.limit = limit;
|
|
22
|
+
}
|
|
23
|
+
if (offset !== undefined) {
|
|
24
|
+
if (typeof offset !== 'number' || offset < 0) {
|
|
25
|
+
throw new Error('offset must be a non-negative number when provided');
|
|
26
|
+
}
|
|
27
|
+
params.offset = offset;
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
return await this.client.get(`${this.basePath}/inventory_item`, params);
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
throw new Error(`Failed to get inventory items: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Get a specific inventory item
|
|
38
|
+
* @throws Error if required parameters are missing or invalid
|
|
39
|
+
*/
|
|
40
|
+
async getInventoryItem(sku) {
|
|
41
|
+
if (!sku || typeof sku !== 'string') {
|
|
42
|
+
throw new Error('sku is required and must be a string');
|
|
43
|
+
}
|
|
44
|
+
try {
|
|
45
|
+
return await this.client.get(`${this.basePath}/inventory_item/${sku}`);
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
throw new Error(`Failed to get inventory item: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Create or replace an inventory item
|
|
53
|
+
* @throws Error if required parameters are missing or invalid
|
|
54
|
+
*/
|
|
55
|
+
async createOrReplaceInventoryItem(sku, inventoryItem) {
|
|
56
|
+
if (!sku || typeof sku !== 'string') {
|
|
57
|
+
throw new Error('sku is required and must be a string');
|
|
58
|
+
}
|
|
59
|
+
if (!inventoryItem || typeof inventoryItem !== 'object') {
|
|
60
|
+
throw new Error('inventoryItem is required and must be an object');
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
return await this.client.put(`${this.basePath}/inventory_item/${sku}`, inventoryItem, {
|
|
64
|
+
headers: {
|
|
65
|
+
'Content-Language': 'en-US',
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
throw new Error(`Failed to create or replace inventory item: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Delete an inventory item
|
|
75
|
+
* @throws Error if required parameters are missing or invalid
|
|
76
|
+
*/
|
|
77
|
+
async deleteInventoryItem(sku) {
|
|
78
|
+
if (!sku || typeof sku !== 'string') {
|
|
79
|
+
throw new Error('sku is required and must be a string');
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
return await this.client.delete(`${this.basePath}/inventory_item/${sku}`);
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
throw new Error(`Failed to delete inventory item: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Bulk create or replace inventory items
|
|
90
|
+
* Endpoint: POST /bulk_create_or_replace_inventory_item
|
|
91
|
+
* @throws Error if required parameters are missing or invalid
|
|
92
|
+
*/
|
|
93
|
+
async bulkCreateOrReplaceInventoryItem(requests) {
|
|
94
|
+
if (!requests || typeof requests !== 'object') {
|
|
95
|
+
throw new Error('requests is required and must be an object');
|
|
96
|
+
}
|
|
97
|
+
try {
|
|
98
|
+
return await this.client.post(`${this.basePath}/bulk_create_or_replace_inventory_item`, requests, {
|
|
99
|
+
headers: {
|
|
100
|
+
'Content-Language': 'en-US',
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
throw new Error(`Failed to bulk create or replace inventory items: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Bulk get inventory items
|
|
110
|
+
* Endpoint: POST /bulk_get_inventory_item
|
|
111
|
+
* @throws Error if required parameters are missing or invalid
|
|
112
|
+
*/
|
|
113
|
+
async bulkGetInventoryItem(requests) {
|
|
114
|
+
if (!requests || typeof requests !== 'object') {
|
|
115
|
+
throw new Error('requests is required and must be an object');
|
|
116
|
+
}
|
|
117
|
+
try {
|
|
118
|
+
return await this.client.post(`${this.basePath}/bulk_get_inventory_item`, requests);
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
throw new Error(`Failed to bulk get inventory items: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Bulk update price and quantity
|
|
126
|
+
* Endpoint: POST /bulk_update_price_quantity
|
|
127
|
+
* @throws Error if required parameters are missing or invalid
|
|
128
|
+
*/
|
|
129
|
+
async bulkUpdatePriceQuantity(requests) {
|
|
130
|
+
if (!requests || typeof requests !== 'object') {
|
|
131
|
+
throw new Error('requests is required and must be an object');
|
|
132
|
+
}
|
|
133
|
+
try {
|
|
134
|
+
return await this.client.post(`${this.basePath}/bulk_update_price_quantity`, requests);
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
throw new Error(`Failed to bulk update price and quantity: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Get product compatibility for an inventory item
|
|
142
|
+
* Endpoint: GET /inventory_item/{sku}/product_compatibility
|
|
143
|
+
* @throws Error if required parameters are missing or invalid
|
|
144
|
+
*/
|
|
145
|
+
async getProductCompatibility(sku) {
|
|
146
|
+
if (!sku || typeof sku !== 'string') {
|
|
147
|
+
throw new Error('sku is required and must be a string');
|
|
148
|
+
}
|
|
149
|
+
try {
|
|
150
|
+
return await this.client.get(`${this.basePath}/inventory_item/${sku}/product_compatibility`);
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
throw new Error(`Failed to get product compatibility: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Create or replace product compatibility for an inventory item
|
|
158
|
+
* Endpoint: PUT /inventory_item/{sku}/product_compatibility
|
|
159
|
+
* @throws Error if required parameters are missing or invalid
|
|
160
|
+
*/
|
|
161
|
+
async createOrReplaceProductCompatibility(sku, compatibility) {
|
|
162
|
+
if (!sku || typeof sku !== 'string') {
|
|
163
|
+
throw new Error('sku is required and must be a string');
|
|
164
|
+
}
|
|
165
|
+
if (!compatibility || typeof compatibility !== 'object') {
|
|
166
|
+
throw new Error('compatibility is required and must be an object');
|
|
167
|
+
}
|
|
168
|
+
try {
|
|
169
|
+
return await this.client.put(`${this.basePath}/inventory_item/${sku}/product_compatibility`, compatibility, {
|
|
170
|
+
headers: {
|
|
171
|
+
'Content-Language': 'en-US',
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
catch (error) {
|
|
176
|
+
throw new Error(`Failed to create or replace product compatibility: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Delete product compatibility for an inventory item
|
|
181
|
+
* Endpoint: DELETE /inventory_item/{sku}/product_compatibility
|
|
182
|
+
* @throws Error if required parameters are missing or invalid
|
|
183
|
+
*/
|
|
184
|
+
async deleteProductCompatibility(sku) {
|
|
185
|
+
if (!sku || typeof sku !== 'string') {
|
|
186
|
+
throw new Error('sku is required and must be a string');
|
|
187
|
+
}
|
|
188
|
+
try {
|
|
189
|
+
return await this.client.delete(`${this.basePath}/inventory_item/${sku}/product_compatibility`);
|
|
190
|
+
}
|
|
191
|
+
catch (error) {
|
|
192
|
+
throw new Error(`Failed to delete product compatibility: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Get an inventory item group
|
|
197
|
+
* Endpoint: GET /inventory_item_group/{inventoryItemGroupKey}
|
|
198
|
+
* @throws Error if required parameters are missing or invalid
|
|
199
|
+
*/
|
|
200
|
+
async getInventoryItemGroup(inventoryItemGroupKey) {
|
|
201
|
+
if (!inventoryItemGroupKey || typeof inventoryItemGroupKey !== 'string') {
|
|
202
|
+
throw new Error('inventoryItemGroupKey is required and must be a string');
|
|
203
|
+
}
|
|
204
|
+
try {
|
|
205
|
+
return await this.client.get(`${this.basePath}/inventory_item_group/${inventoryItemGroupKey}`);
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
throw new Error(`Failed to get inventory item group: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Create or replace an inventory item group
|
|
213
|
+
* Endpoint: PUT /inventory_item_group/{inventoryItemGroupKey}
|
|
214
|
+
* @throws Error if required parameters are missing or invalid
|
|
215
|
+
*/
|
|
216
|
+
async createOrReplaceInventoryItemGroup(inventoryItemGroupKey, inventoryItemGroup) {
|
|
217
|
+
if (!inventoryItemGroupKey || typeof inventoryItemGroupKey !== 'string') {
|
|
218
|
+
throw new Error('inventoryItemGroupKey is required and must be a string');
|
|
219
|
+
}
|
|
220
|
+
if (!inventoryItemGroup || typeof inventoryItemGroup !== 'object') {
|
|
221
|
+
throw new Error('inventoryItemGroup is required and must be an object');
|
|
222
|
+
}
|
|
223
|
+
try {
|
|
224
|
+
return await this.client.put(`${this.basePath}/inventory_item_group/${inventoryItemGroupKey}`, inventoryItemGroup, {
|
|
225
|
+
headers: {
|
|
226
|
+
'Content-Language': 'en-US',
|
|
227
|
+
},
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
catch (error) {
|
|
231
|
+
throw new Error(`Failed to create or replace inventory item group: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Delete an inventory item group
|
|
236
|
+
* Endpoint: DELETE /inventory_item_group/{inventoryItemGroupKey}
|
|
237
|
+
* @throws Error if required parameters are missing or invalid
|
|
238
|
+
*/
|
|
239
|
+
async deleteInventoryItemGroup(inventoryItemGroupKey) {
|
|
240
|
+
if (!inventoryItemGroupKey || typeof inventoryItemGroupKey !== 'string') {
|
|
241
|
+
throw new Error('inventoryItemGroupKey is required and must be a string');
|
|
242
|
+
}
|
|
243
|
+
try {
|
|
244
|
+
return await this.client.delete(`${this.basePath}/inventory_item_group/${inventoryItemGroupKey}`);
|
|
245
|
+
}
|
|
246
|
+
catch (error) {
|
|
247
|
+
throw new Error(`Failed to delete inventory item group: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Get all inventory locations
|
|
252
|
+
* Endpoint: GET /location
|
|
253
|
+
* @throws Error if parameters are invalid
|
|
254
|
+
*/
|
|
255
|
+
async getInventoryLocations(limit, offset) {
|
|
256
|
+
const params = {};
|
|
257
|
+
if (limit !== undefined) {
|
|
258
|
+
if (typeof limit !== 'number' || limit < 1) {
|
|
259
|
+
throw new Error('limit must be a positive number when provided');
|
|
260
|
+
}
|
|
261
|
+
params.limit = limit;
|
|
262
|
+
}
|
|
263
|
+
if (offset !== undefined) {
|
|
264
|
+
if (typeof offset !== 'number' || offset < 0) {
|
|
265
|
+
throw new Error('offset must be a non-negative number when provided');
|
|
266
|
+
}
|
|
267
|
+
params.offset = offset;
|
|
268
|
+
}
|
|
269
|
+
try {
|
|
270
|
+
return await this.client.get(`${this.basePath}/location`, params);
|
|
271
|
+
}
|
|
272
|
+
catch (error) {
|
|
273
|
+
throw new Error(`Failed to get inventory locations: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Get a specific inventory location
|
|
278
|
+
* Endpoint: GET /location/{merchantLocationKey}
|
|
279
|
+
* @throws Error if required parameters are missing or invalid
|
|
280
|
+
*/
|
|
281
|
+
async getInventoryLocation(merchantLocationKey) {
|
|
282
|
+
if (!merchantLocationKey || typeof merchantLocationKey !== 'string') {
|
|
283
|
+
throw new Error('merchantLocationKey is required and must be a string');
|
|
284
|
+
}
|
|
285
|
+
try {
|
|
286
|
+
return await this.client.get(`${this.basePath}/location/${merchantLocationKey}`);
|
|
287
|
+
}
|
|
288
|
+
catch (error) {
|
|
289
|
+
throw new Error(`Failed to get inventory location: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Create or replace an inventory location
|
|
294
|
+
* Endpoint: POST /location/{merchantLocationKey}
|
|
295
|
+
* @throws Error if required parameters are missing or invalid
|
|
296
|
+
*/
|
|
297
|
+
async createOrReplaceInventoryLocation(merchantLocationKey, location) {
|
|
298
|
+
if (!merchantLocationKey || typeof merchantLocationKey !== 'string') {
|
|
299
|
+
throw new Error('merchantLocationKey is required and must be a string');
|
|
300
|
+
}
|
|
301
|
+
if (!location || typeof location !== 'object') {
|
|
302
|
+
throw new Error('location is required and must be an object');
|
|
303
|
+
}
|
|
304
|
+
try {
|
|
305
|
+
return await this.client.post(`${this.basePath}/location/${merchantLocationKey}`, location);
|
|
306
|
+
}
|
|
307
|
+
catch (error) {
|
|
308
|
+
throw new Error(`Failed to create or replace inventory location: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Delete an inventory location
|
|
313
|
+
* Endpoint: DELETE /location/{merchantLocationKey}
|
|
314
|
+
* @throws Error if required parameters are missing or invalid
|
|
315
|
+
*/
|
|
316
|
+
async deleteInventoryLocation(merchantLocationKey) {
|
|
317
|
+
if (!merchantLocationKey || typeof merchantLocationKey !== 'string') {
|
|
318
|
+
throw new Error('merchantLocationKey is required and must be a string');
|
|
319
|
+
}
|
|
320
|
+
try {
|
|
321
|
+
return await this.client.delete(`${this.basePath}/location/${merchantLocationKey}`);
|
|
322
|
+
}
|
|
323
|
+
catch (error) {
|
|
324
|
+
throw new Error(`Failed to delete inventory location: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Disable an inventory location
|
|
329
|
+
* Endpoint: POST /location/{merchantLocationKey}/disable
|
|
330
|
+
* @throws Error if required parameters are missing or invalid
|
|
331
|
+
*/
|
|
332
|
+
async disableInventoryLocation(merchantLocationKey) {
|
|
333
|
+
if (!merchantLocationKey || typeof merchantLocationKey !== 'string') {
|
|
334
|
+
throw new Error('merchantLocationKey is required and must be a string');
|
|
335
|
+
}
|
|
336
|
+
try {
|
|
337
|
+
return await this.client.post(`${this.basePath}/location/${merchantLocationKey}/disable`, {});
|
|
338
|
+
}
|
|
339
|
+
catch (error) {
|
|
340
|
+
throw new Error(`Failed to disable inventory location: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Enable an inventory location
|
|
345
|
+
* Endpoint: POST /location/{merchantLocationKey}/enable
|
|
346
|
+
* @throws Error if required parameters are missing or invalid
|
|
347
|
+
*/
|
|
348
|
+
async enableInventoryLocation(merchantLocationKey) {
|
|
349
|
+
if (!merchantLocationKey || typeof merchantLocationKey !== 'string') {
|
|
350
|
+
throw new Error('merchantLocationKey is required and must be a string');
|
|
351
|
+
}
|
|
352
|
+
try {
|
|
353
|
+
return await this.client.post(`${this.basePath}/location/${merchantLocationKey}/enable`, {});
|
|
354
|
+
}
|
|
355
|
+
catch (error) {
|
|
356
|
+
throw new Error(`Failed to enable inventory location: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Update location details
|
|
361
|
+
* Endpoint: POST /location/{merchantLocationKey}/update_location_details
|
|
362
|
+
* @throws Error if required parameters are missing or invalid
|
|
363
|
+
*/
|
|
364
|
+
async updateLocationDetails(merchantLocationKey, locationDetails) {
|
|
365
|
+
if (!merchantLocationKey || typeof merchantLocationKey !== 'string') {
|
|
366
|
+
throw new Error('merchantLocationKey is required and must be a string');
|
|
367
|
+
}
|
|
368
|
+
if (!locationDetails || typeof locationDetails !== 'object') {
|
|
369
|
+
throw new Error('locationDetails is required and must be an object');
|
|
370
|
+
}
|
|
371
|
+
try {
|
|
372
|
+
return await this.client.post(`${this.basePath}/location/${merchantLocationKey}/update_location_details`, locationDetails);
|
|
373
|
+
}
|
|
374
|
+
catch (error) {
|
|
375
|
+
throw new Error(`Failed to update location details: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Get all offers
|
|
380
|
+
* @throws Error if parameters are invalid
|
|
381
|
+
*/
|
|
382
|
+
async getOffers(sku, marketplaceId, limit) {
|
|
383
|
+
const params = {};
|
|
384
|
+
if (sku !== undefined) {
|
|
385
|
+
if (typeof sku !== 'string') {
|
|
386
|
+
throw new Error('sku must be a string when provided');
|
|
387
|
+
}
|
|
388
|
+
params.sku = sku;
|
|
389
|
+
}
|
|
390
|
+
if (marketplaceId !== undefined) {
|
|
391
|
+
if (typeof marketplaceId !== 'string') {
|
|
392
|
+
throw new Error('marketplaceId must be a string when provided');
|
|
393
|
+
}
|
|
394
|
+
params.marketplace_id = marketplaceId;
|
|
395
|
+
}
|
|
396
|
+
if (limit !== undefined) {
|
|
397
|
+
if (typeof limit !== 'number' || limit < 1) {
|
|
398
|
+
throw new Error('limit must be a positive number when provided');
|
|
399
|
+
}
|
|
400
|
+
params.limit = limit;
|
|
401
|
+
}
|
|
402
|
+
try {
|
|
403
|
+
return await this.client.get(`${this.basePath}/offer`, params);
|
|
404
|
+
}
|
|
405
|
+
catch (error) {
|
|
406
|
+
throw new Error(`Failed to get offers: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Get a specific offer
|
|
411
|
+
* Endpoint: GET /offer/{offerId}
|
|
412
|
+
* @throws Error if required parameters are missing or invalid
|
|
413
|
+
*/
|
|
414
|
+
async getOffer(offerId) {
|
|
415
|
+
if (!offerId || typeof offerId !== 'string') {
|
|
416
|
+
throw new Error('offerId is required and must be a string');
|
|
417
|
+
}
|
|
418
|
+
try {
|
|
419
|
+
return await this.client.get(`${this.basePath}/offer/${offerId}`);
|
|
420
|
+
}
|
|
421
|
+
catch (error) {
|
|
422
|
+
throw new Error(`Failed to get offer: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Create an offer
|
|
427
|
+
* @throws Error if required parameters are missing or invalid
|
|
428
|
+
*/
|
|
429
|
+
async createOffer(offer) {
|
|
430
|
+
if (!offer || typeof offer !== 'object') {
|
|
431
|
+
throw new Error('offer is required and must be an object');
|
|
432
|
+
}
|
|
433
|
+
try {
|
|
434
|
+
return await this.client.post(`${this.basePath}/offer`, offer, {
|
|
435
|
+
headers: {
|
|
436
|
+
'Content-Language': 'en-US',
|
|
437
|
+
},
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
catch (error) {
|
|
441
|
+
throw new Error(`Failed to create offer: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* Update an offer
|
|
446
|
+
* Endpoint: PUT /offer/{offerId}
|
|
447
|
+
* @throws Error if required parameters are missing or invalid
|
|
448
|
+
*/
|
|
449
|
+
async updateOffer(offerId, offer) {
|
|
450
|
+
if (!offerId || typeof offerId !== 'string') {
|
|
451
|
+
throw new Error('offerId is required and must be a string');
|
|
452
|
+
}
|
|
453
|
+
if (!offer || typeof offer !== 'object') {
|
|
454
|
+
throw new Error('offer is required and must be an object');
|
|
455
|
+
}
|
|
456
|
+
try {
|
|
457
|
+
return await this.client.put(`${this.basePath}/offer/${offerId}`, offer, {
|
|
458
|
+
headers: {
|
|
459
|
+
'Content-Language': 'en-US',
|
|
460
|
+
},
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
catch (error) {
|
|
464
|
+
throw new Error(`Failed to update offer: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* Delete an offer
|
|
469
|
+
* Endpoint: DELETE /offer/{offerId}
|
|
470
|
+
* @throws Error if required parameters are missing or invalid
|
|
471
|
+
*/
|
|
472
|
+
async deleteOffer(offerId) {
|
|
473
|
+
if (!offerId || typeof offerId !== 'string') {
|
|
474
|
+
throw new Error('offerId is required and must be a string');
|
|
475
|
+
}
|
|
476
|
+
try {
|
|
477
|
+
return await this.client.delete(`${this.basePath}/offer/${offerId}`);
|
|
478
|
+
}
|
|
479
|
+
catch (error) {
|
|
480
|
+
throw new Error(`Failed to delete offer: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Publish an offer
|
|
485
|
+
* @throws Error if required parameters are missing or invalid
|
|
486
|
+
*/
|
|
487
|
+
async publishOffer(offerId) {
|
|
488
|
+
if (!offerId || typeof offerId !== 'string') {
|
|
489
|
+
throw new Error('offerId is required and must be a string');
|
|
490
|
+
}
|
|
491
|
+
try {
|
|
492
|
+
return await this.client.post(`${this.basePath}/offer/${offerId}/publish`);
|
|
493
|
+
}
|
|
494
|
+
catch (error) {
|
|
495
|
+
throw new Error(`Failed to publish offer: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Withdraw an offer
|
|
500
|
+
* Endpoint: POST /offer/{offerId}/withdraw
|
|
501
|
+
* @throws Error if required parameters are missing or invalid
|
|
502
|
+
*/
|
|
503
|
+
async withdrawOffer(offerId) {
|
|
504
|
+
if (!offerId || typeof offerId !== 'string') {
|
|
505
|
+
throw new Error('offerId is required and must be a string');
|
|
506
|
+
}
|
|
507
|
+
try {
|
|
508
|
+
return await this.client.post(`${this.basePath}/offer/${offerId}/withdraw`, {});
|
|
509
|
+
}
|
|
510
|
+
catch (error) {
|
|
511
|
+
throw new Error(`Failed to withdraw offer: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* Bulk create offers
|
|
516
|
+
* Endpoint: POST /bulk_create_offer
|
|
517
|
+
* @throws Error if required parameters are missing or invalid
|
|
518
|
+
*/
|
|
519
|
+
async bulkCreateOffer(requests) {
|
|
520
|
+
if (!requests || typeof requests !== 'object') {
|
|
521
|
+
throw new Error('requests is required and must be an object');
|
|
522
|
+
}
|
|
523
|
+
try {
|
|
524
|
+
return await this.client.post(`${this.basePath}/bulk_create_offer`, requests, {
|
|
525
|
+
headers: {
|
|
526
|
+
'Content-Language': 'en-US',
|
|
527
|
+
},
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
catch (error) {
|
|
531
|
+
throw new Error(`Failed to bulk create offers: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Bulk publish offers
|
|
536
|
+
* Endpoint: POST /bulk_publish_offer
|
|
537
|
+
* @throws Error if required parameters are missing or invalid
|
|
538
|
+
*/
|
|
539
|
+
async bulkPublishOffer(requests) {
|
|
540
|
+
if (!requests || typeof requests !== 'object') {
|
|
541
|
+
throw new Error('requests is required and must be an object');
|
|
542
|
+
}
|
|
543
|
+
try {
|
|
544
|
+
return await this.client.post(`${this.basePath}/bulk_publish_offer`, requests);
|
|
545
|
+
}
|
|
546
|
+
catch (error) {
|
|
547
|
+
throw new Error(`Failed to bulk publish offers: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* Get listing fees for offers
|
|
552
|
+
* Endpoint: POST /offer/get_listing_fees
|
|
553
|
+
* @throws Error if required parameters are missing or invalid
|
|
554
|
+
*/
|
|
555
|
+
async getListingFees(offers) {
|
|
556
|
+
if (!offers || typeof offers !== 'object') {
|
|
557
|
+
throw new Error('offers is required and must be an object');
|
|
558
|
+
}
|
|
559
|
+
try {
|
|
560
|
+
return await this.client.post(`${this.basePath}/offer/get_listing_fees`, offers);
|
|
561
|
+
}
|
|
562
|
+
catch (error) {
|
|
563
|
+
throw new Error(`Failed to get listing fees: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* Bulk migrate listings
|
|
568
|
+
* Endpoint: POST /bulk_migrate_listing
|
|
569
|
+
* @throws Error if required parameters are missing or invalid
|
|
570
|
+
*/
|
|
571
|
+
async bulkMigrateListing(requests) {
|
|
572
|
+
if (!requests || typeof requests !== 'object') {
|
|
573
|
+
throw new Error('requests is required and must be an object');
|
|
574
|
+
}
|
|
575
|
+
try {
|
|
576
|
+
return await this.client.post(`${this.basePath}/bulk_migrate_listing`, requests);
|
|
577
|
+
}
|
|
578
|
+
catch (error) {
|
|
579
|
+
throw new Error(`Failed to bulk migrate listings: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Get listing's inventory locations
|
|
584
|
+
* Endpoint: GET /listing/{listingId}/sku/{sku}/locations
|
|
585
|
+
* @throws Error if required parameters are missing or invalid
|
|
586
|
+
*/
|
|
587
|
+
async getListingLocations(listingId, sku) {
|
|
588
|
+
if (!listingId || typeof listingId !== 'string') {
|
|
589
|
+
throw new Error('listingId is required and must be a string');
|
|
590
|
+
}
|
|
591
|
+
if (!sku || typeof sku !== 'string') {
|
|
592
|
+
throw new Error('sku is required and must be a string');
|
|
593
|
+
}
|
|
594
|
+
try {
|
|
595
|
+
return await this.client.get(`${this.basePath}/listing/${listingId}/sku/${sku}/locations`);
|
|
596
|
+
}
|
|
597
|
+
catch (error) {
|
|
598
|
+
throw new Error(`Failed to get listing locations: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* Publish offer by inventory item group
|
|
603
|
+
* Endpoint: POST /offer/publish_by_inventory_item_group
|
|
604
|
+
* @throws Error if required parameters are missing or invalid
|
|
605
|
+
*/
|
|
606
|
+
async publishOfferByInventoryItemGroup(request) {
|
|
607
|
+
if (!request || typeof request !== 'object') {
|
|
608
|
+
throw new Error('request is required and must be an object');
|
|
609
|
+
}
|
|
610
|
+
try {
|
|
611
|
+
return await this.client.post(`${this.basePath}/offer/publish_by_inventory_item_group`, request);
|
|
612
|
+
}
|
|
613
|
+
catch (error) {
|
|
614
|
+
throw new Error(`Failed to publish offer by inventory item group: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* Withdraw offer by inventory item group
|
|
619
|
+
* Endpoint: POST /offer/withdraw_by_inventory_item_group
|
|
620
|
+
* @throws Error if required parameters are missing or invalid
|
|
621
|
+
*/
|
|
622
|
+
async withdrawOfferByInventoryItemGroup(request) {
|
|
623
|
+
if (!request || typeof request !== 'object') {
|
|
624
|
+
throw new Error('request is required and must be an object');
|
|
625
|
+
}
|
|
626
|
+
try {
|
|
627
|
+
return await this.client.post(`${this.basePath}/offer/withdraw_by_inventory_item_group`, request);
|
|
628
|
+
}
|
|
629
|
+
catch (error) {
|
|
630
|
+
throw new Error(`Failed to withdraw offer by inventory item group: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
}
|