Skip to content

Commit

Permalink
Merge pull request #35 from marverix/master
Browse files Browse the repository at this point in the history
withCredentials support
  • Loading branch information
Marek Sierociński authored Dec 4, 2020
2 parents a620d72 + 76694d1 commit 7a86b0e
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 10 deletions.
1 change: 1 addition & 0 deletions dist/ApiConfig.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ interface ApiConfig {
v2?: boolean;
apiKey?: string;
auth?: AxiosBasicCredentials;
withCredentials?: boolean;
}
export default ApiConfig;
5 changes: 5 additions & 0 deletions dist/api/APIAdminResourceAccount.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import APIResource from './APIResource';
declare class APIAdminResourceAccount extends APIResource {
constructor(parent: object);
}
export default APIAdminResourceAccount;
5 changes: 3 additions & 2 deletions dist/bitbar-cloud-api-client.js

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

2 changes: 1 addition & 1 deletion dist/bitbar-cloud-api-client.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/bitbar-cloud-api-client.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/bitbar-cloud-api-client.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bitbar/cloud-api-client",
"version": "0.24.0",
"version": "0.24.1",
"description": "Bitbar Cloud API Client for JavaScript",
"main": "dist/bitbar-cloud-api-client.min.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -42,7 +42,7 @@
"@typescript-eslint/eslint-plugin": "^2.34.0",
"@typescript-eslint/parser": "^2.34.0",
"chai": "^4.1.2",
"core-js": "^3.8.0",
"core-js": "^3.6.5",
"eslint": "^6.8.0",
"mocha": "^7.2.0",
"rollup": "^1.32.1",
Expand Down
3 changes: 3 additions & 0 deletions src/API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ class API {
};
}

// With credentials
this.axiosConfig.withCredentials = config.withCredentials == null ? false : config.withCredentials;

// Create axios instance
this.axios = axios.create(this.axiosConfig);
}
Expand Down
7 changes: 7 additions & 0 deletions src/ApiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ interface ApiConfig {
*
*/
auth?: AxiosBasicCredentials;


/**
* With credentials?
*
*/
withCredentials?: boolean;
}

export default ApiConfig;
24 changes: 24 additions & 0 deletions src/api/APIAdminResourceAccount.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import APIResource from './APIResource'


/**
* APIAdminResourceAccount
*
* @class
* @extends APIResource
*/
class APIAdminResourceAccount extends APIResource {

/**
* /services/{id}
*
* Constructor
*/
constructor (parent: object) {
super(parent);
this.push('account');
}

}

export default APIAdminResourceAccount

0 comments on commit 7a86b0e

Please sign in to comment.