ebay-mcp 1.13.2 → 1.14.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 (169) hide show
  1. package/README.de.md +3 -3
  2. package/README.es.md +3 -3
  3. package/README.fr.md +3 -3
  4. package/README.ja.md +3 -3
  5. package/README.ko.md +3 -3
  6. package/README.md +163 -41
  7. package/README.pt-BR.md +3 -3
  8. package/README.ru.md +3 -3
  9. package/README.zh-CN.md +3 -3
  10. package/build/api/account-management/account.js +633 -297
  11. package/build/api/analytics-and-report/analytics.js +111 -65
  12. package/build/api/client.js +199 -140
  13. package/build/api/clientRequestError.js +23 -0
  14. package/build/api/clientTrading.js +213 -0
  15. package/build/api/clientTradingError.js +4 -0
  16. package/build/api/communication/feedback.js +147 -59
  17. package/build/api/communication/message.js +134 -81
  18. package/build/api/communication/negotiation.js +65 -53
  19. package/build/api/communication/notification.js +458 -164
  20. package/build/api/developer/developer.js +99 -45
  21. package/build/api/index.js +23 -8
  22. package/build/api/listing-management/inventory.js +884 -338
  23. package/build/api/listing-metadata/metadata.js +416 -170
  24. package/build/api/listing-metadata/taxonomy.js +187 -42
  25. package/build/api/marketing-and-promotions/marketing.js +1392 -598
  26. package/build/api/marketing-and-promotions/recommendation.js +49 -24
  27. package/build/api/order-management/dispute.js +226 -45
  28. package/build/api/order-management/fulfillment.js +144 -71
  29. package/build/api/order-management/orderIssueHelpers.js +61 -0
  30. package/build/api/other/compliance.js +50 -38
  31. package/build/api/other/edelivery.js +603 -159
  32. package/build/api/other/finding.js +280 -0
  33. package/build/api/other/identity.js +30 -15
  34. package/build/api/other/translation.js +29 -14
  35. package/build/api/other/vero.js +113 -27
  36. package/build/api/rateLimitTracker.js +55 -0
  37. package/build/api/shared/request.js +189 -98
  38. package/build/api/trading/trading.js +154 -87
  39. package/build/auth/credentialSession.js +250 -0
  40. package/build/auth/oauth.js +298 -171
  41. package/build/auth/{oauth-metadata.js → oauthMetadata.js} +22 -6
  42. package/build/auth/oauthMiddleware.js +104 -0
  43. package/build/auth/{scope-utils.js → scopeUtils.js} +101 -28
  44. package/build/auth/tokenVerifier.js +243 -0
  45. package/build/auth/tokenVerifierError.js +21 -0
  46. package/build/config/environment.js +148 -113
  47. package/build/config/{tool-families.js → toolFamilies.js} +30 -14
  48. package/build/index.js +25 -19
  49. package/build/mcp/{http-transport.js → httpTransport.js} +102 -52
  50. package/build/mcp/readOnlyFilter.js +67 -0
  51. package/build/mcp/runtime.js +31 -13
  52. package/build/mcp/{tool-gating.js → toolGating.js} +77 -49
  53. package/build/mcp/{ui-bridge.js → uiBridge.js} +80 -23
  54. package/build/schemas/account-management/account.js +144 -6
  55. package/build/schemas/analytics/analytics.js +33 -19
  56. package/build/schemas/communication/messages.js +12 -42
  57. package/build/schemas/developer/developer.js +135 -0
  58. package/build/schemas/fulfillment/orders.js +183 -21
  59. package/build/schemas/index.js +27 -19
  60. package/build/schemas/inventory-management/inventory.js +17 -9
  61. package/build/schemas/marketing/marketing.js +480 -25
  62. package/build/schemas/metadata/metadata.js +11 -6
  63. package/build/schemas/other/finding.js +27 -0
  64. package/build/schemas/other/otherApis.js +424 -0
  65. package/build/schemas/taxonomy/taxonomy.js +11 -5
  66. package/build/scripts/{auto-setup.js → autoSetup.js} +87 -74
  67. package/build/scripts/{build-ui.js → buildUi.js} +6 -1
  68. package/build/scripts/{dev-sync.js → devSync.js} +169 -110
  69. package/build/scripts/diagnostics.js +52 -44
  70. package/build/scripts/{download-specs.js → downloadSpecs.js} +29 -21
  71. package/build/scripts/{interactive-setup.js → interactiveSetup.js} +84 -78
  72. package/build/scripts/setup.js +241 -178
  73. package/build/scripts/{setup-shared.js → setupShared.js} +29 -7
  74. package/build/scripts/skills.js +35 -27
  75. package/build/scripts/updateApiStatusDoc.js +71 -0
  76. package/build/serverHttp.js +90 -0
  77. package/build/skills/content.js +124 -118
  78. package/build/skills/index.js +22 -10
  79. package/build/skills/install.js +21 -10
  80. package/build/skills/markers.js +50 -15
  81. package/build/skills/{registry-snapshot.js → registrySnapshot.js} +8 -2
  82. package/build/skills/render.js +41 -14
  83. package/build/skills/targets.js +49 -17
  84. package/build/tools/categories/account.js +166 -264
  85. package/build/tools/categories/analytics.js +11 -22
  86. package/build/tools/categories/browse.js +17 -0
  87. package/build/tools/categories/communication.js +124 -399
  88. package/build/tools/categories/connector.js +23 -20
  89. package/build/tools/categories/developer.js +46 -159
  90. package/build/tools/categories/fulfillment.js +84 -215
  91. package/build/tools/categories/index.js +6 -14
  92. package/build/tools/categories/inventory.js +238 -293
  93. package/build/tools/categories/marketing.js +677 -39
  94. package/build/tools/categories/metadata.js +190 -117
  95. package/build/tools/categories/other.js +81 -208
  96. package/build/tools/categories/taxonomy.js +29 -20
  97. package/build/tools/categories/{token-management.js → tokenManagement.js} +187 -192
  98. package/build/tools/categories/trading.js +16 -47
  99. package/build/tools/contracts.js +34 -24
  100. package/build/tools/{define-tool.js → defineTool.js} +44 -29
  101. package/build/tools/registry.js +87 -29
  102. package/build/tools/schemas.js +3 -57
  103. package/build/tools/ui/archetypes.js +1 -0
  104. package/build/tools/ui/{map-helpers.js → mapHelpers.js} +69 -19
  105. package/build/tools/ui/maps.js +294 -80
  106. package/build/types/index.js +1 -1
  107. package/build/ui/card.html +14 -14
  108. package/build/ui/chart.html +14 -14
  109. package/build/ui/stat.html +87 -0
  110. package/build/ui/table.html +14 -14
  111. package/build/utils/apiStatusFeed.js +95 -0
  112. package/build/utils/cliOutput.js +15 -0
  113. package/build/utils/cliUi.js +108 -0
  114. package/build/utils/communication/feedback.js +57 -77
  115. package/build/utils/communication/message.js +69 -98
  116. package/build/utils/communication/negotiation.js +30 -57
  117. package/build/utils/communication/notification.js +112 -252
  118. package/build/utils/{date-converter.js → dateConverter.js} +62 -30
  119. package/build/utils/effectSchema.js +203 -0
  120. package/build/utils/effectSchemaAdapter.js +121 -0
  121. package/build/utils/effectSchemaChainMethods.js +146 -0
  122. package/build/utils/effectSchemaRefinements.js +104 -0
  123. package/build/utils/effectSchemaStringMethods.js +63 -0
  124. package/build/utils/effectSchemaTypes.js +47 -0
  125. package/build/utils/{env-parser.js → envParser.js} +10 -2
  126. package/build/utils/errors.js +7 -3
  127. package/build/utils/http.js +148 -89
  128. package/build/utils/{llm-client-detector.js → llmClientDetector.js} +295 -274
  129. package/build/utils/logger.js +127 -51
  130. package/build/utils/{oauth-helper.js → oauthHelper.js} +127 -90
  131. package/build/utils/other/compliance.js +18 -38
  132. package/build/utils/other/identity.js +2 -2
  133. package/build/utils/other/translation.js +4 -4
  134. package/build/utils/other/vero.js +36 -20
  135. package/build/utils/schemaHelpers.js +22 -0
  136. package/build/utils/scopeHelper.js +270 -0
  137. package/build/utils/securityChecker.js +316 -0
  138. package/build/utils/{setup-validator.js → setupValidator.js} +113 -94
  139. package/build/utils/{setup-wizard.js → setupWizard.js} +57 -46
  140. package/build/utils/{token-utils.js → tokenUtils.js} +2 -2
  141. package/build/utils/trading/trading.js +35 -0
  142. package/build/utils/typeGuards.js +12 -0
  143. package/build/utils/version.js +65 -29
  144. package/package.json +10 -8
  145. package/build/api/client-trading.js +0 -124
  146. package/build/api/communication/shared.js +0 -59
  147. package/build/api/shared/query-params.js +0 -16
  148. package/build/auth/credential-session.js +0 -166
  149. package/build/auth/oauth-middleware.js +0 -100
  150. package/build/auth/token-verifier.js +0 -186
  151. package/build/schemas/other/other-apis.js +0 -390
  152. package/build/scripts/update-api-status-doc.js +0 -44
  153. package/build/server-http.js +0 -85
  154. package/build/tools/definitions/marketing.js +0 -1381
  155. package/build/tools/tool-handlers/marketing.js +0 -312
  156. package/build/utils/account-management/account.js +0 -818
  157. package/build/utils/api-status-feed.js +0 -84
  158. package/build/utils/cli-ui.js +0 -47
  159. package/build/utils/order-management/dispute.js +0 -369
  160. package/build/utils/order-management/fulfillment.js +0 -205
  161. package/build/utils/other/edelivery.js +0 -235
  162. package/build/utils/schema-helpers.js +0 -13
  163. package/build/utils/scope-helper.js +0 -207
  164. package/build/utils/security-checker.js +0 -248
  165. package/build/utils/type-guards.js +0 -6
  166. /package/build/auth/{oauth-types.js → oauthTypes.js} +0 -0
  167. /package/build/{server-http.d.ts → serverHttp.d.ts} +0 -0
  168. /package/build/tools/ui/{view-models.js → viewModels.js} +0 -0
  169. /package/build/types/{ebay-enums.js → ebayEnums.js} +0 -0
