Skip to content

Releases: kyle-n/unofficial-amazon-search

Upgrades jsdom

22 Oct 19:18
Compare
Choose a tag to compare

Upgrades unofficial-amazon-search to use jsdom 18.

Also upgrades the devDependencies used to build the package.

Updated dependencies

05 May 20:24
Compare
Choose a tag to compare

This release contains no changes to the public API for the package.

  • Updates package dependencies
  • Fixes a security vulnerability in a dependency
  • Moves e2e test out of GitHub Actions to a separate script for running e2e tests locally

Bumps node-notifier version

05 Jan 17:05
Compare
Choose a tag to compare

Bumps node-notifier to fix a security vulnerability.

Bug fixes for sponsored results

24 Nov 20:09
Compare
Choose a tag to compare
  • The logic for detecting if a result was sponsored was broken, it has been fixed
  • fullProductUrl on AmazonSearchResult now accepts values. You must pass a full URL with the Amazon domain or it will error. Assign sub-domain values to productUrl.
  • Unit test suite, should help detect future regressions

Multi-page search

22 Nov 19:41
Compare
Choose a tag to compare

🎉 2.0.0! 🎊

UAS is celebrating 2.0.0 by adding multi-page search. Now you can load as many search results as Amazon returns.

Breaking changes

searchAmazon parameters

searchAmazon now takes two parameters, one an optional config object.

import {searchAmazon} from 'unofficial-amazon-search';

// Loads page 2 of search results, with ads included
searchAmazon('mad max', {page: 2, includeSponsoredResults: true}).then(data => {
  console.log(data.searchResults); // (search result array)
  console.log(data.pageNumber);  // 2
});

All config properties are optional.

searchAmazon return shape

searchAmazon now returns an object conforming to the interface SearchData. SearchData is documented in the README.

searchAmazon('mad max').then(data => {
  console.log(data.searchResults) // (page 1 search result array)
  return data.getNextPage();
}).then(data => {
  console.log(data.searchResults) // (page 2 search result array)
});

AmazonSearchResult properties

The productUrl now property returns the path for an Amazon search result without the leading domain. To access the complete url, use the new fullProductUrl computed property.

searchAmazon('mad max').then(data => {
  console.log(data.searchResults[0].productUrl)    // /gp/slredirect/picassoRedirect.html/ref=pa_sp_atf_next_aps_sr_pg2_1...
  console.log(data.searchResults[0].fullProductUrl // https://www.amazon.com/gp/slredirect/picassoRedirect.html/ref=pa_sp_atf_next_aps_sr_pg2_1...
});

If you assign to productUrl, its value should not include the leading https://www.amazon.com.

The AmazonSearchResult class previously used getters and setters to assign to and read from private underscored properties (e.x. get title(): string { return this._title; }. These have been simplified to just have publicly accessible properties without gets and and sets. If you used the underscore-prefixed properties, for some reason, those have been removed.

Faster builds when compiling for NPM

22 Nov 19:27
Compare
Choose a tag to compare

In 1.2.5, the TypeScript source was actually transpiled three times: Once for Node, once for the minified bundle and once for the un-minified bundle.

1.2.6 simplifies the build process to:

  • tsc transpiles the TS source into un-minified JS for Node, stored in lib
  • webpack bundles the JS in lib into minified and un-minified bundles, stored in _bundles

Dependencies

  • Adds source-map-loader to preserve original TS sources in the browser
  • Removes ts-loader, since webpack no longer transpiles

Upgrades dependencies

16 Nov 21:00
Compare
Choose a tag to compare
  • The un-minified browser bundle is now not minified
  • Upgrades dependencies
  • Changes NPM CD workflow to run on new tag, not new release

NPM keywords

23 Jun 20:37
Compare
Choose a tag to compare

NPM keywords to help the package show up in site search

Clarifies documentation and tsconfig

15 Jun 16:58
Compare
Choose a tag to compare
  • README explains how proxying browser-side requests works
  • tsconfig does not include comments or unused options
  • search file is better organized to handle async and export default syntax

Publishes only transpiled JS to NPM

31 May 03:02
Compare
Choose a tag to compare