TossPaymentsPostgresOptions — @gj-kit/toss-payments-postgresql
@gj-kit/toss-payments-postgresql에서 공개하는 interface입니다. package version 0.5.1의 release declaration을 그대로 표시합니다.
검증된 import 예제
섹션 제목: “검증된 import 예제”import { TossPaymentsPostgresOptions } from '@gj-kit/toss-payments-postgresql';시그니처, 매개변수, 반환 타입
섹션 제목: “시그니처, 매개변수, 반환 타입”/** * createTossPaymentsPostgres — 스토어 집합체 팩토리 (설계 §5) + cleanup (설계 §6). * * 팩토리는 **순수 조립**이다 — 즉시 DB 접속이 없고 첫 쿼리가 첫 접점이다. 스키마 * 식별자 검증만 조립 시점에 수행해 잘못된 설정을 즉시 드러낸다(fail-fast). * 부팅 시 자동 DDL도, 자동 cleanup 타이머도 없다 — 모든 옵션 기본 꺼짐 원칙. */interface TossPaymentsPostgresOptions { readonly sql: SqlClient; /** * billing key·deposit secret·cancel retry record의 필수 at-rest 보호기. * * 기본값은 없다. 평문 개발 DB를 의도적으로 써야 할 때만 * `unsafePlaintextSensitiveValueProtector`를 명시해 전달한다. 보호기는 `purpose`와 * `recordId`를 AAD에 결속해야 한다. */ readonly sensitiveValueProtector: SensitiveValueProtector; /** 기본 'toss_payments'. `/^[a-z_][a-z0-9_]{0,62}$/` 위반 시 조립 시점에 throw. */ readonly schema?: string; readonly dedupe?: { /** processing 행의 crash-recovery lease(초). 기본 60. */ readonly leaseSeconds?: number; /** * completed 행의 TTL(초). 기본 432_000(5일) — 코어 TSDoc "토스 최장 재전송 * 기간보다 긴 TTL, 권장 5일". 삭제는 cleanup() 호출 시에만 일어난다. */ readonly completedTtlSeconds?: number; }; readonly retention?: { /** * cancel_retries 보존 일수. 기본 15 — 토스 멱등키 유효기간과 일치. * **양의 정수**여야 한다(cleanup SQL의 make_interval days 파라미터가 int) — * 소수는 조립 시점에 TypeError로 거부된다. */ readonly cancelRetryDays?: number; };}이 선언은 매개변수, optionality, 제네릭, 반환값, 공개 union/type 계약의 정본입니다. 호출 전 필요한 환경·권한·오류 경계는 패키지 Golden path와 이 subpath의 import 조건을 함께 확인하세요.
Release context
섹션 제목: “Release context”- 패키지:
@gj-kit/toss-payments-postgresql - 버전:
0.5.1 - 공개 entry:
. - 소스: GitHub
구현 주석
섹션 제목: “구현 주석”createTossPaymentsPostgres — 스토어 집합체 팩토리 (설계 §5) + cleanup (설계 §6).
팩토리는 순수 조립이다 — 즉시 DB 접속이 없고 첫 쿼리가 첫 접점이다. 스키마 식별자 검증만 조립 시점에 수행해 잘못된 설정을 즉시 드러낸다(fail-fast). 부팅 시 자동 DDL도, 자동 cleanup 타이머도 없다 — 모든 옵션 기본 꺼짐 원칙.