Files
ai_platform/lib/ops-state.js
dsyoon 073a8343dd feat: xavis ai_platform 기능 이전 및 ncue 환경 전환
xavis 소스·DB 스키마·활용사례/F-Scan/프롬프트 라이브러리 등 기능 반영.
@xavis.co.kr → @ncue.net, 관리자 토큰 ncue-admin, 런타임 data/ Git 추적 제외.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-26 22:27:48 +09:00

36 lines
892 B
JavaScript

/**
* OPS_STATE: DEV(개발), PROD(운영·임직원 이메일 로그인), SUPER(데모·제한 완화).
* 과거 값 REAL 은 PROD 와 동일하게 처리합니다.
*/
function normalizeOpsState() {
const raw = (process.env.OPS_STATE || "DEV").trim().toUpperCase();
if (raw === "REAL") return "PROD";
if (raw === "DEV" || raw === "PROD" || raw === "SUPER") return raw;
return "DEV";
}
function isOpsStateDev() {
return normalizeOpsState() === "DEV";
}
function isOpsStateProd() {
return normalizeOpsState() === "PROD";
}
function isOpsStateSuper() {
return normalizeOpsState() === "SUPER";
}
/** 임직원 이메일(@ncue.net) 매직 링크 로그인을 강제하는 모드 (REAL 구 값 포함) */
function isOpsProdMode() {
return isOpsStateProd();
}
module.exports = {
normalizeOpsState,
isOpsStateDev,
isOpsStateProd,
isOpsStateSuper,
isOpsProdMode,
};