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
package/lib/auth/base-auth.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2021 Google Inc.
|
|
4
4
|
*
|
|
@@ -21,7 +21,7 @@ import { UserRecord } from './user-record';
|
|
|
21
21
|
import { UserIdentifier } from './identifier';
|
|
22
22
|
import { UserImportOptions, UserImportRecord, UserImportResult } from './user-import-builder';
|
|
23
23
|
import { ActionCodeSettings } from './action-code-settings-builder';
|
|
24
|
-
/** Represents the result of the {@link
|
|
24
|
+
/** Represents the result of the {@link BaseAuth.getUsers} API. */
|
|
25
25
|
export interface GetUsersResult {
|
|
26
26
|
/**
|
|
27
27
|
* Set of user records, corresponding to the set of users that were
|
|
@@ -34,12 +34,12 @@ export interface GetUsersResult {
|
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
36
|
* Interface representing the object returned from a
|
|
37
|
-
* {@link
|
|
37
|
+
* {@link BaseAuth.listUsers} operation. Contains the list
|
|
38
38
|
* of users for the current batch and the next page token if available.
|
|
39
39
|
*/
|
|
40
40
|
export interface ListUsersResult {
|
|
41
41
|
/**
|
|
42
|
-
* The list of {@link
|
|
42
|
+
* The list of {@link UserRecord} objects for the
|
|
43
43
|
* current downloaded batch.
|
|
44
44
|
*/
|
|
45
45
|
users: UserRecord[];
|
|
@@ -49,8 +49,7 @@ export interface ListUsersResult {
|
|
|
49
49
|
pageToken?: string;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
|
-
* Represents the result of the
|
|
53
|
-
* {@link auth.Auth.deleteUsers `deleteUsers()`}
|
|
52
|
+
* Represents the result of the {@link BaseAuth.deleteUsers}.
|
|
54
53
|
* API.
|
|
55
54
|
*/
|
|
56
55
|
export interface DeleteUsersResult {
|
|
@@ -67,13 +66,13 @@ export interface DeleteUsersResult {
|
|
|
67
66
|
/**
|
|
68
67
|
* A list of `FirebaseArrayIndexError` instances describing the errors that
|
|
69
68
|
* were encountered during the deletion. Length of this list is equal to
|
|
70
|
-
* the return value of
|
|
69
|
+
* the return value of {@link DeleteUsersResult.failureCount}.
|
|
71
70
|
*/
|
|
72
71
|
errors: FirebaseArrayIndexError[];
|
|
73
72
|
}
|
|
74
73
|
/**
|
|
75
74
|
* Interface representing the session cookie options needed for the
|
|
76
|
-
* {@link
|
|
75
|
+
* {@link BaseAuth.createSessionCookie} method.
|
|
77
76
|
*/
|
|
78
77
|
export interface SessionCookieOptions {
|
|
79
78
|
/**
|
|
@@ -92,14 +91,14 @@ export declare abstract class BaseAuth {
|
|
|
92
91
|
* methods. (Tenant-aware instances will also embed the tenant ID in the
|
|
93
92
|
* token.)
|
|
94
93
|
*
|
|
95
|
-
* See
|
|
96
|
-
* samples and detailed documentation.
|
|
94
|
+
* See {@link https://firebase.google.com/docs/auth/admin/create-custom-tokens | Create Custom Tokens}
|
|
95
|
+
* for code samples and detailed documentation.
|
|
97
96
|
*
|
|
98
|
-
* @param uid The `uid` to use as the custom token's subject.
|
|
99
|
-
* @param developerClaims Optional additional claims to include
|
|
97
|
+
* @param uid - The `uid` to use as the custom token's subject.
|
|
98
|
+
* @param developerClaims - Optional additional claims to include
|
|
100
99
|
* in the custom token's payload.
|
|
101
100
|
*
|
|
102
|
-
* @
|
|
101
|
+
* @returns A promise fulfilled with a custom token for the
|
|
103
102
|
* provided `uid` and payload.
|
|
104
103
|
*/
|
|
105
104
|
createCustomToken(uid: string, developerClaims?: object): Promise<string>;
|
|
@@ -107,19 +106,23 @@ export declare abstract class BaseAuth {
|
|
|
107
106
|
* Verifies a Firebase ID token (JWT). If the token is valid, the promise is
|
|
108
107
|
* fulfilled with the token's decoded claims; otherwise, the promise is
|
|
109
108
|
* rejected.
|
|
110
|
-
* An optional flag can be passed to additionally check whether the ID token
|
|
111
|
-
* was revoked.
|
|
112
109
|
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
110
|
+
* If `checkRevoked` is set to true, first verifies whether the corresponding
|
|
111
|
+
* user is disabled. If yes, an `auth/user-disabled` error is thrown. If no,
|
|
112
|
+
* verifies if the session corresponding to the ID token was revoked. If the
|
|
113
|
+
* corresponding user's session was invalidated, an `auth/id-token-revoked`
|
|
114
|
+
* error is thrown. If not specified the check is not applied.
|
|
115
|
+
*
|
|
116
|
+
* See {@link https://firebase.google.com/docs/auth/admin/verify-id-tokens | Verify ID Tokens}
|
|
117
|
+
* for code samples and detailed documentation.
|
|
115
118
|
*
|
|
116
|
-
* @param idToken The ID token to verify.
|
|
117
|
-
* @param checkRevoked Whether to check if the ID token was revoked.
|
|
119
|
+
* @param idToken - The ID token to verify.
|
|
120
|
+
* @param checkRevoked - Whether to check if the ID token was revoked.
|
|
118
121
|
* This requires an extra request to the Firebase Auth backend to check
|
|
119
122
|
* the `tokensValidAfterTime` time for the corresponding user.
|
|
120
123
|
* When not specified, this additional check is not applied.
|
|
121
124
|
*
|
|
122
|
-
* @
|
|
125
|
+
* @returns A promise fulfilled with the
|
|
123
126
|
* token's decoded claims if the ID token is valid; otherwise, a rejected
|
|
124
127
|
* promise.
|
|
125
128
|
*/
|
|
@@ -127,25 +130,25 @@ export declare abstract class BaseAuth {
|
|
|
127
130
|
/**
|
|
128
131
|
* Gets the user data for the user corresponding to a given `uid`.
|
|
129
132
|
*
|
|
130
|
-
* See
|
|
133
|
+
* See {@link https://firebase.google.com/docs/auth/admin/manage-users#retrieve_user_data | Retrieve user data}
|
|
131
134
|
* for code samples and detailed documentation.
|
|
132
135
|
*
|
|
133
|
-
* @param uid The `uid` corresponding to the user whose data to fetch.
|
|
136
|
+
* @param uid - The `uid` corresponding to the user whose data to fetch.
|
|
134
137
|
*
|
|
135
|
-
* @
|
|
138
|
+
* @returns A promise fulfilled with the user
|
|
136
139
|
* data corresponding to the provided `uid`.
|
|
137
140
|
*/
|
|
138
141
|
getUser(uid: string): Promise<UserRecord>;
|
|
139
142
|
/**
|
|
140
143
|
* Gets the user data for the user corresponding to a given email.
|
|
141
144
|
*
|
|
142
|
-
* See
|
|
145
|
+
* See {@link https://firebase.google.com/docs/auth/admin/manage-users#retrieve_user_data | Retrieve user data}
|
|
143
146
|
* for code samples and detailed documentation.
|
|
144
147
|
*
|
|
145
|
-
* @param email The email corresponding to the user whose data to
|
|
148
|
+
* @param email - The email corresponding to the user whose data to
|
|
146
149
|
* fetch.
|
|
147
150
|
*
|
|
148
|
-
* @
|
|
151
|
+
* @returns A promise fulfilled with the user
|
|
149
152
|
* data corresponding to the provided email.
|
|
150
153
|
*/
|
|
151
154
|
getUserByEmail(email: string): Promise<UserRecord>;
|
|
@@ -153,16 +156,30 @@ export declare abstract class BaseAuth {
|
|
|
153
156
|
* Gets the user data for the user corresponding to a given phone number. The
|
|
154
157
|
* phone number has to conform to the E.164 specification.
|
|
155
158
|
*
|
|
156
|
-
* See
|
|
159
|
+
* See {@link https://firebase.google.com/docs/auth/admin/manage-users#retrieve_user_data | Retrieve user data}
|
|
157
160
|
* for code samples and detailed documentation.
|
|
158
161
|
*
|
|
159
|
-
* @param phoneNumber The phone number corresponding to the user whose
|
|
162
|
+
* @param phoneNumber - The phone number corresponding to the user whose
|
|
160
163
|
* data to fetch.
|
|
161
164
|
*
|
|
162
|
-
* @
|
|
165
|
+
* @returns A promise fulfilled with the user
|
|
163
166
|
* data corresponding to the provided phone number.
|
|
164
167
|
*/
|
|
165
168
|
getUserByPhoneNumber(phoneNumber: string): Promise<UserRecord>;
|
|
169
|
+
/**
|
|
170
|
+
* Gets the user data for the user corresponding to a given provider id.
|
|
171
|
+
*
|
|
172
|
+
* See {@link https://firebase.google.com/docs/auth/admin/manage-users#retrieve_user_data | Retrieve user data}
|
|
173
|
+
* for code samples and detailed documentation.
|
|
174
|
+
*
|
|
175
|
+
* @param providerId - The provider ID, for example, "google.com" for the
|
|
176
|
+
* Google provider.
|
|
177
|
+
* @param uid - The user identifier for the given provider.
|
|
178
|
+
*
|
|
179
|
+
* @returns A promise fulfilled with the user data corresponding to the
|
|
180
|
+
* given provider id.
|
|
181
|
+
*/
|
|
182
|
+
getUserByProviderUid(providerId: string, uid: string): Promise<UserRecord>;
|
|
166
183
|
/**
|
|
167
184
|
* Gets the user data corresponding to the specified identifiers.
|
|
168
185
|
*
|
|
@@ -172,9 +189,9 @@ export declare abstract class BaseAuth {
|
|
|
172
189
|
* Only a maximum of 100 identifiers may be supplied. If more than 100 identifiers are supplied,
|
|
173
190
|
* this method throws a FirebaseAuthError.
|
|
174
191
|
*
|
|
175
|
-
* @param identifiers The identifiers used to indicate which user records should be returned.
|
|
176
|
-
* Must have
|
|
177
|
-
* @
|
|
192
|
+
* @param identifiers - The identifiers used to indicate which user records should be returned.
|
|
193
|
+
* Must not have more than 100 entries.
|
|
194
|
+
* @returns A promise that resolves to the corresponding user records.
|
|
178
195
|
* @throws FirebaseAuthError If any of the identifiers are invalid or if more than 100
|
|
179
196
|
* identifiers are specified.
|
|
180
197
|
*/
|
|
@@ -184,39 +201,39 @@ export declare abstract class BaseAuth {
|
|
|
184
201
|
* starting from the offset as specified by `pageToken`. This is used to
|
|
185
202
|
* retrieve all the users of a specified project in batches.
|
|
186
203
|
*
|
|
187
|
-
* See
|
|
204
|
+
* See {@link https://firebase.google.com/docs/auth/admin/manage-users#list_all_users | List all users}
|
|
188
205
|
* for code samples and detailed documentation.
|
|
189
206
|
*
|
|
190
|
-
* @param maxResults The page size, 1000 if undefined. This is also
|
|
207
|
+
* @param maxResults - The page size, 1000 if undefined. This is also
|
|
191
208
|
* the maximum allowed limit.
|
|
192
|
-
* @param pageToken The next page token. If not specified, returns
|
|
209
|
+
* @param pageToken - The next page token. If not specified, returns
|
|
193
210
|
* users starting without any offset.
|
|
194
|
-
* @
|
|
211
|
+
* @returns A promise that resolves with
|
|
195
212
|
* the current batch of downloaded users and the next page token.
|
|
196
213
|
*/
|
|
197
214
|
listUsers(maxResults?: number, pageToken?: string): Promise<ListUsersResult>;
|
|
198
215
|
/**
|
|
199
216
|
* Creates a new user.
|
|
200
217
|
*
|
|
201
|
-
* See
|
|
202
|
-
* samples and detailed documentation.
|
|
218
|
+
* See {@link https://firebase.google.com/docs/auth/admin/manage-users#create_a_user | Create a user}
|
|
219
|
+
* for code samples and detailed documentation.
|
|
203
220
|
*
|
|
204
|
-
* @param properties The properties to set on the
|
|
221
|
+
* @param properties - The properties to set on the
|
|
205
222
|
* new user record to be created.
|
|
206
223
|
*
|
|
207
|
-
* @
|
|
224
|
+
* @returns A promise fulfilled with the user
|
|
208
225
|
* data corresponding to the newly created user.
|
|
209
226
|
*/
|
|
210
227
|
createUser(properties: CreateRequest): Promise<UserRecord>;
|
|
211
228
|
/**
|
|
212
229
|
* Deletes an existing user.
|
|
213
230
|
*
|
|
214
|
-
* See
|
|
215
|
-
* samples and detailed documentation.
|
|
231
|
+
* See {@link https://firebase.google.com/docs/auth/admin/manage-users#delete_a_user | Delete a user}
|
|
232
|
+
* for code samples and detailed documentation.
|
|
216
233
|
*
|
|
217
|
-
* @param uid The `uid` corresponding to the user to delete.
|
|
234
|
+
* @param uid - The `uid` corresponding to the user to delete.
|
|
218
235
|
*
|
|
219
|
-
* @
|
|
236
|
+
* @returns An empty promise fulfilled once the user has been
|
|
220
237
|
* deleted.
|
|
221
238
|
*/
|
|
222
239
|
deleteUser(uid: string): Promise<void>;
|
|
@@ -236,9 +253,9 @@ export declare abstract class BaseAuth {
|
|
|
236
253
|
* delete more than 1000 users, you may need to add a delay to ensure you
|
|
237
254
|
* don't go over this limit.
|
|
238
255
|
*
|
|
239
|
-
* @param uids The `uids` corresponding to the users to delete.
|
|
256
|
+
* @param uids - The `uids` corresponding to the users to delete.
|
|
240
257
|
*
|
|
241
|
-
* @
|
|
258
|
+
* @returns A Promise that resolves to the total number of successful/failed
|
|
242
259
|
* deletions, as well as the array of errors that corresponds to the
|
|
243
260
|
* failed deletions.
|
|
244
261
|
*/
|
|
@@ -246,14 +263,14 @@ export declare abstract class BaseAuth {
|
|
|
246
263
|
/**
|
|
247
264
|
* Updates an existing user.
|
|
248
265
|
*
|
|
249
|
-
* See
|
|
250
|
-
* samples and detailed documentation.
|
|
266
|
+
* See {@link https://firebase.google.com/docs/auth/admin/manage-users#update_a_user | Update a user}
|
|
267
|
+
* for code samples and detailed documentation.
|
|
251
268
|
*
|
|
252
|
-
* @param uid The `uid` corresponding to the user to update.
|
|
253
|
-
* @param properties The properties to update on
|
|
269
|
+
* @param uid - The `uid` corresponding to the user to update.
|
|
270
|
+
* @param properties - The properties to update on
|
|
254
271
|
* the provided user.
|
|
255
272
|
*
|
|
256
|
-
* @
|
|
273
|
+
* @returns A promise fulfilled with the
|
|
257
274
|
* updated user data.
|
|
258
275
|
*/
|
|
259
276
|
updateUser(uid: string, properties: UpdateRequest): Promise<UserRecord>;
|
|
@@ -266,40 +283,38 @@ export declare abstract class BaseAuth {
|
|
|
266
283
|
* is used (sub, iat, iss, etc), an error is thrown. They are set on the
|
|
267
284
|
* authenticated user's ID token JWT.
|
|
268
285
|
*
|
|
269
|
-
* See
|
|
270
|
-
*
|
|
286
|
+
* See {@link https://firebase.google.com/docs/auth/admin/custom-claims |
|
|
287
|
+
* Defining user roles and access levels}
|
|
271
288
|
* for code samples and detailed documentation.
|
|
272
289
|
*
|
|
273
|
-
* @param uid The `uid` of the user to edit.
|
|
274
|
-
* @param customUserClaims The developer claims to set. If null is
|
|
290
|
+
* @param uid - The `uid` of the user to edit.
|
|
291
|
+
* @param customUserClaims - The developer claims to set. If null is
|
|
275
292
|
* passed, existing custom claims are deleted. Passing a custom claims payload
|
|
276
293
|
* larger than 1000 bytes will throw an error. Custom claims are added to the
|
|
277
294
|
* user's ID token which is transmitted on every authenticated request.
|
|
278
295
|
* For profile non-access related user attributes, use database or other
|
|
279
296
|
* separate storage systems.
|
|
280
|
-
* @
|
|
297
|
+
* @returns A promise that resolves when the operation completes
|
|
281
298
|
* successfully.
|
|
282
299
|
*/
|
|
283
300
|
setCustomUserClaims(uid: string, customUserClaims: object | null): Promise<void>;
|
|
284
301
|
/**
|
|
285
302
|
* Revokes all refresh tokens for an existing user.
|
|
286
303
|
*
|
|
287
|
-
* This API will update the user's
|
|
288
|
-
* {@link auth.UserRecord.tokensValidAfterTime `tokensValidAfterTime`} to
|
|
304
|
+
* This API will update the user's {@link UserRecord.tokensValidAfterTime} to
|
|
289
305
|
* the current UTC. It is important that the server on which this is called has
|
|
290
306
|
* its clock set correctly and synchronized.
|
|
291
307
|
*
|
|
292
308
|
* While this will revoke all sessions for a specified user and disable any
|
|
293
309
|
* new ID tokens for existing sessions from getting minted, existing ID tokens
|
|
294
310
|
* may remain active until their natural expiration (one hour). To verify that
|
|
295
|
-
* ID tokens are revoked, use
|
|
296
|
-
* {@link auth.Auth.verifyIdToken `verifyIdToken(idToken, true)`}
|
|
311
|
+
* ID tokens are revoked, use {@link BaseAuth.verifyIdToken}
|
|
297
312
|
* where `checkRevoked` is set to true.
|
|
298
313
|
*
|
|
299
|
-
* @param uid The `uid` corresponding to the user whose refresh tokens
|
|
314
|
+
* @param uid - The `uid` corresponding to the user whose refresh tokens
|
|
300
315
|
* are to be revoked.
|
|
301
316
|
*
|
|
302
|
-
* @
|
|
317
|
+
* @returns An empty promise fulfilled once the user's refresh
|
|
303
318
|
* tokens have been revoked.
|
|
304
319
|
*/
|
|
305
320
|
revokeRefreshTokens(uid: string): Promise<void>;
|
|
@@ -307,15 +322,15 @@ export declare abstract class BaseAuth {
|
|
|
307
322
|
* Imports the provided list of users into Firebase Auth.
|
|
308
323
|
* A maximum of 1000 users are allowed to be imported one at a time.
|
|
309
324
|
* When importing users with passwords,
|
|
310
|
-
* {@link
|
|
325
|
+
* {@link UserImportOptions} are required to be
|
|
311
326
|
* specified.
|
|
312
327
|
* This operation is optimized for bulk imports and will ignore checks on `uid`,
|
|
313
328
|
* `email` and other identifier uniqueness which could result in duplications.
|
|
314
329
|
*
|
|
315
|
-
* @param users The list of user records to import to Firebase Auth.
|
|
316
|
-
* @param options The user import options, required when the users provided include
|
|
330
|
+
* @param users - The list of user records to import to Firebase Auth.
|
|
331
|
+
* @param options - The user import options, required when the users provided include
|
|
317
332
|
* password credentials.
|
|
318
|
-
* @
|
|
333
|
+
* @returns A promise that resolves when
|
|
319
334
|
* the operation completes with the result of the import. This includes the
|
|
320
335
|
* number of successful imports, the number of failed imports and their
|
|
321
336
|
* corresponding errors.
|
|
@@ -327,36 +342,40 @@ export declare abstract class BaseAuth {
|
|
|
327
342
|
* policy, and be used for session management. The session cookie JWT will have
|
|
328
343
|
* the same payload claims as the provided ID token.
|
|
329
344
|
*
|
|
330
|
-
* See
|
|
331
|
-
* samples and detailed documentation.
|
|
345
|
+
* See {@link https://firebase.google.com/docs/auth/admin/manage-cookies | Manage Session Cookies}
|
|
346
|
+
* for code samples and detailed documentation.
|
|
332
347
|
*
|
|
333
|
-
* @param idToken The Firebase ID token to exchange for a session
|
|
348
|
+
* @param idToken - The Firebase ID token to exchange for a session
|
|
334
349
|
* cookie.
|
|
335
|
-
* @param sessionCookieOptions The session
|
|
350
|
+
* @param sessionCookieOptions - The session
|
|
336
351
|
* cookie options which includes custom session duration.
|
|
337
352
|
*
|
|
338
|
-
* @
|
|
353
|
+
* @returns A promise that resolves on success with the
|
|
339
354
|
* created session cookie.
|
|
340
355
|
*/
|
|
341
356
|
createSessionCookie(idToken: string, sessionCookieOptions: SessionCookieOptions): Promise<string>;
|
|
342
357
|
/**
|
|
343
358
|
* Verifies a Firebase session cookie. Returns a Promise with the cookie claims.
|
|
344
|
-
* Rejects the promise if the cookie could not be verified.
|
|
345
|
-
*
|
|
346
|
-
*
|
|
347
|
-
* `auth/
|
|
348
|
-
*
|
|
359
|
+
* Rejects the promise if the cookie could not be verified.
|
|
360
|
+
*
|
|
361
|
+
* If `checkRevoked` is set to true, first verifies whether the corresponding
|
|
362
|
+
* user is disabled: If yes, an `auth/user-disabled` error is thrown. If no,
|
|
363
|
+
* verifies if the session corresponding to the session cookie was revoked.
|
|
364
|
+
* If the corresponding user's session was invalidated, an
|
|
365
|
+
* `auth/session-cookie-revoked` error is thrown. If not specified the check
|
|
366
|
+
* is not performed.
|
|
349
367
|
*
|
|
350
|
-
* See
|
|
368
|
+
* See {@link https://firebase.google.com/docs/auth/admin/manage-cookies#verify_session_cookie_and_check_permissions |
|
|
369
|
+
* Verify Session Cookies}
|
|
351
370
|
* for code samples and detailed documentation
|
|
352
371
|
*
|
|
353
|
-
* @param sessionCookie The session cookie to verify.
|
|
354
|
-
* @param checkForRevocation Whether to check if the session cookie was
|
|
372
|
+
* @param sessionCookie - The session cookie to verify.
|
|
373
|
+
* @param checkForRevocation - Whether to check if the session cookie was
|
|
355
374
|
* revoked. This requires an extra request to the Firebase Auth backend to
|
|
356
375
|
* check the `tokensValidAfterTime` time for the corresponding user.
|
|
357
376
|
* When not specified, this additional check is not performed.
|
|
358
377
|
*
|
|
359
|
-
* @
|
|
378
|
+
* @returns A promise fulfilled with the
|
|
360
379
|
* session cookie's decoded claims if the session cookie is valid; otherwise,
|
|
361
380
|
* a rejected promise.
|
|
362
381
|
*/
|
|
@@ -364,7 +383,7 @@ export declare abstract class BaseAuth {
|
|
|
364
383
|
/**
|
|
365
384
|
* Generates the out of band email action link to reset a user's password.
|
|
366
385
|
* The link is generated for the user with the specified email address. The
|
|
367
|
-
* optional {@link
|
|
386
|
+
* optional {@link ActionCodeSettings} object
|
|
368
387
|
* defines whether the link is to be handled by a mobile app or browser and the
|
|
369
388
|
* additional state information to be passed in the deep link, etc.
|
|
370
389
|
*
|
|
@@ -393,9 +412,9 @@ export declare abstract class BaseAuth {
|
|
|
393
412
|
* });
|
|
394
413
|
* ```
|
|
395
414
|
*
|
|
396
|
-
* @param email The email address of the user whose password is to be
|
|
415
|
+
* @param email - The email address of the user whose password is to be
|
|
397
416
|
* reset.
|
|
398
|
-
* @param actionCodeSettings The action
|
|
417
|
+
* @param actionCodeSettings - The action
|
|
399
418
|
* code settings. If specified, the state/continue URL is set as the
|
|
400
419
|
* "continueUrl" parameter in the password reset link. The default password
|
|
401
420
|
* reset landing page will use this to display a link to go back to the app
|
|
@@ -408,13 +427,12 @@ export declare abstract class BaseAuth {
|
|
|
408
427
|
* and accepts the Firebase Dynamic Links terms of service.
|
|
409
428
|
* The Android package name and iOS bundle ID are respected only if they
|
|
410
429
|
* are configured in the same Firebase Auth project.
|
|
411
|
-
* @
|
|
430
|
+
* @returns A promise that resolves with the generated link.
|
|
412
431
|
*/
|
|
413
432
|
generatePasswordResetLink(email: string, actionCodeSettings?: ActionCodeSettings): Promise<string>;
|
|
414
433
|
/**
|
|
415
434
|
* Generates the out of band email action link to verify the user's ownership
|
|
416
|
-
* of the specified email. The
|
|
417
|
-
* {@link auth.ActionCodeSettings `ActionCodeSettings`} object provided
|
|
435
|
+
* of the specified email. The {@link ActionCodeSettings} object provided
|
|
418
436
|
* as an argument to this method defines whether the link is to be handled by a
|
|
419
437
|
* mobile app or browser along with additional state information to be passed in
|
|
420
438
|
* the deep link, etc.
|
|
@@ -444,8 +462,8 @@ export declare abstract class BaseAuth {
|
|
|
444
462
|
* });
|
|
445
463
|
* ```
|
|
446
464
|
*
|
|
447
|
-
* @param email The email account to verify.
|
|
448
|
-
* @param actionCodeSettings The action
|
|
465
|
+
* @param email - The email account to verify.
|
|
466
|
+
* @param actionCodeSettings - The action
|
|
449
467
|
* code settings. If specified, the state/continue URL is set as the
|
|
450
468
|
* "continueUrl" parameter in the email verification link. The default email
|
|
451
469
|
* verification landing page will use this to display a link to go back to
|
|
@@ -458,13 +476,12 @@ export declare abstract class BaseAuth {
|
|
|
458
476
|
* and accepts the Firebase Dynamic Links terms of service.
|
|
459
477
|
* The Android package name and iOS bundle ID are respected only if they
|
|
460
478
|
* are configured in the same Firebase Auth project.
|
|
461
|
-
* @
|
|
479
|
+
* @returns A promise that resolves with the generated link.
|
|
462
480
|
*/
|
|
463
481
|
generateEmailVerificationLink(email: string, actionCodeSettings?: ActionCodeSettings): Promise<string>;
|
|
464
482
|
/**
|
|
465
483
|
* Generates the out of band email action link to verify the user's ownership
|
|
466
|
-
* of the specified email. The
|
|
467
|
-
* {@link auth.ActionCodeSettings `ActionCodeSettings`} object provided
|
|
484
|
+
* of the specified email. The {@link ActionCodeSettings} object provided
|
|
468
485
|
* as an argument to this method defines whether the link is to be handled by a
|
|
469
486
|
* mobile app or browser along with additional state information to be passed in
|
|
470
487
|
* the deep link, etc.
|
|
@@ -494,8 +511,8 @@ export declare abstract class BaseAuth {
|
|
|
494
511
|
* });
|
|
495
512
|
* ```
|
|
496
513
|
*
|
|
497
|
-
* @param email The email account to verify.
|
|
498
|
-
* @param actionCodeSettings The action
|
|
514
|
+
* @param email - The email account to verify.
|
|
515
|
+
* @param actionCodeSettings - The action
|
|
499
516
|
* code settings. If specified, the state/continue URL is set as the
|
|
500
517
|
* "continueUrl" parameter in the email verification link. The default email
|
|
501
518
|
* verification landing page will use this to display a link to go back to
|
|
@@ -508,7 +525,7 @@ export declare abstract class BaseAuth {
|
|
|
508
525
|
* and accepts the Firebase Dynamic Links terms of service.
|
|
509
526
|
* The Android package name and iOS bundle ID are respected only if they
|
|
510
527
|
* are configured in the same Firebase Auth project.
|
|
511
|
-
* @
|
|
528
|
+
* @returns A promise that resolves with the generated link.
|
|
512
529
|
*/
|
|
513
530
|
generateSignInWithEmailLink(email: string, actionCodeSettings: ActionCodeSettings): Promise<string>;
|
|
514
531
|
/**
|
|
@@ -517,10 +534,10 @@ export declare abstract class BaseAuth {
|
|
|
517
534
|
*
|
|
518
535
|
* SAML and OIDC provider support requires Google Cloud's Identity Platform
|
|
519
536
|
* (GCIP). To learn more about GCIP, including pricing and features,
|
|
520
|
-
* see the
|
|
537
|
+
* see the {@link https://cloud.google.com/identity-platform | GCIP documentation}.
|
|
521
538
|
*
|
|
522
|
-
* @param options The provider config filter to apply.
|
|
523
|
-
* @
|
|
539
|
+
* @param options - The provider config filter to apply.
|
|
540
|
+
* @returns A promise that resolves with the list of provider configs meeting the
|
|
524
541
|
* filter requirements.
|
|
525
542
|
*/
|
|
526
543
|
listProviderConfigs(options: AuthProviderConfigFilter): Promise<ListProviderConfigResults>;
|
|
@@ -532,11 +549,11 @@ export declare abstract class BaseAuth {
|
|
|
532
549
|
*
|
|
533
550
|
* SAML and OIDC provider support requires Google Cloud's Identity Platform
|
|
534
551
|
* (GCIP). To learn more about GCIP, including pricing and features,
|
|
535
|
-
* see the
|
|
552
|
+
* see the {@link https://cloud.google.com/identity-platform | GCIP documentation}.
|
|
536
553
|
*
|
|
537
|
-
* @param providerId The provider ID corresponding to the provider
|
|
554
|
+
* @param providerId - The provider ID corresponding to the provider
|
|
538
555
|
* config to return.
|
|
539
|
-
* @
|
|
556
|
+
* @returns A promise that resolves
|
|
540
557
|
* with the configuration corresponding to the provided ID.
|
|
541
558
|
*/
|
|
542
559
|
getProviderConfig(providerId: string): Promise<AuthProviderConfig>;
|
|
@@ -547,11 +564,11 @@ export declare abstract class BaseAuth {
|
|
|
547
564
|
*
|
|
548
565
|
* SAML and OIDC provider support requires Google Cloud's Identity Platform
|
|
549
566
|
* (GCIP). To learn more about GCIP, including pricing and features,
|
|
550
|
-
* see the
|
|
567
|
+
* see the {@link https://cloud.google.com/identity-platform | GCIP documentation}.
|
|
551
568
|
*
|
|
552
|
-
* @param providerId The provider ID corresponding to the provider
|
|
569
|
+
* @param providerId - The provider ID corresponding to the provider
|
|
553
570
|
* config to delete.
|
|
554
|
-
* @
|
|
571
|
+
* @returns A promise that resolves on completion.
|
|
555
572
|
*/
|
|
556
573
|
deleteProviderConfig(providerId: string): Promise<void>;
|
|
557
574
|
/**
|
|
@@ -562,12 +579,12 @@ export declare abstract class BaseAuth {
|
|
|
562
579
|
*
|
|
563
580
|
* SAML and OIDC provider support requires Google Cloud's Identity Platform
|
|
564
581
|
* (GCIP). To learn more about GCIP, including pricing and features,
|
|
565
|
-
* see the
|
|
582
|
+
* see the {@link https://cloud.google.com/identity-platform | GCIP documentation}.
|
|
566
583
|
*
|
|
567
|
-
* @param providerId The provider ID corresponding to the provider
|
|
584
|
+
* @param providerId - The provider ID corresponding to the provider
|
|
568
585
|
* config to update.
|
|
569
|
-
* @param updatedConfig The updated configuration.
|
|
570
|
-
* @
|
|
586
|
+
* @param updatedConfig - The updated configuration.
|
|
587
|
+
* @returns A promise that resolves with the updated provider configuration.
|
|
571
588
|
*/
|
|
572
589
|
updateProviderConfig(providerId: string, updatedConfig: UpdateAuthProviderRequest): Promise<AuthProviderConfig>;
|
|
573
590
|
/**
|
|
@@ -576,20 +593,21 @@ export declare abstract class BaseAuth {
|
|
|
576
593
|
*
|
|
577
594
|
* SAML and OIDC provider support requires Google Cloud's Identity Platform
|
|
578
595
|
* (GCIP). To learn more about GCIP, including pricing and features,
|
|
579
|
-
* see the
|
|
596
|
+
* see the {@link https://cloud.google.com/identity-platform | GCIP documentation}.
|
|
580
597
|
*
|
|
581
|
-
* @param config The provider configuration to create.
|
|
582
|
-
* @
|
|
598
|
+
* @param config - The provider configuration to create.
|
|
599
|
+
* @returns A promise that resolves with the created provider configuration.
|
|
583
600
|
*/
|
|
584
601
|
createProviderConfig(config: AuthProviderConfig): Promise<AuthProviderConfig>;
|
|
585
602
|
/**
|
|
586
|
-
* Verifies the decoded Firebase issued JWT is not revoked. Returns a promise that
|
|
587
|
-
* with the decoded claims on success. Rejects the promise with revocation error if revoked
|
|
603
|
+
* Verifies the decoded Firebase issued JWT is not revoked or disabled. Returns a promise that
|
|
604
|
+
* resolves with the decoded claims on success. Rejects the promise with revocation error if revoked
|
|
605
|
+
* or user disabled.
|
|
588
606
|
*
|
|
589
|
-
* @param decodedIdToken The JWT's decoded claims.
|
|
590
|
-
* @param revocationErrorInfo The revocation error info to throw on revocation
|
|
607
|
+
* @param decodedIdToken - The JWT's decoded claims.
|
|
608
|
+
* @param revocationErrorInfo - The revocation error info to throw on revocation
|
|
591
609
|
* detection.
|
|
592
|
-
* @
|
|
610
|
+
* @returns A promise that will be fulfilled after a successful verification.
|
|
593
611
|
*/
|
|
594
|
-
private
|
|
612
|
+
private verifyDecodedJWTNotRevokedOrDisabled;
|
|
595
613
|
}
|