-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from EveCloud/develop
Develop
- Loading branch information
Showing
63 changed files
with
845 additions
and
848 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,3 @@ | ||
const { request, APIError } = require('../request') | ||
|
||
/** | ||
* @name getGitHubRepositories | ||
* @description Get GitHub repositories | ||
* @namespace Account | ||
* @link https://docs.evecloud.xyz/reference/api#tag/Account/operation/Integrations.GitHub.Repositories | ||
* @returns {Promise<Object>} GitHub repositories | ||
*/ | ||
function getGitHubRepositories () { | ||
return new Promise((resolve, reject) => { | ||
request.get('/v1/account/integrations/github/repositories').then(response => { | ||
resolve(response.data) | ||
}).catch(error => { | ||
reject(APIError(error)) | ||
}) | ||
}) | ||
} | ||
|
||
/** | ||
* @name connectGitHub | ||
* @description Connect GitHub to your account | ||
* @namespace Account | ||
* @link https://docs.evecloud.xyz/reference/api#tag/Account/operation/Integrations.GitHub.Connect | ||
* @param {String} code The code returned from GitHub | ||
* @param {String} installationId The installation ID returned from GitHub | ||
* @returns {Promise<String>} Success message | ||
*/ | ||
function connectGitHub (code, installationId) { | ||
return new Promise((resolve, reject) => { | ||
request.post('/v1/account/integrations/github/connect', { | ||
code, | ||
installationId | ||
}).then(response => { | ||
resolve(response.data) | ||
}).catch(error => { | ||
reject(APIError(error)) | ||
}) | ||
}) | ||
} | ||
|
||
module.exports = { | ||
getGitHubRepositories, | ||
connectGitHub | ||
github: require('./integrations/github') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
const { request, APIError } = require('../../request') | ||
|
||
/** | ||
* @name list | ||
* @description Get GitHub repositories | ||
* @namespace Integrations | ||
* @link https://docs.evecloud.xyz/api/account/integrations/github/repositories | ||
* @returns {Promise<Object>} GitHub repositories | ||
*/ | ||
function listRepositories () { | ||
return new Promise((resolve, reject) => { | ||
request.get('/v1/account/integrations/github/repositories').then(response => { | ||
resolve(response.data) | ||
}).catch(error => { | ||
reject(APIError(error)) | ||
}) | ||
}) | ||
} | ||
|
||
/** | ||
* @name connect | ||
* @description Connect GitHub to your account | ||
* @namespace Integrations | ||
* @link https://docs.evecloud.xyz/api/account/integrations/github/connect | ||
* @param {String} code The code returned from GitHub | ||
* @param {String} installationId The installation ID returned from GitHub | ||
* @returns {Promise<String>} Success message | ||
*/ | ||
function connect (code, installationId) { | ||
return new Promise((resolve, reject) => { | ||
request.post('/v1/account/integrations/github/connect', { | ||
code, | ||
installationId | ||
}).then(response => { | ||
resolve(response.data) | ||
}).catch(error => { | ||
reject(APIError(error)) | ||
}) | ||
}) | ||
} | ||
|
||
module.exports = { | ||
repositories: { | ||
list: listRepositories | ||
}, | ||
connect | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
const { request, APIError } = require('../request') | ||
|
||
/** | ||
* @name get | ||
* @description Get the current user's account preferences | ||
* @namespace Preferences | ||
* @link https://docs.evecloud.xyz/api/account/preferences/view | ||
* @returns {Promise<Object>} User preferences object | ||
*/ | ||
function get () { | ||
return new Promise((resolve, reject) => { | ||
request.get('/v1/account/preferences').then(response => { | ||
resolve(response.data) | ||
}).catch(error => { | ||
reject(APIError(error)) | ||
}) | ||
}) | ||
} | ||
|
||
/** | ||
* @name update | ||
* @description Update the current user's account preferences | ||
* @namespace Preferences | ||
* @link https://docs.evecloud.xyz/api/account/preferences/update | ||
* @param {Object} data Information to update | ||
* @returns {Promise<Object>} User preferences object | ||
*/ | ||
function update (data) { | ||
return new Promise((resolve, reject) => { | ||
request.put('/v1/account/preferences', data).then(response => { | ||
resolve(response.data) | ||
}).catch(error => { | ||
reject(APIError(error)) | ||
}) | ||
}) | ||
} | ||
|
||
module.exports = { | ||
get, | ||
update | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
const { request, APIError } = require('../request') | ||
|
||
/** | ||
* @name getEvents | ||
* @description Get your authentication events | ||
* @namespace Account | ||
* @link https://docs.evecloud.xyz/reference/api#tag/Account/operation/Security.GetEvents | ||
* @name list | ||
* @description Get your authentication events from the last 30 days. | ||
* @namespace Security | ||
* @link https://docs.evecloud.xyz/api/account/security/events | ||
* @param {String} params Parameters | ||
* @returns {Promise<Object>} Authentication events | ||
*/ | ||
function getEvents (params) { | ||
function listEvents (params) { | ||
return new Promise((resolve, reject) => { | ||
request.get('/v1/account/security/events', { | ||
params: params || {} | ||
}).then(response => { | ||
resolve(response.data.data) | ||
resolve(response.data) | ||
}).catch(error => { | ||
reject(APIError(error)) | ||
}) | ||
}) | ||
} | ||
|
||
module.exports = { | ||
getEvents | ||
events: { | ||
list: listEvents | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.