/** * @module notification.query * * Firestore query constraint builders for notification model documents. * Used by the server-side action service to find documents that need processing. */ import { type FirestoreQueryConstraint } from '../../common/firestore'; import { type NotificationBoxSendExclusion } from './notification.id'; import { type ArrayOrValue } from '@dereekb/util'; /** * Query constraints for finding {@link NotificationUser} documents that have pending config syncs (`ns == true`). * * Used by the server to discover users whose configs need to be synced to their NotificationBox recipients. * * @returns array of Firestore query constraints filtering for users needing sync */ export declare function notificationUsersFlaggedForNeedsSyncQuery(): FirestoreQueryConstraint[]; /** * Query constraints for finding {@link NotificationUser} documents that have any of the given exclusion IDs in their `x` array. * * @param exclusionId - one or more box IDs or collection name prefixes to match against * @returns array of Firestore query constraints filtering for users with matching exclusions */ export declare function notificationUserHasExclusionQuery(exclusionId: ArrayOrValue): FirestoreQueryConstraint[]; /** * Query constraints for finding {@link NotificationSummary} documents that need server-side initialization (`s == true`). * * @returns array of Firestore query constraints filtering for summaries needing initialization */ export declare function notificationSummariesFlaggedForNeedsInitializationQuery(): FirestoreQueryConstraint[]; /** * Query constraints for finding {@link NotificationBox} documents that need server-side initialization (`s == true`). * * @returns array of Firestore query constraints filtering for boxes needing initialization */ export declare function notificationBoxesFlaggedForNeedsInitializationQuery(): FirestoreQueryConstraint[]; /** * Query constraints for finding {@link NotificationBox} documents flagged as invalid (`fi == true`). * * Used by the server to clean up boxes that could not be initialized. * * @returns array of Firestore query constraints filtering for boxes flagged as invalid */ export declare function notificationBoxesFlaggedInvalidQuery(): FirestoreQueryConstraint[]; /** * Query constraints for finding {@link Notification} documents that are ready to be sent * (not done and `sat` is in the past). * * This is the primary query used by the send queue processor. * * @param now - reference time for the `sat` comparison (defaults to current time) * @returns array of Firestore query constraints filtering for notifications past their scheduled send time */ export declare function notificationsPastSendAtTimeQuery(now?: Date): FirestoreQueryConstraint[]; /** * Query constraints for finding {@link Notification} documents marked as done (`d == true`) * and ready to be archived to {@link NotificationWeek} and then deleted. * * @returns array of Firestore query constraints filtering for completed notifications ready to archive */ export declare function notificationsReadyForCleanupQuery(): FirestoreQueryConstraint[];