Skip to content

(items): Specification for interacting with Mount/Minion lookup #24

@ReidWeb

Description

@ReidWeb

During the process of fetching a character's mounts or minions we cannot ascertain the item ID or name of the mount/minion directly (see comments on #22 and #23). To do so we need to interact with the DOM of the page, the proposal is to abstract this into a service consumable by the lodestone client.

Use Case

  1. As a consumer of the module I should be able to ascertain the name of mount/minion on a character's profile.
  2. As a consumer of the module I should be able to ascertain the id of a mount/minion on a character's profile

Proposed Solution

In short the "service" will have methods as below:

  1. Lookup character ID's mounts/minions on Lodestone, iterate over DOM, record to DB and return results as set of objects with keys that are, any keys not existing will be persisted to the DB:
    • item id
    • item name
    • item thumbnail url (match against this)
  2. Fetch all presently stored minions as one blob of JSON
  3. Fetch all presently stored mounts as one blob of JSON

There will be a typescript client for interfacing with the above service. At build time, the client should be pre-seeded with 2 JSON files reflecting the current state of the prod database. The client should include a function to interface with these in addition to the above methods.

When utilizing that client the lodestone module should behave as follows during the lodestoneClient.getCharacter(..) method:

  • The lodestone client should first attempt to find a match in the map included in the dependency.
  • If local lookup fails to find a match, call to service should be made to fetch the blob.
  • When a call to fetch blob is made, this should be persisted to memory and that in memory blob should replace the file system blob for the duration of eixstence of the client
  • If no match can be found on the blob, a call to lookup that individual character should be made.

Other

Implementation of this will be described in issues in a new repo.

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions