-
Notifications
You must be signed in to change notification settings - Fork 61
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 passing parameters of non-model types into generated client methods #235
Conversation
740abf9
to
209c1d7
Compare
@@ -13,7 +13,7 @@ | |||
import { GeneratedApiClient } from './generated-client'; | |||
import { OAuth } from './oauth'; | |||
import { Http } from './http'; | |||
import { IRequestExecutor } from './request-executor'; | |||
import { RequestExecutor } from './request-executor'; |
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.
Is this a type name change? Looks like a breaking change
@@ -769,6 +769,30 @@ const client = new okta.Client({ | |||
}) | |||
``` | |||
|
|||
### TypeScript usage examples (>=4.5.0) |
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.
Can you add one more example for the newly introduced optional
model type?
src/types/models/AcsEndpoint.d.ts
Outdated
export { | ||
AcsEndpoint | ||
AcsEndpoint, | ||
AcsEndpointOptionsType |
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.
How about name it as xxxOptionalType
?
Looks good to me in general. Can we put the type breaking change ( |
d29c544
to
28e884d
Compare
test/type/client.test-d.ts
Outdated
@@ -2,7 +2,7 @@ import { expectError, expectType } from 'tsd'; | |||
import { Response } from 'node-fetch'; | |||
import { Client } from '../../src/types/client'; | |||
import { Collection } from '../../src/types/collection'; | |||
import { Application } from '../../src/types/models/Application'; | |||
import { Application, ApplicationOptionsType } from '../../src/types/models/Application'; |
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.
should it be ApplicationOptions?
test/type/client.test-d.ts
Outdated
@@ -16,3 +16,9 @@ expectError(client.deleteApplicationUser('appId', 'userId', {sendEmail: 0})); | |||
// Client methods return either Promise or Collection | |||
expectType<Promise<Response>>(client.deletePolicy('policyId')); | |||
expectType<Collection<Application>>(client.listApplications()); | |||
|
|||
// methods expecting body request parameters | |||
const appOptions: ApplicationOptionsType = { |
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.
same here
README.md
Outdated
} | ||
}; | ||
|
||
client.createApplication(bookmarkApp).then((createdApp: Application) => { |
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.
nit: bookmarkApp -> bookmarkAppOptions
c289240
to
d37051c
Compare
da1628d
to
5b54101
Compare
5b54101
to
f53f4cd
Compare
dfb8b53
to
4bd9b1c
Compare
url
property to RequestOptions interface