https://github.com/vkcom/api-schema-typescript-generator
https://github.com/vkcom/api-schema-typescript-generator
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/vkcom/api-schema-typescript-generator
- Owner: VKCOM
- License: mit
- Created: 2020-06-22T08:20:29.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2025-01-23T07:55:52.000Z (over 1 year ago)
- Last Synced: 2025-01-23T08:29:25.813Z (over 1 year ago)
- Language: TypeScript
- Size: 669 KB
- Stars: 13
- Watchers: 16
- Forks: 2
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# VK API Schema Typescript Generator
[](https://www.npmjs.com/package/@vkontakte/api-schema-typescript-generator)
This package generates TypeScript typings based on the [VK API JSON schema](https://github.com/VKCOM/vk-api-schema).
## Usage
#### Via npx:
```shell script
npx @vkontakte/api-schema-typescript-generator --schemaDir ./schema --outDir ./types/api --methods '*'
```
#### Via installed dependency:
```shell script
yarn add @vkontakte/api-schema-typescript-generator
vk-api-schema-typescript-generator --schemaDir ./schema --outDir ./types/api --methods 'messages.*'
```
### Options
#### --help
Shows help.
#### --schemaDir
The relative path to directory with `methods.json`, `objects.json` and `responses.json` files.
#### --outDir
The directory where the files will be generated.
If you skip this param, script will work in linter mode without emitting files to file system.
> **Please note** that this folder will be cleared after starting the generation.
#### --methods
List of methods to generate responses and all needed objects.
Examples:
- `'*'` – to generate all responses and objects.
- `'messages.*, users.get, groups.isMember'` - to generate all methods from messages section, users.get and groups.isMember.