@spfn/cms 0.1.0-alpha.7 → 0.1.0-alpha.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -416
- package/dist/{helpers/locale.actions.d.ts → actions-BpTAYuBA.d.ts} +70 -7
- package/dist/actions.d.ts +2 -9
- package/dist/actions.js +97 -10
- package/dist/actions.js.map +1 -1
- package/dist/api.d.ts +214 -0
- package/dist/api.js +353 -0
- package/dist/api.js.map +1 -0
- package/dist/client.d.ts +136 -127
- package/dist/client.js +1199 -59
- package/dist/client.js.map +1 -1
- package/dist/{types.d.ts → index-Dh5FjWzR.d.ts} +45 -7
- package/dist/index.d.ts +108 -16
- package/dist/index.js +610 -23
- package/dist/index.js.map +1 -1
- package/dist/label-sync-generator-B0EmvtWM.d.ts +32 -0
- package/dist/lib/contracts/labels.d.ts +151 -0
- package/dist/lib/contracts/labels.js +168 -0
- package/dist/lib/contracts/labels.js.map +1 -0
- package/dist/lib/contracts/published-cache.d.ts +48 -0
- package/dist/lib/contracts/published-cache.js +49 -0
- package/dist/lib/contracts/published-cache.js.map +1 -0
- package/dist/lib/contracts/values.d.ts +71 -0
- package/dist/lib/contracts/values.js +103 -0
- package/dist/lib/contracts/values.js.map +1 -0
- package/dist/locale.constants-BMBK70YM.d.ts +104 -0
- package/dist/{entities → server/entities}/cms-audit-logs.d.ts +15 -70
- package/dist/server/entities/cms-audit-logs.js +78 -0
- package/dist/server/entities/cms-audit-logs.js.map +1 -0
- package/dist/{entities → server/entities}/cms-draft-cache.d.ts +13 -73
- package/dist/server/entities/cms-draft-cache.js +38 -0
- package/dist/server/entities/cms-draft-cache.js.map +1 -0
- package/dist/{entities → server/entities}/cms-label-values.d.ts +16 -67
- package/dist/server/entities/cms-label-values.js +81 -0
- package/dist/server/entities/cms-label-values.js.map +1 -0
- package/dist/{entities → server/entities}/cms-label-versions.d.ts +16 -49
- package/dist/server/entities/cms-label-versions.js +76 -0
- package/dist/server/entities/cms-label-versions.js.map +1 -0
- package/dist/{entities → server/entities}/cms-labels.d.ts +17 -14
- package/dist/server/entities/cms-labels.js +42 -0
- package/dist/server/entities/cms-labels.js.map +1 -0
- package/dist/{entities → server/entities}/cms-published-cache.d.ts +14 -69
- package/dist/server/entities/cms-published-cache.js +36 -0
- package/dist/server/entities/cms-published-cache.js.map +1 -0
- package/dist/server/entities/index.d.ts +7 -0
- package/dist/server/entities/index.js +218 -0
- package/dist/server/entities/index.js.map +1 -0
- package/dist/server/generators/index.d.ts +19 -0
- package/dist/server/generators/index.js +753 -0
- package/dist/server/generators/index.js.map +1 -0
- package/dist/server/labels/index.d.ts +1 -0
- package/dist/server/labels/index.js +32 -0
- package/dist/server/labels/index.js.map +1 -0
- package/dist/server/repositories/index.d.ts +209 -0
- package/dist/server/repositories/index.js +441 -0
- package/dist/server/repositories/index.js.map +1 -0
- package/dist/server/routes/labels/[id]/index.js +508 -0
- package/dist/server/routes/labels/[id]/index.js.map +1 -0
- package/dist/{routes/labels/[id] → server/routes/labels/_id_}/index.d.ts +5 -3
- package/dist/server/routes/labels/by-key/[key]/index.js +458 -0
- package/dist/server/routes/labels/by-key/[key]/index.js.map +1 -0
- package/dist/server/routes/labels/by-key/_key_/index.d.ts +10 -0
- package/dist/server/routes/labels/index.d.ts +12 -0
- package/dist/server/routes/labels/index.js +617 -0
- package/dist/server/routes/labels/index.js.map +1 -0
- package/dist/server/routes/published-cache/index.d.ts +11 -0
- package/dist/server/routes/published-cache/index.js +369 -0
- package/dist/server/routes/published-cache/index.js.map +1 -0
- package/dist/server/routes/values/[labelId]/[version]/index.js +479 -0
- package/dist/server/routes/values/[labelId]/[version]/index.js.map +1 -0
- package/dist/server/routes/values/[labelId]/index.js +474 -0
- package/dist/server/routes/values/[labelId]/index.js.map +1 -0
- package/dist/server/routes/values/_labelId_/_version_/index.d.ts +10 -0
- package/dist/server/routes/values/_labelId_/index.d.ts +10 -0
- package/dist/server.d.ts +78 -7
- package/dist/server.js +1752 -247
- package/dist/server.js.map +1 -1
- package/migrations/0000_init.sql +3 -0
- package/migrations/0001_far_lady_vermin.sql +86 -0
- package/migrations/0002_heavy_the_enforcers.sql +2 -0
- package/migrations/meta/0000_snapshot.json +15 -0
- package/migrations/meta/0001_snapshot.json +687 -0
- package/migrations/meta/0002_snapshot.json +686 -0
- package/migrations/meta/_journal.json +27 -0
- package/package.json +55 -36
- package/dist/actions.d.ts.map +0 -1
- package/dist/client.d.ts.map +0 -1
- package/dist/cms.config.d.ts +0 -77
- package/dist/cms.config.d.ts.map +0 -1
- package/dist/cms.config.js +0 -111
- package/dist/cms.config.js.map +0 -1
- package/dist/entities/cms-audit-logs.d.ts.map +0 -1
- package/dist/entities/cms-audit-logs.js +0 -103
- package/dist/entities/cms-audit-logs.js.map +0 -1
- package/dist/entities/cms-draft-cache.d.ts.map +0 -1
- package/dist/entities/cms-draft-cache.js +0 -112
- package/dist/entities/cms-draft-cache.js.map +0 -1
- package/dist/entities/cms-label-values.d.ts.map +0 -1
- package/dist/entities/cms-label-values.js +0 -105
- package/dist/entities/cms-label-values.js.map +0 -1
- package/dist/entities/cms-label-versions.d.ts.map +0 -1
- package/dist/entities/cms-label-versions.js +0 -80
- package/dist/entities/cms-label-versions.js.map +0 -1
- package/dist/entities/cms-labels.d.ts.map +0 -1
- package/dist/entities/cms-labels.js +0 -48
- package/dist/entities/cms-labels.js.map +0 -1
- package/dist/entities/cms-published-cache.d.ts.map +0 -1
- package/dist/entities/cms-published-cache.js +0 -103
- package/dist/entities/cms-published-cache.js.map +0 -1
- package/dist/entities/index.d.ts +0 -10
- package/dist/entities/index.d.ts.map +0 -1
- package/dist/entities/index.js +0 -10
- package/dist/entities/index.js.map +0 -1
- package/dist/generators/index.d.ts +0 -19
- package/dist/generators/index.d.ts.map +0 -1
- package/dist/generators/index.js +0 -19
- package/dist/generators/index.js.map +0 -1
- package/dist/generators/label-sync-generator.d.ts +0 -33
- package/dist/generators/label-sync-generator.d.ts.map +0 -1
- package/dist/generators/label-sync-generator.js +0 -87
- package/dist/generators/label-sync-generator.js.map +0 -1
- package/dist/helpers/locale.actions.d.ts.map +0 -1
- package/dist/helpers/locale.actions.js +0 -210
- package/dist/helpers/locale.actions.js.map +0 -1
- package/dist/helpers/locale.constants.d.ts +0 -10
- package/dist/helpers/locale.constants.d.ts.map +0 -1
- package/dist/helpers/locale.constants.js +0 -10
- package/dist/helpers/locale.constants.js.map +0 -1
- package/dist/helpers/locale.d.ts +0 -17
- package/dist/helpers/locale.d.ts.map +0 -1
- package/dist/helpers/locale.js +0 -20
- package/dist/helpers/locale.js.map +0 -1
- package/dist/helpers/sync.d.ts +0 -41
- package/dist/helpers/sync.d.ts.map +0 -1
- package/dist/helpers/sync.js +0 -309
- package/dist/helpers/sync.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/init.d.ts +0 -31
- package/dist/init.d.ts.map +0 -1
- package/dist/init.js +0 -36
- package/dist/init.js.map +0 -1
- package/dist/labels/helpers.d.ts +0 -31
- package/dist/labels/helpers.d.ts.map +0 -1
- package/dist/labels/helpers.js +0 -60
- package/dist/labels/helpers.js.map +0 -1
- package/dist/labels/index.d.ts +0 -7
- package/dist/labels/index.d.ts.map +0 -1
- package/dist/labels/index.js +0 -7
- package/dist/labels/index.js.map +0 -1
- package/dist/repositories/cms-draft-cache.repository.d.ts +0 -62
- package/dist/repositories/cms-draft-cache.repository.d.ts.map +0 -1
- package/dist/repositories/cms-draft-cache.repository.js +0 -56
- package/dist/repositories/cms-draft-cache.repository.js.map +0 -1
- package/dist/repositories/cms-label-values.repository.d.ts +0 -32
- package/dist/repositories/cms-label-values.repository.d.ts.map +0 -1
- package/dist/repositories/cms-label-values.repository.js +0 -72
- package/dist/repositories/cms-label-values.repository.js.map +0 -1
- package/dist/repositories/cms-labels.repository.d.ts +0 -53
- package/dist/repositories/cms-labels.repository.d.ts.map +0 -1
- package/dist/repositories/cms-labels.repository.js +0 -77
- package/dist/repositories/cms-labels.repository.js.map +0 -1
- package/dist/repositories/cms-published-cache.repository.d.ts +0 -53
- package/dist/repositories/cms-published-cache.repository.d.ts.map +0 -1
- package/dist/repositories/cms-published-cache.repository.js +0 -54
- package/dist/repositories/cms-published-cache.repository.js.map +0 -1
- package/dist/repositories/index.d.ts +0 -8
- package/dist/repositories/index.d.ts.map +0 -1
- package/dist/repositories/index.js +0 -9
- package/dist/repositories/index.js.map +0 -1
- package/dist/routes/labels/[id]/contract.d.ts +0 -68
- package/dist/routes/labels/[id]/contract.d.ts.map +0 -1
- package/dist/routes/labels/[id]/contract.js +0 -84
- package/dist/routes/labels/[id]/contract.js.map +0 -1
- package/dist/routes/labels/[id]/index.d.ts.map +0 -1
- package/dist/routes/labels/[id]/index.js +0 -96
- package/dist/routes/labels/[id]/index.js.map +0 -1
- package/dist/routes/labels/by-key/[key]/contract.d.ts +0 -24
- package/dist/routes/labels/by-key/[key]/contract.d.ts.map +0 -1
- package/dist/routes/labels/by-key/[key]/contract.js +0 -28
- package/dist/routes/labels/by-key/[key]/contract.js.map +0 -1
- package/dist/routes/labels/by-key/[key]/index.d.ts +0 -8
- package/dist/routes/labels/by-key/[key]/index.d.ts.map +0 -1
- package/dist/routes/labels/by-key/[key]/index.js +0 -32
- package/dist/routes/labels/by-key/[key]/index.js.map +0 -1
- package/dist/routes/labels/contract.d.ts +0 -59
- package/dist/routes/labels/contract.d.ts.map +0 -1
- package/dist/routes/labels/contract.js +0 -75
- package/dist/routes/labels/contract.js.map +0 -1
- package/dist/routes/labels/index.d.ts +0 -10
- package/dist/routes/labels/index.d.ts.map +0 -1
- package/dist/routes/labels/index.js +0 -73
- package/dist/routes/labels/index.js.map +0 -1
- package/dist/routes/published-cache/contract.d.ts +0 -25
- package/dist/routes/published-cache/contract.d.ts.map +0 -1
- package/dist/routes/published-cache/contract.js +0 -35
- package/dist/routes/published-cache/contract.js.map +0 -1
- package/dist/routes/published-cache/index.d.ts +0 -8
- package/dist/routes/published-cache/index.d.ts.map +0 -1
- package/dist/routes/published-cache/index.js +0 -33
- package/dist/routes/published-cache/index.js.map +0 -1
- package/dist/routes/values/[labelId]/[version]/contract.d.ts +0 -29
- package/dist/routes/values/[labelId]/[version]/contract.d.ts.map +0 -1
- package/dist/routes/values/[labelId]/[version]/contract.js +0 -33
- package/dist/routes/values/[labelId]/[version]/contract.js.map +0 -1
- package/dist/routes/values/[labelId]/[version]/index.d.ts +0 -8
- package/dist/routes/values/[labelId]/[version]/index.d.ts.map +0 -1
- package/dist/routes/values/[labelId]/[version]/index.js +0 -45
- package/dist/routes/values/[labelId]/[version]/index.js.map +0 -1
- package/dist/routes/values/[labelId]/contract.d.ts +0 -38
- package/dist/routes/values/[labelId]/contract.d.ts.map +0 -1
- package/dist/routes/values/[labelId]/contract.js +0 -59
- package/dist/routes/values/[labelId]/contract.js.map +0 -1
- package/dist/routes/values/[labelId]/index.d.ts +0 -8
- package/dist/routes/values/[labelId]/index.d.ts.map +0 -1
- package/dist/routes/values/[labelId]/index.js +0 -42
- package/dist/routes/values/[labelId]/index.js.map +0 -1
- package/dist/server.d.ts.map +0 -1
- package/dist/store.d.ts +0 -87
- package/dist/store.d.ts.map +0 -1
- package/dist/store.js +0 -205
- package/dist/store.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -7
- package/dist/types.js.map +0 -1
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
"use server";
|
|
2
|
-
/**
|
|
3
|
-
* Locale Management Server Actions
|
|
4
|
-
*
|
|
5
|
-
* Server Actions으로 구현된 locale 관리 함수
|
|
6
|
-
* - 서버 컴포넌트: 일반 함수 호출로 동작
|
|
7
|
-
* - 클라이언트 컴포넌트: Server Action으로 자동 처리
|
|
8
|
-
*/
|
|
9
|
-
import { cookies, headers } from 'next/headers';
|
|
10
|
-
import { getCmsConfig } from '../cms.config.js';
|
|
11
|
-
import { LOCALE_COOKIE_KEY } from './locale.constants.js';
|
|
12
|
-
/**
|
|
13
|
-
* 브라우저 언어 감지
|
|
14
|
-
*
|
|
15
|
-
* Accept-Language 헤더에서 지원하는 언어를 찾습니다.
|
|
16
|
-
*
|
|
17
|
-
* @returns 감지된 언어 코드 또는 null
|
|
18
|
-
*/
|
|
19
|
-
async function detectBrowserLanguage() {
|
|
20
|
-
try {
|
|
21
|
-
const headersList = await headers();
|
|
22
|
-
const acceptLanguage = headersList.get('accept-language');
|
|
23
|
-
if (!acceptLanguage) {
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
// "ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7" 형식 파싱
|
|
27
|
-
const languages = acceptLanguage
|
|
28
|
-
.split(',')
|
|
29
|
-
.map(lang => {
|
|
30
|
-
const [code] = lang.split(';');
|
|
31
|
-
return code.split('-')[0].trim();
|
|
32
|
-
});
|
|
33
|
-
const config = getCmsConfig();
|
|
34
|
-
// 지원하는 언어 중 첫 번째 매칭되는 언어 반환
|
|
35
|
-
for (const lang of languages) {
|
|
36
|
-
if (config.supportedLocales.includes(lang)) {
|
|
37
|
-
return lang;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
catch (error) {
|
|
43
|
-
// 헤더 접근 실패 시
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* 현재 locale 가져오기 (Server Action)
|
|
49
|
-
*
|
|
50
|
-
* 서버/클라이언트 컴포넌트 모두에서 사용 가능
|
|
51
|
-
*
|
|
52
|
-
* 우선순위:
|
|
53
|
-
* 1. 쿠키 (사용자가 명시적으로 선택한 언어)
|
|
54
|
-
* 2. 브라우저 언어 감지 (설정에서 활성화된 경우)
|
|
55
|
-
* 3. 시스템 기본 언어 (CMS 설정)
|
|
56
|
-
*
|
|
57
|
-
* @returns 현재 locale (예: 'ko', 'en')
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* ```tsx
|
|
61
|
-
* // Server Component
|
|
62
|
-
* import { getLocale } from '@spfn/cms';
|
|
63
|
-
*
|
|
64
|
-
* export default async function Page()
|
|
65
|
-
* {
|
|
66
|
-
* const locale = await getLocale();
|
|
67
|
-
* return <div>Current locale: {locale}</div>;
|
|
68
|
-
* }
|
|
69
|
-
* ```
|
|
70
|
-
*
|
|
71
|
-
* @example
|
|
72
|
-
* ```tsx
|
|
73
|
-
* // Client Component
|
|
74
|
-
* 'use client';
|
|
75
|
-
* import { getLocale } from '@spfn/cms/client';
|
|
76
|
-
*
|
|
77
|
-
* export default function LanguageSwitcher()
|
|
78
|
-
* {
|
|
79
|
-
* const [locale, setLocale] = useState('');
|
|
80
|
-
*
|
|
81
|
-
* useEffect(() => {
|
|
82
|
-
* getLocale().then(setLocale);
|
|
83
|
-
* }, []);
|
|
84
|
-
*
|
|
85
|
-
* return <div>Current locale: {locale}</div>;
|
|
86
|
-
* }
|
|
87
|
-
* ```
|
|
88
|
-
*/
|
|
89
|
-
export async function getLocale() {
|
|
90
|
-
const config = getCmsConfig();
|
|
91
|
-
// 1순위: 쿠키 (사용자가 명시적으로 선택한 언어)
|
|
92
|
-
const cookieStore = await cookies();
|
|
93
|
-
const cookieLocale = cookieStore.get(LOCALE_COOKIE_KEY)?.value;
|
|
94
|
-
if (cookieLocale && config.supportedLocales.includes(cookieLocale)) {
|
|
95
|
-
return cookieLocale;
|
|
96
|
-
}
|
|
97
|
-
// 2순위: 브라우저 언어 감지 (설정에서 활성화된 경우)
|
|
98
|
-
if (config.detectBrowserLanguage) {
|
|
99
|
-
const browserLang = await detectBrowserLanguage();
|
|
100
|
-
if (browserLang) {
|
|
101
|
-
return browserLang;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
// 3순위: 시스템 기본 언어
|
|
105
|
-
return config.defaultLocale;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Locale 설정하기 (Server Action)
|
|
109
|
-
*
|
|
110
|
-
* 서버/클라이언트 컴포넌트 모두에서 사용 가능
|
|
111
|
-
* 쿠키에 locale을 저장합니다.
|
|
112
|
-
*
|
|
113
|
-
* @param locale - 설정할 locale (예: 'ko', 'en')
|
|
114
|
-
* @throws {Error} 지원하지 않는 locale인 경우
|
|
115
|
-
*
|
|
116
|
-
* @example
|
|
117
|
-
* ```tsx
|
|
118
|
-
* // Server Component (Server Action)
|
|
119
|
-
* import { setLocale } from '@spfn/cms';
|
|
120
|
-
*
|
|
121
|
-
* export default async function Page()
|
|
122
|
-
* {
|
|
123
|
-
* await setLocale('en');
|
|
124
|
-
* return <div>Locale changed</div>;
|
|
125
|
-
* }
|
|
126
|
-
* ```
|
|
127
|
-
*
|
|
128
|
-
* @example
|
|
129
|
-
* ```tsx
|
|
130
|
-
* // Client Component (Server Action)
|
|
131
|
-
* 'use client';
|
|
132
|
-
* import { setLocale } from '@spfn/cms/client';
|
|
133
|
-
*
|
|
134
|
-
* export default function LanguageSwitcher()
|
|
135
|
-
* {
|
|
136
|
-
* const handleChange = async (newLocale: string) =>
|
|
137
|
-
* {
|
|
138
|
-
* await setLocale(newLocale);
|
|
139
|
-
* window.location.reload(); // 페이지 새로고침
|
|
140
|
-
* };
|
|
141
|
-
*
|
|
142
|
-
* return (
|
|
143
|
-
* <button onClick={() => handleChange('en')}>
|
|
144
|
-
* Switch to English
|
|
145
|
-
* </button>
|
|
146
|
-
* );
|
|
147
|
-
* }
|
|
148
|
-
* ```
|
|
149
|
-
*/
|
|
150
|
-
export async function setLocale(locale) {
|
|
151
|
-
const config = getCmsConfig();
|
|
152
|
-
// 유효성 검사
|
|
153
|
-
if (!config.supportedLocales.includes(locale)) {
|
|
154
|
-
throw new Error(`Unsupported locale: ${locale}. Supported locales: ${config.supportedLocales.join(', ')}`);
|
|
155
|
-
}
|
|
156
|
-
const cookieStore = await cookies();
|
|
157
|
-
cookieStore.set(LOCALE_COOKIE_KEY, locale, {
|
|
158
|
-
path: '/',
|
|
159
|
-
maxAge: 60 * 60 * 24 * 365, // 1년
|
|
160
|
-
sameSite: 'lax',
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* 지원하는 locale 목록 가져오기 (Server Action)
|
|
165
|
-
*
|
|
166
|
-
* 서버/클라이언트 컴포넌트 모두에서 사용 가능
|
|
167
|
-
*
|
|
168
|
-
* @returns 지원하는 locale 배열 (예: ['ko', 'en', 'ja'])
|
|
169
|
-
*
|
|
170
|
-
* @example
|
|
171
|
-
* ```tsx
|
|
172
|
-
* // Server Component
|
|
173
|
-
* import { getLocales } from '@spfn/cms';
|
|
174
|
-
*
|
|
175
|
-
* export default async function Page()
|
|
176
|
-
* {
|
|
177
|
-
* const locales = await getLocales();
|
|
178
|
-
* return <div>Supported: {locales.join(', ')}</div>;
|
|
179
|
-
* }
|
|
180
|
-
* ```
|
|
181
|
-
*
|
|
182
|
-
* @example
|
|
183
|
-
* ```tsx
|
|
184
|
-
* // Client Component
|
|
185
|
-
* 'use client';
|
|
186
|
-
* import { getLocales } from '@spfn/cms/client';
|
|
187
|
-
*
|
|
188
|
-
* export default function LanguageSwitcher()
|
|
189
|
-
* {
|
|
190
|
-
* const [locales, setLocales] = useState<string[]>([]);
|
|
191
|
-
*
|
|
192
|
-
* useEffect(() => {
|
|
193
|
-
* getLocales().then(setLocales);
|
|
194
|
-
* }, []);
|
|
195
|
-
*
|
|
196
|
-
* return (
|
|
197
|
-
* <div>
|
|
198
|
-
* {locales.map(locale => (
|
|
199
|
-
* <button key={locale}>{locale}</button>
|
|
200
|
-
* ))}
|
|
201
|
-
* </div>
|
|
202
|
-
* );
|
|
203
|
-
* }
|
|
204
|
-
* ```
|
|
205
|
-
*/
|
|
206
|
-
export async function getLocales() {
|
|
207
|
-
const config = getCmsConfig();
|
|
208
|
-
return config.supportedLocales;
|
|
209
|
-
}
|
|
210
|
-
//# sourceMappingURL=locale.actions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locale.actions.js","sourceRoot":"","sources":["../../src/helpers/locale.actions.ts"],"names":[],"mappings":"AAAA,YAAY,CA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AAU;IAE5B,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,OAAO,MAAM,CAAC,gBAAgB,CAAC;AACnC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locale.constants.d.ts","sourceRoot":"","sources":["../../src/helpers/locale.constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB,gBAAgB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locale.constants.js","sourceRoot":"","sources":["../../src/helpers/locale.constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC"}
|
package/dist/helpers/locale.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import "server-only";
|
|
2
|
-
/**
|
|
3
|
-
* Locale Management Module (Server Components)
|
|
4
|
-
*
|
|
5
|
-
* 서버 컴포넌트용 locale 관리 (Server Actions re-export)
|
|
6
|
-
* 실제 구현은 locale.actions.ts 참조
|
|
7
|
-
*/
|
|
8
|
-
export { getLocale, setLocale, getLocales, } from './locale.actions.js';
|
|
9
|
-
export { LOCALE_COOKIE_KEY } from './locale.constants.js';
|
|
10
|
-
/**
|
|
11
|
-
* Locale 유효성 검사
|
|
12
|
-
*
|
|
13
|
-
* @param locale - 검사할 locale
|
|
14
|
-
* @returns 지원 여부
|
|
15
|
-
*/
|
|
16
|
-
export declare function isValidLocale(locale: string): Promise<boolean>;
|
|
17
|
-
//# sourceMappingURL=locale.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../../src/helpers/locale.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAErB;;;;;GAKG;AAEH,OAAO,EACH,SAAS,EACT,SAAS,EACT,UAAU,GACb,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAIpE"}
|
package/dist/helpers/locale.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import "server-only";
|
|
2
|
-
/**
|
|
3
|
-
* Locale Management Module (Server Components)
|
|
4
|
-
*
|
|
5
|
-
* 서버 컴포넌트용 locale 관리 (Server Actions re-export)
|
|
6
|
-
* 실제 구현은 locale.actions.ts 참조
|
|
7
|
-
*/
|
|
8
|
-
export { getLocale, setLocale, getLocales, } from './locale.actions.js';
|
|
9
|
-
export { LOCALE_COOKIE_KEY } from './locale.constants.js';
|
|
10
|
-
/**
|
|
11
|
-
* Locale 유효성 검사
|
|
12
|
-
*
|
|
13
|
-
* @param locale - 검사할 locale
|
|
14
|
-
* @returns 지원 여부
|
|
15
|
-
*/
|
|
16
|
-
export async function isValidLocale(locale) {
|
|
17
|
-
const locales = await import('./locale.actions.js').then(m => m.getLocales());
|
|
18
|
-
return locales.includes(locale);
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=locale.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locale.js","sourceRoot":"","sources":["../../src/helpers/locale.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAErB;;;;;GAKG;AAEH,OAAO,EACH,SAAS,EACT,SAAS,EACT,UAAU,GACb,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAAc;IAE9C,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC;IAC9E,OAAO,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC"}
|
package/dist/helpers/sync.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CMS Sync Utilities
|
|
3
|
-
*
|
|
4
|
-
* JSON 파일 기반 라벨 동기화
|
|
5
|
-
*/
|
|
6
|
-
import type { SectionDefinition, SyncOptions, SyncResult } from '../types.js';
|
|
7
|
-
/**
|
|
8
|
-
* 여러 섹션 동기화
|
|
9
|
-
*/
|
|
10
|
-
export declare function syncAll(sections: SectionDefinition[], options?: SyncOptions): Promise<SyncResult[]>;
|
|
11
|
-
/**
|
|
12
|
-
* JSON 파일에서 라벨 로드
|
|
13
|
-
*/
|
|
14
|
-
export declare function loadLabelsFromJson(labelsDir: string): SectionDefinition[];
|
|
15
|
-
/**
|
|
16
|
-
* 섹션 라벨 동기화
|
|
17
|
-
*/
|
|
18
|
-
export declare function syncSection(definition: SectionDefinition, options?: SyncOptions): Promise<SyncResult>;
|
|
19
|
-
/**
|
|
20
|
-
* Initialize label sync for server startup
|
|
21
|
-
*
|
|
22
|
-
* Call this in your server.config.ts beforeRoutes hook
|
|
23
|
-
*
|
|
24
|
-
* @param options - Sync options
|
|
25
|
-
* @param options.labelsDir - Path to labels directory (default: 'src/cms/labels')
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* ```typescript
|
|
29
|
-
* import { initLabelSync } from '@spfn/cms';
|
|
30
|
-
*
|
|
31
|
-
* export default {
|
|
32
|
-
* beforeRoutes: async (app) => {
|
|
33
|
-
* await initLabelSync({ verbose: true });
|
|
34
|
-
* },
|
|
35
|
-
* } satisfies ServerConfig;
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
export declare function initLabelSync(options?: SyncOptions & {
|
|
39
|
-
labelsDir?: string;
|
|
40
|
-
}): Promise<void>;
|
|
41
|
-
//# sourceMappingURL=sync.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/helpers/sync.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAgB,iBAAiB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE5F;;GAEG;AACH,wBAAsB,OAAO,CACzB,QAAQ,EAAE,iBAAiB,EAAE,EAC7B,OAAO,GAAE,WAAgB,GAC1B,OAAO,CAAC,UAAU,EAAE,CAAC,CAWvB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,iBAAiB,EAAE,CAqCzE;AAqCD;;GAEG;AACH,wBAAsB,WAAW,CAC7B,UAAU,EAAE,iBAAiB,EAC7B,OAAO,GAAE,WAAgB,GAC1B,OAAO,CAAC,UAAU,CAAC,CAoKrB;AAyDD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,aAAa,CAAC,OAAO,GAAE,WAAW,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAgErG"}
|
package/dist/helpers/sync.js
DELETED
|
@@ -1,309 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CMS Sync Utilities
|
|
3
|
-
*
|
|
4
|
-
* JSON 파일 기반 라벨 동기화
|
|
5
|
-
*/
|
|
6
|
-
import { existsSync, readdirSync, readFileSync, statSync } from 'fs';
|
|
7
|
-
import { basename, extname, join } from 'path';
|
|
8
|
-
import { extractLabels } from '../labels/index.js';
|
|
9
|
-
import { cmsLabelsRepository, cmsPublishedCacheRepository } from '../repositories/index.js';
|
|
10
|
-
/**
|
|
11
|
-
* 여러 섹션 동기화
|
|
12
|
-
*/
|
|
13
|
-
export async function syncAll(sections, options = {}) {
|
|
14
|
-
const results = [];
|
|
15
|
-
for (const definition of sections) {
|
|
16
|
-
const result = await syncSection(definition, options);
|
|
17
|
-
results.push(result);
|
|
18
|
-
}
|
|
19
|
-
return results;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* JSON 파일에서 라벨 로드
|
|
23
|
-
*/
|
|
24
|
-
export function loadLabelsFromJson(labelsDir) {
|
|
25
|
-
const sections = [];
|
|
26
|
-
if (!existsSync(labelsDir)) {
|
|
27
|
-
console.warn(`[CMS] Labels directory not found: ${labelsDir}`);
|
|
28
|
-
return sections;
|
|
29
|
-
}
|
|
30
|
-
try {
|
|
31
|
-
const entries = readdirSync(labelsDir);
|
|
32
|
-
for (const entry of entries) {
|
|
33
|
-
const sectionPath = join(labelsDir, entry);
|
|
34
|
-
const stat = statSync(sectionPath);
|
|
35
|
-
if (stat.isDirectory()) {
|
|
36
|
-
const sectionName = entry;
|
|
37
|
-
const labels = loadSectionLabels(sectionPath);
|
|
38
|
-
if (Object.keys(labels).length > 0) {
|
|
39
|
-
sections.push({ section: sectionName, labels });
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
catch (error) {
|
|
45
|
-
console.warn(`[CMS] Could not scan labels directory: ${labelsDir}`);
|
|
46
|
-
}
|
|
47
|
-
return sections;
|
|
48
|
-
}
|
|
49
|
-
function loadSectionLabels(sectionPath) {
|
|
50
|
-
const labels = {};
|
|
51
|
-
try {
|
|
52
|
-
const files = readdirSync(sectionPath);
|
|
53
|
-
for (const file of files) {
|
|
54
|
-
if (extname(file) === '.json') {
|
|
55
|
-
const filePath = join(sectionPath, file);
|
|
56
|
-
const categoryName = basename(file, '.json');
|
|
57
|
-
try {
|
|
58
|
-
const content = readFileSync(filePath, 'utf-8');
|
|
59
|
-
labels[categoryName] = JSON.parse(content);
|
|
60
|
-
}
|
|
61
|
-
catch (error) {
|
|
62
|
-
console.warn(`[CMS] Failed to parse ${filePath}`);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
catch (error) {
|
|
68
|
-
console.warn(`[CMS] Could not read section directory: ${sectionPath}`);
|
|
69
|
-
}
|
|
70
|
-
return labels;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* 섹션 라벨 동기화
|
|
74
|
-
*/
|
|
75
|
-
export async function syncSection(definition, options = {}) {
|
|
76
|
-
const { dryRun = false, updateExisting = false, removeUnused = false, verbose = false, } = options;
|
|
77
|
-
const { section } = definition;
|
|
78
|
-
const result = {
|
|
79
|
-
section,
|
|
80
|
-
created: 0,
|
|
81
|
-
updated: 0,
|
|
82
|
-
deleted: 0,
|
|
83
|
-
unchanged: 0,
|
|
84
|
-
errors: [],
|
|
85
|
-
};
|
|
86
|
-
try {
|
|
87
|
-
const definedLabels = extractLabels(definition);
|
|
88
|
-
const definedKeys = new Set(definedLabels.map((l) => l.key));
|
|
89
|
-
const existingLabels = await cmsLabelsRepository.findBySection(section);
|
|
90
|
-
const existingMap = new Map(existingLabels.map((l) => [l.key, l]));
|
|
91
|
-
if (verbose) {
|
|
92
|
-
console.log(`\n[${section}] Found ${definedLabels.length} labels in definition`);
|
|
93
|
-
console.log(`[${section}] Found ${existingLabels.length} labels in DB`);
|
|
94
|
-
}
|
|
95
|
-
// 생성 및 업데이트
|
|
96
|
-
for (const label of definedLabels) {
|
|
97
|
-
const existing = existingMap.get(label.key);
|
|
98
|
-
if (!existing) {
|
|
99
|
-
if (verbose)
|
|
100
|
-
console.log(` [CREATE] ${label.key}`);
|
|
101
|
-
if (!dryRun) {
|
|
102
|
-
try {
|
|
103
|
-
const defaultValue = typeof label.defaultValue === 'object'
|
|
104
|
-
? JSON.stringify(label.defaultValue)
|
|
105
|
-
: label.defaultValue;
|
|
106
|
-
await cmsLabelsRepository.create({
|
|
107
|
-
section,
|
|
108
|
-
key: label.key,
|
|
109
|
-
type: 'text',
|
|
110
|
-
defaultValue,
|
|
111
|
-
description: label.description,
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
catch (error) {
|
|
115
|
-
result.errors.push({
|
|
116
|
-
key: label.key,
|
|
117
|
-
error: error instanceof Error ? error.message : String(error),
|
|
118
|
-
});
|
|
119
|
-
continue;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
result.created++;
|
|
123
|
-
}
|
|
124
|
-
else if (updateExisting) {
|
|
125
|
-
const newDefaultValue = typeof label.defaultValue === 'object'
|
|
126
|
-
? JSON.stringify(label.defaultValue)
|
|
127
|
-
: label.defaultValue;
|
|
128
|
-
const hasChanged = existing.defaultValue !== newDefaultValue;
|
|
129
|
-
if (hasChanged) {
|
|
130
|
-
if (verbose) {
|
|
131
|
-
console.log(` [UPDATE] ${label.key}`);
|
|
132
|
-
console.log(` Old: "${existing.defaultValue}"`);
|
|
133
|
-
console.log(` New: "${newDefaultValue}"`);
|
|
134
|
-
}
|
|
135
|
-
if (!dryRun) {
|
|
136
|
-
try {
|
|
137
|
-
await cmsLabelsRepository.updateById(existing.id, {
|
|
138
|
-
defaultValue: newDefaultValue,
|
|
139
|
-
description: label.description,
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
catch (error) {
|
|
143
|
-
result.errors.push({
|
|
144
|
-
key: label.key,
|
|
145
|
-
error: error instanceof Error ? error.message : String(error),
|
|
146
|
-
});
|
|
147
|
-
continue;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
result.updated++;
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
result.unchanged++;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
result.unchanged++;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
// 사용되지 않는 라벨 삭제
|
|
161
|
-
if (removeUnused) {
|
|
162
|
-
for (const existing of existingLabels) {
|
|
163
|
-
if (!definedKeys.has(existing.key)) {
|
|
164
|
-
if (verbose)
|
|
165
|
-
console.log(` [DELETE] ${existing.key}`);
|
|
166
|
-
if (!dryRun) {
|
|
167
|
-
try {
|
|
168
|
-
await cmsLabelsRepository.deleteById(existing.id);
|
|
169
|
-
}
|
|
170
|
-
catch (error) {
|
|
171
|
-
result.errors.push({
|
|
172
|
-
key: existing.key,
|
|
173
|
-
error: error instanceof Error ? error.message : String(error),
|
|
174
|
-
});
|
|
175
|
-
continue;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
result.deleted++;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
// Published cache 업데이트
|
|
183
|
-
if (!dryRun && (result.created > 0 || result.updated > 0 || result.deleted > 0)) {
|
|
184
|
-
if (verbose)
|
|
185
|
-
console.log(` [CACHE] Updating published cache for section: ${section}`);
|
|
186
|
-
await updatePublishedCache(section);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
catch (error) {
|
|
190
|
-
result.errors.push({
|
|
191
|
-
key: '__section__',
|
|
192
|
-
error: error instanceof Error ? error.message : String(error),
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
return result;
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Published Cache 업데이트
|
|
199
|
-
*/
|
|
200
|
-
async function updatePublishedCache(section) {
|
|
201
|
-
const labels = await cmsLabelsRepository.findBySection(section);
|
|
202
|
-
const localesSet = new Set();
|
|
203
|
-
const labelsByLocale = {};
|
|
204
|
-
labels.forEach((label) => {
|
|
205
|
-
try {
|
|
206
|
-
const parsed = JSON.parse(label.defaultValue || '{}');
|
|
207
|
-
if (typeof parsed === 'object' && !Array.isArray(parsed)) {
|
|
208
|
-
// Multilingual
|
|
209
|
-
Object.keys(parsed).forEach((locale) => localesSet.add(locale));
|
|
210
|
-
Object.entries(parsed).forEach(([locale, value]) => {
|
|
211
|
-
if (!labelsByLocale[locale])
|
|
212
|
-
labelsByLocale[locale] = {};
|
|
213
|
-
labelsByLocale[locale][label.key] = value;
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
// Single value
|
|
218
|
-
if (!labelsByLocale.ko)
|
|
219
|
-
labelsByLocale.ko = {};
|
|
220
|
-
labelsByLocale.ko[label.key] = label.defaultValue;
|
|
221
|
-
localesSet.add('ko');
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
catch {
|
|
225
|
-
// Plain string
|
|
226
|
-
if (!labelsByLocale.ko)
|
|
227
|
-
labelsByLocale.ko = {};
|
|
228
|
-
labelsByLocale.ko[label.key] = label.defaultValue;
|
|
229
|
-
localesSet.add('ko');
|
|
230
|
-
}
|
|
231
|
-
});
|
|
232
|
-
const timestamp = new Date();
|
|
233
|
-
for (const locale of localesSet) {
|
|
234
|
-
await cmsPublishedCacheRepository.upsert({
|
|
235
|
-
section,
|
|
236
|
-
locale,
|
|
237
|
-
content: labelsByLocale[locale] || {},
|
|
238
|
-
publishedAt: timestamp,
|
|
239
|
-
publishedBy: 'system',
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* Initialize label sync for server startup
|
|
245
|
-
*
|
|
246
|
-
* Call this in your server.config.ts beforeRoutes hook
|
|
247
|
-
*
|
|
248
|
-
* @param options - Sync options
|
|
249
|
-
* @param options.labelsDir - Path to labels directory (default: 'src/cms/labels')
|
|
250
|
-
*
|
|
251
|
-
* @example
|
|
252
|
-
* ```typescript
|
|
253
|
-
* import { initLabelSync } from '@spfn/cms';
|
|
254
|
-
*
|
|
255
|
-
* export default {
|
|
256
|
-
* beforeRoutes: async (app) => {
|
|
257
|
-
* await initLabelSync({ verbose: true });
|
|
258
|
-
* },
|
|
259
|
-
* } satisfies ServerConfig;
|
|
260
|
-
* ```
|
|
261
|
-
*/
|
|
262
|
-
export async function initLabelSync(options = {}) {
|
|
263
|
-
const isDevelopment = process.env.NODE_ENV === 'development';
|
|
264
|
-
const verbose = options.verbose ?? isDevelopment;
|
|
265
|
-
const labelsDir = options.labelsDir ?? 'src/cms/labels';
|
|
266
|
-
if (verbose) {
|
|
267
|
-
console.log('\n🔄 Initializing label sync...\n');
|
|
268
|
-
}
|
|
269
|
-
// Load labels from JSON files
|
|
270
|
-
const sections = loadLabelsFromJson(labelsDir);
|
|
271
|
-
if (sections.length === 0) {
|
|
272
|
-
if (verbose) {
|
|
273
|
-
console.log('⚠️ No labels found in', labelsDir);
|
|
274
|
-
console.log('');
|
|
275
|
-
}
|
|
276
|
-
return;
|
|
277
|
-
}
|
|
278
|
-
const results = await syncAll(sections, {
|
|
279
|
-
updateExisting: true, // 🔄 항상 업데이트 (프로덕션 포함)
|
|
280
|
-
...options,
|
|
281
|
-
verbose,
|
|
282
|
-
});
|
|
283
|
-
const totalCreated = results.reduce((sum, r) => sum + r.created, 0);
|
|
284
|
-
const totalUpdated = results.reduce((sum, r) => sum + r.updated, 0);
|
|
285
|
-
const totalUnchanged = results.reduce((sum, r) => sum + r.unchanged, 0);
|
|
286
|
-
const totalErrors = results.reduce((sum, r) => sum + r.errors.length, 0);
|
|
287
|
-
if (verbose) {
|
|
288
|
-
console.log('✅ Label sync completed\n');
|
|
289
|
-
console.log(` Sections: ${results.length}`);
|
|
290
|
-
console.log(` Created: ${totalCreated}`);
|
|
291
|
-
console.log(` Updated: ${totalUpdated}`);
|
|
292
|
-
console.log(` Unchanged: ${totalUnchanged}`);
|
|
293
|
-
if (totalErrors > 0) {
|
|
294
|
-
console.log(` Errors: ${totalErrors}\n`);
|
|
295
|
-
}
|
|
296
|
-
else {
|
|
297
|
-
console.log('');
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
// Log errors
|
|
301
|
-
if (totalErrors > 0) {
|
|
302
|
-
results.forEach((result) => {
|
|
303
|
-
result.errors.forEach((error) => {
|
|
304
|
-
console.error(`[${result.section}] ${error.key}: ${error.error}`);
|
|
305
|
-
});
|
|
306
|
-
});
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
//# sourceMappingURL=sync.js.map
|
package/dist/helpers/sync.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../../src/helpers/sync.ts"],"names":[],"mappings":"AAAA;;;;GAIG;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