ebay-mcp 1.18.0 → 1.18.2
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/README.md +24 -35
- package/build/api/account-management/accountV2.js +22 -22
- package/build/api/account-management/finances.js +10 -10
- package/build/api/analytics-and-report/analytics.js +1 -1
- package/build/api/{client.js → client/ebayApiClient.js} +37 -41
- package/build/api/{clientTrading.js → client/tradingApiClient.js} +22 -22
- package/build/api/communication/feedback.js +21 -21
- package/build/api/communication/message.js +23 -23
- package/build/api/communication/negotiation.js +7 -7
- package/build/api/communication/notification.js +52 -52
- package/build/api/developer/developer.js +3 -3
- package/build/api/{index.js → ebaySellerApi.js} +4 -4
- package/build/api/listing-management/feedReportTasks.js +6 -6
- package/build/api/listing-management/feedRequest.js +6 -6
- package/build/api/listing-management/feedSchedules.js +4 -4
- package/build/api/listing-management/feedTasks.js +2 -2
- package/build/api/listing-management/items.js +22 -22
- package/build/api/listing-management/locations.js +4 -4
- package/build/api/listing-management/media.js +14 -14
- package/build/api/listing-management/mediaAttach.js +14 -14
- package/build/api/listing-management/mediaResources.js +15 -13
- package/build/api/listing-management/offerFormat.js +1 -1
- package/build/api/listing-management/offers.js +23 -23
- package/build/api/listing-management/stores.js +9 -9
- package/build/api/listing-metadata/metadata.js +10 -10
- package/build/api/marketing-and-promotions/ads.js +34 -34
- package/build/api/marketing-and-promotions/campaigns.js +19 -19
- package/build/api/marketing-and-promotions/promotions.js +22 -22
- package/build/api/marketing-and-promotions/reports.js +7 -7
- package/build/api/order-management/dispute.js +11 -9
- package/build/api/order-management/fulfillment.js +4 -4
- package/build/api/order-management/logistics.js +7 -7
- package/build/api/other/browseMappers.js +15 -13
- package/build/api/other/browseValidators.js +4 -4
- package/build/api/other/edelivery.js +19 -19
- package/build/api/other/finding.js +13 -13
- package/build/api/other/translation.js +2 -2
- package/build/api/other/vero.js +2 -2
- package/build/api/shared/download.js +7 -7
- package/build/api/shared/request.js +28 -19
- package/build/api/trading/listingFormat.js +37 -30
- package/build/api/trading/trading.js +33 -33
- package/build/auth/credentialSession.js +5 -5
- package/build/auth/oauth.js +3 -3
- package/build/auth/oauthHelper.js +24 -24
- package/build/auth/oauthMetadata.js +4 -4
- package/build/auth/oauthMiddleware.js +16 -16
- package/build/auth/scopeUtils.js +2 -2
- package/build/auth/tokenVerifier.js +23 -23
- package/build/config/environment.js +4 -45
- package/build/config/oauthScopes.js +132 -0
- package/build/index.js +5 -5
- package/build/mcp/httpTransport.js +32 -20
- package/build/mcp/runtime.js +12 -12
- package/build/mcp/toolGating.js +6 -12
- package/build/mcp/uiBridge.js +3 -3
- package/build/schemas/account-management/account.js +2 -52
- package/build/schemas/account-management/accountV2.js +2 -2
- package/build/schemas/account-management/finances.js +1 -1
- package/build/schemas/analytics/analytics.js +2 -48
- package/build/schemas/communication/messages.js +2 -46
- package/build/schemas/developer/developer.js +1 -27
- package/build/schemas/fulfillment/logistics.js +1 -1
- package/build/schemas/fulfillment/orders.js +2 -47
- package/build/schemas/inventory-management/feed.js +1 -1
- package/build/schemas/inventory-management/inventory.js +2 -50
- package/build/schemas/inventory-management/media.js +2 -2
- package/build/schemas/inventory-management/mediaDocuments.js +1 -1
- package/build/schemas/inventory-management/stores.js +1 -1
- package/build/schemas/marketing/ads.js +2 -2
- package/build/schemas/marketing/campaigns.js +2 -2
- package/build/schemas/marketing/common.js +2 -2
- package/build/schemas/marketing/marketing.js +0 -1
- package/build/schemas/marketing/promotions.js +2 -2
- package/build/schemas/marketing/reports.js +2 -2
- package/build/schemas/metadata/metadata.js +2 -90
- package/build/schemas/metadata/shipping.js +1 -1
- package/build/schemas/other/browse.js +2 -2
- package/build/schemas/other/finding.js +2 -2
- package/build/schemas/other/otherApis.js +2 -114
- package/build/schemas/taxonomy/categoryTree.js +1 -1
- package/build/schemas/taxonomy/charity.js +1 -1
- package/build/schemas/taxonomy/taxonomy.js +2 -69
- package/build/scripts/autoSetup.js +3 -3
- package/build/scripts/{buildUi.js → buildMcpApps.js} +13 -13
- package/build/scripts/devSync.js +19 -68
- package/build/scripts/diagnostics.js +15 -16
- package/build/scripts/interactiveSetup.js +25 -25
- package/build/scripts/scopeHelper.js +2 -2
- package/build/scripts/securityChecker.js +20 -20
- package/build/scripts/setup.js +76 -76
- package/build/scripts/setupShared.js +5 -30
- package/build/scripts/setupValidator.js +9 -9
- package/build/scripts/setupWizard.js +23 -23
- package/build/scripts/skills.js +14 -17
- package/build/scripts/specRefs.js +1 -1
- package/build/scripts/specSources.js +144 -0
- package/build/serverHttp.js +4 -7
- package/build/skills/content.js +13 -13
- package/build/skills/install.js +9 -9
- package/build/skills/render.js +2 -2
- package/build/tools/categories/communication.js +1 -1
- package/build/tools/categories/connector.js +19 -16
- package/build/tools/categories/fulfillment.js +4 -4
- package/build/tools/categories/inventory.js +1 -1
- package/build/tools/categories/metadata.js +1 -1
- package/build/tools/categories/taxonomy.js +1 -1
- package/build/tools/categories/tokenManagement.js +8 -8
- package/build/tools/contracts.js +2 -2
- package/build/tools/defineTool.js +27 -12
- package/build/tools/registry.js +2 -2
- package/build/tools/schemas.js +2 -2
- package/build/tools/ui/mapHelpers.js +12 -12
- package/build/tools/ui/maps.js +101 -97
- package/build/tools/ui/viewModels.js +2 -2
- package/build/utils/apiStatusFeed.js +12 -12
- package/build/utils/communication/feedback.js +3 -3
- package/build/utils/communication/message.js +3 -3
- package/build/utils/communication/negotiation.js +3 -3
- package/build/utils/communication/notification.js +3 -3
- package/build/utils/entryModule.js +33 -0
- package/build/utils/envFile.js +47 -0
- package/build/utils/envParser.js +5 -5
- package/build/utils/errors.js +4 -4
- package/build/utils/http.js +38 -38
- package/build/utils/localFeedFiles.js +3 -3
- package/build/utils/logRedaction.js +21 -0
- package/build/utils/logger.js +49 -35
- package/build/utils/other/compliance.js +3 -3
- package/build/utils/other/identity.js +3 -3
- package/build/utils/other/translation.js +3 -3
- package/build/utils/other/vero.js +3 -3
- package/build/utils/schemaHelpers.js +2 -2
- package/build/utils/tokenUtils.js +2 -2
- package/build/utils/trading/trading.js +1 -1
- package/build/utils/version.js +1 -1
- package/build/utils/zodIssues.js +14 -0
- package/package.json +8 -11
- package/README.de.md +0 -426
- package/README.es.md +0 -426
- package/README.fr.md +0 -426
- package/README.ja.md +0 -426
- package/README.ko.md +0 -426
- package/README.pt-BR.md +0 -426
- package/README.ru.md +0 -426
- package/README.zh-CN.md +0 -426
- package/build/schemas/index.js +0 -76
- package/build/schemas/marketing/jsonSchemas.js +0 -118
- package/build/scripts/downloadSpecs.js +0 -117
- package/build/scripts/updateApiStatusDoc.js +0 -71
- package/build/utils/effectSchema.js +0 -203
- package/build/utils/effectSchemaAdapter.js +0 -121
- package/build/utils/effectSchemaChainMethods.js +0 -146
- package/build/utils/effectSchemaRefinements.js +0 -104
- package/build/utils/effectSchemaStringMethods.js +0 -63
- package/build/utils/effectSchemaTypes.js +0 -47
- package/docs/auth/production_scopes.json +0 -111
- package/docs/auth/sandbox_scopes.json +0 -142
- /package/build/api/{clientRequestError.js → client/ebayClientRequestError.js} +0 -0
- /package/build/api/{rateLimitTracker.js → client/rateLimitTracker.js} +0 -0
- /package/build/api/{clientTradingError.js → client/tradingApiFailure.js} +0 -0
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { z } from '
|
|
2
|
-
import { zodToJsonSchema } from 'zod-to-json-schema';
|
|
1
|
+
import { z } from 'zod';
|
|
3
2
|
/**
|
|
4
3
|
* Metadata API Schemas
|
|
5
4
|
*
|
|
6
|
-
* This file contains
|
|
5
|
+
* This file contains Zod schemas for all Metadata API endpoints.
|
|
7
6
|
* Schemas are organized by endpoint and include both input and output validation.
|
|
8
7
|
*/
|
|
9
8
|
// ============================================================================
|
|
@@ -747,90 +746,3 @@ export const salesTaxJurisdictionsSchema = z.object({
|
|
|
747
746
|
// ============================================================================
|
|
748
747
|
// JSON Schema Conversion Function
|
|
749
748
|
// ============================================================================
|
|
750
|
-
/**
|
|
751
|
-
* Generates JSON schemas for all Metadata API endpoints.
|
|
752
|
-
*
|
|
753
|
-
* @returns Metadata API JSON schemas keyed by endpoint or shared model name.
|
|
754
|
-
* @example
|
|
755
|
-
* ```ts
|
|
756
|
-
* const schemas = getMetadataJsonSchemas();
|
|
757
|
-
* ```
|
|
758
|
-
*/
|
|
759
|
-
export const getMetadataJsonSchemas = () => {
|
|
760
|
-
return {
|
|
761
|
-
// Marketplace Policies
|
|
762
|
-
automotivePartsCompatibilityPolicy: zodToJsonSchema(automotivePartsCompatibilityPolicySchema, 'automotivePartsCompatibilityPolicy'),
|
|
763
|
-
automotivePartsCompatibilityPolicyResponse: zodToJsonSchema(automotivePartsCompatibilityPolicyResponseSchema, 'automotivePartsCompatibilityPolicyResponse'),
|
|
764
|
-
categoryPolicy: zodToJsonSchema(categoryPolicySchema, 'categoryPolicy'),
|
|
765
|
-
categoryPolicyResponse: zodToJsonSchema(categoryPolicyResponseSchema, 'categoryPolicyResponse'),
|
|
766
|
-
classifiedAdPolicy: zodToJsonSchema(classifiedAdPolicySchema, 'classifiedAdPolicy'),
|
|
767
|
-
classifiedAdPolicyResponse: zodToJsonSchema(classifiedAdPolicyResponseSchema, 'classifiedAdPolicyResponse'),
|
|
768
|
-
currency: zodToJsonSchema(currencySchema, 'currency'),
|
|
769
|
-
getCurrenciesResponse: zodToJsonSchema(getCurrenciesResponseSchema, 'getCurrenciesResponse'),
|
|
770
|
-
extendedProducerResponsibility: zodToJsonSchema(extendedProducerResponsibilitySchema, 'extendedProducerResponsibility'),
|
|
771
|
-
extendedProducerResponsibilityPolicy: zodToJsonSchema(extendedProducerResponsibilityPolicySchema, 'extendedProducerResponsibilityPolicy'),
|
|
772
|
-
extendedProducerResponsibilityPolicyResponse: zodToJsonSchema(extendedProducerResponsibilityPolicyResponseSchema, 'extendedProducerResponsibilityPolicyResponse'),
|
|
773
|
-
signalWord: zodToJsonSchema(signalWordSchema, 'signalWord'),
|
|
774
|
-
hazardStatement: zodToJsonSchema(hazardStatementSchema, 'hazardStatement'),
|
|
775
|
-
pictogram: zodToJsonSchema(pictogramSchema, 'pictogram'),
|
|
776
|
-
hazardousMaterialDetailsResponse: zodToJsonSchema(hazardousMaterialDetailsResponseSchema, 'hazardousMaterialDetailsResponse'),
|
|
777
|
-
itemCondition: zodToJsonSchema(itemConditionSchema, 'itemCondition'),
|
|
778
|
-
itemConditionDescriptor: zodToJsonSchema(itemConditionDescriptorSchema, 'itemConditionDescriptor'),
|
|
779
|
-
itemConditionDescriptorConstraint: zodToJsonSchema(itemConditionDescriptorConstraintSchema, 'itemConditionDescriptorConstraint'),
|
|
780
|
-
itemConditionDescriptorValue: zodToJsonSchema(itemConditionDescriptorValueSchema, 'itemConditionDescriptorValue'),
|
|
781
|
-
itemConditionDescriptorValueConstraint: zodToJsonSchema(itemConditionDescriptorValueConstraintSchema, 'itemConditionDescriptorValueConstraint'),
|
|
782
|
-
itemConditionPolicy: zodToJsonSchema(itemConditionPolicySchema, 'itemConditionPolicy'),
|
|
783
|
-
itemConditionPolicyResponse: zodToJsonSchema(itemConditionPolicyResponseSchema, 'itemConditionPolicyResponse'),
|
|
784
|
-
listingStructurePolicy: zodToJsonSchema(listingStructurePolicySchema, 'listingStructurePolicy'),
|
|
785
|
-
listingStructurePolicyResponse: zodToJsonSchema(listingStructurePolicyResponseSchema, 'listingStructurePolicyResponse'),
|
|
786
|
-
listingDuration: zodToJsonSchema(listingDurationSchema, 'listingDuration'),
|
|
787
|
-
listingTypePolicy: zodToJsonSchema(listingTypePolicySchema, 'listingTypePolicy'),
|
|
788
|
-
listingTypePoliciesResponse: zodToJsonSchema(listingTypePoliciesResponseSchema, 'listingTypePoliciesResponse'),
|
|
789
|
-
localListingDistance: zodToJsonSchema(localListingDistanceSchema, 'localListingDistance'),
|
|
790
|
-
motorsListingPolicy: zodToJsonSchema(motorsListingPolicySchema, 'motorsListingPolicy'),
|
|
791
|
-
motorsListingPoliciesResponse: zodToJsonSchema(motorsListingPoliciesResponseSchema, 'motorsListingPoliciesResponse'),
|
|
792
|
-
negotiatedPricePolicy: zodToJsonSchema(negotiatedPricePolicySchema, 'negotiatedPricePolicy'),
|
|
793
|
-
negotiatedPricePolicyResponse: zodToJsonSchema(negotiatedPricePolicyResponseSchema, 'negotiatedPricePolicyResponse'),
|
|
794
|
-
productSafetyLabelPictogram: zodToJsonSchema(productSafetyLabelPictogramSchema, 'productSafetyLabelPictogram'),
|
|
795
|
-
productSafetyLabelStatement: zodToJsonSchema(productSafetyLabelStatementSchema, 'productSafetyLabelStatement'),
|
|
796
|
-
productSafetyLabelsResponse: zodToJsonSchema(productSafetyLabelsResponseSchema, 'productSafetyLabelsResponse'),
|
|
797
|
-
regulatoryAttribute: zodToJsonSchema(regulatoryAttributeSchema, 'regulatoryAttribute'),
|
|
798
|
-
regulatoryPolicy: zodToJsonSchema(regulatoryPolicySchema, 'regulatoryPolicy'),
|
|
799
|
-
regulatoryPolicyResponse: zodToJsonSchema(regulatoryPolicyResponseSchema, 'regulatoryPolicyResponse'),
|
|
800
|
-
returnPolicyDetails: zodToJsonSchema(returnPolicyDetailsSchema, 'returnPolicyDetails'),
|
|
801
|
-
returnPolicy: zodToJsonSchema(returnPolicyMetadataSchema, 'returnPolicy'),
|
|
802
|
-
returnPolicyResponse: zodToJsonSchema(returnPolicyMetadataResponseSchema, 'returnPolicyResponse'),
|
|
803
|
-
shippingPolicy: zodToJsonSchema(shippingPolicySchema, 'shippingPolicy'),
|
|
804
|
-
shippingPoliciesResponse: zodToJsonSchema(shippingPoliciesResponseSchema, 'shippingPoliciesResponse'),
|
|
805
|
-
siteVisibilityPolicy: zodToJsonSchema(siteVisibilityPolicySchema, 'siteVisibilityPolicy'),
|
|
806
|
-
siteVisibilityPoliciesResponse: zodToJsonSchema(siteVisibilityPoliciesResponseSchema, 'siteVisibilityPoliciesResponse'),
|
|
807
|
-
// Compatibility Schemas
|
|
808
|
-
propertyFilterInner: zodToJsonSchema(propertyFilterInnerSchema, 'propertyFilterInner'),
|
|
809
|
-
compatibilityDetails: zodToJsonSchema(compatibilityDetailsSchema, 'compatibilityDetails'),
|
|
810
|
-
compatibility: zodToJsonSchema(compatibilitySchema, 'compatibility'),
|
|
811
|
-
specificationRequest: zodToJsonSchema(specificationRequestSchema, 'specificationRequest'),
|
|
812
|
-
specificationResponse: zodToJsonSchema(specificationResponseSchema, 'specificationResponse'),
|
|
813
|
-
propertyNamesRequest: zodToJsonSchema(propertyNamesRequestSchema, 'propertyNamesRequest'),
|
|
814
|
-
propertyNamesResponse: zodToJsonSchema(propertyNamesResponseSchema, 'propertyNamesResponse'),
|
|
815
|
-
propertyValuesRequest: zodToJsonSchema(propertyValuesRequestSchema, 'propertyValuesRequest'),
|
|
816
|
-
propertyValuesResponse: zodToJsonSchema(propertyValuesResponseSchema, 'propertyValuesResponse'),
|
|
817
|
-
multiCompatibilityPropertyValuesRequest: zodToJsonSchema(multiCompatibilityPropertyValuesRequestSchema, 'multiCompatibilityPropertyValuesRequest'),
|
|
818
|
-
multiCompatibilityPropertyValuesResponse: zodToJsonSchema(multiCompatibilityPropertyValuesResponseSchema, 'multiCompatibilityPropertyValuesResponse'),
|
|
819
|
-
disabledProductFilter: zodToJsonSchema(disabledProductFilterSchema, 'disabledProductFilter'),
|
|
820
|
-
productIdentifier: zodToJsonSchema(productIdentifierSchema, 'productIdentifier'),
|
|
821
|
-
productRequest: zodToJsonSchema(productRequestSchema, 'productRequest'),
|
|
822
|
-
productResponse: zodToJsonSchema(productResponseSchema, 'productResponse'),
|
|
823
|
-
// Sales Tax Jurisdictions
|
|
824
|
-
salesTaxJurisdiction: zodToJsonSchema(salesTaxJurisdictionSchema, 'salesTaxJurisdiction'),
|
|
825
|
-
salesTaxJurisdictions: zodToJsonSchema(salesTaxJurisdictionsSchema, 'salesTaxJurisdictions'),
|
|
826
|
-
// Common Schemas
|
|
827
|
-
pagination: zodToJsonSchema(paginationSchema, 'pagination'),
|
|
828
|
-
paginationInput: zodToJsonSchema(paginationInputSchema, 'paginationInput'),
|
|
829
|
-
sortOrderInner: zodToJsonSchema(sortOrderInnerSchema, 'sortOrderInner'),
|
|
830
|
-
sortOrderProperties: zodToJsonSchema(sortOrderPropertiesSchema, 'sortOrderProperties'),
|
|
831
|
-
error: zodToJsonSchema(errorSchema, 'error'),
|
|
832
|
-
errorParameter: zodToJsonSchema(errorParameterSchema, 'errorParameter'),
|
|
833
|
-
amount: zodToJsonSchema(amountSchema, 'amount'),
|
|
834
|
-
timeDuration: zodToJsonSchema(timeDurationSchema, 'timeDuration'),
|
|
835
|
-
};
|
|
836
|
-
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MarketplaceId } from '../../types/ebayEnums.js';
|
|
2
|
-
import { z } from '
|
|
2
|
+
import { z } from 'zod';
|
|
3
3
|
/**
|
|
4
4
|
* Input shared by the five Metadata API `shipping:marketplace` methods (carriers, services,
|
|
5
5
|
* locations, excluded locations, and handling times): one path parameter and one header.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { z } from '
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
/**
|
|
3
3
|
* Browse API Schemas
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* Zod input schemas for active-listing marketplace search tools.
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
8
|
* Validates input for ebay_find_active_items (Browse item_summary/search).
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { z } from '
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
/**
|
|
3
3
|
* Finding API Schemas
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* Zod input schemas for sold/completed listing search tools.
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
8
|
* Validates input for ebay_find_completed_items (Finding API findCompletedItems).
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { z } from '
|
|
2
|
-
import { zodToJsonSchema } from 'zod-to-json-schema';
|
|
1
|
+
import { z } from 'zod';
|
|
3
2
|
/**
|
|
4
3
|
* Other eBay APIs Schemas
|
|
5
4
|
*
|
|
6
|
-
* This file contains
|
|
5
|
+
* This file contains Zod schemas for various eBay APIs including:
|
|
7
6
|
* - Commerce Identity API
|
|
8
7
|
* - Sell Compliance API
|
|
9
8
|
* - Commerce Translation API
|
|
@@ -311,114 +310,3 @@ export const getVeroReasonCodesInputSchema = z.object({});
|
|
|
311
310
|
// ============================================================================
|
|
312
311
|
// JSON Schema Conversion Functions
|
|
313
312
|
// ============================================================================
|
|
314
|
-
/**
|
|
315
|
-
* Converts other eBay API Effect-backed schemas to JSON Schema format for MCP tools.
|
|
316
|
-
*
|
|
317
|
-
* @returns Other API JSON schemas keyed by endpoint or shared model name.
|
|
318
|
-
* @example
|
|
319
|
-
* ```ts
|
|
320
|
-
* const schemas = getOtherApisJsonSchemas();
|
|
321
|
-
* ```
|
|
322
|
-
*/
|
|
323
|
-
export const getOtherApisJsonSchemas = () => {
|
|
324
|
-
return {
|
|
325
|
-
// Commerce Identity API
|
|
326
|
-
getUserInput: zodToJsonSchema(getUserInputSchema, 'getUserInput'),
|
|
327
|
-
getUserConsentOutput: zodToJsonSchema(getUserConsentResponseSchema, 'getUserConsentOutput'),
|
|
328
|
-
// Sell Compliance API
|
|
329
|
-
getComplianceSummaryOutput: zodToJsonSchema(complianceSummaryInfoSchema, 'getComplianceSummaryOutput'),
|
|
330
|
-
getListingViolationsInput: zodToJsonSchema(getListingViolationsInputSchema, 'getListingViolationsInput'),
|
|
331
|
-
getListingViolationsOutput: zodToJsonSchema(listingViolationSummaryResponseSchema, 'getListingViolationsOutput'),
|
|
332
|
-
getListingViolationsSummaryInput: zodToJsonSchema(getListingViolationsSummaryInputSchema, 'getListingViolationsSummaryInput'),
|
|
333
|
-
// Commerce Translation API
|
|
334
|
-
translateInput: zodToJsonSchema(translateInputSchema, 'translateInput'),
|
|
335
|
-
translateOutput: zodToJsonSchema(translateResponseSchema, 'translateOutput'),
|
|
336
|
-
// Commerce VERO API
|
|
337
|
-
createVeroReportInput: zodToJsonSchema(createVeroReportInputSchema, 'createVeroReportInput'),
|
|
338
|
-
createVeroReportOutput: zodToJsonSchema(veroReportItemsResponseSchema, 'createVeroReportOutput'),
|
|
339
|
-
getVeroReportInput: zodToJsonSchema(getVeroReportInputSchema, 'getVeroReportInput'),
|
|
340
|
-
getVeroReportOutput: zodToJsonSchema(veroReportStatusResponseSchema, 'getVeroReportOutput'),
|
|
341
|
-
getVeroReportItemsInput: zodToJsonSchema(getVeroReportItemsInputSchema, 'getVeroReportItemsInput'),
|
|
342
|
-
getVeroReportItemsOutput: zodToJsonSchema(veroReportItemsStatusResponseSchema, 'getVeroReportItemsOutput'),
|
|
343
|
-
getVeroReasonCodeInput: zodToJsonSchema(getVeroReasonCodeInputSchema, 'getVeroReasonCodeInput'),
|
|
344
|
-
getVeroReasonCodeOutput: zodToJsonSchema(veroReasonCodeResponseSchema, 'getVeroReasonCodeOutput'),
|
|
345
|
-
getVeroReasonCodesInput: zodToJsonSchema(getVeroReasonCodesInputSchema, 'getVeroReasonCodesInput'),
|
|
346
|
-
getVeroReasonCodesOutput: zodToJsonSchema(veroReasonCodesResponseSchema, 'getVeroReasonCodesOutput'),
|
|
347
|
-
// Sell eDelivery International Shipping API
|
|
348
|
-
getActualCostsInput: zodToJsonSchema(getActualCostsInputSchema, 'getActualCostsInput'),
|
|
349
|
-
getActualCostsOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getActualCostsOutput'),
|
|
350
|
-
getAddressPreferencesInput: zodToJsonSchema(getAddressPreferencesInputSchema, 'getAddressPreferencesInput'),
|
|
351
|
-
getAddressPreferencesOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getAddressPreferencesOutput'),
|
|
352
|
-
createAddressPreferenceInput: zodToJsonSchema(edeliveryBodyInputSchema, 'createAddressPreferenceInput'),
|
|
353
|
-
createAddressPreferenceOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'createAddressPreferenceOutput'),
|
|
354
|
-
getConsignPreferencesOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getConsignPreferencesOutput'),
|
|
355
|
-
getConsignPreferencesInput: zodToJsonSchema(getConsignPreferencesInputSchema, 'getConsignPreferencesInput'),
|
|
356
|
-
createConsignPreferenceInput: zodToJsonSchema(edeliveryBodyInputSchema, 'createConsignPreferenceInput'),
|
|
357
|
-
createConsignPreferenceOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'createConsignPreferenceOutput'),
|
|
358
|
-
getAgentsInput: zodToJsonSchema(edeliveryPaginationInputSchema, 'getAgentsInput'),
|
|
359
|
-
getAgentsOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getAgentsOutput'),
|
|
360
|
-
getBatteryQualificationsInput: zodToJsonSchema(edeliveryPaginationInputSchema, 'getBatteryQualificationsInput'),
|
|
361
|
-
getBatteryQualificationsOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getBatteryQualificationsOutput'),
|
|
362
|
-
getDropoffSitesInput: zodToJsonSchema(edeliveryPaginationInputSchema, 'getDropoffSitesInput'),
|
|
363
|
-
getDropoffSitesOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getDropoffSitesOutput'),
|
|
364
|
-
getServicesInput: zodToJsonSchema(edeliveryPaginationInputSchema, 'getServicesInput'),
|
|
365
|
-
getServicesOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getServicesOutput'),
|
|
366
|
-
createBundleInput: zodToJsonSchema(edeliveryBodyInputSchema, 'createBundleInput'),
|
|
367
|
-
createBundleOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'createBundleOutput'),
|
|
368
|
-
getBundleInput: zodToJsonSchema(bundleIdInputSchema, 'getBundleInput'),
|
|
369
|
-
getBundleOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getBundleOutput'),
|
|
370
|
-
cancelBundleInput: zodToJsonSchema(bundleIdInputSchema, 'cancelBundleInput'),
|
|
371
|
-
cancelBundleOutput: zodToJsonSchema(emptyResponseSchema, 'cancelBundleOutput'),
|
|
372
|
-
getBundleLabelInput: zodToJsonSchema(bundleIdInputSchema, 'getBundleLabelInput'),
|
|
373
|
-
getBundleLabelOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getBundleLabelOutput'),
|
|
374
|
-
createPackageInput: zodToJsonSchema(edeliveryBodyInputSchema, 'createPackageInput'),
|
|
375
|
-
createPackageOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'createPackageOutput'),
|
|
376
|
-
getPackageInput: zodToJsonSchema(packageIdInputSchema, 'getPackageInput'),
|
|
377
|
-
getPackageOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getPackageOutput'),
|
|
378
|
-
deletePackageInput: zodToJsonSchema(packageIdInputSchema, 'deletePackageInput'),
|
|
379
|
-
deletePackageOutput: zodToJsonSchema(emptyResponseSchema, 'deletePackageOutput'),
|
|
380
|
-
getPackagesByLineItemIdInput: zodToJsonSchema(getPackagesByLineItemIdInputSchema, 'getPackagesByLineItemIdInput'),
|
|
381
|
-
getPackagesByLineItemIdOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getPackagesByLineItemIdOutput'),
|
|
382
|
-
cancelPackageInput: zodToJsonSchema(packageIdInputSchema, 'cancelPackageInput'),
|
|
383
|
-
cancelPackageOutput: zodToJsonSchema(emptyResponseSchema, 'cancelPackageOutput'),
|
|
384
|
-
clonePackageInput: zodToJsonSchema(packageIdInputSchema, 'clonePackageInput'),
|
|
385
|
-
clonePackageOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'clonePackageOutput'),
|
|
386
|
-
confirmPackageInput: zodToJsonSchema(packageIdInputSchema, 'confirmPackageInput'),
|
|
387
|
-
confirmPackageOutput: zodToJsonSchema(emptyResponseSchema, 'confirmPackageOutput'),
|
|
388
|
-
bulkCancelPackagesInput: zodToJsonSchema(edeliveryBodyInputSchema, 'bulkCancelPackagesInput'),
|
|
389
|
-
bulkCancelPackagesOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'bulkCancelPackagesOutput'),
|
|
390
|
-
bulkConfirmPackagesInput: zodToJsonSchema(edeliveryBodyInputSchema, 'bulkConfirmPackagesInput'),
|
|
391
|
-
bulkConfirmPackagesOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'bulkConfirmPackagesOutput'),
|
|
392
|
-
bulkDeletePackagesInput: zodToJsonSchema(edeliveryBodyInputSchema, 'bulkDeletePackagesInput'),
|
|
393
|
-
bulkDeletePackagesOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'bulkDeletePackagesOutput'),
|
|
394
|
-
getLabelsInput: zodToJsonSchema(getLabelsInputSchema, 'getLabelsInput'),
|
|
395
|
-
getLabelsOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getLabelsOutput'),
|
|
396
|
-
getHandoverSheetInput: zodToJsonSchema(getHandoverSheetInputSchema, 'getHandoverSheetInput'),
|
|
397
|
-
getHandoverSheetOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getHandoverSheetOutput'),
|
|
398
|
-
getTrackingInput: zodToJsonSchema(getTrackingInputSchema, 'getTrackingInput'),
|
|
399
|
-
getTrackingOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getTrackingOutput'),
|
|
400
|
-
createComplaintInput: zodToJsonSchema(edeliveryBodyInputSchema, 'createComplaintInput'),
|
|
401
|
-
createComplaintOutput: zodToJsonSchema(emptyResponseSchema, 'createComplaintOutput'),
|
|
402
|
-
// Common Types
|
|
403
|
-
error: zodToJsonSchema(errorSchema, 'error'),
|
|
404
|
-
errorParameter: zodToJsonSchema(errorParameterSchema, 'errorParameter'),
|
|
405
|
-
amount: zodToJsonSchema(amountSchema, 'amount'),
|
|
406
|
-
address: zodToJsonSchema(addressSchema, 'address'),
|
|
407
|
-
contact: zodToJsonSchema(contactSchema, 'contact'),
|
|
408
|
-
dimensions: zodToJsonSchema(dimensionsSchema, 'dimensions'),
|
|
409
|
-
weight: zodToJsonSchema(weightSchema, 'weight'),
|
|
410
|
-
pageMetadata: zodToJsonSchema(pageMetadataSchema, 'pageMetadata'),
|
|
411
|
-
// Compliance Types
|
|
412
|
-
complianceViolation: zodToJsonSchema(complianceViolationSchema, 'complianceViolation'),
|
|
413
|
-
complianceDetail: zodToJsonSchema(complianceDetailSchema, 'complianceDetail'),
|
|
414
|
-
correctiveRecommendations: zodToJsonSchema(correctiveRecommendationsSchema, 'correctiveRecommendations'),
|
|
415
|
-
variationDetails: zodToJsonSchema(variationDetailsSchema, 'variationDetails'),
|
|
416
|
-
nameValueList: zodToJsonSchema(nameValueListSchema, 'nameValueList'),
|
|
417
|
-
// Translation Types
|
|
418
|
-
translation: zodToJsonSchema(translationSchema, 'translation'),
|
|
419
|
-
// VERO Types
|
|
420
|
-
reportedItem: zodToJsonSchema(reportedItemSchema, 'reportedItem'),
|
|
421
|
-
reportItemDetails: zodToJsonSchema(reportItemDetailsSchema, 'reportItemDetails'),
|
|
422
|
-
userConsent: zodToJsonSchema(userConsentSchema, 'userConsent'),
|
|
423
|
-
};
|
|
424
|
-
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { z } from '
|
|
2
|
-
import { zodToJsonSchema } from 'zod-to-json-schema';
|
|
1
|
+
import { z } from 'zod';
|
|
3
2
|
/**
|
|
4
3
|
* Taxonomy/Metadata API Schemas
|
|
5
4
|
*
|
|
6
|
-
* This file contains
|
|
5
|
+
* This file contains Zod schemas for the Sell Metadata API (Taxonomy section).
|
|
7
6
|
* Schemas are organized by policy type and include category-related metadata.
|
|
8
7
|
*/
|
|
9
8
|
// ============================================================================
|
|
@@ -513,69 +512,3 @@ const specificationRequestSchema = z.object({
|
|
|
513
512
|
// ============================================================================
|
|
514
513
|
// JSON Schema Conversion Functions
|
|
515
514
|
// ============================================================================
|
|
516
|
-
/**
|
|
517
|
-
* Converts Taxonomy API Effect-backed schemas to JSON Schema format for MCP tools.
|
|
518
|
-
*
|
|
519
|
-
* @returns Taxonomy API JSON schemas keyed by endpoint or shared model name.
|
|
520
|
-
* @example
|
|
521
|
-
* ```ts
|
|
522
|
-
* const schemas = getTaxonomyJsonSchemas();
|
|
523
|
-
* ```
|
|
524
|
-
*/
|
|
525
|
-
export const getTaxonomyJsonSchemas = () => {
|
|
526
|
-
return {
|
|
527
|
-
// Category Policies
|
|
528
|
-
getCategoryPoliciesOutput: zodToJsonSchema(categoryPolicyResponseSchema, 'getCategoryPoliciesOutput'),
|
|
529
|
-
// Item Condition Policies
|
|
530
|
-
getItemConditionPoliciesOutput: zodToJsonSchema(itemConditionPolicyResponseSchema, 'getItemConditionPoliciesOutput'),
|
|
531
|
-
// Return Policies
|
|
532
|
-
getReturnPoliciesOutput: zodToJsonSchema(returnPolicyResponseSchema, 'getReturnPoliciesOutput'),
|
|
533
|
-
// Listing Structure Policies
|
|
534
|
-
getListingStructurePoliciesOutput: zodToJsonSchema(listingStructurePolicyResponseSchema, 'getListingStructurePoliciesOutput'),
|
|
535
|
-
// Listing Type Policies
|
|
536
|
-
getListingTypePoliciesOutput: zodToJsonSchema(listingTypePoliciesResponseSchema, 'getListingTypePoliciesOutput'),
|
|
537
|
-
// Negotiated Price Policies
|
|
538
|
-
getNegotiatedPricePoliciesOutput: zodToJsonSchema(negotiatedPricePolicyResponseSchema, 'getNegotiatedPricePoliciesOutput'),
|
|
539
|
-
// Shipping Policies
|
|
540
|
-
getShippingPoliciesOutput: zodToJsonSchema(shippingPoliciesResponseSchema, 'getShippingPoliciesOutput'),
|
|
541
|
-
// Automotive Parts Compatibility Policies
|
|
542
|
-
getAutomotivePartsCompatibilityPoliciesOutput: zodToJsonSchema(automotivePartsCompatibilityPolicyResponseSchema, 'getAutomotivePartsCompatibilityPoliciesOutput'),
|
|
543
|
-
// Classified Ad Policies
|
|
544
|
-
getClassifiedAdPoliciesOutput: zodToJsonSchema(classifiedAdPolicyResponseSchema, 'getClassifiedAdPoliciesOutput'),
|
|
545
|
-
// Motors Listing Policies
|
|
546
|
-
getMotorsListingPoliciesOutput: zodToJsonSchema(motorsListingPoliciesResponseSchema, 'getMotorsListingPoliciesOutput'),
|
|
547
|
-
// Currencies
|
|
548
|
-
getCurrenciesOutput: zodToJsonSchema(getCurrenciesResponseSchema, 'getCurrenciesOutput'),
|
|
549
|
-
// Extended Producer Responsibility
|
|
550
|
-
getExtendedProducerResponsibilityPoliciesOutput: zodToJsonSchema(extendedProducerResponsibilityPolicyResponseSchema, 'getExtendedProducerResponsibilityPoliciesOutput'),
|
|
551
|
-
// Hazardous Materials Labels
|
|
552
|
-
getHazardousMaterialsLabelsOutput: zodToJsonSchema(hazardousMaterialDetailsResponseSchema, 'getHazardousMaterialsLabelsOutput'),
|
|
553
|
-
// Product Safety Labels
|
|
554
|
-
getProductSafetyLabelsOutput: zodToJsonSchema(productSafetyLabelsResponseSchema, 'getProductSafetyLabelsOutput'),
|
|
555
|
-
// Regulatory Policies
|
|
556
|
-
getRegulatoryPoliciesOutput: zodToJsonSchema(regulatoryPolicyResponseSchema, 'getRegulatoryPoliciesOutput'),
|
|
557
|
-
// Site Visibility Policies
|
|
558
|
-
getSiteVisibilityPoliciesOutput: zodToJsonSchema(siteVisibilityPoliciesResponseSchema, 'getSiteVisibilityPoliciesOutput'),
|
|
559
|
-
// Compatibility Methods
|
|
560
|
-
getCompatibilityPropertyNamesInput: zodToJsonSchema(propertyNamesRequestSchema, 'getCompatibilityPropertyNamesInput'),
|
|
561
|
-
getCompatibilityPropertyNamesOutput: zodToJsonSchema(propertyNamesResponseSchema, 'getCompatibilityPropertyNamesOutput'),
|
|
562
|
-
getCompatibilityPropertyValuesInput: zodToJsonSchema(propertyValuesRequestSchema, 'getCompatibilityPropertyValuesInput'),
|
|
563
|
-
getCompatibilityPropertyValuesOutput: zodToJsonSchema(propertyValuesResponseSchema, 'getCompatibilityPropertyValuesOutput'),
|
|
564
|
-
getMultiCompatibilityPropertyValuesInput: zodToJsonSchema(multiCompatibilityPropertyValuesRequestSchema, 'getMultiCompatibilityPropertyValuesInput'),
|
|
565
|
-
getMultiCompatibilityPropertyValuesOutput: zodToJsonSchema(multiCompatibilityPropertyValuesResponseSchema, 'getMultiCompatibilityPropertyValuesOutput'),
|
|
566
|
-
getProductCompatibilitiesInput: zodToJsonSchema(productRequestSchema, 'getProductCompatibilitiesInput'),
|
|
567
|
-
getProductCompatibilitiesOutput: zodToJsonSchema(productResponseSchema, 'getProductCompatibilitiesOutput'),
|
|
568
|
-
getCompatibilitiesBySpecificationInput: zodToJsonSchema(specificationRequestSchema, 'getCompatibilitiesBySpecificationInput'),
|
|
569
|
-
getCompatibilitiesBySpecificationOutput: zodToJsonSchema(specificationResponseSchema, 'getCompatibilitiesBySpecificationOutput'),
|
|
570
|
-
// Common Types
|
|
571
|
-
amount: zodToJsonSchema(amountSchema, 'amount'),
|
|
572
|
-
error: zodToJsonSchema(errorSchema, 'error'),
|
|
573
|
-
errorParameter: zodToJsonSchema(errorParameterSchema, 'errorParameter'),
|
|
574
|
-
timeDuration: zodToJsonSchema(timeDurationSchema, 'timeDuration'),
|
|
575
|
-
pagination: zodToJsonSchema(paginationSchema, 'pagination'),
|
|
576
|
-
compatibility: zodToJsonSchema(compatibilitySchema, 'compatibility'),
|
|
577
|
-
compatibilityDetails: zodToJsonSchema(compatibilityDetailsSchema, 'compatibilityDetails'),
|
|
578
|
-
propertyFilterInner: zodToJsonSchema(propertyFilterInnerSchema, 'propertyFilterInner'),
|
|
579
|
-
productIdentifier: zodToJsonSchema(productIdentifierSchema, 'productIdentifier'),
|
|
580
|
-
};
|
|
581
|
-
};
|
|
@@ -340,7 +340,7 @@ function main() {
|
|
|
340
340
|
// Step 2: Detect MCP clients
|
|
341
341
|
print('\nStep 2/4: Detecting installed MCP clients...');
|
|
342
342
|
const clients = detectMCPClients();
|
|
343
|
-
const detectedClients = clients.filter((
|
|
343
|
+
const detectedClients = clients.filter((client) => client.detected);
|
|
344
344
|
if (detectedClients.length === 0) {
|
|
345
345
|
printWarning('No MCP clients detected on this system');
|
|
346
346
|
printInfo('Supported clients: Claude Desktop, Cline, Continue.dev, Zed, Cursor, Windsurf, Roo Code, Claude Code CLI, Amazon Q');
|
|
@@ -372,14 +372,14 @@ function main() {
|
|
|
372
372
|
validateTokens();
|
|
373
373
|
// Final summary
|
|
374
374
|
printHeader('Setup Complete! 🎉');
|
|
375
|
-
const generatedCount = detectedClients.filter((
|
|
375
|
+
const generatedCount = detectedClients.filter((client) => client.configGenerated).length;
|
|
376
376
|
if (generatedCount > 0) {
|
|
377
377
|
printSuccess(`Successfully configured ${generatedCount} MCP client(s)`);
|
|
378
378
|
print('\n📝 Next Steps:', 'cyan');
|
|
379
379
|
print(' 1. Restart your MCP clients (Claude Desktop, Cursor, Zed, etc.)');
|
|
380
380
|
print(' 2. Verify connection in MCP client settings/logs');
|
|
381
381
|
print(' 3. Test with: "List my eBay inventory items"');
|
|
382
|
-
if (validation.warnings.some((
|
|
382
|
+
if (validation.warnings.some((warning) => warning.includes('EBAY_REDIRECT_URI'))) {
|
|
383
383
|
print('\n💡 Pro Tip:', 'yellow');
|
|
384
384
|
print(' Add EBAY_REDIRECT_URI to .env for user OAuth (10k-50k req/day rate limits)');
|
|
385
385
|
}
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Builds the
|
|
3
|
-
* under `build/ui/`.
|
|
2
|
+
* Builds the interactive MCP Apps views in `mcp-apps/` into self-contained HTML
|
|
3
|
+
* files under `build/ui/`.
|
|
4
4
|
*
|
|
5
5
|
* Why a script rather than a single `vite.config.ts`: `vite-plugin-singlefile`
|
|
6
6
|
* inlines all dynamic imports, which Rollup only permits with a single input.
|
|
7
|
-
* The
|
|
7
|
+
* The archetypes are therefore built one at a time (each its own
|
|
8
8
|
* single-page build) into a shared output directory — the first pass clears it,
|
|
9
9
|
* the rest append. The result is exactly what `src/mcp/uiBridge.ts` expects:
|
|
10
|
-
* `build/ui/{table,card,chart}.html`, each with its JS and CSS inlined so the
|
|
10
|
+
* `build/ui/{table,card,chart,stat}.html`, each with its JS and CSS inlined so the
|
|
11
11
|
* server can serve it verbatim as a `ui://` resource with no sibling requests.
|
|
12
12
|
*
|
|
13
|
-
* Run via `
|
|
13
|
+
* Run via `pnpm build:mcp-apps` (also chained into `pnpm build`).
|
|
14
14
|
*/
|
|
15
|
-
import
|
|
15
|
+
import path from 'node:path';
|
|
16
16
|
import { fileURLToPath } from 'node:url';
|
|
17
17
|
import { build } from 'vite';
|
|
18
18
|
import { viteSingleFile } from 'vite-plugin-singlefile';
|
|
19
19
|
import { uiArchetypes } from '../tools/ui/archetypes.js';
|
|
20
20
|
import { serverLogger } from '../utils/logger.js';
|
|
21
|
-
const scriptsDir = dirname(fileURLToPath(import.meta.url));
|
|
22
|
-
const repoRoot = resolve(scriptsDir, '../..');
|
|
23
|
-
const
|
|
24
|
-
const outDir = resolve(repoRoot, 'build', 'ui');
|
|
21
|
+
const scriptsDir = path.dirname(fileURLToPath(import.meta.url));
|
|
22
|
+
const repoRoot = path.resolve(scriptsDir, '../..');
|
|
23
|
+
const mcpAppsDir = path.resolve(repoRoot, 'mcp-apps');
|
|
24
|
+
const outDir = path.resolve(repoRoot, 'build', 'ui');
|
|
25
25
|
/** Vite config for a single archetype's single-page, fully-inlined build. */
|
|
26
26
|
function configFor(archetype, clean) {
|
|
27
27
|
return {
|
|
28
|
-
root:
|
|
28
|
+
root: mcpAppsDir,
|
|
29
29
|
configFile: false,
|
|
30
30
|
logLevel: 'warn',
|
|
31
31
|
plugins: [viteSingleFile()],
|
|
32
32
|
esbuild: { jsx: 'automatic', jsxImportSource: 'react' },
|
|
33
33
|
resolve: {
|
|
34
34
|
alias: {
|
|
35
|
-
'@': resolve(repoRoot, 'src'),
|
|
35
|
+
'@': path.resolve(repoRoot, 'src'),
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
38
|
build: {
|
|
39
39
|
outDir,
|
|
40
40
|
emptyOutDir: clean,
|
|
41
|
-
rollupOptions: { input: resolve(
|
|
41
|
+
rollupOptions: { input: path.resolve(mcpAppsDir, uiArchetypes[archetype].htmlFile) },
|
|
42
42
|
},
|
|
43
43
|
};
|
|
44
44
|
}
|
package/build/scripts/devSync.js
CHANGED
|
@@ -9,10 +9,12 @@ import { getErrorMessage } from '../utils/errors.js';
|
|
|
9
9
|
import { httpRequest } from '../utils/http.js';
|
|
10
10
|
import process from 'node:process';
|
|
11
11
|
import { replaceDanglingSchemaRefs } from './specRefs.js';
|
|
12
|
+
import { specSources } from './specSources.js';
|
|
12
13
|
const __filename = fileURLToPath(import.meta.url);
|
|
13
14
|
const __dirname = dirname(__filename);
|
|
14
15
|
const PROJECT_ROOT = join(__dirname, '../..');
|
|
15
|
-
|
|
16
|
+
/** Local, git-ignored cache of downloaded eBay OpenAPI specs. */
|
|
17
|
+
const SPECS_DIR = join(PROJECT_ROOT, '.cache/ebay-specs');
|
|
16
18
|
const TYPES_DIR = join(PROJECT_ROOT, 'src/types');
|
|
17
19
|
const TOOLS_DIRS = [join(PROJECT_ROOT, 'src/tools/categories')];
|
|
18
20
|
/** Repo-specific OpenAPI namespace aliases preserved after type regeneration. */
|
|
@@ -101,85 +103,34 @@ function showSpinner(message) {
|
|
|
101
103
|
process.stdout.write('\r' + ' '.repeat(message.length + 10) + '\r');
|
|
102
104
|
};
|
|
103
105
|
}
|
|
104
|
-
const SPEC_FOLDER_MAP = {
|
|
105
|
-
'developer_analytics_v1_beta_oas3.json': 'application-settings',
|
|
106
|
-
'developer_key_management_v1_oas3.json': 'application-settings',
|
|
107
|
-
'developer_client_registration_v1_oas3.json': 'application-settings',
|
|
108
|
-
'sell_inventory_v1_oas3.json': 'sell-apps/listing-management',
|
|
109
|
-
'sell_feed_v1_oas3.json': 'sell-apps/listing-management',
|
|
110
|
-
'commerce_media_v1_beta_oas3.json': 'sell-apps/listing-management',
|
|
111
|
-
'sell_stores_v1_oas3.json': 'sell-apps/listing-management',
|
|
112
|
-
'sell_metadata_v1_oas3.json': 'sell-apps/listing-metadata',
|
|
113
|
-
'commerce_taxonomy_v1_oas3.json': 'sell-apps/listing-metadata',
|
|
114
|
-
'commerce_charity_v1_oas3.json': 'sell-apps/listing-metadata',
|
|
115
|
-
'sell_account_v1_oas3.json': 'sell-apps/account-management',
|
|
116
|
-
'sell_account_v2_oas3.json': 'sell-apps/account-management',
|
|
117
|
-
'sell_finances_v1_oas3.json': 'sell-apps/account-management',
|
|
118
|
-
'commerce_message_v1_oas3.json': 'sell-apps/communication',
|
|
119
|
-
'commerce_notification_v1_oas3.json': 'sell-apps/communication',
|
|
120
|
-
'sell_negotiation_v1_oas3.json': 'sell-apps/communication',
|
|
121
|
-
'commerce_feedback_v1_beta_oas3.json': 'sell-apps/communication',
|
|
122
|
-
'sell_fulfillment_v1_oas3.json': 'sell-apps/order-management',
|
|
123
|
-
'sell_logistics_v1_oas3.json': 'sell-apps/order-management',
|
|
124
|
-
'sell_marketing_v1_oas3.json': 'sell-apps/marketing-and-promotions',
|
|
125
|
-
'sell_recommendation_v1_oas3.json': 'sell-apps/marketing-and-promotions',
|
|
126
|
-
'sell_analytics_v1_oas3.json': 'sell-apps/analytics-and-report',
|
|
127
|
-
'commerce_translation_v1_beta_oas3.json': 'sell-apps/other-apis',
|
|
128
|
-
'sell_compliance_v1_oas3.json': 'sell-apps/other-apis',
|
|
129
|
-
'commerce_identity_v1_oas3.json': 'sell-apps/other-apis',
|
|
130
|
-
'sell_edelivery_international_shipping_oas3.json': 'sell-apps/other-apis',
|
|
131
|
-
'commerce_vero_v1_oas3.json': 'sell-apps/other-apis',
|
|
132
|
-
'buy_browse_v1_oas3.json': 'buy-apps/inventory-discovery',
|
|
133
|
-
'buy_feed_v1_beta_oas3.json': 'buy-apps/inventory-discovery',
|
|
134
|
-
'buy_feed_v1_oas3.json': 'buy-apps/inventory-discovery',
|
|
135
|
-
'buy_deal_v1_oas3.json': 'buy-apps/marketing-and-discounts',
|
|
136
|
-
'buy_marketing_v1_beta_oas3.json': 'buy-apps/marketing-and-discounts',
|
|
137
|
-
'commerce_catalog_v1_beta_oas3.json': 'buy-apps/marketplace-metadata',
|
|
138
|
-
'buy_order_v2_oas3.json': 'buy-apps/checkout-and-bidding',
|
|
139
|
-
'buy_offer_v1_beta_oas3.json': 'buy-apps/checkout-and-bidding',
|
|
140
|
-
};
|
|
141
106
|
async function downloadSpecs() {
|
|
142
107
|
console.log(ui.bold('\n📥 Downloading OpenAPI Specifications\n'));
|
|
143
|
-
|
|
144
|
-
if (!existsSync(readmePath)) {
|
|
145
|
-
console.log(ui.warning(` ⚠ README not found at ${readmePath}`));
|
|
146
|
-
console.log(ui.dim(' Create docs/sell-apps/README.md with spec URLs'));
|
|
147
|
-
return 0;
|
|
148
|
-
}
|
|
149
|
-
const readmeContent = readFileSync(readmePath, 'utf-8');
|
|
150
|
-
const urlRegex = /(https:\/\/[^\s)]+\.json)/g;
|
|
151
|
-
const urls = Array.from(readmeContent.matchAll(urlRegex)).map((m) => m[1]);
|
|
152
|
-
if (urls.length === 0) {
|
|
153
|
-
console.log(ui.warning(' ⚠ No spec URLs found in README'));
|
|
154
|
-
return 0;
|
|
155
|
-
}
|
|
156
|
-
console.log(ui.dim(` Found ${urls.length} spec URLs\n`));
|
|
108
|
+
console.log(ui.dim(` Found ${specSources.length} spec URLs\n`));
|
|
157
109
|
let downloaded = 0;
|
|
158
110
|
let failed = 0;
|
|
159
|
-
for (const url of
|
|
111
|
+
for (const { api, folder, url } of specSources) {
|
|
160
112
|
const fileName = basename(url);
|
|
161
|
-
const
|
|
162
|
-
const folderPath = join(DOCS_DIR, folderName);
|
|
113
|
+
const folderPath = join(SPECS_DIR, folder);
|
|
163
114
|
const filePath = join(folderPath, fileName);
|
|
164
|
-
const stopSpinner = showSpinner(`Downloading ${fileName}...`);
|
|
115
|
+
const stopSpinner = showSpinner(`Downloading ${api} (${fileName})...`);
|
|
165
116
|
const downloadedSpec = await Effect.runPromise(Effect.either(Effect.tryPromise({
|
|
166
117
|
try: async () => {
|
|
167
118
|
mkdirSync(folderPath, { recursive: true });
|
|
168
|
-
const
|
|
119
|
+
const specResponse = await httpRequest({
|
|
169
120
|
url,
|
|
170
121
|
responseType: 'arraybuffer',
|
|
171
122
|
timeoutMs: 20_000,
|
|
172
123
|
});
|
|
173
|
-
writeFileSync(filePath,
|
|
124
|
+
writeFileSync(filePath, specResponse.data);
|
|
174
125
|
},
|
|
175
126
|
catch: (error) => error,
|
|
176
127
|
}).pipe(Effect.ensuring(Effect.sync(stopSpinner)))));
|
|
177
128
|
if (Either.isLeft(downloadedSpec)) {
|
|
178
|
-
console.log(` ${ui.error('✗')} ${fileName}: ${getErrorMessage(downloadedSpec.left)}`);
|
|
129
|
+
console.log(` ${ui.error('✗')} ${api} (${fileName}): ${getErrorMessage(downloadedSpec.left)}`);
|
|
179
130
|
failed++;
|
|
180
131
|
}
|
|
181
132
|
else {
|
|
182
|
-
console.log(` ${ui.success('✓')} ${fileName}`);
|
|
133
|
+
console.log(` ${ui.success('✓')} ${api} (${fileName})`);
|
|
183
134
|
downloaded++;
|
|
184
135
|
}
|
|
185
136
|
}
|
|
@@ -215,7 +166,7 @@ function generateTypes() {
|
|
|
215
166
|
skipped++;
|
|
216
167
|
continue;
|
|
217
168
|
}
|
|
218
|
-
const relativePath = fullPath.replace(
|
|
169
|
+
const relativePath = fullPath.replace(SPECS_DIR + '/', '');
|
|
219
170
|
const outputDir = join(TYPES_DIR, dirname(relativePath));
|
|
220
171
|
mkdirSync(outputDir, { recursive: true });
|
|
221
172
|
const baseFileName = basename(entry.name, '.json');
|
|
@@ -258,7 +209,7 @@ function generateTypes() {
|
|
|
258
209
|
}
|
|
259
210
|
}
|
|
260
211
|
}
|
|
261
|
-
processDirectory(
|
|
212
|
+
processDirectory(SPECS_DIR);
|
|
262
213
|
console.log(ui.dim(`\n Generated: ${generated}, Skipped: ${skipped}`));
|
|
263
214
|
return generated;
|
|
264
215
|
}
|
|
@@ -299,7 +250,7 @@ function extractEndpointsFromSpecs() {
|
|
|
299
250
|
}
|
|
300
251
|
}
|
|
301
252
|
}
|
|
302
|
-
processDirectory(
|
|
253
|
+
processDirectory(SPECS_DIR);
|
|
303
254
|
return endpoints;
|
|
304
255
|
}
|
|
305
256
|
function collectToolNames(dir, tools) {
|
|
@@ -481,7 +432,7 @@ function analyzeEndpoints() {
|
|
|
481
432
|
const implementedTools = getImplementedTools();
|
|
482
433
|
const implementedApiMethods = getImplementedApiMethods();
|
|
483
434
|
// Normalize all tool names
|
|
484
|
-
const normalizedTools = new Set(Array.from(implementedTools).map((
|
|
435
|
+
const normalizedTools = new Set(Array.from(implementedTools).map((toolName) => normalizeForMatching(toolName)));
|
|
485
436
|
// Combine tools and API methods for matching
|
|
486
437
|
const allImplemented = new Set([...normalizedTools, ...implementedApiMethods]);
|
|
487
438
|
// Track unique endpoints (dedupe by operationId)
|
|
@@ -596,7 +547,7 @@ ${ui.bold('What this does:')}
|
|
|
596
547
|
if (!(reportOnly || skipDownload)) {
|
|
597
548
|
report.specsDownloaded = await downloadSpecs();
|
|
598
549
|
}
|
|
599
|
-
// If the download step ran but fetched nothing (
|
|
550
|
+
// If the download step ran but fetched nothing (for example, blocked
|
|
600
551
|
// requests), the coverage numbers below describe the cached specs on disk —
|
|
601
552
|
// not eBay's current API. Flag it loudly so a stale run is never mistaken for
|
|
602
553
|
// a clean "100% coverage, 0 missing" result.
|
|
@@ -623,9 +574,9 @@ ${ui.bold('What this does:')}
|
|
|
623
574
|
void Effect.runPromise(Effect.either(Effect.tryPromise({
|
|
624
575
|
try: () => main(),
|
|
625
576
|
catch: (error) => error,
|
|
626
|
-
}))).then((
|
|
627
|
-
if (Either.isLeft(
|
|
628
|
-
console.error(ui.error('\n Sync failed:'), getErrorMessage(
|
|
577
|
+
}))).then((syncOutcome) => {
|
|
578
|
+
if (Either.isLeft(syncOutcome)) {
|
|
579
|
+
console.error(ui.error('\n Sync failed:'), getErrorMessage(syncOutcome.left));
|
|
629
580
|
process.exitCode = 1;
|
|
630
581
|
}
|
|
631
582
|
});
|