diff --git a/.gitignore b/.gitignore index bc09b2d2f..24084ea02 100644 --- a/.gitignore +++ b/.gitignore @@ -9,11 +9,7 @@ build/ system-test/secrets.js system-test/*key.json *.lock -<<<<<<< HEAD -======= build/ package-lock.json ->>>>>>> master .DS_Store -package-lock.json __pycache__ diff --git a/dev/protos/firestore_v1_proto_api.js b/dev/protos/firestore_v1_proto_api.js index 90db28876..865f136a8 100644 --- a/dev/protos/firestore_v1_proto_api.js +++ b/dev/protos/firestore_v1_proto_api.js @@ -6162,304 +6162,9 @@ return Precondition; })(); -<<<<<<< HEAD v1.TransactionOptions = (function() { -======= - - return TargetChange; - })(); - - v1.ListCollectionIdsRequest = (function() { - - /** - * Properties of a ListCollectionIdsRequest. - * @memberof google.firestore.v1 - * @interface IListCollectionIdsRequest - * @property {string|null} [parent] ListCollectionIdsRequest parent - * @property {number|null} [pageSize] ListCollectionIdsRequest pageSize - * @property {string|null} [pageToken] ListCollectionIdsRequest pageToken - */ - - /** - * Constructs a new ListCollectionIdsRequest. - * @memberof google.firestore.v1 - * @classdesc Represents a ListCollectionIdsRequest. - * @implements IListCollectionIdsRequest - * @constructor - * @param {google.firestore.v1.IListCollectionIdsRequest=} [properties] Properties to set - */ - function ListCollectionIdsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListCollectionIdsRequest parent. - * @member {string} parent - * @memberof google.firestore.v1.ListCollectionIdsRequest - * @instance - */ - ListCollectionIdsRequest.prototype.parent = ""; - - /** - * ListCollectionIdsRequest pageSize. - * @member {number} pageSize - * @memberof google.firestore.v1.ListCollectionIdsRequest - * @instance - */ - ListCollectionIdsRequest.prototype.pageSize = 0; - - /** - * ListCollectionIdsRequest pageToken. - * @member {string} pageToken - * @memberof google.firestore.v1.ListCollectionIdsRequest - * @instance - */ - ListCollectionIdsRequest.prototype.pageToken = ""; - - return ListCollectionIdsRequest; - })(); - - v1.ListCollectionIdsResponse = (function() { - - /** - * Properties of a ListCollectionIdsResponse. - * @memberof google.firestore.v1 - * @interface IListCollectionIdsResponse - * @property {Array.|null} [collectionIds] ListCollectionIdsResponse collectionIds - * @property {string|null} [nextPageToken] ListCollectionIdsResponse nextPageToken - */ - - /** - * Constructs a new ListCollectionIdsResponse. - * @memberof google.firestore.v1 - * @classdesc Represents a ListCollectionIdsResponse. - * @implements IListCollectionIdsResponse - * @constructor - * @param {google.firestore.v1.IListCollectionIdsResponse=} [properties] Properties to set - */ - function ListCollectionIdsResponse(properties) { - this.collectionIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListCollectionIdsResponse collectionIds. - * @member {Array.} collectionIds - * @memberof google.firestore.v1.ListCollectionIdsResponse - * @instance - */ - ListCollectionIdsResponse.prototype.collectionIds = $util.emptyArray; - - /** - * ListCollectionIdsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.firestore.v1.ListCollectionIdsResponse - * @instance - */ - ListCollectionIdsResponse.prototype.nextPageToken = ""; - - return ListCollectionIdsResponse; - })(); - - v1.BatchWriteRequest = (function() { - - /** - * Properties of a BatchWriteRequest. - * @memberof google.firestore.v1 - * @interface IBatchWriteRequest - * @property {string|null} [database] BatchWriteRequest database - * @property {Array.|null} [writes] BatchWriteRequest writes - */ - - /** - * Constructs a new BatchWriteRequest. - * @memberof google.firestore.v1 - * @classdesc Represents a BatchWriteRequest. - * @implements IBatchWriteRequest - * @constructor - * @param {google.firestore.v1.IBatchWriteRequest=} [properties] Properties to set - */ - function BatchWriteRequest(properties) { - this.writes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchWriteRequest database. - * @member {string} database - * @memberof google.firestore.v1.BatchWriteRequest - * @instance - */ - BatchWriteRequest.prototype.database = ""; - - /** - * BatchWriteRequest writes. - * @member {Array.} writes - * @memberof google.firestore.v1.BatchWriteRequest - * @instance - */ - BatchWriteRequest.prototype.writes = $util.emptyArray; - - return BatchWriteRequest; - })(); - - v1.BatchWriteResponse = (function() { - - /** - * Properties of a BatchWriteResponse. - * @memberof google.firestore.v1 - * @interface IBatchWriteResponse - * @property {Array.|null} [writeResults] BatchWriteResponse writeResults - * @property {Array.|null} [status] BatchWriteResponse status - */ - - /** - * Constructs a new BatchWriteResponse. - * @memberof google.firestore.v1 - * @classdesc Represents a BatchWriteResponse. - * @implements IBatchWriteResponse - * @constructor - * @param {google.firestore.v1.IBatchWriteResponse=} [properties] Properties to set - */ - function BatchWriteResponse(properties) { - this.writeResults = []; - this.status = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchWriteResponse writeResults. - * @member {Array.} writeResults - * @memberof google.firestore.v1.BatchWriteResponse - * @instance - */ - BatchWriteResponse.prototype.writeResults = $util.emptyArray; - - /** - * BatchWriteResponse status. - * @member {Array.} status - * @memberof google.firestore.v1.BatchWriteResponse - * @instance - */ - BatchWriteResponse.prototype.status = $util.emptyArray; - - return BatchWriteResponse; - })(); - - v1.StructuredQuery = (function() { - - /** - * Properties of a StructuredQuery. - * @memberof google.firestore.v1 - * @interface IStructuredQuery - * @property {google.firestore.v1.StructuredQuery.IProjection|null} [select] StructuredQuery select - * @property {Array.|null} [from] StructuredQuery from - * @property {google.firestore.v1.StructuredQuery.IFilter|null} [where] StructuredQuery where - * @property {Array.|null} [orderBy] StructuredQuery orderBy - * @property {google.firestore.v1.ICursor|null} [startAt] StructuredQuery startAt - * @property {google.firestore.v1.ICursor|null} [endAt] StructuredQuery endAt - * @property {number|null} [offset] StructuredQuery offset - * @property {google.protobuf.IInt32Value|null} [limit] StructuredQuery limit - */ - - /** - * Constructs a new StructuredQuery. - * @memberof google.firestore.v1 - * @classdesc Represents a StructuredQuery. - * @implements IStructuredQuery - * @constructor - * @param {google.firestore.v1.IStructuredQuery=} [properties] Properties to set - */ - function StructuredQuery(properties) { - this.from = []; - this.orderBy = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StructuredQuery select. - * @member {google.firestore.v1.StructuredQuery.IProjection|null|undefined} select - * @memberof google.firestore.v1.StructuredQuery - * @instance - */ - StructuredQuery.prototype.select = null; - - /** - * StructuredQuery from. - * @member {Array.} from - * @memberof google.firestore.v1.StructuredQuery - * @instance - */ - StructuredQuery.prototype.from = $util.emptyArray; - - /** - * StructuredQuery where. - * @member {google.firestore.v1.StructuredQuery.IFilter|null|undefined} where - * @memberof google.firestore.v1.StructuredQuery - * @instance - */ - StructuredQuery.prototype.where = null; - - /** - * StructuredQuery orderBy. - * @member {Array.} orderBy - * @memberof google.firestore.v1.StructuredQuery - * @instance - */ - StructuredQuery.prototype.orderBy = $util.emptyArray; - - /** - * StructuredQuery startAt. - * @member {google.firestore.v1.ICursor|null|undefined} startAt - * @memberof google.firestore.v1.StructuredQuery - * @instance - */ - StructuredQuery.prototype.startAt = null; - - /** - * StructuredQuery endAt. - * @member {google.firestore.v1.ICursor|null|undefined} endAt - * @memberof google.firestore.v1.StructuredQuery - * @instance - */ - StructuredQuery.prototype.endAt = null; - - /** - * StructuredQuery offset. - * @member {number} offset - * @memberof google.firestore.v1.StructuredQuery - * @instance - */ - StructuredQuery.prototype.offset = 0; - - /** - * StructuredQuery limit. - * @member {google.protobuf.IInt32Value|null|undefined} limit - * @memberof google.firestore.v1.StructuredQuery - * @instance - */ - StructuredQuery.prototype.limit = null; - - StructuredQuery.CollectionSelector = (function() { - ->>>>>>> master /** * Properties of a TransactionOptions. * @memberof google.firestore.v1 @@ -11431,6 +11136,97 @@ return ListCollectionIdsResponse; })(); + + v1.BatchWriteRequest = (function() { + + /** + * Properties of a BatchWriteRequest. + * @memberof google.firestore.v1 + * @interface IBatchWriteRequest + * @property {string|null} [database] BatchWriteRequest database + * @property {Array.|null} [writes] BatchWriteRequest writes + */ + + /** + * Constructs a new BatchWriteRequest. + * @memberof google.firestore.v1 + * @classdesc Represents a BatchWriteRequest. + * @implements IBatchWriteRequest + * @constructor + * @param {google.firestore.v1.IBatchWriteRequest=} [properties] Properties to set + */ + function BatchWriteRequest(properties) { + this.writes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchWriteRequest database. + * @member {string} database + * @memberof google.firestore.v1.BatchWriteRequest + * @instance + */ + BatchWriteRequest.prototype.database = ""; + + /** + * BatchWriteRequest writes. + * @member {Array.} writes + * @memberof google.firestore.v1.BatchWriteRequest + * @instance + */ + BatchWriteRequest.prototype.writes = $util.emptyArray; + + return BatchWriteRequest; + })(); + + v1.BatchWriteResponse = (function() { + + /** + * Properties of a BatchWriteResponse. + * @memberof google.firestore.v1 + * @interface IBatchWriteResponse + * @property {Array.|null} [writeResults] BatchWriteResponse writeResults + * @property {Array.|null} [status] BatchWriteResponse status + */ + + /** + * Constructs a new BatchWriteResponse. + * @memberof google.firestore.v1 + * @classdesc Represents a BatchWriteResponse. + * @implements IBatchWriteResponse + * @constructor + * @param {google.firestore.v1.IBatchWriteResponse=} [properties] Properties to set + */ + function BatchWriteResponse(properties) { + this.writeResults = []; + this.status = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchWriteResponse writeResults. + * @member {Array.} writeResults + * @memberof google.firestore.v1.BatchWriteResponse + * @instance + */ + BatchWriteResponse.prototype.writeResults = $util.emptyArray; + + /** + * BatchWriteResponse status. + * @member {Array.} status + * @memberof google.firestore.v1.BatchWriteResponse + * @instance + */ + BatchWriteResponse.prototype.status = $util.emptyArray; + + return BatchWriteResponse; + })(); v1.StructuredQuery = (function() { diff --git a/dev/src/index.ts b/dev/src/index.ts index a57fa965c..e886fe9eb 100644 --- a/dev/src/index.ts +++ b/dev/src/index.ts @@ -43,11 +43,7 @@ import {Timestamp} from './timestamp'; import {parseGetAllArguments, Transaction} from './transaction'; import { ApiMapValue, -<<<<<<< HEAD -======= BulkWriterOptions, - DocumentData, ->>>>>>> master FirestoreStreamingMethod, FirestoreUnaryMethod, GapicClient, diff --git a/dev/src/rate-limiter.ts b/dev/src/rate-limiter.ts index c3ee91d33..412a2dba2 100644 --- a/dev/src/rate-limiter.ts +++ b/dev/src/rate-limiter.ts @@ -15,8 +15,6 @@ */ import * as assert from 'assert'; -import {Timestamp} from './timestamp'; - /** * A helper that uses the Token Bucket algorithm to rate limit the number of * operations that can be made in a second. diff --git a/dev/src/write-batch.ts b/dev/src/write-batch.ts index f3847f09a..d90f7f6e3 100644 --- a/dev/src/write-batch.ts +++ b/dev/src/write-batch.ts @@ -14,8 +14,6 @@ * limitations under the License. */ -import * as assert from 'assert'; - import {google} from '../protos/firestore_v1_proto_api'; import { DocumentMask, diff --git a/dev/test/bulk-writer.ts b/dev/test/bulk-writer.ts index 1366ff269..1c3ae4f7d 100644 --- a/dev/test/bulk-writer.ts +++ b/dev/test/bulk-writer.ts @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +import {describe, it, beforeEach, afterEach} from 'mocha'; import {expect} from 'chai'; import {Status} from 'google-gax'; diff --git a/dev/test/gapic_firestore_v1.ts b/dev/test/gapic_firestore_v1.ts index d83eab6fc..3b409f88d 100644 --- a/dev/test/gapic_firestore_v1.ts +++ b/dev/test/gapic_firestore_v1.ts @@ -1259,7 +1259,6 @@ describe('v1.FirestoreClient', () => { new protos.google.firestore.v1.WriteRequest() ); request.database = ''; - const expectedHeaderRequestParams = 'database='; const expectedError = new Error('expected'); client.innerApiCalls.write = stubBidiStreamingCall( undefined, @@ -1349,7 +1348,6 @@ describe('v1.FirestoreClient', () => { new protos.google.firestore.v1.ListenRequest() ); request.database = ''; - const expectedHeaderRequestParams = 'database='; const expectedError = new Error('expected'); client.innerApiCalls.listen = stubBidiStreamingCall( undefined, diff --git a/dev/test/gapic_firestore_v1beta1.ts b/dev/test/gapic_firestore_v1beta1.ts index 933cfb9f5..bebd9e5cb 100644 --- a/dev/test/gapic_firestore_v1beta1.ts +++ b/dev/test/gapic_firestore_v1beta1.ts @@ -1263,7 +1263,6 @@ describe('v1beta1.FirestoreClient', () => { new protos.google.firestore.v1beta1.WriteRequest() ); request.database = ''; - const expectedHeaderRequestParams = 'database='; const expectedError = new Error('expected'); client.innerApiCalls.write = stubBidiStreamingCall( undefined, @@ -1353,7 +1352,6 @@ describe('v1beta1.FirestoreClient', () => { new protos.google.firestore.v1beta1.ListenRequest() ); request.database = ''; - const expectedHeaderRequestParams = 'database='; const expectedError = new Error('expected'); client.innerApiCalls.listen = stubBidiStreamingCall( undefined, diff --git a/dev/test/rate-limiter.ts b/dev/test/rate-limiter.ts index e3271303d..977fa0c13 100644 --- a/dev/test/rate-limiter.ts +++ b/dev/test/rate-limiter.ts @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +import {describe, it, beforeEach} from 'mocha'; import {expect} from 'chai'; import {RateLimiter} from '../src/rate-limiter';