Global

Methods

(async) addFragments(schema)

Given a top level Schema, collect every method on all resource objects. Generate a sample, format it, and attach to the method.fragment field.

Parameters:
Name Type Description
schema

Top level schema for the API.

cleanComments(str)

Clean a string of comment tags.

Parameters:
Name Type Description
str

String to process

Returns:
Type Description

Single line string processed

createChangelog()

Given a set of changes, generate a changelog.

(async) downloadDiscoveryDocs(options)

Download all discovery documents into the /discovery directory.

Parameters:
Name Type Description
options

flattenObject()

Given a complex nested object, flatten the key paths so this: { a: { b: 2 }, c: 3 } becomes ... { 'a.b': 2 c: 3 }

flattenSchema()

Provide a flattened representation of what the structure for a given request or response could look like.

(async) generateSamples(apiPath, schema)

Generate all samples, and write them into the samples folder on disk.

Parameters:
Name Type Description
apiPath

Location on disk where the API lives.

schema

The top level Schema containing API information.

getAllMethods(bag, methods)

Iterate over items in the schema recursively, and return a flattened list of all methods.

Parameters:
Name Type Description
bag
methods

getDiffs()

Get a diff between the two

getSemverity()

Given a set of changes, figure out if the total changeset is semver patch, minor, or major.

(async) main()

Reach out to google-cloud-node, and get a list of available client libraries that are veneer or GAPIC. Use that to populate a JSON file that will be used during generation to call out improved clients in READMEs for a given API.

To use this, run node build/src/generator/disclaimers.

(async) main()

Iterate over each API directory, and use the compodoc tool to generate reference API documentation in the docs folder. This folder is ignored in git, so a publish must be done with npm run publish-docs.

To use this, run npm run generate-docs.

shouldUpdate(newDoc, oldDoc)

Determine if any of the changes in the discovery docs were interesting

Parameters:
Name Type Description
newDoc

New downloaded schema

oldDoc

The existing schema from disk

sortKeys(obj)

Given an arbitrary object, recursively sort the properties on the object by the name of the key. For example: { b: 1, a: 2 } becomes.... { a: 2, b: 1 }

Parameters:
Name Type Description
obj

Object to be sorted

Returns:
Type Description

object with sorted keys

unRegex(regex)

Attempt to turn a regex into a more human readable form.

Parameters:
Name Type Description
regex

pattern for the given parameter