Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
paapi5-typescript-sdk
Advanced tools
*Unofficial* TypeScript SDK for Product Advertising API 5.0
Unofficial TypeScript SDK for Product Advertising API 5.0
In order to install this SDK, you just have to run you well-known npm
or yarn
scripts:
npm i -S paapi5-typescript-sdk
Or
yarn add paapi5-typescript-sdk
And there you go! Enjoy 😎
Everything is exported from the SDK: requests' classes, models, utility types, helper and so on..
If you want to import everything
import * as SDK from 'paapi5-typescript-sdk';
And use what you need later
const request = new SDK.SearchItemsRequest(/* ... */);
You can refer to the Amazon Product Advertising API 5.0 for further details about every request
In order to validate all the requests against the APIs, I've implemented almost from scratch the AWS V4 signing process, creating the SignHelper
class.
This is intended for interal use, but if you want to use it for other purposes, here you can find an example:
import { HttpMethod, SignHelper, Region } from 'paapi5-typescript-sdk'
const timestamp = 1609426121130;
const path = '/paapi5/getbrowsenodes';
const method = HttpMethod.POST;
const service = 'ProductAdvertisingAPI';
const accessKey = 'accessKey';
const secretKey = 'secretKey';
const signHelper = new SignHelper(accessKey, secretKey);
const headers = {
host: 'webservices.amazon.it',
'x-amz-target': 'com.amazon.paapi5.v1.ProductAdvertisingAPIv1.GetBrowseNodes',
'x-amz-date': signHelper.toAmzDate(timestamp),
'content-encoding': 'amz-1.0',
'content-type': 'application/json; charset=utf-8',
};
const header = signHelper.getAuthorizationHeader(path, method, {}, headers, Region.ITALY, service, timestamp);
// 'AWS4-HMAC-SHA256 Credential=accessKey/20201231/eu-west-1/ProductAdvertisingAPI/aws4_request, SignedHeaders=content-encoding;content-type;host;x-amz-date;x-amz-target, Signature=ba741bfb87f9bf3b9b343d72e4f76dc9f169f2e86a047423d783a2169f03c595'
This folder only contains some types, interfaces and enums
This folder only contains some types, interfaces and enums
Here you can find all the classes you need in order to communicate with the APIs
CommonRequest
This is intended to be just a parent class to be extended by all the other specific classes.
Its only purposes are:
SignHelper
for internal usesend()
method so that all the sub-classes don't need to implement itExample
import { CommonRequest, PartnerType, Host, Region } from 'paapi5-typescript-sdk'
const commonRequest = new CommonRequest(
'partnerTag',
PartnerType.ASSOCIATES,
'accessKey',
'secretKey',
Host.Italy,
Region.Italy
);
// Not an real request, just an example
const data = await commonRequest.send();
GetBrowseNodesRequest
Amazon documentation here
Example
import { GetBrowseNodesRequest, PartnerType, Host, Region } from 'paapi5-typescript-sdk'
const request = new GetBrowseNodesRequest(
{ /* parameters */ }
'partnerTag',
PartnerType.ASSOCIATES,
'accessKey',
'secretKey',
Host.Italy,
Region.Italy
);
const data = await request.send();
GetItemsRequest
Amazon documentation here
Example
import { GetItemsRequest, PartnerType, Host, Region } from 'paapi5-typescript-sdk'
const request = new GetItemsRequest(
{ /* parameters */ }
'partnerTag',
PartnerType.ASSOCIATES,
'accessKey',
'secretKey',
Host.Italy,
Region.Italy
);
const data = await request.send();
GetVariationsRequest
Amazon documentation here
Example
import { GetVariationsRequest, PartnerType, Host, Region } from 'paapi5-typescript-sdk'
const request = new GetVariationsRequest(
{ /* parameters */ }
'partnerTag',
PartnerType.ASSOCIATES,
'accessKey',
'secretKey',
Host.Italy,
Region.Italy
);
const data = await request.send();
SearchItemsRequest
Amazon documentation here
Example
import { SearchItemsRequest, PartnerType, Host, Region } from 'paapi5-typescript-sdk'
const request = new SearchItemsRequest(
{ /* parameters */ }
'partnerTag',
PartnerType.ASSOCIATES,
'accessKey',
'secretKey',
Host.Italy,
Region.Italy
);
const data = await request.send();
FAQs
*Unofficial* TypeScript SDK for Product Advertising API 5.0
We found that paapi5-typescript-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.