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,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message API - Buyer-seller messaging
|
|
3
|
+
* Based on: docs/sell-apps/communication/commerce_message_v1_oas3.json
|
|
4
|
+
*/
|
|
5
|
+
export class MessageApi {
|
|
6
|
+
client;
|
|
7
|
+
basePath = '/commerce/message/v1';
|
|
8
|
+
constructor(client) {
|
|
9
|
+
this.client = client;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Bulk update conversation
|
|
13
|
+
* Endpoint: POST /bulk_update_conversation
|
|
14
|
+
* @throws Error if required parameters are missing or invalid
|
|
15
|
+
*/
|
|
16
|
+
async bulkUpdateConversation(updateData) {
|
|
17
|
+
if (!updateData || typeof updateData !== 'object') {
|
|
18
|
+
throw new Error('updateData is required and must be an object');
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
return await this.client.post(`${this.basePath}/bulk_update_conversation`, updateData);
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
throw new Error(`Failed to bulk update conversation: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get conversations
|
|
29
|
+
* Endpoint: GET /conversation
|
|
30
|
+
* @throws Error if the request fails
|
|
31
|
+
*/
|
|
32
|
+
async getConversations(filter, limit, offset) {
|
|
33
|
+
const params = {};
|
|
34
|
+
if (filter !== undefined) {
|
|
35
|
+
if (typeof filter !== 'string') {
|
|
36
|
+
throw new Error('filter must be a string when provided');
|
|
37
|
+
}
|
|
38
|
+
params.filter = filter;
|
|
39
|
+
}
|
|
40
|
+
if (limit !== undefined) {
|
|
41
|
+
if (typeof limit !== 'number' || limit < 1) {
|
|
42
|
+
throw new Error('limit must be a positive number when provided');
|
|
43
|
+
}
|
|
44
|
+
params.limit = limit;
|
|
45
|
+
}
|
|
46
|
+
if (offset !== undefined) {
|
|
47
|
+
if (typeof offset !== 'number' || offset < 0) {
|
|
48
|
+
throw new Error('offset must be a non-negative number when provided');
|
|
49
|
+
}
|
|
50
|
+
params.offset = offset;
|
|
51
|
+
}
|
|
52
|
+
try {
|
|
53
|
+
return await this.client.get(`${this.basePath}/conversation`, params);
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
throw new Error(`Failed to get conversations: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Get a specific conversation
|
|
61
|
+
* Endpoint: GET /conversation/{conversation_id}
|
|
62
|
+
* @throws Error if required parameters are missing or invalid
|
|
63
|
+
*/
|
|
64
|
+
async getConversation(conversationId) {
|
|
65
|
+
if (!conversationId || typeof conversationId !== 'string') {
|
|
66
|
+
throw new Error('conversationId is required and must be a string');
|
|
67
|
+
}
|
|
68
|
+
try {
|
|
69
|
+
return await this.client.get(`${this.basePath}/conversation/${conversationId}`);
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
throw new Error(`Failed to get conversation: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Send a message
|
|
77
|
+
* Endpoint: POST /send_message
|
|
78
|
+
* @throws Error if required parameters are missing or invalid
|
|
79
|
+
*/
|
|
80
|
+
async sendMessage(messageData) {
|
|
81
|
+
if (!messageData || typeof messageData !== 'object') {
|
|
82
|
+
throw new Error('messageData is required and must be an object');
|
|
83
|
+
}
|
|
84
|
+
try {
|
|
85
|
+
return await this.client.post(`${this.basePath}/send_message`, messageData);
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
throw new Error(`Failed to send message: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Update a conversation
|
|
93
|
+
* Endpoint: POST /update_conversation
|
|
94
|
+
* @throws Error if required parameters are missing or invalid
|
|
95
|
+
*/
|
|
96
|
+
async updateConversation(updateData) {
|
|
97
|
+
if (!updateData || typeof updateData !== 'object') {
|
|
98
|
+
throw new Error('updateData is required and must be an object');
|
|
99
|
+
}
|
|
100
|
+
try {
|
|
101
|
+
return await this.client.post(`${this.basePath}/update_conversation`, updateData);
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
throw new Error(`Failed to update conversation: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Search for messages
|
|
109
|
+
* @deprecated Use getConversations() instead
|
|
110
|
+
*/
|
|
111
|
+
async searchMessages(filter, limit, offset) {
|
|
112
|
+
return await this.getConversations(filter, limit, offset);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Get a specific message
|
|
116
|
+
* @deprecated Use getConversation() instead
|
|
117
|
+
*/
|
|
118
|
+
async getMessage(messageId) {
|
|
119
|
+
return await this.getConversation(messageId);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Reply to a message
|
|
123
|
+
* @deprecated Use sendMessage() instead
|
|
124
|
+
*/
|
|
125
|
+
async replyToMessage(messageId, messageContent) {
|
|
126
|
+
return await this.sendMessage({
|
|
127
|
+
conversation_id: messageId,
|
|
128
|
+
message_content: messageContent,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { EbayApiClient } from '../client.js';
|
|
2
|
+
/**
|
|
3
|
+
* Negotiation API - Buyer-seller negotiations and offers
|
|
4
|
+
* Based on: docs/sell-apps/communication/sell_negotiation_v1_oas3.json
|
|
5
|
+
*/
|
|
6
|
+
export declare class NegotiationApi {
|
|
7
|
+
private client;
|
|
8
|
+
private readonly basePath;
|
|
9
|
+
constructor(client: EbayApiClient);
|
|
10
|
+
/**
|
|
11
|
+
* Find eligible items for a seller-initiated offer
|
|
12
|
+
* Endpoint: GET /find_eligible_items
|
|
13
|
+
* @throws Error if the request fails
|
|
14
|
+
*/
|
|
15
|
+
findEligibleItems(filter?: string, limit?: number, offset?: number): Promise<unknown>;
|
|
16
|
+
/**
|
|
17
|
+
* Send offer to interested buyers
|
|
18
|
+
* Endpoint: POST /send_offer_to_interested_buyers
|
|
19
|
+
* @throws Error if required parameters are missing or invalid
|
|
20
|
+
*/
|
|
21
|
+
sendOfferToInterestedBuyers(offerData: Record<string, unknown>): Promise<unknown>;
|
|
22
|
+
/**
|
|
23
|
+
* Get offers to buyers (Best Offers)
|
|
24
|
+
* @deprecated This method does not match any endpoint in the OpenAPI spec
|
|
25
|
+
*/
|
|
26
|
+
getOffersToBuyers(filter?: string, limit?: number, offset?: number): Promise<unknown>;
|
|
27
|
+
/**
|
|
28
|
+
* Get offers for listing (alias for getOffersToBuyers)
|
|
29
|
+
* Endpoint: GET /offer
|
|
30
|
+
* @throws Error if the request fails
|
|
31
|
+
*/
|
|
32
|
+
getOffersForListing(filter?: string, limit?: number, offset?: number): Promise<unknown>;
|
|
33
|
+
/**
|
|
34
|
+
* Get a specific offer
|
|
35
|
+
* Endpoint: GET /offer/{offerId}
|
|
36
|
+
* @throws Error if required parameters are missing or invalid
|
|
37
|
+
*/
|
|
38
|
+
getOffer(offerId: string): Promise<unknown>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Negotiation API - Buyer-seller negotiations and offers
|
|
3
|
+
* Based on: docs/sell-apps/communication/sell_negotiation_v1_oas3.json
|
|
4
|
+
*/
|
|
5
|
+
export class NegotiationApi {
|
|
6
|
+
client;
|
|
7
|
+
basePath = '/sell/negotiation/v1';
|
|
8
|
+
constructor(client) {
|
|
9
|
+
this.client = client;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Find eligible items for a seller-initiated offer
|
|
13
|
+
* Endpoint: GET /find_eligible_items
|
|
14
|
+
* @throws Error if the request fails
|
|
15
|
+
*/
|
|
16
|
+
async findEligibleItems(filter, limit, offset) {
|
|
17
|
+
const params = {};
|
|
18
|
+
if (filter !== undefined) {
|
|
19
|
+
if (typeof filter !== 'string') {
|
|
20
|
+
throw new Error('filter must be a string when provided');
|
|
21
|
+
}
|
|
22
|
+
params.filter = filter;
|
|
23
|
+
}
|
|
24
|
+
if (limit !== undefined) {
|
|
25
|
+
if (typeof limit !== 'number' || limit < 1) {
|
|
26
|
+
throw new Error('limit must be a positive number when provided');
|
|
27
|
+
}
|
|
28
|
+
params.limit = limit;
|
|
29
|
+
}
|
|
30
|
+
if (offset !== undefined) {
|
|
31
|
+
if (typeof offset !== 'number' || offset < 0) {
|
|
32
|
+
throw new Error('offset must be a non-negative number when provided');
|
|
33
|
+
}
|
|
34
|
+
params.offset = offset;
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
return await this.client.get(`${this.basePath}/find_eligible_items`, params);
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
throw new Error(`Failed to find eligible items: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Send offer to interested buyers
|
|
45
|
+
* Endpoint: POST /send_offer_to_interested_buyers
|
|
46
|
+
* @throws Error if required parameters are missing or invalid
|
|
47
|
+
*/
|
|
48
|
+
async sendOfferToInterestedBuyers(offerData) {
|
|
49
|
+
if (!offerData || typeof offerData !== 'object') {
|
|
50
|
+
throw new Error('offerData is required and must be an object');
|
|
51
|
+
}
|
|
52
|
+
try {
|
|
53
|
+
return await this.client.post(`${this.basePath}/send_offer_to_interested_buyers`, offerData);
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
throw new Error(`Failed to send offer to interested buyers: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Get offers to buyers (Best Offers)
|
|
61
|
+
* @deprecated This method does not match any endpoint in the OpenAPI spec
|
|
62
|
+
*/
|
|
63
|
+
async getOffersToBuyers(filter, limit, offset) {
|
|
64
|
+
const params = {};
|
|
65
|
+
if (filter)
|
|
66
|
+
params.filter = filter;
|
|
67
|
+
if (limit)
|
|
68
|
+
params.limit = limit;
|
|
69
|
+
if (offset)
|
|
70
|
+
params.offset = offset;
|
|
71
|
+
return await this.client.get(`${this.basePath}/offer`, params);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Get offers for listing (alias for getOffersToBuyers)
|
|
75
|
+
* Endpoint: GET /offer
|
|
76
|
+
* @throws Error if the request fails
|
|
77
|
+
*/
|
|
78
|
+
async getOffersForListing(filter, limit, offset) {
|
|
79
|
+
return this.getOffersToBuyers(filter, limit, offset);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Get a specific offer
|
|
83
|
+
* Endpoint: GET /offer/{offerId}
|
|
84
|
+
* @throws Error if required parameters are missing or invalid
|
|
85
|
+
*/
|
|
86
|
+
async getOffer(offerId) {
|
|
87
|
+
if (!offerId || typeof offerId !== 'string') {
|
|
88
|
+
throw new Error('offerId is required and must be a string');
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
return await this.client.get(`${this.basePath}/offer/${offerId}`);
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
throw new Error(`Failed to get offer: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { EbayApiClient } from '../client.js';
|
|
2
|
+
/**
|
|
3
|
+
* Notification API - Event notifications and subscriptions
|
|
4
|
+
* Based on: docs/sell-apps/communication/commerce_notification_v1_oas3.json
|
|
5
|
+
*/
|
|
6
|
+
export declare class NotificationApi {
|
|
7
|
+
private client;
|
|
8
|
+
private readonly basePath;
|
|
9
|
+
constructor(client: EbayApiClient);
|
|
10
|
+
/**
|
|
11
|
+
* Get public key for validating notifications
|
|
12
|
+
* @throws Error if required parameters are missing or invalid
|
|
13
|
+
*/
|
|
14
|
+
getPublicKey(publicKeyId: string): Promise<unknown>;
|
|
15
|
+
/**
|
|
16
|
+
* Get notification config
|
|
17
|
+
* @throws Error if the request fails
|
|
18
|
+
*/
|
|
19
|
+
getConfig(): Promise<unknown>;
|
|
20
|
+
/**
|
|
21
|
+
* Update notification config
|
|
22
|
+
* @throws Error if required parameters are missing or invalid
|
|
23
|
+
*/
|
|
24
|
+
updateConfig(config: Record<string, unknown>): Promise<unknown>;
|
|
25
|
+
/**
|
|
26
|
+
* Get all destinations (paginated)
|
|
27
|
+
* @throws Error if the request fails
|
|
28
|
+
*/
|
|
29
|
+
getDestinations(limit?: number, continuationToken?: string): Promise<unknown>;
|
|
30
|
+
/**
|
|
31
|
+
* Get destination
|
|
32
|
+
* @throws Error if required parameters are missing or invalid
|
|
33
|
+
*/
|
|
34
|
+
getDestination(destinationId: string): Promise<unknown>;
|
|
35
|
+
/**
|
|
36
|
+
* Create destination
|
|
37
|
+
* @throws Error if required parameters are missing or invalid
|
|
38
|
+
*/
|
|
39
|
+
createDestination(destination: Record<string, unknown>): Promise<unknown>;
|
|
40
|
+
/**
|
|
41
|
+
* Update destination
|
|
42
|
+
* @throws Error if required parameters are missing or invalid
|
|
43
|
+
*/
|
|
44
|
+
updateDestination(destinationId: string, destination: Record<string, unknown>): Promise<unknown>;
|
|
45
|
+
/**
|
|
46
|
+
* Delete destination
|
|
47
|
+
* @throws Error if required parameters are missing or invalid
|
|
48
|
+
*/
|
|
49
|
+
deleteDestination(destinationId: string): Promise<unknown>;
|
|
50
|
+
/**
|
|
51
|
+
* Get all subscriptions
|
|
52
|
+
* Endpoint: GET /subscription
|
|
53
|
+
* @throws Error if the request fails
|
|
54
|
+
*/
|
|
55
|
+
getSubscriptions(limit?: number, continuationToken?: string): Promise<unknown>;
|
|
56
|
+
/**
|
|
57
|
+
* Create a subscription
|
|
58
|
+
* Endpoint: POST /subscription
|
|
59
|
+
* @throws Error if required parameters are missing or invalid
|
|
60
|
+
*/
|
|
61
|
+
createSubscription(subscription: Record<string, unknown>): Promise<unknown>;
|
|
62
|
+
/**
|
|
63
|
+
* Get a subscription
|
|
64
|
+
* Endpoint: GET /subscription/{subscription_id}
|
|
65
|
+
* @throws Error if required parameters are missing or invalid
|
|
66
|
+
*/
|
|
67
|
+
getSubscription(subscriptionId: string): Promise<unknown>;
|
|
68
|
+
/**
|
|
69
|
+
* Update a subscription
|
|
70
|
+
* Endpoint: PUT /subscription/{subscription_id}
|
|
71
|
+
* @throws Error if required parameters are missing or invalid
|
|
72
|
+
*/
|
|
73
|
+
updateSubscription(subscriptionId: string, subscription: Record<string, unknown>): Promise<unknown>;
|
|
74
|
+
/**
|
|
75
|
+
* Delete a subscription
|
|
76
|
+
* Endpoint: DELETE /subscription/{subscription_id}
|
|
77
|
+
* @throws Error if required parameters are missing or invalid
|
|
78
|
+
*/
|
|
79
|
+
deleteSubscription(subscriptionId: string): Promise<unknown>;
|
|
80
|
+
/**
|
|
81
|
+
* Disable a subscription
|
|
82
|
+
* Endpoint: POST /subscription/{subscription_id}/disable
|
|
83
|
+
* @throws Error if required parameters are missing or invalid
|
|
84
|
+
*/
|
|
85
|
+
disableSubscription(subscriptionId: string): Promise<unknown>;
|
|
86
|
+
/**
|
|
87
|
+
* Enable a subscription
|
|
88
|
+
* Endpoint: POST /subscription/{subscription_id}/enable
|
|
89
|
+
* @throws Error if required parameters are missing or invalid
|
|
90
|
+
*/
|
|
91
|
+
enableSubscription(subscriptionId: string): Promise<unknown>;
|
|
92
|
+
/**
|
|
93
|
+
* Test a subscription
|
|
94
|
+
* Endpoint: POST /subscription/{subscription_id}/test
|
|
95
|
+
* @throws Error if required parameters are missing or invalid
|
|
96
|
+
*/
|
|
97
|
+
testSubscription(subscriptionId: string): Promise<unknown>;
|
|
98
|
+
/**
|
|
99
|
+
* Get a topic
|
|
100
|
+
* Endpoint: GET /topic/{topic_id}
|
|
101
|
+
* @throws Error if required parameters are missing or invalid
|
|
102
|
+
*/
|
|
103
|
+
getTopic(topicId: string): Promise<unknown>;
|
|
104
|
+
/**
|
|
105
|
+
* Get all topics
|
|
106
|
+
* Endpoint: GET /topic
|
|
107
|
+
* @throws Error if the request fails
|
|
108
|
+
*/
|
|
109
|
+
getTopics(limit?: number, continuationToken?: string): Promise<unknown>;
|
|
110
|
+
/**
|
|
111
|
+
* Create a subscription filter
|
|
112
|
+
* Endpoint: POST /subscription/{subscription_id}/filter
|
|
113
|
+
* @throws Error if required parameters are missing or invalid
|
|
114
|
+
*/
|
|
115
|
+
createSubscriptionFilter(subscriptionId: string, filter: Record<string, unknown>): Promise<unknown>;
|
|
116
|
+
/**
|
|
117
|
+
* Get a subscription filter
|
|
118
|
+
* Endpoint: GET /subscription/{subscription_id}/filter/{filter_id}
|
|
119
|
+
* @throws Error if required parameters are missing or invalid
|
|
120
|
+
*/
|
|
121
|
+
getSubscriptionFilter(subscriptionId: string, filterId: string): Promise<unknown>;
|
|
122
|
+
/**
|
|
123
|
+
* Delete a subscription filter
|
|
124
|
+
* Endpoint: DELETE /subscription/{subscription_id}/filter/{filter_id}
|
|
125
|
+
* @throws Error if required parameters are missing or invalid
|
|
126
|
+
*/
|
|
127
|
+
deleteSubscriptionFilter(subscriptionId: string, filterId: string): Promise<unknown>;
|
|
128
|
+
}
|