diff --git a/src/parser/GESI.cr b/src/parser/GESI.cr index 79aacd6..b642bc9 100644 --- a/src/parser/GESI.cr +++ b/src/parser/GESI.cr @@ -5,7 +5,7 @@ base = EveSwagger.load # Save the function list File.open("#{EveSwagger::DIST_DIR}/functions.ts", "w") do |file| - base.endpoints.join("\n", file) { |endpoint, io| endpoint.to_function io } + base.endpoints.join(file, "\n") { |endpoint, io| endpoint.to_function io } end # Save the endpoint list diff --git a/src/parser/eve_swagger.cr b/src/parser/eve_swagger.cr index 41e4e9b..68d0f9f 100644 --- a/src/parser/eve_swagger.cr +++ b/src/parser/eve_swagger.cr @@ -2,7 +2,7 @@ require "json" require "http/client" module EveSwagger - DIST_DIR = "../script" + DIST_DIR = "../script/src" # Base url for the swagger spec ESI_HOST = "https://esi.evetech.net" IGNORE_PARAMS = %w(user_agent X-User-Agent token If-None-Match Accept-Language datasource) @@ -139,11 +139,11 @@ module EveSwagger io.puts "/**" io.puts " * #{@description}" io.puts " *" - parameters.join("", io) { |param, join_io| param.to_doc_s join_io } + parameters.join(io, "") { |param, join_io| param.to_doc_s join_io } io.puts " * @customfunction" io.puts " */" io << "function #{@name}(" - parameters.join(", ", io) { |param, join_io| param.to_s join_io } + parameters.join(io, ", ") { |param, join_io| param.to_s join_io } io.puts "): SheetsArray {" parameters.each do |p| @@ -152,7 +152,7 @@ module EveSwagger io << " return invoke('#{@name}', { " - parameters.join(", ", io) { |param, join_io| param.name.to_s join_io } + parameters.join(io, ", ") { |param, join_io| param.name.to_s join_io } io << " });" @@ -193,9 +193,6 @@ module EveSwagger endpoint_name = route.operation_id.gsub(/^post_|^get_|_id/, "") - # Rename search endpoint to not conflict with Sheets' `Search` function - endpoint_name = "eve_search" if endpoint_name == "search" - # Rename universes to universe_ids due to regex matching `_ids` endpoint_name = "universe_ids" if endpoint_name == "universes" diff --git a/src/script/src/endpoints.ts b/src/script/src/endpoints.ts index 6460a0c..ff7cc5c 100644 --- a/src/script/src/endpoints.ts +++ b/src/script/src/endpoints.ts @@ -4171,106 +4171,6 @@ function getEndpoints(): IEndpointList { "summary": "Get effect information", "version": "v2" }, - "eve_search": { - "description": "Search for entities that match a given sub-string.", - "headers": [ - { - "name": "agent", - "sub_headers": [ - "agent_agents" - ] - }, - { - "name": "alliance", - "sub_headers": [ - "alliance_alliances" - ] - }, - { - "name": "character", - "sub_headers": [ - "character_characters" - ] - }, - { - "name": "constellation", - "sub_headers": [ - "constellation_constellations" - ] - }, - { - "name": "corporation", - "sub_headers": [ - "corporation_corporations" - ] - }, - { - "name": "faction", - "sub_headers": [ - "faction_factions" - ] - }, - { - "name": "inventory_type", - "sub_headers": [ - "inventory_types" - ] - }, - { - "name": "region", - "sub_headers": [ - "region_regions" - ] - }, - { - "name": "solar_system", - "sub_headers": [ - "solar_systems" - ] - }, - { - "name": "station", - "sub_headers": [ - "station_stations" - ] - } - ], - "method": "get", - "paginated": false, - "parameters": [ - { - "description": "The string to search on", - "in": "query", - "name": "search", - "type": "string", - "required": true - }, - { - "description": "Type of entities to search for", - "in": "query", - "name": "categories", - "type": "string[]", - "required": true - }, - { - "description": "Language to use in the response, takes precedence over Accept-Language", - "in": "query", - "name": "language", - "type": "string", - "required": false - }, - { - "description": "Whether the search should be a strict match", - "in": "query", - "name": "strict", - "type": "boolean", - "required": false - } - ], - "path": "/{version}/search/", - "summary": "Search on a string", - "version": "v2" - }, "eve_status": { "description": "EVE Server status", "headers": [ diff --git a/src/script/src/functions.ts b/src/script/src/functions.ts index c38cfec..302b00b 100644 --- a/src/script/src/functions.ts +++ b/src/script/src/functions.ts @@ -1404,23 +1404,6 @@ function dogma_effects_effect(effect_id: number, show_column_headings: boolean = return invoke('dogma_effects_effect', { effect_id, show_column_headings, version }); } -/** - * Search for entities that match a given sub-string. - * - * @param {string} search - The string to search on - * @param {string|string[]} categories - Type of entities to search for - * @param {string} language - Language to use in the response, takes precedence over Accept-Language - * @param {boolean} strict - Whether the search should be a strict match - * @param {boolean} show_column_headings - If column headings should be shown. - * @param {string} version - Which ESI version to use for the request. - * @customfunction - */ -function eve_search(search: string, categories: string|string[], language?: string, strict?: boolean, show_column_headings: boolean = true, version: string = "v2"): SheetsArray { - if (!search) throw new Error(`search is required.`); - if (!categories) throw new Error(`categories is required.`); - return invoke('eve_search', { search, categories, language, strict, show_column_headings, version }); -} - /** * EVE Server status *