The clients in this repository are all automatically generated. They are generated using the Google Discovery Service. Most users of this library will not need to directly use the generator. This documentation is intended for users that need to maintain the repository, or build custom clients.
To run the generator locally:
- Clone the repository, and cd into the directory
- Run
npm install
- Run
npm run generate
This command will download all discovery files available via the discovery index, and run the code generator against those files.
There are some situations where you don't want to re-download the discovery files before running the generator. This is particularly useful in situations where you're working on the generator itself, and want to isolate the change. To prevent the generator from re-downloading the discovery files, run:
npm run generate -- --use-cache
As part of the npm run generate
command, discovery docs are downloaded. To only download discovery file updates, and not re-run the generator, run:
npm run download
This repository uses synthtool to re-generate the API on a nightly basis. The command npm run submit-prs
will perform a variety of steps:
- Download all discovery files (
npm run download
) - Run the generator (
npm run generate
) - Iterate over each directory in
src/apis
, and create a commit with only those changes - Submit a single PR with multiple commits, including a changelog
You can generate a single API based on a discovery URL. Replace the url and API name below to match the API you'd like to generate:
npm run build-tools
node build/src/generator/generator.js 'https://apigee.googleapis.com/$discovery/rest?version=v1'
Assuming that command completes successfully, you can access the output and test it out by navigating to the API subdirectory:
cd src/apis/apigee
npm install
If you want to distribute this package, which is common for APIs not listed in the discovery index, you can pack it to generate a tarball:
npm pack
Feel free to submit an issue!