Skip to content

Conversation

@c0reme
Copy link
Collaborator

@c0reme c0reme commented Oct 13, 2025

Since https://v2.xivapi.com has made some breaking changes to this package, I have gone through and updated the base methods (including typings):

  • /asset
  • /asset/map/{territory}/{index}
  • /search
  • /sheet
  • /sheet/{sheet}
  • /sheet/{sheet}/{row}
  • /version

Methods relating to lodestone, such as pvpteam and characters are no longers supported (Source: https://v2.xivapi.com/docs/migrate/#lodestone):

V1 provided endpoints that surfaced data obtained from Lodestone, however these endpoints saw degraded availability due to the nature of the scraping being performed. By late 2023, they were effectively rendered non-functional.

There are no current plans to re-introduce Lodestone endpoints in v2. For alternatives, please see the Open Souce page, which lists a few tools and libraries that can be used to obtain this information.

If you wish for me to continue, please let me know. I can use the methods above to create datasets for items, achievements etc if required.

P.S. For locally usage, I switched to TS and ESM, if you want me to change this back I can after.

@c0reme c0reme marked this pull request as draft October 13, 2025 13:04
…ality

- Consolidated exports in index.ts to simplify module structure.
- Updated request function in utils.ts to handle array parameters for query and version options.
- Modified sheets.ts and versions.ts to ensure params are passed correctly in API requests.
- Expanded test suite in xivapi-js.test.ts to include comprehensive search validation and error handling for various query scenarios.
@kaimoe
Copy link
Member

kaimoe commented Oct 14, 2025

Thank you very much! I'm not at all involved in JS dev these days so this is invaluable help. You can keep going at your leisure and I can review your changes when you have full coverage.

As for the TS, I'm not 100% sure. Let's see towards the end of this PR.

… error handling

- Introduced a new class structure for xivapi, encapsulating sheet access methods for achievements, items, and more.
- Enhanced error handling with a CustomError class for better debugging.
- Updated utils to ensure consistent option handling across API requests.
- Expanded test coverage to validate new functionalities and ensure robust error handling.
@c0reme
Copy link
Collaborator Author

c0reme commented Oct 14, 2025

I have made some changes to the README to showcase what it can do now. I am not 100% sure what sheets people would want so I have left it as Items and Achievements, more can be added easily. For those sheets not typed out, xivapi.data.sheets can be used, for example:

await xivapi.data.sheets.all();
await xivapi.data.sheets.list("BeastTribe")
await xivapi.data.sheets.get("BeastTribe", 1) // can be a string or number

…tionality

- Introduced a new Sheet class for structured access to sheet data.
- Updated XIVAPI class to utilize the new Sheet class for achievements, minions, mounts, and items.
- Removed the deprecated Search class and its related functionality.
- Enhanced error handling and request parameter management in the utils and sheets modules.
- Consolidated exports in index.ts for improved module organization.
@c0reme c0reme marked this pull request as ready for review October 17, 2025 18:57
@c0reme
Copy link
Collaborator Author

c0reme commented Oct 17, 2025

Let me know if you want me to switch it to javascript, also did you want to continue using commonjs (require())?

@kaimoe
Copy link
Member

kaimoe commented Oct 30, 2025

Let me know if you want me to switch it to javascript, also did you want to continue using commonjs (require())?

Nope, considering how major and breaking the overall update is by definition, I think it's fine to make those changes too. Thank you again!

@kaimoe kaimoe merged commit f7359c2 into xivapi:master Oct 30, 2025
@c0reme
Copy link
Collaborator Author

c0reme commented Oct 30, 2025

No worries. I just noticed something I forgot to add, pathing to the dist folder. Give me a moment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants