{"version":3,"sources":["/home/runner/work/xivapi-js/xivapi-js/dist/index.cjs","../src/utils.ts","../src/lib/assets.ts","../src/lib/sheets.ts","../src/lib/versions.ts","../src/index.ts"],"names":["SchemaFormat","SchemaLanguage"],"mappings":"AAAA;ACEO,IAAM,SAAA,EAAW,4BAAA;AAEjB,IAAM,YAAA,EAAN,MAAA,QAA0B,MAAM;AAAA,EACtC,WAAA,CAAY,OAAA,EAAiB,KAAA,EAAsB,IAAA,EAAM;AACxD,IAAA,KAAA,CAAM,CAAA;AACN,IAAA,KAAA,CAAM,iBAAA,CAAkB,IAAA,EAAM,IAAA,CAAK,WAAW,CAAA;AAC9C,IAAA,IAAA,CAAK,KAAA,EAAO,KAAA,GAAQ,aAAA;AACpB,IAAA,IAAA,CAAK,QAAA,EAAU,OAAA;AAAA,EAChB;AACD,CAAA;AAUO,IAAM,QAAA,EAAU,MAAA,CAAO,OAAA,EAAA,GAAqD;AAClF,EAAA,MAAM,EAAE,IAAA,EAAM,MAAA,EAAQ,QAAQ,EAAA,EAAI,OAAA;AAElC,EAAA,GAAA,CAAI,iBAAC,OAAA,2BAAS,UAAA,mBAAW,MAAA,6BAAQ,UAAA,IAAY,KAAA,CAAA,EAAW;AACrD,IAAA,OAAA,CAAS,QAAA,EAAU,OAAA,iBAAQ,MAAA,6BAAQ,SAAO,CAAA;AAC1C,IAAA,uBAAO,MAAA,oCAAQ,SAAA;AAAA,EAClB;AAEA,EAAA,MAAM,IAAA,EAAM,IAAI,GAAA,CAAI,KAAA,WAAgB,IAAA,EAAM,IAAA,CAAK,QAAA,CAAS,EAAA,EAAI,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,EAAE,CAAA,EAAG,QAAQ,CAAA;AAC9F,EAAA,GAAA,CAAI,MAAA,EAAQ;AACX,IAAA,MAAM,MAAA,EAAgC,EAAE,KAAA,EAAO,GAAA,EAAK,MAAA,EAAQ,GAAA,EAAK,SAAA,EAAW,IAAI,CAAA;AAChF,IAAA,IAAA,CAAA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"import type { Models, XIVAPI } from \".\"\n\nexport const endpoint = \"https://v2.xivapi.com/api/\"\n\nexport class CustomError extends Error {\n\tconstructor(message: string, name: string | null = null) {\n\t\tsuper()\n\t\tError.captureStackTrace(this, this.constructor)\n\t\tthis.name = name || \"XIVAPIError\"\n\t\tthis.message = message\n\t}\n}\n\nexport interface RequestPayload {\n  path: string | URL;\n  data?: unknown;\n  params?: Record<string, unknown>;\n  errors?: Models.ErrorResponse[];\n  options?: XIVAPI.Options;\n}\n\nexport const request = async (payload: RequestPayload): Promise<RequestPayload> => {\n\tconst { path, params, options } = payload\n\n\tif (!options?.verbose && params?.verbose !== undefined) {\n    options!.verbose = Boolean(params?.verbose)\n    delete params?.verbose\n\t}\n\n\tconst url = new URL(path instanceof URL ? path.toString() : path.replace(/^\\/+/, \"\"), endpoint)\n\tif (params) {\n\t\tconst array: Record<string, string> = { query: \" \", fields: \",\", transient: \",\" }\n\t\tfor (const key in array) {\n\t\t\tif (Object.prototype.hasOwnProperty.call(params, key) && Array.isArray(params[key])) {\n\t\t\t\tparams[key] = (params[key] as string[]).join(array[key])\n\t\t\t}\n\t\t}\n\n\t\turl.search = new URLSearchParams(params as Record<string, string>).toString()\n\n\t\tif (!params.language) {\n\t\t\tif (options && options.language) url.searchParams.set(\"language\", options.language)\n\t\t}\n\n\t\tif (!params.version) {\n\t\t\tif (options && options.version) url.searchParams.set(\"version\", options.version)\n\t\t}\n\t}\n\n\tconst response = await fetch(url)\n\tif (options && options.verbose) console.debug(`Requesting ${path} with params:`, params)\n\n\tif (response.ok) {\n\t\tconst contentType = response.headers.get(\"content-type\")\n\t\tif (contentType && contentType.includes(\"application/json\")) {\n\t\t\tpayload.data = await response.json()\n\t\t} else {\n\t\t\tpayload.data = Buffer.from(await response.arrayBuffer())\n\t\t}\n\t} else {\n\t\tpayload.errors = [(await response.json()) as Models.ErrorResponse]\n\t}\n\n\tif (options && options.verbose)\n\t\tconsole.debug(`${response.ok ? \"Success\" : \"Error\"} on ${path} with params:`, params)\n\n\treturn payload\n}\n","import type { Models } from \"..\"\nimport { CustomError, request } from \"../utils\"\n\n/**\n * Endpoints for accessing game data on a file-by-file basis. Commonly useful for fetching icons or other textures to display on the web.\n * @see https://v2.xivapi.com/api/docs#tag/assets\n */\nexport class Assets {\n\t/**\n   * Read an asset from the game at the specified path, converting it into a usable format. If no valid conversion between the game file type and specified format exists, an error will be returned.\n   * @param {Models.AssetQuery} params Query parameters accepted by the asset endpoint.\n   * @returns {Promise<Buffer>} An image of the asset.\n   * @see https://v2.xivapi.com/api/docs#tag/assets/get/asset\n   */\n\tasync get(params: Models.AssetQuery): Promise<Buffer> {\n\t\tconst { data, errors } = await request({ path: \"/asset\", params: params as unknown as Record<string, unknown> })\n\t\tif (errors) throw new CustomError(errors[0].message)\n\t\treturn data as Buffer\n\t}\n\n\t/**\n   * Retrieve the specified map, composing it from split source files if necessary.\n   * @param {Models.MapPath & Models.VersionQuery & Models.AssetQuery} params\n   * @returns {Promise<Buffer>} An image of the map.\n   * @see https://v2.xivapi.com/api/docs#tag/assets/get/asset/map/{territory}/{index}\n   */\n\tasync map(\n\t\tparams: Models.MapPath & Models.VersionQuery & Pick<Models.AssetQuery, \"format\">\n\t): Promise<Buffer> {\n\t\tconst { data, errors } = await request({ path: \"/asset/map\", params: params as unknown as Record<string, unknown> })\n\t\tif (errors) throw new CustomError(errors[0].message)\n\t\treturn data as Buffer\n\t}\n}\n","import type { Models, XIVAPI } from \"..\"\nimport { CustomError, request } from \"../utils\"\n\nexport class Sheet<T extends Models.SchemaSpecifier> {\n\tprivate readonly type: T\n\n\tconstructor(sheet: T) {\n\t\tthis.type = sheet\n\t}\n\n\t/**\n   * Gets a single row from the sheet.\n   * @param {string | number} id The row to fetch.\n   * @param {Models.RowReaderQuery} [params] The parameters to fetch the row with.\n   * @returns {Promise<Models.RowResponse>} A single row with typed fields.\n   * @see https://v2.xivapi.com/api/docs#tag/sheets/get/sheet/{sheet}/{row}\n   */\n\tpublic get(\n\t\tid: string | number,\n\t\tparams: Models.RowReaderQuery = {}\n\t): Promise<Models.RowResponse> {\n\t\ttry {\n\t\t\tif (typeof id !== \"string\") id = id.toString()\n\t\t\treturn new Sheets().get(this.type, id, params)\n\t\t} catch (error) {\n\t\t\tthrow new CustomError(error instanceof Error ? error.message : \"Unknown error\")\n\t\t}\n\t}\n\n\t/**\n   * Gets a list of rows from the sheet.\n   * @param {Models.SheetQuery} [params] The parameters to fetch the rows with.\n   * @returns {Promise<Models.SheetResponse>} A list of rows with typed fields.\n   * @see https://v2.xivapi.com/api/docs#tag/sheets/get/sheet/{sheet}\n   */\n\tpublic list(params: Models.SheetQuery = {}): Promise<Models.SheetResponse> {\n\t\ttry {\n\t\t\treturn new Sheets().list(this.type, params)\n\t\t} catch (error) {\n\t\t\tthrow new CustomError(error instanceof Error ? error.message : \"Unknown error\")\n\t\t}\n\t}\n}\n\nexport class Sheets {\n\tprivate readonly options: XIVAPI.Options\n\n\t/**\n   * Endpoints for reading data from the game's static relational data store.\n   * @param {XIVAPI.Options} [options] The options to fetch the sheets with.\n   * @see https://v2.xivapi.com/api/docs#tag/sheets\n   */\n\tpublic constructor(\n\t\toptions: XIVAPI.Options = {\n\t\t\tlanguage: \"en\",\n\t\t\tverbose: false,\n\t\t}\n\t) {\n\t\tthis.options = options\n\t}\n\n\t/**\n   * List known excel sheets that can be read by the API.\n   * @returns {Promise<Models.ListResponse>} Response structure for the list endpoint.\n   * @see https://v2.xivapi.com/api/docs#tag/sheets/get/sheet\n   */\n\tasync all(): Promise<Models.ListResponse> {\n\t\tconst { data, errors } = await request({ path: \"/sheet\", params: {}, options: this.options })\n\t\tif (errors) throw new CustomError(errors[0].message)\n\t\treturn data as Models.ListResponse\n\t}\n\n\t/**\n   * Read information about one or more rows and their related data.\n   * @param {Models.SchemaSpecifier} sheet The sheet to fetch the rows from.\n   * @param {Models.SheetQuery} [params] The parameters to fetch the rows with.\n   * @returns {Promise<Models.SheetResponse>} A list of rows with typed fields.\n   * @see https://v2.xivapi.com/api/docs#tag/sheets/get/sheet/{sheet}\n   */\n\tasync list(\n\t\tsheet: Models.SchemaSpecifier,\n\t\tparams: Models.SheetQuery = {}\n\t): Promise<Models.SheetResponse> {\n\t\tconst { data, errors } = await request({\n\t\t\tpath: `/sheet/${sheet}`,\n\t\t\tparams: params as Record<string, unknown>,\n\t\t\toptions: this.options,\n\t\t})\n\t\tif (errors) throw new CustomError(errors[0].message)\n\t\treturn data as Models.SheetResponse\n\t}\n\n\t/**\n   * Read detailed, filterable information from a single sheet row and its related data.\n   * @param {Models.SchemaSpecifier} sheet Name of the sheet to read.\n   * @param {Models.RowSpecifier} row Row to read.\n   * @returns {Promise<Models.RowResponse>} A list of rows with typed fields.\n   * @see https://v2.xivapi.com/api/docs#tag/sheets/get/sheet/{sheet}/{id}\n   */\n\tasync get(\n\t\tsheet: Models.SchemaSpecifier,\n\t\trow: Models.RowSpecifier,\n\t\tparams: Models.RowReaderQuery = {}\n\t): Promise<Models.RowResponse> {\n\t\tconst { data, errors } = await request({\n\t\t\tpath: `/sheet/${sheet}/${row}`,\n\t\t\tparams: params as Record<string, unknown>,\n\t\t\toptions: this.options,\n\t\t})\n\t\tif (errors) throw new CustomError(errors[0].message)\n\t\treturn data as Models.RowResponse\n\t}\n}\n","import type { Models } from \"..\"\nimport { CustomError, request } from \"../utils\"\n\n/**\n * Endpoints for querying metadata about the versions recorded by the boilmaster system.\n * @see https://v2.xivapi.com/api/docs#tag/versions\n */\nexport class Versions {\n\t/**\n   * List versions understood by the API.\n   * @see https://v2.xivapi.com/api/docs#tag/versions/get/version\n   */\n\tasync all(): Promise<Models.VersionsResponse> {\n\t\tconst { data, errors } = await request({ path: \"/version\", params: {} })\n\t\tif (errors) throw new CustomError(errors[0].message)\n\t\treturn data as Models.VersionsResponse\n\t}\n}\n","import { Assets, Sheet, Sheets, Versions } from \"./lib\"\nimport { CustomError, request } from \"./utils\"\n\nexport default class XIVAPI {\n\tpublic readonly options: XIVAPI.Options\n\n\tpublic readonly achievements: Sheet<\"Achievement\">\n\tpublic readonly minions: Sheet<\"Companion\">\n\tpublic readonly mounts: Sheet<\"Mount\">\n\tpublic readonly items: Sheet<\"Item\">\n\n\t/**\n   * Raw endpoints for the API. Please consider using the typed endpoints instead.\n   * @see https://v2.xivapi.com/api/docs\n   * @since 0.5.0\n   */\n\tpublic readonly data = {\n\t\t/**\n     * @see https://v2.xivapi.com/api/docs#tag/sheets\n     * @since 0.5.0\n     */\n\t\tsheets: () => new Sheets(this.options),\n\t\t/**\n     * @see https://v2.xivapi.com/api/docs#tag/versions\n     * @since 0.5.0\n     */\n\t\tversions: () => new Versions().all().then((versions) => versions.versions.map((version) => version.names[0])),\n\t\t/**\n     * @see https://v2.xivapi.com/api/docs#tag/assets\n     * @since 0.5.0\n     */\n\t\tassets: () => new Assets(),\n\t}\n\n\t/**\n   * A wrapper for the XIVAPI v2 API.\n   * @param {XIVAPI.Options} [options] The client options to fetch with.\n   * @see https://v2.xivapi.com/api/docs\n   * @since 0.5.0\n   */\n\tconstructor(\n\t\toptions: XIVAPI.Options = {\n\t\t\tversion: \"latest\",\n\t\t\tlanguage: \"en\",\n\t\t\tverbose: false,\n\t\t}\n\t) {\n\t\tthis.achievements = new Sheet(\"Achievement\")\n\t\tthis.minions = new Sheet(\"Companion\")\n\t\tthis.mounts = new Sheet(\"Mount\")\n\t\tthis.items = new Sheet(\"Item\")\n\n\t\tthis.options = options\n\t}\n\n\t/**\n   * Fetch information about rows and their related data that match the provided search query.\n   * @param {Models.SearchQuery} params Query paramters accepted by the search endpoint.\n   * @returns {Promise<Models.SearchResponse>} Response structure for the search endpoint.\n   * @see https://v2.xivapi.com/api/docs#tag/search/get/search\n   * @since 0.5.0\n   */\n\tpublic async search(params: XIVAPI.SearchParams): Promise<Models.SearchResponse> {\n\t\tconst { data, errors } = await request({\n\t\t\tpath: \"/search\",\n\t\t\tparams: params as Record<string, unknown>,\n\t\t})\n\t\tif (errors) throw new CustomError(errors[0].message)\n\t\treturn data as Models.SearchResponse\n\t}\n}\n\nexport namespace XIVAPI {\n  export interface Options {\n    /**\n     * The supported version of the game to use for the API.\n     * @default \"latest\"\n     */\n    version?: string;\n    /**\n     * Language to use for the API.\n     */\n    language?: keyof typeof Models.SchemaLanguage;\n    /**\n     * Whether to enable verbose logging.\n     * @default false\n     */\n    verbose?: boolean;\n  }\n\n  /**\n   * Query parameters accepted by the search endpoint.\n   * @see https://v2.xivapi.com/api/docs#tag/search/get/search\n   */\n  export type SearchParams = Models.SearchQuery &\n    Models.VersionQuery &\n    Models.RowReaderQuery & { verbose?: boolean };\n}\n\n/**\n * Models are used to define the structure of the data returned by the API.\n * @see https://v2.xivapi.com/api/docs#models\n */\nexport namespace Models {\n  /**\n   * Query parameters accepted by endpoints that interact with versioned game data.\n   * @see https://v2.xivapi.com/api/docs#model/versionquery\n   */\n  export interface VersionQuery {\n    /**\n     * Game version to utilise for this query.\n     */\n    version?: string | null;\n  }\n\n  /**\n   * Query parameters accepted by the asset endpoint.\n   * @see https://v2.xivapi.com/api/docs#model/assetquery\n   */\n  export interface AssetQuery {\n    format: string | SchemaFormat;\n    /**\n     * Game path of the asset to retrieve.\n     * @example \"ui/icon/051000/051474_hr1.tex\"\n     */\n    path: string;\n  }\n\n  /**\n   * @see https://v2.xivapi.com/api/docs#model/schemaformat\n   */\n  export enum SchemaFormat {\n    jpg = \"jpg\",\n    png = \"png\",\n    webp = \"webp\",\n  }\n\n  /**\n   * General purpose error response structure.\n   * @see https://v2.xivapi.com/api/docs#model/errorresponse\n   */\n  export interface ErrorResponse {\n    code: number;\n    /**\n     * Description of what went wrong.\n     */\n    message: string;\n  }\n\n  /**\n   * @see https://v2.xivapi.com/api/docs#model/statuscode\n   */\n  export type StatusCode = number;\n\n  /**\n   * Path segments expected by the asset map endpoint.\n   * @see https://v2.xivapi.com/api/docs#model/mappath\n   */\n  export interface MapPath {\n    /**\n     * Index of the map within the territory. This invariably takes the form of a two-digit zero-padded number. See Map's Id field for examples of possible combinations of `territory` and `index`.\n     * @example \"00\"\n     */\n    index: string;\n    /**\n     * Territory of the map to be retrieved. This typically takes the form of 4 characters, [letter][number][letter][number]. See Map's Id field for examples of possible combinations of `territory` and `index`.\n     * @example \"s1d1\"\n     */\n    territory: string;\n  }\n\n  /**\n   * Query paramters accepted by the search endpoint.\n   * @see https://v2.xivapi.com/api/docs#model/searchquery\n   */\n  export interface SearchQuery {\n    /**\n     * Continuation token to retrieve further results from a prior search request. If specified, takes priority over query.\n     */\n    cursor?: string | null;\n    /**\n     * Maximum number of rows to return. To paginate, provide the cursor token provided in `next` to the `cursor` parameter.\n     */\n    limit?: number | null;\n    /**\n     * A query string for searching excel data.\n     * Queries are formed of clauses, which take the basic form of `[specifier][operation][value]`, i.e. `Name=\"Example\"`. Multiple clauses may be specified by seperating them with whitespace, i.e. `Foo=1 Bar=2`.\n     * @see https://v2.xivapi.com/docs/guides/search/#query\n     */\n    query?: QueryString;\n    /**\n     * List of excel sheets that the query should be run against. At least one must be specified if not querying a cursor.\n     */\n    sheets?: string | null;\n  }\n\n  /**\n   * A query string for searching excel data.\n   * Queries are formed of clauses, which take the basic form of `[specifier][operation][value]`, i.e. `Name=\"Example\"`. Multiple clauses may be specified by seperating them with whitespace, i.e. `Foo=1 Bar=2`.\n   * @see https://v2.xivapi.com/api/docs#model/querystring\n   */\n  export type QueryString =\n    | string\n    | string[]\n    | Record<string, string | number | boolean>\n    | URLSearchParams\n    | null;\n\n  /**\n   * Query parameters accepted by endpoints that retrieve excel row data.\n   * @see https://v2.xivapi.com/api/docs#model/rowreaderquery\n   */\n  export interface RowReaderQuery {\n    /**\n     * A filter string for selecting fields within a row.\n     * Filters are comprised of a comma-seperated list of field paths, i.e. `a,b` will select the fields `a` and `b`.\n     */\n    fields?: FilterString | null;\n    /**\n     * Known languages supported by the game data format. **NOTE:** Not all languages that are supported by the format are valid for all editions of the game. For example, the global game client acknowledges the existence of `chs` and `kr`, however does not provide any data for them.\n     */\n    language?: string | SchemaLanguage | null;\n    /**\n     * Schema that row data should be read with.\n     */\n    schema?: SchemaSpecifier | null;\n    /**\n     * A filter string for selecting fields within a row.\n     * Filters are comprised of a comma-seperated list of field paths, i.e. `a,b` will select the fields `a` and `b`.\n     */\n    transient?: FilterString | null;\n  }\n\n  /**\n   * Known languages supported by the game data format. **NOTE:** Not all languages that are supported by the format are valid for all editions of the game. For example, the global game client acknowledges the existence of `chs` and `kr`, however does not provide any data for them.\n   * @see https://v2.xivapi.com/api/docs#model/schemalanguage\n   */\n  export enum SchemaLanguage {\n    none = \"none\",\n    en = \"en\",\n    ja = \"ja\",\n    de = \"de\",\n    fr = \"fr\",\n    chs = \"chs\",\n    cht = \"cht\",\n    kr = \"kr\",\n  }\n\n  /**\n   * @see https://v2.xivapi.com/api/docs#model/schemaspecifier\n   */\n  export type SchemaSpecifier = string; // `^.+(@.+)?$`\n\n  /**\n   * A filter string for selecting fields within a row.\n   * Filters are comprised of a comma-seperated list of field paths, i.e. `a,b` will select the fields `a` and `b`.\n   * @see https://v2.xivapi.com/api/docs#model/filterstring\n   */\n  export type FilterString = string | string[];\n\n  /**\n   * Response structure for the search endpoint.\n   * @see https://v2.xivapi.com/api/docs#model/searchresponse\n   */\n  export interface SearchResponse {\n    results: SearchResult[];\n    schema: SchemaSpecifier;\n    next?: string | null;\n  }\n\n  /**\n   * Result found by a search query, hydrated with data from the underlying excel row the result represents.\n   * @see https://v2.xivapi.com/api/docs#model/searchresult\n   */\n  export interface SearchResult {\n    fields: object;\n    /**\n     * ID of this row.\n     */\n    row_id: number;\n    /**\n     * Relevance score for this entry.\n     * These values only loosely represent the relevance of an entry to the search query. No guarantee is given that the discrete values, nor resulting sort order, will remain stable.\n     */\n    score: number;\n    /**\n     * Excel sheet this result was found in.\n     */\n    sheet: SchemaSpecifier;\n    /**\n     * Subrow ID of this row, when relevant.\n     */\n    subrow_id?: number;\n    /**\n     * Field values for this row's transient row, if any is present, according to the current schema and transient filter.\n     */\n    transient?: object;\n  }\n\n  /**\n   * Response structure for the list endpoint.\n   * @see https://v2.xivapi.com/api/docs#model/listresponse\n   */\n  export interface ListResponse {\n    /**\n     * Array of sheets known to the API.\n     * Metadata about a single sheet.\n     */\n    sheets: SheetMetadata[];\n  }\n\n  /**\n   * Metadata about a single sheet.\n   * @see https://v2.xivapi.com/api/docs#model/sheetmetadata\n   */\n  export interface SheetMetadata {\n    /**\n     * The name of the sheet.\n     */\n    name: string;\n  }\n\n  /**\n   * Path variables accepted by the sheet endpoint.\n   * @see https://v2.xivapi.com/api/docs#model/sheetpath\n   */\n  export interface SheetPath {\n    /**\n     * Name of the sheet to read.\n     */\n    sheet: SchemaSpecifier;\n  }\n\n  /**\n   * Query parameters accepted by the sheet endpoint.\n   * @see https://v2.xivapi.com/api/docs#model/sheetquery\n   */\n  export interface SheetQuery {\n    /**\n     * Fetch rows after the specified row. Behavior is undefined if both `rows` and `after` are provided.\n     */\n    after?: SchemaSpecifier | null;\n    /**\n     * Maximum number of rows to return. To paginate, provide the last returned row to the next request's `after` parameter.\n     */\n    limit?: number | null;\n    /**\n     * Rows to fetch from the sheet, as a comma-separated list. Behavior is undefined if both `rows` and `after` are provided.\n     */\n    rows?: string; // `^\\d+(:\\d+)?(,\\d+(:\\d+)?)*$`\n  }\n\n  /**\n   * @see https://v2.xivapi.com/api/docs#model/rowspecifier\n   */\n  export type RowSpecifier = string; // `^\\d+(:\\d+)?$`\n\n  /**\n   * Response structure for the sheet endpoint.\n   * @see https://v2.xivapi.com/api/docs#model/sheetresponse\n   */\n  export interface SheetResponse {\n    /**\n     * Array of rows retrieved by the query.\n     * @see https://v2.xivapi.com/api/docs#model/rowresult\n     */\n    rows: RowResult[];\n    /**\n     * The canonical specifier for the schema used in this response.\n     */\n    schema: SchemaSpecifier;\n  }\n\n  /**\n   * Row retrieved by the query.\n   * @see https://v2.xivapi.com/api/docs#model/rowresult\n   */\n  export interface RowResult {\n    fields: object;\n    /**\n     * ID of this row.\n     */\n    row_id: number;\n    /**\n     * Subrow ID of this row, when relevant.\n     */\n    subrow_id?: number | null;\n    /**\n     * Field values for this row's transient row, if any is present, according to the current schema and transient filter.\n     */\n    transient?: object;\n  }\n\n  /**\n   * Path variables accepted by the row endpoint.\n   * @see https://v2.xivapi.com/api/docs#model/rowpath\n   */\n  export interface RowPath {\n    row: RowSpecifier;\n    /**\n     * Name of the sheet to read.\n     */\n    sheet: SchemaSpecifier;\n  }\n\n  /**\n   * Response structure for the row endpoint.\n   * @see https://v2.xivapi.com/api/docs#model/rowresponse\n   */\n  export interface RowResponse {\n    fields: object;\n    /**\n     * ID of this row.\n     */\n    row_id: number;\n    /**\n     * The canonical specifier for the schema used in this response.\n     */\n    schema: SchemaSpecifier;\n    /**\n     * Subrow ID of this row, when relevant.\n     */\n    subrow_id?: number | null;\n    /**\n     * Field values for this row's transient row, if any is present, according to the current schema and transient filter.\n     */\n    transient?: object;\n  }\n\n  /**\n   * Response structure for the versions endpoint.\n   * @see https://v2.xivapi.com/api/docs#model/versionsresponse\n   */\n  export interface VersionsResponse {\n    /**\n     * Array of versions available in the API.\n     * Metadata about a single version supported by the API.\n     */\n    versions: VersionMetadata[];\n  }\n\n  /**\n   * Metadata about a single version supported by the API.\n   * @see https://v2.xivapi.com/api/docs#model/versionmetadata\n   */\n  export interface VersionMetadata {\n    /**\n     * Names associated with this version. Version names specified here are accepted by the `version` query parameter throughout the API.\n     */\n    names: string[];\n  }\n}\n"]}