firebase-admin 10.1.0 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. package/README.md +1 -1
  2. package/lib/app/core.d.ts +1 -1
  3. package/lib/app/core.js +1 -1
  4. package/lib/app/credential-factory.d.ts +1 -1
  5. package/lib/app/credential-factory.js +8 -8
  6. package/lib/app/credential-internal.d.ts +3 -1
  7. package/lib/app/credential-internal.js +103 -95
  8. package/lib/app/credential.d.ts +1 -1
  9. package/lib/app/credential.js +1 -1
  10. package/lib/app/firebase-app.d.ts +1 -1
  11. package/lib/app/firebase-app.js +76 -91
  12. package/lib/app/firebase-namespace.d.ts +1 -1
  13. package/lib/app/firebase-namespace.js +209 -279
  14. package/lib/app/index.d.ts +1 -1
  15. package/lib/app/index.js +4 -4
  16. package/lib/app/lifecycle.d.ts +1 -1
  17. package/lib/app/lifecycle.js +37 -43
  18. package/lib/app-check/app-check-api-client-internal.d.ts +1 -1
  19. package/lib/app-check/app-check-api-client-internal.js +54 -73
  20. package/lib/app-check/app-check-api.d.ts +1 -1
  21. package/lib/app-check/app-check-api.js +1 -1
  22. package/lib/app-check/app-check-namespace.d.ts +1 -1
  23. package/lib/app-check/app-check-namespace.js +1 -1
  24. package/lib/app-check/app-check.d.ts +1 -1
  25. package/lib/app-check/app-check.js +17 -19
  26. package/lib/app-check/index.d.ts +1 -1
  27. package/lib/app-check/index.js +7 -7
  28. package/lib/app-check/token-generator.d.ts +1 -1
  29. package/lib/app-check/token-generator.js +47 -52
  30. package/lib/app-check/token-verifier.d.ts +1 -1
  31. package/lib/app-check/token-verifier.js +46 -50
  32. package/lib/auth/action-code-settings-builder.d.ts +1 -1
  33. package/lib/auth/action-code-settings-builder.js +10 -11
  34. package/lib/auth/auth-api-request.d.ts +1 -1
  35. package/lib/auth/auth-api-request.js +355 -382
  36. package/lib/auth/auth-config.d.ts +1 -1
  37. package/lib/auth/auth-config.js +95 -106
  38. package/lib/auth/auth-namespace.d.ts +1 -1
  39. package/lib/auth/auth-namespace.js +1 -1
  40. package/lib/auth/auth.d.ts +1 -1
  41. package/lib/auth/auth.js +20 -40
  42. package/lib/auth/base-auth.d.ts +26 -1
  43. package/lib/auth/base-auth.js +162 -142
  44. package/lib/auth/identifier.d.ts +1 -1
  45. package/lib/auth/identifier.js +2 -2
  46. package/lib/auth/index.d.ts +1 -1
  47. package/lib/auth/index.js +7 -7
  48. package/lib/auth/tenant-manager.d.ts +1 -1
  49. package/lib/auth/tenant-manager.js +49 -71
  50. package/lib/auth/tenant.d.ts +1 -1
  51. package/lib/auth/tenant.js +44 -55
  52. package/lib/auth/token-generator.d.ts +1 -1
  53. package/lib/auth/token-generator.js +49 -53
  54. package/lib/auth/token-verifier.d.ts +1 -1
  55. package/lib/auth/token-verifier.js +83 -91
  56. package/lib/auth/user-import-builder.d.ts +1 -1
  57. package/lib/auth/user-import-builder.js +70 -73
  58. package/lib/auth/user-record.d.ts +1 -1
  59. package/lib/auth/user-record.js +61 -84
  60. package/lib/credential/index.d.ts +1 -1
  61. package/lib/credential/index.js +2 -2
  62. package/lib/database/database-namespace.d.ts +1 -1
  63. package/lib/database/database-namespace.js +1 -1
  64. package/lib/database/database.d.ts +1 -1
  65. package/lib/database/database.js +92 -108
  66. package/lib/database/index.d.ts +1 -1
  67. package/lib/database/index.js +10 -10
  68. package/lib/default-namespace.d.ts +1 -1
  69. package/lib/default-namespace.js +2 -2
  70. package/lib/esm/eventarc/index.js +5 -0
  71. package/lib/esm/functions/index.js +5 -0
  72. package/lib/eventarc/cloudevent.d.ts +84 -0
  73. package/lib/eventarc/cloudevent.js +19 -0
  74. package/lib/eventarc/eventarc-client-internal.d.ts +18 -0
  75. package/lib/eventarc/eventarc-client-internal.js +139 -0
  76. package/lib/eventarc/eventarc-utils.d.ts +31 -0
  77. package/lib/eventarc/eventarc-utils.js +125 -0
  78. package/lib/eventarc/eventarc.d.ts +107 -0
  79. package/lib/eventarc/eventarc.js +125 -0
  80. package/lib/eventarc/index.d.ts +53 -0
  81. package/lib/eventarc/index.js +64 -0
  82. package/lib/firebase-namespace-api.d.ts +1 -1
  83. package/lib/firebase-namespace-api.js +8 -3
  84. package/lib/firestore/firestore-internal.d.ts +1 -1
  85. package/lib/firestore/firestore-internal.js +28 -37
  86. package/lib/firestore/firestore-namespace.d.ts +9 -1
  87. package/lib/firestore/firestore-namespace.js +2 -2
  88. package/lib/firestore/index.d.ts +2 -2
  89. package/lib/firestore/index.js +7 -7
  90. package/lib/functions/functions-api-client-internal.d.ts +32 -0
  91. package/lib/functions/functions-api-client-internal.js +257 -0
  92. package/lib/functions/functions-api.d.ts +67 -0
  93. package/lib/functions/functions-api.js +19 -0
  94. package/lib/functions/functions.d.ts +63 -0
  95. package/lib/functions/functions.js +97 -0
  96. package/lib/functions/index.d.ts +53 -0
  97. package/lib/functions/index.js +64 -0
  98. package/lib/index.d.ts +1 -1
  99. package/lib/index.js +14 -4
  100. package/lib/installations/index.d.ts +1 -1
  101. package/lib/installations/index.js +6 -6
  102. package/lib/installations/installations-namespace.d.ts +1 -1
  103. package/lib/installations/installations-namespace.js +1 -1
  104. package/lib/installations/installations-request-handler.d.ts +1 -1
  105. package/lib/installations/installations-request-handler.js +33 -36
  106. package/lib/installations/installations.d.ts +1 -1
  107. package/lib/installations/installations.js +17 -22
  108. package/lib/instance-id/index.d.ts +1 -1
  109. package/lib/instance-id/index.js +6 -6
  110. package/lib/instance-id/instance-id-namespace.d.ts +1 -1
  111. package/lib/instance-id/instance-id-namespace.js +1 -1
  112. package/lib/instance-id/instance-id.d.ts +1 -1
  113. package/lib/instance-id/instance-id.js +21 -26
  114. package/lib/machine-learning/index.d.ts +1 -1
  115. package/lib/machine-learning/index.js +7 -7
  116. package/lib/machine-learning/machine-learning-api-client.d.ts +1 -1
  117. package/lib/machine-learning/machine-learning-api-client.js +110 -124
  118. package/lib/machine-learning/machine-learning-namespace.d.ts +1 -1
  119. package/lib/machine-learning/machine-learning-namespace.js +1 -1
  120. package/lib/machine-learning/machine-learning-utils.d.ts +1 -1
  121. package/lib/machine-learning/machine-learning-utils.js +9 -24
  122. package/lib/machine-learning/machine-learning.d.ts +1 -1
  123. package/lib/machine-learning/machine-learning.js +146 -207
  124. package/lib/messaging/batch-request-internal.d.ts +1 -1
  125. package/lib/messaging/batch-request-internal.js +33 -35
  126. package/lib/messaging/index.d.ts +1 -1
  127. package/lib/messaging/index.js +7 -7
  128. package/lib/messaging/messaging-api-request-internal.d.ts +1 -1
  129. package/lib/messaging/messaging-api-request-internal.js +38 -40
  130. package/lib/messaging/messaging-api.d.ts +1 -1
  131. package/lib/messaging/messaging-api.js +1 -1
  132. package/lib/messaging/messaging-errors-internal.d.ts +1 -1
  133. package/lib/messaging/messaging-errors-internal.js +12 -13
  134. package/lib/messaging/messaging-internal.d.ts +1 -1
  135. package/lib/messaging/messaging-internal.js +51 -51
  136. package/lib/messaging/messaging-namespace.d.ts +1 -1
  137. package/lib/messaging/messaging-namespace.js +1 -1
  138. package/lib/messaging/messaging.d.ts +1 -1
  139. package/lib/messaging/messaging.js +184 -208
  140. package/lib/project-management/android-app.d.ts +1 -1
  141. package/lib/project-management/android-app.js +41 -43
  142. package/lib/project-management/app-metadata.d.ts +1 -1
  143. package/lib/project-management/app-metadata.js +1 -1
  144. package/lib/project-management/index.d.ts +1 -1
  145. package/lib/project-management/index.js +7 -7
  146. package/lib/project-management/ios-app.d.ts +1 -1
  147. package/lib/project-management/ios-app.js +25 -26
  148. package/lib/project-management/project-management-api-request-internal.d.ts +1 -1
  149. package/lib/project-management/project-management-api-request-internal.js +84 -89
  150. package/lib/project-management/project-management-namespace.d.ts +1 -1
  151. package/lib/project-management/project-management-namespace.js +1 -1
  152. package/lib/project-management/project-management.d.ts +1 -1
  153. package/lib/project-management/project-management.js +80 -87
  154. package/lib/remote-config/index.d.ts +1 -1
  155. package/lib/remote-config/index.js +7 -7
  156. package/lib/remote-config/remote-config-api-client-internal.d.ts +1 -1
  157. package/lib/remote-config/remote-config-api-client-internal.js +116 -154
  158. package/lib/remote-config/remote-config-api.d.ts +1 -1
  159. package/lib/remote-config/remote-config-api.js +1 -1
  160. package/lib/remote-config/remote-config-namespace.d.ts +1 -1
  161. package/lib/remote-config/remote-config-namespace.js +1 -1
  162. package/lib/remote-config/remote-config.d.ts +1 -1
  163. package/lib/remote-config/remote-config.js +51 -59
  164. package/lib/security-rules/index.d.ts +1 -1
  165. package/lib/security-rules/index.js +7 -7
  166. package/lib/security-rules/security-rules-api-client-internal.d.ts +1 -1
  167. package/lib/security-rules/security-rules-api-client-internal.js +95 -107
  168. package/lib/security-rules/security-rules-internal.d.ts +1 -1
  169. package/lib/security-rules/security-rules-internal.js +6 -21
  170. package/lib/security-rules/security-rules-namespace.d.ts +1 -1
  171. package/lib/security-rules/security-rules-namespace.js +1 -1
  172. package/lib/security-rules/security-rules.d.ts +1 -1
  173. package/lib/security-rules/security-rules.js +82 -91
  174. package/lib/storage/index.d.ts +1 -1
  175. package/lib/storage/index.js +7 -7
  176. package/lib/storage/storage-namespace.d.ts +1 -1
  177. package/lib/storage/storage-namespace.js +1 -1
  178. package/lib/storage/storage.d.ts +1 -1
  179. package/lib/storage/storage.js +25 -30
  180. package/lib/utils/api-request.d.ts +3 -1
  181. package/lib/utils/api-request.js +278 -356
  182. package/lib/utils/crypto-signer.d.ts +1 -1
  183. package/lib/utils/crypto-signer.js +58 -93
  184. package/lib/utils/deep-copy.d.ts +1 -1
  185. package/lib/utils/deep-copy.js +3 -3
  186. package/lib/utils/error.d.ts +5 -1
  187. package/lib/utils/error.js +613 -677
  188. package/lib/utils/index.d.ts +43 -1
  189. package/lib/utils/index.js +99 -34
  190. package/lib/utils/jwt.d.ts +1 -1
  191. package/lib/utils/jwt.js +97 -123
  192. package/lib/utils/validator.d.ts +1 -1
  193. package/lib/utils/validator.js +13 -13
  194. package/package.json +43 -11
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.1.0 */
1
+ /*! firebase-admin v11.0.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -16,29 +16,16 @@
16
16
  * See the License for the specific language governing permissions and
17
17
  * limitations under the License.
18
18
  */
