Comparing version 1.0.0 to 1.1.0
@@ -103,2 +103,11 @@ /// <reference types="node" /> | ||
/** | ||
* @since 1.1.0 | ||
* | ||
* Get information about a ship by id | ||
* | ||
* @param {string} id The id of the ship | ||
* @returns {Promise<IShip>} | ||
*/ | ||
getShipById(id: string): Promise<IShip>; | ||
/** | ||
* @since 0.0.1 | ||
@@ -105,0 +114,0 @@ * |
@@ -58,2 +58,24 @@ 'use strict'; | ||
/** | ||
* @since 1.1.0 | ||
* | ||
* Get information about a ship by id | ||
* | ||
* @param {string} id The id of the ship | ||
* @returns {Promise<IShip>} | ||
*/ | ||
async getShipById(id) { | ||
try { | ||
const response = await axios.get(`${this.baseUrl}/ship?id=${id}`, this._axiosOptions); | ||
return response.data.ship; | ||
} | ||
catch (error) { | ||
if (error.response && error.response.data) { | ||
throw new ApiError(error.response.data); | ||
} | ||
else { | ||
throw error; | ||
} | ||
} | ||
} | ||
/** | ||
* @since 0.0.1 | ||
@@ -60,0 +82,0 @@ * |
{ | ||
"name": "azurlane", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Api wrapper for the azur lane api", | ||
@@ -5,0 +5,0 @@ "main": "lib/index", |
@@ -54,2 +54,23 @@ import axios, { AxiosRequestConfig } from "axios"; | ||
/** | ||
* @since 1.1.0 | ||
* | ||
* Get information about a ship by id | ||
* | ||
* @param {string} id The id of the ship | ||
* @returns {Promise<IShip>} | ||
*/ | ||
public async getShipById(id: string): Promise<IShip> { | ||
try { | ||
const response = await axios.get<IShipResponse>(`${this.baseUrl}/ship?id=${id}`, this._axiosOptions); | ||
return response.data.ship; | ||
} catch (error) { | ||
if (error.response && error.response.data) { | ||
throw new ApiError(error.response.data); | ||
} else { | ||
throw error; | ||
} | ||
} | ||
} | ||
/** | ||
* @since 0.0.1 | ||
@@ -56,0 +77,0 @@ * |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
591766
2843
2