@@ -1,4 +1,5 @@
1
- import { withApiError } from '../../api/shared/request.js';
1
+ import { buildEndpointParams, requestGetEffect, requestPostEffect, requireObjectEffect, requireStringEffect, } from '../../api/shared/request.js';
2
+ import { Effect } from 'effect';
2
3
  /**
3
4
  * Developer API - Rate limits, client registration, and signing keys
4
5
  * Based on:
@@ -18,65 +19,118 @@ export class DeveloperApi {
18
19
  // RATE LIMITS (Analytics API)
19
20
  // ========================================
20
21
  /**
21
- * Get application rate limits
22
- * Endpoint: GET /rate_limit/
22
+ * Retrieves application rate-limit usage across eBay APIs.
23
+ *
24
+ * @param input - Optional API context and API name filters.
25
+ * @returns An Effect that succeeds with eBay's generated RateLimitsResponse.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * const limits = await Effect.runPromise(
30
+ * developerApi.getRateLimits({ apiContext: 'sell', apiName: 'inventory' }),
31
+ * );
32
+ * ```
33
+ *
34
+ * @see https://developer.ebay.com/api-docs/developer/analytics/resources/rate_limit/methods/getRateLimits
23
35
  */
24
- async getRateLimits(apiContext, apiName) {
25
- const params = {};
26
- if (apiContext)
27
- params.api_context = apiContext;
28
- if (apiName)
29
- params.api_name = apiName;
30
- return await withApiError('Failed to get rate limits', () => this.client.get(`${this.analyticsBasePath}/rate_limit/`, Object.keys(params).length > 0 ? params : undefined));
31
- }
36
+ getRateLimits = (input = {}) => {
37
+ const params = buildEndpointParams({
38
+ apiContext: { wireName: 'api_context', value: input.apiContext },
39
+ apiName: { wireName: 'api_name', value: input.apiName },
40
+ });
41
+ return requestGetEffect(this.client, `${this.analyticsBasePath}/rate_limit/`, params);
42
+ };
32
43
  /**
33
- * Get user rate limits
34
- * Endpoint: GET /user_rate_limit/
44
+ * Retrieves user-specific rate-limit usage across eBay APIs.
45
+ *
46
+ * @param input - Optional API context and API name filters.
47
+ * @returns An Effect that succeeds with eBay's generated RateLimitsResponse.
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * const limits = await Effect.runPromise(developerApi.getUserRateLimits({ apiContext: 'sell' }));
52
+ * ```
53
+ *
54
+ * @see https://developer.ebay.com/api-docs/developer/analytics/resources/user_rate_limit/methods/getUserRateLimits
35
55
  */