19
- var __extends = (this && this.__extends) || (function () {
20
- var extendStatics = function (d, b) {
21
- extendStatics = Object.setPrototypeOf ||
22
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
23
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
24
- return extendStatics(d, b);
25
- };
26
- return function (d, b) {
27
- extendStatics(d, b);
28
- function __() { this.constructor = d; }
29
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
30
- };
31
- })();
32
19
  Object.defineProperty(exports, "__esModule", { value: true });
33
20
  exports.UserRecord = exports.UserInfo = exports.UserMetadata = exports.MultiFactorSettings = exports.PhoneMultiFactorInfo = exports.MultiFactorInfo = void 0;
34
- var deep_copy_1 = require("../utils/deep-copy");
35
- var validator_1 = require("../utils/validator");
36
- var utils = require("../utils");
37
- var error_1 = require("../utils/error");
21
+ const deep_copy_1 = require("../utils/deep-copy");
22
+ const validator_1 = require("../utils/validator");
23
+ const utils = require("../utils");
24
+ const error_1 = require("../utils/error");
38
25
  /**
39
26
  * 'REDACTED', encoded as a base64 string.
40
27
  */
41
- var B64_REDACTED = Buffer.from('REDACTED').toString('base64');
28
+ const B64_REDACTED = Buffer.from('REDACTED').toString('base64');
42
29
  /**
43
30
  * Parses a time stamp string or number and returns the corresponding date if valid.
44
31
  *
@@ -47,7 +34,7 @@ var B64_REDACTED = Buffer.from('REDACTED').toString('base64');
47
34
  */
