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

Allow querying custom properties #238

Closed
PVince81 opened this issue Jan 27, 2021 · 8 comments · Fixed by #247
Closed

Allow querying custom properties #238

PVince81 opened this issue Jan 27, 2021 · 8 comments · Fixed by #247

Comments

@PVince81
Copy link

Nextcloud for example has additional properties (like checksum, tags, comments, etc) that can be queried with PROPFIND optionally and are not part of the default response.

The methods stat and getDirectoryContents should allow modifying the properties list to be queried.

Requires namespace support: #210

This will likely have an impact on the current parsing and would need a decision about how to return namespaces (ex: using clark notation).

@perry-mitchell
Copy link
Owner

I like this idea. I would happily entertain contributions regarding both the namespace support and custom properties.

I haven't yet seen a great example of where namespacing is useful or even present (multiple namespaces).

@skjnldsv
Copy link
Contributor

Hey, it used to be possible on 3.x.x https://github.com/nextcloud/viewer/blob/0208dd519d0f266b309d765a73c0221a9d2dd8ee/src/services/FileInfo.js#L33-L61

But with latest 4.x.x it doesn't work anymore @perry-mitchell. Any insights?

@skjnldsv
Copy link
Contributor

skjnldsv commented Feb 16, 2021

Ah, it's becaused you removed the data parameter forward in

if (methodOptions.data) {
requestOptions.data = methodOptions.data;
}

export function prepareRequestOptions(

That is a crazy breaking change,this breaks almost all of our Nextcloud uses of this webdav library :)

@perry-mitchell
Copy link
Owner

perry-mitchell commented Mar 7, 2021

@skjnldsv I wasn't aware anyone was using the library like that - else I would have avoided such a change. That is kind of why the customRequest method exists - or at least so I thought :). In the linked example you're passing a fair amount of custom data to the stat call - If these were common use-cases I'm surprised someone hasn't contributed them to this library as a core method or feature.

I'll reintroduce this functionality now.

@perry-mitchell
Copy link
Owner

@skjnldsv Sorry for the inconvenience.. I'll document this better now so it won't mysteriously disappear again.

I've added it back in v4.2.1. You can see it documented in the method options in the readme. It's available under the data property in the options argument for stat (and other methods).

@skjnldsv
Copy link
Contributor

skjnldsv commented Mar 9, 2021

Awesome @perry-mitchell! Thank you very much! 🤗

@skjnldsv
Copy link
Contributor

skjnldsv commented Mar 9, 2021

I'm surprised someone hasn't contributed them to this library as a core method or feature

I'm very sorry, I did a few issues and prs here, but I'm also quite overwhelmed, I would love to spend a fair amount of time trying to push a bit more here :)
I'm sure we'll get a future work that will require a very extensive usage of thiw lib and we'll be able to contribute a bit more! 🚀

@skjnldsv
Copy link
Contributor

skjnldsv commented Mar 9, 2021

Sorry for the inconvenience

No worries! It's all good, things happens 😉

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

Successfully merging a pull request may close this issue.

3 participants