export { L as LOCALE_COOKIE_KEY, e as LOCALE_INFO_MAP, f as LocaleInfo, S as SupportedLocale, d as getDialCode, c as getFlag, g as getLocaleInfo, b as getSupportedLocales, i as isRTL } from './locale.constants-BNkSdNP1.js'; import { S as SectionDefinition, b as SyncOptions, c as SyncResult } from './index-Dh5FjWzR.js'; export { e as extractLabels, f as flattenLabels } from './index-Dh5FjWzR.js'; export { cmsDraftCacheRepository, cmsLabelValuesRepository, cmsLabelsRepository, cmsPublishedCacheRepository } from './server/repositories/index.js'; export { CmsLabel, NewCmsLabel, cmsLabels } from './server/entities/cms-labels.js'; export { CmsLabelValue, NewCmsLabelValue, cmsLabelValues } from './server/entities/cms-label-values.js'; export { CmsDraftCache, NewCmsDraftCache, cmsDraftCache } from './server/entities/cms-draft-cache.js'; export { CmsPublishedCache, NewCmsPublishedCache, cmsPublishedCache } from './server/entities/cms-published-cache.js'; export { CmsAuditLog, NewCmsAuditLog, cmsAuditLogs } from './server/entities/cms-audit-logs.js'; export { c as createLabelSyncGenerator } from './label-sync-generator-B0EmvtWM.js'; import 'drizzle-orm/pg-core'; import '@spfn/core/codegen'; /** * CMS Sync Utilities * * JSON 파일 기반 라벨 동기화 */ /** * 여러 섹션 동기화 */ declare function syncAll(sections: SectionDefinition[], options?: SyncOptions): Promise; /** * JSON 파일에서 라벨 로드 */ declare function loadLabelsFromJson(labelsDir: string): SectionDefinition[]; /** * 섹션 라벨 동기화 */ declare function syncSection(definition: SectionDefinition, options?: SyncOptions): Promise; /** * Initialize label sync for server startup * * Call this in your server.config.ts beforeRoutes hook * * @param options - Sync options * @param options.labelsDir - Path to labels directory (default: 'src/lib/labels') * * @example * ```typescript * import { initLabelSync } from '@spfn/cms'; * * export default { * beforeRoutes: async (app) => { * await initLabelSync({ verbose: true }); * }, * } satisfies ServerConfig; * ``` */ declare function initLabelSync(options?: SyncOptions & { labelsDir?: string; }): Promise; /** * @spfn/cms/server * * Server-side Only Module * 서버 전용 모듈 (서버 컴포넌트 + 백엔드) * * Includes: * - Server Components (getSection, getSections) * - Locale Management (Server Actions) * - Backend: Sync utilities * - Backend: Repositories * - Backend: Entities * - Backend: Label helpers * - Backend: Codegen generators * * @note This module should only be imported in server-side code */ /** * Section Data Type */ type SectionData = { section: string; locale: string; content: Record; version: number; publishedAt: string | null; }; /** * Translation Function Type (runtime version) */ type ServerTranslationFunction = (key: string, defaultValue?: any, replace?: Record) => any; /** * Section API Return Type */ type SectionAPI = { /** * 라벨 값 가져오기 (변수 치환 지원) * * @param key - 라벨 키 (섹션 제외, 예: 'hero.title') * @param defaultValue - 기본값 * @param replace - 변수 치환 맵 (예: { name: 'John' }) * @returns 라벨 값 (문자열인 경우 변수 치환됨) */ t: ServerTranslationFunction; /** * 섹션 데이터 */ data: SectionData; }; /** * 섹션 데이터 로드 (React cache 적용) * * 동일한 요청 내에서 같은 섹션을 여러 번 요청해도 한 번만 API 호출 * * @param section - 섹션 이름 (예: 'home', 'why-futureplay') * @param locale - 언어 코드 (선택, 미지정시 쿠키에서 자동 조회) * @returns Section API ({ t, data }) * * @example * ```tsx * // Server Component * import { getSection } from '@spfn/cms/server'; * * export default async function HomePage() * { * // locale을 지정하지 않으면 쿠키에서 자동으로 가져옴 * const { t } = await getSection('home'); * * // 또는 명시적으로 locale 지정 * const { t: tEn } = await getSection('home', 'en'); * * return ( *
*

{t('hero.title')}

*

{t('hero.subtitle', 'Default Subtitle')}

*

{t('hero.greeting', 'Hello {name}!', { name: 'World' })}

*
* ); * } * ``` */ declare const getSection: (section: string, locale?: string) => Promise; /** * 여러 섹션 한번에 로드 (React cache 적용) * 단일 API 호출로 여러 섹션을 효율적으로 가져옵니다 * * @param sections - 섹션 이름 배열 * @param locale - 언어 코드 (선택, 미지정시 쿠키에서 자동 조회) * @returns Section API 맵 ({ home: { t, data }, ... }) * * @example * ```tsx * // Server Component * import { getSections } from '@spfn/cms/server'; * * export default async function Page() * { * // locale을 지정하지 않으면 쿠키에서 자동으로 가져옴 * const sections = await getSections(['home', 'why-futureplay']); * * // 또는 명시적으로 locale 지정 * const sectionsEn = await getSections(['home', 'why-futureplay'], 'en'); * * return ( *
*

{sections.home.t('hero.title')}

*

{sections['why-futureplay'].t('intro.text')}

*
* ); * } * ``` */ declare const getSections: (sections: string[], locale?: string) => Promise>; export { type SectionAPI, type SectionData, getSection, getSections, initLabelSync, loadLabelsFromJson, syncAll, syncSection };