CLI for generating a communibase.d.ts
for a specific administration.
Quick and easy:
npx communibase-types-generator -D @types -k <api-key>
Will generate @types/communibase.d.ts
for the given api-key administration.
types are declared in namespace Communibase
(i.e. Communibase.Address
)
This project makes the following multi-cli solution easier;
-
Generate the
swagger.json
from the administrationnpx communibase-swagger <administrationKey> `./@types/swagger.json`
-
Generate the
swagger.d.ts
from theswagger.json
npx dtsgenerator --out ./@types/swagger.d.ts ./@types/swagger.json
-
Change the
./@types/swagger.d.ts
to export the namespace---declare namespace Definitions { +++export namespace Definitions {