ebay-mcp-remote-edition 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +755 -0
  3. package/build/api/account-management/account.js +301 -0
  4. package/build/api/analytics-and-report/analytics.js +102 -0
  5. package/build/api/client-trading.js +96 -0
  6. package/build/api/client.js +173 -0
  7. package/build/api/communication/feedback.js +119 -0
  8. package/build/api/communication/message.js +131 -0
  9. package/build/api/communication/negotiation.js +97 -0
  10. package/build/api/communication/notification.js +373 -0
  11. package/build/api/developer/developer.js +81 -0
  12. package/build/api/index.js +109 -0
  13. package/build/api/listing-management/inventory.js +640 -0
  14. package/build/api/listing-metadata/metadata.js +485 -0
  15. package/build/api/listing-metadata/taxonomy.js +58 -0
  16. package/build/api/marketing-and-promotions/marketing.js +768 -0
  17. package/build/api/marketing-and-promotions/recommendation.js +32 -0
  18. package/build/api/order-management/dispute.js +69 -0
  19. package/build/api/order-management/fulfillment.js +89 -0
  20. package/build/api/other/compliance.js +47 -0
  21. package/build/api/other/edelivery.js +219 -0
  22. package/build/api/other/identity.js +24 -0
  23. package/build/api/other/translation.js +22 -0
  24. package/build/api/other/vero.js +48 -0
  25. package/build/api/trading/trading.js +78 -0
  26. package/build/auth/kv-store.js +40 -0
  27. package/build/auth/multi-user-store.js +120 -0
  28. package/build/auth/oauth-metadata.js +59 -0
  29. package/build/auth/oauth-middleware.js +99 -0
  30. package/build/auth/oauth-types.js +4 -0
  31. package/build/auth/oauth.js +235 -0
  32. package/build/auth/scope-utils.js +304 -0
  33. package/build/auth/token-store.js +46 -0
  34. package/build/auth/token-verifier.js +172 -0
  35. package/build/config/environment.js +297 -0
  36. package/build/index.d.ts +1 -0
  37. package/build/index.js +129 -0
  38. package/build/schemas/account-management/account.js +375 -0
  39. package/build/schemas/analytics/analytics.js +191 -0
  40. package/build/schemas/communication/messages.js +345 -0
  41. package/build/schemas/fulfillment/orders.js +338 -0
  42. package/build/schemas/index.js +68 -0
  43. package/build/schemas/inventory-management/inventory.js +471 -0
  44. package/build/schemas/marketing/marketing.js +1103 -0
  45. package/build/schemas/metadata/metadata.js +618 -0
  46. package/build/schemas/other/other-apis.js +390 -0
  47. package/build/schemas/taxonomy/taxonomy.js +575 -0
  48. package/build/scripts/auto-setup.js +364 -0
  49. package/build/scripts/dev-sync.js +512 -0
  50. package/build/scripts/diagnostics.js +301 -0
  51. package/build/scripts/download-specs.js +116 -0
  52. package/build/scripts/interactive-setup.js +757 -0
  53. package/build/scripts/setup.js +1515 -0
  54. package/build/scripts/update-api-status-doc.js +44 -0
  55. package/build/server-http.d.ts +1 -0
  56. package/build/server-http.js +581 -0
  57. package/build/tools/definitions/account-with-schemas.js +170 -0
  58. package/build/tools/definitions/account.js +428 -0
  59. package/build/tools/definitions/analytics.js +66 -0
  60. package/build/tools/definitions/communication.js +394 -0
  61. package/build/tools/definitions/developer.js +195 -0
  62. package/build/tools/definitions/fulfillment.js +326 -0
  63. package/build/tools/definitions/index.js +41 -0
  64. package/build/tools/definitions/inventory.js +464 -0
  65. package/build/tools/definitions/marketing.js +1486 -0
  66. package/build/tools/definitions/metadata.js +188 -0
  67. package/build/tools/definitions/other.js +309 -0
  68. package/build/tools/definitions/taxonomy.js +64 -0
  69. package/build/tools/definitions/token-management.js +148 -0
  70. package/build/tools/definitions/trading.js +71 -0
  71. package/build/tools/index.js +1200 -0
  72. package/build/tools/schemas.js +667 -0
  73. package/build/tools/tool-definitions.js +3534 -0
  74. package/build/types/application-settings/developerAnalyticsV1BetaOas3.js +5 -0
  75. package/build/types/application-settings/developerClientRegistrationV1Oas3.js +5 -0
  76. package/build/types/application-settings/developerKeyManagementV1Oas3.js +5 -0
  77. package/build/types/ebay-enums.js +1330 -0
  78. package/build/types/ebay.js +123 -0
  79. package/build/types/index.js +10 -0
  80. package/build/types/sell-apps/account-management/sellAccountV1Oas3.js +5 -0
  81. package/build/types/sell-apps/analytics-and-report/sellAnalyticsV1Oas3.js +5 -0
  82. package/build/types/sell-apps/communication/commerceFeedbackV1BetaOas3.js +5 -0
  83. package/build/types/sell-apps/communication/commerceMessageV1Oas3.js +5 -0
  84. package/build/types/sell-apps/communication/commerceNotificationV1Oas3.js +5 -0
  85. package/build/types/sell-apps/communication/sellNegotiationV1Oas3.js +5 -0
  86. package/build/types/sell-apps/listing-management/sellInventoryV1Oas3.js +5 -0
  87. package/build/types/sell-apps/listing-metadata/sellMetadataV1Oas3.js +5 -0
  88. package/build/types/sell-apps/markeitng-and-promotions/sellMarketingV1Oas3.js +5 -0
  89. package/build/types/sell-apps/markeitng-and-promotions/sellRecommendationV1Oas3.js +5 -0
  90. package/build/types/sell-apps/order-management/sellFulfillmentV1Oas3.js +5 -0
  91. package/build/types/sell-apps/other-apis/commerceIdentityV1Oas3.js +5 -0
  92. package/build/types/sell-apps/other-apis/commerceTranslationV1BetaOas3.js +5 -0
  93. package/build/types/sell-apps/other-apis/commerceVeroV1Oas3.js +5 -0
  94. package/build/types/sell-apps/other-apis/sellComplianceV1Oas3.js +5 -0
  95. package/build/types/sell-apps/other-apis/sellEdeliveryInternationalShippingOas3.js +5 -0
  96. package/build/types/sell-apps/other-apis/sellMarketingV1Oas3.js +5 -0
  97. package/build/types/sell-apps/other-apis/sellRecommendationV1Oas3.js +5 -0
  98. package/build/utils/account-management/account.js +831 -0
  99. package/build/utils/api-status-feed.js +83 -0
  100. package/build/utils/communication/feedback.js +216 -0
  101. package/build/utils/communication/message.js +242 -0
  102. package/build/utils/communication/negotiation.js +150 -0
  103. package/build/utils/communication/notification.js +369 -0
  104. package/build/utils/date-converter.js +160 -0
  105. package/build/utils/llm-client-detector.js +758 -0
  106. package/build/utils/logger.js +198 -0
  107. package/build/utils/oauth-helper.js +315 -0
  108. package/build/utils/order-management/dispute.js +369 -0
  109. package/build/utils/order-management/fulfillment.js +205 -0
  110. package/build/utils/other/compliance.js +76 -0
  111. package/build/utils/other/edelivery.js +241 -0
  112. package/build/utils/other/identity.js +13 -0
  113. package/build/utils/other/translation.js +41 -0
  114. package/build/utils/other/vero.js +90 -0
  115. package/build/utils/scope-helper.js +207 -0
  116. package/build/utils/security-checker.js +248 -0
  117. package/build/utils/setup-validator.js +305 -0
  118. package/build/utils/token-utils.js +40 -0
  119. package/build/utils/version.js +56 -0
  120. package/docs/auth/production_scopes.json +111 -0
  121. package/docs/auth/sandbox_scopes.json +142 -0
  122. package/package.json +122 -0
  123. package/public/icons/1024x1024.png +0 -0
  124. package/public/icons/128x128.png +0 -0
  125. package/public/icons/16x16.png +0 -0
  126. package/public/icons/256x256.png +0 -0
  127. package/public/icons/32x32.png +0 -0
  128. package/public/icons/48x48.png +0 -0
  129. package/public/icons/512x512.png +0 -0
