-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated programmatically by calling `gcloud services list --available` and then doing enough post-processing to clean up duplicate and missing titles somewhat arbitrarily.
- Loading branch information
Showing
8 changed files
with
213,608 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/.env | ||
/_bundles | ||
/dist | ||
/docs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import cli from '@battis/qui-cli'; | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
import * as url from 'url'; | ||
|
||
const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); | ||
|
||
cli.init({ shell: { silent: true, showCommands: false } }); | ||
let spinner = cli.spinner('Loading Google API services...'); | ||
const services = JSON.parse( | ||
cli.shell.exec( | ||
`gcloud services list --available --filter=name:googleapis.com --format=json --project=${process.env.PROJECT} --quiet` | ||
).stdout | ||
); | ||
spinner.succeed('Google API services loaded'); | ||
|
||
spinner = cli.spinner('Writing src/services/API.ts...'); | ||
fs.writeFileSync( | ||
path.join(__dirname, '../../src/services/API.ts'), | ||
`export const API = { | ||
${services | ||
.map( | ||
(service) => | ||
` ${service.config.title.replace(/[^a-z0-9]+/gi, '')}: '${ | ||
service.config.name | ||
}',` | ||
) | ||
.join('\n')} | ||
}; | ||
export default API;` | ||
); | ||
spinner.succeed('Wrote src/services/API.ts'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.