Skip to content

Commit

Permalink
Bump version to v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Pupix committed Jul 25, 2018
1 parent 672fa0d commit 8b062d9
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 17 deletions.
8 changes: 5 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const electron = require('electron');
const LCUConnector = require('lcu-connector');
const createSpec = require('./createSpec');

const connector = new LCUConnector('');
const { app } = electron;
Expand All @@ -25,12 +26,13 @@ app.on('ready', () => {
mainWindow.loadURL('file://' + root + '/index.html');

// Check if dev env FIXME
//mainWindow.openDevTools();
// mainWindow.openDevTools();

// Avoid white page on load.
mainWindow.webContents.on('did-finish-load', () => {
connector.on('connect', (data) => {
mainWindow.webContents.send('lcu-load', data);
connector.on('connect', async (data) => {
const spec = await createSpec(data);
mainWindow.webContents.send('lcu-load', Object.assign(data, { spec }));
});

connector.start();
Expand Down
9 changes: 9 additions & 0 deletions app/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ html {
float: right;
}

.swagger-section .discord {
width: 28px;
height: 28px;
display: block;
background: transparent url(../images/discord.svg) 100%/100% no-repeat;
float: right;
margin: -1px 4px 0 0;
}

.swagger-section #swagger-ui-container:empty {
display: none;
}
Expand Down
21 changes: 12 additions & 9 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,25 @@

IPC.on('lcu-load', (event, data) => {

const { username, password, address, port } = data;
const { username, password, address, port, spec } = data;
const header = `Basic ${btoa(`${username}:${password}`)}`;
const auth = new SwaggerClient.ApiKeyAuthorization("Authorization", header, "header");


window.swaggerUi = new SwaggerUi({
url: `https://${username}:${password}@${address}:${port}/v2/swagger.json`,
authorizations: { riot: auth },
dom_id: "swagger-ui-container",
supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
spec,
validatorUrl: null,
authorizations: { riot: auth },
dom_id: "swagger-ui-container",
// supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
onComplete(swaggerApi, swaggerUi) {

$('pre code').each(function(i, e) {
hljs.highlightBlock(e)
});

window.swaggerUi.api.clientAuthorizations.add("riot", auth);
},
onFailure(data) {
console.log(data);
alert("Trouble loading SwaggerUI");
// REMOTE.getCurrentWindow().close();
},
Expand All @@ -64,11 +64,14 @@
});

window.swaggerUi.load();

});

function _handleGithubLink(event) {
shell.openExternal('https://github.com/pupix/rift-explorer');
shell.openExternal('https://github.com/pupix/rift-explorer');
}

function _handleDiscordLink(event) {
shell.openExternal('https://discord.gg/hPtrMcx');
}

</script>
Expand Down
4 changes: 2 additions & 2 deletions app/swagger-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ Handlebars.registerHelper('renderTextParam', function(param) {
});

this["Handlebars"]["templates"]["main"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression, buffer = " <a class=\"github\" title=\"Click to visit the official repository\" href=\"#\" onclick=\"_handleGithubLink(this);\"></a><div class=\"info_title\">"
var stack1, lambda=this.lambda, escapeExpression=this.escapeExpression, buffer = " <a class=\"github\" title=\"Click to visit the official repository\" href=\"#\" onclick=\"_handleGithubLink(this);\"></a><a class=\"discord\" title=\"Join the Discord server\" href=\"#\" onclick=\"_handleDiscordLink(this);\"></a><div class=\"info_title\">"
+ escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.title : stack1), depth0))
+ "</div>\n <div class=\"info_description markdown\">";
stack1 = lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.description : stack1), depth0);
Expand Down Expand Up @@ -25110,6 +25110,7 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
}
}


// set up the UI for input
this.model.auths = [];

Expand All @@ -25122,7 +25123,6 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
value: value
});
}

