Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

the-traveler

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

the-traveler - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

29

build/enums.js

@@ -43,3 +43,3 @@ "use strict";

DestinyActivityModeType[DestinyActivityModeType["Strike"] = 3] = "Strike";
DestinyActivityModeType[DestinyActivityModeType["Reserved4"] = 4] = "Reserved4";
DestinyActivityModeType[DestinyActivityModeType["Raid"] = 4] = "Raid";
DestinyActivityModeType[DestinyActivityModeType["AllPvP"] = 5] = "AllPvP";

@@ -51,9 +51,9 @@ DestinyActivityModeType[DestinyActivityModeType["Patrol"] = 6] = "Patrol";

DestinyActivityModeType[DestinyActivityModeType["Reserved11"] = 11] = "Reserved11";
DestinyActivityModeType[DestinyActivityModeType["Team"] = 12] = "Team";
DestinyActivityModeType[DestinyActivityModeType["Clash"] = 12] = "Clash";
DestinyActivityModeType[DestinyActivityModeType["Reserved13"] = 13] = "Reserved13";
DestinyActivityModeType[DestinyActivityModeType["Reserved15"] = 15] = "Reserved15";
DestinyActivityModeType[DestinyActivityModeType["Nightfall"] = 16] = "Nightfall";
DestinyActivityModeType[DestinyActivityModeType["Heroic"] = 17] = "Heroic";
DestinyActivityModeType[DestinyActivityModeType["HeroicNightfall"] = 17] = "HeroicNightfall";
DestinyActivityModeType[DestinyActivityModeType["AllStrikes"] = 18] = "AllStrikes";
DestinyActivityModeType[DestinyActivityModeType["Reserved19"] = 19] = "Reserved19";
DestinyActivityModeType[DestinyActivityModeType["IronBanner"] = 19] = "IronBanner";
DestinyActivityModeType[DestinyActivityModeType["Reserved20"] = 20] = "Reserved20";

@@ -69,6 +69,7 @@ DestinyActivityModeType[DestinyActivityModeType["Reserved21"] = 21] = "Reserved21";

DestinyActivityModeType[DestinyActivityModeType["Reserved30"] = 30] = "Reserved30";
DestinyActivityModeType[DestinyActivityModeType["Supremacy"] = 31] = "Supremacy";
DestinyActivityModeType[DestinyActivityModeType["Reserved32"] = 32] = "Reserved32";
DestinyActivityModeType[DestinyActivityModeType["Survival"] = 37] = "Survival";
DestinyActivityModeType[DestinyActivityModeType["Countdown"] = 38] = "Countdown";
DestinyActivityModeType[DestinyActivityModeType["Reserved39"] = 39] = "Reserved39";
DestinyActivityModeType[DestinyActivityModeType["TrialsOfTheNine"] = 39] = "TrialsOfTheNine";
DestinyActivityModeType[DestinyActivityModeType["Social"] = 40] = "Social";

@@ -93,13 +94,13 @@ })(DestinyActivityModeType = exports.DestinyActivityModeType || (exports.DestinyActivityModeType = {}));

