Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Kit

The main application class

Hierarchy

Indexable

[key: string]: any

Index

Constructors

constructor

  • new Kit(): Kit

Properties

allianceQuery

allianceQuery: { (params: Parameters, query: string, paginator?: false): Promise<Alliance[]>; (params: Parameters, query: string, paginator: true): Promise<AlliancePaginator> } = ...

Type declaration

    • Gets a list of alliances

      Parameters

      • params: Parameters

        Query parameters to customize your results

      • query: string

        The graphql query to get info with

      • Optional paginator: false

        Deliver the data in a paginated format

      Returns Promise<Alliance[]>

      The nations queried or as paginated

    • Parameters

      • params: Parameters
      • query: string
      • paginator: true

      Returns Promise<AlliancePaginator>

apiKey

apiKey: string = ''

bankRecordsQuery

bankRecordsQuery: { (params: Parameters, query: string, paginator?: false): Promise<Bankrec[]>; (params: Parameters, query: string, paginator: true): Promise<BankrecPaginator> } = ...

Type declaration

    • Gets a list of bank records

      Parameters

      • params: Parameters

        Query parameters to customize your results

      • query: string

        The graphql query to get info with

      • Optional paginator: false

        If true it will return paginator info

      Returns Promise<Bankrec[]>

    • Parameters

      • params: Parameters
      • query: string
      • paginator: true

      Returns Promise<BankrecPaginator>

bountyQuery

bountyQuery: { (params: Parameters, query: string, paginator?: false): Promise<Bounty[]>; (params: Parameters, query: string, paginator: true): Promise<BountyPaginator> } = ...

Type declaration

    • Gets a list of bounties

      Parameters

      • params: Parameters

        Query parameters to customize your results

      • query: string

        The graphql query to get info with

      • Optional paginator: false

        If true it will return paginator info

      Returns Promise<Bounty[]>

    • Parameters

      • params: Parameters
      • query: string
      • paginator: true

      Returns Promise<BountyPaginator>

cityQuery

cityQuery: { (params: Parameters, query: string, paginator?: false): Promise<City[]>; (params: Parameters, query: string, paginator: true): Promise<CityPaginator> } = ...

Type declaration

    • Gets a list of cities

      Parameters

      • params: Parameters

        Query parameters to customize your results

      • query: string

        The graphql query to get info with

      • Optional paginator: false

        If true it will return paginator info

      Returns Promise<City[]>

    • Parameters

      • params: Parameters
      • query: string
      • paginator: true

      Returns Promise<CityPaginator>

colorQuery

colorQuery: (query: string) => Promise<Color[]> = ...

Type declaration

    • (query: string): Promise<Color[]>
    • Gets all color trade blocs

      Parameters

      • query: string

        The graphql query to get info with

      Returns Promise<Color[]>

nationQuery

nationQuery: { (params: Parameters, query: string, paginator?: false): Promise<Nation[]>; (params: Parameters, query: string, paginator: true): Promise<NationPaginator> } = ...

Type declaration

    • Gets a list of nations

      Parameters

      • params: Parameters

        Query parameters to customize your results

      • query: string

        The graphql query to get info with

      • Optional paginator: false

        Deliver the data in a paginated format

      Returns Promise<Nation[]>

      The nations queried or as paginated

    • Parameters

      • params: Parameters
      • query: string
      • paginator: true

      Returns Promise<NationPaginator>

Private rateLimitData

rateLimitData: { limit: number; remaining: number; reset: number; resetAfterSeconds: number } = ...

Type declaration

  • limit: number
  • remaining: number
  • reset: number
  • resetAfterSeconds: number

tradePricesQuery

tradePricesQuery: { (params: Parameters, query: string, paginator?: false): Promise<Tradeprice[]>; (params: Parameters, query: string, paginator: true): Promise<TradepricePaginator> } = ...

Type declaration

    • Gets a list of trade prices

      Parameters

      • params: Parameters

        Query parameters to customize your results

      • query: string

        The graphql query to get info with

      • Optional paginator: false

        If true, returns paginator information

      Returns Promise<Tradeprice[]>

    • Parameters

      • params: Parameters
      • query: string
      • paginator: true

      Returns Promise<TradepricePaginator>

tradeQuery

tradeQuery: { (params: Parameters, query: string, paginator?: false): Promise<Trade[]>; (params: Parameters, query: string, paginator: true): Promise<TradePaginator> } = ...

Type declaration

    • Gets a list of trades

      Parameters

      • params: Parameters

        Query parameters to customize your results

      • query: string

        The graphql query to get info with

      • Optional paginator: false

        If true returns paginator info

      Returns Promise<Trade[]>

    • Parameters

      • params: Parameters
      • query: string
      • paginator: true

      Returns Promise<TradePaginator>

treasureQuery

treasureQuery: (query: string) => Promise<Treasure[]> = ...

Type declaration

    • Gets a list of all treasures

      Parameters

      • query: string

        The graphql query to get info with

      Returns Promise<Treasure[]>

warQuery

warQuery: { (params: Parameters, query: string, paginator?: false): Promise<War[]>; (params: Parameters, query: string, paginator: true): Promise<WarPaginator> } = ...

Type declaration

    • Gets a list of wars

      Parameters

      • params: Parameters

        Query parameters to customize your results

      • query: string

        The graphql query to get info with

      • Optional paginator: false

        if true it will return paginator info

      Returns Promise<War[]>

    • Parameters

      • params: Parameters
      • query: string
      • paginator: true

      Returns Promise<WarPaginator>

Accessors

rateLimit

  • get rateLimit(): RateLimitI

Methods

cached

  • cached(queryFunc: (...args: any[]) => any, maxAgeMinutes: number): (...args: any[]) => any & Memoized<(...args: any[]) => any>
  • Lets you cache results of a query call

    It returns a cached version of the function that accepts the same arguments but caches it for a certain period of time

    Parameters

    • queryFunc: (...args: any[]) => any

      The query function you want to cache

        • (...args: any[]): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    • maxAgeMinutes: number

      The max number of minutes to cache it for

    Returns (...args: any[]) => any & Memoized<(...args: any[]) => any>

    returns a cached version of the function

setKey

  • setKey(key: string): void
  • Set the pnwkit instance's key.

    Parameters

    • key: string

    Returns void

setRateLimit

  • setRateLimit(value: RateLimitI): void
  • Do not call this function, this is internal.

    Parameters

    • value: RateLimitI

    Returns void

Generated using TypeDoc