48
35
  function parseDate(time) {
49
36
  try {
50
- var date = new Date(parseInt(time, 10));
37
+ const date = new Date(parseInt(time, 10));
51
38
  if (!isNaN(date.getTime())) {
52
39
  return date.toUTCString();
53
40
  }
@@ -64,7 +51,7 @@ var MultiFactorId;
64
51
  /**
65
52
  * Interface representing the common properties of a user-enrolled second factor.
66
53
  */
67
- var MultiFactorInfo = /** @class */ (function () {
54
+ class MultiFactorInfo {
68
55
  /**
69
56
  * Initializes the MultiFactorInfo object using the server side response.
70
57
  *
@@ -72,7 +59,7 @@ var MultiFactorInfo = /** @class */ (function () {
72
59
  * @constructor
73
60
  * @internal
74
61
  */
75
- function MultiFactorInfo(response) {
62
+ constructor(response) {
76
63
  this.initFromServerResponse(response);
77
64
  }
78
65
  /**
@@ -82,8 +69,8 @@ var MultiFactorInfo = /** @class */ (function () {
82
69
  * @param response - The server side response.
83
70
  * @internal
84
71
  */
85
- MultiFactorInfo.initMultiFactorInfo = function (response) {
86
- var multiFactorInfo = null;
72
+ static initMultiFactorInfo(response) {
73
+ let multiFactorInfo = null;
87
74
  // Only PhoneMultiFactorInfo currently available.
88
75
  try {
89
76
  multiFactorInfo = new PhoneMultiFactorInfo(response);
@@ -92,27 +79,27 @@ var MultiFactorInfo = /** @class */ (function () {
92
79
  // Ignore error.
93
80
  }
94
81
  return multiFactorInfo;
95
- };
82
+ }
96
83
  /**
97
84
  * Returns a JSON-serializable representation of this object.
98
85
  *
99
86
  * @returns A JSON-serializable representation of this object.
100
87
  */
101
- MultiFactorInfo.prototype.toJSON = function () {
88
+ toJSON() {
102
89
  return {
103
90
  uid: this.uid,
104
91
  displayName: this.displayName,
105
92
  factorId: this.factorId,
106
93
  enrollmentTime: this.enrollmentTime,
107
94
  };
108
- };
95
+ }
109
96
  /**
110
97
  * Initializes the MultiFactorInfo object using the provided server response.
111
98
  *
112
99
  * @param response - The server side response.
113
100
  */
114
- MultiFactorInfo.prototype.initFromServerResponse = function (response) {
115
- var factorId = response && this.getFactorId(response);
101
+ initFromServerResponse(response) {
102
+ const factorId = response && this.getFactorId(response);
116
103
  if (!factorId || !response || !response.mfaEnrollmentId) {
117
104
  throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Invalid multi-factor info response');
118
105
  }
@@ -129,15 +116,13 @@ var MultiFactorInfo = /** @class */ (function () {
129
116
  else {
130
117
  utils.addReadonlyGetter(this, 'enrollmentTime', null);
131
118
  }
132
- };
133
- return MultiFactorInfo;
134
- }());
119
+ }
120
+ }
135
121
  exports.MultiFactorInfo = MultiFactorInfo;
136
122
  /**
137
123
  * Interface representing a phone specific user-enrolled second factor.
138
124
  */
139
- var PhoneMultiFactorInfo = /** @class */ (function (_super) {
140
- __extends(PhoneMultiFactorInfo, _super);
125
+ class PhoneMultiFactorInfo extends MultiFactorInfo {
141
126
  /**
142
127
  * Initializes the PhoneMultiFactorInfo object using the server side response.
143
128
  *
@@ -145,19 +130,18 @@ var PhoneMultiFactorInfo = /** @class */ (function (_super) {
145
130
  * @constructor
146
131
  * @internal
147
132
  */
148
- function PhoneMultiFactorInfo(response) {
149
- var _this = _super.call(this, response) || this;
150
- utils.addReadonlyGetter(_this, 'phoneNumber', response.phoneInfo);
151
- return _this;
133
+ constructor(response) {
134
+ super(response);
135
+ utils.addReadonlyGetter(this, 'phoneNumber', response.phoneInfo);
152
136
  }
153
137
  /**
154
138
  * {@inheritdoc MultiFactorInfo.toJSON}
155
139
  */
156
- PhoneMultiFactorInfo.prototype.toJSON = function () {
157
- return Object.assign(_super.prototype.toJSON.call(this), {
140
+ toJSON() {
141
+ return Object.assign(super.toJSON(), {
158
142
  phoneNumber: this.phoneNumber,
159
143
  });
160
- };
144
+ }
161
145
  /**
162
146
  * Returns the factor ID based on the response provided.
163
147
  *
@@ -167,16 +151,15 @@ var PhoneMultiFactorInfo = /** @class */ (function (_super) {
167
151
  *
168
152
  * @internal
169
153
  */
170
- PhoneMultiFactorInfo.prototype.getFactorId = function (response) {
154
+ getFactorId(response) {
171
155
  return (response && response.phoneInfo) ? MultiFactorId.Phone : null;
172
- };
173
- return PhoneMultiFactorInfo;
174
- }(MultiFactorInfo));
156
+ }
157
+ }
175
158
  exports.PhoneMultiFactorInfo = PhoneMultiFactorInfo;
176
159
  /**
177
160
  * The multi-factor related user settings.
178
161
  */
179
- var MultiFactorSettings = /** @class */ (function () {
162
+ class MultiFactorSettings {
180
163
  /**
181
164
  * Initializes the MultiFactor object using the server side or JWT format response.
182
165
  *
@@ -184,14 +167,14 @@ var MultiFactorSettings = /** @class */ (function () {
184
167
  * @constructor
185
168
  * @internal
186
169
  */
187
- function MultiFactorSettings(response) {
188
- var parsedEnrolledFactors = [];
189
- if (!validator_1.isNonNullObject(response)) {
170
+ constructor(response) {
171
+ const parsedEnrolledFactors = [];
172
+ if (!(0, validator_1.isNonNullObject)(response)) {
190
173
  throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Invalid multi-factor response');
191
174
  }
192
175
  else if (response.mfaInfo) {
193
- response.mfaInfo.forEach(function (factorResponse) {
194
- var multiFactorInfo = MultiFactorInfo.initMultiFactorInfo(factorResponse);
176
+ response.mfaInfo.forEach((factorResponse) => {
177
+ const multiFactorInfo = MultiFactorInfo.initMultiFactorInfo(factorResponse);
195
178
  if (multiFactorInfo) {
196
179
  parsedEnrolledFactors.push(multiFactorInfo);
197
180
  }
@@ -205,32 +188,31 @@ var MultiFactorSettings = /** @class */ (function () {
205
188
  *
206
189
  * @returns A JSON-serializable representation of this multi-factor object.
207
190
  */
208
- MultiFactorSettings.prototype.toJSON = function () {
191
+ toJSON() {
209
192
  return {
210
- enrolledFactors: this.enrolledFactors.map(function (info) { return info.toJSON(); }),
193
+ enrolledFactors: this.enrolledFactors.map((info) => info.toJSON()),
211
194
  };
212
- };
213
- return MultiFactorSettings;
214
- }());
195
+ }
196
+ }
215
197
  exports.MultiFactorSettings = MultiFactorSettings;
216
198
  /**
217
199
  * Represents a user's metadata.
218
200
  */
219
- var UserMetadata = /** @class */ (function () {
201
+ class UserMetadata {
220
202
  /**
221
203
  * @param response - The server side response returned from the getAccountInfo
222
204
  * endpoint.
223
205
  * @constructor
224
206
  * @internal
225
207
  */
226
- function UserMetadata(response) {
208
+ constructor(response) {
227
209
  // Creation date should always be available but due to some backend bugs there
228
210
  // were cases in the past where users did not have creation date properly set.
229
211
  // This included legacy Firebase migrating project users and some anonymous users.
230
212
  // These bugs have already been addressed since then.
231
213
  utils.addReadonlyGetter(this, 'creationTime', parseDate(response.createdAt));
232
214
  utils.addReadonlyGetter(this, 'lastSignInTime', parseDate(response.lastLoginAt));
233
- var lastRefreshAt = response.lastRefreshAt ? new Date(response.lastRefreshAt).toUTCString() : null;
215
+ const lastRefreshAt = response.lastRefreshAt ? new Date(response.lastRefreshAt).toUTCString() : null;
234
216
  utils.addReadonlyGetter(this, 'lastRefreshTime', lastRefreshAt);
235
217
  }
236
218
  /**
@@ -238,27 +220,26 @@ var UserMetadata = /** @class */ (function () {
238
220
  *
239
221
  * @returns A JSON-serializable representation of this object.
240
222
  */
241
- UserMetadata.prototype.toJSON = function () {
223
+ toJSON() {
242
224
  return {
243
225
  lastSignInTime: this.lastSignInTime,
244
226
  creationTime: this.creationTime,
245
227
  };
246
- };
247
- return UserMetadata;
248
- }());
228
+ }
229
+ }
249
230
  exports.UserMetadata = UserMetadata;
250
231
  /**
251
232
  * Represents a user's info from a third-party identity provider
252
233
  * such as Google or Facebook.
253
234
  */
254
- var UserInfo = /** @class */ (function () {
235
+ class UserInfo {
255
236
  /**
256
237
  * @param response - The server side response returned from the `getAccountInfo`
257
238
  * endpoint.
258
239
  * @constructor
259
240
  * @internal
260
241
  */
261
- function UserInfo(response) {
242
+ constructor(response) {
262
243
  // Provider user id and provider id are required.
263
244
  if (!response.rawId || !response.providerId) {
264
245
  throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Invalid user info response');
@@ -275,7 +256,7 @@ var UserInfo = /** @class */ (function () {
275
256
  *
276
257
  * @returns A JSON-serializable representation of this object.
277
258
  */
278
- UserInfo.prototype.toJSON = function () {
259
+ toJSON() {
279
260
  return {
280
261
  uid: this.uid,
281
262
  displayName: this.displayName,
@@ -284,21 +265,20 @@ var UserInfo = /** @class */ (function () {
284
265
  providerId: this.providerId,
285
266
  phoneNumber: this.phoneNumber,
286
267
  };
287
- };
288
- return UserInfo;
289
- }());
268
+ }
269
+ }
290
270
  exports.UserInfo = UserInfo;
291
271
  /**
292
272
  * Represents a user.
293
273
  */
294
- var UserRecord = /** @class */ (function () {
274
+ class UserRecord {
295
275
  /**
296
276
  * @param response - The server side response returned from the getAccountInfo
297
277
  * endpoint.
298
278
  * @constructor
299
279
  * @internal
300
280
  */
301
- function UserRecord(response) {
281
+ constructor(response) {
302
282
  // The Firebase user id is required.
303
283
  if (!response.localId) {
304
284
  throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Invalid user response');
@@ -312,9 +292,8 @@ var UserRecord = /** @class */ (function () {
312
292
  // If disabled is not provided, the account is enabled by default.
313
293
  utils.addReadonlyGetter(this, 'disabled', response.disabled || false);
314
294
  utils.addReadonlyGetter(this, 'metadata', new UserMetadata(response));
315
- var providerData = [];
316
- for (var _i = 0, _a = (response.providerUserInfo || []); _i < _a.length; _i++) {
317
- var entry = _a[_i];
295
+ const providerData = [];
296
+ for (const entry of (response.providerUserInfo || [])) {
318
297
  providerData.push(new UserInfo(entry));
319
298
  }
320
299
  utils.addReadonlyGetter(this, 'providerData', providerData);
@@ -331,14 +310,14 @@ var UserRecord = /** @class */ (function () {
331
310
  if (response.customAttributes) {
332
311
  utils.addReadonlyGetter(this, 'customClaims', JSON.parse(response.customAttributes));
333
312
  }
334
- var validAfterTime = null;
313
+ let validAfterTime = null;
335
314
  // Convert validSince first to UTC milliseconds and then to UTC date string.
336
315
  if (typeof response.validSince !== 'undefined') {
337
316
  validAfterTime = parseDate(parseInt(response.validSince, 10) * 1000);
338
317
  }
339
318
  utils.addReadonlyGetter(this, 'tokensValidAfterTime', validAfterTime || undefined);
340
319
  utils.addReadonlyGetter(this, 'tenantId', response.tenantId);
341
- var multiFactor = new MultiFactorSettings(response);
320
+ const multiFactor = new MultiFactorSettings(response);
342
321
  if (multiFactor.enrolledFactors.length > 0) {
343
322
  utils.addReadonlyGetter(this, 'multiFactor', multiFactor);
344
323
  }
@@ -348,8 +327,8 @@ var UserRecord = /** @class */ (function () {
348
327
  *
349
328
  * @returns A JSON-serializable representation of this object.
350
329
  */
351
- UserRecord.prototype.toJSON = function () {
352
- var json = {
330
+ toJSON() {
331
+ const json = {
353
332
  uid: this.uid,
354
333
  email: this.email,
355
334
  emailVerified: this.emailVerified,
@@ -361,7 +340,7 @@ var UserRecord = /** @class */ (function () {
361
340
  metadata: this.metadata.toJSON(),
362
341
  passwordHash: this.passwordHash,
363
342
  passwordSalt: this.passwordSalt,
364
- customClaims: deep_copy_1.deepCopy(this.customClaims),
343
+ customClaims: (0, deep_copy_1.deepCopy)(this.customClaims),
365
344
  tokensValidAfterTime: this.tokensValidAfterTime,
366
345
  tenantId: this.tenantId,
367
346
  };
@@ -369,13 +348,11 @@ var UserRecord = /** @class */ (function () {
369
348
  json.multiFactor = this.multiFactor.toJSON();
370
349
  }
371
350
  json.providerData = [];
372
- for (var _i = 0, _a = this.providerData; _i < _a.length; _i++) {
373
- var entry = _a[_i];
351
+ for (const entry of this.providerData) {
374
352
  // Convert each provider data to json.
375
353
  json.providerData.push(entry.toJSON());
376
354
  }
377
355
  return json;
378
- };
379
- return UserRecord;
380
- }());
356
+ }
357
+ }
381
358
  exports.UserRecord = UserRecord;
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.1.0 */
1
+ /*! firebase-admin v11.0.0 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.1.0 */
1
+ /*! firebase-admin v11.0.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -17,7 +17,7 @@
17
17
  */
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.credential = void 0;
20
- var index_1 = require("../app/index");
20
+ const index_1 = require("../app/index");
21
21
  /* eslint-disable @typescript-eslint/no-namespace */
22
22
  var credential;
23
23
  (function (credential) {
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.1.0 */
1
+ /*! firebase-admin v11.0.0 */
2
2
  /*!
3
3
  * Copyright 2021 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.1.0 */
1
+ /*! firebase-admin v11.0.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.1.0 */
1
+ /*! firebase-admin v11.0.0 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *