Skip to content

fflorent/poc-grist-codegen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

POC for a Typescript Grist client

This is a POC for a Typescript Grist API client.

It uses openapi-typescript-codegen to generate the API client and the OpenAPI documentation of Grist (source code).

What should I look at?

What interest us is the process that generates the client (./generate_client.sh) and also the use of the client (./cli-sample.ts).

Quick start for the POC demo

Just run the following commands:

$ npm install
$ npm run generate-client
$ ts-node ./cli-sample.ts --help

To list the content of a table:

$ ts-node ./cli-sample.ts -b BEARER -d DOC_ID -t TABLE_ID -u http://localhost:8484/api

To insert a record (replace the JSON by whatever you want to insert in the given table):

$ ts-node ./cli-sample.ts -b BEARER -d DOC_ID -t TABLE_ID -u http://localhost:8484/api --recordToAdd '{"Name": "Some-Name", "Email": "[email protected]"}'

How does this work?

Openapi-typescript-codegen parses the content of the yaml file and generates a client and the models to pass to the Client so it can handle the requests.

About

POC for a Typescript Grist client

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published