@@ -0,0 +1,485 @@
1
+ /**
2
+ * Metadata API - Marketplace policies and configurations
3
+ * Based on: docs/sell-apps/listing-metadata/sell_metadata_v1_oas3.json
4
+ */
5
+ export class MetadataApi {
6
+ client;
7
+ basePath = '/sell/metadata/v1';
8
+ constructor(client) {
9
+ this.client = client;
10
+ }
11
+ /**
12
+ * Get automotive parts compatibility policies for a marketplace
13
+ * Endpoint: GET /marketplace/{marketplace_id}/get_automotive_parts_compatibility_policies
14
+ * @throws Error if marketplaceId is missing or invalid
15
+ */
16
+ async getAutomotivePartsCompatibilityPolicies(marketplaceId, filter) {
17
+ if (!marketplaceId || typeof marketplaceId !== 'string') {
18
+ throw new Error('marketplaceId is required and must be a string');
19
+ }
20
+ if (filter !== undefined && typeof filter !== 'string') {
21
+ throw new Error('filter must be a string when provided');
22
+ }
23
+ try {
24
+ const params = {};
25
+ if (filter)
26
+ params.filter = filter;
27
+ return await this.client.get(`${this.basePath}/marketplace/${marketplaceId}/get_automotive_parts_compatibility_policies`, params);
28
+ }
29
+ catch (error) {
30
+ throw new Error(`Failed to get automotive parts compatibility policies: ${error instanceof Error ? error.message : 'Unknown error'}`);
31
+ }
32
+ }
33
+ /**
34
+ * Get category policies for a marketplace
35
+ * Endpoint: GET /marketplace/{marketplace_id}/get_category_policies
36
+ * @throws Error if marketplaceId is missing or invalid
37
+ */
38
+ async getCategoryPolicies(marketplaceId, filter) {
39
+ if (!marketplaceId || typeof marketplaceId !== 'string') {
40
+ throw new Error('marketplaceId is required and must be a string');
41
+ }
42
+ if (filter !== undefined && typeof filter !== 'string') {
43
+ throw new Error('filter must be a string when provided');
44
+ }
45
+ try {
46
+ const params = {};
47
+ if (filter)
48
+ params.filter = filter;
49
+ return await this.client.get(`${this.basePath}/marketplace/${marketplaceId}/get_category_policies`, params);
50
+ }
51
+ catch (error) {
52
+ throw new Error(`Failed to get category policies: ${error instanceof Error ? error.message : 'Unknown error'}`);
53
+ }
54
+ }
55
+ /**
56
+ * Get extended producer responsibility policies
57
+ * Endpoint: GET /marketplace/{marketplace_id}/get_extended_producer_responsibility_policies
58
+ * @throws Error if marketplaceId is missing or invalid
59
+ */
60
+ async getExtendedProducerResponsibilityPolicies(marketplaceId, filter) {
61
+ if (!marketplaceId || typeof marketplaceId !== 'string') {
62
+ throw new Error('marketplaceId is required and must be a string');
63
+ }
64
+ if (filter !== undefined && typeof filter !== 'string') {
65
+ throw new Error('filter must be a string when provided');
66
+ }
67
+ try {
68
+ const params = {};
69
+ if (filter)
70
+ params.filter = filter;
71
+ return await this.client.get(`${this.basePath}/marketplace/${marketplaceId}/get_extended_producer_responsibility_policies`, params);
72
+ }
73
+ catch (error) {
74
+ throw new Error(`Failed to get extended producer responsibility policies: ${error instanceof Error ? error.message : 'Unknown error'}`);
75
+ }
76
+ }
77
+ /**
78
+ * Get hazardous materials labels
79
+ * Endpoint: GET /marketplace/{marketplace_id}/get_hazardous_materials_labels
80
+ * @throws Error if marketplaceId is missing or invalid
81
+ */
82
+ async getHazardousMaterialsLabels(marketplaceId) {
83
+ if (!marketplaceId || typeof marketplaceId !== 'string') {
84
+ throw new Error('marketplaceId is required and must be a string');
85
+ }
86
+ try {
87
+ return await this.client.get(`${this.basePath}/marketplace/${marketplaceId}/get_hazardous_materials_labels`);
88
+ }
89
+ catch (error) {
90
+ throw new Error(`Failed to get hazardous materials labels: ${error instanceof Error ? error.message : 'Unknown error'}`);
91
+ }
92
+ }
93
+ /**
94
+ * Get item condition policies for a marketplace
95
+ * Endpoint: GET /marketplace/{marketplace_id}/get_item_condition_policies
96
+ * @throws Error if marketplaceId is missing or invalid
97
+ */
98
+ async getItemConditionPolicies(marketplaceId, filter) {
99
+ if (!marketplaceId || typeof marketplaceId !== 'string') {
100
+ throw new Error('marketplaceId is required and must be a string');
101
+ }
102
+ if (filter !== undefined && typeof filter !== 'string') {
103
+ throw new Error('filter must be a string when provided');
104
+ }
105
+ try {
106
+ const params = {};
107
+ if (filter)
108
+ params.filter = filter;
109
+ return await this.client.get(`${this.basePath}/marketplace/${marketplaceId}/get_item_condition_policies`, params);
110
+ }
111
+ catch (error) {
112
+ throw new Error(`Failed to get item condition policies: ${error instanceof Error ? error.message : 'Unknown error'}`);
113
+ }
114
+ }
115
+ /**
116
+ * Get listing structure policies
117
+ * Endpoint: GET /marketplace/{marketplace_id}/get_listing_structure_policies
118
+ * @throws Error if marketplaceId is missing or invalid
119
+ */
120
+ async getListingStructurePolicies(marketplaceId, filter) {
121
+ if (!marketplaceId || typeof marketplaceId !== 'string') {
122
+ throw new Error('marketplaceId is required and must be a string');
123
+ }
124
+ if (filter !== undefined && typeof filter !== 'string') {
125
+ throw new Error('filter must be a string when provided');
126
+ }
127
+ try {
128
+ const params = {};
129
+ if (filter)
130
+ params.filter = filter;
131
+ return await this.client.get(`${this.basePath}/marketplace/${marketplaceId}/get_listing_structure_policies`, params);
132
+ }
133
+ catch (error) {
134
+ throw new Error(`Failed to get listing structure policies: ${error instanceof Error ? error.message : 'Unknown error'}`);
135
+ }
136
+ }
137
+ /**
138
+ * Get negotiated price policies
139
+ * Endpoint: GET /marketplace/{marketplace_id}/get_negotiated_price_policies
140
+ * @throws Error if marketplaceId is missing or invalid
141
+ */
142
+ async getNegotiatedPricePolicies(marketplaceId, filter) {
143
+ if (!marketplaceId || typeof marketplaceId !== 'string') {
144
+ throw new Error('marketplaceId is required and must be a string');
145
+ }
146
+ if (filter !== undefined && typeof filter !== 'string') {
147
+ throw new Error('filter must be a string when provided');
148
+ }
149
+ try {
150
+ const params = {};
151
+ if (filter)
152
+ params.filter = filter;
153
+ return await this.client.get(`${this.basePath}/marketplace/${marketplaceId}/get_negotiated_price_policies`, params);
154
+ }
155
+ catch (error) {
156
+ throw new Error(`Failed to get negotiated price policies: ${error instanceof Error ? error.message : 'Unknown error'}`);
157
+ }
158
+ }
159
+ /**
160
+ * Get product safety labels
161
+ * Endpoint: GET /marketplace/{marketplace_id}/get_product_safety_labels
162
+ * @throws Error if marketplaceId is missing or invalid
163
+ */
164
+ async getProductSafetyLabels(marketplaceId) {
165
+ if (!marketplaceId || typeof marketplaceId !== 'string') {
166
+ throw new Error('marketplaceId is required and must be a string');
167
+ }
168
+ try {
169
+ return await this.client.get(`${this.basePath}/marketplace/${marketplaceId}/get_product_safety_labels`);
170
+ }
171
+ catch (error) {
172
+ throw new Error(`Failed to get product safety labels: ${error instanceof Error ? error.message : 'Unknown error'}`);
173
+ }
174
+ }
175
+ /**
176
+ * Get regulatory policies
177
+ * Endpoint: GET /marketplace/{marketplace_id}/get_regulatory_policies
178
+ * @throws Error if marketplaceId is missing or invalid
179
+ */
180
+ async getRegulatoryPolicies(marketplaceId, filter) {
181
+ if (!marketplaceId || typeof marketplaceId !== 'string') {
182
+ throw new Error('marketplaceId is required and must be a string');
183
+ }
184
+ if (filter !== undefined && typeof filter !== 'string') {
185
+ throw new Error('filter must be a string when provided');
186
+ }
187
+ try {
188
+ const params = {};
189
+ if (filter)
190
+ params.filter = filter;
191
+ return await this.client.get(`${this.basePath}/marketplace/${marketplaceId}/get_regulatory_policies`, params);
192
+ }
193
+ catch (error) {
194
+ throw new Error(`Failed to get regulatory policies: ${error instanceof Error ? error.message : 'Unknown error'}`);
195
+ }
196
+ }
197
+ /**
198
+ * Get return policies for a marketplace
199
+ * Endpoint: GET /marketplace/{marketplace_id}/get_return_policies
200
+ * @throws Error if marketplaceId is missing or invalid
201
+ */
202
+ async getReturnPolicies(marketplaceId, filter) {
203
+ if (!marketplaceId || typeof marketplaceId !== 'string') {
204
+ throw new Error('marketplaceId is required and must be a string');
205
+ }
206
+ if (filter !== undefined && typeof filter !== 'string') {
207
+ throw new Error('filter must be a string when provided');
208
+ }
209
+ try {
210
+ const params = {};
211
+ if (filter)
212
+ params.filter = filter;
213
+ return await this.client.get(`${this.basePath}/marketplace/${marketplaceId}/get_return_policies`, params);
214
+ }
215
+ catch (error) {
216
+ throw new Error(`Failed to get return policies: ${error instanceof Error ? error.message : 'Unknown error'}`);
217
+ }
218
+ }
219
+ /**
220
+ * Get shipping cost type policies
221
+ * Endpoint: GET /marketplace/{marketplace_id}/get_shipping_cost_type_policies
222
+ * @throws Error if marketplaceId is missing or invalid
223
+ */
224
+ async getShippingCostTypePolicies(marketplaceId, filter) {
225
+ if (!marketplaceId || typeof marketplaceId !== 'string') {
226
+ throw new Error('marketplaceId is required and must be a string');
227
+ }
228
+ if (filter !== undefined && typeof filter !== 'string') {
229
+ throw new Error('filter must be a string when provided');
230
+ }
231
+ try {
232
+ const params = {};
233
+ if (filter)
234
+ params.filter = filter;
235
+ return await this.client.get(`${this.basePath}/marketplace/${marketplaceId}/get_shipping_cost_type_policies`, params);
236
+ }
237
+ catch (error) {
238
+ throw new Error(`Failed to get shipping cost type policies: ${error instanceof Error ? error.message : 'Unknown error'}`);
239
+ }
240
+ }
241
+ /**
242
+ * Get classified ad policies for a marketplace
243
+ * Endpoint: GET /marketplace/{marketplace_id}/get_classified_ad_policies
244
+ * @throws Error if marketplaceId is missing or invalid
245
+ */
246
+ async getClassifiedAdPolicies(marketplaceId, filter) {
247
+ if (!marketplaceId || typeof marketplaceId !== 'string') {
248
+ throw new Error('marketplaceId is required and must be a string');
249
+ }
250
+ if (filter !== undefined && typeof filter !== 'string') {
251
+ throw new Error('filter must be a string when provided');
252
+ }
253
+ try {
254
+ const params = {};
255
+ if (filter)
256
+ params.filter = filter;
257
+ return await this.client.get(`${this.basePath}/marketplace/${marketplaceId}/get_classified_ad_policies`, params);
258
+ }
259
+ catch (error) {
260
+ throw new Error(`Failed to get classified ad policies: ${error instanceof Error ? error.message : 'Unknown error'}`);
261
+ }
262
+ }
263
+ /**
264
+ * Get currencies for a marketplace
265
+ * Endpoint: GET /marketplace/{marketplace_id}/get_currencies
266
+ * @throws Error if marketplaceId is missing or invalid
267
+ */
268
+ async getCurrencies(marketplaceId) {
269
+ if (!marketplaceId || typeof marketplaceId !== 'string') {
270
+ throw new Error('marketplaceId is required and must be a string');
271
+ }
272
+ try {
273
+ return await this.client.get(`${this.basePath}/marketplace/${marketplaceId}/get_currencies`);
274
+ }
275
+ catch (error) {
276
+ throw new Error(`Failed to get currencies: ${error instanceof Error ? error.message : 'Unknown error'}`);
277
+ }
278
+ }
279
+ /**
280
+ * Get listing type policies for a marketplace
281
+ * Endpoint: GET /marketplace/{marketplace_id}/get_listing_type_policies
282
+ * @throws Error if marketplaceId is missing or invalid
283
+ */
284
+ async getListingTypePolicies(marketplaceId, filter) {
285
+ if (!marketplaceId || typeof marketplaceId !== 'string') {
286
+ throw new Error('marketplaceId is required and must be a string');
287
+ }
288
+ if (filter !== undefined && typeof filter !== 'string') {
289
+ throw new Error('filter must be a string when provided');
290
+ }
291
+ try {
292
+ const params = {};
293
+ if (filter)
294
+ params.filter = filter;
295
+ return await this.client.get(`${this.basePath}/marketplace/${marketplaceId}/get_listing_type_policies`, params);
296
+ }
297
+ catch (error) {
298
+ throw new Error(`Failed to get listing type policies: ${error instanceof Error ? error.message : 'Unknown error'}`);
299
+ }
300
+ }
301
+ /**
302
+ * Get motors listing policies for a marketplace
303
+ * Endpoint: GET /marketplace/{marketplace_id}/get_motors_listing_policies
304
+ * @throws Error if marketplaceId is missing or invalid
305
+ */
306
+ async getMotorsListingPolicies(marketplaceId, filter) {
307
+ if (!marketplaceId || typeof marketplaceId !== 'string') {
308
+ throw new Error('marketplaceId is required and must be a string');
309
+ }
310
+ if (filter !== undefined && typeof filter !== 'string') {
311
+ throw new Error('filter must be a string when provided');
312
+ }
313
+ try {
314
+ const params = {};
315
+ if (filter)
316
+ params.filter = filter;
317
+ return await this.client.get(`${this.basePath}/marketplace/${marketplaceId}/get_motors_listing_policies`, params);
318
+ }
319
+ catch (error) {
320
+ throw new Error(`Failed to get motors listing policies: ${error instanceof Error ? error.message : 'Unknown error'}`);
321
+ }
322
+ }
323
+ /**
324
+ * Get shipping policies for a marketplace
325
+ * Endpoint: GET /marketplace/{marketplace_id}/get_shipping_policies
326
+ * @throws Error if marketplaceId is missing or invalid
327
+ */
328
+ async getShippingPolicies(marketplaceId, filter) {
329
+ if (!marketplaceId || typeof marketplaceId !== 'string') {
330
+ throw new Error('marketplaceId is required and must be a string');
331
+ }
332
+ if (filter !== undefined && typeof filter !== 'string') {
333
+ throw new Error('filter must be a string when provided');
334
+ }
335
+ try {
336
+ const params = {};
337
+ if (filter)
338
+ params.filter = filter;
339
+ return await this.client.get(`${this.basePath}/marketplace/${marketplaceId}/get_shipping_policies`, params);
340
+ }
341
+ catch (error) {
342
+ throw new Error(`Failed to get shipping policies: ${error instanceof Error ? error.message : 'Unknown error'}`);
343
+ }
344
+ }
345
+ /**
346
+ * Get site visibility policies for a marketplace
347
+ * Endpoint: GET /marketplace/{marketplace_id}/get_site_visibility_policies
348
+ * @throws Error if marketplaceId is missing or invalid
349
+ */
350
+ async getSiteVisibilityPolicies(marketplaceId, filter) {
351
+ if (!marketplaceId || typeof marketplaceId !== 'string') {
352
+ throw new Error('marketplaceId is required and must be a string');
353
+ }
354
+ if (filter !== undefined && typeof filter !== 'string') {
355
+ throw new Error('filter must be a string when provided');
356
+ }
357
+ try {
358
+ const params = {};
359
+ if (filter)
360
+ params.filter = filter;
361
+ return await this.client.get(`${this.basePath}/marketplace/${marketplaceId}/get_site_visibility_policies`, params);
362
+ }
363
+ catch (error) {
364
+ throw new Error(`Failed to get site visibility policies: ${error instanceof Error ? error.message : 'Unknown error'}`);
365
+ }
366
+ }
367
+ /**
368
+ * Get compatibilities by specification
369
+ * Endpoint: POST /compatibilities/get_compatibilities_by_specification
370
+ * @throws Error if specification is missing or invalid
371
+ */
372
+ async getCompatibilitiesBySpecification(specification) {
373
+ if (!specification || typeof specification !== 'object') {
374
+ throw new Error('specification is required and must be an object');
375
+ }
376
+ try {
377
+ return await this.client.post(`${this.basePath}/compatibilities/get_compatibilities_by_specification`, specification);
378
+ }
379
+ catch (error) {
380
+ throw new Error(`Failed to get compatibilities by specification: ${error instanceof Error ? error.message : 'Unknown error'}`);
381
+ }
382
+ }
383
+ /**
384
+ * Get compatibility property names
385
+ * Endpoint: POST /compatibilities/get_compatibility_property_names
386
+ * @throws Error if request data is missing or invalid
387
+ */
388
+ async getCompatibilityPropertyNames(data) {
389
+ if (!data || typeof data !== 'object') {
390
+ throw new Error('data is required and must be an object');
391
+ }
392
+ try {
393
+ return await this.client.post(`${this.basePath}/compatibilities/get_compatibility_property_names`, data);
394
+ }
395
+ catch (error) {
396
+ throw new Error(`Failed to get compatibility property names: ${error instanceof Error ? error.message : 'Unknown error'}`);
397
+ }
398
+ }
399
+ /**
400
+ * Get compatibility property values
401
+ * Endpoint: POST /compatibilities/get_compatibility_property_values
402
+ * @throws Error if request data is missing or invalid
403
+ */
404
+ async getCompatibilityPropertyValues(data) {
405
+ if (!data || typeof data !== 'object') {
406
+ throw new Error('data is required and must be an object');
407
+ }
408
+ try {
409
+ return await this.client.post(`${this.basePath}/compatibilities/get_compatibility_property_values`, data);
410
+ }
411
+ catch (error) {
412
+ throw new Error(`Failed to get compatibility property values: ${error instanceof Error ? error.message : 'Unknown error'}`);
413
+ }
414
+ }
415
+ /**
416
+ * Get multi compatibility property values
417
+ * Endpoint: POST /compatibilities/get_multi_compatibility_property_values
418
+ * @throws Error if request data is missing or invalid
419
+ */
420
+ async getMultiCompatibilityPropertyValues(data) {
421
+ if (!data || typeof data !== 'object') {
422
+ throw new Error('data is required and must be an object');
423
+ }
424
+ try {
425
+ return await this.client.post(`${this.basePath}/compatibilities/get_multi_compatibility_property_values`, data);
426
+ }
427
+ catch (error) {
428
+ throw new Error(`Failed to get multi compatibility property values: ${error instanceof Error ? error.message : 'Unknown error'}`);
429
+ }
430
+ }
431
+ /**
432
+ * Get product compatibilities
433
+ * Endpoint: POST /compatibilities/get_product_compatibilities
434
+ * @throws Error if request data is missing or invalid
435
+ */
436
+ async getProductCompatibilities(data) {
437
+ if (!data || typeof data !== 'object') {
438
+ throw new Error('data is required and must be an object');
439
+ }
440
+ try {
441
+ return await this.client.post(`${this.basePath}/compatibilities/get_product_compatibilities`, data);
442
+ }
443
+ catch (error) {
444
+ throw new Error(`Failed to get product compatibilities: ${error instanceof Error ? error.message : 'Unknown error'}`);
445
+ }
446
+ }
447
+ /**
448
+ * Get sales tax jurisdictions for a country
449
+ * Endpoint: GET /country/{countryCode}/sales_tax_jurisdiction
450
+ * @throws Error if countryCode is missing or invalid
451
+ */
452
+ async getSalesTaxJurisdictions(countryCode) {
453
+ if (!countryCode || typeof countryCode !== 'string') {
454
+ throw new Error('countryCode is required and must be a string');
455
+ }
456
+ try {
457
+ return await this.client.get(`${this.basePath}/country/${countryCode}/sales_tax_jurisdiction`);
458
+ }
459
+ catch (error) {
460
+ throw new Error(`Failed to get sales tax jurisdictions: ${error instanceof Error ? error.message : 'Unknown error'}`);
461
+ }
462
+ }
463
+ /**
464
+ * Get product compliance policies
465
+ * Endpoint: GET /marketplace/{marketplace_id}/get_product_compliance_policies
466
+ * @throws Error if marketplaceId is missing or invalid
467
+ */
468
+ async getProductCompliancePolicies(marketplaceId, filter) {
469
+ if (!marketplaceId || typeof marketplaceId !== 'string') {
470
+ throw new Error('marketplaceId is required and must be a string');
471
+ }
472
+ if (filter !== undefined && typeof filter !== 'string') {
473
+ throw new Error('filter must be a string when provided');
474
+ }
475
+ try {
476
+ const params = {};
477
+ if (filter)
478
+ params.filter = filter;
479
+ return await this.client.get(`${this.basePath}/marketplace/${marketplaceId}/get_product_compliance_policies`, params);
480
+ }
481
+ catch (error) {
482
+ throw new Error(`Failed to get product compliance policies: ${error instanceof Error ? error.message : 'Unknown error'}`);
483
+ }
484
+ }
485
+ }
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Taxonomy API - Category trees and hierarchies
3
+ * Based on: eBay Commerce Taxonomy API
4
+ */
5
+ export class TaxonomyApi {
6
+ client;
7
+ basePath = '/commerce/taxonomy/v1';
8
+ constructor(client) {
9
+ this.client = client;
10
+ }
11
+ /**
12
+ * Get the default category tree ID for a marketplace
13
+ */
14
+ async getDefaultCategoryTreeId(marketplaceId) {
15
+ return await this.client.get(`${this.basePath}/get_default_category_tree_id`, {
16
+ marketplace_id: marketplaceId,
17
+ });
18
+ }
19
+ /**
20
+ * Get category tree
21
+ */
22
+ async getCategoryTree(categoryTreeId) {
23
+ return await this.client.get(`${this.basePath}/category_tree/${categoryTreeId}`);
24
+ }
25
+ /**
26
+ * Get category subtree
27
+ */
28
+ async getCategorySubtree(categoryTreeId, categoryId) {
29
+ return await this.client.get(`${this.basePath}/category_tree/${categoryTreeId}/get_category_subtree`, { category_id: categoryId });
30
+ }
31
+ /**
32
+ * Get category suggestions
33
+ */
34
+ async getCategorySuggestions(categoryTreeId, query) {
35
+ return await this.client.get(`${this.basePath}/category_tree/${categoryTreeId}/get_category_suggestions`, { q: query });
36
+ }
37
+ /**
38
+ * Get item aspects for category
39
+ */
40
+ async getItemAspectsForCategory(categoryTreeId, categoryId) {
41
+ return await this.client.get(`${this.basePath}/category_tree/${categoryTreeId}/get_item_aspects_for_category`, { category_id: categoryId });
42
+ }
43
+ /**
44
+ * Get compatibility properties
45
+ */
46
+ async getCompatibilityProperties(categoryTreeId, categoryId) {
47
+ return await this.client.get(`${this.basePath}/category_tree/${categoryTreeId}/get_compatibility_properties`, { category_id: categoryId });
48
+ }
49
+ /**
50
+ * Get compatibility property values
51
+ */
52
+ async getCompatibilityPropertyValues(categoryTreeId, categoryId, compatibilityProperty) {
53
+ return await this.client.get(`${this.basePath}/category_tree/${categoryTreeId}/get_compatibility_property_values`, {
54
+ category_id: categoryId,
55
+ compatibility_property: compatibilityProperty,
56
+ });
57
+ }
58
+ }