@dereekb/firebase-server 13.36.0 → 13.38.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/calcom/package.json +10 -10
- package/discord/package.json +10 -10
- package/index.cjs.js +1732 -510
- package/index.esm.js +1717 -513
- package/mailgun/package.json +9 -9
- package/mcp/index.cjs.js +913 -167
- package/mcp/index.esm.js +906 -166
- package/mcp/package.json +13 -12
- package/mcp/src/lib/controller/mcp.controller.d.ts +28 -3
- package/mcp/src/lib/controller/mcp.wellknown.controller.d.ts +21 -1
- package/mcp/src/lib/mcp.config.d.ts +31 -8
- package/mcp/src/lib/mcp.module.d.ts +2 -1
- package/mcp/src/lib/service/index.d.ts +1 -0
- package/mcp/src/lib/service/mcp.server.factory.d.ts +8 -6
- package/mcp/src/lib/service/mcp.tool-generator.d.ts +1 -1
- package/mcp/src/lib/service/mcp.visibility.d.ts +1 -1
- package/mcp/src/lib/service/tools/mcp.tool.model-roles.d.ts +95 -0
- package/mcp/src/lib/transport/streamable-http.transport.d.ts +16 -11
- package/model/index.cjs.js +1 -1
- package/model/index.esm.js +1 -1
- package/model/package.json +9 -9
- package/oidc/index.cjs.js +257 -67
- package/oidc/index.esm.js +256 -69
- package/oidc/package.json +10 -10
- package/oidc/src/lib/profile.d.ts +21 -0
- package/oidc/src/lib/service/index.d.ts +1 -0
- package/oidc/src/lib/service/oidc.config.service.d.ts +14 -0
- package/oidc/src/lib/service/oidc.interaction-policy.d.ts +35 -0
- package/oidc/src/lib/service/oidc.service.d.ts +29 -0
- package/package.json +14 -13
- package/src/lib/env/env.service.d.ts +27 -3
- package/src/lib/nest/controller/api.scope.d.ts +63 -0
- package/src/lib/nest/controller/index.d.ts +2 -0
- package/src/lib/nest/controller/model/model.api.get.service.d.ts +146 -1
- package/src/lib/nest/controller/model/model.api.scope.d.ts +3 -2
- package/src/lib/nest/controller/session/index.d.ts +4 -0
- package/src/lib/nest/controller/session/session.api.config.d.ts +104 -0
- package/src/lib/nest/controller/session/session.api.controller.d.ts +26 -0
- package/src/lib/nest/controller/session/session.api.module.d.ts +49 -0
- package/src/lib/nest/controller/session/session.api.service.d.ts +71 -0
- package/test/index.cjs.js +8 -8
- package/test/index.esm.js +8 -8
- package/test/package.json +11 -11
- package/twilio/package.json +8 -8
- package/zoho/package.json +10 -10
package/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { timingSafeEqual } from 'node:crypto';
|
|
2
|
-
import { DBX_FIREBASE_SERVER_NO_AUTH_ERROR_CODE, UNAUTHENTICATED_ERROR_CODE, FORBIDDEN_ERROR_CODE, PERMISSION_DENIED_ERROR_CODE, NOT_FOUND_ERROR_CODE, MODEL_NOT_AVAILABLE_ERROR_CODE, BAD_REQUEST_ERROR_CODE, CONFLICT_ERROR_CODE, ALREADY_EXISTS_ERROR_CODE, UNAVAILABLE_ERROR_CODE, UNAVAILABLE_OR_DEACTIVATED_FUNCTION_ERROR_CODE, INTERNAL_SERVER_ERROR_CODE, FIREBASE_AUTH_USER_NOT_FOUND_ERROR, FIREBASE_SERVER_AUTH_CLAIMS_RESET_PASSWORD_KEY, FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY, FIREBASE_SERVER_AUTH_CLAIMS_RESET_EXPIRES_AT_KEY, FIREBASE_AUTH_PHONE_NUMBER_ALREADY_EXISTS_ERROR, FIREBASE_AUTH_EMAIL_ALREADY_EXISTS_ERROR, FIREBASE_AUTH_INVALID_PHONE_NUMBER_ERROR, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_PASSWORD_KEY, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_LAST_COM_DATE_KEY, setIdAndKeyFromKeyIdRefOnDocumentData, DBX_FIREBASE_SERVER_PASSWORD_RESET_INVALID_CODE_ERROR_CODE, DBX_FIREBASE_SERVER_PASSWORD_RESET_NO_CONFIG_ERROR_CODE, DBX_FIREBASE_SERVER_PASSWORD_RESET_SEND_ONCE_ERROR_CODE, DBX_FIREBASE_SERVER_PASSWORD_RESET_THROTTLE_ERROR_CODE, FirestoreDocumentContextType, streamFromOnSnapshot, FIRESTORE_LIMIT_QUERY_CONSTRAINT_TYPE, FIRESTORE_LIMIT_TO_LAST_QUERY_CONSTRAINT_TYPE, FIRESTORE_ORDER_BY_QUERY_CONSTRAINT_TYPE, FIRESTORE_ORDER_BY_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, FIRESTORE_WHERE_QUERY_CONSTRAINT_TYPE, FIRESTORE_WHERE_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, FIRESTORE_OFFSET_QUERY_CONSTRAINT_TYPE, FIRESTORE_START_AT_QUERY_CONSTRAINT_TYPE, FIRESTORE_START_AT_VALUE_QUERY_CONSTRAINT_TYPE, FIRESTORE_START_AFTER_QUERY_CONSTRAINT_TYPE, FIRESTORE_END_AT_QUERY_CONSTRAINT_TYPE, FIRESTORE_END_AT_VALUE_QUERY_CONSTRAINT_TYPE, FIRESTORE_END_BEFORE_QUERY_CONSTRAINT_TYPE, makeFirestoreQueryConstraintFunctionsDriver, firestoreContextFactory, firestoreField, optionalFirestoreField, DEFAULT_MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER, UNKNOWN_MODEL_TYPE_ERROR_CODE, BAD_DOCUMENT_QUERY_CURSOR_ERROR_CODE, limit, startAfter, DEFAULT_ON_CALL_QUERY_MODEL_LIMIT, MAX_ON_CALL_QUERY_MODEL_LIMIT, resolveEffectiveOidcScopeTerms, callModelOidcScopeForCallType, oidcScopeTermsSatisfied,
|
|
2
|
+
import { DBX_FIREBASE_SERVER_NO_AUTH_ERROR_CODE, UNAUTHENTICATED_ERROR_CODE, FORBIDDEN_ERROR_CODE, PERMISSION_DENIED_ERROR_CODE, NOT_FOUND_ERROR_CODE, MODEL_NOT_AVAILABLE_ERROR_CODE, BAD_REQUEST_ERROR_CODE, CONFLICT_ERROR_CODE, ALREADY_EXISTS_ERROR_CODE, UNAVAILABLE_ERROR_CODE, UNAVAILABLE_OR_DEACTIVATED_FUNCTION_ERROR_CODE, INTERNAL_SERVER_ERROR_CODE, FIREBASE_AUTH_USER_NOT_FOUND_ERROR, FIREBASE_SERVER_AUTH_CLAIMS_RESET_PASSWORD_KEY, FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY, FIREBASE_SERVER_AUTH_CLAIMS_RESET_EXPIRES_AT_KEY, FIREBASE_AUTH_PHONE_NUMBER_ALREADY_EXISTS_ERROR, FIREBASE_AUTH_EMAIL_ALREADY_EXISTS_ERROR, FIREBASE_AUTH_INVALID_PHONE_NUMBER_ERROR, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_PASSWORD_KEY, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_LAST_COM_DATE_KEY, setIdAndKeyFromKeyIdRefOnDocumentData, DBX_FIREBASE_SERVER_PASSWORD_RESET_INVALID_CODE_ERROR_CODE, DBX_FIREBASE_SERVER_PASSWORD_RESET_NO_CONFIG_ERROR_CODE, DBX_FIREBASE_SERVER_PASSWORD_RESET_SEND_ONCE_ERROR_CODE, DBX_FIREBASE_SERVER_PASSWORD_RESET_THROTTLE_ERROR_CODE, FirestoreDocumentContextType, streamFromOnSnapshot, FIRESTORE_LIMIT_QUERY_CONSTRAINT_TYPE, FIRESTORE_LIMIT_TO_LAST_QUERY_CONSTRAINT_TYPE, FIRESTORE_ORDER_BY_QUERY_CONSTRAINT_TYPE, FIRESTORE_ORDER_BY_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, FIRESTORE_WHERE_QUERY_CONSTRAINT_TYPE, FIRESTORE_WHERE_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, FIRESTORE_OFFSET_QUERY_CONSTRAINT_TYPE, FIRESTORE_START_AT_QUERY_CONSTRAINT_TYPE, FIRESTORE_START_AT_VALUE_QUERY_CONSTRAINT_TYPE, FIRESTORE_START_AFTER_QUERY_CONSTRAINT_TYPE, FIRESTORE_END_AT_QUERY_CONSTRAINT_TYPE, FIRESTORE_END_AT_VALUE_QUERY_CONSTRAINT_TYPE, FIRESTORE_END_BEFORE_QUERY_CONSTRAINT_TYPE, makeFirestoreQueryConstraintFunctionsDriver, firestoreContextFactory, firestoreField, optionalFirestoreField, DEFAULT_MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER, UNKNOWN_MODEL_TYPE_ERROR_CODE, BAD_DOCUMENT_QUERY_CURSOR_ERROR_CODE, limit, startAfter, DEFAULT_ON_CALL_QUERY_MODEL_LIMIT, MAX_ON_CALL_QUERY_MODEL_LIMIT, oidcScopeTermSatisfied, oidcScopesFromScopeClaim, resolveEffectiveOidcScopeTerms, callModelOidcScopeForCallType, oidcScopeTermsSatisfied, CALL_MODEL_MISSING_OIDC_SCOPE_ERROR_CODE, FIRESTORE_SESSION_OIDC_SCOPE, ScheduledFunctionDevelopmentFunctionTypeEnum, SCHEDULED_FUNCTION_DEV_FUNCTION_SPECIFIER, storageListFilesResultFactory, assertStorageUploadOptionsStringFormat, firebaseStorageContextFactory, inContextFirebaseModelsServiceFactory, useFirebaseModelsService } from '@dereekb/firebase';
|
|
3
3
|
import { partialServerError, isServerError, randomNumberFactory, cachedGetter, filterNullAndUndefinedValues, asSet, AUTH_ADMIN_ROLE, AUTH_TOS_SIGNED_ROLE, forEachKeyValue, KeyValueTypleValueFilter, filterUndefinedValues, isThrottled, mapObjectMap, batch, objectToMap, serverError, asArray, containsAllValues, websiteUrlDetails, mergeObjects, cronExpressionRepeatingEveryNMinutes, mapIdentityFunction, slashPathName, toRelativeSlashPathStartType, fixMultiSlashesInSlashPath, SLASH_PATH_SEPARATOR, objectHasNoKeys, websiteUrlFromPaths, pushItemOrArrayItemsIntoArray, makeGetter, asGetter, build, performAsyncTasks } from '@dereekb/util';
|
|
4
4
|
import { HttpsError } from 'firebase-functions/https';
|
|
5
5
|
import { hoursToMs, minutesToMs, toISODateString } from '@dereekb/date';
|
|
@@ -11,8 +11,8 @@ import { Injectable, Optional, Inject, Module, Post, Body, Req, Get, Param, Quer
|
|
|
11
11
|
import { ModuleRef, NestFactory } from '@nestjs/core';
|
|
12
12
|
import { asAnalyticsEventData } from '@dereekb/analytics';
|
|
13
13
|
import { SegmentService, SegmentServiceModule } from '@dereekb/analytics/nestjs';
|
|
14
|
+
import { isFullAccessRoleMap, FULL_ACCESS_ROLE_KEY, NO_ACCESS_ROLE_KEY, toTransformAndValidateFunctionResultFactory, transformAndValidateObjectFactory } from '@dereekb/model';
|
|
14
15
|
import { https, scheduler } from 'firebase-functions/v2';
|
|
15
|
-
import { toTransformAndValidateFunctionResultFactory, transformAndValidateObjectFactory } from '@dereekb/model';
|
|
16
16
|
import admin from 'firebase-admin';
|
|
17
17
|
import { ApiError } from '@google-cloud/storage';
|
|
18
18
|
import { addHours, addMilliseconds } from 'date-fns';
|
|
@@ -21,7 +21,7 @@ import { fetchAssetLoader, delegatedAssetLoader, AssetLoader } from '@dereekb/rx
|
|
|
21
21
|
import { ExpressAdapter } from '@nestjs/platform-express';
|
|
22
22
|
import express from 'express';
|
|
23
23
|
|
|
24
|
-
function _define_property$
|
|
24
|
+
function _define_property$C(obj, key, value) {
|
|
25
25
|
if (key in obj) {
|
|
26
26
|
Object.defineProperty(obj, key, {
|
|
27
27
|
value: value,
|
|
@@ -34,7 +34,7 @@ function _define_property$z(obj, key, value) {
|
|
|
34
34
|
}
|
|
35
35
|
return obj;
|
|
36
36
|
}
|
|
37
|
-
function _object_spread$
|
|
37
|
+
function _object_spread$m(target) {
|
|
38
38
|
for(var i = 1; i < arguments.length; i++){
|
|
39
39
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
40
40
|
var ownKeys = Object.keys(source);
|
|
@@ -44,12 +44,12 @@ function _object_spread$l(target) {
|
|
|
44
44
|
}));
|
|
45
45
|
}
|
|
46
46
|
ownKeys.forEach(function(key) {
|
|
47
|
-
_define_property$
|
|
47
|
+
_define_property$C(target, key, source[key]);
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
return target;
|
|
51
51
|
}
|
|
52
|
-
function ownKeys$
|
|
52
|
+
function ownKeys$g(object, enumerableOnly) {
|
|
53
53
|
var keys = Object.keys(object);
|
|
54
54
|
if (Object.getOwnPropertySymbols) {
|
|
55
55
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -57,12 +57,12 @@ function ownKeys$e(object, enumerableOnly) {
|
|
|
57
57
|
}
|
|
58
58
|
return keys;
|
|
59
59
|
}
|
|
60
|
-
function _object_spread_props$
|
|
60
|
+
function _object_spread_props$g(target, source) {
|
|
61
61
|
source = source != null ? source : {};
|
|
62
62
|
if (Object.getOwnPropertyDescriptors) {
|
|
63
63
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
64
64
|
} else {
|
|
65
|
-
ownKeys$
|
|
65
|
+
ownKeys$g(Object(source)).forEach(function(key) {
|
|
66
66
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
67
67
|
});
|
|
68
68
|
}
|
|
@@ -101,7 +101,7 @@ function _type_of$7(obj) {
|
|
|
101
101
|
*/ function unauthenticatedError(messageOrError) {
|
|
102
102
|
var _serverError_message;
|
|
103
103
|
var serverError = partialServerError(messageOrError);
|
|
104
|
-
return new HttpsError('unauthenticated', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'unauthenticated', _object_spread_props$
|
|
104
|
+
return new HttpsError('unauthenticated', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'unauthenticated', _object_spread_props$g(_object_spread$m({
|
|
105
105
|
status: 401,
|
|
106
106
|
code: UNAUTHENTICATED_ERROR_CODE
|
|
107
107
|
}, serverError), {
|
|
@@ -116,7 +116,7 @@ function _type_of$7(obj) {
|
|
|
116
116
|
*/ function forbiddenError(messageOrError) {
|
|
117
117
|
var _serverError_message;
|
|
118
118
|
var serverError = partialServerError(messageOrError);
|
|
119
|
-
return new HttpsError('permission-denied', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'forbidden', _object_spread_props$
|
|
119
|
+
return new HttpsError('permission-denied', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'forbidden', _object_spread_props$g(_object_spread$m({
|
|
120
120
|
status: 403,
|
|
121
121
|
code: FORBIDDEN_ERROR_CODE
|
|
122
122
|
}, serverError), {
|
|
@@ -131,7 +131,7 @@ function _type_of$7(obj) {
|
|
|
131
131
|
*/ function permissionDeniedError(messageOrError) {
|
|
132
132
|
var _serverError_message;
|
|
133
133
|
var serverError = partialServerError(messageOrError);
|
|
134
|
-
return new HttpsError('permission-denied', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'permission denied', _object_spread_props$
|
|
134
|
+
return new HttpsError('permission-denied', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'permission denied', _object_spread_props$g(_object_spread$m({
|
|
135
135
|
status: 403,
|
|
136
136
|
code: PERMISSION_DENIED_ERROR_CODE
|
|
137
137
|
}, serverError), {
|
|
@@ -146,7 +146,7 @@ function _type_of$7(obj) {
|
|
|
146
146
|
*/ function notFoundError(messageOrError) {
|
|
147
147
|
var _serverError_message;
|
|
148
148
|
var serverError = partialServerError(messageOrError);
|
|
149
|
-
return new HttpsError('not-found', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'not found', _object_spread_props$
|
|
149
|
+
return new HttpsError('not-found', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'not found', _object_spread_props$g(_object_spread$m({
|
|
150
150
|
status: 404,
|
|
151
151
|
code: NOT_FOUND_ERROR_CODE
|
|
152
152
|
}, serverError), {
|
|
@@ -161,7 +161,7 @@ function _type_of$7(obj) {
|
|
|
161
161
|
*/ function modelNotAvailableError(messageOrError) {
|
|
162
162
|
var _serverError_message;
|
|
163
163
|
var serverError = partialServerError(messageOrError);
|
|
164
|
-
return new HttpsError('not-found', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'model was not available', _object_spread_props$
|
|
164
|
+
return new HttpsError('not-found', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'model was not available', _object_spread_props$g(_object_spread$m({
|
|
165
165
|
status: 404,
|
|
166
166
|
code: MODEL_NOT_AVAILABLE_ERROR_CODE
|
|
167
167
|
}, serverError), {
|
|
@@ -176,7 +176,7 @@ function _type_of$7(obj) {
|
|
|
176
176
|
*/ function badRequestError(messageOrError) {
|
|
177
177
|
var _serverError_message;
|
|
178
178
|
var serverError = partialServerError(messageOrError);
|
|
179
|
-
return new HttpsError('invalid-argument', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'bad request', _object_spread_props$
|
|
179
|
+
return new HttpsError('invalid-argument', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'bad request', _object_spread_props$g(_object_spread$m({
|
|
180
180
|
status: 400,
|
|
181
181
|
code: BAD_REQUEST_ERROR_CODE
|
|
182
182
|
}, serverError), {
|
|
@@ -191,7 +191,7 @@ function _type_of$7(obj) {
|
|
|
191
191
|
*/ function preconditionConflictError(messageOrError) {
|
|
192
192
|
var _serverError_message;
|
|
193
193
|
var serverError = partialServerError(messageOrError);
|
|
194
|
-
return new HttpsError('failed-precondition', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'conflict', _object_spread_props$
|
|
194
|
+
return new HttpsError('failed-precondition', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'conflict', _object_spread_props$g(_object_spread$m({
|
|
195
195
|
status: 409,
|
|
196
196
|
code: CONFLICT_ERROR_CODE
|
|
197
197
|
}, serverError), {
|
|
@@ -206,7 +206,7 @@ function _type_of$7(obj) {
|
|
|
206
206
|
*/ function alreadyExistsError(messageOrError) {
|
|
207
207
|
var _serverError_message;
|
|
208
208
|
var serverError = partialServerError(messageOrError);
|
|
209
|
-
return new HttpsError('already-exists', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'already exists', _object_spread_props$
|
|
209
|
+
return new HttpsError('already-exists', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'already exists', _object_spread_props$g(_object_spread$m({
|
|
210
210
|
status: 409,
|
|
211
211
|
code: ALREADY_EXISTS_ERROR_CODE
|
|
212
212
|
}, serverError), {
|
|
@@ -221,7 +221,7 @@ function _type_of$7(obj) {
|
|
|
221
221
|
*/ function unavailableError(messageOrError) {
|
|
222
222
|
var _serverError_message;
|
|
223
223
|
var serverError = partialServerError(messageOrError);
|
|
224
|
-
return new HttpsError('unavailable', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'service unavailable', _object_spread_props$
|
|
224
|
+
return new HttpsError('unavailable', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'service unavailable', _object_spread_props$g(_object_spread$m({
|
|
225
225
|
status: 503,
|
|
226
226
|
code: UNAVAILABLE_ERROR_CODE
|
|
227
227
|
}, serverError), {
|
|
@@ -236,7 +236,7 @@ function _type_of$7(obj) {
|
|
|
236
236
|
*/ function unavailableOrDeactivatedFunctionError(messageOrError) {
|
|
237
237
|
var _serverError_message;
|
|
238
238
|
var serverError = partialServerError(messageOrError);
|
|
239
|
-
return new HttpsError('unimplemented', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'the requested function is not available or has been deactivated for use', _object_spread_props$
|
|
239
|
+
return new HttpsError('unimplemented', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'the requested function is not available or has been deactivated for use', _object_spread_props$g(_object_spread$m({
|
|
240
240
|
status: 501,
|
|
241
241
|
code: UNAVAILABLE_OR_DEACTIVATED_FUNCTION_ERROR_CODE
|
|
242
242
|
}, serverError), {
|
|
@@ -251,7 +251,7 @@ function _type_of$7(obj) {
|
|
|
251
251
|
*/ function internalServerError(messageOrError) {
|
|
252
252
|
var _serverError_message;
|
|
253
253
|
var serverError = partialServerError(messageOrError);
|
|
254
|
-
return new HttpsError('internal', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'internal error', _object_spread_props$
|
|
254
|
+
return new HttpsError('internal', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'internal error', _object_spread_props$g(_object_spread$m({
|
|
255
255
|
status: 500,
|
|
256
256
|
code: INTERNAL_SERVER_ERROR_CODE
|
|
257
257
|
}, serverError), {
|
|
@@ -487,7 +487,7 @@ function toIsoStringFromUnixSeconds(value) {
|
|
|
487
487
|
return result;
|
|
488
488
|
}
|
|
489
489
|
|
|
490
|
-
function asyncGeneratorStep$
|
|
490
|
+
function asyncGeneratorStep$j(gen, resolve, reject, _next, _throw, key, arg) {
|
|
491
491
|
try {
|
|
492
492
|
var info = gen[key](arg);
|
|
493
493
|
var value = info.value;
|
|
@@ -501,22 +501,22 @@ function asyncGeneratorStep$h(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
501
501
|
Promise.resolve(value).then(_next, _throw);
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
|
-
function _async_to_generator$
|
|
504
|
+
function _async_to_generator$j(fn) {
|
|
505
505
|
return function() {
|
|
506
506
|
var self = this, args = arguments;
|
|
507
507
|
return new Promise(function(resolve, reject) {
|
|
508
508
|
var gen = fn.apply(self, args);
|
|
509
509
|
function _next(value) {
|
|
510
|
-
asyncGeneratorStep$
|
|
510
|
+
asyncGeneratorStep$j(gen, resolve, reject, _next, _throw, "next", value);
|
|
511
511
|
}
|
|
512
512
|
function _throw(err) {
|
|
513
|
-
asyncGeneratorStep$
|
|
513
|
+
asyncGeneratorStep$j(gen, resolve, reject, _next, _throw, "throw", err);
|
|
514
514
|
}
|
|
515
515
|
_next(undefined);
|
|
516
516
|
});
|
|
517
517
|
};
|
|
518
518
|
}
|
|
519
|
-
function _ts_generator$
|
|
519
|
+
function _ts_generator$j(thisArg, body) {
|
|
520
520
|
var f, y, t, _ = {
|
|
521
521
|
label: 0,
|
|
522
522
|
sent: function() {
|
|
@@ -632,9 +632,9 @@ function _ts_generator$h(thisArg, body) {
|
|
|
632
632
|
* }
|
|
633
633
|
* ```
|
|
634
634
|
*/ function getAuthUserOrUndefined(promise) {
|
|
635
|
-
return _async_to_generator$
|
|
635
|
+
return _async_to_generator$j(function() {
|
|
636
636
|
var result, error;
|
|
637
|
-
return _ts_generator$
|
|
637
|
+
return _ts_generator$j(this, function(_state) {
|
|
638
638
|
switch(_state.label){
|
|
639
639
|
case 0:
|
|
640
640
|
_state.trys.push([
|
|
@@ -682,12 +682,12 @@ function _call_super$5(_this, derived, args) {
|
|
|
682
682
|
derived = _get_prototype_of$5(derived);
|
|
683
683
|
return _possible_constructor_return$5(_this, _is_native_reflect_construct$5() ? Reflect.construct(derived, args || [], _get_prototype_of$5(_this).constructor) : derived.apply(_this, args));
|
|
684
684
|
}
|
|
685
|
-
function _class_call_check$
|
|
685
|
+
function _class_call_check$u(instance, Constructor) {
|
|
686
686
|
if (!(instance instanceof Constructor)) {
|
|
687
687
|
throw new TypeError("Cannot call a class as a function");
|
|
688
688
|
}
|
|
689
689
|
}
|
|
690
|
-
function _define_property$
|
|
690
|
+
function _define_property$B(obj, key, value) {
|
|
691
691
|
if (key in obj) {
|
|
692
692
|
Object.defineProperty(obj, key, {
|
|
693
693
|
value: value,
|
|
@@ -761,11 +761,11 @@ function _is_native_reflect_construct$5() {
|
|
|
761
761
|
*/ var FirebaseServerAuthUserExistsError = /*#__PURE__*/ function(BaseError) {
|
|
762
762
|
_inherits$5(FirebaseServerAuthUserExistsError, BaseError);
|
|
763
763
|
function FirebaseServerAuthUserExistsError(code, identifierType, identifierValue) {
|
|
764
|
-
_class_call_check$
|
|
764
|
+
_class_call_check$u(this, FirebaseServerAuthUserExistsError);
|
|
765
765
|
var _this;
|
|
766
766
|
_this = _call_super$5(this, FirebaseServerAuthUserExistsError, [
|
|
767
767
|
"A user with the provided ".concat(identifierType, " already exists.")
|
|
768
|
-
]), _define_property$
|
|
768
|
+
]), _define_property$B(_this, "code", void 0), _define_property$B(_this, "identifierType", void 0), _define_property$B(_this, "identifierValue", void 0);
|
|
769
769
|
_this.code = code;
|
|
770
770
|
_this.identifierType = identifierType;
|
|
771
771
|
_this.identifierValue = identifierValue;
|
|
@@ -790,11 +790,11 @@ function _is_native_reflect_construct$5() {
|
|
|
790
790
|
*/ var FirebaseServerAuthUserBadInputError = /*#__PURE__*/ function(BaseError) {
|
|
791
791
|
_inherits$5(FirebaseServerAuthUserBadInputError, BaseError);
|
|
792
792
|
function FirebaseServerAuthUserBadInputError(code, inputValue, message) {
|
|
793
|
-
_class_call_check$
|
|
793
|
+
_class_call_check$u(this, FirebaseServerAuthUserBadInputError);
|
|
794
794
|
var _this;
|
|
795
795
|
_this = _call_super$5(this, FirebaseServerAuthUserBadInputError, [
|
|
796
796
|
message !== null && message !== void 0 ? message : "Invalid input for user creation: ".concat(inputValue)
|
|
797
|
-
]), _define_property$
|
|
797
|
+
]), _define_property$B(_this, "code", void 0), _define_property$B(_this, "inputValue", void 0);
|
|
798
798
|
_this.code = code;
|
|
799
799
|
_this.inputValue = inputValue;
|
|
800
800
|
return _this;
|
|
@@ -806,7 +806,7 @@ function _is_native_reflect_construct$5() {
|
|
|
806
806
|
*/ var FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError = /*#__PURE__*/ function(BaseError) {
|
|
807
807
|
_inherits$5(FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError, BaseError);
|
|
808
808
|
function FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError() {
|
|
809
|
-
_class_call_check$
|
|
809
|
+
_class_call_check$u(this, FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError);
|
|
810
810
|
return _call_super$5(this, FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError, [
|
|
811
811
|
"This user has no setup configuration available."
|
|
812
812
|
]);
|
|
@@ -818,11 +818,11 @@ function _is_native_reflect_construct$5() {
|
|
|
818
818
|
*/ var FirebaseServerAuthNewUserSendSetupDetailsThrottleError = /*#__PURE__*/ function(BaseError) {
|
|
819
819
|
_inherits$5(FirebaseServerAuthNewUserSendSetupDetailsThrottleError, BaseError);
|
|
820
820
|
function FirebaseServerAuthNewUserSendSetupDetailsThrottleError(lastSentAt) {
|
|
821
|
-
_class_call_check$
|
|
821
|
+
_class_call_check$u(this, FirebaseServerAuthNewUserSendSetupDetailsThrottleError);
|
|
822
822
|
var _this;
|
|
823
823
|
_this = _call_super$5(this, FirebaseServerAuthNewUserSendSetupDetailsThrottleError, [
|
|
824
824
|
"This user was recently sent details. Try again later."
|
|
825
|
-
]), _define_property$
|
|
825
|
+
]), _define_property$B(_this, "lastSentAt", void 0);
|
|
826
826
|
_this.lastSentAt = lastSentAt;
|
|
827
827
|
return _this;
|
|
828
828
|
}
|
|
@@ -834,7 +834,7 @@ function _is_native_reflect_construct$5() {
|
|
|
834
834
|
*/ var FirebaseServerAuthNewUserSendSetupDetailsSendOnceError = /*#__PURE__*/ function(BaseError) {
|
|
835
835
|
_inherits$5(FirebaseServerAuthNewUserSendSetupDetailsSendOnceError, BaseError);
|
|
836
836
|
function FirebaseServerAuthNewUserSendSetupDetailsSendOnceError() {
|
|
837
|
-
_class_call_check$
|
|
837
|
+
_class_call_check$u(this, FirebaseServerAuthNewUserSendSetupDetailsSendOnceError);
|
|
838
838
|
return _call_super$5(this, FirebaseServerAuthNewUserSendSetupDetailsSendOnceError, [
|
|
839
839
|
"The user has been sent details before and the sendSetupDetailsOnce configuration was true."
|
|
840
840
|
]);
|
|
@@ -848,7 +848,7 @@ function _is_native_reflect_construct$5() {
|
|
|
848
848
|
*/ var FirebaseServerAuthPasswordResetNoResetConfigError = /*#__PURE__*/ function(BaseError) {
|
|
849
849
|
_inherits$5(FirebaseServerAuthPasswordResetNoResetConfigError, BaseError);
|
|
850
850
|
function FirebaseServerAuthPasswordResetNoResetConfigError() {
|
|
851
|
-
_class_call_check$
|
|
851
|
+
_class_call_check$u(this, FirebaseServerAuthPasswordResetNoResetConfigError);
|
|
852
852
|
return _call_super$5(this, FirebaseServerAuthPasswordResetNoResetConfigError, [
|
|
853
853
|
"This user has no active password reset configuration."
|
|
854
854
|
]);
|
|
@@ -861,11 +861,11 @@ function _is_native_reflect_construct$5() {
|
|
|
861
861
|
*/ var FirebaseServerAuthPasswordResetThrottleError = /*#__PURE__*/ function(BaseError) {
|
|
862
862
|
_inherits$5(FirebaseServerAuthPasswordResetThrottleError, BaseError);
|
|
863
863
|
function FirebaseServerAuthPasswordResetThrottleError(lastSentAt) {
|
|
864
|
-
_class_call_check$
|
|
864
|
+
_class_call_check$u(this, FirebaseServerAuthPasswordResetThrottleError);
|
|
865
865
|
var _this;
|
|
866
866
|
_this = _call_super$5(this, FirebaseServerAuthPasswordResetThrottleError, [
|
|
867
867
|
"This user was recently sent password reset details. Try again later."
|
|
868
|
-
]), _define_property$
|
|
868
|
+
]), _define_property$B(_this, "lastSentAt", void 0);
|
|
869
869
|
_this.lastSentAt = lastSentAt;
|
|
870
870
|
return _this;
|
|
871
871
|
}
|
|
@@ -877,7 +877,7 @@ function _is_native_reflect_construct$5() {
|
|
|
877
877
|
*/ var FirebaseServerAuthPasswordResetSendOnceError = /*#__PURE__*/ function(BaseError) {
|
|
878
878
|
_inherits$5(FirebaseServerAuthPasswordResetSendOnceError, BaseError);
|
|
879
879
|
function FirebaseServerAuthPasswordResetSendOnceError() {
|
|
880
|
-
_class_call_check$
|
|
880
|
+
_class_call_check$u(this, FirebaseServerAuthPasswordResetSendOnceError);
|
|
881
881
|
return _call_super$5(this, FirebaseServerAuthPasswordResetSendOnceError, [
|
|
882
882
|
"The user has been sent password reset details before and the sendResetDetailsOnce configuration was true."
|
|
883
883
|
]);
|
|
@@ -890,7 +890,7 @@ function _is_native_reflect_construct$5() {
|
|
|
890
890
|
*/ var FirebaseServerAuthPasswordResetInvalidCodeError = /*#__PURE__*/ function(BaseError) {
|
|
891
891
|
_inherits$5(FirebaseServerAuthPasswordResetInvalidCodeError, BaseError);
|
|
892
892
|
function FirebaseServerAuthPasswordResetInvalidCodeError() {
|
|
893
|
-
_class_call_check$
|
|
893
|
+
_class_call_check$u(this, FirebaseServerAuthPasswordResetInvalidCodeError);
|
|
894
894
|
return _call_super$5(this, FirebaseServerAuthPasswordResetInvalidCodeError, [
|
|
895
895
|
"The provided reset password code is invalid or expired."
|
|
896
896
|
]);
|
|
@@ -899,16 +899,16 @@ function _is_native_reflect_construct$5() {
|
|
|
899
899
|
}
|
|
900
900
|
(BaseError);
|
|
901
901
|
|
|
902
|
-
function _array_like_to_array$
|
|
902
|
+
function _array_like_to_array$h(arr, len) {
|
|
903
903
|
if (len == null || len > arr.length) len = arr.length;
|
|
904
904
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
905
905
|
return arr2;
|
|
906
906
|
}
|
|
907
|
-
function _array_with_holes$
|
|
907
|
+
function _array_with_holes$5(arr) {
|
|
908
908
|
if (Array.isArray(arr)) return arr;
|
|
909
909
|
}
|
|
910
|
-
function _array_without_holes$
|
|
911
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
910
|
+
function _array_without_holes$c(arr) {
|
|
911
|
+
if (Array.isArray(arr)) return _array_like_to_array$h(arr);
|
|
912
912
|
}
|
|
913
913
|
function _assert_this_initialized$4(self) {
|
|
914
914
|
if (self === void 0) {
|
|
@@ -916,7 +916,7 @@ function _assert_this_initialized$4(self) {
|
|
|
916
916
|
}
|
|
917
917
|
return self;
|
|
918
918
|
}
|
|
919
|
-
function asyncGeneratorStep$
|
|
919
|
+
function asyncGeneratorStep$i(gen, resolve, reject, _next, _throw, key, arg) {
|
|
920
920
|
try {
|
|
921
921
|
var info = gen[key](arg);
|
|
922
922
|
var value = info.value;
|
|
@@ -930,16 +930,16 @@ function asyncGeneratorStep$g(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
930
930
|
Promise.resolve(value).then(_next, _throw);
|
|
931
931
|
}
|
|
932
932
|
}
|
|
933
|
-
function _async_to_generator$
|
|
933
|
+
function _async_to_generator$i(fn) {
|
|
934
934
|
return function() {
|
|
935
935
|
var self = this, args = arguments;
|
|
936
936
|
return new Promise(function(resolve, reject) {
|
|
937
937
|
var gen = fn.apply(self, args);
|
|
938
938
|
function _next(value) {
|
|
939
|
-
asyncGeneratorStep$
|
|
939
|
+
asyncGeneratorStep$i(gen, resolve, reject, _next, _throw, "next", value);
|
|
940
940
|
}
|
|
941
941
|
function _throw(err) {
|
|
942
|
-
asyncGeneratorStep$
|
|
942
|
+
asyncGeneratorStep$i(gen, resolve, reject, _next, _throw, "throw", err);
|
|
943
943
|
}
|
|
944
944
|
_next(undefined);
|
|
945
945
|
});
|
|
@@ -949,12 +949,12 @@ function _call_super$4(_this, derived, args) {
|
|
|
949
949
|
derived = _get_prototype_of$4(derived);
|
|
950
950
|
return _possible_constructor_return$4(_this, _is_native_reflect_construct$4() ? Reflect.construct(derived, args || [], _get_prototype_of$4(_this).constructor) : derived.apply(_this, args));
|
|
951
951
|
}
|
|
952
|
-
function _class_call_check$
|
|
952
|
+
function _class_call_check$t(instance, Constructor) {
|
|
953
953
|
if (!(instance instanceof Constructor)) {
|
|
954
954
|
throw new TypeError("Cannot call a class as a function");
|
|
955
955
|
}
|
|
956
956
|
}
|
|
957
|
-
function _defineProperties$
|
|
957
|
+
function _defineProperties$i(target, props) {
|
|
958
958
|
for(var i = 0; i < props.length; i++){
|
|
959
959
|
var descriptor = props[i];
|
|
960
960
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
@@ -963,11 +963,11 @@ function _defineProperties$g(target, props) {
|
|
|
963
963
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
964
964
|
}
|
|
965
965
|
}
|
|
966
|
-
function _create_class$
|
|
967
|
-
if (protoProps) _defineProperties$
|
|
966
|
+
function _create_class$i(Constructor, protoProps, staticProps) {
|
|
967
|
+
if (protoProps) _defineProperties$i(Constructor.prototype, protoProps);
|
|
968
968
|
return Constructor;
|
|
969
969
|
}
|
|
970
|
-
function _define_property$
|
|
970
|
+
function _define_property$A(obj, key, value) {
|
|
971
971
|
if (key in obj) {
|
|
972
972
|
Object.defineProperty(obj, key, {
|
|
973
973
|
value: value,
|
|
@@ -999,10 +999,10 @@ function _inherits$4(subClass, superClass) {
|
|
|
999
999
|
});
|
|
1000
1000
|
if (superClass) _set_prototype_of$4(subClass, superClass);
|
|
1001
1001
|
}
|
|
1002
|
-
function _iterable_to_array$
|
|
1002
|
+
function _iterable_to_array$c(iter) {
|
|
1003
1003
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
1004
1004
|
}
|
|
1005
|
-
function _iterable_to_array_limit$
|
|
1005
|
+
function _iterable_to_array_limit$5(arr, i) {
|
|
1006
1006
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
1007
1007
|
if (_i == null) return;
|
|
1008
1008
|
var _arr = [];
|
|
@@ -1026,13 +1026,13 @@ function _iterable_to_array_limit$4(arr, i) {
|
|
|
1026
1026
|
}
|
|
1027
1027
|
return _arr;
|
|
1028
1028
|
}
|
|
1029
|
-
function _non_iterable_rest$
|
|
1029
|
+
function _non_iterable_rest$5() {
|
|
1030
1030
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1031
1031
|
}
|
|
1032
|
-
function _non_iterable_spread$
|
|
1032
|
+
function _non_iterable_spread$c() {
|
|
1033
1033
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1034
1034
|
}
|
|
1035
|
-
function _object_spread$
|
|
1035
|
+
function _object_spread$l(target) {
|
|
1036
1036
|
for(var i = 1; i < arguments.length; i++){
|
|
1037
1037
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
1038
1038
|
var ownKeys = Object.keys(source);
|
|
@@ -1042,7 +1042,7 @@ function _object_spread$k(target) {
|
|
|
1042
1042
|
}));
|
|
1043
1043
|
}
|
|
1044
1044
|
ownKeys.forEach(function(key) {
|
|
1045
|
-
_define_property$
|
|
1045
|
+
_define_property$A(target, key, source[key]);
|
|
1046
1046
|
});
|
|
1047
1047
|
}
|
|
1048
1048
|
return target;
|
|
@@ -1060,23 +1060,23 @@ function _set_prototype_of$4(o, p) {
|
|
|
1060
1060
|
};
|
|
1061
1061
|
return _set_prototype_of$4(o, p);
|
|
1062
1062
|
}
|
|
1063
|
-
function _sliced_to_array$
|
|
1064
|
-
return _array_with_holes$
|
|
1063
|
+
function _sliced_to_array$5(arr, i) {
|
|
1064
|
+
return _array_with_holes$5(arr) || _iterable_to_array_limit$5(arr, i) || _unsupported_iterable_to_array$h(arr, i) || _non_iterable_rest$5();
|
|
1065
1065
|
}
|
|
1066
|
-
function _to_consumable_array$
|
|
1067
|
-
return _array_without_holes$
|
|
1066
|
+
function _to_consumable_array$c(arr) {
|
|
1067
|
+
return _array_without_holes$c(arr) || _iterable_to_array$c(arr) || _unsupported_iterable_to_array$h(arr) || _non_iterable_spread$c();
|
|
1068
1068
|
}
|
|
1069
1069
|
function _type_of$5(obj) {
|
|
1070
1070
|
"@swc/helpers - typeof";
|
|
1071
1071
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
1072
1072
|
}
|
|
1073
|
-
function _unsupported_iterable_to_array$
|
|
1073
|
+
function _unsupported_iterable_to_array$h(o, minLen) {
|
|
1074
1074
|
if (!o) return;
|
|
1075
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
1075
|
+
if (typeof o === "string") return _array_like_to_array$h(o, minLen);
|
|
1076
1076
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1077
1077
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1078
1078
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
1079
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
1079
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$h(o, minLen);
|
|
1080
1080
|
}
|
|
1081
1081
|
function _is_native_reflect_construct$4() {
|
|
1082
1082
|
try {
|
|
@@ -1086,7 +1086,7 @@ function _is_native_reflect_construct$4() {
|
|
|
1086
1086
|
return !!result;
|
|
1087
1087
|
})();
|
|
1088
1088
|
}
|
|
1089
|
-
function _ts_generator$
|
|
1089
|
+
function _ts_generator$i(thisArg, body) {
|
|
1090
1090
|
var f, y, t, _ = {
|
|
1091
1091
|
label: 0,
|
|
1092
1092
|
sent: function() {
|
|
@@ -1218,16 +1218,16 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1218
1218
|
*/ var AbstractFirebaseServerAuthUserContext = /*#__PURE__*/ function() {
|
|
1219
1219
|
function AbstractFirebaseServerAuthUserContext(service, uid) {
|
|
1220
1220
|
var _this = this;
|
|
1221
|
-
_class_call_check$
|
|
1222
|
-
_define_property$
|
|
1223
|
-
_define_property$
|
|
1224
|
-
_define_property$
|
|
1221
|
+
_class_call_check$t(this, AbstractFirebaseServerAuthUserContext);
|
|
1222
|
+
_define_property$A(this, "_service", void 0);
|
|
1223
|
+
_define_property$A(this, "_uid", void 0);
|
|
1224
|
+
_define_property$A(this, "_loadRecord", cachedGetter(function() {
|
|
1225
1225
|
return _this._service.auth.getUser(_this._uid);
|
|
1226
1226
|
}));
|
|
1227
1227
|
this._service = service;
|
|
1228
1228
|
this._uid = uid;
|
|
1229
1229
|
}
|
|
1230
|
-
_create_class$
|
|
1230
|
+
_create_class$i(AbstractFirebaseServerAuthUserContext, [
|
|
1231
1231
|
{
|
|
1232
1232
|
key: "service",
|
|
1233
1233
|
get: function get() {
|
|
@@ -1243,8 +1243,8 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1243
1243
|
{
|
|
1244
1244
|
key: "exists",
|
|
1245
1245
|
value: function exists() {
|
|
1246
|
-
return _async_to_generator$
|
|
1247
|
-
return _ts_generator$
|
|
1246
|
+
return _async_to_generator$i(function() {
|
|
1247
|
+
return _ts_generator$i(this, function(_state) {
|
|
1248
1248
|
return [
|
|
1249
1249
|
2,
|
|
1250
1250
|
getAuthUserOrUndefined(this._loadRecord()).then(Boolean)
|
|
@@ -1281,9 +1281,9 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1281
1281
|
{
|
|
1282
1282
|
key: "beginResetPassword",
|
|
1283
1283
|
value: function beginResetPassword(options) {
|
|
1284
|
-
return _async_to_generator$
|
|
1284
|
+
return _async_to_generator$i(function() {
|
|
1285
1285
|
var _ref, password, now, expiresInMs, expiresAt, _obj, passwordClaimsData;
|
|
1286
|
-
return _ts_generator$
|
|
1286
|
+
return _ts_generator$i(this, function(_state) {
|
|
1287
1287
|
switch(_state.label){
|
|
1288
1288
|
case 0:
|
|
1289
1289
|
password = this._generateResetPasswordKey();
|
|
@@ -1291,7 +1291,7 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1291
1291
|
// An explicit per-call lifetime wins over the context default; otherwise fall back to _resetCodeExpiresInMs().
|
|
1292
1292
|
expiresInMs = (_ref = options === null || options === void 0 ? void 0 : options.resetCodeExpiresIn) !== null && _ref !== void 0 ? _ref : this._resetCodeExpiresInMs();
|
|
1293
1293
|
expiresAt = new Date(now.getTime() + expiresInMs);
|
|
1294
|
-
passwordClaimsData = (_obj = {}, _define_property$
|
|
1294
|
+
passwordClaimsData = (_obj = {}, _define_property$A(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_PASSWORD_KEY, password), _define_property$A(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY, toISODateString(now)), _define_property$A(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_EXPIRES_AT_KEY, toISODateString(expiresAt)), _obj);
|
|
1295
1295
|
// set the claims
|
|
1296
1296
|
return [
|
|
1297
1297
|
4,
|
|
@@ -1322,9 +1322,9 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1322
1322
|
{
|
|
1323
1323
|
key: "loadResetPasswordClaims",
|
|
1324
1324
|
value: function loadResetPasswordClaims() {
|
|
1325
|
-
return _async_to_generator$
|
|
1325
|
+
return _async_to_generator$i(function() {
|
|
1326
1326
|
var claims, result;
|
|
1327
|
-
return _ts_generator$
|
|
1327
|
+
return _ts_generator$i(this, function(_state) {
|
|
1328
1328
|
switch(_state.label){
|
|
1329
1329
|
case 0:
|
|
1330
1330
|
return [
|
|
@@ -1346,9 +1346,9 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1346
1346
|
{
|
|
1347
1347
|
key: "setPassword",
|
|
1348
1348
|
value: function setPassword(password) {
|
|
1349
|
-
return _async_to_generator$
|
|
1349
|
+
return _async_to_generator$i(function() {
|
|
1350
1350
|
var record, _obj;
|
|
1351
|
-
return _ts_generator$
|
|
1351
|
+
return _ts_generator$i(this, function(_state) {
|
|
1352
1352
|
switch(_state.label){
|
|
1353
1353
|
case 0:
|
|
1354
1354
|
return [
|
|
@@ -1362,7 +1362,7 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1362
1362
|
// clear password reset claims
|
|
1363
1363
|
return [
|
|
1364
1364
|
4,
|
|
1365
|
-
this.updateClaims((_obj = {}, _define_property$
|
|
1365
|
+
this.updateClaims((_obj = {}, _define_property$A(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_PASSWORD_KEY, null), _define_property$A(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY, null), _define_property$A(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_EXPIRES_AT_KEY, null), _obj))
|
|
1366
1366
|
];
|
|
1367
1367
|
case 2:
|
|
1368
1368
|
_state.sent();
|
|
@@ -1378,9 +1378,9 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1378
1378
|
{
|
|
1379
1379
|
key: "updateUser",
|
|
1380
1380
|
value: function updateUser(template) {
|
|
1381
|
-
return _async_to_generator$
|
|
1381
|
+
return _async_to_generator$i(function() {
|
|
1382
1382
|
var e, firebaseError, errorCode, email, phoneNumber;
|
|
1383
|
-
return _ts_generator$
|
|
1383
|
+
return _ts_generator$i(this, function(_state) {
|
|
1384
1384
|
switch(_state.label){
|
|
1385
1385
|
case 0:
|
|
1386
1386
|
_state.trys.push([
|
|
@@ -1423,9 +1423,9 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1423
1423
|
{
|
|
1424
1424
|
key: "loadRoles",
|
|
1425
1425
|
value: function loadRoles() {
|
|
1426
|
-
return _async_to_generator$
|
|
1426
|
+
return _async_to_generator$i(function() {
|
|
1427
1427
|
var claims;
|
|
1428
|
-
return _ts_generator$
|
|
1428
|
+
return _ts_generator$i(this, function(_state) {
|
|
1429
1429
|
switch(_state.label){
|
|
1430
1430
|
case 0:
|
|
1431
1431
|
return [
|
|
@@ -1446,9 +1446,9 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1446
1446
|
{
|
|
1447
1447
|
key: "addRoles",
|
|
1448
1448
|
value: function addRoles(roles) {
|
|
1449
|
-
return _async_to_generator$
|
|
1449
|
+
return _async_to_generator$i(function() {
|
|
1450
1450
|
var claims;
|
|
1451
|
-
return _ts_generator$
|
|
1451
|
+
return _ts_generator$i(this, function(_state) {
|
|
1452
1452
|
claims = this._claimsForRolesChange(roles);
|
|
1453
1453
|
return [
|
|
1454
1454
|
2,
|
|
@@ -1461,14 +1461,14 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1461
1461
|
{
|
|
1462
1462
|
key: "removeRoles",
|
|
1463
1463
|
value: function removeRoles(roles) {
|
|
1464
|
-
return _async_to_generator$
|
|
1464
|
+
return _async_to_generator$i(function() {
|
|
1465
1465
|
var baseClaims, claims;
|
|
1466
|
-
return _ts_generator$
|
|
1466
|
+
return _ts_generator$i(this, function(_state) {
|
|
1467
1467
|
baseClaims = this._claimsForRolesChange(roles);
|
|
1468
1468
|
claims = {};
|
|
1469
1469
|
forEachKeyValue(baseClaims, {
|
|
1470
1470
|
forEach: function forEach(param) {
|
|
1471
|
-
var _param = _sliced_to_array$
|
|
1471
|
+
var _param = _sliced_to_array$5(param, 1), key = _param[0];
|
|
1472
1472
|
claims[key] = null; // set null on every key
|
|
1473
1473
|
},
|
|
1474
1474
|
filter: KeyValueTypleValueFilter.NONE // don't skip any key/value
|
|
@@ -1499,10 +1499,10 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1499
1499
|
* await userCtx.setRoles([AUTH_ADMIN_ROLE], { customFlag: 1 });
|
|
1500
1500
|
* ```
|
|
1501
1501
|
*/ function setRoles(roles, claimsToRetain) {
|
|
1502
|
-
return _async_to_generator$
|
|
1502
|
+
return _async_to_generator$i(function() {
|
|
1503
1503
|
var claims;
|
|
1504
|
-
return _ts_generator$
|
|
1505
|
-
claims = _object_spread$
|
|
1504
|
+
return _ts_generator$i(this, function(_state) {
|
|
1505
|
+
claims = _object_spread$l({}, claimsToRetain, this._claimsForRolesChange(_to_consumable_array$c(roles)));
|
|
1506
1506
|
return [
|
|
1507
1507
|
2,
|
|
1508
1508
|
this.setClaims(claims)
|
|
@@ -1535,9 +1535,9 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1535
1535
|
{
|
|
1536
1536
|
key: "updateClaims",
|
|
1537
1537
|
value: function updateClaims(claims) {
|
|
1538
|
-
return _async_to_generator$
|
|
1538
|
+
return _async_to_generator$i(function() {
|
|
1539
1539
|
var currentClaims, newClaims;
|
|
1540
|
-
return _ts_generator$
|
|
1540
|
+
return _ts_generator$i(this, function(_state) {
|
|
1541
1541
|
switch(_state.label){
|
|
1542
1542
|
case 0:
|
|
1543
1543
|
return [
|
|
@@ -1546,7 +1546,7 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1546
1546
|
];
|
|
1547
1547
|
case 1:
|
|
1548
1548
|
currentClaims = _state.sent();
|
|
1549
|
-
newClaims = _object_spread$
|
|
1549
|
+
newClaims = _object_spread$l({}, currentClaims, filterUndefinedValues(claims, false));
|
|
1550
1550
|
newClaims = filterNullAndUndefinedValues(newClaims);
|
|
1551
1551
|
return [
|
|
1552
1552
|
2,
|
|
@@ -1586,25 +1586,25 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1586
1586
|
*/ var AbstractFirebaseServerAuthContext = /*#__PURE__*/ function() {
|
|
1587
1587
|
function AbstractFirebaseServerAuthContext(service, context) {
|
|
1588
1588
|
var _this = this;
|
|
1589
|
-
_class_call_check$
|
|
1590
|
-
_define_property$
|
|
1591
|
-
_define_property$
|
|
1592
|
-
_define_property$
|
|
1589
|
+
_class_call_check$t(this, AbstractFirebaseServerAuthContext);
|
|
1590
|
+
_define_property$A(this, "_service", void 0);
|
|
1591
|
+
_define_property$A(this, "_context", void 0);
|
|
1592
|
+
_define_property$A(this, "_authRoles", cachedGetter(function() {
|
|
1593
1593
|
return _this.service.readRoles(_this.claims);
|
|
1594
1594
|
}));
|
|
1595
|
-
_define_property$
|
|
1595
|
+
_define_property$A(this, "_isAdmin", cachedGetter(function() {
|
|
1596
1596
|
return _this.service.isAdminInRoles(_this._authRoles());
|
|
1597
1597
|
}));
|
|
1598
|
-
_define_property$
|
|
1598
|
+
_define_property$A(this, "_hasSignedTos", cachedGetter(function() {
|
|
1599
1599
|
return _this.service.hasSignedTosInRoles(_this._authRoles());
|
|
1600
1600
|
}));
|
|
1601
|
-
_define_property$
|
|
1601
|
+
_define_property$A(this, "_userContext", cachedGetter(function() {
|
|
1602
1602
|
return _this.service.userContext(_this.context.auth.uid);
|
|
1603
1603
|
}));
|
|
1604
1604
|
this._service = service;
|
|
1605
1605
|
this._context = context;
|
|
1606
1606
|
}
|
|
1607
|
-
_create_class$
|
|
1607
|
+
_create_class$i(AbstractFirebaseServerAuthContext, [
|
|
1608
1608
|
{
|
|
1609
1609
|
key: "service",
|
|
1610
1610
|
get: function get() {
|
|
@@ -1704,15 +1704,15 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1704
1704
|
* ```
|
|
1705
1705
|
*/ var AbstractFirebaseServerNewUserService = /*#__PURE__*/ function() {
|
|
1706
1706
|
function AbstractFirebaseServerNewUserService(authService) {
|
|
1707
|
-
_class_call_check$
|
|
1708
|
-
_define_property$
|
|
1707
|
+
_class_call_check$t(this, AbstractFirebaseServerNewUserService);
|
|
1708
|
+
_define_property$A(this, "_authService", void 0);
|
|
1709
1709
|
/**
|
|
1710
1710
|
* Minimum time between setup content sends. Defaults to {@link DEFAULT_SETUP_COM_THROTTLE_TIME} (1 hour).
|
|
1711
1711
|
* Override in subclasses to customize the throttle window.
|
|
1712
|
-
*/ _define_property$
|
|
1712
|
+
*/ _define_property$A(this, "setupThrottleTime", DEFAULT_SETUP_COM_THROTTLE_TIME);
|
|
1713
1713
|
this._authService = authService;
|
|
1714
1714
|
}
|
|
1715
|
-
_create_class$
|
|
1715
|
+
_create_class$i(AbstractFirebaseServerNewUserService, [
|
|
1716
1716
|
{
|
|
1717
1717
|
key: "authService",
|
|
1718
1718
|
get: function get() {
|
|
@@ -1722,9 +1722,9 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1722
1722
|
{
|
|
1723
1723
|
key: "initializeNewUser",
|
|
1724
1724
|
value: function initializeNewUser(input) {
|
|
1725
|
-
return _async_to_generator$
|
|
1725
|
+
return _async_to_generator$i(function() {
|
|
1726
1726
|
var uid, email, phone, sendSetupContent, sendSetupContentIfUserExists, sendSetupDetailsOnce, sendSetupIgnoreThrottle, sendSetupThrowErrors, data, sendDetailsInTestEnvironment, userRecordPromise, userRecord, userRecordId, createdUser, createResult, userContext, sentEmail, userContext1;
|
|
1727
|
-
return _ts_generator$
|
|
1727
|
+
return _ts_generator$i(this, function(_state) {
|
|
1728
1728
|
switch(_state.label){
|
|
1729
1729
|
case 0:
|
|
1730
1730
|
uid = input.uid, email = input.email, phone = input.phone, sendSetupContent = input.sendSetupContent, sendSetupContentIfUserExists = input.sendSetupContentIfUserExists, sendSetupDetailsOnce = input.sendSetupDetailsOnce, sendSetupIgnoreThrottle = input.sendSetupIgnoreThrottle, sendSetupThrowErrors = input.sendSetupThrowErrors, data = input.data, sendDetailsInTestEnvironment = input.sendDetailsInTestEnvironment;
|
|
@@ -1819,16 +1819,16 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1819
1819
|
{
|
|
1820
1820
|
key: "addNewUserSetupClaims",
|
|
1821
1821
|
value: function addNewUserSetupClaims(userContextOrUid, setupPassword) {
|
|
1822
|
-
return _async_to_generator$
|
|
1822
|
+
return _async_to_generator$i(function() {
|
|
1823
1823
|
var password, userContext;
|
|
1824
|
-
return _ts_generator$
|
|
1824
|
+
return _ts_generator$i(this, function(_state) {
|
|
1825
1825
|
switch(_state.label){
|
|
1826
1826
|
case 0:
|
|
1827
1827
|
password = setupPassword !== null && setupPassword !== void 0 ? setupPassword : this.generateRandomSetupPassword();
|
|
1828
1828
|
userContext = userContextFromUid(this.authService, userContextOrUid);
|
|
1829
1829
|
return [
|
|
1830
1830
|
4,
|
|
1831
|
-
userContext.updateClaims(_define_property$
|
|
1831
|
+
userContext.updateClaims(_define_property$A({}, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_PASSWORD_KEY, password))
|
|
1832
1832
|
];
|
|
1833
1833
|
case 1:
|
|
1834
1834
|
_state.sent();
|
|
@@ -1844,9 +1844,9 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1844
1844
|
{
|
|
1845
1845
|
key: "sendSetupContent",
|
|
1846
1846
|
value: function sendSetupContent(userContextOrUid, config) {
|
|
1847
|
-
return _async_to_generator$
|
|
1847
|
+
return _async_to_generator$i(function() {
|
|
1848
1848
|
var setupDetails, sentContent, setupCommunicationAt, hasSentCommunication, lastSentAt, sendIsThrottled;
|
|
1849
|
-
return _ts_generator$
|
|
1849
|
+
return _ts_generator$i(this, function(_state) {
|
|
1850
1850
|
switch(_state.label){
|
|
1851
1851
|
case 0:
|
|
1852
1852
|
return [
|
|
@@ -1927,9 +1927,9 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1927
1927
|
{
|
|
1928
1928
|
key: "loadSetupDetails",
|
|
1929
1929
|
value: function loadSetupDetails(userContextOrUid, config) {
|
|
1930
|
-
return _async_to_generator$
|
|
1930
|
+
return _async_to_generator$i(function() {
|
|
1931
1931
|
var userContext, userExists, details;
|
|
1932
|
-
return _ts_generator$
|
|
1932
|
+
return _ts_generator$i(this, function(_state) {
|
|
1933
1933
|
switch(_state.label){
|
|
1934
1934
|
case 0:
|
|
1935
1935
|
userContext = userContextFromUid(this.authService, userContextOrUid);
|
|
@@ -1963,9 +1963,9 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1963
1963
|
{
|
|
1964
1964
|
key: "loadSetupDetailsForUserContext",
|
|
1965
1965
|
value: function loadSetupDetailsForUserContext(userContext, config) {
|
|
1966
|
-
return _async_to_generator$
|
|
1966
|
+
return _async_to_generator$i(function() {
|
|
1967
1967
|
var details, _ref, setupPassword, setupCommunicationAt;
|
|
1968
|
-
return _ts_generator$
|
|
1968
|
+
return _ts_generator$i(this, function(_state) {
|
|
1969
1969
|
switch(_state.label){
|
|
1970
1970
|
case 0:
|
|
1971
1971
|
return [
|
|
@@ -2001,9 +2001,9 @@ function _ts_generator$g(thisArg, body) {
|
|
|
2001
2001
|
*
|
|
2002
2002
|
* @param details - The user's setup details containing the user context.
|
|
2003
2003
|
*/ function updateSetupContentSentTime(details) {
|
|
2004
|
-
return _async_to_generator$
|
|
2004
|
+
return _async_to_generator$i(function() {
|
|
2005
2005
|
var setupCommunicationAt;
|
|
2006
|
-
return _ts_generator$
|
|
2006
|
+
return _ts_generator$i(this, function(_state) {
|
|
2007
2007
|
switch(_state.label){
|
|
2008
2008
|
case 0:
|
|
2009
2009
|
setupCommunicationAt = toISODateString(new Date());
|
|
@@ -2026,9 +2026,9 @@ function _ts_generator$g(thisArg, body) {
|
|
|
2026
2026
|
{
|
|
2027
2027
|
key: "markUserSetupAsComplete",
|
|
2028
2028
|
value: function markUserSetupAsComplete(uid) {
|
|
2029
|
-
return _async_to_generator$
|
|
2029
|
+
return _async_to_generator$i(function() {
|
|
2030
2030
|
var userContext, userExists;
|
|
2031
|
-
return _ts_generator$
|
|
2031
|
+
return _ts_generator$i(this, function(_state) {
|
|
2032
2032
|
switch(_state.label){
|
|
2033
2033
|
case 0:
|
|
2034
2034
|
userContext = this.authService.userContext(uid);
|
|
@@ -2070,9 +2070,9 @@ function _ts_generator$g(thisArg, body) {
|
|
|
2070
2070
|
* @returns The created user record and the setup password used.
|
|
2071
2071
|
* @throws {Error} Throws if the Firebase Admin SDK rejects the user creation.
|
|
2072
2072
|
*/ function createNewUser(input) {
|
|
2073
|
-
return _async_to_generator$
|
|
2073
|
+
return _async_to_generator$i(function() {
|
|
2074
2074
|
var uid, displayName, email, phoneNumber, inputPassword, password, user, e, firebaseError, errorCode;
|
|
2075
|
-
return _ts_generator$
|
|
2075
|
+
return _ts_generator$i(this, function(_state) {
|
|
2076
2076
|
switch(_state.label){
|
|
2077
2077
|
case 0:
|
|
2078
2078
|
uid = input.uid, displayName = input.displayName, email = input.email, phoneNumber = input.phone, inputPassword = input.setupPassword;
|
|
@@ -2139,14 +2139,14 @@ function _ts_generator$g(thisArg, body) {
|
|
|
2139
2139
|
*
|
|
2140
2140
|
* @param userContext - The user context to clear setup claims from.
|
|
2141
2141
|
*/ function updateClaimsToClearUser(userContext) {
|
|
2142
|
-
return _async_to_generator$
|
|
2142
|
+
return _async_to_generator$i(function() {
|
|
2143
2143
|
var _obj;
|
|
2144
|
-
return _ts_generator$
|
|
2144
|
+
return _ts_generator$i(this, function(_state) {
|
|
2145
2145
|
switch(_state.label){
|
|
2146
2146
|
case 0:
|
|
2147
2147
|
return [
|
|
2148
2148
|
4,
|
|
2149
|
-
userContext.updateClaims((_obj = {}, _define_property$
|
|
2149
|
+
userContext.updateClaims((_obj = {}, _define_property$A(_obj, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_PASSWORD_KEY, null), _define_property$A(_obj, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_LAST_COM_DATE_KEY, null), _obj))
|
|
2150
2150
|
];
|
|
2151
2151
|
case 1:
|
|
2152
2152
|
_state.sent();
|
|
@@ -2168,15 +2168,15 @@ function _ts_generator$g(thisArg, body) {
|
|
|
2168
2168
|
*/ var NoSetupContentFirebaseServerNewUserService = /*#__PURE__*/ function(AbstractFirebaseServerNewUserService) {
|
|
2169
2169
|
_inherits$4(NoSetupContentFirebaseServerNewUserService, AbstractFirebaseServerNewUserService);
|
|
2170
2170
|
function NoSetupContentFirebaseServerNewUserService() {
|
|
2171
|
-
_class_call_check$
|
|
2171
|
+
_class_call_check$t(this, NoSetupContentFirebaseServerNewUserService);
|
|
2172
2172
|
return _call_super$4(this, NoSetupContentFirebaseServerNewUserService, arguments);
|
|
2173
2173
|
}
|
|
2174
|
-
_create_class$
|
|
2174
|
+
_create_class$i(NoSetupContentFirebaseServerNewUserService, [
|
|
2175
2175
|
{
|
|
2176
2176
|
key: "sendSetupContentToUser",
|
|
2177
2177
|
value: function sendSetupContentToUser(_details) {
|
|
2178
|
-
return _async_to_generator$
|
|
2179
|
-
return _ts_generator$
|
|
2178
|
+
return _async_to_generator$i(function() {
|
|
2179
|
+
return _ts_generator$i(this, function(_state) {
|
|
2180
2180
|
return [
|
|
2181
2181
|
2
|
|
2182
2182
|
];
|
|
@@ -2261,15 +2261,15 @@ function _ts_generator$g(thisArg, body) {
|
|
|
2261
2261
|
* ```
|
|
2262
2262
|
*/ var AbstractFirebaseServerUserPasswordResetService = /*#__PURE__*/ function() {
|
|
2263
2263
|
function AbstractFirebaseServerUserPasswordResetService(authService) {
|
|
2264
|
-
_class_call_check$
|
|
2265
|
-
_define_property$
|
|
2264
|
+
_class_call_check$t(this, AbstractFirebaseServerUserPasswordResetService);
|
|
2265
|
+
_define_property$A(this, "_authService", void 0);
|
|
2266
2266
|
/**
|
|
2267
2267
|
* Minimum time between reset content sends. Defaults to {@link DEFAULT_RESET_COM_THROTTLE_TIME} (1 hour).
|
|
2268
2268
|
* Override in subclasses to customize the throttle window.
|
|
2269
|
-
*/ _define_property$
|
|
2269
|
+
*/ _define_property$A(this, "resetThrottleTime", DEFAULT_RESET_COM_THROTTLE_TIME);
|
|
2270
2270
|
this._authService = authService;
|
|
2271
2271
|
}
|
|
2272
|
-
_create_class$
|
|
2272
|
+
_create_class$i(AbstractFirebaseServerUserPasswordResetService, [
|
|
2273
2273
|
{
|
|
2274
2274
|
key: "authService",
|
|
2275
2275
|
get: function get() {
|
|
@@ -2279,9 +2279,9 @@ function _ts_generator$g(thisArg, body) {
|
|
|
2279
2279
|
{
|
|
2280
2280
|
key: "beginPasswordReset",
|
|
2281
2281
|
value: function beginPasswordReset(input) {
|
|
2282
|
-
return _async_to_generator$
|
|
2282
|
+
return _async_to_generator$i(function() {
|
|
2283
2283
|
var uid, email, sendResetContent, sendResetDetailsOnce, sendResetIgnoreThrottle, sendResetThrowErrors, data, sendDetailsInTestEnvironment, resetCodeExpiresIn, resolvedUid, userRecord, userContext, claims, oobCode;
|
|
2284
|
-
return _ts_generator$
|
|
2284
|
+
return _ts_generator$i(this, function(_state) {
|
|
2285
2285
|
switch(_state.label){
|
|
2286
2286
|
case 0:
|
|
2287
2287
|
uid = input.uid, email = input.email, sendResetContent = input.sendResetContent, sendResetDetailsOnce = input.sendResetDetailsOnce, sendResetIgnoreThrottle = input.sendResetIgnoreThrottle, sendResetThrowErrors = input.sendResetThrowErrors, data = input.data, sendDetailsInTestEnvironment = input.sendDetailsInTestEnvironment, resetCodeExpiresIn = input.resetCodeExpiresIn;
|
|
@@ -2359,9 +2359,9 @@ function _ts_generator$g(thisArg, body) {
|
|
|
2359
2359
|
{
|
|
2360
2360
|
key: "sendResetContent",
|
|
2361
2361
|
value: function sendResetContent(uid, config) {
|
|
2362
|
-
return _async_to_generator$
|
|
2362
|
+
return _async_to_generator$i(function() {
|
|
2363
2363
|
var resetDetails, sentContent, resetCommunicationAt, hasSentCommunication, lastSentAt, sendIsThrottled;
|
|
2364
|
-
return _ts_generator$
|
|
2364
|
+
return _ts_generator$i(this, function(_state) {
|
|
2365
2365
|
switch(_state.label){
|
|
2366
2366
|
case 0:
|
|
2367
2367
|
return [
|
|
@@ -2440,9 +2440,9 @@ function _ts_generator$g(thisArg, body) {
|
|
|
2440
2440
|
{
|
|
2441
2441
|
key: "loadResetDetails",
|
|
2442
2442
|
value: function loadResetDetails(uid, config) {
|
|
2443
|
-
return _async_to_generator$
|
|
2443
|
+
return _async_to_generator$i(function() {
|
|
2444
2444
|
var userContext, userExists, details;
|
|
2445
|
-
return _ts_generator$
|
|
2445
|
+
return _ts_generator$i(this, function(_state) {
|
|
2446
2446
|
switch(_state.label){
|
|
2447
2447
|
case 0:
|
|
2448
2448
|
userContext = this.authService.userContext(uid);
|
|
@@ -2476,9 +2476,9 @@ function _ts_generator$g(thisArg, body) {
|
|
|
2476
2476
|
{
|
|
2477
2477
|
key: "loadResetDetailsForUserContext",
|
|
2478
2478
|
value: function loadResetDetailsForUserContext(userContext, config) {
|
|
2479
|
-
return _async_to_generator$
|
|
2479
|
+
return _async_to_generator$i(function() {
|
|
2480
2480
|
var details, claims;
|
|
2481
|
-
return _ts_generator$
|
|
2481
|
+
return _ts_generator$i(this, function(_state) {
|
|
2482
2482
|
switch(_state.label){
|
|
2483
2483
|
case 0:
|
|
2484
2484
|
return [
|
|
@@ -2516,15 +2516,15 @@ function _ts_generator$g(thisArg, body) {
|
|
|
2516
2516
|
*
|
|
2517
2517
|
* @param details - The user's reset details containing the user context.
|
|
2518
2518
|
*/ function updateResetContentSentTime(details) {
|
|
2519
|
-
return _async_to_generator$
|
|
2519
|
+
return _async_to_generator$i(function() {
|
|
2520
2520
|
var resetCommunicationAt;
|
|
2521
|
-
return _ts_generator$
|
|
2521
|
+
return _ts_generator$i(this, function(_state) {
|
|
2522
2522
|
switch(_state.label){
|
|
2523
2523
|
case 0:
|
|
2524
2524
|
resetCommunicationAt = toISODateString(new Date());
|
|
2525
2525
|
return [
|
|
2526
2526
|
4,
|
|
2527
|
-
details.userContext.updateClaims(_define_property$
|
|
2527
|
+
details.userContext.updateClaims(_define_property$A({}, FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY, resetCommunicationAt))
|
|
2528
2528
|
];
|
|
2529
2529
|
case 1:
|
|
2530
2530
|
_state.sent();
|
|
@@ -2539,9 +2539,9 @@ function _ts_generator$g(thisArg, body) {
|
|
|
2539
2539
|
{
|
|
2540
2540
|
key: "completePasswordReset",
|
|
2541
2541
|
value: function completePasswordReset(input) {
|
|
2542
|
-
return _async_to_generator$
|
|
2542
|
+
return _async_to_generator$i(function() {
|
|
2543
2543
|
var decoded, userContext, claims, storedCode, expiresAt, storedBuf, inputBuf;
|
|
2544
|
-
return _ts_generator$
|
|
2544
|
+
return _ts_generator$i(this, function(_state) {
|
|
2545
2545
|
switch(_state.label){
|
|
2546
2546
|
case 0:
|
|
2547
2547
|
// Decode the composite token. A malformed token is treated identically to every other
|
|
@@ -2610,15 +2610,15 @@ function _ts_generator$g(thisArg, body) {
|
|
|
2610
2610
|
*/ var NoContentFirebaseServerUserPasswordResetService = /*#__PURE__*/ function(AbstractFirebaseServerUserPasswordResetService) {
|
|
2611
2611
|
_inherits$4(NoContentFirebaseServerUserPasswordResetService, AbstractFirebaseServerUserPasswordResetService);
|
|
2612
2612
|
function NoContentFirebaseServerUserPasswordResetService() {
|
|
2613
|
-
_class_call_check$
|
|
2613
|
+
_class_call_check$t(this, NoContentFirebaseServerUserPasswordResetService);
|
|
2614
2614
|
return _call_super$4(this, NoContentFirebaseServerUserPasswordResetService, arguments);
|
|
2615
2615
|
}
|
|
2616
|
-
_create_class$
|
|
2616
|
+
_create_class$i(NoContentFirebaseServerUserPasswordResetService, [
|
|
2617
2617
|
{
|
|
2618
2618
|
key: "sendPasswordResetContentToUser",
|
|
2619
2619
|
value: function sendPasswordResetContentToUser(_details) {
|
|
2620
|
-
return _async_to_generator$
|
|
2621
|
-
return _ts_generator$
|
|
2620
|
+
return _async_to_generator$i(function() {
|
|
2621
|
+
return _ts_generator$i(this, function(_state) {
|
|
2622
2622
|
return [
|
|
2623
2623
|
2
|
|
2624
2624
|
];
|
|
@@ -2650,7 +2650,7 @@ function _ts_generator$g(thisArg, body) {
|
|
|
2650
2650
|
* }
|
|
2651
2651
|
* ```
|
|
2652
2652
|
*/ var FirebaseServerAuthService = function FirebaseServerAuthService() {
|
|
2653
|
-
_class_call_check$
|
|
2653
|
+
_class_call_check$t(this, FirebaseServerAuthService);
|
|
2654
2654
|
};
|
|
2655
2655
|
/**
|
|
2656
2656
|
* Base implementation of {@link FirebaseServerAuthService} providing standard admin/ToS checks,
|
|
@@ -2681,11 +2681,11 @@ function _ts_generator$g(thisArg, body) {
|
|
|
2681
2681
|
* ```
|
|
2682
2682
|
*/ var AbstractFirebaseServerAuthService = /*#__PURE__*/ function() {
|
|
2683
2683
|
function AbstractFirebaseServerAuthService(auth) {
|
|
2684
|
-
_class_call_check$
|
|
2685
|
-
_define_property$
|
|
2684
|
+
_class_call_check$t(this, AbstractFirebaseServerAuthService);
|
|
2685
|
+
_define_property$A(this, "_auth", void 0);
|
|
2686
2686
|
this._auth = auth;
|
|
2687
2687
|
}
|
|
2688
|
-
_create_class$
|
|
2688
|
+
_create_class$i(AbstractFirebaseServerAuthService, [
|
|
2689
2689
|
{
|
|
2690
2690
|
key: "auth",
|
|
2691
2691
|
get: function get() {
|
|
@@ -2783,7 +2783,7 @@ function _ts_generator$g(thisArg, body) {
|
|
|
2783
2783
|
}
|
|
2784
2784
|
();
|
|
2785
2785
|
|
|
2786
|
-
function asyncGeneratorStep$
|
|
2786
|
+
function asyncGeneratorStep$h(gen, resolve, reject, _next, _throw, key, arg) {
|
|
2787
2787
|
try {
|
|
2788
2788
|
var info = gen[key](arg);
|
|
2789
2789
|
var value = info.value;
|
|
@@ -2797,22 +2797,22 @@ function asyncGeneratorStep$f(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
2797
2797
|
Promise.resolve(value).then(_next, _throw);
|
|
2798
2798
|
}
|
|
2799
2799
|
}
|
|
2800
|
-
function _async_to_generator$
|
|
2800
|
+
function _async_to_generator$h(fn) {
|
|
2801
2801
|
return function() {
|
|
2802
2802
|
var self = this, args = arguments;
|
|
2803
2803
|
return new Promise(function(resolve, reject) {
|
|
2804
2804
|
var gen = fn.apply(self, args);
|
|
2805
2805
|
function _next(value) {
|
|
2806
|
-
asyncGeneratorStep$
|
|
2806
|
+
asyncGeneratorStep$h(gen, resolve, reject, _next, _throw, "next", value);
|
|
2807
2807
|
}
|
|
2808
2808
|
function _throw(err) {
|
|
2809
|
-
asyncGeneratorStep$
|
|
2809
|
+
asyncGeneratorStep$h(gen, resolve, reject, _next, _throw, "throw", err);
|
|
2810
2810
|
}
|
|
2811
2811
|
_next(undefined);
|
|
2812
2812
|
});
|
|
2813
2813
|
};
|
|
2814
2814
|
}
|
|
2815
|
-
function _ts_generator$
|
|
2815
|
+
function _ts_generator$h(thisArg, body) {
|
|
2816
2816
|
var f, y, t, _ = {
|
|
2817
2817
|
label: 0,
|
|
2818
2818
|
sent: function() {
|
|
@@ -2940,9 +2940,9 @@ function _ts_generator$f(thisArg, body) {
|
|
|
2940
2940
|
* const userData = await assertSnapshotData(userDocument);
|
|
2941
2941
|
* ```
|
|
2942
2942
|
*/ function assertSnapshotData(document, message) {
|
|
2943
|
-
return _async_to_generator$
|
|
2943
|
+
return _async_to_generator$h(function() {
|
|
2944
2944
|
var data;
|
|
2945
|
-
return _ts_generator$
|
|
2945
|
+
return _ts_generator$h(this, function(_state) {
|
|
2946
2946
|
switch(_state.label){
|
|
2947
2947
|
case 0:
|
|
2948
2948
|
return [
|
|
@@ -2974,9 +2974,9 @@ function _ts_generator$f(thisArg, body) {
|
|
|
2974
2974
|
* @returns The document's snapshot data with `id` and `key` attached.
|
|
2975
2975
|
* @throws {HttpsError} Throws a {@link modelNotAvailableError} (404) if the document has no data.
|
|
2976
2976
|
*/ function assertSnapshotDataWithKey(document, message) {
|
|
2977
|
-
return _async_to_generator$
|
|
2977
|
+
return _async_to_generator$h(function() {
|
|
2978
2978
|
var data;
|
|
2979
|
-
return _ts_generator$
|
|
2979
|
+
return _ts_generator$h(this, function(_state) {
|
|
2980
2980
|
switch(_state.label){
|
|
2981
2981
|
case 0:
|
|
2982
2982
|
return [
|
|
@@ -3000,9 +3000,9 @@ function _ts_generator$f(thisArg, body) {
|
|
|
3000
3000
|
* @param message - Optional custom error message.
|
|
3001
3001
|
* @throws {HttpsError} Throws a {@link modelNotAvailableError} (404) if the document does not exist.
|
|
3002
3002
|
*/ function assertDocumentExists(document, message) {
|
|
3003
|
-
return _async_to_generator$
|
|
3003
|
+
return _async_to_generator$h(function() {
|
|
3004
3004
|
var exists;
|
|
3005
|
-
return _ts_generator$
|
|
3005
|
+
return _ts_generator$h(this, function(_state) {
|
|
3006
3006
|
switch(_state.label){
|
|
3007
3007
|
case 0:
|
|
3008
3008
|
return [
|
|
@@ -3068,7 +3068,7 @@ function _ts_generator$f(thisArg, body) {
|
|
|
3068
3068
|
});
|
|
3069
3069
|
}
|
|
3070
3070
|
|
|
3071
|
-
function asyncGeneratorStep$
|
|
3071
|
+
function asyncGeneratorStep$g(gen, resolve, reject, _next, _throw, key, arg) {
|
|
3072
3072
|
try {
|
|
3073
3073
|
var info = gen[key](arg);
|
|
3074
3074
|
var value = info.value;
|
|
@@ -3082,22 +3082,22 @@ function asyncGeneratorStep$e(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
3082
3082
|
Promise.resolve(value).then(_next, _throw);
|
|
3083
3083
|
}
|
|
3084
3084
|
}
|
|
3085
|
-
function _async_to_generator$
|
|
3085
|
+
function _async_to_generator$g(fn) {
|
|
3086
3086
|
return function() {
|
|
3087
3087
|
var self = this, args = arguments;
|
|
3088
3088
|
return new Promise(function(resolve, reject) {
|
|
3089
3089
|
var gen = fn.apply(self, args);
|
|
3090
3090
|
function _next(value) {
|
|
3091
|
-
asyncGeneratorStep$
|
|
3091
|
+
asyncGeneratorStep$g(gen, resolve, reject, _next, _throw, "next", value);
|
|
3092
3092
|
}
|
|
3093
3093
|
function _throw(err) {
|
|
3094
|
-
asyncGeneratorStep$
|
|
3094
|
+
asyncGeneratorStep$g(gen, resolve, reject, _next, _throw, "throw", err);
|
|
3095
3095
|
}
|
|
3096
3096
|
_next(undefined);
|
|
3097
3097
|
});
|
|
3098
3098
|
};
|
|
3099
3099
|
}
|
|
3100
|
-
function _instanceof$
|
|
3100
|
+
function _instanceof$4(left, right) {
|
|
3101
3101
|
"@swc/helpers - instanceof";
|
|
3102
3102
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
3103
3103
|
return !!right[Symbol.hasInstance](left);
|
|
@@ -3105,7 +3105,7 @@ function _instanceof$3(left, right) {
|
|
|
3105
3105
|
return left instanceof right;
|
|
3106
3106
|
}
|
|
3107
3107
|
}
|
|
3108
|
-
function _ts_generator$
|
|
3108
|
+
function _ts_generator$g(thisArg, body) {
|
|
3109
3109
|
var f, y, t, _ = {
|
|
3110
3110
|
label: 0,
|
|
3111
3111
|
sent: function() {
|
|
@@ -3231,9 +3231,9 @@ function _ts_generator$e(thisArg, body) {
|
|
|
3231
3231
|
* enumeration-safe opaque response. Pass the caller's admin status here.
|
|
3232
3232
|
* @returns The result of the function.
|
|
3233
3233
|
*/ function catchAndThrowPasswordResetServerErrors(fn, isAdmin) {
|
|
3234
|
-
return _async_to_generator$
|
|
3234
|
+
return _async_to_generator$g(function() {
|
|
3235
3235
|
var result, error;
|
|
3236
|
-
return _ts_generator$
|
|
3236
|
+
return _ts_generator$g(this, function(_state) {
|
|
3237
3237
|
switch(_state.label){
|
|
3238
3238
|
case 0:
|
|
3239
3239
|
_state.trys.push([
|
|
@@ -3254,13 +3254,13 @@ function _ts_generator$e(thisArg, body) {
|
|
|
3254
3254
|
];
|
|
3255
3255
|
case 2:
|
|
3256
3256
|
error = _state.sent();
|
|
3257
|
-
if (_instanceof$
|
|
3257
|
+
if (_instanceof$4(error, FirebaseServerAuthPasswordResetInvalidCodeError)) {
|
|
3258
3258
|
throw authServicePasswordResetInvalidCodeError();
|
|
3259
|
-
} else if (_instanceof$
|
|
3259
|
+
} else if (_instanceof$4(error, FirebaseServerAuthPasswordResetNoResetConfigError)) {
|
|
3260
3260
|
throw isAdmin ? authServicePasswordResetNoConfigError() : authServicePasswordResetInvalidCodeError();
|
|
3261
|
-
} else if (_instanceof$
|
|
3261
|
+
} else if (_instanceof$4(error, FirebaseServerAuthPasswordResetSendOnceError)) {
|
|
3262
3262
|
throw isAdmin ? authServicePasswordResetSendOnceError() : authServicePasswordResetInvalidCodeError();
|
|
3263
|
-
} else if (_instanceof$
|
|
3263
|
+
} else if (_instanceof$4(error, FirebaseServerAuthPasswordResetThrottleError)) {
|
|
3264
3264
|
throw authServicePasswordResetThrottleError();
|
|
3265
3265
|
}
|
|
3266
3266
|
throw error;
|
|
@@ -3367,7 +3367,7 @@ function _ts_generator$e(thisArg, body) {
|
|
|
3367
3367
|
];
|
|
3368
3368
|
}
|
|
3369
3369
|
|
|
3370
|
-
function _class_call_check$
|
|
3370
|
+
function _class_call_check$s(instance, Constructor) {
|
|
3371
3371
|
if (!(instance instanceof Constructor)) {
|
|
3372
3372
|
throw new TypeError("Cannot call a class as a function");
|
|
3373
3373
|
}
|
|
@@ -3379,7 +3379,7 @@ function _class_call_check$p(instance, Constructor) {
|
|
|
3379
3379
|
* Implementations are typically injected via {@link FIREBASE_SERVER_ENV_TOKEN} and
|
|
3380
3380
|
* backed by a {@link FirebaseServerEnvironmentConfig}.
|
|
3381
3381
|
*/ var FirebaseServerEnvService = function FirebaseServerEnvService() {
|
|
3382
|
-
_class_call_check$
|
|
3382
|
+
_class_call_check$s(this, FirebaseServerEnvService);
|
|
3383
3383
|
}
|
|
3384
3384
|
;
|
|
3385
3385
|
|
|
@@ -3406,15 +3406,15 @@ function _class_call_check$p(instance, Constructor) {
|
|
|
3406
3406
|
});
|
|
3407
3407
|
}
|
|
3408
3408
|
|
|
3409
|
-
function _array_like_to_array$
|
|
3409
|
+
function _array_like_to_array$g(arr, len) {
|
|
3410
3410
|
if (len == null || len > arr.length) len = arr.length;
|
|
3411
3411
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
3412
3412
|
return arr2;
|
|
3413
3413
|
}
|
|
3414
|
-
function _array_without_holes$
|
|
3415
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
3414
|
+
function _array_without_holes$b(arr) {
|
|
3415
|
+
if (Array.isArray(arr)) return _array_like_to_array$g(arr);
|
|
3416
3416
|
}
|
|
3417
|
-
function _define_property$
|
|
3417
|
+
function _define_property$z(obj, key, value) {
|
|
3418
3418
|
if (key in obj) {
|
|
3419
3419
|
Object.defineProperty(obj, key, {
|
|
3420
3420
|
value: value,
|
|
@@ -3427,13 +3427,13 @@ function _define_property$w(obj, key, value) {
|
|
|
3427
3427
|
}
|
|
3428
3428
|
return obj;
|
|
3429
3429
|
}
|
|
3430
|
-
function _iterable_to_array$
|
|
3430
|
+
function _iterable_to_array$b(iter) {
|
|
3431
3431
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
3432
3432
|
}
|
|
3433
|
-
function _non_iterable_spread$
|
|
3433
|
+
function _non_iterable_spread$b() {
|
|
3434
3434
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3435
3435
|
}
|
|
3436
|
-
function _object_spread$
|
|
3436
|
+
function _object_spread$k(target) {
|
|
3437
3437
|
for(var i = 1; i < arguments.length; i++){
|
|
3438
3438
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
3439
3439
|
var ownKeys = Object.keys(source);
|
|
@@ -3443,21 +3443,21 @@ function _object_spread$j(target) {
|
|
|
3443
3443
|
}));
|
|
3444
3444
|
}
|
|
3445
3445
|
ownKeys.forEach(function(key) {
|
|
3446
|
-
_define_property$
|
|
3446
|
+
_define_property$z(target, key, source[key]);
|
|
3447
3447
|
});
|
|
3448
3448
|
}
|
|
3449
3449
|
return target;
|
|
3450
3450
|
}
|
|
3451
|
-
function _to_consumable_array$
|
|
3452
|
-
return _array_without_holes$
|
|
3451
|
+
function _to_consumable_array$b(arr) {
|
|
3452
|
+
return _array_without_holes$b(arr) || _iterable_to_array$b(arr) || _unsupported_iterable_to_array$g(arr) || _non_iterable_spread$b();
|
|
3453
3453
|
}
|
|
3454
|
-
function _unsupported_iterable_to_array$
|
|
3454
|
+
function _unsupported_iterable_to_array$g(o, minLen) {
|
|
3455
3455
|
if (!o) return;
|
|
3456
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
3456
|
+
if (typeof o === "string") return _array_like_to_array$g(o, minLen);
|
|
3457
3457
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
3458
3458
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
3459
3459
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
3460
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
3460
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$g(o, minLen);
|
|
3461
3461
|
}
|
|
3462
3462
|
/**
|
|
3463
3463
|
* Converts a {@link FirestoreAccessorArrayUpdate} into Firestore {@link UpdateData} using
|
|
@@ -3483,23 +3483,23 @@ function _unsupported_iterable_to_array$d(o, minLen) {
|
|
|
3483
3483
|
result = mapObjectMap(fieldUpdate, function(arrayUpdate) {
|
|
3484
3484
|
var result;
|
|
3485
3485
|
if (arrayUpdate) {
|
|
3486
|
-
result = arrayUpdateFunction.apply(void 0, _to_consumable_array$
|
|
3486
|
+
result = arrayUpdateFunction.apply(void 0, _to_consumable_array$b(arrayUpdate)); // use spread operator to insert each value as an argument, as "nested arrays" are not allowed in the Firestore
|
|
3487
3487
|
}
|
|
3488
3488
|
return result;
|
|
3489
3489
|
});
|
|
3490
3490
|
}
|
|
3491
3491
|
return result;
|
|
3492
3492
|
}
|
|
3493
|
-
var updateData = _object_spread$
|
|
3493
|
+
var updateData = _object_spread$k({}, createUpdatesWithArrayFunction(union, FieldValue.arrayUnion), createUpdatesWithArrayFunction(remove, FieldValue.arrayRemove));
|
|
3494
3494
|
return updateData;
|
|
3495
3495
|
}
|
|
3496
3496
|
|
|
3497
|
-
function _class_call_check$
|
|
3497
|
+
function _class_call_check$r(instance, Constructor) {
|
|
3498
3498
|
if (!(instance instanceof Constructor)) {
|
|
3499
3499
|
throw new TypeError("Cannot call a class as a function");
|
|
3500
3500
|
}
|
|
3501
3501
|
}
|
|
3502
|
-
function _defineProperties$
|
|
3502
|
+
function _defineProperties$h(target, props) {
|
|
3503
3503
|
for(var i = 0; i < props.length; i++){
|
|
3504
3504
|
var descriptor = props[i];
|
|
3505
3505
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
@@ -3508,11 +3508,11 @@ function _defineProperties$f(target, props) {
|
|
|
3508
3508
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
3509
3509
|
}
|
|
3510
3510
|
}
|
|
3511
|
-
function _create_class$
|
|
3512
|
-
if (protoProps) _defineProperties$
|
|
3511
|
+
function _create_class$h(Constructor, protoProps, staticProps) {
|
|
3512
|
+
if (protoProps) _defineProperties$h(Constructor.prototype, protoProps);
|
|
3513
3513
|
return Constructor;
|
|
3514
3514
|
}
|
|
3515
|
-
function _define_property$
|
|
3515
|
+
function _define_property$y(obj, key, value) {
|
|
3516
3516
|
if (key in obj) {
|
|
3517
3517
|
Object.defineProperty(obj, key, {
|
|
3518
3518
|
value: value,
|
|
@@ -3534,13 +3534,13 @@ function _define_property$v(obj, key, value) {
|
|
|
3534
3534
|
* (get, exists) bypass the batch and read directly from Firestore.
|
|
3535
3535
|
*/ var WriteBatchFirestoreDocumentDataAccessor = /*#__PURE__*/ function() {
|
|
3536
3536
|
function WriteBatchFirestoreDocumentDataAccessor(batch, documentRef) {
|
|
3537
|
-
_class_call_check$
|
|
3538
|
-
_define_property$
|
|
3539
|
-
_define_property$
|
|
3537
|
+
_class_call_check$r(this, WriteBatchFirestoreDocumentDataAccessor);
|
|
3538
|
+
_define_property$y(this, "documentRef", void 0);
|
|
3539
|
+
_define_property$y(this, "_batch", void 0);
|
|
3540
3540
|
this.documentRef = documentRef;
|
|
3541
3541
|
this._batch = batch;
|
|
3542
3542
|
}
|
|
3543
|
-
_create_class$
|
|
3543
|
+
_create_class$h(WriteBatchFirestoreDocumentDataAccessor, [
|
|
3544
3544
|
{
|
|
3545
3545
|
key: "batch",
|
|
3546
3546
|
get: function get() {
|
|
@@ -3652,14 +3652,14 @@ function _define_property$v(obj, key, value) {
|
|
|
3652
3652
|
* All document accessors created from this context queue writes into the same batch.
|
|
3653
3653
|
*/ var WriteBatchFirestoreDocumentContext = /*#__PURE__*/ function() {
|
|
3654
3654
|
function WriteBatchFirestoreDocumentContext(batch) {
|
|
3655
|
-
_class_call_check$
|
|
3656
|
-
_define_property$
|
|
3657
|
-
_define_property$
|
|
3658
|
-
_define_property$
|
|
3655
|
+
_class_call_check$r(this, WriteBatchFirestoreDocumentContext);
|
|
3656
|
+
_define_property$y(this, "_batch", void 0);
|
|
3657
|
+
_define_property$y(this, "contextType", FirestoreDocumentContextType.BATCH);
|
|
3658
|
+
_define_property$y(this, "accessorFactory", void 0);
|
|
3659
3659
|
this._batch = batch;
|
|
3660
3660
|
this.accessorFactory = writeBatchAccessorFactory(batch);
|
|
3661
3661
|
}
|
|
3662
|
-
_create_class$
|
|
3662
|
+
_create_class$h(WriteBatchFirestoreDocumentContext, [
|
|
3663
3663
|
{
|
|
3664
3664
|
key: "batch",
|
|
3665
3665
|
get: function get() {
|
|
@@ -3678,12 +3678,12 @@ function _define_property$v(obj, key, value) {
|
|
|
3678
3678
|
return new WriteBatchFirestoreDocumentContext(batch);
|
|
3679
3679
|
}
|
|
3680
3680
|
|
|
3681
|
-
function _class_call_check$
|
|
3681
|
+
function _class_call_check$q(instance, Constructor) {
|
|
3682
3682
|
if (!(instance instanceof Constructor)) {
|
|
3683
3683
|
throw new TypeError("Cannot call a class as a function");
|
|
3684
3684
|
}
|
|
3685
3685
|
}
|
|
3686
|
-
function _defineProperties$
|
|
3686
|
+
function _defineProperties$g(target, props) {
|
|
3687
3687
|
for(var i = 0; i < props.length; i++){
|
|
3688
3688
|
var descriptor = props[i];
|
|
3689
3689
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
@@ -3692,11 +3692,11 @@ function _defineProperties$e(target, props) {
|
|
|
3692
3692
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
3693
3693
|
}
|
|
3694
3694
|
}
|
|
3695
|
-
function _create_class$
|
|
3696
|
-
if (protoProps) _defineProperties$
|
|
3695
|
+
function _create_class$g(Constructor, protoProps, staticProps) {
|
|
3696
|
+
if (protoProps) _defineProperties$g(Constructor.prototype, protoProps);
|
|
3697
3697
|
return Constructor;
|
|
3698
3698
|
}
|
|
3699
|
-
function _define_property$
|
|
3699
|
+
function _define_property$x(obj, key, value) {
|
|
3700
3700
|
if (key in obj) {
|
|
3701
3701
|
Object.defineProperty(obj, key, {
|
|
3702
3702
|
value: value,
|
|
@@ -3717,11 +3717,11 @@ function _define_property$u(obj, key, value) {
|
|
|
3717
3717
|
* batching or transactional context. Supports real-time streaming via `onSnapshot`.
|
|
3718
3718
|
*/ var DefaultFirestoreDocumentDataAccessor = /*#__PURE__*/ function() {
|
|
3719
3719
|
function DefaultFirestoreDocumentDataAccessor(documentRef) {
|
|
3720
|
-
_class_call_check$
|
|
3721
|
-
_define_property$
|
|
3720
|
+
_class_call_check$q(this, DefaultFirestoreDocumentDataAccessor);
|
|
3721
|
+
_define_property$x(this, "_documentRef", void 0);
|
|
3722
3722
|
this._documentRef = documentRef;
|
|
3723
3723
|
}
|
|
3724
|
-
_create_class$
|
|
3724
|
+
_create_class$g(DefaultFirestoreDocumentDataAccessor, [
|
|
3725
3725
|
{
|
|
3726
3726
|
key: "documentRef",
|
|
3727
3727
|
get: function get() {
|
|
@@ -3829,12 +3829,12 @@ function _define_property$u(obj, key, value) {
|
|
|
3829
3829
|
};
|
|
3830
3830
|
}
|
|
3831
3831
|
|
|
3832
|
-
function _class_call_check$
|
|
3832
|
+
function _class_call_check$p(instance, Constructor) {
|
|
3833
3833
|
if (!(instance instanceof Constructor)) {
|
|
3834
3834
|
throw new TypeError("Cannot call a class as a function");
|
|
3835
3835
|
}
|
|
3836
3836
|
}
|
|
3837
|
-
function _defineProperties$
|
|
3837
|
+
function _defineProperties$f(target, props) {
|
|
3838
3838
|
for(var i = 0; i < props.length; i++){
|
|
3839
3839
|
var descriptor = props[i];
|
|
3840
3840
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
@@ -3843,11 +3843,11 @@ function _defineProperties$d(target, props) {
|
|
|
3843
3843
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
3844
3844
|
}
|
|
3845
3845
|
}
|
|
3846
|
-
function _create_class$
|
|
3847
|
-
if (protoProps) _defineProperties$
|
|
3846
|
+
function _create_class$f(Constructor, protoProps, staticProps) {
|
|
3847
|
+
if (protoProps) _defineProperties$f(Constructor.prototype, protoProps);
|
|
3848
3848
|
return Constructor;
|
|
3849
3849
|
}
|
|
3850
|
-
function _define_property$
|
|
3850
|
+
function _define_property$w(obj, key, value) {
|
|
3851
3851
|
if (key in obj) {
|
|
3852
3852
|
Object.defineProperty(obj, key, {
|
|
3853
3853
|
value: value,
|
|
@@ -3869,13 +3869,13 @@ function _define_property$t(obj, key, value) {
|
|
|
3869
3869
|
* consistency. Writes are committed atomically when the transaction completes.
|
|
3870
3870
|
*/ var TransactionFirestoreDocumentDataAccessor = /*#__PURE__*/ function() {
|
|
3871
3871
|
function TransactionFirestoreDocumentDataAccessor(transaction, documentRef) {
|
|
3872
|
-
_class_call_check$
|
|
3873
|
-
_define_property$
|
|
3874
|
-
_define_property$
|
|
3872
|
+
_class_call_check$p(this, TransactionFirestoreDocumentDataAccessor);
|
|
3873
|
+
_define_property$w(this, "_transaction", void 0);
|
|
3874
|
+
_define_property$w(this, "_documentRef", void 0);
|
|
3875
3875
|
this._transaction = transaction;
|
|
3876
3876
|
this._documentRef = documentRef;
|
|
3877
3877
|
}
|
|
3878
|
-
_create_class$
|
|
3878
|
+
_create_class$f(TransactionFirestoreDocumentDataAccessor, [
|
|
3879
3879
|
{
|
|
3880
3880
|
key: "transaction",
|
|
3881
3881
|
get: function get() {
|
|
@@ -3994,14 +3994,14 @@ function _define_property$t(obj, key, value) {
|
|
|
3994
3994
|
* All document accessors created from this context operate within the same transaction.
|
|
3995
3995
|
*/ var TransactionFirestoreDocumentContext = /*#__PURE__*/ function() {
|
|
3996
3996
|
function TransactionFirestoreDocumentContext(transaction) {
|
|
3997
|
-
_class_call_check$
|
|
3998
|
-
_define_property$
|
|
3999
|
-
_define_property$
|
|
4000
|
-
_define_property$
|
|
3997
|
+
_class_call_check$p(this, TransactionFirestoreDocumentContext);
|
|
3998
|
+
_define_property$w(this, "_transaction", void 0);
|
|
3999
|
+
_define_property$w(this, "contextType", FirestoreDocumentContextType.TRANSACTION);
|
|
4000
|
+
_define_property$w(this, "accessorFactory", void 0);
|
|
4001
4001
|
this._transaction = transaction;
|
|
4002
4002
|
this.accessorFactory = transactionAccessorFactory(transaction);
|
|
4003
4003
|
}
|
|
4004
|
-
_create_class$
|
|
4004
|
+
_create_class$f(TransactionFirestoreDocumentContext, [
|
|
4005
4005
|
{
|
|
4006
4006
|
key: "transaction",
|
|
4007
4007
|
get: function get() {
|
|
@@ -4020,15 +4020,15 @@ function _define_property$t(obj, key, value) {
|
|
|
4020
4020
|
return new TransactionFirestoreDocumentContext(transaction);
|
|
4021
4021
|
}
|
|
4022
4022
|
|
|
4023
|
-
function _array_like_to_array$
|
|
4023
|
+
function _array_like_to_array$f(arr, len) {
|
|
4024
4024
|
if (len == null || len > arr.length) len = arr.length;
|
|
4025
4025
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4026
4026
|
return arr2;
|
|
4027
4027
|
}
|
|
4028
|
-
function _array_with_holes$
|
|
4028
|
+
function _array_with_holes$4(arr) {
|
|
4029
4029
|
if (Array.isArray(arr)) return arr;
|
|
4030
4030
|
}
|
|
4031
|
-
function asyncGeneratorStep$
|
|
4031
|
+
function asyncGeneratorStep$f(gen, resolve, reject, _next, _throw, key, arg) {
|
|
4032
4032
|
try {
|
|
4033
4033
|
var info = gen[key](arg);
|
|
4034
4034
|
var value = info.value;
|
|
@@ -4042,22 +4042,22 @@ function asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
4042
4042
|
Promise.resolve(value).then(_next, _throw);
|
|
4043
4043
|
}
|
|
4044
4044
|
}
|
|
4045
|
-
function _async_to_generator$
|
|
4045
|
+
function _async_to_generator$f(fn) {
|
|
4046
4046
|
return function() {
|
|
4047
4047
|
var self = this, args = arguments;
|
|
4048
4048
|
return new Promise(function(resolve, reject) {
|
|
4049
4049
|
var gen = fn.apply(self, args);
|
|
4050
4050
|
function _next(value) {
|
|
4051
|
-
asyncGeneratorStep$
|
|
4051
|
+
asyncGeneratorStep$f(gen, resolve, reject, _next, _throw, "next", value);
|
|
4052
4052
|
}
|
|
4053
4053
|
function _throw(err) {
|
|
4054
|
-
asyncGeneratorStep$
|
|
4054
|
+
asyncGeneratorStep$f(gen, resolve, reject, _next, _throw, "throw", err);
|
|
4055
4055
|
}
|
|
4056
4056
|
_next(undefined);
|
|
4057
4057
|
});
|
|
4058
4058
|
};
|
|
4059
4059
|
}
|
|
4060
|
-
function _iterable_to_array_limit$
|
|
4060
|
+
function _iterable_to_array_limit$4(arr, i) {
|
|
4061
4061
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
4062
4062
|
if (_i == null) return;
|
|
4063
4063
|
var _arr = [];
|
|
@@ -4081,21 +4081,21 @@ function _iterable_to_array_limit$3(arr, i) {
|
|
|
4081
4081
|
}
|
|
4082
4082
|
return _arr;
|
|
4083
4083
|
}
|
|
4084
|
-
function _non_iterable_rest$
|
|
4084
|
+
function _non_iterable_rest$4() {
|
|
4085
4085
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4086
4086
|
}
|
|
4087
|
-
function _sliced_to_array$
|
|
4088
|
-
return _array_with_holes$
|
|
4087
|
+
function _sliced_to_array$4(arr, i) {
|
|
4088
|
+
return _array_with_holes$4(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$f(arr, i) || _non_iterable_rest$4();
|
|
4089
4089
|
}
|
|
4090
|
-
function _unsupported_iterable_to_array$
|
|
4090
|
+
function _unsupported_iterable_to_array$f(o, minLen) {
|
|
4091
4091
|
if (!o) return;
|
|
4092
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
4092
|
+
if (typeof o === "string") return _array_like_to_array$f(o, minLen);
|
|
4093
4093
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
4094
4094
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
4095
4095
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
4096
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
4096
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$f(o, minLen);
|
|
4097
4097
|
}
|
|
4098
|
-
function _ts_generator$
|
|
4098
|
+
function _ts_generator$f(thisArg, body) {
|
|
4099
4099
|
var f, y, t, _ = {
|
|
4100
4100
|
label: 0,
|
|
4101
4101
|
sent: function() {
|
|
@@ -4218,7 +4218,7 @@ function _ts_generator$d(thisArg, body) {
|
|
|
4218
4218
|
}
|
|
4219
4219
|
var batches = batch(pathSegments, 2); // batch to tuple [string, string]
|
|
4220
4220
|
batches.forEach(function(x) {
|
|
4221
|
-
var _x = _sliced_to_array$
|
|
4221
|
+
var _x = _sliced_to_array$4(x, 2), first = _x[0], second = _x[1];
|
|
4222
4222
|
ref = ref.doc(first).collection(second);
|
|
4223
4223
|
});
|
|
4224
4224
|
}
|
|
@@ -4245,7 +4245,7 @@ function _ts_generator$d(thisArg, body) {
|
|
|
4245
4245
|
if (pathSegments === null || pathSegments === void 0 ? void 0 : pathSegments.length) {
|
|
4246
4246
|
var batches = batch(pathSegments, 2); // batch to tuple [string, string]
|
|
4247
4247
|
batches.forEach(function(x) {
|
|
4248
|
-
var _x = _sliced_to_array$
|
|
4248
|
+
var _x = _sliced_to_array$4(x, 2), first = _x[0], second = _x[1];
|
|
4249
4249
|
var collection = doc.collection(first);
|
|
4250
4250
|
doc = second ? collection.doc(second) : collection.doc();
|
|
4251
4251
|
});
|
|
@@ -4292,8 +4292,8 @@ function _ts_generator$d(thisArg, body) {
|
|
|
4292
4292
|
},
|
|
4293
4293
|
transactionFactoryForFirestore: function transactionFactoryForFirestore(firestore) {
|
|
4294
4294
|
return function(fn) {
|
|
4295
|
-
return _async_to_generator$
|
|
4296
|
-
return _ts_generator$
|
|
4295
|
+
return _async_to_generator$f(function() {
|
|
4296
|
+
return _ts_generator$f(this, function(_state) {
|
|
4297
4297
|
return [
|
|
4298
4298
|
2,
|
|
4299
4299
|
firestore.runTransaction(fn)
|
|
@@ -4313,15 +4313,15 @@ function _ts_generator$d(thisArg, body) {
|
|
|
4313
4313
|
};
|
|
4314
4314
|
}
|
|
4315
4315
|
|
|
4316
|
-
function _array_like_to_array$
|
|
4316
|
+
function _array_like_to_array$e(arr, len) {
|
|
4317
4317
|
if (len == null || len > arr.length) len = arr.length;
|
|
4318
4318
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4319
4319
|
return arr2;
|
|
4320
4320
|
}
|
|
4321
|
-
function _array_without_holes$
|
|
4322
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
4321
|
+
function _array_without_holes$a(arr) {
|
|
4322
|
+
if (Array.isArray(arr)) return _array_like_to_array$e(arr);
|
|
4323
4323
|
}
|
|
4324
|
-
function _define_property$
|
|
4324
|
+
function _define_property$v(obj, key, value) {
|
|
4325
4325
|
if (key in obj) {
|
|
4326
4326
|
Object.defineProperty(obj, key, {
|
|
4327
4327
|
value: value,
|
|
@@ -4334,13 +4334,13 @@ function _define_property$s(obj, key, value) {
|
|
|
4334
4334
|
}
|
|
4335
4335
|
return obj;
|
|
4336
4336
|
}
|
|
4337
|
-
function _iterable_to_array$
|
|
4337
|
+
function _iterable_to_array$a(iter) {
|
|
4338
4338
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
4339
4339
|
}
|
|
4340
|
-
function _non_iterable_spread$
|
|
4340
|
+
function _non_iterable_spread$a() {
|
|
4341
4341
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4342
4342
|
}
|
|
4343
|
-
function _object_spread$
|
|
4343
|
+
function _object_spread$j(target) {
|
|
4344
4344
|
for(var i = 1; i < arguments.length; i++){
|
|
4345
4345
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
4346
4346
|
var ownKeys = Object.keys(source);
|
|
@@ -4350,12 +4350,12 @@ function _object_spread$i(target) {
|
|
|
4350
4350
|
}));
|
|
4351
4351
|
}
|
|
4352
4352
|
ownKeys.forEach(function(key) {
|
|
4353
|
-
_define_property$
|
|
4353
|
+
_define_property$v(target, key, source[key]);
|
|
4354
4354
|
});
|
|
4355
4355
|
}
|
|
4356
4356
|
return target;
|
|
4357
4357
|
}
|
|
4358
|
-
function ownKeys$
|
|
4358
|
+
function ownKeys$f(object, enumerableOnly) {
|
|
4359
4359
|
var keys = Object.keys(object);
|
|
4360
4360
|
if (Object.getOwnPropertySymbols) {
|
|
4361
4361
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -4363,27 +4363,27 @@ function ownKeys$d(object, enumerableOnly) {
|
|
|
4363
4363
|
}
|
|
4364
4364
|
return keys;
|
|
4365
4365
|
}
|
|
4366
|
-
function _object_spread_props$
|
|
4366
|
+
function _object_spread_props$f(target, source) {
|
|
4367
4367
|
source = source != null ? source : {};
|
|
4368
4368
|
if (Object.getOwnPropertyDescriptors) {
|
|
4369
4369
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
4370
4370
|
} else {
|
|
4371
|
-
ownKeys$
|
|
4371
|
+
ownKeys$f(Object(source)).forEach(function(key) {
|
|
4372
4372
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
4373
4373
|
});
|
|
4374
4374
|
}
|
|
4375
4375
|
return target;
|
|
4376
4376
|
}
|
|
4377
|
-
function _to_consumable_array$
|
|
4378
|
-
return _array_without_holes$
|
|
4377
|
+
function _to_consumable_array$a(arr) {
|
|
4378
|
+
return _array_without_holes$a(arr) || _iterable_to_array$a(arr) || _unsupported_iterable_to_array$e(arr) || _non_iterable_spread$a();
|
|
4379
4379
|
}
|
|
4380
|
-
function _unsupported_iterable_to_array$
|
|
4380
|
+
function _unsupported_iterable_to_array$e(o, minLen) {
|
|
4381
4381
|
if (!o) return;
|
|
4382
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
4382
|
+
if (typeof o === "string") return _array_like_to_array$e(o, minLen);
|
|
4383
4383
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
4384
4384
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
4385
4385
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
4386
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
4386
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$e(o, minLen);
|
|
4387
4387
|
}
|
|
4388
4388
|
var _builder, _builder1;
|
|
4389
4389
|
var _obj;
|
|
@@ -4391,31 +4391,31 @@ var _obj;
|
|
|
4391
4391
|
* Maps each abstract query constraint type to its Google Cloud Firestore implementation.
|
|
4392
4392
|
*
|
|
4393
4393
|
* Used by {@link firestoreClientQueryConstraintFunctionsDriver} to build the server-side query driver.
|
|
4394
|
-
*/ var FIRESTORE_CLIENT_QUERY_CONSTRAINT_HANDLER_MAPPING = (_obj = {}, _define_property$
|
|
4394
|
+
*/ var FIRESTORE_CLIENT_QUERY_CONSTRAINT_HANDLER_MAPPING = (_obj = {}, _define_property$v(_obj, FIRESTORE_LIMIT_QUERY_CONSTRAINT_TYPE, function(builder, data) {
|
|
4395
4395
|
return builder.limit(data.limit);
|
|
4396
|
-
}), _define_property$
|
|
4396
|
+
}), _define_property$v(_obj, FIRESTORE_LIMIT_TO_LAST_QUERY_CONSTRAINT_TYPE, function(builder, data) {
|
|
4397
4397
|
return builder.limitToLast(data.limit);
|
|
4398
|
-
}), _define_property$
|
|
4398
|
+
}), _define_property$v(_obj, FIRESTORE_ORDER_BY_QUERY_CONSTRAINT_TYPE, function(builder, data) {
|
|
4399
4399
|
return builder.orderBy(data.fieldPath, data.directionStr);
|
|
4400
|
-
}), _define_property$
|
|
4400
|
+
}), _define_property$v(_obj, FIRESTORE_ORDER_BY_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, function(builder, data) {
|
|
4401
4401
|
return builder.orderBy(FieldPath.documentId(), data.directionStr);
|
|
4402
|
-
}), _define_property$
|
|
4402
|
+
}), _define_property$v(_obj, FIRESTORE_WHERE_QUERY_CONSTRAINT_TYPE, function(builder, data) {
|
|
4403
4403
|
return builder.where(data.fieldPath, data.opStr, data.value);
|
|
4404
|
-
}), _define_property$
|
|
4404
|
+
}), _define_property$v(_obj, FIRESTORE_WHERE_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, function(builder, data) {
|
|
4405
4405
|
return builder.where(FieldPath.documentId(), data.opStr, data.value);
|
|
4406
|
-
}), _define_property$
|
|
4406
|
+
}), _define_property$v(_obj, FIRESTORE_OFFSET_QUERY_CONSTRAINT_TYPE, function(builder, data) {
|
|
4407
4407
|
return builder.offset(data.offset);
|
|
4408
|
-
}), _define_property$
|
|
4408
|
+
}), _define_property$v(_obj, FIRESTORE_START_AT_QUERY_CONSTRAINT_TYPE, function(builder, data) {
|
|
4409
4409
|
return builder.startAt(data.snapshot);
|
|
4410
|
-
}), _define_property$
|
|
4411
|
-
return (_builder = builder).startAt.apply(_builder, _to_consumable_array$
|
|
4412
|
-
}), _define_property$
|
|
4410
|
+
}), _define_property$v(_obj, FIRESTORE_START_AT_VALUE_QUERY_CONSTRAINT_TYPE, function(builder, data) {
|
|
4411
|
+
return (_builder = builder).startAt.apply(_builder, _to_consumable_array$a(data.fieldValues));
|
|
4412
|
+
}), _define_property$v(_obj, FIRESTORE_START_AFTER_QUERY_CONSTRAINT_TYPE, function(builder, data) {
|
|
4413
4413
|
return builder.startAfter(data.snapshot);
|
|
4414
|
-
}), _define_property$
|
|
4414
|
+
}), _define_property$v(_obj, FIRESTORE_END_AT_QUERY_CONSTRAINT_TYPE, function(builder, data) {
|
|
4415
4415
|
return builder.endAt(data.snapshot);
|
|
4416
|
-
}), _define_property$
|
|
4417
|
-
return (_builder1 = builder).endAt.apply(_builder1, _to_consumable_array$
|
|
4418
|
-
}), _define_property$
|
|
4416
|
+
}), _define_property$v(_obj, FIRESTORE_END_AT_VALUE_QUERY_CONSTRAINT_TYPE, function(builder, data) {
|
|
4417
|
+
return (_builder1 = builder).endAt.apply(_builder1, _to_consumable_array$a(data.fieldValues));
|
|
4418
|
+
}), _define_property$v(_obj, FIRESTORE_END_BEFORE_QUERY_CONSTRAINT_TYPE, function(builder, data) {
|
|
4419
4419
|
return builder.endBefore(data.snapshot);
|
|
4420
4420
|
}), _obj);
|
|
4421
4421
|
/**
|
|
@@ -4453,7 +4453,7 @@ var _obj;
|
|
|
4453
4453
|
* const queryDriver = googleCloudFirestoreQueryDriver();
|
|
4454
4454
|
* ```
|
|
4455
4455
|
*/ function googleCloudFirestoreQueryDriver() {
|
|
4456
|
-
return _object_spread_props$
|
|
4456
|
+
return _object_spread_props$f(_object_spread$j({}, firestoreClientQueryConstraintFunctionsDriver()), {
|
|
4457
4457
|
countDocs: function countDocs(query) {
|
|
4458
4458
|
return query.count().get().then(function(x) {
|
|
4459
4459
|
return x.data().count;
|
|
@@ -4619,7 +4619,7 @@ typeof SuppressedError === "function" ? SuppressedError : function(error, suppre
|
|
|
4619
4619
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
4620
4620
|
};
|
|
4621
4621
|
|
|
4622
|
-
function _class_call_check$
|
|
4622
|
+
function _class_call_check$o(instance, Constructor) {
|
|
4623
4623
|
if (!(instance instanceof Constructor)) {
|
|
4624
4624
|
throw new TypeError("Cannot call a class as a function");
|
|
4625
4625
|
}
|
|
@@ -4630,7 +4630,7 @@ function _class_call_check$l(instance, Constructor) {
|
|
|
4630
4630
|
* Analogous to {@link DbxAnalyticsService} on the frontend.
|
|
4631
4631
|
* Apps extend this class and provide it via {@link ON_CALL_MODEL_ANALYTICS_SERVICE}.
|
|
4632
4632
|
*/ var OnCallModelAnalyticsService = function OnCallModelAnalyticsService() {
|
|
4633
|
-
_class_call_check$
|
|
4633
|
+
_class_call_check$o(this, OnCallModelAnalyticsService);
|
|
4634
4634
|
};
|
|
4635
4635
|
/**
|
|
4636
4636
|
* Default injection token for the analytics service.
|
|
@@ -4655,7 +4655,7 @@ function _class_call_check$l(instance, Constructor) {
|
|
|
4655
4655
|
* @deprecated Use {@link ON_CALL_MODEL_ANALYTICS_SERVICE} instead.
|
|
4656
4656
|
*/ var ON_CALL_MODEL_ANALYTICS_HANDLER = ON_CALL_MODEL_ANALYTICS_SERVICE;
|
|
4657
4657
|
|
|
4658
|
-
function _class_call_check$
|
|
4658
|
+
function _class_call_check$n(instance, Constructor) {
|
|
4659
4659
|
if (!(instance instanceof Constructor)) {
|
|
4660
4660
|
throw new TypeError("Cannot call a class as a function");
|
|
4661
4661
|
}
|
|
@@ -4665,7 +4665,7 @@ function _class_call_check$k(instance, Constructor) {
|
|
|
4665
4665
|
* Events are forwarded from FirebaseServerAnalyticsService to this listener
|
|
4666
4666
|
* for processing by an analytics provider (e.g., Segment).
|
|
4667
4667
|
*/ var FirebaseServerAnalyticsServiceListener = function FirebaseServerAnalyticsServiceListener() {
|
|
4668
|
-
_class_call_check$
|
|
4668
|
+
_class_call_check$n(this, FirebaseServerAnalyticsServiceListener);
|
|
4669
4669
|
};
|
|
4670
4670
|
/**
|
|
4671
4671
|
* Creates a default no-op {@link FirebaseServerAnalyticsServiceListener}.
|
|
@@ -4695,12 +4695,12 @@ function _call_super$3(_this, derived, args) {
|
|
|
4695
4695
|
derived = _get_prototype_of$3(derived);
|
|
4696
4696
|
return _possible_constructor_return$3(_this, _is_native_reflect_construct$3() ? Reflect.construct(derived, [], _get_prototype_of$3(_this).constructor) : derived.apply(_this, args));
|
|
4697
4697
|
}
|
|
4698
|
-
function _class_call_check$
|
|
4698
|
+
function _class_call_check$m(instance, Constructor) {
|
|
4699
4699
|
if (!(instance instanceof Constructor)) {
|
|
4700
4700
|
throw new TypeError("Cannot call a class as a function");
|
|
4701
4701
|
}
|
|
4702
4702
|
}
|
|
4703
|
-
function _defineProperties$
|
|
4703
|
+
function _defineProperties$e(target, props) {
|
|
4704
4704
|
for(var i = 0; i < props.length; i++){
|
|
4705
4705
|
var descriptor = props[i];
|
|
4706
4706
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
@@ -4709,11 +4709,11 @@ function _defineProperties$c(target, props) {
|
|
|
4709
4709
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
4710
4710
|
}
|
|
4711
4711
|
}
|
|
4712
|
-
function _create_class$
|
|
4713
|
-
if (protoProps) _defineProperties$
|
|
4712
|
+
function _create_class$e(Constructor, protoProps, staticProps) {
|
|
4713
|
+
if (protoProps) _defineProperties$e(Constructor.prototype, protoProps);
|
|
4714
4714
|
return Constructor;
|
|
4715
4715
|
}
|
|
4716
|
-
function _define_property$
|
|
4716
|
+
function _define_property$u(obj, key, value) {
|
|
4717
4717
|
if (key in obj) {
|
|
4718
4718
|
Object.defineProperty(obj, key, {
|
|
4719
4719
|
value: value,
|
|
@@ -4793,9 +4793,9 @@ function _is_native_reflect_construct$3() {
|
|
|
4793
4793
|
*/ var FirebaseServerAnalyticsService = /*#__PURE__*/ function(OnCallModelAnalyticsService) {
|
|
4794
4794
|
_inherits$3(FirebaseServerAnalyticsService, OnCallModelAnalyticsService);
|
|
4795
4795
|
function FirebaseServerAnalyticsService(listener) {
|
|
4796
|
-
_class_call_check$
|
|
4796
|
+
_class_call_check$m(this, FirebaseServerAnalyticsService);
|
|
4797
4797
|
var _this;
|
|
4798
|
-
_this = _call_super$3(this, FirebaseServerAnalyticsService), _define_property$
|
|
4798
|
+
_this = _call_super$3(this, FirebaseServerAnalyticsService), _define_property$u(_this, "_listener", void 0);
|
|
4799
4799
|
if (listener) {
|
|
4800
4800
|
_this._listener = listener;
|
|
4801
4801
|
} else {
|
|
@@ -4804,7 +4804,7 @@ function _is_native_reflect_construct$3() {
|
|
|
4804
4804
|
}
|
|
4805
4805
|
return _this;
|
|
4806
4806
|
}
|
|
4807
|
-
_create_class$
|
|
4807
|
+
_create_class$e(FirebaseServerAnalyticsService, [
|
|
4808
4808
|
{
|
|
4809
4809
|
key: "handleOnCallAnalyticsEvent",
|
|
4810
4810
|
value: function handleOnCallAnalyticsEvent(event) {
|
|
@@ -4844,7 +4844,7 @@ FirebaseServerAnalyticsService = __decorate([
|
|
|
4844
4844
|
__param(0, Inject(FirebaseServerAnalyticsServiceListener))
|
|
4845
4845
|
], FirebaseServerAnalyticsService);
|
|
4846
4846
|
|
|
4847
|
-
function asyncGeneratorStep$
|
|
4847
|
+
function asyncGeneratorStep$e(gen, resolve, reject, _next, _throw, key, arg) {
|
|
4848
4848
|
try {
|
|
4849
4849
|
var info = gen[key](arg);
|
|
4850
4850
|
var value = info.value;
|
|
@@ -4858,22 +4858,22 @@ function asyncGeneratorStep$c(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
4858
4858
|
Promise.resolve(value).then(_next, _throw);
|
|
4859
4859
|
}
|
|
4860
4860
|
}
|
|
4861
|
-
function _async_to_generator$
|
|
4861
|
+
function _async_to_generator$e(fn) {
|
|
4862
4862
|
return function() {
|
|
4863
4863
|
var self = this, args = arguments;
|
|
4864
4864
|
return new Promise(function(resolve, reject) {
|
|
4865
4865
|
var gen = fn.apply(self, args);
|
|
4866
4866
|
function _next(value) {
|
|
4867
|
-
asyncGeneratorStep$
|
|
4867
|
+
asyncGeneratorStep$e(gen, resolve, reject, _next, _throw, "next", value);
|
|
4868
4868
|
}
|
|
4869
4869
|
function _throw(err) {
|
|
4870
|
-
asyncGeneratorStep$
|
|
4870
|
+
asyncGeneratorStep$e(gen, resolve, reject, _next, _throw, "throw", err);
|
|
4871
4871
|
}
|
|
4872
4872
|
_next(undefined);
|
|
4873
4873
|
});
|
|
4874
4874
|
};
|
|
4875
4875
|
}
|
|
4876
|
-
function _ts_generator$
|
|
4876
|
+
function _ts_generator$e(thisArg, body) {
|
|
4877
4877
|
var f, y, t, _ = {
|
|
4878
4878
|
label: 0,
|
|
4879
4879
|
sent: function() {
|
|
@@ -5037,7 +5037,7 @@ function _ts_generator$c(thisArg, body) {
|
|
|
5037
5037
|
* });
|
|
5038
5038
|
* ```
|
|
5039
5039
|
*/ function callWithAnalytics(config) {
|
|
5040
|
-
return _async_to_generator$
|
|
5040
|
+
return _async_to_generator$e(function() {
|
|
5041
5041
|
var service, details, context, execute, result, emitter, error;
|
|
5042
5042
|
function _safeCall(fn) {
|
|
5043
5043
|
try {
|
|
@@ -5047,7 +5047,7 @@ function _ts_generator$c(thisArg, body) {
|
|
|
5047
5047
|
console.error("callWithAnalytics: Failed to emit analytics event:", error);
|
|
5048
5048
|
}
|
|
5049
5049
|
}
|
|
5050
|
-
return _ts_generator$
|
|
5050
|
+
return _ts_generator$e(this, function(_state) {
|
|
5051
5051
|
switch(_state.label){
|
|
5052
5052
|
case 0:
|
|
5053
5053
|
service = config.service, details = config.details, context = config.context, execute = config.execute;
|
|
@@ -5106,15 +5106,15 @@ function _ts_generator$c(thisArg, body) {
|
|
|
5106
5106
|
})();
|
|
5107
5107
|
}
|
|
5108
5108
|
|
|
5109
|
-
function _array_like_to_array$
|
|
5109
|
+
function _array_like_to_array$d(arr, len) {
|
|
5110
5110
|
if (len == null || len > arr.length) len = arr.length;
|
|
5111
5111
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
5112
5112
|
return arr2;
|
|
5113
5113
|
}
|
|
5114
|
-
function _array_with_holes$
|
|
5114
|
+
function _array_with_holes$3(arr) {
|
|
5115
5115
|
if (Array.isArray(arr)) return arr;
|
|
5116
5116
|
}
|
|
5117
|
-
function _iterable_to_array_limit$
|
|
5117
|
+
function _iterable_to_array_limit$3(arr, i) {
|
|
5118
5118
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
5119
5119
|
if (_i == null) return;
|
|
5120
5120
|
var _arr = [];
|
|
@@ -5138,7 +5138,7 @@ function _iterable_to_array_limit$2(arr, i) {
|
|
|
5138
5138
|
}
|
|
5139
5139
|
return _arr;
|
|
5140
5140
|
}
|
|
5141
|
-
function _non_iterable_rest$
|
|
5141
|
+
function _non_iterable_rest$3() {
|
|
5142
5142
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
5143
5143
|
}
|
|
5144
5144
|
function _object_without_properties(source, excluded) {
|
|
@@ -5177,16 +5177,16 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
5177
5177
|
}
|
|
5178
5178
|
return target;
|
|
5179
5179
|
}
|
|
5180
|
-
function _sliced_to_array$
|
|
5181
|
-
return _array_with_holes$
|
|
5180
|
+
function _sliced_to_array$3(arr, i) {
|
|
5181
|
+
return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$d(arr, i) || _non_iterable_rest$3();
|
|
5182
5182
|
}
|
|
5183
|
-
function _unsupported_iterable_to_array$
|
|
5183
|
+
function _unsupported_iterable_to_array$d(o, minLen) {
|
|
5184
5184
|
if (!o) return;
|
|
5185
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
5185
|
+
if (typeof o === "string") return _array_like_to_array$d(o, minLen);
|
|
5186
5186
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
5187
5187
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
5188
5188
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
5189
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
5189
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$d(o, minLen);
|
|
5190
5190
|
}
|
|
5191
5191
|
// MARK: Type Guards
|
|
5192
5192
|
/**
|
|
@@ -5288,7 +5288,7 @@ function _unsupported_iterable_to_array$a(o, minLen) {
|
|
|
5288
5288
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
5289
5289
|
try {
|
|
5290
5290
|
for(var _iterator = Object.entries(config)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
5291
|
-
var _step_value = _sliced_to_array$
|
|
5291
|
+
var _step_value = _sliced_to_array$3(_step.value, 2), key = _step_value[0], handler = _step_value[1];
|
|
5292
5292
|
var details = readApiDetails(handler);
|
|
5293
5293
|
if (details != null) {
|
|
5294
5294
|
// At the specifier level, details should be handler-level (OnCallModelFunctionApiDetails)
|
|
@@ -5328,7 +5328,7 @@ function _unsupported_iterable_to_array$a(o, minLen) {
|
|
|
5328
5328
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
5329
5329
|
try {
|
|
5330
5330
|
for(var _iterator = Object.entries(map)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
5331
|
-
var _step_value = _sliced_to_array$
|
|
5331
|
+
var _step_value = _sliced_to_array$3(_step.value, 2), key = _step_value[0], handler = _step_value[1];
|
|
5332
5332
|
var details = readApiDetails(handler);
|
|
5333
5333
|
if (details != null) {
|
|
5334
5334
|
if (isOnCallModelTypeApiDetails(details)) {
|
|
@@ -5377,7 +5377,7 @@ function _unsupported_iterable_to_array$a(o, minLen) {
|
|
|
5377
5377
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
5378
5378
|
try {
|
|
5379
5379
|
for(var _iterator = Object.entries(map)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
5380
|
-
var _step_value = _sliced_to_array$
|
|
5380
|
+
var _step_value = _sliced_to_array$3(_step.value, 2), call = _step_value[0], handler = _step_value[1];
|
|
5381
5381
|
var details = readApiDetails(handler);
|
|
5382
5382
|
if (details != null) {
|
|
5383
5383
|
result[call] = details;
|
|
@@ -5425,14 +5425,14 @@ function _unsupported_iterable_to_array$a(o, minLen) {
|
|
|
5425
5425
|
try {
|
|
5426
5426
|
// Pivot: iterate CRUD types, then model types within each
|
|
5427
5427
|
for(var _iterator = Object.entries(topDetails)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
5428
|
-
var _step_value = _sliced_to_array$
|
|
5428
|
+
var _step_value = _sliced_to_array$3(_step.value, 2), callType = _step_value[0], crudDetails = _step_value[1];
|
|
5429
5429
|
if (crudDetails == null) {
|
|
5430
5430
|
continue;
|
|
5431
5431
|
}
|
|
5432
5432
|
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
5433
5433
|
try {
|
|
5434
5434
|
for(var _iterator1 = Object.entries(crudDetails.modelTypes)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
5435
|
-
var _step_value1 = _sliced_to_array$
|
|
5435
|
+
var _step_value1 = _sliced_to_array$3(_step1.value, 2), modelType = _step_value1[0], modelDetails = _step_value1[1];
|
|
5436
5436
|
if (modelDetails == null) {
|
|
5437
5437
|
continue;
|
|
5438
5438
|
}
|
|
@@ -5702,7 +5702,7 @@ function resolveRequiredScopeFromApiDetails(apiDetails, call, modelType, specifi
|
|
|
5702
5702
|
}));
|
|
5703
5703
|
}
|
|
5704
5704
|
|
|
5705
|
-
function _define_property$
|
|
5705
|
+
function _define_property$t(obj, key, value) {
|
|
5706
5706
|
if (key in obj) {
|
|
5707
5707
|
Object.defineProperty(obj, key, {
|
|
5708
5708
|
value: value,
|
|
@@ -5715,7 +5715,7 @@ function _define_property$q(obj, key, value) {
|
|
|
5715
5715
|
}
|
|
5716
5716
|
return obj;
|
|
5717
5717
|
}
|
|
5718
|
-
function _object_spread$
|
|
5718
|
+
function _object_spread$i(target) {
|
|
5719
5719
|
for(var i = 1; i < arguments.length; i++){
|
|
5720
5720
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
5721
5721
|
var ownKeys = Object.keys(source);
|
|
@@ -5725,12 +5725,12 @@ function _object_spread$h(target) {
|
|
|
5725
5725
|
}));
|
|
5726
5726
|
}
|
|
5727
5727
|
ownKeys.forEach(function(key) {
|
|
5728
|
-
_define_property$
|
|
5728
|
+
_define_property$t(target, key, source[key]);
|
|
5729
5729
|
});
|
|
5730
5730
|
}
|
|
5731
5731
|
return target;
|
|
5732
5732
|
}
|
|
5733
|
-
function ownKeys$
|
|
5733
|
+
function ownKeys$e(object, enumerableOnly) {
|
|
5734
5734
|
var keys = Object.keys(object);
|
|
5735
5735
|
if (Object.getOwnPropertySymbols) {
|
|
5736
5736
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -5738,12 +5738,12 @@ function ownKeys$c(object, enumerableOnly) {
|
|
|
5738
5738
|
}
|
|
5739
5739
|
return keys;
|
|
5740
5740
|
}
|
|
5741
|
-
function _object_spread_props$
|
|
5741
|
+
function _object_spread_props$e(target, source) {
|
|
5742
5742
|
source = source != null ? source : {};
|
|
5743
5743
|
if (Object.getOwnPropertyDescriptors) {
|
|
5744
5744
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
5745
5745
|
} else {
|
|
5746
|
-
ownKeys$
|
|
5746
|
+
ownKeys$e(Object(source)).forEach(function(key) {
|
|
5747
5747
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
5748
5748
|
});
|
|
5749
5749
|
}
|
|
@@ -5822,7 +5822,7 @@ function _object_spread_props$c(target, source) {
|
|
|
5822
5822
|
// Resolve the leaf handler's per-function requiredScope (if any) so the preAssert can enforce
|
|
5823
5823
|
// it additively with the per-verb OIDC scope. Same call -> modelType -> specifier walk as analytics.
|
|
5824
5824
|
var requiredScope = resolveRequiredScopeFromApiDetails(modelApiDetails, call, modelType, specifier);
|
|
5825
|
-
preAssert(_object_spread_props$
|
|
5825
|
+
preAssert(_object_spread_props$e(_object_spread$i({}, context), {
|
|
5826
5826
|
requiredScope: requiredScope
|
|
5827
5827
|
}));
|
|
5828
5828
|
var result;
|
|
@@ -5900,7 +5900,7 @@ function _object_spread_props$c(target, source) {
|
|
|
5900
5900
|
modelType: modelType,
|
|
5901
5901
|
specifier: specifier
|
|
5902
5902
|
});
|
|
5903
|
-
return crudFn(_object_spread_props$
|
|
5903
|
+
return crudFn(_object_spread_props$e(_object_spread$i({}, request), {
|
|
5904
5904
|
specifier: specifier,
|
|
5905
5905
|
data: request.data.data
|
|
5906
5906
|
}));
|
|
@@ -6087,15 +6087,15 @@ function _object_spread_props$c(target, source) {
|
|
|
6087
6087
|
}));
|
|
6088
6088
|
}
|
|
6089
6089
|
|
|
6090
|
-
function _array_like_to_array$
|
|
6090
|
+
function _array_like_to_array$c(arr, len) {
|
|
6091
6091
|
if (len == null || len > arr.length) len = arr.length;
|
|
6092
6092
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
6093
6093
|
return arr2;
|
|
6094
6094
|
}
|
|
6095
|
-
function _array_without_holes$
|
|
6096
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
6095
|
+
function _array_without_holes$9(arr) {
|
|
6096
|
+
if (Array.isArray(arr)) return _array_like_to_array$c(arr);
|
|
6097
6097
|
}
|
|
6098
|
-
function asyncGeneratorStep$
|
|
6098
|
+
function asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, key, arg) {
|
|
6099
6099
|
try {
|
|
6100
6100
|
var info = gen[key](arg);
|
|
6101
6101
|
var value = info.value;
|
|
@@ -6109,39 +6109,39 @@ function asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
6109
6109
|
Promise.resolve(value).then(_next, _throw);
|
|
6110
6110
|
}
|
|
6111
6111
|
}
|
|
6112
|
-
function _async_to_generator$
|
|
6112
|
+
function _async_to_generator$d(fn) {
|
|
6113
6113
|
return function() {
|
|
6114
6114
|
var self = this, args = arguments;
|
|
6115
6115
|
return new Promise(function(resolve, reject) {
|
|
6116
6116
|
var gen = fn.apply(self, args);
|
|
6117
6117
|
function _next(value) {
|
|
6118
|
-
asyncGeneratorStep$
|
|
6118
|
+
asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, "next", value);
|
|
6119
6119
|
}
|
|
6120
6120
|
function _throw(err) {
|
|
6121
|
-
asyncGeneratorStep$
|
|
6121
|
+
asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, "throw", err);
|
|
6122
6122
|
}
|
|
6123
6123
|
_next(undefined);
|
|
6124
6124
|
});
|
|
6125
6125
|
};
|
|
6126
6126
|
}
|
|
6127
|
-
function _iterable_to_array$
|
|
6127
|
+
function _iterable_to_array$9(iter) {
|
|
6128
6128
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
6129
6129
|
}
|
|
6130
|
-
function _non_iterable_spread$
|
|
6130
|
+
function _non_iterable_spread$9() {
|
|
6131
6131
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
6132
6132
|
}
|
|
6133
|
-
function _to_consumable_array$
|
|
6134
|
-
return _array_without_holes$
|
|
6133
|
+
function _to_consumable_array$9(arr) {
|
|
6134
|
+
return _array_without_holes$9(arr) || _iterable_to_array$9(arr) || _unsupported_iterable_to_array$c(arr) || _non_iterable_spread$9();
|
|
6135
6135
|
}
|
|
6136
|
-
function _unsupported_iterable_to_array$
|
|
6136
|
+
function _unsupported_iterable_to_array$c(o, minLen) {
|
|
6137
6137
|
if (!o) return;
|
|
6138
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
6138
|
+
if (typeof o === "string") return _array_like_to_array$c(o, minLen);
|
|
6139
6139
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
6140
6140
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
6141
6141
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
6142
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
6142
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$c(o, minLen);
|
|
6143
6143
|
}
|
|
6144
|
-
function _ts_generator$
|
|
6144
|
+
function _ts_generator$d(thisArg, body) {
|
|
6145
6145
|
var f, y, t, _ = {
|
|
6146
6146
|
label: 0,
|
|
6147
6147
|
sent: function() {
|
|
@@ -6344,9 +6344,9 @@ function _ts_generator$b(thisArg, body) {
|
|
|
6344
6344
|
* };
|
|
6345
6345
|
* ```
|
|
6346
6346
|
*/ function executeOnCallQuery(config) {
|
|
6347
|
-
return _async_to_generator$
|
|
6347
|
+
return _async_to_generator$d(function() {
|
|
6348
6348
|
var _collection, _params_limit, _resultDocs_at, params, collection, loadCursorDocument, buildConstraints, _config_maxLimit, maxLimit, mapResult, requestedLimit, effectiveLimit, constraints, cursorSnapshot, e, errorInfo, executableQuery, querySnapshot, docs, hasMore, resultDocs, results, keys, cursorDocumentKey;
|
|
6349
|
-
return _ts_generator$
|
|
6349
|
+
return _ts_generator$d(this, function(_state) {
|
|
6350
6350
|
switch(_state.label){
|
|
6351
6351
|
case 0:
|
|
6352
6352
|
params = config.params, collection = config.collection, loadCursorDocument = config.loadCursorDocument, buildConstraints = config.buildConstraints, _config_maxLimit = config.maxLimit, maxLimit = _config_maxLimit === void 0 ? MAX_ON_CALL_QUERY_MODEL_LIMIT : _config_maxLimit, mapResult = config.mapResult;
|
|
@@ -6398,7 +6398,7 @@ function _ts_generator$b(thisArg, body) {
|
|
|
6398
6398
|
// Fetch one extra to detect hasMore
|
|
6399
6399
|
constraints.push(limit(effectiveLimit + 1));
|
|
6400
6400
|
// Execute via the collection's query factory
|
|
6401
|
-
executableQuery = (_collection = collection).query.apply(_collection, _to_consumable_array$
|
|
6401
|
+
executableQuery = (_collection = collection).query.apply(_collection, _to_consumable_array$9(constraints));
|
|
6402
6402
|
return [
|
|
6403
6403
|
4,
|
|
6404
6404
|
executableQuery.getDocs()
|
|
@@ -6475,30 +6475,30 @@ function _ts_generator$b(thisArg, body) {
|
|
|
6475
6475
|
}));
|
|
6476
6476
|
}
|
|
6477
6477
|
|
|
6478
|
-
function _array_like_to_array$
|
|
6478
|
+
function _array_like_to_array$b(arr, len) {
|
|
6479
6479
|
if (len == null || len > arr.length) len = arr.length;
|
|
6480
6480
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
6481
6481
|
return arr2;
|
|
6482
6482
|
}
|
|
6483
|
-
function _array_without_holes$
|
|
6484
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
6483
|
+
function _array_without_holes$8(arr) {
|
|
6484
|
+
if (Array.isArray(arr)) return _array_like_to_array$b(arr);
|
|
6485
6485
|
}
|
|
6486
|
-
function _iterable_to_array$
|
|
6486
|
+
function _iterable_to_array$8(iter) {
|
|
6487
6487
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
6488
6488
|
}
|
|
6489
|
-
function _non_iterable_spread$
|
|
6489
|
+
function _non_iterable_spread$8() {
|
|
6490
6490
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
6491
6491
|
}
|
|
6492
|
-
function _to_consumable_array$
|
|
6493
|
-
return _array_without_holes$
|
|
6494
|
-
}
|
|
6495
|
-
function _unsupported_iterable_to_array$
|
|
6492
|
+
function _to_consumable_array$8(arr) {
|
|
6493
|
+
return _array_without_holes$8(arr) || _iterable_to_array$8(arr) || _unsupported_iterable_to_array$b(arr) || _non_iterable_spread$8();
|
|
6494
|
+
}
|
|
6495
|
+
function _unsupported_iterable_to_array$b(o, minLen) {
|
|
6496
6496
|
if (!o) return;
|
|
6497
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
6497
|
+
if (typeof o === "string") return _array_like_to_array$b(o, minLen);
|
|
6498
6498
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
6499
6499
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
6500
6500
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
6501
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
6501
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$b(o, minLen);
|
|
6502
6502
|
}
|
|
6503
6503
|
/**
|
|
6504
6504
|
* Generates NestJS {@link ModuleMetadata} for an app's analytics module.
|
|
@@ -6523,18 +6523,18 @@ function _unsupported_iterable_to_array$8(o, minLen) {
|
|
|
6523
6523
|
dependencyModule
|
|
6524
6524
|
] : [];
|
|
6525
6525
|
return {
|
|
6526
|
-
imports: _to_consumable_array$
|
|
6526
|
+
imports: _to_consumable_array$8(dependencyModuleImport).concat(_to_consumable_array$8(imports !== null && imports !== void 0 ? imports : [])),
|
|
6527
6527
|
exports: [
|
|
6528
6528
|
FirebaseServerAnalyticsService,
|
|
6529
6529
|
ON_CALL_MODEL_ANALYTICS_SERVICE
|
|
6530
|
-
].concat(_to_consumable_array$
|
|
6530
|
+
].concat(_to_consumable_array$8(exports !== null && exports !== void 0 ? exports : [])),
|
|
6531
6531
|
providers: [
|
|
6532
6532
|
FirebaseServerAnalyticsService,
|
|
6533
6533
|
{
|
|
6534
6534
|
provide: ON_CALL_MODEL_ANALYTICS_SERVICE,
|
|
6535
6535
|
useExisting: FirebaseServerAnalyticsService
|
|
6536
6536
|
}
|
|
6537
|
-
].concat(_to_consumable_array$
|
|
6537
|
+
].concat(_to_consumable_array$8(providers !== null && providers !== void 0 ? providers : []))
|
|
6538
6538
|
};
|
|
6539
6539
|
}
|
|
6540
6540
|
|
|
@@ -6548,12 +6548,12 @@ function _call_super$2(_this, derived, args) {
|
|
|
6548
6548
|
derived = _get_prototype_of$2(derived);
|
|
6549
6549
|
return _possible_constructor_return$2(_this, _is_native_reflect_construct$2() ? Reflect.construct(derived, [], _get_prototype_of$2(_this).constructor) : derived.apply(_this, args));
|
|
6550
6550
|
}
|
|
6551
|
-
function _class_call_check$
|
|
6551
|
+
function _class_call_check$l(instance, Constructor) {
|
|
6552
6552
|
if (!(instance instanceof Constructor)) {
|
|
6553
6553
|
throw new TypeError("Cannot call a class as a function");
|
|
6554
6554
|
}
|
|
6555
6555
|
}
|
|
6556
|
-
function _defineProperties$
|
|
6556
|
+
function _defineProperties$d(target, props) {
|
|
6557
6557
|
for(var i = 0; i < props.length; i++){
|
|
6558
6558
|
var descriptor = props[i];
|
|
6559
6559
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
@@ -6562,11 +6562,11 @@ function _defineProperties$b(target, props) {
|
|
|
6562
6562
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
6563
6563
|
}
|
|
6564
6564
|
}
|
|
6565
|
-
function _create_class$
|
|
6566
|
-
if (protoProps) _defineProperties$
|
|
6565
|
+
function _create_class$d(Constructor, protoProps, staticProps) {
|
|
6566
|
+
if (protoProps) _defineProperties$d(Constructor.prototype, protoProps);
|
|
6567
6567
|
return Constructor;
|
|
6568
6568
|
}
|
|
6569
|
-
function _define_property$
|
|
6569
|
+
function _define_property$s(obj, key, value) {
|
|
6570
6570
|
if (key in obj) {
|
|
6571
6571
|
Object.defineProperty(obj, key, {
|
|
6572
6572
|
value: value,
|
|
@@ -6598,7 +6598,7 @@ function _inherits$2(subClass, superClass) {
|
|
|
6598
6598
|
});
|
|
6599
6599
|
if (superClass) _set_prototype_of$2(subClass, superClass);
|
|
6600
6600
|
}
|
|
6601
|
-
function _object_spread$
|
|
6601
|
+
function _object_spread$h(target) {
|
|
6602
6602
|
for(var i = 1; i < arguments.length; i++){
|
|
6603
6603
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
6604
6604
|
var ownKeys = Object.keys(source);
|
|
@@ -6608,12 +6608,12 @@ function _object_spread$g(target) {
|
|
|
6608
6608
|
}));
|
|
6609
6609
|
}
|
|
6610
6610
|
ownKeys.forEach(function(key) {
|
|
6611
|
-
_define_property$
|
|
6611
|
+
_define_property$s(target, key, source[key]);
|
|
6612
6612
|
});
|
|
6613
6613
|
}
|
|
6614
6614
|
return target;
|
|
6615
6615
|
}
|
|
6616
|
-
function ownKeys$
|
|
6616
|
+
function ownKeys$d(object, enumerableOnly) {
|
|
6617
6617
|
var keys = Object.keys(object);
|
|
6618
6618
|
if (Object.getOwnPropertySymbols) {
|
|
6619
6619
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -6621,12 +6621,12 @@ function ownKeys$b(object, enumerableOnly) {
|
|
|
6621
6621
|
}
|
|
6622
6622
|
return keys;
|
|
6623
6623
|
}
|
|
6624
|
-
function _object_spread_props$
|
|
6624
|
+
function _object_spread_props$d(target, source) {
|
|
6625
6625
|
source = source != null ? source : {};
|
|
6626
6626
|
if (Object.getOwnPropertyDescriptors) {
|
|
6627
6627
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
6628
6628
|
} else {
|
|
6629
|
-
ownKeys$
|
|
6629
|
+
ownKeys$d(Object(source)).forEach(function(key) {
|
|
6630
6630
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
6631
6631
|
});
|
|
6632
6632
|
}
|
|
@@ -6669,17 +6669,17 @@ function _is_native_reflect_construct$2() {
|
|
|
6669
6669
|
*/ var FirebaseServerAnalyticsSegmentListenerService = /*#__PURE__*/ function(FirebaseServerAnalyticsServiceListener) {
|
|
6670
6670
|
_inherits$2(FirebaseServerAnalyticsSegmentListenerService, FirebaseServerAnalyticsServiceListener);
|
|
6671
6671
|
function FirebaseServerAnalyticsSegmentListenerService(_segmentService) {
|
|
6672
|
-
_class_call_check$
|
|
6672
|
+
_class_call_check$l(this, FirebaseServerAnalyticsSegmentListenerService);
|
|
6673
6673
|
var _this;
|
|
6674
|
-
_this = _call_super$2(this, FirebaseServerAnalyticsSegmentListenerService), _define_property$
|
|
6674
|
+
_this = _call_super$2(this, FirebaseServerAnalyticsSegmentListenerService), _define_property$s(_this, "_segmentService", void 0);
|
|
6675
6675
|
_this._segmentService = _segmentService;
|
|
6676
6676
|
return _this;
|
|
6677
6677
|
}
|
|
6678
|
-
_create_class$
|
|
6678
|
+
_create_class$d(FirebaseServerAnalyticsSegmentListenerService, [
|
|
6679
6679
|
{
|
|
6680
6680
|
key: "handleOnCallAnalyticsEvent",
|
|
6681
6681
|
value: function handleOnCallAnalyticsEvent(event) {
|
|
6682
|
-
var properties = _object_spread$
|
|
6682
|
+
var properties = _object_spread$h(_object_spread_props$d(_object_spread$h({}, asAnalyticsEventData(event.properties)), {
|
|
6683
6683
|
call: event.call,
|
|
6684
6684
|
modelType: event.modelType,
|
|
6685
6685
|
lifecycle: event.lifecycle
|
|
@@ -6736,7 +6736,7 @@ FirebaseServerAnalyticsSegmentListenerService = __decorate([
|
|
|
6736
6736
|
__param(0, Inject(SegmentService))
|
|
6737
6737
|
], FirebaseServerAnalyticsSegmentListenerService);
|
|
6738
6738
|
|
|
6739
|
-
function _class_call_check$
|
|
6739
|
+
function _class_call_check$k(instance, Constructor) {
|
|
6740
6740
|
if (!(instance instanceof Constructor)) {
|
|
6741
6741
|
throw new TypeError("Cannot call a class as a function");
|
|
6742
6742
|
}
|
|
@@ -6746,7 +6746,7 @@ function _class_call_check$h(instance, Constructor) {
|
|
|
6746
6746
|
*
|
|
6747
6747
|
* This module provides the {@link FirebaseServerAnalyticsSegmentListenerService} as the {@link FirebaseServerAnalyticsServiceListener} implementation and exports {@link SegmentServiceModule} for use in the app.
|
|
6748
6748
|
*/ var FirebaseServerAnalyticsSegmentModule = function FirebaseServerAnalyticsSegmentModule() {
|
|
6749
|
-
_class_call_check$
|
|
6749
|
+
_class_call_check$k(this, FirebaseServerAnalyticsSegmentModule);
|
|
6750
6750
|
};
|
|
6751
6751
|
FirebaseServerAnalyticsSegmentModule = __decorate([
|
|
6752
6752
|
Module({
|
|
@@ -6791,12 +6791,12 @@ FirebaseServerAnalyticsSegmentModule = __decorate([
|
|
|
6791
6791
|
};
|
|
6792
6792
|
}
|
|
6793
6793
|
|
|
6794
|
-
function _class_call_check$
|
|
6794
|
+
function _class_call_check$j(instance, Constructor) {
|
|
6795
6795
|
if (!(instance instanceof Constructor)) {
|
|
6796
6796
|
throw new TypeError("Cannot call a class as a function");
|
|
6797
6797
|
}
|
|
6798
6798
|
}
|
|
6799
|
-
function _define_property$
|
|
6799
|
+
function _define_property$r(obj, key, value) {
|
|
6800
6800
|
if (key in obj) {
|
|
6801
6801
|
Object.defineProperty(obj, key, {
|
|
6802
6802
|
value: value,
|
|
@@ -6809,7 +6809,7 @@ function _define_property$o(obj, key, value) {
|
|
|
6809
6809
|
}
|
|
6810
6810
|
return obj;
|
|
6811
6811
|
}
|
|
6812
|
-
function _object_spread$
|
|
6812
|
+
function _object_spread$g(target) {
|
|
6813
6813
|
for(var i = 1; i < arguments.length; i++){
|
|
6814
6814
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
6815
6815
|
var ownKeys = Object.keys(source);
|
|
@@ -6819,12 +6819,12 @@ function _object_spread$f(target) {
|
|
|
6819
6819
|
}));
|
|
6820
6820
|
}
|
|
6821
6821
|
ownKeys.forEach(function(key) {
|
|
6822
|
-
_define_property$
|
|
6822
|
+
_define_property$r(target, key, source[key]);
|
|
6823
6823
|
});
|
|
6824
6824
|
}
|
|
6825
6825
|
return target;
|
|
6826
6826
|
}
|
|
6827
|
-
function ownKeys$
|
|
6827
|
+
function ownKeys$c(object, enumerableOnly) {
|
|
6828
6828
|
var keys = Object.keys(object);
|
|
6829
6829
|
if (Object.getOwnPropertySymbols) {
|
|
6830
6830
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -6832,12 +6832,12 @@ function ownKeys$a(object, enumerableOnly) {
|
|
|
6832
6832
|
}
|
|
6833
6833
|
return keys;
|
|
6834
6834
|
}
|
|
6835
|
-
function _object_spread_props$
|
|
6835
|
+
function _object_spread_props$c(target, source) {
|
|
6836
6836
|
source = source != null ? source : {};
|
|
6837
6837
|
if (Object.getOwnPropertyDescriptors) {
|
|
6838
6838
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
6839
6839
|
} else {
|
|
6840
|
-
ownKeys$
|
|
6840
|
+
ownKeys$c(Object(source)).forEach(function(key) {
|
|
6841
6841
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
6842
6842
|
});
|
|
6843
6843
|
}
|
|
@@ -6850,7 +6850,7 @@ function _object_spread_props$a(target, source) {
|
|
|
6850
6850
|
/**
|
|
6851
6851
|
* Nest provider module for Firebase that provides a firestore, etc. from the firestore token.
|
|
6852
6852
|
*/ var FirebaseServerAuthModule = function FirebaseServerAuthModule() {
|
|
6853
|
-
_class_call_check$
|
|
6853
|
+
_class_call_check$j(this, FirebaseServerAuthModule);
|
|
6854
6854
|
};
|
|
6855
6855
|
FirebaseServerAuthModule = __decorate([
|
|
6856
6856
|
Module({
|
|
@@ -6890,7 +6890,7 @@ FirebaseServerAuthModule = __decorate([
|
|
|
6890
6890
|
*/ function provideFirebaseServerAuthService(provider) {
|
|
6891
6891
|
var _provider_inject;
|
|
6892
6892
|
return [
|
|
6893
|
-
_object_spread_props$
|
|
6893
|
+
_object_spread_props$c(_object_spread$g({}, provider), {
|
|
6894
6894
|
inject: (_provider_inject = provider.inject) !== null && _provider_inject !== void 0 ? _provider_inject : [
|
|
6895
6895
|
FIREBASE_AUTH_TOKEN
|
|
6896
6896
|
]
|
|
@@ -7079,27 +7079,86 @@ FirebaseServerAuthModule = __decorate([
|
|
|
7079
7079
|
return claims[FIREBASE_SERVER_AUTH_CLAIMS_SETUP_PASSWORD_KEY] != null;
|
|
7080
7080
|
}
|
|
7081
7081
|
|
|
7082
|
-
// MARK: Scope Reading
|
|
7083
7082
|
/**
|
|
7084
|
-
*
|
|
7083
|
+
* Error code thrown by {@link assertEndpointOidcScope} when an OIDC caller is missing the scope a
|
|
7084
|
+
* non-model endpoint requires.
|
|
7085
|
+
*
|
|
7086
|
+
* Distinct from the callModel-layer code so a client can tell "you cannot call this endpoint" apart
|
|
7087
|
+
* from "you cannot make this model call".
|
|
7088
|
+
*/ var MISSING_ENDPOINT_OIDC_SCOPE_ERROR_CODE = 'MISSING_ENDPOINT_OIDC_SCOPE_ERROR';
|
|
7089
|
+
/**
|
|
7090
|
+
* Reads the set of OIDC scopes carried by an authenticated request, or `undefined` for a non-OIDC
|
|
7085
7091
|
* (regular Firebase ID-token) caller.
|
|
7086
7092
|
*
|
|
7087
7093
|
* The OIDC bearer-token middleware attaches the validated access-token claims at
|
|
7088
7094
|
* `auth.oidcValidatedToken` (with the space-delimited `scope` string); a non-OIDC caller has neither
|
|
7089
|
-
* that field nor a `scope` on `auth.token`. Reading is defensive
|
|
7090
|
-
* {@link FirebaseServerAuthData} here
|
|
7091
|
-
* `@dereekb/firebase-server/oidc` sub-package this core layer cannot import
|
|
7092
|
-
*
|
|
7095
|
+
* that field nor a `scope` on `auth.token`. Reading is defensive — the auth shape is only typed as
|
|
7096
|
+
* {@link FirebaseServerAuthData} here, since the OIDC-specific `oidcValidatedToken` lives in the
|
|
7097
|
+
* `@dereekb/firebase-server/oidc` sub-package this core layer cannot import — and the actual parse is
|
|
7098
|
+
* delegated to the shared {@link oidcScopesFromScopeClaim} so there is no drift with
|
|
7099
|
+
* `getOidcScopesFromRequest`.
|
|
7093
7100
|
*
|
|
7094
7101
|
* @param auth - The request auth data, or undefined for unauthenticated requests.
|
|
7095
7102
|
* @returns The granted scope set, or `undefined` when the request carries no OIDC `scope` claim.
|
|
7096
|
-
*/ function
|
|
7103
|
+
*/ function oidcScopesFromRequestAuth(auth) {
|
|
7097
7104
|
var _auth_oidcValidatedToken, _auth_token;
|
|
7098
7105
|
var oidcScope = auth === null || auth === void 0 ? void 0 : (_auth_oidcValidatedToken = auth.oidcValidatedToken) === null || _auth_oidcValidatedToken === void 0 ? void 0 : _auth_oidcValidatedToken.scope;
|
|
7099
7106
|
var tokenScope = auth === null || auth === void 0 ? void 0 : (_auth_token = auth.token) === null || _auth_token === void 0 ? void 0 : _auth_token.scope;
|
|
7100
7107
|
var scope = oidcScope !== null && oidcScope !== void 0 ? oidcScope : tokenScope;
|
|
7101
7108
|
return oidcScopesFromScopeClaim(scope);
|
|
7102
7109
|
}
|
|
7110
|
+
/**
|
|
7111
|
+
* Enforces a single OIDC scope requirement for a plain (non-callModel) endpoint, throwing a `403`
|
|
7112
|
+
* when an OIDC caller does not hold it.
|
|
7113
|
+
*
|
|
7114
|
+
* The non-model counterpart to `assertModelApiOidcScope`, which is unusable outside the model API
|
|
7115
|
+
* because it requires a `{ call, modelType }` pair. Evaluation reuses the same shipped
|
|
7116
|
+
* {@link oidcScopeTermSatisfied} primitive so a term means the same thing on both surfaces.
|
|
7117
|
+
*
|
|
7118
|
+
* Bypasses (no-op) when `grantedScopes` is `undefined` — i.e. a non-OIDC caller carrying a plain
|
|
7119
|
+
* Firebase ID token, which has no `scope` claim to enforce against. **This is why scope-gating alone
|
|
7120
|
+
* is never a sufficient gate**: an endpoint that must reject non-admins needs its own admin check,
|
|
7121
|
+
* with the scope acting as defence in depth.
|
|
7122
|
+
*
|
|
7123
|
+
* @param input - The required term, the caller's granted scopes, and the endpoint name for the message.
|
|
7124
|
+
* @throws A `403` forbidden error (code {@link MISSING_ENDPOINT_OIDC_SCOPE_ERROR_CODE}) when an OIDC
|
|
7125
|
+
* caller does not satisfy the requirement.
|
|
7126
|
+
*/ function assertEndpointOidcScope(input) {
|
|
7127
|
+
var requiredScope = input.requiredScope, grantedScopes = input.grantedScopes, endpoint = input.endpoint;
|
|
7128
|
+
if (requiredScope != null && grantedScopes != null && !oidcScopeTermSatisfied(requiredScope, grantedScopes)) {
|
|
7129
|
+
var required = Array.isArray(requiredScope) ? requiredScope : [
|
|
7130
|
+
requiredScope
|
|
7131
|
+
];
|
|
7132
|
+
throw forbiddenError({
|
|
7133
|
+
status: 403,
|
|
7134
|
+
code: MISSING_ENDPOINT_OIDC_SCOPE_ERROR_CODE,
|
|
7135
|
+
message: "Missing required OIDC scope for ".concat(endpoint, ": ").concat(required.join(' | ')),
|
|
7136
|
+
data: {
|
|
7137
|
+
requiredScopes: required,
|
|
7138
|
+
endpoint: endpoint
|
|
7139
|
+
}
|
|
7140
|
+
});
|
|
7141
|
+
}
|
|
7142
|
+
}
|
|
7143
|
+
|
|
7144
|
+
// MARK: Scope Reading
|
|
7145
|
+
/**
|
|
7146
|
+
* Reads the set of OIDC scopes carried by a model-api request's auth, or `undefined` for a non-OIDC
|
|
7147
|
+
* (regular Firebase ID-token) caller.
|
|
7148
|
+
*
|
|
7149
|
+
* The OIDC bearer-token middleware attaches the validated access-token claims at
|
|
7150
|
+
* `auth.oidcValidatedToken` (with the space-delimited `scope` string); a non-OIDC caller has neither
|
|
7151
|
+
* that field nor a `scope` on `auth.token`. Reading is defensive (the auth shape is only typed as
|
|
7152
|
+
* {@link FirebaseServerAuthData} here — the OIDC-specific `oidcValidatedToken` lives in the
|
|
7153
|
+
* `@dereekb/firebase-server/oidc` sub-package this core layer cannot import), delegating entirely to the
|
|
7154
|
+
* shared {@link oidcScopesFromRequestAuth} so there is no drift with `getOidcScopesFromRequest` or with
|
|
7155
|
+
* the non-model endpoints that read scopes the same way.
|
|
7156
|
+
*
|
|
7157
|
+
* @param auth - The request auth data, or undefined for unauthenticated requests.
|
|
7158
|
+
* @returns The granted scope set, or `undefined` when the request carries no OIDC `scope` claim.
|
|
7159
|
+
*/ function oidcScopesFromModelApiAuth(auth) {
|
|
7160
|
+
return oidcScopesFromRequestAuth(auth);
|
|
7161
|
+
}
|
|
7103
7162
|
/**
|
|
7104
7163
|
* Enforces the OIDC scope requirement for a single model-api op, throwing a `403`
|
|
7105
7164
|
* {@link CALL_MODEL_MISSING_OIDC_SCOPE_ERROR_CODE} error when the caller does not satisfy it.
|
|
@@ -7151,7 +7210,7 @@ FirebaseServerAuthModule = __decorate([
|
|
|
7151
7210
|
return typeof term === 'string' ? term : term.join('|');
|
|
7152
7211
|
}
|
|
7153
7212
|
|
|
7154
|
-
function _define_property$
|
|
7213
|
+
function _define_property$q(obj, key, value) {
|
|
7155
7214
|
if (key in obj) {
|
|
7156
7215
|
Object.defineProperty(obj, key, {
|
|
7157
7216
|
value: value,
|
|
@@ -7164,7 +7223,7 @@ function _define_property$n(obj, key, value) {
|
|
|
7164
7223
|
}
|
|
7165
7224
|
return obj;
|
|
7166
7225
|
}
|
|
7167
|
-
function _object_spread$
|
|
7226
|
+
function _object_spread$f(target) {
|
|
7168
7227
|
for(var i = 1; i < arguments.length; i++){
|
|
7169
7228
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
7170
7229
|
var ownKeys = Object.keys(source);
|
|
@@ -7174,12 +7233,12 @@ function _object_spread$e(target) {
|
|
|
7174
7233
|
}));
|
|
7175
7234
|
}
|
|
7176
7235
|
ownKeys.forEach(function(key) {
|
|
7177
|
-
_define_property$
|
|
7236
|
+
_define_property$q(target, key, source[key]);
|
|
7178
7237
|
});
|
|
7179
7238
|
}
|
|
7180
7239
|
return target;
|
|
7181
7240
|
}
|
|
7182
|
-
function ownKeys$
|
|
7241
|
+
function ownKeys$b(object, enumerableOnly) {
|
|
7183
7242
|
var keys = Object.keys(object);
|
|
7184
7243
|
if (Object.getOwnPropertySymbols) {
|
|
7185
7244
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -7187,12 +7246,12 @@ function ownKeys$9(object, enumerableOnly) {
|
|
|
7187
7246
|
}
|
|
7188
7247
|
return keys;
|
|
7189
7248
|
}
|
|
7190
|
-
function _object_spread_props$
|
|
7249
|
+
function _object_spread_props$b(target, source) {
|
|
7191
7250
|
source = source != null ? source : {};
|
|
7192
7251
|
if (Object.getOwnPropertyDescriptors) {
|
|
7193
7252
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
7194
7253
|
} else {
|
|
7195
|
-
ownKeys$
|
|
7254
|
+
ownKeys$b(Object(source)).forEach(function(key) {
|
|
7196
7255
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
7197
7256
|
});
|
|
7198
7257
|
}
|
|
@@ -7209,7 +7268,7 @@ function _object_spread_props$9(target, source) {
|
|
|
7209
7268
|
* @param request - The base request to augment (must include the nestApplication reference).
|
|
7210
7269
|
* @returns A new object combining the request properties with the nest context.
|
|
7211
7270
|
*/ function injectNestIntoRequest(nest, request) {
|
|
7212
|
-
return _object_spread_props$
|
|
7271
|
+
return _object_spread_props$b(_object_spread$f({}, request), {
|
|
7213
7272
|
nest: nest
|
|
7214
7273
|
});
|
|
7215
7274
|
}
|
|
@@ -7223,12 +7282,12 @@ function _object_spread_props$9(target, source) {
|
|
|
7223
7282
|
* @param request - The base request to augment.
|
|
7224
7283
|
* @returns A new object combining the request properties with the application context.
|
|
7225
7284
|
*/ function injectNestApplicationContextIntoRequest(nestContext, request) {
|
|
7226
|
-
return _object_spread_props$
|
|
7285
|
+
return _object_spread_props$b(_object_spread$f({}, request), {
|
|
7227
7286
|
nestApplication: nestContext
|
|
7228
7287
|
});
|
|
7229
7288
|
}
|
|
7230
7289
|
|
|
7231
|
-
function asyncGeneratorStep$
|
|
7290
|
+
function asyncGeneratorStep$c(gen, resolve, reject, _next, _throw, key, arg) {
|
|
7232
7291
|
try {
|
|
7233
7292
|
var info = gen[key](arg);
|
|
7234
7293
|
var value = info.value;
|
|
@@ -7242,27 +7301,27 @@ function asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
7242
7301
|
Promise.resolve(value).then(_next, _throw);
|
|
7243
7302
|
}
|
|
7244
7303
|
}
|
|
7245
|
-
function _async_to_generator$
|
|
7304
|
+
function _async_to_generator$c(fn) {
|
|
7246
7305
|
return function() {
|
|
7247
7306
|
var self = this, args = arguments;
|
|
7248
7307
|
return new Promise(function(resolve, reject) {
|
|
7249
7308
|
var gen = fn.apply(self, args);
|
|
7250
7309
|
function _next(value) {
|
|
7251
|
-
asyncGeneratorStep$
|
|
7310
|
+
asyncGeneratorStep$c(gen, resolve, reject, _next, _throw, "next", value);
|
|
7252
7311
|
}
|
|
7253
7312
|
function _throw(err) {
|
|
7254
|
-
asyncGeneratorStep$
|
|
7313
|
+
asyncGeneratorStep$c(gen, resolve, reject, _next, _throw, "throw", err);
|
|
7255
7314
|
}
|
|
7256
7315
|
_next(undefined);
|
|
7257
7316
|
});
|
|
7258
7317
|
};
|
|
7259
7318
|
}
|
|
7260
|
-
function _class_call_check$
|
|
7319
|
+
function _class_call_check$i(instance, Constructor) {
|
|
7261
7320
|
if (!(instance instanceof Constructor)) {
|
|
7262
7321
|
throw new TypeError("Cannot call a class as a function");
|
|
7263
7322
|
}
|
|
7264
7323
|
}
|
|
7265
|
-
function _defineProperties$
|
|
7324
|
+
function _defineProperties$c(target, props) {
|
|
7266
7325
|
for(var i = 0; i < props.length; i++){
|
|
7267
7326
|
var descriptor = props[i];
|
|
7268
7327
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
@@ -7271,11 +7330,11 @@ function _defineProperties$a(target, props) {
|
|
|
7271
7330
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
7272
7331
|
}
|
|
7273
7332
|
}
|
|
7274
|
-
function _create_class$
|
|
7275
|
-
if (protoProps) _defineProperties$
|
|
7333
|
+
function _create_class$c(Constructor, protoProps, staticProps) {
|
|
7334
|
+
if (protoProps) _defineProperties$c(Constructor.prototype, protoProps);
|
|
7276
7335
|
return Constructor;
|
|
7277
7336
|
}
|
|
7278
|
-
function _define_property$
|
|
7337
|
+
function _define_property$p(obj, key, value) {
|
|
7279
7338
|
if (key in obj) {
|
|
7280
7339
|
Object.defineProperty(obj, key, {
|
|
7281
7340
|
value: value,
|
|
@@ -7288,7 +7347,7 @@ function _define_property$m(obj, key, value) {
|
|
|
7288
7347
|
}
|
|
7289
7348
|
return obj;
|
|
7290
7349
|
}
|
|
7291
|
-
function _object_spread$
|
|
7350
|
+
function _object_spread$e(target) {
|
|
7292
7351
|
for(var i = 1; i < arguments.length; i++){
|
|
7293
7352
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
7294
7353
|
var ownKeys = Object.keys(source);
|
|
@@ -7298,12 +7357,12 @@ function _object_spread$d(target) {
|
|
|
7298
7357
|
}));
|
|
7299
7358
|
}
|
|
7300
7359
|
ownKeys.forEach(function(key) {
|
|
7301
|
-
_define_property$
|
|
7360
|
+
_define_property$p(target, key, source[key]);
|
|
7302
7361
|
});
|
|
7303
7362
|
}
|
|
7304
7363
|
return target;
|
|
7305
7364
|
}
|
|
7306
|
-
function _ts_generator$
|
|
7365
|
+
function _ts_generator$c(thisArg, body) {
|
|
7307
7366
|
var f, y, t, _ = {
|
|
7308
7367
|
label: 0,
|
|
7309
7368
|
sent: function() {
|
|
@@ -7420,22 +7479,22 @@ function _ts_generator$a(thisArg, body) {
|
|
|
7420
7479
|
* }
|
|
7421
7480
|
* ```
|
|
7422
7481
|
*/ var ModelApiDispatchConfig = function ModelApiDispatchConfig() {
|
|
7423
|
-
_class_call_check$
|
|
7482
|
+
_class_call_check$i(this, ModelApiDispatchConfig);
|
|
7424
7483
|
/**
|
|
7425
7484
|
* The onCallModel() return value with _apiDetails attached.
|
|
7426
|
-
*/ _define_property$
|
|
7485
|
+
*/ _define_property$p(this, "callModelFn", void 0);
|
|
7427
7486
|
/**
|
|
7428
7487
|
* Factory to create typed nest context from INestApplicationContext.
|
|
7429
|
-
*/ _define_property$
|
|
7488
|
+
*/ _define_property$p(this, "makeNestContext", void 0);
|
|
7430
7489
|
/**
|
|
7431
7490
|
* Optional model-api-layer OIDC group-scope default. See {@link ModelApiOidcScopeConfig.defaultRequiredScope}.
|
|
7432
7491
|
* This is the home for the callModel group-scope default; providing it here enforces it across
|
|
7433
7492
|
* dispatch AND the `/get` reads.
|
|
7434
|
-
*/ _define_property$
|
|
7493
|
+
*/ _define_property$p(this, "defaultRequiredScope", void 0);
|
|
7435
7494
|
/**
|
|
7436
7495
|
* Optional per-model OIDC group-scope overrides. See {@link ModelApiOidcScopeConfig.modelRequiredScopes}.
|
|
7437
7496
|
* The only place a plain `/get` read (no per-function handler) can be scope-gated beyond `model.read`.
|
|
7438
|
-
*/ _define_property$
|
|
7497
|
+
*/ _define_property$p(this, "modelRequiredScopes", void 0);
|
|
7439
7498
|
};
|
|
7440
7499
|
/**
|
|
7441
7500
|
* Injection token for providing the NestJS application context to the dispatch service.
|
|
@@ -7452,13 +7511,13 @@ function _ts_generator$a(thisArg, body) {
|
|
|
7452
7511
|
* the callModel function.
|
|
7453
7512
|
*/ var ModelApiCallModelDispatchService = /*#__PURE__*/ function() {
|
|
7454
7513
|
function ModelApiCallModelDispatchService(config, nestApplication) {
|
|
7455
|
-
_class_call_check$
|
|
7456
|
-
_define_property$
|
|
7457
|
-
_define_property$
|
|
7514
|
+
_class_call_check$i(this, ModelApiCallModelDispatchService);
|
|
7515
|
+
_define_property$p(this, "config", void 0);
|
|
7516
|
+
_define_property$p(this, "nestApplication", void 0);
|
|
7458
7517
|
this.config = config;
|
|
7459
7518
|
this.nestApplication = nestApplication;
|
|
7460
7519
|
}
|
|
7461
|
-
_create_class$
|
|
7520
|
+
_create_class$c(ModelApiCallModelDispatchService, [
|
|
7462
7521
|
{
|
|
7463
7522
|
key: "dispatch",
|
|
7464
7523
|
value: /**
|
|
@@ -7469,9 +7528,9 @@ function _ts_generator$a(thisArg, body) {
|
|
|
7469
7528
|
* @param rawRequest - The raw Express request.
|
|
7470
7529
|
* @returns The handler's return value.
|
|
7471
7530
|
*/ function dispatch(params, auth, rawRequest) {
|
|
7472
|
-
return _async_to_generator$
|
|
7531
|
+
return _async_to_generator$c(function() {
|
|
7473
7532
|
var call, modelType, specifier, apiDetails, requiredScope, callableRequest, appRequest, contextRequest;
|
|
7474
|
-
return _ts_generator$
|
|
7533
|
+
return _ts_generator$c(this, function(_state) {
|
|
7475
7534
|
// Enforce OIDC scope BEFORE dispatching — the relocated home of the callModel scope check.
|
|
7476
7535
|
// AND-of-ORs across the per-verb `model.<call>` scope and the effective group term (per-function
|
|
7477
7536
|
// `requiredScope` > per-model requirement > module default), bypassing non-OIDC callers. A nullish
|
|
@@ -7497,7 +7556,7 @@ function _ts_generator$a(thisArg, body) {
|
|
|
7497
7556
|
data: params,
|
|
7498
7557
|
auth: auth ? {
|
|
7499
7558
|
uid: auth.uid,
|
|
7500
|
-
token: _object_spread$
|
|
7559
|
+
token: _object_spread$e({}, auth.token, auth.oidcValidatedToken)
|
|
7501
7560
|
} : undefined,
|
|
7502
7561
|
rawRequest: rawRequest,
|
|
7503
7562
|
acceptsStreaming: false
|
|
@@ -7533,7 +7592,15 @@ ModelApiCallModelDispatchService = __decorate([
|
|
|
7533
7592
|
__param(1, Inject(MODEL_API_NEST_APPLICATION_CONTEXT))
|
|
7534
7593
|
], ModelApiCallModelDispatchService);
|
|
7535
7594
|
|
|
7536
|
-
function
|
|
7595
|
+
function _array_like_to_array$a(arr, len) {
|
|
7596
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
7597
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
7598
|
+
return arr2;
|
|
7599
|
+
}
|
|
7600
|
+
function _array_with_holes$2(arr) {
|
|
7601
|
+
if (Array.isArray(arr)) return arr;
|
|
7602
|
+
}
|
|
7603
|
+
function asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, key, arg) {
|
|
7537
7604
|
try {
|
|
7538
7605
|
var info = gen[key](arg);
|
|
7539
7606
|
var value = info.value;
|
|
@@ -7547,27 +7614,27 @@ function asyncGeneratorStep$9(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
7547
7614
|
Promise.resolve(value).then(_next, _throw);
|
|
7548
7615
|
}
|
|
7549
7616
|
}
|
|
7550
|
-
function _async_to_generator$
|
|
7617
|
+
function _async_to_generator$b(fn) {
|
|
7551
7618
|
return function() {
|
|
7552
7619
|
var self = this, args = arguments;
|
|
7553
7620
|
return new Promise(function(resolve, reject) {
|
|
7554
7621
|
var gen = fn.apply(self, args);
|
|
7555
7622
|
function _next(value) {
|
|
7556
|
-
asyncGeneratorStep$
|
|
7623
|
+
asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, "next", value);
|
|
7557
7624
|
}
|
|
7558
7625
|
function _throw(err) {
|
|
7559
|
-
asyncGeneratorStep$
|
|
7626
|
+
asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, "throw", err);
|
|
7560
7627
|
}
|
|
7561
7628
|
_next(undefined);
|
|
7562
7629
|
});
|
|
7563
7630
|
};
|
|
7564
7631
|
}
|
|
7565
|
-
function _class_call_check$
|
|
7632
|
+
function _class_call_check$h(instance, Constructor) {
|
|
7566
7633
|
if (!(instance instanceof Constructor)) {
|
|
7567
7634
|
throw new TypeError("Cannot call a class as a function");
|
|
7568
7635
|
}
|
|
7569
7636
|
}
|
|
7570
|
-
function _defineProperties$
|
|
7637
|
+
function _defineProperties$b(target, props) {
|
|
7571
7638
|
for(var i = 0; i < props.length; i++){
|
|
7572
7639
|
var descriptor = props[i];
|
|
7573
7640
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
@@ -7576,11 +7643,11 @@ function _defineProperties$9(target, props) {
|
|
|
7576
7643
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
7577
7644
|
}
|
|
7578
7645
|
}
|
|
7579
|
-
function _create_class$
|
|
7580
|
-
if (protoProps) _defineProperties$
|
|
7646
|
+
function _create_class$b(Constructor, protoProps, staticProps) {
|
|
7647
|
+
if (protoProps) _defineProperties$b(Constructor.prototype, protoProps);
|
|
7581
7648
|
return Constructor;
|
|
7582
7649
|
}
|
|
7583
|
-
function _define_property$
|
|
7650
|
+
function _define_property$o(obj, key, value) {
|
|
7584
7651
|
if (key in obj) {
|
|
7585
7652
|
Object.defineProperty(obj, key, {
|
|
7586
7653
|
value: value,
|
|
@@ -7593,7 +7660,7 @@ function _define_property$l(obj, key, value) {
|
|
|
7593
7660
|
}
|
|
7594
7661
|
return obj;
|
|
7595
7662
|
}
|
|
7596
|
-
function _instanceof$
|
|
7663
|
+
function _instanceof$3(left, right) {
|
|
7597
7664
|
"@swc/helpers - instanceof";
|
|
7598
7665
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
7599
7666
|
return !!right[Symbol.hasInstance](left);
|
|
@@ -7601,7 +7668,34 @@ function _instanceof$2(left, right) {
|
|
|
7601
7668
|
return left instanceof right;
|
|
7602
7669
|
}
|
|
7603
7670
|
}
|
|
7604
|
-
function
|
|
7671
|
+
function _iterable_to_array_limit$2(arr, i) {
|
|
7672
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
7673
|
+
if (_i == null) return;
|
|
7674
|
+
var _arr = [];
|
|
7675
|
+
var _n = true;
|
|
7676
|
+
var _d = false;
|
|
7677
|
+
var _s, _e;
|
|
7678
|
+
try {
|
|
7679
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
7680
|
+
_arr.push(_s.value);
|
|
7681
|
+
if (i && _arr.length === i) break;
|
|
7682
|
+
}
|
|
7683
|
+
} catch (err) {
|
|
7684
|
+
_d = true;
|
|
7685
|
+
_e = err;
|
|
7686
|
+
} finally{
|
|
7687
|
+
try {
|
|
7688
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
7689
|
+
} finally{
|
|
7690
|
+
if (_d) throw _e;
|
|
7691
|
+
}
|
|
7692
|
+
}
|
|
7693
|
+
return _arr;
|
|
7694
|
+
}
|
|
7695
|
+
function _non_iterable_rest$2() {
|
|
7696
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
7697
|
+
}
|
|
7698
|
+
function _object_spread$d(target) {
|
|
7605
7699
|
for(var i = 1; i < arguments.length; i++){
|
|
7606
7700
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
7607
7701
|
var ownKeys = Object.keys(source);
|
|
@@ -7611,12 +7705,42 @@ function _object_spread$c(target) {
|
|
|
7611
7705
|
}));
|
|
7612
7706
|
}
|
|
7613
7707
|
ownKeys.forEach(function(key) {
|
|
7614
|
-
_define_property$
|
|
7708
|
+
_define_property$o(target, key, source[key]);
|
|
7615
7709
|
});
|
|
7616
7710
|
}
|
|
7617
7711
|
return target;
|
|
7618
7712
|
}
|
|
7619
|
-
function
|
|
7713
|
+
function ownKeys$a(object, enumerableOnly) {
|
|
7714
|
+
var keys = Object.keys(object);
|
|
7715
|
+
if (Object.getOwnPropertySymbols) {
|
|
7716
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
7717
|
+
keys.push.apply(keys, symbols);
|
|
7718
|
+
}
|
|
7719
|
+
return keys;
|
|
7720
|
+
}
|
|
7721
|
+
function _object_spread_props$a(target, source) {
|
|
7722
|
+
source = source != null ? source : {};
|
|
7723
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
7724
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
7725
|
+
} else {
|
|
7726
|
+
ownKeys$a(Object(source)).forEach(function(key) {
|
|
7727
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
7728
|
+
});
|
|
7729
|
+
}
|
|
7730
|
+
return target;
|
|
7731
|
+
}
|
|
7732
|
+
function _sliced_to_array$2(arr, i) {
|
|
7733
|
+
return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$a(arr, i) || _non_iterable_rest$2();
|
|
7734
|
+
}
|
|
7735
|
+
function _unsupported_iterable_to_array$a(o, minLen) {
|
|
7736
|
+
if (!o) return;
|
|
7737
|
+
if (typeof o === "string") return _array_like_to_array$a(o, minLen);
|
|
7738
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
7739
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
7740
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
7741
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$a(o, minLen);
|
|
7742
|
+
}
|
|
7743
|
+
function _ts_generator$b(thisArg, body) {
|
|
7620
7744
|
var f, y, t, _ = {
|
|
7621
7745
|
label: 0,
|
|
7622
7746
|
sent: function() {
|
|
@@ -7719,6 +7843,49 @@ function _ts_generator$9(thisArg, body) {
|
|
|
7719
7843
|
/**
|
|
7720
7844
|
* Maximum number of keys allowed in a multi-read request.
|
|
7721
7845
|
*/ var MAX_MODEL_ACCESS_MULTI_READ_KEYS = 50;
|
|
7846
|
+
/**
|
|
7847
|
+
* Error code returned when a read targets a model the app declared SERVER-ONLY.
|
|
7848
|
+
*
|
|
7849
|
+
* Deliberately distinct from a permission error: nothing the caller can be granted will make this
|
|
7850
|
+
* read succeed, so the message needs to say WHY rather than implying a missing role.
|
|
7851
|
+
*/ var MODEL_IS_SERVER_ONLY_ERROR_CODE = 'MODEL_IS_SERVER_ONLY';
|
|
7852
|
+
/**
|
|
7853
|
+
* Role-map keys that are structural markers rather than granted role names, so they are never
|
|
7854
|
+
* reported as roles.
|
|
7855
|
+
*
|
|
7856
|
+
* {@link FULL_ACCESS_ROLE_KEY} is surfaced through `fullAccess` instead. {@link NO_ACCESS_ROLE_KEY}
|
|
7857
|
+
* is what `noAccessRoleMap()` sets and means "no roles at all" — both a missing document and an
|
|
7858
|
+
* explicit no-access grant carry it, so leaking it would report `__EMPTY__` as a granted role and
|
|
7859
|
+
* make the no-access case indistinguishable from a real one-role grant.
|
|
7860
|
+
*/ var MODEL_ACCESS_ROLE_MAP_MARKER_KEYS = new Set([
|
|
7861
|
+
FULL_ACCESS_ROLE_KEY,
|
|
7862
|
+
NO_ACCESS_ROLE_KEY
|
|
7863
|
+
]);
|
|
7864
|
+
/**
|
|
7865
|
+
* Maps a resolved `ContextGrantedModelRoles` into the flat {@link ModelAccessRoleMapResult} wire
|
|
7866
|
+
* shape — collapsing the full-access marker into a boolean, dropping the structural marker keys, and
|
|
7867
|
+
* sorting the enumerated role keys so output is stable across calls.
|
|
7868
|
+
*
|
|
7869
|
+
* @param input - The key and its resolved granted-roles result.
|
|
7870
|
+
* @returns The flattened per-key permission state.
|
|
7871
|
+
*/ function modelAccessRoleMapResultFromGrantedRoles(input) {
|
|
7872
|
+
var _granted_data;
|
|
7873
|
+
var key = input.key, granted = input.granted;
|
|
7874
|
+
var fullAccess = isFullAccessRoleMap(granted.roleMap);
|
|
7875
|
+
var roles = fullAccess ? [] : Object.entries(granted.roleMap).filter(function(param) {
|
|
7876
|
+
var _param = _sliced_to_array$2(param, 2), roleKey = _param[0], value = _param[1];
|
|
7877
|
+
return value === true && !MODEL_ACCESS_ROLE_MAP_MARKER_KEYS.has(roleKey);
|
|
7878
|
+
}).map(function(param) {
|
|
7879
|
+
var _param = _sliced_to_array$2(param, 1), roleKey = _param[0];
|
|
7880
|
+
return roleKey;
|
|
7881
|
+
}).sort();
|
|
7882
|
+
return {
|
|
7883
|
+
key: key,
|
|
7884
|
+
exists: ((_granted_data = granted.data) === null || _granted_data === void 0 ? void 0 : _granted_data.exists) === true,
|
|
7885
|
+
fullAccess: fullAccess,
|
|
7886
|
+
roles: roles
|
|
7887
|
+
};
|
|
7888
|
+
}
|
|
7722
7889
|
/**
|
|
7723
7890
|
* Maps a single `useMultipleModels` failure entry into the public {@link ModelAccessReadError}
|
|
7724
7891
|
* shape. Unwraps the typical Firebase error shapes via {@link firebaseServerErrorInfo} so
|
|
@@ -7738,7 +7905,7 @@ function _ts_generator$9(thisArg, body) {
|
|
|
7738
7905
|
var info = firebaseServerErrorInfo(entry.error);
|
|
7739
7906
|
var serverMessage = (_info_httpsErrorDetailsServerError = info.httpsErrorDetailsServerError) === null || _info_httpsErrorDetailsServerError === void 0 ? void 0 : _info_httpsErrorDetailsServerError.message;
|
|
7740
7907
|
var httpsMessage = (_info_httpsError = info.httpsError) === null || _info_httpsError === void 0 ? void 0 : _info_httpsError.message;
|
|
7741
|
-
var plainMessage = _instanceof$
|
|
7908
|
+
var plainMessage = _instanceof$3(entry.error, Error) ? entry.error.message : undefined;
|
|
7742
7909
|
var code = (_info_serverErrorCode = info.serverErrorCode) !== null && _info_serverErrorCode !== void 0 ? _info_serverErrorCode : info.firebaseErrorCode;
|
|
7743
7910
|
return {
|
|
7744
7911
|
key: entry.key,
|
|
@@ -7778,16 +7945,16 @@ function _ts_generator$9(thisArg, body) {
|
|
|
7778
7945
|
* enforcing `'read'` role permissions per document.
|
|
7779
7946
|
*/ var ModelApiGetService = /*#__PURE__*/ function() {
|
|
7780
7947
|
function ModelApiGetService(config, nestApplication) {
|
|
7781
|
-
_class_call_check$
|
|
7782
|
-
_define_property$
|
|
7783
|
-
_define_property$
|
|
7784
|
-
_define_property$
|
|
7785
|
-
_define_property$
|
|
7948
|
+
_class_call_check$h(this, ModelApiGetService);
|
|
7949
|
+
_define_property$o(this, "_nestContext", void 0);
|
|
7950
|
+
_define_property$o(this, "_defaultRequiredScope", void 0);
|
|
7951
|
+
_define_property$o(this, "_modelRequiredScopes", void 0);
|
|
7952
|
+
_define_property$o(this, "_identityByModelType", void 0);
|
|
7786
7953
|
this._nestContext = config.makeNestContext(nestApplication);
|
|
7787
7954
|
this._defaultRequiredScope = config.defaultRequiredScope;
|
|
7788
7955
|
this._modelRequiredScopes = config.modelRequiredScopes;
|
|
7789
7956
|
}
|
|
7790
|
-
_create_class$
|
|
7957
|
+
_create_class$b(ModelApiGetService, [
|
|
7791
7958
|
{
|
|
7792
7959
|
/**
|
|
7793
7960
|
* Enforces the OIDC read-scope requirement for a direct document read before it hits Firestore.
|
|
@@ -7812,6 +7979,57 @@ function _ts_generator$9(thisArg, body) {
|
|
|
7812
7979
|
},
|
|
7813
7980
|
{
|
|
7814
7981
|
/**
|
|
7982
|
+
* Refuses a read of a model the app declared SERVER-ONLY, BEFORE `useModel` runs.
|
|
7983
|
+
*
|
|
7984
|
+
* The model API authorizes through `roleMapForModel` under the Admin SDK, which bypasses
|
|
7985
|
+
* `firestore.rules` entirely. For a model the rules file deliberately leaves unmatched (or denies
|
|
7986
|
+
* outright), those two systems disagree and the model API is the one handing out the document.
|
|
7987
|
+
* Gating here — ahead of the role map, and on the ONE service both `/model/<type>/get` and the
|
|
7988
|
+
* `model-get` MCP tool share — is what makes the two read paths agree.
|
|
7989
|
+
*
|
|
7990
|
+
* @param modelType - The Firestore model type being read.
|
|
7991
|
+
* @param auth - The request's auth data; used to build the context the service lookup needs.
|
|
7992
|
+
* @throws {HttpsError} `MODEL_IS_SERVER_ONLY` when the model opted in via `serverOnly`.
|
|
7993
|
+
*/ key: "_assertNotServerOnly",
|
|
7994
|
+
value: function _assertNotServerOnly(modelType, auth) {
|
|
7995
|
+
if (this._isServerOnlyModel(modelType, auth)) {
|
|
7996
|
+
throw forbiddenError({
|
|
7997
|
+
status: 403,
|
|
7998
|
+
code: MODEL_IS_SERVER_ONLY_ERROR_CODE,
|
|
7999
|
+
message: 'Model "'.concat(modelType, '" is server-only and cannot be read through the model API. It has no client read grant in firestore.rules either — reach it through a callable that owns its access policy.'),
|
|
8000
|
+
data: {
|
|
8001
|
+
modelType: modelType
|
|
8002
|
+
}
|
|
8003
|
+
});
|
|
8004
|
+
}
|
|
8005
|
+
}
|
|
8006
|
+
},
|
|
8007
|
+
{
|
|
8008
|
+
/**
|
|
8009
|
+
* Reads the `serverOnly` flag off the registered model service, tolerating a type whose service
|
|
8010
|
+
* cannot be constructed (which `readDocument` then reports as an unknown model).
|
|
8011
|
+
*
|
|
8012
|
+
* @param modelType - The Firestore model type to inspect.
|
|
8013
|
+
* @param auth - The request's auth data.
|
|
8014
|
+
* @returns `true` when the model declared itself server-only.
|
|
8015
|
+
*/ key: "_isServerOnlyModel",
|
|
8016
|
+
value: function _isServerOnlyModel(modelType, auth) {
|
|
8017
|
+
var authRef = this._makeAuthRef(auth);
|
|
8018
|
+
var result = false;
|
|
8019
|
+
try {
|
|
8020
|
+
var inContextService = this._nestContext.model(authRef);
|
|
8021
|
+
var modelService = inContextService(modelType);
|
|
8022
|
+
result = (modelService === null || modelService === void 0 ? void 0 : modelService.serverOnly) === true;
|
|
8023
|
+
} catch (unused) {
|
|
8024
|
+
// an unregistered / unconstructable type is not our error to raise here — the subsequent
|
|
8025
|
+
// useModel call reports it as an unknown model
|
|
8026
|
+
result = false;
|
|
8027
|
+
}
|
|
8028
|
+
return result;
|
|
8029
|
+
}
|
|
8030
|
+
},
|
|
8031
|
+
{
|
|
8032
|
+
/**
|
|
7815
8033
|
* Returns the registered {@link FirestoreModelIdentity} for the given `modelType` string, or
|
|
7816
8034
|
* `undefined` when no model of that type is registered.
|
|
7817
8035
|
*
|
|
@@ -7878,12 +8096,13 @@ function _ts_generator$9(thisArg, body) {
|
|
|
7878
8096
|
* @returns The document key and data.
|
|
7879
8097
|
* @throws {Error} Permission or not-found errors from useModel.
|
|
7880
8098
|
*/ function readDocument(modelType, key, auth) {
|
|
7881
|
-
return _async_to_generator$
|
|
8099
|
+
return _async_to_generator$b(function() {
|
|
7882
8100
|
var authRef, doc, snapshot;
|
|
7883
|
-
return _ts_generator$
|
|
8101
|
+
return _ts_generator$b(this, function(_state) {
|
|
7884
8102
|
switch(_state.label){
|
|
7885
8103
|
case 0:
|
|
7886
8104
|
this._assertReadScope(modelType, auth);
|
|
8105
|
+
this._assertNotServerOnly(modelType, auth);
|
|
7887
8106
|
authRef = this._makeAuthRef(auth);
|
|
7888
8107
|
return [
|
|
7889
8108
|
4,
|
|
@@ -7929,10 +8148,11 @@ function _ts_generator$9(thisArg, body) {
|
|
|
7929
8148
|
* @param auth - The authenticated user's auth data from the request.
|
|
7930
8149
|
* @returns Results and errors for each requested key.
|
|
7931
8150
|
*/ function readDocuments(modelType, keys, auth) {
|
|
7932
|
-
return _async_to_generator$
|
|
8151
|
+
return _async_to_generator$b(function() {
|
|
7933
8152
|
var authRef;
|
|
7934
|
-
return _ts_generator$
|
|
8153
|
+
return _ts_generator$b(this, function(_state) {
|
|
7935
8154
|
this._assertReadScope(modelType, auth);
|
|
8155
|
+
this._assertNotServerOnly(modelType, auth);
|
|
7936
8156
|
authRef = this._makeAuthRef(auth);
|
|
7937
8157
|
return [
|
|
7938
8158
|
2,
|
|
@@ -7942,17 +8162,17 @@ function _ts_generator$9(thisArg, body) {
|
|
|
7942
8162
|
roles: 'read',
|
|
7943
8163
|
throwOnFirstError: false,
|
|
7944
8164
|
use: function use(successful, failure) {
|
|
7945
|
-
return _async_to_generator$
|
|
8165
|
+
return _async_to_generator$b(function() {
|
|
7946
8166
|
var results, errors;
|
|
7947
|
-
return _ts_generator$
|
|
8167
|
+
return _ts_generator$b(this, function(_state) {
|
|
7948
8168
|
switch(_state.label){
|
|
7949
8169
|
case 0:
|
|
7950
8170
|
return [
|
|
7951
8171
|
4,
|
|
7952
8172
|
Promise.all(successful.map(function(reader) {
|
|
7953
|
-
return _async_to_generator$
|
|
8173
|
+
return _async_to_generator$b(function() {
|
|
7954
8174
|
var snapshot;
|
|
7955
|
-
return _ts_generator$
|
|
8175
|
+
return _ts_generator$b(this, function(_state) {
|
|
7956
8176
|
switch(_state.label){
|
|
7957
8177
|
case 0:
|
|
7958
8178
|
return [
|
|
@@ -7994,27 +8214,207 @@ function _ts_generator$9(thisArg, body) {
|
|
|
7994
8214
|
}
|
|
7995
8215
|
},
|
|
7996
8216
|
{
|
|
7997
|
-
|
|
7998
|
-
|
|
8217
|
+
key: "readRoleMaps",
|
|
8218
|
+
value: /**
|
|
8219
|
+
* Resolves the granted role map for one or more keys of the same model type — i.e. "what is this
|
|
8220
|
+
* user actually allowed to do with this document?".
|
|
7999
8221
|
*
|
|
8000
|
-
*
|
|
8001
|
-
*
|
|
8002
|
-
*
|
|
8003
|
-
*
|
|
8222
|
+
* This is the same computation the permission-checked read path runs (`roleMapForModel()` on the
|
|
8223
|
+
* model's registered service factory), but the resolved roles are returned instead of being
|
|
8224
|
+
* consumed to allow/deny an operation. Because it runs the model's real delegate, derived and
|
|
8225
|
+
* cascading roles are included exactly as the API would grant them.
|
|
8004
8226
|
*
|
|
8005
|
-
*
|
|
8006
|
-
*
|
|
8007
|
-
|
|
8008
|
-
|
|
8009
|
-
|
|
8010
|
-
|
|
8011
|
-
|
|
8012
|
-
|
|
8013
|
-
var
|
|
8014
|
-
|
|
8015
|
-
|
|
8016
|
-
|
|
8017
|
-
|
|
8227
|
+
* Per-key failures are captured in `errors` rather than thrown, matching {@link readDocuments}.
|
|
8228
|
+
* A key that resolves to a missing document is NOT an error — it comes back with
|
|
8229
|
+
* `exists: false, roles: []`, which is what distinguishes "not there" from "no access".
|
|
8230
|
+
*
|
|
8231
|
+
* @param params - Model type, keys, calling auth, and an optional target uid.
|
|
8232
|
+
* @returns The per-key permission state plus the uid the roles were resolved for.
|
|
8233
|
+
*/ function readRoleMaps(params) {
|
|
8234
|
+
return _async_to_generator$b(function() {
|
|
8235
|
+
var _authRef_auth, modelType, keys, auth, targetUid, targeted, authRef, _tmp, context, service, settled, results, errors, uid;
|
|
8236
|
+
return _ts_generator$b(this, function(_state) {
|
|
8237
|
+
switch(_state.label){
|
|
8238
|
+
case 0:
|
|
8239
|
+
modelType = params.modelType, keys = params.keys, auth = params.auth, targetUid = params.targetUid;
|
|
8240
|
+
this._assertReadScope(modelType, auth);
|
|
8241
|
+
targeted = targetUid != null && targetUid !== (auth === null || auth === void 0 ? void 0 : auth.uid);
|
|
8242
|
+
if (!targeted) return [
|
|
8243
|
+
3,
|
|
8244
|
+
2
|
|
8245
|
+
];
|
|
8246
|
+
return [
|
|
8247
|
+
4,
|
|
8248
|
+
this._makeAuthRefForUid(targetUid)
|
|
8249
|
+
];
|
|
8250
|
+
case 1:
|
|
8251
|
+
_tmp = _state.sent();
|
|
8252
|
+
return [
|
|
8253
|
+
3,
|
|
8254
|
+
3
|
|
8255
|
+
];
|
|
8256
|
+
case 2:
|
|
8257
|
+
_tmp = this._makeAuthRef(auth);
|
|
8258
|
+
_state.label = 3;
|
|
8259
|
+
case 3:
|
|
8260
|
+
authRef = _tmp;
|
|
8261
|
+
context = this._nestContext.makeModelContext(authRef);
|
|
8262
|
+
service = this._nestContext.firebaseModelsService(modelType, context);
|
|
8263
|
+
return [
|
|
8264
|
+
4,
|
|
8265
|
+
Promise.all(keys.map(function(key) {
|
|
8266
|
+
return _async_to_generator$b(function() {
|
|
8267
|
+
var entry, granted, error;
|
|
8268
|
+
return _ts_generator$b(this, function(_state) {
|
|
8269
|
+
switch(_state.label){
|
|
8270
|
+
case 0:
|
|
8271
|
+
_state.trys.push([
|
|
8272
|
+
0,
|
|
8273
|
+
2,
|
|
8274
|
+
,
|
|
8275
|
+
3
|
|
8276
|
+
]);
|
|
8277
|
+
return [
|
|
8278
|
+
4,
|
|
8279
|
+
service.roleMapForKey(key)
|
|
8280
|
+
];
|
|
8281
|
+
case 1:
|
|
8282
|
+
granted = _state.sent();
|
|
8283
|
+
entry = {
|
|
8284
|
+
result: modelAccessRoleMapResultFromGrantedRoles({
|
|
8285
|
+
key: key,
|
|
8286
|
+
granted: granted
|
|
8287
|
+
})
|
|
8288
|
+
};
|
|
8289
|
+
return [
|
|
8290
|
+
3,
|
|
8291
|
+
3
|
|
8292
|
+
];
|
|
8293
|
+
case 2:
|
|
8294
|
+
error = _state.sent();
|
|
8295
|
+
entry = {
|
|
8296
|
+
error: modelAccessReadErrorFromUseMultipleModelsFailure({
|
|
8297
|
+
key: key,
|
|
8298
|
+
error: error
|
|
8299
|
+
})
|
|
8300
|
+
};
|
|
8301
|
+
return [
|
|
8302
|
+
3,
|
|
8303
|
+
3
|
|
8304
|
+
];
|
|
8305
|
+
case 3:
|
|
8306
|
+
return [
|
|
8307
|
+
2,
|
|
8308
|
+
entry
|
|
8309
|
+
];
|
|
8310
|
+
}
|
|
8311
|
+
});
|
|
8312
|
+
})();
|
|
8313
|
+
}))
|
|
8314
|
+
];
|
|
8315
|
+
case 4:
|
|
8316
|
+
settled = _state.sent();
|
|
8317
|
+
results = [];
|
|
8318
|
+
errors = [];
|
|
8319
|
+
settled.forEach(function(entry) {
|
|
8320
|
+
if (entry.result != null) {
|
|
8321
|
+
results.push(entry.result);
|
|
8322
|
+
} else if (entry.error != null) {
|
|
8323
|
+
errors.push(entry.error);
|
|
8324
|
+
}
|
|
8325
|
+
});
|
|
8326
|
+
uid = (_authRef_auth = authRef.auth) === null || _authRef_auth === void 0 ? void 0 : _authRef_auth.uid;
|
|
8327
|
+
return [
|
|
8328
|
+
2,
|
|
8329
|
+
_object_spread_props$a(_object_spread$d({}, uid == null ? {} : {
|
|
8330
|
+
uid: uid
|
|
8331
|
+
}), {
|
|
8332
|
+
targeted: targeted,
|
|
8333
|
+
results: results,
|
|
8334
|
+
errors: errors
|
|
8335
|
+
})
|
|
8336
|
+
];
|
|
8337
|
+
}
|
|
8338
|
+
});
|
|
8339
|
+
}).call(this);
|
|
8340
|
+
}
|
|
8341
|
+
},
|
|
8342
|
+
{
|
|
8343
|
+
key: "_makeAuthRefForUid",
|
|
8344
|
+
value: /**
|
|
8345
|
+
* Builds a synthetic {@link AuthData} for an arbitrary uid so role resolution can run *as* that
|
|
8346
|
+
* user rather than as the caller.
|
|
8347
|
+
*
|
|
8348
|
+
* The target's custom claims are read from their Firebase Auth record and spread into the
|
|
8349
|
+
* synthetic token, mirroring how Firebase merges custom claims into a real decoded ID token —
|
|
8350
|
+
* so claim-reading permission delegates behave identically to a live request from that user.
|
|
8351
|
+
*
|
|
8352
|
+
* @param uid - The uid to resolve as.
|
|
8353
|
+
* @returns An auth ref carrying the target user's claims.
|
|
8354
|
+
* @throws {Error} If no Firebase Auth user exists for the uid.
|
|
8355
|
+
*/ function _makeAuthRefForUid(uid) {
|
|
8356
|
+
return _async_to_generator$b(function() {
|
|
8357
|
+
var userContext, exists, record;
|
|
8358
|
+
return _ts_generator$b(this, function(_state) {
|
|
8359
|
+
switch(_state.label){
|
|
8360
|
+
case 0:
|
|
8361
|
+
userContext = this._nestContext.authService.userContext(uid);
|
|
8362
|
+
return [
|
|
8363
|
+
4,
|
|
8364
|
+
userContext.exists()
|
|
8365
|
+
];
|
|
8366
|
+
case 1:
|
|
8367
|
+
exists = _state.sent();
|
|
8368
|
+
if (!exists) {
|
|
8369
|
+
throw new Error('No user exists with uid "'.concat(uid, '".'));
|
|
8370
|
+
}
|
|
8371
|
+
return [
|
|
8372
|
+
4,
|
|
8373
|
+
userContext.loadRecord()
|
|
8374
|
+
];
|
|
8375
|
+
case 2:
|
|
8376
|
+
record = _state.sent();
|
|
8377
|
+
return [
|
|
8378
|
+
2,
|
|
8379
|
+
{
|
|
8380
|
+
auth: {
|
|
8381
|
+
uid: uid,
|
|
8382
|
+
token: _object_spread_props$a(_object_spread$d({}, record.customClaims), {
|
|
8383
|
+
uid: uid,
|
|
8384
|
+
sub: uid,
|
|
8385
|
+
email: record.email,
|
|
8386
|
+
email_verified: record.emailVerified
|
|
8387
|
+
})
|
|
8388
|
+
}
|
|
8389
|
+
}
|
|
8390
|
+
];
|
|
8391
|
+
}
|
|
8392
|
+
});
|
|
8393
|
+
}).call(this);
|
|
8394
|
+
}
|
|
8395
|
+
},
|
|
8396
|
+
{
|
|
8397
|
+
/**
|
|
8398
|
+
* Builds an {@link AuthDataRef} compatible with `useModel()` from the HTTP request auth.
|
|
8399
|
+
*
|
|
8400
|
+
* Uses the same synthetic auth pattern as {@link ModelApiDispatchService.dispatch}.
|
|
8401
|
+
* The OIDC-validated claim subset is layered over the base token so the synthetic
|
|
8402
|
+
* `auth.token` keeps standard JWT claims (`iat`, `auth_time`, `email`, …) that
|
|
8403
|
+
* downstream consumers like `authContextInfo` rely on.
|
|
8404
|
+
*
|
|
8405
|
+
* @param auth - The Firebase server auth data from the HTTP request, or undefined for unauthenticated requests.
|
|
8406
|
+
* @returns An object containing a synthetic {@link AuthData} for use with `useModel()`, or undefined auth.
|
|
8407
|
+
*/ key: "_makeAuthRef",
|
|
8408
|
+
value: function _makeAuthRef(auth) {
|
|
8409
|
+
var synthetic;
|
|
8410
|
+
if (auth) {
|
|
8411
|
+
var _auth_token, _auth_oidcValidatedToken;
|
|
8412
|
+
var baseToken = (_auth_token = auth.token) !== null && _auth_token !== void 0 ? _auth_token : {};
|
|
8413
|
+
var oidcToken = (_auth_oidcValidatedToken = auth.oidcValidatedToken) !== null && _auth_oidcValidatedToken !== void 0 ? _auth_oidcValidatedToken : {};
|
|
8414
|
+
synthetic = {
|
|
8415
|
+
uid: auth.uid,
|
|
8416
|
+
token: _object_spread$d({}, baseToken, oidcToken)
|
|
8417
|
+
};
|
|
8018
8418
|
}
|
|
8019
8419
|
return {
|
|
8020
8420
|
auth: synthetic
|
|
@@ -8030,7 +8430,7 @@ ModelApiGetService = __decorate([
|
|
|
8030
8430
|
__param(1, Inject(MODEL_API_NEST_APPLICATION_CONTEXT))
|
|
8031
8431
|
], ModelApiGetService);
|
|
8032
8432
|
|
|
8033
|
-
function asyncGeneratorStep$
|
|
8433
|
+
function asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, key, arg) {
|
|
8034
8434
|
try {
|
|
8035
8435
|
var info = gen[key](arg);
|
|
8036
8436
|
var value = info.value;
|
|
@@ -8044,27 +8444,27 @@ function asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
8044
8444
|
Promise.resolve(value).then(_next, _throw);
|
|
8045
8445
|
}
|
|
8046
8446
|
}
|
|
8047
|
-
function _async_to_generator$
|
|
8447
|
+
function _async_to_generator$a(fn) {
|
|
8048
8448
|
return function() {
|
|
8049
8449
|
var self = this, args = arguments;
|
|
8050
8450
|
return new Promise(function(resolve, reject) {
|
|
8051
8451
|
var gen = fn.apply(self, args);
|
|
8052
8452
|
function _next(value) {
|
|
8053
|
-
asyncGeneratorStep$
|
|
8453
|
+
asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, "next", value);
|
|
8054
8454
|
}
|
|
8055
8455
|
function _throw(err) {
|
|
8056
|
-
asyncGeneratorStep$
|
|
8456
|
+
asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, "throw", err);
|
|
8057
8457
|
}
|
|
8058
8458
|
_next(undefined);
|
|
8059
8459
|
});
|
|
8060
8460
|
};
|
|
8061
8461
|
}
|
|
8062
|
-
function _class_call_check$
|
|
8462
|
+
function _class_call_check$g(instance, Constructor) {
|
|
8063
8463
|
if (!(instance instanceof Constructor)) {
|
|
8064
8464
|
throw new TypeError("Cannot call a class as a function");
|
|
8065
8465
|
}
|
|
8066
8466
|
}
|
|
8067
|
-
function _defineProperties$
|
|
8467
|
+
function _defineProperties$a(target, props) {
|
|
8068
8468
|
for(var i = 0; i < props.length; i++){
|
|
8069
8469
|
var descriptor = props[i];
|
|
8070
8470
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
@@ -8073,11 +8473,11 @@ function _defineProperties$8(target, props) {
|
|
|
8073
8473
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
8074
8474
|
}
|
|
8075
8475
|
}
|
|
8076
|
-
function _create_class$
|
|
8077
|
-
if (protoProps) _defineProperties$
|
|
8476
|
+
function _create_class$a(Constructor, protoProps, staticProps) {
|
|
8477
|
+
if (protoProps) _defineProperties$a(Constructor.prototype, protoProps);
|
|
8078
8478
|
return Constructor;
|
|
8079
8479
|
}
|
|
8080
|
-
function _define_property$
|
|
8480
|
+
function _define_property$n(obj, key, value) {
|
|
8081
8481
|
if (key in obj) {
|
|
8082
8482
|
Object.defineProperty(obj, key, {
|
|
8083
8483
|
value: value,
|
|
@@ -8090,7 +8490,7 @@ function _define_property$k(obj, key, value) {
|
|
|
8090
8490
|
}
|
|
8091
8491
|
return obj;
|
|
8092
8492
|
}
|
|
8093
|
-
function _instanceof$
|
|
8493
|
+
function _instanceof$2(left, right) {
|
|
8094
8494
|
"@swc/helpers - instanceof";
|
|
8095
8495
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
8096
8496
|
return !!right[Symbol.hasInstance](left);
|
|
@@ -8098,7 +8498,7 @@ function _instanceof$1(left, right) {
|
|
|
8098
8498
|
return left instanceof right;
|
|
8099
8499
|
}
|
|
8100
8500
|
}
|
|
8101
|
-
function _ts_generator$
|
|
8501
|
+
function _ts_generator$a(thisArg, body) {
|
|
8102
8502
|
var f, y, t, _ = {
|
|
8103
8503
|
label: 0,
|
|
8104
8504
|
sent: function() {
|
|
@@ -8223,13 +8623,13 @@ function _ts_generator$8(thisArg, body) {
|
|
|
8223
8623
|
* Auth is provided by the OIDC bearer token middleware on the `req.auth` field.
|
|
8224
8624
|
*/ var ModelApiController = /*#__PURE__*/ function() {
|
|
8225
8625
|
function ModelApiController(dispatchService, accessService) {
|
|
8226
|
-
_class_call_check$
|
|
8227
|
-
_define_property$
|
|
8228
|
-
_define_property$
|
|
8626
|
+
_class_call_check$g(this, ModelApiController);
|
|
8627
|
+
_define_property$n(this, "dispatchService", void 0);
|
|
8628
|
+
_define_property$n(this, "accessService", void 0);
|
|
8229
8629
|
this.dispatchService = dispatchService;
|
|
8230
8630
|
this.accessService = accessService;
|
|
8231
8631
|
}
|
|
8232
|
-
_create_class$
|
|
8632
|
+
_create_class$a(ModelApiController, [
|
|
8233
8633
|
{
|
|
8234
8634
|
key: "directDispatch",
|
|
8235
8635
|
value: // MARK: Direct Dispatch
|
|
@@ -8243,8 +8643,8 @@ function _ts_generator$8(thisArg, body) {
|
|
|
8243
8643
|
* @param req - The Express request containing auth credentials on `req.auth`.
|
|
8244
8644
|
* @returns The result of the dispatched model call.
|
|
8245
8645
|
*/ function directDispatch(body, req) {
|
|
8246
|
-
return _async_to_generator$
|
|
8247
|
-
return _ts_generator$
|
|
8646
|
+
return _async_to_generator$a(function() {
|
|
8647
|
+
return _ts_generator$a(this, function(_state) {
|
|
8248
8648
|
return [
|
|
8249
8649
|
2,
|
|
8250
8650
|
this._dispatch(body, req)
|
|
@@ -8268,9 +8668,9 @@ function _ts_generator$8(thisArg, body) {
|
|
|
8268
8668
|
* @param req - The Express request containing auth credentials on `req.auth`.
|
|
8269
8669
|
* @returns The document data for the requested model key.
|
|
8270
8670
|
*/ function getOne(modelType, key, req) {
|
|
8271
|
-
return _async_to_generator$
|
|
8671
|
+
return _async_to_generator$a(function() {
|
|
8272
8672
|
var auth, error;
|
|
8273
|
-
return _ts_generator$
|
|
8673
|
+
return _ts_generator$a(this, function(_state) {
|
|
8274
8674
|
switch(_state.label){
|
|
8275
8675
|
case 0:
|
|
8276
8676
|
if (!key) {
|
|
@@ -8324,9 +8724,9 @@ function _ts_generator$8(thisArg, body) {
|
|
|
8324
8724
|
* @param req - The Express request containing auth credentials on `req.auth`.
|
|
8325
8725
|
* @returns An object with `results` (document data array) and `errors` (per-key failures).
|
|
8326
8726
|
*/ function getMany(modelType, body, req) {
|
|
8327
|
-
return _async_to_generator$
|
|
8727
|
+
return _async_to_generator$a(function() {
|
|
8328
8728
|
var keys, auth, error;
|
|
8329
|
-
return _ts_generator$
|
|
8729
|
+
return _ts_generator$a(this, function(_state) {
|
|
8330
8730
|
switch(_state.label){
|
|
8331
8731
|
case 0:
|
|
8332
8732
|
keys = body.keys;
|
|
@@ -8389,9 +8789,9 @@ function _ts_generator$8(thisArg, body) {
|
|
|
8389
8789
|
* @param req - The Express request whose path segments encode modelType, call, and optional specifier.
|
|
8390
8790
|
* @returns The result of the dispatched model call.
|
|
8391
8791
|
*/ function handleDispatchRequest(req) {
|
|
8392
|
-
return _async_to_generator$
|
|
8792
|
+
return _async_to_generator$a(function() {
|
|
8393
8793
|
var _this__parsePath, modelType, call, specifier, params;
|
|
8394
|
-
return _ts_generator$
|
|
8794
|
+
return _ts_generator$a(this, function(_state) {
|
|
8395
8795
|
if (!ALLOWED_DISPATCH_METHODS.has(req.method)) {
|
|
8396
8796
|
throw new HttpException({
|
|
8397
8797
|
statusCode: 405,
|
|
@@ -8464,9 +8864,9 @@ function _ts_generator$8(thisArg, body) {
|
|
|
8464
8864
|
{
|
|
8465
8865
|
key: "_dispatch",
|
|
8466
8866
|
value: function _dispatch(params, req) {
|
|
8467
|
-
return _async_to_generator$
|
|
8867
|
+
return _async_to_generator$a(function() {
|
|
8468
8868
|
var auth, error;
|
|
8469
|
-
return _ts_generator$
|
|
8869
|
+
return _ts_generator$a(this, function(_state) {
|
|
8470
8870
|
switch(_state.label){
|
|
8471
8871
|
case 0:
|
|
8472
8872
|
auth = req.auth;
|
|
@@ -8503,7 +8903,7 @@ function _ts_generator$8(thisArg, body) {
|
|
|
8503
8903
|
key: "_toHttpException",
|
|
8504
8904
|
value: function _toHttpException(error) {
|
|
8505
8905
|
var result;
|
|
8506
|
-
if (_instanceof$
|
|
8906
|
+
if (_instanceof$2(error, HttpException)) {
|
|
8507
8907
|
result = error;
|
|
8508
8908
|
} else {
|
|
8509
8909
|
var _ref, _ref1, _ref2;
|
|
@@ -8549,15 +8949,15 @@ ModelApiController = __decorate([
|
|
|
8549
8949
|
__param(1, Inject(ModelApiGetService))
|
|
8550
8950
|
], ModelApiController);
|
|
8551
8951
|
|
|
8552
|
-
function _array_like_to_array$
|
|
8952
|
+
function _array_like_to_array$9(arr, len) {
|
|
8553
8953
|
if (len == null || len > arr.length) len = arr.length;
|
|
8554
8954
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
8555
8955
|
return arr2;
|
|
8556
8956
|
}
|
|
8557
|
-
function _array_without_holes$
|
|
8558
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
8957
|
+
function _array_without_holes$7(arr) {
|
|
8958
|
+
if (Array.isArray(arr)) return _array_like_to_array$9(arr);
|
|
8559
8959
|
}
|
|
8560
|
-
function _define_property$
|
|
8960
|
+
function _define_property$m(obj, key, value) {
|
|
8561
8961
|
if (key in obj) {
|
|
8562
8962
|
Object.defineProperty(obj, key, {
|
|
8563
8963
|
value: value,
|
|
@@ -8570,13 +8970,13 @@ function _define_property$j(obj, key, value) {
|
|
|
8570
8970
|
}
|
|
8571
8971
|
return obj;
|
|
8572
8972
|
}
|
|
8573
|
-
function _iterable_to_array$
|
|
8973
|
+
function _iterable_to_array$7(iter) {
|
|
8574
8974
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
8575
8975
|
}
|
|
8576
|
-
function _non_iterable_spread$
|
|
8976
|
+
function _non_iterable_spread$7() {
|
|
8577
8977
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
8578
8978
|
}
|
|
8579
|
-
function _object_spread$
|
|
8979
|
+
function _object_spread$c(target) {
|
|
8580
8980
|
for(var i = 1; i < arguments.length; i++){
|
|
8581
8981
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
8582
8982
|
var ownKeys = Object.keys(source);
|
|
@@ -8586,21 +8986,21 @@ function _object_spread$b(target) {
|
|
|
8586
8986
|
}));
|
|
8587
8987
|
}
|
|
8588
8988
|
ownKeys.forEach(function(key) {
|
|
8589
|
-
_define_property$
|
|
8989
|
+
_define_property$m(target, key, source[key]);
|
|
8590
8990
|
});
|
|
8591
8991
|
}
|
|
8592
8992
|
return target;
|
|
8593
8993
|
}
|
|
8594
|
-
function _to_consumable_array$
|
|
8595
|
-
return _array_without_holes$
|
|
8994
|
+
function _to_consumable_array$7(arr) {
|
|
8995
|
+
return _array_without_holes$7(arr) || _iterable_to_array$7(arr) || _unsupported_iterable_to_array$9(arr) || _non_iterable_spread$7();
|
|
8596
8996
|
}
|
|
8597
|
-
function _unsupported_iterable_to_array$
|
|
8997
|
+
function _unsupported_iterable_to_array$9(o, minLen) {
|
|
8598
8998
|
if (!o) return;
|
|
8599
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
8999
|
+
if (typeof o === "string") return _array_like_to_array$9(o, minLen);
|
|
8600
9000
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
8601
9001
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
8602
9002
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
8603
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
9003
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$9(o, minLen);
|
|
8604
9004
|
}
|
|
8605
9005
|
// MARK: Module Metadata
|
|
8606
9006
|
/**
|
|
@@ -8625,14 +9025,14 @@ function _unsupported_iterable_to_array$7(o, minLen) {
|
|
|
8625
9025
|
return {
|
|
8626
9026
|
imports: [
|
|
8627
9027
|
dependencyModule
|
|
8628
|
-
].concat(_to_consumable_array$
|
|
9028
|
+
].concat(_to_consumable_array$7(imports !== null && imports !== void 0 ? imports : [])),
|
|
8629
9029
|
controllers: [
|
|
8630
9030
|
ModelApiController
|
|
8631
9031
|
],
|
|
8632
9032
|
exports: [
|
|
8633
9033
|
ModelApiGetService,
|
|
8634
9034
|
ModelApiCallModelDispatchService
|
|
8635
|
-
].concat(_to_consumable_array$
|
|
9035
|
+
].concat(_to_consumable_array$7(exports !== null && exports !== void 0 ? exports : [])),
|
|
8636
9036
|
providers: [
|
|
8637
9037
|
ModelApiGetService,
|
|
8638
9038
|
ModelApiCallModelDispatchService,
|
|
@@ -8644,7 +9044,7 @@ function _unsupported_iterable_to_array$7(o, minLen) {
|
|
|
8644
9044
|
// a full app-level context where all providers (e.g., server actions) are resolvable.
|
|
8645
9045
|
return {
|
|
8646
9046
|
get: function get(typeOrToken, options) {
|
|
8647
|
-
return moduleRef.get(typeOrToken, _object_spread$
|
|
9047
|
+
return moduleRef.get(typeOrToken, _object_spread$c({
|
|
8648
9048
|
strict: false
|
|
8649
9049
|
}, options));
|
|
8650
9050
|
}
|
|
@@ -8654,6 +9054,810 @@ function _unsupported_iterable_to_array$7(o, minLen) {
|
|
|
8654
9054
|
ModuleRef
|
|
8655
9055
|
]
|
|
8656
9056
|
}
|
|
9057
|
+
].concat(_to_consumable_array$7(providers !== null && providers !== void 0 ? providers : []))
|
|
9058
|
+
};
|
|
9059
|
+
}
|
|
9060
|
+
|
|
9061
|
+
function _class_call_check$f(instance, Constructor) {
|
|
9062
|
+
if (!(instance instanceof Constructor)) {
|
|
9063
|
+
throw new TypeError("Cannot call a class as a function");
|
|
9064
|
+
}
|
|
9065
|
+
}
|
|
9066
|
+
function _define_property$l(obj, key, value) {
|
|
9067
|
+
if (key in obj) {
|
|
9068
|
+
Object.defineProperty(obj, key, {
|
|
9069
|
+
value: value,
|
|
9070
|
+
enumerable: true,
|
|
9071
|
+
configurable: true,
|
|
9072
|
+
writable: true
|
|
9073
|
+
});
|
|
9074
|
+
} else {
|
|
9075
|
+
obj[key] = value;
|
|
9076
|
+
}
|
|
9077
|
+
return obj;
|
|
9078
|
+
}
|
|
9079
|
+
// MARK: Paths
|
|
9080
|
+
/**
|
|
9081
|
+
* Route prefix the session API controller is mounted at. Under the `/api` global route prefix the
|
|
9082
|
+
* routes become `/api/session/*`.
|
|
9083
|
+
*/ var SESSION_API_ROUTE_PREFIX = 'session';
|
|
9084
|
+
/**
|
|
9085
|
+
* Path (relative to the API base URL) of the direct-Firestore session endpoint.
|
|
9086
|
+
*
|
|
9087
|
+
* The `@dereekb/dbx-cli` client posts to `<apiBaseUrl>${FIRESTORE_SESSION_API_PATH}`.
|
|
9088
|
+
*/ var FIRESTORE_SESSION_API_PATH = '/session/firestore';
|
|
9089
|
+
/**
|
|
9090
|
+
* Path prefix apps must add to their OIDC `protectedPaths` so the bearer-token middleware
|
|
9091
|
+
* authenticates the session endpoint (today typically `['/api/model', '/mcp']`).
|
|
9092
|
+
*
|
|
9093
|
+
* Without this the endpoint is reachable unauthenticated — `req.auth` would be `undefined` and the
|
|
9094
|
+
* request rejected as unauthenticated, but the gate belongs at the middleware, not the handler.
|
|
9095
|
+
*/ var FIREBASE_SERVER_SESSION_API_PROTECTED_PATH = '/api/session';
|
|
9096
|
+
// MARK: TTL
|
|
9097
|
+
/**
|
|
9098
|
+
* Default lifetime requested for the minted App Check token. Matches the Admin SDK's own default.
|
|
9099
|
+
*/ var DEFAULT_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS = 60 * 60 * 1000;
|
|
9100
|
+
/**
|
|
9101
|
+
* Minimum lifetime the Admin SDK accepts for an App Check token (30 minutes).
|
|
9102
|
+
*/ var MIN_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS = 30 * 60 * 1000;
|
|
9103
|
+
/**
|
|
9104
|
+
* Maximum lifetime the Admin SDK accepts for an App Check token (7 days).
|
|
9105
|
+
*
|
|
9106
|
+
* Deliberately NOT the default: this endpoint mints a valid web-app App Check attestation for
|
|
9107
|
+
* whoever calls it, so the shortest workable lifetime is the right one.
|
|
9108
|
+
*/ var MAX_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS = 7 * 24 * 60 * 60 * 1000;
|
|
9109
|
+
/**
|
|
9110
|
+
* Window a Firebase Auth custom token may be exchanged for an ID token within (1 hour, fixed by
|
|
9111
|
+
* Firebase). The exchanged ID token then lives its own hour from sign-in.
|
|
9112
|
+
*/ var FIREBASE_CUSTOM_TOKEN_EXCHANGE_WINDOW_MILLIS = 60 * 60 * 1000;
|
|
9113
|
+
/**
|
|
9114
|
+
* NestJS injection token for the {@link FirestoreSessionAdminPredicate} provider.
|
|
9115
|
+
*/ var FIRESTORE_SESSION_ADMIN_PREDICATE = 'FIRESTORE_SESSION_ADMIN_PREDICATE';
|
|
9116
|
+
// MARK: Config
|
|
9117
|
+
/**
|
|
9118
|
+
* Optional configuration for the session API module, supplied by the app via its dependency module.
|
|
9119
|
+
*
|
|
9120
|
+
* Everything here is optional — with no config provided the endpoint still mints custom tokens, just
|
|
9121
|
+
* without an App Check attestation (correct for a project that does not enforce App Check, and for
|
|
9122
|
+
* emulator-backed local development).
|
|
9123
|
+
*/ var SessionApiModuleConfig = function SessionApiModuleConfig() {
|
|
9124
|
+
_class_call_check$f(this, SessionApiModuleConfig);
|
|
9125
|
+
/**
|
|
9126
|
+
* The Firebase `appId` of the registered **web** app to mint App Check tokens for. This is the same
|
|
9127
|
+
* `appId` the browser client initializes with — the attestation must match an app the project's
|
|
9128
|
+
* App Check enforcement recognizes.
|
|
9129
|
+
*
|
|
9130
|
+
* When unset, no App Check token is minted and the response's `appCheckToken` is omitted.
|
|
9131
|
+
*/ _define_property$l(this, "appCheckAppId", void 0);
|
|
9132
|
+
/**
|
|
9133
|
+
* Lifetime to request for the minted App Check token. Clamped to
|
|
9134
|
+
* [{@link MIN_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS}, {@link MAX_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS}].
|
|
9135
|
+
*
|
|
9136
|
+
* Defaults to {@link DEFAULT_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS}.
|
|
9137
|
+
*/ _define_property$l(this, "appCheckTokenTtlMillis", void 0);
|
|
9138
|
+
/**
|
|
9139
|
+
* OIDC scope term an OIDC caller must hold to open a session. Defaults to
|
|
9140
|
+
* {@link FIRESTORE_SESSION_OIDC_SCOPE}. Pass `null` to disable scope enforcement entirely (the admin
|
|
9141
|
+
* predicate remains the real gate either way).
|
|
9142
|
+
*/ _define_property$l(this, "requiredScope", void 0);
|
|
9143
|
+
};
|
|
9144
|
+
/**
|
|
9145
|
+
* Resolves the effective App Check TTL from the module config, clamped to the Admin SDK's accepted range.
|
|
9146
|
+
*
|
|
9147
|
+
* @param ttlMillis - The configured TTL, or `undefined` to use the default.
|
|
9148
|
+
* @returns The TTL to request, in milliseconds.
|
|
9149
|
+
* @__NO_SIDE_EFFECTS__
|
|
9150
|
+
*/ function firestoreSessionAppCheckTtlMillis(ttlMillis) {
|
|
9151
|
+
var requested = ttlMillis !== null && ttlMillis !== void 0 ? ttlMillis : DEFAULT_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS;
|
|
9152
|
+
return Math.min(Math.max(requested, MIN_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS), MAX_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS);
|
|
9153
|
+
}
|
|
9154
|
+
/**
|
|
9155
|
+
* The default {@link SessionApiModuleConfig.requiredScope}, re-exported for apps that want to widen it
|
|
9156
|
+
* into an OR-group rather than replace it.
|
|
9157
|
+
*/ var DEFAULT_FIRESTORE_SESSION_REQUIRED_OIDC_SCOPE = FIRESTORE_SESSION_OIDC_SCOPE;
|
|
9158
|
+
|
|
9159
|
+
function _array_like_to_array$8(arr, len) {
|
|
9160
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
9161
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
9162
|
+
return arr2;
|
|
9163
|
+
}
|
|
9164
|
+
function _array_without_holes$6(arr) {
|
|
9165
|
+
if (Array.isArray(arr)) return _array_like_to_array$8(arr);
|
|
9166
|
+
}
|
|
9167
|
+
function asyncGeneratorStep$9(gen, resolve, reject, _next, _throw, key, arg) {
|
|
9168
|
+
try {
|
|
9169
|
+
var info = gen[key](arg);
|
|
9170
|
+
var value = info.value;
|
|
9171
|
+
} catch (error) {
|
|
9172
|
+
reject(error);
|
|
9173
|
+
return;
|
|
9174
|
+
}
|
|
9175
|
+
if (info.done) {
|
|
9176
|
+
resolve(value);
|
|
9177
|
+
} else {
|
|
9178
|
+
Promise.resolve(value).then(_next, _throw);
|
|
9179
|
+
}
|
|
9180
|
+
}
|
|
9181
|
+
function _async_to_generator$9(fn) {
|
|
9182
|
+
return function() {
|
|
9183
|
+
var self = this, args = arguments;
|
|
9184
|
+
return new Promise(function(resolve, reject) {
|
|
9185
|
+
var gen = fn.apply(self, args);
|
|
9186
|
+
function _next(value) {
|
|
9187
|
+
asyncGeneratorStep$9(gen, resolve, reject, _next, _throw, "next", value);
|
|
9188
|
+
}
|
|
9189
|
+
function _throw(err) {
|
|
9190
|
+
asyncGeneratorStep$9(gen, resolve, reject, _next, _throw, "throw", err);
|
|
9191
|
+
}
|
|
9192
|
+
_next(undefined);
|
|
9193
|
+
});
|
|
9194
|
+
};
|
|
9195
|
+
}
|
|
9196
|
+
function _class_call_check$e(instance, Constructor) {
|
|
9197
|
+
if (!(instance instanceof Constructor)) {
|
|
9198
|
+
throw new TypeError("Cannot call a class as a function");
|
|
9199
|
+
}
|
|
9200
|
+
}
|
|
9201
|
+
function _defineProperties$9(target, props) {
|
|
9202
|
+
for(var i = 0; i < props.length; i++){
|
|
9203
|
+
var descriptor = props[i];
|
|
9204
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
9205
|
+
descriptor.configurable = true;
|
|
9206
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
9207
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
9208
|
+
}
|
|
9209
|
+
}
|
|
9210
|
+
function _create_class$9(Constructor, protoProps, staticProps) {
|
|
9211
|
+
if (protoProps) _defineProperties$9(Constructor.prototype, protoProps);
|
|
9212
|
+
return Constructor;
|
|
9213
|
+
}
|
|
9214
|
+
function _define_property$k(obj, key, value) {
|
|
9215
|
+
if (key in obj) {
|
|
9216
|
+
Object.defineProperty(obj, key, {
|
|
9217
|
+
value: value,
|
|
9218
|
+
enumerable: true,
|
|
9219
|
+
configurable: true,
|
|
9220
|
+
writable: true
|
|
9221
|
+
});
|
|
9222
|
+
} else {
|
|
9223
|
+
obj[key] = value;
|
|
9224
|
+
}
|
|
9225
|
+
return obj;
|
|
9226
|
+
}
|
|
9227
|
+
function _iterable_to_array$6(iter) {
|
|
9228
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
9229
|
+
}
|
|
9230
|
+
function _non_iterable_spread$6() {
|
|
9231
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
9232
|
+
}
|
|
9233
|
+
function _object_spread$b(target) {
|
|
9234
|
+
for(var i = 1; i < arguments.length; i++){
|
|
9235
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
9236
|
+
var ownKeys = Object.keys(source);
|
|
9237
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
9238
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
9239
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
9240
|
+
}));
|
|
9241
|
+
}
|
|
9242
|
+
ownKeys.forEach(function(key) {
|
|
9243
|
+
_define_property$k(target, key, source[key]);
|
|
9244
|
+
});
|
|
9245
|
+
}
|
|
9246
|
+
return target;
|
|
9247
|
+
}
|
|
9248
|
+
function ownKeys$9(object, enumerableOnly) {
|
|
9249
|
+
var keys = Object.keys(object);
|
|
9250
|
+
if (Object.getOwnPropertySymbols) {
|
|
9251
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
9252
|
+
keys.push.apply(keys, symbols);
|
|
9253
|
+
}
|
|
9254
|
+
return keys;
|
|
9255
|
+
}
|
|
9256
|
+
function _object_spread_props$9(target, source) {
|
|
9257
|
+
source = source != null ? source : {};
|
|
9258
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
9259
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
9260
|
+
} else {
|
|
9261
|
+
ownKeys$9(Object(source)).forEach(function(key) {
|
|
9262
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
9263
|
+
});
|
|
9264
|
+
}
|
|
9265
|
+
return target;
|
|
9266
|
+
}
|
|
9267
|
+
function _to_consumable_array$6(arr) {
|
|
9268
|
+
return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$8(arr) || _non_iterable_spread$6();
|
|
9269
|
+
}
|
|
9270
|
+
function _unsupported_iterable_to_array$8(o, minLen) {
|
|
9271
|
+
if (!o) return;
|
|
9272
|
+
if (typeof o === "string") return _array_like_to_array$8(o, minLen);
|
|
9273
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
9274
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
9275
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
9276
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
|
|
9277
|
+
}
|
|
9278
|
+
function _ts_generator$9(thisArg, body) {
|
|
9279
|
+
var f, y, t, _ = {
|
|
9280
|
+
label: 0,
|
|
9281
|
+
sent: function() {
|
|
9282
|
+
if (t[0] & 1) throw t[1];
|
|
9283
|
+
return t[1];
|
|
9284
|
+
},
|
|
9285
|
+
trys: [],
|
|
9286
|
+
ops: []
|
|
9287
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
9288
|
+
return d(g, "next", {
|
|
9289
|
+
value: verb(0)
|
|
9290
|
+
}), d(g, "throw", {
|
|
9291
|
+
value: verb(1)
|
|
9292
|
+
}), d(g, "return", {
|
|
9293
|
+
value: verb(2)
|
|
9294
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
9295
|
+
value: function() {
|
|
9296
|
+
return this;
|
|
9297
|
+
}
|
|
9298
|
+
}), g;
|
|
9299
|
+
function verb(n) {
|
|
9300
|
+
return function(v) {
|
|
9301
|
+
return step([
|
|
9302
|
+
n,
|
|
9303
|
+
v
|
|
9304
|
+
]);
|
|
9305
|
+
};
|
|
9306
|
+
}
|
|
9307
|
+
function step(op) {
|
|
9308
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
9309
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
9310
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
9311
|
+
if (y = 0, t) op = [
|
|
9312
|
+
op[0] & 2,
|
|
9313
|
+
t.value
|
|
9314
|
+
];
|
|
9315
|
+
switch(op[0]){
|
|
9316
|
+
case 0:
|
|
9317
|
+
case 1:
|
|
9318
|
+
t = op;
|
|
9319
|
+
break;
|
|
9320
|
+
case 4:
|
|
9321
|
+
_.label++;
|
|
9322
|
+
return {
|
|
9323
|
+
value: op[1],
|
|
9324
|
+
done: false
|
|
9325
|
+
};
|
|
9326
|
+
case 5:
|
|
9327
|
+
_.label++;
|
|
9328
|
+
y = op[1];
|
|
9329
|
+
op = [
|
|
9330
|
+
0
|
|
9331
|
+
];
|
|
9332
|
+
continue;
|
|
9333
|
+
case 7:
|
|
9334
|
+
op = _.ops.pop();
|
|
9335
|
+
_.trys.pop();
|
|
9336
|
+
continue;
|
|
9337
|
+
default:
|
|
9338
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
9339
|
+
_ = 0;
|
|
9340
|
+
continue;
|
|
9341
|
+
}
|
|
9342
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
9343
|
+
_.label = op[1];
|
|
9344
|
+
break;
|
|
9345
|
+
}
|
|
9346
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
9347
|
+
_.label = t[1];
|
|
9348
|
+
t = op;
|
|
9349
|
+
break;
|
|
9350
|
+
}
|
|
9351
|
+
if (t && _.label < t[2]) {
|
|
9352
|
+
_.label = t[2];
|
|
9353
|
+
_.ops.push(op);
|
|
9354
|
+
break;
|
|
9355
|
+
}
|
|
9356
|
+
if (t[2]) _.ops.pop();
|
|
9357
|
+
_.trys.pop();
|
|
9358
|
+
continue;
|
|
9359
|
+
}
|
|
9360
|
+
op = body.call(thisArg, _);
|
|
9361
|
+
} catch (e) {
|
|
9362
|
+
op = [
|
|
9363
|
+
6,
|
|
9364
|
+
e
|
|
9365
|
+
];
|
|
9366
|
+
y = 0;
|
|
9367
|
+
} finally{
|
|
9368
|
+
f = t = 0;
|
|
9369
|
+
}
|
|
9370
|
+
if (op[0] & 5) throw op[1];
|
|
9371
|
+
return {
|
|
9372
|
+
value: op[0] ? op[1] : void 0,
|
|
9373
|
+
done: true
|
|
9374
|
+
};
|
|
9375
|
+
}
|
|
9376
|
+
}
|
|
9377
|
+
var FirestoreSessionApiService_1;
|
|
9378
|
+
/**
|
|
9379
|
+
* Error code thrown when the caller is not authorized to open a direct-Firestore session.
|
|
9380
|
+
*/ var FIRESTORE_SESSION_FORBIDDEN_ERROR_CODE = 'FIRESTORE_SESSION_FORBIDDEN_ERROR';
|
|
9381
|
+
/**
|
|
9382
|
+
* Mints the direct-Firestore session credential bundle returned by `SessionApiController`.
|
|
9383
|
+
*
|
|
9384
|
+
* ## Security
|
|
9385
|
+
*
|
|
9386
|
+
* This service hands out a valid web-app App Check token and a custom token for the caller's own uid.
|
|
9387
|
+
* Two gates apply, in order:
|
|
9388
|
+
*
|
|
9389
|
+
* 1. The app-supplied {@link FirestoreSessionAdminPredicate} — the load-bearing check. **Fails closed**
|
|
9390
|
+
* when the app provides no predicate.
|
|
9391
|
+
* 2. The OIDC scope requirement (default {@link FIRESTORE_SESSION_OIDC_SCOPE}) — defence in depth only.
|
|
9392
|
+
* It cannot stand alone: a non-OIDC caller carries no `scope` claim and every enforcement site in
|
|
9393
|
+
* this codebase treats that as "skip".
|
|
9394
|
+
*
|
|
9395
|
+
* The custom token is ALWAYS minted for `auth.uid`; there is no way to ask for someone else's session,
|
|
9396
|
+
* so a granted session is exactly as privileged as the caller already is under Firestore rules.
|
|
9397
|
+
*/ var FirestoreSessionApiService = FirestoreSessionApiService_1 = /*#__PURE__*/ function() {
|
|
9398
|
+
function FirestoreSessionApiService(app, config, adminPredicate) {
|
|
9399
|
+
_class_call_check$e(this, FirestoreSessionApiService);
|
|
9400
|
+
_define_property$k(this, "_logger", new Logger(FirestoreSessionApiService_1.name));
|
|
9401
|
+
_define_property$k(this, "_app", void 0);
|
|
9402
|
+
_define_property$k(this, "_config", void 0);
|
|
9403
|
+
_define_property$k(this, "_adminPredicate", void 0);
|
|
9404
|
+
this._app = app;
|
|
9405
|
+
this._config = config;
|
|
9406
|
+
this._adminPredicate = adminPredicate;
|
|
9407
|
+
if (!adminPredicate) {
|
|
9408
|
+
this._logger.warn("No ".concat(FIRESTORE_SESSION_ADMIN_PREDICATE, " provided — ").concat(FIRESTORE_SESSION_API_PATH, " will reject every caller. Provide one from the session module's dependency module."));
|
|
9409
|
+
}
|
|
9410
|
+
if (!(config === null || config === void 0 ? void 0 : config.appCheckAppId)) {
|
|
9411
|
+
this._logger.warn("No SessionApiModuleConfig.appCheckAppId configured — ".concat(FIRESTORE_SESSION_API_PATH, " will issue sessions without an App Check attestation. Direct Firestore access will be rejected wherever App Check is enforced."));
|
|
9412
|
+
}
|
|
9413
|
+
}
|
|
9414
|
+
_create_class$9(FirestoreSessionApiService, [
|
|
9415
|
+
{
|
|
9416
|
+
key: "createFirestoreSession",
|
|
9417
|
+
value: /**
|
|
9418
|
+
* Mints a direct-Firestore session for the calling user after enforcing the admin predicate and the
|
|
9419
|
+
* OIDC scope requirement.
|
|
9420
|
+
*
|
|
9421
|
+
* @param auth - The authenticated request's auth data (`req.auth`).
|
|
9422
|
+
* @returns The credential bundle the client needs to connect to Firestore as this user.
|
|
9423
|
+
* @throws {HttpsError} A `401` when the request carries no uid, or a `403` when either gate rejects the caller.
|
|
9424
|
+
*/ function createFirestoreSession(auth) {
|
|
9425
|
+
return _async_to_generator$9(function() {
|
|
9426
|
+
var _Math, _this__config, _this__config1, uid, isAllowed, _tmp, configuredScope, now, customToken, appCheckToken, appCheckTtlMillis, appCheckAppId, _created_ttlMillis, _this__config2, ttlMillis, created, expiresAtMillis;
|
|
9427
|
+
return _ts_generator$9(this, function(_state) {
|
|
9428
|
+
switch(_state.label){
|
|
9429
|
+
case 0:
|
|
9430
|
+
uid = auth === null || auth === void 0 ? void 0 : auth.uid;
|
|
9431
|
+
if (!uid) {
|
|
9432
|
+
throw unauthenticatedError({
|
|
9433
|
+
message: 'A direct-Firestore session requires an authenticated caller.'
|
|
9434
|
+
});
|
|
9435
|
+
}
|
|
9436
|
+
if (!this._adminPredicate) return [
|
|
9437
|
+
3,
|
|
9438
|
+
2
|
|
9439
|
+
];
|
|
9440
|
+
return [
|
|
9441
|
+
4,
|
|
9442
|
+
this._adminPredicate(auth)
|
|
9443
|
+
];
|
|
9444
|
+
case 1:
|
|
9445
|
+
_tmp = _state.sent();
|
|
9446
|
+
return [
|
|
9447
|
+
3,
|
|
9448
|
+
3
|
|
9449
|
+
];
|
|
9450
|
+
case 2:
|
|
9451
|
+
_tmp = false;
|
|
9452
|
+
_state.label = 3;
|
|
9453
|
+
case 3:
|
|
9454
|
+
isAllowed = _tmp;
|
|
9455
|
+
if (!isAllowed) {
|
|
9456
|
+
throw forbiddenError({
|
|
9457
|
+
status: 403,
|
|
9458
|
+
code: FIRESTORE_SESSION_FORBIDDEN_ERROR_CODE,
|
|
9459
|
+
message: 'Not authorized to open a direct-Firestore session.'
|
|
9460
|
+
});
|
|
9461
|
+
}
|
|
9462
|
+
// an explicit `null` disables scope enforcement; only an ABSENT value falls back to the default
|
|
9463
|
+
configuredScope = (_this__config = this._config) === null || _this__config === void 0 ? void 0 : _this__config.requiredScope;
|
|
9464
|
+
assertEndpointOidcScope({
|
|
9465
|
+
requiredScope: configuredScope === undefined ? DEFAULT_FIRESTORE_SESSION_REQUIRED_OIDC_SCOPE : configuredScope,
|
|
9466
|
+
grantedScopes: oidcScopesFromRequestAuth(auth),
|
|
9467
|
+
endpoint: FIRESTORE_SESSION_API_PATH
|
|
9468
|
+
});
|
|
9469
|
+
now = Date.now();
|
|
9470
|
+
return [
|
|
9471
|
+
4,
|
|
9472
|
+
this._app.auth().createCustomToken(uid)
|
|
9473
|
+
];
|
|
9474
|
+
case 4:
|
|
9475
|
+
customToken = _state.sent();
|
|
9476
|
+
appCheckAppId = (_this__config1 = this._config) === null || _this__config1 === void 0 ? void 0 : _this__config1.appCheckAppId;
|
|
9477
|
+
if (!appCheckAppId) return [
|
|
9478
|
+
3,
|
|
9479
|
+
6
|
|
9480
|
+
];
|
|
9481
|
+
ttlMillis = firestoreSessionAppCheckTtlMillis((_this__config2 = this._config) === null || _this__config2 === void 0 ? void 0 : _this__config2.appCheckTokenTtlMillis);
|
|
9482
|
+
return [
|
|
9483
|
+
4,
|
|
9484
|
+
this._app.appCheck().createToken(appCheckAppId, {
|
|
9485
|
+
ttlMillis: ttlMillis
|
|
9486
|
+
})
|
|
9487
|
+
];
|
|
9488
|
+
case 5:
|
|
9489
|
+
created = _state.sent();
|
|
9490
|
+
appCheckToken = created.token;
|
|
9491
|
+
appCheckTtlMillis = (_created_ttlMillis = created.ttlMillis) !== null && _created_ttlMillis !== void 0 ? _created_ttlMillis : ttlMillis;
|
|
9492
|
+
_state.label = 6;
|
|
9493
|
+
case 6:
|
|
9494
|
+
// the session lives only as long as its shortest-lived credential
|
|
9495
|
+
expiresAtMillis = (_Math = Math).min.apply(_Math, [
|
|
9496
|
+
now + FIREBASE_CUSTOM_TOKEN_EXCHANGE_WINDOW_MILLIS
|
|
9497
|
+
].concat(_to_consumable_array$6(appCheckTtlMillis == null ? [] : [
|
|
9498
|
+
now + appCheckTtlMillis
|
|
9499
|
+
])));
|
|
9500
|
+
return [
|
|
9501
|
+
2,
|
|
9502
|
+
_object_spread_props$9(_object_spread$b({
|
|
9503
|
+
uid: uid,
|
|
9504
|
+
customToken: customToken
|
|
9505
|
+
}, appCheckToken ? {
|
|
9506
|
+
appCheckToken: appCheckToken
|
|
9507
|
+
} : undefined), {
|
|
9508
|
+
expiresAt: new Date(expiresAtMillis).toISOString()
|
|
9509
|
+
})
|
|
9510
|
+
];
|
|
9511
|
+
}
|
|
9512
|
+
});
|
|
9513
|
+
}).call(this);
|
|
9514
|
+
}
|
|
9515
|
+
}
|
|
9516
|
+
]);
|
|
9517
|
+
return FirestoreSessionApiService;
|
|
9518
|
+
}();
|
|
9519
|
+
FirestoreSessionApiService = FirestoreSessionApiService_1 = __decorate([
|
|
9520
|
+
Injectable(),
|
|
9521
|
+
__param(0, Inject(FIREBASE_APP_TOKEN)),
|
|
9522
|
+
__param(1, Optional()),
|
|
9523
|
+
__param(1, Inject(SessionApiModuleConfig)),
|
|
9524
|
+
__param(2, Optional()),
|
|
9525
|
+
__param(2, Inject(FIRESTORE_SESSION_ADMIN_PREDICATE))
|
|
9526
|
+
], FirestoreSessionApiService);
|
|
9527
|
+
|
|
9528
|
+
function asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, key, arg) {
|
|
9529
|
+
try {
|
|
9530
|
+
var info = gen[key](arg);
|
|
9531
|
+
var value = info.value;
|
|
9532
|
+
} catch (error) {
|
|
9533
|
+
reject(error);
|
|
9534
|
+
return;
|
|
9535
|
+
}
|
|
9536
|
+
if (info.done) {
|
|
9537
|
+
resolve(value);
|
|
9538
|
+
} else {
|
|
9539
|
+
Promise.resolve(value).then(_next, _throw);
|
|
9540
|
+
}
|
|
9541
|
+
}
|
|
9542
|
+
function _async_to_generator$8(fn) {
|
|
9543
|
+
return function() {
|
|
9544
|
+
var self = this, args = arguments;
|
|
9545
|
+
return new Promise(function(resolve, reject) {
|
|
9546
|
+
var gen = fn.apply(self, args);
|
|
9547
|
+
function _next(value) {
|
|
9548
|
+
asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, "next", value);
|
|
9549
|
+
}
|
|
9550
|
+
function _throw(err) {
|
|
9551
|
+
asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, "throw", err);
|
|
9552
|
+
}
|
|
9553
|
+
_next(undefined);
|
|
9554
|
+
});
|
|
9555
|
+
};
|
|
9556
|
+
}
|
|
9557
|
+
function _class_call_check$d(instance, Constructor) {
|
|
9558
|
+
if (!(instance instanceof Constructor)) {
|
|
9559
|
+
throw new TypeError("Cannot call a class as a function");
|
|
9560
|
+
}
|
|
9561
|
+
}
|
|
9562
|
+
function _defineProperties$8(target, props) {
|
|
9563
|
+
for(var i = 0; i < props.length; i++){
|
|
9564
|
+
var descriptor = props[i];
|
|
9565
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
9566
|
+
descriptor.configurable = true;
|
|
9567
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
9568
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
9569
|
+
}
|
|
9570
|
+
}
|
|
9571
|
+
function _create_class$8(Constructor, protoProps, staticProps) {
|
|
9572
|
+
if (protoProps) _defineProperties$8(Constructor.prototype, protoProps);
|
|
9573
|
+
return Constructor;
|
|
9574
|
+
}
|
|
9575
|
+
function _define_property$j(obj, key, value) {
|
|
9576
|
+
if (key in obj) {
|
|
9577
|
+
Object.defineProperty(obj, key, {
|
|
9578
|
+
value: value,
|
|
9579
|
+
enumerable: true,
|
|
9580
|
+
configurable: true,
|
|
9581
|
+
writable: true
|
|
9582
|
+
});
|
|
9583
|
+
} else {
|
|
9584
|
+
obj[key] = value;
|
|
9585
|
+
}
|
|
9586
|
+
return obj;
|
|
9587
|
+
}
|
|
9588
|
+
function _instanceof$1(left, right) {
|
|
9589
|
+
"@swc/helpers - instanceof";
|
|
9590
|
+
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
9591
|
+
return !!right[Symbol.hasInstance](left);
|
|
9592
|
+
} else {
|
|
9593
|
+
return left instanceof right;
|
|
9594
|
+
}
|
|
9595
|
+
}
|
|
9596
|
+
function _ts_generator$8(thisArg, body) {
|
|
9597
|
+
var f, y, t, _ = {
|
|
9598
|
+
label: 0,
|
|
9599
|
+
sent: function() {
|
|
9600
|
+
if (t[0] & 1) throw t[1];
|
|
9601
|
+
return t[1];
|
|
9602
|
+
},
|
|
9603
|
+
trys: [],
|
|
9604
|
+
ops: []
|
|
9605
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
9606
|
+
return d(g, "next", {
|
|
9607
|
+
value: verb(0)
|
|
9608
|
+
}), d(g, "throw", {
|
|
9609
|
+
value: verb(1)
|
|
9610
|
+
}), d(g, "return", {
|
|
9611
|
+
value: verb(2)
|
|
9612
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
9613
|
+
value: function() {
|
|
9614
|
+
return this;
|
|
9615
|
+
}
|
|
9616
|
+
}), g;
|
|
9617
|
+
function verb(n) {
|
|
9618
|
+
return function(v) {
|
|
9619
|
+
return step([
|
|
9620
|
+
n,
|
|
9621
|
+
v
|
|
9622
|
+
]);
|
|
9623
|
+
};
|
|
9624
|
+
}
|
|
9625
|
+
function step(op) {
|
|
9626
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
9627
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
9628
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
9629
|
+
if (y = 0, t) op = [
|
|
9630
|
+
op[0] & 2,
|
|
9631
|
+
t.value
|
|
9632
|
+
];
|
|
9633
|
+
switch(op[0]){
|
|
9634
|
+
case 0:
|
|
9635
|
+
case 1:
|
|
9636
|
+
t = op;
|
|
9637
|
+
break;
|
|
9638
|
+
case 4:
|
|
9639
|
+
_.label++;
|
|
9640
|
+
return {
|
|
9641
|
+
value: op[1],
|
|
9642
|
+
done: false
|
|
9643
|
+
};
|
|
9644
|
+
case 5:
|
|
9645
|
+
_.label++;
|
|
9646
|
+
y = op[1];
|
|
9647
|
+
op = [
|
|
9648
|
+
0
|
|
9649
|
+
];
|
|
9650
|
+
continue;
|
|
9651
|
+
case 7:
|
|
9652
|
+
op = _.ops.pop();
|
|
9653
|
+
_.trys.pop();
|
|
9654
|
+
continue;
|
|
9655
|
+
default:
|
|
9656
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
9657
|
+
_ = 0;
|
|
9658
|
+
continue;
|
|
9659
|
+
}
|
|
9660
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
9661
|
+
_.label = op[1];
|
|
9662
|
+
break;
|
|
9663
|
+
}
|
|
9664
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
9665
|
+
_.label = t[1];
|
|
9666
|
+
t = op;
|
|
9667
|
+
break;
|
|
9668
|
+
}
|
|
9669
|
+
if (t && _.label < t[2]) {
|
|
9670
|
+
_.label = t[2];
|
|
9671
|
+
_.ops.push(op);
|
|
9672
|
+
break;
|
|
9673
|
+
}
|
|
9674
|
+
if (t[2]) _.ops.pop();
|
|
9675
|
+
_.trys.pop();
|
|
9676
|
+
continue;
|
|
9677
|
+
}
|
|
9678
|
+
op = body.call(thisArg, _);
|
|
9679
|
+
} catch (e) {
|
|
9680
|
+
op = [
|
|
9681
|
+
6,
|
|
9682
|
+
e
|
|
9683
|
+
];
|
|
9684
|
+
y = 0;
|
|
9685
|
+
} finally{
|
|
9686
|
+
f = t = 0;
|
|
9687
|
+
}
|
|
9688
|
+
if (op[0] & 5) throw op[1];
|
|
9689
|
+
return {
|
|
9690
|
+
value: op[0] ? op[1] : void 0,
|
|
9691
|
+
done: true
|
|
9692
|
+
};
|
|
9693
|
+
}
|
|
9694
|
+
}
|
|
9695
|
+
/**
|
|
9696
|
+
* REST controller that hands an authenticated admin caller the credentials needed to talk to
|
|
9697
|
+
* Firestore directly, rather than only through the model HTTP API.
|
|
9698
|
+
*
|
|
9699
|
+
* Mounted at `session` — under the `/api` global prefix the route becomes `GET /api/session/firestore`.
|
|
9700
|
+
*
|
|
9701
|
+
* Auth comes from the global OIDC bearer middleware, so `'/api/session'` MUST be listed in the OIDC
|
|
9702
|
+
* module's `protectedPaths` (see `FIREBASE_SERVER_SESSION_API_PROTECTED_PATH`). Follows `McpController`:
|
|
9703
|
+
* there are no NestJS guards in this codebase — protection is path-prefix middleware plus the
|
|
9704
|
+
* per-endpoint checks in {@link FirestoreSessionApiService}.
|
|
9705
|
+
*/ var SessionApiController = /*#__PURE__*/ function() {
|
|
9706
|
+
function SessionApiController(sessionService) {
|
|
9707
|
+
_class_call_check$d(this, SessionApiController);
|
|
9708
|
+
_define_property$j(this, "sessionService", void 0);
|
|
9709
|
+
this.sessionService = sessionService;
|
|
9710
|
+
}
|
|
9711
|
+
_create_class$8(SessionApiController, [
|
|
9712
|
+
{
|
|
9713
|
+
key: "getFirestoreSession",
|
|
9714
|
+
value: /**
|
|
9715
|
+
* Mints a short-lived Firebase Auth custom token (+ App Check attestation, when configured) for the
|
|
9716
|
+
* calling user.
|
|
9717
|
+
*
|
|
9718
|
+
* @param req - The Express request carrying auth credentials on `req.auth`.
|
|
9719
|
+
* @returns The {@link FirestoreSessionResult} credential bundle.
|
|
9720
|
+
*/ function getFirestoreSession(req) {
|
|
9721
|
+
return _async_to_generator$8(function() {
|
|
9722
|
+
var auth, error;
|
|
9723
|
+
return _ts_generator$8(this, function(_state) {
|
|
9724
|
+
switch(_state.label){
|
|
9725
|
+
case 0:
|
|
9726
|
+
auth = req.auth;
|
|
9727
|
+
_state.label = 1;
|
|
9728
|
+
case 1:
|
|
9729
|
+
_state.trys.push([
|
|
9730
|
+
1,
|
|
9731
|
+
3,
|
|
9732
|
+
,
|
|
9733
|
+
4
|
|
9734
|
+
]);
|
|
9735
|
+
return [
|
|
9736
|
+
4,
|
|
9737
|
+
this.sessionService.createFirestoreSession(auth)
|
|
9738
|
+
];
|
|
9739
|
+
case 2:
|
|
9740
|
+
return [
|
|
9741
|
+
2,
|
|
9742
|
+
_state.sent()
|
|
9743
|
+
];
|
|
9744
|
+
case 3:
|
|
9745
|
+
error = _state.sent();
|
|
9746
|
+
throw this._toHttpException(error);
|
|
9747
|
+
case 4:
|
|
9748
|
+
return [
|
|
9749
|
+
2
|
|
9750
|
+
];
|
|
9751
|
+
}
|
|
9752
|
+
});
|
|
9753
|
+
}).call(this);
|
|
9754
|
+
}
|
|
9755
|
+
},
|
|
9756
|
+
{
|
|
9757
|
+
key: "_toHttpException",
|
|
9758
|
+
value: function _toHttpException(error) {
|
|
9759
|
+
var result;
|
|
9760
|
+
if (_instanceof$1(error, HttpException)) {
|
|
9761
|
+
result = error;
|
|
9762
|
+
} else {
|
|
9763
|
+
var _ref, _ref1, _ref2, _ref3;
|
|
9764
|
+
var _error_httpErrorCode, _error_details;
|
|
9765
|
+
var status = (_ref = (_ref1 = error === null || error === void 0 ? void 0 : error.status) !== null && _ref1 !== void 0 ? _ref1 : error === null || error === void 0 ? void 0 : (_error_httpErrorCode = error.httpErrorCode) === null || _error_httpErrorCode === void 0 ? void 0 : _error_httpErrorCode.status) !== null && _ref !== void 0 ? _ref : HttpStatus.INTERNAL_SERVER_ERROR;
|
|
9766
|
+
var message = (_ref2 = error === null || error === void 0 ? void 0 : error.message) !== null && _ref2 !== void 0 ? _ref2 : 'Internal server error';
|
|
9767
|
+
// `forbiddenError`/`unauthenticatedError` build an HttpsError whose top-level `code` is the
|
|
9768
|
+
// coarse functions code ('permission-denied'), with the specific one under `details`. Prefer
|
|
9769
|
+
// the specific code so a client can tell FIRESTORE_SESSION_FORBIDDEN_ERROR (not an admin) apart
|
|
9770
|
+
// from MISSING_ENDPOINT_OIDC_SCOPE_ERROR (admin, but the token lacks `session.firestore`).
|
|
9771
|
+
var code = (_ref3 = error === null || error === void 0 ? void 0 : (_error_details = error.details) === null || _error_details === void 0 ? void 0 : _error_details.code) !== null && _ref3 !== void 0 ? _ref3 : error === null || error === void 0 ? void 0 : error.code;
|
|
9772
|
+
result = new HttpException({
|
|
9773
|
+
statusCode: status,
|
|
9774
|
+
message: message,
|
|
9775
|
+
code: code
|
|
9776
|
+
}, status);
|
|
9777
|
+
}
|
|
9778
|
+
return result;
|
|
9779
|
+
}
|
|
9780
|
+
}
|
|
9781
|
+
]);
|
|
9782
|
+
return SessionApiController;
|
|
9783
|
+
}();
|
|
9784
|
+
__decorate([
|
|
9785
|
+
Get('firestore'),
|
|
9786
|
+
__param(0, Req())
|
|
9787
|
+
], SessionApiController.prototype, "getFirestoreSession", null);
|
|
9788
|
+
SessionApiController = __decorate([
|
|
9789
|
+
Controller(SESSION_API_ROUTE_PREFIX),
|
|
9790
|
+
__param(0, Inject(FirestoreSessionApiService))
|
|
9791
|
+
], SessionApiController);
|
|
9792
|
+
|
|
9793
|
+
function _array_like_to_array$7(arr, len) {
|
|
9794
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
9795
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
9796
|
+
return arr2;
|
|
9797
|
+
}
|
|
9798
|
+
function _array_without_holes$5(arr) {
|
|
9799
|
+
if (Array.isArray(arr)) return _array_like_to_array$7(arr);
|
|
9800
|
+
}
|
|
9801
|
+
function _iterable_to_array$5(iter) {
|
|
9802
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
9803
|
+
}
|
|
9804
|
+
function _non_iterable_spread$5() {
|
|
9805
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
9806
|
+
}
|
|
9807
|
+
function _to_consumable_array$5(arr) {
|
|
9808
|
+
return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_spread$5();
|
|
9809
|
+
}
|
|
9810
|
+
function _unsupported_iterable_to_array$7(o, minLen) {
|
|
9811
|
+
if (!o) return;
|
|
9812
|
+
if (typeof o === "string") return _array_like_to_array$7(o, minLen);
|
|
9813
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
9814
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
9815
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
9816
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
|
|
9817
|
+
}
|
|
9818
|
+
// MARK: Module Metadata
|
|
9819
|
+
/**
|
|
9820
|
+
* Generates NestJS module metadata for the direct-Firestore session API.
|
|
9821
|
+
*
|
|
9822
|
+
* Mirrors the convention used by `modelApiModuleMetadata` and `mcpModuleMetadata`: the consumer
|
|
9823
|
+
* provides a dependency module exposing the required tokens, and this factory wires the controller +
|
|
9824
|
+
* service.
|
|
9825
|
+
*
|
|
9826
|
+
* Remember to add `FIREBASE_SERVER_SESSION_API_PROTECTED_PATH` (`'/api/session'`) to the OIDC module's
|
|
9827
|
+
* `protectedPaths` — the controller relies on the bearer middleware having populated `req.auth`.
|
|
9828
|
+
*
|
|
9829
|
+
* @param metadataConfig - Configuration including the dependency module.
|
|
9830
|
+
* @returns NestJS module metadata exposing the session controller + service.
|
|
9831
|
+
*
|
|
9832
|
+
* @example
|
|
9833
|
+
* ```typescript
|
|
9834
|
+
* @Module({
|
|
9835
|
+
* imports: [DemoApiAuthModule],
|
|
9836
|
+
* providers: [
|
|
9837
|
+
* { provide: SessionApiModuleConfig, useValue: { appCheckAppId: environment.firebase.appId } },
|
|
9838
|
+
* { provide: FIRESTORE_SESSION_ADMIN_PREDICATE, useValue: (auth) => DEMO_AUTH_CLAIMS_SERVICE.toRoles(auth?.token ?? {}).has('admin') }
|
|
9839
|
+
* ],
|
|
9840
|
+
* exports: [SessionApiModuleConfig, FIRESTORE_SESSION_ADMIN_PREDICATE]
|
|
9841
|
+
* })
|
|
9842
|
+
* export class DemoSessionApiDependencyModule {}
|
|
9843
|
+
*
|
|
9844
|
+
* @Module(sessionApiModuleMetadata({ dependencyModule: DemoSessionApiDependencyModule }))
|
|
9845
|
+
* export class DemoSessionApiModule {}
|
|
9846
|
+
* ```
|
|
9847
|
+
*/ function sessionApiModuleMetadata(metadataConfig) {
|
|
9848
|
+
var dependencyModule = metadataConfig.dependencyModule, imports = metadataConfig.imports, exports = metadataConfig.exports, providers = metadataConfig.providers;
|
|
9849
|
+
return {
|
|
9850
|
+
imports: [
|
|
9851
|
+
dependencyModule
|
|
9852
|
+
].concat(_to_consumable_array$5(imports !== null && imports !== void 0 ? imports : [])),
|
|
9853
|
+
controllers: [
|
|
9854
|
+
SessionApiController
|
|
9855
|
+
],
|
|
9856
|
+
exports: [
|
|
9857
|
+
FirestoreSessionApiService
|
|
9858
|
+
].concat(_to_consumable_array$5(exports !== null && exports !== void 0 ? exports : [])),
|
|
9859
|
+
providers: [
|
|
9860
|
+
FirestoreSessionApiService
|
|
8657
9861
|
].concat(_to_consumable_array$5(providers !== null && providers !== void 0 ? providers : []))
|
|
8658
9862
|
};
|
|
8659
9863
|
}
|
|
@@ -11563,7 +12767,7 @@ function _ts_generator$2(thisArg, body) {
|
|
|
11563
12767
|
return x[0];
|
|
11564
12768
|
}).catch(function(e) {
|
|
11565
12769
|
var publicUrlBackup;
|
|
11566
|
-
if (_instanceof(e, Error) && e.name === 'SigningError' && (isTestNodeEnv() || process.env
|
|
12770
|
+
if (_instanceof(e, Error) && e.name === 'SigningError' && (isTestNodeEnv() || process.env['FIREBASE_STORAGE_EMULATOR_HOST'])) {
|
|
11567
12771
|
// NOTE: Signing does not behave properly in the emulator as it is not supported.
|
|
11568
12772
|
// https://github.com/firebase/firebase-tools/issues/3400
|
|
11569
12773
|
// we can return the public url instead.
|
|
@@ -13275,4 +14479,4 @@ function _define_property(obj, key, value) {
|
|
|
13275
14479
|
}
|
|
13276
14480
|
();
|
|
13277
14481
|
|
|
13278
|
-
export { AbstractFirebaseNestContext, AbstractFirebaseServerActionsContext, AbstractFirebaseServerAuthContext, AbstractFirebaseServerAuthService, AbstractFirebaseServerAuthUserContext, AbstractFirebaseServerNewUserService, AbstractFirebaseServerUserPasswordResetService, AbstractNestContext, AbstractServerFirebaseNestContext, ConfigureFirebaseAppCheckMiddlewareModule, ConfigureFirebaseWebhookMiddlewareModule, DEFAULT_FIREBASE_PASSWORD_NUMBER_GENERATOR, DEFAULT_RESET_CODE_EXPIRES_IN, DEFAULT_RESET_COM_THROTTLE_TIME, DEFAULT_SERVER_ASSETS_BASE_PATH, DEFAULT_SETUP_COM_THROTTLE_TIME, DefaultFirebaseServerEnvService, FIREBASE_APP_TOKEN, FIREBASE_AUTH_TOKEN, FIREBASE_FIRESTORE_CONTEXT_TOKEN, FIREBASE_FIRESTORE_TOKEN, FIREBASE_SERVER_ENV_TOKEN, FIREBASE_SERVER_VALIDATION_ERROR_CODE, FIREBASE_STORAGE_CONTEXT_FACTORY_CONFIG_TOKEN, FIREBASE_STORAGE_CONTEXT_TOKEN, FIREBASE_STORAGE_TOKEN, FIRESTORE_CLIENT_QUERY_CONSTRAINT_HANDLER_MAPPING, FirebaseAppCheckMiddleware, FirebaseAppCheckMiddlewareConfig, FirebaseNestServerRootModule, FirebaseRawBodyMiddleware, FirebaseServerAnalyticsSegmentListenerService, FirebaseServerAnalyticsSegmentModule, FirebaseServerAnalyticsService, FirebaseServerAnalyticsServiceListener, FirebaseServerAuthModule, FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError, FirebaseServerAuthNewUserSendSetupDetailsSendOnceError, FirebaseServerAuthNewUserSendSetupDetailsThrottleError, FirebaseServerAuthPasswordResetInvalidCodeError, FirebaseServerAuthPasswordResetNoResetConfigError, FirebaseServerAuthPasswordResetSendOnceError, FirebaseServerAuthPasswordResetThrottleError, FirebaseServerAuthService, FirebaseServerAuthUserBadInputError, FirebaseServerAuthUserExistsError, FirebaseServerEnvService, FirebaseServerFirestoreContextModule, FirebaseServerFirestoreModule, FirebaseServerStorageContextModule, FirebaseServerStorageModule, FirebaseServerStorageService, GlobalRoutePrefixConfig, MAX_MODEL_ACCESS_MULTI_READ_KEYS, MODEL_API_NEST_APPLICATION_CONTEXT, ModelApiCallModelDispatchService, ModelApiController, ModelApiDispatchConfig, ModelApiGetService, NO_RUN_NAME_SPECIFIED_FOR_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_CODE, NoContentFirebaseServerUserPasswordResetService, NoSetupContentFirebaseServerNewUserService, ON_CALL_MODEL_ANALYTICS_HANDLER, ON_CALL_MODEL_ANALYTICS_SERVICE, OnCallModelAnalyticsService, PHONE_NUMBER_ALREADY_EXISTS_ERROR_CODE, SkipAppCheck, UNKNOWN_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_NAME_CODE, UNKNOWN_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_TYPE_CODE, _onCallWithCallTypeFunction, aggregateCrudModelApiDetails, aggregateModelApiDetails, aggregateSpecifierApiDetails, alreadyExistsError, appAnalyticsModuleMetadata, appFirestoreModuleMetadata, assertContextHasAuth, assertDocumentExists, assertHasRolesInRequest, assertHasSignedTosInRequest, assertIsAdminInRequest, assertIsAdminOrTargetUserInRequestData, assertIsContextWithAuthData, assertModelApiOidcScope, assertRequestRequiresAuthForFunction, assertSnapshotData, assertSnapshotDataWithKey, authServicePasswordResetInvalidCodeError, authServicePasswordResetNoConfigError, authServicePasswordResetSendOnceError, authServicePasswordResetThrottleError, badRequestError, blockingFunctionHandlerWithNestContextFactory, buildNestServerRootModule, callWithAnalytics, catchAndThrowPasswordResetServerErrors, cloudEventHandlerWithNestContextFactory, collectionRefForPath, createModelUnknownModelTypeError, decodeFirebaseServerUserPasswordResetOobCode, defaultFirebaseServerActionsTransformFactoryLogErrorFunction, defaultProvideFirebaseServerStorageServiceSimple, deleteModelUnknownModelTypeError, developmentUnknownSpecifierError, docRefForPath, documentModelNotAvailableError, encodeFirebaseServerUserPasswordResetOobCode, executeOnCallQuery, firebaseAuthTokenFromDecodedIdToken, firebaseServerActionsContext, firebaseServerActionsTransformContext, firebaseServerActionsTransformFactory, firebaseServerAppTokenProvider, firebaseServerAuthModuleMetadata, firebaseServerDevFunctions, firebaseServerEnvTokenProvider, firebaseServerEnvTokenProviders, firebaseServerErrorInfo, firebaseServerErrorInfoCodePair, firebaseServerErrorInfoServerErrorCodePair, firebaseServerErrorInfoServerErrorPair, firebaseServerFirestoreContextModuleMetadata, firebaseServerStorageDefaultBucketIdTokenProvider, firebaseServerStorageModuleMetadata, firebaseServerValidationError, firebaseServerValidationServerError, firestoreClientQueryConstraintFunctionsDriver, firestoreEncryptedField, firestoreServerIncrementUpdateToUpdateData, forbiddenError, getAuthUserOrUndefined, getModelApiDetails, googleCloudFileMetadataToStorageMetadata, googleCloudFirebaseStorageContextFactory, googleCloudFirebaseStorageDrivers, googleCloudFirestoreAccessorDriver, googleCloudFirestoreContextFactory, googleCloudFirestoreDrivers, googleCloudFirestoreQueryDriver, googleCloudStorageAccessorFile, googleCloudStorageAccessorFolder, googleCloudStorageBucketForStorageFilePath, googleCloudStorageFileForStorageFilePath, googleCloudStorageFirebaseStorageAccessorDriver, googleCloudStorageFromFirebaseAdminStorage, googleCloudStorageListFilesResultFactory, handleFirebaseAuthError, handleFirebaseError, hasAuthRolesInRequest, hasNewUserSetupPasswordInRequest, hasSignedTosInRequest, inAuthContext, injectNestApplicationContextIntoRequest, injectNestIntoRequest, internalServerError, invokeModelUnknownModelTypeError, isActualSpecifier, isAdminInRequest, isAdminOrTargetUserInRequestData, isContextWithAuthData, isFirebaseError, isFirebaseHttpsError, isOnCallCrudModelApiDetails, isOnCallHandlerApiDetails, isOnCallModelTypeApiDetails, isOnCallSpecifierApiDetails, makeBlockingFunctionWithHandler, makeOnScheduleHandlerWithNestApplicationRequest, makeScheduledFunctionDevelopmentFunction, modelAccessReadErrorFromUseMultipleModelsFailure, modelApiModuleMetadata, modelNotAvailableError, nestAppHasDevelopmentSchedulerEnabled, nestAppIsProductionEnvironment, nestFirebaseDoesNotExistError, nestFirebaseForbiddenPermissionError, nestServerInstance, noRunNameSpecifiedForScheduledFunctionDevelopmentFunction, noopFirebaseServerAnalyticsServiceListener, noopOnCallModelAnalyticsService, notFoundError, oidcScopesFromModelApiAuth, onCallAnalyticsEmitterInstance, onCallCreateModel, onCallDeleteModel, onCallDevelopmentFunction, onCallHandlerWithNestApplicationFactory, onCallHandlerWithNestContextFactory, onCallInvokeModel, onCallModel, onCallModelMissingCallTypeError, onCallModelUnknownCallTypeError, onCallQueryModel, onCallReadModel, onCallSpecifierHandler, onCallUpdateModel, onScheduleHandlerWithNestApplicationFactory, onScheduleHandlerWithNestContextFactory, optionalAuthContext, optionalFirestoreEncryptedField, permissionDeniedError, phoneNumberAlreadyExistsError, preconditionConflictError, provideAppFirestoreCollections, provideFirebaseServerAuthService, provideFirebaseServerStorageService, queryModelBadCursorError, queryModelUnknownModelTypeError, readApiDetails, readModelUnknownModelTypeError, resolveAdminOnlyValue, resolveAnalyticsFromApiDetails, resolveRequiredScopeFromApiDetails, setNestContextOnRequest, setNestContextOnScheduleRequest, taskQueueFunctionHandlerWithNestContextFactory, unauthenticatedContextHasNoAuthData, unauthenticatedContextHasNoUidError, unauthenticatedError, unavailableError, unavailableOrDeactivatedFunctionError, unknownModelCrudFunctionSpecifierError, unknownScheduledFunctionDevelopmentFunctionName, unknownScheduledFunctionDevelopmentFunctionType, updateModelUnknownModelTypeError, userContextFromUid, verifyAppCheckInRequest, withApiDetails };
|
|
14482
|
+
export { AbstractFirebaseNestContext, AbstractFirebaseServerActionsContext, AbstractFirebaseServerAuthContext, AbstractFirebaseServerAuthService, AbstractFirebaseServerAuthUserContext, AbstractFirebaseServerNewUserService, AbstractFirebaseServerUserPasswordResetService, AbstractNestContext, AbstractServerFirebaseNestContext, ConfigureFirebaseAppCheckMiddlewareModule, ConfigureFirebaseWebhookMiddlewareModule, DEFAULT_FIREBASE_PASSWORD_NUMBER_GENERATOR, DEFAULT_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS, DEFAULT_FIRESTORE_SESSION_REQUIRED_OIDC_SCOPE, DEFAULT_RESET_CODE_EXPIRES_IN, DEFAULT_RESET_COM_THROTTLE_TIME, DEFAULT_SERVER_ASSETS_BASE_PATH, DEFAULT_SETUP_COM_THROTTLE_TIME, DefaultFirebaseServerEnvService, FIREBASE_APP_TOKEN, FIREBASE_AUTH_TOKEN, FIREBASE_CUSTOM_TOKEN_EXCHANGE_WINDOW_MILLIS, FIREBASE_FIRESTORE_CONTEXT_TOKEN, FIREBASE_FIRESTORE_TOKEN, FIREBASE_SERVER_ENV_TOKEN, FIREBASE_SERVER_SESSION_API_PROTECTED_PATH, FIREBASE_SERVER_VALIDATION_ERROR_CODE, FIREBASE_STORAGE_CONTEXT_FACTORY_CONFIG_TOKEN, FIREBASE_STORAGE_CONTEXT_TOKEN, FIREBASE_STORAGE_TOKEN, FIRESTORE_CLIENT_QUERY_CONSTRAINT_HANDLER_MAPPING, FIRESTORE_SESSION_ADMIN_PREDICATE, FIRESTORE_SESSION_API_PATH, FIRESTORE_SESSION_FORBIDDEN_ERROR_CODE, FirebaseAppCheckMiddleware, FirebaseAppCheckMiddlewareConfig, FirebaseNestServerRootModule, FirebaseRawBodyMiddleware, FirebaseServerAnalyticsSegmentListenerService, FirebaseServerAnalyticsSegmentModule, FirebaseServerAnalyticsService, FirebaseServerAnalyticsServiceListener, FirebaseServerAuthModule, FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError, FirebaseServerAuthNewUserSendSetupDetailsSendOnceError, FirebaseServerAuthNewUserSendSetupDetailsThrottleError, FirebaseServerAuthPasswordResetInvalidCodeError, FirebaseServerAuthPasswordResetNoResetConfigError, FirebaseServerAuthPasswordResetSendOnceError, FirebaseServerAuthPasswordResetThrottleError, FirebaseServerAuthService, FirebaseServerAuthUserBadInputError, FirebaseServerAuthUserExistsError, FirebaseServerEnvService, FirebaseServerFirestoreContextModule, FirebaseServerFirestoreModule, FirebaseServerStorageContextModule, FirebaseServerStorageModule, FirebaseServerStorageService, FirestoreSessionApiService, GlobalRoutePrefixConfig, MAX_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS, MAX_MODEL_ACCESS_MULTI_READ_KEYS, MIN_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS, MISSING_ENDPOINT_OIDC_SCOPE_ERROR_CODE, MODEL_API_NEST_APPLICATION_CONTEXT, MODEL_IS_SERVER_ONLY_ERROR_CODE, ModelApiCallModelDispatchService, ModelApiController, ModelApiDispatchConfig, ModelApiGetService, NO_RUN_NAME_SPECIFIED_FOR_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_CODE, NoContentFirebaseServerUserPasswordResetService, NoSetupContentFirebaseServerNewUserService, ON_CALL_MODEL_ANALYTICS_HANDLER, ON_CALL_MODEL_ANALYTICS_SERVICE, OnCallModelAnalyticsService, PHONE_NUMBER_ALREADY_EXISTS_ERROR_CODE, SESSION_API_ROUTE_PREFIX, SessionApiController, SessionApiModuleConfig, SkipAppCheck, UNKNOWN_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_NAME_CODE, UNKNOWN_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_TYPE_CODE, _onCallWithCallTypeFunction, aggregateCrudModelApiDetails, aggregateModelApiDetails, aggregateSpecifierApiDetails, alreadyExistsError, appAnalyticsModuleMetadata, appFirestoreModuleMetadata, assertContextHasAuth, assertDocumentExists, assertEndpointOidcScope, assertHasRolesInRequest, assertHasSignedTosInRequest, assertIsAdminInRequest, assertIsAdminOrTargetUserInRequestData, assertIsContextWithAuthData, assertModelApiOidcScope, assertRequestRequiresAuthForFunction, assertSnapshotData, assertSnapshotDataWithKey, authServicePasswordResetInvalidCodeError, authServicePasswordResetNoConfigError, authServicePasswordResetSendOnceError, authServicePasswordResetThrottleError, badRequestError, blockingFunctionHandlerWithNestContextFactory, buildNestServerRootModule, callWithAnalytics, catchAndThrowPasswordResetServerErrors, cloudEventHandlerWithNestContextFactory, collectionRefForPath, createModelUnknownModelTypeError, decodeFirebaseServerUserPasswordResetOobCode, defaultFirebaseServerActionsTransformFactoryLogErrorFunction, defaultProvideFirebaseServerStorageServiceSimple, deleteModelUnknownModelTypeError, developmentUnknownSpecifierError, docRefForPath, documentModelNotAvailableError, encodeFirebaseServerUserPasswordResetOobCode, executeOnCallQuery, firebaseAuthTokenFromDecodedIdToken, firebaseServerActionsContext, firebaseServerActionsTransformContext, firebaseServerActionsTransformFactory, firebaseServerAppTokenProvider, firebaseServerAuthModuleMetadata, firebaseServerDevFunctions, firebaseServerEnvTokenProvider, firebaseServerEnvTokenProviders, firebaseServerErrorInfo, firebaseServerErrorInfoCodePair, firebaseServerErrorInfoServerErrorCodePair, firebaseServerErrorInfoServerErrorPair, firebaseServerFirestoreContextModuleMetadata, firebaseServerStorageDefaultBucketIdTokenProvider, firebaseServerStorageModuleMetadata, firebaseServerValidationError, firebaseServerValidationServerError, firestoreClientQueryConstraintFunctionsDriver, firestoreEncryptedField, firestoreServerIncrementUpdateToUpdateData, firestoreSessionAppCheckTtlMillis, forbiddenError, getAuthUserOrUndefined, getModelApiDetails, googleCloudFileMetadataToStorageMetadata, googleCloudFirebaseStorageContextFactory, googleCloudFirebaseStorageDrivers, googleCloudFirestoreAccessorDriver, googleCloudFirestoreContextFactory, googleCloudFirestoreDrivers, googleCloudFirestoreQueryDriver, googleCloudStorageAccessorFile, googleCloudStorageAccessorFolder, googleCloudStorageBucketForStorageFilePath, googleCloudStorageFileForStorageFilePath, googleCloudStorageFirebaseStorageAccessorDriver, googleCloudStorageFromFirebaseAdminStorage, googleCloudStorageListFilesResultFactory, handleFirebaseAuthError, handleFirebaseError, hasAuthRolesInRequest, hasNewUserSetupPasswordInRequest, hasSignedTosInRequest, inAuthContext, injectNestApplicationContextIntoRequest, injectNestIntoRequest, internalServerError, invokeModelUnknownModelTypeError, isActualSpecifier, isAdminInRequest, isAdminOrTargetUserInRequestData, isContextWithAuthData, isFirebaseError, isFirebaseHttpsError, isOnCallCrudModelApiDetails, isOnCallHandlerApiDetails, isOnCallModelTypeApiDetails, isOnCallSpecifierApiDetails, makeBlockingFunctionWithHandler, makeOnScheduleHandlerWithNestApplicationRequest, makeScheduledFunctionDevelopmentFunction, modelAccessReadErrorFromUseMultipleModelsFailure, modelAccessRoleMapResultFromGrantedRoles, modelApiModuleMetadata, modelNotAvailableError, nestAppHasDevelopmentSchedulerEnabled, nestAppIsProductionEnvironment, nestFirebaseDoesNotExistError, nestFirebaseForbiddenPermissionError, nestServerInstance, noRunNameSpecifiedForScheduledFunctionDevelopmentFunction, noopFirebaseServerAnalyticsServiceListener, noopOnCallModelAnalyticsService, notFoundError, oidcScopesFromModelApiAuth, oidcScopesFromRequestAuth, onCallAnalyticsEmitterInstance, onCallCreateModel, onCallDeleteModel, onCallDevelopmentFunction, onCallHandlerWithNestApplicationFactory, onCallHandlerWithNestContextFactory, onCallInvokeModel, onCallModel, onCallModelMissingCallTypeError, onCallModelUnknownCallTypeError, onCallQueryModel, onCallReadModel, onCallSpecifierHandler, onCallUpdateModel, onScheduleHandlerWithNestApplicationFactory, onScheduleHandlerWithNestContextFactory, optionalAuthContext, optionalFirestoreEncryptedField, permissionDeniedError, phoneNumberAlreadyExistsError, preconditionConflictError, provideAppFirestoreCollections, provideFirebaseServerAuthService, provideFirebaseServerStorageService, queryModelBadCursorError, queryModelUnknownModelTypeError, readApiDetails, readModelUnknownModelTypeError, resolveAdminOnlyValue, resolveAnalyticsFromApiDetails, resolveRequiredScopeFromApiDetails, sessionApiModuleMetadata, setNestContextOnRequest, setNestContextOnScheduleRequest, taskQueueFunctionHandlerWithNestContextFactory, unauthenticatedContextHasNoAuthData, unauthenticatedContextHasNoUidError, unauthenticatedError, unavailableError, unavailableOrDeactivatedFunctionError, unknownModelCrudFunctionSpecifierError, unknownScheduledFunctionDevelopmentFunctionName, unknownScheduledFunctionDevelopmentFunctionType, updateModelUnknownModelTypeError, userContextFromUid, verifyAppCheckInRequest, withApiDetails };
|