36
- async getUserRateLimits(apiContext, apiName) {
37
- const params = {};
38
- if (apiContext)
39
- params.api_context = apiContext;
40
- if (apiName)
41
- params.api_name = apiName;
42
- return await withApiError('Failed to get user rate limits', () => this.client.get(`${this.analyticsBasePath}/user_rate_limit/`, Object.keys(params).length > 0 ? params : undefined));
43
- }
56
+ getUserRateLimits = (input = {}) => {
57
+ const params = buildEndpointParams({
58
+ apiContext: { wireName: 'api_context', value: input.apiContext },
59
+ apiName: { wireName: 'api_name', value: input.apiName },
60
+ });
61
+ return requestGetEffect(this.client, `${this.analyticsBasePath}/user_rate_limit/`, params);
62
+ };
44
63
  // ========================================
45
64
  // CLIENT REGISTRATION
46
65
  // ========================================
47
66
  /**
48
- * Register a new third party financial application with eBay
49
- * Endpoint: POST /client/register
50
- * Note: This is primarily for Open Banking / PSD2 compliance
67
+ * Registers a third-party financial application with eBay.
68
+ *
69
+ * @param input - Generated ClientSettings request body.
70
+ * @returns An Effect that succeeds with eBay's generated ClientDetails response.
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * const client = await Effect.runPromise(
75
+ * developerApi.registerClient({ clientSettings }),
76
+ * );
77
+ * ```
78
+ *
79
+ * @see https://developer.ebay.com/api-docs/developer/client_registration/resources/client/methods/registerClient
51
80
  */