/**
* Enum for the Destiny membership type
* Enum for the Bungie membership type
* @enum
*/
var MembershipType;
(function (MembershipType) {
MembershipType[MembershipType["All"] = -1] = "All";
MembershipType[MembershipType["Xbox"] = 1] = "Xbox";
MembershipType[MembershipType["PSN"] = 2] = "PSN";
MembershipType[MembershipType["PC"] = 4] = "PC";
MembershipType[MembershipType["Bungie"] = 254] = "Bungie";
})(MembershipType = exports.MembershipType || (exports.MembershipType = {}));
var BungieMembershipType;
(function (BungieMembershipType) {
BungieMembershipType[BungieMembershipType["All"] = -1] = "All";
BungieMembershipType[BungieMembershipType["Xbox"] = 1] = "Xbox";
BungieMembershipType[BungieMembershipType["PSN"] = 2] = "PSN";
BungieMembershipType[BungieMembershipType["PC"] = 4] = "PC";
BungieMembershipType[BungieMembershipType["Bungie"] = 254] = "Bungie";
})(BungieMembershipType = exports.BungieMembershipType || (exports.BungieMembershipType = {}));
/**

@@ -106,0 +107,0 @@ * Enum for Destiny period type

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("es6-promise");
var querystring = require("querystring");
var rp = require("request-promise-native");
var querystring = require('querystring');
/**

@@ -7,0 +7,0 @@ * Entry class for accessing the Destiny 2 API

{
"name": "the-traveler",
"version": "0.1.7",
"version": "0.1.8",
"description": "A Node.js API wrapper for the Destiny 2 API",

@@ -5,0 +5,0 @@ "keywords": [

@@ -79,3 +79,3 @@ Table of Contents

If you want to use OAuth to also get access to endpoints which require authentications, provide the `Traveler` object with the needed OAuth `clientId` and if you are using a confidential client type the `clientSecret`.
If you want to use OAuth to get access to endpoints which require user approval provide the `Traveler` object with your OAuth `clientId` and if you are using a confidential client type additionally the `clientSecret`.

@@ -94,14 +94,13 @@ ```

Also ensure that you specify an `redirectURL` in your Application settings on [https://www.bungie.net/en/Application](https://www.bungie.net/en/Application)
After that you can generate the authentication URL which has to be visited by your users to approve your app and give it access. This follows the following schema: `https://www.bungie.net/en/OAuth/Authorize?client_id={yourClientID}&response_type=code`.
Please ensure that you specified a `redirectURL` in your application settings on [https://www.bungie.net/en/Application](https://www.bungie.net/en/Application).
After you have done that, you can generate the authentication URL which has to be visited by your users to approve your application. The URL is constructed with the following schema: `https://www.bungie.net/en/OAuth/Authorize?client_id={yourClientID}&response_type=code`.
```
const authUrl = traveler.traveler.generateOAuthURL(); // The URL your users have to visit to give your application access
```
If the users visit this site and approve your application they will be redirected to the `redirectURL` you specified, with a URL query parameter `code` appended: `https://www.example.com/?code=hereComesTheCode`
If a user visit this site and approve your application he/she will be redirected to the `redirectURL` you specified. This URL is expaned with query parameter called `code`: `https://www.example.com/?code=hereComesTheCode`
This is the code you need to get the OAuth Access token. Use it with the `getAccessToken()`
This is the code you need to obtain the OAuth Access token with the `getAccessToken()` method.

@@ -117,3 +116,3 @@ ```

The oauth response schema depends on if you are using a `public` or `confidential`client type. With a `public` type the response does **not** contain an `refresh_token`. This means that a user has to authenticate everytime again after the OAuth access token has expired. Such an response looks like this:
The OAuth response schema is depended on the client type you are using on if you are using. With a `public` type the response does **not** contain an `refresh_token`. This means that a user has to authenticate everytime again after the OAuth access token has expired.

@@ -129,3 +128,3 @@

If you are using a `confidential` client type the response will contain an `refresh_token` which can be used to get a new `access_token` without requiring the user to approve your app again. Use this `refresh_token` to prevent getting errors because the `access_token` has expired. In the following you can see such a response with the method to renew the token.
If you are using a `confidential` client type the response will contain a `refresh_token` which can be used to get a new `access_token` without requiring the user to approve your app again. Use this `refresh_token` to prevent getting errors if the `access_token` has expired. In the following you can see such a response with the method to renew the token.

@@ -157,5 +156,5 @@ _Response_:

* Grab the `code` parameter from your `redirectURL`
* Use `code` to get the `oauth Object` and apply it to the `traveler object`
* **FOR Public** Reauthenticate your users after the access token has expired, so they have to visit the `authUrl`again
* **FOR Confidential** Use `traveler.oauth.refreshtoken` to renew the `accessToken`, without user interaction
* Use `code` to get the `OAuth object` and apply it to the `Traveler object`
* **FOR Public** Reauthenticate your users after the access token has expired. They have to visit the `authorization url` again
* **FOR Confidential** Use `traveler.oauth.refreshtoken` to renew the `accessToken`, without user interaction by `traveler.refreshToken()`
* After the oauth object is set on the traveler object you can query the endpoints which require authentiation

@@ -162,0 +161,0 @@ * Keep in mind that it would be very useful to store the tokens for your users _**securely**_!

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc