import * as plugins from '../../plugins.js'; import { DcRouterDb } from '../classes.dcrouter-db.js'; const getDb = () => DcRouterDb.getInstance().getDb(); /** * Durable, binding-scoped Web Push admission counters. * * A credential rotation must not reset these counters, so the stable binding * id and lifecycle generation are the authority rather than a credential id. */ @plugins.smartdata.Collection(() => getDb()) export class WebPushAdmissionDoc extends plugins.smartdata.SmartDataDbDoc< WebPushAdmissionDoc, WebPushAdmissionDoc > { @plugins.smartdata.svDb() public bindingId!: string; @plugins.smartdata.svDb() public lifecycleGeneration!: number; @plugins.smartdata.svDb() public shortWindowStartedAt!: number; @plugins.smartdata.svDb() public shortWindowCount!: number; @plugins.smartdata.svDb() public longWindowStartedAt!: number; @plugins.smartdata.svDb() public longWindowCount!: number; @plugins.smartdata.svDb() public revision!: number; @plugins.smartdata.svDb() public updatedAt!: number; @plugins.smartdata.svDb() public purgeAt!: Date; public static getNativeCollection(): plugins.smartdata.SmartdataCollection['mongoDbCollection'] { return getDb().mongoDb.collection('WebPushAdmissionDoc'); } }