firebase-admin 9.12.0 → 10.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.
- package/README.md +7 -3
- package/lib/app/core.d.ts +188 -0
- package/lib/app/core.js +19 -0
- package/lib/app/credential-factory.d.ts +123 -0
- package/lib/app/credential-factory.js +150 -0
- package/lib/app/credential-internal.d.ts +90 -0
- package/lib/{credential → app}/credential-internal.js +15 -13
- package/lib/app/credential.d.ts +45 -0
- package/lib/app/credential.js +19 -0
- package/lib/app/firebase-app.d.ts +51 -0
- package/lib/{firebase-app.js → app/firebase-app.js} +26 -156
- package/lib/app/firebase-namespace.d.ts +163 -0
- package/lib/{firebase-namespace.js → app/firebase-namespace.js} +99 -111
- package/lib/app/index.d.ts +27 -0
- package/lib/app/index.js +31 -0
- package/lib/app/lifecycle.d.ts +60 -0
- package/lib/app/lifecycle.js +165 -0
- package/lib/app-check/app-check-api-client-internal.d.ts +32 -0
- package/lib/app-check/app-check-api-client-internal.js +10 -10
- 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 +13 -10
- package/lib/app-check/index.d.ts +19 -126
- package/lib/app-check/index.js +45 -1
- package/lib/app-check/token-generator.d.ts +25 -0
- package/lib/app-check/token-generator.js +9 -9
- package/lib/app-check/token-verifier.d.ts +17 -0
- package/lib/app-check/token-verifier.js +6 -6
- package/lib/auth/action-code-settings-builder.d.ts +87 -0
- package/lib/auth/action-code-settings-builder.js +4 -2
- package/lib/auth/auth-api-request.d.ts +174 -0
- package/lib/auth/auth-api-request.js +197 -124
- package/lib/auth/auth-config.d.ts +575 -0
- package/lib/auth/auth-config.js +43 -34
- package/lib/auth/auth-namespace.d.ts +255 -0
- package/lib/auth/auth-namespace.js +18 -0
- package/lib/auth/auth.d.ts +40 -0
- package/lib/auth/auth.js +12 -772
- package/lib/auth/base-auth.d.ts +613 -0
- package/lib/auth/base-auth.js +951 -0
- package/lib/auth/identifier.d.ts +57 -0
- package/lib/auth/identifier.js +1 -1
- package/lib/auth/index.d.ts +25 -1897
- package/lib/auth/index.js +54 -1
- package/lib/auth/tenant-manager.d.ts +146 -0
- package/lib/auth/tenant-manager.js +151 -39
- package/lib/auth/tenant.d.ts +130 -0
- package/lib/auth/tenant.js +62 -16
- package/lib/auth/token-generator.d.ts +44 -0
- package/lib/auth/token-generator.js +11 -9
- package/lib/auth/token-verifier.d.ts +150 -0
- package/lib/auth/token-verifier.js +27 -15
- package/lib/auth/user-import-builder.d.ts +322 -0
- package/lib/auth/user-import-builder.js +9 -9
- package/lib/auth/user-record.d.ts +265 -0
- package/lib/auth/user-record.js +80 -45
- package/lib/credential/index.d.ts +24 -66
- package/lib/credential/index.js +101 -1
- package/lib/database/database-namespace.d.ts +95 -0
- package/lib/database/database-namespace.js +23 -0
- package/lib/database/database.d.ts +66 -0
- package/lib/database/{database-internal.js → database.js} +16 -9
- package/lib/database/index.d.ts +55 -54
- package/lib/database/index.js +84 -13
- package/lib/{firebase-namespace.d.ts → default-namespace.d.ts} +7 -14
- package/lib/default-namespace.js +4 -5
- 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 +23 -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 +34 -186
- package/lib/firebase-namespace-api.js +37 -2
- package/lib/firestore/firestore-internal.d.ts +32 -0
- package/lib/firestore/firestore-internal.js +3 -3
- package/lib/firestore/firestore-namespace.d.ts +50 -0
- package/lib/firestore/firestore-namespace.js +47 -0
- package/lib/firestore/index.d.ts +37 -35
- package/lib/firestore/index.js +61 -30
- package/lib/index.d.ts +2 -2
- package/lib/index.js +1 -1
- package/lib/installations/index.d.ts +34 -63
- package/lib/installations/index.js +45 -1
- package/lib/installations/installations-namespace.d.ts +55 -0
- package/lib/installations/installations-namespace.js +18 -0
- package/lib/installations/installations-request-handler.d.ts +43 -0
- package/lib/installations/installations-request-handler.js +4 -4
- package/lib/installations/installations.d.ts +38 -0
- package/lib/installations/installations.js +6 -5
- package/lib/instance-id/index.d.ts +23 -45
- package/lib/instance-id/index.js +54 -1
- package/lib/instance-id/instance-id-namespace.d.ts +38 -0
- package/lib/instance-id/instance-id-namespace.js +3 -0
- package/lib/instance-id/instance-id.d.ts +47 -0
- package/lib/instance-id/instance-id.js +14 -19
- package/lib/machine-learning/index.d.ts +19 -216
- package/lib/machine-learning/index.js +46 -1
- package/lib/machine-learning/machine-learning-api-client.d.ts +102 -0
- package/lib/machine-learning/machine-learning-api-client.js +6 -6
- package/lib/machine-learning/machine-learning-namespace.d.ts +85 -0
- package/lib/machine-learning/machine-learning-namespace.js +18 -0
- package/lib/machine-learning/machine-learning-utils.d.ts +22 -0
- package/lib/machine-learning/machine-learning-utils.js +1 -1
- package/lib/machine-learning/machine-learning.d.ts +181 -0
- package/lib/machine-learning/machine-learning.js +72 -37
- package/lib/messaging/batch-request-internal.d.ts +55 -0
- package/lib/messaging/batch-request-internal.js +9 -9
- package/lib/messaging/index.d.ts +18 -1140
- package/lib/messaging/index.js +45 -1
- package/lib/messaging/messaging-api-request-internal.d.ts +50 -0
- package/lib/messaging/messaging-api-request-internal.js +8 -8
- package/lib/messaging/messaging-api.d.ts +980 -0
- package/lib/messaging/messaging-api.js +19 -0
- package/lib/messaging/messaging-errors-internal.d.ts +31 -0
- package/lib/messaging/messaging-errors-internal.js +7 -7
- package/lib/messaging/messaging-internal.d.ts +27 -0
- package/lib/messaging/messaging-internal.js +2 -2
- package/lib/messaging/messaging-namespace.d.ts +181 -0
- package/lib/messaging/messaging-namespace.js +18 -0
- package/lib/messaging/messaging.d.ts +269 -0
- package/lib/messaging/messaging.js +83 -91
- package/lib/project-management/android-app.d.ts +110 -0
- package/lib/project-management/android-app.js +24 -15
- package/lib/project-management/app-metadata.d.ts +85 -0
- package/lib/project-management/app-metadata.js +37 -0
- package/lib/project-management/index.d.ts +21 -331
- package/lib/project-management/index.js +51 -24
- package/lib/project-management/ios-app.d.ts +66 -0
- package/lib/project-management/ios-app.js +15 -8
- package/lib/project-management/project-management-api-request-internal.d.ts +17 -0
- package/lib/project-management/project-management-api-request-internal.js +15 -15
- package/lib/project-management/project-management-namespace.d.ts +82 -0
- package/lib/project-management/project-management-namespace.js +18 -0
- package/lib/project-management/project-management.d.ts +115 -0
- package/lib/project-management/project-management.js +22 -25
- package/lib/remote-config/index.d.ts +19 -336
- package/lib/remote-config/index.js +45 -1
- package/lib/remote-config/remote-config-api-client-internal.d.ts +28 -0
- package/lib/remote-config/remote-config-api-client-internal.js +3 -3
- package/lib/remote-config/remote-config-api.d.ts +258 -0
- package/lib/remote-config/remote-config-api.js +18 -0
- package/lib/remote-config/remote-config-namespace.d.ts +105 -0
- package/lib/remote-config/remote-config-namespace.js +18 -0
- package/lib/remote-config/remote-config.d.ts +94 -0
- package/lib/remote-config/remote-config.js +27 -26
- package/lib/security-rules/index.d.ts +18 -184
- package/lib/security-rules/index.js +46 -1
- package/lib/security-rules/security-rules-api-client-internal.d.ts +73 -0
- package/lib/security-rules/security-rules-api-client-internal.js +1 -1
- package/lib/security-rules/security-rules-internal.d.ts +21 -0
- package/lib/security-rules/security-rules-internal.js +1 -1
- package/lib/security-rules/security-rules-namespace.d.ts +69 -0
- package/lib/security-rules/security-rules-namespace.js +18 -0
- package/lib/security-rules/security-rules.d.ts +196 -0
- package/lib/security-rules/security-rules.js +73 -55
- package/lib/storage/index.d.ts +16 -32
- package/lib/storage/index.js +38 -1
- package/lib/storage/storage-namespace.d.ts +45 -0
- package/lib/storage/storage-namespace.js +18 -0
- package/lib/storage/storage.d.ts +42 -0
- package/lib/storage/storage.js +9 -6
- package/lib/utils/api-request.d.ts +230 -0
- package/lib/utils/api-request.js +25 -25
- package/lib/utils/crypto-signer.d.ts +128 -0
- package/lib/utils/crypto-signer.js +9 -9
- package/lib/utils/deep-copy.d.ts +40 -0
- package/lib/utils/deep-copy.js +6 -6
- package/lib/utils/error.d.ts +650 -0
- package/lib/utils/error.js +34 -34
- package/lib/utils/index.d.ts +105 -0
- package/lib/utils/index.js +22 -21
- package/lib/utils/jwt.d.ts +131 -0
- package/lib/utils/jwt.js +11 -11
- package/lib/utils/validator.d.ts +144 -0
- package/lib/utils/validator.js +37 -37
- package/package.json +110 -8
- package/lib/credential/credential.js +0 -44
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* @license
|
|
@@ -33,14 +33,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
33
33
|
exports.useEmulator = exports.TenantAwareAuthRequestHandler = exports.AuthRequestHandler = exports.AbstractAuthRequestHandler = exports.FIREBASE_AUTH_SIGN_UP_NEW_USER = exports.FIREBASE_AUTH_SET_ACCOUNT_INFO = exports.FIREBASE_AUTH_BATCH_DELETE_ACCOUNTS = exports.FIREBASE_AUTH_DELETE_ACCOUNT = exports.FIREBASE_AUTH_GET_ACCOUNTS_INFO = exports.FIREBASE_AUTH_GET_ACCOUNT_INFO = exports.FIREBASE_AUTH_DOWNLOAD_ACCOUNT = exports.FIREBASE_AUTH_UPLOAD_ACCOUNT = exports.FIREBASE_AUTH_CREATE_SESSION_COOKIE = exports.EMAIL_ACTION_REQUEST_TYPES = exports.RESERVED_CLAIMS = void 0;
|
|
34
34
|
var validator = require("../utils/validator");
|
|
35
35
|
var deep_copy_1 = require("../utils/deep-copy");
|
|
36
|
-
var identifier_1 = require("./identifier");
|
|
37
36
|
var error_1 = require("../utils/error");
|
|
38
37
|
var api_request_1 = require("../utils/api-request");
|
|
39
|
-
var user_import_builder_1 = require("./user-import-builder");
|
|
40
38
|
var utils = require("../utils/index");
|
|
39
|
+
var user_import_builder_1 = require("./user-import-builder");
|
|
41
40
|
var action_code_settings_builder_1 = require("./action-code-settings-builder");
|
|
42
|
-
var auth_config_1 = require("./auth-config");
|
|
43
41
|
var tenant_1 = require("./tenant");
|
|
42
|
+
var identifier_1 = require("./identifier");
|
|
43
|
+
var auth_config_1 = require("./auth-config");
|
|
44
44
|
/** Firebase Auth request header. */
|
|
45
45
|
var FIREBASE_AUTH_HEADER = {
|
|
46
46
|
'X-Client-Version': "Node/Admin/" + utils.getSdkVersion(),
|
|
@@ -96,8 +96,8 @@ var AuthResourceUrlBuilder = /** @class */ (function () {
|
|
|
96
96
|
/**
|
|
97
97
|
* The resource URL builder constructor.
|
|
98
98
|
*
|
|
99
|
-
* @param
|
|
100
|
-
* @param
|
|
99
|
+
* @param projectId - The resource project ID.
|
|
100
|
+
* @param version - The endpoint API version.
|
|
101
101
|
* @constructor
|
|
102
102
|
*/
|
|
103
103
|
function AuthResourceUrlBuilder(app, version) {
|
|
@@ -116,10 +116,10 @@ var AuthResourceUrlBuilder = /** @class */ (function () {
|
|
|
116
116
|
/**
|
|
117
117
|
* Returns the resource URL corresponding to the provided parameters.
|
|
118
118
|
*
|
|
119
|
-
* @param
|
|
120
|
-
* @param
|
|
119
|
+
* @param api - The backend API name.
|
|
120
|
+
* @param params - The optional additional parameters to substitute in the
|
|
121
121
|
* URL path.
|
|
122
|
-
* @
|
|
122
|
+
* @returns The corresponding resource URL.
|
|
123
123
|
*/
|
|
124
124
|
AuthResourceUrlBuilder.prototype.getUrl = function (api, params) {
|
|
125
125
|
var _this = this;
|
|
@@ -159,9 +159,9 @@ var TenantAwareAuthResourceUrlBuilder = /** @class */ (function (_super) {
|
|
|
159
159
|
/**
|
|
160
160
|
* The tenant aware resource URL builder constructor.
|
|
161
161
|
*
|
|
162
|
-
* @param
|
|
163
|
-
* @param
|
|
164
|
-
* @param
|
|
162
|
+
* @param projectId - The resource project ID.
|
|
163
|
+
* @param version - The endpoint API version.
|
|
164
|
+
* @param tenantId - The tenant ID.
|
|
165
165
|
* @constructor
|
|
166
166
|
*/
|
|
167
167
|
function TenantAwareAuthResourceUrlBuilder(app, version, tenantId) {
|
|
@@ -182,10 +182,10 @@ var TenantAwareAuthResourceUrlBuilder = /** @class */ (function (_super) {
|
|
|
182
182
|
/**
|
|
183
183
|
* Returns the resource URL corresponding to the provided parameters.
|
|
184
184
|
*
|
|
185
|
-
* @param
|
|
186
|
-
* @param
|
|
185
|
+
* @param api - The backend API name.
|
|
186
|
+
* @param params - The optional additional parameters to substitute in the
|
|
187
187
|
* URL path.
|
|
188
|
-
* @
|
|
188
|
+
* @returns The corresponding resource URL.
|
|
189
189
|
*/
|
|
190
190
|
TenantAwareAuthResourceUrlBuilder.prototype.getUrl = function (api, params) {
|
|
191
191
|
var _this = this;
|
|
@@ -218,7 +218,7 @@ var AuthHttpClient = /** @class */ (function (_super) {
|
|
|
218
218
|
* are removed from the original request. If an invalid field is passed
|
|
219
219
|
* an error is thrown.
|
|
220
220
|
*
|
|
221
|
-
* @param request The AuthFactorInfo request object.
|
|
221
|
+
* @param request - The AuthFactorInfo request object.
|
|
222
222
|
*/
|
|
223
223
|
function validateAuthFactorInfo(request) {
|
|
224
224
|
var validKeys = {
|
|
@@ -269,7 +269,7 @@ function validateAuthFactorInfo(request) {
|
|
|
269
269
|
* are removed from the original request. If an invalid field is passed
|
|
270
270
|
* an error is thrown.
|
|
271
271
|
*
|
|
272
|
-
* @param
|
|
272
|
+
* @param request - The providerUserInfo request object.
|
|
273
273
|
*/
|
|
274
274
|
function validateProviderUserInfo(request) {
|
|
275
275
|
var validKeys = {
|
|
@@ -314,8 +314,8 @@ function validateProviderUserInfo(request) {
|
|
|
314
314
|
* are removed from the original request. If an invalid field is passed
|
|
315
315
|
* an error is thrown.
|
|
316
316
|
*
|
|
317
|
-
* @param request The create/edit request object.
|
|
318
|
-
* @param writeOperationType The write operation type.
|
|
317
|
+
* @param request - The create/edit request object.
|
|
318
|
+
* @param writeOperationType - The write operation type.
|
|
319
319
|
*/
|
|
320
320
|
function validateCreateEditRequest(request, writeOperationType) {
|
|
321
321
|
var uploadAccountRequest = writeOperationType === WriteOperationType.Upload;
|
|
@@ -505,7 +505,11 @@ function validateCreateEditRequest(request, writeOperationType) {
|
|
|
505
505
|
});
|
|
506
506
|
}
|
|
507
507
|
}
|
|
508
|
-
/**
|
|
508
|
+
/**
|
|
509
|
+
* Instantiates the createSessionCookie endpoint settings.
|
|
510
|
+
*
|
|
511
|
+
* @internal
|
|
512
|
+
*/
|
|
509
513
|
exports.FIREBASE_AUTH_CREATE_SESSION_COOKIE = new api_request_1.ApiSettings(':createSessionCookie', 'POST')
|
|
510
514
|
// Set request validator.
|
|
511
515
|
.setRequestValidator(function (request) {
|
|
@@ -527,9 +531,17 @@ exports.FIREBASE_AUTH_CREATE_SESSION_COOKIE = new api_request_1.ApiSettings(':cr
|
|
|
527
531
|
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR);
|
|
528
532
|
}
|
|
529
533
|
});
|
|
530
|
-
/**
|
|
534
|
+
/**
|
|
535
|
+
* Instantiates the uploadAccount endpoint settings.
|
|
536
|
+
*
|
|
537
|
+
* @internal
|
|
538
|
+
*/
|
|
531
539
|
exports.FIREBASE_AUTH_UPLOAD_ACCOUNT = new api_request_1.ApiSettings('/accounts:batchCreate', 'POST');
|
|
532
|
-
/**
|
|
540
|
+
/**
|
|
541
|
+
* Instantiates the downloadAccount endpoint settings.
|
|
542
|
+
*
|
|
543
|
+
* @internal
|
|
544
|
+
*/
|
|
533
545
|
exports.FIREBASE_AUTH_DOWNLOAD_ACCOUNT = new api_request_1.ApiSettings('/accounts:batchGet', 'GET')
|
|
534
546
|
// Set request validator.
|
|
535
547
|
.setRequestValidator(function (request) {
|
|
@@ -546,7 +558,11 @@ exports.FIREBASE_AUTH_DOWNLOAD_ACCOUNT = new api_request_1.ApiSettings('/account
|
|
|
546
558
|
(MAX_DOWNLOAD_ACCOUNT_PAGE_SIZE + "."));
|
|
547
559
|
}
|
|
548
560
|
});
|
|
549
|
-
/**
|
|
561
|
+
/**
|
|
562
|
+
* Instantiates the getAccountInfo endpoint settings.
|
|
563
|
+
*
|
|
564
|
+
* @internal
|
|
565
|
+
*/
|
|
550
566
|
exports.FIREBASE_AUTH_GET_ACCOUNT_INFO = new api_request_1.ApiSettings('/accounts:lookup', 'POST')
|
|
551
567
|
// Set request validator.
|
|
552
568
|
.setRequestValidator(function (request) {
|
|
@@ -563,6 +579,8 @@ exports.FIREBASE_AUTH_GET_ACCOUNT_INFO = new api_request_1.ApiSettings('/account
|
|
|
563
579
|
/**
|
|
564
580
|
* Instantiates the getAccountInfo endpoint settings for use when fetching info
|
|
565
581
|
* for multiple accounts.
|
|
582
|
+
*
|
|
583
|
+
* @internal
|
|
566
584
|
*/
|
|
567
585
|
exports.FIREBASE_AUTH_GET_ACCOUNTS_INFO = new api_request_1.ApiSettings('/accounts:lookup', 'POST')
|
|
568
586
|
// Set request validator.
|
|
@@ -571,7 +589,11 @@ exports.FIREBASE_AUTH_GET_ACCOUNTS_INFO = new api_request_1.ApiSettings('/accoun
|
|
|
571
589
|
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Server request is missing user identifier');
|
|
572
590
|
}
|
|
573
591
|
});
|
|
574
|
-
/**
|
|
592
|
+
/**
|
|
593
|
+
* Instantiates the deleteAccount endpoint settings.
|
|
594
|
+
*
|
|
595
|
+
* @internal
|
|
596
|
+
*/
|
|
575
597
|
exports.FIREBASE_AUTH_DELETE_ACCOUNT = new api_request_1.ApiSettings('/accounts:delete', 'POST')
|
|
576
598
|
// Set request validator.
|
|
577
599
|
.setRequestValidator(function (request) {
|
|
@@ -579,6 +601,9 @@ exports.FIREBASE_AUTH_DELETE_ACCOUNT = new api_request_1.ApiSettings('/accounts:
|
|
|
579
601
|
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Server request is missing user identifier');
|
|
580
602
|
}
|
|
581
603
|
});
|
|
604
|
+
/**
|
|
605
|
+
* @internal
|
|
606
|
+
*/
|
|
582
607
|
exports.FIREBASE_AUTH_BATCH_DELETE_ACCOUNTS = new api_request_1.ApiSettings('/accounts:batchDelete', 'POST')
|
|
583
608
|
.setRequestValidator(function (request) {
|
|
584
609
|
if (!request.localIds) {
|
|
@@ -600,7 +625,11 @@ exports.FIREBASE_AUTH_BATCH_DELETE_ACCOUNTS = new api_request_1.ApiSettings('/ac
|
|
|
600
625
|
// Allow the (error) message to be missing/undef.
|
|
601
626
|
});
|
|
602
627
|
});
|
|
603
|
-
/**
|
|
628
|
+
/**
|
|
629
|
+
* Instantiates the setAccountInfo endpoint settings for updating existing accounts.
|
|
630
|
+
*
|
|
631
|
+
* @internal
|
|
632
|
+
*/
|
|
604
633
|
exports.FIREBASE_AUTH_SET_ACCOUNT_INFO = new api_request_1.ApiSettings('/accounts:update', 'POST')
|
|
605
634
|
// Set request validator.
|
|
606
635
|
.setRequestValidator(function (request) {
|
|
@@ -624,6 +653,8 @@ exports.FIREBASE_AUTH_SET_ACCOUNT_INFO = new api_request_1.ApiSettings('/account
|
|
|
624
653
|
/**
|
|
625
654
|
* Instantiates the signupNewUser endpoint settings for creating a new user with or without
|
|
626
655
|
* uid being specified. The backend will create a new one if not provided and return it.
|
|
656
|
+
*
|
|
657
|
+
* @internal
|
|
627
658
|
*/
|
|
628
659
|
exports.FIREBASE_AUTH_SIGN_UP_NEW_USER = new api_request_1.ApiSettings('/accounts', 'POST')
|
|
629
660
|
// Set request validator.
|
|
@@ -666,7 +697,11 @@ var FIREBASE_AUTH_GET_OOB_CODE = new api_request_1.ApiSettings('/accounts:sendOo
|
|
|
666
697
|
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Unable to create the email action link');
|
|
667
698
|
}
|
|
668
699
|
});
|
|
669
|
-
/**
|
|
700
|
+
/**
|
|
701
|
+
* Instantiates the retrieve OIDC configuration endpoint settings.
|
|
702
|
+
*
|
|
703
|
+
* @internal
|
|
704
|
+
*/
|
|
670
705
|
var GET_OAUTH_IDP_CONFIG = new api_request_1.ApiSettings('/oauthIdpConfigs/{providerId}', 'GET')
|
|
671
706
|
// Set response validator.
|
|
672
707
|
.setResponseValidator(function (response) {
|
|
@@ -675,9 +710,17 @@ var GET_OAUTH_IDP_CONFIG = new api_request_1.ApiSettings('/oauthIdpConfigs/{prov
|
|
|
675
710
|
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Unable to get OIDC configuration');
|
|
676
711
|
}
|
|
677
712
|
});
|
|
678
|
-
/**
|
|
713
|
+
/**
|
|
714
|
+
* Instantiates the delete OIDC configuration endpoint settings.
|
|
715
|
+
*
|
|
716
|
+
* @internal
|
|
717
|
+
*/
|
|
679
718
|
var DELETE_OAUTH_IDP_CONFIG = new api_request_1.ApiSettings('/oauthIdpConfigs/{providerId}', 'DELETE');
|
|
680
|
-
/**
|
|
719
|
+
/**
|
|
720
|
+
* Instantiates the create OIDC configuration endpoint settings.
|
|
721
|
+
*
|
|
722
|
+
* @internal
|
|
723
|
+
*/
|
|
681
724
|
var CREATE_OAUTH_IDP_CONFIG = new api_request_1.ApiSettings('/oauthIdpConfigs?oauthIdpConfigId={providerId}', 'POST')
|
|
682
725
|
// Set response validator.
|
|
683
726
|
.setResponseValidator(function (response) {
|
|
@@ -686,7 +729,11 @@ var CREATE_OAUTH_IDP_CONFIG = new api_request_1.ApiSettings('/oauthIdpConfigs?oa
|
|
|
686
729
|
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Unable to create new OIDC configuration');
|
|
687
730
|
}
|
|
688
731
|
});
|
|
689
|
-
/**
|
|
732
|
+
/**
|
|
733
|
+
* Instantiates the update OIDC configuration endpoint settings.
|
|
734
|
+
*
|
|
735
|
+
* @internal
|
|
736
|
+
*/
|
|
690
737
|
var UPDATE_OAUTH_IDP_CONFIG = new api_request_1.ApiSettings('/oauthIdpConfigs/{providerId}?updateMask={updateMask}', 'PATCH')
|
|
691
738
|
// Set response validator.
|
|
692
739
|
.setResponseValidator(function (response) {
|
|
@@ -695,7 +742,11 @@ var UPDATE_OAUTH_IDP_CONFIG = new api_request_1.ApiSettings('/oauthIdpConfigs/{p
|
|
|
695
742
|
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Unable to update OIDC configuration');
|
|
696
743
|
}
|
|
697
744
|
});
|
|
698
|
-
/**
|
|
745
|
+
/**
|
|
746
|
+
* Instantiates the list OIDC configuration endpoint settings.
|
|
747
|
+
*
|
|
748
|
+
* @internal
|
|
749
|
+
*/
|
|
699
750
|
var LIST_OAUTH_IDP_CONFIGS = new api_request_1.ApiSettings('/oauthIdpConfigs', 'GET')
|
|
700
751
|
// Set request validator.
|
|
701
752
|
.setRequestValidator(function (request) {
|
|
@@ -712,7 +763,11 @@ var LIST_OAUTH_IDP_CONFIGS = new api_request_1.ApiSettings('/oauthIdpConfigs', '
|
|
|
712
763
|
(MAX_LIST_PROVIDER_CONFIGURATION_PAGE_SIZE + "."));
|
|
713
764
|
}
|
|
714
765
|
});
|
|
715
|
-
/**
|
|
766
|
+
/**
|
|
767
|
+
* Instantiates the retrieve SAML configuration endpoint settings.
|
|
768
|
+
*
|
|
769
|
+
* @internal
|
|
770
|
+
*/
|
|
716
771
|
var GET_INBOUND_SAML_CONFIG = new api_request_1.ApiSettings('/inboundSamlConfigs/{providerId}', 'GET')
|
|
717
772
|
// Set response validator.
|
|
718
773
|
.setResponseValidator(function (response) {
|
|
@@ -721,9 +776,17 @@ var GET_INBOUND_SAML_CONFIG = new api_request_1.ApiSettings('/inboundSamlConfigs
|
|
|
721
776
|
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Unable to get SAML configuration');
|
|
722
777
|
}
|
|
723
778
|
});
|
|
724
|
-
/**
|
|
779
|
+
/**
|
|
780
|
+
* Instantiates the delete SAML configuration endpoint settings.
|
|
781
|
+
*
|
|
782
|
+
* @internal
|
|
783
|
+
*/
|
|
725
784
|
var DELETE_INBOUND_SAML_CONFIG = new api_request_1.ApiSettings('/inboundSamlConfigs/{providerId}', 'DELETE');
|
|
726
|
-
/**
|
|
785
|
+
/**
|
|
786
|
+
* Instantiates the create SAML configuration endpoint settings.
|
|
787
|
+
*
|
|
788
|
+
* @internal
|
|
789
|
+
*/
|
|
727
790
|
var CREATE_INBOUND_SAML_CONFIG = new api_request_1.ApiSettings('/inboundSamlConfigs?inboundSamlConfigId={providerId}', 'POST')
|
|
728
791
|
// Set response validator.
|
|
729
792
|
.setResponseValidator(function (response) {
|
|
@@ -732,7 +795,11 @@ var CREATE_INBOUND_SAML_CONFIG = new api_request_1.ApiSettings('/inboundSamlConf
|
|
|
732
795
|
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Unable to create new SAML configuration');
|
|
733
796
|
}
|
|
734
797
|
});
|
|
735
|
-
/**
|
|
798
|
+
/**
|
|
799
|
+
* Instantiates the update SAML configuration endpoint settings.
|
|
800
|
+
*
|
|
801
|
+
* @internal
|
|
802
|
+
*/
|
|
736
803
|
var UPDATE_INBOUND_SAML_CONFIG = new api_request_1.ApiSettings('/inboundSamlConfigs/{providerId}?updateMask={updateMask}', 'PATCH')
|
|
737
804
|
// Set response validator.
|
|
738
805
|
.setResponseValidator(function (response) {
|
|
@@ -741,7 +808,11 @@ var UPDATE_INBOUND_SAML_CONFIG = new api_request_1.ApiSettings('/inboundSamlConf
|
|
|
741
808
|
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Unable to update SAML configuration');
|
|
742
809
|
}
|
|
743
810
|
});
|
|
744
|
-
/**
|
|
811
|
+
/**
|
|
812
|
+
* Instantiates the list SAML configuration endpoint settings.
|
|
813
|
+
*
|
|
814
|
+
* @internal
|
|
815
|
+
*/
|
|
745
816
|
var LIST_INBOUND_SAML_CONFIGS = new api_request_1.ApiSettings('/inboundSamlConfigs', 'GET')
|
|
746
817
|
// Set request validator.
|
|
747
818
|
.setRequestValidator(function (request) {
|
|
@@ -760,10 +831,12 @@ var LIST_INBOUND_SAML_CONFIGS = new api_request_1.ApiSettings('/inboundSamlConfi
|
|
|
760
831
|
});
|
|
761
832
|
/**
|
|
762
833
|
* Class that provides the mechanism to send requests to the Firebase Auth backend endpoints.
|
|
834
|
+
*
|
|
835
|
+
* @internal
|
|
763
836
|
*/
|
|
764
837
|
var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
765
838
|
/**
|
|
766
|
-
* @param
|
|
839
|
+
* @param app - The app used to fetch access tokens to sign API requests.
|
|
767
840
|
* @constructor
|
|
768
841
|
*/
|
|
769
842
|
function AbstractAuthRequestHandler(app) {
|
|
@@ -774,8 +847,8 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
774
847
|
this.httpClient = new AuthHttpClient(app);
|
|
775
848
|
}
|
|
776
849
|
/**
|
|
777
|
-
* @param
|
|
778
|
-
* @
|
|
850
|
+
* @param response - The response to check for errors.
|
|
851
|
+
* @returns The error code if present; null otherwise.
|
|
779
852
|
*/
|
|
780
853
|
AbstractAuthRequestHandler.getErrorCode = function (response) {
|
|
781
854
|
return (validator.isNonNullObject(response) && response.error && response.error.message) || null;
|
|
@@ -822,10 +895,10 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
822
895
|
* session management (set as a server side session cookie with custom cookie policy).
|
|
823
896
|
* The session cookie JWT will have the same payload claims as the provided ID token.
|
|
824
897
|
*
|
|
825
|
-
* @param
|
|
826
|
-
* @param
|
|
898
|
+
* @param idToken - The Firebase ID token to exchange for a session cookie.
|
|
899
|
+
* @param expiresIn - The session cookie duration in milliseconds.
|
|
827
900
|
*
|
|
828
|
-
* @
|
|
901
|
+
* @returns A promise that resolves on success with the created session cookie.
|
|
829
902
|
*/
|
|
830
903
|
AbstractAuthRequestHandler.prototype.createSessionCookie = function (idToken, expiresIn) {
|
|
831
904
|
var request = {
|
|
@@ -839,8 +912,8 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
839
912
|
/**
|
|
840
913
|
* Looks up a user by uid.
|
|
841
914
|
*
|
|
842
|
-
* @param
|
|
843
|
-
* @
|
|
915
|
+
* @param uid - The uid of the user to lookup.
|
|
916
|
+
* @returns A promise that resolves with the user information.
|
|
844
917
|
*/
|
|
845
918
|
AbstractAuthRequestHandler.prototype.getAccountInfoByUid = function (uid) {
|
|
846
919
|
if (!validator.isUid(uid)) {
|
|
@@ -854,8 +927,8 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
854
927
|
/**
|
|
855
928
|
* Looks up a user by email.
|
|
856
929
|
*
|
|
857
|
-
* @param
|
|
858
|
-
* @
|
|
930
|
+
* @param email - The email of the user to lookup.
|
|
931
|
+
* @returns A promise that resolves with the user information.
|
|
859
932
|
*/
|
|
860
933
|
AbstractAuthRequestHandler.prototype.getAccountInfoByEmail = function (email) {
|
|
861
934
|
if (!validator.isEmail(email)) {
|
|
@@ -869,8 +942,8 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
869
942
|
/**
|
|
870
943
|
* Looks up a user by phone number.
|
|
871
944
|
*
|
|
872
|
-
* @param
|
|
873
|
-
* @
|
|
945
|
+
* @param phoneNumber - The phone number of the user to lookup.
|
|
946
|
+
* @returns A promise that resolves with the user information.
|
|
874
947
|
*/
|
|
875
948
|
AbstractAuthRequestHandler.prototype.getAccountInfoByPhoneNumber = function (phoneNumber) {
|
|
876
949
|
if (!validator.isPhoneNumber(phoneNumber)) {
|
|
@@ -896,9 +969,9 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
896
969
|
/**
|
|
897
970
|
* Looks up multiple users by their identifiers (uid, email, etc).
|
|
898
971
|
*
|
|
899
|
-
* @param
|
|
972
|
+
* @param identifiers - The identifiers indicating the users
|
|
900
973
|
* to be looked up. Must have <= 100 entries.
|
|
901
|
-
* @param
|
|
974
|
+
* @param A - promise that resolves with the set of successfully
|
|
902
975
|
* looked up users. Possibly empty if no users were looked up.
|
|
903
976
|
*/
|
|
904
977
|
AbstractAuthRequestHandler.prototype.getAccountInfoByIdentifiers = function (identifiers) {
|
|
@@ -933,12 +1006,12 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
933
1006
|
* Exports the users (single batch only) with a size of maxResults and starting from
|
|
934
1007
|
* the offset as specified by pageToken.
|
|
935
1008
|
*
|
|
936
|
-
* @param
|
|
1009
|
+
* @param maxResults - The page size, 1000 if undefined. This is also the maximum
|
|
937
1010
|
* allowed limit.
|
|
938
|
-
* @param
|
|
1011
|
+
* @param pageToken - The next page token. If not specified, returns users starting
|
|
939
1012
|
* without any offset. Users are returned in the order they were created from oldest to
|
|
940
1013
|
* newest, relative to the page token offset.
|
|
941
|
-
* @
|
|
1014
|
+
* @returns A promise that resolves with the current batch of downloaded
|
|
942
1015
|
* users and the next page token if available. For the last page, an empty list of users
|
|
943
1016
|
* and no page token are returned.
|
|
944
1017
|
*/
|
|
@@ -968,10 +1041,10 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
968
1041
|
* At most, 1000 users are allowed to be imported one at a time.
|
|
969
1042
|
* When importing a list of password users, UserImportOptions are required to be specified.
|
|
970
1043
|
*
|
|
971
|
-
* @param
|
|
972
|
-
* @param
|
|
1044
|
+
* @param users - The list of user records to import to Firebase Auth.
|
|
1045
|
+
* @param options - The user import options, required when the users provided
|
|
973
1046
|
* include password credentials.
|
|
974
|
-
* @
|
|
1047
|
+
* @returns A promise that resolves when the operation completes
|
|
975
1048
|
* with the result of the import. This includes the number of successful imports, the number
|
|
976
1049
|
* of failed uploads and their corresponding errors.
|
|
977
1050
|
*/
|
|
@@ -1005,8 +1078,8 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
1005
1078
|
/**
|
|
1006
1079
|
* Deletes an account identified by a uid.
|
|
1007
1080
|
*
|
|
1008
|
-
* @param
|
|
1009
|
-
* @
|
|
1081
|
+
* @param uid - The uid of the user to delete.
|
|
1082
|
+
* @returns A promise that resolves when the user is deleted.
|
|
1010
1083
|
*/
|
|
1011
1084
|
AbstractAuthRequestHandler.prototype.deleteAccount = function (uid) {
|
|
1012
1085
|
if (!validator.isUid(uid)) {
|
|
@@ -1039,9 +1112,9 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
1039
1112
|
/**
|
|
1040
1113
|
* Sets additional developer claims on an existing user identified by provided UID.
|
|
1041
1114
|
*
|
|
1042
|
-
* @param
|
|
1043
|
-
* @param
|
|
1044
|
-
* @
|
|
1115
|
+
* @param uid - The user to edit.
|
|
1116
|
+
* @param customUserClaims - The developer claims to set.
|
|
1117
|
+
* @returns A promise that resolves when the operation completes
|
|
1045
1118
|
* with the user id that was edited.
|
|
1046
1119
|
*/
|
|
1047
1120
|
AbstractAuthRequestHandler.prototype.setCustomUserClaims = function (uid, customUserClaims) {
|
|
@@ -1069,9 +1142,9 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
1069
1142
|
/**
|
|
1070
1143
|
* Edits an existing user.
|
|
1071
1144
|
*
|
|
1072
|
-
* @param
|
|
1073
|
-
* @param
|
|
1074
|
-
* @
|
|
1145
|
+
* @param uid - The user to edit.
|
|
1146
|
+
* @param properties - The properties to set on the user.
|
|
1147
|
+
* @returns A promise that resolves when the operation completes
|
|
1075
1148
|
* with the user id that was edited.
|
|
1076
1149
|
*/
|
|
1077
1150
|
AbstractAuthRequestHandler.prototype.updateExistingAccount = function (uid, properties) {
|
|
@@ -1196,8 +1269,8 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
1196
1269
|
* the same second as the revocation will still be valid. If there is a chance that a token
|
|
1197
1270
|
* was minted in the last second, delay for 1 second before revoking.
|
|
1198
1271
|
*
|
|
1199
|
-
* @param
|
|
1200
|
-
* @
|
|
1272
|
+
* @param uid - The user whose tokens are to be revoked.
|
|
1273
|
+
* @returns A promise that resolves when the operation completes
|
|
1201
1274
|
* successfully with the user id of the corresponding user.
|
|
1202
1275
|
*/
|
|
1203
1276
|
AbstractAuthRequestHandler.prototype.revokeRefreshTokens = function (uid) {
|
|
@@ -1218,8 +1291,8 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
1218
1291
|
/**
|
|
1219
1292
|
* Create a new user with the properties supplied.
|
|
1220
1293
|
*
|
|
1221
|
-
* @param
|
|
1222
|
-
* @
|
|
1294
|
+
* @param properties - The properties to set on the user.
|
|
1295
|
+
* @returns A promise that resolves when the operation completes
|
|
1223
1296
|
* with the user id that was created.
|
|
1224
1297
|
*/
|
|
1225
1298
|
AbstractAuthRequestHandler.prototype.createNewAccount = function (properties) {
|
|
@@ -1271,13 +1344,13 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
1271
1344
|
* Generates the out of band email action link for the email specified using the action code settings provided.
|
|
1272
1345
|
* Returns a promise that resolves with the generated link.
|
|
1273
1346
|
*
|
|
1274
|
-
* @param
|
|
1347
|
+
* @param requestType - The request type. This could be either used for password reset,
|
|
1275
1348
|
* email verification, email link sign-in.
|
|
1276
|
-
* @param
|
|
1277
|
-
* @param
|
|
1349
|
+
* @param email - The email of the user the link is being sent to.
|
|
1350
|
+
* @param actionCodeSettings - The optional action code setings which defines whether
|
|
1278
1351
|
* the link is to be handled by a mobile app and the additional state information to be passed in the
|
|
1279
1352
|
* deep link, etc. Required when requestType == 'EMAIL_SIGNIN'
|
|
1280
|
-
* @
|
|
1353
|
+
* @returns A promise that resolves with the email action link.
|
|
1281
1354
|
*/
|
|
1282
1355
|
AbstractAuthRequestHandler.prototype.getEmailActionLink = function (requestType, email, actionCodeSettings) {
|
|
1283
1356
|
var request = { requestType: requestType, email: email, returnOobLink: true };
|
|
@@ -1304,8 +1377,8 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
1304
1377
|
/**
|
|
1305
1378
|
* Looks up an OIDC provider configuration by provider ID.
|
|
1306
1379
|
*
|
|
1307
|
-
* @param
|
|
1308
|
-
* @
|
|
1380
|
+
* @param providerId - The provider identifier of the configuration to lookup.
|
|
1381
|
+
* @returns A promise that resolves with the provider configuration information.
|
|
1309
1382
|
*/
|
|
1310
1383
|
AbstractAuthRequestHandler.prototype.getOAuthIdpConfig = function (providerId) {
|
|
1311
1384
|
if (!auth_config_1.OIDCConfig.isProviderId(providerId)) {
|
|
@@ -1317,12 +1390,12 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
1317
1390
|
* Lists the OIDC configurations (single batch only) with a size of maxResults and starting from
|
|
1318
1391
|
* the offset as specified by pageToken.
|
|
1319
1392
|
*
|
|
1320
|
-
* @param
|
|
1393
|
+
* @param maxResults - The page size, 100 if undefined. This is also the maximum
|
|
1321
1394
|
* allowed limit.
|
|
1322
|
-
* @param
|
|
1395
|
+
* @param pageToken - The next page token. If not specified, returns OIDC configurations
|
|
1323
1396
|
* without any offset. Configurations are returned in the order they were created from oldest to
|
|
1324
1397
|
* newest, relative to the page token offset.
|
|
1325
|
-
* @
|
|
1398
|
+
* @returns A promise that resolves with the current batch of downloaded
|
|
1326
1399
|
* OIDC configurations and the next page token if available. For the last page, an empty list of provider
|
|
1327
1400
|
* configuration and no page token are returned.
|
|
1328
1401
|
*/
|
|
@@ -1347,8 +1420,8 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
1347
1420
|
/**
|
|
1348
1421
|
* Deletes an OIDC configuration identified by a providerId.
|
|
1349
1422
|
*
|
|
1350
|
-
* @param
|
|
1351
|
-
* @
|
|
1423
|
+
* @param providerId - The identifier of the OIDC configuration to delete.
|
|
1424
|
+
* @returns A promise that resolves when the OIDC provider is deleted.
|
|
1352
1425
|
*/
|
|
1353
1426
|
AbstractAuthRequestHandler.prototype.deleteOAuthIdpConfig = function (providerId) {
|
|
1354
1427
|
if (!auth_config_1.OIDCConfig.isProviderId(providerId)) {
|
|
@@ -1362,8 +1435,8 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
1362
1435
|
/**
|
|
1363
1436
|
* Creates a new OIDC provider configuration with the properties provided.
|
|
1364
1437
|
*
|
|
1365
|
-
* @param
|
|
1366
|
-
* @
|
|
1438
|
+
* @param options - The properties to set on the new OIDC provider configuration to be created.
|
|
1439
|
+
* @returns A promise that resolves with the newly created OIDC
|
|
1367
1440
|
* configuration.
|
|
1368
1441
|
*/
|
|
1369
1442
|
AbstractAuthRequestHandler.prototype.createOAuthIdpConfig = function (options) {
|
|
@@ -1387,9 +1460,9 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
1387
1460
|
/**
|
|
1388
1461
|
* Updates an existing OIDC provider configuration with the properties provided.
|
|
1389
1462
|
*
|
|
1390
|
-
* @param
|
|
1391
|
-
* @param
|
|
1392
|
-
* @
|
|
1463
|
+
* @param providerId - The provider identifier of the OIDC configuration to update.
|
|
1464
|
+
* @param options - The properties to update on the existing configuration.
|
|
1465
|
+
* @returns A promise that resolves with the modified provider
|
|
1393
1466
|
* configuration.
|
|
1394
1467
|
*/
|
|
1395
1468
|
AbstractAuthRequestHandler.prototype.updateOAuthIdpConfig = function (providerId, options) {
|
|
@@ -1416,8 +1489,8 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
1416
1489
|
/**
|
|
1417
1490
|
* Looks up an SAML provider configuration by provider ID.
|
|
1418
1491
|
*
|
|
1419
|
-
* @param
|
|
1420
|
-
* @
|
|
1492
|
+
* @param providerId - The provider identifier of the configuration to lookup.
|
|
1493
|
+
* @returns A promise that resolves with the provider configuration information.
|
|
1421
1494
|
*/
|
|
1422
1495
|
AbstractAuthRequestHandler.prototype.getInboundSamlConfig = function (providerId) {
|
|
1423
1496
|
if (!auth_config_1.SAMLConfig.isProviderId(providerId)) {
|
|
@@ -1429,12 +1502,12 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
1429
1502
|
* Lists the SAML configurations (single batch only) with a size of maxResults and starting from
|
|
1430
1503
|
* the offset as specified by pageToken.
|
|
1431
1504
|
*
|
|
1432
|
-
* @param
|
|
1505
|
+
* @param maxResults - The page size, 100 if undefined. This is also the maximum
|
|
1433
1506
|
* allowed limit.
|
|
1434
|
-
* @param
|
|
1507
|
+
* @param pageToken - The next page token. If not specified, returns SAML configurations starting
|
|
1435
1508
|
* without any offset. Configurations are returned in the order they were created from oldest to
|
|
1436
1509
|
* newest, relative to the page token offset.
|
|
1437
|
-
* @
|
|
1510
|
+
* @returns A promise that resolves with the current batch of downloaded
|
|
1438
1511
|
* SAML configurations and the next page token if available. For the last page, an empty list of provider
|
|
1439
1512
|
* configuration and no page token are returned.
|
|
1440
1513
|
*/
|
|
@@ -1459,8 +1532,8 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
1459
1532
|
/**
|
|
1460
1533
|
* Deletes a SAML configuration identified by a providerId.
|
|
1461
1534
|
*
|
|
1462
|
-
* @param
|
|
1463
|
-
* @
|
|
1535
|
+
* @param providerId - The identifier of the SAML configuration to delete.
|
|
1536
|
+
* @returns A promise that resolves when the SAML provider is deleted.
|
|
1464
1537
|
*/
|
|
1465
1538
|
AbstractAuthRequestHandler.prototype.deleteInboundSamlConfig = function (providerId) {
|
|
1466
1539
|
if (!auth_config_1.SAMLConfig.isProviderId(providerId)) {
|
|
@@ -1474,8 +1547,8 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
1474
1547
|
/**
|
|
1475
1548
|
* Creates a new SAML provider configuration with the properties provided.
|
|
1476
1549
|
*
|
|
1477
|
-
* @param
|
|
1478
|
-
* @
|
|
1550
|
+
* @param options - The properties to set on the new SAML provider configuration to be created.
|
|
1551
|
+
* @returns A promise that resolves with the newly created SAML
|
|
1479
1552
|
* configuration.
|
|
1480
1553
|
*/
|
|
1481
1554
|
AbstractAuthRequestHandler.prototype.createInboundSamlConfig = function (options) {
|
|
@@ -1499,9 +1572,9 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
1499
1572
|
/**
|
|
1500
1573
|
* Updates an existing SAML provider configuration with the properties provided.
|
|
1501
1574
|
*
|
|
1502
|
-
* @param
|
|
1503
|
-
* @param
|
|
1504
|
-
* @
|
|
1575
|
+
* @param providerId - The provider identifier of the SAML configuration to update.
|
|
1576
|
+
* @param options - The properties to update on the existing configuration.
|
|
1577
|
+
* @returns A promise that resolves with the modified provider
|
|
1505
1578
|
* configuration.
|
|
1506
1579
|
*/
|
|
1507
1580
|
AbstractAuthRequestHandler.prototype.updateInboundSamlConfig = function (providerId, options) {
|
|
@@ -1528,11 +1601,11 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
1528
1601
|
/**
|
|
1529
1602
|
* Invokes the request handler based on the API settings object passed.
|
|
1530
1603
|
*
|
|
1531
|
-
* @param
|
|
1532
|
-
* @param
|
|
1533
|
-
* @param
|
|
1534
|
-
* @param
|
|
1535
|
-
* @
|
|
1604
|
+
* @param urlBuilder - The URL builder for Auth endpoints.
|
|
1605
|
+
* @param apiSettings - The API endpoint settings to apply to request and response.
|
|
1606
|
+
* @param requestData - The request data.
|
|
1607
|
+
* @param additionalResourceParams - Additional resource related params if needed.
|
|
1608
|
+
* @returns A promise that resolves with the response.
|
|
1536
1609
|
*/
|
|
1537
1610
|
AbstractAuthRequestHandler.prototype.invokeRequestHandler = function (urlBuilder, apiSettings, requestData, additionalResourceParams) {
|
|
1538
1611
|
var _this = this;
|
|
@@ -1573,7 +1646,7 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
1573
1646
|
});
|
|
1574
1647
|
};
|
|
1575
1648
|
/**
|
|
1576
|
-
* @
|
|
1649
|
+
* @returns The current Auth user management resource URL builder.
|
|
1577
1650
|
*/
|
|
1578
1651
|
AbstractAuthRequestHandler.prototype.getAuthUrlBuilder = function () {
|
|
1579
1652
|
if (!this.authUrlBuilder) {
|
|
@@ -1582,7 +1655,7 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
|
|
|
1582
1655
|
return this.authUrlBuilder;
|
|
1583
1656
|
};
|
|
1584
1657
|
/**
|
|
1585
|
-
* @
|
|
1658
|
+
* @returns The current project config resource URL builder.
|
|
1586
1659
|
*/
|
|
1587
1660
|
AbstractAuthRequestHandler.prototype.getProjectConfigUrlBuilder = function () {
|
|
1588
1661
|
if (!this.projectConfigUrlBuilder) {
|
|
@@ -1651,7 +1724,7 @@ var AuthRequestHandler = /** @class */ (function (_super) {
|
|
|
1651
1724
|
/**
|
|
1652
1725
|
* The FirebaseAuthRequestHandler constructor used to initialize an instance using a FirebaseApp.
|
|
1653
1726
|
*
|
|
1654
|
-
* @param
|
|
1727
|
+
* @param app - The app used to fetch access tokens to sign API requests.
|
|
1655
1728
|
* @constructor.
|
|
1656
1729
|
*/
|
|
1657
1730
|
function AuthRequestHandler(app) {
|
|
@@ -1660,13 +1733,13 @@ var AuthRequestHandler = /** @class */ (function (_super) {
|
|
|
1660
1733
|
return _this;
|
|
1661
1734
|
}
|
|
1662
1735
|
/**
|
|
1663
|
-
* @
|
|
1736
|
+
* @returns A new Auth user management resource URL builder instance.
|
|
1664
1737
|
*/
|
|
1665
1738
|
AuthRequestHandler.prototype.newAuthUrlBuilder = function () {
|
|
1666
1739
|
return new AuthResourceUrlBuilder(this.app, 'v1');
|
|
1667
1740
|
};
|
|
1668
1741
|
/**
|
|
1669
|
-
* @
|
|
1742
|
+
* @returns A new project config resource URL builder instance.
|
|
1670
1743
|
*/
|
|
1671
1744
|
AuthRequestHandler.prototype.newProjectConfigUrlBuilder = function () {
|
|
1672
1745
|
return new AuthResourceUrlBuilder(this.app, 'v2');
|
|
@@ -1674,8 +1747,8 @@ var AuthRequestHandler = /** @class */ (function (_super) {
|
|
|
1674
1747
|
/**
|
|
1675
1748
|
* Looks up a tenant by tenant ID.
|
|
1676
1749
|
*
|
|
1677
|
-
* @param
|
|
1678
|
-
* @
|
|
1750
|
+
* @param tenantId - The tenant identifier of the tenant to lookup.
|
|
1751
|
+
* @returns A promise that resolves with the tenant information.
|
|
1679
1752
|
*/
|
|
1680
1753
|
AuthRequestHandler.prototype.getTenant = function (tenantId) {
|
|
1681
1754
|
if (!validator.isNonEmptyString(tenantId)) {
|
|
@@ -1690,12 +1763,12 @@ var AuthRequestHandler = /** @class */ (function (_super) {
|
|
|
1690
1763
|
* Exports the tenants (single batch only) with a size of maxResults and starting from
|
|
1691
1764
|
* the offset as specified by pageToken.
|
|
1692
1765
|
*
|
|
1693
|
-
* @param
|
|
1766
|
+
* @param maxResults - The page size, 1000 if undefined. This is also the maximum
|
|
1694
1767
|
* allowed limit.
|
|
1695
|
-
* @param
|
|
1768
|
+
* @param pageToken - The next page token. If not specified, returns tenants starting
|
|
1696
1769
|
* without any offset. Tenants are returned in the order they were created from oldest to
|
|
1697
1770
|
* newest, relative to the page token offset.
|
|
1698
|
-
* @
|
|
1771
|
+
* @returns A promise that resolves with the current batch of downloaded
|
|
1699
1772
|
* tenants and the next page token if available. For the last page, an empty list of tenants
|
|
1700
1773
|
* and no page token are returned.
|
|
1701
1774
|
*/
|
|
@@ -1721,8 +1794,8 @@ var AuthRequestHandler = /** @class */ (function (_super) {
|
|
|
1721
1794
|
/**
|
|
1722
1795
|
* Deletes a tenant identified by a tenantId.
|
|
1723
1796
|
*
|
|
1724
|
-
* @param
|
|
1725
|
-
* @
|
|
1797
|
+
* @param tenantId - The identifier of the tenant to delete.
|
|
1798
|
+
* @returns A promise that resolves when the tenant is deleted.
|
|
1726
1799
|
*/
|
|
1727
1800
|
AuthRequestHandler.prototype.deleteTenant = function (tenantId) {
|
|
1728
1801
|
if (!validator.isNonEmptyString(tenantId)) {
|
|
@@ -1736,8 +1809,8 @@ var AuthRequestHandler = /** @class */ (function (_super) {
|
|
|
1736
1809
|
/**
|
|
1737
1810
|
* Creates a new tenant with the properties provided.
|
|
1738
1811
|
*
|
|
1739
|
-
* @param
|
|
1740
|
-
* @
|
|
1812
|
+
* @param tenantOptions - The properties to set on the new tenant to be created.
|
|
1813
|
+
* @returns A promise that resolves with the newly created tenant object.
|
|
1741
1814
|
*/
|
|
1742
1815
|
AuthRequestHandler.prototype.createTenant = function (tenantOptions) {
|
|
1743
1816
|
try {
|
|
@@ -1755,9 +1828,9 @@ var AuthRequestHandler = /** @class */ (function (_super) {
|
|
|
1755
1828
|
/**
|
|
1756
1829
|
* Updates an existing tenant with the properties provided.
|
|
1757
1830
|
*
|
|
1758
|
-
* @param
|
|
1759
|
-
* @param
|
|
1760
|
-
* @
|
|
1831
|
+
* @param tenantId - The tenant identifier of the tenant to update.
|
|
1832
|
+
* @param tenantOptions - The properties to update on the existing tenant.
|
|
1833
|
+
* @returns A promise that resolves with the modified tenant object.
|
|
1761
1834
|
*/
|
|
1762
1835
|
AuthRequestHandler.prototype.updateTenant = function (tenantId, tenantOptions) {
|
|
1763
1836
|
if (!validator.isNonEmptyString(tenantId)) {
|
|
@@ -1792,8 +1865,8 @@ var TenantAwareAuthRequestHandler = /** @class */ (function (_super) {
|
|
|
1792
1865
|
* The FirebaseTenantRequestHandler constructor used to initialize an instance using a
|
|
1793
1866
|
* FirebaseApp and a tenant ID.
|
|
1794
1867
|
*
|
|
1795
|
-
* @param
|
|
1796
|
-
* @param
|
|
1868
|
+
* @param app - The app used to fetch access tokens to sign API requests.
|
|
1869
|
+
* @param tenantId - The request handler's tenant ID.
|
|
1797
1870
|
* @constructor
|
|
1798
1871
|
*/
|
|
1799
1872
|
function TenantAwareAuthRequestHandler(app, tenantId) {
|
|
@@ -1802,13 +1875,13 @@ var TenantAwareAuthRequestHandler = /** @class */ (function (_super) {
|
|
|
1802
1875
|
return _this;
|
|
1803
1876
|
}
|
|
1804
1877
|
/**
|
|
1805
|
-
* @
|
|
1878
|
+
* @returns A new Auth user management resource URL builder instance.
|
|
1806
1879
|
*/
|
|
1807
1880
|
TenantAwareAuthRequestHandler.prototype.newAuthUrlBuilder = function () {
|
|
1808
1881
|
return new TenantAwareAuthResourceUrlBuilder(this.app, 'v1', this.tenantId);
|
|
1809
1882
|
};
|
|
1810
1883
|
/**
|
|
1811
|
-
* @
|
|
1884
|
+
* @returns A new project config resource URL builder instance.
|
|
1812
1885
|
*/
|
|
1813
1886
|
TenantAwareAuthRequestHandler.prototype.newProjectConfigUrlBuilder = function () {
|
|
1814
1887
|
return new TenantAwareAuthResourceUrlBuilder(this.app, 'v2', this.tenantId);
|
|
@@ -1822,10 +1895,10 @@ var TenantAwareAuthRequestHandler = /** @class */ (function (_super) {
|
|
|
1822
1895
|
* Overrides the superclass methods by adding an additional check to match tenant IDs of
|
|
1823
1896
|
* imported user records if present.
|
|
1824
1897
|
*
|
|
1825
|
-
* @param
|
|
1826
|
-
* @param
|
|
1898
|
+
* @param users - The list of user records to import to Firebase Auth.
|
|
1899
|
+
* @param options - The user import options, required when the users provided
|
|
1827
1900
|
* include password credentials.
|
|
1828
|
-
* @
|
|
1901
|
+
* @returns A promise that resolves when the operation completes
|
|
1829
1902
|
* with the result of the import. This includes the number of successful imports, the number
|
|
1830
1903
|
* of failed uploads and their corresponding errors.
|
|
1831
1904
|
*/
|