Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jensdev committed Aug 10, 2021
1 parent 1d73672 commit 8dd28b8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.0.4] - 2021-08-10

### Changed

- fixed inconsistency in README with parameter naming
- remove trailing slash on url parameter on client creation

## [1.0.3] - 2021-03-18

### Changed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ With es6 imports
import client from '@craftzing/akeneo-api';

const akeneo = client({
baseURL,
url,
username,
password,
clientId,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@craftzing/akeneo-api",
"version": "1.0.3",
"version": "1.0.4",
"description": "A Node Rest Client for the Akeneo PIM",
"author": "Jens Verbeken <[email protected]>",
"license": "MIT",
Expand Down
5 changes: 4 additions & 1 deletion src/http-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ const defaultConfig = {
*/
const createHttpClient = (options: ClientParams): AxiosInstance => {
let accessToken = '';
const { url: baseURL, clientId, secret, username, password } = options;
const { url, clientId, secret, username, password } = options;

const baseURL = url.endsWith('/') ? url.substr(0, url.length - 1) : url;

const instance = axios.create({
...defaultConfig,
...(options.axiosOptions || {}),
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const wrap = <P extends Record<string, any>, R>(
*
* ```javascript
* const client = akeneo({
* baseURL: AKENEO_API_URL,
* url: AKENEO_API_URL,
* username: AKENEO_USERNAME,
* password: AKENEO_PASSWORD,
* clientId: AKENEO_CLIENT_ID,
Expand Down Expand Up @@ -175,7 +175,7 @@ export const createClient = (params: ClientParams) => {
};
};

export type AkeneoClientAPI = ReturnType<typeof createClient>;
export type ClientAPI = ReturnType<typeof createClient>;

export * from './types';
export default createClient;

0 comments on commit 8dd28b8

Please sign in to comment.