Skip to content

Commit

Permalink
fix: Hopefully last attempt to make this work.
Browse files Browse the repository at this point in the history
  • Loading branch information
KararTY committed Jul 30, 2020
1 parent 1678424 commit fecc934
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 26 deletions.
2 changes: 1 addition & 1 deletion dist/TwitchAuth.d.ts
Expand Up @@ -23,7 +23,7 @@ export interface TwitchValidateBody {
scopes: string[];
user_id: string;
}
export default class Client {
export default class TwitchAuth {
private readonly token;
private readonly secret;
private readonly redirectURI;
Expand Down
18 changes: 9 additions & 9 deletions dist/TwitchAuth.js
Expand Up @@ -52,16 +52,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
exports.__esModule = true;
var got_1 = __importDefault(require("got"));
var standalone_1 = require("@adonisjs/logger/build/standalone");
var Client = /** @class */ (function () {
function Client(config, loggerLevel) {
var TwitchAuth = /** @class */ (function () {
function TwitchAuth(config, loggerLevel) {
this.token = config.clientToken;
this.secret = config.clientSecret;
this.redirectURI = config.redirectURI;
this.scopes = config.scopes.join(' ');
this.headers = config.headers;
this.logger = new standalone_1.Logger({ enabled: true, name: 'befriendly-shared', level: loggerLevel });
}
Client.prototype.requestToken = function (code) {
TwitchAuth.prototype.requestToken = function (code) {
return __awaiter(this, void 0, void 0, function () {
var searchParams, body, error_1;
return __generator(this, function (_a) {
Expand Down Expand Up @@ -95,7 +95,7 @@ var Client = /** @class */ (function () {
});
});
};
Client.prototype.getUser = function (token, usernames) {
TwitchAuth.prototype.getUser = function (token, usernames) {
return __awaiter(this, void 0, void 0, function () {
var body, error_2;
return __generator(this, function (_a) {
Expand Down Expand Up @@ -124,7 +124,7 @@ var Client = /** @class */ (function () {
});
});
};
Client.prototype.refreshToken = function (token) {
TwitchAuth.prototype.refreshToken = function (token) {
return __awaiter(this, void 0, void 0, function () {
var searchParams, body, error_3;
return __generator(this, function (_a) {
Expand Down Expand Up @@ -157,7 +157,7 @@ var Client = /** @class */ (function () {
});
});
};
Client.prototype.validateToken = function (token) {
TwitchAuth.prototype.validateToken = function (token) {
return __awaiter(this, void 0, void 0, function () {
var body, error_4;
return __generator(this, function (_a) {
Expand All @@ -180,7 +180,7 @@ var Client = /** @class */ (function () {
});
});
};
Client.prototype.authorizationURL = function (csrfToken) {
TwitchAuth.prototype.authorizationURL = function (csrfToken) {
var url = 'https://id.twitch.tv/oauth2/authorize?response_type=code';
url += "&client_id=" + this.token;
url += "&redirect_uri=" + this.redirectURI;
Expand All @@ -189,6 +189,6 @@ var Client = /** @class */ (function () {
url += "&state=" + csrfToken;
return url;
};
return Client;
return TwitchAuth;
}());
exports["default"] = Client;
exports["default"] = TwitchAuth;
2 changes: 1 addition & 1 deletion dist/index.d.ts
@@ -1,2 +1,2 @@
export * from './MessageType';
export * as TwitchAuth from './TwitchAuth';
export * from './TwitchAuth';
14 changes: 1 addition & 13 deletions dist/index.js
Expand Up @@ -6,21 +6,9 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
exports.__esModule = true;
__exportStar(require("./MessageType"), exports);
exports.TwitchAuth = __importStar(require("./TwitchAuth"));
__exportStar(require("./TwitchAuth"), exports);
2 changes: 1 addition & 1 deletion src/TwitchAuth.ts
Expand Up @@ -29,7 +29,7 @@ export interface TwitchValidateBody {
user_id: string
}

export default class Client {
export default class TwitchAuth {
private readonly token: string
private readonly secret: string
private readonly redirectURI: string
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
@@ -1,2 +1,2 @@
export * from './MessageType'
export * as TwitchAuth from './TwitchAuth'
export * from './TwitchAuth'

0 comments on commit fecc934

Please sign in to comment.