@spfn/cms 0.1.0-alpha.8 → 0.1.0-alpha.81

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.
Files changed (233) hide show
  1. package/README.md +28 -416
  2. package/dist/{helpers/locale.actions.d.ts → actions-BEFWwQsh.d.ts} +70 -7
  3. package/dist/actions.d.ts +2 -9
  4. package/dist/actions.js +99 -10
  5. package/dist/actions.js.map +1 -1
  6. package/dist/api.d.ts +319 -0
  7. package/dist/api.js +467 -0
  8. package/dist/api.js.map +1 -0
  9. package/dist/client.d.ts +135 -127
  10. package/dist/client.js +1318 -59
  11. package/dist/client.js.map +1 -1
  12. package/dist/{types.d.ts → index-Dh5FjWzR.d.ts} +45 -7
  13. package/dist/index.d.ts +112 -16
  14. package/dist/index.js +625 -23
  15. package/dist/index.js.map +1 -1
  16. package/dist/label-sync-generator-B0EmvtWM.d.ts +32 -0
  17. package/dist/lib/contracts/labels.d.ts +244 -0
  18. package/dist/lib/contracts/labels.js +269 -0
  19. package/dist/lib/contracts/labels.js.map +1 -0
  20. package/dist/lib/contracts/published-cache.d.ts +48 -0
  21. package/dist/lib/contracts/published-cache.js +49 -0
  22. package/dist/lib/contracts/published-cache.js.map +1 -0
  23. package/dist/lib/contracts/values.d.ts +71 -0
  24. package/dist/lib/contracts/values.js +104 -0
  25. package/dist/lib/contracts/values.js.map +1 -0
  26. package/dist/locale.constants-BNkSdNP1.d.ts +108 -0
  27. package/dist/{entities → server/entities}/cms-audit-logs.d.ts +15 -70
  28. package/dist/server/entities/cms-audit-logs.js +78 -0
  29. package/dist/server/entities/cms-audit-logs.js.map +1 -0
  30. package/dist/{entities → server/entities}/cms-draft-cache.d.ts +13 -73
  31. package/dist/server/entities/cms-draft-cache.js +38 -0
  32. package/dist/server/entities/cms-draft-cache.js.map +1 -0
  33. package/dist/{entities → server/entities}/cms-label-values.d.ts +16 -67
  34. package/dist/server/entities/cms-label-values.js +81 -0
  35. package/dist/server/entities/cms-label-values.js.map +1 -0
  36. package/dist/{entities → server/entities}/cms-labels.d.ts +17 -14
  37. package/dist/server/entities/cms-labels.js +42 -0
  38. package/dist/server/entities/cms-labels.js.map +1 -0
  39. package/dist/{entities → server/entities}/cms-published-cache.d.ts +14 -69
  40. package/dist/server/entities/cms-published-cache.js +36 -0
  41. package/dist/server/entities/cms-published-cache.js.map +1 -0
  42. package/dist/server/entities/index.d.ts +6 -0
  43. package/dist/server/entities/index.js +185 -0
  44. package/dist/server/entities/index.js.map +1 -0
  45. package/dist/server/generators/index.d.ts +19 -0
  46. package/dist/server/generators/index.js +731 -0
  47. package/dist/server/generators/index.js.map +1 -0
  48. package/dist/server/labels/index.d.ts +1 -0
  49. package/dist/server/labels/index.js +33 -0
  50. package/dist/server/labels/index.js.map +1 -0
  51. package/dist/server/repositories/index.d.ts +212 -0
  52. package/dist/server/repositories/index.js +418 -0
  53. package/dist/server/repositories/index.js.map +1 -0
  54. package/dist/server/routes/labels/[id]/admin/index.js +679 -0
  55. package/dist/server/routes/labels/[id]/admin/index.js.map +1 -0
  56. package/dist/server/routes/labels/[id]/index.js +576 -0
  57. package/dist/server/routes/labels/[id]/index.js.map +1 -0
  58. package/dist/server/routes/labels/[id]/publish/index.js +720 -0
  59. package/dist/server/routes/labels/[id]/publish/index.js.map +1 -0
  60. package/dist/server/routes/labels/[id]/versions/index.js +548 -0
  61. package/dist/server/routes/labels/[id]/versions/index.js.map +1 -0
  62. package/dist/server/routes/labels/_id_/admin/index.d.ts +11 -0
  63. package/dist/{routes/labels/[id] → server/routes/labels/_id_}/index.d.ts +5 -3
  64. package/dist/server/routes/labels/_id_/publish/index.d.ts +11 -0
  65. package/dist/server/routes/labels/_id_/versions/index.d.ts +11 -0
  66. package/dist/server/routes/labels/by-key/[key]/index.js +525 -0
  67. package/dist/server/routes/labels/by-key/[key]/index.js.map +1 -0
  68. package/dist/server/routes/labels/by-key/_key_/index.d.ts +10 -0
  69. package/dist/server/routes/labels/index.d.ts +12 -0
  70. package/dist/server/routes/labels/index.js +684 -0
  71. package/dist/server/routes/labels/index.js.map +1 -0
  72. package/dist/server/routes/published-cache/index.d.ts +11 -0
  73. package/dist/server/routes/published-cache/index.js +337 -0
  74. package/dist/server/routes/published-cache/index.js.map +1 -0
  75. package/dist/server/routes/values/[labelId]/[version]/index.js +457 -0
  76. package/dist/server/routes/values/[labelId]/[version]/index.js.map +1 -0
  77. package/dist/server/routes/values/[labelId]/index.js +452 -0
  78. package/dist/server/routes/values/[labelId]/index.js.map +1 -0
  79. package/dist/server/routes/values/_labelId_/_version_/index.d.ts +10 -0
  80. package/dist/server/routes/values/_labelId_/index.d.ts +10 -0
  81. package/dist/server.d.ts +77 -7
  82. package/dist/server.js +1747 -247
  83. package/dist/server.js.map +1 -1
  84. package/migrations/0000_init.sql +3 -0
  85. package/migrations/0001_far_lady_vermin.sql +86 -0
  86. package/migrations/0002_heavy_the_enforcers.sql +2 -0
  87. package/migrations/0003_rare_runaways.sql +1 -0
  88. package/migrations/meta/0000_snapshot.json +15 -0
  89. package/migrations/meta/0001_snapshot.json +687 -0
  90. package/migrations/meta/0002_snapshot.json +686 -0
  91. package/migrations/meta/0003_snapshot.json +563 -0
  92. package/migrations/meta/_journal.json +34 -0
  93. package/package.json +55 -36
  94. package/dist/actions.d.ts.map +0 -1
  95. package/dist/client.d.ts.map +0 -1
  96. package/dist/cms.config.d.ts +0 -77
  97. package/dist/cms.config.d.ts.map +0 -1
  98. package/dist/cms.config.js +0 -111
  99. package/dist/cms.config.js.map +0 -1
  100. package/dist/entities/cms-audit-logs.d.ts.map +0 -1
  101. package/dist/entities/cms-audit-logs.js +0 -103
  102. package/dist/entities/cms-audit-logs.js.map +0 -1
  103. package/dist/entities/cms-draft-cache.d.ts.map +0 -1
  104. package/dist/entities/cms-draft-cache.js +0 -112
  105. package/dist/entities/cms-draft-cache.js.map +0 -1
  106. package/dist/entities/cms-label-values.d.ts.map +0 -1
  107. package/dist/entities/cms-label-values.js +0 -105
  108. package/dist/entities/cms-label-values.js.map +0 -1
  109. package/dist/entities/cms-label-versions.d.ts +0 -207
  110. package/dist/entities/cms-label-versions.d.ts.map +0 -1
  111. package/dist/entities/cms-label-versions.js +0 -80
  112. package/dist/entities/cms-label-versions.js.map +0 -1
  113. package/dist/entities/cms-labels.d.ts.map +0 -1
  114. package/dist/entities/cms-labels.js +0 -48
  115. package/dist/entities/cms-labels.js.map +0 -1
  116. package/dist/entities/cms-published-cache.d.ts.map +0 -1
  117. package/dist/entities/cms-published-cache.js +0 -103
  118. package/dist/entities/cms-published-cache.js.map +0 -1
  119. package/dist/entities/index.d.ts +0 -10
  120. package/dist/entities/index.d.ts.map +0 -1
  121. package/dist/entities/index.js +0 -10
  122. package/dist/entities/index.js.map +0 -1
  123. package/dist/generators/index.d.ts +0 -19
  124. package/dist/generators/index.d.ts.map +0 -1
  125. package/dist/generators/index.js +0 -19
  126. package/dist/generators/index.js.map +0 -1
  127. package/dist/generators/label-sync-generator.d.ts +0 -33
  128. package/dist/generators/label-sync-generator.d.ts.map +0 -1
  129. package/dist/generators/label-sync-generator.js +0 -86
  130. package/dist/generators/label-sync-generator.js.map +0 -1
  131. package/dist/helpers/locale.actions.d.ts.map +0 -1
  132. package/dist/helpers/locale.actions.js +0 -210
  133. package/dist/helpers/locale.actions.js.map +0 -1
  134. package/dist/helpers/locale.constants.d.ts +0 -10
  135. package/dist/helpers/locale.constants.d.ts.map +0 -1
  136. package/dist/helpers/locale.constants.js +0 -10
  137. package/dist/helpers/locale.constants.js.map +0 -1
  138. package/dist/helpers/locale.d.ts +0 -17
  139. package/dist/helpers/locale.d.ts.map +0 -1
  140. package/dist/helpers/locale.js +0 -20
  141. package/dist/helpers/locale.js.map +0 -1
  142. package/dist/helpers/sync.d.ts +0 -41
  143. package/dist/helpers/sync.d.ts.map +0 -1
  144. package/dist/helpers/sync.js +0 -309
  145. package/dist/helpers/sync.js.map +0 -1
  146. package/dist/index.d.ts.map +0 -1
  147. package/dist/init.d.ts +0 -31
  148. package/dist/init.d.ts.map +0 -1
  149. package/dist/init.js +0 -36
  150. package/dist/init.js.map +0 -1
  151. package/dist/labels/helpers.d.ts +0 -31
  152. package/dist/labels/helpers.d.ts.map +0 -1
  153. package/dist/labels/helpers.js +0 -60
  154. package/dist/labels/helpers.js.map +0 -1
  155. package/dist/labels/index.d.ts +0 -7
  156. package/dist/labels/index.d.ts.map +0 -1
  157. package/dist/labels/index.js +0 -7
  158. package/dist/labels/index.js.map +0 -1
  159. package/dist/repositories/cms-draft-cache.repository.d.ts +0 -62
  160. package/dist/repositories/cms-draft-cache.repository.d.ts.map +0 -1
  161. package/dist/repositories/cms-draft-cache.repository.js +0 -56
  162. package/dist/repositories/cms-draft-cache.repository.js.map +0 -1
  163. package/dist/repositories/cms-label-values.repository.d.ts +0 -32
  164. package/dist/repositories/cms-label-values.repository.d.ts.map +0 -1
  165. package/dist/repositories/cms-label-values.repository.js +0 -72
  166. package/dist/repositories/cms-label-values.repository.js.map +0 -1
  167. package/dist/repositories/cms-labels.repository.d.ts +0 -53
  168. package/dist/repositories/cms-labels.repository.d.ts.map +0 -1
  169. package/dist/repositories/cms-labels.repository.js +0 -77
  170. package/dist/repositories/cms-labels.repository.js.map +0 -1
  171. package/dist/repositories/cms-published-cache.repository.d.ts +0 -53
  172. package/dist/repositories/cms-published-cache.repository.d.ts.map +0 -1
  173. package/dist/repositories/cms-published-cache.repository.js +0 -54
  174. package/dist/repositories/cms-published-cache.repository.js.map +0 -1
  175. package/dist/repositories/index.d.ts +0 -8
  176. package/dist/repositories/index.d.ts.map +0 -1
  177. package/dist/repositories/index.js +0 -9
  178. package/dist/repositories/index.js.map +0 -1
  179. package/dist/routes/labels/[id]/contract.d.ts +0 -68
  180. package/dist/routes/labels/[id]/contract.d.ts.map +0 -1
  181. package/dist/routes/labels/[id]/contract.js +0 -84
  182. package/dist/routes/labels/[id]/contract.js.map +0 -1
  183. package/dist/routes/labels/[id]/index.d.ts.map +0 -1
  184. package/dist/routes/labels/[id]/index.js +0 -96
  185. package/dist/routes/labels/[id]/index.js.map +0 -1
  186. package/dist/routes/labels/by-key/[key]/contract.d.ts +0 -24
  187. package/dist/routes/labels/by-key/[key]/contract.d.ts.map +0 -1
  188. package/dist/routes/labels/by-key/[key]/contract.js +0 -28
  189. package/dist/routes/labels/by-key/[key]/contract.js.map +0 -1
  190. package/dist/routes/labels/by-key/[key]/index.d.ts +0 -8
  191. package/dist/routes/labels/by-key/[key]/index.d.ts.map +0 -1
  192. package/dist/routes/labels/by-key/[key]/index.js +0 -32
  193. package/dist/routes/labels/by-key/[key]/index.js.map +0 -1
  194. package/dist/routes/labels/contract.d.ts +0 -59
  195. package/dist/routes/labels/contract.d.ts.map +0 -1
  196. package/dist/routes/labels/contract.js +0 -75
  197. package/dist/routes/labels/contract.js.map +0 -1
  198. package/dist/routes/labels/index.d.ts +0 -10
  199. package/dist/routes/labels/index.d.ts.map +0 -1
  200. package/dist/routes/labels/index.js +0 -73
  201. package/dist/routes/labels/index.js.map +0 -1
  202. package/dist/routes/published-cache/contract.d.ts +0 -25
  203. package/dist/routes/published-cache/contract.d.ts.map +0 -1
  204. package/dist/routes/published-cache/contract.js +0 -35
  205. package/dist/routes/published-cache/contract.js.map +0 -1
  206. package/dist/routes/published-cache/index.d.ts +0 -8
  207. package/dist/routes/published-cache/index.d.ts.map +0 -1
  208. package/dist/routes/published-cache/index.js +0 -33
  209. package/dist/routes/published-cache/index.js.map +0 -1
  210. package/dist/routes/values/[labelId]/[version]/contract.d.ts +0 -29
  211. package/dist/routes/values/[labelId]/[version]/contract.d.ts.map +0 -1
  212. package/dist/routes/values/[labelId]/[version]/contract.js +0 -33
  213. package/dist/routes/values/[labelId]/[version]/contract.js.map +0 -1
  214. package/dist/routes/values/[labelId]/[version]/index.d.ts +0 -8
  215. package/dist/routes/values/[labelId]/[version]/index.d.ts.map +0 -1
  216. package/dist/routes/values/[labelId]/[version]/index.js +0 -45
  217. package/dist/routes/values/[labelId]/[version]/index.js.map +0 -1
  218. package/dist/routes/values/[labelId]/contract.d.ts +0 -38
  219. package/dist/routes/values/[labelId]/contract.d.ts.map +0 -1
  220. package/dist/routes/values/[labelId]/contract.js +0 -59
  221. package/dist/routes/values/[labelId]/contract.js.map +0 -1
  222. package/dist/routes/values/[labelId]/index.d.ts +0 -8
  223. package/dist/routes/values/[labelId]/index.d.ts.map +0 -1
  224. package/dist/routes/values/[labelId]/index.js +0 -42
  225. package/dist/routes/values/[labelId]/index.js.map +0 -1
  226. package/dist/server.d.ts.map +0 -1
  227. package/dist/store.d.ts +0 -87
  228. package/dist/store.d.ts.map +0 -1
  229. package/dist/store.js +0 -205
  230. package/dist/store.js.map +0 -1
  231. package/dist/types.d.ts.map +0 -1
  232. package/dist/types.js +0 -7
  233. package/dist/types.js.map +0 -1
@@ -1,32 +0,0 @@
1
- /**
2
- * CMS Label Values Repository
3
- *
4
- * 라벨 값 관리를 위한 Repository
5
- */
6
- import { type CmsLabelValue, type NewCmsLabelValue } from '../entities/index.js';
7
- /**
8
- * 특정 라벨의 특정 버전 값들 조회
9
- */
10
- export declare function findByLabelIdAndVersion(labelId: number, version: number, options?: {
11
- locale?: string;
12
- breakpoint?: string | null;
13
- }): Promise<CmsLabelValue[]>;
14
- /**
15
- * 값 저장 (upsert)
16
- */
17
- export declare function upsert(data: NewCmsLabelValue): Promise<CmsLabelValue>;
18
- /**
19
- * 여러 값 일괄 저장
20
- */
21
- export declare function upsertMany(values: NewCmsLabelValue[]): Promise<CmsLabelValue[]>;
22
- /**
23
- * 특정 버전의 모든 값 삭제
24
- */
25
- export declare function deleteByVersion(labelId: number, version: number): Promise<CmsLabelValue[]>;
26
- export declare const cmsLabelValuesRepository: {
27
- findByLabelIdAndVersion: typeof findByLabelIdAndVersion;
28
- upsert: typeof upsert;
29
- upsertMany: typeof upsertMany;
30
- deleteByVersion: typeof deleteByVersion;
31
- };
32
- //# sourceMappingURL=cms-label-values.repository.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cms-label-values.repository.d.ts","sourceRoot":"","sources":["../../src/repositories/cms-label-values.repository.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAkB,KAAK,aAAa,EAAE,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEjG;;GAEG;AACH,wBAAsB,uBAAuB,CACzC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;IACN,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,GACF,OAAO,CAAC,aAAa,EAAE,CAAC,CA0B1B;AAED;;GAEG;AACH,wBAAsB,MAAM,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,aAAa,CAAC,CA8B3E;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,MAAM,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CASrF;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAShG;AAGD,eAAO,MAAM,wBAAwB;;;;;CAKpC,CAAC"}
@@ -1,72 +0,0 @@
1
- /**
2
- * CMS Label Values Repository
3
- *
4
- * 라벨 값 관리를 위한 Repository
5
- */
6
- import { findOne, findMany, create, updateOne, deleteMany } from '@spfn/core/db';
7
- import { eq, and, isNull } from 'drizzle-orm';
8
- import { cmsLabelValues } from '../entities/index.js';
9
- /**
10
- * 특정 라벨의 특정 버전 값들 조회
11
- */
12
- export async function findByLabelIdAndVersion(labelId, version, options) {
13
- const { locale, breakpoint } = options || {};
14
- const conditions = [
15
- eq(cmsLabelValues.labelId, labelId),
16
- eq(cmsLabelValues.version, version)
17
- ];
18
- if (locale) {
19
- conditions.push(eq(cmsLabelValues.locale, locale));
20
- }
21
- if (breakpoint !== undefined) {
22
- conditions.push(breakpoint === null
23
- ? isNull(cmsLabelValues.breakpoint)
24
- : eq(cmsLabelValues.breakpoint, breakpoint));
25
- }
26
- return findMany(cmsLabelValues, {
27
- where: and(...conditions)
28
- });
29
- }
30
- /**
31
- * 값 저장 (upsert)
32
- */
33
- export async function upsert(data) {
34
- // 기존 값이 있는지 확인
35
- const existing = await findOne(cmsLabelValues, and(eq(cmsLabelValues.labelId, data.labelId), eq(cmsLabelValues.version, data.version ?? 1), eq(cmsLabelValues.locale, data.locale || 'ko'), data.breakpoint
36
- ? eq(cmsLabelValues.breakpoint, data.breakpoint)
37
- : isNull(cmsLabelValues.breakpoint)));
38
- if (existing) {
39
- // UPDATE
40
- const updated = await updateOne(cmsLabelValues, { id: existing.id }, { value: data.value });
41
- return updated;
42
- }
43
- else {
44
- // INSERT
45
- return create(cmsLabelValues, data);
46
- }
47
- }
48
- /**
49
- * 여러 값 일괄 저장
50
- */
51
- export async function upsertMany(values) {
52
- const results = [];
53
- for (const value of values) {
54
- const result = await upsert(value);
55
- results.push(result);
56
- }
57
- return results;
58
- }
59
- /**
60
- * 특정 버전의 모든 값 삭제
61
- */
62
- export async function deleteByVersion(labelId, version) {
63
- return deleteMany(cmsLabelValues, and(eq(cmsLabelValues.labelId, labelId), eq(cmsLabelValues.version, version)));
64
- }
65
- // Legacy export for backward compatibility
66
- export const cmsLabelValuesRepository = {
67
- findByLabelIdAndVersion,
68
- upsert,
69
- upsertMany,
70
- deleteByVersion
71
- };
72
- //# sourceMappingURL=cms-label-values.repository.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cms-label-values.repository.js","sourceRoot":"","sources":["../../src/repositories/cms-label-values.repository.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,EAAE,EAAE,EAAE,GAAG,EAAO,MAAM,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,cAAc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AU,EAAE,IAAI,CAAC,UAAU,CAAC;QAChD,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,CAC1C,CACJ,CAAC;IAEF,IAAI,QAAQ,EACZ,CAAC;QACG,SAAS;QACT,MAAM,OAAO,GAAG,MAAM,SAAS,CAC3B,cAAc,EACd,EAAE,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,EACnB,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CACxB,CAAC;QACF,OAAO,OAAQ,CAAC;IACpB,CAAC;SAED,CAAC;QACG,SAAS;QACT,OAAO,MAAM,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;IACxC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,MAA0B;IAEvD,MAAM,OAAO,GAAG,EAAE,CAAC;IACnB,KAAK,MAAM,KAAK,IAAI,MAAM,EAC1B,CAAC;QACG,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC;QACnC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAAe,EAAE,OAAe;IAElE,OAAO,UAAU,CACb,cAAc,EACd,GAAG,CACC,EAAE,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,EACnC,EAAE,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CACtC,CACJ,CAAC;AACN,CAAC;AAED,2CAA2C;AAC3C,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACpC,uBAAuB;IACvB,MAAM;IACN,UAAU;IACV,eAAe;CAClB,CAAC"}
@@ -1,53 +0,0 @@
1
- /**
2
- * CMS Labels Repository
3
- *
4
- * 라벨 메타데이터 관리를 위한 Repository
5
- */
6
- import { type CmsLabel, type NewCmsLabel } from '../entities/index.js';
7
- /**
8
- * 라벨 목록 조회 (페이지네이션)
9
- */
10
- export declare function findMany(options?: {
11
- section?: string;
12
- limit?: number;
13
- offset?: number;
14
- }): Promise<CmsLabel[]>;
15
- /**
16
- * 전체 라벨 수 조회
17
- */
18
- export declare function count(section?: string): Promise<number>;
19
- /**
20
- * ID로 라벨 조회
21
- */
22
- export declare function findById(id: number): Promise<CmsLabel | null>;
23
- /**
24
- * Key로 라벨 조회
25
- */
26
- export declare function findByKey(key: string): Promise<CmsLabel | null>;
27
- /**
28
- * 섹션으로 모든 라벨 조회
29
- */
30
- export declare function findBySection(section: string): Promise<CmsLabel[]>;
31
- /**
32
- * 라벨 생성
33
- */
34
- export declare function create(data: NewCmsLabel): Promise<CmsLabel>;
35
- /**
36
- * 라벨 수정
37
- */
38
- export declare function updateById(id: number, data: Partial<NewCmsLabel>): Promise<CmsLabel | null>;
39
- /**
40
- * 라벨 삭제
41
- */
42
- export declare function deleteById(id: number): Promise<CmsLabel | null>;
43
- export declare const cmsLabelsRepository: {
44
- findMany: typeof findMany;
45
- count: typeof count;
46
- findById: typeof findById;
47
- findByKey: typeof findByKey;
48
- findBySection: typeof findBySection;
49
- create: typeof create;
50
- updateById: typeof updateById;
51
- deleteById: typeof deleteById;
52
- };
53
- //# sourceMappingURL=cms-labels.repository.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cms-labels.repository.d.ts","sourceRoot":"","sources":["../../src/repositories/cms-labels.repository.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAa,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAElF;;GAEG;AACH,wBAAsB,QAAQ,CAAC,OAAO,CAAC,EAAE;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAUtB;AAED;;GAEG;AACH,wBAAsB,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAG7D;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAGnE;AAED;;GAEG;AACH,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAGrE;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAMxE;AAED;;GAEG;AACH,wBAAsB,MAAM,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,CAGjE;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAGjG;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAGrE;AAGD,eAAO,MAAM,mBAAmB;;;;;;;;;CAS/B,CAAC"}
@@ -1,77 +0,0 @@
1
- /**
2
- * CMS Labels Repository
3
- *
4
- * 라벨 메타데이터 관리를 위한 Repository
5
- */
6
- import { findOne, findMany as findManyHelper, create as createHelper, updateOne, deleteOne, count as countHelper } from '@spfn/core/db';
7
- import { desc } from 'drizzle-orm';
8
- import { cmsLabels } from '../entities/index.js';
9
- /**
10
- * 라벨 목록 조회 (페이지네이션)
11
- */
12
- export async function findMany(options) {
13
- const { section, limit = 20, offset = 0 } = options || {};
14
- return findManyHelper(cmsLabels, {
15
- where: section ? { section } : undefined,
16
- orderBy: desc(cmsLabels.updatedAt),
17
- limit,
18
- offset
19
- });
20
- }
21
- /**
22
- * 전체 라벨 수 조회
23
- */
24
- export async function count(section) {
25
- return countHelper(cmsLabels, section ? { section } : undefined);
26
- }
27
- /**
28
- * ID로 라벨 조회
29
- */
30
- export async function findById(id) {
31
- return findOne(cmsLabels, { id });
32
- }
33
- /**
34
- * Key로 라벨 조회
35
- */
36
- export async function findByKey(key) {
37
- return findOne(cmsLabels, { key });
38
- }
39
- /**
40
- * 섹션으로 모든 라벨 조회
41
- */
42
- export async function findBySection(section) {
43
- return findManyHelper(cmsLabels, {
44
- where: { section },
45
- orderBy: desc(cmsLabels.updatedAt),
46
- });
47
- }
48
- /**
49
- * 라벨 생성
50
- */
51
- export async function create(data) {
52
- return createHelper(cmsLabels, data);
53
- }
54
- /**
55
- * 라벨 수정
56
- */
57
- export async function updateById(id, data) {
58
- return updateOne(cmsLabels, { id }, { ...data, updatedAt: new Date() });
59
- }
60
- /**
61
- * 라벨 삭제
62
- */
63
- export async function deleteById(id) {
64
- return deleteOne(cmsLabels, { id });
65
- }
66
- // Legacy export for backward compatibility
67
- export const cmsLabelsRepository = {
68
- findMany,
69
- count,
70
- findById,
71
- findByKey,
72
- findBySection,
73
- create,
74
- updateById,
75
- deleteById
76
- };
77
- //# sourceMappingURL=cms-labels.repository.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cms-labels.repository.js","sourceRoot":"","sources":["../../src/repositories/cms-labels.repository.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,IAAI,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACxI,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,SAAS,EAAmC,MAAM,sBAAsB,CAAC;AAElF;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,OAI9B;IAEG,MAAM,EAAE,OAAO,EAAE,KAAK,GAAG,EAAE,EAAE,MAAM,GAAG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AE,SAAS,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC;AAC5E,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,EAAU;IAEvC,OAAO,SAAS,CAAC,SAAS,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;AACxC,CAAC;AAED,2CAA2C;AAC3C,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,QAAQ;IACR,KAAK;IACL,QAAQ;IACR,SAAS;IACT,aAAa;IACb,MAAM;IACN,UAAU;IACV,UAAU;CACb,CAAC"}
@@ -1,53 +0,0 @@
1
- /**
2
- * CMS Published Cache Repository
3
- *
4
- * 발행된 콘텐츠 캐시 관리 (초고속 조회)
5
- */
6
- import { type NewCmsPublishedCache } from '../entities/index.js';
7
- /**
8
- * 섹션 + 언어로 발행된 캐시 조회
9
- */
10
- export declare function findBySection(section: string, locale?: string): Promise<{
11
- section: string;
12
- id: number;
13
- locale: string;
14
- content: unknown;
15
- version: number;
16
- publishedAt: Date;
17
- publishedBy: string | null;
18
- } | null>;
19
- /**
20
- * 캐시 생성 또는 업데이트 (UPSERT)
21
- */
22
- export declare function upsert(data: NewCmsPublishedCache): Promise<{
23
- section: string;
24
- id: number;
25
- locale: string;
26
- content: unknown;
27
- version: number;
28
- publishedAt: Date;
29
- publishedBy: string | null;
30
- }>;
31
- /**
32
- * 섹션별 모든 언어 캐시 조회
33
- */
34
- export declare function findAllLanguages(section: string): Promise<{
35
- section: string;
36
- id: number;
37
- locale: string;
38
- content: unknown;
39
- version: number;
40
- publishedAt: Date;
41
- publishedBy: string | null;
42
- }[]>;
43
- /**
44
- * 캐시 삭제
45
- */
46
- export declare function deleteBySection(section: string, locale?: string): Promise<void>;
47
- export declare const cmsPublishedCacheRepository: {
48
- findBySection: typeof findBySection;
49
- upsert: typeof upsert;
50
- findAllLanguages: typeof findAllLanguages;
51
- deleteBySection: typeof deleteBySection;
52
- };
53
- //# sourceMappingURL=cms-published-cache.repository.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cms-published-cache.repository.d.ts","sourceRoot":"","sources":["../../src/repositories/cms-published-cache.repository.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAqB,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEpF;;GAEG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,MAAa;;;;;;;;UASzE;AAED;;GAEG;AACH,wBAAsB,MAAM,CAAC,IAAI,EAAE,oBAAoB;;;;;;;;GAWtD;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,MAAM;;;;;;;;KAKrD;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,iBAmBrE;AAED,eAAO,MAAM,2BAA2B;;;;;CAKvC,CAAC"}
@@ -1,54 +0,0 @@
1
- /**
2
- * CMS Published Cache Repository
3
- *
4
- * 발행된 콘텐츠 캐시 관리 (초고속 조회)
5
- */
6
- import { findOne, findMany, deleteOne, deleteMany, upsert as upsertHelper } from '@spfn/core/db';
7
- import { eq, and, sql } from 'drizzle-orm';
8
- import { cmsPublishedCache } from '../entities/index.js';
9
- /**
10
- * 섹션 + 언어로 발행된 캐시 조회
11
- */
12
- export async function findBySection(section, locale = 'ko') {
13
- return findOne(cmsPublishedCache, and(eq(cmsPublishedCache.section, section), eq(cmsPublishedCache.locale, locale)));
14
- }
15
- /**
16
- * 캐시 생성 또는 업데이트 (UPSERT)
17
- */
18
- export async function upsert(data) {
19
- return upsertHelper(cmsPublishedCache, data, {
20
- target: [cmsPublishedCache.section, cmsPublishedCache.locale],
21
- set: {
22
- content: data.content,
23
- publishedAt: data.publishedAt,
24
- publishedBy: data.publishedBy,
25
- version: sql `${cmsPublishedCache.version} + 1`, // 버전 증가로 클라이언트 캐시 무효화
26
- }
27
- });
28
- }
29
- /**
30
- * 섹션별 모든 언어 캐시 조회
31
- */
32
- export async function findAllLanguages(section) {
33
- return findMany(cmsPublishedCache, {
34
- where: eq(cmsPublishedCache.section, section)
35
- });
36
- }
37
- /**
38
- * 캐시 삭제
39
- */
40
- export async function deleteBySection(section, locale) {
41
- if (locale) {
42
- await deleteOne(cmsPublishedCache, and(eq(cmsPublishedCache.section, section), eq(cmsPublishedCache.locale, locale)));
43
- }
44
- else {
45
- await deleteMany(cmsPublishedCache, eq(cmsPublishedCache.section, section));
46
- }
47
- }
48
- export const cmsPublishedCacheRepository = {
49
- findBySection,
50
- upsert,
51
- findAllLanguages,
52
- deleteBySection,
53
- };
54
- //# sourceMappingURL=cms-published-cache.repository.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cms-published-cache.repository.js","sourceRoot":"","sources":["../../src/repositories/cms-published-cache.repository.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,eAAe,CAAC;AACjG,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAA6B,MAAM,sBAAsB,CAAC;AAEpF;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAAe,EAAE,SAAiB,IAAI;IAEtE,OAAO,OAAO,CACV,iBAAiB,EACjB,GAAG,CACC,EAAE,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,EACtC,EAAE,CAAC,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CACvC,CACJ,CAAC;AACN,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,IAA0B;IAEnD,OAAO,YAAY,CAAC,iBAAiB,EAAE,IAAI,EAAE;QACzC,MAAM,EAAE,CAAC,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,CAAC,MAAM,CAAC;QAC7D,GAAG,EAAE;YACD,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,OAAO,EAAE,GAAG,CAAA,GAAG,iBAAiB,CAAC,OAAO,MAAM,EAAE,sBAAsB;SACzE;KACJ,CAAC,CAAC;AACP,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAAe;IAElD,OAAO,QAAQ,CAAC,iBAAiB,EAAE;QAC/B,KAAK,EAAE,EAAE,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC;KAChD,CAAC,CAAC;AACP,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAAe,EAAE,MAAe;IAElE,IAAI,MAAM,EACV,CAAC;QACG,MAAM,SAAS,CACX,iBAAiB,EACjB,GAAG,CACC,EAAE,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,EACtC,EAAE,CAAC,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CACvC,CACJ,CAAC;IACN,CAAC;SAED,CAAC;QACG,MAAM,UAAU,CACZ,iBAAiB,EACjB,EAAE,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,CACzC,CAAC;IACN,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACvC,aAAa;IACb,MAAM;IACN,gBAAgB;IAChB,eAAe;CAClB,CAAC"}
@@ -1,8 +0,0 @@
1
- /**
2
- * CMS Database Repositories
3
- */
4
- export { cmsLabelsRepository } from './cms-labels.repository.js';
5
- export { cmsLabelValuesRepository } from './cms-label-values.repository.js';
6
- export { cmsDraftCacheRepository } from './cms-draft-cache.repository.js';
7
- export { cmsPublishedCacheRepository } from './cms-published-cache.repository.js';
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/repositories/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC"}
@@ -1,9 +0,0 @@
1
- /**
2
- * CMS Database Repositories
3
- */
4
- // Export repositories as namespaced objects to avoid naming conflicts
5
- export { cmsLabelsRepository } from './cms-labels.repository.js';
6
- export { cmsLabelValuesRepository } from './cms-label-values.repository.js';
7
- export { cmsDraftCacheRepository } from './cms-draft-cache.repository.js';
8
- export { cmsPublishedCacheRepository } from './cms-published-cache.repository.js';
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/repositories/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,sEAAsE;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC"}
@@ -1,68 +0,0 @@
1
- /**
2
- * CMS Label Detail Contracts
3
- */
4
- /**
5
- * GET /cms/labels/:id - 라벨 단건 조회
6
- */
7
- export declare const getLabelContract: {
8
- readonly method: "GET";
9
- readonly path: "/:id";
10
- readonly params: import("@sinclair/typebox").TObject<{
11
- id: import("@sinclair/typebox").TString;
12
- }>;
13
- readonly response: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
14
- id: import("@sinclair/typebox").TNumber;
15
- key: import("@sinclair/typebox").TString;
16
- section: import("@sinclair/typebox").TString;
17
- type: import("@sinclair/typebox").TString;
18
- publishedVersion: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TNull]>;
19
- createdBy: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
20
- createdAt: import("@sinclair/typebox").TString;
21
- updatedAt: import("@sinclair/typebox").TString;
22
- }>, import("@sinclair/typebox").TObject<{
23
- error: import("@sinclair/typebox").TString;
24
- }>]>;
25
- };
26
- /**
27
- * PATCH /cms/labels/:id - 라벨 메타데이터 수정
28
- */
29
- export declare const updateLabelContract: {
30
- readonly method: "PATCH";
31
- readonly path: "/:id";
32
- readonly params: import("@sinclair/typebox").TObject<{
33
- id: import("@sinclair/typebox").TString;
34
- }>;
35
- readonly body: import("@sinclair/typebox").TObject<{
36
- section: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
37
- type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"text">, import("@sinclair/typebox").TLiteral<"image">, import("@sinclair/typebox").TLiteral<"video">, import("@sinclair/typebox").TLiteral<"file">, import("@sinclair/typebox").TLiteral<"object">]>>;
38
- }>;
39
- readonly response: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
40
- id: import("@sinclair/typebox").TNumber;
41
- key: import("@sinclair/typebox").TString;
42
- section: import("@sinclair/typebox").TString;
43
- type: import("@sinclair/typebox").TString;
44
- publishedVersion: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TNull]>;
45
- createdBy: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
46
- createdAt: import("@sinclair/typebox").TString;
47
- updatedAt: import("@sinclair/typebox").TString;
48
- }>, import("@sinclair/typebox").TObject<{
49
- error: import("@sinclair/typebox").TString;
50
- }>]>;
51
- };
52
- /**
53
- * DELETE /cms/labels/:id - 라벨 삭제
54
- */
55
- export declare const deleteLabelContract: {
56
- readonly method: "DELETE";
57
- readonly path: "/:id";
58
- readonly params: import("@sinclair/typebox").TObject<{
59
- id: import("@sinclair/typebox").TString;
60
- }>;
61
- readonly response: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
62
- success: import("@sinclair/typebox").TBoolean;
63
- id: import("@sinclair/typebox").TNumber;
64
- }>, import("@sinclair/typebox").TObject<{
65
- error: import("@sinclair/typebox").TString;
66
- }>]>;
67
- };
68
- //# sourceMappingURL=contract.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../../src/routes/labels/[id]/contract.ts"],"names":[],"mappings":"AAGA;;GAEG;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;CAqBK,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;CA+BE,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;CAeE,CAAC"}
@@ -1,84 +0,0 @@
1
- import { Type } from '@sinclair/typebox';
2
- /**
3
- * CMS Label Detail Contracts
4
- */
5
- /**
6
- * GET /cms/labels/:id - 라벨 단건 조회
7
- */
8
- export const getLabelContract = {
9
- method: 'GET',
10
- path: '/:id',
11
- params: Type.Object({
12
- id: Type.String({ description: '라벨 ID' })
13
- }),
14
- response: Type.Union([
15
- Type.Object({
16
- id: Type.Number(),
17
- key: Type.String(),
18
- section: Type.String(),
19
- type: Type.String(),
20
- publishedVersion: Type.Union([Type.Number(), Type.Null()]),
21
- createdBy: Type.Union([Type.String(), Type.Null()]),
22
- createdAt: Type.String(),
23
- updatedAt: Type.String()
24
- }),
25
- Type.Object({
26
- error: Type.String()
27
- })
28
- ])
29
- };
30
- /**
31
- * PATCH /cms/labels/:id - 라벨 메타데이터 수정
32
- */
33
- export const updateLabelContract = {
34
- method: 'PATCH',
35
- path: '/:id',
36
- params: Type.Object({
37
- id: Type.String({ description: '라벨 ID' })
38
- }),
39
- body: Type.Object({
40
- section: Type.Optional(Type.String({ description: '섹션 변경' })),
41
- type: Type.Optional(Type.Union([
42
- Type.Literal('text'),
43
- Type.Literal('image'),
44
- Type.Literal('video'),
45
- Type.Literal('file'),
46
- Type.Literal('object')
47
- ]))
48
- }),
49
- response: Type.Union([
50
- Type.Object({
51
- id: Type.Number(),
52
- key: Type.String(),
53
- section: Type.String(),
54
- type: Type.String(),
55
- publishedVersion: Type.Union([Type.Number(), Type.Null()]),
56
- createdBy: Type.Union([Type.String(), Type.Null()]),
57
- createdAt: Type.String(),
58
- updatedAt: Type.String()
59
- }),
60
- Type.Object({
61
- error: Type.String()
62
- })
63
- ])
64
- };
65
- /**
66
- * DELETE /cms/labels/:id - 라벨 삭제
67
- */
68
- export const deleteLabelContract = {
69
- method: 'DELETE',
70
- path: '/:id',
71
- params: Type.Object({
72
- id: Type.String({ description: '라벨 ID' })
73
- }),
74
- response: Type.Union([
75
- Type.Object({
76
- success: Type.Boolean(),
77
- id: Type.Number()
78
- }),
79
- Type.Object({
80
- error: Type.String()
81
- })
82
- ])
83
- };
84
- //# sourceMappingURL=contract.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contract.js","sourceRoot":"","sources":["../../../../src/routes/labels/[id]/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAGzC;;GAEG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,MAAM,EAAE,KAAc;IACtB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;QAChB,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;KAC5C,CAAC;IACF,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC;QACjB,IAAI,CAAC,MAAM,CAAC;YACR,EAAE,EAAE,IAAI,CAAC,MAAM,EA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1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/routes/labels/[id]/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAWH,QAAA,MAAM,GAAG,oCAAc,CAAC;AAiHxB,eAAe,GAAG,CAAC"}
@@ -1,96 +0,0 @@
1
- /**
2
- * CMS Label Detail Routes
3
- *
4
- * - GET /cms/labels/:id - 라벨 단건 조회
5
- * - PATCH /cms/labels/:id - 라벨 메타데이터 수정
6
- * - DELETE /cms/labels/:id - 라벨 삭제
7
- */
8
- import { createApp } from '@spfn/core/route';
9
- import { Transactional } from '@spfn/core/db';
10
- import { cmsLabelsRepository } from '../../../repositories/index.js';
11
- import { getLabelContract, updateLabelContract, deleteLabelContract, } from './contract.js';
12
- const app = createApp();
13
- /**
14
- * GET /cms/labels/:id
15
- * 라벨 단건 조회
16
- */
17
- app.bind(getLabelContract, async (c) => {
18
- const { id } = c.params;
19
- const labelId = parseInt(id, 10);
20
- if (isNaN(labelId)) {
21
- return c.json({ error: 'Invalid label ID' }, 400);
22
- }
23
- const label = await cmsLabelsRepository.findById(labelId);
24
- if (!label) {
25
- return c.json({ error: 'Label not found' }, 404);
26
- }
27
- return c.json({
28
- id: label.id,
29
- key: label.key,
30
- section: label.section,
31
- type: label.type,
32
- publishedVersion: label.publishedVersion,
33
- createdBy: label.createdBy,
34
- createdAt: label.createdAt.toISOString(),
35
- updatedAt: label.updatedAt.toISOString(),
36
- });
37
- });
38
- /**
39
- * PATCH /cms/labels/:id
40
- * 라벨 메타데이터 수정
41
- */
42
- app.bind(updateLabelContract, [Transactional()], async (c) => {
43
- const { id } = c.params;
44
- const labelId = parseInt(id, 10);
45
- if (isNaN(labelId)) {
46
- return c.json({ error: 'Invalid label ID' }, 400);
47
- }
48
- const body = await c.data();
49
- // 라벨 존재 확인
50
- const existing = await cmsLabelsRepository.findById(labelId);
51
- if (!existing) {
52
- return c.json({ error: 'Label not found' }, 404);
53
- }
54
- // 라벨 수정
55
- const updated = await cmsLabelsRepository.updateById(labelId, body);
56
- if (!updated) {
57
- return c.json({ error: 'Failed to update label' }, 500);
58
- }
59
- return c.json({
60
- id: updated.id,
61
- key: updated.key,
62
- section: updated.section,
63
- type: updated.type,
64
- publishedVersion: updated.publishedVersion,
65
- createdBy: updated.createdBy,
66
- createdAt: updated.createdAt.toISOString(),
67
- updatedAt: updated.updatedAt.toISOString(),
68
- });
69
- });
70
- /**
71
- * DELETE /cms/labels/:id
72
- * 라벨 삭제
73
- */
74
- app.bind(deleteLabelContract, [Transactional()], async (c) => {
75
- const { id } = c.params;
76
- const labelId = parseInt(id, 10);
77
- if (isNaN(labelId)) {
78
- return c.json({ error: 'Invalid label ID' }, 400);
79
- }
80
- // 라벨 존재 확인
81
- const existing = await cmsLabelsRepository.findById(labelId);
82
- if (!existing) {
83
- return c.json({ error: 'Label not found' }, 404);
84
- }
85
- // 라벨 삭제 (CASCADE로 values도 함께 삭제됨)
86
- const deleted = await cmsLabelsRepository.deleteById(labelId);
87
- if (!deleted) {
88
- return c.json({ error: 'Failed to delete label' }, 500);
89
- }
90
- return c.json({
91
- success: true,
92
- id: deleted.id,
93
- });
94
- });
95
- export default app;
96
- //# sourceMappingURL=index.js.map