firebase-admin 9.100.0-alpha.0 → 10.0.2
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/README.md +7 -3
- package/lib/app/core.d.ts +15 -22
- package/lib/app/core.js +1 -1
- package/lib/app/credential-factory.d.ts +17 -33
- package/lib/app/credential-factory.js +17 -33
- package/lib/app/credential-internal.d.ts +10 -9
- package/lib/app/credential-internal.js +15 -13
- package/lib/app/credential.d.ts +3 -9
- package/lib/app/credential.js +1 -1
- package/lib/app/firebase-app.d.ts +6 -30
- package/lib/app/firebase-app.js +72 -216
- package/lib/app/firebase-namespace.d.ts +28 -34
- package/lib/app/firebase-namespace.js +119 -99
- package/lib/app/index.d.ts +6 -1
- package/lib/app/index.js +1 -1
- package/lib/app/lifecycle.d.ts +24 -3
- package/lib/app/lifecycle.js +119 -25
- package/lib/app-check/app-check-api-client-internal.d.ts +32 -0
- package/lib/app-check/app-check-api-client-internal.js +197 -0
- package/lib/app-check/app-check-api.d.ts +95 -0
- package/lib/app-check/app-check-api.js +19 -0
- package/lib/app-check/app-check-namespace.d.ts +65 -0
- package/lib/app-check/app-check-namespace.js +18 -0
- package/lib/app-check/app-check.d.ts +49 -0
- package/lib/app-check/app-check.js +82 -0
- package/lib/app-check/index.d.ts +53 -0
- package/lib/app-check/index.js +63 -0
- package/lib/app-check/token-generator.d.ts +25 -0
- package/lib/app-check/token-generator.js +159 -0
- package/lib/app-check/token-verifier.d.ts +17 -0
- package/lib/app-check/token-verifier.js +151 -0
- package/lib/auth/action-code-settings-builder.d.ts +1 -1
- package/lib/auth/action-code-settings-builder.js +2 -2
- package/lib/auth/auth-api-request.d.ts +28 -32
- package/lib/auth/auth-api-request.js +167 -125
- package/lib/auth/auth-config.d.ts +123 -21
- package/lib/auth/auth-config.js +85 -34
- package/lib/auth/auth-namespace.d.ts +157 -4
- package/lib/auth/auth-namespace.js +1 -1
- package/lib/auth/auth.d.ts +5 -3
- package/lib/auth/auth.js +6 -4
- package/lib/auth/base-auth.d.ts +134 -116
- package/lib/auth/base-auth.js +213 -143
- package/lib/auth/identifier.d.ts +5 -5
- package/lib/auth/identifier.js +1 -1
- package/lib/auth/index.d.ts +10 -5
- package/lib/auth/index.js +9 -4
- package/lib/auth/tenant-manager.d.ts +19 -19
- package/lib/auth/tenant-manager.js +21 -25
- package/lib/auth/tenant.d.ts +14 -5
- package/lib/auth/tenant.js +19 -11
- package/lib/auth/token-generator.d.ts +7 -108
- package/lib/auth/token-generator.js +52 -145
- package/lib/auth/token-verifier.d.ts +3 -4
- package/lib/auth/token-verifier.js +96 -145
- package/lib/auth/user-import-builder.d.ts +11 -11
- package/lib/auth/user-import-builder.js +9 -9
- package/lib/auth/user-record.d.ts +23 -15
- package/lib/auth/user-record.js +30 -20
- package/lib/credential/index.d.ts +18 -35
- package/lib/credential/index.js +17 -33
- package/lib/database/database-namespace.d.ts +39 -10
- package/lib/database/database-namespace.js +1 -1
- package/lib/database/database.d.ts +16 -6
- package/lib/database/database.js +61 -6
- package/lib/database/index.d.ts +19 -18
- package/lib/database/index.js +21 -23
- package/lib/default-namespace.d.ts +7 -1
- package/lib/default-namespace.js +4 -4
- package/lib/esm/app/index.js +10 -0
- package/lib/esm/app-check/index.js +4 -0
- package/lib/esm/auth/index.js +14 -0
- package/lib/esm/database/index.js +6 -0
- package/lib/esm/firestore/index.js +24 -0
- package/lib/esm/installations/index.js +4 -0
- package/lib/esm/instance-id/index.js +4 -0
- package/lib/esm/machine-learning/index.js +5 -0
- package/lib/esm/messaging/index.js +4 -0
- package/lib/esm/package.json +1 -0
- package/lib/esm/project-management/index.js +8 -0
- package/lib/esm/remote-config/index.js +4 -0
- package/lib/esm/security-rules/index.js +6 -0
- package/lib/esm/storage/index.js +4 -0
- package/lib/firebase-namespace-api.d.ts +12 -6
- package/lib/firebase-namespace-api.js +5 -1
- package/lib/firestore/firestore-internal.d.ts +2 -2
- package/lib/firestore/firestore-internal.js +2 -2
- package/lib/firestore/firestore-namespace.d.ts +6 -1
- package/lib/firestore/firestore-namespace.js +2 -1
- package/lib/firestore/index.d.ts +36 -4
- package/lib/firestore/index.js +29 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/installations/index.d.ts +52 -0
- package/lib/installations/index.js +62 -0
- package/lib/installations/installations-namespace.d.ts +55 -0
- package/lib/installations/installations-namespace.js +18 -0
- package/lib/{instance-id/instance-id-request-internal.d.ts → installations/installations-request-handler.d.ts} +8 -8
- package/lib/{instance-id/instance-id-request-internal.js → installations/installations-request-handler.js} +23 -23
- package/lib/installations/installations.d.ts +38 -0
- package/lib/installations/installations.js +63 -0
- package/lib/instance-id/index.d.ts +20 -9
- package/lib/instance-id/index.js +20 -9
- package/lib/instance-id/instance-id-namespace.d.ts +9 -8
- package/lib/instance-id/instance-id-namespace.js +1 -1
- package/lib/instance-id/instance-id.d.ts +8 -6
- package/lib/instance-id/instance-id.js +20 -11
- package/lib/machine-learning/index.d.ts +29 -27
- package/lib/machine-learning/index.js +29 -27
- package/lib/machine-learning/machine-learning-api-client.d.ts +1 -1
- package/lib/machine-learning/machine-learning-api-client.js +4 -4
- package/lib/machine-learning/machine-learning-namespace.d.ts +33 -8
- 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 +19 -19
- package/lib/machine-learning/machine-learning.js +20 -20
- package/lib/messaging/batch-request-internal.d.ts +3 -3
- package/lib/messaging/batch-request-internal.js +9 -9
- package/lib/messaging/index.d.ts +11 -9
- package/lib/messaging/index.js +11 -9
- package/lib/messaging/messaging-api-request-internal.d.ts +8 -8
- package/lib/messaging/messaging-api-request-internal.js +8 -8
- package/lib/messaging/messaging-api.d.ts +79 -75
- package/lib/messaging/messaging-api.js +1 -1
- package/lib/messaging/messaging-errors-internal.d.ts +5 -5
- package/lib/messaging/messaging-errors-internal.js +7 -7
- package/lib/messaging/messaging-internal.d.ts +1 -1
- package/lib/messaging/messaging-internal.js +6 -31
- package/lib/messaging/messaging-namespace.d.ts +105 -8
- package/lib/messaging/messaging-namespace.js +1 -1
- package/lib/messaging/messaging.d.ts +70 -86
- package/lib/messaging/messaging.js +76 -89
- package/lib/project-management/android-app.d.ts +11 -12
- package/lib/project-management/android-app.js +13 -14
- 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 +11 -9
- package/lib/project-management/index.js +11 -9
- package/lib/project-management/ios-app.d.ts +6 -7
- package/lib/project-management/ios-app.js +6 -7
- package/lib/project-management/project-management-api-request-internal.d.ts +1 -80
- package/lib/project-management/project-management-api-request-internal.js +14 -14
- package/lib/project-management/project-management-namespace.d.ts +31 -9
- package/lib/project-management/project-management-namespace.js +1 -1
- package/lib/project-management/project-management.d.ts +18 -21
- package/lib/project-management/project-management.js +19 -22
- package/lib/remote-config/index.d.ts +12 -10
- package/lib/remote-config/index.js +11 -9
- package/lib/remote-config/remote-config-api-client-internal.d.ts +1 -1
- package/lib/remote-config/remote-config-api-client-internal.js +2 -2
- package/lib/remote-config/remote-config-api.d.ts +12 -2
- package/lib/remote-config/remote-config-api.js +1 -1
- package/lib/remote-config/remote-config-namespace.d.ts +50 -9
- package/lib/remote-config/remote-config-namespace.js +1 -1
- package/lib/remote-config/remote-config.d.ts +19 -21
- package/lib/remote-config/remote-config.js +25 -25
- package/lib/security-rules/index.d.ts +12 -10
- package/lib/security-rules/index.js +12 -10
- 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 +43 -28
- package/lib/security-rules/security-rules-namespace.js +1 -1
- package/lib/security-rules/security-rules.d.ts +39 -42
- package/lib/security-rules/security-rules.js +38 -39
- package/lib/storage/index.d.ts +9 -7
- package/lib/storage/index.js +9 -7
- package/lib/storage/storage-namespace.d.ts +7 -6
- package/lib/storage/storage-namespace.js +1 -1
- package/lib/storage/storage.d.ts +3 -3
- package/lib/storage/storage.js +14 -4
- package/lib/utils/api-request.d.ts +24 -24
- package/lib/utils/api-request.js +25 -25
- package/lib/utils/crypto-signer.d.ts +128 -0
- package/lib/utils/crypto-signer.js +237 -0
- package/lib/utils/deep-copy.d.ts +6 -6
- package/lib/utils/deep-copy.js +6 -6
- package/lib/utils/error.d.ts +69 -36
- package/lib/utils/error.js +98 -43
- package/lib/utils/index.d.ts +30 -19
- package/lib/utils/index.js +47 -20
- package/lib/utils/jwt.d.ts +131 -0
- package/lib/utils/jwt.js +355 -0
- package/lib/utils/validator.d.ts +37 -37
- package/lib/utils/validator.js +37 -37
- package/package.json +126 -53
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2021 Google Inc.
|
|
4
4
|
*
|
|
@@ -14,10 +14,12 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
import { appCheck } from './app-check/app-check-namespace';
|
|
17
18
|
import { auth } from './auth/auth-namespace';
|
|
18
19
|
import { database } from './database/database-namespace';
|
|
19
20
|
import { firestore } from './firestore/firestore-namespace';
|
|
20
21
|
import { instanceId } from './instance-id/instance-id-namespace';
|
|
22
|
+
import { installations } from './installations/installations-namespace';
|
|
21
23
|
import { machineLearning } from './machine-learning/machine-learning-namespace';
|
|
22
24
|
import { messaging } from './messaging/messaging-namespace';
|
|
23
25
|
import { projectManagement } from './project-management/project-management-namespace';
|
|
@@ -25,22 +27,24 @@ import { remoteConfig } from './remote-config/remote-config-namespace';
|
|
|
25
27
|
import { securityRules } from './security-rules/security-rules-namespace';
|
|
26
28
|
import { storage } from './storage/storage-namespace';
|
|
27
29
|
import { App as AppCore, AppOptions } from './app/index';
|
|
28
|
-
export {
|
|
30
|
+
export { AppOptions, FirebaseError, FirebaseArrayIndexError } from './app/index';
|
|
29
31
|
export declare namespace app {
|
|
30
32
|
/**
|
|
31
33
|
* A Firebase app holds the initialization information for a collection of
|
|
32
34
|
* services.
|
|
33
35
|
*
|
|
34
36
|
* Do not call this constructor directly. Instead, use
|
|
35
|
-
* {@link
|
|
36
|
-
* https://firebase.google.com/docs/reference/admin/node/admin#.initializeApp
|
|
37
|
-
* `admin.initializeApp()`}
|
|
38
|
-
* to create an app.
|
|
37
|
+
* {@link firebase-admin.app#initializeApp} to create an app.
|
|
39
38
|
*/
|
|
40
39
|
interface App extends AppCore {
|
|
40
|
+
appCheck(): appCheck.AppCheck;
|
|
41
41
|
auth(): auth.Auth;
|
|
42
42
|
database(url?: string): database.Database;
|
|
43
43
|
firestore(): firestore.Firestore;
|
|
44
|
+
installations(): installations.Installations;
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated Use {@link firebase-admin.installations#Installations} instead.
|
|
47
|
+
*/
|
|
44
48
|
instanceId(): instanceId.InstanceId;
|
|
45
49
|
machineLearning(): machineLearning.MachineLearning;
|
|
46
50
|
messaging(): messaging.Messaging;
|
|
@@ -69,10 +73,12 @@ export declare namespace app {
|
|
|
69
73
|
}
|
|
70
74
|
}
|
|
71
75
|
export * from './credential/index';
|
|
76
|
+
export { appCheck } from './app-check/app-check-namespace';
|
|
72
77
|
export { auth } from './auth/auth-namespace';
|
|
73
78
|
export { database } from './database/database-namespace';
|
|
74
79
|
export { firestore } from './firestore/firestore-namespace';
|
|
75
80
|
export { instanceId } from './instance-id/instance-id-namespace';
|
|
81
|
+
export { installations } from './installations/installations-namespace';
|
|
76
82
|
export { machineLearning } from './machine-learning/machine-learning-namespace';
|
|
77
83
|
export { messaging } from './messaging/messaging-namespace';
|
|
78
84
|
export { projectManagement } from './project-management/project-management-namespace';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2021 Google Inc.
|
|
@@ -27,6 +27,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
__exportStar(require("./credential/index"), exports);
|
|
30
|
+
var app_check_namespace_1 = require("./app-check/app-check-namespace");
|
|
31
|
+
Object.defineProperty(exports, "appCheck", { enumerable: true, get: function () { return app_check_namespace_1.appCheck; } });
|
|
30
32
|
var auth_namespace_1 = require("./auth/auth-namespace");
|
|
31
33
|
Object.defineProperty(exports, "auth", { enumerable: true, get: function () { return auth_namespace_1.auth; } });
|
|
32
34
|
var database_namespace_1 = require("./database/database-namespace");
|
|
@@ -35,6 +37,8 @@ var firestore_namespace_1 = require("./firestore/firestore-namespace");
|
|
|
35
37
|
Object.defineProperty(exports, "firestore", { enumerable: true, get: function () { return firestore_namespace_1.firestore; } });
|
|
36
38
|
var instance_id_namespace_1 = require("./instance-id/instance-id-namespace");
|
|
37
39
|
Object.defineProperty(exports, "instanceId", { enumerable: true, get: function () { return instance_id_namespace_1.instanceId; } });
|
|
40
|
+
var installations_namespace_1 = require("./installations/installations-namespace");
|
|
41
|
+
Object.defineProperty(exports, "installations", { enumerable: true, get: function () { return installations_namespace_1.installations; } });
|
|
38
42
|
var machine_learning_namespace_1 = require("./machine-learning/machine-learning-namespace");
|
|
39
43
|
Object.defineProperty(exports, "machineLearning", { enumerable: true, get: function () { return machine_learning_namespace_1.machineLearning; } });
|
|
40
44
|
var messaging_namespace_1 = require("./messaging/messaging-namespace");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
/*!
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2017 Google Inc.
|
|
@@ -24,7 +24,7 @@ export declare class FirestoreService {
|
|
|
24
24
|
/**
|
|
25
25
|
* Returns the app associated with this Storage instance.
|
|
26
26
|
*
|
|
27
|
-
* @
|
|
27
|
+
* @returns The app associated with this Storage instance.
|
|
28
28
|
*/
|
|
29
29
|
get app(): App;
|
|
30
30
|
get client(): Firestore;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* @license
|
|
@@ -31,7 +31,7 @@ var FirestoreService = /** @class */ (function () {
|
|
|
31
31
|
/**
|
|
32
32
|
* Returns the app associated with this Storage instance.
|
|
33
33
|
*
|
|
34
|
-
* @
|
|
34
|
+
* @returns The app associated with this Storage instance.
|
|
35
35
|
*/
|
|
36
36
|
get: function () {
|
|
37
37
|
return this.appInternal;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2021 Google Inc.
|
|
4
4
|
*
|
|
@@ -22,8 +22,10 @@ export declare namespace firestore {
|
|
|
22
22
|
export import v1 = _firestore.v1;
|
|
23
23
|
export import BulkWriter = _firestore.BulkWriter;
|
|
24
24
|
export import BulkWriterOptions = _firestore.BulkWriterOptions;
|
|
25
|
+
export import BundleBuilder = _firestore.BundleBuilder;
|
|
25
26
|
export import CollectionGroup = _firestore.CollectionGroup;
|
|
26
27
|
export import CollectionReference = _firestore.CollectionReference;
|
|
28
|
+
export import DocumentChange = _firestore.DocumentChange;
|
|
27
29
|
export import DocumentChangeType = _firestore.DocumentChangeType;
|
|
28
30
|
export import DocumentData = _firestore.DocumentData;
|
|
29
31
|
export import DocumentReference = _firestore.DocumentReference;
|
|
@@ -34,6 +36,7 @@ export declare namespace firestore {
|
|
|
34
36
|
export import FirestoreDataConverter = _firestore.FirestoreDataConverter;
|
|
35
37
|
export import GeoPoint = _firestore.GeoPoint;
|
|
36
38
|
export import GrpcStatus = _firestore.GrpcStatus;
|
|
39
|
+
export import OrderByDirection = _firestore.OrderByDirection;
|
|
37
40
|
export import Precondition = _firestore.Precondition;
|
|
38
41
|
export import Query = _firestore.Query;
|
|
39
42
|
export import QueryDocumentSnapshot = _firestore.QueryDocumentSnapshot;
|
|
@@ -41,9 +44,11 @@ export declare namespace firestore {
|
|
|
41
44
|
export import QuerySnapshot = _firestore.QuerySnapshot;
|
|
42
45
|
export import ReadOptions = _firestore.ReadOptions;
|
|
43
46
|
export import Settings = _firestore.Settings;
|
|
47
|
+
export import SetOptions = _firestore.SetOptions;
|
|
44
48
|
export import Timestamp = _firestore.Timestamp;
|
|
45
49
|
export import Transaction = _firestore.Transaction;
|
|
46
50
|
export import UpdateData = _firestore.UpdateData;
|
|
51
|
+
export import WhereFilterOp = _firestore.WhereFilterOp;
|
|
47
52
|
export import WriteBatch = _firestore.WriteBatch;
|
|
48
53
|
export import WriteResult = _firestore.WriteResult;
|
|
49
54
|
export import setLogFunction = _firestore.setLogFunction;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2021 Google Inc.
|
|
@@ -26,6 +26,7 @@ var firestore;
|
|
|
26
26
|
firestore.v1beta1 = _firestore.v1beta1;
|
|
27
27
|
firestore.v1 = _firestore.v1;
|
|
28
28
|
firestore.BulkWriter = _firestore.BulkWriter;
|
|
29
|
+
firestore.BundleBuilder = _firestore.BundleBuilder;
|
|
29
30
|
firestore.CollectionGroup = _firestore.CollectionGroup;
|
|
30
31
|
firestore.CollectionReference = _firestore.CollectionReference;
|
|
31
32
|
firestore.DocumentReference = _firestore.DocumentReference;
|
package/lib/firestore/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2020 Google Inc.
|
|
4
4
|
*
|
|
@@ -14,7 +14,39 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Cloud Firestore.
|
|
19
|
+
*
|
|
20
|
+
* @packageDocumentation
|
|
21
|
+
*/
|
|
22
|
+
import { Firestore } from '@google-cloud/firestore';
|
|
18
23
|
import { App } from '../app';
|
|
19
|
-
export { BulkWriter, BulkWriterOptions, CollectionGroup, CollectionReference, DocumentChangeType, DocumentData, DocumentReference, DocumentSnapshot, FieldPath, FieldValue, Firestore, FirestoreDataConverter, GeoPoint, GrpcStatus, Precondition, Query, QueryDocumentSnapshot, QueryPartition, QuerySnapshot, ReadOptions, Settings, Timestamp, Transaction, UpdateData, WriteBatch, WriteResult, v1, setLogFunction, } from '@google-cloud/firestore';
|
|
20
|
-
|
|
24
|
+
export { BulkWriter, BulkWriterOptions, BundleBuilder, CollectionGroup, CollectionReference, DocumentChange, DocumentChangeType, DocumentData, DocumentReference, DocumentSnapshot, FieldPath, FieldValue, Firestore, FirestoreDataConverter, GeoPoint, GrpcStatus, OrderByDirection, Precondition, Query, QueryDocumentSnapshot, QueryPartition, QuerySnapshot, ReadOptions, Settings, SetOptions, Timestamp, Transaction, UpdateData, WhereFilterOp, WriteBatch, WriteResult, v1, setLogFunction, } from '@google-cloud/firestore';
|
|
25
|
+
/**
|
|
26
|
+
* Gets the {@link https://googleapis.dev/nodejs/firestore/latest/Firestore.html | Firestore}
|
|
27
|
+
* service for the default app or a given app.
|
|
28
|
+
*
|
|
29
|
+
* `getFirestore()` can be called with no arguments to access the default
|
|
30
|
+
* app's `Firestore` service or as `getFirestore(app)` to access the
|
|
31
|
+
* `Firestore` service associated with a specific app.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```javascript
|
|
35
|
+
* // Get the Firestore service for the default app
|
|
36
|
+
* const defaultFirestore = getFirestore();
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```javascript
|
|
41
|
+
* // Get the Firestore service for a specific app
|
|
42
|
+
* const otherFirestore = getFirestore(app);
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @param App - whose `Firestore` service to
|
|
46
|
+
* return. If not provided, the default `Firestore` service will be returned.
|
|
47
|
+
*
|
|
48
|
+
* @returns The default {@link https://googleapis.dev/nodejs/firestore/latest/Firestore.html | Firestore}
|
|
49
|
+
* service if no app is provided or the `Firestore` service associated with the
|
|
50
|
+
* provided app.
|
|
51
|
+
*/
|
|
52
|
+
export declare function getFirestore(app?: App): Firestore;
|
package/lib/firestore/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2020 Google Inc.
|
|
@@ -21,6 +21,7 @@ var app_1 = require("../app");
|
|
|
21
21
|
var firestore_internal_1 = require("./firestore-internal");
|
|
22
22
|
var firestore_1 = require("@google-cloud/firestore");
|
|
23
23
|
Object.defineProperty(exports, "BulkWriter", { enumerable: true, get: function () { return firestore_1.BulkWriter; } });
|
|
24
|
+
Object.defineProperty(exports, "BundleBuilder", { enumerable: true, get: function () { return firestore_1.BundleBuilder; } });
|
|
24
25
|
Object.defineProperty(exports, "CollectionGroup", { enumerable: true, get: function () { return firestore_1.CollectionGroup; } });
|
|
25
26
|
Object.defineProperty(exports, "CollectionReference", { enumerable: true, get: function () { return firestore_1.CollectionReference; } });
|
|
26
27
|
Object.defineProperty(exports, "DocumentReference", { enumerable: true, get: function () { return firestore_1.DocumentReference; } });
|
|
@@ -40,6 +41,33 @@ Object.defineProperty(exports, "WriteBatch", { enumerable: true, get: function (
|
|
|
40
41
|
Object.defineProperty(exports, "WriteResult", { enumerable: true, get: function () { return firestore_1.WriteResult; } });
|
|
41
42
|
Object.defineProperty(exports, "v1", { enumerable: true, get: function () { return firestore_1.v1; } });
|
|
42
43
|
Object.defineProperty(exports, "setLogFunction", { enumerable: true, get: function () { return firestore_1.setLogFunction; } });
|
|
44
|
+
/**
|
|
45
|
+
* Gets the {@link https://googleapis.dev/nodejs/firestore/latest/Firestore.html | Firestore}
|
|
46
|
+
* service for the default app or a given app.
|
|
47
|
+
*
|
|
48
|
+
* `getFirestore()` can be called with no arguments to access the default
|
|
49
|
+
* app's `Firestore` service or as `getFirestore(app)` to access the
|
|
50
|
+
* `Firestore` service associated with a specific app.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```javascript
|
|
54
|
+
* // Get the Firestore service for the default app
|
|
55
|
+
* const defaultFirestore = getFirestore();
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```javascript
|
|
60
|
+
* // Get the Firestore service for a specific app
|
|
61
|
+
* const otherFirestore = getFirestore(app);
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @param App - whose `Firestore` service to
|
|
65
|
+
* return. If not provided, the default `Firestore` service will be returned.
|
|
66
|
+
*
|
|
67
|
+
* @returns The default {@link https://googleapis.dev/nodejs/firestore/latest/Firestore.html | Firestore}
|
|
68
|
+
* service if no app is provided or the `Firestore` service associated with the
|
|
69
|
+
* provided app.
|
|
70
|
+
*/
|
|
43
71
|
function getFirestore(app) {
|
|
44
72
|
if (typeof app === 'undefined') {
|
|
45
73
|
app = app_1.getApp();
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright 2021 Google Inc.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Firebase Instance ID service.
|
|
19
|
+
*
|
|
20
|
+
* @packageDocumentation
|
|
21
|
+
*/
|
|
22
|
+
import { App } from '../app/index';
|
|
23
|
+
import { Installations } from './installations';
|
|
24
|
+
export { Installations };
|
|
25
|
+
/**
|
|
26
|
+
* Gets the {@link Installations} service for the default app or a given app.
|
|
27
|
+
*
|
|
28
|
+
* `getInstallations()` can be called with no arguments to access the default
|
|
29
|
+
* app's `Installations` service or as `getInstallations(app)` to access the
|
|
30
|
+
* `Installations` service associated with a specific app.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```javascript
|
|
34
|
+
* // Get the Installations service for the default app
|
|
35
|
+
* const defaultInstallations = getInstallations();
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```javascript
|
|
40
|
+
* // Get the Installations service for a given app
|
|
41
|
+
* const otherInstallations = getInstallations(otherApp);
|
|
42
|
+
*```
|
|
43
|
+
*
|
|
44
|
+
* @param app - Optional app whose `Installations` service to
|
|
45
|
+
* return. If not provided, the default `Installations` service will be
|
|
46
|
+
* returned.
|
|
47
|
+
*
|
|
48
|
+
* @returns The default `Installations` service if
|
|
49
|
+
* no app is provided or the `Installations` service associated with the
|
|
50
|
+
* provided app.
|
|
51
|
+
*/
|
|
52
|
+
export declare function getInstallations(app?: App): Installations;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
|
+
"use strict";
|
|
3
|
+
/*!
|
|
4
|
+
* Copyright 2021 Google Inc.
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.getInstallations = exports.Installations = void 0;
|
|
20
|
+
/**
|
|
21
|
+
* Firebase Instance ID service.
|
|
22
|
+
*
|
|
23
|
+
* @packageDocumentation
|
|
24
|
+
*/
|
|
25
|
+
var index_1 = require("../app/index");
|
|
26
|
+
var installations_1 = require("./installations");
|
|
27
|
+
Object.defineProperty(exports, "Installations", { enumerable: true, get: function () { return installations_1.Installations; } });
|
|
28
|
+
/**
|
|
29
|
+
* Gets the {@link Installations} service for the default app or a given app.
|
|
30
|
+
*
|
|
31
|
+
* `getInstallations()` can be called with no arguments to access the default
|
|
32
|
+
* app's `Installations` service or as `getInstallations(app)` to access the
|
|
33
|
+
* `Installations` service associated with a specific app.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```javascript
|
|
37
|
+
* // Get the Installations service for the default app
|
|
38
|
+
* const defaultInstallations = getInstallations();
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```javascript
|
|
43
|
+
* // Get the Installations service for a given app
|
|
44
|
+
* const otherInstallations = getInstallations(otherApp);
|
|
45
|
+
*```
|
|
46
|
+
*
|
|
47
|
+
* @param app - Optional app whose `Installations` service to
|
|
48
|
+
* return. If not provided, the default `Installations` service will be
|
|
49
|
+
* returned.
|
|
50
|
+
*
|
|
51
|
+
* @returns The default `Installations` service if
|
|
52
|
+
* no app is provided or the `Installations` service associated with the
|
|
53
|
+
* provided app.
|
|
54
|
+
*/
|
|
55
|
+
function getInstallations(app) {
|
|
56
|
+
if (typeof app === 'undefined') {
|
|
57
|
+
app = index_1.getApp();
|
|
58
|
+
}
|
|
59
|
+
var firebaseApp = app;
|
|
60
|
+
return firebaseApp.getOrInitService('installations', function (app) { return new installations_1.Installations(app); });
|
|
61
|
+
}
|
|
62
|
+
exports.getInstallations = getInstallations;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright 2021 Google Inc.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { App } from '../app/index';
|
|
18
|
+
import { Installations as TInstallations } from './installations';
|
|
19
|
+
/**
|
|
20
|
+
* Gets the {@link firebase-admin.installations#Installations} service for the
|
|
21
|
+
* default app or a given app.
|
|
22
|
+
*
|
|
23
|
+
* `admin.installations()` can be called with no arguments to access the default
|
|
24
|
+
* app's {@link firebase-admin.installations#Installations} service or as
|
|
25
|
+
* `admin.installations(app)` to access the
|
|
26
|
+
* {@link firebase-admin.installations#Installations} service associated with a
|
|
27
|
+
* specific app.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```javascript
|
|
31
|
+
* // Get the Installations service for the default app
|
|
32
|
+
* var defaultInstallations = admin.installations();
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```javascript
|
|
37
|
+
* // Get the Installations service for a given app
|
|
38
|
+
* var otherInstallations = admin.installations(otherApp);
|
|
39
|
+
*```
|
|
40
|
+
*
|
|
41
|
+
* @param app - Optional app whose `Installations` service to
|
|
42
|
+
* return. If not provided, the default `Installations` service is
|
|
43
|
+
* returned.
|
|
44
|
+
*
|
|
45
|
+
* @returns The default `Installations` service if
|
|
46
|
+
* no app is provided or the `Installations` service associated with the
|
|
47
|
+
* provided app.
|
|
48
|
+
*/
|
|
49
|
+
export declare function installations(app?: App): installations.Installations;
|
|
50
|
+
export declare namespace installations {
|
|
51
|
+
/**
|
|
52
|
+
* Type alias to {@link firebase-admin.installations#Installations}.
|
|
53
|
+
*/
|
|
54
|
+
type Installations = TInstallations;
|
|
55
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
|
+
"use strict";
|
|
3
|
+
/*!
|
|
4
|
+
* Copyright 2021 Google Inc.
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
/*!
|
|
3
3
|
* @license
|
|
4
|
-
* Copyright
|
|
4
|
+
* Copyright 2021 Google Inc.
|
|
5
5
|
*
|
|
6
6
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
* you may not use this file except in compliance with the License.
|
|
@@ -17,26 +17,26 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { App } from '../app/index';
|
|
19
19
|
/**
|
|
20
|
-
* Class that provides mechanism to send requests to the
|
|
20
|
+
* Class that provides mechanism to send requests to the FIS backend endpoints.
|
|
21
21
|
*/
|
|
22
|
-
export declare class
|
|
22
|
+
export declare class FirebaseInstallationsRequestHandler {
|
|
23
23
|
private readonly app;
|
|
24
24
|
private readonly host;
|
|
25
25
|
private readonly timeout;
|
|
26
26
|
private readonly httpClient;
|
|
27
27
|
private path;
|
|
28
28
|
/**
|
|
29
|
-
* @param app The app used to fetch access tokens to sign API requests.
|
|
29
|
+
* @param app - The app used to fetch access tokens to sign API requests.
|
|
30
30
|
*
|
|
31
31
|
* @constructor
|
|
32
32
|
*/
|
|
33
33
|
constructor(app: App);
|
|
34
|
-
|
|
34
|
+
deleteInstallation(fid: string): Promise<void>;
|
|
35
35
|
/**
|
|
36
36
|
* Invokes the request handler based on the API settings object passed.
|
|
37
37
|
*
|
|
38
|
-
* @param
|
|
39
|
-
* @
|
|
38
|
+
* @param apiSettings - The API endpoint settings to apply to request and response.
|
|
39
|
+
* @returns A promise that resolves when the request is complete.
|
|
40
40
|
*/
|
|
41
41
|
private invokeRequestHandler;
|
|
42
42
|
private getPathPrefix;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* @license
|
|
5
|
-
* Copyright
|
|
5
|
+
* Copyright 2021 Google Inc.
|
|
6
6
|
*
|
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
8
|
* you may not use this file except in compliance with the License.
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* limitations under the License.
|
|
18
18
|
*/
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.
|
|
20
|
+
exports.FirebaseInstallationsRequestHandler = void 0;
|
|
21
21
|
var error_1 = require("../utils/error");
|
|
22
22
|
var api_request_1 = require("../utils/api-request");
|
|
23
23
|
var utils = require("../utils/index");
|
|
@@ -30,43 +30,43 @@ var FIREBASE_IID_PATH = '/v1/';
|
|
|
30
30
|
var FIREBASE_IID_TIMEOUT = 10000;
|
|
31
31
|
/** HTTP error codes raised by the backend server. */
|
|
32
32
|
var ERROR_CODES = {
|
|
33
|
-
400: 'Malformed
|
|
33
|
+
400: 'Malformed installation ID argument.',
|
|
34
34
|
401: 'Request not authorized.',
|
|
35
|
-
403: 'Project does not match
|
|
36
|
-
404: 'Failed to find the
|
|
35
|
+
403: 'Project does not match installation ID or the client does not have sufficient privileges.',
|
|
36
|
+
404: 'Failed to find the installation ID.',
|
|
37
37
|
409: 'Already deleted.',
|
|
38
38
|
429: 'Request throttled out by the backend server.',
|
|
39
39
|
500: 'Internal server error.',
|
|
40
40
|
503: 'Backend servers are over capacity. Try again later.',
|
|
41
41
|
};
|
|
42
42
|
/**
|
|
43
|
-
* Class that provides mechanism to send requests to the
|
|
43
|
+
* Class that provides mechanism to send requests to the FIS backend endpoints.
|
|
44
44
|
*/
|
|
45
|
-
var
|
|
45
|
+
var FirebaseInstallationsRequestHandler = /** @class */ (function () {
|
|
46
46
|
/**
|
|
47
|
-
* @param app The app used to fetch access tokens to sign API requests.
|
|
47
|
+
* @param app - The app used to fetch access tokens to sign API requests.
|
|
48
48
|
*
|
|
49
49
|
* @constructor
|
|
50
50
|
*/
|
|
51
|
-
function
|
|
51
|
+
function FirebaseInstallationsRequestHandler(app) {
|
|
52
52
|
this.app = app;
|
|
53
53
|
this.host = FIREBASE_IID_HOST;
|
|
54
54
|
this.timeout = FIREBASE_IID_TIMEOUT;
|
|
55
55
|
this.httpClient = new api_request_1.AuthorizedHttpClient(app);
|
|
56
56
|
}
|
|
57
|
-
|
|
58
|
-
if (!validator.isNonEmptyString(
|
|
59
|
-
return Promise.reject(new error_1.
|
|
57
|
+
FirebaseInstallationsRequestHandler.prototype.deleteInstallation = function (fid) {
|
|
58
|
+
if (!validator.isNonEmptyString(fid)) {
|
|
59
|
+
return Promise.reject(new error_1.FirebaseInstallationsError(error_1.InstallationsClientErrorCode.INVALID_INSTALLATION_ID, 'Installation ID must be a non-empty string.'));
|
|
60
60
|
}
|
|
61
|
-
return this.invokeRequestHandler(new api_request_1.ApiSettings(
|
|
61
|
+
return this.invokeRequestHandler(new api_request_1.ApiSettings(fid, 'DELETE'));
|
|
62
62
|
};
|
|
63
63
|
/**
|
|
64
64
|
* Invokes the request handler based on the API settings object passed.
|
|
65
65
|
*
|
|
66
|
-
* @param
|
|
67
|
-
* @
|
|
66
|
+
* @param apiSettings - The API endpoint settings to apply to request and response.
|
|
67
|
+
* @returns A promise that resolves when the request is complete.
|
|
68
68
|
*/
|
|
69
|
-
|
|
69
|
+
FirebaseInstallationsRequestHandler.prototype.invokeRequestHandler = function (apiSettings) {
|
|
70
70
|
var _this = this;
|
|
71
71
|
return this.getPathPrefix()
|
|
72
72
|
.then(function (path) {
|
|
@@ -87,15 +87,15 @@ var FirebaseInstanceIdRequestHandler = /** @class */ (function () {
|
|
|
87
87
|
response.data.error : response.text;
|
|
88
88
|
var template = ERROR_CODES[response.status];
|
|
89
89
|
var message = template ?
|
|
90
|
-
"
|
|
91
|
-
throw new error_1.
|
|
90
|
+
"Installation ID \"" + apiSettings.getEndpoint() + "\": " + template : errorMessage;
|
|
91
|
+
throw new error_1.FirebaseInstallationsError(error_1.InstallationsClientErrorCode.API_ERROR, message);
|
|
92
92
|
}
|
|
93
93
|
// In case of timeouts and other network errors, the HttpClient returns a
|
|
94
94
|
// FirebaseError wrapped in the response. Simply throw it here.
|
|
95
95
|
throw err;
|
|
96
96
|
});
|
|
97
97
|
};
|
|
98
|
-
|
|
98
|
+
FirebaseInstallationsRequestHandler.prototype.getPathPrefix = function () {
|
|
99
99
|
var _this = this;
|
|
100
100
|
if (this.path) {
|
|
101
101
|
return Promise.resolve(this.path);
|
|
@@ -104,7 +104,7 @@ var FirebaseInstanceIdRequestHandler = /** @class */ (function () {
|
|
|
104
104
|
.then(function (projectId) {
|
|
105
105
|
if (!validator.isNonEmptyString(projectId)) {
|
|
106
106
|
// Assert for an explicit projct ID (either via AppOptions or the cert itself).
|
|
107
|
-
throw new error_1.
|
|
107
|
+
throw new error_1.FirebaseInstallationsError(error_1.InstallationsClientErrorCode.INVALID_PROJECT_ID, 'Failed to determine project ID for Installations. Initialize the '
|
|
108
108
|
+ 'SDK with service account credentials or set project ID as an app option. '
|
|
109
109
|
+ 'Alternatively set the GOOGLE_CLOUD_PROJECT environment variable.');
|
|
110
110
|
}
|
|
@@ -112,6 +112,6 @@ var FirebaseInstanceIdRequestHandler = /** @class */ (function () {
|
|
|
112
112
|
return _this.path;
|
|
113
113
|
});
|
|
114
114
|
};
|
|
115
|
-
return
|
|
115
|
+
return FirebaseInstallationsRequestHandler;
|
|
116
116
|
}());
|
|
117
|
-
exports.
|
|
117
|
+
exports.FirebaseInstallationsRequestHandler = FirebaseInstallationsRequestHandler;
|