the-traveler
Advanced tools
Comparing version 0.2.1 to 0.3.0
@@ -33,3 +33,5 @@ "use strict"; | ||
} | ||
resolve(response); | ||
else { | ||
resolve(JSON.parse(JSON.stringify(response))); | ||
} | ||
}) | ||
@@ -36,0 +38,0 @@ .catch(function (err) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
require("es6-promise"); | ||
require("es6-map"); | ||
var querystring = require("querystring"); | ||
@@ -34,3 +34,3 @@ var HttpService_1 = require("./HttpService"); | ||
* @async | ||
* @return {Promise.IAPIResponse} When fulfilled returns an object containing the current Destiny 2 manifest | ||
* @return {Promise.IAPIResponse<IDestinyManifest>} When fulfilled returns an object containing the current Destiny 2 manifest | ||
*/ | ||
@@ -56,3 +56,3 @@ Traveler.prototype.getDestinyManifest = function () { | ||
* @param hashIdentifier | ||
* @return {Promise.IAPIResponse} When fulfilled returns an object containing the static definition of an entity. | ||
* @return {Promise.IAPIResponse<IDestinyDefinition>} When fulfilled returns an object containing the static definition of an entity. | ||
*/ | ||
@@ -84,3 +84,3 @@ Traveler.prototype.getDestinyEntityDefinition = function (typeDefinition, hashIdentifier) { | ||
* Keep in mind that `-1` or `MembershipType.All` is only applicable on this endpoint. | ||
* @return {Promise.IAPIResponse} When fulfilled returns an object containing information about the found user | ||
* @return {Promise.IAPIResponse<IUserInfoCard>} When fulfilled returns an object containing information about the found user | ||
*/ | ||
@@ -111,16 +111,30 @@ Traveler.prototype.searchDestinyPlayer = function (membershipType, displayName) { | ||
* </ul> | ||
* @return {Promise.IAPIResponse} When fulfilled returns an object containing stats about the specified character | ||
* @return {Promise.IAPIResponse<IDestinyProfileResponse>} When fulfilled returns an object containing stats about the specified character | ||
*/ | ||
Traveler.prototype.getProfile = function (membershipType, destinyMembershipId, queryStringParameters) { | ||
var _this = this; | ||
this.options.uri = this.apibase + "/" + membershipType + "/Profile/" + destinyMembershipId + "/" + this.resolveQueryStringParameters(queryStringParameters); | ||
return new Promise(function (resolve, reject) { | ||
_this.httpService.get(_this.options) | ||
.then(function (response) { | ||
resolve(response); | ||
}) | ||
.catch(function (err) { | ||
reject(err); | ||
if (this.oauthOptions) { | ||
this.oauthOptions.uri = this.apibase + "/" + membershipType + "/Profile/" + destinyMembershipId + "/" + this.resolveQueryStringParameters(queryStringParameters); | ||
return new Promise(function (resolve, reject) { | ||
_this.httpService.get(_this.oauthOptions) | ||
.then(function (response) { | ||
resolve(response); | ||
}) | ||
.catch(function (err) { | ||
reject(err); | ||
}); | ||
}); | ||
}); | ||
} | ||
else { | ||
this.options.uri = this.apibase + "/" + membershipType + "/Profile/" + destinyMembershipId + "/" + this.resolveQueryStringParameters(queryStringParameters); | ||
return new Promise(function (resolve, reject) { | ||
_this.httpService.get(_this.options) | ||
.then(function (response) { | ||
resolve(response); | ||
}) | ||
.catch(function (err) { | ||
reject(err); | ||
}); | ||
}); | ||
} | ||
}; | ||
@@ -139,3 +153,3 @@ /** | ||
* </ul> | ||
* @return {Promise.IAPIResponse} When fulfilled returns an object containing stats about the specified character | ||
* @return {Promise.IAPIResponse<IDestinyCharacterResponse>} When fulfilled returns an object containing stats about the specified character | ||
*/ | ||
@@ -201,3 +215,3 @@ Traveler.prototype.getCharacter = function (membershipType, destinyMembershipId, characterId, queryStringParameters) { | ||
* </ul> | ||
* @return {Promise.IAPIResponse} When fulfilled returns an object containing stats about the queried item | ||
* @return {Promise.IAPIResponse<IDestinyItemResponse>} When fulfilled returns an object containing stats about the queried item | ||
*/ | ||
@@ -229,3 +243,3 @@ Traveler.prototype.getItem = function (membershipType, destinyMembershipId, itemInstanceId, queryStringParameters) { | ||
* </ul> | ||
* @return {Promise.IAPIResponse} When fulfilled returns an object containing all available vendors | ||
* @return {Promise.IAPIResponse<IDestinyVendorResponse[]>} When fulfilled returns an object containing all available vendors | ||
*/ | ||
@@ -272,3 +286,3 @@ Traveler.prototype.getVendors = function (membershipType, destinyMembershipId, characterId, queryStringParameters) { | ||
* </ul> | ||
* @return {Promise.IAPIResponse} When fulfilled returns an object containing all available vendors | ||
* @return {Promise.IAPIResponse<IDestinyVendorResponse>} When fulfilled returns an object containing all available vendors | ||
*/ | ||
@@ -292,3 +306,3 @@ Traveler.prototype.getVendor = function (membershipType, destinyMembershipId, characterId, vendorHash, queryStringParameters) { | ||
* @param activityId The activity ID for getting the carnage report | ||
* @return {Promise.IAPIResponse} When fulfilled returns an object containing the carnage report for the specified activity | ||
* @return {Promise.IAPIResponse<IDestinyPostGameCarnageReportData>} When fulfilled returns an object containing the carnage report for the specified activity | ||
*/ | ||
@@ -338,3 +352,3 @@ Traveler.prototype.getPostGameCarnageReport = function (activityId) { | ||
* </ul> | ||
* @return {Promise.IAPIResponse} When fulfilled returns an object containing leaderboards for a clan | ||
* @return {Promise.IAPIResponse<object>} When fulfilled returns an object containing leaderboards for a clan | ||
*/ | ||
@@ -363,3 +377,3 @@ Traveler.prototype.getClanLeaderboards = function (groupId, queryStringParameters) { | ||
* </ul> | ||
* @return {Promise.IAPIResponse} When fulfilled returns an object containing aggregated stats for a clan | ||
* @return {Promise.IAPIResponse<IDestinyClanAggregateStat[]>} When fulfilled returns an object containing aggregated stats for a clan | ||
*/ | ||
@@ -395,3 +409,3 @@ Traveler.prototype.getClanAggregateStats = function (groupId, queryStringParameters) { | ||
* </ul> | ||
* @return {Promise.IAPIResponse} When fulfilled returns an object containing the leaderboard | ||
* @return {Promise.IAPIResponse<object>} When fulfilled returns an object containing the leaderboard | ||
*/ | ||
@@ -451,3 +465,3 @@ Traveler.prototype.getLeaderboards = function (membershipType, destinyMembershipId, queryStringParameters) { | ||
* <li>page {number} Page number to return, starting with 0</li> | ||
* @return {Promise.IAPIResponse} The entities search result | ||
* @return {Promise.IAPIResponse<IDestinyEntitySearchResult>} The entities search result | ||
*/ | ||
@@ -516,3 +530,3 @@ Traveler.prototype.searchDestinyEntities = function (searchTerm, typeDefinition, queryStringParameters) { | ||
* </ul> | ||
* @return {Promise.object} When fulfilled returns an object containing stats about the found user's account | ||
* @return {Promise.IAPIResponse<IDestinyHistoricalStatsAccountResult>} When fulfilled returns an object containing stats about the found user's account | ||
*/ | ||
@@ -548,3 +562,3 @@ Traveler.prototype.getHistoricalStatsForAccount = function (membershipType, destinyMembershipId, queryStringParameters) { | ||
* </ul> | ||
* @return {Promise.IAPIResponse} When fulfilled returns an object containing stats for activities for the specified character | ||
* @return {Promise.IAPIResponse<IDestinyActivityHistoryResults>} When fulfilled returns an object containing stats for activities for the specified character | ||
*/ | ||
@@ -572,3 +586,3 @@ Traveler.prototype.getActivityHistory = function (membershipType, destinyMembershipId, characterId, queryStringParameters) { | ||
* @param characterId ID of the character | ||
* @return {Promise.object} When fulfilled returns an object containing information about the weapon usage for the indiciated character | ||
* @return {Promise.IAPIResponse<IDestinyHistoricalWeaponStatsData>} When fulfilled returns an object containing information about the weapon usage for the indiciated character | ||
*/ | ||
@@ -596,3 +610,3 @@ Traveler.prototype.getUniqueWeaponHistory = function (membershipType, destinyMembershipId, characterId) { | ||
* @param characterId ID of the character | ||
* @return {Promise.IAPIResponse} When fulfilled returns an object containing aggregated information about recent activities | ||
* @return {Promise.IAPIResponse<IDestinyAggregateActivityResults>} When fulfilled returns an object containing aggregated information about recent activities | ||
*/ | ||
@@ -616,3 +630,3 @@ Traveler.prototype.getAggregateActivityStats = function (membershipType, destinyMembershipId, characterId) { | ||
* @param milestoneHash The identifier for the milestone to be returned | ||
* @return {Promise.IAPIResponse} When fulfilled returns an object containing aggregated information about recent activities | ||
* @return {Promise.IAPIResponse<IDestinyMilestoneContent>} When fulfilled returns an object containing aggregated information about recent activities | ||
*/ | ||
@@ -619,0 +633,0 @@ Traveler.prototype.getPublicMilestoneContent = function (milestoneHash) { |
{ | ||
"name": "the-traveler", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "A Node.js API wrapper for the Destiny 2 API", | ||
@@ -11,3 +11,4 @@ "keywords": [ | ||
], | ||
"main": "build/traveler.js", | ||
"main": "build/Traveler.js", | ||
"types": "build/Traveler.d.ts", | ||
"author": "Alexander Weiß", | ||
@@ -20,9 +21,8 @@ "license": "MIT", | ||
"files": [ | ||
"build/Traveler.js", | ||
"build/enums.js", | ||
"build/HttpService.js", | ||
"build/OAuthError.js" | ||
"build/*.js", | ||
"build/*.d.ts" | ||
], | ||
"scripts": { | ||
"start": "babel-node ./src/index.js --presets es2015,stage-2", | ||
"debug": "babel-node ./src/index.js --presets es2015,stage-2", | ||
"build": "tsc --p tsconfig.json --declaration --target es5", | ||
@@ -37,6 +37,6 @@ "watch": "tsc --watch --p tsconfig.json --declaration --target es5", | ||
"request": "^2.81.0", | ||
"request-promise-native": "^1.0.4" | ||
"request-promise-native": "^1.0.4", | ||
"@types/request-promise-native": "^1.0.6" | ||
}, | ||
"devDependencies": { | ||
"@types/request-promise-native": "^1.0.6", | ||
"babel-cli": "^6.26.0", | ||
@@ -50,3 +50,5 @@ "babel-core": "^6.26.0", | ||
"codecov": "^2.3.0", | ||
"es6-map": "^0.1.5", | ||
"es6-promise": "^4.1.1", | ||
"es6-shim": "^0.35.3", | ||
"minami": "^1.2.3", | ||
@@ -53,0 +55,0 @@ "mocha": "^3.5.0", |
# The Traveler | ||
[]() | ||
[]() | ||
[](https://raw.githubusercontent.com/alexanderwe/the-traveler/master/LICENSE.md) | ||
[](https://www.npmjs.com/package/the-traveler) | ||
[](https://www.npmjs.com/package/the-traveler) | ||
[](https://github.com/alexanderwe/the-traveler/blob/master/LICENSE.md) | ||
[](https://github.com/alexanderwe/the-traveler/issues) | ||
@@ -20,2 +20,3 @@ [](https://travis-ci.org/alexanderwe/the-traveler) | ||
* [Notices](#notices) | ||
* [Typescript Support](#typescript-support) | ||
* [Typical Response](#typical-response) | ||
@@ -173,4 +174,15 @@ * [Privacy](#privacy) | ||
There are some noteworthy information which could help to resolve some issues with the Destiny 2 API. | ||
### Typescript Support | ||
The npm package comes with `d.ts` files to allow autocompletion and type checking if you are using `the-traveler` within Typescript. | ||
 | ||
There are some other noteworthy information which could help to resolve some issues with the Destiny 2 API. | ||
### Typical Response | ||
@@ -177,0 +189,0 @@ |
Sorry, the diff of this file is too big to display
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
277321
13
4862
402
4
17
1
+ Added@types/caseless@0.12.5(transitive)
+ Added@types/node@22.13.9(transitive)
+ Added@types/request@2.48.12(transitive)
+ Added@types/request-promise-native@1.0.21(transitive)
+ Added@types/tough-cookie@4.0.5(transitive)
+ Addedcall-bind-apply-helpers@1.0.2(transitive)
+ Addeddunder-proto@1.0.1(transitive)
+ Addedes-define-property@1.0.1(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.1.1(transitive)
+ Addedes-set-tostringtag@2.1.0(transitive)
+ Addedform-data@2.5.3(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.3.0(transitive)
+ Addedget-proto@1.0.1(transitive)
+ Addedgopd@1.2.0(transitive)
+ Addedhas-symbols@1.1.0(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedmath-intrinsics@1.1.0(transitive)
+ Addedundici-types@6.20.0(transitive)