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.
Files changed (188) hide show
  1. package/README.md +7 -3
  2. package/lib/app/core.d.ts +15 -22
  3. package/lib/app/core.js +1 -1
  4. package/lib/app/credential-factory.d.ts +17 -33
  5. package/lib/app/credential-factory.js +17 -33
  6. package/lib/app/credential-internal.d.ts +10 -9
  7. package/lib/app/credential-internal.js +15 -13
  8. package/lib/app/credential.d.ts +3 -9
  9. package/lib/app/credential.js +1 -1
  10. package/lib/app/firebase-app.d.ts +6 -30
  11. package/lib/app/firebase-app.js +72 -216
  12. package/lib/app/firebase-namespace.d.ts +28 -34
  13. package/lib/app/firebase-namespace.js +119 -99
  14. package/lib/app/index.d.ts +6 -1
  15. package/lib/app/index.js +1 -1
  16. package/lib/app/lifecycle.d.ts +24 -3
  17. package/lib/app/lifecycle.js +119 -25
  18. package/lib/app-check/app-check-api-client-internal.d.ts +32 -0
  19. package/lib/app-check/app-check-api-client-internal.js +197 -0
  20. package/lib/app-check/app-check-api.d.ts +95 -0
  21. package/lib/app-check/app-check-api.js +19 -0
  22. package/lib/app-check/app-check-namespace.d.ts +65 -0
  23. package/lib/app-check/app-check-namespace.js +18 -0
  24. package/lib/app-check/app-check.d.ts +49 -0
  25. package/lib/app-check/app-check.js +82 -0
  26. package/lib/app-check/index.d.ts +53 -0
  27. package/lib/app-check/index.js +63 -0
  28. package/lib/app-check/token-generator.d.ts +25 -0
  29. package/lib/app-check/token-generator.js +159 -0
  30. package/lib/app-check/token-verifier.d.ts +17 -0
  31. package/lib/app-check/token-verifier.js +151 -0
  32. package/lib/auth/action-code-settings-builder.d.ts +1 -1
  33. package/lib/auth/action-code-settings-builder.js +2 -2
  34. package/lib/auth/auth-api-request.d.ts +28 -32
  35. package/lib/auth/auth-api-request.js +167 -125
  36. package/lib/auth/auth-config.d.ts +123 -21
  37. package/lib/auth/auth-config.js +85 -34
  38. package/lib/auth/auth-namespace.d.ts +157 -4
  39. package/lib/auth/auth-namespace.js +1 -1
  40. package/lib/auth/auth.d.ts +5 -3
  41. package/lib/auth/auth.js +6 -4
  42. package/lib/auth/base-auth.d.ts +134 -116
  43. package/lib/auth/base-auth.js +213 -143
  44. package/lib/auth/identifier.d.ts +5 -5
  45. package/lib/auth/identifier.js +1 -1
  46. package/lib/auth/index.d.ts +10 -5
  47. package/lib/auth/index.js +9 -4
  48. package/lib/auth/tenant-manager.d.ts +19 -19
  49. package/lib/auth/tenant-manager.js +21 -25
  50. package/lib/auth/tenant.d.ts +14 -5
  51. package/lib/auth/tenant.js +19 -11
  52. package/lib/auth/token-generator.d.ts +7 -108
  53. package/lib/auth/token-generator.js +52 -145
  54. package/lib/auth/token-verifier.d.ts +3 -4
  55. package/lib/auth/token-verifier.js +96 -145
  56. package/lib/auth/user-import-builder.d.ts +11 -11
  57. package/lib/auth/user-import-builder.js +9 -9
  58. package/lib/auth/user-record.d.ts +23 -15
  59. package/lib/auth/user-record.js +30 -20
  60. package/lib/credential/index.d.ts +18 -35
  61. package/lib/credential/index.js +17 -33
  62. package/lib/database/database-namespace.d.ts +39 -10
  63. package/lib/database/database-namespace.js +1 -1
  64. package/lib/database/database.d.ts +16 -6
  65. package/lib/database/database.js +61 -6
  66. package/lib/database/index.d.ts +19 -18
  67. package/lib/database/index.js +21 -23
  68. package/lib/default-namespace.d.ts +7 -1
  69. package/lib/default-namespace.js +4 -4
  70. package/lib/esm/app/index.js +10 -0
  71. package/lib/esm/app-check/index.js +4 -0
  72. package/lib/esm/auth/index.js +14 -0
  73. package/lib/esm/database/index.js +6 -0
  74. package/lib/esm/firestore/index.js +24 -0
  75. package/lib/esm/installations/index.js +4 -0
  76. package/lib/esm/instance-id/index.js +4 -0
  77. package/lib/esm/machine-learning/index.js +5 -0
  78. package/lib/esm/messaging/index.js +4 -0
  79. package/lib/esm/package.json +1 -0
  80. package/lib/esm/project-management/index.js +8 -0
  81. package/lib/esm/remote-config/index.js +4 -0
  82. package/lib/esm/security-rules/index.js +6 -0
  83. package/lib/esm/storage/index.js +4 -0
  84. package/lib/firebase-namespace-api.d.ts +12 -6
  85. package/lib/firebase-namespace-api.js +5 -1
  86. package/lib/firestore/firestore-internal.d.ts +2 -2
  87. package/lib/firestore/firestore-internal.js +2 -2
  88. package/lib/firestore/firestore-namespace.d.ts +6 -1
  89. package/lib/firestore/firestore-namespace.js +2 -1
  90. package/lib/firestore/index.d.ts +36 -4
  91. package/lib/firestore/index.js +29 -1
  92. package/lib/index.d.ts +1 -1
  93. package/lib/index.js +1 -1
  94. package/lib/installations/index.d.ts +52 -0
  95. package/lib/installations/index.js +62 -0
  96. package/lib/installations/installations-namespace.d.ts +55 -0
  97. package/lib/installations/installations-namespace.js +18 -0
  98. package/lib/{instance-id/instance-id-request-internal.d.ts → installations/installations-request-handler.d.ts} +8 -8
  99. package/lib/{instance-id/instance-id-request-internal.js → installations/installations-request-handler.js} +23 -23
  100. package/lib/installations/installations.d.ts +38 -0
  101. package/lib/installations/installations.js +63 -0
  102. package/lib/instance-id/index.d.ts +20 -9
  103. package/lib/instance-id/index.js +20 -9
  104. package/lib/instance-id/instance-id-namespace.d.ts +9 -8
  105. package/lib/instance-id/instance-id-namespace.js +1 -1
  106. package/lib/instance-id/instance-id.d.ts +8 -6
  107. package/lib/instance-id/instance-id.js +20 -11
  108. package/lib/machine-learning/index.d.ts +29 -27
  109. package/lib/machine-learning/index.js +29 -27
  110. package/lib/machine-learning/machine-learning-api-client.d.ts +1 -1
  111. package/lib/machine-learning/machine-learning-api-client.js +4 -4
  112. package/lib/machine-learning/machine-learning-namespace.d.ts +33 -8
  113. package/lib/machine-learning/machine-learning-namespace.js +1 -1
  114. package/lib/machine-learning/machine-learning-utils.d.ts +1 -1
  115. package/lib/machine-learning/machine-learning-utils.js +1 -1
  116. package/lib/machine-learning/machine-learning.d.ts +19 -19
  117. package/lib/machine-learning/machine-learning.js +20 -20
  118. package/lib/messaging/batch-request-internal.d.ts +3 -3
  119. package/lib/messaging/batch-request-internal.js +9 -9
  120. package/lib/messaging/index.d.ts +11 -9
  121. package/lib/messaging/index.js +11 -9
  122. package/lib/messaging/messaging-api-request-internal.d.ts +8 -8
  123. package/lib/messaging/messaging-api-request-internal.js +8 -8
  124. package/lib/messaging/messaging-api.d.ts +79 -75
  125. package/lib/messaging/messaging-api.js +1 -1
  126. package/lib/messaging/messaging-errors-internal.d.ts +5 -5
  127. package/lib/messaging/messaging-errors-internal.js +7 -7
  128. package/lib/messaging/messaging-internal.d.ts +1 -1
  129. package/lib/messaging/messaging-internal.js +6 -31
  130. package/lib/messaging/messaging-namespace.d.ts +105 -8
  131. package/lib/messaging/messaging-namespace.js +1 -1
  132. package/lib/messaging/messaging.d.ts +70 -86
  133. package/lib/messaging/messaging.js +76 -89
  134. package/lib/project-management/android-app.d.ts +11 -12
  135. package/lib/project-management/android-app.js +13 -14
  136. package/lib/project-management/app-metadata.d.ts +1 -1
  137. package/lib/project-management/app-metadata.js +1 -1
  138. package/lib/project-management/index.d.ts +11 -9
  139. package/lib/project-management/index.js +11 -9
  140. package/lib/project-management/ios-app.d.ts +6 -7
  141. package/lib/project-management/ios-app.js +6 -7
  142. package/lib/project-management/project-management-api-request-internal.d.ts +1 -80
  143. package/lib/project-management/project-management-api-request-internal.js +14 -14
  144. package/lib/project-management/project-management-namespace.d.ts +31 -9
  145. package/lib/project-management/project-management-namespace.js +1 -1
  146. package/lib/project-management/project-management.d.ts +18 -21
  147. package/lib/project-management/project-management.js +19 -22
  148. package/lib/remote-config/index.d.ts +12 -10
  149. package/lib/remote-config/index.js +11 -9
  150. package/lib/remote-config/remote-config-api-client-internal.d.ts +1 -1
  151. package/lib/remote-config/remote-config-api-client-internal.js +2 -2
  152. package/lib/remote-config/remote-config-api.d.ts +12 -2
  153. package/lib/remote-config/remote-config-api.js +1 -1
  154. package/lib/remote-config/remote-config-namespace.d.ts +50 -9
  155. package/lib/remote-config/remote-config-namespace.js +1 -1
  156. package/lib/remote-config/remote-config.d.ts +19 -21
  157. package/lib/remote-config/remote-config.js +25 -25
  158. package/lib/security-rules/index.d.ts +12 -10
  159. package/lib/security-rules/index.js +12 -10
  160. package/lib/security-rules/security-rules-api-client-internal.d.ts +1 -1
  161. package/lib/security-rules/security-rules-api-client-internal.js +1 -1
  162. package/lib/security-rules/security-rules-internal.d.ts +1 -1
  163. package/lib/security-rules/security-rules-internal.js +1 -1
  164. package/lib/security-rules/security-rules-namespace.d.ts +43 -28
  165. package/lib/security-rules/security-rules-namespace.js +1 -1
  166. package/lib/security-rules/security-rules.d.ts +39 -42
  167. package/lib/security-rules/security-rules.js +38 -39
  168. package/lib/storage/index.d.ts +9 -7
  169. package/lib/storage/index.js +9 -7
  170. package/lib/storage/storage-namespace.d.ts +7 -6
  171. package/lib/storage/storage-namespace.js +1 -1
  172. package/lib/storage/storage.d.ts +3 -3
  173. package/lib/storage/storage.js +14 -4
  174. package/lib/utils/api-request.d.ts +24 -24
  175. package/lib/utils/api-request.js +25 -25
  176. package/lib/utils/crypto-signer.d.ts +128 -0
  177. package/lib/utils/crypto-signer.js +237 -0
  178. package/lib/utils/deep-copy.d.ts +6 -6
  179. package/lib/utils/deep-copy.js +6 -6
  180. package/lib/utils/error.d.ts +69 -36
  181. package/lib/utils/error.js +98 -43
  182. package/lib/utils/index.d.ts +30 -19
  183. package/lib/utils/index.js +47 -20
  184. package/lib/utils/jwt.d.ts +131 -0
  185. package/lib/utils/jwt.js +355 -0
  186. package/lib/utils/validator.d.ts +37 -37
  187. package/lib/utils/validator.js +37 -37
  188. package/package.json +126 -53
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v9.100.0-alpha.0 */
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 auth.Auth.getUsers} API. */
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 auth.Auth.listUsers `listUsers()`} operation. Contains the list
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 auth.UserRecord `UserRecord`} objects for the
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 [`failureCount`](#failureCount).
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 auth.Auth.createSessionCookie `createSessionCookie()`} method.
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 [Create Custom Tokens](/docs/auth/admin/create-custom-tokens) for code
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
- * @return A promise fulfilled with a custom token for the
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
- * See [Verify ID Tokens](/docs/auth/admin/verify-id-tokens) for code samples
114
- * and detailed documentation.
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
- * @return A promise fulfilled with the
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 [Retrieve user data](/docs/auth/admin/manage-users#retrieve_user_data)
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
- * @return A promise fulfilled with the user
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 [Retrieve user data](/docs/auth/admin/manage-users#retrieve_user_data)
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
- * @return A promise fulfilled with the user
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 [Retrieve user data](/docs/auth/admin/manage-users#retrieve_user_data)
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
- * @return A promise fulfilled with the user
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 <= 100 entries.
177
- * @return {Promise<GetUsersResult>} A promise that resolves to the corresponding user records.
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 [List all users](/docs/auth/admin/manage-users#list_all_users)
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
- * @return A promise that resolves with
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 [Create a user](/docs/auth/admin/manage-users#create_a_user) for code
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
- * @return A promise fulfilled with the user
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 [Delete a user](/docs/auth/admin/manage-users#delete_a_user) for code
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
- * @return An empty promise fulfilled once the user has been
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
- * @return A Promise that resolves to the total number of successful/failed
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 [Update a user](/docs/auth/admin/manage-users#update_a_user) for code
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
- * @return A promise fulfilled with the
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
- * [Defining user roles and access levels](/docs/auth/admin/custom-claims)
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
- * @return A promise that resolves when the operation completes
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
- * @return An empty promise fulfilled once the user's refresh
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 auth.UserImportOptions `UserImportOptions`} are required to be
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
- * @return A promise that resolves when
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 [Manage Session Cookies](/docs/auth/admin/manage-cookies) for code
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
- * @return A promise that resolves on success with the
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. If `checkRevoked` is
345
- * set to true, verifies if the session corresponding to the session cookie was
346
- * revoked. If the corresponding user's session was revoked, an
347
- * `auth/session-cookie-revoked` error is thrown. If not specified the check is
348
- * not performed.
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 [Verify Session Cookies](/docs/auth/admin/manage-cookies#verify_session_cookie_and_check_permissions)
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
- * @return A promise fulfilled with the
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 auth.ActionCodeSettings `ActionCodeSettings`} object
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
- * @return A promise that resolves with the generated link.
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
- * @return A promise that resolves with the generated link.
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
- * @return A promise that resolves with the generated link.
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 [GCIP documentation](https://cloud.google.com/identity-platform).
537
+ * see the {@link https://cloud.google.com/identity-platform | GCIP documentation}.
521
538
  *
522
- * @param options The provider config filter to apply.
523
- * @return A promise that resolves with the list of provider configs meeting the
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 [GCIP documentation](https://cloud.google.com/identity-platform).
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
- * @return A promise that resolves
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 [GCIP documentation](https://cloud.google.com/identity-platform).
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
- * @return A promise that resolves on completion.
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 [GCIP documentation](https://cloud.google.com/identity-platform).
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
- * @return A promise that resolves with the updated provider configuration.
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 [GCIP documentation](https://cloud.google.com/identity-platform).
596
+ * see the {@link https://cloud.google.com/identity-platform | GCIP documentation}.
580
597
  *
581
- * @param config The provider configuration to create.
582
- * @return A promise that resolves with the created provider configuration.
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 resolves
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
- * @return A Promise that will be fulfilled after a successful verification.
610
+ * @returns A promise that will be fulfilled after a successful verification.
593
611
  */
594
- private verifyDecodedJWTNotRevoked;
612
+ private verifyDecodedJWTNotRevokedOrDisabled;
595
613
  }