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,32 @@
1
+ /**
2
+ * Recommendation API - Listing recommendations
3
+ * Based on: docs/sell-apps/marketing-and-promotions/sell_recommendation_v1_oas3.json
4
+ */
5
+ export class RecommendationApi {
6
+ client;
7
+ basePath = '/sell/recommendation/v1';
8
+ constructor(client) {
9
+ this.client = client;
10
+ }
11
+ /**
12
+ * Find listing recommendations
13
+ * Endpoint: POST /find
14
+ */
15
+ async findListingRecommendations(requestBody, filter, limit, offset, marketplaceId) {
16
+ const params = {};
17
+ if (filter)
18
+ params.filter = filter;
19
+ if (limit)
20
+ params.limit = limit;
21
+ if (offset)
22
+ params.offset = offset;
23
+ const headers = {};
24
+ if (marketplaceId) {
25
+ headers['X-EBAY-C-MARKETPLACE-ID'] = marketplaceId;
26
+ }
27
+ return await this.client.post(`${this.basePath}/find`, requestBody || {}, {
28
+ params,
29
+ headers,
30
+ });
31
+ }
32
+ }
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Dispute API - Manage payment disputes
3
+ * Based on: docs/sell-apps/order-management/sell_fulfillment_v1_oas3.json
4
+ */
5
+ export class DisputeApi {
6
+ client;
7
+ basePath = '/sell/fulfillment/v1';
8
+ constructor(client) {
9
+ this.client = client;
10
+ }
11
+ /**
12
+ * Get payment dispute details
13
+ */
14
+ async getPaymentDispute(paymentDisputeId) {
15
+ return await this.client.get(`${this.basePath}/payment_dispute/${paymentDisputeId}`);
16
+ }
17
+ /**
18
+ * Get payment dispute evidence file
19
+ */
20
+ async fetchEvidenceContent(paymentDisputeId, evidenceId, fileId) {
21
+ const params = {
22
+ evidence_id: evidenceId,
23
+ file_id: fileId,
24
+ };
25
+ return await this.client.get(`${this.basePath}/payment_dispute/${paymentDisputeId}/fetch_evidence_content`, params);
26
+ }
27
+ /**
28
+ * Get payment dispute activity
29
+ */
30
+ async getActivities(paymentDisputeId) {
31
+ return await this.client.get(`${this.basePath}/payment_dispute/${paymentDisputeId}/activity`);
32
+ }
33
+ /**
34
+ * Search for payment disputes
35
+ */
36
+ async getPaymentDisputeSummaries(params) {
37
+ return await this.client.get(`${this.basePath}/payment_dispute_summary`, params);
38
+ }
39
+ /**
40
+ * Contest a payment dispute
41
+ */
42
+ async contestPaymentDispute(paymentDisputeId, body) {
43
+ return await this.client.post(`${this.basePath}/payment_dispute/${paymentDisputeId}/contest`, body);
44
+ }
45
+ /**
46
+ * Accept a payment dispute
47
+ */
48
+ async acceptPaymentDispute(paymentDisputeId, body) {
49
+ return await this.client.post(`${this.basePath}/payment_dispute/${paymentDisputeId}/accept`, body);
50
+ }
51
+ /**
52
+ * Upload an evidence file
53
+ */
54
+ async uploadEvidenceFile(paymentDisputeId, body) {
55
+ return await this.client.post(`${this.basePath}/payment_dispute/${paymentDisputeId}/upload_evidence_file`, body, { headers: { 'Content-Type': 'multipart/form-data' } });
56
+ }
57
+ /**
58
+ * Add an evidence file
59
+ */
60
+ async addEvidence(paymentDisputeId, body) {
61
+ return await this.client.post(`${this.basePath}/payment_dispute/${paymentDisputeId}/add_evidence`, body);
62
+ }
63
+ /**
64
+ * Update an evidence file
65
+ */
66
+ async updateEvidence(paymentDisputeId, body) {
67
+ return await this.client.post(`${this.basePath}/payment_dispute/${paymentDisputeId}/update_evidence`, body);
68
+ }
69
+ }
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Fulfillment API - Order processing and shipping
3
+ * Based on: docs/sell-apps/order-management/sell_fulfillment_v1_oas3.json
4
+ */
5
+ export class FulfillmentApi {
6
+ client;
7
+ basePath = '/sell/fulfillment/v1';
8
+ constructor(client) {
9
+ this.client = client;
10
+ }
11
+ /**
12
+ * Get orders for the seller
13
+ */
14
+ async getOrders(filter, limit, offset) {
15
+ const params = {};
16
+ if (filter)
17
+ params.filter = filter;
18
+ if (limit)
19
+ params.limit = limit;
20
+ if (offset)
21
+ params.offset = offset;
22
+ return await this.client.get(`${this.basePath}/order`, params);
23
+ }
24
+ /**
25
+ * Get a specific order
26
+ */
27
+ async getOrder(orderId) {
28
+ return await this.client.get(`${this.basePath}/order/${orderId}`);
29
+ }
30
+ /**
31
+ * Create a shipping fulfillment
32
+ */
33
+ async createShippingFulfillment(orderId, fulfillment) {
34
+ return await this.client.post(`${this.basePath}/order/${orderId}/shipping_fulfillment`, fulfillment);
35
+ }
36
+ /**
37
+ * Get shipping fulfillments for an order
38
+ */
39
+ async getShippingFulfillments(orderId) {
40
+ return await this.client.get(`${this.basePath}/order/${orderId}/shipping_fulfillment`);
41
+ }
42
+ /**
43
+ * Get a specific shipping fulfillment
44
+ * @param orderId The unique identifier of the order.
45
+ * @param fulfillmentId The unique identifier of the fulfillment.
46
+ */
47
+ async getShippingFulfillment(orderId, fulfillmentId) {
48
+ return await this.client.get(`${this.basePath}/order/${orderId}/shipping_fulfillment/${fulfillmentId}`);
49
+ }
50
+ /**
51
+ * Issue a refund
52
+ */
53
+ async issueRefund(orderId, refund) {
54
+ return await this.client.post(`${this.basePath}/order/${orderId}/issue_refund`, refund);
55
+ }
56
+ /**
57
+ * Get payment dispute summaries
58
+ * Note: This method delegates to the DisputeApi
59
+ */
60
+ async getPaymentDisputeSummaries(params) {
61
+ return await this.client.get(`${this.basePath}/payment_dispute_summary`, params);
62
+ }
63
+ /**
64
+ * Get payment dispute activities
65
+ * Note: This method delegates to the DisputeApi
66
+ */
67
+ async getActivities(paymentDisputeId) {
68
+ return await this.client.get(`${this.basePath}/payment_dispute/${paymentDisputeId}/activity`);
69
+ }
70
+ /**
71
+ * Get payment dispute details
72
+ * Note: This method delegates to the DisputeApi
73
+ */
74
+ async getPaymentDispute(paymentDisputeId) {
75
+ return await this.client.get(`${this.basePath}/payment_dispute/${paymentDisputeId}`);
76
+ }
77
+ /**
78
+ * Get shipping quote
79
+ */
80
+ async getShippingQuote(request) {
81
+ return await this.client.post(`${this.basePath}/shipping_quote`, request);
82
+ }
83
+ /**
84
+ * Get cancellation details for an order
85
+ */
86
+ async getCancellation(orderId, cancellationId) {
87
+ return await this.client.get(`${this.basePath}/order/${orderId}/cancellation/${cancellationId}`);
88
+ }
89
+ }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Compliance API - Listing compliance checks
3
+ * Based on: docs/sell-apps/other-apis/sell_compliance_v1_oas3.json
4
+ */
5
+ export class ComplianceApi {
6
+ client;
7
+ basePath = '/sell/compliance/v1';
8
+ constructor(client) {
9
+ this.client = client;
10
+ }
11
+ /**
12
+ * Get listing violations
13
+ */
14
+ async getListingViolations(complianceType, offset, limit) {
15
+ const params = {};
16
+ if (complianceType)
17
+ params.compliance_type = complianceType;
18
+ if (offset)
19
+ params.offset = offset;
20
+ if (limit)
21
+ params.limit = limit;
22
+ return await this.client.get(`${this.basePath}/listing_violation`, params);
23
+ }
24
+ /**
25
+ * Get listing violation summary
26
+ */
27
+ async getListingViolationsSummary(complianceType) {
28
+ const params = {};
29
+ if (complianceType)
30
+ params.compliance_type = complianceType;
31
+ return await this.client.get(`${this.basePath}/listing_violation_summary`, params);
32
+ }
33
+ /**
34
+ * Suppress a violation
35
+ */
36
+ async suppressViolation(listingViolationId) {
37
+ return await this.client.post(`${this.basePath}/suppress_violation`, {
38
+ listing_violation_id: listingViolationId,
39
+ });
40
+ }
41
+ /**
42
+ * Get compliance snapshot (alias for getListingViolations)
43
+ */
44
+ async getComplianceSnapshot(complianceType, offset, limit) {
45
+ return await this.getListingViolations(complianceType, offset, limit);
46
+ }
47
+ }
@@ -0,0 +1,219 @@
1
+ /**
2
+ * eDelivery API - International shipping eDelivery
3
+ * Based on: docs/sell-apps/other-apis/sell_edelivery_international_shipping_oas3.json
4
+ */
5
+ export class EDeliveryApi {
6
+ client;
7
+ basePath = '/sell/logistics/v1';
8
+ constructor(client) {
9
+ this.client = client;
10
+ }
11
+ /**
12
+ * Create shipping quote
13
+ */
14
+ async createShippingQuote(shippingQuoteRequest) {
15
+ return await this.client.post(`${this.basePath}/shipping_quote`, shippingQuoteRequest);
16
+ }
17
+ /**
18
+ * Get shipping quote
19
+ */
20
+ async getShippingQuote(shippingQuoteId) {
21
+ return await this.client.get(`${this.basePath}/shipping_quote/${shippingQuoteId}`);
22
+ }
23
+ // ==================== Cost & Preferences ====================
24
+ /**
25
+ * Get actual costs for shipped packages
26
+ * Endpoint: GET /actual_costs
27
+ */
28
+ async getActualCosts(params) {
29
+ return await this.client.get(`${this.basePath}/actual_costs`, params);
30
+ }
31
+ /**
32
+ * Get address preferences
33
+ * Endpoint: GET /address_preference
34
+ */
35
+ async getAddressPreferences() {
36
+ return await this.client.get(`${this.basePath}/address_preference`);
37
+ }
38
+ /**
39
+ * Create address preference
40
+ * Endpoint: POST /address_preference
41
+ */
42
+ async createAddressPreference(addressPreference) {
43
+ return await this.client.post(`${this.basePath}/address_preference`, addressPreference);
44
+ }
45
+ /**
46
+ * Get consign preferences
47
+ * Endpoint: GET /consign_preference
48
+ */
49
+ async getConsignPreferences() {
50
+ return await this.client.get(`${this.basePath}/consign_preference`);
51
+ }
52
+ /**
53
+ * Create consign preference
54
+ * Endpoint: POST /consign_preference
55
+ */
56
+ async createConsignPreference(consignPreference) {
57
+ return await this.client.post(`${this.basePath}/consign_preference`, consignPreference);
58
+ }
59
+ // ==================== Agents & Services ====================
60
+ /**
61
+ * Get available shipping agents
62
+ * Endpoint: GET /agents
63
+ */
64
+ async getAgents(params) {
65
+ return await this.client.get(`${this.basePath}/agents`, params);
66
+ }
67
+ /**
68
+ * Get battery qualifications
69
+ * Endpoint: GET /battery_qualifications
70
+ */
71
+ async getBatteryQualifications(params) {
72
+ return await this.client.get(`${this.basePath}/battery_qualifications`, params);
73
+ }
74
+ /**
75
+ * Get dropoff sites
76
+ * Endpoint: GET /dropoff_sites
77
+ */
78
+ async getDropoffSites(params) {
79
+ return await this.client.get(`${this.basePath}/dropoff_sites`, params);
80
+ }
81
+ /**
82
+ * Get available shipping services
83
+ * Endpoint: GET /services
84
+ */
85
+ async getShippingServices(params) {
86
+ return await this.client.get(`${this.basePath}/services`, params);
87
+ }
88
+ // ==================== Bundles ====================
89
+ /**
90
+ * Create a bundle of packages
91
+ * Endpoint: POST /bundle
92
+ */
93
+ async createBundle(bundleRequest) {
94
+ return await this.client.post(`${this.basePath}/bundle`, bundleRequest);
95
+ }
96
+ /**
97
+ * Get bundle by ID
98
+ * Endpoint: GET /bundle/{bundle_id}
99
+ */
100
+ async getBundle(bundleId) {
101
+ return await this.client.get(`${this.basePath}/bundle/${bundleId}`);
102
+ }
103
+ /**
104
+ * Cancel a bundle
105
+ * Endpoint: POST /bundle/{bundle_id}/cancel
106
+ */
107
+ async cancelBundle(bundleId) {
108
+ return await this.client.post(`${this.basePath}/bundle/${bundleId}/cancel`, {});
109
+ }
110
+ /**
111
+ * Get bundle label
112
+ * Endpoint: GET /bundle/{bundle_id}/label
113
+ */
114
+ async getBundleLabel(bundleId) {
115
+ return await this.client.get(`${this.basePath}/bundle/${bundleId}/label`);
116
+ }
117
+ // ==================== Packages (Single) ====================
118
+ /**
119
+ * Create a package
120
+ * Endpoint: POST /package
121
+ */
122
+ async createPackage(packageRequest) {
123
+ return await this.client.post(`${this.basePath}/package`, packageRequest);
124
+ }
125
+ /**
126
+ * Get package by ID
127
+ * Endpoint: GET /package/{package_id}
128
+ */
129
+ async getPackage(packageId) {
130
+ return await this.client.get(`${this.basePath}/package/${packageId}`);
131
+ }
132
+ /**
133
+ * Delete a package
134
+ * Endpoint: DELETE /package/{package_id}
135
+ */
136
+ async deletePackage(packageId) {
137
+ return await this.client.delete(`${this.basePath}/package/${packageId}`);
138
+ }
139
+ /**
140
+ * Get package by order line item
141
+ * Endpoint: GET /package/{order_line_item_id}/item
142
+ */
143
+ async getPackageByOrderLineItem(orderLineItemId) {
144
+ return await this.client.get(`${this.basePath}/package/${orderLineItemId}/item`);
145
+ }
146
+ /**
147
+ * Cancel a package
148
+ * Endpoint: POST /package/{package_id}/cancel
149
+ */
150
+ async cancelPackage(packageId) {
151
+ return await this.client.post(`${this.basePath}/package/${packageId}/cancel`, {});
152
+ }
153
+ /**
154
+ * Clone a package
155
+ * Endpoint: POST /package/{package_id}/clone
156
+ */
157
+ async clonePackage(packageId) {
158
+ return await this.client.post(`${this.basePath}/package/${packageId}/clone`, {});
159
+ }
160
+ /**
161
+ * Confirm a package
162
+ * Endpoint: POST /package/{package_id}/confirm
163
+ */
164
+ async confirmPackage(packageId) {
165
+ return await this.client.post(`${this.basePath}/package/${packageId}/confirm`, {});
166
+ }
167
+ // ==================== Packages (Bulk) ====================
168
+ /**
169
+ * Bulk cancel packages
170
+ * Endpoint: POST /package/bulk_cancel_packages
171
+ */
172
+ async bulkCancelPackages(bulkCancelRequest) {
173
+ return await this.client.post(`${this.basePath}/package/bulk_cancel_packages`, bulkCancelRequest);
174
+ }
175
+ /**
176
+ * Bulk confirm packages
177
+ * Endpoint: POST /package/bulk_confirm_packages
178
+ */
179
+ async bulkConfirmPackages(bulkConfirmRequest) {
180
+ return await this.client.post(`${this.basePath}/package/bulk_confirm_packages`, bulkConfirmRequest);
181
+ }
182
+ /**
183
+ * Bulk delete packages
184
+ * Endpoint: POST /package/bulk_delete_packages
185
+ */
186
+ async bulkDeletePackages(bulkDeleteRequest) {
187
+ return await this.client.post(`${this.basePath}/package/bulk_delete_packages`, bulkDeleteRequest);
188
+ }
189
+ // ==================== Labels & Tracking ====================
190
+ /**
191
+ * Get labels
192
+ * Endpoint: GET /labels
193
+ */
194
+ async getLabels(params) {
195
+ return await this.client.get(`${this.basePath}/labels`, params);
196
+ }
197
+ /**
198
+ * Get handover sheet
199
+ * Endpoint: GET /handover_sheet
200
+ */
201
+ async getHandoverSheet(params) {
202
+ return await this.client.get(`${this.basePath}/handover_sheet`, params);
203
+ }
204
+ /**
205
+ * Get tracking information
206
+ * Endpoint: GET /tracking
207
+ */
208
+ async getTracking(params) {
209
+ return await this.client.get(`${this.basePath}/tracking`, params);
210
+ }
211
+ // ==================== Other ====================
212
+ /**
213
+ * Create a complaint
214
+ * Endpoint: POST /complaint
215
+ */
216
+ async createComplaint(complaintRequest) {
217
+ return await this.client.post(`${this.basePath}/complaint`, complaintRequest);
218
+ }
219
+ }
@@ -0,0 +1,24 @@
1
+ import { getIdentityBaseUrl } from '../../config/environment.js';
2
+ /**
3
+ * Identity API - User identity verification
4
+ * Based on: docs/sell-apps/other-apis/commerce_identity_v1_oas3.json
5
+ *
6
+ * Note: Identity API uses apiz subdomain instead of api
7
+ */
8
+ export class IdentityApi {
9
+ client;
10
+ basePath = '/commerce/identity/v1';
11
+ constructor(client) {
12
+ this.client = client;
13
+ }
14
+ /**
15
+ * Get user information
16
+ * Uses apiz.ebay.com instead of api.ebay.com
17
+ */
18
+ async getUser() {
19
+ const config = this.client.getConfig();
20
+ const identityBaseUrl = getIdentityBaseUrl(config.environment);
21
+ const fullUrl = `${identityBaseUrl}${this.basePath}/user`;
22
+ return await this.client.getWithFullUrl(fullUrl);
23
+ }
24
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Translation API - Translation services
3
+ * Based on: docs/sell-apps/other-apis/commerce_translation_v1_beta_oas3.json
4
+ */
5
+ export class TranslationApi {
6
+ client;
7
+ basePath = '/commerce/translation/v1';
8
+ constructor(client) {
9
+ this.client = client;
10
+ }
11
+ /**
12
+ * Translate listing text
13
+ */
14
+ async translate(from, to, translationContext, text) {
15
+ return await this.client.post(`${this.basePath}/translate`, {
16
+ from,
17
+ to,
18
+ translationContext,
19
+ text,
20
+ });
21
+ }
22
+ }
@@ -0,0 +1,48 @@
1
+ /**
2
+ * VERO API - Verified Rights Owner program
3
+ * Based on: docs/sell-apps/other-apis/commerce_vero_v1_oas3.json
4
+ */
5
+ export class VeroApi {
6
+ client;
7
+ basePath = '/commerce/vero/v1';
8
+ constructor(client) {
9
+ this.client = client;
10
+ }
11
+ /**
12
+ * Create a VERO report to report intellectual property infringement
13
+ */
14
+ async createVeroReport(reportData) {
15
+ return await this.client.post(`${this.basePath}/vero_report`, reportData);
16
+ }
17
+ /**
18
+ * Get a specific VERO report by ID
19
+ */
20
+ async getVeroReport(veroReportId) {
21
+ return await this.client.get(`${this.basePath}/vero_report/${veroReportId}`);
22
+ }
23
+ /**
24
+ * Get VERO report items (listings reported for infringement)
25
+ */
26
+ async getVeroReportItems(filter, limit, offset) {
27
+ const params = {};
28
+ if (filter)
29
+ params.filter = filter;
30
+ if (limit)
31
+ params.limit = limit;
32
+ if (offset)
33
+ params.offset = offset;
34
+ return await this.client.get(`${this.basePath}/vero_report_items`, params);
35
+ }
36
+ /**
37
+ * Get a specific VERO reason code by ID
38
+ */
39
+ async getVeroReasonCode(veroReasonCodeId) {
40
+ return await this.client.get(`${this.basePath}/vero_reason_code/${veroReasonCodeId}`);
41
+ }
42
+ /**
43
+ * Get all available VERO reason codes
44
+ */
45
+ async getVeroReasonCodes() {
46
+ return await this.client.get(`${this.basePath}/vero_reason_code`);
47
+ }
48
+ }
@@ -0,0 +1,78 @@
1
+ export class TradingApi {
2
+ client;
3
+ constructor(client) {
4
+ this.client = client;
5
+ }
6
+ async getActiveListings(page = 1, entriesPerPage = 50) {
7
+ const result = await this.client.execute('GetMyeBaySelling', {
8
+ ActiveList: {
9
+ Sort: 'TimeLeft',
10
+ Pagination: {
11
+ EntriesPerPage: entriesPerPage,
12
+ PageNumber: page,
13
+ },
14
+ },
15
+ });
16
+ const activeList = result.ActiveList;
17
+ const itemArray = activeList?.ItemArray;
18
+ const items = itemArray?.Item || [];
19
+ const pagination = activeList?.PaginationResult;
20
+ const listings = items.map((item) => {
21
+ const sellingStatus = item.SellingStatus;
22
+ const currentPrice = sellingStatus?.CurrentPrice;
23
+ const priceValue = typeof currentPrice === 'object' && currentPrice !== null
24
+ ? Number(currentPrice['#text'] || 0)
25
+ : Number(currentPrice || 0);
26
+ return {
27
+ itemId: String(item.ItemID ?? ''),
28
+ title: String(item.Title ?? ''),
29
+ sku: String(item.SKU ?? ''),
30
+ quantity: Number(item.Quantity || 0),
31
+ quantityAvailable: Number(item.QuantityAvailable || 0),
32
+ currentPrice: priceValue,
33
+ watchCount: Number(item.WatchCount || 0),
34
+ listingType: String(item.ListingType ?? ''),
35
+ };
36
+ });
37
+ return {
38
+ listings,
39
+ total: Number(pagination?.TotalNumberOfEntries || 0),
40
+ totalPages: Number(pagination?.TotalNumberOfPages || 0),
41
+ };
42
+ }
43
+ async getListing(itemId) {
44
+ if (!itemId)
45
+ throw new Error('itemId is required');
46
+ const result = await this.client.execute('GetItem', {
47
+ ItemID: itemId,
48
+ DetailLevel: 'ReturnAll',
49
+ });
50
+ const items = result.Item;
51
+ return items?.[0] || result;
52
+ }
53
+ async createListing(item) {
54
+ return await this.client.execute('AddFixedPriceItem', { Item: item });
55
+ }
56
+ async reviseListing(itemId, fields) {
57
+ if (!itemId)
58
+ throw new Error('itemId is required');
59
+ return await this.client.execute('ReviseFixedPriceItem', {
60
+ Item: { ...fields, ItemID: itemId },
61
+ });
62
+ }
63
+ async endListing(itemId, reason = 'NotAvailable') {
64
+ if (!itemId)
65
+ throw new Error('itemId is required');
66
+ return await this.client.execute('EndFixedPriceItem', {
67
+ ItemID: itemId,
68
+ EndingReason: reason,
69
+ });
70
+ }
71
+ async relistItem(itemId, modifications) {
72
+ if (!itemId)
73
+ throw new Error('itemId is required');
74
+ return await this.client.execute('RelistFixedPriceItem', {
75
+ Item: { ...modifications, ItemID: itemId },
76
+ });
77
+ }
78
+ }
@@ -0,0 +1,40 @@
1
+ import axios from 'axios';
2
+ export class CloudflareKVStore {
3
+ client;
4
+ accountId;
5
+ namespaceId;
6
+ constructor() {
7
+ this.accountId = process.env.CLOUDFLARE_ACCOUNT_ID || '';
8
+ this.namespaceId = process.env.CLOUDFLARE_KV_NAMESPACE_ID || '';
9
+ const apiToken = process.env.CLOUDFLARE_API_TOKEN || '';
10
+ this.client = axios.create({
11
+ baseURL: `https://api.cloudflare.com/client/v4/accounts/${this.accountId}/storage/kv/namespaces/${this.namespaceId}`,
12
+ headers: {
13
+ Authorization: `Bearer ${apiToken}`,
14
+ 'Content-Type': 'application/json',
15
+ },
16
+ timeout: 30000,
17
+ });
18
+ }
19
+ async get(key) {
20
+ try {
21
+ const response = await this.client.get(`/values/${encodeURIComponent(key)}`, {
22
+ responseType: 'text',
23
+ });
24
+ return JSON.parse(response.data);
25
+ }
26
+ catch (error) {
27
+ if (axios.isAxiosError(error) && error.response?.status === 404) {
28
+ return null;
29
+ }
30
+ throw error;
31
+ }
32
+ }
33
+ async put(key, value, expirationTtl) {
34
+ const params = expirationTtl ? { expiration_ttl: expirationTtl } : undefined;
35
+ await this.client.put(`/values/${encodeURIComponent(key)}`, JSON.stringify(value), { params });
36
+ }
37
+ async delete(key) {
38
+ await this.client.delete(`/values/${encodeURIComponent(key)}`);
39
+ }
40
+ }