diff --git a/packages/google-cloud-securitycenter/.jsdoc.js b/packages/google-cloud-securitycenter/.jsdoc.js index bf57e3f53da..a67138482f6 100644 --- a/packages/google-cloud-securitycenter/.jsdoc.js +++ b/packages/google-cloud-securitycenter/.jsdoc.js @@ -20,7 +20,7 @@ module.exports = { opts: { readme: './README.md', package: './package.json', - template: './node_modules/ink-docstrap/template', + template: './node_modules/jsdoc-baseline', recurse: true, verbose: true, destination: './docs/' diff --git a/packages/google-cloud-securitycenter/README.md b/packages/google-cloud-securitycenter/README.md index 4a3a9280915..d64c54c7f64 100644 --- a/packages/google-cloud-securitycenter/README.md +++ b/packages/google-cloud-securitycenter/README.md @@ -8,7 +8,7 @@ [![npm version](https://img.shields.io/npm/v/@google-cloud/security-center.svg)](https://www.npmjs.org/package/@google-cloud/security-center) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-security-center/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-security-center) -[Cloud Security Command Center](https://cloud.google.com/security-center/docs/) helps security teams gather data, identify threats, and act on them before they result in business damage or loss. It offers deep insight into application and data risk so that you can quickly mitigate threats to your cloud resources and evaluate overall health. With Cloud Security Command Center, you can view and monitor an inventory of your cloud assets, scan storage systems for sensitive data, detect common web vulnerabilities, and review access rights to your critical resources, all from a single, centralized dashboard. +[Cloud Security Command Center](https://cloud.google.com/security-command-center/docs/) helps security teams gather data, identify threats, and act on them before they result in business damage or loss. It offers deep insight into application and data risk so that you can quickly mitigate threats to your cloud resources and evaluate overall health. With Cloud Security Command Center, you can view and monitor an inventory of your cloud assets, scan storage systems for sensitive data, detect common web vulnerabilities, and review access rights to your critical resources, all from a single, centralized dashboard. * [Using the client library](#using-the-client-library) @@ -33,7 +33,7 @@ ```javascript async function quickstart( - organization = 'YOUR_ORGANIZATION', // Your GCP organization + organization = 'YOUR_ORGANIZATION' // Your GCP organization ) { const sc = require('@google-cloud/security-center'); @@ -93,7 +93,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. [explained]: https://cloud.google.com/apis/docs/client-libraries-explained [client-docs]: https://cloud.google.com/nodejs/docs/reference/security-center/latest/ -[product-docs]: https://cloud.google.com/security-center/docs/ +[product-docs]: https://cloud.google.com/security-command-center/docs/ [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index edd1d7b3bb4..9615db9cab6 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -49,7 +49,7 @@ "eslint-config-prettier": "^3.0.0", "eslint-plugin-node": "^8.0.0", "eslint-plugin-prettier": "^3.0.0", - "ink-docstrap": "^1.3.0", + "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.5.5", "mocha": "^5.0.0", diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js index 711883d5969..7d2cac8744f 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js @@ -27,13 +27,13 @@ * "organizations/123/sources/456" * * @property {string} displayName - * The source's display name. - * A source's display name must be unique amongst its siblings, for example, + * The source’s display name. + * A source’s display name must be unique amongst its siblings, for example, * two sources with the same parent can't share the same display name. * The display name must start and end with a letter or digit, may contain * letters, digits, spaces, hyphens, and underscores, and can be no longer - * than 32 characters. This is captured by the regular expression: - * [\p{L}\p{N}](https://cloud.google.com{\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?. + * than 30 characters. This is captured by the regular expression: + * `\[\p{L}\p{N}]({\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?`. * * @property {string} description * The description of the source (max of 1024 characters). @@ -50,4 +50,4 @@ */ const Source = { // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file +}; diff --git a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js index 1ebe2e6e1a5..1cc64cbed80 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js +++ b/packages/google-cloud-securitycenter/src/v1beta1/doc/google/protobuf/doc_timestamp.js @@ -87,13 +87,11 @@ * 01:30 UTC on January 15, 2017. * * In JavaScript, one can convert a Date object to this format using the - * standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString] + * standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) * method. In Python, a standard `datetime.datetime` object can be converted * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one - * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://cloud.google.com - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime-- - * ) to obtain a formatter capable of generating timestamps in this format. + * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--) to obtain a formatter capable of generating timestamps in this format. * * @property {number} seconds * Represents seconds of UTC time since Unix epoch diff --git a/packages/google-cloud-securitycenter/synth.py b/packages/google-cloud-securitycenter/synth.py index 75371a5a4c7..f25c5a7dbb6 100644 --- a/packages/google-cloud-securitycenter/synth.py +++ b/packages/google-cloud-securitycenter/synth.py @@ -31,6 +31,20 @@ templates = common_templates.node_library() s.copy(templates) +s.replace('src/v1beta1/doc/google/cloud/securitycenter/v1beta1/doc_source.js', + r"\[\\p\{L\}\\p\{N\}\]\(https:\/\/cloud\.google\.com\{\\p\{L\}\\p\{N\}_- \]\{0\,30\}\[\\p\{L\}\\p\{N\}\]\)\?", + r"`\[\p{L}\p{N}]({\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?`") + +# [START fix-dead-link] +s.replace('**/doc/google/protobuf/doc_timestamp.js', + 'https:\/\/cloud\.google\.com[\s\*]*http:\/\/(.*)[\s\*]*\)', + r"https://\1)") + +s.replace('**/doc/google/protobuf/doc_timestamp.js', + 'toISOString\]', + 'toISOString)') +# [END fix-dead-link] + # Node.js specific cleanup subprocess.run(['npm', 'install']) subprocess.run(['npm', 'run', 'fix'])