Skip to content

Commit 8b062d9

Browse files
committed
Bump version to v2.0.0
1 parent 672fa0d commit 8b062d9

File tree

7 files changed

+97
-17
lines changed

7 files changed

+97
-17
lines changed

app.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const electron = require('electron');
22
const LCUConnector = require('lcu-connector');
3+
const createSpec = require('./createSpec');
34

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

2728
// Check if dev env FIXME
28-
//mainWindow.openDevTools();
29+
// mainWindow.openDevTools();
2930

3031
// Avoid white page on load.
3132
mainWindow.webContents.on('did-finish-load', () => {
32-
connector.on('connect', (data) => {
33-
mainWindow.webContents.send('lcu-load', data);
33+
connector.on('connect', async (data) => {
34+
const spec = await createSpec(data);
35+
mainWindow.webContents.send('lcu-load', Object.assign(data, { spec }));
3436
});
3537

3638
connector.start();

app/css/style.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ html {
1212
float: right;
1313
}
1414

15+
.swagger-section .discord {
16+
width: 28px;
17+
height: 28px;
18+
display: block;
19+
background: transparent url(../images/discord.svg) 100%/100% no-repeat;
20+
float: right;
21+
margin: -1px 4px 0 0;
22+
}
23+
1524
.swagger-section #swagger-ui-container:empty {
1625
display: none;
1726
}

app/index.html

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,25 @@
3434

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

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

41+
4142
window.swaggerUi = new SwaggerUi({
42-
url: `https://${username}:${password}@${address}:${port}/v2/swagger.json`,
43-
authorizations: { riot: auth },
44-
dom_id: "swagger-ui-container",
45-
supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
43+
spec,
44+
validatorUrl: null,
45+
authorizations: { riot: auth },
46+
dom_id: "swagger-ui-container",
47+
// supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
4648
onComplete(swaggerApi, swaggerUi) {
47-
4849
$('pre code').each(function(i, e) {
4950
hljs.highlightBlock(e)
5051
});
5152

5253
window.swaggerUi.api.clientAuthorizations.add("riot", auth);
5354
},
5455
onFailure(data) {
55-
console.log(data);
5656
alert("Trouble loading SwaggerUI");
5757
// REMOTE.getCurrentWindow().close();
5858
},
@@ -64,11 +64,14 @@
6464
});
6565

6666
window.swaggerUi.load();
67-
6867
});
6968

7069
function _handleGithubLink(event) {
71-
shell.openExternal('https://github.com/pupix/rift-explorer');
70+
shell.openExternal('https://github.com/pupix/rift-explorer');
71+
}
72+
73+
function _handleDiscordLink(event) {
74+
shell.openExternal('https://discord.gg/hPtrMcx');
7275
}
7376

7477
</script>

app/swagger-ui.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ Handlebars.registerHelper('renderTextParam', function(param) {
295295
});
296296

297297
this["Handlebars"]["templates"]["main"] = Handlebars.template({"1":function(depth0,helpers,partials,data) {
298-
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\">"
298+
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\">"
299299
+ escapeExpression(lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.title : stack1), depth0))
300300
+ "</div>\n <div class=\"info_description markdown\">";
301301
stack1 = lambda(((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.description : stack1), depth0);
@@ -25110,6 +25110,7 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
2511025110
}
2511125111
}
2511225112

25113+
2511325114
// set up the UI for input
2511425115
this.model.auths = [];
2511525116

@@ -25122,7 +25123,6 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
2512225123
value: value
2512325124
});
2512425125
}
25125-
2512625126
if ('validatorUrl' in opts.swaggerOptions) {
2512725127
// Validator URL specified explicitly
2512825128
this.model.validatorUrl = opts.swaggerOptions.validatorUrl;

createSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module.exports = async ({ address, port, username, password, protocol }) => {
2525
paths: {},
2626
info: {
2727
'description': 'Always up to date LCU API documentation',
28-
'title': 'LeagueClient',
28+
'title': 'Rift Explorer',
2929
'version': builds.version
3030
},
3131
produces: [

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rift-explorer",
3-
"version": "1.0.3",
3+
"version": "2.0.0",
44
"description": "Explore the API of the League of Legends client",
55
"main": "app.js",
66
"scripts": {
@@ -10,7 +10,10 @@
1010
"author": "Robert Manolea <[email protected]>",
1111
"license": "MIT",
1212
"dependencies": {
13-
"lcu-connector": "^1.0.0"
13+
"lcu-connector": "^1.0.0",
14+
"request": "^2.87.0",
15+
"request-promise": "^4.2.2",
16+
"mixin-deep": "^2.0.0"
1417
},
1518
"devDependencies": {
1619
"electron": "^1.7.11",

yarn.lock

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,6 +1288,10 @@ locate-path@^2.0.0:
12881288
p-locate "^2.0.0"
12891289
path-exists "^3.0.0"
12901290

1291+
lodash@^4.13.1:
1292+
version "4.17.10"
1293+
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7"
1294+
12911295
12921296
version "1.0.2"
12931297
resolved "https://registry.yarnpkg.com/lol-lockfile-parser/-/lol-lockfile-parser-1.0.2.tgz#f42ad5fa3ad6921ca34a102ce288a0db8fd92453"
@@ -1393,6 +1397,10 @@ minimist@^1.1.0, minimist@^1.1.3, minimist@^1.2.0:
13931397
version "1.2.0"
13941398
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
13951399

1400+
mixin-deep@^2.0.0:
1401+
version "2.0.0"
1402+
resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-2.0.0.tgz#9dfd525156720ec6cbee14fcb4b968253ba358ee"
1403+
13961404
13971405
version "0.5.0"
13981406
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.0.tgz#1d73076a6df986cd9344e15e71fcc05a4c9abf12"
@@ -1678,6 +1686,10 @@ pseudomap@^1.0.2:
16781686
version "1.0.2"
16791687
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
16801688

1689+
psl@^1.1.24:
1690+
version "1.1.28"
1691+
resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.28.tgz#4fb6ceb08a1e2214d4fd4de0ca22dae13740bc7b"
1692+
16811693
punycode@^1.4.1:
16821694
version "1.4.1"
16831695
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
@@ -1809,6 +1821,21 @@ repeating@^2.0.0:
18091821
dependencies:
18101822
is-finite "^1.0.0"
18111823

1824+
1825+
version "1.1.1"
1826+
resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.1.tgz#3eee00b2c5aa83239cfb04c5700da36f81cd08b6"
1827+
dependencies:
1828+
lodash "^4.13.1"
1829+
1830+
request-promise@^4.2.2:
1831+
version "4.2.2"
1832+
resolved "https://registry.yarnpkg.com/request-promise/-/request-promise-4.2.2.tgz#d1ea46d654a6ee4f8ee6a4fea1018c22911904b4"
1833+
dependencies:
1834+
bluebird "^3.5.0"
1835+
request-promise-core "1.1.1"
1836+
stealthy-require "^1.1.0"
1837+
tough-cookie ">=2.3.3"
1838+
18121839
18131840
version "2.81.0"
18141841
resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0"
@@ -1863,6 +1890,31 @@ request@^2.45.0:
18631890
tunnel-agent "^0.6.0"
18641891
uuid "^3.1.0"
18651892

1893+
request@^2.87.0:
1894+
version "2.87.0"
1895+
resolved "https://registry.yarnpkg.com/request/-/request-2.87.0.tgz#32f00235cd08d482b4d0d68db93a829c0ed5756e"
1896+
dependencies:
1897+
aws-sign2 "~0.7.0"
1898+
aws4 "^1.6.0"
1899+
caseless "~0.12.0"
1900+
combined-stream "~1.0.5"
1901+
extend "~3.0.1"
1902+
forever-agent "~0.6.1"
1903+
form-data "~2.3.1"
1904+
har-validator "~5.0.3"
1905+
http-signature "~1.2.0"
1906+
is-typedarray "~1.0.0"
1907+
isstream "~0.1.2"
1908+
json-stringify-safe "~5.0.1"
1909+
mime-types "~2.1.17"
1910+
oauth-sign "~0.8.2"
1911+
performance-now "^2.1.0"
1912+
qs "~6.5.1"
1913+
safe-buffer "^5.1.1"
1914+
tough-cookie "~2.3.3"
1915+
tunnel-agent "^0.6.0"
1916+
uuid "^3.1.0"
1917+
18661918
require-directory@^2.1.1:
18671919
version "2.1.1"
18681920
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
@@ -1991,6 +2043,10 @@ stat-mode@^0.2.2:
19912043
version "0.2.2"
19922044
resolved "https://registry.yarnpkg.com/stat-mode/-/stat-mode-0.2.2.tgz#e6c80b623123d7d80cf132ce538f346289072502"
19932045

2046+
stealthy-require@^1.1.0:
2047+
version "1.1.1"
2048+
resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b"
2049+
19942050
string-width@^1.0.1, string-width@^1.0.2:
19952051
version "1.0.2"
19962052
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
@@ -2122,6 +2178,13 @@ timed-out@^4.0.0:
21222178
version "4.0.1"
21232179
resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f"
21242180

2181+
tough-cookie@>=2.3.3:
2182+
version "2.4.3"
2183+
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781"
2184+
dependencies:
2185+
psl "^1.1.24"
2186+
punycode "^1.4.1"
2187+
21252188
tough-cookie@~2.3.0, tough-cookie@~2.3.3:
21262189
version "2.3.3"
21272190
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.3.tgz#0b618a5565b6dea90bf3425d04d55edc475a7561"

0 commit comments

Comments
 (0)