firebase-admin 9.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +90 -0
- package/lib/app-check/app-check-api-client-internal.js +197 -0
- package/lib/app-check/app-check.js +79 -0
- package/lib/app-check/index.d.ts +160 -0
- package/lib/app-check/index.js +19 -0
- package/lib/app-check/token-generator.js +161 -0
- package/lib/app-check/token-verifier.js +152 -0
- package/lib/auth/action-code-settings-builder.js +118 -0
- package/lib/auth/auth-api-request.js +1856 -0
- package/lib/auth/auth-config.js +636 -0
- package/lib/auth/auth.js +836 -0
- package/lib/auth/identifier.js +40 -0
- package/lib/auth/index.d.ts +1927 -0
- package/lib/auth/index.js +18 -0
- package/lib/auth/tenant-manager.js +140 -0
- package/lib/auth/tenant.js +171 -0
- package/lib/auth/token-generator.js +200 -0
- package/lib/auth/token-verifier.js +259 -0
- package/lib/auth/user-import-builder.js +387 -0
- package/lib/auth/user-record.js +346 -0
- package/lib/credential/credential-internal.js +391 -0
- package/lib/credential/credential.js +44 -0
- package/lib/credential/index.d.ts +169 -0
- package/lib/credential/index.js +23 -0
- package/lib/database/database-internal.js +266 -0
- package/lib/database/index.d.ts +89 -0
- package/lib/database/index.js +31 -0
- package/lib/default-namespace.js +31 -0
- package/lib/firebase-app.js +349 -0
- package/lib/firebase-namespace-api.d.ts +243 -0
- package/lib/firebase-namespace-api.js +18 -0
- package/lib/firebase-namespace.d.ts +31 -0
- package/lib/firebase-namespace.js +417 -0
- package/lib/firestore/firestore-internal.js +105 -0
- package/lib/firestore/index.d.ts +50 -0
- package/lib/firestore/index.js +47 -0
- package/lib/index.d.ts +24 -0
- package/lib/index.js +27 -0
- package/lib/installations/index.d.ts +81 -0
- package/lib/installations/index.js +18 -0
- package/lib/installations/installations-request-handler.js +117 -0
- package/lib/installations/installations.js +62 -0
- package/lib/instance-id/index.d.ts +83 -0
- package/lib/instance-id/index.js +18 -0
- package/lib/instance-id/instance-id.js +87 -0
- package/lib/machine-learning/index.d.ts +249 -0
- package/lib/machine-learning/index.js +18 -0
- package/lib/machine-learning/machine-learning-api-client.js +304 -0
- package/lib/machine-learning/machine-learning-utils.js +62 -0
- package/lib/machine-learning/machine-learning.js +364 -0
- package/lib/messaging/batch-request-internal.js +129 -0
- package/lib/messaging/index.d.ts +1174 -0
- package/lib/messaging/index.js +18 -0
- package/lib/messaging/messaging-api-request-internal.js +128 -0
- package/lib/messaging/messaging-errors-internal.js +106 -0
- package/lib/messaging/messaging-internal.js +484 -0
- package/lib/messaging/messaging.js +846 -0
- package/lib/project-management/android-app.js +176 -0
- package/lib/project-management/index.d.ts +363 -0
- package/lib/project-management/index.js +41 -0
- package/lib/project-management/ios-app.js +88 -0
- package/lib/project-management/project-management-api-request-internal.js +273 -0
- package/lib/project-management/project-management.js +254 -0
- package/lib/remote-config/index.d.ts +369 -0
- package/lib/remote-config/index.js +18 -0
- package/lib/remote-config/remote-config-api-client-internal.js +407 -0
- package/lib/remote-config/remote-config.js +304 -0
- package/lib/security-rules/index.d.ts +216 -0
- package/lib/security-rules/index.js +18 -0
- package/lib/security-rules/security-rules-api-client-internal.js +237 -0
- package/lib/security-rules/security-rules-internal.js +41 -0
- package/lib/security-rules/security-rules.js +310 -0
- package/lib/storage/index.d.ts +60 -0
- package/lib/storage/index.js +18 -0
- package/lib/storage/storage.js +123 -0
- package/lib/utils/api-request.js +845 -0
- package/lib/utils/crypto-signer.js +237 -0
- package/lib/utils/deep-copy.js +78 -0
- package/lib/utils/error.js +1063 -0
- package/lib/utils/index.js +217 -0
- package/lib/utils/jwt.js +355 -0
- package/lib/utils/validator.js +271 -0
- package/package.json +122 -0
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
/*! firebase-admin v9.12.0 */
|
|
2
|
+
"use strict";
|
|
3
|
+
/*!
|
|
4
|
+
* @license
|
|
5
|
+
* Copyright 2017 Google Inc.
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.UserRecord = exports.UserInfo = exports.UserMetadata = exports.MultiFactor = 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");
|
|
38
|
+
/**
|
|
39
|
+
* 'REDACTED', encoded as a base64 string.
|
|
40
|
+
*/
|
|
41
|
+
var B64_REDACTED = Buffer.from('REDACTED').toString('base64');
|
|
42
|
+
/**
|
|
43
|
+
* Parses a time stamp string or number and returns the corresponding date if valid.
|
|
44
|
+
*
|
|
45
|
+
* @param {any} time The unix timestamp string or number in milliseconds.
|
|
46
|
+
* @return {string} The corresponding date as a UTC string, if valid. Otherwise, null.
|
|
47
|
+
*/
|
|
48
|
+
function parseDate(time) {
|
|
49
|
+
try {
|
|
50
|
+
var date = new Date(parseInt(time, 10));
|
|
51
|
+
if (!isNaN(date.getTime())) {
|
|
52
|
+
return date.toUTCString();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
catch (e) {
|
|
56
|
+
// Do nothing. null will be returned.
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
var MultiFactorId;
|
|
61
|
+
(function (MultiFactorId) {
|
|
62
|
+
MultiFactorId["Phone"] = "phone";
|
|
63
|
+
})(MultiFactorId || (MultiFactorId = {}));
|
|
64
|
+
/**
|
|
65
|
+
* Abstract class representing a multi-factor info interface.
|
|
66
|
+
*/
|
|
67
|
+
var MultiFactorInfo = /** @class */ (function () {
|
|
68
|
+
/**
|
|
69
|
+
* Initializes the MultiFactorInfo object using the server side response.
|
|
70
|
+
*
|
|
71
|
+
* @param response The server side response.
|
|
72
|
+
* @constructor
|
|
73
|
+
*/
|
|
74
|
+
function MultiFactorInfo(response) {
|
|
75
|
+
this.initFromServerResponse(response);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Initializes the MultiFactorInfo associated subclass using the server side.
|
|
79
|
+
* If no MultiFactorInfo is associated with the response, null is returned.
|
|
80
|
+
*
|
|
81
|
+
* @param response The server side response.
|
|
82
|
+
* @constructor
|
|
83
|
+
*/
|
|
84
|
+
MultiFactorInfo.initMultiFactorInfo = function (response) {
|
|
85
|
+
var multiFactorInfo = null;
|
|
86
|
+
// Only PhoneMultiFactorInfo currently available.
|
|
87
|
+
try {
|
|
88
|
+
multiFactorInfo = new PhoneMultiFactorInfo(response);
|
|
89
|
+
}
|
|
90
|
+
catch (e) {
|
|
91
|
+
// Ignore error.
|
|
92
|
+
}
|
|
93
|
+
return multiFactorInfo;
|
|
94
|
+
};
|
|
95
|
+
/** @return The plain object representation. */
|
|
96
|
+
MultiFactorInfo.prototype.toJSON = function () {
|
|
97
|
+
return {
|
|
98
|
+
uid: this.uid,
|
|
99
|
+
displayName: this.displayName,
|
|
100
|
+
factorId: this.factorId,
|
|
101
|
+
enrollmentTime: this.enrollmentTime,
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Initializes the MultiFactorInfo object using the provided server response.
|
|
106
|
+
*
|
|
107
|
+
* @param response The server side response.
|
|
108
|
+
*/
|
|
109
|
+
MultiFactorInfo.prototype.initFromServerResponse = function (response) {
|
|
110
|
+
var factorId = response && this.getFactorId(response);
|
|
111
|
+
if (!factorId || !response || !response.mfaEnrollmentId) {
|
|
112
|
+
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Invalid multi-factor info response');
|
|
113
|
+
}
|
|
114
|
+
utils.addReadonlyGetter(this, 'uid', response.mfaEnrollmentId);
|
|
115
|
+
utils.addReadonlyGetter(this, 'factorId', factorId);
|
|
116
|
+
utils.addReadonlyGetter(this, 'displayName', response.displayName);
|
|
117
|
+
// Encoded using [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format.
|
|
118
|
+
// For example, "2017-01-15T01:30:15.01Z".
|
|
119
|
+
// This can be parsed directly via Date constructor.
|
|
120
|
+
// This can be computed using Data.prototype.toISOString.
|
|
121
|
+
if (response.enrolledAt) {
|
|
122
|
+
utils.addReadonlyGetter(this, 'enrollmentTime', new Date(response.enrolledAt).toUTCString());
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
utils.addReadonlyGetter(this, 'enrollmentTime', null);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
return MultiFactorInfo;
|
|
129
|
+
}());
|
|
130
|
+
exports.MultiFactorInfo = MultiFactorInfo;
|
|
131
|
+
/** Class representing a phone MultiFactorInfo object. */
|
|
132
|
+
var PhoneMultiFactorInfo = /** @class */ (function (_super) {
|
|
133
|
+
__extends(PhoneMultiFactorInfo, _super);
|
|
134
|
+
/**
|
|
135
|
+
* Initializes the PhoneMultiFactorInfo object using the server side response.
|
|
136
|
+
*
|
|
137
|
+
* @param response The server side response.
|
|
138
|
+
* @constructor
|
|
139
|
+
*/
|
|
140
|
+
function PhoneMultiFactorInfo(response) {
|
|
141
|
+
var _this = _super.call(this, response) || this;
|
|
142
|
+
utils.addReadonlyGetter(_this, 'phoneNumber', response.phoneInfo);
|
|
143
|
+
return _this;
|
|
144
|
+
}
|
|
145
|
+
/** @return The plain object representation. */
|
|
146
|
+
PhoneMultiFactorInfo.prototype.toJSON = function () {
|
|
147
|
+
return Object.assign(_super.prototype.toJSON.call(this), {
|
|
148
|
+
phoneNumber: this.phoneNumber,
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Returns the factor ID based on the response provided.
|
|
153
|
+
*
|
|
154
|
+
* @param response The server side response.
|
|
155
|
+
* @return The multi-factor ID associated with the provided response. If the response is
|
|
156
|
+
* not associated with any known multi-factor ID, null is returned.
|
|
157
|
+
*/
|
|
158
|
+
PhoneMultiFactorInfo.prototype.getFactorId = function (response) {
|
|
159
|
+
return (response && response.phoneInfo) ? MultiFactorId.Phone : null;
|
|
160
|
+
};
|
|
161
|
+
return PhoneMultiFactorInfo;
|
|
162
|
+
}(MultiFactorInfo));
|
|
163
|
+
exports.PhoneMultiFactorInfo = PhoneMultiFactorInfo;
|
|
164
|
+
/** Class representing multi-factor related properties of a user. */
|
|
165
|
+
var MultiFactor = /** @class */ (function () {
|
|
166
|
+
/**
|
|
167
|
+
* Initializes the MultiFactor object using the server side or JWT format response.
|
|
168
|
+
*
|
|
169
|
+
* @param response The server side response.
|
|
170
|
+
* @constructor
|
|
171
|
+
*/
|
|
172
|
+
function MultiFactor(response) {
|
|
173
|
+
var parsedEnrolledFactors = [];
|
|
174
|
+
if (!validator_1.isNonNullObject(response)) {
|
|
175
|
+
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Invalid multi-factor response');
|
|
176
|
+
}
|
|
177
|
+
else if (response.mfaInfo) {
|
|
178
|
+
response.mfaInfo.forEach(function (factorResponse) {
|
|
179
|
+
var multiFactorInfo = MultiFactorInfo.initMultiFactorInfo(factorResponse);
|
|
180
|
+
if (multiFactorInfo) {
|
|
181
|
+
parsedEnrolledFactors.push(multiFactorInfo);
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
// Make enrolled factors immutable.
|
|
186
|
+
utils.addReadonlyGetter(this, 'enrolledFactors', Object.freeze(parsedEnrolledFactors));
|
|
187
|
+
}
|
|
188
|
+
/** @return The plain object representation. */
|
|
189
|
+
MultiFactor.prototype.toJSON = function () {
|
|
190
|
+
return {
|
|
191
|
+
enrolledFactors: this.enrolledFactors.map(function (info) { return info.toJSON(); }),
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
return MultiFactor;
|
|
195
|
+
}());
|
|
196
|
+
exports.MultiFactor = MultiFactor;
|
|
197
|
+
/**
|
|
198
|
+
* User metadata class that provides metadata information like user account creation
|
|
199
|
+
* and last sign in time.
|
|
200
|
+
*
|
|
201
|
+
* @param response The server side response returned from the getAccountInfo
|
|
202
|
+
* endpoint.
|
|
203
|
+
* @constructor
|
|
204
|
+
*/
|
|
205
|
+
var UserMetadata = /** @class */ (function () {
|
|
206
|
+
function UserMetadata(response) {
|
|
207
|
+
// Creation date should always be available but due to some backend bugs there
|
|
208
|
+
// were cases in the past where users did not have creation date properly set.
|
|
209
|
+
// This included legacy Firebase migrating project users and some anonymous users.
|
|
210
|
+
// These bugs have already been addressed since then.
|
|
211
|
+
utils.addReadonlyGetter(this, 'creationTime', parseDate(response.createdAt));
|
|
212
|
+
utils.addReadonlyGetter(this, 'lastSignInTime', parseDate(response.lastLoginAt));
|
|
213
|
+
var lastRefreshAt = response.lastRefreshAt ? new Date(response.lastRefreshAt).toUTCString() : null;
|
|
214
|
+
utils.addReadonlyGetter(this, 'lastRefreshTime', lastRefreshAt);
|
|
215
|
+
}
|
|
216
|
+
/** @return The plain object representation of the user's metadata. */
|
|
217
|
+
UserMetadata.prototype.toJSON = function () {
|
|
218
|
+
return {
|
|
219
|
+
lastSignInTime: this.lastSignInTime,
|
|
220
|
+
creationTime: this.creationTime,
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
return UserMetadata;
|
|
224
|
+
}());
|
|
225
|
+
exports.UserMetadata = UserMetadata;
|
|
226
|
+
/**
|
|
227
|
+
* User info class that provides provider user information for different
|
|
228
|
+
* Firebase providers like google.com, facebook.com, password, etc.
|
|
229
|
+
*
|
|
230
|
+
* @param response The server side response returned from the getAccountInfo
|
|
231
|
+
* endpoint.
|
|
232
|
+
* @constructor
|
|
233
|
+
*/
|
|
234
|
+
var UserInfo = /** @class */ (function () {
|
|
235
|
+
function UserInfo(response) {
|
|
236
|
+
// Provider user id and provider id are required.
|
|
237
|
+
if (!response.rawId || !response.providerId) {
|
|
238
|
+
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Invalid user info response');
|
|
239
|
+
}
|
|
240
|
+
utils.addReadonlyGetter(this, 'uid', response.rawId);
|
|
241
|
+
utils.addReadonlyGetter(this, 'displayName', response.displayName);
|
|
242
|
+
utils.addReadonlyGetter(this, 'email', response.email);
|
|
243
|
+
utils.addReadonlyGetter(this, 'photoURL', response.photoUrl);
|
|
244
|
+
utils.addReadonlyGetter(this, 'providerId', response.providerId);
|
|
245
|
+
utils.addReadonlyGetter(this, 'phoneNumber', response.phoneNumber);
|
|
246
|
+
}
|
|
247
|
+
/** @return The plain object representation of the current provider data. */
|
|
248
|
+
UserInfo.prototype.toJSON = function () {
|
|
249
|
+
return {
|
|
250
|
+
uid: this.uid,
|
|
251
|
+
displayName: this.displayName,
|
|
252
|
+
email: this.email,
|
|
253
|
+
photoURL: this.photoURL,
|
|
254
|
+
providerId: this.providerId,
|
|
255
|
+
phoneNumber: this.phoneNumber,
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
return UserInfo;
|
|
259
|
+
}());
|
|
260
|
+
exports.UserInfo = UserInfo;
|
|
261
|
+
/**
|
|
262
|
+
* User record class that defines the Firebase user object populated from
|
|
263
|
+
* the Firebase Auth getAccountInfo response.
|
|
264
|
+
*
|
|
265
|
+
* @param response The server side response returned from the getAccountInfo
|
|
266
|
+
* endpoint.
|
|
267
|
+
* @constructor
|
|
268
|
+
*/
|
|
269
|
+
var UserRecord = /** @class */ (function () {
|
|
270
|
+
function UserRecord(response) {
|
|
271
|
+
// The Firebase user id is required.
|
|
272
|
+
if (!response.localId) {
|
|
273
|
+
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Invalid user response');
|
|
274
|
+
}
|
|
275
|
+
utils.addReadonlyGetter(this, 'uid', response.localId);
|
|
276
|
+
utils.addReadonlyGetter(this, 'email', response.email);
|
|
277
|
+
utils.addReadonlyGetter(this, 'emailVerified', !!response.emailVerified);
|
|
278
|
+
utils.addReadonlyGetter(this, 'displayName', response.displayName);
|
|
279
|
+
utils.addReadonlyGetter(this, 'photoURL', response.photoUrl);
|
|
280
|
+
utils.addReadonlyGetter(this, 'phoneNumber', response.phoneNumber);
|
|
281
|
+
// If disabled is not provided, the account is enabled by default.
|
|
282
|
+
utils.addReadonlyGetter(this, 'disabled', response.disabled || false);
|
|
283
|
+
utils.addReadonlyGetter(this, 'metadata', new UserMetadata(response));
|
|
284
|
+
var providerData = [];
|
|
285
|
+
for (var _i = 0, _a = (response.providerUserInfo || []); _i < _a.length; _i++) {
|
|
286
|
+
var entry = _a[_i];
|
|
287
|
+
providerData.push(new UserInfo(entry));
|
|
288
|
+
}
|
|
289
|
+
utils.addReadonlyGetter(this, 'providerData', providerData);
|
|
290
|
+
// If the password hash is redacted (probably due to missing permissions)
|
|
291
|
+
// then clear it out, similar to how the salt is returned. (Otherwise, it
|
|
292
|
+
// *looks* like a b64-encoded hash is present, which is confusing.)
|
|
293
|
+
if (response.passwordHash === B64_REDACTED) {
|
|
294
|
+
utils.addReadonlyGetter(this, 'passwordHash', undefined);
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
utils.addReadonlyGetter(this, 'passwordHash', response.passwordHash);
|
|
298
|
+
}
|
|
299
|
+
utils.addReadonlyGetter(this, 'passwordSalt', response.salt);
|
|
300
|
+
if (response.customAttributes) {
|
|
301
|
+
utils.addReadonlyGetter(this, 'customClaims', JSON.parse(response.customAttributes));
|
|
302
|
+
}
|
|
303
|
+
var validAfterTime = null;
|
|
304
|
+
// Convert validSince first to UTC milliseconds and then to UTC date string.
|
|
305
|
+
if (typeof response.validSince !== 'undefined') {
|
|
306
|
+
validAfterTime = parseDate(parseInt(response.validSince, 10) * 1000);
|
|
307
|
+
}
|
|
308
|
+
utils.addReadonlyGetter(this, 'tokensValidAfterTime', validAfterTime || undefined);
|
|
309
|
+
utils.addReadonlyGetter(this, 'tenantId', response.tenantId);
|
|
310
|
+
var multiFactor = new MultiFactor(response);
|
|
311
|
+
if (multiFactor.enrolledFactors.length > 0) {
|
|
312
|
+
utils.addReadonlyGetter(this, 'multiFactor', multiFactor);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
/** @return The plain object representation of the user record. */
|
|
316
|
+
UserRecord.prototype.toJSON = function () {
|
|
317
|
+
var json = {
|
|
318
|
+
uid: this.uid,
|
|
319
|
+
email: this.email,
|
|
320
|
+
emailVerified: this.emailVerified,
|
|
321
|
+
displayName: this.displayName,
|
|
322
|
+
photoURL: this.photoURL,
|
|
323
|
+
phoneNumber: this.phoneNumber,
|
|
324
|
+
disabled: this.disabled,
|
|
325
|
+
// Convert metadata to json.
|
|
326
|
+
metadata: this.metadata.toJSON(),
|
|
327
|
+
passwordHash: this.passwordHash,
|
|
328
|
+
passwordSalt: this.passwordSalt,
|
|
329
|
+
customClaims: deep_copy_1.deepCopy(this.customClaims),
|
|
330
|
+
tokensValidAfterTime: this.tokensValidAfterTime,
|
|
331
|
+
tenantId: this.tenantId,
|
|
332
|
+
};
|
|
333
|
+
if (this.multiFactor) {
|
|
334
|
+
json.multiFactor = this.multiFactor.toJSON();
|
|
335
|
+
}
|
|
336
|
+
json.providerData = [];
|
|
337
|
+
for (var _i = 0, _a = this.providerData; _i < _a.length; _i++) {
|
|
338
|
+
var entry = _a[_i];
|
|
339
|
+
// Convert each provider data to json.
|
|
340
|
+
json.providerData.push(entry.toJSON());
|
|
341
|
+
}
|
|
342
|
+
return json;
|
|
343
|
+
};
|
|
344
|
+
return UserRecord;
|
|
345
|
+
}());
|
|
346
|
+
exports.UserRecord = UserRecord;
|