@dereekb/firebase-server 14.7.0 → 14.9.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.
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@dereekb/firebase-server/calcom",
3
- "version": "14.7.0",
3
+ "version": "14.9.0",
4
4
  "sideEffects": false,
5
5
  "type": "module",
6
6
  "peerDependencies": {
7
- "@dereekb/analytics": "14.7.0",
8
- "@dereekb/calcom": "14.7.0",
9
- "@dereekb/date": "14.7.0",
10
- "@dereekb/firebase": "14.7.0",
11
- "@dereekb/firebase-server": "14.7.0",
12
- "@dereekb/model": "14.7.0",
13
- "@dereekb/nestjs": "14.7.0",
14
- "@dereekb/rxjs": "14.7.0",
15
- "@dereekb/util": "14.7.0",
7
+ "@dereekb/analytics": "14.9.0",
8
+ "@dereekb/calcom": "14.9.0",
9
+ "@dereekb/date": "14.9.0",
10
+ "@dereekb/firebase": "14.9.0",
11
+ "@dereekb/firebase-server": "14.9.0",
12
+ "@dereekb/model": "14.9.0",
13
+ "@dereekb/nestjs": "14.9.0",
14
+ "@dereekb/rxjs": "14.9.0",
15
+ "@dereekb/util": "14.9.0",
16
16
  "@nestjs/common": "^12.0.1",
17
17
  "@nestjs/config": "^12.0.0",
18
18
  "express": "^5.2.1"
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@dereekb/firebase-server/discord",
3
- "version": "14.7.0",
3
+ "version": "14.9.0",
4
4
  "sideEffects": false,
5
5
  "type": "module",
6
6
  "peerDependencies": {
7
- "@dereekb/analytics": "14.7.0",
8
- "@dereekb/date": "14.7.0",
9
- "@dereekb/discord": "14.7.0",
10
- "@dereekb/firebase": "14.7.0",
11
- "@dereekb/firebase-server": "14.7.0",
12
- "@dereekb/model": "14.7.0",
13
- "@dereekb/nestjs": "14.7.0",
14
- "@dereekb/rxjs": "14.7.0",
15
- "@dereekb/util": "14.7.0",
7
+ "@dereekb/analytics": "14.9.0",
8
+ "@dereekb/date": "14.9.0",
9
+ "@dereekb/discord": "14.9.0",
10
+ "@dereekb/firebase": "14.9.0",
11
+ "@dereekb/firebase-server": "14.9.0",
12
+ "@dereekb/model": "14.9.0",
13
+ "@dereekb/nestjs": "14.9.0",
14
+ "@dereekb/rxjs": "14.9.0",
15
+ "@dereekb/util": "14.9.0",
16
16
  "@nestjs/common": "^12.0.1",
17
17
  "@nestjs/config": "^12.0.0",
18
18
  "express": "^5.2.1"
package/index.esm.js CHANGED
@@ -7049,6 +7049,33 @@ FirebaseServerAuthModule = __decorate([
7049
7049
  }
7050
7050
  }
7051
7051
 
7052
+ /**
7053
+ * Access-token `extra` claim carrying the grant's resolved expiry as unix seconds.
7054
+ *
7055
+ * Baked on at issuance (`extraTokenClaims`) and read back by `verifyAccessToken` and the
7056
+ * `GET /oidc/session` route so clients can surface the session lifetime without decoding the token.
7057
+ *
7058
+ * Declared in this core layer (and re-exported by `@dereekb/firebase-server/oidc`) so non-OIDC
7059
+ * endpoints such as the direct-Firestore session can bound what they mint by the caller's own
7060
+ * lifetime without importing the OIDC sub-package.
7061
+ */ var DBX_FIREBASE_SERVER_OIDC_SESSION_EXPIRES_AT_CLAIM = 'dbx_session_expires_at';
7062
+ /**
7063
+ * Reads when the CALLER's own OIDC grant expires, from the {@link DBX_FIREBASE_SERVER_OIDC_SESSION_EXPIRES_AT_CLAIM}
7064
+ * claim baked onto the access token at issuance.
7065
+ *
7066
+ * Returns `undefined` when the claim is absent — a non-OIDC caller (plain Firebase ID token), or a
7067
+ * token issued before the claim existed. Callers must treat that as "no bound", not "expired".
7068
+ *
7069
+ * @param auth - The request auth data, or undefined for unauthenticated requests.
7070
+ * @returns The caller's grant expiry in unix seconds, or `undefined`.
7071
+ */ function oidcSessionExpiresAtFromRequestAuth(auth) {
7072
+ var _ref;
7073
+ var _claims_oidcValidatedToken, _claims_token;
7074
+ var claims = auth !== null && auth !== void 0 ? auth : {};
7075
+ var raw = (_ref = (_claims_oidcValidatedToken = claims.oidcValidatedToken) === null || _claims_oidcValidatedToken === void 0 ? void 0 : _claims_oidcValidatedToken[DBX_FIREBASE_SERVER_OIDC_SESSION_EXPIRES_AT_CLAIM]) !== null && _ref !== void 0 ? _ref : (_claims_token = claims.token) === null || _claims_token === void 0 ? void 0 : _claims_token[DBX_FIREBASE_SERVER_OIDC_SESSION_EXPIRES_AT_CLAIM];
7076
+ return typeof raw === 'number' && Number.isFinite(raw) ? raw : undefined;
7077
+ }
7078
+
7052
7079
  /**
7053
7080
  * Header carrying the originating client address through a proxy chain, as a comma-delimited list
7054
7081
  * whose FIRST entry is the original caller.
@@ -9961,6 +9988,15 @@ function _define_property$l(obj, key, value) {
9961
9988
  * Window a Firebase Auth custom token may be exchanged for an ID token within (1 hour, fixed by
9962
9989
  * Firebase). The exchanged ID token then lives its own hour from sign-in.
9963
9990
  */ var FIREBASE_CUSTOM_TOKEN_EXCHANGE_WINDOW_MILLIS = 60 * 60 * 1000;
9991
+ /**
9992
+ * Default grace allowed below {@link MIN_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS} when checking the
9993
+ * caller's remaining lifetime (2 minutes).
9994
+ *
9995
+ * A session cannot be shorter than that App Check floor, so a caller whose own credential ends sooner
9996
+ * is refused rather than handed a session that outlives it. The leeway covers the unavoidable delay
9997
+ * between minting a credential and using it: a credential minted to last exactly the floor can still
9998
+ * open a session for this long afterwards, and that session outlives it by at most this much.
9999
+ */ var DEFAULT_FIRESTORE_SESSION_CALLER_EXPIRY_LEEWAY_MILLIS = 2 * 60 * 1000;
9964
10000
  /**
9965
10001
  * NestJS injection token for the {@link FirestoreSessionAdminPredicate} provider.
9966
10002
  */ var FIRESTORE_SESSION_ADMIN_PREDICATE = 'FIRESTORE_SESSION_ADMIN_PREDICATE';
@@ -9986,6 +10022,12 @@ function _define_property$l(obj, key, value) {
9986
10022
  *
9987
10023
  * Defaults to {@link DEFAULT_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS}.
9988
10024
  */ _define_property$l(this, "appCheckTokenTtlMillis", void 0);
10025
+ /**
10026
+ * Grace allowed below {@link MIN_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS} when checking an OIDC
10027
+ * caller's remaining lifetime. A caller with less than `floor - leeway` left is refused.
10028
+ *
10029
+ * Defaults to {@link DEFAULT_FIRESTORE_SESSION_CALLER_EXPIRY_LEEWAY_MILLIS}.
10030
+ */ _define_property$l(this, "callerExpiryLeewayMillis", void 0);
9989
10031
  /**
9990
10032
  * OIDC scope term an OIDC caller must hold to open a session. Defaults to
9991
10033
  * {@link FIRESTORE_SESSION_OIDC_SCOPE}. Pass `null` to disable scope enforcement entirely (the admin
@@ -10223,6 +10265,11 @@ var FirestoreSessionApiService_1;
10223
10265
  /**
10224
10266
  * Error code thrown when the caller is not authorized to open a direct-Firestore session.
10225
10267
  */ var FIRESTORE_SESSION_FORBIDDEN_ERROR_CODE = 'FIRESTORE_SESSION_FORBIDDEN_ERROR';
10268
+ /**
10269
+ * Error code thrown when the caller's own OIDC credential expires too soon to back a session — less
10270
+ * than {@link MIN_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS} minus the configured leeway remains. The
10271
+ * client should re-authenticate (or mint a fresh CLI handoff) and try again.
10272
+ */ var FIRESTORE_SESSION_CALLER_EXPIRING_ERROR_CODE = 'FIRESTORE_SESSION_CALLER_EXPIRING_ERROR';
10226
10273
  /**
10227
10274
  * Mints the direct-Firestore session credential bundle returned by `SessionApiController`.
10228
10275
  *
@@ -10239,6 +10286,20 @@ var FirestoreSessionApiService_1;
10239
10286
  *
10240
10287
  * The custom token is ALWAYS minted for `auth.uid`; there is no way to ask for someone else's session,
10241
10288
  * so a granted session is exactly as privileged as the caller already is under Firestore rules.
10289
+ *
10290
+ * ## Lifetime
10291
+ *
10292
+ * A session never outlives the OIDC credential that opened it (read from the caller's
10293
+ * `dbx_session_expires_at` claim): the App Check TTL and the reported `expiresAt` are both capped at
10294
+ * the caller's expiry. The App Check token cannot be shorter than
10295
+ * {@link MIN_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS}, so a caller with less than that floor (minus
10296
+ * {@link SessionApiModuleConfig.callerExpiryLeewayMillis}) remaining is refused with
10297
+ * {@link FIRESTORE_SESSION_CALLER_EXPIRING_ERROR_CODE}. Inside the leeway the attestation may outlive
10298
+ * the caller by at most the leeway.
10299
+ *
10300
+ * The Firebase custom token's one-hour exchange window is fixed by Firebase and cannot be shortened;
10301
+ * the capped `expiresAt` is what stops a well-behaved client from reusing the session past its caller.
10302
+ * A caller with no expiry claim (a non-OIDC Firebase ID token) is not bounded.
10242
10303
  */ var FirestoreSessionApiService = FirestoreSessionApiService_1 = /*#__PURE__*/ function() {
10243
10304
  function FirestoreSessionApiService(app, config, adminPredicate) {
10244
10305
  _class_call_check$e(this, FirestoreSessionApiService);
@@ -10268,7 +10329,7 @@ var FirestoreSessionApiService_1;
10268
10329
  * @throws {HttpsError} A `401` when the request carries no uid, or a `403` when either gate rejects the caller.
10269
10330
  */ function createFirestoreSession(auth) {
10270
10331
  return _async_to_generator$9(function() {
10271
- var _Math, _this__config, _this__config1, uid, isAllowed, _tmp, configuredScope, now, customToken, appCheckToken, appCheckTtlMillis, appCheckAppId, _created_ttlMillis, _this__config2, ttlMillis, created, expiresAtMillis;
10332
+ var _Math, _this__config, _this__config1, uid, isAllowed, _tmp, configuredScope, now, callerExpiresAtSeconds, callerExpiresAtMillis, _ref, _this__config2, leewayMillis, minimumRemainingMillis, remainingMillis, customToken, appCheckToken, appCheckTtlMillis, appCheckAppId, _created_ttlMillis, _this__config3, configuredTtlMillis, ttlMillis, created, expiresAtMillis;
10272
10333
  return _ts_generator$9(this, function(_state) {
10273
10334
  switch(_state.label){
10274
10335
  case 0:
@@ -10312,6 +10373,20 @@ var FirestoreSessionApiService_1;
10312
10373
  endpoint: FIRESTORE_SESSION_API_PATH
10313
10374
  });
10314
10375
  now = Date.now();
10376
+ callerExpiresAtSeconds = oidcSessionExpiresAtFromRequestAuth(auth);
10377
+ callerExpiresAtMillis = callerExpiresAtSeconds == null ? undefined : callerExpiresAtSeconds * 1000;
10378
+ if (callerExpiresAtMillis != null) {
10379
+ leewayMillis = (_ref = (_this__config2 = this._config) === null || _this__config2 === void 0 ? void 0 : _this__config2.callerExpiryLeewayMillis) !== null && _ref !== void 0 ? _ref : DEFAULT_FIRESTORE_SESSION_CALLER_EXPIRY_LEEWAY_MILLIS;
10380
+ minimumRemainingMillis = MIN_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS - leewayMillis;
10381
+ remainingMillis = callerExpiresAtMillis - now;
10382
+ if (remainingMillis < minimumRemainingMillis) {
10383
+ throw forbiddenError({
10384
+ status: 403,
10385
+ code: FIRESTORE_SESSION_CALLER_EXPIRING_ERROR_CODE,
10386
+ message: "The calling credential expires in ".concat(Math.max(0, Math.floor(remainingMillis / 60000)), " minute(s), but a direct-Firestore session needs at least ").concat(Math.ceil(minimumRemainingMillis / 60000), ". Re-authenticate and try again.")
10387
+ });
10388
+ }
10389
+ }
10315
10390
  return [
10316
10391
  4,
10317
10392
  this._app.auth().createCustomToken(uid)
@@ -10323,7 +10398,9 @@ var FirestoreSessionApiService_1;
10323
10398
  3,
10324
10399
  6
10325
10400
  ];
10326
- ttlMillis = firestoreSessionAppCheckTtlMillis((_this__config2 = this._config) === null || _this__config2 === void 0 ? void 0 : _this__config2.appCheckTokenTtlMillis);
10401
+ configuredTtlMillis = firestoreSessionAppCheckTtlMillis((_this__config3 = this._config) === null || _this__config3 === void 0 ? void 0 : _this__config3.appCheckTokenTtlMillis);
10402
+ // never ask for an attestation that outlives the caller; the floor clamp applies inside the leeway
10403
+ ttlMillis = callerExpiresAtMillis == null ? configuredTtlMillis : firestoreSessionAppCheckTtlMillis(Math.min(configuredTtlMillis, callerExpiresAtMillis - now));
10327
10404
  return [
10328
10405
  4,
10329
10406
  this._app.appCheck().createToken(appCheckAppId, {
@@ -10336,11 +10413,13 @@ var FirestoreSessionApiService_1;
10336
10413
  appCheckTtlMillis = (_created_ttlMillis = created.ttlMillis) !== null && _created_ttlMillis !== void 0 ? _created_ttlMillis : ttlMillis;
10337
10414
  _state.label = 6;
10338
10415
  case 6:
10339
- // the session lives only as long as its shortest-lived credential
10416
+ // the session lives only as long as its shortest-lived credential, and never past the caller's own
10340
10417
  expiresAtMillis = (_Math = Math).min.apply(_Math, [
10341
10418
  now + FIREBASE_CUSTOM_TOKEN_EXCHANGE_WINDOW_MILLIS
10342
10419
  ].concat(_to_consumable_array$6(appCheckTtlMillis == null ? [] : [
10343
10420
  now + appCheckTtlMillis
10421
+ ]), _to_consumable_array$6(callerExpiresAtMillis == null ? [] : [
10422
+ callerExpiresAtMillis
10344
10423
  ])));
10345
10424
  return [
10346
10425
  2,
@@ -15209,4 +15288,4 @@ function _define_property(obj, key, value) {
15209
15288
  }
15210
15289
  ();
15211
15290
 
15212
- export { AbstractFirebaseNestContext, AbstractFirebaseServerActionsContext, AbstractFirebaseServerAuthContext, AbstractFirebaseServerAuthService, AbstractFirebaseServerAuthUserContext, AbstractFirebaseServerNewUserService, AbstractFirebaseServerUserPasswordResetService, AbstractNestContext, AbstractServerFirebaseNestContext, ConfigureFirebaseAppCheckMiddlewareModule, ConfigureFirebaseWebhookMiddlewareModule, DEFAULT_DOWNLOAD_CONTENT_TYPE, DEFAULT_DOWNLOAD_TOKEN_TTL_SECONDS, 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_SECURE_ASSETS_DIRECTORY, DEFAULT_SERVER_ASSETS_BASE_PATH, DEFAULT_SETUP_COM_THROTTLE_TIME, DOWNLOAD_API_ASSET_QUERY_PARAM, DOWNLOAD_API_PATH, DOWNLOAD_API_ROUTE_PREFIX, DOWNLOAD_ASSET_NOT_FOUND_ERROR_CODE, DOWNLOAD_ASSET_NOT_MINTABLE_ERROR_CODE, DOWNLOAD_CONTENT_TYPES, DOWNLOAD_INVALID_TOKEN_ERROR_CODE, DOWNLOAD_TOKEN_AUDIENCE, DOWNLOAD_TOKEN_PATH_CLAIM, DOWNLOAD_TOKEN_SIGNER, DOWNLOAD_TOKEN_SUBJECT, DOWNLOAD_TOKEN_TYP, DefaultFirebaseServerEnvService, DownloadApiController, DownloadApiModuleConfig, DownloadApiService, 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, FORWARDED_FOR_REQUEST_HEADER, 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_DOWNLOAD_TOKEN_TTL_SECONDS, 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_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, clientIpsMatch, cloudEventHandlerWithNestContextFactory, collectionRefForPath, createModelUnknownModelTypeError, decodeFirebaseServerUserPasswordResetOobCode, defaultFirebaseServerActionsTransformFactoryLogErrorFunction, defaultProvideFirebaseServerStorageServiceSimple, deleteModelUnknownModelTypeError, developmentUnknownSpecifierError, docRefForPath, documentModelNotAvailableError, downloadApiModuleMetadata, downloadContentTypeForPath, downloadTokenTtlSeconds, 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, isSafeRelativeAssetPath, makeBlockingFunctionWithHandler, makeOnScheduleHandlerWithNestApplicationRequest, makeScheduledFunctionDevelopmentFunction, modelAccessReadErrorFromUseMultipleModelsFailure, modelAccessRoleMapResultFromGrantedRoles, modelApiModuleMetadata, modelNotAvailableError, nestAppHasDevelopmentSchedulerEnabled, nestAppIsProductionEnvironment, nestFirebaseDoesNotExistError, nestFirebaseForbiddenPermissionError, nestServerInstance, noRunNameSpecifiedForScheduledFunctionDevelopmentFunction, noopFirebaseServerAnalyticsServiceListener, noopOnCallModelAnalyticsService, normalizeClientIp, 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, requestClientIp, resolveAdminOnlyValue, resolveAnalyticsFromApiDetails, resolveRequiredScopeFromApiDetails, resolveSecureAssetPath, sessionApiModuleMetadata, setNestContextOnRequest, setNestContextOnScheduleRequest, sha256ForFile, taskQueueFunctionHandlerWithNestContextFactory, unauthenticatedContextHasNoAuthData, unauthenticatedContextHasNoUidError, unauthenticatedError, unavailableError, unavailableOrDeactivatedFunctionError, unknownModelCrudFunctionSpecifierError, unknownScheduledFunctionDevelopmentFunctionName, unknownScheduledFunctionDevelopmentFunctionType, updateModelUnknownModelTypeError, userContextFromUid, verifyAppCheckInRequest, withApiDetails };
15291
+ export { AbstractFirebaseNestContext, AbstractFirebaseServerActionsContext, AbstractFirebaseServerAuthContext, AbstractFirebaseServerAuthService, AbstractFirebaseServerAuthUserContext, AbstractFirebaseServerNewUserService, AbstractFirebaseServerUserPasswordResetService, AbstractNestContext, AbstractServerFirebaseNestContext, ConfigureFirebaseAppCheckMiddlewareModule, ConfigureFirebaseWebhookMiddlewareModule, DBX_FIREBASE_SERVER_OIDC_SESSION_EXPIRES_AT_CLAIM, DEFAULT_DOWNLOAD_CONTENT_TYPE, DEFAULT_DOWNLOAD_TOKEN_TTL_SECONDS, DEFAULT_FIREBASE_PASSWORD_NUMBER_GENERATOR, DEFAULT_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS, DEFAULT_FIRESTORE_SESSION_CALLER_EXPIRY_LEEWAY_MILLIS, DEFAULT_FIRESTORE_SESSION_REQUIRED_OIDC_SCOPE, DEFAULT_RESET_CODE_EXPIRES_IN, DEFAULT_RESET_COM_THROTTLE_TIME, DEFAULT_SECURE_ASSETS_DIRECTORY, DEFAULT_SERVER_ASSETS_BASE_PATH, DEFAULT_SETUP_COM_THROTTLE_TIME, DOWNLOAD_API_ASSET_QUERY_PARAM, DOWNLOAD_API_PATH, DOWNLOAD_API_ROUTE_PREFIX, DOWNLOAD_ASSET_NOT_FOUND_ERROR_CODE, DOWNLOAD_ASSET_NOT_MINTABLE_ERROR_CODE, DOWNLOAD_CONTENT_TYPES, DOWNLOAD_INVALID_TOKEN_ERROR_CODE, DOWNLOAD_TOKEN_AUDIENCE, DOWNLOAD_TOKEN_PATH_CLAIM, DOWNLOAD_TOKEN_SIGNER, DOWNLOAD_TOKEN_SUBJECT, DOWNLOAD_TOKEN_TYP, DefaultFirebaseServerEnvService, DownloadApiController, DownloadApiModuleConfig, DownloadApiService, 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_CALLER_EXPIRING_ERROR_CODE, FIRESTORE_SESSION_FORBIDDEN_ERROR_CODE, FORWARDED_FOR_REQUEST_HEADER, 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_DOWNLOAD_TOKEN_TTL_SECONDS, 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_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, clientIpsMatch, cloudEventHandlerWithNestContextFactory, collectionRefForPath, createModelUnknownModelTypeError, decodeFirebaseServerUserPasswordResetOobCode, defaultFirebaseServerActionsTransformFactoryLogErrorFunction, defaultProvideFirebaseServerStorageServiceSimple, deleteModelUnknownModelTypeError, developmentUnknownSpecifierError, docRefForPath, documentModelNotAvailableError, downloadApiModuleMetadata, downloadContentTypeForPath, downloadTokenTtlSeconds, 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, isSafeRelativeAssetPath, makeBlockingFunctionWithHandler, makeOnScheduleHandlerWithNestApplicationRequest, makeScheduledFunctionDevelopmentFunction, modelAccessReadErrorFromUseMultipleModelsFailure, modelAccessRoleMapResultFromGrantedRoles, modelApiModuleMetadata, modelNotAvailableError, nestAppHasDevelopmentSchedulerEnabled, nestAppIsProductionEnvironment, nestFirebaseDoesNotExistError, nestFirebaseForbiddenPermissionError, nestServerInstance, noRunNameSpecifiedForScheduledFunctionDevelopmentFunction, noopFirebaseServerAnalyticsServiceListener, noopOnCallModelAnalyticsService, normalizeClientIp, notFoundError, oidcScopesFromModelApiAuth, oidcScopesFromRequestAuth, oidcSessionExpiresAtFromRequestAuth, 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, requestClientIp, resolveAdminOnlyValue, resolveAnalyticsFromApiDetails, resolveRequiredScopeFromApiDetails, resolveSecureAssetPath, sessionApiModuleMetadata, setNestContextOnRequest, setNestContextOnScheduleRequest, sha256ForFile, taskQueueFunctionHandlerWithNestContextFactory, unauthenticatedContextHasNoAuthData, unauthenticatedContextHasNoUidError, unauthenticatedError, unavailableError, unavailableOrDeactivatedFunctionError, unknownModelCrudFunctionSpecifierError, unknownScheduledFunctionDevelopmentFunctionName, unknownScheduledFunctionDevelopmentFunctionType, updateModelUnknownModelTypeError, userContextFromUid, verifyAppCheckInRequest, withApiDetails };
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@dereekb/firebase-server/mailgun",
3
- "version": "14.7.0",
3
+ "version": "14.9.0",
4
4
  "sideEffects": false,
5
5
  "type": "module",
6
6
  "peerDependencies": {
7
- "@dereekb/analytics": "14.7.0",
8
- "@dereekb/firebase": "14.7.0",
9
- "@dereekb/firebase-server": "14.7.0",
10
- "@dereekb/date": "14.7.0",
11
- "@dereekb/nestjs": "14.7.0",
12
- "@dereekb/model": "14.7.0",
13
- "@dereekb/rxjs": "14.7.0",
14
- "@dereekb/util": "14.7.0"
7
+ "@dereekb/analytics": "14.9.0",
8
+ "@dereekb/firebase": "14.9.0",
9
+ "@dereekb/firebase-server": "14.9.0",
10
+ "@dereekb/date": "14.9.0",
11
+ "@dereekb/nestjs": "14.9.0",
12
+ "@dereekb/model": "14.9.0",
13
+ "@dereekb/rxjs": "14.9.0",
14
+ "@dereekb/util": "14.9.0"
15
15
  },
16
16
  "exports": {
17
17
  "./package.json": "./package.json",
package/mcp/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@dereekb/firebase-server/mcp",
3
- "version": "14.7.0",
3
+ "version": "14.9.0",
4
4
  "sideEffects": false,
5
5
  "type": "module",
6
6
  "peerDependencies": {
7
- "@dereekb/analytics": "14.7.0",
8
- "@dereekb/date": "14.7.0",
9
- "@dereekb/firebase": "14.7.0",
10
- "@dereekb/firebase-server": "14.7.0",
11
- "@dereekb/firebase-server/oidc": "14.7.0",
12
- "@dereekb/model": "14.7.0",
13
- "@dereekb/nestjs": "14.7.0",
14
- "@dereekb/oauth-resource": "14.7.0",
15
- "@dereekb/rxjs": "14.7.0",
16
- "@dereekb/util": "14.7.0",
17
- "@dereekb/zoho": "14.7.0",
7
+ "@dereekb/analytics": "14.9.0",
8
+ "@dereekb/date": "14.9.0",
9
+ "@dereekb/firebase": "14.9.0",
10
+ "@dereekb/firebase-server": "14.9.0",
11
+ "@dereekb/firebase-server/oidc": "14.9.0",
12
+ "@dereekb/model": "14.9.0",
13
+ "@dereekb/nestjs": "14.9.0",
14
+ "@dereekb/oauth-resource": "14.9.0",
15
+ "@dereekb/rxjs": "14.9.0",
16
+ "@dereekb/util": "14.9.0",
17
+ "@dereekb/zoho": "14.9.0",
18
18
  "@modelcontextprotocol/node": "2.0.0",
19
19
  "@modelcontextprotocol/server": "2.0.0",
20
20
  "@nestjs/common": "^12.0.1",
@@ -1,4 +1,4 @@
1
- import { STORAGE_FILE_MODEL_ALREADY_INITIALIZED_ERROR_CODE, STORAGE_FILE_NOT_FLAGGED_FOR_GROUPS_SYNC_ERROR_CODE, UPLOADED_FILE_DOES_NOT_EXIST_ERROR_CODE, UPLOADED_FILE_NOT_ALLOWED_TO_BE_INITIALIZED_ERROR_CODE, UPLOADED_FILE_INITIALIZATION_FAILED_ERROR_CODE, UPLOADED_FILE_INITIALIZATION_DISCARDED_ERROR_CODE, STORAGE_FILE_PROCESSING_NOT_ALLOWED_FOR_INVALID_STATE_ERROR_CODE, STORAGE_FILE_PROCESSING_NOT_QUEUED_FOR_PROCESSING_ERROR_CODE, STORAGE_FILE_PROCESSING_NOT_AVAILABLE_FOR_TYPE_ERROR_CODE, STORAGE_FILE_ALREADY_PROCESSED_ERROR_CODE, STORAGE_FILE_NOT_FLAGGED_FOR_DELETION_ERROR_CODE, STORAGE_FILE_CANNOT_BE_DELETED_YET_ERROR_CODE, STORAGE_FILE_GROUP_QUEUED_FOR_INITIALIZATION_ERROR_CODE, STORAGE_FILE_GROUP_CREATE_INPUT_ERROR_CODE, createStorageFileParamsType, createStorageFileGroupParamsType, createStorageFileSignedUploadUrlParamsType, deleteAllQueuedStorageFilesParamsType, deleteStorageFileParamsType, downloadMultipleStorageFilesParamsType, downloadStorageFileParamsType, initializeAllStorageFilesFromUploadsParamsType, initializeStorageFileFromUploadParamsType, processAllQueuedStorageFilesParamsType, processStorageFileParamsType, readMultipleStorageFilesMetadataParamsType, readStorageFileMetadataParamsType, regenerateAllFlaggedStorageFileGroupsContentParamsType, regenerateStorageFileGroupContentParamsType, syncAllFlaggedStorageFilesWithGroupsParamsType, syncStorageFileWithGroupsParamsType, updateStorageFileParamsType, updateStorageFileGroupParamsType, UPLOADS_FOLDER_PATH, iterateStorageListFilesByEachFile, StorageFileProcessingState, iterateFirestoreDocumentSnapshotPairs, storageFilesQueuedForProcessingQuery, firestoreDummyKey, STORAGE_FILE_PROCESSING_STUCK_THROTTLE_CHECK_MS, StorageFileState, createNotificationDocument, storageFileProcessingNotificationTaskTemplate, storageFilesQueuedForDeleteQuery, storageFileDisplayFileName, loadStorageFileGroupDocumentForReferencePair, inferKeyFromTwoWayFlatFirestoreModelKey, calculateStorageFileGroupEmbeddedFileUpdate, loadDocumentsForIds, getDocumentSnapshotDataPairs, iterateFirestoreDocumentSnapshotPairBatches, storageFileFlaggedForSyncWithGroupsQuery, createStorageFileDocumentPairFactory, StorageFileCreationType, storageFileGroupZipFileStoragePath, STORAGE_FILE_GROUP_ZIP_STORAGE_FILE_PURPOSE, calculateStorageFileGroupRegeneration, getDocumentSnapshotDataPair, storageFileGroupsFlaggedForContentRegenerationQuery, DEFAULT_CREATE_STORAGE_FILE_SIGNED_UPLOAD_URL_EXPIRES_IN_MS, CREATE_STORAGE_FILE_SIGNED_UPLOAD_URL_MIN_EXPIRES_IN_MS, CREATE_STORAGE_FILE_SIGNED_UPLOAD_URL_MAX_EXPIRES_IN_MS, CREATE_STORAGE_FILE_SIGNED_UPLOAD_URL_MAX_FILENAME_LENGTH, CALENDAR_ICS_DOMAIN_NOT_CONFIGURED_ERROR_CODE, CALENDAR_ICS_ROTATE_THROTTLED_ERROR_CODE, CALENDAR_ICS_STORAGE_FILE_UNAVAILABLE_ERROR_CODE, flagStaleCalendarsForSyncParamsType, rotateCalendarIcsParamsType, syncAllFlaggedCalendarsParamsType, syncCalendarParamsType, CALENDAR_ICS_STORAGE_FILE_PURPOSE, calendarIcsFileStoragePath, pruneCalendarEvents, calendarNextIcsRotateAt, isCalendarIcsRotateThrottled, calendarsFlaggedForSyncQuery, DEFAULT_CALENDAR_RESYNC_INTERVAL, calendarsDueForResyncQuery, AppCalendarTypeConfigService, appCalendarTypeConfigService, calendarTypeConfigRecord, CALENDAR_ICS_STORAGE_FILE_PURPOSE_GENERATE_ICS_SUBTASK, notificationSubtaskComplete, calendarToIcsString, calendarTypeConfigIcsExpansionRange, calendarTypeConfigIcsConfig, notificationTaskComplete, _createNotificationDocumentFromPair, createNotificationDocumentPair, FORM_SPACE_ALREADY_EXISTS_ERROR_CODE, FORM_SPACE_FILE_ACCESS_DENIED_ERROR_CODE, FORM_SPACE_FILE_NOT_FOUND_ERROR_CODE, FORM_SPACE_HAS_INVALID_FILES_ERROR_CODE, FORM_SPACE_NOT_EDITABLE_ERROR_CODE, FORM_SPACE_NOT_FOUND_ERROR_CODE, FORM_SPACE_NOT_REOPENABLE_ERROR_CODE, FORM_SPACE_NOT_SUBMITTED_ERROR_CODE, FORM_SPACE_PROCESSING_IN_PROGRESS_ERROR_CODE, FORM_SPACE_REQUIRED_SLOT_MISSING_ERROR_CODE, FORM_SPACE_TYPE_MISMATCH_ERROR_CODE, FORM_SPACE_TYPE_NOT_REGISTERED_ERROR_CODE, FORM_SPACE_UPLOAD_NOT_ALLOWED_ERROR_CODE, FORM_SPACE_UPLOAD_USER_MISMATCH_ERROR_CODE, FORM_SPACE_VALIDATION_PENDING_ERROR_CODE, createFormSpaceParamsType, deleteFormSpaceParamsType, expireAllExpiredFormSpacesParamsType, lockFormSpaceParamsType, processAllQueuedFormSpacesParamsType, removeFormSpaceFileParamsType, reopenFormSpaceParamsType, submitFormSpaceParamsType, updateFormSpaceParamsType, formSpaceTemplate, resolveFormSpaceExpiresAt, isFormSpaceEditable, formSpaceSubmitBlockers, submitFormSpaceTemplate, isFormSpaceReopenable, FormSpaceProcessingState, reopenFormSpaceTemplate, lockFormSpaceTemplate, formSpaceFilesInSlot, isFormSpaceFileAccessibleByUser, formSpaceSubmissionNotificationTaskTemplate, storageFilesForFormSpaceQuery, formSpacesQueuedForProcessingQuery, expireFormSpaceTemplate, formSpacesDueForExpirationQuery, AppFormSpaceTypeConfigService, appFormSpaceTypeConfigService, formSpaceTypeConfigRecord, NOTIFICATION_TASK_SUBTASK_CHECKPOINT_PROCESSING, NOTIFICATION_TASK_SUBTASK_CHECKPOINT_CLEANUP, completeSubtaskProcessingAndScheduleCleanupTaskResult, delayCompletion, notificationTaskDelayRetry, DEFAULT_NOTIFICATION_TASK_SUBTASK_CLEANUP_RETRY_DELAY, DEFAULT_NOTIFICATION_TASK_SUBTASK_CLEANUP_RETRY_ATTEMPTS, FORM_SPACE_SUBMISSION_NOTIFICATION_TASK_TYPE, FormSpaceState, getDocumentSnapshotData, storedFileReaderFactory, limitUploadFileTypeDeterminer, combineUploadFileTypeDeterminers, STORAGEFILE_RELATED_FILE_METADATA_KEY, copyStoragePath, storageFilePurposeAndUserQuery, determineUserByUserUploadsFolderWrapperFunction, determineByFilePath, FORM_SPACE_UPLOADED_FILE_TYPE_IDENTIFIER, FORM_SPACE_UPLOADS_FOLDER_NAME, ALL_USER_UPLOADS_FOLDER_PATH, FormSpaceFileValidationState, formSpaceFileSlotConfig, formSpaceSlotMaxFiles, FORM_SPACE_PURPOSE, formSpaceStorageFileGroupId, formSpaceFileStoragePath, formSpaceUploadFileNameDetails, parseFormSpaceUploadPath, assertFormSpaceUploadAllowed, FORM_SPACE_PURPOSE_REGISTER_SUBTASK, FORM_SPACE_PURPOSE_VALIDATE_SUBTASK, inferStorageFileGroupRelatedModelKey, notificationHealthCheckIssue, KnownNotificationHealthCheckIssueCode, NotificationHealthCheckStatus, MailgunNotificationHealthCheckIssueCode, untrackableNotificationHealthCheckProbe, DEFAULT_NOTIFICATION_MESSAGE_CALENDAR_ATTACHMENT_FILENAME, CREATE_NOTIFICATION_ID_REQUIRED_ERROR_CODE, NOTIFICATION_BOX_DOES_NOT_EXIST_ERROR_CODE, NOTIFICATION_BOX_EXCLUSION_TARGET_INVALID_ERROR_CODE, NOTIFICATION_BOX_EXISTS_FOR_MODEL_ERROR_CODE, NOTIFICATION_BOX_RECIPIENT_DOES_NOT_EXIST_ERROR_CODE, NOTIFICATION_MODEL_ALREADY_INITIALIZED_ERROR_CODE, NOTIFICATION_USER_BLOCKED_FROM_BEING_ADD_TO_RECIPIENTS_ERROR_CODE, NOTIFICATION_USER_HEALTH_CHECK_PROBE_THROTTLED_ERROR_CODE, NOTIFICATION_USER_HEALTH_CHECK_THROTTLED_ERROR_CODE, NOTIFICATION_USER_HEALTH_CHECK_VERIFY_THROTTLED_ERROR_CODE, NOTIFICATION_USER_INVALID_UID_FOR_CREATE_ERROR_CODE, NOTIFICATION_USER_LOCKED_CONFIG_FROM_BEING_UPDATED_ERROR_CODE, notificationUserHealthCheckParamsType, rollupNotificationHealthCheckResultStatus, rollupNotificationDeliveryHealthCheckResultStatus, isPendingNotificationHealthCheckProbe, notificationUserHealthCheckNextProbeAt, notificationUserHealthCheckNextVerifyAt, notificationUserHealthCheckNextRunAt, DEFAULT_NOTIFICATION_TEMPLATE_TYPE, NotificationDeliveryMethod, NotificationBoxRecipientFlag, effectiveNotificationBoxRecipientTemplateConfig, mergeNotificationBoxRecipients, mergeNotificationUserNotificationBoxRecipientConfigs, applyExclusionsToNotificationUserNotificationBoxRecipientConfigs, mergeNotificationBoxRecipientTemplateConfigs, notificationSendExclusionCanSendFunction, mergeNotificationUserDefaultNotificationBoxRecipientConfig, NotificationRecipientSendFlag, allowedNotificationRecipients, getDocumentSnapshotDataPairsWithData, cleanupOldNotificationLoggedEventDaysParamsType, cleanupSentNotificationsParamsType, createNotificationBoxParamsType, createNotificationSummaryParamsType, createNotificationUserParamsType, resyncNotificationUserParamsType, sendNotificationParamsType, sendQueuedNotificationsParamsType, updateNotificationBoxParamsType, updateNotificationBoxRecipientParamsType, updateNotificationSummaryParamsType, updateNotificationUserParamsType, updateNotificationUserDefaultNotificationBoxRecipientConfig, effectiveNotificationBoxRecipientConfig, updateNotificationUserNotificationBoxRecipientConfigs, calculateNsForNotificationUserNotificationBoxRecipientConfigs, notificationUsersFlaggedForNeedsSyncQuery, notificationSummaryIdForModel, loadNotificationBoxDocumentForReferencePair, updateNotificationUserNotificationSendExclusions, notificationBoxRecipientTemplateConfigArrayToRecord, updateNotificationRecipient, setIdAndKeyFromKeyIdRefOnDocumentData, NotificationSendType, notificationSendFlagsImplyIsComplete, NotificationSendState, mergeNotificationSendMessagesResult, notificationsPastSendAtTimeQuery, loadDocumentsForDocumentReferencesFromValues, notificationLoggedEventDayId, shouldSaveNotificationToNotificationWeek, notificationsReadyForCleanupQuery, notificationLoggedEventDaysOlderThanQuery, initializeAllApplicableNotificationBoxesParamsType, initializeAllApplicableNotificationSummariesParamsType, initializeNotificationModelParamsType, firestoreModelKeyCollectionName, notificationBoxesFlaggedForNeedsInitializationQuery, notificationSummariesFlaggedForNeedsInitializationQuery, noContentNotificationMessageFunctionFactory, NOTIFICATION_SUMMARY_EMBEDDED_NOTIFICATION_ITEM_SUBJECT_MAX_LENGTH, NOTIFICATION_SUMMARY_EMBEDDED_NOTIFICATION_ITEM_MESSAGE_MAX_LENGTH, sortNotificationItemsFunction, NOTIFICATION_SUMMARY_ITEM_LIMIT, initializeAllApplicableStorageFileGroupsParamsType, initializeStorageFileModelParamsType, storageFileGroupsFlaggedForNeedsInitializationQuery, STORAGE_FILE_GROUP_ZIP_STORAGE_FILE_PURPOSE_CREATE_ZIP_SUBTASK, STORAGE_FILE_PROCESSING_NOTIFICATION_TASK_TYPE, STORAGE_FILE_GROUP_ZIP_INFO_JSON_FILE_NAME, firestoreModelIdentity, systemStateConverter, systemStateStoredDataConverterFactory, AbstractFirestoreDocument, schedulerSystemStateRead, loadSchedulerSystemState, SCHEDULER_SYSTEM_STATE_TYPE, USER_EXTERNAL_CONNECTION_ALREADY_EXISTS_ERROR_CODE, USER_EXTERNAL_CONNECTION_CREDENTIALS_EXPIRED_ERROR_CODE, USER_EXTERNAL_CONNECTION_EXTERNAL_ACCOUNT_IN_USE_ERROR_CODE, USER_EXTERNAL_CONNECTION_LINK_NOT_ENABLED_ERROR_CODE, USER_EXTERNAL_CONNECTION_PROVIDER_NOT_ALLOWED_ERROR_CODE, USER_EXTERNAL_CONNECTION_PROVIDER_NOT_CONNECTED_ERROR_CODE, USER_EXTERNAL_CONNECTION_SIGN_IN_DENIED_ERROR_CODE, USER_EXTERNAL_CONNECTION_SIGN_IN_EMAIL_CONFLICT_ERROR_CODE, USER_EXTERNAL_CONNECTION_SIGN_IN_REPORTABLE_ERROR_CODES, USER_EXTERNAL_CONNECTION_SIGN_IN_IDENTITY_UNAVAILABLE_ERROR_CODE, USER_EXTERNAL_CONNECTION_SIGN_IN_NOT_ENABLED_ERROR_CODE, USER_EXTERNAL_CONNECTION_SIGN_IN_USER_MISSING_ERROR_CODE, USER_EXTERNAL_CONNECTION_UNLINK_LAST_LOGIN_METHOD_ERROR_CODE, copyUserRelatedDataAccessorFactoryFunction, snapshotConverterFunctions, firestoreDate, firestoreUID, emptyUserExternalConnection, applyUserExternalConnectionEntry, userExternalConnectionEntryForOutcome, applyUserExternalConnectionLogin, userExternalConnectionsWithExternalAccountQuery, userExternalConnectionLoginForIdentity, userExternalConnectionExternalAccountKeys, userExternalConnectionValue } from '@dereekb/firebase';
1
+ import { STORAGE_FILE_MODEL_ALREADY_INITIALIZED_ERROR_CODE, STORAGE_FILE_NOT_FLAGGED_FOR_GROUPS_SYNC_ERROR_CODE, UPLOADED_FILE_DOES_NOT_EXIST_ERROR_CODE, UPLOADED_FILE_NOT_ALLOWED_TO_BE_INITIALIZED_ERROR_CODE, UPLOADED_FILE_INITIALIZATION_FAILED_ERROR_CODE, UPLOADED_FILE_INITIALIZATION_DISCARDED_ERROR_CODE, STORAGE_FILE_PROCESSING_NOT_ALLOWED_FOR_INVALID_STATE_ERROR_CODE, STORAGE_FILE_PROCESSING_NOT_QUEUED_FOR_PROCESSING_ERROR_CODE, STORAGE_FILE_PROCESSING_NOT_AVAILABLE_FOR_TYPE_ERROR_CODE, STORAGE_FILE_ALREADY_PROCESSED_ERROR_CODE, STORAGE_FILE_NOT_FLAGGED_FOR_DELETION_ERROR_CODE, STORAGE_FILE_CANNOT_BE_DELETED_YET_ERROR_CODE, STORAGE_FILE_GROUP_QUEUED_FOR_INITIALIZATION_ERROR_CODE, STORAGE_FILE_GROUP_CREATE_INPUT_ERROR_CODE, createStorageFileParamsType, createStorageFileGroupParamsType, createStorageFileSignedUploadUrlParamsType, deleteAllQueuedStorageFilesParamsType, deleteStorageFileParamsType, downloadMultipleStorageFilesParamsType, downloadStorageFileParamsType, initializeAllStorageFilesFromUploadsParamsType, initializeStorageFileFromUploadParamsType, processAllQueuedStorageFilesParamsType, processStorageFileParamsType, readMultipleStorageFilesMetadataParamsType, readStorageFileMetadataParamsType, regenerateAllFlaggedStorageFileGroupsContentParamsType, regenerateStorageFileGroupContentParamsType, syncAllFlaggedStorageFilesWithGroupsParamsType, syncStorageFileWithGroupsParamsType, updateStorageFileParamsType, updateStorageFileGroupParamsType, UPLOADS_FOLDER_PATH, iterateStorageListFilesByEachFile, StorageFileProcessingState, iterateFirestoreDocumentSnapshotPairs, storageFilesQueuedForProcessingQuery, firestoreDummyKey, STORAGE_FILE_PROCESSING_STUCK_THROTTLE_CHECK_MS, StorageFileState, createNotificationDocument, storageFileProcessingNotificationTaskTemplate, storageFilesQueuedForDeleteQuery, storageFileDisplayFileName, loadStorageFileGroupDocumentForReferencePair, inferKeyFromTwoWayFlatFirestoreModelKey, calculateStorageFileGroupEmbeddedFileUpdate, loadDocumentsForIds, getDocumentSnapshotDataPairs, iterateFirestoreDocumentSnapshotPairBatches, storageFileFlaggedForSyncWithGroupsQuery, createStorageFileDocumentPairFactory, StorageFileCreationType, storageFileGroupZipFileStoragePath, STORAGE_FILE_GROUP_ZIP_STORAGE_FILE_PURPOSE, calculateStorageFileGroupRegeneration, getDocumentSnapshotDataPair, storageFileGroupsFlaggedForContentRegenerationQuery, DEFAULT_CREATE_STORAGE_FILE_SIGNED_UPLOAD_URL_EXPIRES_IN_MS, CREATE_STORAGE_FILE_SIGNED_UPLOAD_URL_MIN_EXPIRES_IN_MS, CREATE_STORAGE_FILE_SIGNED_UPLOAD_URL_MAX_EXPIRES_IN_MS, CREATE_STORAGE_FILE_SIGNED_UPLOAD_URL_MAX_FILENAME_LENGTH, CALENDAR_ICS_DOMAIN_NOT_CONFIGURED_ERROR_CODE, CALENDAR_ICS_ROTATE_THROTTLED_ERROR_CODE, CALENDAR_ICS_STORAGE_FILE_UNAVAILABLE_ERROR_CODE, flagStaleCalendarsForSyncParamsType, rotateCalendarIcsParamsType, syncAllFlaggedCalendarsParamsType, syncCalendarParamsType, CALENDAR_ICS_STORAGE_FILE_PURPOSE, calendarIcsFileStoragePath, pruneCalendarEvents, calendarNextIcsRotateAt, isCalendarIcsRotateThrottled, calendarsFlaggedForSyncQuery, DEFAULT_CALENDAR_RESYNC_INTERVAL, calendarsDueForResyncQuery, AppCalendarTypeConfigService, appCalendarTypeConfigService, calendarTypeConfigRecord, CALENDAR_ICS_STORAGE_FILE_PURPOSE_GENERATE_ICS_SUBTASK, notificationSubtaskComplete, calendarToIcsString, calendarTypeConfigIcsExpansionRange, calendarTypeConfigIcsConfig, notificationTaskComplete, _createNotificationDocumentFromPair, createNotificationDocumentPair, FORM_SPACE_ALREADY_EXISTS_ERROR_CODE, FORM_SPACE_FILE_ACCESS_DENIED_ERROR_CODE, FORM_SPACE_FILE_NOT_FOUND_ERROR_CODE, FORM_SPACE_HAS_INVALID_FILES_ERROR_CODE, FORM_SPACE_NOT_EDITABLE_ERROR_CODE, FORM_SPACE_NOT_FOUND_ERROR_CODE, FORM_SPACE_NOT_REOPENABLE_ERROR_CODE, FORM_SPACE_NOT_SUBMITTED_ERROR_CODE, FORM_SPACE_PROCESSING_IN_PROGRESS_ERROR_CODE, FORM_SPACE_REQUIRED_SLOT_MISSING_ERROR_CODE, FORM_SPACE_TYPE_MISMATCH_ERROR_CODE, FORM_SPACE_TYPE_NOT_REGISTERED_ERROR_CODE, FORM_SPACE_UPLOAD_NOT_ALLOWED_ERROR_CODE, FORM_SPACE_UPLOAD_USER_MISMATCH_ERROR_CODE, FORM_SPACE_VALIDATION_PENDING_ERROR_CODE, createFormSpaceParamsType, deleteFormSpaceParamsType, expireAllExpiredFormSpacesParamsType, lockFormSpaceParamsType, processAllQueuedFormSpacesParamsType, removeFormSpaceFileParamsType, reopenFormSpaceParamsType, submitFormSpaceParamsType, updateFormSpaceParamsType, formSpaceTemplate, resolveFormSpaceExpiresAt, isFormSpaceEditable, formSpaceSubmitBlockers, submitFormSpaceTemplate, isFormSpaceReopenable, FormSpaceProcessingState, reopenFormSpaceTemplate, lockFormSpaceTemplate, formSpaceFilesInSlot, isFormSpaceFileAccessibleByUser, formSpaceSubmissionNotificationTaskTemplate, storageFilesForFormSpaceQuery, formSpacesQueuedForProcessingQuery, expireFormSpaceTemplate, formSpacesDueForExpirationQuery, limit, AppFormSpaceTypeConfigService, appFormSpaceTypeConfigService, formSpaceTypeConfigRecord, NOTIFICATION_TASK_SUBTASK_CHECKPOINT_PROCESSING, NOTIFICATION_TASK_SUBTASK_CHECKPOINT_CLEANUP, completeSubtaskProcessingAndScheduleCleanupTaskResult, delayCompletion, notificationTaskDelayRetry, DEFAULT_NOTIFICATION_TASK_SUBTASK_CLEANUP_RETRY_DELAY, DEFAULT_NOTIFICATION_TASK_SUBTASK_CLEANUP_RETRY_ATTEMPTS, FORM_SPACE_SUBMISSION_NOTIFICATION_TASK_TYPE, FormSpaceState, getDocumentSnapshotData, storedFileReaderFactory, limitUploadFileTypeDeterminer, combineUploadFileTypeDeterminers, STORAGEFILE_RELATED_FILE_METADATA_KEY, copyStoragePath, storageFilePurposeAndUserQuery, determineUserByUserUploadsFolderWrapperFunction, determineByFilePath, FORM_SPACE_UPLOADED_FILE_TYPE_IDENTIFIER, FORM_SPACE_UPLOADS_FOLDER_NAME, ALL_USER_UPLOADS_FOLDER_PATH, FormSpaceFileValidationState, formSpaceFileSlotConfig, formSpaceSlotMaxFiles, FORM_SPACE_PURPOSE, formSpaceStorageFileGroupId, formSpaceFileStoragePath, formSpaceUploadFileNameDetails, parseFormSpaceUploadPath, assertFormSpaceUploadAllowed, FORM_SPACE_PURPOSE_REGISTER_SUBTASK, FORM_SPACE_PURPOSE_VALIDATE_SUBTASK, inferStorageFileGroupRelatedModelKey, notificationHealthCheckIssue, KnownNotificationHealthCheckIssueCode, NotificationHealthCheckStatus, MailgunNotificationHealthCheckIssueCode, untrackableNotificationHealthCheckProbe, DEFAULT_NOTIFICATION_MESSAGE_CALENDAR_ATTACHMENT_FILENAME, CREATE_NOTIFICATION_ID_REQUIRED_ERROR_CODE, NOTIFICATION_BOX_DOES_NOT_EXIST_ERROR_CODE, NOTIFICATION_BOX_EXCLUSION_TARGET_INVALID_ERROR_CODE, NOTIFICATION_BOX_EXISTS_FOR_MODEL_ERROR_CODE, NOTIFICATION_BOX_RECIPIENT_DOES_NOT_EXIST_ERROR_CODE, NOTIFICATION_MODEL_ALREADY_INITIALIZED_ERROR_CODE, NOTIFICATION_USER_BLOCKED_FROM_BEING_ADD_TO_RECIPIENTS_ERROR_CODE, NOTIFICATION_USER_HEALTH_CHECK_PROBE_THROTTLED_ERROR_CODE, NOTIFICATION_USER_HEALTH_CHECK_THROTTLED_ERROR_CODE, NOTIFICATION_USER_HEALTH_CHECK_VERIFY_THROTTLED_ERROR_CODE, NOTIFICATION_USER_INVALID_UID_FOR_CREATE_ERROR_CODE, NOTIFICATION_USER_LOCKED_CONFIG_FROM_BEING_UPDATED_ERROR_CODE, notificationUserHealthCheckParamsType, rollupNotificationHealthCheckResultStatus, rollupNotificationDeliveryHealthCheckResultStatus, isPendingNotificationHealthCheckProbe, notificationUserHealthCheckNextProbeAt, notificationUserHealthCheckNextVerifyAt, notificationUserHealthCheckNextRunAt, DEFAULT_NOTIFICATION_TEMPLATE_TYPE, NotificationDeliveryMethod, NotificationBoxRecipientFlag, effectiveNotificationBoxRecipientTemplateConfig, mergeNotificationBoxRecipients, mergeNotificationUserNotificationBoxRecipientConfigs, applyExclusionsToNotificationUserNotificationBoxRecipientConfigs, mergeNotificationBoxRecipientTemplateConfigs, notificationSendExclusionCanSendFunction, mergeNotificationUserDefaultNotificationBoxRecipientConfig, NotificationRecipientSendFlag, allowedNotificationRecipients, getDocumentSnapshotDataPairsWithData, cleanupOldNotificationLoggedEventDaysParamsType, cleanupSentNotificationsParamsType, createNotificationBoxParamsType, createNotificationSummaryParamsType, createNotificationUserParamsType, resyncNotificationUserParamsType, sendNotificationParamsType, sendQueuedNotificationsParamsType, updateNotificationBoxParamsType, updateNotificationBoxRecipientParamsType, updateNotificationSummaryParamsType, updateNotificationUserParamsType, updateNotificationUserDefaultNotificationBoxRecipientConfig, effectiveNotificationBoxRecipientConfig, updateNotificationUserNotificationBoxRecipientConfigs, calculateNsForNotificationUserNotificationBoxRecipientConfigs, notificationUsersFlaggedForNeedsSyncQuery, notificationSummaryIdForModel, loadNotificationBoxDocumentForReferencePair, updateNotificationUserNotificationSendExclusions, notificationBoxRecipientTemplateConfigArrayToRecord, updateNotificationRecipient, setIdAndKeyFromKeyIdRefOnDocumentData, NotificationSendType, notificationSendFlagsImplyIsComplete, NotificationSendState, mergeNotificationSendMessagesResult, notificationsPastSendAtTimeQuery, loadDocumentsForDocumentReferencesFromValues, notificationLoggedEventDayId, shouldSaveNotificationToNotificationWeek, notificationsReadyForCleanupQuery, notificationLoggedEventDaysOlderThanQuery, initializeAllApplicableNotificationBoxesParamsType, initializeAllApplicableNotificationSummariesParamsType, initializeNotificationModelParamsType, firestoreModelKeyCollectionName, notificationBoxesFlaggedForNeedsInitializationQuery, notificationSummariesFlaggedForNeedsInitializationQuery, noContentNotificationMessageFunctionFactory, NOTIFICATION_SUMMARY_EMBEDDED_NOTIFICATION_ITEM_SUBJECT_MAX_LENGTH, NOTIFICATION_SUMMARY_EMBEDDED_NOTIFICATION_ITEM_MESSAGE_MAX_LENGTH, sortNotificationItemsFunction, NOTIFICATION_SUMMARY_ITEM_LIMIT, initializeAllApplicableStorageFileGroupsParamsType, initializeStorageFileModelParamsType, storageFileGroupsFlaggedForNeedsInitializationQuery, STORAGE_FILE_GROUP_ZIP_STORAGE_FILE_PURPOSE_CREATE_ZIP_SUBTASK, STORAGE_FILE_PROCESSING_NOTIFICATION_TASK_TYPE, STORAGE_FILE_GROUP_ZIP_INFO_JSON_FILE_NAME, firestoreModelIdentity, systemStateConverter, systemStateStoredDataConverterFactory, AbstractFirestoreDocument, schedulerSystemStateRead, loadSchedulerSystemState, SCHEDULER_SYSTEM_STATE_TYPE, USER_EXTERNAL_CONNECTION_ALREADY_EXISTS_ERROR_CODE, USER_EXTERNAL_CONNECTION_CREDENTIALS_EXPIRED_ERROR_CODE, USER_EXTERNAL_CONNECTION_EXTERNAL_ACCOUNT_IN_USE_ERROR_CODE, USER_EXTERNAL_CONNECTION_LINK_NOT_ENABLED_ERROR_CODE, USER_EXTERNAL_CONNECTION_PROVIDER_NOT_ALLOWED_ERROR_CODE, USER_EXTERNAL_CONNECTION_PROVIDER_NOT_CONNECTED_ERROR_CODE, USER_EXTERNAL_CONNECTION_SIGN_IN_DENIED_ERROR_CODE, USER_EXTERNAL_CONNECTION_SIGN_IN_EMAIL_CONFLICT_ERROR_CODE, USER_EXTERNAL_CONNECTION_SIGN_IN_REPORTABLE_ERROR_CODES, USER_EXTERNAL_CONNECTION_SIGN_IN_IDENTITY_UNAVAILABLE_ERROR_CODE, USER_EXTERNAL_CONNECTION_SIGN_IN_NOT_ENABLED_ERROR_CODE, USER_EXTERNAL_CONNECTION_SIGN_IN_USER_MISSING_ERROR_CODE, USER_EXTERNAL_CONNECTION_UNLINK_LAST_LOGIN_METHOD_ERROR_CODE, copyUserRelatedDataAccessorFactoryFunction, snapshotConverterFunctions, firestoreDate, firestoreUID, emptyUserExternalConnection, applyUserExternalConnectionEntry, userExternalConnectionEntryForOutcome, applyUserExternalConnectionLogin, userExternalConnectionsWithExternalAccountQuery, userExternalConnectionLoginForIdentity, userExternalConnectionExternalAccountKeys, userExternalConnectionValue } from '@dereekb/firebase';
2
2
  export { USER_EXTERNAL_CONNECTION_ALREADY_EXISTS_ERROR_CODE, USER_EXTERNAL_CONNECTION_CREDENTIALS_EXPIRED_ERROR_CODE, USER_EXTERNAL_CONNECTION_EXTERNAL_ACCOUNT_IN_USE_ERROR_CODE, USER_EXTERNAL_CONNECTION_LINK_NOT_ENABLED_ERROR_CODE, USER_EXTERNAL_CONNECTION_PROVIDER_NOT_ALLOWED_ERROR_CODE, USER_EXTERNAL_CONNECTION_PROVIDER_NOT_CONNECTED_ERROR_CODE, USER_EXTERNAL_CONNECTION_SIGN_IN_DENIED_ERROR_CODE, USER_EXTERNAL_CONNECTION_SIGN_IN_EMAIL_CONFLICT_ERROR_CODE, USER_EXTERNAL_CONNECTION_SIGN_IN_IDENTITY_UNAVAILABLE_ERROR_CODE, USER_EXTERNAL_CONNECTION_SIGN_IN_NOT_ENABLED_ERROR_CODE, USER_EXTERNAL_CONNECTION_SIGN_IN_REPORTABLE_ERROR_CODES, USER_EXTERNAL_CONNECTION_SIGN_IN_USER_MISSING_ERROR_CODE, USER_EXTERNAL_CONNECTION_UNLINK_LAST_LOGIN_METHOD_ERROR_CODE } from '@dereekb/firebase';
3
3
  import { preconditionConflictError, internalServerError, assertSnapshotData, badRequestError, unavailableError, FIREBASE_FIRESTORE_CONTEXT_TOKEN, FirebaseServerFirestoreContextModule, forbiddenError, firestoreEncryptedField, getAuthUserOrUndefined, FirebaseServerEnvService } from '@dereekb/firebase-server';
4
4
  import { addDays, subMilliseconds, isAfter, hoursToMilliseconds, addHours, isFuture, addMinutes, addSeconds } from 'date-fns';
@@ -160,7 +160,7 @@ import { createAES256GCMEncryption, isValidAES256GCMEncryptionSecret } from '@de
160
160
  });
161
161
  }
162
162
 
163
- function _array_like_to_array$l(arr, len) {
163
+ function _array_like_to_array$m(arr, len) {
164
164
  if (len == null || len > arr.length) len = arr.length;
165
165
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
166
166
  return arr2;
@@ -275,7 +275,7 @@ function _object_spread_props$p(target, source) {
275
275
  return target;
276
276
  }
277
277
  function _sliced_to_array$9(arr, i) {
278
- return _array_with_holes$9(arr) || _iterable_to_array_limit$9(arr, i) || _unsupported_iterable_to_array$l(arr, i) || _non_iterable_rest$9();
278
+ return _array_with_holes$9(arr) || _iterable_to_array_limit$9(arr, i) || _unsupported_iterable_to_array$m(arr, i) || _non_iterable_rest$9();
279
279
  }
280
280
  function _ts_generator$A(thisArg, body) {
281
281
  var f, y, t, _ = {
@@ -376,13 +376,13 @@ function _ts_generator$A(thisArg, body) {
376
376
  };
377
377
  }
378
378
  }
379
- function _unsupported_iterable_to_array$l(o, minLen) {
379
+ function _unsupported_iterable_to_array$m(o, minLen) {
380
380
  if (!o) return;
381
- if (typeof o === "string") return _array_like_to_array$l(o, minLen);
381
+ if (typeof o === "string") return _array_like_to_array$m(o, minLen);
382
382
  var n = Object.prototype.toString.call(o).slice(8, -1);
383
383
  if (n === "Object" && o.constructor) n = o.constructor.name;
384
384
  if (n === "Map" || n === "Set") return Array.from(n);
385
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$l(o, minLen);
385
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$m(o, minLen);
386
386
  }
387
387
  /**
388
388
  * NestJS injection token for the {@link BaseStorageFileServerActionsContext}, providing
@@ -4098,13 +4098,13 @@ function _ts_values(o) {
4098
4098
  });
4099
4099
  }
4100
4100
 
4101
- function _array_like_to_array$k(arr, len) {
4101
+ function _array_like_to_array$l(arr, len) {
4102
4102
  if (len == null || len > arr.length) len = arr.length;
4103
4103
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4104
4104
  return arr2;
4105
4105
  }
4106
- function _array_without_holes$f(arr) {
4107
- if (Array.isArray(arr)) return _array_like_to_array$k(arr);
4106
+ function _array_without_holes$g(arr) {
4107
+ if (Array.isArray(arr)) return _array_like_to_array$l(arr);
4108
4108
  }
4109
4109
  function _define_property$s(obj, key, value) {
4110
4110
  if (key in obj) {
@@ -4117,12 +4117,12 @@ function _define_property$s(obj, key, value) {
4117
4117
  } else obj[key] = value;
4118
4118
  return obj;
4119
4119
  }
4120
- function _iterable_to_array$f(iter) {
4120
+ function _iterable_to_array$g(iter) {
4121
4121
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
4122
4122
  return Array.from(iter);
4123
4123
  }
4124
4124
  }
4125
- function _non_iterable_spread$f() {
4125
+ function _non_iterable_spread$g() {
4126
4126
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4127
4127
  }
4128
4128
  function _object_spread$q(target) {
@@ -4158,16 +4158,16 @@ function _object_spread_props$o(target, source) {
4158
4158
  }
4159
4159
  return target;
4160
4160
  }
4161
- function _to_consumable_array$f(arr) {
4162
- return _array_without_holes$f(arr) || _iterable_to_array$f(arr) || _unsupported_iterable_to_array$k(arr) || _non_iterable_spread$f();
4161
+ function _to_consumable_array$g(arr) {
4162
+ return _array_without_holes$g(arr) || _iterable_to_array$g(arr) || _unsupported_iterable_to_array$l(arr) || _non_iterable_spread$g();
4163
4163
  }
4164
- function _unsupported_iterable_to_array$k(o, minLen) {
4164
+ function _unsupported_iterable_to_array$l(o, minLen) {
4165
4165
  if (!o) return;
4166
- if (typeof o === "string") return _array_like_to_array$k(o, minLen);
4166
+ if (typeof o === "string") return _array_like_to_array$l(o, minLen);
4167
4167
  var n = Object.prototype.toString.call(o).slice(8, -1);
4168
4168
  if (n === "Object" && o.constructor) n = o.constructor.name;
4169
4169
  if (n === "Map" || n === "Set") return Array.from(n);
4170
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$k(o, minLen);
4170
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$l(o, minLen);
4171
4171
  }
4172
4172
  /**
4173
4173
  * NestJS injection token for the app's `CalendarTypeConfig[]` registry.
@@ -4224,13 +4224,13 @@ function _unsupported_iterable_to_array$k(o, minLen) {
4224
4224
  return {
4225
4225
  imports: [
4226
4226
  ConfigModule
4227
- ].concat(_to_consumable_array$f(dependencyModuleImport), _to_consumable_array$f(imports !== null && imports !== void 0 ? imports : [])),
4227
+ ].concat(_to_consumable_array$g(dependencyModuleImport), _to_consumable_array$g(imports !== null && imports !== void 0 ? imports : [])),
4228
4228
  exports: [
4229
4229
  CALENDAR_SERVER_ACTION_CONTEXT_TOKEN,
4230
4230
  CalendarServerActions,
4231
4231
  AppCalendarTypeConfigService,
4232
4232
  CALENDAR_ICS_DOMAIN_TOKEN
4233
- ].concat(_to_consumable_array$f(exports !== null && exports !== void 0 ? exports : [])),
4233
+ ].concat(_to_consumable_array$g(exports !== null && exports !== void 0 ? exports : [])),
4234
4234
  providers: [
4235
4235
  {
4236
4236
  provide: CALENDAR_TYPE_CONFIGS_TOKEN,
@@ -4262,7 +4262,7 @@ function _unsupported_iterable_to_array$k(o, minLen) {
4262
4262
  CALENDAR_SERVER_ACTION_CONTEXT_TOKEN
4263
4263
  ]
4264
4264
  }
4265
- ].concat(_to_consumable_array$f(providers !== null && providers !== void 0 ? providers : []))
4265
+ ].concat(_to_consumable_array$g(providers !== null && providers !== void 0 ? providers : []))
4266
4266
  };
4267
4267
  }
4268
4268
 
@@ -5197,6 +5197,14 @@ function _ts_generator$w(thisArg, body) {
5197
5197
  });
5198
5198
  }
5199
5199
 
5200
+ function _array_like_to_array$k(arr, len) {
5201
+ if (len == null || len > arr.length) len = arr.length;
5202
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
5203
+ return arr2;
5204
+ }
5205
+ function _array_without_holes$f(arr) {
5206
+ if (Array.isArray(arr)) return _array_like_to_array$k(arr);
5207
+ }
5200
5208
  function asyncGeneratorStep$v(gen, resolve, reject, _next, _throw, key, arg) {
5201
5209
  try {
5202
5210
  var info = gen[key](arg);
@@ -5226,6 +5234,17 @@ function _async_to_generator$v(fn) {
5226
5234
  function _class_call_check$r(instance, Constructor) {
5227
5235
  if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
5228
5236
  }
5237
+ function _iterable_to_array$f(iter) {
5238
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
5239
+ return Array.from(iter);
5240
+ }
5241
+ }
5242
+ function _non_iterable_spread$f() {
5243
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5244
+ }
5245
+ function _to_consumable_array$f(arr) {
5246
+ return _array_without_holes$f(arr) || _iterable_to_array$f(arr) || _unsupported_iterable_to_array$k(arr) || _non_iterable_spread$f();
5247
+ }
5229
5248
  function _ts_generator$v(thisArg, body) {
5230
5249
  var f, y, t, _ = {
5231
5250
  label: 0,
@@ -5325,6 +5344,14 @@ function _ts_generator$v(thisArg, body) {
5325
5344
  };
5326
5345
  }
5327
5346
  }
5347
+ function _unsupported_iterable_to_array$k(o, minLen) {
5348
+ if (!o) return;
5349
+ if (typeof o === "string") return _array_like_to_array$k(o, minLen);
5350
+ var n = Object.prototype.toString.call(o).slice(8, -1);
5351
+ if (n === "Object" && o.constructor) n = o.constructor.name;
5352
+ if (n === "Map" || n === "Set") return Array.from(n);
5353
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$k(o, minLen);
5354
+ }
5328
5355
  /**
5329
5356
  * NestJS injection token for the {@link BaseFormSpaceServerActionsContext}.
5330
5357
  */ var BASE_FORM_SPACE_SERVER_ACTION_CONTEXT_TOKEN = 'BASE_FORM_SPACE_SERVER_ACTION_CONTEXT';
@@ -6106,9 +6133,9 @@ function _ts_generator$v(thisArg, body) {
6106
6133
  var queueFormSpaceForProcessing = _queueFormSpaceForProcessingFactory(context);
6107
6134
  return firebaseServerActionTransformFunctionFactory(processAllQueuedFormSpacesParamsType, function(params) {
6108
6135
  return _async_to_generator$v(function() {
6109
- var limit;
6136
+ var totalSnapshotsLimit;
6110
6137
  return _ts_generator$v(this, function(_state) {
6111
- limit = params.limit;
6138
+ totalSnapshotsLimit = params.limit;
6112
6139
  return [
6113
6140
  2,
6114
6141
  function() {
@@ -6155,9 +6182,10 @@ function _ts_generator$v(thisArg, body) {
6155
6182
  })();
6156
6183
  },
6157
6184
  constraintsFactory: function constraintsFactory() {
6158
- return formSpacesQueuedForProcessingQuery(limit);
6185
+ return formSpacesQueuedForProcessingQuery();
6159
6186
  },
6160
6187
  queryFactory: formSpaceCollection,
6188
+ totalSnapshotsLimit: totalSnapshotsLimit,
6161
6189
  batchSize: undefined,
6162
6190
  performTasksConfig: {
6163
6191
  maxParallelTasks: 10
@@ -6209,13 +6237,13 @@ function _ts_generator$v(thisArg, body) {
6209
6237
  2,
6210
6238
  function() {
6211
6239
  return _async_to_generator$v(function() {
6212
- var startedAt, budget, limit, cutoff, formSpacesExpired, storageFilesFlaggedForDelete, pages, stoppedForTimeBudget, elapsed, documents, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, formSpaceDocument, flagResult, err, result;
6240
+ var startedAt, budget, pageLimit, cutoff, formSpacesExpired, storageFilesFlaggedForDelete, pages, stoppedForTimeBudget, elapsed, documents, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, formSpaceDocument, flagResult, err, result;
6213
6241
  return _ts_generator$v(this, function(_state) {
6214
6242
  switch(_state.label){
6215
6243
  case 0:
6216
6244
  startedAt = Date.now();
6217
6245
  budget = maxRunTimeMs !== null && maxRunTimeMs !== void 0 ? maxRunTimeMs : DEFAULT_FORM_SPACE_EXPIRATION_SWEEP_MAX_RUN_TIME;
6218
- limit = pageSize !== null && pageSize !== void 0 ? pageSize : DEFAULT_FORM_SPACE_EXPIRATION_SWEEP_PAGE_SIZE;
6246
+ pageLimit = pageSize !== null && pageSize !== void 0 ? pageSize : DEFAULT_FORM_SPACE_EXPIRATION_SWEEP_PAGE_SIZE;
6219
6247
  cutoff = before !== null && before !== void 0 ? before : new Date(startedAt);
6220
6248
  formSpacesExpired = 0;
6221
6249
  storageFilesFlaggedForDelete = 0;
@@ -6241,10 +6269,11 @@ function _ts_generator$v(thisArg, body) {
6241
6269
  }
6242
6270
  return [
6243
6271
  4,
6244
- formSpaceCollection.queryDocument(formSpacesDueForExpirationQuery({
6245
- before: cutoff,
6246
- limit: limit
6247
- })).getDocs()
6272
+ formSpaceCollection.queryDocument(_to_consumable_array$f(formSpacesDueForExpirationQuery({
6273
+ before: cutoff
6274
+ })).concat([
6275
+ limit(pageLimit)
6276
+ ])).getDocs()
6248
6277
  ];
6249
6278
  case 2:
6250
6279
  documents = _state.sent();
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@dereekb/firebase-server/model",
3
- "version": "14.7.0",
3
+ "version": "14.9.0",
4
4
  "sideEffects": false,
5
5
  "type": "module",
6
6
  "peerDependencies": {
7
7
  "@cantoo/pdf-lib": ">=2.6.5 <2.11.0",
8
- "@dereekb/analytics": "14.7.0",
9
- "@dereekb/date": "14.7.0",
10
- "@dereekb/firebase": "14.7.0",
11
- "@dereekb/firebase-server": "14.7.0",
12
- "@dereekb/model": "14.7.0",
13
- "@dereekb/nestjs": "14.7.0",
14
- "@dereekb/rxjs": "14.7.0",
15
- "@dereekb/util": "14.7.0",
8
+ "@dereekb/analytics": "14.9.0",
9
+ "@dereekb/date": "14.9.0",
10
+ "@dereekb/firebase": "14.9.0",
11
+ "@dereekb/firebase-server": "14.9.0",
12
+ "@dereekb/model": "14.9.0",
13
+ "@dereekb/nestjs": "14.9.0",
14
+ "@dereekb/rxjs": "14.9.0",
15
+ "@dereekb/util": "14.9.0",
16
16
  "@nestjs/common": "^12.0.1",
17
17
  "@nestjs/config": "^12.0.0",
18
18
  "archiver": "^8.0.0",
package/oidc/index.esm.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { createParamDecorator, Injectable, Inject, Optional, Logger, UnauthorizedException, Post, Req, Body, Controller, HttpStatus, HttpException, Get, Param, Res, HttpCode, All } from '@nestjs/common';
2
+ import { firestoreEncryptedField, firebaseServerActionsContext, FirebaseServerEnvService, DBX_FIREBASE_SERVER_OIDC_SESSION_EXPIRES_AT_CLAIM, notFoundError, badRequestError, forbiddenError, oidcScopesFromRequestAuth, assertEndpointOidcScope, unauthenticatedError, clientIpsMatch, oidcSessionExpiresAtFromRequestAuth, requestClientIp, FirebaseServerAnalyticsService, FIREBASE_FIRESTORE_CONTEXT_TOKEN, FirebaseServerFirestoreContextModule } from '@dereekb/firebase-server';
2
3
  import { errors } from 'oidc-provider';
3
4
  import { SECONDS_IN_MINUTE, SECONDS_IN_DAY, cachedGetter, unixDateTimeSecondsNumberToDate, unixDateTimeSecondsNumberForNow, selectiveFieldEncryptor, filterUndefinedValues, websiteUrlFromPaths, unique, filterKeysOnPOJOFunction, firstValue, SECONDS_IN_HOUR, hasHttpPrefix } from '@dereekb/util';
4
5
  import { generateKeyPairSync, randomBytes, randomUUID } from 'node:crypto';
5
6
  import { resolveEncryptionKey, encryptValue, decryptValue, createAesStringEncryptionProvider, isValidAES256GCMEncryptionSecret } from '@dereekb/nestjs';
6
7
  import { where, iterateFirestoreDocumentSnapshotPairs, firestoreModelIdentity, snapshotConverterFunctions, optionalFirestoreDate, firestoreDate, firestoreEnum, firestorePassThroughField, AbstractFirestoreDocument, createOidcClientParamsType, deleteOidcClientParamsType, deleteOidcTokenParamsType, rotateOidcClientSecretParamsType, updateOidcClientParamsType, firestoreModelKey, oidcEntryIdentity, PUBLIC_PKCE_TOKEN_ENDPOINT_AUTH_METHOD, OIDC_ENTRY_CLIENT_TYPE, oidcEntriesByUserCodeQuery, oidcEntriesByUidQuery, oidcEntriesByGrantIdQuery, assignmentOnlyScopesForOidcProviderProfiles, adminOnlyScopesForOidcProviderProfiles, oidcProviderProfilesForClient, requiredScopesForOidcProviderProfiles, scopesForOidcProviderProfiles, CLI_TOKEN_OIDC_SCOPE, SERVICE_TOKEN_OIDC_SCOPE, OFFLINE_ACCESS_OIDC_SCOPE, OIDC_ENTRY_CLI_TOKEN_CLAIM_TYPE, oidcScopesFromScopeClaim, oidcEntryFirestoreCollection } from '@dereekb/firebase';
7
- import { firestoreEncryptedField, firebaseServerActionsContext, FirebaseServerEnvService, notFoundError, badRequestError, forbiddenError, oidcScopesFromRequestAuth, assertEndpointOidcScope, unauthenticatedError, clientIpsMatch, requestClientIp, FirebaseServerAnalyticsService, FIREBASE_FIRESTORE_CONTEXT_TOKEN, FirebaseServerFirestoreContextModule } from '@dereekb/firebase-server';
8
8
  import { nanoid } from 'nanoid';
9
9
  import { safeToJsDate } from '@dereekb/date';
10
10
  import { makeUrlSearchParamsString } from '@dereekb/util/fetch';
@@ -401,12 +401,7 @@ function _define_property$l(obj, key, value) {
401
401
  /**
402
402
  * Custom oidc-provider client metadata field for a client's maximum requestable login duration (seconds).
403
403
  */ var DBX_FIREBASE_SERVER_OIDC_MAX_SESSION_TTL_CLIENT_METADATA = 'dbx_max_session_ttl';
404
- /**
405
- * Access-token `extra` claim carrying the grant's resolved expiry as unix seconds.
406
- *
407
- * Baked on at issuance (`extraTokenClaims`) and read back by `verifyAccessToken` and the
408
- * `GET /oidc/session` route so clients can surface the session lifetime without decoding the token.
409
- */ var DBX_FIREBASE_SERVER_OIDC_SESSION_EXPIRES_AT_CLAIM = 'dbx_session_expires_at';
404
+ // `DBX_FIREBASE_SERVER_OIDC_SESSION_EXPIRES_AT_CLAIM` is declared in the core `@dereekb/firebase-server` layer so non-OIDC endpoints can read it.
410
405
  /**
411
406
  * Access-token `extra` claim flagging whether the grant's refresh token rotation is disabled.
412
407
  *
@@ -6877,15 +6872,8 @@ OidcCliTokenService = OidcCliTokenService_1 = __decorate([
6877
6872
  * @param auth - The request auth data.
6878
6873
  * @returns Remaining seconds on the parent grant, or `undefined`.
6879
6874
  */ function parentGrantRemainingSeconds(auth) {
6880
- var _ref;
6881
- var _claims_oidcValidatedToken, _claims_token;
6882
- var claims = auth !== null && auth !== void 0 ? auth : {};
6883
- var raw = (_ref = (_claims_oidcValidatedToken = claims.oidcValidatedToken) === null || _claims_oidcValidatedToken === void 0 ? void 0 : _claims_oidcValidatedToken[DBX_FIREBASE_SERVER_OIDC_SESSION_EXPIRES_AT_CLAIM]) !== null && _ref !== void 0 ? _ref : (_claims_token = claims.token) === null || _claims_token === void 0 ? void 0 : _claims_token[DBX_FIREBASE_SERVER_OIDC_SESSION_EXPIRES_AT_CLAIM];
6884
- var result;
6885
- if (typeof raw === 'number' && Number.isFinite(raw)) {
6886
- result = raw - unixDateTimeSecondsNumberForNow();
6887
- }
6888
- return result;
6875
+ var expiresAt = oidcSessionExpiresAtFromRequestAuth(auth);
6876
+ return expiresAt == null ? undefined : expiresAt - unixDateTimeSecondsNumberForNow();
6889
6877
  }
6890
6878
  /**
6891
6879
  * Returns true when a stored claim entry is past its `expiresAt`.
package/oidc/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@dereekb/firebase-server/oidc",
3
- "version": "14.7.0",
3
+ "version": "14.9.0",
4
4
  "sideEffects": false,
5
5
  "type": "module",
6
6
  "peerDependencies": {
7
- "@dereekb/analytics": "14.7.0",
8
- "@dereekb/date": "14.7.0",
9
- "@dereekb/firebase": "14.7.0",
10
- "@dereekb/firebase-server": "14.7.0",
11
- "@dereekb/model": "14.7.0",
12
- "@dereekb/nestjs": "14.7.0",
13
- "@dereekb/oauth-resource": "14.7.0",
14
- "@dereekb/rxjs": "14.7.0",
15
- "@dereekb/util": "14.7.0",
16
- "@dereekb/zoho": "14.7.0",
7
+ "@dereekb/analytics": "14.9.0",
8
+ "@dereekb/date": "14.9.0",
9
+ "@dereekb/firebase": "14.9.0",
10
+ "@dereekb/firebase-server": "14.9.0",
11
+ "@dereekb/model": "14.9.0",
12
+ "@dereekb/nestjs": "14.9.0",
13
+ "@dereekb/oauth-resource": "14.9.0",
14
+ "@dereekb/rxjs": "14.9.0",
15
+ "@dereekb/util": "14.9.0",
16
+ "@dereekb/zoho": "14.9.0",
17
17
  "@nestjs/common": "^12.0.1",
18
18
  "@nestjs/config": "^12.0.0",
19
19
  "express": "^5.2.1",
@@ -9,13 +9,6 @@ export declare const DBX_FIREBASE_SERVER_OIDC_SESSION_TTL_PARAM = "dbx_session_t
9
9
  * Custom oidc-provider client metadata field for a client's maximum requestable login duration (seconds).
10
10
  */
11
11
  export declare const DBX_FIREBASE_SERVER_OIDC_MAX_SESSION_TTL_CLIENT_METADATA = "dbx_max_session_ttl";
12
- /**
13
- * Access-token `extra` claim carrying the grant's resolved expiry as unix seconds.
14
- *
15
- * Baked on at issuance (`extraTokenClaims`) and read back by `verifyAccessToken` and the
16
- * `GET /oidc/session` route so clients can surface the session lifetime without decoding the token.
17
- */
18
- export declare const DBX_FIREBASE_SERVER_OIDC_SESSION_EXPIRES_AT_CLAIM = "dbx_session_expires_at";
19
12
  /**
20
13
  * Access-token `extra` claim flagging whether the grant's refresh token rotation is disabled.
21
14
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/firebase-server",
3
- "version": "14.7.0",
3
+ "version": "14.9.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "exports": {
@@ -58,18 +58,18 @@
58
58
  },
59
59
  "peerDependencies": {
60
60
  "@cantoo/pdf-lib": ">=2.6.5 <2.11.0",
61
- "@dereekb/analytics": "14.7.0",
62
- "@dereekb/calcom": "14.7.0",
63
- "@dereekb/date": "14.7.0",
64
- "@dereekb/dbx-core": "14.7.0",
65
- "@dereekb/discord": "14.7.0",
66
- "@dereekb/firebase": "14.7.0",
67
- "@dereekb/model": "14.7.0",
68
- "@dereekb/nestjs": "14.7.0",
69
- "@dereekb/oauth-resource": "14.7.0",
70
- "@dereekb/rxjs": "14.7.0",
71
- "@dereekb/util": "14.7.0",
72
- "@dereekb/zoho": "14.7.0",
61
+ "@dereekb/analytics": "14.9.0",
62
+ "@dereekb/calcom": "14.9.0",
63
+ "@dereekb/date": "14.9.0",
64
+ "@dereekb/dbx-core": "14.9.0",
65
+ "@dereekb/discord": "14.9.0",
66
+ "@dereekb/firebase": "14.9.0",
67
+ "@dereekb/model": "14.9.0",
68
+ "@dereekb/nestjs": "14.9.0",
69
+ "@dereekb/oauth-resource": "14.9.0",
70
+ "@dereekb/rxjs": "14.9.0",
71
+ "@dereekb/util": "14.9.0",
72
+ "@dereekb/zoho": "14.9.0",
73
73
  "@google-cloud/firestore": "^7.11.6",
74
74
  "@google-cloud/storage": "^7.22.0",
75
75
  "@modelcontextprotocol/node": "2.0.0",
@@ -0,0 +1,24 @@
1
+ import { type Maybe, type UnixDateTimeSecondsNumber } from '@dereekb/util';
2
+ import { type FirebaseServerAuthData } from './auth.context.server';
3
+ /**
4
+ * Access-token `extra` claim carrying the grant's resolved expiry as unix seconds.
5
+ *
6
+ * Baked on at issuance (`extraTokenClaims`) and read back by `verifyAccessToken` and the
7
+ * `GET /oidc/session` route so clients can surface the session lifetime without decoding the token.
8
+ *
9
+ * Declared in this core layer (and re-exported by `@dereekb/firebase-server/oidc`) so non-OIDC
10
+ * endpoints such as the direct-Firestore session can bound what they mint by the caller's own
11
+ * lifetime without importing the OIDC sub-package.
12
+ */
13
+ export declare const DBX_FIREBASE_SERVER_OIDC_SESSION_EXPIRES_AT_CLAIM = "dbx_session_expires_at";
14
+ /**
15
+ * Reads when the CALLER's own OIDC grant expires, from the {@link DBX_FIREBASE_SERVER_OIDC_SESSION_EXPIRES_AT_CLAIM}
16
+ * claim baked onto the access token at issuance.
17
+ *
18
+ * Returns `undefined` when the claim is absent — a non-OIDC caller (plain Firebase ID token), or a
19
+ * token issued before the claim existed. Callers must treat that as "no bound", not "expired".
20
+ *
21
+ * @param auth - The request auth data, or undefined for unauthenticated requests.
22
+ * @returns The caller's grant expiry in unix seconds, or `undefined`.
23
+ */
24
+ export declare function oidcSessionExpiresAtFromRequestAuth(auth: Maybe<FirebaseServerAuthData>): Maybe<UnixDateTimeSecondsNumber>;
@@ -1,5 +1,6 @@
1
1
  export * from './auth.context.server';
2
2
  export * from './api.scope';
3
+ export * from './api.session-expiry';
3
4
  export * from './request.ip';
4
5
  export * from './download';
5
6
  export * from './model';
@@ -40,6 +40,16 @@ export declare const MAX_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS: Milliseconds;
40
40
  * Firebase). The exchanged ID token then lives its own hour from sign-in.
41
41
  */
42
42
  export declare const FIREBASE_CUSTOM_TOKEN_EXCHANGE_WINDOW_MILLIS: Milliseconds;
43
+ /**
44
+ * Default grace allowed below {@link MIN_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS} when checking the
45
+ * caller's remaining lifetime (2 minutes).
46
+ *
47
+ * A session cannot be shorter than that App Check floor, so a caller whose own credential ends sooner
48
+ * is refused rather than handed a session that outlives it. The leeway covers the unavoidable delay
49
+ * between minting a credential and using it: a credential minted to last exactly the floor can still
50
+ * open a session for this long afterwards, and that session outlives it by at most this much.
51
+ */
52
+ export declare const DEFAULT_FIRESTORE_SESSION_CALLER_EXPIRY_LEEWAY_MILLIS: Milliseconds;
43
53
  /**
44
54
  * Signature for the predicate that authorizes a caller to open a direct-Firestore session.
45
55
  *
@@ -82,6 +92,13 @@ export declare abstract class SessionApiModuleConfig {
82
92
  * Defaults to {@link DEFAULT_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS}.
83
93
  */
84
94
  readonly appCheckTokenTtlMillis?: Milliseconds;
95
+ /**
96
+ * Grace allowed below {@link MIN_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS} when checking an OIDC
97
+ * caller's remaining lifetime. A caller with less than `floor - leeway` left is refused.
98
+ *
99
+ * Defaults to {@link DEFAULT_FIRESTORE_SESSION_CALLER_EXPIRY_LEEWAY_MILLIS}.
100
+ */
101
+ readonly callerExpiryLeewayMillis?: Milliseconds;
85
102
  /**
86
103
  * OIDC scope term an OIDC caller must hold to open a session. Defaults to
87
104
  * {@link FIRESTORE_SESSION_OIDC_SCOPE}. Pass `null` to disable scope enforcement entirely (the admin
@@ -7,6 +7,12 @@ import { type FirestoreSessionAdminPredicate, SessionApiModuleConfig } from './s
7
7
  * Error code thrown when the caller is not authorized to open a direct-Firestore session.
8
8
  */
9
9
  export declare const FIRESTORE_SESSION_FORBIDDEN_ERROR_CODE = "FIRESTORE_SESSION_FORBIDDEN_ERROR";
10
+ /**
11
+ * Error code thrown when the caller's own OIDC credential expires too soon to back a session — less
12
+ * than {@link MIN_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS} minus the configured leeway remains. The
13
+ * client should re-authenticate (or mint a fresh CLI handoff) and try again.
14
+ */
15
+ export declare const FIRESTORE_SESSION_CALLER_EXPIRING_ERROR_CODE = "FIRESTORE_SESSION_CALLER_EXPIRING_ERROR";
10
16
  /**
11
17
  * A short-lived credential bundle that lets a headless client connect directly to Firestore as the
12
18
  * authenticated user, through the app's security rules.
@@ -52,6 +58,20 @@ export interface FirestoreSessionResult {
52
58
  *
53
59
  * The custom token is ALWAYS minted for `auth.uid`; there is no way to ask for someone else's session,
54
60
  * so a granted session is exactly as privileged as the caller already is under Firestore rules.
61
+ *
62
+ * ## Lifetime
63
+ *
64
+ * A session never outlives the OIDC credential that opened it (read from the caller's
65
+ * `dbx_session_expires_at` claim): the App Check TTL and the reported `expiresAt` are both capped at
66
+ * the caller's expiry. The App Check token cannot be shorter than
67
+ * {@link MIN_FIRESTORE_SESSION_APP_CHECK_TTL_MILLIS}, so a caller with less than that floor (minus
68
+ * {@link SessionApiModuleConfig.callerExpiryLeewayMillis}) remaining is refused with
69
+ * {@link FIRESTORE_SESSION_CALLER_EXPIRING_ERROR_CODE}. Inside the leeway the attestation may outlive
70
+ * the caller by at most the leeway.
71
+ *
72
+ * The Firebase custom token's one-hour exchange window is fixed by Firebase and cannot be shortened;
73
+ * the capped `expiresAt` is what stops a well-behaved client from reusing the session past its caller.
74
+ * A caller with no expiry claim (a non-OIDC Firebase ID token) is not bounded.
55
75
  */
56
76
  export declare class FirestoreSessionApiService {
57
77
  private readonly _logger;
package/test/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@dereekb/firebase-server/test",
3
- "version": "14.7.0",
3
+ "version": "14.9.0",
4
4
  "sideEffects": false,
5
5
  "type": "module",
6
6
  "peerDependencies": {
7
- "@dereekb/analytics": "14.7.0",
8
- "@dereekb/date": "14.7.0",
9
- "@dereekb/firebase": "14.7.0",
10
- "@dereekb/firebase-server": "14.7.0",
11
- "@dereekb/firebase-server/oidc": "14.7.0",
12
- "@dereekb/model": "14.7.0",
13
- "@dereekb/nestjs": "14.7.0",
14
- "@dereekb/oauth-resource": "14.7.0",
15
- "@dereekb/rxjs": "14.7.0",
16
- "@dereekb/util": "14.7.0",
7
+ "@dereekb/analytics": "14.9.0",
8
+ "@dereekb/date": "14.9.0",
9
+ "@dereekb/firebase": "14.9.0",
10
+ "@dereekb/firebase-server": "14.9.0",
11
+ "@dereekb/firebase-server/oidc": "14.9.0",
12
+ "@dereekb/model": "14.9.0",
13
+ "@dereekb/nestjs": "14.9.0",
14
+ "@dereekb/oauth-resource": "14.9.0",
15
+ "@dereekb/rxjs": "14.9.0",
16
+ "@dereekb/util": "14.9.0",
17
17
  "@google-cloud/firestore": "^7.11.6",
18
18
  "@google-cloud/storage": "^7.22.0",
19
19
  "@nestjs/common": "^12.0.1",
@@ -26,7 +26,7 @@
26
26
  "supertest": "^7.2.2"
27
27
  },
28
28
  "devDependencies": {
29
- "@dereekb/nestjs": "14.7.0"
29
+ "@dereekb/nestjs": "14.9.0"
30
30
  },
31
31
  "exports": {
32
32
  "./package.json": "./package.json",
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@dereekb/firebase-server/twilio",
3
- "version": "14.7.0",
3
+ "version": "14.9.0",
4
4
  "sideEffects": false,
5
5
  "type": "module",
6
6
  "peerDependencies": {
7
- "@dereekb/date": "14.7.0",
8
- "@dereekb/firebase": "14.7.0",
9
- "@dereekb/firebase-server": "14.7.0",
10
- "@dereekb/model": "14.7.0",
11
- "@dereekb/nestjs": "14.7.0",
12
- "@dereekb/rxjs": "14.7.0",
13
- "@dereekb/util": "14.7.0"
7
+ "@dereekb/date": "14.9.0",
8
+ "@dereekb/firebase": "14.9.0",
9
+ "@dereekb/firebase-server": "14.9.0",
10
+ "@dereekb/model": "14.9.0",
11
+ "@dereekb/nestjs": "14.9.0",
12
+ "@dereekb/rxjs": "14.9.0",
13
+ "@dereekb/util": "14.9.0"
14
14
  },
15
15
  "exports": {
16
16
  "./package.json": "./package.json",
package/zoho/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@dereekb/firebase-server/zoho",
3
- "version": "14.7.0",
3
+ "version": "14.9.0",
4
4
  "sideEffects": false,
5
5
  "type": "module",
6
6
  "peerDependencies": {
7
- "@dereekb/analytics": "14.7.0",
8
- "@dereekb/date": "14.7.0",
9
- "@dereekb/firebase": "14.7.0",
10
- "@dereekb/firebase-server": "14.7.0",
11
- "@dereekb/model": "14.7.0",
12
- "@dereekb/nestjs": "14.7.0",
13
- "@dereekb/rxjs": "14.7.0",
14
- "@dereekb/util": "14.7.0",
15
- "@dereekb/zoho": "14.7.0",
7
+ "@dereekb/analytics": "14.9.0",
8
+ "@dereekb/date": "14.9.0",
9
+ "@dereekb/firebase": "14.9.0",
10
+ "@dereekb/firebase-server": "14.9.0",
11
+ "@dereekb/model": "14.9.0",
12
+ "@dereekb/nestjs": "14.9.0",
13
+ "@dereekb/rxjs": "14.9.0",
14
+ "@dereekb/util": "14.9.0",
15
+ "@dereekb/zoho": "14.9.0",
16
16
  "@nestjs/common": "^12.0.1",
17
17
  "@nestjs/config": "^12.0.0",
18
18
  "express": "^5.2.1"