firebase-admin 11.3.0 → 11.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/core.d.ts +1 -1
- package/lib/app/core.js +1 -1
- package/lib/app/credential-factory.d.ts +1 -1
- package/lib/app/credential-factory.js +1 -1
- package/lib/app/credential-internal.d.ts +1 -1
- package/lib/app/credential-internal.js +1 -1
- package/lib/app/credential.d.ts +1 -1
- package/lib/app/credential.js +1 -1
- package/lib/app/firebase-app.d.ts +1 -1
- package/lib/app/firebase-app.js +1 -1
- package/lib/app/firebase-namespace.d.ts +1 -1
- package/lib/app/firebase-namespace.js +1 -1
- package/lib/app/index.d.ts +1 -1
- package/lib/app/index.js +1 -1
- package/lib/app/lifecycle.d.ts +1 -1
- package/lib/app/lifecycle.js +1 -1
- package/lib/app-check/app-check-api-client-internal.d.ts +1 -1
- package/lib/app-check/app-check-api-client-internal.js +1 -1
- package/lib/app-check/app-check-api.d.ts +1 -1
- package/lib/app-check/app-check-api.js +1 -1
- package/lib/app-check/app-check-namespace.d.ts +1 -1
- package/lib/app-check/app-check-namespace.js +1 -1
- package/lib/app-check/app-check.d.ts +1 -1
- package/lib/app-check/app-check.js +1 -1
- package/lib/app-check/index.d.ts +1 -1
- package/lib/app-check/index.js +1 -1
- package/lib/app-check/token-generator.d.ts +1 -1
- package/lib/app-check/token-generator.js +1 -1
- package/lib/app-check/token-verifier.d.ts +1 -1
- package/lib/app-check/token-verifier.js +1 -1
- package/lib/auth/action-code-settings-builder.d.ts +1 -1
- package/lib/auth/action-code-settings-builder.js +1 -1
- package/lib/auth/auth-api-request.d.ts +1 -1
- package/lib/auth/auth-api-request.js +1 -1
- package/lib/auth/auth-config.d.ts +1 -1
- package/lib/auth/auth-config.js +1 -1
- package/lib/auth/auth-namespace.d.ts +1 -1
- package/lib/auth/auth-namespace.js +1 -1
- package/lib/auth/auth.d.ts +1 -1
- package/lib/auth/auth.js +1 -1
- package/lib/auth/base-auth.d.ts +1 -1
- package/lib/auth/base-auth.js +1 -1
- package/lib/auth/identifier.d.ts +1 -1
- package/lib/auth/identifier.js +1 -1
- package/lib/auth/index.d.ts +1 -1
- package/lib/auth/index.js +1 -1
- package/lib/auth/project-config-manager.d.ts +1 -1
- package/lib/auth/project-config-manager.js +1 -1
- package/lib/auth/project-config.d.ts +1 -1
- package/lib/auth/project-config.js +1 -1
- package/lib/auth/tenant-manager.d.ts +1 -1
- package/lib/auth/tenant-manager.js +1 -1
- package/lib/auth/tenant.d.ts +1 -1
- package/lib/auth/tenant.js +1 -1
- package/lib/auth/token-generator.d.ts +1 -1
- package/lib/auth/token-generator.js +1 -1
- package/lib/auth/token-verifier.d.ts +1 -1
- package/lib/auth/token-verifier.js +1 -1
- package/lib/auth/user-import-builder.d.ts +1 -1
- package/lib/auth/user-import-builder.js +1 -1
- package/lib/auth/user-record.d.ts +1 -1
- package/lib/auth/user-record.js +1 -1
- package/lib/credential/index.d.ts +1 -1
- package/lib/credential/index.js +1 -1
- package/lib/database/database-namespace.d.ts +1 -1
- package/lib/database/database-namespace.js +1 -1
- package/lib/database/database.d.ts +1 -1
- package/lib/database/database.js +1 -1
- package/lib/database/index.d.ts +1 -1
- package/lib/database/index.js +1 -1
- package/lib/default-namespace.d.ts +1 -1
- package/lib/default-namespace.js +1 -1
- package/lib/esm/firestore/index.js +1 -0
- package/lib/eventarc/cloudevent.d.ts +1 -1
- package/lib/eventarc/cloudevent.js +1 -1
- package/lib/eventarc/eventarc-client-internal.d.ts +1 -1
- package/lib/eventarc/eventarc-client-internal.js +1 -1
- package/lib/eventarc/eventarc-utils.d.ts +1 -1
- package/lib/eventarc/eventarc-utils.js +1 -1
- package/lib/eventarc/eventarc.d.ts +1 -1
- package/lib/eventarc/eventarc.js +1 -1
- package/lib/eventarc/index.d.ts +1 -1
- package/lib/eventarc/index.js +1 -1
- package/lib/extensions/extensions-api-client-internal.d.ts +1 -1
- package/lib/extensions/extensions-api-client-internal.js +1 -1
- package/lib/extensions/extensions-api.d.ts +1 -1
- package/lib/extensions/extensions-api.js +1 -1
- package/lib/extensions/extensions.d.ts +1 -1
- package/lib/extensions/extensions.js +1 -1
- package/lib/extensions/index.d.ts +1 -1
- package/lib/extensions/index.js +1 -1
- package/lib/firebase-namespace-api.d.ts +1 -1
- package/lib/firebase-namespace-api.js +1 -1
- package/lib/firestore/firestore-internal.d.ts +24 -3
- package/lib/firestore/firestore-internal.js +34 -7
- package/lib/firestore/firestore-namespace.d.ts +1 -1
- package/lib/firestore/firestore-namespace.js +1 -1
- package/lib/firestore/index.d.ts +22 -2
- package/lib/firestore/index.js +10 -2
- package/lib/functions/functions-api-client-internal.d.ts +1 -1
- package/lib/functions/functions-api-client-internal.js +1 -1
- package/lib/functions/functions-api.d.ts +1 -1
- package/lib/functions/functions-api.js +1 -1
- package/lib/functions/functions.d.ts +1 -1
- package/lib/functions/functions.js +1 -1
- package/lib/functions/index.d.ts +1 -1
- package/lib/functions/index.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/installations/index.d.ts +1 -1
- package/lib/installations/index.js +1 -1
- package/lib/installations/installations-namespace.d.ts +1 -1
- package/lib/installations/installations-namespace.js +1 -1
- package/lib/installations/installations-request-handler.d.ts +1 -1
- package/lib/installations/installations-request-handler.js +1 -1
- package/lib/installations/installations.d.ts +1 -1
- package/lib/installations/installations.js +1 -1
- package/lib/instance-id/index.d.ts +1 -1
- package/lib/instance-id/index.js +1 -1
- package/lib/instance-id/instance-id-namespace.d.ts +1 -1
- package/lib/instance-id/instance-id-namespace.js +1 -1
- package/lib/instance-id/instance-id.d.ts +1 -1
- package/lib/instance-id/instance-id.js +1 -1
- package/lib/machine-learning/index.d.ts +1 -1
- package/lib/machine-learning/index.js +1 -1
- package/lib/machine-learning/machine-learning-api-client.d.ts +4 -1
- package/lib/machine-learning/machine-learning-api-client.js +1 -1
- package/lib/machine-learning/machine-learning-namespace.d.ts +3 -1
- package/lib/machine-learning/machine-learning-namespace.js +1 -1
- package/lib/machine-learning/machine-learning-utils.d.ts +1 -1
- package/lib/machine-learning/machine-learning-utils.js +1 -1
- package/lib/machine-learning/machine-learning.d.ts +3 -1
- package/lib/machine-learning/machine-learning.js +1 -1
- package/lib/messaging/batch-request-internal.d.ts +1 -1
- package/lib/messaging/batch-request-internal.js +2 -2
- package/lib/messaging/index.d.ts +1 -1
- package/lib/messaging/index.js +1 -1
- package/lib/messaging/messaging-api-request-internal.d.ts +1 -1
- package/lib/messaging/messaging-api-request-internal.js +1 -1
- package/lib/messaging/messaging-api.d.ts +1 -1
- package/lib/messaging/messaging-api.js +1 -1
- package/lib/messaging/messaging-errors-internal.d.ts +1 -1
- package/lib/messaging/messaging-errors-internal.js +1 -1
- package/lib/messaging/messaging-internal.d.ts +1 -1
- package/lib/messaging/messaging-internal.js +1 -1
- package/lib/messaging/messaging-namespace.d.ts +1 -1
- package/lib/messaging/messaging-namespace.js +1 -1
- package/lib/messaging/messaging.d.ts +1 -1
- package/lib/messaging/messaging.js +1 -1
- package/lib/project-management/android-app.d.ts +1 -1
- package/lib/project-management/android-app.js +1 -1
- package/lib/project-management/app-metadata.d.ts +1 -1
- package/lib/project-management/app-metadata.js +1 -1
- package/lib/project-management/index.d.ts +1 -1
- package/lib/project-management/index.js +1 -1
- package/lib/project-management/ios-app.d.ts +1 -1
- package/lib/project-management/ios-app.js +1 -1
- package/lib/project-management/project-management-api-request-internal.d.ts +1 -1
- package/lib/project-management/project-management-api-request-internal.js +1 -1
- package/lib/project-management/project-management-namespace.d.ts +1 -1
- package/lib/project-management/project-management-namespace.js +1 -1
- package/lib/project-management/project-management.d.ts +1 -1
- package/lib/project-management/project-management.js +1 -1
- package/lib/remote-config/index.d.ts +1 -1
- package/lib/remote-config/index.js +1 -1
- package/lib/remote-config/remote-config-api-client-internal.d.ts +1 -1
- package/lib/remote-config/remote-config-api-client-internal.js +1 -1
- package/lib/remote-config/remote-config-api.d.ts +1 -1
- package/lib/remote-config/remote-config-api.js +1 -1
- package/lib/remote-config/remote-config-namespace.d.ts +1 -1
- package/lib/remote-config/remote-config-namespace.js +1 -1
- package/lib/remote-config/remote-config.d.ts +1 -1
- package/lib/remote-config/remote-config.js +1 -1
- package/lib/security-rules/index.d.ts +1 -1
- package/lib/security-rules/index.js +1 -1
- package/lib/security-rules/security-rules-api-client-internal.d.ts +1 -1
- package/lib/security-rules/security-rules-api-client-internal.js +1 -1
- package/lib/security-rules/security-rules-internal.d.ts +1 -1
- package/lib/security-rules/security-rules-internal.js +1 -1
- package/lib/security-rules/security-rules-namespace.d.ts +1 -1
- package/lib/security-rules/security-rules-namespace.js +1 -1
- package/lib/security-rules/security-rules.d.ts +1 -1
- package/lib/security-rules/security-rules.js +1 -1
- package/lib/storage/index.d.ts +1 -1
- package/lib/storage/index.js +1 -1
- package/lib/storage/storage-namespace.d.ts +1 -1
- package/lib/storage/storage-namespace.js +1 -1
- package/lib/storage/storage.d.ts +1 -1
- package/lib/storage/storage.js +1 -1
- package/lib/utils/api-request.d.ts +1 -1
- package/lib/utils/api-request.js +6 -1
- package/lib/utils/crypto-signer.d.ts +1 -1
- package/lib/utils/crypto-signer.js +1 -1
- package/lib/utils/deep-copy.d.ts +1 -1
- package/lib/utils/deep-copy.js +1 -1
- package/lib/utils/error.d.ts +1 -1
- package/lib/utils/error.js +1 -1
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +1 -1
- package/lib/utils/jwt.d.ts +1 -1
- package/lib/utils/jwt.js +1 -1
- package/lib/utils/validator.d.ts +1 -1
- package/lib/utils/validator.js +1 -1
- package/package.json +1 -1
package/lib/extensions/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
1
|
+
/*! firebase-admin v11.4.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2017 Google Inc.
|
|
@@ -17,11 +17,32 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { Firestore, Settings } from '@google-cloud/firestore';
|
|
19
19
|
import { App } from '../app';
|
|
20
|
+
/**
|
|
21
|
+
* Settings to pass to the Firestore constructor.
|
|
22
|
+
*
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
export interface FirestoreSettings {
|
|
26
|
+
/**
|
|
27
|
+
* Use HTTP/1.1 REST transport where possible.
|
|
28
|
+
*
|
|
29
|
+
* `preferRest` will force the use of HTTP/1.1 REST transport until a method
|
|
30
|
+
* that requires gRPC is called. When a method requires gRPC, this Firestore
|
|
31
|
+
* client will load dependent gRPC libraries and then use gRPC transport for
|
|
32
|
+
* all communication from that point forward. Currently the only operation
|
|
33
|
+
* that requires gRPC is creating a snapshot listener using `onSnapshot()`.
|
|
34
|
+
*
|
|
35
|
+
* @defaultValue `undefined`
|
|
36
|
+
*/
|
|
37
|
+
preferRest?: boolean;
|
|
38
|
+
}
|
|
20
39
|
export declare class FirestoreService {
|
|
21
40
|
private readonly appInternal;
|
|
22
41
|
private readonly databases;
|
|
42
|
+
private readonly firestoreSettings;
|
|
23
43
|
constructor(app: App);
|
|
24
|
-
getDatabase(databaseId: string): Firestore;
|
|
44
|
+
getDatabase(databaseId: string, settings?: FirestoreSettings): Firestore;
|
|
45
|
+
private checkIfSameSettings;
|
|
25
46
|
/**
|
|
26
47
|
* Returns the app associated with this Storage instance.
|
|
27
48
|
*
|
|
@@ -29,4 +50,4 @@ export declare class FirestoreService {
|
|
|
29
50
|
*/
|
|
30
51
|
get app(): App;
|
|
31
52
|
}
|
|
32
|
-
export declare function getFirestoreOptions(app: App): Settings;
|
|
53
|
+
export declare function getFirestoreOptions(app: App, firestoreSettings?: FirestoreSettings): Settings;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
1
|
+
/*! firebase-admin v11.4.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* @license
|
|
@@ -25,16 +25,39 @@ const utils = require("../utils/index");
|
|
|
25
25
|
class FirestoreService {
|
|
26
26
|
constructor(app) {
|
|
27
27
|
this.databases = new Map();
|
|
28
|
+
this.firestoreSettings = new Map();
|
|
28
29
|
this.appInternal = app;
|
|
29
30
|
}
|
|
30
|
-
getDatabase(databaseId) {
|
|
31
|
+
getDatabase(databaseId, settings) {
|
|
32
|
+
settings ?? (settings = {});
|
|
31
33
|
let database = this.databases.get(databaseId);
|
|
32
34
|
if (database === undefined) {
|
|
33
|
-
database = initFirestore(this.app, databaseId);
|
|
35
|
+
database = initFirestore(this.app, databaseId, settings);
|
|
34
36
|
this.databases.set(databaseId, database);
|
|
37
|
+
this.firestoreSettings.set(databaseId, settings);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
if (!this.checkIfSameSettings(databaseId, settings)) {
|
|
41
|
+
throw new error_1.FirebaseFirestoreError({
|
|
42
|
+
code: 'failed-precondition',
|
|
43
|
+
message: 'initializeFirestore() has already been called with ' +
|
|
44
|
+
'different options. To avoid this error, call initializeFirestore() with the ' +
|
|
45
|
+
'same options as when it was originally called, or call getFirestore() to return the' +
|
|
46
|
+
' already initialized instance.'
|
|
47
|
+
});
|
|
48
|
+
}
|
|
35
49
|
}
|
|
36
50
|
return database;
|
|
37
51
|
}
|
|
52
|
+
checkIfSameSettings(databaseId, firestoreSettings) {
|
|
53
|
+
// If we start passing more settings to Firestore constructor,
|
|
54
|
+
// replace this with deep equality check.
|
|
55
|
+
const existingSettings = this.firestoreSettings.get(databaseId);
|
|
56
|
+
if (!existingSettings) {
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
return (existingSettings.preferRest === firestoreSettings.preferRest);
|
|
60
|
+
}
|
|
38
61
|
/**
|
|
39
62
|
* Returns the app associated with this Storage instance.
|
|
40
63
|
*
|
|
@@ -45,7 +68,7 @@ class FirestoreService {
|
|
|
45
68
|
}
|
|
46
69
|
}
|
|
47
70
|
exports.FirestoreService = FirestoreService;
|
|
48
|
-
function getFirestoreOptions(app) {
|
|
71
|
+
function getFirestoreOptions(app, firestoreSettings) {
|
|
49
72
|
if (!validator.isNonNullObject(app) || !('options' in app)) {
|
|
50
73
|
throw new error_1.FirebaseFirestoreError({
|
|
51
74
|
code: 'invalid-argument',
|
|
@@ -56,6 +79,7 @@ function getFirestoreOptions(app) {
|
|
|
56
79
|
const credential = app.options.credential;
|
|
57
80
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
58
81
|
const { version: firebaseVersion } = require('../../package.json');
|
|
82
|
+
const preferRest = firestoreSettings?.preferRest;
|
|
59
83
|
if (credential instanceof credential_internal_1.ServiceAccountCredential) {
|
|
60
84
|
return {
|
|
61
85
|
credentials: {
|
|
@@ -66,13 +90,16 @@ function getFirestoreOptions(app) {
|
|
|
66
90
|
// guaranteed to be available.
|
|
67
91
|
projectId: projectId,
|
|
68
92
|
firebaseVersion,
|
|
93
|
+
preferRest,
|
|
69
94
|
};
|
|
70
95
|
}
|
|
71
96
|
else if ((0, credential_internal_1.isApplicationDefault)(app.options.credential)) {
|
|
72
97
|
// Try to use the Google application default credentials.
|
|
73
98
|
// If an explicit project ID is not available, let Firestore client discover one from the
|
|
74
99
|
// environment. This prevents the users from having to set GOOGLE_CLOUD_PROJECT in GCP runtimes.
|
|
75
|
-
return validator.isNonEmptyString(projectId)
|
|
100
|
+
return validator.isNonEmptyString(projectId)
|
|
101
|
+
? { projectId, firebaseVersion, preferRest }
|
|
102
|
+
: { firebaseVersion, preferRest };
|
|
76
103
|
}
|
|
77
104
|
throw new error_1.FirebaseFirestoreError({
|
|
78
105
|
code: 'invalid-credential',
|
|
@@ -82,8 +109,8 @@ function getFirestoreOptions(app) {
|
|
|
82
109
|
});
|
|
83
110
|
}
|
|
84
111
|
exports.getFirestoreOptions = getFirestoreOptions;
|
|
85
|
-
function initFirestore(app, databaseId) {
|
|
86
|
-
const options = getFirestoreOptions(app);
|
|
112
|
+
function initFirestore(app, databaseId, firestoreSettings) {
|
|
113
|
+
const options = getFirestoreOptions(app, firestoreSettings);
|
|
87
114
|
options.databaseId = databaseId;
|
|
88
115
|
let firestoreDatabase;
|
|
89
116
|
try {
|
package/lib/firestore/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
1
|
+
/*! firebase-admin v11.4.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2020 Google Inc.
|
|
4
4
|
*
|
|
@@ -21,7 +21,9 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import { Firestore } from '@google-cloud/firestore';
|
|
23
23
|
import { App } from '../app';
|
|
24
|
+
import { FirestoreSettings } from './firestore-internal';
|
|
24
25
|
export { AddPrefixToKeys, BulkWriter, BulkWriterOptions, BundleBuilder, ChildUpdateFields, CollectionGroup, CollectionReference, DocumentChange, DocumentChangeType, DocumentData, DocumentReference, DocumentSnapshot, FieldPath, FieldValue, Firestore, FirestoreDataConverter, GeoPoint, GrpcStatus, NestedUpdateFields, OrderByDirection, PartialWithFieldValue, Precondition, Primitive, Query, QueryDocumentSnapshot, QueryPartition, QuerySnapshot, ReadOptions, ReadOnlyTransactionOptions, ReadWriteTransactionOptions, Settings, SetOptions, Timestamp, Transaction, UpdateData, UnionToIntersection, WhereFilterOp, WithFieldValue, WriteBatch, WriteResult, v1, setLogFunction, } from '@google-cloud/firestore';
|
|
26
|
+
export { FirestoreSettings };
|
|
25
27
|
/**
|
|
26
28
|
* Gets the {@link https://googleapis.dev/nodejs/firestore/latest/Firestore.html | Firestore}
|
|
27
29
|
* service for the default app.
|
|
@@ -55,7 +57,7 @@ export declare function getFirestore(): Firestore;
|
|
|
55
57
|
* const otherFirestore = getFirestore(app);
|
|
56
58
|
* ```
|
|
57
59
|
*
|
|
58
|
-
* @param App -
|
|
60
|
+
* @param App - which `Firestore` service to
|
|
59
61
|
* return. If not provided, the default `Firestore` service will be returned.
|
|
60
62
|
*
|
|
61
63
|
* @returns The default {@link https://googleapis.dev/nodejs/firestore/latest/Firestore.html | Firestore}
|
|
@@ -63,3 +65,21 @@ export declare function getFirestore(): Firestore;
|
|
|
63
65
|
* provided app.
|
|
64
66
|
*/
|
|
65
67
|
export declare function getFirestore(app: App): Firestore;
|
|
68
|
+
/**
|
|
69
|
+
* Gets the {@link https://googleapis.dev/nodejs/firestore/latest/Firestore.html | Firestore}
|
|
70
|
+
* service for the given app, passing extra parameters to its constructor.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```javascript
|
|
74
|
+
* // Get the Firestore service for a specific app, require HTTP/1.1 REST transport
|
|
75
|
+
* const otherFirestore = initializeFirestore(app, {preferRest: true});
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* @param App - which `Firestore` service to
|
|
79
|
+
* return. If not provided, the default `Firestore` service will be returned.
|
|
80
|
+
*
|
|
81
|
+
* @param settings - Settings object to be passed to the constructor.
|
|
82
|
+
*
|
|
83
|
+
* @returns The `Firestore` service associated with the provided app and settings.
|
|
84
|
+
*/
|
|
85
|
+
export declare function initializeFirestore(app: App, settings?: FirestoreSettings): Firestore;
|
package/lib/firestore/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
1
|
+
/*! firebase-admin v11.4.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2020 Google Inc.
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.getFirestore = exports.setLogFunction = exports.v1 = exports.WriteResult = exports.WriteBatch = exports.Transaction = exports.Timestamp = exports.QuerySnapshot = exports.QueryPartition = exports.QueryDocumentSnapshot = exports.Query = exports.GrpcStatus = exports.GeoPoint = exports.Firestore = exports.FieldValue = exports.FieldPath = exports.DocumentSnapshot = exports.DocumentReference = exports.CollectionReference = exports.CollectionGroup = exports.BundleBuilder = exports.BulkWriter = void 0;
|
|
19
|
+
exports.initializeFirestore = exports.getFirestore = exports.setLogFunction = exports.v1 = exports.WriteResult = exports.WriteBatch = exports.Transaction = exports.Timestamp = exports.QuerySnapshot = exports.QueryPartition = exports.QueryDocumentSnapshot = exports.Query = exports.GrpcStatus = exports.GeoPoint = exports.Firestore = exports.FieldValue = exports.FieldPath = exports.DocumentSnapshot = exports.DocumentReference = exports.CollectionReference = exports.CollectionGroup = exports.BundleBuilder = exports.BulkWriter = void 0;
|
|
20
20
|
const app_1 = require("../app");
|
|
21
21
|
const firestore_internal_1 = require("./firestore-internal");
|
|
22
22
|
const path_1 = require("@google-cloud/firestore/build/src/path");
|
|
@@ -50,3 +50,11 @@ function getFirestore(appOrDatabaseId, optionalDatabaseId) {
|
|
|
50
50
|
return firestoreService.getDatabase(databaseId);
|
|
51
51
|
}
|
|
52
52
|
exports.getFirestore = getFirestore;
|
|
53
|
+
function initializeFirestore(app, settings, databaseId) {
|
|
54
|
+
settings ?? (settings = {});
|
|
55
|
+
databaseId ?? (databaseId = path_1.DEFAULT_DATABASE_ID);
|
|
56
|
+
const firebaseApp = app;
|
|
57
|
+
const firestoreService = firebaseApp.getOrInitService('firestore', (app) => new firestore_internal_1.FirestoreService(app));
|
|
58
|
+
return firestoreService.getDatabase(databaseId, settings);
|
|
59
|
+
}
|
|
60
|
+
exports.initializeFirestore = initializeFirestore;
|
package/lib/functions/index.d.ts
CHANGED
package/lib/functions/index.js
CHANGED
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
package/lib/instance-id/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
1
|
+
/*! firebase-admin v11.4.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2020 Google Inc.
|
|
4
4
|
*
|
|
@@ -26,6 +26,9 @@ export interface GcsTfliteModelOptions extends ModelOptionsBase {
|
|
|
26
26
|
gcsTfliteUri: string;
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated AutoMLTfliteModelOptions will be removed in the next major version.
|
|
31
|
+
*/
|
|
29
32
|
export interface AutoMLTfliteModelOptions extends ModelOptionsBase {
|
|
30
33
|
tfliteModel: {
|
|
31
34
|
automlModel: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
1
|
+
/*! firebase-admin v11.4.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2021 Google Inc.
|
|
4
4
|
*
|
|
@@ -64,6 +64,8 @@ export declare namespace machineLearning {
|
|
|
64
64
|
type TFLiteModel = TTFLiteModel;
|
|
65
65
|
/**
|
|
66
66
|
* Type alias to {@link firebase-admin.machine-learning#AutoMLTfliteModelOptions}.
|
|
67
|
+
*
|
|
68
|
+
* @deprecated AutoMLTfliteModelOptions will be removed in the next major version.
|
|
67
69
|
*/
|
|
68
70
|
type AutoMLTfliteModelOptions = TAutoMLTfliteModelOptions;
|
|
69
71
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
1
|
+
/*! firebase-admin v11.4.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2020 Google Inc.
|
|
4
4
|
*
|
|
@@ -40,6 +40,8 @@ export interface TFLiteModel {
|
|
|
40
40
|
/**
|
|
41
41
|
* The AutoML model reference from which the model was originally provided
|
|
42
42
|
* to Firebase.
|
|
43
|
+
*
|
|
44
|
+
* @deprecated AutoML model support will be removed in the next major version.
|
|
43
45
|
*/
|
|
44
46
|
readonly automlModel?: string;
|
|
45
47
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
1
|
+
/*! firebase-admin v11.4.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2019 Google Inc.
|
|
@@ -20,7 +20,7 @@ exports.BatchRequestClient = void 0;
|
|
|
20
20
|
const api_request_1 = require("../utils/api-request");
|
|
21
21
|
const error_1 = require("../utils/error");
|
|
22
22
|
const PART_BOUNDARY = '__END_OF_PART__';
|
|
23
|
-
const TEN_SECONDS_IN_MILLIS =
|
|
23
|
+
const TEN_SECONDS_IN_MILLIS = 15000;
|
|
24
24
|
/**
|
|
25
25
|
* An HTTP client that can be used to make batch requests. This client is not tied to any service
|
|
26
26
|
* (FCM or otherwise). Therefore it can be used to make batch requests to any service that allows
|
package/lib/messaging/index.d.ts
CHANGED
package/lib/messaging/index.js
CHANGED