Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "shipthisapi-js",
"version": "2.0.7",
"version": "2.0.8",
"description": "Wrapper for shipthis api",
"engines": {
"node": ">=18"
Expand All @@ -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"
},
Expand Down
4 changes: 4 additions & 0 deletions src/utils/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand All @@ -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:
Expand Down
Loading