52
- async registerClient(clientSettings) {
53
- return await withApiError('Failed to register client', () => this.client.post(`${this.clientBasePath}/client/register`, clientSettings));
54
- }
81
+ registerClient = (input) => requestPostEffect(this.client, `${this.clientBasePath}/client/register`, input.clientSettings);
55
82
  // ========================================
56
83
  // SIGNING KEY MANAGEMENT
57
84
  // ========================================
58
85
  /**
59
- * Get all signing keys for the application
60
- * Endpoint: GET /signing_key
86
+ * Retrieves all signing keys for the application.
87
+ *
88
+ * @param input - Empty endpoint input object.
89
+ * @returns An Effect that succeeds with eBay's generated QuerySigningKeysResponse.
90
+ *
91
+ * @example
92
+ * ```ts
93
+ * const keys = await Effect.runPromise(developerApi.getSigningKeys({}));
94
+ * ```
95
+ *
96
+ * @see https://developer.ebay.com/api-docs/developer/key_management/resources/signing_key/methods/getSigningKeys
61
97
  */
62
- async getSigningKeys() {
63
- return await withApiError('Failed to get signing keys', () => this.client.get(`${this.keyBasePath}/signing_key`));
64
- }
98
+ getSigningKeys = (input = {}) => {
99
+ void input;
100
+ return requestGetEffect(this.client, `${this.keyBasePath}/signing_key`);
101
+ };
65
102
  /**
66
- * Create a new signing key
67
- * Endpoint: POST /signing_key
103
+ * Creates a signing keypair for API digital signatures.
104
+ *
105
+ * @param input - Optional signing-key cipher request body.
106
+ * @returns An Effect that succeeds with eBay's generated SigningKey response.
107
+ *
108
+ * @example
109
+ * ```ts
110
+ * const key = await Effect.runPromise(
111
+ * developerApi.createSigningKey({ request: { signingKeyCipher: 'RSA' } }),
112
+ * );
113
+ * ```
114
+ *
115
+ * @see https://developer.ebay.com/api-docs/developer/key_management/resources/signing_key/methods/createSigningKey
68
116
  */
69
- async createSigningKey(request) {
70
- return await withApiError('Failed to create signing key', () => this.client.post(`${this.keyBasePath}/signing_key`, request || {}));
71
- }
117
+ createSigningKey = (input = {}) => requestPostEffect(this.client, `${this.keyBasePath}/signing_key`, input.request ?? {});
72
118
  /**
73
- * Get a specific signing key by ID
74
- * Endpoint: GET /signing_key/{signing_key_id}
119
+ * Retrieves a specific signing key by eBay signing key ID.
120
+ *
121
+ * @param input - eBay-generated signing key identifier.
122
+ * @returns An Effect that succeeds with eBay's generated SigningKey response.
123
+ *
124
+ * @example
125
+ * ```ts
126
+ * const key = await Effect.runPromise(developerApi.getSigningKey({ signingKeyId: 'key_001' }));
127
+ * ```
128
+ *
129
+ * @see https://developer.ebay.com/api-docs/developer/key_management/resources/signing_key/methods/getSigningKey
75
130
  */
76
- async getSigningKey(signingKeyId) {
77
- if (!signingKeyId || typeof signingKeyId !== 'string') {
78
- throw new Error('signingKeyId is required and must be a string');
79
- }
80
- return await withApiError('Failed to get signing key', () => this.client.get(`${this.keyBasePath}/signing_key/${signingKeyId}`));
81
- }
131
+ getSigningKey = (input) => Effect.gen(this, function* () {
132
+ const endpointInput = yield* requireObjectEffect(input, 'input');
133
+ const signingKeyId = yield* requireStringEffect(endpointInput.signingKeyId, 'signingKeyId');
134
+ return yield* requestGetEffect(this.client, `${this.keyBasePath}/signing_key/${signingKeyId}`);
135
+ });
82
136
  }
