@google-cloud/firestore
Advanced tools
Comparing version 4.7.1 to 4.7.2
@@ -104,2 +104,3 @@ /*! | ||
* successfully completes. | ||
* @private | ||
*/ | ||
@@ -110,2 +111,3 @@ private _successFn; | ||
* fails. | ||
* @private | ||
*/ | ||
@@ -318,2 +320,3 @@ private _errorFn; | ||
* Throws an error if the BulkWriter instance has been closed. | ||
* @private | ||
*/ | ||
@@ -355,2 +358,3 @@ private verifyNotClosed; | ||
* Schedules and runs the provided operation. | ||
* @private | ||
*/ | ||
@@ -357,0 +361,0 @@ private _executeWrite; |
@@ -225,2 +225,3 @@ "use strict"; | ||
* successfully completes. | ||
* @private | ||
*/ | ||
@@ -231,2 +232,3 @@ this._successFn = () => { }; | ||
* fails. | ||
* @private | ||
*/ | ||
@@ -555,2 +557,3 @@ this._errorFn = error => { | ||
* Throws an error if the BulkWriter instance has been closed. | ||
* @private | ||
*/ | ||
@@ -652,2 +655,3 @@ verifyNotClosed() { | ||
* Schedules and runs the provided operation. | ||
* @private | ||
*/ | ||
@@ -654,0 +658,0 @@ async _executeWrite(documentRef, operationType, operationFn) { |
@@ -162,2 +162,29 @@ /*! | ||
/** | ||
* An options object to configure throttling on BulkWriter. | ||
* | ||
* Whether to disable or configure throttling. By default, throttling is | ||
* enabled. `throttling` can be set to either a boolean or a config object. | ||
* Setting it to `true` will use default values. You can override the defaults | ||
* by setting it to `false` to disable throttling, or by setting the config | ||
* values to enable throttling with the provided values. | ||
* | ||
* @property {boolean|Object} throttling Whether to disable or enable | ||
* throttling. Throttling is enabled by default, if the field is set to `true` | ||
* or if any custom throttling options are provided. `{ initialOpsPerSecond: | ||
* number }` sets the initial maximum number of operations per second allowed by | ||
* the throttler. If `initialOpsPerSecond` is not set, the default is 500 | ||
* operations per second. `{ maxOpsPerSecond: number }` sets the maximum number | ||
* of operations per second allowed by the throttler. If `maxOpsPerSecond` is | ||
* not set, no maximum is enforced. | ||
* @typedef {Object} BulkWriterOptions | ||
*/ | ||
/** | ||
* Status codes returned by GRPC operations. | ||
* | ||
* @see https://github.com/grpc/grpc/blob/master/doc/statuscodes.md | ||
* | ||
* @enum {number} | ||
* @typedef {Object} GrpcStatus | ||
*/ | ||
/** | ||
* The Firestore client represents a Firestore Database and is the entry point | ||
@@ -164,0 +191,0 @@ * for all Firestore operations. |
@@ -240,2 +240,29 @@ "use strict"; | ||
/** | ||
* An options object to configure throttling on BulkWriter. | ||
* | ||
* Whether to disable or configure throttling. By default, throttling is | ||
* enabled. `throttling` can be set to either a boolean or a config object. | ||
* Setting it to `true` will use default values. You can override the defaults | ||
* by setting it to `false` to disable throttling, or by setting the config | ||
* values to enable throttling with the provided values. | ||
* | ||
* @property {boolean|Object} throttling Whether to disable or enable | ||
* throttling. Throttling is enabled by default, if the field is set to `true` | ||
* or if any custom throttling options are provided. `{ initialOpsPerSecond: | ||
* number }` sets the initial maximum number of operations per second allowed by | ||
* the throttler. If `initialOpsPerSecond` is not set, the default is 500 | ||
* operations per second. `{ maxOpsPerSecond: number }` sets the maximum number | ||
* of operations per second allowed by the throttler. If `maxOpsPerSecond` is | ||
* not set, no maximum is enforced. | ||
* @typedef {Object} BulkWriterOptions | ||
*/ | ||
/** | ||
* Status codes returned by GRPC operations. | ||
* | ||
* @see https://github.com/grpc/grpc/blob/master/doc/statuscodes.md | ||
* | ||
* @enum {number} | ||
* @typedef {Object} GrpcStatus | ||
*/ | ||
/** | ||
* The Firestore client represents a Firestore Database and is the entry point | ||
@@ -242,0 +269,0 @@ * for all Firestore operations. |
@@ -86,5 +86,9 @@ /*! | ||
* configuration. | ||
* @private | ||
*/ | ||
export declare function getRetryCodes(methodName: string): number[]; | ||
/** Returns the backoff setting from the service configuration. */ | ||
/** | ||
* Returns the backoff setting from the service configuration. | ||
* @private | ||
*/ | ||
export declare function getRetryParams(methodName: string): BackoffSettings; | ||
@@ -97,2 +101,4 @@ /** | ||
* the promise will be discarded. | ||
* | ||
* @private | ||
*/ | ||
@@ -99,0 +105,0 @@ export declare function silencePromise(promise: Promise<unknown>): Promise<void>; |
@@ -136,2 +136,3 @@ "use strict"; | ||
* configuration. | ||
* @private | ||
*/ | ||
@@ -143,3 +144,6 @@ function getRetryCodes(methodName) { | ||
exports.getRetryCodes = getRetryCodes; | ||
/** Returns the backoff setting from the service configuration. */ | ||
/** | ||
* Returns the backoff setting from the service configuration. | ||
* @private | ||
*/ | ||
function getRetryParams(methodName) { | ||
@@ -156,2 +160,4 @@ var _a, _b, _c; | ||
* the promise will be discarded. | ||
* | ||
* @private | ||
*/ | ||
@@ -158,0 +164,0 @@ function silencePromise(promise) { |
/// <reference types="node" /> | ||
import * as gax from 'google-gax'; | ||
import { Callback, Descriptors, ClientOptions, LROperation, PaginationCallback } from 'google-gax'; | ||
import { Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback } from 'google-gax'; | ||
import { Transform } from 'stream'; | ||
@@ -57,5 +57,5 @@ import * as protos from '../../protos/firestore_admin_v1_proto_api'; | ||
* API remote host. | ||
* @param {gax.ClientConfig} [options.clientConfig] - client configuration override. | ||
* TODO(@alexander-fenster): link to gax documentation. | ||
* @param {boolean} fallback - Use HTTP fallback mode. | ||
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. | ||
* Follows the structure of {@link gapicConfig}. | ||
* @param {boolean} [options.fallback] - Use HTTP fallback mode. | ||
* In fallback mode, a special browser-compatible transport implementation is used | ||
@@ -105,13 +105,13 @@ * instead of gRPC transport. In browser context (if the `window` object is defined) | ||
getProjectId(callback: Callback<string, undefined, undefined>): void; | ||
getIndex(request: protos.google.firestore.admin.v1.IGetIndexRequest, options?: gax.CallOptions): Promise<[protos.google.firestore.admin.v1.IIndex, protos.google.firestore.admin.v1.IGetIndexRequest | undefined, {} | undefined]>; | ||
getIndex(request: protos.google.firestore.admin.v1.IGetIndexRequest, options: gax.CallOptions, callback: Callback<protos.google.firestore.admin.v1.IIndex, protos.google.firestore.admin.v1.IGetIndexRequest | null | undefined, {} | null | undefined>): void; | ||
getIndex(request: protos.google.firestore.admin.v1.IGetIndexRequest, options?: CallOptions): Promise<[protos.google.firestore.admin.v1.IIndex, protos.google.firestore.admin.v1.IGetIndexRequest | undefined, {} | undefined]>; | ||
getIndex(request: protos.google.firestore.admin.v1.IGetIndexRequest, options: CallOptions, callback: Callback<protos.google.firestore.admin.v1.IIndex, protos.google.firestore.admin.v1.IGetIndexRequest | null | undefined, {} | null | undefined>): void; | ||
getIndex(request: protos.google.firestore.admin.v1.IGetIndexRequest, callback: Callback<protos.google.firestore.admin.v1.IIndex, protos.google.firestore.admin.v1.IGetIndexRequest | null | undefined, {} | null | undefined>): void; | ||
deleteIndex(request: protos.google.firestore.admin.v1.IDeleteIndexRequest, options?: gax.CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.firestore.admin.v1.IDeleteIndexRequest | undefined, {} | undefined]>; | ||
deleteIndex(request: protos.google.firestore.admin.v1.IDeleteIndexRequest, options: gax.CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.firestore.admin.v1.IDeleteIndexRequest | null | undefined, {} | null | undefined>): void; | ||
deleteIndex(request: protos.google.firestore.admin.v1.IDeleteIndexRequest, options?: CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.firestore.admin.v1.IDeleteIndexRequest | undefined, {} | undefined]>; | ||
deleteIndex(request: protos.google.firestore.admin.v1.IDeleteIndexRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.firestore.admin.v1.IDeleteIndexRequest | null | undefined, {} | null | undefined>): void; | ||
deleteIndex(request: protos.google.firestore.admin.v1.IDeleteIndexRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.firestore.admin.v1.IDeleteIndexRequest | null | undefined, {} | null | undefined>): void; | ||
getField(request: protos.google.firestore.admin.v1.IGetFieldRequest, options?: gax.CallOptions): Promise<[protos.google.firestore.admin.v1.IField, protos.google.firestore.admin.v1.IGetFieldRequest | undefined, {} | undefined]>; | ||
getField(request: protos.google.firestore.admin.v1.IGetFieldRequest, options: gax.CallOptions, callback: Callback<protos.google.firestore.admin.v1.IField, protos.google.firestore.admin.v1.IGetFieldRequest | null | undefined, {} | null | undefined>): void; | ||
getField(request: protos.google.firestore.admin.v1.IGetFieldRequest, options?: CallOptions): Promise<[protos.google.firestore.admin.v1.IField, protos.google.firestore.admin.v1.IGetFieldRequest | undefined, {} | undefined]>; | ||
getField(request: protos.google.firestore.admin.v1.IGetFieldRequest, options: CallOptions, callback: Callback<protos.google.firestore.admin.v1.IField, protos.google.firestore.admin.v1.IGetFieldRequest | null | undefined, {} | null | undefined>): void; | ||
getField(request: protos.google.firestore.admin.v1.IGetFieldRequest, callback: Callback<protos.google.firestore.admin.v1.IField, protos.google.firestore.admin.v1.IGetFieldRequest | null | undefined, {} | null | undefined>): void; | ||
createIndex(request: protos.google.firestore.admin.v1.ICreateIndexRequest, options?: gax.CallOptions): Promise<[LROperation<protos.google.firestore.admin.v1.IIndex, protos.google.firestore.admin.v1.IIndexOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
createIndex(request: protos.google.firestore.admin.v1.ICreateIndexRequest, options: gax.CallOptions, callback: Callback<LROperation<protos.google.firestore.admin.v1.IIndex, protos.google.firestore.admin.v1.IIndexOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
createIndex(request: protos.google.firestore.admin.v1.ICreateIndexRequest, options?: CallOptions): Promise<[LROperation<protos.google.firestore.admin.v1.IIndex, protos.google.firestore.admin.v1.IIndexOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
createIndex(request: protos.google.firestore.admin.v1.ICreateIndexRequest, options: CallOptions, callback: Callback<LROperation<protos.google.firestore.admin.v1.IIndex, protos.google.firestore.admin.v1.IIndexOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
createIndex(request: protos.google.firestore.admin.v1.ICreateIndexRequest, callback: Callback<LROperation<protos.google.firestore.admin.v1.IIndex, protos.google.firestore.admin.v1.IIndexOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
@@ -134,4 +134,4 @@ /** | ||
checkCreateIndexProgress(name: string): Promise<LROperation<protos.google.firestore.admin.v1.Index, protos.google.firestore.admin.v1.IndexOperationMetadata>>; | ||
updateField(request: protos.google.firestore.admin.v1.IUpdateFieldRequest, options?: gax.CallOptions): Promise<[LROperation<protos.google.firestore.admin.v1.IField, protos.google.firestore.admin.v1.IFieldOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
updateField(request: protos.google.firestore.admin.v1.IUpdateFieldRequest, options: gax.CallOptions, callback: Callback<LROperation<protos.google.firestore.admin.v1.IField, protos.google.firestore.admin.v1.IFieldOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
updateField(request: protos.google.firestore.admin.v1.IUpdateFieldRequest, options?: CallOptions): Promise<[LROperation<protos.google.firestore.admin.v1.IField, protos.google.firestore.admin.v1.IFieldOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
updateField(request: protos.google.firestore.admin.v1.IUpdateFieldRequest, options: CallOptions, callback: Callback<LROperation<protos.google.firestore.admin.v1.IField, protos.google.firestore.admin.v1.IFieldOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
updateField(request: protos.google.firestore.admin.v1.IUpdateFieldRequest, callback: Callback<LROperation<protos.google.firestore.admin.v1.IField, protos.google.firestore.admin.v1.IFieldOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
@@ -154,4 +154,4 @@ /** | ||
checkUpdateFieldProgress(name: string): Promise<LROperation<protos.google.firestore.admin.v1.Field, protos.google.firestore.admin.v1.FieldOperationMetadata>>; | ||
exportDocuments(request: protos.google.firestore.admin.v1.IExportDocumentsRequest, options?: gax.CallOptions): Promise<[LROperation<protos.google.firestore.admin.v1.IExportDocumentsResponse, protos.google.firestore.admin.v1.IExportDocumentsMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
exportDocuments(request: protos.google.firestore.admin.v1.IExportDocumentsRequest, options: gax.CallOptions, callback: Callback<LROperation<protos.google.firestore.admin.v1.IExportDocumentsResponse, protos.google.firestore.admin.v1.IExportDocumentsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
exportDocuments(request: protos.google.firestore.admin.v1.IExportDocumentsRequest, options?: CallOptions): Promise<[LROperation<protos.google.firestore.admin.v1.IExportDocumentsResponse, protos.google.firestore.admin.v1.IExportDocumentsMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
exportDocuments(request: protos.google.firestore.admin.v1.IExportDocumentsRequest, options: CallOptions, callback: Callback<LROperation<protos.google.firestore.admin.v1.IExportDocumentsResponse, protos.google.firestore.admin.v1.IExportDocumentsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
exportDocuments(request: protos.google.firestore.admin.v1.IExportDocumentsRequest, callback: Callback<LROperation<protos.google.firestore.admin.v1.IExportDocumentsResponse, protos.google.firestore.admin.v1.IExportDocumentsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
@@ -174,4 +174,4 @@ /** | ||
checkExportDocumentsProgress(name: string): Promise<LROperation<protos.google.firestore.admin.v1.ExportDocumentsResponse, protos.google.firestore.admin.v1.ExportDocumentsMetadata>>; | ||
importDocuments(request: protos.google.firestore.admin.v1.IImportDocumentsRequest, options?: gax.CallOptions): Promise<[LROperation<protos.google.protobuf.IEmpty, protos.google.firestore.admin.v1.IImportDocumentsMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
importDocuments(request: protos.google.firestore.admin.v1.IImportDocumentsRequest, options: gax.CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.firestore.admin.v1.IImportDocumentsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
importDocuments(request: protos.google.firestore.admin.v1.IImportDocumentsRequest, options?: CallOptions): Promise<[LROperation<protos.google.protobuf.IEmpty, protos.google.firestore.admin.v1.IImportDocumentsMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
importDocuments(request: protos.google.firestore.admin.v1.IImportDocumentsRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.firestore.admin.v1.IImportDocumentsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
importDocuments(request: protos.google.firestore.admin.v1.IImportDocumentsRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.firestore.admin.v1.IImportDocumentsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
@@ -194,4 +194,4 @@ /** | ||
checkImportDocumentsProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.firestore.admin.v1.ImportDocumentsMetadata>>; | ||
listIndexes(request: protos.google.firestore.admin.v1.IListIndexesRequest, options?: gax.CallOptions): Promise<[protos.google.firestore.admin.v1.IIndex[], protos.google.firestore.admin.v1.IListIndexesRequest | null, protos.google.firestore.admin.v1.IListIndexesResponse]>; | ||
listIndexes(request: protos.google.firestore.admin.v1.IListIndexesRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.firestore.admin.v1.IListIndexesRequest, protos.google.firestore.admin.v1.IListIndexesResponse | null | undefined, protos.google.firestore.admin.v1.IIndex>): void; | ||
listIndexes(request: protos.google.firestore.admin.v1.IListIndexesRequest, options?: CallOptions): Promise<[protos.google.firestore.admin.v1.IIndex[], protos.google.firestore.admin.v1.IListIndexesRequest | null, protos.google.firestore.admin.v1.IListIndexesResponse]>; | ||
listIndexes(request: protos.google.firestore.admin.v1.IListIndexesRequest, options: CallOptions, callback: PaginationCallback<protos.google.firestore.admin.v1.IListIndexesRequest, protos.google.firestore.admin.v1.IListIndexesResponse | null | undefined, protos.google.firestore.admin.v1.IIndex>): void; | ||
listIndexes(request: protos.google.firestore.admin.v1.IListIndexesRequest, callback: PaginationCallback<protos.google.firestore.admin.v1.IListIndexesRequest, protos.google.firestore.admin.v1.IListIndexesResponse | null | undefined, protos.google.firestore.admin.v1.IIndex>): void; | ||
@@ -225,3 +225,3 @@ /** | ||
*/ | ||
listIndexesStream(request?: protos.google.firestore.admin.v1.IListIndexesRequest, options?: gax.CallOptions): Transform; | ||
listIndexesStream(request?: protos.google.firestore.admin.v1.IListIndexesRequest, options?: CallOptions): Transform; | ||
/** | ||
@@ -260,5 +260,5 @@ * Equivalent to `listIndexes`, but returns an iterable object. | ||
*/ | ||
listIndexesAsync(request?: protos.google.firestore.admin.v1.IListIndexesRequest, options?: gax.CallOptions): AsyncIterable<protos.google.firestore.admin.v1.IIndex>; | ||
listFields(request: protos.google.firestore.admin.v1.IListFieldsRequest, options?: gax.CallOptions): Promise<[protos.google.firestore.admin.v1.IField[], protos.google.firestore.admin.v1.IListFieldsRequest | null, protos.google.firestore.admin.v1.IListFieldsResponse]>; | ||
listFields(request: protos.google.firestore.admin.v1.IListFieldsRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.firestore.admin.v1.IListFieldsRequest, protos.google.firestore.admin.v1.IListFieldsResponse | null | undefined, protos.google.firestore.admin.v1.IField>): void; | ||
listIndexesAsync(request?: protos.google.firestore.admin.v1.IListIndexesRequest, options?: CallOptions): AsyncIterable<protos.google.firestore.admin.v1.IIndex>; | ||
listFields(request: protos.google.firestore.admin.v1.IListFieldsRequest, options?: CallOptions): Promise<[protos.google.firestore.admin.v1.IField[], protos.google.firestore.admin.v1.IListFieldsRequest | null, protos.google.firestore.admin.v1.IListFieldsResponse]>; | ||
listFields(request: protos.google.firestore.admin.v1.IListFieldsRequest, options: CallOptions, callback: PaginationCallback<protos.google.firestore.admin.v1.IListFieldsRequest, protos.google.firestore.admin.v1.IListFieldsResponse | null | undefined, protos.google.firestore.admin.v1.IField>): void; | ||
listFields(request: protos.google.firestore.admin.v1.IListFieldsRequest, callback: PaginationCallback<protos.google.firestore.admin.v1.IListFieldsRequest, protos.google.firestore.admin.v1.IListFieldsResponse | null | undefined, protos.google.firestore.admin.v1.IField>): void; | ||
@@ -296,3 +296,3 @@ /** | ||
*/ | ||
listFieldsStream(request?: protos.google.firestore.admin.v1.IListFieldsRequest, options?: gax.CallOptions): Transform; | ||
listFieldsStream(request?: protos.google.firestore.admin.v1.IListFieldsRequest, options?: CallOptions): Transform; | ||
/** | ||
@@ -335,3 +335,3 @@ * Equivalent to `listFields`, but returns an iterable object. | ||
*/ | ||
listFieldsAsync(request?: protos.google.firestore.admin.v1.IListFieldsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.firestore.admin.v1.IField>; | ||
listFieldsAsync(request?: protos.google.firestore.admin.v1.IListFieldsRequest, options?: CallOptions): AsyncIterable<protos.google.firestore.admin.v1.IField>; | ||
/** | ||
@@ -338,0 +338,0 @@ * Return a fully-qualified collectionGroup resource name string. |
@@ -20,4 +20,10 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/* global window */ | ||
const gax = require("google-gax"); | ||
const path = require("path"); | ||
/** | ||
* Client JSON configuration object, loaded from | ||
* `src/v1/firestore_admin_client_config.json`. | ||
* This file defines retry strategy and timeouts for all API methods in this library. | ||
*/ | ||
const gapicConfig = require("./firestore_admin_client_config.json"); | ||
@@ -59,5 +65,5 @@ const google_gax_1 = require("google-gax"); | ||
* API remote host. | ||
* @param {gax.ClientConfig} [options.clientConfig] - client configuration override. | ||
* TODO(@alexander-fenster): link to gax documentation. | ||
* @param {boolean} fallback - Use HTTP fallback mode. | ||
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. | ||
* Follows the structure of {@link gapicConfig}. | ||
* @param {boolean} [options.fallback] - Use HTTP fallback mode. | ||
* In fallback mode, a special browser-compatible transport implementation is used | ||
@@ -82,3 +88,3 @@ * instead of gRPC transport. In browser context (if the `window` object is defined) | ||
const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {}; | ||
const fallback = (_b = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _b !== void 0 ? _b : typeof window !== 'undefined'; | ||
const fallback = (_b = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _b !== void 0 ? _b : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function'); | ||
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); | ||
@@ -85,0 +91,0 @@ // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. |
/// <reference types="node" /> | ||
import * as gax from 'google-gax'; | ||
import { Callback, Descriptors, ClientOptions, PaginationCallback } from 'google-gax'; | ||
import { Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback } from 'google-gax'; | ||
import { Transform } from 'stream'; | ||
@@ -59,5 +59,5 @@ import * as protos from '../../protos/firestore_v1_proto_api'; | ||
* API remote host. | ||
* @param {gax.ClientConfig} [options.clientConfig] - client configuration override. | ||
* TODO(@alexander-fenster): link to gax documentation. | ||
* @param {boolean} fallback - Use HTTP fallback mode. | ||
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. | ||
* Follows the structure of {@link gapicConfig}. | ||
* @param {boolean} [options.fallback] - Use HTTP fallback mode. | ||
* In fallback mode, a special browser-compatible transport implementation is used | ||
@@ -107,25 +107,25 @@ * instead of gRPC transport. In browser context (if the `window` object is defined) | ||
getProjectId(callback: Callback<string, undefined, undefined>): void; | ||
getDocument(request: protos.google.firestore.v1.IGetDocumentRequest, options?: gax.CallOptions): Promise<[protos.google.firestore.v1.IDocument, protos.google.firestore.v1.IGetDocumentRequest | undefined, {} | undefined]>; | ||
getDocument(request: protos.google.firestore.v1.IGetDocumentRequest, options: gax.CallOptions, callback: Callback<protos.google.firestore.v1.IDocument, protos.google.firestore.v1.IGetDocumentRequest | null | undefined, {} | null | undefined>): void; | ||
getDocument(request: protos.google.firestore.v1.IGetDocumentRequest, options?: CallOptions): Promise<[protos.google.firestore.v1.IDocument, protos.google.firestore.v1.IGetDocumentRequest | undefined, {} | undefined]>; | ||
getDocument(request: protos.google.firestore.v1.IGetDocumentRequest, options: CallOptions, callback: Callback<protos.google.firestore.v1.IDocument, protos.google.firestore.v1.IGetDocumentRequest | null | undefined, {} | null | undefined>): void; | ||
getDocument(request: protos.google.firestore.v1.IGetDocumentRequest, callback: Callback<protos.google.firestore.v1.IDocument, protos.google.firestore.v1.IGetDocumentRequest | null | undefined, {} | null | undefined>): void; | ||
updateDocument(request: protos.google.firestore.v1.IUpdateDocumentRequest, options?: gax.CallOptions): Promise<[protos.google.firestore.v1.IDocument, protos.google.firestore.v1.IUpdateDocumentRequest | undefined, {} | undefined]>; | ||
updateDocument(request: protos.google.firestore.v1.IUpdateDocumentRequest, options: gax.CallOptions, callback: Callback<protos.google.firestore.v1.IDocument, protos.google.firestore.v1.IUpdateDocumentRequest | null | undefined, {} | null | undefined>): void; | ||
updateDocument(request: protos.google.firestore.v1.IUpdateDocumentRequest, options?: CallOptions): Promise<[protos.google.firestore.v1.IDocument, protos.google.firestore.v1.IUpdateDocumentRequest | undefined, {} | undefined]>; | ||
updateDocument(request: protos.google.firestore.v1.IUpdateDocumentRequest, options: CallOptions, callback: Callback<protos.google.firestore.v1.IDocument, protos.google.firestore.v1.IUpdateDocumentRequest | null | undefined, {} | null | undefined>): void; | ||
updateDocument(request: protos.google.firestore.v1.IUpdateDocumentRequest, callback: Callback<protos.google.firestore.v1.IDocument, protos.google.firestore.v1.IUpdateDocumentRequest | null | undefined, {} | null | undefined>): void; | ||
deleteDocument(request: protos.google.firestore.v1.IDeleteDocumentRequest, options?: gax.CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.firestore.v1.IDeleteDocumentRequest | undefined, {} | undefined]>; | ||
deleteDocument(request: protos.google.firestore.v1.IDeleteDocumentRequest, options: gax.CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.firestore.v1.IDeleteDocumentRequest | null | undefined, {} | null | undefined>): void; | ||
deleteDocument(request: protos.google.firestore.v1.IDeleteDocumentRequest, options?: CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.firestore.v1.IDeleteDocumentRequest | undefined, {} | undefined]>; | ||
deleteDocument(request: protos.google.firestore.v1.IDeleteDocumentRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.firestore.v1.IDeleteDocumentRequest | null | undefined, {} | null | undefined>): void; | ||
deleteDocument(request: protos.google.firestore.v1.IDeleteDocumentRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.firestore.v1.IDeleteDocumentRequest | null | undefined, {} | null | undefined>): void; | ||
beginTransaction(request: protos.google.firestore.v1.IBeginTransactionRequest, options?: gax.CallOptions): Promise<[protos.google.firestore.v1.IBeginTransactionResponse, protos.google.firestore.v1.IBeginTransactionRequest | undefined, {} | undefined]>; | ||
beginTransaction(request: protos.google.firestore.v1.IBeginTransactionRequest, options: gax.CallOptions, callback: Callback<protos.google.firestore.v1.IBeginTransactionResponse, protos.google.firestore.v1.IBeginTransactionRequest | null | undefined, {} | null | undefined>): void; | ||
beginTransaction(request: protos.google.firestore.v1.IBeginTransactionRequest, options?: CallOptions): Promise<[protos.google.firestore.v1.IBeginTransactionResponse, protos.google.firestore.v1.IBeginTransactionRequest | undefined, {} | undefined]>; | ||
beginTransaction(request: protos.google.firestore.v1.IBeginTransactionRequest, options: CallOptions, callback: Callback<protos.google.firestore.v1.IBeginTransactionResponse, protos.google.firestore.v1.IBeginTransactionRequest | null | undefined, {} | null | undefined>): void; | ||
beginTransaction(request: protos.google.firestore.v1.IBeginTransactionRequest, callback: Callback<protos.google.firestore.v1.IBeginTransactionResponse, protos.google.firestore.v1.IBeginTransactionRequest | null | undefined, {} | null | undefined>): void; | ||
commit(request: protos.google.firestore.v1.ICommitRequest, options?: gax.CallOptions): Promise<[protos.google.firestore.v1.ICommitResponse, protos.google.firestore.v1.ICommitRequest | undefined, {} | undefined]>; | ||
commit(request: protos.google.firestore.v1.ICommitRequest, options: gax.CallOptions, callback: Callback<protos.google.firestore.v1.ICommitResponse, protos.google.firestore.v1.ICommitRequest | null | undefined, {} | null | undefined>): void; | ||
commit(request: protos.google.firestore.v1.ICommitRequest, options?: CallOptions): Promise<[protos.google.firestore.v1.ICommitResponse, protos.google.firestore.v1.ICommitRequest | undefined, {} | undefined]>; | ||
commit(request: protos.google.firestore.v1.ICommitRequest, options: CallOptions, callback: Callback<protos.google.firestore.v1.ICommitResponse, protos.google.firestore.v1.ICommitRequest | null | undefined, {} | null | undefined>): void; | ||
commit(request: protos.google.firestore.v1.ICommitRequest, callback: Callback<protos.google.firestore.v1.ICommitResponse, protos.google.firestore.v1.ICommitRequest | null | undefined, {} | null | undefined>): void; | ||
rollback(request: protos.google.firestore.v1.IRollbackRequest, options?: gax.CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.firestore.v1.IRollbackRequest | undefined, {} | undefined]>; | ||
rollback(request: protos.google.firestore.v1.IRollbackRequest, options: gax.CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.firestore.v1.IRollbackRequest | null | undefined, {} | null | undefined>): void; | ||
rollback(request: protos.google.firestore.v1.IRollbackRequest, options?: CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.firestore.v1.IRollbackRequest | undefined, {} | undefined]>; | ||
rollback(request: protos.google.firestore.v1.IRollbackRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.firestore.v1.IRollbackRequest | null | undefined, {} | null | undefined>): void; | ||
rollback(request: protos.google.firestore.v1.IRollbackRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.firestore.v1.IRollbackRequest | null | undefined, {} | null | undefined>): void; | ||
batchWrite(request: protos.google.firestore.v1.IBatchWriteRequest, options?: gax.CallOptions): Promise<[protos.google.firestore.v1.IBatchWriteResponse, protos.google.firestore.v1.IBatchWriteRequest | undefined, {} | undefined]>; | ||
batchWrite(request: protos.google.firestore.v1.IBatchWriteRequest, options: gax.CallOptions, callback: Callback<protos.google.firestore.v1.IBatchWriteResponse, protos.google.firestore.v1.IBatchWriteRequest | null | undefined, {} | null | undefined>): void; | ||
batchWrite(request: protos.google.firestore.v1.IBatchWriteRequest, options?: CallOptions): Promise<[protos.google.firestore.v1.IBatchWriteResponse, protos.google.firestore.v1.IBatchWriteRequest | undefined, {} | undefined]>; | ||
batchWrite(request: protos.google.firestore.v1.IBatchWriteRequest, options: CallOptions, callback: Callback<protos.google.firestore.v1.IBatchWriteResponse, protos.google.firestore.v1.IBatchWriteRequest | null | undefined, {} | null | undefined>): void; | ||
batchWrite(request: protos.google.firestore.v1.IBatchWriteRequest, callback: Callback<protos.google.firestore.v1.IBatchWriteResponse, protos.google.firestore.v1.IBatchWriteRequest | null | undefined, {} | null | undefined>): void; | ||
createDocument(request: protos.google.firestore.v1.ICreateDocumentRequest, options?: gax.CallOptions): Promise<[protos.google.firestore.v1.IDocument, protos.google.firestore.v1.ICreateDocumentRequest | undefined, {} | undefined]>; | ||
createDocument(request: protos.google.firestore.v1.ICreateDocumentRequest, options: gax.CallOptions, callback: Callback<protos.google.firestore.v1.IDocument, protos.google.firestore.v1.ICreateDocumentRequest | null | undefined, {} | null | undefined>): void; | ||
createDocument(request: protos.google.firestore.v1.ICreateDocumentRequest, options?: CallOptions): Promise<[protos.google.firestore.v1.IDocument, protos.google.firestore.v1.ICreateDocumentRequest | undefined, {} | undefined]>; | ||
createDocument(request: protos.google.firestore.v1.ICreateDocumentRequest, options: CallOptions, callback: Callback<protos.google.firestore.v1.IDocument, protos.google.firestore.v1.ICreateDocumentRequest | null | undefined, {} | null | undefined>): void; | ||
createDocument(request: protos.google.firestore.v1.ICreateDocumentRequest, callback: Callback<protos.google.firestore.v1.IDocument, protos.google.firestore.v1.ICreateDocumentRequest | null | undefined, {} | null | undefined>): void; | ||
@@ -175,3 +175,3 @@ /** | ||
*/ | ||
batchGetDocuments(request?: protos.google.firestore.v1.IBatchGetDocumentsRequest, options?: gax.CallOptions): gax.CancellableStream; | ||
batchGetDocuments(request?: protos.google.firestore.v1.IBatchGetDocumentsRequest, options?: CallOptions): gax.CancellableStream; | ||
/** | ||
@@ -213,3 +213,3 @@ * Runs a query. | ||
*/ | ||
runQuery(request?: protos.google.firestore.v1.IRunQueryRequest, options?: gax.CallOptions): gax.CancellableStream; | ||
runQuery(request?: protos.google.firestore.v1.IRunQueryRequest, options?: CallOptions): gax.CancellableStream; | ||
/** | ||
@@ -234,3 +234,3 @@ * Streams batches of document updates and deletes, in order. | ||
*/ | ||
write(options?: gax.CallOptions): gax.CancellableStream; | ||
write(options?: CallOptions): gax.CancellableStream; | ||
/** | ||
@@ -255,5 +255,5 @@ * Listens to changes. | ||
*/ | ||
listen(options?: gax.CallOptions): gax.CancellableStream; | ||
listDocuments(request: protos.google.firestore.v1.IListDocumentsRequest, options?: gax.CallOptions): Promise<[protos.google.firestore.v1.IDocument[], protos.google.firestore.v1.IListDocumentsRequest | null, protos.google.firestore.v1.IListDocumentsResponse]>; | ||
listDocuments(request: protos.google.firestore.v1.IListDocumentsRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.firestore.v1.IListDocumentsRequest, protos.google.firestore.v1.IListDocumentsResponse | null | undefined, protos.google.firestore.v1.IDocument>): void; | ||
listen(options?: CallOptions): gax.CancellableStream; | ||
listDocuments(request: protos.google.firestore.v1.IListDocumentsRequest, options?: CallOptions): Promise<[protos.google.firestore.v1.IDocument[], protos.google.firestore.v1.IListDocumentsRequest | null, protos.google.firestore.v1.IListDocumentsResponse]>; | ||
listDocuments(request: protos.google.firestore.v1.IListDocumentsRequest, options: CallOptions, callback: PaginationCallback<protos.google.firestore.v1.IListDocumentsRequest, protos.google.firestore.v1.IListDocumentsResponse | null | undefined, protos.google.firestore.v1.IDocument>): void; | ||
listDocuments(request: protos.google.firestore.v1.IListDocumentsRequest, callback: PaginationCallback<protos.google.firestore.v1.IListDocumentsRequest, protos.google.firestore.v1.IListDocumentsResponse | null | undefined, protos.google.firestore.v1.IDocument>): void; | ||
@@ -310,3 +310,3 @@ /** | ||
*/ | ||
listDocumentsStream(request?: protos.google.firestore.v1.IListDocumentsRequest, options?: gax.CallOptions): Transform; | ||
listDocumentsStream(request?: protos.google.firestore.v1.IListDocumentsRequest, options?: CallOptions): Transform; | ||
/** | ||
@@ -368,5 +368,5 @@ * Equivalent to `listDocuments`, but returns an iterable object. | ||
*/ | ||
listDocumentsAsync(request?: protos.google.firestore.v1.IListDocumentsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.firestore.v1.IDocument>; | ||
partitionQuery(request: protos.google.firestore.v1.IPartitionQueryRequest, options?: gax.CallOptions): Promise<[protos.google.firestore.v1.ICursor[], protos.google.firestore.v1.IPartitionQueryRequest | null, protos.google.firestore.v1.IPartitionQueryResponse]>; | ||
partitionQuery(request: protos.google.firestore.v1.IPartitionQueryRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.firestore.v1.IPartitionQueryRequest, protos.google.firestore.v1.IPartitionQueryResponse | null | undefined, protos.google.firestore.v1.ICursor>): void; | ||
listDocumentsAsync(request?: protos.google.firestore.v1.IListDocumentsRequest, options?: CallOptions): AsyncIterable<protos.google.firestore.v1.IDocument>; | ||
partitionQuery(request: protos.google.firestore.v1.IPartitionQueryRequest, options?: CallOptions): Promise<[protos.google.firestore.v1.ICursor[], protos.google.firestore.v1.IPartitionQueryRequest | null, protos.google.firestore.v1.IPartitionQueryResponse]>; | ||
partitionQuery(request: protos.google.firestore.v1.IPartitionQueryRequest, options: CallOptions, callback: PaginationCallback<protos.google.firestore.v1.IPartitionQueryRequest, protos.google.firestore.v1.IPartitionQueryResponse | null | undefined, protos.google.firestore.v1.ICursor>): void; | ||
partitionQuery(request: protos.google.firestore.v1.IPartitionQueryRequest, callback: PaginationCallback<protos.google.firestore.v1.IPartitionQueryRequest, protos.google.firestore.v1.IPartitionQueryResponse | null | undefined, protos.google.firestore.v1.ICursor>): void; | ||
@@ -430,3 +430,3 @@ /** | ||
*/ | ||
partitionQueryStream(request?: protos.google.firestore.v1.IPartitionQueryRequest, options?: gax.CallOptions): Transform; | ||
partitionQueryStream(request?: protos.google.firestore.v1.IPartitionQueryRequest, options?: CallOptions): Transform; | ||
/** | ||
@@ -495,5 +495,5 @@ * Equivalent to `partitionQuery`, but returns an iterable object. | ||
*/ | ||
partitionQueryAsync(request?: protos.google.firestore.v1.IPartitionQueryRequest, options?: gax.CallOptions): AsyncIterable<protos.google.firestore.v1.ICursor>; | ||
listCollectionIds(request: protos.google.firestore.v1.IListCollectionIdsRequest, options?: gax.CallOptions): Promise<[string[], protos.google.firestore.v1.IListCollectionIdsRequest | null, protos.google.firestore.v1.IListCollectionIdsResponse]>; | ||
listCollectionIds(request: protos.google.firestore.v1.IListCollectionIdsRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.firestore.v1.IListCollectionIdsRequest, protos.google.firestore.v1.IListCollectionIdsResponse | null | undefined, string>): void; | ||
partitionQueryAsync(request?: protos.google.firestore.v1.IPartitionQueryRequest, options?: CallOptions): AsyncIterable<protos.google.firestore.v1.ICursor>; | ||
listCollectionIds(request: protos.google.firestore.v1.IListCollectionIdsRequest, options?: CallOptions): Promise<[string[], protos.google.firestore.v1.IListCollectionIdsRequest | null, protos.google.firestore.v1.IListCollectionIdsResponse]>; | ||
listCollectionIds(request: protos.google.firestore.v1.IListCollectionIdsRequest, options: CallOptions, callback: PaginationCallback<protos.google.firestore.v1.IListCollectionIdsRequest, protos.google.firestore.v1.IListCollectionIdsResponse | null | undefined, string>): void; | ||
listCollectionIds(request: protos.google.firestore.v1.IListCollectionIdsRequest, callback: PaginationCallback<protos.google.firestore.v1.IListCollectionIdsRequest, protos.google.firestore.v1.IListCollectionIdsResponse | null | undefined, string>): void; | ||
@@ -526,3 +526,3 @@ /** | ||
*/ | ||
listCollectionIdsStream(request?: protos.google.firestore.v1.IListCollectionIdsRequest, options?: gax.CallOptions): Transform; | ||
listCollectionIdsStream(request?: protos.google.firestore.v1.IListCollectionIdsRequest, options?: CallOptions): Transform; | ||
/** | ||
@@ -560,3 +560,3 @@ * Equivalent to `listCollectionIds`, but returns an iterable object. | ||
*/ | ||
listCollectionIdsAsync(request?: protos.google.firestore.v1.IListCollectionIdsRequest, options?: gax.CallOptions): AsyncIterable<string>; | ||
listCollectionIdsAsync(request?: protos.google.firestore.v1.IListCollectionIdsRequest, options?: CallOptions): AsyncIterable<string>; | ||
/** | ||
@@ -563,0 +563,0 @@ * Terminate the gRPC channel and close the client. |
/// <reference types="node" /> | ||
import * as gax from 'google-gax'; | ||
import { Callback, Descriptors, ClientOptions, PaginationCallback } from 'google-gax'; | ||
import { Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback } from 'google-gax'; | ||
import { Transform } from 'stream'; | ||
@@ -68,5 +68,5 @@ import * as protos from '../../protos/firestore_v1beta1_proto_api'; | ||
* API remote host. | ||
* @param {gax.ClientConfig} [options.clientConfig] - client configuration override. | ||
* TODO(@alexander-fenster): link to gax documentation. | ||
* @param {boolean} fallback - Use HTTP fallback mode. | ||
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. | ||
* Follows the structure of {@link gapicConfig}. | ||
* @param {boolean} [options.fallback] - Use HTTP fallback mode. | ||
* In fallback mode, a special browser-compatible transport implementation is used | ||
@@ -116,22 +116,22 @@ * instead of gRPC transport. In browser context (if the `window` object is defined) | ||
getProjectId(callback: Callback<string, undefined, undefined>): void; | ||
getDocument(request: protos.google.firestore.v1beta1.IGetDocumentRequest, options?: gax.CallOptions): Promise<[protos.google.firestore.v1beta1.IDocument, protos.google.firestore.v1beta1.IGetDocumentRequest | undefined, {} | undefined]>; | ||
getDocument(request: protos.google.firestore.v1beta1.IGetDocumentRequest, options: gax.CallOptions, callback: Callback<protos.google.firestore.v1beta1.IDocument, protos.google.firestore.v1beta1.IGetDocumentRequest | null | undefined, {} | null | undefined>): void; | ||
getDocument(request: protos.google.firestore.v1beta1.IGetDocumentRequest, options?: CallOptions): Promise<[protos.google.firestore.v1beta1.IDocument, protos.google.firestore.v1beta1.IGetDocumentRequest | undefined, {} | undefined]>; | ||
getDocument(request: protos.google.firestore.v1beta1.IGetDocumentRequest, options: CallOptions, callback: Callback<protos.google.firestore.v1beta1.IDocument, protos.google.firestore.v1beta1.IGetDocumentRequest | null | undefined, {} | null | undefined>): void; | ||
getDocument(request: protos.google.firestore.v1beta1.IGetDocumentRequest, callback: Callback<protos.google.firestore.v1beta1.IDocument, protos.google.firestore.v1beta1.IGetDocumentRequest | null | undefined, {} | null | undefined>): void; | ||
createDocument(request: protos.google.firestore.v1beta1.ICreateDocumentRequest, options?: gax.CallOptions): Promise<[protos.google.firestore.v1beta1.IDocument, protos.google.firestore.v1beta1.ICreateDocumentRequest | undefined, {} | undefined]>; | ||
createDocument(request: protos.google.firestore.v1beta1.ICreateDocumentRequest, options: gax.CallOptions, callback: Callback<protos.google.firestore.v1beta1.IDocument, protos.google.firestore.v1beta1.ICreateDocumentRequest | null | undefined, {} | null | undefined>): void; | ||
createDocument(request: protos.google.firestore.v1beta1.ICreateDocumentRequest, options?: CallOptions): Promise<[protos.google.firestore.v1beta1.IDocument, protos.google.firestore.v1beta1.ICreateDocumentRequest | undefined, {} | undefined]>; | ||
createDocument(request: protos.google.firestore.v1beta1.ICreateDocumentRequest, options: CallOptions, callback: Callback<protos.google.firestore.v1beta1.IDocument, protos.google.firestore.v1beta1.ICreateDocumentRequest | null | undefined, {} | null | undefined>): void; | ||
createDocument(request: protos.google.firestore.v1beta1.ICreateDocumentRequest, callback: Callback<protos.google.firestore.v1beta1.IDocument, protos.google.firestore.v1beta1.ICreateDocumentRequest | null | undefined, {} | null | undefined>): void; | ||
updateDocument(request: protos.google.firestore.v1beta1.IUpdateDocumentRequest, options?: gax.CallOptions): Promise<[protos.google.firestore.v1beta1.IDocument, protos.google.firestore.v1beta1.IUpdateDocumentRequest | undefined, {} | undefined]>; | ||
updateDocument(request: protos.google.firestore.v1beta1.IUpdateDocumentRequest, options: gax.CallOptions, callback: Callback<protos.google.firestore.v1beta1.IDocument, protos.google.firestore.v1beta1.IUpdateDocumentRequest | null | undefined, {} | null | undefined>): void; | ||
updateDocument(request: protos.google.firestore.v1beta1.IUpdateDocumentRequest, options?: CallOptions): Promise<[protos.google.firestore.v1beta1.IDocument, protos.google.firestore.v1beta1.IUpdateDocumentRequest | undefined, {} | undefined]>; | ||
updateDocument(request: protos.google.firestore.v1beta1.IUpdateDocumentRequest, options: CallOptions, callback: Callback<protos.google.firestore.v1beta1.IDocument, protos.google.firestore.v1beta1.IUpdateDocumentRequest | null | undefined, {} | null | undefined>): void; | ||
updateDocument(request: protos.google.firestore.v1beta1.IUpdateDocumentRequest, callback: Callback<protos.google.firestore.v1beta1.IDocument, protos.google.firestore.v1beta1.IUpdateDocumentRequest | null | undefined, {} | null | undefined>): void; | ||
deleteDocument(request: protos.google.firestore.v1beta1.IDeleteDocumentRequest, options?: gax.CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.firestore.v1beta1.IDeleteDocumentRequest | undefined, {} | undefined]>; | ||
deleteDocument(request: protos.google.firestore.v1beta1.IDeleteDocumentRequest, options: gax.CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.firestore.v1beta1.IDeleteDocumentRequest | null | undefined, {} | null | undefined>): void; | ||
deleteDocument(request: protos.google.firestore.v1beta1.IDeleteDocumentRequest, options?: CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.firestore.v1beta1.IDeleteDocumentRequest | undefined, {} | undefined]>; | ||
deleteDocument(request: protos.google.firestore.v1beta1.IDeleteDocumentRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.firestore.v1beta1.IDeleteDocumentRequest | null | undefined, {} | null | undefined>): void; | ||
deleteDocument(request: protos.google.firestore.v1beta1.IDeleteDocumentRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.firestore.v1beta1.IDeleteDocumentRequest | null | undefined, {} | null | undefined>): void; | ||
beginTransaction(request: protos.google.firestore.v1beta1.IBeginTransactionRequest, options?: gax.CallOptions): Promise<[protos.google.firestore.v1beta1.IBeginTransactionResponse, protos.google.firestore.v1beta1.IBeginTransactionRequest | undefined, {} | undefined]>; | ||
beginTransaction(request: protos.google.firestore.v1beta1.IBeginTransactionRequest, options: gax.CallOptions, callback: Callback<protos.google.firestore.v1beta1.IBeginTransactionResponse, protos.google.firestore.v1beta1.IBeginTransactionRequest | null | undefined, {} | null | undefined>): void; | ||
beginTransaction(request: protos.google.firestore.v1beta1.IBeginTransactionRequest, options?: CallOptions): Promise<[protos.google.firestore.v1beta1.IBeginTransactionResponse, protos.google.firestore.v1beta1.IBeginTransactionRequest | undefined, {} | undefined]>; | ||
beginTransaction(request: protos.google.firestore.v1beta1.IBeginTransactionRequest, options: CallOptions, callback: Callback<protos.google.firestore.v1beta1.IBeginTransactionResponse, protos.google.firestore.v1beta1.IBeginTransactionRequest | null | undefined, {} | null | undefined>): void; | ||
beginTransaction(request: protos.google.firestore.v1beta1.IBeginTransactionRequest, callback: Callback<protos.google.firestore.v1beta1.IBeginTransactionResponse, protos.google.firestore.v1beta1.IBeginTransactionRequest | null | undefined, {} | null | undefined>): void; | ||
commit(request: protos.google.firestore.v1beta1.ICommitRequest, options?: gax.CallOptions): Promise<[protos.google.firestore.v1beta1.ICommitResponse, protos.google.firestore.v1beta1.ICommitRequest | undefined, {} | undefined]>; | ||
commit(request: protos.google.firestore.v1beta1.ICommitRequest, options: gax.CallOptions, callback: Callback<protos.google.firestore.v1beta1.ICommitResponse, protos.google.firestore.v1beta1.ICommitRequest | null | undefined, {} | null | undefined>): void; | ||
commit(request: protos.google.firestore.v1beta1.ICommitRequest, options?: CallOptions): Promise<[protos.google.firestore.v1beta1.ICommitResponse, protos.google.firestore.v1beta1.ICommitRequest | undefined, {} | undefined]>; | ||
commit(request: protos.google.firestore.v1beta1.ICommitRequest, options: CallOptions, callback: Callback<protos.google.firestore.v1beta1.ICommitResponse, protos.google.firestore.v1beta1.ICommitRequest | null | undefined, {} | null | undefined>): void; | ||
commit(request: protos.google.firestore.v1beta1.ICommitRequest, callback: Callback<protos.google.firestore.v1beta1.ICommitResponse, protos.google.firestore.v1beta1.ICommitRequest | null | undefined, {} | null | undefined>): void; | ||
rollback(request: protos.google.firestore.v1beta1.IRollbackRequest, options?: gax.CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.firestore.v1beta1.IRollbackRequest | undefined, {} | undefined]>; | ||
rollback(request: protos.google.firestore.v1beta1.IRollbackRequest, options: gax.CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.firestore.v1beta1.IRollbackRequest | null | undefined, {} | null | undefined>): void; | ||
rollback(request: protos.google.firestore.v1beta1.IRollbackRequest, options?: CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.firestore.v1beta1.IRollbackRequest | undefined, {} | undefined]>; | ||
rollback(request: protos.google.firestore.v1beta1.IRollbackRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.firestore.v1beta1.IRollbackRequest | null | undefined, {} | null | undefined>): void; | ||
rollback(request: protos.google.firestore.v1beta1.IRollbackRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.firestore.v1beta1.IRollbackRequest | null | undefined, {} | null | undefined>): void; | ||
@@ -181,3 +181,3 @@ /** | ||
*/ | ||
batchGetDocuments(request?: protos.google.firestore.v1beta1.IBatchGetDocumentsRequest, options?: gax.CallOptions): gax.CancellableStream; | ||
batchGetDocuments(request?: protos.google.firestore.v1beta1.IBatchGetDocumentsRequest, options?: CallOptions): gax.CancellableStream; | ||
/** | ||
@@ -219,3 +219,3 @@ * Runs a query. | ||
*/ | ||
runQuery(request?: protos.google.firestore.v1beta1.IRunQueryRequest, options?: gax.CallOptions): gax.CancellableStream; | ||
runQuery(request?: protos.google.firestore.v1beta1.IRunQueryRequest, options?: CallOptions): gax.CancellableStream; | ||
/** | ||
@@ -240,3 +240,3 @@ * Streams batches of document updates and deletes, in order. | ||
*/ | ||
write(options?: gax.CallOptions): gax.CancellableStream; | ||
write(options?: CallOptions): gax.CancellableStream; | ||
/** | ||
@@ -261,5 +261,5 @@ * Listens to changes. | ||
*/ | ||
listen(options?: gax.CallOptions): gax.CancellableStream; | ||
listDocuments(request: protos.google.firestore.v1beta1.IListDocumentsRequest, options?: gax.CallOptions): Promise<[protos.google.firestore.v1beta1.IDocument[], protos.google.firestore.v1beta1.IListDocumentsRequest | null, protos.google.firestore.v1beta1.IListDocumentsResponse]>; | ||
listDocuments(request: protos.google.firestore.v1beta1.IListDocumentsRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.firestore.v1beta1.IListDocumentsRequest, protos.google.firestore.v1beta1.IListDocumentsResponse | null | undefined, protos.google.firestore.v1beta1.IDocument>): void; | ||
listen(options?: CallOptions): gax.CancellableStream; | ||
listDocuments(request: protos.google.firestore.v1beta1.IListDocumentsRequest, options?: CallOptions): Promise<[protos.google.firestore.v1beta1.IDocument[], protos.google.firestore.v1beta1.IListDocumentsRequest | null, protos.google.firestore.v1beta1.IListDocumentsResponse]>; | ||
listDocuments(request: protos.google.firestore.v1beta1.IListDocumentsRequest, options: CallOptions, callback: PaginationCallback<protos.google.firestore.v1beta1.IListDocumentsRequest, protos.google.firestore.v1beta1.IListDocumentsResponse | null | undefined, protos.google.firestore.v1beta1.IDocument>): void; | ||
listDocuments(request: protos.google.firestore.v1beta1.IListDocumentsRequest, callback: PaginationCallback<protos.google.firestore.v1beta1.IListDocumentsRequest, protos.google.firestore.v1beta1.IListDocumentsResponse | null | undefined, protos.google.firestore.v1beta1.IDocument>): void; | ||
@@ -316,3 +316,3 @@ /** | ||
*/ | ||
listDocumentsStream(request?: protos.google.firestore.v1beta1.IListDocumentsRequest, options?: gax.CallOptions): Transform; | ||
listDocumentsStream(request?: protos.google.firestore.v1beta1.IListDocumentsRequest, options?: CallOptions): Transform; | ||
/** | ||
@@ -374,5 +374,5 @@ * Equivalent to `listDocuments`, but returns an iterable object. | ||
*/ | ||
listDocumentsAsync(request?: protos.google.firestore.v1beta1.IListDocumentsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.firestore.v1beta1.IDocument>; | ||
listCollectionIds(request: protos.google.firestore.v1beta1.IListCollectionIdsRequest, options?: gax.CallOptions): Promise<[string[], protos.google.firestore.v1beta1.IListCollectionIdsRequest | null, protos.google.firestore.v1beta1.IListCollectionIdsResponse]>; | ||
listCollectionIds(request: protos.google.firestore.v1beta1.IListCollectionIdsRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.firestore.v1beta1.IListCollectionIdsRequest, protos.google.firestore.v1beta1.IListCollectionIdsResponse | null | undefined, string>): void; | ||
listDocumentsAsync(request?: protos.google.firestore.v1beta1.IListDocumentsRequest, options?: CallOptions): AsyncIterable<protos.google.firestore.v1beta1.IDocument>; | ||
listCollectionIds(request: protos.google.firestore.v1beta1.IListCollectionIdsRequest, options?: CallOptions): Promise<[string[], protos.google.firestore.v1beta1.IListCollectionIdsRequest | null, protos.google.firestore.v1beta1.IListCollectionIdsResponse]>; | ||
listCollectionIds(request: protos.google.firestore.v1beta1.IListCollectionIdsRequest, options: CallOptions, callback: PaginationCallback<protos.google.firestore.v1beta1.IListCollectionIdsRequest, protos.google.firestore.v1beta1.IListCollectionIdsResponse | null | undefined, string>): void; | ||
listCollectionIds(request: protos.google.firestore.v1beta1.IListCollectionIdsRequest, callback: PaginationCallback<protos.google.firestore.v1beta1.IListCollectionIdsRequest, protos.google.firestore.v1beta1.IListCollectionIdsResponse | null | undefined, string>): void; | ||
@@ -405,3 +405,3 @@ /** | ||
*/ | ||
listCollectionIdsStream(request?: protos.google.firestore.v1beta1.IListCollectionIdsRequest, options?: gax.CallOptions): Transform; | ||
listCollectionIdsStream(request?: protos.google.firestore.v1beta1.IListCollectionIdsRequest, options?: CallOptions): Transform; | ||
/** | ||
@@ -439,3 +439,3 @@ * Equivalent to `listCollectionIds`, but returns an iterable object. | ||
*/ | ||
listCollectionIdsAsync(request?: protos.google.firestore.v1beta1.IListCollectionIdsRequest, options?: gax.CallOptions): AsyncIterable<string>; | ||
listCollectionIdsAsync(request?: protos.google.firestore.v1beta1.IListCollectionIdsRequest, options?: CallOptions): AsyncIterable<string>; | ||
/** | ||
@@ -442,0 +442,0 @@ * Terminate the gRPC channel and close the client. |
@@ -20,4 +20,10 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/* global window */ | ||
const gax = require("google-gax"); | ||
const path = require("path"); | ||
/** | ||
* Client JSON configuration object, loaded from | ||
* `src/v1beta1/firestore_client_config.json`. | ||
* This file defines retry strategy and timeouts for all API methods in this library. | ||
*/ | ||
const gapicConfig = require("./firestore_client_config.json"); | ||
@@ -74,5 +80,5 @@ // tslint:disable deprecation | ||
* API remote host. | ||
* @param {gax.ClientConfig} [options.clientConfig] - client configuration override. | ||
* TODO(@alexander-fenster): link to gax documentation. | ||
* @param {boolean} fallback - Use HTTP fallback mode. | ||
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. | ||
* Follows the structure of {@link gapicConfig}. | ||
* @param {boolean} [options.fallback] - Use HTTP fallback mode. | ||
* In fallback mode, a special browser-compatible transport implementation is used | ||
@@ -97,3 +103,3 @@ * instead of gRPC transport. In browser context (if the `window` object is defined) | ||
const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {}; | ||
const fallback = (_b = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _b !== void 0 ? _b : typeof window !== 'undefined'; | ||
const fallback = (_b = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _b !== void 0 ? _b : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function'); | ||
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); | ||
@@ -100,0 +106,0 @@ // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. |
@@ -23,3 +23,3 @@ /*! | ||
import api = google.firestore.v1; | ||
/** | ||
/*! | ||
* Idle timeout used to detect Watch streams that stall (see | ||
@@ -26,0 +26,0 @@ * https://github.com/googleapis/nodejs-firestore/issues/1057, b/156308554). |
@@ -35,3 +35,3 @@ "use strict"; | ||
const WATCH_TARGET_ID = 0x1; | ||
/** | ||
/*! | ||
* Idle timeout used to detect Watch streams that stall (see | ||
@@ -38,0 +38,0 @@ * https://github.com/googleapis/nodejs-firestore/issues/1057, b/156308554). |
@@ -7,2 +7,9 @@ # Changelog | ||
### [4.7.2](https://www.github.com/googleapis/nodejs-firestore/compare/v4.7.1...v4.7.2) (2020-11-25) | ||
### Bug Fixes | ||
* **browser:** check for fetch on window ([#1368](https://www.github.com/googleapis/nodejs-firestore/issues/1368)) ([3cd29d2](https://www.github.com/googleapis/nodejs-firestore/commit/3cd29d22073cff8d0ca072057c63dfe0a2144841)) | ||
### [4.7.1](https://www.github.com/googleapis/nodejs-firestore/compare/v4.7.0...v4.7.1) (2020-11-10) | ||
@@ -9,0 +16,0 @@ |
{ | ||
"name": "@google-cloud/firestore", | ||
"description": "Firestore Client Library for Node.js", | ||
"version": "4.7.1", | ||
"version": "4.7.2", | ||
"license": "Apache-2.0", | ||
@@ -75,3 +75,3 @@ "author": "Google Inc.", | ||
"extend": "^3.0.2", | ||
"gts": "^2.0.0-alpha.9", | ||
"gts": "^3.0.0", | ||
"jsdoc": "^3.6.2", | ||
@@ -78,0 +78,0 @@ "jsdoc-fresh": "^1.0.2", |
@@ -126,3 +126,3 @@ [//]: # "This README.md file is auto-generated, all changes to this file will be lost." | ||
Client libraries targetting some end-of-life versions of Node.js are available, and | ||
Client libraries targeting some end-of-life versions of Node.js are available, and | ||
can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). | ||
@@ -129,0 +129,0 @@ The dist-tags follow the naming convention `legacy-(version)`. |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4503638
83820