ebay-api 8.5.0 → 8.6.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.
- package/README.md +4 -4
- package/dist/api/apiFactory.d.ts +0 -3
- package/dist/api/apiFactory.js +0 -4
- package/dist/api/base.d.ts +0 -3
- package/dist/api/base.js +0 -3
- package/dist/api/digitalSignature.d.ts +0 -33
- package/dist/api/digitalSignature.js +1 -41
- package/dist/api/index.d.ts +0 -3
- package/dist/api/index.js +0 -3
- package/dist/api/restful/buy/browse/index.d.ts +0 -66
- package/dist/api/restful/buy/browse/index.js +0 -73
- package/dist/api/restful/buy/deal/index.d.ts +0 -32
- package/dist/api/restful/buy/deal/index.js +0 -32
- package/dist/api/restful/buy/feed/index.d.ts +0 -33
- package/dist/api/restful/buy/feed/index.js +0 -33
- package/dist/api/restful/buy/marketing/index.d.ts +0 -18
- package/dist/api/restful/buy/marketing/index.js +0 -22
- package/dist/api/restful/buy/marketplaceInsights/index.d.ts +0 -21
- package/dist/api/restful/buy/marketplaceInsights/index.js +0 -21
- package/dist/api/restful/buy/offer/index.d.ts +0 -15
- package/dist/api/restful/buy/offer/index.js +0 -15
- package/dist/api/restful/buy/order/index.d.ts +0 -227
- package/dist/api/restful/buy/order/index.js +0 -227
- package/dist/api/restful/commerce/catalog/index.d.ts +0 -54
- package/dist/api/restful/commerce/catalog/index.js +0 -54
- package/dist/api/restful/commerce/charity/index.d.ts +0 -21
- package/dist/api/restful/commerce/charity/index.js +0 -21
- package/dist/api/restful/commerce/identity/index.d.ts +0 -7
- package/dist/api/restful/commerce/identity/index.js +0 -7
- package/dist/api/restful/commerce/notification/index.d.ts +0 -93
- package/dist/api/restful/commerce/notification/index.js +0 -93
- package/dist/api/restful/commerce/taxonomy/index.d.ts +0 -64
- package/dist/api/restful/commerce/taxonomy/index.js +0 -64
- package/dist/api/restful/commerce/translation/index.d.ts +0 -8
- package/dist/api/restful/commerce/translation/index.js +0 -8
- package/dist/api/restful/developer/analytics/index.d.ts +0 -15
- package/dist/api/restful/developer/analytics/index.js +0 -15
- package/dist/api/restful/developer/keyManagement/index.d.ts +0 -15
- package/dist/api/restful/developer/keyManagement/index.js +0 -15
- package/dist/api/restful/index.d.ts +0 -16
- package/dist/api/restful/index.js +1 -23
- package/dist/api/restful/postOrder/cancellation/index.d.ts +0 -43
- package/dist/api/restful/postOrder/cancellation/index.js +0 -43
- package/dist/api/restful/postOrder/case/index.d.ts +0 -46
- package/dist/api/restful/postOrder/case/index.js +0 -46
- package/dist/api/restful/postOrder/inquiry/index.d.ts +0 -64
- package/dist/api/restful/postOrder/inquiry/index.js +0 -64
- package/dist/api/restful/postOrder/return/index.d.ts +0 -190
- package/dist/api/restful/postOrder/return/index.js +0 -190
- package/dist/api/restful/sell/account/index.d.ts +0 -241
- package/dist/api/restful/sell/account/index.js +0 -241
- package/dist/api/restful/sell/analytics/index.d.ts +0 -26
- package/dist/api/restful/sell/analytics/index.js +0 -26
- package/dist/api/restful/sell/compliance/index.d.ts +0 -23
- package/dist/api/restful/sell/compliance/index.js +0 -23
- package/dist/api/restful/sell/feed/index.d.ts +0 -135
- package/dist/api/restful/sell/feed/index.js +0 -135
- package/dist/api/restful/sell/finances/index.d.ts +0 -51
- package/dist/api/restful/sell/finances/index.js +0 -51
- package/dist/api/restful/sell/fulfillment/index.d.ts +0 -108
- package/dist/api/restful/sell/fulfillment/index.js +0 -108
- package/dist/api/restful/sell/inventory/index.d.ts +0 -197
- package/dist/api/restful/sell/inventory/index.js +0 -197
- package/dist/api/restful/sell/listing/index.d.ts +0 -8
- package/dist/api/restful/sell/listing/index.js +0 -8
- package/dist/api/restful/sell/logistics/index.d.ts +0 -33
- package/dist/api/restful/sell/logistics/index.js +0 -33
- package/dist/api/restful/sell/marketing/index.d.ts +16 -495
- package/dist/api/restful/sell/marketing/index.js +48 -494
- package/dist/api/restful/sell/metadata/index.d.ts +0 -65
- package/dist/api/restful/sell/metadata/index.js +0 -65
- package/dist/api/restful/sell/negotiation/index.d.ts +0 -14
- package/dist/api/restful/sell/negotiation/index.js +0 -14
- package/dist/api/restful/sell/recommendation/index.d.ts +0 -15
- package/dist/api/restful/sell/recommendation/index.js +0 -15
- package/dist/api/traditional/XMLRequest.d.ts +0 -44
- package/dist/api/traditional/XMLRequest.js +0 -46
- package/dist/api/traditional/clientAlerts/index.js +0 -1
- package/dist/api/traditional/index.d.ts +0 -3
- package/dist/api/traditional/index.js +0 -5
- package/dist/api/traditional/shopping/index.js +0 -1
- package/dist/auth/authNAuth.d.ts +0 -5
- package/dist/auth/authNAuth.js +0 -5
- package/dist/auth/index.d.ts +0 -3
- package/dist/auth/index.js +0 -3
- package/dist/auth/oAuth2.d.ts +0 -52
- package/dist/auth/oAuth2.js +0 -53
- package/dist/eBayApi.d.ts +1 -12
- package/dist/eBayApi.js +0 -14
- package/dist/ebay-api.min.mjs +1 -1
- package/dist/enums/restfulEnums.d.ts +24 -23
- package/dist/enums/restfulEnums.js +52 -51
- package/dist/errors/index.d.ts +0 -19
- package/dist/errors/index.js +1 -20
- package/dist/types/apiTypes.d.ts +2 -2
- package/dist/types/restful/specs/buy_browse_v1_oas3.d.ts +0 -697
- package/dist/types/restful/specs/buy_browse_v1_oas3.js +0 -4
- package/dist/types/restful/specs/buy_deal_v1_oas3.d.ts +0 -189
- package/dist/types/restful/specs/buy_deal_v1_oas3.js +0 -4
- package/dist/types/restful/specs/buy_feed_v1_beta_oas3.d.ts +0 -229
- package/dist/types/restful/specs/buy_feed_v1_beta_oas3.js +0 -4
- package/dist/types/restful/specs/buy_marketing_v1_beta_oas3.d.ts +0 -101
- package/dist/types/restful/specs/buy_marketing_v1_beta_oas3.js +0 -4
- package/dist/types/restful/specs/buy_marketplace_insights_v1_beta_oas3.d.ts +0 -150
- package/dist/types/restful/specs/buy_marketplace_insights_v1_beta_oas3.js +0 -4
- package/dist/types/restful/specs/buy_offer_v1_beta_oas3.d.ts +0 -62
- package/dist/types/restful/specs/buy_offer_v1_beta_oas3.js +0 -4
- package/dist/types/restful/specs/buy_order_v1_beta_oas3.d.ts +0 -600
- package/dist/types/restful/specs/buy_order_v1_beta_oas3.js +0 -4
- package/dist/types/restful/specs/cancellation_oas3.d.ts +0 -29
- package/dist/types/restful/specs/cancellation_oas3.js +0 -4
- package/dist/types/restful/specs/case_oas3.d.ts +0 -31
- package/dist/types/restful/specs/case_oas3.js +0 -4
- package/dist/types/restful/specs/commerce_catalog_v1_beta_oas3.d.ts +0 -331
- package/dist/types/restful/specs/commerce_catalog_v1_beta_oas3.js +0 -4
- package/dist/types/restful/specs/commerce_charity_v1_oas3.d.ts +0 -85
- package/dist/types/restful/specs/commerce_charity_v1_oas3.js +0 -4
- package/dist/types/restful/specs/commerce_identity_v1_oas3.d.ts +0 -63
- package/dist/types/restful/specs/commerce_identity_v1_oas3.js +0 -4
- package/dist/types/restful/specs/commerce_notification_v1_oas3.d.ts +0 -236
- package/dist/types/restful/specs/commerce_notification_v1_oas3.js +0 -4
- package/dist/types/restful/specs/commerce_taxonomy_v1_oas3.d.ts +0 -219
- package/dist/types/restful/specs/commerce_taxonomy_v1_oas3.js +0 -4
- package/dist/types/restful/specs/commerce_translation_v1_beta_oas3.d.ts +0 -36
- package/dist/types/restful/specs/commerce_translation_v1_beta_oas3.js +0 -4
- package/dist/types/restful/specs/developer_analytics_v1_beta_oas3.d.ts +0 -57
- package/dist/types/restful/specs/developer_analytics_v1_beta_oas3.js +0 -4
- package/dist/types/restful/specs/developer_key_management_v1_oas3.d.ts +0 -60
- package/dist/types/restful/specs/developer_key_management_v1_oas3.js +0 -4
- package/dist/types/restful/specs/inquiry_oas3.d.ts +0 -45
- package/dist/types/restful/specs/inquiry_oas3.js +0 -4
- package/dist/types/restful/specs/return_oas3.d.ts +0 -130
- package/dist/types/restful/specs/return_oas3.js +0 -4
- package/dist/types/restful/specs/sell_account_v1_oas3.d.ts +0 -751
- package/dist/types/restful/specs/sell_account_v1_oas3.js +0 -4
- package/dist/types/restful/specs/sell_analytics_v1_oas3.d.ts +0 -130
- package/dist/types/restful/specs/sell_analytics_v1_oas3.js +0 -4
- package/dist/types/restful/specs/sell_compliance_v1_oas3.d.ts +0 -102
- package/dist/types/restful/specs/sell_compliance_v1_oas3.js +0 -4
- package/dist/types/restful/specs/sell_feed_v1_oas3.d.ts +0 -461
- package/dist/types/restful/specs/sell_feed_v1_oas3.js +0 -4
- package/dist/types/restful/specs/sell_finances_v1_oas3.d.ts +0 -255
- package/dist/types/restful/specs/sell_finances_v1_oas3.js +0 -4
- package/dist/types/restful/specs/sell_fulfillment_v1_oas3.d.ts +0 -595
- package/dist/types/restful/specs/sell_fulfillment_v1_oas3.js +0 -4
- package/dist/types/restful/specs/sell_inventory_v1_oas3.d.ts +0 -844
- package/dist/types/restful/specs/sell_inventory_v1_oas3.js +0 -4
- package/dist/types/restful/specs/sell_listing_v1_beta_oas3.d.ts +0 -57
- package/dist/types/restful/specs/sell_listing_v1_beta_oas3.js +0 -4
- package/dist/types/restful/specs/sell_logistics_v1_oas3.d.ts +0 -173
- package/dist/types/restful/specs/sell_logistics_v1_oas3.js +0 -4
- package/dist/types/restful/specs/sell_marketing_v1_oas3.d.ts +454 -1411
- package/dist/types/restful/specs/sell_marketing_v1_oas3.js +0 -4
- package/dist/types/restful/specs/sell_metadata_v1_oas3.d.ts +0 -147
- package/dist/types/restful/specs/sell_metadata_v1_oas3.js +0 -4
- package/dist/types/restful/specs/sell_negotiation_v1_oas3.d.ts +0 -94
- package/dist/types/restful/specs/sell_negotiation_v1_oas3.js +0 -4
- package/dist/types/restful/specs/sell_recommendation_v1_oas3.d.ts +0 -60
- package/dist/types/restful/specs/sell_recommendation_v1_oas3.js +0 -4
- package/dist/types/restfulTypes.d.ts +3 -0
- package/lib/api/apiFactory.d.ts +0 -3
- package/lib/api/apiFactory.js +0 -4
- package/lib/api/base.d.ts +0 -3
- package/lib/api/base.js +0 -3
- package/lib/api/digitalSignature.d.ts +0 -33
- package/lib/api/digitalSignature.js +1 -41
- package/lib/api/index.d.ts +0 -3
- package/lib/api/index.js +0 -3
- package/lib/api/restful/buy/browse/index.d.ts +0 -66
- package/lib/api/restful/buy/browse/index.js +0 -73
- package/lib/api/restful/buy/deal/index.d.ts +0 -32
- package/lib/api/restful/buy/deal/index.js +0 -32
- package/lib/api/restful/buy/feed/index.d.ts +0 -33
- package/lib/api/restful/buy/feed/index.js +0 -33
- package/lib/api/restful/buy/marketing/index.d.ts +0 -18
- package/lib/api/restful/buy/marketing/index.js +0 -22
- package/lib/api/restful/buy/marketplaceInsights/index.d.ts +0 -21
- package/lib/api/restful/buy/marketplaceInsights/index.js +0 -21
- package/lib/api/restful/buy/offer/index.d.ts +0 -15
- package/lib/api/restful/buy/offer/index.js +0 -15
- package/lib/api/restful/buy/order/index.d.ts +0 -227
- package/lib/api/restful/buy/order/index.js +0 -227
- package/lib/api/restful/commerce/catalog/index.d.ts +0 -54
- package/lib/api/restful/commerce/catalog/index.js +0 -54
- package/lib/api/restful/commerce/charity/index.d.ts +0 -21
- package/lib/api/restful/commerce/charity/index.js +0 -21
- package/lib/api/restful/commerce/identity/index.d.ts +0 -7
- package/lib/api/restful/commerce/identity/index.js +0 -7
- package/lib/api/restful/commerce/notification/index.d.ts +0 -93
- package/lib/api/restful/commerce/notification/index.js +0 -93
- package/lib/api/restful/commerce/taxonomy/index.d.ts +0 -64
- package/lib/api/restful/commerce/taxonomy/index.js +0 -64
- package/lib/api/restful/commerce/translation/index.d.ts +0 -8
- package/lib/api/restful/commerce/translation/index.js +0 -8
- package/lib/api/restful/developer/analytics/index.d.ts +0 -15
- package/lib/api/restful/developer/analytics/index.js +0 -15
- package/lib/api/restful/developer/keyManagement/index.d.ts +0 -15
- package/lib/api/restful/developer/keyManagement/index.js +0 -15
- package/lib/api/restful/index.d.ts +0 -16
- package/lib/api/restful/index.js +1 -23
- package/lib/api/restful/postOrder/cancellation/index.d.ts +0 -43
- package/lib/api/restful/postOrder/cancellation/index.js +0 -43
- package/lib/api/restful/postOrder/case/index.d.ts +0 -46
- package/lib/api/restful/postOrder/case/index.js +0 -46
- package/lib/api/restful/postOrder/inquiry/index.d.ts +0 -64
- package/lib/api/restful/postOrder/inquiry/index.js +0 -64
- package/lib/api/restful/postOrder/return/index.d.ts +0 -190
- package/lib/api/restful/postOrder/return/index.js +0 -190
- package/lib/api/restful/sell/account/index.d.ts +0 -241
- package/lib/api/restful/sell/account/index.js +0 -241
- package/lib/api/restful/sell/analytics/index.d.ts +0 -26
- package/lib/api/restful/sell/analytics/index.js +0 -26
- package/lib/api/restful/sell/compliance/index.d.ts +0 -23
- package/lib/api/restful/sell/compliance/index.js +0 -23
- package/lib/api/restful/sell/feed/index.d.ts +0 -135
- package/lib/api/restful/sell/feed/index.js +0 -135
- package/lib/api/restful/sell/finances/index.d.ts +0 -51
- package/lib/api/restful/sell/finances/index.js +0 -51
- package/lib/api/restful/sell/fulfillment/index.d.ts +0 -108
- package/lib/api/restful/sell/fulfillment/index.js +0 -108
- package/lib/api/restful/sell/inventory/index.d.ts +0 -197
- package/lib/api/restful/sell/inventory/index.js +0 -197
- package/lib/api/restful/sell/listing/index.d.ts +0 -8
- package/lib/api/restful/sell/listing/index.js +0 -8
- package/lib/api/restful/sell/logistics/index.d.ts +0 -33
- package/lib/api/restful/sell/logistics/index.js +0 -33
- package/lib/api/restful/sell/marketing/index.d.ts +16 -495
- package/lib/api/restful/sell/marketing/index.js +48 -494
- package/lib/api/restful/sell/metadata/index.d.ts +0 -65
- package/lib/api/restful/sell/metadata/index.js +0 -65
- package/lib/api/restful/sell/negotiation/index.d.ts +0 -14
- package/lib/api/restful/sell/negotiation/index.js +0 -14
- package/lib/api/restful/sell/recommendation/index.d.ts +0 -15
- package/lib/api/restful/sell/recommendation/index.js +0 -15
- package/lib/api/traditional/XMLRequest.d.ts +0 -44
- package/lib/api/traditional/XMLRequest.js +0 -46
- package/lib/api/traditional/clientAlerts/index.js +0 -1
- package/lib/api/traditional/index.d.ts +0 -3
- package/lib/api/traditional/index.js +0 -5
- package/lib/api/traditional/shopping/index.js +0 -1
- package/lib/auth/authNAuth.d.ts +0 -5
- package/lib/auth/authNAuth.js +0 -5
- package/lib/auth/index.d.ts +0 -3
- package/lib/auth/index.js +0 -3
- package/lib/auth/oAuth2.d.ts +0 -52
- package/lib/auth/oAuth2.js +0 -53
- package/lib/eBayApi.d.ts +1 -12
- package/lib/eBayApi.js +0 -14
- package/lib/ebay-api.min.js +1 -1
- package/lib/enums/restfulEnums.d.ts +24 -23
- package/lib/enums/restfulEnums.js +52 -52
- package/lib/errors/index.d.ts +0 -19
- package/lib/errors/index.js +1 -20
- package/lib/types/apiTypes.d.ts +2 -2
- package/lib/types/restful/specs/buy_browse_v1_oas3.d.ts +0 -697
- package/lib/types/restful/specs/buy_browse_v1_oas3.js +0 -4
- package/lib/types/restful/specs/buy_deal_v1_oas3.d.ts +0 -189
- package/lib/types/restful/specs/buy_deal_v1_oas3.js +0 -4
- package/lib/types/restful/specs/buy_feed_v1_beta_oas3.d.ts +0 -229
- package/lib/types/restful/specs/buy_feed_v1_beta_oas3.js +0 -4
- package/lib/types/restful/specs/buy_marketing_v1_beta_oas3.d.ts +0 -101
- package/lib/types/restful/specs/buy_marketing_v1_beta_oas3.js +0 -4
- package/lib/types/restful/specs/buy_marketplace_insights_v1_beta_oas3.d.ts +0 -150
- package/lib/types/restful/specs/buy_marketplace_insights_v1_beta_oas3.js +0 -4
- package/lib/types/restful/specs/buy_offer_v1_beta_oas3.d.ts +0 -62
- package/lib/types/restful/specs/buy_offer_v1_beta_oas3.js +0 -4
- package/lib/types/restful/specs/buy_order_v1_beta_oas3.d.ts +0 -600
- package/lib/types/restful/specs/buy_order_v1_beta_oas3.js +0 -4
- package/lib/types/restful/specs/cancellation_oas3.d.ts +0 -29
- package/lib/types/restful/specs/cancellation_oas3.js +0 -4
- package/lib/types/restful/specs/case_oas3.d.ts +0 -31
- package/lib/types/restful/specs/case_oas3.js +0 -4
- package/lib/types/restful/specs/commerce_catalog_v1_beta_oas3.d.ts +0 -331
- package/lib/types/restful/specs/commerce_catalog_v1_beta_oas3.js +0 -4
- package/lib/types/restful/specs/commerce_charity_v1_oas3.d.ts +0 -85
- package/lib/types/restful/specs/commerce_charity_v1_oas3.js +0 -4
- package/lib/types/restful/specs/commerce_identity_v1_oas3.d.ts +0 -63
- package/lib/types/restful/specs/commerce_identity_v1_oas3.js +0 -4
- package/lib/types/restful/specs/commerce_notification_v1_oas3.d.ts +0 -236
- package/lib/types/restful/specs/commerce_notification_v1_oas3.js +0 -4
- package/lib/types/restful/specs/commerce_taxonomy_v1_oas3.d.ts +0 -219
- package/lib/types/restful/specs/commerce_taxonomy_v1_oas3.js +0 -4
- package/lib/types/restful/specs/commerce_translation_v1_beta_oas3.d.ts +0 -36
- package/lib/types/restful/specs/commerce_translation_v1_beta_oas3.js +0 -4
- package/lib/types/restful/specs/developer_analytics_v1_beta_oas3.d.ts +0 -57
- package/lib/types/restful/specs/developer_analytics_v1_beta_oas3.js +0 -4
- package/lib/types/restful/specs/developer_key_management_v1_oas3.d.ts +0 -60
- package/lib/types/restful/specs/developer_key_management_v1_oas3.js +0 -4
- package/lib/types/restful/specs/inquiry_oas3.d.ts +0 -45
- package/lib/types/restful/specs/inquiry_oas3.js +0 -4
- package/lib/types/restful/specs/return_oas3.d.ts +0 -130
- package/lib/types/restful/specs/return_oas3.js +0 -4
- package/lib/types/restful/specs/sell_account_v1_oas3.d.ts +0 -751
- package/lib/types/restful/specs/sell_account_v1_oas3.js +0 -4
- package/lib/types/restful/specs/sell_analytics_v1_oas3.d.ts +0 -130
- package/lib/types/restful/specs/sell_analytics_v1_oas3.js +0 -4
- package/lib/types/restful/specs/sell_compliance_v1_oas3.d.ts +0 -102
- package/lib/types/restful/specs/sell_compliance_v1_oas3.js +0 -4
- package/lib/types/restful/specs/sell_feed_v1_oas3.d.ts +0 -461
- package/lib/types/restful/specs/sell_feed_v1_oas3.js +0 -4
- package/lib/types/restful/specs/sell_finances_v1_oas3.d.ts +0 -255
- package/lib/types/restful/specs/sell_finances_v1_oas3.js +0 -4
- package/lib/types/restful/specs/sell_fulfillment_v1_oas3.d.ts +0 -595
- package/lib/types/restful/specs/sell_fulfillment_v1_oas3.js +0 -4
- package/lib/types/restful/specs/sell_inventory_v1_oas3.d.ts +0 -844
- package/lib/types/restful/specs/sell_inventory_v1_oas3.js +0 -4
- package/lib/types/restful/specs/sell_listing_v1_beta_oas3.d.ts +0 -57
- package/lib/types/restful/specs/sell_listing_v1_beta_oas3.js +0 -4
- package/lib/types/restful/specs/sell_logistics_v1_oas3.d.ts +0 -173
- package/lib/types/restful/specs/sell_logistics_v1_oas3.js +0 -4
- package/lib/types/restful/specs/sell_marketing_v1_oas3.d.ts +454 -1411
- package/lib/types/restful/specs/sell_marketing_v1_oas3.js +0 -4
- package/lib/types/restful/specs/sell_metadata_v1_oas3.d.ts +0 -147
- package/lib/types/restful/specs/sell_metadata_v1_oas3.js +0 -4
- package/lib/types/restful/specs/sell_negotiation_v1_oas3.d.ts +0 -94
- package/lib/types/restful/specs/sell_negotiation_v1_oas3.js +0 -4
- package/lib/types/restful/specs/sell_recommendation_v1_oas3.d.ts +0 -60
- package/lib/types/restful/specs/sell_recommendation_v1_oas3.js +0 -4
- package/lib/types/restfulTypes.d.ts +3 -0
- package/package.json +2 -2
package/dist/auth/oAuth2.js
CHANGED
|
@@ -2,12 +2,6 @@ import debug from 'debug';
|
|
|
2
2
|
import { createNanoEvents } from '../nanoevents.js';
|
|
3
3
|
import Base from '../api/base.js';
|
|
4
4
|
const log = debug('ebay:oauth2');
|
|
5
|
-
/**
|
|
6
|
-
* https://developer.ebay.com/api-docs/static/oauth-tokens.html
|
|
7
|
-
*
|
|
8
|
-
* Client credentials grant flow mints a new Application access token that you can use to access the resources owned by the application.
|
|
9
|
-
* Authorization code grant flow mints a new User access token that you can use to access the resources owned by the user.
|
|
10
|
-
*/
|
|
11
5
|
class OAuth2 extends Base {
|
|
12
6
|
constructor(config, req) {
|
|
13
7
|
super(config, req);
|
|
@@ -30,10 +24,6 @@ class OAuth2 extends Base {
|
|
|
30
24
|
get identityEndpoint() {
|
|
31
25
|
return this.config.sandbox ? OAuth2.IDENTITY_ENDPOINT.sandbox : OAuth2.IDENTITY_ENDPOINT.production;
|
|
32
26
|
}
|
|
33
|
-
/**
|
|
34
|
-
* Return the access token.
|
|
35
|
-
* First return user access token, if not set Application Access Token.
|
|
36
|
-
*/
|
|
37
27
|
async getAccessToken() {
|
|
38
28
|
return this.getUserAccessToken() || this.getApplicationAccessToken();
|
|
39
29
|
}
|
|
@@ -62,9 +52,6 @@ class OAuth2 extends Base {
|
|
|
62
52
|
getScope() {
|
|
63
53
|
return [...this.scope];
|
|
64
54
|
}
|
|
65
|
-
/**
|
|
66
|
-
* Client credentials grant flow.
|
|
67
|
-
*/
|
|
68
55
|
async mintApplicationAccessToken() {
|
|
69
56
|
if (!this.config.appId) {
|
|
70
57
|
throw new Error('Missing App ID (Client Id)');
|
|
@@ -89,9 +76,6 @@ class OAuth2 extends Base {
|
|
|
89
76
|
throw error;
|
|
90
77
|
}
|
|
91
78
|
}
|
|
92
|
-
/**
|
|
93
|
-
* Client credentials grant flow.
|
|
94
|
-
*/
|
|
95
79
|
async obtainApplicationAccessToken() {
|
|
96
80
|
log('Obtain a new application access token with scope: ', this.scope.join(','));
|
|
97
81
|
try {
|
|
@@ -106,13 +90,6 @@ class OAuth2 extends Base {
|
|
|
106
90
|
throw error;
|
|
107
91
|
}
|
|
108
92
|
}
|
|
109
|
-
/**
|
|
110
|
-
* Generates URL for consent page landing.
|
|
111
|
-
*
|
|
112
|
-
* @param ruName RuName
|
|
113
|
-
* @param scope the scopes
|
|
114
|
-
* @param state state parameter returned in the redirect URL
|
|
115
|
-
*/
|
|
116
93
|
generateAuthUrl(ruName, scope = this.scope, state = '') {
|
|
117
94
|
ruName = ruName || this.config.ruName;
|
|
118
95
|
if (!ruName) {
|
|
@@ -120,14 +97,6 @@ class OAuth2 extends Base {
|
|
|
120
97
|
}
|
|
121
98
|
return OAuth2.generateAuthUrl(this.config.sandbox, this.config.appId, ruName, scope, state);
|
|
122
99
|
}
|
|
123
|
-
/**
|
|
124
|
-
* Authorization code grant flow.
|
|
125
|
-
*
|
|
126
|
-
* Mint the user access token for the given code.
|
|
127
|
-
*
|
|
128
|
-
* @param code the code
|
|
129
|
-
* @param ruName the redirectUri
|
|
130
|
-
*/
|
|
131
100
|
async mintUserAccessToken(code, ruName = this.config.ruName) {
|
|
132
101
|
try {
|
|
133
102
|
const response = await this.req.postForm(this.identityEndpoint, {
|
|
@@ -149,20 +118,9 @@ class OAuth2 extends Base {
|
|
|
149
118
|
throw error;
|
|
150
119
|
}
|
|
151
120
|
}
|
|
152
|
-
/**
|
|
153
|
-
* Authorization code grant flow.
|
|
154
|
-
*
|
|
155
|
-
* Mint the access token for the given code.
|
|
156
|
-
*
|
|
157
|
-
* @param code the code
|
|
158
|
-
* @param ruName the redirectUri
|
|
159
|
-
*/
|
|
160
121
|
async getToken(code, ruName = this.config.ruName) {
|
|
161
122
|
return await this.mintUserAccessToken(code, ruName);
|
|
162
123
|
}
|
|
163
|
-
/**
|
|
164
|
-
* Authorization code grant flow.
|
|
165
|
-
*/
|
|
166
124
|
async refreshUserAccessToken() {
|
|
167
125
|
if (!this._authToken || !this._authToken.refresh_token) {
|
|
168
126
|
log('Tried to refresh user access token before it was set.');
|
|
@@ -194,13 +152,6 @@ class OAuth2 extends Base {
|
|
|
194
152
|
throw error;
|
|
195
153
|
}
|
|
196
154
|
}
|
|
197
|
-
/**
|
|
198
|
-
* Gets and sets the user access token for the given code.
|
|
199
|
-
*
|
|
200
|
-
* Authorization code grant flow.
|
|
201
|
-
*
|
|
202
|
-
* @param code the code
|
|
203
|
-
*/
|
|
204
155
|
async obtainToken(code) {
|
|
205
156
|
const token = await this.getToken(code);
|
|
206
157
|
log('Obtain user access token', token);
|
|
@@ -234,9 +185,6 @@ class OAuth2 extends Base {
|
|
|
234
185
|
this._authToken = authToken;
|
|
235
186
|
}
|
|
236
187
|
}
|
|
237
|
-
/**
|
|
238
|
-
* Refresh the user access token if set or application access token
|
|
239
|
-
*/
|
|
240
188
|
async refreshToken() {
|
|
241
189
|
if (this._authToken) {
|
|
242
190
|
return await this.refreshUserAccessToken();
|
|
@@ -247,7 +195,6 @@ class OAuth2 extends Base {
|
|
|
247
195
|
throw new Error('Missing credentials. To refresh a token an application access token or user access token must be already set.');
|
|
248
196
|
}
|
|
249
197
|
}
|
|
250
|
-
// If all the calls in our application require just an Application access token we can use this endpoint
|
|
251
198
|
OAuth2.IDENTITY_ENDPOINT = {
|
|
252
199
|
production: 'https://api.ebay.com/identity/v1/oauth2/token',
|
|
253
200
|
sandbox: 'https://api.sandbox.ebay.com/identity/v1/oauth2/token'
|
package/dist/eBayApi.d.ts
CHANGED
|
@@ -15,15 +15,8 @@ import { AppConfig, ClientAlerts, Finding, Merchandising, Shopping, Signature, T
|
|
|
15
15
|
export default class eBayApi extends Api {
|
|
16
16
|
static readonly SiteId: typeof enums.SiteId;
|
|
17
17
|
static readonly MarketplaceId: typeof enums.MarketplaceId;
|
|
18
|
-
static readonly ContentLanguage: typeof enums.
|
|
18
|
+
static readonly ContentLanguage: typeof enums.Locale;
|
|
19
19
|
static readonly Locale: typeof enums.Locale;
|
|
20
|
-
/**
|
|
21
|
-
* Loads config from `process.env`
|
|
22
|
-
*
|
|
23
|
-
* @return {eBayApi} a new eBayApi instance
|
|
24
|
-
* @param {request} req request
|
|
25
|
-
* @throws {ApiEnvError}
|
|
26
|
-
*/
|
|
27
20
|
static fromEnv(req?: IEBayApiRequest): eBayApi;
|
|
28
21
|
readonly authNAuth: AuthNAuth;
|
|
29
22
|
readonly oAuth2: OAuth2;
|
|
@@ -39,10 +32,6 @@ export default class eBayApi extends Api {
|
|
|
39
32
|
private _shopping?;
|
|
40
33
|
private _merchandising?;
|
|
41
34
|
private _clientAlerts?;
|
|
42
|
-
/**
|
|
43
|
-
* @param {AppConfig} config the app config
|
|
44
|
-
* @param {IEBayApiRequest} req the request
|
|
45
|
-
*/
|
|
46
35
|
constructor(config: AppConfig, req?: IEBayApiRequest);
|
|
47
36
|
get buy(): Buy;
|
|
48
37
|
get commerce(): Commerce;
|
package/dist/eBayApi.js
CHANGED
|
@@ -13,15 +13,7 @@ const defaultConfig = {
|
|
|
13
13
|
acceptLanguage: Locale.en_US,
|
|
14
14
|
contentLanguage: ContentLanguage.en_US
|
|
15
15
|
};
|
|
16
|
-
// tslint:disable-next-line:class-name
|
|
17
16
|
class eBayApi extends Api {
|
|
18
|
-
/**
|
|
19
|
-
* Loads config from `process.env`
|
|
20
|
-
*
|
|
21
|
-
* @return {eBayApi} a new eBayApi instance
|
|
22
|
-
* @param {request} req request
|
|
23
|
-
* @throws {ApiEnvError}
|
|
24
|
-
*/
|
|
25
17
|
static fromEnv(req) {
|
|
26
18
|
if (!process.env.EBAY_APP_ID) {
|
|
27
19
|
throw new ApiEnvError('EBAY_APP_ID');
|
|
@@ -50,14 +42,9 @@ class eBayApi extends Api {
|
|
|
50
42
|
signature
|
|
51
43
|
}, req);
|
|
52
44
|
}
|
|
53
|
-
/**
|
|
54
|
-
* @param {AppConfig} config the app config
|
|
55
|
-
* @param {IEBayApiRequest} req the request
|
|
56
|
-
*/
|
|
57
45
|
constructor(config, req) {
|
|
58
46
|
super({ ...defaultConfig, ...config }, req);
|
|
59
47
|
this.factory = new ApiFactory(this.config, this.req, this.auth);
|
|
60
|
-
// Shortcuts
|
|
61
48
|
this.authNAuth = this.auth.authNAuth;
|
|
62
49
|
this.OAuth2 = this.auth.OAuth2;
|
|
63
50
|
this.oAuth2 = this.OAuth2;
|
|
@@ -77,7 +64,6 @@ class eBayApi extends Api {
|
|
|
77
64
|
get sell() {
|
|
78
65
|
return this._sell || (this._sell = this.factory.createSellApi());
|
|
79
66
|
}
|
|
80
|
-
// Traditional
|
|
81
67
|
get trading() {
|
|
82
68
|
return this._trading || (this._trading = this.factory.createTradingApi());
|
|
83
69
|
}
|