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,373 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notification API - Event notifications and subscriptions
|
|
3
|
+
* Based on: docs/sell-apps/communication/commerce_notification_v1_oas3.json
|
|
4
|
+
*/
|
|
5
|
+
export class NotificationApi {
|
|
6
|
+
client;
|
|
7
|
+
basePath = '/commerce/notification/v1';
|
|
8
|
+
constructor(client) {
|
|
9
|
+
this.client = client;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Get public key for validating notifications
|
|
13
|
+
* @throws Error if required parameters are missing or invalid
|
|
14
|
+
*/
|
|
15
|
+
async getPublicKey(publicKeyId) {
|
|
16
|
+
if (!publicKeyId || typeof publicKeyId !== 'string') {
|
|
17
|
+
throw new Error('publicKeyId is required and must be a string');
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
return await this.client.get(`${this.basePath}/public_key/${publicKeyId}`);
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
throw new Error(`Failed to get public key: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get notification config
|
|
28
|
+
* @throws Error if the request fails
|
|
29
|
+
*/
|
|
30
|
+
async getConfig() {
|
|
31
|
+
try {
|
|
32
|
+
return await this.client.get(`${this.basePath}/config`);
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
throw new Error(`Failed to get config: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Update notification config
|
|
40
|
+
* @throws Error if required parameters are missing or invalid
|
|
41
|
+
*/
|
|
42
|
+
async updateConfig(config) {
|
|
43
|
+
if (!config || typeof config !== 'object') {
|
|
44
|
+
throw new Error('config is required and must be an object');
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
return await this.client.put(`${this.basePath}/config`, config);
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
throw new Error(`Failed to update config: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Get all destinations (paginated)
|
|
55
|
+
* @throws Error if the request fails
|
|
56
|
+
*/
|
|
57
|
+
async getDestinations(limit, continuationToken) {
|
|
58
|
+
const params = {};
|
|
59
|
+
if (limit !== undefined)
|
|
60
|
+
params.limit = String(limit);
|
|
61
|
+
if (continuationToken)
|
|
62
|
+
params.continuation_token = continuationToken;
|
|
63
|
+
try {
|
|
64
|
+
return await this.client.get(`${this.basePath}/destination`, params);
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
throw new Error(`Failed to get destinations: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Get destination
|
|
72
|
+
* @throws Error if required parameters are missing or invalid
|
|
73
|
+
*/
|
|
74
|
+
async getDestination(destinationId) {
|
|
75
|
+
if (!destinationId || typeof destinationId !== 'string') {
|
|
76
|
+
throw new Error('destinationId is required and must be a string');
|
|
77
|
+
}
|
|
78
|
+
try {
|
|
79
|
+
return await this.client.get(`${this.basePath}/destination/${destinationId}`);
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
throw new Error(`Failed to get destination: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Create destination
|
|
87
|
+
* @throws Error if required parameters are missing or invalid
|
|
88
|
+
*/
|
|
89
|
+
async createDestination(destination) {
|
|
90
|
+
if (!destination || typeof destination !== 'object') {
|
|
91
|
+
throw new Error('destination is required and must be an object');
|
|
92
|
+
}
|
|
93
|
+
try {
|
|
94
|
+
return await this.client.post(`${this.basePath}/destination`, destination);
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
throw new Error(`Failed to create destination: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Update destination
|
|
102
|
+
* @throws Error if required parameters are missing or invalid
|
|
103
|
+
*/
|
|
104
|
+
async updateDestination(destinationId, destination) {
|
|
105
|
+
if (!destinationId || typeof destinationId !== 'string') {
|
|
106
|
+
throw new Error('destinationId is required and must be a string');
|
|
107
|
+
}
|
|
108
|
+
if (!destination || typeof destination !== 'object') {
|
|
109
|
+
throw new Error('destination is required and must be an object');
|
|
110
|
+
}
|
|
111
|
+
try {
|
|
112
|
+
return await this.client.put(`${this.basePath}/destination/${destinationId}`, destination);
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
throw new Error(`Failed to update destination: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Delete destination
|
|
120
|
+
* @throws Error if required parameters are missing or invalid
|
|
121
|
+
*/
|
|
122
|
+
async deleteDestination(destinationId) {
|
|
123
|
+
if (!destinationId || typeof destinationId !== 'string') {
|
|
124
|
+
throw new Error('destinationId is required and must be a string');
|
|
125
|
+
}
|
|
126
|
+
try {
|
|
127
|
+
return await this.client.delete(`${this.basePath}/destination/${destinationId}`);
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
throw new Error(`Failed to delete destination: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Get all subscriptions
|
|
135
|
+
* Endpoint: GET /subscription
|
|
136
|
+
* @throws Error if the request fails
|
|
137
|
+
*/
|
|
138
|
+
async getSubscriptions(limit, continuationToken) {
|
|
139
|
+
const params = {};
|
|
140
|
+
if (limit !== undefined) {
|
|
141
|
+
if (typeof limit !== 'number' || limit < 1) {
|
|
142
|
+
throw new Error('limit must be a positive number when provided');
|
|
143
|
+
}
|
|
144
|
+
params.limit = limit;
|
|
145
|
+
}
|
|
146
|
+
if (continuationToken !== undefined) {
|
|
147
|
+
if (typeof continuationToken !== 'string') {
|
|
148
|
+
throw new Error('continuationToken must be a string when provided');
|
|
149
|
+
}
|
|
150
|
+
params.continuation_token = continuationToken;
|
|
151
|
+
}
|
|
152
|
+
try {
|
|
153
|
+
return await this.client.get(`${this.basePath}/subscription`, params);
|
|
154
|
+
}
|
|
155
|
+
catch (error) {
|
|
156
|
+
throw new Error(`Failed to get subscriptions: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Create a subscription
|
|
161
|
+
* Endpoint: POST /subscription
|
|
162
|
+
* @throws Error if required parameters are missing or invalid
|
|
163
|
+
*/
|
|
164
|
+
async createSubscription(subscription) {
|
|
165
|
+
if (!subscription || typeof subscription !== 'object') {
|
|
166
|
+
throw new Error('subscription is required and must be an object');
|
|
167
|
+
}
|
|
168
|
+
try {
|
|
169
|
+
return await this.client.post(`${this.basePath}/subscription`, subscription);
|
|
170
|
+
}
|
|
171
|
+
catch (error) {
|
|
172
|
+
throw new Error(`Failed to create subscription: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Get a subscription
|
|
177
|
+
* Endpoint: GET /subscription/{subscription_id}
|
|
178
|
+
* @throws Error if required parameters are missing or invalid
|
|
179
|
+
*/
|
|
180
|
+
async getSubscription(subscriptionId) {
|
|
181
|
+
if (!subscriptionId || typeof subscriptionId !== 'string') {
|
|
182
|
+
throw new Error('subscriptionId is required and must be a string');
|
|
183
|
+
}
|
|
184
|
+
try {
|
|
185
|
+
return await this.client.get(`${this.basePath}/subscription/${subscriptionId}`);
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
throw new Error(`Failed to get subscription: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Update a subscription
|
|
193
|
+
* Endpoint: PUT /subscription/{subscription_id}
|
|
194
|
+
* @throws Error if required parameters are missing or invalid
|
|
195
|
+
*/
|
|
196
|
+
async updateSubscription(subscriptionId, subscription) {
|
|
197
|
+
if (!subscriptionId || typeof subscriptionId !== 'string') {
|
|
198
|
+
throw new Error('subscriptionId is required and must be a string');
|
|
199
|
+
}
|
|
200
|
+
if (!subscription || typeof subscription !== 'object') {
|
|
201
|
+
throw new Error('subscription is required and must be an object');
|
|
202
|
+
}
|
|
203
|
+
try {
|
|
204
|
+
return await this.client.put(`${this.basePath}/subscription/${subscriptionId}`, subscription);
|
|
205
|
+
}
|
|
206
|
+
catch (error) {
|
|
207
|
+
throw new Error(`Failed to update subscription: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Delete a subscription
|
|
212
|
+
* Endpoint: DELETE /subscription/{subscription_id}
|
|
213
|
+
* @throws Error if required parameters are missing or invalid
|
|
214
|
+
*/
|
|
215
|
+
async deleteSubscription(subscriptionId) {
|
|
216
|
+
if (!subscriptionId || typeof subscriptionId !== 'string') {
|
|
217
|
+
throw new Error('subscriptionId is required and must be a string');
|
|
218
|
+
}
|
|
219
|
+
try {
|
|
220
|
+
return await this.client.delete(`${this.basePath}/subscription/${subscriptionId}`);
|
|
221
|
+
}
|
|
222
|
+
catch (error) {
|
|
223
|
+
throw new Error(`Failed to delete subscription: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Disable a subscription
|
|
228
|
+
* Endpoint: POST /subscription/{subscription_id}/disable
|
|
229
|
+
* @throws Error if required parameters are missing or invalid
|
|
230
|
+
*/
|
|
231
|
+
async disableSubscription(subscriptionId) {
|
|
232
|
+
if (!subscriptionId || typeof subscriptionId !== 'string') {
|
|
233
|
+
throw new Error('subscriptionId is required and must be a string');
|
|
234
|
+
}
|
|
235
|
+
try {
|
|
236
|
+
return await this.client.post(`${this.basePath}/subscription/${subscriptionId}/disable`, {});
|
|
237
|
+
}
|
|
238
|
+
catch (error) {
|
|
239
|
+
throw new Error(`Failed to disable subscription: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Enable a subscription
|
|
244
|
+
* Endpoint: POST /subscription/{subscription_id}/enable
|
|
245
|
+
* @throws Error if required parameters are missing or invalid
|
|
246
|
+
*/
|
|
247
|
+
async enableSubscription(subscriptionId) {
|
|
248
|
+
if (!subscriptionId || typeof subscriptionId !== 'string') {
|
|
249
|
+
throw new Error('subscriptionId is required and must be a string');
|
|
250
|
+
}
|
|
251
|
+
try {
|
|
252
|
+
return await this.client.post(`${this.basePath}/subscription/${subscriptionId}/enable`, {});
|
|
253
|
+
}
|
|
254
|
+
catch (error) {
|
|
255
|
+
throw new Error(`Failed to enable subscription: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Test a subscription
|
|
260
|
+
* Endpoint: POST /subscription/{subscription_id}/test
|
|
261
|
+
* @throws Error if required parameters are missing or invalid
|
|
262
|
+
*/
|
|
263
|
+
async testSubscription(subscriptionId) {
|
|
264
|
+
if (!subscriptionId || typeof subscriptionId !== 'string') {
|
|
265
|
+
throw new Error('subscriptionId is required and must be a string');
|
|
266
|
+
}
|
|
267
|
+
try {
|
|
268
|
+
return await this.client.post(`${this.basePath}/subscription/${subscriptionId}/test`, {});
|
|
269
|
+
}
|
|
270
|
+
catch (error) {
|
|
271
|
+
throw new Error(`Failed to test subscription: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Get a topic
|
|
276
|
+
* Endpoint: GET /topic/{topic_id}
|
|
277
|
+
* @throws Error if required parameters are missing or invalid
|
|
278
|
+
*/
|
|
279
|
+
async getTopic(topicId) {
|
|
280
|
+
if (!topicId || typeof topicId !== 'string') {
|
|
281
|
+
throw new Error('topicId is required and must be a string');
|
|
282
|
+
}
|
|
283
|
+
try {
|
|
284
|
+
return await this.client.get(`${this.basePath}/topic/${topicId}`);
|
|
285
|
+
}
|
|
286
|
+
catch (error) {
|
|
287
|
+
throw new Error(`Failed to get topic: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Get all topics
|
|
292
|
+
* Endpoint: GET /topic
|
|
293
|
+
* @throws Error if the request fails
|
|
294
|
+
*/
|
|
295
|
+
async getTopics(limit, continuationToken) {
|
|
296
|
+
const params = {};
|
|
297
|
+
if (limit !== undefined) {
|
|
298
|
+
if (typeof limit !== 'number' || limit < 1) {
|
|
299
|
+
throw new Error('limit must be a positive number when provided');
|
|
300
|
+
}
|
|
301
|
+
params.limit = limit;
|
|
302
|
+
}
|
|
303
|
+
if (continuationToken !== undefined) {
|
|
304
|
+
if (typeof continuationToken !== 'string') {
|
|
305
|
+
throw new Error('continuationToken must be a string when provided');
|
|
306
|
+
}
|
|
307
|
+
params.continuation_token = continuationToken;
|
|
308
|
+
}
|
|
309
|
+
try {
|
|
310
|
+
return await this.client.get(`${this.basePath}/topic`, params);
|
|
311
|
+
}
|
|
312
|
+
catch (error) {
|
|
313
|
+
throw new Error(`Failed to get topics: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Create a subscription filter
|
|
318
|
+
* Endpoint: POST /subscription/{subscription_id}/filter
|
|
319
|
+
* @throws Error if required parameters are missing or invalid
|
|
320
|
+
*/
|
|
321
|
+
async createSubscriptionFilter(subscriptionId, filter) {
|
|
322
|
+
if (!subscriptionId || typeof subscriptionId !== 'string') {
|
|
323
|
+
throw new Error('subscriptionId is required and must be a string');
|
|
324
|
+
}
|
|
325
|
+
if (!filter || typeof filter !== 'object') {
|
|
326
|
+
throw new Error('filter is required and must be an object');
|
|
327
|
+
}
|
|
328
|
+
try {
|
|
329
|
+
return await this.client.post(`${this.basePath}/subscription/${subscriptionId}/filter`, filter);
|
|
330
|
+
}
|
|
331
|
+
catch (error) {
|
|
332
|
+
throw new Error(`Failed to create subscription filter: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Get a subscription filter
|
|
337
|
+
* Endpoint: GET /subscription/{subscription_id}/filter/{filter_id}
|
|
338
|
+
* @throws Error if required parameters are missing or invalid
|
|
339
|
+
*/
|
|
340
|
+
async getSubscriptionFilter(subscriptionId, filterId) {
|
|
341
|
+
if (!subscriptionId || typeof subscriptionId !== 'string') {
|
|
342
|
+
throw new Error('subscriptionId is required and must be a string');
|
|
343
|
+
}
|
|
344
|
+
if (!filterId || typeof filterId !== 'string') {
|
|
345
|
+
throw new Error('filterId is required and must be a string');
|
|
346
|
+
}
|
|
347
|
+
try {
|
|
348
|
+
return await this.client.get(`${this.basePath}/subscription/${subscriptionId}/filter/${filterId}`);
|
|
349
|
+
}
|
|
350
|
+
catch (error) {
|
|
351
|
+
throw new Error(`Failed to get subscription filter: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Delete a subscription filter
|
|
356
|
+
* Endpoint: DELETE /subscription/{subscription_id}/filter/{filter_id}
|
|
357
|
+
* @throws Error if required parameters are missing or invalid
|
|
358
|
+
*/
|
|
359
|
+
async deleteSubscriptionFilter(subscriptionId, filterId) {
|
|
360
|
+
if (!subscriptionId || typeof subscriptionId !== 'string') {
|
|
361
|
+
throw new Error('subscriptionId is required and must be a string');
|
|
362
|
+
}
|
|
363
|
+
if (!filterId || typeof filterId !== 'string') {
|
|
364
|
+
throw new Error('filterId is required and must be a string');
|
|
365
|
+
}
|
|
366
|
+
try {
|
|
367
|
+
return await this.client.delete(`${this.basePath}/subscription/${subscriptionId}/filter/${filterId}`);
|
|
368
|
+
}
|
|
369
|
+
catch (error) {
|
|
370
|
+
throw new Error(`Failed to delete subscription filter: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { AccountApi } from '../api/account-management/account.js';
|
|
2
|
+
import { AnalyticsApi } from '../api/analytics-and-report/analytics.js';
|
|
3
|
+
import { EbayApiClient } from '../api/client.js';
|
|
4
|
+
import { FeedbackApi } from '../api/communication/feedback.js';
|
|
5
|
+
import { MessageApi } from '../api/communication/message.js';
|
|
6
|
+
import { NegotiationApi } from '../api/communication/negotiation.js';
|
|
7
|
+
import { NotificationApi } from '../api/communication/notification.js';
|
|
8
|
+
import { InventoryApi } from '../api/listing-management/inventory.js';
|
|
9
|
+
import { MetadataApi } from '../api/listing-metadata/metadata.js';
|
|
10
|
+
import { TaxonomyApi } from '../api/listing-metadata/taxonomy.js';
|
|
11
|
+
import { MarketingApi } from '../api/marketing-and-promotions/marketing.js';
|
|
12
|
+
import { RecommendationApi } from '../api/marketing-and-promotions/recommendation.js';
|
|
13
|
+
import { DisputeApi } from '../api/order-management/dispute.js';
|
|
14
|
+
import { FulfillmentApi } from '../api/order-management/fulfillment.js';
|
|
15
|
+
import { ComplianceApi } from '../api/other/compliance.js';
|
|
16
|
+
import { EDeliveryApi } from '../api/other/edelivery.js';
|
|
17
|
+
import { IdentityApi } from '../api/other/identity.js';
|
|
18
|
+
import { TranslationApi } from '../api/other/translation.js';
|
|
19
|
+
import { VeroApi } from '../api/other/vero.js';
|
|
20
|
+
import type { EbayConfig } from '../types/ebay.js';
|
|
21
|
+
/**
|
|
22
|
+
* Main API facade providing access to all eBay APIs
|
|
23
|
+
*/
|
|
24
|
+
export declare class EbaySellerApi {
|
|
25
|
+
private client;
|
|
26
|
+
account: AccountApi;
|
|
27
|
+
inventory: InventoryApi;
|
|
28
|
+
fulfillment: FulfillmentApi;
|
|
29
|
+
dispute: DisputeApi;
|
|
30
|
+
marketing: MarketingApi;
|
|
31
|
+
recommendation: RecommendationApi;
|
|
32
|
+
analytics: AnalyticsApi;
|
|
33
|
+
metadata: MetadataApi;
|
|
34
|
+
taxonomy: TaxonomyApi;
|
|
35
|
+
negotiation: NegotiationApi;
|
|
36
|
+
message: MessageApi;
|
|
37
|
+
notification: NotificationApi;
|
|
38
|
+
feedback: FeedbackApi;
|
|
39
|
+
identity: IdentityApi;
|
|
40
|
+
compliance: ComplianceApi;
|
|
41
|
+
vero: VeroApi;
|
|
42
|
+
translation: TranslationApi;
|
|
43
|
+
edelivery: EDeliveryApi;
|
|
44
|
+
constructor(config: EbayConfig);
|
|
45
|
+
/**
|
|
46
|
+
* Initialize the API (load tokens from storage)
|
|
47
|
+
*/
|
|
48
|
+
initialize(): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Check if the API client is authenticated
|
|
51
|
+
*/
|
|
52
|
+
isAuthenticated(): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Check if user tokens are available
|
|
55
|
+
*/
|
|
56
|
+
hasUserTokens(): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Set user access and refresh tokens
|
|
59
|
+
*/
|
|
60
|
+
setUserTokens(accessToken: string, refreshToken: string): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Get OAuth client for advanced operations
|
|
63
|
+
*/
|
|
64
|
+
getAuthClient(): EbayApiClient;
|
|
65
|
+
/**
|
|
66
|
+
* Get token information for debugging
|
|
67
|
+
*/
|
|
68
|
+
getTokenInfo(): {
|
|
69
|
+
hasUserToken: boolean;
|
|
70
|
+
hasAppAccessToken: boolean;
|
|
71
|
+
scopeInfo?: {
|
|
72
|
+
tokenScopes: string[];
|
|
73
|
+
environmentScopes: string[];
|
|
74
|
+
missingScopes: string[];
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export * from '../api/account-management/account.js';
|
|
79
|
+
export * from '../api/analytics-and-report/analytics.js';
|
|
80
|
+
export * from '../api/client.js';
|
|
81
|
+
export * from '../api/communication/feedback.js';
|
|
82
|
+
export * from '../api/communication/message.js';
|
|
83
|
+
export * from '../api/communication/negotiation.js';
|
|
84
|
+
export * from '../api/communication/notification.js';
|
|
85
|
+
export * from '../api/listing-management/inventory.js';
|
|
86
|
+
export * from '../api/listing-metadata/metadata.js';
|
|
87
|
+
export * from '../api/listing-metadata/taxonomy.js';
|
|
88
|
+
export * from '../api/marketing-and-promotions/marketing.js';
|
|
89
|
+
export * from '../api/marketing-and-promotions/recommendation.js';
|
|
90
|
+
export * from '../api/order-management/dispute.js';
|
|
91
|
+
export * from '../api/order-management/fulfillment.js';
|
|
92
|
+
export * from '../api/other/compliance.js';
|
|
93
|
+
export * from '../api/other/edelivery.js';
|
|
94
|
+
export * from '../api/other/identity.js';
|
|
95
|
+
export * from '../api/other/translation.js';
|
|
96
|
+
export * from '../api/other/vero.js';
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { AccountApi } from '../api/account-management/account.js';
|
|
2
|
+
import { AnalyticsApi } from '../api/analytics-and-report/analytics.js';
|
|
3
|
+
import { EbayApiClient } from '../api/client.js';
|
|
4
|
+
import { FeedbackApi } from '../api/communication/feedback.js';
|
|
5
|
+
import { MessageApi } from '../api/communication/message.js';
|
|
6
|
+
import { NegotiationApi } from '../api/communication/negotiation.js';
|
|
7
|
+
import { NotificationApi } from '../api/communication/notification.js';
|
|
8
|
+
import { InventoryApi } from '../api/listing-management/inventory.js';
|
|
9
|
+
import { MetadataApi } from '../api/listing-metadata/metadata.js';
|
|
10
|
+
import { TaxonomyApi } from '../api/listing-metadata/taxonomy.js';
|
|
11
|
+
import { MarketingApi } from '../api/marketing-and-promotions/marketing.js';
|
|
12
|
+
import { RecommendationApi } from '../api/marketing-and-promotions/recommendation.js';
|
|
13
|
+
import { DisputeApi } from '../api/order-management/dispute.js';
|
|
14
|
+
import { FulfillmentApi } from '../api/order-management/fulfillment.js';
|
|
15
|
+
import { ComplianceApi } from '../api/other/compliance.js';
|
|
16
|
+
import { EDeliveryApi } from '../api/other/edelivery.js';
|
|
17
|
+
import { IdentityApi } from '../api/other/identity.js';
|
|
18
|
+
import { TranslationApi } from '../api/other/translation.js';
|
|
19
|
+
import { VeroApi } from '../api/other/vero.js';
|
|
20
|
+
/**
|
|
21
|
+
* Main API facade providing access to all eBay APIs
|
|
22
|
+
*/
|
|
23
|
+
export class EbaySellerApi {
|
|
24
|
+
client;
|
|
25
|
+
// API categories
|
|
26
|
+
account;
|
|
27
|
+
inventory;
|
|
28
|
+
fulfillment;
|
|
29
|
+
dispute;
|
|
30
|
+
marketing;
|
|
31
|
+
recommendation;
|
|
32
|
+
analytics;
|
|
33
|
+
metadata;
|
|
34
|
+
taxonomy;
|
|
35
|
+
negotiation;
|
|
36
|
+
message;
|
|
37
|
+
notification;
|
|
38
|
+
feedback;
|
|
39
|
+
identity;
|
|
40
|
+
compliance;
|
|
41
|
+
vero;
|
|
42
|
+
translation;
|
|
43
|
+
edelivery;
|
|
44
|
+
constructor(config) {
|
|
45
|
+
this.client = new EbayApiClient(config);
|
|
46
|
+
// Initialize API category handlers
|
|
47
|
+
this.account = new AccountApi(this.client);
|
|
48
|
+
this.inventory = new InventoryApi(this.client);
|
|
49
|
+
this.fulfillment = new FulfillmentApi(this.client);
|
|
50
|
+
this.dispute = new DisputeApi(this.client);
|
|
51
|
+
this.marketing = new MarketingApi(this.client);
|
|
52
|
+
this.recommendation = new RecommendationApi(this.client);
|
|
53
|
+
this.analytics = new AnalyticsApi(this.client);
|
|
54
|
+
this.metadata = new MetadataApi(this.client);
|
|
55
|
+
this.taxonomy = new TaxonomyApi(this.client);
|
|
56
|
+
this.negotiation = new NegotiationApi(this.client);
|
|
57
|
+
this.message = new MessageApi(this.client);
|
|
58
|
+
this.notification = new NotificationApi(this.client);
|
|
59
|
+
this.feedback = new FeedbackApi(this.client);
|
|
60
|
+
this.identity = new IdentityApi(this.client);
|
|
61
|
+
this.compliance = new ComplianceApi(this.client);
|
|
62
|
+
this.vero = new VeroApi(this.client);
|
|
63
|
+
this.translation = new TranslationApi(this.client);
|
|
64
|
+
this.edelivery = new EDeliveryApi(this.client);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Initialize the API (load tokens from storage)
|
|
68
|
+
*/
|
|
69
|
+
async initialize() {
|
|
70
|
+
await this.client.initialize();
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Check if the API client is authenticated
|
|
74
|
+
*/
|
|
75
|
+
isAuthenticated() {
|
|
76
|
+
return this.client.isAuthenticated();
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Check if user tokens are available
|
|
80
|
+
*/
|
|
81
|
+
hasUserTokens() {
|
|
82
|
+
return this.client.hasUserTokens();
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Set user access and refresh tokens
|
|
86
|
+
*/
|
|
87
|
+
async setUserTokens(accessToken, refreshToken) {
|
|
88
|
+
await this.client.setUserTokens(accessToken, refreshToken);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Get OAuth client for advanced operations
|
|
92
|
+
*/
|
|
93
|
+
getAuthClient() {
|
|
94
|
+
return this.client;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Get token information for debugging
|
|
98
|
+
*/
|
|
99
|
+
getTokenInfo() {
|
|
100
|
+
return this.client.getTokenInfo();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
export * from '../api/account-management/account.js';
|
|
104
|
+
export * from '../api/analytics-and-report/analytics.js';
|
|
105
|
+
export * from '../api/client.js';
|
|
106
|
+
export * from '../api/communication/feedback.js';
|
|
107
|
+
export * from '../api/communication/message.js';
|
|
108
|
+
export * from '../api/communication/negotiation.js';
|
|
109
|
+
export * from '../api/communication/notification.js';
|
|
110
|
+
export * from '../api/listing-management/inventory.js';
|
|
111
|
+
export * from '../api/listing-metadata/metadata.js';
|
|
112
|
+
export * from '../api/listing-metadata/taxonomy.js';
|
|
113
|
+
export * from '../api/marketing-and-promotions/marketing.js';
|
|
114
|
+
export * from '../api/marketing-and-promotions/recommendation.js';
|
|
115
|
+
export * from '../api/order-management/dispute.js';
|
|
116
|
+
export * from '../api/order-management/fulfillment.js';
|
|
117
|
+
export * from '../api/other/compliance.js';
|
|
118
|
+
export * from '../api/other/edelivery.js';
|
|
119
|
+
export * from '../api/other/identity.js';
|
|
120
|
+
export * from '../api/other/translation.js';
|
|
121
|
+
export * from '../api/other/vero.js';
|