From ec9dc3b5e60c49bf22e0d22360b05f592bb5253e Mon Sep 17 00:00:00 2001 From: EJ Mercado Date: Mon, 22 Jun 2020 20:40:28 +0800 Subject: [PATCH] feat: add get-service-status example --- examples/get-service-status.ts | 44 ++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 examples/get-service-status.ts diff --git a/examples/get-service-status.ts b/examples/get-service-status.ts new file mode 100644 index 00000000..1a3e9358 --- /dev/null +++ b/examples/get-service-status.ts @@ -0,0 +1,44 @@ +// eslint-disable-next-line eslint-comments/disable-enable-pair +/* eslint-disable @typescript-eslint/no-unused-vars */ +/** + * import from 'amazon-mws-api-sdk' + */ +import { amazonMarketplaces, HttpClient, MWSOptions, Sellers } from '../src' + +/** + * Configure the HttpClient + */ + +const mwsOptions: MWSOptions = { + marketplace: amazonMarketplaces.US, + awsAccessKeyId: '', + mwsAuthToken: '', + sellerId: '', + secretKey: '', +} + +const http = new HttpClient(mwsOptions) + +/** + * Configure which API you need + * Sellers, Orders, Fulfillment Inventory, Products, Reports, Subscriptions, Finances, Feeds + */ +const sellers = new Sellers(http) + +/** + * Get service status of the Sellers API + */ +const main = async () => { + /** + * Returns a tuple containing + * [0] Actual response data in JS object format + * [1] Metadata of the request + */ + const [serviceStatus, requestMeta] = await sellers.getServiceStatus() + + /** + * Check out Amazon's official docs for other available endpoints + * http://docs.developer.amazonservices.com/en_CA/dev_guide/index.html + * Under the folder API References + */ +}