Skip to content

Commit

Permalink
Merge pull request #132 from InterNetX/master
Browse files Browse the repository at this point in the history
2.1.15
  • Loading branch information
ChripIX authored Oct 11, 2024
2 parents bc87bbf + 3b499fc commit c18aacd
Show file tree
Hide file tree
Showing 10 changed files with 4,558 additions and 2,555 deletions.
Binary file added .yarn/install-state.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion diagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
288 changes: 161 additions & 127 deletions index.d.ts

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-domainrobot-sdk",
"version": "2.1.14",
"version": "2.1.15",
"description": "A (node)js package for easy integration of the domainrobot API powered by InterNetX GmbH.",
"main": "index.js",
"types": "index.d.ts",
Expand Down Expand Up @@ -42,10 +42,10 @@
"cross-env": "^6.0.3",
"mocha": "^9.1.0",
"nyc": "^15.1.0",
"webpack": "^4.41.4"
"webpack": "^5.94.0"
},
"dependencies": {
"axios": "^0.21.1",
"axios": "^0.28.0",
"chai": "^4.3.4",
"yarn.lock": "^0.0.1-security"
}
Expand Down
1 change: 1 addition & 0 deletions release-notes/v2.1.15.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* update definitions
24 changes: 13 additions & 11 deletions src/services/DomainRobotService.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,15 @@ class DomainRobotService {
}
}

this.axiosconfig = {}
// decide which authentcation method we should use
// its either 'basic auth' or via 'session_id'
if (this.domainRobotConfig.auth !== undefined) {
// set basic axios config
this.axiosconfig = {
auth: {
username: this.domainRobotConfig.auth.user,
password: this.domainRobotConfig.auth.password
}
};
this.axiosconfig.auth = {
username: this.domainRobotConfig.auth.user,
password: this.domainRobotConfig.auth.password
}
} else if (this.domainRobotConfig.session_id !== null && this.domainRobotConfig.session_id !== undefined) {
// set the session_id header for authentication
axios.defaults.headers.common[Headers.DOMAINROBOT_HEADER_SESSION_ID] = this.domainRobotConfig.session_id;
Expand All @@ -73,6 +72,9 @@ class DomainRobotService {
* @param {object} headers
*/
headers(headers) {
if(!this.axiosconfig.headers) {
this.axiosconfig.headers = {};
}
this.axiosconfig.headers = headers;
return this;
}
Expand Down Expand Up @@ -113,9 +115,9 @@ class DomainRobotService {
}

let result;
if (this.domainRobotConfig.isMockRequest === true){
result = this.domainRobotConfig.mockResponse;
}else{
if (this.domainRobotConfig.isMockRequest === true) {
result = this.domainRobotConfig.mockResponse;
} else {
result = await this.axios(requestOptions);
}

Expand All @@ -136,8 +138,8 @@ class DomainRobotService {
return domainRobotResult;
} catch (error) {
// a connection error (e.g. timeout, wrong address etc.) or some error that didn't return a response occured
if (error.response === undefined){
throw error
if (error.response === undefined) {
throw error
}
throw new DomainRobotException(
error.response.data,
Expand Down
5 changes: 3 additions & 2 deletions src/services/UserService.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ class User extends DomainRobotService {
}

return await this.sendGetRequest(
this.domainRobotConfig.url + "/user/" + user + "/" + context + queryString
);
this.domainRobotConfig.url + "/user/" + user + "/" + context + queryString
)

}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/swagger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
```bash
yarn

#after installation is complete
# after installation is complete
yarn update:specs
```

Expand All @@ -12,11 +12,11 @@ or with npm
```bash
npm run install

#after installation is complete
# after installation is complete
npm run update:specs
```

Run the tests to check that everything is still ok and nothing is broken.
See tests/Readme.md for more information on how to run the tests.

If the tests are all ok commit the new swagger files and publish a new npm package version.
If the tests are all ok commit the new swagger files and publish a new npm package version.
Loading

0 comments on commit c18aacd

Please sign in to comment.