NotificationRecipientLiveness — @gj-kit/nest-notifications
A public interface from @gj-kit/nest-notifications/core. The signature below is taken directly from the 0.1.1 release declaration.
Verified import example
Section titled “Verified import example”import { NotificationRecipientLiveness } from '@gj-kit/nest-notifications/core';Signature, parameters, and return type
Section titled “Signature, parameters, and return type”/** * ingress·계정 수명주기 포트와 의무 I1–I3 · L1–L4 (설계 §3.3.6). * * 파이프라인은 이 파일의 어떤 메서드도 호출하지 않는다. 그런데도 `./core`에 있는 이유는 * 이 패키지의 첫 보증(G1: ingress 멱등)과 유일한 "개인정보 사고" 등급 보증(G7: tombstone * 이후 배달 0)이 전적으로 이 두 포트 위에 서 있기 때문이다. 라이브러리가 이 의무를 강제할 * 수 없다는 사실도 그대로 적는다 — 강제하는 것은 `./testing`의 적합성 케이스뿐이다. *//** * Recipient lifecycle barrier. The library calls neither method: staging calls * `ensureLive` from the host publisher, and account deletion calls `tombstone` * from the host lifecycle. * * `notificationRecipientKey(applicationKey, recipientRef)` is the intended key * for the tombstone row: it lets an implementation retain the barrier after a * purge without retaining the raw recipient reference. * * Obligations (design 3.3.6): * * - **I2** — `stage` calls `ensureLive` inside its own transaction, before the * insert, and writes nothing when it returns false. Acquiring - not merely * reading - is what makes stage and purge serialise against each other. * - **L3** — the tombstone row survives the purge that follows it. Delete it and * a late `ensureLive` returns true, so a deleted account starts receiving * notifications again. */interface NotificationRecipientLiveness<Transaction = unknown> { /** * Acquires the recipient gate inside this transaction and returns false once * the ref is tombstoned (I2). */ ensureLive(transaction: Transaction, applicationKey: string, recipientRef: string): Promise<boolean>; /** Marks deletion. The tombstone row must survive the purge that follows (L3). */ tombstone(transaction: Transaction, applicationKey: string, recipientRef: string): Promise<void>;}This declaration is the source of truth for parameters, optionality, generics, return values, and public union/type contracts. Check the package golden path and this subpath’s import conditions for required environment, permission, and error boundaries before calling it.
Release context
Section titled “Release context”- Package:
@gj-kit/nest-notifications - Version:
0.1.1 - Public entry:
./core - Source: GitHub