Skip to content

Commit

Permalink
added a couple more types, prep for 1.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
karnthis committed Nov 17, 2021
1 parent 0e63019 commit 18df69e
Show file tree
Hide file tree
Showing 10 changed files with 7,579 additions and 1,362 deletions.
8,887 changes: 7,534 additions & 1,353 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "esiil",
"version": "0.4.0",
"version": "1.0.0",
"description": "Minimalist library for EVE Online's ESI *Beta*",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
5 changes: 3 additions & 2 deletions src/classes/Character/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Core from '../Core'
import {basePath} from "./characterHelper";
import IInstanceConfig from "../../interfaces/InstanceConfig";
import IExtraParametersWithSig from "../../interfaces/ExtraParametersWithSig";
import ILpServiceResponse from "../../interfaces/responses/character/LpServiceResponse";

export default class Character extends Core.CoreClass {
constructor(cfg: IInstanceConfig) {
Expand Down Expand Up @@ -66,8 +67,8 @@ export default class Character extends Core.CoreClass {
implants(characterID: number, sessionToken: string, extraParameters: IExtraParametersWithSig) {
return Core._makeAuthedGet(`${basePath}/${characterID}/implants/`, sessionToken, extraParameters)
}
lp(characterID: number, sessionToken: string, extraParameters: IExtraParametersWithSig) {
return Core._makeAuthedGet(`${basePath}/${characterID}/loyalty/points/`, sessionToken, extraParameters)
async lp(characterID: number, sessionToken: string, extraParameters: IExtraParametersWithSig): Promise<ILpServiceResponse> {
return await Core._makeAuthedGet(`${basePath}/${characterID}/loyalty/points/`, sessionToken, extraParameters) as ILpServiceResponse
}
medals(characterID: number, sessionToken: string, extraParameters: IExtraParametersWithSig) {
return Core._makeAuthedGet(`${basePath}/${characterID}/medals/`, sessionToken, extraParameters)
Expand Down
5 changes: 3 additions & 2 deletions src/classes/Universe/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Core from'../Core'
import { basePath } from './universeHelper'
import IInstanceConfig from "../../interfaces/InstanceConfig";
import IExtraParametersWithSig from "../../interfaces/ExtraParametersWithSig";
import IName2IdResponseBody from "../../interfaces/responses/universe/Name2IdResponseBody";

export default class Universe extends Core.CoreClass {
constructor(cfg: IInstanceConfig) {
Expand All @@ -11,8 +12,8 @@ export default class Universe extends Core.CoreClass {
piSchematics(schematicsID: number, extraParameters: IExtraParametersWithSig) {
return Core._makePublicGet(`${basePath}/schematics/${schematicsID}/`, extraParameters)
}
name2ID(namesArray: string[], extraParameters: IExtraParametersWithSig) {
return Core._makePublicPost(`${basePath}/ids/`, namesArray, extraParameters)
async name2ID(namesArray: string[], extraParameters: IExtraParametersWithSig): Promise<IName2IdResponseBody> {
return await Core._makePublicPost(`${basePath}/ids/`, namesArray, extraParameters) as IName2IdResponseBody
}
ids2Name(idsArray: number[], extraParameters: IExtraParametersWithSig) {
return Core._makePublicPost(`${basePath}/names/`, idsArray, extraParameters)
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ class ESIIL extends Core.CoreClass {
super(cfg)
}

defaultAuthRequestURL() {
return this.defaultRequestURL()
defaultAuthRequestURL(state: string) {
return this.defaultRequestURL(state)
}
targetedAuthRequestURL() {
return this.targetedRequestURL()
targetedAuthRequestURL(state: string, scopes: string[]) {
return this.targetedRequestURL(state, scopes)
}
receiveAuthCode(authCode: string) {
return _processAuthToken(authCode, this.ccpJwt)
Expand Down
4 changes: 4 additions & 0 deletions src/interfaces/responses/character/Lp.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default interface ILp {
corporation_id: number,
loyalty_points: number
}
6 changes: 6 additions & 0 deletions src/interfaces/responses/character/LpServiceResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import IServiceResponse from "../ServiceResponse";
import ILp from "./Lp";

export default interface ILpServiceResponse extends IServiceResponse {
body: ILp[]
}
4 changes: 4 additions & 0 deletions src/interfaces/responses/universe/IdNamePair.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default interface IIdNamePair {
id: number,
name: string
}
14 changes: 14 additions & 0 deletions src/interfaces/responses/universe/Name2IdResponseBody.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import IIdNamePair from "./IdNamePair";

export default interface IName2IdResponseBody {
agents?: IIdNamePair[],
alliances?: IIdNamePair[],
characters?: IIdNamePair[],
constellations?: IIdNamePair[],
corporations?: IIdNamePair[],
factions?: IIdNamePair[],
inventory_types?: IIdNamePair[],
regions?: IIdNamePair[],
stations?: IIdNamePair[],
systems?: IIdNamePair[]
}
6 changes: 6 additions & 0 deletions src/interfaces/responses/universe/Name2IdServiceResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import IServiceResponse from "../ServiceResponse";
import IName2IdResponseBody from "./Name2IdResponseBody";

export default interface IName2IdServiceResponse extends IServiceResponse {
body: IName2IdResponseBody
}

0 comments on commit 18df69e

Please sign in to comment.