-
Notifications
You must be signed in to change notification settings - Fork 1
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
Update pinejs-client and make use of improved typings #54
Conversation
.get({ | ||
resource: 'user', | ||
id, | ||
options: { $select: 'id' }, |
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 $select
was previously missing
.get({ | ||
resource: 'application', | ||
id, | ||
options: { $select: 'id' }, |
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 $select
was previously missing
options: { $select: 'id' }, | ||
} as const) | ||
.catch(models.wrapResponseError); | ||
if (user == null) { |
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.
It could always be null but in the past it would have error'ed with something like TypeError: cannot read 'id' of undefined
downstream
options: { $select: 'id' }, | ||
} as const) | ||
.catch(models.wrapResponseError); | ||
if (app == null) { |
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.
It could always be null but in the past it would have error'ed with something like TypeError: cannot read 'id' of undefined
downstream
} | ||
|
||
async function getOrCreateService( | ||
api: PinejsClientCore<unknown>, | ||
body: models.ServiceAttributes, | ||
): Promise<models.ServiceModel> { | ||
return models.getOrCreate(api, 'service', body, { |
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.
I replaced this with the built in getOrCreate
to keep things standardized with other repos using the client
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.
Glad we got rid of the extra models.ts
wrapper, since pinejs-client is our sdk for OData and we shouldn't need an extra sdk on top of it for such simple operations.
package.json
Outdated
"pinejs-client-core": "^6.15.10", | ||
"pinejs-client-request": "^7.5.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.
Since the sdk is pinned to ~6.14.0, bumping these would cause headaches in the CLI by causing it to have to separate versions of pinejs-client-core. Would it be a big deal deferring this bump for a bit (until the next sdk major)?
6ad2ec9
to
01937a9
Compare
Pull request was converted to draft
01937a9
to
60117af
Compare
8b71424
to
1085c2c
Compare
Change-type: patch
1085c2c
to
055a907
Compare
Change-type: patch