diff --git a/package.json b/package.json index c410a63..2c2e543 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "shipthisapi-js", - "version": "2.0.7", + "version": "2.0.8", "description": "Wrapper for shipthis api", "engines": { "node": ">=18" @@ -24,11 +24,10 @@ "scripts": { "start": "node dist/shipthisapi-js/main.js", "clean": "rimraf coverage build tmp", - "prebuild": "node ./scripts/pre-build && npm run lint", + "prebuild": "node ./scripts/pre-build", "build": "tsc -p tsconfig.prod.json", "postbuild": "node ./scripts/pre-publish", "build:watch": "tsc -w -p tsconfig.prod.json", - "lint": "eslint ./src", "test": "jest --coverage", "test:watch": "jest --watch" }, diff --git a/src/utils/request.ts b/src/utils/request.ts index 7d2eb3f..48b1538 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -17,6 +17,9 @@ const prepareHeaders = async (obj: ShipthisAPI) => { if (obj.xApiKey) { headers['x-api-key'] = obj.xApiKey || ''; } + if (obj.authorization) { + headers['authorization'] = obj.authorization || ''; + } return headers; }; @@ -38,6 +41,7 @@ const internalRequest = async ( headers['Access-Control-Allow-Origin'] = '*'; headers['Access-Control-Allow-Credentials'] = true; const query_params = options?.queryParams || null; + console.log('headers', headers); const config: AxiosRequestConfig = { method, url: