Skip to content

Commit

Permalink
Merge pull request #46 from Blacksmoke16/concurrent-requests
Browse files Browse the repository at this point in the history
Concurrent requests
  • Loading branch information
Blacksmoke16 authored Jan 15, 2019
2 parents 2bd5486 + 4bfc7fe commit 0bc7d67
Show file tree
Hide file tree
Showing 8 changed files with 262 additions and 232 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea/
node_modules/
package-lock.json
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MIT License
The MIT License (MIT)

Copyright (c) 2019 Blacksmoke16

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Google Sheets add-on for interacting with EVE ESI API.

## Setup:

1. Install the add-on [HERE](https://chrome.google.com/webstore/detail/gesi/haaceilfjgofjglobglglnafgnjbekoc?utm_source=permalink).
1. Install the add-on [HERE](https://gsuite.google.com/marketplace/app/gesi/337869328721).
2. Give the script access to what it needs.
3. There will now be a GESI option under the `Add-Ons` option in the menu bar. Click it and then click `GESI => Authorize Characters`.
4. Click the EVE SSO button in the modal. Login => select what character you want to authorize => Authorize.
Expand Down
Binary file modified bin/GESI-linux-x86_64
Binary file not shown.
15 changes: 11 additions & 4 deletions src/parser/eve_swagger.cr
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ module EveSwagger

# Extract the endpoint version and replace with placeholder to allow user to define what version they wish to use
version = path_url.match(/\/(v\d)\//).not_nil![1]
path_url = path_url.sub(/v\d/,"{version}")
path_url = path_url.sub(/v\d/, "{version}")

@endpoints[endpoint_name] = EndpointObj.new(
responses.get.nil? ? "POST" : "GET",
Expand Down Expand Up @@ -123,7 +123,7 @@ module EveSwagger
str << " * @customfunction\n"
str << " */\n"
str << "function #{endpoint_name}(#{endpoint_data.parameters.map { |p| "#{p.name}: #{p.type}" }.join(", ")}): any[][] {\n"
endpoint_data.parameters.each { |p| str << " if(!#{p.name}) throw '#{p.name} is required';\n" if p.required }
endpoint_data.parameters.each { |p| str << " if(!#{p.name}) throw buildError_({body: '#{p.name} is required', code: 400, method: '#{endpoint_name}'});\n" if p.required }
str << " return parseData_('#{endpoint_name}',{#{endpoint_data.parameters.map { |p| "#{p.name}:#{p.name}" }.join(',')}})\n"
str << "}\n\n"
end
Expand Down Expand Up @@ -291,7 +291,7 @@ module EveSwagger
@parameters << Parameter.from_json({name: "version", in: "path", type: "string", description: "Which ESI version to use for the request. Default: Current ESI latest stable version."}.to_json) unless EveSwagger.rejected_params.includes? "version"
end

private def get_headers(schema : Schema | Nil)
private def get_headers(schema : Schema?)
headers = [] of Header

return headers if schema.nil?
Expand All @@ -309,7 +309,6 @@ module EveSwagger
end
else
# of single type
title = items.title
if title = items.title
headers << Header.new(title.includes?('_') ? title.match(/.*_(.*)_200_ok/).not_nil![1].chomp('s') + "_ids" : title + 's')
end
Expand All @@ -323,6 +322,14 @@ module EveSwagger
sub_headers = v.properties.not_nil!.keys if v.type == "object"
headers << Header.new(k, sub_headers)
end
else
if schema.description == "200 ok integer"
title = schema.title.match(/.*_(\w+_\w+)_ok$/).not_nil![1]
title = title.sub("s_", '_')
else
title = schema.description.underscore.sub(' ', '_')
end
headers << Header.new(title)
end
headers.sort_by! { |h| h.name }
end
Expand Down
12 changes: 10 additions & 2 deletions src/script/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1903,7 +1903,11 @@ const ENDPOINTS = {
},
"characters_character_wallet": {
"description": "Returns a character's wallet balance",
"headers": [],
"headers": [
{
"name": "wallet_balance"
}
],
"method": "GET",
"path": "/{version}/characters/{character_id}/wallet/",
"parameters": [
Expand Down Expand Up @@ -3368,7 +3372,11 @@ const ENDPOINTS = {
},
"corporations_corporation_members_limit": {
"description": "Return a corporation's member limit, not including CEO himself",
"headers": [],
"headers": [
{
"name": "member_limit"
}
],
"method": "GET",
"path": "/{version}/corporations/{corporation_id}/members/limit/",
"parameters": [
Expand Down
140 changes: 70 additions & 70 deletions src/script/functions.ts

Large diffs are not rendered by default.

Loading

0 comments on commit 0bc7d67

Please sign in to comment.