From 7a2673d631b2dd3cc240f7867b72f3bf8aea971a Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Thu, 31 Jan 2019 14:39:50 -0800 Subject: [PATCH 01/51] initial commit --- talent/.eslintrc.yml | 3 +++ talent/quickstart.js | 13 +++++++++++++ talent/system-test/.eslintrc.yml | 4 ++++ 3 files changed, 20 insertions(+) create mode 100644 talent/.eslintrc.yml create mode 100644 talent/quickstart.js create mode 100644 talent/system-test/.eslintrc.yml diff --git a/talent/.eslintrc.yml b/talent/.eslintrc.yml new file mode 100644 index 0000000000..282535f55f --- /dev/null +++ b/talent/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +rules: + no-console: off diff --git a/talent/quickstart.js b/talent/quickstart.js new file mode 100644 index 0000000000..016ff5054c --- /dev/null +++ b/talent/quickstart.js @@ -0,0 +1,13 @@ +// Copyright 2019 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. diff --git a/talent/system-test/.eslintrc.yml b/talent/system-test/.eslintrc.yml new file mode 100644 index 0000000000..8e078abbec --- /dev/null +++ b/talent/system-test/.eslintrc.yml @@ -0,0 +1,4 @@ +--- +rules: + node/no-unpublished-require: off + no-empty: off From f56d4e4a98c542563c1b02462e51a888e12a6cba Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Tue, 26 Feb 2019 14:20:45 -0800 Subject: [PATCH 02/51] docs(samples): fix lint and docs (#6) --- talent/package.json | 23 ++++++++++++++++++++++ talent/{system-test => test}/.eslintrc.yml | 0 talent/test/no-test.js | 1 + 3 files changed, 24 insertions(+) create mode 100644 talent/package.json rename talent/{system-test => test}/.eslintrc.yml (100%) create mode 100644 talent/test/no-test.js diff --git a/talent/package.json b/talent/package.json new file mode 100644 index 0000000000..eaa4da30f8 --- /dev/null +++ b/talent/package.json @@ -0,0 +1,23 @@ +{ + "name": "@google-cloud/talent-samples", + "description": "Samples for the Cloud Talent Solution client library for Node.js", + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=8" + }, + "repository": "googleapis/nodejs-talent", + "private": true, + "files": [ + "*.js" + ], + "scripts": { + "test": "mocha --timeout 600000" + }, + "dependencies": {}, + "devDependencies": { + "chai": "^4.2.0", + "execa": "^1.0.0", + "mocha": "^6.0.0" + } +} diff --git a/talent/system-test/.eslintrc.yml b/talent/test/.eslintrc.yml similarity index 100% rename from talent/system-test/.eslintrc.yml rename to talent/test/.eslintrc.yml diff --git a/talent/test/no-test.js b/talent/test/no-test.js new file mode 100644 index 0000000000..665d93e66f --- /dev/null +++ b/talent/test/no-test.js @@ -0,0 +1 @@ +console.log('no test yet'); From a5884a9d5ff39381700466998b5c46c7b9347fb3 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 4 Apr 2019 13:51:26 -0700 Subject: [PATCH 03/51] refactor: use execSync for tests (#32) --- talent/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index eaa4da30f8..72731af5c4 100644 --- a/talent/package.json +++ b/talent/package.json @@ -17,7 +17,6 @@ "dependencies": {}, "devDependencies": { "chai": "^4.2.0", - "execa": "^1.0.0", "mocha": "^6.0.0" } } From 4c7aaacdd2d062bb7b74ff6c8dc69c8d49f686c4 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Thu, 9 May 2019 12:41:53 -0700 Subject: [PATCH 04/51] chore: release 0.3.0 (#50) * updated CHANGELOG.md * updated package.json * updated samples/package.json --- talent/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 72731af5c4..6635bf5d01 100644 --- a/talent/package.json +++ b/talent/package.json @@ -14,7 +14,9 @@ "scripts": { "test": "mocha --timeout 600000" }, - "dependencies": {}, + "dependencies": { + "@google-cloud/talent": "^0.3.0" + }, "devDependencies": { "chai": "^4.2.0", "mocha": "^6.0.0" From 722c41eb4554e01004fea06bf9b70642ec193484 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 14 May 2019 16:13:50 -0700 Subject: [PATCH 05/51] chore: release 1.0.0 (#55) --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 6635bf5d01..569fc7117e 100644 --- a/talent/package.json +++ b/talent/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 600000" }, "dependencies": { - "@google-cloud/talent": "^0.3.0" + "@google-cloud/talent": "^1.0.0" }, "devDependencies": { "chai": "^4.2.0", From 01271c65893300538c5f0cfd0ac33e47f662d7e1 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 13 Jun 2019 18:31:29 -0700 Subject: [PATCH 06/51] chore: release 1.0.1 (#68) * updated CHANGELOG.md * updated package.json * updated samples/package.json --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 569fc7117e..2a6ac50f0d 100644 --- a/talent/package.json +++ b/talent/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 600000" }, "dependencies": { - "@google-cloud/talent": "^1.0.0" + "@google-cloud/talent": "^1.0.1" }, "devDependencies": { "chai": "^4.2.0", From c308b39f54b5bc5c4a4d3e6d2c7761ba87f16178 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 26 Jun 2019 15:29:12 -0700 Subject: [PATCH 07/51] chore: release 1.0.2 (#72) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 2a6ac50f0d..607cdf4502 100644 --- a/talent/package.json +++ b/talent/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 600000" }, "dependencies": { - "@google-cloud/talent": "^1.0.1" + "@google-cloud/talent": "^1.0.2" }, "devDependencies": { "chai": "^4.2.0", From 404214fd1e31cd2b4afb3d08049ff444b8d9c1b3 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 28 Jun 2019 11:05:52 -0700 Subject: [PATCH 08/51] chore: release 1.1.0 (#74) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 607cdf4502..b28bc63e52 100644 --- a/talent/package.json +++ b/talent/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 600000" }, "dependencies": { - "@google-cloud/talent": "^1.0.2" + "@google-cloud/talent": "^1.1.0" }, "devDependencies": { "chai": "^4.2.0", From 9fbabb7b4ad8cf262fe9853524caf60c1d13f74e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 16 Jul 2019 09:19:32 -0700 Subject: [PATCH 09/51] chore: release 1.2.0 (#77) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index b28bc63e52..063e79226d 100644 --- a/talent/package.json +++ b/talent/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 600000" }, "dependencies": { - "@google-cloud/talent": "^1.1.0" + "@google-cloud/talent": "^1.2.0" }, "devDependencies": { "chai": "^4.2.0", From a1289a738e5839c5e1d881f2928b3eb80ec5acdf Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 8 Aug 2019 09:12:04 -0700 Subject: [PATCH 10/51] chore: release 1.3.0 (#86) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 063e79226d..24c16ed751 100644 --- a/talent/package.json +++ b/talent/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 600000" }, "dependencies": { - "@google-cloud/talent": "^1.2.0" + "@google-cloud/talent": "^1.3.0" }, "devDependencies": { "chai": "^4.2.0", From 47391ad7af51425dfe6de56de76f41dd9a230e66 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 16 Sep 2019 09:57:43 -0700 Subject: [PATCH 11/51] chore: release 1.4.0 (#94) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 24c16ed751..9f1dc767c8 100644 --- a/talent/package.json +++ b/talent/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 600000" }, "dependencies": { - "@google-cloud/talent": "^1.3.0" + "@google-cloud/talent": "^1.4.0" }, "devDependencies": { "chai": "^4.2.0", From 11574e6d6898bbba5ff9ea8a9aae6963cf497b11 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2019 13:31:42 -0700 Subject: [PATCH 12/51] chore: release 1.5.1 (#115) --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 9f1dc767c8..50d3ed70be 100644 --- a/talent/package.json +++ b/talent/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 600000" }, "dependencies": { - "@google-cloud/talent": "^1.4.0" + "@google-cloud/talent": "^1.5.1" }, "devDependencies": { "chai": "^4.2.0", From e700ae9784d67dfcea34ca2fb7769a15ce424f71 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Sat, 9 Nov 2019 16:03:09 -0800 Subject: [PATCH 13/51] chore: release 1.6.0 (#119) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 50d3ed70be..0a3f65d197 100644 --- a/talent/package.json +++ b/talent/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 600000" }, "dependencies": { - "@google-cloud/talent": "^1.5.1" + "@google-cloud/talent": "^1.6.0" }, "devDependencies": { "chai": "^4.2.0", From ffaaf3c84119de81d5e0ec79bea61cf877e901ad Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2019 11:40:55 -0800 Subject: [PATCH 14/51] chore: release 1.6.1 (#123) --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 0a3f65d197..1df8e62068 100644 --- a/talent/package.json +++ b/talent/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 600000" }, "dependencies": { - "@google-cloud/talent": "^1.6.0" + "@google-cloud/talent": "^1.6.1" }, "devDependencies": { "chai": "^4.2.0", From c3fda3b5ce1ee954d08446e1e4fee03a093a2835 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2020 12:49:14 -0800 Subject: [PATCH 15/51] chore: release 1.6.2 (#138) --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 1df8e62068..5f3a152730 100644 --- a/talent/package.json +++ b/talent/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 600000" }, "dependencies": { - "@google-cloud/talent": "^1.6.1" + "@google-cloud/talent": "^1.6.2" }, "devDependencies": { "chai": "^4.2.0", From a154b1ea44db264963642be5a7d3e80f7bc3b184 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 7 Jan 2020 01:16:51 +0200 Subject: [PATCH 16/51] chore(deps): update dependency mocha to v7 --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 5f3a152730..4cfd3ab598 100644 --- a/talent/package.json +++ b/talent/package.json @@ -19,6 +19,6 @@ }, "devDependencies": { "chai": "^4.2.0", - "mocha": "^6.0.0" + "mocha": "^7.0.0" } } From 58da53c7e533f70564a176598679f11c42d7476e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2020 16:27:38 -0800 Subject: [PATCH 17/51] chore: release 1.7.0 (#149) --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 4cfd3ab598..cf4985a79a 100644 --- a/talent/package.json +++ b/talent/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 600000" }, "dependencies": { - "@google-cloud/talent": "^1.6.2" + "@google-cloud/talent": "^1.7.0" }, "devDependencies": { "chai": "^4.2.0", From 159057509d733c46fc9898567bdb7ef1f2f70bd7 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2020 21:05:03 -0800 Subject: [PATCH 18/51] chore: release 1.7.1 (#155) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index cf4985a79a..833ab777ac 100644 --- a/talent/package.json +++ b/talent/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 600000" }, "dependencies": { - "@google-cloud/talent": "^1.7.0" + "@google-cloud/talent": "^1.7.1" }, "devDependencies": { "chai": "^4.2.0", From c98f3302b4243487efad2b7831c5a9b0199173fc Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 4 Jun 2020 10:55:46 -0700 Subject: [PATCH 19/51] chore: release 2.0.0 (#164) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 833ab777ac..5e2df05dc1 100644 --- a/talent/package.json +++ b/talent/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 600000" }, "dependencies": { - "@google-cloud/talent": "^1.7.1" + "@google-cloud/talent": "^2.0.0" }, "devDependencies": { "chai": "^4.2.0", From 2823fe1d6ea734a3e01787734fab12624c283a65 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 11 Jun 2020 17:48:02 +0200 Subject: [PATCH 20/51] chore(deps): update dependency mocha to v8 (#214) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [mocha](https://mochajs.org/) ([source](https://togithub.com/mochajs/mocha)) | devDependencies | major | [`^7.0.0` -> `^8.0.0`](https://renovatebot.com/diffs/npm/mocha/7.2.0/8.0.1) | --- ### Release Notes
mochajs/mocha ### [`v8.0.1`](https://togithub.com/mochajs/mocha/blob/master/CHANGELOG.md#​801--2020-06-10) [Compare Source](https://togithub.com/mochajs/mocha/compare/v8.0.0...v8.0.1) The obligatory patch after a major. #### :bug: Fixes - [#​4328](https://togithub.com/mochajs/mocha/issues/4328): Fix `--parallel` when combined with `--watch` ([**@​boneskull**](https://togithub.com/boneskull)) ### [`v8.0.0`](https://togithub.com/mochajs/mocha/blob/master/CHANGELOG.md#​800--2020-06-10) [Compare Source](https://togithub.com/mochajs/mocha/compare/v7.2.0...v8.0.0) In this major release, Mocha adds the ability to _run tests in parallel_. Better late than never! Please note the **breaking changes** detailed below. Let's welcome [**@​giltayar**](https://togithub.com/giltayar) and [**@​nicojs**](https://togithub.com/nicojs) to the maintenance team! #### :boom: Breaking Changes - [#​4164](https://togithub.com/mochajs/mocha/issues/4164): **Mocha v8.0.0 now requires Node.js v10.0.0 or newer.** Mocha no longer supports the Node.js v8.x line ("Carbon"), which entered End-of-Life at the end of 2019 ([**@​UlisesGascon**](https://togithub.com/UlisesGascon)) - [#​4175](https://togithub.com/mochajs/mocha/issues/4175): Having been deprecated with a warning since v7.0.0, **`mocha.opts` is no longer supported** ([**@​juergba**](https://togithub.com/juergba)) :sparkles: **WORKAROUND:** Replace `mocha.opts` with a [configuration file](https://mochajs.org/#configuring-mocha-nodejs). - [#​4260](https://togithub.com/mochajs/mocha/issues/4260): Remove `enableTimeout()` (`this.enableTimeout()`) from the context object ([**@​craigtaub**](https://togithub.com/craigtaub)) :sparkles: **WORKAROUND:** Replace usage of `this.enableTimeout(false)` in your tests with `this.timeout(0)`. - [#​4315](https://togithub.com/mochajs/mocha/issues/4315): The `spec` option no longer supports a comma-delimited list of files ([**@​juergba**](https://togithub.com/juergba)) :sparkles: **WORKAROUND**: Use an array instead (e.g., `"spec": "foo.js,bar.js"` becomes `"spec": ["foo.js", "bar.js"]`). - [#​4309](https://togithub.com/mochajs/mocha/issues/4309): Drop support for Node.js v13.x line, which is now End-of-Life ([**@​juergba**](https://togithub.com/juergba)) - [#​4282](https://togithub.com/mochajs/mocha/issues/4282): `--forbid-only` will throw an error even if exclusive tests are avoided via `--grep` or other means ([**@​arvidOtt**](https://togithub.com/arvidOtt)) - [#​4223](https://togithub.com/mochajs/mocha/issues/4223): The context object's `skip()` (`this.skip()`) in a "before all" (`before()`) hook will no longer execute subsequent sibling hooks, in addition to hooks in child suites ([**@​juergba**](https://togithub.com/juergba)) - [#​4178](https://togithub.com/mochajs/mocha/issues/4178): Remove previously soft-deprecated APIs ([**@​wnghdcjfe**](https://togithub.com/wnghdcjfe)): - `Mocha.prototype.ignoreLeaks()` - `Mocha.prototype.useColors()` - `Mocha.prototype.useInlineDiffs()` - `Mocha.prototype.hideDiff()` #### :tada: Enhancements - [#​4245](https://togithub.com/mochajs/mocha/issues/4245): Add ability to run tests in parallel for Node.js (see [docs](https://mochajs.org/#parallel-tests)) ([**@​boneskull**](https://togithub.com/boneskull)) :exclamation: See also [#​4244](https://togithub.com/mochajs/mocha/issues/4244); [Root Hook Plugins (docs)](https://mochajs.org/#root-hook-plugins) -- _root hooks must be defined via Root Hook Plugins to work in parallel mode_ - [#​4304](https://togithub.com/mochajs/mocha/issues/4304): `--require` now works with ES modules ([**@​JacobLey**](https://togithub.com/JacobLey)) - [#​4299](https://togithub.com/mochajs/mocha/issues/4299): In some circumstances, Mocha can run ES modules under Node.js v10 -- _use at your own risk!_ ([**@​giltayar**](https://togithub.com/giltayar)) #### :book: Documentation - [#​4246](https://togithub.com/mochajs/mocha/issues/4246): Add documentation for parallel mode and Root Hook plugins ([**@​boneskull**](https://togithub.com/boneskull)) #### :bug: Fixes (All bug fixes in Mocha v8.0.0 are also breaking changes, and are listed above)
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-talent). --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 5e2df05dc1..7431d4da8e 100644 --- a/talent/package.json +++ b/talent/package.json @@ -19,6 +19,6 @@ }, "devDependencies": { "chai": "^4.2.0", - "mocha": "^7.0.0" + "mocha": "^8.0.0" } } From f7d1d8ca05a82f097e78873bcb2ee2534c8dfea8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 29 Jun 2020 14:25:52 -0700 Subject: [PATCH 21/51] chore: release 2.1.0 (#215) --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 7431d4da8e..7465dcdcdc 100644 --- a/talent/package.json +++ b/talent/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 600000" }, "dependencies": { - "@google-cloud/talent": "^2.0.0" + "@google-cloud/talent": "^2.1.0" }, "devDependencies": { "chai": "^4.2.0", From b48ec1d02d3339f3db288cd58d93a60e104089fd Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 12 Oct 2020 17:30:24 -0700 Subject: [PATCH 22/51] chore: release 3.0.0 (#247) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 7465dcdcdc..743b01d6b9 100644 --- a/talent/package.json +++ b/talent/package.json @@ -15,7 +15,7 @@ "test": "mocha --timeout 600000" }, "dependencies": { - "@google-cloud/talent": "^2.1.0" + "@google-cloud/talent": "^3.0.0" }, "devDependencies": { "chai": "^4.2.0", From 5384629714a90c0525a414650fc74012ff55fabb Mon Sep 17 00:00:00 2001 From: saumyasahu-bot <71405727+saumyasahu-bot@users.noreply.github.com> Date: Wed, 14 Oct 2020 16:52:18 -0700 Subject: [PATCH 23/51] samples: add Job Search v4 samples (#255) --- talent/package.json | 12 +- .../job_search_autocomplete_job_title.js | 94 ++++++++++++ talent/snippet/job_search_batch_delete_job.js | 63 ++++++++ talent/snippet/job_search_commute_search.js | 91 ++++++++++++ .../snippet/job_search_create_client_event.js | 106 +++++++++++++ talent/snippet/job_search_create_company.js | 82 ++++++++++ talent/snippet/job_search_create_job.js | 136 +++++++++++++++++ ...job_search_create_job_custom_attributes.js | 92 ++++++++++++ talent/snippet/job_search_create_tenant.js | 60 ++++++++ .../job_search_custom_ranking_search.js | 85 +++++++++++ talent/snippet/job_search_delete_company.js | 51 +++++++ talent/snippet/job_search_delete_job.js | 51 +++++++ talent/snippet/job_search_delete_tenant.js | 46 ++++++ talent/snippet/job_search_get_company.js | 57 +++++++ talent/snippet/job_search_get_job.js | 69 +++++++++ talent/snippet/job_search_get_tenant.js | 52 +++++++ talent/snippet/job_search_histogram_search.js | 87 +++++++++++ talent/snippet/job_search_list_companies.js | 62 ++++++++ talent/snippet/job_search_list_jobs.js | 72 +++++++++ talent/snippet/job_search_list_tenants.js | 50 +++++++ talent/test/no-test.js | 1 - talent/test/talent.test.js | 140 ++++++++++++++++++ 22 files changed, 1555 insertions(+), 4 deletions(-) create mode 100644 talent/snippet/job_search_autocomplete_job_title.js create mode 100644 talent/snippet/job_search_batch_delete_job.js create mode 100644 talent/snippet/job_search_commute_search.js create mode 100644 talent/snippet/job_search_create_client_event.js create mode 100644 talent/snippet/job_search_create_company.js create mode 100644 talent/snippet/job_search_create_job.js create mode 100644 talent/snippet/job_search_create_job_custom_attributes.js create mode 100644 talent/snippet/job_search_create_tenant.js create mode 100644 talent/snippet/job_search_custom_ranking_search.js create mode 100644 talent/snippet/job_search_delete_company.js create mode 100644 talent/snippet/job_search_delete_job.js create mode 100644 talent/snippet/job_search_delete_tenant.js create mode 100644 talent/snippet/job_search_get_company.js create mode 100644 talent/snippet/job_search_get_job.js create mode 100644 talent/snippet/job_search_get_tenant.js create mode 100644 talent/snippet/job_search_histogram_search.js create mode 100644 talent/snippet/job_search_list_companies.js create mode 100644 talent/snippet/job_search_list_jobs.js create mode 100644 talent/snippet/job_search_list_tenants.js delete mode 100644 talent/test/no-test.js create mode 100644 talent/test/talent.test.js diff --git a/talent/package.json b/talent/package.json index 743b01d6b9..0f35f1dcb5 100644 --- a/talent/package.json +++ b/talent/package.json @@ -12,13 +12,19 @@ "*.js" ], "scripts": { - "test": "mocha --timeout 600000" + "test": "mocha --timeout 600000", + "lint": "eslint src --ext .ts", + "lint:fix": "npm run lint -- --fix" }, "dependencies": { - "@google-cloud/talent": "^3.0.0" + "@google-cloud/talent": "^3.0.0", + "uuid": "^8.3.1", + "yargs": "^16.0.3" }, "devDependencies": { + "@types/mocha": "^8.0.0", + "@types/node": "^12.0.0", "chai": "^4.2.0", - "mocha": "^8.0.0" + "mocha": "^8.1.3" } } diff --git a/talent/snippet/job_search_autocomplete_job_title.js b/talent/snippet/job_search_autocomplete_job_title.js new file mode 100644 index 0000000000..04767653f8 --- /dev/null +++ b/talent/snippet/job_search_autocomplete_job_title.js @@ -0,0 +1,94 @@ +// 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. + +'use strict'; + +// [START job_search_autocomplete_job_title] + +const talent = require('@google-cloud/talent').v4; + +/** + * Complete job title given partial text (autocomplete) + * + * @param projectId {string} Your Google Cloud Project ID + * @param tenantId {string} Identifier of the TenantId + */ +function sampleCompleteQuery( + projectId, + tenantId, + query, + numResults, + languageCode +) { + const client = new talent.CompletionClient(); + // const projectId = 'Your Google Cloud Project ID'; + // const tenantId = 'Your Tenant ID (using tenancy is optional)'; + // const query = '[partially typed job title]'; + // const numResults = 5; + // const languageCode = 'en-US'; + const formattedParent = client.tenantPath(projectId, tenantId); + const languageCodes = [languageCode]; + const request = { + parent: formattedParent, + query: query, + pageSize: numResults, + languageCodes: languageCodes, + }; + client + .completeQuery(request) + .then(responses => { + const response = responses[0]; + for (const result of response.completionResults) { + console.log(`Suggested title: ${result.suggestion}`); + // Suggestion type is JOB_TITLE or COMPANY_TITLE + console.log(`Suggestion type: ${result.type}`); + } + }) + .catch(err => { + console.error(err); + }); +} + +// [END job_search_autocomplete_job_title] +// tslint:disable-next-line:no-any + +const argv = require('yargs') + .option('project_id', { + default: 'Your Google Cloud Project ID', + string: true, + }) + .option('tenant_id', { + default: 'Your Tenant ID (using tenancy is optional)', + string: true, + }) + .option('query', { + default: '[partially typed job title]', + string: true, + }) + .option('num_results', { + default: 5, + number: true, + }) + .option('language_code', { + default: 'en-US', + string: true, + }).argv; + +sampleCompleteQuery( + argv.project_id, + argv.tenant_id, + argv.query, + argv.num_results, + argv.language_code +); diff --git a/talent/snippet/job_search_batch_delete_job.js b/talent/snippet/job_search_batch_delete_job.js new file mode 100644 index 0000000000..e64dc216fb --- /dev/null +++ b/talent/snippet/job_search_batch_delete_job.js @@ -0,0 +1,63 @@ +// 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. + +'use strict'; + +// [START job_search_batch_delete_job] + +const talent = require('@google-cloud/talent').v4; + +/** + * Batch delete jobs using a filter + * + * @param projectId {string} Your Google Cloud Project ID + * @param tenantId {string} Identifier of the Tenantd + * @param filter {string} The filter string specifies the jobs to be deleted. + * For example: + * companyName = "projects/api-test-project/companies/123" AND equisitionId = "req-1" + */ +function sampleBatchDeleteJobs(projectId, tenantId, filter) { + const client = new talent.JobServiceClient(); + // const projectId = 'Your Google Cloud Project ID'; + // const tenantId = 'Your Tenant ID (using tenancy is optional)'; + // const filter = '[Query]'; + const formattedParent = client.tenantPath(projectId, tenantId); + const request = { + parent: formattedParent, + filter: filter, + }; + client.batchDeleteJobs(request).catch(err => { + console.error(err); + }); + console.log('Batch deleted jobs from filter'); +} + +// [END job_search_batch_delete_job] +// tslint:disable-next-line:no-any + +const argv = require('yargs') + .option('project_id', { + default: 'Your Google Cloud Project ID', + string: true, + }) + .option('tenant_id', { + default: 'Your Tenant ID (using tenancy is optional)', + string: true, + }) + .option('filter', { + default: '[Query]', + string: true, + }).argv; + +sampleBatchDeleteJobs(argv.project_id, argv.tenant_id, argv.filter); diff --git a/talent/snippet/job_search_commute_search.js b/talent/snippet/job_search_commute_search.js new file mode 100644 index 0000000000..e8da1eef67 --- /dev/null +++ b/talent/snippet/job_search_commute_search.js @@ -0,0 +1,91 @@ +// 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. + +'use strict'; + +// [START job_search_commute_search] + +const talent = require('@google-cloud/talent').v4; + +/** Search Jobs using commute distance */ +function sampleSearchJobs(projectId, tenantId) { + const client = new talent.JobServiceClient(); + // Iterate over all elements. + // const projectId = 'Your Google Cloud Project ID'; + // const tenantId = 'Your Tenant ID (using tenancy is optional)'; + const formattedParent = client.tenantPath(projectId, tenantId); + const domain = 'www.example.com'; + const sessionId = 'Hashed session identifier'; + const userId = 'Hashed user identifier'; + const requestMetadata = { + domain: domain, + sessionId: sessionId, + userId: userId, + }; + const commuteMethod = 'TRANSIT'; + const seconds = 1800; + const travelDuration = { + seconds: seconds, + }; + const latitude = 37.422408; + const longitude = 122.084068; + const startCoordinates = { + latitude: latitude, + longitude: longitude, + }; + const commuteFilter = { + commuteMethod: commuteMethod, + travelDuration: travelDuration, + startCoordinates: startCoordinates, + }; + const jobQuery = { + commuteFilter: commuteFilter, + }; + const request = { + parent: formattedParent, + requestMetadata: requestMetadata, + jobQuery: jobQuery, + }; + + client + .searchJobs(request) + .then(responses => { + const resources = responses[0]; + for (const resource of resources) { + console.log(`Job summary: ${resource.jobSummary}`); + console.log(`Job title snippet: ${resource.jobTitleSnippet}`); + const job = resource.job; + console.log(`Job name: ${job.name}`); + console.log(`Job title: ${job.title}`); + } + }) + .catch(err => { + console.error(err); + }); +} + +// [END job_search_commute_search] +// tslint:disable-next-line:no-any + +const argv = require('yargs') + .option('project_id', { + default: 'Your Google Cloud Project ID', + string: true, + }) + .option('tenant_id', { + default: 'Your Tenant ID (using tenancy is optional)', + string: true, + }).argv; + +sampleSearchJobs(argv.project_id, argv.tenant_id); diff --git a/talent/snippet/job_search_create_client_event.js b/talent/snippet/job_search_create_client_event.js new file mode 100644 index 0000000000..53d8af0b01 --- /dev/null +++ b/talent/snippet/job_search_create_client_event.js @@ -0,0 +1,106 @@ +// 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. + +'use strict'; + +// [START job_search_create_client_event] + +const talent = require('@google-cloud/talent').v4; + +/** + * Creates a client event + * + * @param projectId {string} Your Google Cloud Project ID + * @param tenantId {string} Identifier of the Tenant + * @param requestId {string} A unique ID generated in the API responses. + * Value should be set to the request_id from an API response. + * @param eventId {string} A unique identifier, generated by the client application + */ +function sampleCreateClientEvent(projectId, tenantId, requestId, eventId) { + const client = new talent.EventServiceClient(); + // const projectId = 'Your Google Cloud Project ID'; + // const tenantId = 'Your Tenant ID (using tenancy is optional)'; + // const requestId = '[request_id from ResponseMetadata]'; + // const eventId = '[Set this to a unique identifier]'; + const formattedParent = client.tenantPath(projectId, tenantId); + + // The timestamp of the event as seconds of UTC time since Unix epoch + // For more information on how to create google.protobuf.Timestamps + // See: https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/timestamp.proto + const seconds = 0; + const createTime = { + seconds: seconds, + }; + + // The type of event attributed to the behavior of the end user + const type = 'VIEW'; + + // List of job names associated with this event + const jobsElement = 'projects/[Project ID]/tenants/[Tenant ID]/jobs/[Job ID]'; + const jobsElement2 = + 'projects/[Project ID]/tenants/[Tenant ID]/jobs/[Job ID]'; + const jobs = [jobsElement, jobsElement2]; + const jobEvent = { + type: type, + jobs: jobs, + }; + const clientEvent = { + requestId: requestId, + eventId: eventId, + createTime: createTime, + jobEvent: jobEvent, + }; + const request = { + parent: formattedParent, + clientEvent: clientEvent, + }; + client + .createClientEvent(request) + .then(responses => { + const response = responses[0]; + console.log('Created client event'); + console.log(`Response: ${response}`); + }) + .catch(err => { + console.error(err); + }); +} + +// [END job_search_create_client_event] +// tslint:disable-next-line:no-any + +const argv = require('yargs') + .option('project_id', { + default: 'Your Google Cloud Project ID', + string: true, + }) + .option('tenant_id', { + default: 'Your Tenant ID (using tenancy is optional)', + string: true, + }) + .option('request_id', { + default: '[request_id from ResponseMetadata]', + string: true, + }) + .option('event_id', { + default: '[Set this to a unique identifier]', + string: true, + }).argv; + +sampleCreateClientEvent( + argv.project_id, + argv.tenant_id, + argv.request_id, + argv.event_id +); diff --git a/talent/snippet/job_search_create_company.js b/talent/snippet/job_search_create_company.js new file mode 100644 index 0000000000..00ed4274ce --- /dev/null +++ b/talent/snippet/job_search_create_company.js @@ -0,0 +1,82 @@ +// 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. + +'use strict'; + +// [START job_search_create_company] + +const talent = require('@google-cloud/talent').v4; + +/** + * Create Company + * + * @param projectId {string} Your Google Cloud Project ID + * @param tenantId {string} Identifier of the Tenant + */ +function sampleCreateCompany(projectId, tenantId, displayName, externalId) { + const client = new talent.CompanyServiceClient(); + // const projectId = 'Your Google Cloud Project ID'; + // const tenantId = 'Your Tenant ID (using tenancy is optional)'; + // const displayName = 'My Company Name'; + // const externalId = 'Identifier of this company in my system'; + const formattedParent = client.tenantPath(projectId, tenantId); + const company = { + displayName: displayName, + externalId: externalId, + }; + const request = { + parent: formattedParent, + company: company, + }; + client + .createCompany(request) + .then(responses => { + const response = responses[0]; + console.log('Created Company'); + console.log(`Name: ${response.name}`); + console.log(`Display Name: ${response.displayName}`); + console.log(`External ID: ${response.externalId}`); + }) + .catch(err => { + console.error(err); + }); +} + +// [END job_search_create_company] +// tslint:disable-next-line:no-any + +const argv = require('yargs') + .option('project_id', { + default: 'Your Google Cloud Project ID', + string: true, + }) + .option('tenant_id', { + default: 'Your Tenant ID (using tenancy is optional)', + string: true, + }) + .option('display_name', { + default: 'My Company Name', + string: true, + }) + .option('external_id', { + default: 'Identifier of this company in my system', + string: true, + }).argv; + +sampleCreateCompany( + argv.project_id, + argv.tenant_id, + argv.display_name, + argv.external_id +); diff --git a/talent/snippet/job_search_create_job.js b/talent/snippet/job_search_create_job.js new file mode 100644 index 0000000000..8d1f1bf815 --- /dev/null +++ b/talent/snippet/job_search_create_job.js @@ -0,0 +1,136 @@ +// 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. + +'use strict'; + +// [START job_search_create_job] + +const talent = require('@google-cloud/talent').v4; + +/** + * Create Job + * + * @param projectId {string} Your Google Cloud Project ID + * @param tenantId {string} Identifier of the Tenant + */ +function sampleCreateJob( + projectId, + tenantId, + companyName, + requisitionId, + title, + description, + jobApplicationUrl, + addressOne, + addressTwo, + languageCode +) { + const client = new talent.JobServiceClient(); + // const projectId = 'Your Google Cloud Project ID'; + // const tenantId = 'Your Tenant ID (using tenancy is optional)'; + // const companyName = 'Company name, e.g. projects/your-project/companies/company-id'; + // const requisitionId = 'Job requisition ID, aka Posting ID. Unique per job.'; + // const title = 'Software Engineer'; + // const description = 'This is a description of this wonderful job!'; + // const jobApplicationUrl = 'https://www.example.org/job-posting/123'; + // const addressOne = '1600 Amphitheatre Parkway, Mountain View, CA 94043'; + // const addressTwo = '111 8th Avenue, New York, NY 10011'; + // const languageCode = 'en-US'; + const formattedParent = client.tenantPath(projectId, tenantId); + const uris = [jobApplicationUrl]; + const applicationInfo = { + uris: uris, + }; + const addresses = [addressOne, addressTwo]; + const job = { + company: companyName, + requisitionId: requisitionId, + title: title, + description: description, + applicationInfo: applicationInfo, + addresses: addresses, + languageCode: languageCode, + }; + const request = { + parent: formattedParent, + job: job, + }; + client + .createJob(request) + .then(responses => { + const response = responses[0]; + console.log(`Created job: ${response.name}`); + }) + .catch(err => { + console.error(err); + }); +} + +// [END job_search_create_job] +// tslint:disable-next-line:no-any + +const argv = require('yargs') + .option('project_id', { + default: 'Your Google Cloud Project ID', + string: true, + }) + .option('tenant_id', { + default: 'Your Tenant ID (using tenancy is optional)', + string: true, + }) + .option('company_name', { + default: 'Company name, e.g. projects/your-project/companies/company-id', + string: true, + }) + .option('requisition_id', { + default: 'Job requisition ID, aka Posting ID. Unique per job.', + string: true, + }) + .option('title', { + default: 'Software Engineer', + string: true, + }) + .option('description', { + default: 'This is a description of this wonderful job!', + string: true, + }) + .option('job_application_url', { + default: 'https://www.example.org/job-posting/123', + string: true, + }) + .option('address_one', { + default: '1600 Amphitheatre Parkway, Mountain View, CA 94043', + string: true, + }) + .option('address_two', { + default: '111 8th Avenue, New York, NY 10011', + string: true, + }) + .option('language_code', { + default: 'en-US', + string: true, + }).argv; + +sampleCreateJob( + argv.project_id, + argv.tenant_id, + argv.company_name, + argv.requisition_id, + argv.title, + argv.description, + argv.job_application_url, + argv.address_one, + argv.address_two, + argv.language_code +); diff --git a/talent/snippet/job_search_create_job_custom_attributes.js b/talent/snippet/job_search_create_job_custom_attributes.js new file mode 100644 index 0000000000..00b9bbab79 --- /dev/null +++ b/talent/snippet/job_search_create_job_custom_attributes.js @@ -0,0 +1,92 @@ +// 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. + +'use strict'; + +// [START job_search_create_job_custom_attributes] + +const talent = require('@google-cloud/talent').v4; + +/** + * Create Job with Custom Attributes + * + * @param projectId {string} Your Google Cloud Project ID + * @param tenantId {string} Identifier of the Tenantd + */ +function sampleCreateJob( + projectId, + tenantId, + companyName, + requisitionId, + languageCode +) { + const client = new talent.JobServiceClient(); + // const projectId = 'Your Google Cloud Project ID'; + // const tenantId = 'Your Tenant ID (using tenancy is optional)'; + // const companyName = 'Company name, e.g. projects/your-project/companies/company-id'; + // const requisitionId = 'Job requisition ID, aka Posting ID. Unique per job.'; + // const languageCode = 'en-US'; + const formattedParent = client.tenantPath(projectId, tenantId); + const job = { + company: companyName, + requisitionId: requisitionId, + languageCode: languageCode, + }; + const request = { + parent: formattedParent, + job: job, + }; + client + .createJob(request) + .then(responses => { + const response = responses[0]; + console.log(`Created job: ${response.name}`); + }) + .catch(err => { + console.error(err); + }); +} + +// [END job_search_create_job_custom_attributes] +// tslint:disable-next-line:no-any + +const argv = require('yargs') + .option('project_id', { + default: 'Your Google Cloud Project ID', + string: true, + }) + .option('tenant_id', { + default: 'Your Tenant ID (using tenancy is optional)', + string: true, + }) + .option('company_name', { + default: 'Company name, e.g. projects/your-project/companies/company-id', + string: true, + }) + .option('requisition_id', { + default: 'Job requisition ID, aka Posting ID. Unique per job.', + string: true, + }) + .option('language_code', { + default: 'en-US', + string: true, + }).argv; + +sampleCreateJob( + argv.project_id, + argv.tenant_id, + argv.company_name, + argv.requisition_id, + argv.language_code +); diff --git a/talent/snippet/job_search_create_tenant.js b/talent/snippet/job_search_create_tenant.js new file mode 100644 index 0000000000..bfc3b5671d --- /dev/null +++ b/talent/snippet/job_search_create_tenant.js @@ -0,0 +1,60 @@ +// 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. + +'use strict'; + +// [START job_search_create_tenant] + +const talent = require('@google-cloud/talent').v4; + +/** Create Tenant for scoping resources, e.g. companies and jobs */ +function sampleCreateTenant(projectId, externalId) { + const client = new talent.TenantServiceClient(); + // const projectId = 'Your Google Cloud Project ID'; + // const externalId = 'Your Unique Identifier for Tenant'; + const formattedParent = client.projectPath(projectId); + const tenant = { + externalId: externalId, + }; + const request = { + parent: formattedParent, + tenant: tenant, + }; + client + .createTenant(request) + .then(responses => { + const response = responses[0]; + console.log('Created Tenant'); + console.log(`Name: ${response.name}`); + console.log(`External ID: ${response.externalId}`); + }) + .catch(err => { + console.error(err); + }); +} + +// [END job_search_create_tenant] +// tslint:disable-next-line:no-any + +const argv = require('yargs') + .option('project_id', { + default: 'Your Google Cloud Project ID', + string: true, + }) + .option('external_id', { + default: 'Your Unique Identifier for Tenant', + string: true, + }).argv; + +sampleCreateTenant(argv.project_id, argv.external_id); diff --git a/talent/snippet/job_search_custom_ranking_search.js b/talent/snippet/job_search_custom_ranking_search.js new file mode 100644 index 0000000000..136dc5911a --- /dev/null +++ b/talent/snippet/job_search_custom_ranking_search.js @@ -0,0 +1,85 @@ +// 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. + +'use strict'; + +// [START job_search_custom_ranking_search] + +const talent = require('@google-cloud/talent').v4; + +/** + * Search Jobs using custom rankings + * + * @param projectId {string} Your Google Cloud Project ID + * @param tenantId {string} Identifier of the Tenantd + */ +function sampleSearchJobs(projectId, tenantId) { + const client = new talent.JobServiceClient(); + // Iterate over all elements. + // const projectId = 'Your Google Cloud Project ID'; + // const tenantId = 'Your Tenant ID (using tenancy is optional)'; + const formattedParent = client.tenantPath(projectId, tenantId); + const domain = 'www.example.com'; + const sessionId = 'Hashed session identifier'; + const userId = 'Hashed user identifier'; + const requestMetadata = { + domain: domain, + sessionId: sessionId, + userId: userId, + }; + const importanceLevel = 'EXTREME'; + const rankingExpression = '(someFieldLong + 25) * 0.25'; + const customRankingInfo = { + importanceLevel: importanceLevel, + rankingExpression: rankingExpression, + }; + const orderBy = 'custom_ranking desc'; + const request = { + parent: formattedParent, + requestMetadata: requestMetadata, + customRankingInfo: customRankingInfo, + orderBy: orderBy, + }; + + client + .searchJobs(request) + .then(responses => { + const resources = responses[0]; + for (const resource of resources.matchingJobs) { + console.log(`Job summary: ${resource.jobSummary}`); + console.log(`Job title snippet: ${resource.jobTitleSnippet}`); + const job = resource.job; + console.log(`Job name: ${job.name}`); + console.log(`Job title: ${job.title}`); + } + }) + .catch(err => { + console.error(err); + }); +} + +// [END job_search_custom_ranking_search] +// tslint:disable-next-line:no-any + +const argv = require('yargs') + .option('project_id', { + default: 'Your Google Cloud Project ID', + string: true, + }) + .option('tenant_id', { + default: 'Your Tenant ID (using tenancy is optional)', + string: true, + }).argv; + +sampleSearchJobs(argv.project_id, argv.tenant_id); diff --git a/talent/snippet/job_search_delete_company.js b/talent/snippet/job_search_delete_company.js new file mode 100644 index 0000000000..96ed877355 --- /dev/null +++ b/talent/snippet/job_search_delete_company.js @@ -0,0 +1,51 @@ +// 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. + +'use strict'; + +// [START job_search_delete_company] + +const talent = require('@google-cloud/talent').v4; + +/** Delete Company */ +function sampleDeleteCompany(projectId, tenantId, companyId) { + const client = new talent.CompanyServiceClient(); + // const projectId = 'Your Google Cloud Project ID'; + // const tenantId = 'Your Tenant ID (using tenancy is optional)'; + // const companyId = 'ID of the company to delete'; + const formattedName = client.companyPath(projectId, tenantId, companyId); + client.deleteCompany({name: formattedName}).catch(err => { + console.error(err); + }); + console.log('Deleted company'); +} + +// [END job_search_delete_company] +// tslint:disable-next-line:no-any + +const argv = require('yargs') + .option('project_id', { + default: 'Your Google Cloud Project ID', + string: true, + }) + .option('tenant_id', { + default: 'Your Tenant ID (using tenancy is optional)', + string: true, + }) + .option('company_id', { + default: 'ID of the company to delete', + string: true, + }).argv; + +sampleDeleteCompany(argv.project_id, argv.tenant_id, argv.company_id); diff --git a/talent/snippet/job_search_delete_job.js b/talent/snippet/job_search_delete_job.js new file mode 100644 index 0000000000..37ffc1a269 --- /dev/null +++ b/talent/snippet/job_search_delete_job.js @@ -0,0 +1,51 @@ +// 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. + +'use strict'; + +// [START job_search_delete_job] + +const talent = require('@google-cloud/talent').v4; + +/** Delete Job */ +function sampleDeleteJob(projectId, tenantId, jobId) { + const client = new talent.JobServiceClient(); + // const projectId = 'Your Google Cloud Project ID'; + // const tenantId = 'Your Tenant ID (using tenancy is optional)'; + // const jobId = 'Company ID'; + const formattedName = client.jobPath(projectId, tenantId, jobId); + client.deleteJob({name: formattedName}).catch(err => { + console.error(err); + }); + console.log('Deleted job.'); +} + +// [END job_search_delete_job] +// tslint:disable-next-line:no-any + +const argv = require('yargs') + .option('project_id', { + default: 'Your Google Cloud Project ID', + string: true, + }) + .option('tenant_id', { + default: 'Your Tenant ID (using tenancy is optional)', + string: true, + }) + .option('job_id', { + default: 'Company ID', + string: true, + }).argv; + +sampleDeleteJob(argv.project_id, argv.tenant_id, argv.job_id); diff --git a/talent/snippet/job_search_delete_tenant.js b/talent/snippet/job_search_delete_tenant.js new file mode 100644 index 0000000000..dc1921e851 --- /dev/null +++ b/talent/snippet/job_search_delete_tenant.js @@ -0,0 +1,46 @@ +// 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. + +'use strict'; + +// [START job_search_delete_tenant] + +const talent = require('@google-cloud/talent').v4; + +/** Delete Tenant */ +function sampleDeleteTenant(projectId, tenantId) { + const client = new talent.TenantServiceClient(); + // const projectId = 'Your Google Cloud Project ID'; + // const tenantId = 'Your Tenant ID)'; + const formattedName = client.tenantPath(projectId, tenantId); + client.deleteTenant({name: formattedName}).catch(err => { + console.error(err); + }); + console.log('Deleted Tenant.'); +} + +// [END job_search_delete_tenant] +// tslint:disable-next-line:no-any + +const argv = require('yargs') + .option('project_id', { + default: 'Your Google Cloud Project ID', + string: true, + }) + .option('tenant_id', { + default: 'Your Tenant ID)', + string: true, + }).argv; + +sampleDeleteTenant(argv.project_id, argv.tenant_id); diff --git a/talent/snippet/job_search_get_company.js b/talent/snippet/job_search_get_company.js new file mode 100644 index 0000000000..12c22a0b57 --- /dev/null +++ b/talent/snippet/job_search_get_company.js @@ -0,0 +1,57 @@ +// 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. + +'use strict'; + +// [START job_search_get_company] + +const talent = require('@google-cloud/talent').v4; + +/** Get Company */ +function sampleGetCompany(projectId, tenantId, companyId) { + const client = new talent.CompanyServiceClient(); + // const projectId = 'Your Google Cloud Project ID'; + // const tenantId = 'Your Tenant ID (using tenancy is optional)'; + // const companyId = 'Company ID'; + const formattedName = client.companyPath(projectId, tenantId, companyId); + client + .getCompany({name: formattedName}) + .then(responses => { + const response = responses[0]; + console.log(`Company name: ${response.name}`); + console.log(`Display name: ${response.displayName}`); + }) + .catch(err => { + console.error(err); + }); +} + +// [END job_search_get_company] +// tslint:disable-next-line:no-any + +const argv = require('yargs') + .option('project_id', { + default: 'Your Google Cloud Project ID', + string: true, + }) + .option('tenant_id', { + default: 'Your Tenant ID (using tenancy is optional)', + string: true, + }) + .option('company_id', { + default: 'Company ID', + string: true, + }).argv; + +sampleGetCompany(argv.project_id, argv.tenant_id, argv.company_id); diff --git a/talent/snippet/job_search_get_job.js b/talent/snippet/job_search_get_job.js new file mode 100644 index 0000000000..c49de33920 --- /dev/null +++ b/talent/snippet/job_search_get_job.js @@ -0,0 +1,69 @@ +// 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. + +'use strict'; + +// [START job_search_get_job] + +const talent = require('@google-cloud/talent').v4; + +/** Get Job */ +function sampleGetJob(projectId, tenantId, jobId) { + const client = new talent.JobServiceClient(); + // const projectId = 'Your Google Cloud Project ID'; + // const tenantId = 'Your Tenant ID (using tenancy is optional)'; + // const jobId = 'Job ID'; + const formattedName = client.jobPath(projectId, tenantId, jobId); + client + .getJob({name: formattedName}) + .then(responses => { + const response = responses[0]; + console.log(`Job name: ${response.name}`); + console.log(`Requisition ID: ${response.requisitionId}`); + console.log(`Title: ${response.title}`); + console.log(`Description: ${response.description}`); + console.log(`Posting language: ${response.languageCode}`); + for (const address of response.addresses) { + console.log(`Address: ${address}`); + } + for (const email of response.applicationInfo.emails) { + console.log(`Email: ${email}`); + } + for (const websiteUri of response.applicationInfo.uris) { + console.log(`Website: ${websiteUri}`); + } + }) + .catch(err => { + console.error(err); + }); +} + +// [END job_search_get_job] +// tslint:disable-next-line:no-any + +const argv = require('yargs') + .option('project_id', { + default: 'Your Google Cloud Project ID', + string: true, + }) + .option('tenant_id', { + default: 'Your Tenant ID (using tenancy is optional)', + string: true, + }) + .option('job_id', { + default: 'Job ID', + string: true, + }).argv; + +sampleGetJob(argv.project_id, argv.tenant_id, argv.job_id); diff --git a/talent/snippet/job_search_get_tenant.js b/talent/snippet/job_search_get_tenant.js new file mode 100644 index 0000000000..ed76917c6b --- /dev/null +++ b/talent/snippet/job_search_get_tenant.js @@ -0,0 +1,52 @@ +// 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. + +'use strict'; + +// [START job_search_get_tenant] + +const talent = require('@google-cloud/talent').v4; + +/** Get Tenant by name */ +function sampleGetTenant(projectId, tenantId) { + const client = new talent.TenantServiceClient(); + // const projectId = 'Your Google Cloud Project ID'; + // const tenantId = 'Your Tenant ID'; + const formattedName = client.tenantPath(projectId, tenantId); + client + .getTenant({name: formattedName}) + .then(responses => { + const response = responses[0]; + console.log(`Name: ${response.name}`); + console.log(`External ID: ${response.externalId}`); + }) + .catch(err => { + console.error(err); + }); +} + +// [END job_search_get_tenant] +// tslint:disable-next-line:no-any + +const argv = require('yargs') + .option('project_id', { + default: 'Your Google Cloud Project ID', + string: true, + }) + .option('tenant_id', { + default: 'Your Tenant ID', + string: true, + }).argv; + +sampleGetTenant(argv.project_id, argv.tenant_id); diff --git a/talent/snippet/job_search_histogram_search.js b/talent/snippet/job_search_histogram_search.js new file mode 100644 index 0000000000..69282fccdb --- /dev/null +++ b/talent/snippet/job_search_histogram_search.js @@ -0,0 +1,87 @@ +// 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. + +'use strict'; + +// [START job_search_histogram_search] + +const talent = require('@google-cloud/talent').v4; + +/** + * Search Jobs with histogram queries + * + * @param query {string} Histogram query + * More info on histogram facets, constants, and built-in functions: + * https://godoc.org/google.golang.org/genproto/googleapis/cloud/talent/v4beta1#SearchJobsRequest + */ +function sampleSearchJobs(projectId, tenantId, query) { + const client = new talent.JobServiceClient(); + // Iterate over all elements. + // const projectId = 'Your Google Cloud Project ID'; + // const tenantId = 'Your Tenant ID (using tenancy is optional)'; + // const query = 'count(base_compensation, [bucket(12, 20)])'; + const formattedParent = client.tenantPath(projectId, tenantId); + const domain = 'www.example.com'; + const sessionId = 'Hashed session identifier'; + const userId = 'Hashed user identifier'; + const requestMetadata = { + domain: domain, + sessionId: sessionId, + userId: userId, + }; + const histogramQueriesElement = { + histogramQuery: query, + }; + const histogramQueries = [histogramQueriesElement]; + const request = { + parent: formattedParent, + requestMetadata: requestMetadata, + histogramQueries: histogramQueries, + }; + + client + .searchJobs(request) + .then(responses => { + const resources = responses[0]; + for (const resource of resources.matchingJobs) { + console.log(`Job summary: ${resource.jobSummary}`); + console.log(`Job title snippet: ${resource.jobTitleSnippet}`); + const job = resource.job; + console.log(`Job name: ${job.name}`); + console.log(`Job title: ${job.title}`); + } + }) + .catch(err => { + console.error(err); + }); +} + +// [END job_search_histogram_search] +// tslint:disable-next-line:no-any + +const argv = require('yargs') + .option('project_id', { + default: 'Your Google Cloud Project ID', + string: true, + }) + .option('tenant_id', { + default: 'Your Tenant ID (using tenancy is optional)', + string: true, + }) + .option('query', { + default: 'count(base_compensation, [bucket(12, 20)])', + string: true, + }).argv; + +sampleSearchJobs(argv.project_id, argv.tenant_id, argv.query); diff --git a/talent/snippet/job_search_list_companies.js b/talent/snippet/job_search_list_companies.js new file mode 100644 index 0000000000..96cc6ffcef --- /dev/null +++ b/talent/snippet/job_search_list_companies.js @@ -0,0 +1,62 @@ +// 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. + +'use strict'; + +// [START job_search_list_companies] + +const talent = require('@google-cloud/talent').v4; + +/** + * List Companies + * + * @param projectId {string} Your Google Cloud Project ID + * @param tenantId {string} Identifier of the Tenant + */ +function sampleListCompanies(projectId, tenantId) { + const client = new talent.CompanyServiceClient(); + // Iterate over all elements. + // const projectId = 'Your Google Cloud Project ID'; + // const tenantId = 'Your Tenant ID (using tenancy is optional)'; + const formattedParent = client.tenantPath(projectId, tenantId); + + client + .listCompanies({parent: formattedParent}) + .then(responses => { + const resources = responses[0]; + for (const resource of resources) { + console.log(`Company Name: ${resource.name}`); + console.log(`Display Name: ${resource.displayName}`); + console.log(`External ID: ${resource.externalId}`); + } + }) + .catch(err => { + console.error(err); + }); +} + +// [END job_search_list_companies] +// tslint:disable-next-line:no-any + +const argv = require('yargs') + .option('project_id', { + default: 'Your Google Cloud Project ID', + string: true, + }) + .option('tenant_id', { + default: 'Your Tenant ID (using tenancy is optional)', + string: true, + }).argv; + +sampleListCompanies(argv.project_id, argv.tenant_id); diff --git a/talent/snippet/job_search_list_jobs.js b/talent/snippet/job_search_list_jobs.js new file mode 100644 index 0000000000..62d08f309c --- /dev/null +++ b/talent/snippet/job_search_list_jobs.js @@ -0,0 +1,72 @@ +// 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. + +'use strict'; + +// [START job_search_list_jobs] + +const talent = require('@google-cloud/talent').v4; + +/** + * List Jobs + * + * @param projectId {string} Your Google Cloud Project ID + * @param tenantId {string} Identifier of the Tenant + */ +function sampleListJobs(projectId, tenantId, filter) { + const client = new talent.JobServiceClient(); + // Iterate over all elements. + // const projectId = 'Your Google Cloud Project ID'; + // const tenantId = 'Your Tenant ID (using tenancy is optional)'; + // const filter = 'companyName=projects/my-project/companies/company-id'; + const formattedParent = client.tenantPath(projectId, tenantId); + const request = { + parent: formattedParent, + filter: filter, + }; + + client + .listJobs(request) + .then(responses => { + const resources = responses[0]; + for (const resource of resources) { + console.log(`Job name: ${resource.name}`); + console.log(`Job requisition ID: ${resource.requisitionId}`); + console.log(`Job title: ${resource.title}`); + console.log(`Job description: ${resource.description}`); + } + }) + .catch(err => { + console.error(err); + }); +} + +// [END job_search_list_jobs] +// tslint:disable-next-line:no-any + +const argv = require('yargs') + .option('project_id', { + default: 'Your Google Cloud Project ID', + string: true, + }) + .option('tenant_id', { + default: 'Your Tenant ID (using tenancy is optional)', + string: true, + }) + .option('filter', { + default: 'companyName=projects/my-project/companies/company-id', + string: true, + }).argv; + +sampleListJobs(argv.project_id, argv.tenant_id, argv.filter); diff --git a/talent/snippet/job_search_list_tenants.js b/talent/snippet/job_search_list_tenants.js new file mode 100644 index 0000000000..aba625d9d5 --- /dev/null +++ b/talent/snippet/job_search_list_tenants.js @@ -0,0 +1,50 @@ +// 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. + +'use strict'; + +// [START job_search_list_tenants] + +const talent = require('@google-cloud/talent').v4; + +/** List Tenants */ +function sampleListTenants(projectId) { + const client = new talent.TenantServiceClient(); + // Iterate over all elements. + // const projectId = 'Your Google Cloud Project ID'; + const formattedParent = client.projectPath(projectId); + + client + .listTenants({parent: formattedParent}) + .then(responses => { + const resources = responses[0]; + for (const resource of resources) { + console.log(`Tenant Name: ${resource.name}`); + console.log(`External ID: ${resource.externalId}`); + } + }) + .catch(err => { + console.error(err); + }); +} + +// [END job_search_list_tenants] +// tslint:disable-next-line:no-any + +const argv = require('yargs').option('project_id', { + default: 'Your Google Cloud Project ID', + string: true, +}).argv; + +sampleListTenants(argv.project_id); diff --git a/talent/test/no-test.js b/talent/test/no-test.js deleted file mode 100644 index 665d93e66f..0000000000 --- a/talent/test/no-test.js +++ /dev/null @@ -1 +0,0 @@ -console.log('no test yet'); diff --git a/talent/test/talent.test.js b/talent/test/talent.test.js new file mode 100644 index 0000000000..353f129fb0 --- /dev/null +++ b/talent/test/talent.test.js @@ -0,0 +1,140 @@ +// 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. + +'use strict'; + +const {assert} = require('chai'); +const cp = require('child_process'); +const {v4} = require('uuid'); +const {describe, it, before, after} = require('mocha'); + +const talent = require('@google-cloud/talent').v4; +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +describe('Talent Solution Jobs API v4 samples', () => { + const projectId = process.env.GCLOUD_PROJECT; + const tenantService = new talent.TenantServiceClient(); + const companyService = new talent.CompanyServiceClient(); + const jobService = new talent.JobServiceClient(); + + let tenant; + let company; + let job; + + let tenantId; + let companyId; + let jobId; + + before(async () => { + const formattedParent = tenantService.projectPath(projectId); + + [tenant] = await tenantService.createTenant({ + parent: formattedParent, + tenant: { + externalId: `${Date.now()}-${v4()}`, + }, + }); + tenantId = tenant.name.split('/').slice(-1)[0]; + console.log(`created tenant: ${tenant.name}`); + + [company] = await companyService.createCompany({ + parent: tenant.name, + company: { + displayName: 'Google', + externalId: `${Date.now()}-${v4()}`, + }, + }); + console.log(`created company: ${company.name}`); + companyId = company.name.split('/').slice(-1)[0]; + + const applicationInfo = { + uris: ['http://test.url'], + }; + + const addressOne = '1600 Amphitheatre Parkway, Mountain View, CA 94043'; + const addressTwo = '111 8th Avenue, New York, NY 10011'; + + const jobRequest = { + company: company.name, + requisitionId: v4(), + title: 'Software engineer', + description: 'Nodejs engineer', + applicationInfo: applicationInfo, + addresses: [addressOne, addressTwo], + languageCode: 'en-US', + }; + + [job] = await jobService.createJob({ + parent: tenant.name, + job: jobRequest, + }); + console.log(`created job: ${job.name}`); + jobId = job.name.split('/').slice(-1)[0]; + }); + + after(async () => { + await jobService.deleteJob({name: job.name}); + await companyService.deleteCompany({name: company.name}); + await tenantService.deleteTenant({name: tenant.name}); + }); + + it('Gets a job', async () => { + console.log( + `node snippet/job_search_get_job.js --project_id=${projectId} --tenant_id=${tenantId} --job_id=${jobId}` + ); + const output = execSync( + `node snippet/job_search_get_job.js --project_id=${projectId} --tenant_id=${tenantId} --job_id=${jobId}` + ); + assert.match(output, new RegExp('Job name')); + }); + it('Gets a company', async () => { + console.log( + `node snippet/job_search_get_company.js --project_id=${projectId} --tenant_id=${tenantId} --company_id=${companyId}` + ); + const output = execSync( + `node snippet/job_search_get_company.js --project_id=${projectId} --tenant_id=${tenantId} --company_id=${companyId}` + ); + assert.match(output, new RegExp('Company name')); + }); + + it('Gets a tenant', async () => { + console.log( + `node snippet/job_search_get_tenant.js --project_id=${projectId} --tenant_id=${tenantId}` + ); + const output = execSync( + `node snippet/job_search_get_tenant.js --project_id=${projectId} --tenant_id=${tenantId}` + ); + assert.match(output, new RegExp('Name')); + }); + + it('Searches for a job with custom ranking search', async () => { + console.log( + `node snippet/job_search_custom_ranking_search.js --project_id=${projectId} --tenant_id=${tenantId}` + ); + const output = execSync( + `node snippet/job_search_custom_ranking_search.js --project_id=${projectId} --tenant_id=${tenantId}` + ); + assert.match(output, new RegExp('Job summary')); + }); + + it('Searches for a job with histogram', async () => { + console.log( + `node snippet/job_search_histogram_search.js --project_id=${projectId} --tenant_id=${tenantId}` + ); + const output = execSync( + `node snippet/job_search_histogram_search.js --project_id=${projectId} --tenant_id=${tenantId}` + ); + assert.match(output, new RegExp('Job summary')); + }); +}); From 14ae3fc3e395a484b609750f99cb5fec40ae0ced Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 11 Nov 2020 12:49:58 -0800 Subject: [PATCH 24/51] chore: release 3.0.1 (#265) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 0f35f1dcb5..5cebdecb0c 100644 --- a/talent/package.json +++ b/talent/package.json @@ -17,7 +17,7 @@ "lint:fix": "npm run lint -- --fix" }, "dependencies": { - "@google-cloud/talent": "^3.0.0", + "@google-cloud/talent": "^3.0.1", "uuid": "^8.3.1", "yargs": "^16.0.3" }, From e39b9dc9e4b3a48de6df9ae0e16b57bd4942c463 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 2 Dec 2020 19:40:26 +0000 Subject: [PATCH 25/51] chore: release 3.0.2 (#275) :robot: I have created a release \*beep\* \*boop\* --- ### [3.0.2](https://www.github.com/googleapis/nodejs-talent/compare/v3.0.1...v3.0.2) (2020-11-25) ### Bug Fixes * **browser:** check for fetch on window ([#274](https://www.github.com/googleapis/nodejs-talent/issues/274)) ([a25c71f](https://www.github.com/googleapis/nodejs-talent/commit/a25c71ff62a46138e088f01d5b9cd8b165588bbd)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 5cebdecb0c..b335591a5c 100644 --- a/talent/package.json +++ b/talent/package.json @@ -17,7 +17,7 @@ "lint:fix": "npm run lint -- --fix" }, "dependencies": { - "@google-cloud/talent": "^3.0.1", + "@google-cloud/talent": "^3.0.2", "uuid": "^8.3.1", "yargs": "^16.0.3" }, From 6d9ad13e28acb699f97813406ebca5999fb1c65f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 12 Jan 2021 18:36:15 +0000 Subject: [PATCH 26/51] chore: release 3.1.0 (#282) :robot: I have created a release \*beep\* \*boop\* --- ## [3.1.0](https://www.github.com/googleapis/nodejs-talent/compare/v3.0.2...v3.1.0) (2021-01-09) ### Features * adds style enumeration ([#281](https://www.github.com/googleapis/nodejs-talent/issues/281)) ([88651c2](https://www.github.com/googleapis/nodejs-talent/commit/88651c2a95638e685235fd8bdf478d4ce71ce941)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index b335591a5c..403315aebc 100644 --- a/talent/package.json +++ b/talent/package.json @@ -17,7 +17,7 @@ "lint:fix": "npm run lint -- --fix" }, "dependencies": { - "@google-cloud/talent": "^3.0.2", + "@google-cloud/talent": "^3.1.0", "uuid": "^8.3.1", "yargs": "^16.0.3" }, From e352e79559237142cf124dc2b98f14eecdd06845 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 1 Mar 2021 18:08:29 -0800 Subject: [PATCH 27/51] chore: release 3.2.0 (#288) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 403315aebc..523ba18706 100644 --- a/talent/package.json +++ b/talent/package.json @@ -17,7 +17,7 @@ "lint:fix": "npm run lint -- --fix" }, "dependencies": { - "@google-cloud/talent": "^3.1.0", + "@google-cloud/talent": "^3.2.0", "uuid": "^8.3.1", "yargs": "^16.0.3" }, From 6898a7e5b756ef251615d520e6e060d8e057fad1 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 13 May 2021 10:36:04 -0700 Subject: [PATCH 28/51] chore: release 3.2.1 (#316) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 523ba18706..439e9a1f8e 100644 --- a/talent/package.json +++ b/talent/package.json @@ -17,7 +17,7 @@ "lint:fix": "npm run lint -- --fix" }, "dependencies": { - "@google-cloud/talent": "^3.2.0", + "@google-cloud/talent": "^3.2.1", "uuid": "^8.3.1", "yargs": "^16.0.3" }, From 271646ffe769d117c45fa4c7a654837704b9aa21 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 21 May 2021 19:04:33 +0200 Subject: [PATCH 29/51] chore(deps): update dependency @types/node to v14 (#322) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^12.0.0` -> `^14.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/12.20.13/14.17.0) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/compatibility-slim/12.20.13)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/confidence-slim/12.20.13)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻️ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-talent). --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 439e9a1f8e..4b4e84c31d 100644 --- a/talent/package.json +++ b/talent/package.json @@ -23,7 +23,7 @@ }, "devDependencies": { "@types/mocha": "^8.0.0", - "@types/node": "^12.0.0", + "@types/node": "^14.0.0", "chai": "^4.2.0", "mocha": "^8.1.3" } From d42bf435dcfe3419eb499bb8ca1ca8da7592bd56 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 27 May 2021 11:44:18 -0400 Subject: [PATCH 30/51] chore: release 3.2.2 (#325) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 4b4e84c31d..ee46076978 100644 --- a/talent/package.json +++ b/talent/package.json @@ -17,7 +17,7 @@ "lint:fix": "npm run lint -- --fix" }, "dependencies": { - "@google-cloud/talent": "^3.2.1", + "@google-cloud/talent": "^3.2.2", "uuid": "^8.3.1", "yargs": "^16.0.3" }, From 26b17d186efb91ff0885b6903b017140ebabb01d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 22 Jun 2021 20:40:40 +0000 Subject: [PATCH 31/51] chore: release 3.2.3 (#336) :robot: I have created a release \*beep\* \*boop\* --- ### [3.2.3](https://www.github.com/googleapis/nodejs-talent/compare/v3.2.2...v3.2.3) (2021-06-22) ### Bug Fixes * make request optional in all cases ([#335](https://www.github.com/googleapis/nodejs-talent/issues/335)) ([7ba1f51](https://www.github.com/googleapis/nodejs-talent/commit/7ba1f51db25cf37b33f9a611e031c7294112649a)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index ee46076978..d4761846be 100644 --- a/talent/package.json +++ b/talent/package.json @@ -17,7 +17,7 @@ "lint:fix": "npm run lint -- --fix" }, "dependencies": { - "@google-cloud/talent": "^3.2.2", + "@google-cloud/talent": "^3.2.3", "uuid": "^8.3.1", "yargs": "^16.0.3" }, From 9486d15fe689e20aa59693bdd7f4d1fdf4bd45b4 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 30 Jun 2021 16:32:28 +0000 Subject: [PATCH 32/51] chore: release 3.2.4 (#343) :robot: I have created a release \*beep\* \*boop\* --- ### [3.2.4](https://www.github.com/googleapis/nodejs-talent/compare/v3.2.3...v3.2.4) (2021-06-30) ### Bug Fixes * **deps:** google-gax v2.17.0 with mTLS ([#341](https://www.github.com/googleapis/nodejs-talent/issues/341)) ([2c240e8](https://www.github.com/googleapis/nodejs-talent/commit/2c240e8cf02566285836b506addbfdfcc76cfa98)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index d4761846be..41ce94d230 100644 --- a/talent/package.json +++ b/talent/package.json @@ -17,7 +17,7 @@ "lint:fix": "npm run lint -- --fix" }, "dependencies": { - "@google-cloud/talent": "^3.2.3", + "@google-cloud/talent": "^3.2.4", "uuid": "^8.3.1", "yargs": "^16.0.3" }, From 39cd6b0beb35a158beb5bf619b38162dad3ba34d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 12 Jul 2021 22:04:29 +0000 Subject: [PATCH 33/51] chore: release 3.2.5 (#346) :robot: I have created a release \*beep\* \*boop\* --- ### [3.2.5](https://www.github.com/googleapis/nodejs-talent/compare/v3.2.4...v3.2.5) (2021-07-12) ### Bug Fixes * **deps:** google-gax v2.17.1 ([#345](https://www.github.com/googleapis/nodejs-talent/issues/345)) ([85c9f44](https://www.github.com/googleapis/nodejs-talent/commit/85c9f442fc9b2054af19e479ded0cb04f8846161)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 41ce94d230..757d94aa53 100644 --- a/talent/package.json +++ b/talent/package.json @@ -17,7 +17,7 @@ "lint:fix": "npm run lint -- --fix" }, "dependencies": { - "@google-cloud/talent": "^3.2.4", + "@google-cloud/talent": "^3.2.5", "uuid": "^8.3.1", "yargs": "^16.0.3" }, From fcc38031e6eef10863358ccfd2f1a90338406183 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 16 Jul 2021 12:50:35 -0700 Subject: [PATCH 34/51] chore: release 3.2.6 (#348) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 757d94aa53..9d572903bf 100644 --- a/talent/package.json +++ b/talent/package.json @@ -17,7 +17,7 @@ "lint:fix": "npm run lint -- --fix" }, "dependencies": { - "@google-cloud/talent": "^3.2.5", + "@google-cloud/talent": "^3.2.6", "uuid": "^8.3.1", "yargs": "^16.0.3" }, From d406cb0a341391c157a20add8c457d462c0cea80 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 17 Aug 2021 03:06:29 +0000 Subject: [PATCH 35/51] chore: release 3.2.7 (#357) :robot: I have created a release \*beep\* \*boop\* --- ### [3.2.7](https://www.github.com/googleapis/nodejs-talent/compare/v3.2.6...v3.2.7) (2021-08-17) ### Bug Fixes * **deps:** google-gax v2.24.1 ([#355](https://www.github.com/googleapis/nodejs-talent/issues/355)) ([241f0ac](https://www.github.com/googleapis/nodejs-talent/commit/241f0ac2a3d49205feec269e0007d536df2fb367)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 9d572903bf..22571833c0 100644 --- a/talent/package.json +++ b/talent/package.json @@ -17,7 +17,7 @@ "lint:fix": "npm run lint -- --fix" }, "dependencies": { - "@google-cloud/talent": "^3.2.6", + "@google-cloud/talent": "^3.2.7", "uuid": "^8.3.1", "yargs": "^16.0.3" }, From 57539a8f215374c9d52723a3d46d35914c33eb12 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 17 Aug 2021 15:56:35 +0000 Subject: [PATCH 36/51] chore: release 3.3.0 (#358) :robot: I have created a release \*beep\* \*boop\* --- ## [3.3.0](https://www.github.com/googleapis/nodejs-talent/compare/v3.2.7...v3.3.0) (2021-08-17) ### Features * Add new commute methods in Search APIs feat: Add new histogram type 'publish_time_in_day' feat: Support filtering by requisitionId is ListJobs API ([#356](https://www.github.com/googleapis/nodejs-talent/issues/356)) ([6ff8783](https://www.github.com/googleapis/nodejs-talent/commit/6ff87834432014db8ddcdd0a1342346f85354d51)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 22571833c0..7893e72310 100644 --- a/talent/package.json +++ b/talent/package.json @@ -17,7 +17,7 @@ "lint:fix": "npm run lint -- --fix" }, "dependencies": { - "@google-cloud/talent": "^3.2.7", + "@google-cloud/talent": "^3.3.0", "uuid": "^8.3.1", "yargs": "^16.0.3" }, From 269347b314226731d91af3b0e948ce43fabd4a45 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 24 Aug 2021 08:31:55 -0700 Subject: [PATCH 37/51] chore: release 3.4.0 (#360) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 7893e72310..50583c89c4 100644 --- a/talent/package.json +++ b/talent/package.json @@ -17,7 +17,7 @@ "lint:fix": "npm run lint -- --fix" }, "dependencies": { - "@google-cloud/talent": "^3.3.0", + "@google-cloud/talent": "^3.4.0", "uuid": "^8.3.1", "yargs": "^16.0.3" }, From dd13e28e6b2de3b19561b7315435799074cf62b3 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 10 Sep 2021 10:55:03 -0700 Subject: [PATCH 38/51] chore: release 3.4.1 (#363) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 50583c89c4..fed5af402a 100644 --- a/talent/package.json +++ b/talent/package.json @@ -17,7 +17,7 @@ "lint:fix": "npm run lint -- --fix" }, "dependencies": { - "@google-cloud/talent": "^3.4.0", + "@google-cloud/talent": "^3.4.1", "uuid": "^8.3.1", "yargs": "^16.0.3" }, From aa8c87de6e55a1d761e27f95f1c7fa6b7b394924 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 15 Sep 2021 14:20:09 +0000 Subject: [PATCH 39/51] chore: release 3.5.0 (#366) :robot: I have created a release \*beep\* \*boop\* --- ## [3.5.0](https://www.github.com/googleapis/nodejs-talent/compare/v3.4.1...v3.5.0) (2021-09-15) ### Features * Added a new `KeywordMatchMode` field to support more keyword matching options feat: Added more `DiversificationLevel` configuration options ([#365](https://www.github.com/googleapis/nodejs-talent/issues/365)) ([bc2c5cf](https://www.github.com/googleapis/nodejs-talent/commit/bc2c5cfc7dd465dd476c027acd978e07ed18b298)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index fed5af402a..b699dd9453 100644 --- a/talent/package.json +++ b/talent/package.json @@ -17,7 +17,7 @@ "lint:fix": "npm run lint -- --fix" }, "dependencies": { - "@google-cloud/talent": "^3.4.1", + "@google-cloud/talent": "^3.5.0", "uuid": "^8.3.1", "yargs": "^16.0.3" }, From 7d0c14790de7467afc4300908ba872ee54573ab5 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 28 Sep 2021 23:28:39 +0000 Subject: [PATCH 40/51] docs(samples): add auto-generated samples for Node with api short name in region tag (#371) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 399287285 Source-Link: https://github.com/googleapis/googleapis/commit/15759865d1c54e3d46429010f7e472fe6c3d3715 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b27fff623a5d8d586b703b5e4919856abe7c2eb3 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjI3ZmZmNjIzYTVkOGQ1ODZiNzAzYjVlNDkxOTg1NmFiZTdjMmViMyJ9 --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index b699dd9453..e13d1783d6 100644 --- a/talent/package.json +++ b/talent/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=8" + "node": ">=10" }, "repository": "googleapis/nodejs-talent", "private": true, From 759bb24f10ce0b74e9ad80cc1ab36c06e6bdcfa4 Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Wed, 20 Oct 2021 09:28:17 -0700 Subject: [PATCH 41/51] fix: flaky sample test two ways (#375) 1. Examine all the resources in the response. 2. I suspect, but cannot prove that the search function is eventually consistent. So, give it some time. Fixes https://github.com/googleapis/nodejs-talent/issues/344 --- .../job_search_custom_ranking_search.js | 15 +++-- talent/test/talent.test.js | 64 +++++++++++++------ 2 files changed, 53 insertions(+), 26 deletions(-) diff --git a/talent/snippet/job_search_custom_ranking_search.js b/talent/snippet/job_search_custom_ranking_search.js index 136dc5911a..7a58341970 100644 --- a/talent/snippet/job_search_custom_ranking_search.js +++ b/talent/snippet/job_search_custom_ranking_search.js @@ -55,13 +55,14 @@ function sampleSearchJobs(projectId, tenantId) { client .searchJobs(request) .then(responses => { - const resources = responses[0]; - for (const resource of resources.matchingJobs) { - console.log(`Job summary: ${resource.jobSummary}`); - console.log(`Job title snippet: ${resource.jobTitleSnippet}`); - const job = resource.job; - console.log(`Job name: ${job.name}`); - console.log(`Job title: ${job.title}`); + for (const resources of responses) { + for (const resource of resources.matchingJobs) { + console.log(`Job summary: ${resource.jobSummary}`); + console.log(`Job title snippet: ${resource.jobTitleSnippet}`); + const job = resource.job; + console.log(`Job name: ${job.name}`); + console.log(`Job title: ${job.title}`); + } } }) .catch(err => { diff --git a/talent/test/talent.test.js b/talent/test/talent.test.js index 353f129fb0..bd1e769e96 100644 --- a/talent/test/talent.test.js +++ b/talent/test/talent.test.js @@ -22,6 +22,26 @@ const {describe, it, before, after} = require('mocha'); const talent = require('@google-cloud/talent').v4; const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); +/** + * For eventually consistent APIs, retry the test after a few seconds, up to 3 times. + * @param {function} testFunction the test function to retry. + * @returns {function} + */ +function eventually(testFunction) { + return async () => { + let delayMs = 2000; + for (let i = 0; i < 2; ++i) { + try { + return await testFunction(); + } catch (e) { + await new Promise(resolve => setTimeout(resolve, delayMs)); + delayMs *= 2; + } + } + return await testFunction(); + }; +} + describe('Talent Solution Jobs API v4 samples', () => { const projectId = process.env.GCLOUD_PROJECT; const tenantService = new talent.TenantServiceClient(); @@ -118,23 +138,29 @@ describe('Talent Solution Jobs API v4 samples', () => { assert.match(output, new RegExp('Name')); }); - it('Searches for a job with custom ranking search', async () => { - console.log( - `node snippet/job_search_custom_ranking_search.js --project_id=${projectId} --tenant_id=${tenantId}` - ); - const output = execSync( - `node snippet/job_search_custom_ranking_search.js --project_id=${projectId} --tenant_id=${tenantId}` - ); - assert.match(output, new RegExp('Job summary')); - }); - - it('Searches for a job with histogram', async () => { - console.log( - `node snippet/job_search_histogram_search.js --project_id=${projectId} --tenant_id=${tenantId}` - ); - const output = execSync( - `node snippet/job_search_histogram_search.js --project_id=${projectId} --tenant_id=${tenantId}` - ); - assert.match(output, new RegExp('Job summary')); - }); + it( + 'Searches for a job with custom ranking search', + eventually(async () => { + console.log( + `node snippet/job_search_custom_ranking_search.js --project_id=${projectId} --tenant_id=${tenantId}` + ); + const output = execSync( + `node snippet/job_search_custom_ranking_search.js --project_id=${projectId} --tenant_id=${tenantId}` + ); + assert.match(output, new RegExp('Job summary')); + }) + ); + + it( + 'Searches for a job with histogram', + eventually(async () => { + console.log( + `node snippet/job_search_histogram_search.js --project_id=${projectId} --tenant_id=${tenantId}` + ); + const output = execSync( + `node snippet/job_search_histogram_search.js --project_id=${projectId} --tenant_id=${tenantId}` + ); + assert.match(output, new RegExp('Job summary')); + }) + ); }); From 702284c59addecd58c0f0b58aa915e00ed7a4fc8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 20 Oct 2021 16:34:18 +0000 Subject: [PATCH 42/51] chore: release 3.5.1 (#376) :robot: I have created a release \*beep\* \*boop\* --- ### [3.5.1](https://www.github.com/googleapis/nodejs-talent/compare/v3.5.0...v3.5.1) (2021-10-20) ### Bug Fixes * flaky sample test two ways ([#375](https://www.github.com/googleapis/nodejs-talent/issues/375)) ([d722bdb](https://www.github.com/googleapis/nodejs-talent/commit/d722bdb0523e8fb5907d4760b33ba75901572747)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index e13d1783d6..145b7c08b0 100644 --- a/talent/package.json +++ b/talent/package.json @@ -17,7 +17,7 @@ "lint:fix": "npm run lint -- --fix" }, "dependencies": { - "@google-cloud/talent": "^3.5.0", + "@google-cloud/talent": "^3.5.1", "uuid": "^8.3.1", "yargs": "^16.0.3" }, From 92c87ffb96e8bef6e694147afaafa2b816d30f04 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 26 Oct 2021 23:19:09 +0200 Subject: [PATCH 43/51] chore(deps): update dependency @types/node to v16 (#377) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^14.0.0` -> `^16.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/14.17.32/16.11.6) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/compatibility-slim/14.17.32)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/confidence-slim/14.17.32)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-talent). --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 145b7c08b0..0f49506ad9 100644 --- a/talent/package.json +++ b/talent/package.json @@ -23,7 +23,7 @@ }, "devDependencies": { "@types/mocha": "^8.0.0", - "@types/node": "^14.0.0", + "@types/node": "^16.0.0", "chai": "^4.2.0", "mocha": "^8.1.3" } From 0f951d2b20e6361163d03569bf045c51d8ce9d74 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 3 May 2022 02:24:16 +0200 Subject: [PATCH 44/51] chore(deps): update dependency @types/mocha to v9 (#415) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/mocha](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^8.0.0` -> `^9.0.0`](https://renovatebot.com/diffs/npm/@types%2fmocha/8.2.3/9.1.1) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/compatibility-slim/8.2.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/confidence-slim/8.2.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-talent). --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 0f49506ad9..8ddcbe1194 100644 --- a/talent/package.json +++ b/talent/package.json @@ -22,7 +22,7 @@ "yargs": "^16.0.3" }, "devDependencies": { - "@types/mocha": "^8.0.0", + "@types/mocha": "^9.0.0", "@types/node": "^16.0.0", "chai": "^4.2.0", "mocha": "^8.1.3" From 56f46bf2f5c4f4f09b038d52ae656ebfd1945831 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Mon, 16 May 2022 17:34:59 -0700 Subject: [PATCH 45/51] build!: update library to use Node 12 (#420) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat!: Update library to use Node 12 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 8ddcbe1194..866d58d291 100644 --- a/talent/package.json +++ b/talent/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=10" + "node": ">=12.0.0" }, "repository": "googleapis/nodejs-talent", "private": true, From 767152a9cfd012e04a4eaeb063f558f3bf710dfb Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 17 May 2022 17:05:45 -0700 Subject: [PATCH 46/51] chore(main): release 4.0.0 (#421) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 4.0.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 866d58d291..0675618f99 100644 --- a/talent/package.json +++ b/talent/package.json @@ -17,7 +17,7 @@ "lint:fix": "npm run lint -- --fix" }, "dependencies": { - "@google-cloud/talent": "^3.5.1", + "@google-cloud/talent": "^4.0.0", "uuid": "^8.3.1", "yargs": "^16.0.3" }, From d0661de35c1c12314f17c195e3606ce7b9ad50fd Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 7 Jun 2022 15:46:54 -0400 Subject: [PATCH 47/51] chore(main): release 4.1.0 (#423) See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 0675618f99..2b464341b0 100644 --- a/talent/package.json +++ b/talent/package.json @@ -17,7 +17,7 @@ "lint:fix": "npm run lint -- --fix" }, "dependencies": { - "@google-cloud/talent": "^4.0.0", + "@google-cloud/talent": "^4.1.0", "uuid": "^8.3.1", "yargs": "^16.0.3" }, From 53c97bd23a5f749b80f5f98a4ce4e1de2e579e9f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 12 Jul 2022 16:13:32 -0700 Subject: [PATCH 48/51] chore(main): release 4.1.1 (#433) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 4.1.1 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 2b464341b0..9eb5356087 100644 --- a/talent/package.json +++ b/talent/package.json @@ -17,7 +17,7 @@ "lint:fix": "npm run lint -- --fix" }, "dependencies": { - "@google-cloud/talent": "^4.1.0", + "@google-cloud/talent": "^4.1.1", "uuid": "^8.3.1", "yargs": "^16.0.3" }, From 60de59841f57439259e0fc8a17c7d66e22b25211 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 9 Sep 2022 04:03:12 +0200 Subject: [PATCH 49/51] fix(deps): update dependency uuid to v9 (#439) --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index 9eb5356087..cbb10ef0a4 100644 --- a/talent/package.json +++ b/talent/package.json @@ -18,7 +18,7 @@ }, "dependencies": { "@google-cloud/talent": "^4.1.1", - "uuid": "^8.3.1", + "uuid": "^9.0.0", "yargs": "^16.0.3" }, "devDependencies": { From 93bf57e1c1dc876b57f1ad19ea41d1cb148b33d1 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 22 Sep 2022 14:20:56 -0700 Subject: [PATCH 50/51] chore(main): release 5.0.0 (#436) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 5.0.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- talent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talent/package.json b/talent/package.json index cbb10ef0a4..5e4766084c 100644 --- a/talent/package.json +++ b/talent/package.json @@ -17,7 +17,7 @@ "lint:fix": "npm run lint -- --fix" }, "dependencies": { - "@google-cloud/talent": "^4.1.1", + "@google-cloud/talent": "^5.0.0", "uuid": "^9.0.0", "yargs": "^16.0.3" }, From 1fda1adee49935d06a0609fc70a58abee257c3f2 Mon Sep 17 00:00:00 2001 From: Eric Schmidt Date: Wed, 9 Nov 2022 12:37:19 -0800 Subject: [PATCH 51/51] add workflows --- .github/workflows/talent.yaml | 67 ++++++++++++++++++++++++++++++++ .github/workflows/workflows.json | 3 +- 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/talent.yaml diff --git a/.github/workflows/talent.yaml b/.github/workflows/talent.yaml new file mode 100644 index 0000000000..d816d96d28 --- /dev/null +++ b/.github/workflows/talent.yaml @@ -0,0 +1,67 @@ +name: talent +on: + push: + branches: + - main + paths: + - 'talent/**' + pull_request: + paths: + - 'talent/**' + pull_request_target: + types: [labeled] + schedule: + - cron: '0 0 * * 0' +jobs: + test: + if: ${{ github.event.action != 'labeled' || github.event.label.name == 'actions:force-run' }} + runs-on: ubuntu-latest + timeout-minutes: 60 + permissions: + contents: 'write' + pull-requests: 'write' + id-token: 'write' + steps: + - uses: actions/checkout@v3.1.0 + with: + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + - uses: 'google-github-actions/auth@v0.8.3' + with: + workload_identity_provider: 'projects/1046198160504/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-provider' + service_account: 'kokoro-system-test@long-door-651.iam.gserviceaccount.com' + create_credentials_file: 'true' + access_token_lifetime: 600s + - uses: actions/setup-node@v3.5.1 + with: + node-version: 16 + - run: npm install + working-directory: talent + - run: npm test + working-directory: talent + env: + MOCHA_REPORTER_SUITENAME: talent + MOCHA_REPORTER_OUTPUT: talent_sponge_log.xml + MOCHA_REPORTER: xunit + - if: ${{ github.event.action == 'labeled' && github.event.label.name == 'actions:force-run' }} + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + try { + await github.rest.issues.removeLabel({ + name: 'actions:force-run', + owner: 'GoogleCloudPlatform', + repo: 'nodejs-docs-samples', + issue_number: context.payload.pull_request.number + }); + } catch (e) { + if (!e.message.includes('Label does not exist')) { + throw e; + } + } + - if: ${{ github.event_name == 'schedule'}} + run: | + curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot -o flakybot -s -L + chmod +x ./flakybot + ./flakybot --repo GoogleCloudPlatform/nodejs-docs-samples --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} diff --git a/.github/workflows/workflows.json b/.github/workflows/workflows.json index 5fc1908212..d9e5e77410 100644 --- a/.github/workflows/workflows.json +++ b/.github/workflows/workflows.json @@ -45,5 +45,6 @@ "monitoring/prometheus", "datacatalog/cloud-client", "datacatalog/quickstart", - "datastore/functions" + "datastore/functions", + "talent" ]