Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Collection.values, fix editField and file return types, fix bad fields showing up in some searches #18

Merged
merged 14 commits into from
Feb 22, 2024

Conversation

3vorp
Copy link
Contributor

@3vorp 3vorp commented Feb 17, 2024

Collection.values:

Getting every existing value in a collection without duplicates is a really common operation that doesn't currently exist in Firestorm at all, so I added a fully tested and typed Collection.values method. It's a slightly simpler version of the SQL SELECT DISTINCT statement, but it also supports directly merging array fields using the flatten option (useful for texture tags, user roles, etc).

Type fixes:

  • Collection.editField and Collection.editFieldBulk now return confirmations like the other write methods (although different to the WriteConfirmation type used by all other write methods?)
  • files.upload and files.delete extract the Axios request and return WriteConfirmations like all other methods.
  • Collection.select now picks the correct return parameters directly instead of returning a partial object (this was actually painful).
  • Replaced broken NoMethods<T> type with a more generalized RemoveMethods<T> type.
  • Method fields are no longer shown as valid in searches and selections.
  • Replaced Writable<T> with more specific Settable<T> and Addable<T> types for set and add operations respectively.

Other changes:

  • Started using changelog again.
  • Ran everything through a spelling checker.
  • Updated type tests with the new typing system.
  • Use JSDoc {@link } properties.
  • Cleaned up README (again).

src/index.js Outdated Show resolved Hide resolved
@3vorp 3vorp requested a review from TheRolfFR February 17, 2024 19:02
@3vorp 3vorp changed the title Add Collection.values, fix editField return types Add Collection.values, fix editField and file return types, fix bad fields showing up in some searches Feb 18, 2024
Copy link
Owner

@TheRolfFR TheRolfFR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather implement values on the server side

CHANGELOG.md Outdated Show resolved Hide resolved
@3vorp 3vorp requested a review from TheRolfFR February 21, 2024 06:47
basically instead of always wrapping the return value in another promise constructor, we just return the promise from the axios request
@TheRolfFR TheRolfFR merged commit 08eff4d into TheRolfFR:main Feb 22, 2024
2 checks passed
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