diff --git a/packages/google-cloud-managedidentities/README.md b/packages/google-cloud-managedidentities/README.md index aa3ca4c7485..48ed2b142bf 100644 --- a/packages/google-cloud-managedidentities/README.md +++ b/packages/google-cloud-managedidentities/README.md @@ -5,7 +5,7 @@ # [Managed Service for Microsoft Active Directory: Node.js Client](https://github.com/googleapis/nodejs-managed-identities) [![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) -[![npm version](https://img.shields.io/npm/v/managedidentities.svg)](https://www.npmjs.org/package/managedidentities) +[![npm version](https://img.shields.io/npm/v/@google-cloud/managed-identities.svg)](https://www.npmjs.org/package/@google-cloud/managed-identities) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-managed-identities/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-managed-identities) @@ -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) @@ -51,11 +51,50 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. ### Installing the client library ```bash -npm install managedidentities +npm install @google-cloud/managed-identities +``` + + +### 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 { + ManagedIdentitiesServiceClient, +} = require('@google-cloud/managed-identities'); + +// 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 ManagedIdentitiesServiceClient(); + +//TODO(library generator): write the actual function you will be testing +async function listDomains() { + const domains = await client.listDomains({ + parent: `projects/${projectId}/locations/global`, + }); + console.info(domains); +} +listDomains(); + ``` +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-managed-identities/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-managed-identities/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-managed-identities&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | + The [Managed Service for Microsoft Active Directory Node.js Client API Reference][client-docs] documentation diff --git a/packages/google-cloud-managedidentities/linkinator.config.json b/packages/google-cloud-managedidentities/linkinator.config.json index 29a223b6db6..c94edc51f54 100644 --- a/packages/google-cloud-managedidentities/linkinator.config.json +++ b/packages/google-cloud-managedidentities/linkinator.config.json @@ -1,10 +1 @@ -{ - "recurse": true, - "skip": [ - "https://codecov.io/gh/googleapis/", - "www.googleapis.com", - "img.shields.io" - ], - "silent": true, - "concurrency": 10 -} +{"recurse":true,"skip":["https://googleapis.dev/nodejs/managedidentities/latest/","https://github.com/googleapis/nodejs-managed-identities/blob/master/CHANGELOG.md","https://github.com/googleapis/nodejs-managed-identities/tree/master/samples","https://github.com/googleapis/nodejs-managed-identities/blob/master/samples/quickstart.js","http://localhost:5542/","https://codecov.io/gh/googleapis/","www.googleapis.com","img.shields.io"],"silent":true,"concurrency":10} \ No newline at end of file diff --git a/packages/google-cloud-managedidentities/package.json b/packages/google-cloud-managedidentities/package.json index 75856398728..01d61e94dc0 100644 --- a/packages/google-cloud-managedidentities/package.json +++ b/packages/google-cloud-managedidentities/package.json @@ -1,8 +1,8 @@ { - "name": "managedidentities", + "name": "@google-cloud/managed-identities", "version": "0.1.0", "description": "Managedidentities client for Node.js", - "repository": "googleapis/nodejs-managedidentities", + "repository": "googleapis/nodejs-managed-identities", "license": "Apache-2.0", "author": "Google LLC", "main": "build/src/index.js", @@ -34,28 +34,30 @@ "lint": "gts check", "prepare": "npm run compile-protos && npm run compile", "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" + "test": "c8 mocha build/test", + "samples-test": "cd samples/ && npm link ../ && npm test", + "prelint": "cd samples; npm link ../; npm i" }, "dependencies": { "google-gax": "^2.9.2" }, "devDependencies": { "@types/mocha": "^8.0.4", - "@types/node": "^14.14.8", - "@types/sinon": "^9.0.8", + "@types/node": "^14.14.10", + "@types/sinon": "^9.0.9", "c8": "^7.3.5", "gts": "^3.0.2", "jsdoc": "^3.6.6", "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.6", - "linkinator": "^2.2.2", + "linkinator": "^2.5.1", "mocha": "^8.2.1", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", "sinon": "^9.2.1", "ts-loader": "^8.0.11", - "typescript": "^4.0.5", - "webpack": "^5.5.1", + "typescript": "^4.1.2", + "webpack": "^5.9.0", "webpack-cli": "^4.2.0" }, "engines": { diff --git a/packages/google-cloud-managedidentities/protos/protos.js b/packages/google-cloud-managedidentities/protos/protos.js index 29e3fccc33e..eb6b2775ec7 100644 --- a/packages/google-cloud-managedidentities/protos/protos.js +++ b/packages/google-cloud-managedidentities/protos/protos.js @@ -28,7 +28,7 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace - var $root = $protobuf.roots.managedidentities_protos || ($protobuf.roots.managedidentities_protos = {}); + var $root = $protobuf.roots._google_cloud_managed_identities_protos || ($protobuf.roots._google_cloud_managed_identities_protos = {}); $root.google = (function() { diff --git a/packages/google-cloud-managedidentities/protos/protos.json b/packages/google-cloud-managedidentities/protos/protos.json index 6cd00ae841c..8d1609c105b 100644 --- a/packages/google-cloud-managedidentities/protos/protos.json +++ b/packages/google-cloud-managedidentities/protos/protos.json @@ -33,7 +33,24 @@ "(google.api.method_signature)": "parent,domain_name,domain", "(google.longrunning.operation_info).response_type": "Domain", "(google.longrunning.operation_info).metadata_type": "OpMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/global}/domains", + "body": "domain" + } + }, + { + "(google.api.method_signature)": "parent,domain_name,domain" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Domain", + "metadata_type": "OpMetadata" + } + } + ] }, "ResetAdminPassword": { "requestType": "ResetAdminPasswordRequest", @@ -42,7 +59,18 @@ "(google.api.http).post": "/v1/{name=projects/*/locations/global/domains/*}:resetAdminPassword", "(google.api.http).body": "*", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/global/domains/*}:resetAdminPassword", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "ListDomains": { "requestType": "ListDomainsRequest", @@ -50,7 +78,17 @@ "options": { "(google.api.http).get": "/v1/{parent=projects/*/locations/global}/domains", "(google.api.method_signature)": "parent" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/global}/domains" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] }, "GetDomain": { "requestType": "GetDomainRequest", @@ -58,7 +96,17 @@ "options": { "(google.api.http).get": "/v1/{name=projects/*/locations/global/domains/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/global/domains/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "UpdateDomain": { "requestType": "UpdateDomainRequest", @@ -69,7 +117,24 @@ "(google.api.method_signature)": "domain,update_mask", "(google.longrunning.operation_info).response_type": "Domain", "(google.longrunning.operation_info).metadata_type": "OpMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{domain.name=projects/*/locations/global/domains/*}", + "body": "domain" + } + }, + { + "(google.api.method_signature)": "domain,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Domain", + "metadata_type": "OpMetadata" + } + } + ] }, "DeleteDomain": { "requestType": "DeleteDomainRequest", @@ -79,7 +144,23 @@ "(google.api.method_signature)": "name", "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", "(google.longrunning.operation_info).metadata_type": "OpMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/global/domains/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OpMetadata" + } + } + ] }, "AttachTrust": { "requestType": "AttachTrustRequest", @@ -90,7 +171,24 @@ "(google.api.method_signature)": "name,trust", "(google.longrunning.operation_info).response_type": "Domain", "(google.longrunning.operation_info).metadata_type": "OpMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/global/domains/*}:attachTrust", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,trust" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Domain", + "metadata_type": "OpMetadata" + } + } + ] }, "ReconfigureTrust": { "requestType": "ReconfigureTrustRequest", @@ -101,7 +199,24 @@ "(google.api.method_signature)": "name,target_domain_name,target_dns_ip_addresses", "(google.longrunning.operation_info).response_type": "Domain", "(google.longrunning.operation_info).metadata_type": "OpMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/global/domains/*}:reconfigureTrust", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,target_domain_name,target_dns_ip_addresses" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Domain", + "metadata_type": "OpMetadata" + } + } + ] }, "DetachTrust": { "requestType": "DetachTrustRequest", @@ -112,7 +227,24 @@ "(google.api.method_signature)": "name,trust", "(google.longrunning.operation_info).response_type": "Domain", "(google.longrunning.operation_info).metadata_type": "OpMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/global/domains/*}:detachTrust", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,trust" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Domain", + "metadata_type": "OpMetadata" + } + } + ] }, "ValidateTrust": { "requestType": "ValidateTrustRequest", @@ -123,7 +255,24 @@ "(google.api.method_signature)": "name,trust", "(google.longrunning.operation_info).response_type": "Domain", "(google.longrunning.operation_info).metadata_type": "OpMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/global/domains/*}:validateTrust", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,trust" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Domain", + "metadata_type": "OpMetadata" + } + } + ] } } }, @@ -650,7 +799,21 @@ "(google.api.http).body": "domain", "(google.longrunning.operation_info).response_type": "Domain", "(google.longrunning.operation_info).metadata_type": "OpMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*/locations/global}/domains", + "body": "domain" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Domain", + "metadata_type": "OpMetadata" + } + } + ] }, "ResetAdminPassword": { "requestType": "ResetAdminPasswordRequest", @@ -658,21 +821,43 @@ "options": { "(google.api.http).post": "/v1beta1/{name=projects/*/locations/global/domains/*}:resetAdminPassword", "(google.api.http).body": "*" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/global/domains/*}:resetAdminPassword", + "body": "*" + } + } + ] }, "ListDomains": { "requestType": "ListDomainsRequest", "responseType": "ListDomainsResponse", "options": { "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/global}/domains" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/global}/domains" + } + } + ] }, "GetDomain": { "requestType": "GetDomainRequest", "responseType": "Domain", "options": { "(google.api.http).get": "/v1beta1/{name=projects/*/locations/global/domains/*}" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/global/domains/*}" + } + } + ] }, "UpdateDomain": { "requestType": "UpdateDomainRequest", @@ -682,7 +867,21 @@ "(google.api.http).body": "domain", "(google.longrunning.operation_info).response_type": "Domain", "(google.longrunning.operation_info).metadata_type": "OpMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{domain.name=projects/*/locations/global/domains/*}", + "body": "domain" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Domain", + "metadata_type": "OpMetadata" + } + } + ] }, "DeleteDomain": { "requestType": "DeleteDomainRequest", @@ -691,7 +890,20 @@ "(google.api.http).delete": "/v1beta1/{name=projects/*/locations/global/domains/*}", "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", "(google.longrunning.operation_info).metadata_type": "OpMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta1/{name=projects/*/locations/global/domains/*}" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OpMetadata" + } + } + ] }, "AttachTrust": { "requestType": "AttachTrustRequest", @@ -701,7 +913,21 @@ "(google.api.http).body": "*", "(google.longrunning.operation_info).response_type": "Domain", "(google.longrunning.operation_info).metadata_type": "OpMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/global/domains/*}:attachTrust", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Domain", + "metadata_type": "OpMetadata" + } + } + ] }, "ReconfigureTrust": { "requestType": "ReconfigureTrustRequest", @@ -711,7 +937,21 @@ "(google.api.http).body": "*", "(google.longrunning.operation_info).response_type": "Domain", "(google.longrunning.operation_info).metadata_type": "OpMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/global/domains/*}:reconfigureTrust", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Domain", + "metadata_type": "OpMetadata" + } + } + ] }, "DetachTrust": { "requestType": "DetachTrustRequest", @@ -721,7 +961,21 @@ "(google.api.http).body": "*", "(google.longrunning.operation_info).response_type": "Domain", "(google.longrunning.operation_info).metadata_type": "OpMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/global/domains/*}:detachTrust", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Domain", + "metadata_type": "OpMetadata" + } + } + ] }, "ValidateTrust": { "requestType": "ValidateTrustRequest", @@ -731,7 +985,21 @@ "(google.api.http).body": "*", "(google.longrunning.operation_info).response_type": "Domain", "(google.longrunning.operation_info).metadata_type": "OpMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/global/domains/*}:validateTrust", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Domain", + "metadata_type": "OpMetadata" + } + } + ] } } }, @@ -2257,7 +2525,17 @@ "options": { "(google.api.http).get": "/v1/{name=operations}", "(google.api.method_signature)": "name,filter" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] }, "GetOperation": { "requestType": "GetOperationRequest", @@ -2265,7 +2543,17 @@ "options": { "(google.api.http).get": "/v1/{name=operations/**}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "DeleteOperation": { "requestType": "DeleteOperationRequest", @@ -2273,7 +2561,17 @@ "options": { "(google.api.http).delete": "/v1/{name=operations/**}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "CancelOperation": { "requestType": "CancelOperationRequest", @@ -2282,7 +2580,18 @@ "(google.api.http).post": "/v1/{name=operations/**}:cancel", "(google.api.http).body": "*", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "WaitOperation": { "requestType": "WaitOperationRequest", diff --git a/packages/google-cloud-managedidentities/samples/README.md b/packages/google-cloud-managedidentities/samples/README.md new file mode 100644 index 00000000000..186d1914572 --- /dev/null +++ b/packages/google-cloud-managedidentities/samples/README.md @@ -0,0 +1,50 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Managed Service for Microsoft Active Directory: Node.js Samples](https://github.com/googleapis/nodejs-managed-identities) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/nodejs-managed-identities#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Quickstart + +View the [source code](https://github.com/googleapis/nodejs-managed-identities/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-managed-identities&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node samples/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-managed-identities&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/managed-microsoft-ad/ diff --git a/packages/google-cloud-managedidentities/samples/package.json b/packages/google-cloud-managedidentities/samples/package.json new file mode 100644 index 00000000000..bfd9e6531f9 --- /dev/null +++ b/packages/google-cloud-managedidentities/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-managed-identities", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=10" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/managed-identities": "^0.1.0" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-managedidentities/samples/quickstart.js b/packages/google-cloud-managedidentities/samples/quickstart.js new file mode 100644 index 00000000000..6023f415469 --- /dev/null +++ b/packages/google-cloud-managedidentities/samples/quickstart.js @@ -0,0 +1,51 @@ +// 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. +// + +'use strict'; + +async function main(projectId) { + // [START nodejs_managed_identities_quickstart] + // Imports the Google Cloud client library + + // remove this line after package is released + // eslint-disable-next-line node/no-missing-require + const { + ManagedIdentitiesServiceClient, + } = require('@google-cloud/managed-identities'); + + // 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 ManagedIdentitiesServiceClient(); + + //TODO(library generator): write the actual function you will be testing + async function listDomains() { + const domains = await client.listDomains({ + parent: `projects/${projectId}/locations/global`, + }); + console.info(domains); + } + listDomains(); + // [END nodejs_managed_identities_quickstart] +} + +main(...process.argv.slice(2)).catch(err => { + console.error(err.message); + process.exitCode = 1; +}); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/packages/google-cloud-managedidentities/samples/test/quickstart.js b/packages/google-cloud-managedidentities/samples/test/quickstart.js new file mode 100644 index 00000000000..e4adca7ca3c --- /dev/null +++ b/packages/google-cloud-managedidentities/samples/test/quickstart.js @@ -0,0 +1,46 @@ +// +// 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'; + +const path = require('path'); +const cp = require('child_process'); +const {before, describe, it} = require('mocha'); +const { + ManagedIdentitiesServiceClient, +} = require('@google-cloud/managed-identities'); +const {assert} = require('chai'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +const client = new ManagedIdentitiesServiceClient(); + +describe('Quickstart', () => { + //TODO: remove this if not using the projectId + let projectId; + + before(async () => { + projectId = await client.getProjectId(); + }); + + it('should run quickstart', async () => { + const stdout = execSync(`node ./quickstart.js ${projectId}`, {cwd}); + assert(stdout, stdout.match(/\[\]/)); + }); +}); diff --git a/packages/google-cloud-managedidentities/synth.metadata b/packages/google-cloud-managedidentities/synth.metadata index 0e30f8c8f21..14d104ac98a 100644 --- a/packages/google-cloud-managedidentities/synth.metadata +++ b/packages/google-cloud-managedidentities/synth.metadata @@ -4,22 +4,22 @@ "git": { "name": ".", "remote": "git@github.com:googleapis/nodejs-managed-identities.git", - "sha": "9ba66879114ae668046dcd103008a212ac62a492" + "sha": "41216f2a3f75d8ec9c18074e0eef4df1c3122b05" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "269083b6ed01aa5a1f445462fcc61e05471cd8f8", - "internalRef": "345127100" + "sha": "6bf92d7ceaf8841f77fe960163f5c607f4edc59a", + "internalRef": "345578804" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "32af6da519a6b042e3da62008e2a75e991efb6b4" + "sha": "18c5dbdb4ac8cf75d4d8174e7b4558f48e76f8a1" } } ], diff --git a/packages/google-cloud-managedidentities/synth.py b/packages/google-cloud-managedidentities/synth.py index 09a5cb173f7..e85c93f0c3a 100644 --- a/packages/google-cloud-managedidentities/synth.py +++ b/packages/google-cloud-managedidentities/synth.py @@ -30,7 +30,7 @@ name, version, bazel_target=f"//google/cloud/managedidentities/{version}:managedidentities-{version}-nodejs") - s.copy(library, excludes=[]) + s.copy(library, excludes=["README.md", "package.json"]) # Copy common templates common_templates = gcp.CommonTemplates() diff --git a/packages/google-cloud-managedidentities/system-test/fixtures/sample/src/index.js b/packages/google-cloud-managedidentities/system-test/fixtures/sample/src/index.js index 3428c1391df..ae8d12c6424 100644 --- a/packages/google-cloud-managedidentities/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-managedidentities/system-test/fixtures/sample/src/index.js @@ -17,7 +17,7 @@ // ** All changes to this file may be overwritten. ** /* eslint-disable node/no-missing-require, no-unused-vars */ -const managedidentities = require('managedidentities'); +const managedidentities = require('@google-cloud/managed-identities'); function main() { const managedIdentitiesServiceClient = new managedidentities.ManagedIdentitiesServiceClient(); diff --git a/packages/google-cloud-managedidentities/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-managedidentities/system-test/fixtures/sample/src/index.ts index 629e3b05f77..f8bab85dddc 100644 --- a/packages/google-cloud-managedidentities/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-managedidentities/system-test/fixtures/sample/src/index.ts @@ -16,7 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import {ManagedIdentitiesServiceClient} from 'managedidentities'; +import {ManagedIdentitiesServiceClient} from '@google-cloud/managed-identities'; // check that the client class type name can be used function doStuffWithManagedIdentitiesServiceClient(