if ('validatorUrl' in opts.swaggerOptions) {
// Validator URL specified explicitly
this.model.validatorUrl = opts.swaggerOptions.validatorUrl;
Expand Down
2 changes: 1 addition & 1 deletion createSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = async ({ address, port, username, password, protocol }) => {
paths: {},
info: {
'description': 'Always up to date LCU API documentation',
'title': 'LeagueClient',
'title': 'Rift Explorer',
'version': builds.version
},
produces: [
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rift-explorer",
"version": "1.0.3",
"version": "2.0.0",
"description": "Explore the API of the League of Legends client",
"main": "app.js",
"scripts": {
Expand All @@ -10,7 +10,10 @@
"author": "Robert Manolea <[email protected]>",
"license": "MIT",
"dependencies": {
"lcu-connector": "^1.0.0"
"lcu-connector": "^1.0.0",
"request": "^2.87.0",
"request-promise": "^4.2.2",
"mixin-deep": "^2.0.0"
},
"devDependencies": {
"electron": "^1.7.11",
Expand Down
63 changes: 63 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,10 @@ locate-path@^2.0.0:
p-locate "^2.0.0"
path-exists "^3.0.0"

lodash@^4.13.1:
version "4.17.10"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7"

[email protected]:
version "1.0.2"
resolved "https://registry.yarnpkg.com/lol-lockfile-parser/-/lol-lockfile-parser-1.0.2.tgz#f42ad5fa3ad6921ca34a102ce288a0db8fd92453"
Expand Down Expand Up @@ -1393,6 +1397,10 @@ minimist@^1.1.0, minimist@^1.1.3, minimist@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"

mixin-deep@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-2.0.0.tgz#9dfd525156720ec6cbee14fcb4b968253ba358ee"

[email protected]:
version "0.5.0"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.0.tgz#1d73076a6df986cd9344e15e71fcc05a4c9abf12"
Expand Down Expand Up @@ -1678,6 +1686,10 @@ pseudomap@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"

psl@^1.1.24:
version "1.1.28"
resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.28.tgz#4fb6ceb08a1e2214d4fd4de0ca22dae13740bc7b"

punycode@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
Expand Down Expand Up @@ -1809,6 +1821,21 @@ repeating@^2.0.0:
dependencies:
is-finite "^1.0.0"

[email protected]:
version "1.1.1"
resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.1.tgz#3eee00b2c5aa83239cfb04c5700da36f81cd08b6"
dependencies:
lodash "^4.13.1"

request-promise@^4.2.2:
version "4.2.2"
resolved "https://registry.yarnpkg.com/request-promise/-/request-promise-4.2.2.tgz#d1ea46d654a6ee4f8ee6a4fea1018c22911904b4"
dependencies:
bluebird "^3.5.0"
request-promise-core "1.1.1"
stealthy-require "^1.1.0"
tough-cookie ">=2.3.3"

[email protected]:
version "2.81.0"
resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0"
Expand Down Expand Up @@ -1863,6 +1890,31 @@ request@^2.45.0:
tunnel-agent "^0.6.0"
uuid "^3.1.0"

request@^2.87.0:
version "2.87.0"
resolved "https://registry.yarnpkg.com/request/-/request-2.87.0.tgz#32f00235cd08d482b4d0d68db93a829c0ed5756e"
dependencies:
aws-sign2 "~0.7.0"
aws4 "^1.6.0"
caseless "~0.12.0"
combined-stream "~1.0.5"
extend "~3.0.1"
forever-agent "~0.6.1"
form-data "~2.3.1"
har-validator "~5.0.3"
http-signature "~1.2.0"
is-typedarray "~1.0.0"
isstream "~0.1.2"
json-stringify-safe "~5.0.1"
mime-types "~2.1.17"
oauth-sign "~0.8.2"
performance-now "^2.1.0"
qs "~6.5.1"
safe-buffer "^5.1.1"
tough-cookie "~2.3.3"
tunnel-agent "^0.6.0"
uuid "^3.1.0"

require-directory@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
Expand Down Expand Up @@ -1991,6 +2043,10 @@ stat-mode@^0.2.2:
version "0.2.2"
resolved "https://registry.yarnpkg.com/stat-mode/-/stat-mode-0.2.2.tgz#e6c80b623123d7d80cf132ce538f346289072502"

stealthy-require@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b"

string-width@^1.0.1, string-width@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
Expand Down Expand Up @@ -2122,6 +2178,13 @@ timed-out@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f"

tough-cookie@>=2.3.3:
version "2.4.3"
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781"
dependencies:
psl "^1.1.24"
punycode "^1.4.1"

tough-cookie@~2.3.0, tough-cookie@~2.3.3:
version "2.3.3"
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.3.tgz#0b618a5565b6dea90bf3425d04d55edc475a7561"
Expand Down

0 comments on commit 8b062d9

Please sign in to comment.