Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sp-api-sdk/common

Package Overview
Dependencies
Maintainers
2
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sp-api-sdk/common - npm Package Compare versions

Comparing version 1.8.0 to 1.9.0

16

dist/cjs/src/axios.js

@@ -73,2 +73,3 @@ "use strict";

prefixText: `sp-api-sdk/${region}`,
dateFormat: 'isoDateTime',
method: true,

@@ -79,2 +80,3 @@ url: true,

headers: false,
logger: console.info,
...requestLoggerOptions,

@@ -87,2 +89,3 @@ }));

prefixText: `sp-api-sdk/${region}`,
dateFormat: 'isoDateTime',
status: true,

@@ -93,7 +96,20 @@ statusText: false,

headers: true,
logger: console.info,
...responseLoggerOptions,
}));
}
if (logging?.error) {
const errorLoggerOptions = logging.error === true ? undefined : logging.error;
instance.interceptors.response.use((response) => response, async (error) => (0, axios_logger_1.errorLogger)(error, {
prefixText: `sp-api-sdk/${region}`,
dateFormat: 'isoDateTime',
params: false,
data: false,
headers: true,
logger: console.error,
...errorLoggerOptions,
}));
}
return { axios: instance, endpoint };
}
exports.createAxiosInstance = createAxiosInstance;

18

dist/es/src/axios.js
import axios from 'axios';
import { aws4Interceptor } from 'aws4-axios';
import axiosRetry from 'axios-retry';
import { requestLogger, responseLogger } from 'axios-logger';
import { requestLogger, responseLogger, errorLogger } from 'axios-logger';
import { sync as readPackageJson } from 'read-pkg-up';

@@ -69,2 +69,3 @@ import { SellingPartnerApiError } from './errors';

prefixText: `sp-api-sdk/${region}`,
dateFormat: 'isoDateTime',
method: true,

@@ -75,2 +76,3 @@ url: true,

headers: false,
logger: console.info,
...requestLoggerOptions,

@@ -83,2 +85,3 @@ }));

prefixText: `sp-api-sdk/${region}`,
dateFormat: 'isoDateTime',
status: true,

@@ -89,6 +92,19 @@ statusText: false,

headers: true,
logger: console.info,
...responseLoggerOptions,
}));
}
if (logging?.error) {
const errorLoggerOptions = logging.error === true ? undefined : logging.error;
instance.interceptors.response.use((response) => response, async (error) => errorLogger(error, {
prefixText: `sp-api-sdk/${region}`,
dateFormat: 'isoDateTime',
params: false,
data: false,
headers: true,
logger: console.error,
...errorLoggerOptions,
}));
}
return { axios: instance, endpoint };
}

4

dist/types/src/axios.d.ts
import { type Method } from 'axios';
import { requestLogger, responseLogger } from 'axios-logger';
import { requestLogger, responseLogger, errorLogger } from 'axios-logger';
import type { SellingPartnerApiAuth } from '@sp-api-sdk/auth';

@@ -7,2 +7,3 @@ import { type SellingPartnerRegion } from './regions';

declare type ResponseLogConfig = Exclude<Parameters<typeof responseLogger>[1], undefined>;
declare type ErrorLogConfig = Exclude<Parameters<typeof errorLogger>[1], undefined>;
export interface RateLimit {

@@ -30,2 +31,3 @@ urlRegex: RegExp;

response?: ResponseLogConfig | true;
error?: ErrorLogConfig | true;
};

@@ -32,0 +34,0 @@ }

@@ -5,3 +5,3 @@ {

"description": "Selling Parner API common library",
"version": "1.8.0",
"version": "1.9.0",
"main": "dist/cjs/index.js",

@@ -32,7 +32,7 @@ "module": "dist/es/index.js",

"dependencies": {
"@sp-api-sdk/auth": "^1.9.13",
"@sp-api-sdk/auth": "^1.9.14",
"aws4-axios": "^2.4.9",
"axios": "^0.27.2",
"axios-logger": "^2.6.0",
"axios-retry": "^3.2.4",
"axios-retry": "^3.2.5",
"read-pkg-up": "^7.0.1"

@@ -62,3 +62,3 @@ },

],
"gitHead": "975705017de9384bf28b85e97d93f866d4d71611"
"gitHead": "15c172555c85ce89731cebb62eb7e23f550f9506"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc