// The module's names and limits, in a file with no import: a browser bundle can take them without // loading the data layer the schemas live beside. /** The format an export names itself with, so a reader of the file knows which shape it holds. */ export const ACCOUNT_EXPORT_FORMAT = "conusai.account-export.v1" /** The section of an export that holds this app's own rows about the person. */ export const ACCOUNT_SECTION = "account" /** * How recent the sign-in of the session that asks for a deletion must be. Deleting an account is the * owner action the template spec's session policy asks a re-authentication for (ยง7): a session that * was left open on a shared machine is not enough. */ export const RECENT_SIGN_IN_SECONDS = 15 * 60 /** The job that resumes a deletion a module's erasure held up, and how often the worker runs it. */ export const DELETION_SWEEP_JOB = "account.deletion.sweep" export const DELETION_SWEEP_CRON = "*/5 * * * *" /** What a deleted user row is left holding until the deletion completes: no provider identity, no address. */ export const DETACHED_ISSUER = "urn:conusai:account:deleted" export const DETACHED_DISPLAY_NAME = "Deleted account" /** Where the account page lives: `settings` is a reserved organization slug, so no organization shadows it. */ export const ACCOUNT_PATH = "/settings/account" /** * The job that delivers the revocations of app sessions whose derived service sessions a module's * platform has not confirmed ending yet, and how often the worker runs it (pg-boss's finest cron). */ export const REVOCATION_JOB = "account.sessions.revoke" export const REVOCATION_CRON = "* * * * *" /** How long one module's revocation call may take before it counts as failed (a sign-out waits no longer). */ export const REVOCATION_CALL_MS = 3000 /** How long a delivery pass holds its row: well above one bounded call, so a pass that died is retried. */ export const REVOCATION_CLAIM_MS = 30_000 /** The first retry waits this long, each next one twice as long, up to REVOCATION_BACKOFF_MAX_MS. */ export const REVOCATION_BACKOFF_MS = 30_000 export const REVOCATION_BACKOFF_MAX_MS = 5 * 60_000 /** * The longest a derived service session can outlive its app session's revocation: a Support widget * session lives 60 minutes from its mint (the platform's fixed lifetime), plus a margin for clocks. * A revocation still undelivered after this has nothing left to end: it is `lapsed`, not retried. */ export const DERIVED_SESSION_LIFETIME_MS = 65 * 60_000 /** Delivered and lapsed revocation rows are removed this long after they finished. */ export const REVOCATION_RETENTION_MS = 24 * 60 * 60_000