Skip to content

Commit

Permalink
feat!: initial stub of library
Browse files Browse the repository at this point in the history
  • Loading branch information
sofisl committed Dec 22, 2020
1 parent 4400191 commit 39f033e
Show file tree
Hide file tree
Showing 37 changed files with 21,493 additions and 3 deletions.
6 changes: 6 additions & 0 deletions packages/google-cloud-policytroubleshooter/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
**/node_modules
**/coverage
test/fixtures
build/
docs/
protos/
3 changes: 3 additions & 0 deletions packages/google-cloud-policytroubleshooter/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "./node_modules/gts"
}
4 changes: 4 additions & 0 deletions packages/google-cloud-policytroubleshooter/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.ts text eol=lf
*.js text eol=lf
protos/* linguist-generated
**/api-extractor.json linguist-language=JSON-with-Comments
14 changes: 14 additions & 0 deletions packages/google-cloud-policytroubleshooter/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
**/*.log
**/node_modules
.coverage
coverage
.nyc_output
docs/
out/
build/
system-test/secrets.js
system-test/*key.json
*.lock
.DS_Store
package-lock.json
__pycache__
55 changes: 55 additions & 0 deletions packages/google-cloud-policytroubleshooter/.jsdoc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Copyright 2020 Google LLC
//
// 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
//
// https://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.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **

'use strict';

module.exports = {
opts: {
readme: './README.md',
package: './package.json',
template: './node_modules/jsdoc-fresh',
recurse: true,
verbose: true,
destination: './docs/'
},
plugins: [
'plugins/markdown',
'jsdoc-region-tag'
],
source: {
excludePattern: '(^|\\/|\\\\)[._]',
include: [
'build/src',
'protos'
],
includePattern: '\\.js$'
},
templates: {
copyright: 'Copyright 2020 Google LLC',
includeDate: false,
sourceFiles: false,
systemName: '@google-cloud/policy-troubleshooter',
theme: 'lumen',
default: {
outputSourceFiles: false
}
},
markdown: {
idInHeadings: true
}
};
29 changes: 29 additions & 0 deletions packages/google-cloud-policytroubleshooter/.mocharc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright 2020 Google LLC
//
// 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.
const config = {
"enable-source-maps": true,
"throw-deprecation": true,
"timeout": 10000,
"recursive": true
}
if (process.env.MOCHA_THROW_DEPRECATION === 'false') {
delete config['throw-deprecation'];
}
if (process.env.MOCHA_REPORTER) {
config.reporter = process.env.MOCHA_REPORTER;
}
if (process.env.MOCHA_REPORTER_OUTPUT) {
config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`;
}
module.exports = config
24 changes: 24 additions & 0 deletions packages/google-cloud-policytroubleshooter/.nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"report-dir": "./.coverage",
"reporter": ["text", "lcov"],
"exclude": [
"**/*-test",
"**/.coverage",
"**/apis",
"**/benchmark",
"**/conformance",
"**/docs",
"**/samples",
"**/scripts",
"**/protos",
"**/test",
"**/*.d.ts",
".jsdoc.js",
"**/.jsdoc.js",
"karma.conf.js",
"webpack-tests.config.js",
"webpack.config.js"
],
"exclude-after-remap": false,
"all": true
}
6 changes: 6 additions & 0 deletions packages/google-cloud-policytroubleshooter/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
**/node_modules
**/coverage
test/fixtures
build/
docs/
protos/
17 changes: 17 additions & 0 deletions packages/google-cloud-policytroubleshooter/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright 2020 Google LLC
//
// 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
//
// https://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.

module.exports = {
...require('gts/.prettierrc.json')
}
14 changes: 14 additions & 0 deletions packages/google-cloud-policytroubleshooter/.repo-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "policytroubleshooter",
"name_pretty": "IAM Policy Troubleshooter API",
"product_documentation": "https://cloud.google.com/iam/docs/troubleshooting-access#rest-api/",
"client_documentation": "https://googleapis.dev/nodejs/policytroubleshooter/latest/",
"issue_tracker": "https://github.com/googleapis/nodejs-policy-troubleshooter/issues",
"release_level": "GA",
"language": "nodejs",
"repo": "googleapis/nodejs-policy-troubleshooter",
"distribution_name": "@google-cloud/policy-troubleshooter",
"api_id": "policytroubleshooter.googleapis.com",
"requires_billing": true
}

41 changes: 39 additions & 2 deletions packages/google-cloud-policytroubleshooter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
* [Quickstart](#quickstart)
* [Before you begin](#before-you-begin)
* [Installing the client library](#installing-the-client-library)


* [Using the client library](#using-the-client-library)
* [Samples](#samples)
* [Versioning](#versioning)
* [Contributing](#contributing)
* [License](#license)
Expand All @@ -55,6 +55,43 @@ npm install @google-cloud/policy-troubleshooter
```


### Using the client library

```javascript
// Imports the Google Cloud client library

// remove this line after package is released
// eslint-disable-next-line node/no-missing-require
const {IamCheckerClient} = require('@google-cloud/policy-troubleshooter');

// TODO(developer): replace with your prefered project ID.
// const projectId = 'my-project'

// Creates a client
// eslint-disable-next-line no-unused-vars
const client = new {IamCheckerClient}();

//TODO(library generator): write the actual function you will be testing
async function doSomething() {
console.log('Developer! Change this code so that it shows how to use the library! See comments below on structure.')
// const [thing] = await client.methodName({
// });
// console.info(thing);
}
doSomething();

```



## Samples

Samples are in the [`samples/`](https://github.com/googleapis/nodejs-policy-troubleshooter/tree/master/samples) directory. The samples' `README.md`
has instructions for running the samples.

| Sample | Source Code | Try it |
| --------------------------- | --------------------------------- | ------ |
| Quickstart | [source code](https://github.com/googleapis/nodejs-policy-troubleshooter/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-policy-troubleshooter&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) |



Expand Down
Loading

0 comments on commit 39f033e

Please sign in to comment.