-
Notifications
You must be signed in to change notification settings - Fork 4
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
Enh: sharing wrappers #18
Enh: sharing wrappers #18
Conversation
f7bbaf6
to
26a1353
Compare
"jest": "^29.7.0", | ||
"jest-environment-jsdom": "^29.7.0", | ||
"ts-node": "^10.9.1", | ||
"typedoc": "^0.25.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by npm audit --fix --force
"@types/jest": "^29.5.5", | ||
"jest": "^29.7.0", | ||
"jest-environment-jsdom": "^29.7.0", | ||
"ts-node": "^10.9.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For testing
"@nextcloud/axios": "^2.4.0", | ||
"@nextcloud/router": "^2.1.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for wrapper functions
@@ -1,6 +1,6 @@ | |||
{ | |||
"compilerOptions": { | |||
"target": "es5", | |||
"target": "ES6", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was needed for building documentation, due to the following error:
> @nextcloud/[email protected] build:doc
> typedoc --out dist/doc lib && touch dist/doc/.nojekyll
node_modules/@jest/reporters/build/index.d.ts:136:3 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
136 #private;
~~~~~~~~
node_modules/jest-runner/build/index.d.ts:101:3 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
101 #private;
|
||
/** | ||
* interface, generated using QuickType from response object | ||
* TODO: find out where this is defined and make better |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO here
|
||
import type { AxiosResponse } from 'axios' | ||
|
||
export enum NcShareType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To prevent naming conflicts in libraries that use it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree that Type
is very generic, but ShareType
should be good.
If it conflicts then just import it with alias like import { ShareType as NcShareType } from '...'
.
Especially as we do not use prefixes on e.g. nextcloud-files or all other libraries
* interface, generated using QuickType from response object | ||
* TODO: find out where this is defined and make better | ||
*/ | ||
export interface ShareData { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe name Nc(OCS)ShareData to also prevent naming conflicts?
jest.config.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Autogenerated by npm run test -- --init
…ud/router, jest Signed-off-by: Fee Gevaert <[email protected]>
Signed-off-by: Fee Gevaert <[email protected]>
26a1353
to
b3e7443
Compare
Nothing is outdated, I just signed off the commits |
/** | ||
* Successful OCS responses look like this, `T` is a template for the response data inside the response | ||
*/ | ||
export interface NcOCSResponse<T>{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already provided by @nextcloud/typings
* interface, generated using QuickType from response object | ||
* TODO: find out where this is defined and make better | ||
*/ | ||
export interface ShareData { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No sure about this, maybe instead like the Folder
or Node
class of nextcloud-files?
Oh wow, I'm like completely out of this and would need quite some reading/comprehending to get back to knowing what is going on... Sorry folks, but will close for now. If someone else feels the need to develop this further, I think they can build on top of this... |
Nobody responded to #17 so I just made my contribution.
Basically, I created wrapper functions for all API calls described in the sharing API section
I added one test, since I didn't know if this is all wanted.
kind regards :)