Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Commit

Permalink
feat!: drop node8 support, support for async iterators (#364)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on npm.
  • Loading branch information
alexander-fenster committed Apr 1, 2020
1 parent 30a628b commit 156ff6f
Show file tree
Hide file tree
Showing 128 changed files with 12,687 additions and 5,017 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "./node_modules/gts"
}
15 changes: 0 additions & 15 deletions .eslintrc.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [8, 10, 12, 13]
node: [10, 12, 13]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
Expand Down
8 changes: 0 additions & 8 deletions .prettierrc

This file was deleted.

17 changes: 17 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

module.exports = {
...require('gts/.prettierrc.json')
}
24 changes: 13 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "Apache-2.0",
"author": "Google LLC",
"engines": {
"node": ">=8.10.0"
"node": ">=10"
},
"repository": "googleapis/nodejs-automl",
"main": "build/src/index.js",
Expand Down Expand Up @@ -42,30 +42,32 @@
"prepare": "npm run compile"
},
"dependencies": {
"google-gax": "^1.14.2"
"google-gax": "^2.0.1"
},
"devDependencies": {
"@types/mocha": "^7.0.2",
"@types/node": "^13.7.7",
"gts": "^1.1.2",
"null-loader": "^3.0.0",
"pack-n-play": "^1.0.0-2",
"power-assert": "^1.6.1",
"ts-loader": "^6.2.1",
"typescript": "^3.7.0",
"webpack": "^4.42.0",
"webpack-cli": "^3.3.11",
"@types/sinon": "^9.0.0",
"c8": "^7.1.0",
"codecov": "^3.6.5",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-prettier": "^3.1.2",
"gts": "2.0.0-alpha.9",
"jsdoc": "^3.6.3",
"jsdoc-fresh": "^1.0.2",
"jsdoc-region-tag": "^1.0.4",
"linkinator": "^2.0.3",
"mocha": "^7.1.0",
"prettier": "^1.19.1"
"null-loader": "^3.0.0",
"pack-n-play": "^1.0.0-2",
"power-assert": "^1.6.1",
"prettier": "^1.19.1",
"sinon": "^9.0.1",
"ts-loader": "^6.2.1",
"typescript": "^3.8.3",
"webpack": "^4.42.0",
"webpack-cli": "^3.3.11"
}
}
4 changes: 2 additions & 2 deletions samples/batch_predict.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function main(
// const outputUri = 'gs://YOUR_BUCKET_ID/path_to_save_results/';

// Imports the Google Cloud AutoML library
const {PredictionServiceClient} = require(`@google-cloud/automl`).v1;
const {PredictionServiceClient} = require('@google-cloud/automl').v1;

// Instantiates a client
const client = new PredictionServiceClient();
Expand All @@ -55,7 +55,7 @@ function main(

const [operation] = await client.batchPredict(request);

console.log(`Waiting for operation to complete...`);
console.log('Waiting for operation to complete...');
// Wait for operation to complete.
const [response] = await operation.promise();
console.log(
Expand Down
4 changes: 2 additions & 2 deletions samples/beta/batch_predict.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function main(
// const outputUri = 'gs://YOUR_BUCKET_ID/path_to_save_results/';

// Imports the Google Cloud AutoML library
const {PredictionServiceClient} = require(`@google-cloud/automl`).v1beta1;
const {PredictionServiceClient} = require('@google-cloud/automl').v1beta1;

// Instantiates a client
const client = new PredictionServiceClient();
Expand All @@ -55,7 +55,7 @@ function main(

const [operation] = await client.batchPredict(request);

console.log(`Waiting for operation to complete...`);
console.log('Waiting for operation to complete...');
// Wait for operation to complete.
const [response] = await operation.promise();
console.log(
Expand Down
2 changes: 1 addition & 1 deletion samples/beta/delete-dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function main(
// const datasetId = 'YOUR_DATASET_ID';

// Imports the Google Cloud AutoML library
const {AutoMlClient} = require(`@google-cloud/automl`).v1beta1;
const {AutoMlClient} = require('@google-cloud/automl').v1beta1;

// Instantiates a client
const client = new AutoMlClient();
Expand Down
2 changes: 1 addition & 1 deletion samples/beta/delete-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function main(
// const modelId = 'YOUR_MODEL_ID';

// Imports the Google Cloud AutoML library
const {AutoMlClient} = require(`@google-cloud/automl`).v1beta1;
const {AutoMlClient} = require('@google-cloud/automl').v1beta1;

// Instantiates a client
const client = new AutoMlClient();
Expand Down
4 changes: 2 additions & 2 deletions samples/beta/get-model-evaluation.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function main(
// const modelEvaluationId = 'YOUR_MODEL_EVALUATION_ID';

// Imports the Google Cloud AutoML library
const {AutoMlClient} = require(`@google-cloud/automl`).v1beta1;
const {AutoMlClient} = require('@google-cloud/automl').v1beta1;

// Instantiates a client
const client = new AutoMlClient();
Expand All @@ -52,7 +52,7 @@ function main(
console.log(`Model evaluation name: ${response.name}`);
console.log(`Model annotation spec id: ${response.annotationSpecId}`);
console.log(`Model display name: ${response.displayName}`);
console.log(`Model create time`);
console.log('Model create time');
console.log(`\tseconds ${response.createTime.seconds}`);
console.log(`\tnanos ${response.createTime.nanos / 1e9}`);
console.log(`Evaluation example count: ${response.evaluatedExampleCount}`);
Expand Down
4 changes: 2 additions & 2 deletions samples/beta/get-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function main(
// const modelId = 'YOUR_MODEL_ID';

// Imports the Google Cloud AutoML library
const {AutoMlClient} = require(`@google-cloud/automl`).v1beta1;
const {AutoMlClient} = require('@google-cloud/automl').v1beta1;

// Instantiates a client
const client = new AutoMlClient();
Expand All @@ -48,7 +48,7 @@ function main(
}`
);
console.log(`Model display name: ${response.displayName}`);
console.log(`Model create time`);
console.log('Model create time');
console.log(`\tseconds ${response.createTime.seconds}`);
console.log(`\tnanos ${response.createTime.nanos / 1e9}`);
console.log(`Model deployment state: ${response.deploymentState}`);
Expand Down
4 changes: 2 additions & 2 deletions samples/beta/get-operation-status.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function main(
// const operationId = 'YOUR_OPERATION_ID';

// Imports the Google Cloud AutoML library
const {AutoMlClient} = require(`@google-cloud/automl`).v1beta1;
const {AutoMlClient} = require('@google-cloud/automl').v1beta1;

// Instantiates a client
const client = new AutoMlClient();
Expand All @@ -42,7 +42,7 @@ function main(
const [response] = await client.operationsClient.getOperation(request);

console.log(`Name: ${response.name}`);
console.log(`Operation details:`);
console.log('Operation details:');
console.log(response);
}

Expand Down
4 changes: 2 additions & 2 deletions samples/beta/import-dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function main(
// const path = 'gs://BUCKET_ID/path_to_training_data.csv';

// Imports the Google Cloud AutoML library
const {AutoMlClient} = require(`@google-cloud/automl`).v1beta1;
const {AutoMlClient} = require('@google-cloud/automl').v1beta1;

// Instantiates a client
const client = new AutoMlClient();
Expand All @@ -47,7 +47,7 @@ function main(
};

// Import dataset
console.log(`Proccessing import`);
console.log('Proccessing import');
const [operation] = await client.importData(request);

// Wait for operation to complete.
Expand Down
6 changes: 3 additions & 3 deletions samples/beta/list-datasets.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function main(projectId = 'YOUR_PROJECT_ID', location = 'us-central1') {
// const location = 'us-central1';

// Imports the Google Cloud AutoML library
const {AutoMlClient} = require(`@google-cloud/automl`).v1beta1;
const {AutoMlClient} = require('@google-cloud/automl').v1beta1;

// Instantiates a client
const client = new AutoMlClient();
Expand All @@ -38,7 +38,7 @@ function main(projectId = 'YOUR_PROJECT_ID', location = 'us-central1') {

const [response] = await client.listDatasets(request);

console.log(`List of datasets:`);
console.log('List of datasets:');
for (const dataset of response) {
console.log(`Dataset name: ${dataset.name}`);
console.log(
Expand All @@ -47,7 +47,7 @@ function main(projectId = 'YOUR_PROJECT_ID', location = 'us-central1') {
}`
);
console.log(`Dataset display name: ${dataset.displayName}`);
console.log(`Dataset create time`);
console.log('Dataset create time');
console.log(`\tseconds ${dataset.createTime.seconds}`);
console.log(`\tnanos ${dataset.createTime.nanos / 1e9}`);

Expand Down
6 changes: 3 additions & 3 deletions samples/beta/list-models.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function main(projectId = 'YOUR_PROJECT_ID', location = 'us-central1') {
// const location = 'us-central1';

// Imports the Google Cloud AutoML library
const {AutoMlClient} = require(`@google-cloud/automl`).v1beta1;
const {AutoMlClient} = require('@google-cloud/automl').v1beta1;

// Instantiates a client
const client = new AutoMlClient();
Expand All @@ -37,13 +37,13 @@ function main(projectId = 'YOUR_PROJECT_ID', location = 'us-central1') {

const [response] = await client.listModels(request);

console.log(`List of models:`);
console.log('List of models:');
for (const model of response) {
console.log(`Model name: ${model.name}`);
console.log(`
Model id: ${model.name.split('/')[model.name.split('/').length - 1]}`);
console.log(`Model display name: ${model.displayName}`);
console.log(`Model create time`);
console.log('Model create time');
console.log(`\tseconds ${model.createTime.seconds}`);
console.log(`\tnanos ${model.createTime.nanos / 1e9}`);
console.log(`Model deployment state: ${model.deploymentState}`);
Expand Down
2 changes: 1 addition & 1 deletion samples/beta/video-classification-create-dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function main(
// const displayName = 'YOUR_DISPLAY_NAME';

// Imports the Google Cloud AutoML library
const {AutoMlClient} = require(`@google-cloud/automl`).v1beta1;
const {AutoMlClient} = require('@google-cloud/automl').v1beta1;

// Instantiates a client
const client = new AutoMlClient();
Expand Down
2 changes: 1 addition & 1 deletion samples/beta/video-classification-create-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function main(
// const displayName = 'YOUR_DISPLAY_NAME';

// Imports the Google Cloud AutoML library
const {AutoMlClient} = require(`@google-cloud/automl`).v1beta1;
const {AutoMlClient} = require('@google-cloud/automl').v1beta1;

// Instantiates a client
const client = new AutoMlClient();
Expand Down
2 changes: 1 addition & 1 deletion samples/beta/video-object-tracking-create-dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function main(
// const displayName = 'YOUR_DISPLAY_NAME';

// Imports the Google Cloud AutoML library
const {AutoMlClient} = require(`@google-cloud/automl`).v1beta1;
const {AutoMlClient} = require('@google-cloud/automl').v1beta1;

// Instantiates a client
const client = new AutoMlClient();
Expand Down
2 changes: 1 addition & 1 deletion samples/beta/video-object-tracking-create-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function main(
// const displayName = 'YOUR_DISPLAY_NAME';

// Imports the Google Cloud AutoML library
const {AutoMlClient} = require(`@google-cloud/automl`).v1beta1;
const {AutoMlClient} = require('@google-cloud/automl').v1beta1;

// Instantiates a client
const client = new AutoMlClient();
Expand Down
2 changes: 1 addition & 1 deletion samples/delete_dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function main(
// const datasetId = 'YOUR_DATASET_ID';

// Imports the Google Cloud AutoML library
const {AutoMlClient} = require(`@google-cloud/automl`).v1;
const {AutoMlClient} = require('@google-cloud/automl').v1;

// Instantiates a client
const client = new AutoMlClient();
Expand Down
2 changes: 1 addition & 1 deletion samples/delete_model.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function main(
// const modelId = 'YOUR_MODEL_ID';

// Imports the Google Cloud AutoML library
const {AutoMlClient} = require(`@google-cloud/automl`).v1;
const {AutoMlClient} = require('@google-cloud/automl').v1;

// Instantiates a client
const client = new AutoMlClient();
Expand Down
2 changes: 1 addition & 1 deletion samples/deploy_model.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function main(
// const modelId = 'YOUR_MODEL_ID';

// Imports the Google Cloud AutoML library
const {AutoMlClient} = require(`@google-cloud/automl`).v1;
const {AutoMlClient} = require('@google-cloud/automl').v1;

// Instantiates a client
const client = new AutoMlClient();
Expand Down
2 changes: 1 addition & 1 deletion samples/export_dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function main(
// const gcsUri = 'gs://BUCKET_ID/path_to_export/';

// Imports the Google Cloud AutoML library
const {AutoMlClient} = require(`@google-cloud/automl`).v1;
const {AutoMlClient} = require('@google-cloud/automl').v1;

// Instantiates a client
const client = new AutoMlClient();
Expand Down
6 changes: 3 additions & 3 deletions samples/get_dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function main(
// const datasetId = 'YOUR_DATASET_ID';

// Imports the Google Cloud AutoML library
const {AutoMlClient} = require(`@google-cloud/automl`).v1;
const {AutoMlClient} = require('@google-cloud/automl').v1;

// Instantiates a client
const client = new AutoMlClient();
Expand All @@ -53,7 +53,7 @@ function main(
}`
);
console.log(`Dataset display name: ${response.displayName}`);
console.log(`Dataset create time`);
console.log('Dataset create time');
console.log(`\tseconds ${response.createTime.seconds}`);
console.log(`\tnanos ${response.createTime.nanos / 1e9}`);
// [END automl_language_sentiment_analysis_get_dataset]
Expand All @@ -80,7 +80,7 @@ function main(

// [START automl_translate_get_dataset]
if (response.translationDatasetMetadata !== undefined) {
console.log(`Translation dataset metadata:`);
console.log('Translation dataset metadata:');
console.log(
`\tSource language code: ${response.translationDatasetMetadata.sourceLanguageCode}`
);
Expand Down

0 comments on commit 156ff6f

Please sign in to comment.