From 2a4fff903ecc3279357aa846a21428e53b13d381 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Thu, 20 Feb 2020 14:11:00 -0800 Subject: [PATCH] fix: mark v1beta1 client as deprecated --- dev/src/v1beta1/firestore_client.ts | 3 + dev/src/v1beta1/index.ts | 2 + dev/synth.metadata | 107 +++------------------------- synth.py | 15 +++- types/firestore.d.ts | 1 + 5 files changed, 31 insertions(+), 97 deletions(-) diff --git a/dev/src/v1beta1/firestore_client.ts b/dev/src/v1beta1/firestore_client.ts index bf29dc995..44cb41c02 100644 --- a/dev/src/v1beta1/firestore_client.ts +++ b/dev/src/v1beta1/firestore_client.ts @@ -32,6 +32,8 @@ import {Transform} from 'stream'; import * as protosTypes from '../../protos/firestore_v1beta1_proto_api'; import * as gapicConfig from './firestore_client_config.json'; +// tslint:disable deprecation + const version = require('../../../package.json').version; /** @@ -52,6 +54,7 @@ const version = require('../../../package.json').version; * committed. Any read with an equal or greater `read_time` is guaranteed * to see the effects of the transaction. * @class + * @deprecated Use v1/firestore_client instead. * @memberof v1beta1 */ export class FirestoreClient { diff --git a/dev/src/v1beta1/index.ts b/dev/src/v1beta1/index.ts index 9a03699e8..b19eff7ed 100644 --- a/dev/src/v1beta1/index.ts +++ b/dev/src/v1beta1/index.ts @@ -16,6 +16,8 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +// tslint:disable deprecation + import {FirestoreClient} from './firestore_client'; export {FirestoreClient}; diff --git a/dev/synth.metadata b/dev/synth.metadata index fc8647cbf..4212107d6 100644 --- a/dev/synth.metadata +++ b/dev/synth.metadata @@ -1,19 +1,26 @@ { - "updateTime": "2020-02-07T18:50:00.377881Z", + "updateTime": "2020-02-20T22:37:26.236453Z", "sources": [ + { + "git": { + "name": ".", + "remote": "git@github.com:googleapis/nodejs-firestore.git", + "sha": "a2c941c3c14fe509d1ca245e07e4c1487c6861c0" + } + }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e46f761cd6ec15a9e3d5ed4ff321a4bcba8e8585", - "internalRef": "293710856" + "sha": "3eaaaf8626ce5b0c0bc7eee05e143beffa373b01", + "internalRef": "296274723" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.10.17" + "version": "2020.2.4" } } ], @@ -45,97 +52,5 @@ "generator": "gapic-generator-typescript" } } - ], - "newFiles": [ - { - "path": ".gitignore" - }, - { - "path": ".mocharc.json" - }, - { - "path": "protos/google/firestore/admin/v1/field.proto" - }, - { - "path": "protos/google/firestore/admin/v1/firestore_admin.proto" - }, - { - "path": "protos/google/firestore/admin/v1/index.proto" - }, - { - "path": "protos/google/firestore/admin/v1/location.proto" - }, - { - "path": "protos/google/firestore/admin/v1/operation.proto" - }, - { - "path": "protos/google/firestore/v1/common.proto" - }, - { - "path": "protos/google/firestore/v1/document.proto" - }, - { - "path": "protos/google/firestore/v1/firestore.proto" - }, - { - "path": "protos/google/firestore/v1/query.proto" - }, - { - "path": "protos/google/firestore/v1/write.proto" - }, - { - "path": "protos/google/firestore/v1beta1/common.proto" - }, - { - "path": "protos/google/firestore/v1beta1/document.proto" - }, - { - "path": "protos/google/firestore/v1beta1/firestore.proto" - }, - { - "path": "protos/google/firestore/v1beta1/query.proto" - }, - { - "path": "protos/google/firestore/v1beta1/write.proto" - }, - { - "path": "protos/protos.json" - }, - { - "path": "src/v1/firestore_admin_client.ts" - }, - { - "path": "src/v1/firestore_admin_client_config.json" - }, - { - "path": "src/v1/firestore_admin_proto_list.json" - }, - { - "path": "src/v1/firestore_client.ts" - }, - { - "path": "src/v1/firestore_client_config.json" - }, - { - "path": "src/v1/firestore_proto_list.json" - }, - { - "path": "src/v1beta1/firestore_client.ts" - }, - { - "path": "src/v1beta1/firestore_client_config.json" - }, - { - "path": "src/v1beta1/firestore_proto_list.json" - }, - { - "path": "test/gapic-firestore-v1.ts" - }, - { - "path": "test/gapic-firestore-v1beta1.ts" - }, - { - "path": "test/gapic-firestore_admin-v1.ts" - } ] } \ No newline at end of file diff --git a/synth.py b/synth.py index 262b0ce32..e18a8dbda 100644 --- a/synth.py +++ b/synth.py @@ -75,13 +75,26 @@ "dev/src/v1beta1/firestore_client.ts", "/protos/protos'", "/protos/firestore_v1beta1_proto_api'" - ) +) s.replace( "dev/test/gapic-firestore-v1beta1.ts", "/protos/protos'", "/protos/firestore_v1beta1_proto_api'" ) +# Mark v1beta1 as deprecated +s.replace( + "dev/src/v1beta1/firestore_client.ts", + "@class", + "@class\n * @deprecated Use v1/firestore_client instead." +) +s.replace( + "dev/src/v1beta1/firestore_client.ts", + "const version", + "// tslint:disable deprecation\n\nconst version", + 1 +) + # Remove auto-generated packaging tests os.system('rm -rf dev/system-test/fixtures dev/system-test/install.ts') diff --git a/types/firestore.d.ts b/types/firestore.d.ts index e338106d7..f0a985e67 100644 --- a/types/firestore.d.ts +++ b/types/firestore.d.ts @@ -1444,6 +1444,7 @@ declare namespace FirebaseFirestore { /** * The v1beta1 Veneer client. This client provides access to to the underlying * Firestore v1beta1 RPCs. + * @deprecated Use v1 instead. */ export const v1beta1 : any;