@@ -15,16 +15,18 @@ import { DisputeApi } from '../api/order-management/dispute.js';
15
15
  import { FulfillmentApi } from '../api/order-management/fulfillment.js';
16
16
  import { ComplianceApi } from '../api/other/compliance.js';
17
17
  import { EDeliveryApi } from '../api/other/edelivery.js';
18
+ import { FindingApi } from '../api/other/finding.js';
18
19
  import { IdentityApi } from '../api/other/identity.js';
19
20
  import { TranslationApi } from '../api/other/translation.js';
20
21
  import { VeroApi } from '../api/other/vero.js';
21
- import { TradingApiClient } from '../api/client-trading.js';
22
+ import { TradingApiClient } from '../api/clientTrading.js';
22
23
  import { TradingApi } from '../api/trading/trading.js';
23
24
  /**
24
25
  * Main API facade providing access to all eBay APIs
25
26
  */
26
27
  export class EbaySellerApi {
27
28
  client;
29
+ config;
28
30
  // API categories
29
31
  account;
30
32
  inventory;
@@ -44,9 +46,11 @@ export class EbaySellerApi {
44
46
  vero;
45
47
  translation;
46
48
  edelivery;
49
+ finding;
47
50
  developer;
48
51
  trading;
49
52
  constructor(config) {
53
+ this.config = config;
50
54
  this.client = new EbayApiClient(config);
51
55
  // Initialize API category handlers
52
56
  this.account = new AccountApi(this.client);
@@ -67,6 +71,7 @@ export class EbaySellerApi {
67
71
  this.vero = new VeroApi(this.client);
68
72
  this.translation = new TranslationApi(this.client);
69
73
  this.edelivery = new EDeliveryApi(this.client);
74
+ this.finding = new FindingApi(this.client);
70
75
  this.developer = new DeveloperApi(this.client);
71
76
  const tradingClient = new TradingApiClient(this.client);
72
77
  this.trading = new TradingApi(tradingClient);
@@ -74,9 +79,7 @@ export class EbaySellerApi {
74
79
  /**
75
80
  * Initialize the API (load tokens from storage)
76
81
  */
77
- async initialize() {
78
- await this.client.initialize();
79
- }
82
+ initialize = () => this.client.initialize();
80
83
  /**
81
84
  * Check if the API client is authenticated
82
85
  */
@@ -92,15 +95,26 @@ export class EbaySellerApi {
92
95
  /**
93
96
  * Set user access and refresh tokens
94
97
  */
95
- async setUserTokens(accessToken, refreshToken, accessTokenExpiry, refreshTokenExpiry) {
96
- await this.client.setUserTokens(accessToken, refreshToken, accessTokenExpiry, refreshTokenExpiry);
97
- }
98
+ setUserTokens = (accessToken, refreshToken, accessTokenExpiry, refreshTokenExpiry) => this.client.setUserTokens(accessToken, refreshToken, accessTokenExpiry, refreshTokenExpiry);
98
99
  /**
99
100
  * Get OAuth client for advanced operations
100
101
  */
101
102
  getAuthClient() {
102
103
  return this.client;
103
104
  }
105
+ /**
106
+ * Returns the validated runtime configuration used to construct this API facade.
107
+ *
108
+ * @returns eBay API runtime configuration with credentials, environment, and proxy flags.
109
+ *
110
+ * @example
111
+ * ```ts
112
+ * const environment = api.getConfig().environment;
113
+ * ```
114
+ */
115
+ getConfig() {
116
+ return this.config;
117
+ }
104
118
  /**
105
119
  * Get token information for debugging
106
120
  */
@@ -124,9 +138,10 @@ export * from '../api/order-management/dispute.js';
124
138
  export * from '../api/order-management/fulfillment.js';
125
139
  export * from '../api/other/compliance.js';
126
140
  export * from '../api/other/edelivery.js';
141
+ export * from '../api/other/finding.js';
127
142
  export * from '../api/other/identity.js';
128
143
  export * from '../api/other/translation.js';
129
144
  export * from '../api/other/vero.js';
130
145
  export * from '../api/developer/developer.js';
131
146
  export * from '../api/trading/trading.js';
132
- export * from '../api/client-trading.js';
147
+ export * from '../api/clientTrading.js';