diff --git a/docs/authentication.md b/docs/authentication.md index 7c26d1481ec..e48be4299ff 100644 --- a/docs/authentication.md +++ b/docs/authentication.md @@ -1,6 +1,6 @@ -## With `google-cloud` +## Authenticating with this module -With `google-cloud` it's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services. +It's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services. ```js var config = { diff --git a/docs/faq.md b/docs/faq.md index 64c2e28d46e..19c7540ba47 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -1,4 +1,4 @@ -## How do I use `gcloud-node` with Google Compute Engine? +## How do I use this module with Google Compute Engine? If you are running this client on Google Compute Engine, we handle authentication for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access. @@ -8,7 +8,7 @@ If you are running this client on Google Compute Engine, we handle authenticatio If you are not running this client on Google Compute Engine, you need a Google Developers service account. To create a service account, please see our [Authentication][auth-guide] guide. -## How do I use `gcloud-node` with AWS Lambda? +## How do I use this module with AWS Lambda? Our library uses some native libraries, which must be recompiled against the platform running your application. For AWS Lambda, we recommend using [lambda-packager](https://github.com/tomdale/lambda-packager) prior to deploying your code. @@ -17,7 +17,7 @@ Reference Issues: [#1287](https://github.com/GoogleCloudPlatform/gcloud-node/iss ## Does this replace [Google Cloud Node.js Client][googleapis]? -Google Cloud Node.js Client is a client library for using the broad set of Google APIs. `gcloud-node` is built specifically for the Google Cloud Platform and is the recommended way to integrate Google Cloud APIs into your Node.js applications. If your application requires both Google Cloud Platform and other Google APIs, the 2 libraries may be used together. +Google Cloud Node.js Client is a client library for using the broad set of Google APIs. This module is built specifically for the Google Cloud Platform and is the recommended way to integrate Google Cloud APIs into your Node.js applications. If your application requires both Google Cloud Platform and other Google APIs, the 2 libraries may be used together. [dev-console]: https://console.developers.google.com/project [gce-how-to]: https://developers.google.com/compute/docs/authentication#using diff --git a/docs/home.html b/docs/home.html index b7e26499341..5bdb9f855c2 100644 --- a/docs/home.html +++ b/docs/home.html @@ -22,7 +22,7 @@
- First, install google-cloud
with npm and require it into your project:
-
- If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to gcloud-node
— we figure that out for you.
-
- However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests. -
-- The full set of options which can be passed to gcloud-node and sub-modules are outlined here. -
diff --git a/docs/toc.json b/docs/toc.json deleted file mode 100644 index 4559bf6387e..00000000000 --- a/docs/toc.json +++ /dev/null @@ -1,205 +0,0 @@ -{ - "overview": "overview.html", - "guides": [{ - "title": "Authentication", - "id": "authentication", - "edit": "https://github.com/GoogleCloudPlatform/gcloud-common/edit/master/authentication/readme.md", - "contents": [ - "https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/readme.md", - "authentication.md" - ] - }, { - "title": "FAQ", - "id": "faq", - "edit": "https://github.com/GoogleCloudPlatform/gcloud-common/edit/master/faq/readme.md", - "contents": [ - "https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/faq/readme.md", - "faq.md" - ] - }, { - "title": "Troubleshooting", - "id": "troubleshooting", - "edit": "https://github.com/GoogleCloudPlatform/gcloud-common/edit/master/troubleshooting/readme.md", - "contents": [ - "https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/troubleshooting/readme.md", - "troubleshooting.md" - ] - }, { - "title": "Contributing", - "id": "contributing", - "edit": "https://github.com/GoogleCloudPlatform/gcloud-common/edit/master/contributing/readme.md", - "contents": "https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/contributing/readme.md" - }], - "services": [{ - "title": "gcloud", - "type": "gcloud" - }, { - "title": "BigQuery", - "type": "bigquery", - "nav": [{ - "title": "Dataset", - "type": "bigquery/dataset" - }, { - "title": "Table", - "type": "bigquery/table" - }, { - "title": "Job", - "type": "bigquery/job" - }] - }, { - "title": "Bigtable", - "type": "bigtable", - "nav": [{ - "title": "Table", - "type": "bigtable/table" - }, { - "title": "Family", - "type": "bigtable/family" - }, { - "title": "Row", - "type": "bigtable/row" - }, { - "title": "Filter", - "type": "bigtable/filter" - }] - }, { - "title": "Compute", - "type": "compute", - "nav": [{ - "title": "Address", - "type": "compute/address" - }, { - "title": "Autoscaler", - "type": "compute/autoscaler" - }, { - "title": "Disk", - "type": "compute/disk" - }, { - "title": "Firewall", - "type": "compute/firewall" - }, { - "title": "HealthCheck", - "type": "compute/health-check" - }, { - "title": "InstanceGroup", - "type": "compute/instance-group" - }, { - "title": "MachineType", - "type": "compute/machine-type" - }, { - "title": "Network", - "type": "compute/network" - }, { - "title": "Operation", - "type": "compute/operation" - }, { - "title": "Region", - "type": "compute/region" - }, { - "title": "Rule", - "type": "compute/rule" - }, { - "title": "Service", - "type": "compute/service" - }, { - "title": "Snapshot", - "type": "compute/snapshot" - }, { - "title": "Subnetwork", - "type": "compute/subnetwork" - }, { - "title": "VM", - "type": "compute/vm" - }, { - "title": "Zone", - "type": "compute/zone" - }] - }, { - "title": "DNS", - "type": "dns", - "nav": [{ - "title": "Zone", - "type": "dns/zone" - }, { - "title": "Record", - "type": "dns/record" - }, { - "title": "Change", - "type": "dns/change" - }] - }, { - "title": "Datastore", - "type": "datastore", - "nav": [{ - "title": "Query", - "type": "datastore/query" - }, { - "title": "Transaction", - "type": "datastore/transaction" - }] - }, { - }, { - "title": "Language", - "type": "language", - "nav": [{ - "title": "Document", - "type": "language/document" - }] - }, { - "title": "Logging", - "type": "logging", - "nav": [{ - "title": "Sink", - "type": "logging/sink" - }, { - "title": "Log", - "type": "logging/log" - }, { - "title": "Entry", - "type": "logging/entry" - }] - }, { - "title": "Prediction", - "type": "prediction", - "nav": [{ - "title": "Model", - "type": "prediction/model" - }] - }, { - "title": "PubSub", - "type": "pubsub", - "nav": [{ - "title": "Topic", - "type": "pubsub/topic" - }, { - "title": "Subscription", - "type": "pubsub/subscription" - }] - }, { - "title": "Resource", - "type": "resource", - "nav": [{ - "title": "Project", - "type": "resource/project" - }] - }, { - "title": "Storage", - "type": "storage", - "nav": [{ - "title": "Bucket", - "type": "storage/bucket" - }, { - "title": "File", - "type": "storage/file" - }, { - "title": "Channel", - "type": "storage/channel" - }] - }, { - "title": "Translate", - "type": "translate" - }, { - "title": "Vision", - "type": "vision" - }] -} diff --git a/package.json b/package.json index 79b0e2fa44b..cf7e719ce85 100644 --- a/package.json +++ b/package.json @@ -10,11 +10,14 @@ "istanbul": "^0.3.5", "jscs": "^2.1.1", "jshint": "^2.9.1", + "lodash.template": "^4.3.0", "mitm": "^1.1.0", + "mkdirp": "^0.5.1", "mocha": "^3.0.1", "propprop": "^0.3.0", "proxyquire": "^1.7.10", "request": "^2.70.0", + "semver": "^5.3.0", "shelljs": "^0.7.3", "string-format-obj": "^1.0.0", "through2": "^2.0.0" @@ -23,7 +26,8 @@ "link-modules": "node ./scripts/link.js", "install-module-dependencies": "node ./scripts/install.js", "postinstall": "npm run link-modules && npm run install-module-dependencies", - "docs": "node ./scripts/docs.js", + "docs": "node ./scripts/docs/packages.js", + "bundle": "node ./scripts/docs/bundle.js", "lint": "jshint scripts/ packages/ system-test/ test/ && jscs packages/ system-test/ test/", "test": "npm run docs && mocha test/docs.js packages/*/test/*.js", "system-test": "mocha packages/*/system-test/*.js --no-timeouts --bail", diff --git a/packages/bigquery/package.json b/packages/bigquery/package.json index 7f813064a51..a39b92df288 100644 --- a/packages/bigquery/package.json +++ b/packages/bigquery/package.json @@ -68,7 +68,7 @@ "proxyquire": "^1.7.10" }, "scripts": { - "publish": "node ../../scripts/publish.js", + "publish": "node ../../scripts/publish.js bigquery", "test": "mocha test/*.js", "system-test": "mocha system-test/*.js --no-timeouts --bail" }, diff --git a/packages/bigtable/package.json b/packages/bigtable/package.json index 7a380de3344..cad829fe52c 100644 --- a/packages/bigtable/package.json +++ b/packages/bigtable/package.json @@ -74,7 +74,7 @@ "sinon": "^1.17.4" }, "scripts": { - "publish": "node ../../scripts/publish.js", + "publish": "node ../../scripts/publish.js bigtable", "test": "mocha test/*.js", "system-test": "mocha system-test/*.js --no-timeouts --bail" }, diff --git a/packages/common/package.json b/packages/common/package.json index 3816df460d7..12c0066fdc1 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -66,7 +66,7 @@ "sinon": "^1.17.4" }, "scripts": { - "publish": "node ../../scripts/publish.js", + "publish": "node ../../scripts/publish.js common", "test": "mocha test/*.js" }, "license": "Apache-2.0", diff --git a/packages/compute/package.json b/packages/compute/package.json index 8f98df196da..c54c67ee47c 100644 --- a/packages/compute/package.json +++ b/packages/compute/package.json @@ -67,7 +67,7 @@ "proxyquire": "^1.7.10" }, "scripts": { - "publish": "node ../../scripts/publish.js", + "publish": "node ../../scripts/publish.js compute", "test": "mocha test/*.js", "system-test": "mocha system-test/*.js --no-timeouts --bail" }, diff --git a/packages/datastore/package.json b/packages/datastore/package.json index 2c5b85981c6..a263e973f87 100644 --- a/packages/datastore/package.json +++ b/packages/datastore/package.json @@ -70,7 +70,7 @@ "through2": "^2.0.0" }, "scripts": { - "publish": "node ../../scripts/publish.js", + "publish": "node ../../scripts/publish.js datastore", "test": "mocha test/*.js", "system-test": "mocha system-test/*.js --no-timeouts --bail" }, diff --git a/packages/dns/package.json b/packages/dns/package.json index d9c654e05f5..ca4758e0222 100644 --- a/packages/dns/package.json +++ b/packages/dns/package.json @@ -66,7 +66,7 @@ "tmp": "0.0.27" }, "scripts": { - "publish": "../../scripts/publish", + "publish": "../../scripts/publish dns", "test": "mocha test/*.js", "system-test": "mocha system-test/*.js --no-timeouts --bail" }, diff --git a/packages/google-cloud/package.json b/packages/google-cloud/package.json index cf285cd1c31..2b6bbcac640 100644 --- a/packages/google-cloud/package.json +++ b/packages/google-cloud/package.json @@ -112,7 +112,7 @@ "proxyquire": "^1.7.10" }, "scripts": { - "publish": "node ../../scripts/publish.js", + "publish": "node ../../scripts/publish.js google-cloud", "test": "mocha test/*.js", "system-test": "mocha system-test/*.js --no-timeouts --bail" }, diff --git a/packages/language/package.json b/packages/language/package.json index 4bc72b4e34d..1fba4ae22d4 100644 --- a/packages/language/package.json +++ b/packages/language/package.json @@ -66,7 +66,7 @@ "proxyquire": "^1.7.10" }, "scripts": { - "publish": "../../scripts/publish.sh", + "publish": "../../scripts/publish.js language", "test": "mocha test/*.js", "system-test": "mocha system-test/*.js --no-timeouts --bail" }, diff --git a/packages/logging/package.json b/packages/logging/package.json index f8446a2051d..bc6ddb27e9c 100644 --- a/packages/logging/package.json +++ b/packages/logging/package.json @@ -69,7 +69,7 @@ "proxyquire": "^1.7.10" }, "scripts": { - "publish": "node ../../scripts/publish.js", + "publish": "node ../../scripts/publish.js logging", "test": "mocha test/*.js", "system-test": "mocha system-test/*.js --no-timeouts --bail" }, diff --git a/packages/prediction/package.json b/packages/prediction/package.json index 4ed3f077fad..edca3058bec 100644 --- a/packages/prediction/package.json +++ b/packages/prediction/package.json @@ -69,7 +69,7 @@ "proxyquire": "^1.7.10" }, "scripts": { - "publish": "node ../../scripts/publish.js", + "publish": "node ../../scripts/publish.js prediction", "test": "mocha test/*.js", "system-test": "mocha system-test/*.js --no-timeouts --bail" }, diff --git a/packages/pubsub/package.json b/packages/pubsub/package.json index 4f00494edaa..e363592c103 100644 --- a/packages/pubsub/package.json +++ b/packages/pubsub/package.json @@ -64,7 +64,7 @@ "proxyquire": "^1.7.10" }, "scripts": { - "publish": "node ../../scripts/publish.js", + "publish": "node ../../scripts/publish.js pubsub", "test": "mocha test/*.js", "system-test": "mocha system-test/*.js --no-timeouts --bail" }, diff --git a/packages/resource/package.json b/packages/resource/package.json index 7c9ddda01bd..5ab801acfbc 100644 --- a/packages/resource/package.json +++ b/packages/resource/package.json @@ -61,7 +61,7 @@ "proxyquire": "^1.7.10" }, "scripts": { - "publish": "node ../../scripts/publish.js", + "publish": "node ../../scripts/publish.js resource", "test": "mocha test/*.js", "system-test": "mocha system-test/*.js --no-timeouts --bail" }, diff --git a/packages/storage/package.json b/packages/storage/package.json index e9ac01ca2d8..b33ffea7181 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -78,7 +78,7 @@ "tmp": "0.0.27" }, "scripts": { - "publish": "node ../../scripts/publish.js", + "publish": "node ../../scripts/publish.js storage", "test": "mocha test/*.js", "system-test": "mocha system-test/*.js --no-timeouts --bail" }, diff --git a/packages/translate/package.json b/packages/translate/package.json index dddacb796b9..9b1659a3380 100644 --- a/packages/translate/package.json +++ b/packages/translate/package.json @@ -61,7 +61,7 @@ "proxyquire": "^1.7.10" }, "scripts": { - "publish": "node ../../scripts/publish.js", + "publish": "node ../../scripts/publish.js translate", "test": "mocha test/*.js", "system-test": "mocha system-test/*.js --no-timeouts --bail" }, diff --git a/packages/vision/package.json b/packages/vision/package.json index b482877cbe3..7e13fa7a321 100644 --- a/packages/vision/package.json +++ b/packages/vision/package.json @@ -71,7 +71,7 @@ "tmp": "0.0.27" }, "scripts": { - "publish": "node ../../scripts/publish.js", + "publish": "node ../../scripts/publish.js vision", "test": "mocha test/*.js", "system-test": "mocha system-test/*.js --no-timeouts --bail" }, diff --git a/scripts/build.sh b/scripts/build.sh index d9bde937207..b0f3f2b7015 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -28,9 +28,8 @@ if [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ] # add new docs to the gh-pages branch git submodule add -b gh-pages https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} ghpages # copy all the docs file that might have changed, excluding versions.txt (to avoid overriding it) - cp -R docs/json/master/* ghpages/json/master - cp docs/*{.md,.html} ghpages/json/master - cp docs/toc.json ghpages/json/master + cp -R docs/json/* ghpages/json + npm run bundle cp docs/home.html ghpages/json cp docs/manifest.json ghpages cd ghpages diff --git a/scripts/docs/base-toc.json b/scripts/docs/base-toc.json new file mode 100644 index 00000000000..17f3e80a931 --- /dev/null +++ b/scripts/docs/base-toc.json @@ -0,0 +1,32 @@ +{ + "guides": [{ + "title": "Authentication", + "id": "authentication", + "edit": "https://github.com/GoogleCloudPlatform/gcloud-common/edit/master/authentication/readme.md", + "contents": [ + "https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/readme.md", + "authentication.md" + ] + }, { + "title": "FAQ", + "id": "faq", + "edit": "https://github.com/GoogleCloudPlatform/gcloud-common/edit/master/faq/readme.md", + "contents": [ + "https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/faq/readme.md", + "faq.md" + ] + }, { + "title": "Troubleshooting", + "id": "troubleshooting", + "edit": "https://github.com/GoogleCloudPlatform/gcloud-common/edit/master/troubleshooting/readme.md", + "contents": [ + "https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/troubleshooting/readme.md", + "troubleshooting.md" + ] + }, { + "title": "Contributing", + "id": "contributing", + "edit": "https://github.com/GoogleCloudPlatform/gcloud-common/edit/master/contributing/readme.md", + "contents": "https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/contributing/readme.md" + }] +} diff --git a/scripts/docs/bundle.js b/scripts/docs/bundle.js new file mode 100644 index 00000000000..fcdba004163 --- /dev/null +++ b/scripts/docs/bundle.js @@ -0,0 +1,223 @@ +/** + * Copyright 2014 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +var path = require('path'); +var globby = require('globby'); +var semver = require('semver'); +var mkdirp = require('mkdirp'); +var fs = require('fs'); +var async = require('async'); +var flatten = require('lodash.flatten'); +var parser = require('./parser'); +var config = require('./config'); + +// since we version the JSON in ghpages and we don't create tags for +// individual modules, we'll look for the appropriate semver version in +// the ghpages submodule +var JSON_DIR = './ghpages/json'; + +var pkgJson = require('../../packages/google-cloud/package.json'); +var dependencies = pkgJson.dependencies; + +var deps = Object.keys(dependencies).reduce(function(deps, dep) { + if (/^\@google\-cloud/.test(dep)) { + deps.push({ + packageName: dep.replace('@google-cloud/', ''), + semver: dependencies[dep] + }); + } + + return deps; +}, []); + +function getPackageVersion(dep, callback) { + var globOptions = { + cwd: path.join(JSON_DIR, dep.packageName) + }; + + globby('*', globOptions) + .then(function(versions) { + var validVersions = versions.filter(function(version) { + return semver.valid(version); + }); + + var version = semver.maxSatisfying(validVersions, dep.semver); + + if (!version) { + throw new Error( + 'Unable to find suitable version for package: ' + dep.packageName); + } + + callback(null, version); + }) + .then(null, callback); +} + +function getDocsFiles(packageName, version, callback) { + var globOptions = { + cwd: path.join(JSON_DIR, packageName), + ignore: [ + path.join(version, config.TYPES_DICT), + path.join(version, config.TOC) + ] + }; + + globby(path.join(version, '*.json'), globOptions) + .then(callback.bind(null, null), callback); +} + +function copyFile(dep, file, callback) { + var outputDir = path.join( + JSON_DIR, + config.UMBRELLA_PACKAGE, + config.DEFAULT_VERSION, + dep.packageName + ); + + mkdirp(outputDir, function(err) { + if (err) { + callback(err); + return; + } + + var inputFile = path.join( + JSON_DIR, + dep.packageName, + file + ); + + var outputFile = path.join( + outputDir, + path.basename(file) + ); + + fs.readFile(inputFile, 'utf8', function(err, contents) { + if (err) { + callback(err); + return; + } + + var fileJson = JSON.parse(contents); + var service = fileJson.parent || fileJson.id; + + fileJson.overview = parser.createOverview(service, true); + fs.writeFile(outputFile, JSON.stringify(fileJson), callback); + }); + }); +} + +function getTypes(dep, callback) { + var inputFile = path.join( + JSON_DIR, + dep.packageName, + dep.version, + config.TYPES_DICT + ); + + fs.readFile(inputFile, 'utf8', function(err, contents) { + var types = JSON.parse(contents); + + types.forEach(function(type) { + type.contents = path.join(dep.packageName, type.contents); + }); + + callback(null, types); + }); +} + +function createUmbrellaTypes(types, callback) { + var inputFile = path.join( + './docs/json', + config.UMBRELLA_PACKAGE, + config.DEFAULT_VERSION, + config.TYPES_DICT + ); + + fs.readFile(inputFile, 'utf8', function(err, contents) { + if (err) { + callback(err); + return; + } + + var umbrellaTypes = JSON.parse(contents); + var allTypes = umbrellaTypes.concat(types); + + var outputFile = path.join( + JSON_DIR, + config.UMBRELLA_PACKAGE, + config.DEFAULT_VERSION, + config.TYPES_DICT + ); + + fs.writeFile(outputFile, JSON.stringify(allTypes), function(err) { + callback(err, allTypes); + }); + }); +} + +function createUmbrellaToc(types, callback) { + var outputFile = path.join( + JSON_DIR, + config.UMBRELLA_PACKAGE, + config.DEFAULT_VERSION, + config.TOC + ); + + var toc = parser.createToc(types, true); + + fs.writeFile(outputFile, JSON.stringify(toc), callback); +} + +async.map(deps, function(dep, callback) { + async.waterfall([ + function(callback) { + getPackageVersion(dep, callback); + }, + function(version, callback) { + dep.version = version; + getDocsFiles(dep.packageName, version, callback); + }, + function(files, callback) { + async.each(files, copyFile.bind(null, dep), callback); + } + ], function(err) { + if (err) { + callback(err); + return; + } + + getTypes(dep, callback); + }); +}, function(err, types) { + if (err) { + throw err; + } + + async.waterfall([ + function(callback) { + createUmbrellaTypes(flatten(types), callback); + }, + function(types, callback) { + createUmbrellaToc(types, callback); + } + ], function(err) { + if (err) { + throw err; + } + }); +}); diff --git a/scripts/docs/config.js b/scripts/docs/config.js new file mode 100644 index 00000000000..f8d6f42844c --- /dev/null +++ b/scripts/docs/config.js @@ -0,0 +1,79 @@ +/** + * Copyright 2014 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +module.exports = { + UMBRELLA_PACKAGE: 'google-cloud', + DEFAULT_VERSION: 'master', + TYPES_DICT: 'types.json', + TOC: 'toc.json', + IGNORE: [ + 'common', + 'datastore/src/entity.js', + 'datastore/src/request.js', + 'pubsub/src/iam.js', + 'storage/src/acl.js', + 'bigtable/src/mutation.js' + ], + OVERVIEW_TEMPLATE: 'overview.template.html', + OVERVIEW: { + 'google-cloud': { + title: 'Google Cloud', + instanceName: 'gcloud' + }, + bigquery: { + title: 'Google BigQuery' + }, + bigtable: { + title: 'Google Cloud Bigtable' + }, + compute: { + title: 'Google Compute Engine' + }, + datastore: { + title: 'Google Cloud Datastore' + }, + dns: { + title: 'Google Cloud DNS' + }, + language: { + title: 'Google Cloud Natural Language' + }, + logging: { + title: 'Google Cloud Logging' + }, + prediction: { + title: 'Google Prediction API' + }, + pubsub: { + title: 'Google Cloud Pub/Sub' + }, + resource: { + title: 'Google Cloud Resource Manager' + }, + storage: { + title: 'Google Cloud Storage', + instanceName: 'gcs' + }, + translate: { + title: 'Google Translate API' + }, + vision: { + title: 'Google Cloud Vision' + } + } +}; diff --git a/scripts/docs/overview.template.html b/scripts/docs/overview.template.html new file mode 100644 index 00000000000..96ef91725a4 --- /dev/null +++ b/scripts/docs/overview.template.html @@ -0,0 +1,42 @@ ++ This class allows you interact with <%= title %>. +
+ +
+ First, install <%= pkgJson.name %>
with npm:
+
+ If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to <%= pkgJson.name %>
— we figure that out for you.
+
+ However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests. +
+ +
+ The full set of options which can be passed to <%= pkgJson.name %>
are outlined in our Authentication guide.
+