Updated README.md to document the current state of the project.
This commit is contained in:
parent
c8e302acdb
commit
5787bea9ba
31
README.md
31
README.md
|
@ -1,35 +1,41 @@
|
||||||
# amazon-pa-api-5.0-sdk-node-ts
|
# amazon-pa-api-5.0-sdk-node-ts
|
||||||
|
|
||||||
I downloaded Amazon's Product Advertising API SDK "Example."
|
I rebuilt Amazon's Product Advertising API SDK for Node.js but for my particular Node.js.
|
||||||
|
|
||||||
I'm going to rebuild this mess so I can read it and understand it.
|
In particular I had the following design requirement:
|
||||||
|
|
||||||
Here's to setting better examples.
|
- Transpiles with TypeScript to ESNext module (ESM) without errors as a NodeNext module for NodeNext (Node 18 in my case).
|
||||||
|
- Sample artifacts from API Scratchpad parses in Node.js with TypeScript using the class types.
|
||||||
|
- Minimal breaking changes to the initial Product Advertising API 5.0.
|
||||||
|
- I didn't want to touch the HTTP client they used for now.
|
||||||
|
|
||||||
Refactored by [David A. Ball](https://daball.me).
|
Refactored by [David A. Ball](https://daball.me).
|
||||||
|
|
||||||
# Product Advertising API 5.0 SDK for NodeJS
|
# Product Advertising API 5.0 SDK for NodeJS
|
||||||
|
|
||||||
[](https://nodei.co/npm/paapi5-nodejs-sdk/)
|
[](https://nodei.co/npm/amazon-pa-api5-node-ts/)
|
||||||
|
|
||||||
[](http://badge.fury.io/js/paapi5-nodejs-sdk) [](https://www.npmjs.com/package/paapi5-nodejs-sdk)
|
[](https://badge.fury.io/js/amazon-pa-api5-node-ts) [](https://www.npmjs.com/package/amazon-pa-api5-node-ts)
|
||||||
|
|
||||||
This repository contains the official Product Advertising API 5.0 NodeJS SDK called **paapi5-nodejs-sdk** that allows you to access the [Product Advertising API](https://webservices.amazon.com/paapi5/documentation/index.html) from your NodeJS app.
|
This repository started with the official Product Advertising API 5.0 NodeJS SDK called **[paapi5-nodejs-sdk](https://www.npmjs.com/package/paapi5-nodejs-sdk)** that allows you to access the [Product Advertising API](https://webservices.amazon.com/paapi5/documentation/index.html) from your NodeJS app.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
### For [Node.js](https://nodejs.org/)
|
### For [Node.js](https://nodejs.org/)
|
||||||
|
|
||||||
The Product Advertising API NodeJS SDK can be installed via [npm](https://www.npmjs.com/package/paapi5-nodejs-sdk):
|
The Product Advertising API NodeJS SDK can be installed via [npm](https://www.npmjs.com/package/amazon-pa-api5-node-ts):
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install paapi5-nodejs-sdk --save
|
npm install amazon-pa-api5-node-ts --save
|
||||||
```
|
```
|
||||||
|
|
||||||
You should now be able to `require('paapi5-nodejs-sdk')` in javascript files.
|
You should now be able to `import * as ProductAdvertisingAPIv1 from 'amazon-pa-api5-node-ts'` in TypeScript files.
|
||||||
|
|
||||||
### For browser
|
### For browser
|
||||||
|
|
||||||
|
I assume it works in the browser. I have no idea really. I use it on the server. I'm leaving the documentation up from
|
||||||
|
the original documentation.
|
||||||
|
|
||||||
The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
|
The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
|
||||||
the above steps with Node.js and installing browserify with `npm install -g browserify`,
|
the above steps with Node.js and installing browserify with `npm install -g browserify`,
|
||||||
perform the following (assuming *main.js* is your entry file, that's to say your javascript file where you actually
|
perform the following (assuming *main.js* is your entry file, that's to say your javascript file where you actually
|
||||||
|
@ -43,6 +49,9 @@ Then include *bundle.js* in the HTML pages.
|
||||||
|
|
||||||
### Webpack Configuration
|
### Webpack Configuration
|
||||||
|
|
||||||
|
I assume it works in Webpack. I'm using it with Vite, for instance, with Astro. I have no idea really. I'm leaving the documentation up from
|
||||||
|
the original documentation.
|
||||||
|
|
||||||
Using Webpack you may encounter the following error: "Module not found: Error:
|
Using Webpack you may encounter the following error: "Module not found: Error:
|
||||||
Cannot resolve module", most certainly you should disable AMD loader. Add/merge
|
Cannot resolve module", most certainly you should disable AMD loader. Add/merge
|
||||||
the following section to your webpack config:
|
the following section to your webpack config:
|
||||||
|
@ -61,6 +70,9 @@ module: {
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
|
This is an old example. I'm sure you won't have trouble getting started since I've made every effort not to break the original API but it works with all the type hinting of TypeScript. I'm leaving the documentation up from
|
||||||
|
the original documentation.
|
||||||
|
|
||||||
Please follow the [installation](#installation) instruction and execute the following JS code:
|
Please follow the [installation](#installation) instruction and execute the following JS code:
|
||||||
|
|
||||||
Simple example for [SearchItems](https://webservices.amazon.com/paapi5/documentation/search-items.html) to discover Amazon products with the keyword 'Harry Potter' in Books category:
|
Simple example for [SearchItems](https://webservices.amazon.com/paapi5/documentation/search-items.html) to discover Amazon products with the keyword 'Harry Potter' in Books category:
|
||||||
|
@ -172,4 +184,5 @@ api.searchItems(searchItemsRequest).then(
|
||||||
Complete documentation, installation instructions, and examples are available [here](https://webservices.amazon.com/paapi5/documentation/index.html).
|
Complete documentation, installation instructions, and examples are available [here](https://webservices.amazon.com/paapi5/documentation/index.html).
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This SDK is distributed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), see LICENSE.txt and NOTICE.txt for more information.
|
This SDK is distributed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), see LICENSE.txt and NOTICE.txt for more information.
|
||||||
|
|
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "amazon-pa-api5-node-ts",
|
"name": "amazon-pa-api5-node-ts",
|
||||||
"version": "2.2.6",
|
"version": "2.2.7",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "amazon-pa-api5-node-ts",
|
"name": "amazon-pa-api5-node-ts",
|
||||||
"version": "2.2.6",
|
"version": "2.2.7",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"superagent": "^9.0.0"
|
"superagent": "^9.0.0"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "amazon-pa-api5-node-ts",
|
"name": "amazon-pa-api5-node-ts",
|
||||||
"version": "2.2.6",
|
"version": "2.2.7",
|
||||||
"description": "ProductAdvertisingAPI 5.0 NodeJS SDK rewritten in TypeScript.",
|
"description": "ProductAdvertisingAPI 5.0 NodeJS SDK rewritten in TypeScript.",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"main": "dist/src/index.mjs",
|
"main": "dist/src/index.mjs",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user