Skip to content

Commit

Permalink
Update package.json and add test
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-imaginemage committed Mar 11, 2024
1 parent f80cca7 commit 3ca56a3
Show file tree
Hide file tree
Showing 3 changed files with 176 additions and 12 deletions.
149 changes: 144 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 12 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{
"name": "@imagination-media/magento-api-rest",
"version": "3.0.0",
"version": "3.0.1",
"description": "Magento API wrapper",
"main": "lib/index.js",
"files": ["lib"],
"directories": {
"lib": "lib"
},
"scripts": {
"start": "nodemon --watch src --exec \"npm run build\"",
"lint": "eslint --ext .ts . --fix",
Expand All @@ -26,16 +30,17 @@
"axios": "^1.6.7"
},
"devDependencies": {
"typescript": "^5.4.2",
"@types/node": "^18.16.3",
"babel-loader": "^9.1.2",
"babel-plugin-transform-class-properties": "^6.24.1",
"nodemon": "^3.0.1",
"@types/axios": "^0.14.0",
"@types/node": "^18.16.3",
"@typescript-eslint/eslint-plugin": "^6.8.0",
"@typescript-eslint/parser": "^6.8.0",
"axios": "^1.5.1",
"babel-loader": "^9.1.2",
"babel-plugin-transform-class-properties": "^6.24.1",
"cpy-cli": "^5.0.0",
"eslint": "^8.51.0"
"eslint": "^8.51.0",
"nodemon": "^3.0.1",
"ts-node": "^10.9.2",
"typescript": "^5.4.2"
}
}
20 changes: 20 additions & 0 deletions test/catalog/product/get.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { default as MagentoApi } from '../../../src/index';

(async () => {
let client = new MagentoApi({
'url': '',
'consumerKey': '',
'consumerSecret': '',
'accessToken': '',
'tokenSecret': ''
});

let sku = "65-813";

try {
let response = await client.get(`products/${sku}`);
console.log(JSON.stringify(response.data));
} catch (e) {
console.log(e);
}
})();

0 comments on commit 3ca56a3

Please sign in to comment.