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

Support auto-generated record types for specific Kintone apps #445

Open
koba04 opened this issue Oct 5, 2020 · 5 comments
Open

Support auto-generated record types for specific Kintone apps #445

koba04 opened this issue Oct 5, 2020 · 5 comments
Labels
Epic feature New feature pkg: dts-gen @kintone/dts-gen pkg: rest-api-client @kintone/rest-api-client

Comments

@koba04
Copy link
Contributor

koba04 commented Oct 5, 2020

Package

  • @kintone/rest-api-client
  • (@kintone/dts-gen)

Why

Some methods rest-api-client provides accept a type parameter for a type definition of your app.

type MyAppRecord = { /* ... */ }
// the type of the record will be MyAppRecord
const record = client.record.getRecord<MyAppRecord>({ app: 1, id: 10 })

After #404 has been merged, we could define the type definition using types #404 exposes.
But it's a bit cumbersome because we have to define the type definition manually.

dts-gen provides us a command to be able to generate type definitions for your app.
But the type definition dts-gen generates is not compatible with rest-api-client expects (refs. #442).

What

We'd like to provide a way to generate type definitions, which are compatible with rest-api-client, automatically.

We could take some options to fix the issue.

  1. Adding a feature to generate type definitions to be able to use with rest-api-client into dts-gen.
  2. Creating a new package to generate type definitions to be able to use with rest-api-client.

Now, we have several types for a Kintone record type like the following.

  • JS API
  • API Response
  • API Request

So we have to sort each type definition respectively.

@koba04 koba04 added Epic feature New feature pkg: rest-api-client @kintone/rest-api-client pkg: dts-gen @kintone/dts-gen labels Oct 5, 2020
@mura-
Copy link
Contributor

mura- commented Oct 12, 2020

@koba04

I'm looking forward to fix this issue.

Could you tell me the expected date when new package including #404 will be released?
I want to use the new version as soon as possible 😀

@koba04
Copy link
Contributor Author

koba04 commented Oct 12, 2020

@mura-
We've just released a new version that includes #404 as kintone/rest-api-client@1.6.0.
Please let us know If you have a problem with the types!

@mura-
Copy link
Contributor

mura- commented Oct 12, 2020

@koba04
Thank you so much!!!
I will try it! 🙏 🙏 🙏

@potaracom
Copy link
Contributor

Can't wait!

@Lorenzras
Copy link

What's the status of this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Epic feature New feature pkg: dts-gen @kintone/dts-gen pkg: rest-api-client @kintone/rest-api-client
Projects
None yet
Development

No branches or pull requests

4 participants