@focus-reactive/payload-plugin-translator 0.1.0 → 0.1.2

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 (636) hide show
  1. package/README.md +27 -14
  2. package/dist/client/app/cache/CacheProvider.export.js +1 -1
  3. package/dist/client/entities/translation/ui/CompletedTranslationStatus/styles.module.scss +3 -0
  4. package/dist/client/entities/translation/ui/FailedTranslationStatus/styles.module.scss +3 -0
  5. package/dist/client/entities/translation/ui/TranslationDirection/styles.module.scss +16 -0
  6. package/dist/client/features/collection-translation-form/ui/styles.module.scss +31 -0
  7. package/dist/client/features/collection-translation-popup/ui/styles.module.scss +18 -0
  8. package/dist/client/features/collection-translation-progress/ui/styles.module.scss +8 -0
  9. package/dist/client/features/open-document-translation-popup/ui/styles.module.scss +11 -0
  10. package/dist/client/features/translate-document-form/ui/styles.module.scss +18 -0
  11. package/dist/client/shared/ui/Alert/styles.module.scss +31 -0
  12. package/dist/client/shared/ui/Button/styles.module.scss +103 -0
  13. package/dist/client/shared/ui/Checkbox/styles.module.scss +17 -0
  14. package/dist/client/shared/ui/ColorIndicator/styles.module.scss +37 -0
  15. package/dist/client/shared/ui/Description/styles.module.scss +14 -0
  16. package/dist/client/shared/ui/Divider/styles.module.scss +56 -0
  17. package/dist/client/shared/ui/Label/styles.module.scss +12 -0
  18. package/dist/client/shared/ui/Loading/styles.module.scss +141 -0
  19. package/dist/client/shared/ui/Popup/styles.module.scss +7 -0
  20. package/dist/client/shared/ui/ProgressBar/styles.module.scss +64 -0
  21. package/dist/client/shared/ui/Select/styles.module.scss +55 -0
  22. package/dist/client/shared/ui/StatusCounter/styles.module.scss +46 -0
  23. package/dist/client/shared/ui/StatusIndicator/styles.module.scss +12 -0
  24. package/dist/client/shared/ui/Tooltip/styles.module.scss +84 -0
  25. package/dist/client/shared/ui/form/FormCheckbox/styles.module.scss +23 -0
  26. package/dist/client/shared/ui/form/FormCheckboxPublish/styles.module.scss +16 -0
  27. package/dist/client/shared/ui/form/FormSelectStrategy/styles.module.scss +16 -0
  28. package/dist/client/shared/utils/componentPath.d.ts +1 -1
  29. package/dist/client/shared/utils/componentPath.js +1 -1
  30. package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.export.js +1 -1
  31. package/dist/client/widgets/translate-document/ui/TranslateDocument.export.js +1 -1
  32. package/package.json +32 -17
  33. package/dist/client/app/cache/CacheProvider.d.ts.map +0 -1
  34. package/dist/client/app/cache/CacheProvider.export.d.ts.map +0 -1
  35. package/dist/client/app/cache/CacheProvider.export.js.map +0 -1
  36. package/dist/client/app/cache/CacheProvider.js.map +0 -1
  37. package/dist/client/app/cache/CacheProvider.jsx +0 -11
  38. package/dist/client/app/config/TranslateKitConfigContext.d.ts.map +0 -1
  39. package/dist/client/app/config/TranslateKitConfigContext.js.map +0 -1
  40. package/dist/client/app/config/TranslateKitConfigContext.jsx +0 -13
  41. package/dist/client/app/config/index.d.ts.map +0 -1
  42. package/dist/client/app/config/index.js.map +0 -1
  43. package/dist/client/entities/translation/api/mutations/useCancelCollectionTranslations.d.ts.map +0 -1
  44. package/dist/client/entities/translation/api/mutations/useCancelCollectionTranslations.js.map +0 -1
  45. package/dist/client/entities/translation/api/mutations/useCancelDocumentTranslation.d.ts.map +0 -1
  46. package/dist/client/entities/translation/api/mutations/useCancelDocumentTranslation.js.map +0 -1
  47. package/dist/client/entities/translation/api/mutations/useQueueDocumentTranslation.d.ts.map +0 -1
  48. package/dist/client/entities/translation/api/mutations/useQueueDocumentTranslation.js.map +0 -1
  49. package/dist/client/entities/translation/api/mutations/useQueueDocumentTranslations.d.ts.map +0 -1
  50. package/dist/client/entities/translation/api/mutations/useQueueDocumentTranslations.js.map +0 -1
  51. package/dist/client/entities/translation/api/mutations/useRunDocumentTranslation.d.ts.map +0 -1
  52. package/dist/client/entities/translation/api/mutations/useRunDocumentTranslation.js.map +0 -1
  53. package/dist/client/entities/translation/api/queries/useCollectionTranslationStatus.d.ts.map +0 -1
  54. package/dist/client/entities/translation/api/queries/useCollectionTranslationStatus.js.map +0 -1
  55. package/dist/client/entities/translation/api/queries/useDocumentTranslation.d.ts.map +0 -1
  56. package/dist/client/entities/translation/api/queries/useDocumentTranslation.js.map +0 -1
  57. package/dist/client/entities/translation/index.d.ts.map +0 -1
  58. package/dist/client/entities/translation/index.js.map +0 -1
  59. package/dist/client/entities/translation/model/enums.d.ts.map +0 -1
  60. package/dist/client/entities/translation/model/enums.js.map +0 -1
  61. package/dist/client/entities/translation/model/types.d.ts.map +0 -1
  62. package/dist/client/entities/translation/model/types.js.map +0 -1
  63. package/dist/client/entities/translation/ui/CompletedTranslationStatus/CompletedTranslationStatus.d.ts.map +0 -1
  64. package/dist/client/entities/translation/ui/CompletedTranslationStatus/CompletedTranslationStatus.js.map +0 -1
  65. package/dist/client/entities/translation/ui/CompletedTranslationStatus/CompletedTranslationStatus.jsx +0 -25
  66. package/dist/client/entities/translation/ui/CompletedTranslationStatus/index.d.ts.map +0 -1
  67. package/dist/client/entities/translation/ui/CompletedTranslationStatus/index.js.map +0 -1
  68. package/dist/client/entities/translation/ui/FailedTranslationStatus/FailedTranslationStatus.d.ts.map +0 -1
  69. package/dist/client/entities/translation/ui/FailedTranslationStatus/FailedTranslationStatus.js.map +0 -1
  70. package/dist/client/entities/translation/ui/FailedTranslationStatus/FailedTranslationStatus.jsx +0 -24
  71. package/dist/client/entities/translation/ui/FailedTranslationStatus/index.d.ts.map +0 -1
  72. package/dist/client/entities/translation/ui/FailedTranslationStatus/index.js.map +0 -1
  73. package/dist/client/entities/translation/ui/PendingTranslationStatus/PendingTranslationStatus.d.ts.map +0 -1
  74. package/dist/client/entities/translation/ui/PendingTranslationStatus/PendingTranslationStatus.js.map +0 -1
  75. package/dist/client/entities/translation/ui/PendingTranslationStatus/PendingTranslationStatus.jsx +0 -38
  76. package/dist/client/entities/translation/ui/PendingTranslationStatus/index.d.ts.map +0 -1
  77. package/dist/client/entities/translation/ui/PendingTranslationStatus/index.js.map +0 -1
  78. package/dist/client/entities/translation/ui/RunningTranslationStatus/RunningTranslationStatus.d.ts.map +0 -1
  79. package/dist/client/entities/translation/ui/RunningTranslationStatus/RunningTranslationStatus.js.map +0 -1
  80. package/dist/client/entities/translation/ui/RunningTranslationStatus/RunningTranslationStatus.jsx +0 -32
  81. package/dist/client/entities/translation/ui/RunningTranslationStatus/index.d.ts.map +0 -1
  82. package/dist/client/entities/translation/ui/RunningTranslationStatus/index.js.map +0 -1
  83. package/dist/client/entities/translation/ui/TranslationDirection/TranslationDirection.d.ts.map +0 -1
  84. package/dist/client/entities/translation/ui/TranslationDirection/TranslationDirection.js.map +0 -1
  85. package/dist/client/entities/translation/ui/TranslationDirection/TranslationDirection.jsx +0 -16
  86. package/dist/client/entities/translation/ui/TranslationDirection/index.d.ts.map +0 -1
  87. package/dist/client/entities/translation/ui/TranslationDirection/index.js.map +0 -1
  88. package/dist/client/features/collection-translation-form/index.client.d.ts.map +0 -1
  89. package/dist/client/features/collection-translation-form/index.client.js.map +0 -1
  90. package/dist/client/features/collection-translation-form/index.d.ts.map +0 -1
  91. package/dist/client/features/collection-translation-form/index.js.map +0 -1
  92. package/dist/client/features/collection-translation-form/model/constants.d.ts.map +0 -1
  93. package/dist/client/features/collection-translation-form/model/constants.js.map +0 -1
  94. package/dist/client/features/collection-translation-form/model/form-model.d.ts.map +0 -1
  95. package/dist/client/features/collection-translation-form/model/form-model.js.map +0 -1
  96. package/dist/client/features/collection-translation-form/model/index.d.ts.map +0 -1
  97. package/dist/client/features/collection-translation-form/model/index.js.map +0 -1
  98. package/dist/client/features/collection-translation-form/model/schema.d.ts.map +0 -1
  99. package/dist/client/features/collection-translation-form/model/schema.js.map +0 -1
  100. package/dist/client/features/collection-translation-form/ui/CollectionTranslationForm.d.ts.map +0 -1
  101. package/dist/client/features/collection-translation-form/ui/CollectionTranslationForm.js.map +0 -1
  102. package/dist/client/features/collection-translation-form/ui/CollectionTranslationForm.jsx +0 -25
  103. package/dist/client/features/collection-translation-form/ui/index.d.ts.map +0 -1
  104. package/dist/client/features/collection-translation-form/ui/index.js.map +0 -1
  105. package/dist/client/features/collection-translation-popup/index.d.ts.map +0 -1
  106. package/dist/client/features/collection-translation-popup/index.js.map +0 -1
  107. package/dist/client/features/collection-translation-popup/ui/CollectionTranslationPopup.d.ts.map +0 -1
  108. package/dist/client/features/collection-translation-popup/ui/CollectionTranslationPopup.js.map +0 -1
  109. package/dist/client/features/collection-translation-popup/ui/CollectionTranslationPopup.jsx +0 -23
  110. package/dist/client/features/collection-translation-progress/index.d.ts.map +0 -1
  111. package/dist/client/features/collection-translation-progress/index.js.map +0 -1
  112. package/dist/client/features/collection-translation-progress/ui/CollectionTranslationProgress.d.ts.map +0 -1
  113. package/dist/client/features/collection-translation-progress/ui/CollectionTranslationProgress.js.map +0 -1
  114. package/dist/client/features/collection-translation-progress/ui/CollectionTranslationProgress.jsx +0 -47
  115. package/dist/client/features/document-translation-progress-failed/index.d.ts.map +0 -1
  116. package/dist/client/features/document-translation-progress-failed/index.js.map +0 -1
  117. package/dist/client/features/document-translation-progress-failed/ui/DocumentTranslationProgressFailed.d.ts.map +0 -1
  118. package/dist/client/features/document-translation-progress-failed/ui/DocumentTranslationProgressFailed.js.map +0 -1
  119. package/dist/client/features/document-translation-progress-failed/ui/DocumentTranslationProgressFailed.jsx +0 -19
  120. package/dist/client/features/document-translation-progress-pending/index.d.ts.map +0 -1
  121. package/dist/client/features/document-translation-progress-pending/index.js.map +0 -1
  122. package/dist/client/features/document-translation-progress-pending/ui/DocumentTranslationProgressPending.d.ts.map +0 -1
  123. package/dist/client/features/document-translation-progress-pending/ui/DocumentTranslationProgressPending.js.map +0 -1
  124. package/dist/client/features/document-translation-progress-pending/ui/DocumentTranslationProgressPending.jsx +0 -34
  125. package/dist/client/features/document-translation-progress-running/index.d.ts.map +0 -1
  126. package/dist/client/features/document-translation-progress-running/index.js.map +0 -1
  127. package/dist/client/features/document-translation-progress-running/ui/DocumentTranslationProgressRunning.d.ts.map +0 -1
  128. package/dist/client/features/document-translation-progress-running/ui/DocumentTranslationProgressRunning.js.map +0 -1
  129. package/dist/client/features/document-translation-progress-running/ui/DocumentTranslationProgressRunning.jsx +0 -19
  130. package/dist/client/features/open-document-translation-popup/index.d.ts.map +0 -1
  131. package/dist/client/features/open-document-translation-popup/index.js.map +0 -1
  132. package/dist/client/features/open-document-translation-popup/ui/OpenDocumentTranslationPopup.d.ts.map +0 -1
  133. package/dist/client/features/open-document-translation-popup/ui/OpenDocumentTranslationPopup.js.map +0 -1
  134. package/dist/client/features/open-document-translation-popup/ui/OpenDocumentTranslationPopup.jsx +0 -15
  135. package/dist/client/features/translate-document-form/index.client.d.ts.map +0 -1
  136. package/dist/client/features/translate-document-form/index.client.js.map +0 -1
  137. package/dist/client/features/translate-document-form/index.d.ts.map +0 -1
  138. package/dist/client/features/translate-document-form/index.js.map +0 -1
  139. package/dist/client/features/translate-document-form/model/constants.d.ts.map +0 -1
  140. package/dist/client/features/translate-document-form/model/constants.js.map +0 -1
  141. package/dist/client/features/translate-document-form/model/form-model.d.ts.map +0 -1
  142. package/dist/client/features/translate-document-form/model/form-model.js.map +0 -1
  143. package/dist/client/features/translate-document-form/model/index.d.ts.map +0 -1
  144. package/dist/client/features/translate-document-form/model/index.js.map +0 -1
  145. package/dist/client/features/translate-document-form/model/schema.d.ts.map +0 -1
  146. package/dist/client/features/translate-document-form/model/schema.js.map +0 -1
  147. package/dist/client/features/translate-document-form/ui/DocumentTranslationForm.d.ts.map +0 -1
  148. package/dist/client/features/translate-document-form/ui/DocumentTranslationForm.js.map +0 -1
  149. package/dist/client/features/translate-document-form/ui/DocumentTranslationForm.jsx +0 -24
  150. package/dist/client/features/translate-document-form/ui/index.d.ts.map +0 -1
  151. package/dist/client/features/translate-document-form/ui/index.js.map +0 -1
  152. package/dist/client/shared/lib/assets/icons/LanguageTranslateIcon.d.ts.map +0 -1
  153. package/dist/client/shared/lib/assets/icons/LanguageTranslateIcon.js.map +0 -1
  154. package/dist/client/shared/lib/assets/icons/LanguageTranslateIcon.jsx +0 -4
  155. package/dist/client/shared/lib/assets/icons/QuestionCircleIcon.d.ts.map +0 -1
  156. package/dist/client/shared/lib/assets/icons/QuestionCircleIcon.js.map +0 -1
  157. package/dist/client/shared/lib/assets/icons/QuestionCircleIcon.jsx +0 -3
  158. package/dist/client/shared/lib/assets/icons/ReloadIcon.d.ts.map +0 -1
  159. package/dist/client/shared/lib/assets/icons/ReloadIcon.js.map +0 -1
  160. package/dist/client/shared/lib/assets/icons/ReloadIcon.jsx +0 -3
  161. package/dist/client/shared/lib/errors/handleApiError.d.ts.map +0 -1
  162. package/dist/client/shared/lib/errors/handleApiError.js.map +0 -1
  163. package/dist/client/shared/lib/forms/handle-form-error.d.ts.map +0 -1
  164. package/dist/client/shared/lib/forms/handle-form-error.js.map +0 -1
  165. package/dist/client/shared/lib/payload/hooks/useCollectionDashboardUrlParams.d.ts.map +0 -1
  166. package/dist/client/shared/lib/payload/hooks/useCollectionDashboardUrlParams.js.map +0 -1
  167. package/dist/client/shared/lib/payload/hooks/useCollectionDocumentUrlParams.d.ts.map +0 -1
  168. package/dist/client/shared/lib/payload/hooks/useCollectionDocumentUrlParams.js.map +0 -1
  169. package/dist/client/shared/lib/payload/hooks/useLocaleOptions.d.ts.map +0 -1
  170. package/dist/client/shared/lib/payload/hooks/useLocaleOptions.js.map +0 -1
  171. package/dist/client/shared/lib/utils/errors/handleApiError.d.ts.map +0 -1
  172. package/dist/client/shared/lib/utils/errors/handleApiError.js.map +0 -1
  173. package/dist/client/shared/lib/utils/react/useToggle.d.ts.map +0 -1
  174. package/dist/client/shared/lib/utils/react/useToggle.js.map +0 -1
  175. package/dist/client/shared/providers/CacheClientProvider/CacheClientProvider.factory.d.ts.map +0 -1
  176. package/dist/client/shared/providers/CacheClientProvider/CacheClientProvider.factory.js.map +0 -1
  177. package/dist/client/shared/providers/CacheClientProvider/index.d.ts.map +0 -1
  178. package/dist/client/shared/providers/CacheClientProvider/index.js.map +0 -1
  179. package/dist/client/shared/types/AccessGuard.d.ts.map +0 -1
  180. package/dist/client/shared/types/AccessGuard.js.map +0 -1
  181. package/dist/client/shared/types/PayloadComponentExport.d.ts.map +0 -1
  182. package/dist/client/shared/types/PayloadComponentExport.js.map +0 -1
  183. package/dist/client/shared/ui/Alert/Alert.d.ts.map +0 -1
  184. package/dist/client/shared/ui/Alert/Alert.js.map +0 -1
  185. package/dist/client/shared/ui/Alert/Alert.jsx +0 -33
  186. package/dist/client/shared/ui/Alert/index.d.ts.map +0 -1
  187. package/dist/client/shared/ui/Alert/index.js.map +0 -1
  188. package/dist/client/shared/ui/Button/Button.d.ts.map +0 -1
  189. package/dist/client/shared/ui/Button/Button.js.map +0 -1
  190. package/dist/client/shared/ui/Button/Button.jsx +0 -35
  191. package/dist/client/shared/ui/Button/index.d.ts.map +0 -1
  192. package/dist/client/shared/ui/Button/index.js.map +0 -1
  193. package/dist/client/shared/ui/Checkbox/Checkbox.d.ts.map +0 -1
  194. package/dist/client/shared/ui/Checkbox/Checkbox.js.map +0 -1
  195. package/dist/client/shared/ui/Checkbox/Checkbox.jsx +0 -6
  196. package/dist/client/shared/ui/Checkbox/index.d.ts.map +0 -1
  197. package/dist/client/shared/ui/Checkbox/index.js.map +0 -1
  198. package/dist/client/shared/ui/ColorIndicator/ColorIndicator.d.ts.map +0 -1
  199. package/dist/client/shared/ui/ColorIndicator/ColorIndicator.js.map +0 -1
  200. package/dist/client/shared/ui/ColorIndicator/ColorIndicator.jsx +0 -7
  201. package/dist/client/shared/ui/ColorIndicator/index.d.ts.map +0 -1
  202. package/dist/client/shared/ui/ColorIndicator/index.js.map +0 -1
  203. package/dist/client/shared/ui/Description/Description.d.ts.map +0 -1
  204. package/dist/client/shared/ui/Description/Description.js.map +0 -1
  205. package/dist/client/shared/ui/Description/Description.jsx +0 -7
  206. package/dist/client/shared/ui/Description/index.d.ts.map +0 -1
  207. package/dist/client/shared/ui/Description/index.js.map +0 -1
  208. package/dist/client/shared/ui/Divider/Divider.d.ts.map +0 -1
  209. package/dist/client/shared/ui/Divider/Divider.js.map +0 -1
  210. package/dist/client/shared/ui/Divider/Divider.jsx +0 -7
  211. package/dist/client/shared/ui/Divider/index.d.ts.map +0 -1
  212. package/dist/client/shared/ui/Divider/index.js.map +0 -1
  213. package/dist/client/shared/ui/Label/Label.d.ts.map +0 -1
  214. package/dist/client/shared/ui/Label/Label.js.map +0 -1
  215. package/dist/client/shared/ui/Label/Label.jsx +0 -9
  216. package/dist/client/shared/ui/Label/index.d.ts.map +0 -1
  217. package/dist/client/shared/ui/Label/index.js.map +0 -1
  218. package/dist/client/shared/ui/Loading/Loading.d.ts.map +0 -1
  219. package/dist/client/shared/ui/Loading/Loading.js.map +0 -1
  220. package/dist/client/shared/ui/Loading/Loading.jsx +0 -11
  221. package/dist/client/shared/ui/Loading/index.d.ts.map +0 -1
  222. package/dist/client/shared/ui/Loading/index.js.map +0 -1
  223. package/dist/client/shared/ui/Popup/Popup.d.ts.map +0 -1
  224. package/dist/client/shared/ui/Popup/Popup.js.map +0 -1
  225. package/dist/client/shared/ui/Popup/Popup.jsx +0 -13
  226. package/dist/client/shared/ui/Popup/index.d.ts.map +0 -1
  227. package/dist/client/shared/ui/Popup/index.js.map +0 -1
  228. package/dist/client/shared/ui/ProgressBar/ProgressBar.d.ts.map +0 -1
  229. package/dist/client/shared/ui/ProgressBar/ProgressBar.js.map +0 -1
  230. package/dist/client/shared/ui/ProgressBar/ProgressBar.jsx +0 -11
  231. package/dist/client/shared/ui/ProgressBar/index.d.ts.map +0 -1
  232. package/dist/client/shared/ui/ProgressBar/index.js.map +0 -1
  233. package/dist/client/shared/ui/Select/Select.d.ts.map +0 -1
  234. package/dist/client/shared/ui/Select/Select.js.map +0 -1
  235. package/dist/client/shared/ui/Select/Select.jsx +0 -41
  236. package/dist/client/shared/ui/Select/index.d.ts.map +0 -1
  237. package/dist/client/shared/ui/Select/index.js.map +0 -1
  238. package/dist/client/shared/ui/StatusCounter/StatusCounter.d.ts.map +0 -1
  239. package/dist/client/shared/ui/StatusCounter/StatusCounter.js.map +0 -1
  240. package/dist/client/shared/ui/StatusCounter/StatusCounter.jsx +0 -26
  241. package/dist/client/shared/ui/StatusCounter/index.d.ts.map +0 -1
  242. package/dist/client/shared/ui/StatusCounter/index.js.map +0 -1
  243. package/dist/client/shared/ui/StatusIndicator/StatusIndicator.d.ts.map +0 -1
  244. package/dist/client/shared/ui/StatusIndicator/StatusIndicator.js.map +0 -1
  245. package/dist/client/shared/ui/StatusIndicator/StatusIndicator.jsx +0 -10
  246. package/dist/client/shared/ui/StatusIndicator/index.d.ts.map +0 -1
  247. package/dist/client/shared/ui/StatusIndicator/index.js.map +0 -1
  248. package/dist/client/shared/ui/Tooltip/Tooltip.d.ts.map +0 -1
  249. package/dist/client/shared/ui/Tooltip/Tooltip.js.map +0 -1
  250. package/dist/client/shared/ui/Tooltip/Tooltip.jsx +0 -16
  251. package/dist/client/shared/ui/Tooltip/index.d.ts.map +0 -1
  252. package/dist/client/shared/ui/Tooltip/index.js.map +0 -1
  253. package/dist/client/shared/ui/form/FormCheckbox/FormCheckbox.d.ts.map +0 -1
  254. package/dist/client/shared/ui/form/FormCheckbox/FormCheckbox.js.map +0 -1
  255. package/dist/client/shared/ui/form/FormCheckbox/FormCheckbox.jsx +0 -24
  256. package/dist/client/shared/ui/form/FormCheckbox/index.d.ts.map +0 -1
  257. package/dist/client/shared/ui/form/FormCheckbox/index.js.map +0 -1
  258. package/dist/client/shared/ui/form/FormCheckboxPublish/FormCheckboxPublish.d.ts.map +0 -1
  259. package/dist/client/shared/ui/form/FormCheckboxPublish/FormCheckboxPublish.js.map +0 -1
  260. package/dist/client/shared/ui/form/FormCheckboxPublish/FormCheckboxPublish.jsx +0 -21
  261. package/dist/client/shared/ui/form/FormCheckboxPublish/index.d.ts.map +0 -1
  262. package/dist/client/shared/ui/form/FormCheckboxPublish/index.js.map +0 -1
  263. package/dist/client/shared/ui/form/FormSelect/FormSelect.d.ts.map +0 -1
  264. package/dist/client/shared/ui/form/FormSelect/FormSelect.js.map +0 -1
  265. package/dist/client/shared/ui/form/FormSelect/FormSelect.jsx +0 -44
  266. package/dist/client/shared/ui/form/FormSelect/index.d.ts.map +0 -1
  267. package/dist/client/shared/ui/form/FormSelect/index.js.map +0 -1
  268. package/dist/client/shared/ui/form/FormSelectLocale/FormSelectLocale.d.ts.map +0 -1
  269. package/dist/client/shared/ui/form/FormSelectLocale/FormSelectLocale.js.map +0 -1
  270. package/dist/client/shared/ui/form/FormSelectLocale/FormSelectLocale.jsx +0 -6
  271. package/dist/client/shared/ui/form/FormSelectLocale/index.d.ts.map +0 -1
  272. package/dist/client/shared/ui/form/FormSelectLocale/index.js.map +0 -1
  273. package/dist/client/shared/ui/form/FormSelectStrategy/FormSelectStrategy.d.ts.map +0 -1
  274. package/dist/client/shared/ui/form/FormSelectStrategy/FormSelectStrategy.js.map +0 -1
  275. package/dist/client/shared/ui/form/FormSelectStrategy/FormSelectStrategy.jsx +0 -25
  276. package/dist/client/shared/ui/form/FormSelectStrategy/index.d.ts.map +0 -1
  277. package/dist/client/shared/ui/form/FormSelectStrategy/index.js.map +0 -1
  278. package/dist/client/shared/utils/componentPath.d.ts.map +0 -1
  279. package/dist/client/shared/utils/componentPath.js.map +0 -1
  280. package/dist/client/widgets/bulk-translation-dashboard/index.d.ts.map +0 -1
  281. package/dist/client/widgets/bulk-translation-dashboard/index.js.map +0 -1
  282. package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.d.ts.map +0 -1
  283. package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.export.d.ts.map +0 -1
  284. package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.export.js.map +0 -1
  285. package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.export.jsx +0 -11
  286. package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.js.map +0 -1
  287. package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.jsx +0 -55
  288. package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.server.d.ts.map +0 -1
  289. package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.server.js.map +0 -1
  290. package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.server.jsx +0 -17
  291. package/dist/client/widgets/bulk-translation-dashboard/ui/index.d.ts.map +0 -1
  292. package/dist/client/widgets/bulk-translation-dashboard/ui/index.js.map +0 -1
  293. package/dist/client/widgets/translate-document/index.d.ts.map +0 -1
  294. package/dist/client/widgets/translate-document/index.js.map +0 -1
  295. package/dist/client/widgets/translate-document/ui/TranslateDocument.d.ts.map +0 -1
  296. package/dist/client/widgets/translate-document/ui/TranslateDocument.export.d.ts.map +0 -1
  297. package/dist/client/widgets/translate-document/ui/TranslateDocument.export.js.map +0 -1
  298. package/dist/client/widgets/translate-document/ui/TranslateDocument.js.map +0 -1
  299. package/dist/client/widgets/translate-document/ui/TranslateDocument.jsx +0 -55
  300. package/dist/client/widgets/translate-document/ui/TranslateDocument.server.d.ts.map +0 -1
  301. package/dist/client/widgets/translate-document/ui/TranslateDocument.server.js.map +0 -1
  302. package/dist/client/widgets/translate-document/ui/TranslateDocument.server.jsx +0 -16
  303. package/dist/client/widgets/translate-document/ui/index.d.ts.map +0 -1
  304. package/dist/client/widgets/translate-document/ui/index.js.map +0 -1
  305. package/dist/field-config.d.ts.map +0 -1
  306. package/dist/field-config.js.map +0 -1
  307. package/dist/index.d.ts.map +0 -1
  308. package/dist/index.js.map +0 -1
  309. package/dist/plugin.d.ts.map +0 -1
  310. package/dist/plugin.js.map +0 -1
  311. package/dist/server/features/_lib/collection-utils.d.ts.map +0 -1
  312. package/dist/server/features/_lib/collection-utils.js.map +0 -1
  313. package/dist/server/features/_lib/index.d.ts.map +0 -1
  314. package/dist/server/features/_lib/index.js.map +0 -1
  315. package/dist/server/features/cancel/handler.d.ts.map +0 -1
  316. package/dist/server/features/cancel/handler.js.map +0 -1
  317. package/dist/server/features/cancel/handler.test.d.ts +0 -2
  318. package/dist/server/features/cancel/handler.test.d.ts.map +0 -1
  319. package/dist/server/features/cancel/handler.test.js +0 -63
  320. package/dist/server/features/cancel/index.d.ts.map +0 -1
  321. package/dist/server/features/cancel/index.js.map +0 -1
  322. package/dist/server/features/cancel/model.d.ts.map +0 -1
  323. package/dist/server/features/cancel/model.js.map +0 -1
  324. package/dist/server/features/cancel/route.d.ts.map +0 -1
  325. package/dist/server/features/cancel/route.js.map +0 -1
  326. package/dist/server/features/cancel-by-collection/handler.d.ts.map +0 -1
  327. package/dist/server/features/cancel-by-collection/handler.js.map +0 -1
  328. package/dist/server/features/cancel-by-collection/handler.test.d.ts +0 -2
  329. package/dist/server/features/cancel-by-collection/handler.test.d.ts.map +0 -1
  330. package/dist/server/features/cancel-by-collection/handler.test.js +0 -126
  331. package/dist/server/features/cancel-by-collection/index.d.ts.map +0 -1
  332. package/dist/server/features/cancel-by-collection/index.js.map +0 -1
  333. package/dist/server/features/cancel-by-collection/model.d.ts.map +0 -1
  334. package/dist/server/features/cancel-by-collection/model.js.map +0 -1
  335. package/dist/server/features/cancel-by-collection/route.d.ts.map +0 -1
  336. package/dist/server/features/cancel-by-collection/route.js.map +0 -1
  337. package/dist/server/features/enqueue-translation/handler.d.ts.map +0 -1
  338. package/dist/server/features/enqueue-translation/handler.js.map +0 -1
  339. package/dist/server/features/enqueue-translation/handler.test.d.ts +0 -2
  340. package/dist/server/features/enqueue-translation/handler.test.d.ts.map +0 -1
  341. package/dist/server/features/enqueue-translation/handler.test.js +0 -115
  342. package/dist/server/features/enqueue-translation/index.d.ts.map +0 -1
  343. package/dist/server/features/enqueue-translation/index.js.map +0 -1
  344. package/dist/server/features/enqueue-translation/model.d.ts.map +0 -1
  345. package/dist/server/features/enqueue-translation/model.js.map +0 -1
  346. package/dist/server/features/enqueue-translation/route.d.ts.map +0 -1
  347. package/dist/server/features/enqueue-translation/route.js.map +0 -1
  348. package/dist/server/features/get-collection-status/handler.d.ts.map +0 -1
  349. package/dist/server/features/get-collection-status/handler.js.map +0 -1
  350. package/dist/server/features/get-collection-status/handler.test.d.ts +0 -2
  351. package/dist/server/features/get-collection-status/handler.test.d.ts.map +0 -1
  352. package/dist/server/features/get-collection-status/handler.test.js +0 -108
  353. package/dist/server/features/get-collection-status/index.d.ts.map +0 -1
  354. package/dist/server/features/get-collection-status/index.js.map +0 -1
  355. package/dist/server/features/get-collection-status/model.d.ts.map +0 -1
  356. package/dist/server/features/get-collection-status/model.js.map +0 -1
  357. package/dist/server/features/get-collection-status/route.d.ts.map +0 -1
  358. package/dist/server/features/get-collection-status/route.js.map +0 -1
  359. package/dist/server/features/get-document-status/handler.d.ts.map +0 -1
  360. package/dist/server/features/get-document-status/handler.js.map +0 -1
  361. package/dist/server/features/get-document-status/handler.test.d.ts +0 -2
  362. package/dist/server/features/get-document-status/handler.test.d.ts.map +0 -1
  363. package/dist/server/features/get-document-status/handler.test.js +0 -138
  364. package/dist/server/features/get-document-status/index.d.ts.map +0 -1
  365. package/dist/server/features/get-document-status/index.js.map +0 -1
  366. package/dist/server/features/get-document-status/model.d.ts.map +0 -1
  367. package/dist/server/features/get-document-status/model.js.map +0 -1
  368. package/dist/server/features/get-document-status/route.d.ts.map +0 -1
  369. package/dist/server/features/get-document-status/route.js.map +0 -1
  370. package/dist/server/features/index.d.ts.map +0 -1
  371. package/dist/server/features/index.js.map +0 -1
  372. package/dist/server/features/run-translation/handler.d.ts.map +0 -1
  373. package/dist/server/features/run-translation/handler.js.map +0 -1
  374. package/dist/server/features/run-translation/handler.test.d.ts +0 -2
  375. package/dist/server/features/run-translation/handler.test.d.ts.map +0 -1
  376. package/dist/server/features/run-translation/handler.test.js +0 -98
  377. package/dist/server/features/run-translation/index.d.ts.map +0 -1
  378. package/dist/server/features/run-translation/index.js.map +0 -1
  379. package/dist/server/features/run-translation/model.d.ts.map +0 -1
  380. package/dist/server/features/run-translation/model.js.map +0 -1
  381. package/dist/server/features/run-translation/route.d.ts.map +0 -1
  382. package/dist/server/features/run-translation/route.js.map +0 -1
  383. package/dist/server/features/translate-document/handler.d.ts.map +0 -1
  384. package/dist/server/features/translate-document/handler.js.map +0 -1
  385. package/dist/server/features/translate-document/handler.test.d.ts +0 -2
  386. package/dist/server/features/translate-document/handler.test.d.ts.map +0 -1
  387. package/dist/server/features/translate-document/handler.test.js +0 -171
  388. package/dist/server/features/translate-document/index.d.ts.map +0 -1
  389. package/dist/server/features/translate-document/index.js.map +0 -1
  390. package/dist/server/features/translate-document/model.d.ts.map +0 -1
  391. package/dist/server/features/translate-document/model.js.map +0 -1
  392. package/dist/server/features/translate-document/task.d.ts.map +0 -1
  393. package/dist/server/features/translate-document/task.js.map +0 -1
  394. package/dist/server/index.d.ts.map +0 -1
  395. package/dist/server/index.js.map +0 -1
  396. package/dist/server/modules/index.d.ts.map +0 -1
  397. package/dist/server/modules/index.js.map +0 -1
  398. package/dist/server/modules/task-runner/TaskRunner.interface.d.ts.map +0 -1
  399. package/dist/server/modules/task-runner/TaskRunner.interface.js.map +0 -1
  400. package/dist/server/modules/task-runner/TaskRunnerProvider.interface.d.ts.map +0 -1
  401. package/dist/server/modules/task-runner/TaskRunnerProvider.interface.js.map +0 -1
  402. package/dist/server/modules/task-runner/index.d.ts.map +0 -1
  403. package/dist/server/modules/task-runner/index.js.map +0 -1
  404. package/dist/server/modules/task-runner/payload-jobs-runner/PayloadJobsRunnerProvider.d.ts.map +0 -1
  405. package/dist/server/modules/task-runner/payload-jobs-runner/PayloadJobsRunnerProvider.js.map +0 -1
  406. package/dist/server/modules/task-runner/payload-jobs-runner/PayloadJobsTaskRunner.d.ts.map +0 -1
  407. package/dist/server/modules/task-runner/payload-jobs-runner/PayloadJobsTaskRunner.js.map +0 -1
  408. package/dist/server/modules/task-runner/payload-jobs-runner/PayloadJobsTaskRunner.test.d.ts +0 -2
  409. package/dist/server/modules/task-runner/payload-jobs-runner/PayloadJobsTaskRunner.test.d.ts.map +0 -1
  410. package/dist/server/modules/task-runner/payload-jobs-runner/PayloadJobsTaskRunner.test.js +0 -188
  411. package/dist/server/modules/task-runner/payload-jobs-runner/index.d.ts.map +0 -1
  412. package/dist/server/modules/task-runner/payload-jobs-runner/index.js.map +0 -1
  413. package/dist/server/modules/task-runner/payload-jobs-runner/normalizeJob.d.ts.map +0 -1
  414. package/dist/server/modules/task-runner/payload-jobs-runner/normalizeJob.js.map +0 -1
  415. package/dist/server/modules/task-runner/payload-jobs-runner/normalizeJob.test.d.ts +0 -2
  416. package/dist/server/modules/task-runner/payload-jobs-runner/normalizeJob.test.d.ts.map +0 -1
  417. package/dist/server/modules/task-runner/payload-jobs-runner/normalizeJob.test.js +0 -169
  418. package/dist/server/modules/task-runner/payload-jobs-runner/types.d.ts.map +0 -1
  419. package/dist/server/modules/task-runner/payload-jobs-runner/types.js.map +0 -1
  420. package/dist/server/modules/task-runner/sync-runner/SyncRunnerProvider.d.ts.map +0 -1
  421. package/dist/server/modules/task-runner/sync-runner/SyncRunnerProvider.js.map +0 -1
  422. package/dist/server/modules/task-runner/sync-runner/SyncTaskRunner.d.ts.map +0 -1
  423. package/dist/server/modules/task-runner/sync-runner/SyncTaskRunner.js.map +0 -1
  424. package/dist/server/modules/task-runner/sync-runner/SyncTaskRunner.test.d.ts +0 -2
  425. package/dist/server/modules/task-runner/sync-runner/SyncTaskRunner.test.d.ts.map +0 -1
  426. package/dist/server/modules/task-runner/sync-runner/SyncTaskRunner.test.js +0 -148
  427. package/dist/server/modules/task-runner/sync-runner/index.d.ts.map +0 -1
  428. package/dist/server/modules/task-runner/sync-runner/index.js.map +0 -1
  429. package/dist/server/modules/task-runner/sync-runner/types.d.ts.map +0 -1
  430. package/dist/server/modules/task-runner/sync-runner/types.js.map +0 -1
  431. package/dist/server/modules/task-runner/types.d.ts.map +0 -1
  432. package/dist/server/modules/task-runner/types.js.map +0 -1
  433. package/dist/server/modules/translation-pipeline/TranslationPipeline.d.ts.map +0 -1
  434. package/dist/server/modules/translation-pipeline/TranslationPipeline.js.map +0 -1
  435. package/dist/server/modules/translation-pipeline/TranslationPipeline.test.d.ts +0 -2
  436. package/dist/server/modules/translation-pipeline/TranslationPipeline.test.d.ts.map +0 -1
  437. package/dist/server/modules/translation-pipeline/TranslationPipeline.test.js +0 -552
  438. package/dist/server/modules/translation-pipeline/index.d.ts.map +0 -1
  439. package/dist/server/modules/translation-pipeline/index.js.map +0 -1
  440. package/dist/server/modules/translation-pipeline/stages/data-reconciler/DataReconciler.d.ts.map +0 -1
  441. package/dist/server/modules/translation-pipeline/stages/data-reconciler/DataReconciler.js.map +0 -1
  442. package/dist/server/modules/translation-pipeline/stages/data-reconciler/DataReconciler.stage.d.ts.map +0 -1
  443. package/dist/server/modules/translation-pipeline/stages/data-reconciler/DataReconciler.stage.js.map +0 -1
  444. package/dist/server/modules/translation-pipeline/stages/data-reconciler/DataReconciler.test.d.ts +0 -2
  445. package/dist/server/modules/translation-pipeline/stages/data-reconciler/DataReconciler.test.d.ts.map +0 -1
  446. package/dist/server/modules/translation-pipeline/stages/data-reconciler/DataReconciler.test.js +0 -294
  447. package/dist/server/modules/translation-pipeline/stages/data-reconciler/index.d.ts.map +0 -1
  448. package/dist/server/modules/translation-pipeline/stages/data-reconciler/index.js.map +0 -1
  449. package/dist/server/modules/translation-pipeline/stages/field-collector/FieldChunkCollector.d.ts.map +0 -1
  450. package/dist/server/modules/translation-pipeline/stages/field-collector/FieldChunkCollector.js.map +0 -1
  451. package/dist/server/modules/translation-pipeline/stages/field-collector/FieldChunkCollector.stage.d.ts.map +0 -1
  452. package/dist/server/modules/translation-pipeline/stages/field-collector/FieldChunkCollector.stage.js.map +0 -1
  453. package/dist/server/modules/translation-pipeline/stages/field-collector/FieldChunkCollector.test.d.ts +0 -2
  454. package/dist/server/modules/translation-pipeline/stages/field-collector/FieldChunkCollector.test.d.ts.map +0 -1
  455. package/dist/server/modules/translation-pipeline/stages/field-collector/FieldChunkCollector.test.js +0 -737
  456. package/dist/server/modules/translation-pipeline/stages/field-collector/index.d.ts.map +0 -1
  457. package/dist/server/modules/translation-pipeline/stages/field-collector/index.js.map +0 -1
  458. package/dist/server/modules/translation-pipeline/stages/index.d.ts.map +0 -1
  459. package/dist/server/modules/translation-pipeline/stages/index.js.map +0 -1
  460. package/dist/server/modules/translation-pipeline/stages/text-expander/PlainTextExpander.d.ts.map +0 -1
  461. package/dist/server/modules/translation-pipeline/stages/text-expander/PlainTextExpander.js.map +0 -1
  462. package/dist/server/modules/translation-pipeline/stages/text-expander/RichTextExpander.d.ts.map +0 -1
  463. package/dist/server/modules/translation-pipeline/stages/text-expander/RichTextExpander.js.map +0 -1
  464. package/dist/server/modules/translation-pipeline/stages/text-expander/TextChunkExpander.d.ts.map +0 -1
  465. package/dist/server/modules/translation-pipeline/stages/text-expander/TextChunkExpander.js.map +0 -1
  466. package/dist/server/modules/translation-pipeline/stages/text-expander/TextChunkExpander.stage.d.ts.map +0 -1
  467. package/dist/server/modules/translation-pipeline/stages/text-expander/TextChunkExpander.stage.js.map +0 -1
  468. package/dist/server/modules/translation-pipeline/stages/text-expander/TextChunkExpander.test.d.ts +0 -2
  469. package/dist/server/modules/translation-pipeline/stages/text-expander/TextChunkExpander.test.d.ts.map +0 -1
  470. package/dist/server/modules/translation-pipeline/stages/text-expander/TextChunkExpander.test.js +0 -396
  471. package/dist/server/modules/translation-pipeline/stages/text-expander/TextExpander.interface.d.ts.map +0 -1
  472. package/dist/server/modules/translation-pipeline/stages/text-expander/TextExpander.interface.js.map +0 -1
  473. package/dist/server/modules/translation-pipeline/stages/text-expander/index.d.ts.map +0 -1
  474. package/dist/server/modules/translation-pipeline/stages/text-expander/index.js.map +0 -1
  475. package/dist/server/modules/translation-pipeline/stages/translation/Translation.stage.d.ts.map +0 -1
  476. package/dist/server/modules/translation-pipeline/stages/translation/Translation.stage.js.map +0 -1
  477. package/dist/server/modules/translation-pipeline/stages/translation/index.d.ts.map +0 -1
  478. package/dist/server/modules/translation-pipeline/stages/translation/index.js.map +0 -1
  479. package/dist/server/modules/translation-pipeline/stages/translation-applicator/TranslationMutator.d.ts.map +0 -1
  480. package/dist/server/modules/translation-pipeline/stages/translation-applicator/TranslationMutator.js.map +0 -1
  481. package/dist/server/modules/translation-pipeline/stages/translation-applicator/TranslationMutator.stage.d.ts.map +0 -1
  482. package/dist/server/modules/translation-pipeline/stages/translation-applicator/TranslationMutator.stage.js.map +0 -1
  483. package/dist/server/modules/translation-pipeline/stages/translation-applicator/TranslationMutator.test.d.ts +0 -2
  484. package/dist/server/modules/translation-pipeline/stages/translation-applicator/TranslationMutator.test.d.ts.map +0 -1
  485. package/dist/server/modules/translation-pipeline/stages/translation-applicator/TranslationMutator.test.js +0 -110
  486. package/dist/server/modules/translation-pipeline/stages/translation-applicator/index.d.ts.map +0 -1
  487. package/dist/server/modules/translation-pipeline/stages/translation-applicator/index.js.map +0 -1
  488. package/dist/server/modules/translation-pipeline/strategies/Overwrite.strategy.d.ts.map +0 -1
  489. package/dist/server/modules/translation-pipeline/strategies/Overwrite.strategy.js.map +0 -1
  490. package/dist/server/modules/translation-pipeline/strategies/Overwrite.strategy.test.d.ts +0 -2
  491. package/dist/server/modules/translation-pipeline/strategies/Overwrite.strategy.test.d.ts.map +0 -1
  492. package/dist/server/modules/translation-pipeline/strategies/Overwrite.strategy.test.js +0 -36
  493. package/dist/server/modules/translation-pipeline/strategies/SkipExisting.strategy.d.ts.map +0 -1
  494. package/dist/server/modules/translation-pipeline/strategies/SkipExisting.strategy.js.map +0 -1
  495. package/dist/server/modules/translation-pipeline/strategies/SkipExisting.strategy.test.d.ts +0 -2
  496. package/dist/server/modules/translation-pipeline/strategies/SkipExisting.strategy.test.d.ts.map +0 -1
  497. package/dist/server/modules/translation-pipeline/strategies/SkipExisting.strategy.test.js +0 -77
  498. package/dist/server/modules/translation-pipeline/strategies/TranslationStrategy.interface.d.ts.map +0 -1
  499. package/dist/server/modules/translation-pipeline/strategies/TranslationStrategy.interface.js.map +0 -1
  500. package/dist/server/modules/translation-pipeline/strategies/index.d.ts.map +0 -1
  501. package/dist/server/modules/translation-pipeline/strategies/index.js.map +0 -1
  502. package/dist/server/modules/translation-pipeline/types/FieldChunk.d.ts.map +0 -1
  503. package/dist/server/modules/translation-pipeline/types/FieldChunk.js.map +0 -1
  504. package/dist/server/modules/translation-pipeline/types/Pipeline.d.ts.map +0 -1
  505. package/dist/server/modules/translation-pipeline/types/Pipeline.js.map +0 -1
  506. package/dist/server/modules/translation-pipeline/types/PipelineContext.d.ts.map +0 -1
  507. package/dist/server/modules/translation-pipeline/types/PipelineContext.js.map +0 -1
  508. package/dist/server/modules/translation-pipeline/types/TextChunk.d.ts.map +0 -1
  509. package/dist/server/modules/translation-pipeline/types/TextChunk.js.map +0 -1
  510. package/dist/server/modules/translation-pipeline/types/index.d.ts.map +0 -1
  511. package/dist/server/modules/translation-pipeline/types/index.js.map +0 -1
  512. package/dist/server/modules/translation-providers/OpenAITranslation.provider.d.ts.map +0 -1
  513. package/dist/server/modules/translation-providers/OpenAITranslation.provider.js.map +0 -1
  514. package/dist/server/modules/translation-providers/OpenAITranslation.provider.test.d.ts +0 -2
  515. package/dist/server/modules/translation-providers/OpenAITranslation.provider.test.d.ts.map +0 -1
  516. package/dist/server/modules/translation-providers/OpenAITranslation.provider.test.js +0 -214
  517. package/dist/server/modules/translation-providers/TranslationProvider.interface.d.ts.map +0 -1
  518. package/dist/server/modules/translation-providers/TranslationProvider.interface.js.map +0 -1
  519. package/dist/server/modules/translation-providers/index.d.ts.map +0 -1
  520. package/dist/server/modules/translation-providers/index.js.map +0 -1
  521. package/dist/server/shared/access/AnyAccessGuard.d.ts.map +0 -1
  522. package/dist/server/shared/access/AnyAccessGuard.js.map +0 -1
  523. package/dist/server/shared/access/handler.d.ts.map +0 -1
  524. package/dist/server/shared/access/handler.js.map +0 -1
  525. package/dist/server/shared/access/index.d.ts.map +0 -1
  526. package/dist/server/shared/access/index.js.map +0 -1
  527. package/dist/server/shared/access/types.d.ts.map +0 -1
  528. package/dist/server/shared/access/types.js.map +0 -1
  529. package/dist/server/shared/field-config/getFieldConfig.d.ts.map +0 -1
  530. package/dist/server/shared/field-config/getFieldConfig.js.map +0 -1
  531. package/dist/server/shared/field-config/getFieldConfig.test.d.ts +0 -2
  532. package/dist/server/shared/field-config/getFieldConfig.test.d.ts.map +0 -1
  533. package/dist/server/shared/field-config/getFieldConfig.test.js +0 -74
  534. package/dist/server/shared/field-config/index.d.ts.map +0 -1
  535. package/dist/server/shared/field-config/index.js.map +0 -1
  536. package/dist/server/shared/field-config/types.d.ts.map +0 -1
  537. package/dist/server/shared/field-config/types.js.map +0 -1
  538. package/dist/server/shared/guards/collection-guards.d.ts.map +0 -1
  539. package/dist/server/shared/guards/collection-guards.js.map +0 -1
  540. package/dist/server/shared/guards/field-guards.d.ts.map +0 -1
  541. package/dist/server/shared/guards/field-guards.js.map +0 -1
  542. package/dist/server/shared/guards/field-guards.test.d.ts +0 -2
  543. package/dist/server/shared/guards/field-guards.test.d.ts.map +0 -1
  544. package/dist/server/shared/guards/field-guards.test.js +0 -166
  545. package/dist/server/shared/guards/index.d.ts.map +0 -1
  546. package/dist/server/shared/guards/index.js.map +0 -1
  547. package/dist/server/shared/http/ServerResponse.d.ts.map +0 -1
  548. package/dist/server/shared/http/ServerResponse.js.map +0 -1
  549. package/dist/server/shared/http/ServerResponse.test.d.ts +0 -2
  550. package/dist/server/shared/http/ServerResponse.test.d.ts.map +0 -1
  551. package/dist/server/shared/http/ServerResponse.test.js +0 -161
  552. package/dist/server/shared/http/index.d.ts.map +0 -1
  553. package/dist/server/shared/http/index.js.map +0 -1
  554. package/dist/server/shared/http/withAccessCheck.d.ts.map +0 -1
  555. package/dist/server/shared/http/withAccessCheck.js.map +0 -1
  556. package/dist/server/shared/http/withAccessCheck.test.d.ts +0 -2
  557. package/dist/server/shared/http/withAccessCheck.test.d.ts.map +0 -1
  558. package/dist/server/shared/http/withAccessCheck.test.js +0 -46
  559. package/dist/server/shared/http/withErrorHandler.d.ts.map +0 -1
  560. package/dist/server/shared/http/withErrorHandler.js.map +0 -1
  561. package/dist/server/shared/http/withErrorHandler.test.d.ts +0 -2
  562. package/dist/server/shared/http/withErrorHandler.test.d.ts.map +0 -1
  563. package/dist/server/shared/http/withErrorHandler.test.js +0 -69
  564. package/dist/server/shared/index.d.ts.map +0 -1
  565. package/dist/server/shared/index.js.map +0 -1
  566. package/dist/server/shared/lexical/collectTextNodes.d.ts.map +0 -1
  567. package/dist/server/shared/lexical/collectTextNodes.js.map +0 -1
  568. package/dist/server/shared/lexical/collectTextNodes.test.d.ts +0 -2
  569. package/dist/server/shared/lexical/collectTextNodes.test.d.ts.map +0 -1
  570. package/dist/server/shared/lexical/collectTextNodes.test.js +0 -120
  571. package/dist/server/shared/lexical/guards.d.ts.map +0 -1
  572. package/dist/server/shared/lexical/guards.js.map +0 -1
  573. package/dist/server/shared/lexical/guards.test.d.ts +0 -2
  574. package/dist/server/shared/lexical/guards.test.d.ts.map +0 -1
  575. package/dist/server/shared/lexical/guards.test.js +0 -160
  576. package/dist/server/shared/lexical/index.d.ts.map +0 -1
  577. package/dist/server/shared/lexical/index.js.map +0 -1
  578. package/dist/server/shared/lexical/isEmptyRichText.d.ts.map +0 -1
  579. package/dist/server/shared/lexical/isEmptyRichText.js.map +0 -1
  580. package/dist/server/shared/lexical/isEmptyRichText.test.d.ts +0 -2
  581. package/dist/server/shared/lexical/isEmptyRichText.test.d.ts.map +0 -1
  582. package/dist/server/shared/lexical/isEmptyRichText.test.js +0 -251
  583. package/dist/server/shared/lexical/traverseLexicalTree.d.ts.map +0 -1
  584. package/dist/server/shared/lexical/traverseLexicalTree.js.map +0 -1
  585. package/dist/server/shared/lexical/traverseLexicalTree.test.d.ts +0 -2
  586. package/dist/server/shared/lexical/traverseLexicalTree.test.d.ts.map +0 -1
  587. package/dist/server/shared/lexical/traverseLexicalTree.test.js +0 -112
  588. package/dist/server/shared/lexical/types.d.ts.map +0 -1
  589. package/dist/server/shared/lexical/types.js.map +0 -1
  590. package/dist/server/shared/utils/LazyMap.d.ts.map +0 -1
  591. package/dist/server/shared/utils/LazyMap.js.map +0 -1
  592. package/dist/server/shared/utils/LazyMap.test.d.ts +0 -2
  593. package/dist/server/shared/utils/LazyMap.test.d.ts.map +0 -1
  594. package/dist/server/shared/utils/LazyMap.test.js +0 -262
  595. package/dist/server/shared/utils/filterLocalizedFields.d.ts.map +0 -1
  596. package/dist/server/shared/utils/filterLocalizedFields.js.map +0 -1
  597. package/dist/server/shared/utils/filterLocalizedFields.test.d.ts +0 -2
  598. package/dist/server/shared/utils/filterLocalizedFields.test.d.ts.map +0 -1
  599. package/dist/server/shared/utils/filterLocalizedFields.test.js +0 -338
  600. package/dist/server/shared/utils/getByPath.d.ts.map +0 -1
  601. package/dist/server/shared/utils/getByPath.js.map +0 -1
  602. package/dist/server/shared/utils/getByPath.test.d.ts +0 -2
  603. package/dist/server/shared/utils/getByPath.test.d.ts.map +0 -1
  604. package/dist/server/shared/utils/getByPath.test.js +0 -33
  605. package/dist/server/shared/utils/index.d.ts.map +0 -1
  606. package/dist/server/shared/utils/index.js.map +0 -1
  607. package/dist/server/shared/utils/isEmpty.d.ts.map +0 -1
  608. package/dist/server/shared/utils/isEmpty.js.map +0 -1
  609. package/dist/server/shared/utils/isEmpty.test.d.ts +0 -2
  610. package/dist/server/shared/utils/isEmpty.test.d.ts.map +0 -1
  611. package/dist/server/shared/utils/isEmpty.test.js +0 -60
  612. package/dist/server/shared/utils/isObject.d.ts.map +0 -1
  613. package/dist/server/shared/utils/isObject.js.map +0 -1
  614. package/dist/server/shared/utils/isObject.test.d.ts +0 -2
  615. package/dist/server/shared/utils/isObject.test.d.ts.map +0 -1
  616. package/dist/server/shared/utils/isObject.test.js +0 -57
  617. package/dist/server/shared/utils/normalizePath.d.ts.map +0 -1
  618. package/dist/server/shared/utils/normalizePath.js.map +0 -1
  619. package/dist/server/shared/utils/normalizePath.test.d.ts +0 -2
  620. package/dist/server/shared/utils/normalizePath.test.d.ts.map +0 -1
  621. package/dist/server/shared/utils/normalizePath.test.js +0 -33
  622. package/dist/server/shared/utils/pipe.d.ts.map +0 -1
  623. package/dist/server/shared/utils/pipe.js.map +0 -1
  624. package/dist/server/shared/utils/pipe.test.d.ts +0 -2
  625. package/dist/server/shared/utils/pipe.test.d.ts.map +0 -1
  626. package/dist/server/shared/utils/pipe.test.js +0 -55
  627. package/dist/server/shared/utils/setByPath.d.ts.map +0 -1
  628. package/dist/server/shared/utils/setByPath.js.map +0 -1
  629. package/dist/server/shared/utils/setByPath.test.d.ts +0 -2
  630. package/dist/server/shared/utils/setByPath.test.d.ts.map +0 -1
  631. package/dist/server/shared/utils/setByPath.test.js +0 -46
  632. package/dist/types/AccessGuard.d.ts.map +0 -1
  633. package/dist/types/AccessGuard.js.map +0 -1
  634. package/dist/types/index.d.ts.map +0 -1
  635. package/dist/types/index.js.map +0 -1
  636. package/dist/vitest-env.d.js.map +0 -1
@@ -1,110 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
- import { TranslationMutator } from './TranslationMutator';
3
- // Helper to create a mock SerializedTextNode with required properties
4
- const createTextNode = (text) => ({
5
- type: 'text',
6
- text,
7
- version: 1,
8
- detail: 0,
9
- format: 0,
10
- mode: 'normal',
11
- style: '',
12
- });
13
- describe('TranslationMutator', () => {
14
- const mutator = new TranslationMutator();
15
- describe('apply with PlainTextChunks', () => {
16
- it('mutates dataRef with translation', () => {
17
- const data = { title: 'Hello' };
18
- const chunks = [{ type: 'plain', index: 0, text: 'Hello', dataRef: data, key: 'title' }];
19
- const translations = { 0: 'Привет' };
20
- mutator.apply(chunks, translations);
21
- expect(data.title).toBe('Привет');
22
- });
23
- it('mutates multiple plain text chunks', () => {
24
- const data1 = { title: 'Hello' };
25
- const data2 = { description: 'World' };
26
- const chunks = [
27
- { type: 'plain', index: 0, text: 'Hello', dataRef: data1, key: 'title' },
28
- { type: 'plain', index: 1, text: 'World', dataRef: data2, key: 'description' },
29
- ];
30
- const translations = { 0: 'Привет', 1: 'Мир' };
31
- mutator.apply(chunks, translations);
32
- expect(data1.title).toBe('Привет');
33
- expect(data2.description).toBe('Мир');
34
- });
35
- it('skips chunks without translation', () => {
36
- const data = { title: 'Hello' };
37
- const chunks = [{ type: 'plain', index: 0, text: 'Hello', dataRef: data, key: 'title' }];
38
- const translations = {}; // No translation for index 0
39
- mutator.apply(chunks, translations);
40
- expect(data.title).toBe('Hello'); // Unchanged
41
- });
42
- });
43
- describe('apply with RichTextChunks', () => {
44
- it('mutates nodeRef.text with translation', () => {
45
- const textNode = createTextNode('Hello');
46
- const chunks = [{ type: 'richText', index: 0, text: 'Hello', nodeRef: textNode }];
47
- const translations = { 0: 'Привет' };
48
- mutator.apply(chunks, translations);
49
- expect(textNode.text).toBe('Привет');
50
- });
51
- it('mutates multiple text nodes in richText', () => {
52
- const node1 = createTextNode('Hello');
53
- const node2 = createTextNode('World');
54
- const chunks = [
55
- { type: 'richText', index: 0, text: 'Hello', nodeRef: node1 },
56
- { type: 'richText', index: 1, text: 'World', nodeRef: node2 },
57
- ];
58
- const translations = { 0: 'Привет', 1: 'Мир' };
59
- mutator.apply(chunks, translations);
60
- expect(node1.text).toBe('Привет');
61
- expect(node2.text).toBe('Мир');
62
- });
63
- });
64
- describe('apply with mixed chunks', () => {
65
- it('handles both plain and richText chunks', () => {
66
- const plainData = { title: 'Hello' };
67
- const richTextNode = createTextNode('World');
68
- const chunks = [
69
- { type: 'plain', index: 0, text: 'Hello', dataRef: plainData, key: 'title' },
70
- { type: 'richText', index: 1, text: 'World', nodeRef: richTextNode },
71
- ];
72
- const translations = { 0: 'Привет', 1: 'Мир' };
73
- mutator.apply(chunks, translations);
74
- expect(plainData.title).toBe('Привет');
75
- expect(richTextNode.text).toBe('Мир');
76
- });
77
- it('applies partial translations', () => {
78
- const data1 = { title: 'Hello' };
79
- const data2 = { subtitle: 'World' };
80
- const chunks = [
81
- { type: 'plain', index: 0, text: 'Hello', dataRef: data1, key: 'title' },
82
- { type: 'plain', index: 1, text: 'World', dataRef: data2, key: 'subtitle' },
83
- ];
84
- const translations = { 0: 'Привет' }; // Only first chunk translated
85
- mutator.apply(chunks, translations);
86
- expect(data1.title).toBe('Привет');
87
- expect(data2.subtitle).toBe('World'); // Unchanged
88
- });
89
- });
90
- describe('edge cases', () => {
91
- it('handles empty chunks array', () => {
92
- const translations = { 0: 'Привет' };
93
- // Should not throw
94
- expect(() => mutator.apply([], translations)).not.toThrow();
95
- });
96
- it('handles empty translations', () => {
97
- const data = { title: 'Hello' };
98
- const chunks = [{ type: 'plain', index: 0, text: 'Hello', dataRef: data, key: 'title' }];
99
- mutator.apply(chunks, {});
100
- expect(data.title).toBe('Hello');
101
- });
102
- it('preserves other properties in dataRef', () => {
103
- const data = { title: 'Hello', slug: 'hello', count: 42 };
104
- const chunks = [{ type: 'plain', index: 0, text: 'Hello', dataRef: data, key: 'title' }];
105
- const translations = { 0: 'Привет' };
106
- mutator.apply(chunks, translations);
107
- expect(data).toEqual({ title: 'Привет', slug: 'hello', count: 42 });
108
- });
109
- });
110
- });
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/server/modules/translation-pipeline/stages/translation-applicator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../src/server/modules/translation-pipeline/stages/translation-applicator/index.ts"],"sourcesContent":["export { TranslationMutator } from './TranslationMutator'\nexport { TranslationMutatorStage } from './TranslationMutator.stage'\n"],"names":["TranslationMutator","TranslationMutatorStage"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,uBAAsB;AACzD,SAASC,uBAAuB,QAAQ,6BAA4B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Overwrite.strategy.d.ts","sourceRoot":"","sources":["../../../../../src/server/modules/translation-pipeline/strategies/Overwrite.strategy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAE3F;;;GAGG;AACH,qBAAa,iBAAkB,YAAW,mBAAmB;IAC3D,eAAe,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO;CAG/C"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/server/modules/translation-pipeline/strategies/Overwrite.strategy.ts"],"sourcesContent":["import { isEmpty } from '../../../shared'\nimport type { TranslationStrategy, StrategyContext } from './TranslationStrategy.interface'\n\n/**\n * Translates all fields, overwriting existing translations.\n * This is the default strategy.\n */\nexport class OverwriteStrategy implements TranslationStrategy {\n shouldTranslate(ctx: StrategyContext): boolean {\n return !isEmpty(ctx.sourceValue)\n }\n}\n"],"names":["isEmpty","OverwriteStrategy","shouldTranslate","ctx","sourceValue"],"mappings":"AAAA,SAASA,OAAO,QAAQ,kBAAiB;AAGzC;;;CAGC,GACD,OAAO,MAAMC;IACXC,gBAAgBC,GAAoB,EAAW;QAC7C,OAAO,CAACH,QAAQG,IAAIC,WAAW;IACjC;AACF"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=Overwrite.strategy.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Overwrite.strategy.test.d.ts","sourceRoot":"","sources":["../../../../../src/server/modules/translation-pipeline/strategies/Overwrite.strategy.test.ts"],"names":[],"mappings":""}
@@ -1,36 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
- import { OverwriteStrategy } from './Overwrite.strategy';
3
- describe('OverwriteStrategy', () => {
4
- const strategy = new OverwriteStrategy();
5
- describe('shouldTranslate', () => {
6
- it('returns true when sourceValue is non-empty string', () => {
7
- expect(strategy.shouldTranslate({ sourceValue: 'hello', targetValue: undefined })).toBe(true);
8
- expect(strategy.shouldTranslate({ sourceValue: 'hello', targetValue: 'existing' })).toBe(true);
9
- });
10
- it('returns true when sourceValue is non-empty object', () => {
11
- expect(strategy.shouldTranslate({ sourceValue: { key: 'value' }, targetValue: undefined })).toBe(true);
12
- });
13
- it('returns true when sourceValue is non-empty array', () => {
14
- expect(strategy.shouldTranslate({ sourceValue: [1, 2, 3], targetValue: undefined })).toBe(true);
15
- });
16
- it('returns false when sourceValue is empty string', () => {
17
- expect(strategy.shouldTranslate({ sourceValue: '', targetValue: undefined })).toBe(false);
18
- expect(strategy.shouldTranslate({ sourceValue: ' ', targetValue: 'existing' })).toBe(false);
19
- });
20
- it('returns false when sourceValue is null or undefined', () => {
21
- expect(strategy.shouldTranslate({ sourceValue: null, targetValue: undefined })).toBe(false);
22
- expect(strategy.shouldTranslate({ sourceValue: undefined, targetValue: 'existing' })).toBe(false);
23
- });
24
- it('returns false when sourceValue is empty object', () => {
25
- expect(strategy.shouldTranslate({ sourceValue: {}, targetValue: undefined })).toBe(false);
26
- });
27
- it('returns false when sourceValue is empty array', () => {
28
- expect(strategy.shouldTranslate({ sourceValue: [], targetValue: undefined })).toBe(false);
29
- });
30
- it('ignores targetValue completely', () => {
31
- // OverwriteStrategy only cares about sourceValue
32
- expect(strategy.shouldTranslate({ sourceValue: 'hello', targetValue: 'already translated' })).toBe(true);
33
- expect(strategy.shouldTranslate({ sourceValue: 'hello', targetValue: null })).toBe(true);
34
- });
35
- });
36
- });
@@ -1 +0,0 @@
1
- {"version":3,"file":"SkipExisting.strategy.d.ts","sourceRoot":"","sources":["../../../../../src/server/modules/translation-pipeline/strategies/SkipExisting.strategy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAE3F;;;GAGG;AACH,qBAAa,oBAAqB,YAAW,mBAAmB;IAC9D,eAAe,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO;IAK9C,OAAO,CAAC,YAAY;CASrB"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/server/modules/translation-pipeline/strategies/SkipExisting.strategy.ts"],"sourcesContent":["import { isSerializedLexicalRoot, isEmptyRichText, isEmpty } from '../../../shared'\nimport type { TranslationStrategy, StrategyContext } from './TranslationStrategy.interface'\n\n/**\n * Only translates fields that are empty or missing in the target locale.\n * Existing translations are preserved.\n */\nexport class SkipExistingStrategy implements TranslationStrategy {\n shouldTranslate(ctx: StrategyContext): boolean {\n if (isEmpty(ctx.sourceValue)) return false\n return this.isEmptyValue(ctx.targetValue)\n }\n\n private isEmptyValue(value: unknown): boolean {\n if (isEmpty(value)) return true\n\n if (isSerializedLexicalRoot(value)) {\n return isEmptyRichText(value)\n }\n\n return false\n }\n}\n"],"names":["isSerializedLexicalRoot","isEmptyRichText","isEmpty","SkipExistingStrategy","shouldTranslate","ctx","sourceValue","isEmptyValue","targetValue","value"],"mappings":"AAAA,SAASA,uBAAuB,EAAEC,eAAe,EAAEC,OAAO,QAAQ,kBAAiB;AAGnF;;;CAGC,GACD,OAAO,MAAMC;IACXC,gBAAgBC,GAAoB,EAAW;QAC7C,IAAIH,QAAQG,IAAIC,WAAW,GAAG,OAAO;QACrC,OAAO,IAAI,CAACC,YAAY,CAACF,IAAIG,WAAW;IAC1C;IAEQD,aAAaE,KAAc,EAAW;QAC5C,IAAIP,QAAQO,QAAQ,OAAO;QAE3B,IAAIT,wBAAwBS,QAAQ;YAClC,OAAOR,gBAAgBQ;QACzB;QAEA,OAAO;IACT;AACF"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=SkipExisting.strategy.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SkipExisting.strategy.test.d.ts","sourceRoot":"","sources":["../../../../../src/server/modules/translation-pipeline/strategies/SkipExisting.strategy.test.ts"],"names":[],"mappings":""}
@@ -1,77 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
- import { SkipExistingStrategy } from './SkipExisting.strategy';
3
- describe('SkipExistingStrategy', () => {
4
- const strategy = new SkipExistingStrategy();
5
- describe('shouldTranslate', () => {
6
- describe('when sourceValue is empty', () => {
7
- it('returns false for empty string', () => {
8
- expect(strategy.shouldTranslate({ sourceValue: '', targetValue: undefined })).toBe(false);
9
- });
10
- it('returns false for null', () => {
11
- expect(strategy.shouldTranslate({ sourceValue: null, targetValue: undefined })).toBe(false);
12
- });
13
- it('returns false for undefined', () => {
14
- expect(strategy.shouldTranslate({ sourceValue: undefined, targetValue: undefined })).toBe(false);
15
- });
16
- });
17
- describe('when sourceValue is non-empty and targetValue is empty', () => {
18
- it('returns true when targetValue is undefined', () => {
19
- expect(strategy.shouldTranslate({ sourceValue: 'hello', targetValue: undefined })).toBe(true);
20
- });
21
- it('returns true when targetValue is null', () => {
22
- expect(strategy.shouldTranslate({ sourceValue: 'hello', targetValue: null })).toBe(true);
23
- });
24
- it('returns true when targetValue is empty string', () => {
25
- expect(strategy.shouldTranslate({ sourceValue: 'hello', targetValue: '' })).toBe(true);
26
- });
27
- it('returns true when targetValue is whitespace-only string', () => {
28
- expect(strategy.shouldTranslate({ sourceValue: 'hello', targetValue: ' ' })).toBe(true);
29
- });
30
- });
31
- describe('when sourceValue is non-empty and targetValue exists', () => {
32
- it('returns false when targetValue is non-empty string', () => {
33
- expect(strategy.shouldTranslate({ sourceValue: 'hello', targetValue: 'existing' })).toBe(false);
34
- });
35
- it('returns false when targetValue is non-empty object', () => {
36
- expect(strategy.shouldTranslate({ sourceValue: 'hello', targetValue: { key: 'value' } })).toBe(false);
37
- });
38
- });
39
- describe('richText handling', () => {
40
- const emptyLexicalRoot = {
41
- root: {
42
- type: 'root',
43
- children: [],
44
- direction: null,
45
- format: '',
46
- indent: 0,
47
- version: 1,
48
- },
49
- };
50
- const nonEmptyLexicalRoot = {
51
- root: {
52
- type: 'root',
53
- children: [
54
- {
55
- type: 'paragraph',
56
- children: [{ type: 'text', text: 'Hello world', version: 1 }],
57
- direction: 'ltr',
58
- format: '',
59
- indent: 0,
60
- version: 1,
61
- },
62
- ],
63
- direction: 'ltr',
64
- format: '',
65
- indent: 0,
66
- version: 1,
67
- },
68
- };
69
- it('returns true when targetValue is empty Lexical root', () => {
70
- expect(strategy.shouldTranslate({ sourceValue: 'hello', targetValue: emptyLexicalRoot })).toBe(true);
71
- });
72
- it('returns false when targetValue is non-empty Lexical root', () => {
73
- expect(strategy.shouldTranslate({ sourceValue: 'hello', targetValue: nonEmptyLexicalRoot })).toBe(false);
74
- });
75
- });
76
- });
77
- });
@@ -1 +0,0 @@
1
- {"version":3,"file":"TranslationStrategy.interface.d.ts","sourceRoot":"","sources":["../../../../../src/server/modules/translation-pipeline/strategies/TranslationStrategy.interface.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,WAAW,EAAE,OAAO,CAAA;IACpB,WAAW,EAAE,OAAO,CAAA;CACrB,CAAA;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,eAAe,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAA;CAC/C"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/server/modules/translation-pipeline/strategies/TranslationStrategy.interface.ts"],"sourcesContent":["/**\n * Context passed to translation strategy for decision making.\n */\nexport type StrategyContext = {\n sourceValue: unknown\n targetValue: unknown\n}\n\n/**\n * Strategy interface for determining which fields should be translated.\n * Implement this interface to create custom translation strategies.\n *\n * Works at data level - called for each translatable field during filtering.\n */\nexport interface TranslationStrategy {\n /**\n * Determines if a field value should be translated.\n * @param ctx - context with source and target values\n * @returns true if field should be translated\n */\n shouldTranslate(ctx: StrategyContext): boolean\n}\n"],"names":[],"mappings":"AAAA;;CAEC,GAMD;;;;;CAKC,GACD,WAOC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/server/modules/translation-pipeline/strategies/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAA;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAE9D,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAC3F,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,CAAA;AAElD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,WAAW,GAAG,eAAe,CAAA;AAEnE;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,uBAAuB,GAAG,mBAAmB,CAQ5F"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/server/modules/translation-pipeline/strategies/index.ts"],"sourcesContent":["import type { TranslationStrategy } from './TranslationStrategy.interface'\nimport { OverwriteStrategy } from './Overwrite.strategy'\nimport { SkipExistingStrategy } from './SkipExisting.strategy'\n\nexport type { TranslationStrategy, StrategyContext } from './TranslationStrategy.interface'\nexport { OverwriteStrategy, SkipExistingStrategy }\n\n/**\n * Strategy names for runtime selection.\n */\nexport type TranslationStrategyName = 'overwrite' | 'skip_existing'\n\n/**\n * Creates a TranslationStrategy instance by name.\n */\nexport function createTranslationStrategy(name: TranslationStrategyName): TranslationStrategy {\n switch (name) {\n case 'skip_existing':\n return new SkipExistingStrategy()\n case 'overwrite':\n default:\n return new OverwriteStrategy()\n }\n}\n"],"names":["OverwriteStrategy","SkipExistingStrategy","createTranslationStrategy","name"],"mappings":"AACA,SAASA,iBAAiB,QAAQ,uBAAsB;AACxD,SAASC,oBAAoB,QAAQ,0BAAyB;AAG9D,SAASD,iBAAiB,EAAEC,oBAAoB,GAAE;AAOlD;;CAEC,GACD,OAAO,SAASC,0BAA0BC,IAA6B;IACrE,OAAQA;QACN,KAAK;YACH,OAAO,IAAIF;QACb,KAAK;QACL;YACE,OAAO,IAAID;IACf;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"FieldChunk.d.ts","sourceRoot":"","sources":["../../../../../src/server/modules/translation-pipeline/types/FieldChunk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,wCAAwC;IACxC,MAAM,EAAE,KAAK,CAAA;IACb,yDAAyD;IACzD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,oCAAoC;IACpC,GAAG,EAAE,MAAM,CAAA;IACX,4DAA4D;IAC5D,IAAI,EAAE,MAAM,EAAE,CAAA;CACf,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/server/modules/translation-pipeline/types/FieldChunk.ts"],"sourcesContent":["import type { Field } from 'payload'\n\n/**\n * Represents a field-level chunk containing schema metadata.\n * Used in stages 1-3 where schema awareness is needed.\n *\n * Contains a reference to the parent data object for later mutation.\n */\nexport type FieldChunk = {\n /** The field schema from Payload CMS */\n schema: Field\n /** Reference to the parent data object (for mutation) */\n dataRef: Record<string, unknown>\n /** The key in the dataRef object */\n key: string\n /** Full path from root for strategy lookup in targetData */\n path: string[]\n}\n"],"names":[],"mappings":"AAEA;;;;;CAKC,GACD,WASC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Pipeline.d.ts","sourceRoot":"","sources":["../../../../../src/server/modules/translation-pipeline/types/Pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACnC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACnC,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,6CAA6C;IAC7C,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACxC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/server/modules/translation-pipeline/types/Pipeline.ts"],"sourcesContent":["import type { Field } from 'payload'\n\n/**\n * Pipeline configuration for translation execution.\n * Contains only data transformation inputs — no persistence concerns.\n */\nexport type PipelineConfig = {\n schema: Field[]\n sourceData: Record<string, unknown>\n targetData: Record<string, unknown>\n sourceLng: string\n targetLng: string\n}\n\n/**\n * Result of pipeline execution.\n * Contains translated data ready to be saved.\n */\nexport type PipelineResult = {\n /** Mutated data with translations applied */\n translatedData: Record<string, unknown>\n}\n"],"names":[],"mappings":"AAcA;;;CAGC,GACD,WAGC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PipelineContext.d.ts","sourceRoot":"","sources":["../../../../../src/server/modules/translation-pipeline/types/PipelineContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE5C;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,CAAA;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAE1B,+DAA+D;IAC/D,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACtC,WAAW,CAAC,EAAE,UAAU,EAAE,CAAA;IAC1B,UAAU,CAAC,EAAE,SAAS,EAAE,CAAA;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACtC,CAAA;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,GAAG,EAAE,eAAe,GAAG,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAAA;CAC1E"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/server/modules/translation-pipeline/types/PipelineContext.ts"],"sourcesContent":["import type { Field } from 'payload'\nimport type { FieldChunk } from './FieldChunk'\nimport type { TextChunk } from './TextChunk'\n\n/**\n * Pipeline context passed through all stages.\n * Each stage reads from context and writes its results back.\n */\nexport type PipelineContext = {\n readonly schema: Field[]\n readonly sourceData: Record<string, unknown>\n readonly targetData: Record<string, unknown>\n readonly sourceLng: string\n readonly targetLng: string\n\n /** Full document shape with reconciled source/target values */\n filteredData?: Record<string, unknown>\n fieldChunks?: FieldChunk[]\n textChunks?: TextChunk[]\n textMap?: Record<number, string>\n translations?: Record<number, string>\n}\n\n/**\n * Interface for pipeline stages.\n * Each stage transforms the context and returns updated context.\n */\nexport interface PipelineStage {\n execute(ctx: PipelineContext): PipelineContext | Promise<PipelineContext>\n}\n"],"names":[],"mappings":"AAuBA;;;CAGC,GACD,WAEC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextChunk.d.ts","sourceRoot":"","sources":["../../../../../src/server/modules/translation-pipeline/types/TextChunk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAEjE;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,OAAO,CAAA;IACb,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAA;IACb,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,+BAA+B;IAC/B,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,UAAU,CAAA;IAChB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAA;IACb,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,0DAA0D;IAC1D,OAAO,EAAE,kBAAkB,CAAA;CAC5B,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,cAAc,GAAG,aAAa,CAAA;AAEtD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,GAAG,KAAK,IAAI,cAAc,CAE1E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,GAAG,KAAK,IAAI,aAAa,CAExE"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/server/modules/translation-pipeline/types/TextChunk.ts"],"sourcesContent":["import type { SerializedTextNode } from '../../../shared/lexical'\n\n/**\n * Text chunk for plain text/textarea fields.\n * Mutates dataRef[key] directly.\n */\nexport type PlainTextChunk = {\n type: 'plain'\n /** Unique index for translation mapping */\n index: number\n /** Original text value */\n text: string\n /** Reference to parent data object */\n dataRef: Record<string, unknown>\n /** Key in dataRef to mutate */\n key: string\n}\n\n/**\n * Text chunk for richText Lexical text nodes.\n * Mutates nodeRef.text directly.\n */\nexport type RichTextChunk = {\n type: 'richText'\n /** Unique index for translation mapping */\n index: number\n /** Original text value */\n text: string\n /** Direct reference to SerializedTextNode for mutation */\n nodeRef: SerializedTextNode\n}\n\n/**\n * Union type for all text chunks.\n * Schema-independent - contains only data references for mutation.\n */\nexport type TextChunk = PlainTextChunk | RichTextChunk\n\n/**\n * Type guard for PlainTextChunk.\n */\nexport function isPlainTextChunk(chunk: TextChunk): chunk is PlainTextChunk {\n return chunk.type === 'plain'\n}\n\n/**\n * Type guard for RichTextChunk.\n */\nexport function isRichTextChunk(chunk: TextChunk): chunk is RichTextChunk {\n return chunk.type === 'richText'\n}\n"],"names":["isPlainTextChunk","chunk","type","isRichTextChunk"],"mappings":"AAsCA;;CAEC,GACD,OAAO,SAASA,iBAAiBC,KAAgB;IAC/C,OAAOA,MAAMC,IAAI,KAAK;AACxB;AAEA;;CAEC,GACD,OAAO,SAASC,gBAAgBF,KAAgB;IAC9C,OAAOA,MAAMC,IAAI,KAAK;AACxB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/server/modules/translation-pipeline/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC3E,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC/D,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAChE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/server/modules/translation-pipeline/types/index.ts"],"sourcesContent":["export type { FieldChunk } from './FieldChunk'\nexport type { PlainTextChunk, RichTextChunk, TextChunk } from './TextChunk'\nexport { isPlainTextChunk, isRichTextChunk } from './TextChunk'\nexport type { PipelineConfig, PipelineResult } from './Pipeline'\nexport type { PipelineContext, PipelineStage } from './PipelineContext'\n"],"names":["isPlainTextChunk","isRichTextChunk"],"mappings":"AAEA,SAASA,gBAAgB,EAAEC,eAAe,QAAQ,cAAa"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"OpenAITranslation.provider.d.ts","sourceRoot":"","sources":["../../../../src/server/modules/translation-providers/OpenAITranslation.provider.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAE/G,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAEtD;;;GAGG;AACH,KAAK,iBAAiB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAEnE;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,2CAA2C;IAC3C,SAAS,EAAE,iBAAiB,CAAA;IAC5B,sFAAsF;IACtF,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAA;IAClB,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAA;IAClB,6DAA6D;IAC7D,aAAa,EAAE,MAAM,CAAA;CACtB,CAAA;AAED;;GAEG;AACH,KAAK,mBAAmB,GAAG,CAAC,OAAO,EAAE,mBAAmB,KAAK,MAAM,CAAA;AAEnE,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,CAAA;IACd;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,SAAS,CAAA;IACjC;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,EAAE,mBAAmB,CAAA;IAClC;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,YAAY,CAAA;CAChC,CAAA;AAED,8DAA8D;AAC9D,qBAAa,yBAA0B,YAAW,mBAAmB;IAGvD,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,OAAO,CAAC,YAAY,CAAQ;gBAEC,MAAM,EAAE,oBAAoB;IAInD,SAAS,CAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAyClH;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAYzB;;;;OAIG;IACH,OAAO,CAAC,oBAAoB;IAO5B;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;YAOV,qBAAqB;IAgBnC;;;;;OAKG;YACW,qBAAqB;CAkBpC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,oBAAoB,GAAG,yBAAyB,CAE5F"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/server/modules/translation-providers/OpenAITranslation.provider.ts"],"sourcesContent":["import OpenAI from 'openai'\n\nimport type { TranslationProvider, TranslationInput, TranslationOutput } from './TranslationProvider.interface'\nimport { isObject } from '../../shared'\nimport { ChatModel } from 'openai/resources/index.mjs'\n\n/**\n * Function to transform text in dry run mode.\n * Receives the original text and returns the transformed text.\n */\ntype DryRunTransformer = (text: string) => string | Promise<string>\n\n/**\n * Configuration for dry run mode with custom transformer.\n */\nexport type DryRunConfig = {\n /** Custom transformer function for text */\n transform: DryRunTransformer\n /** Delay in milliseconds before returning mock translation (simulates API latency) */\n timeout?: number\n}\n\n/**\n * Context passed to the system prompt builder function.\n */\nexport type SystemPromptContext = {\n /** Source language code (e.g., 'en', 'de') */\n sourceLang: string\n /** Target language code (e.g., 'fr', 'es') */\n targetLang: string\n /** Default system prompt that can be extended or replaced */\n defaultPrompt: string\n}\n\n/**\n * Function to build a custom system prompt for translation.\n */\ntype SystemPromptBuilder = (context: SystemPromptContext) => string\n\nexport type OpenAIProviderConfig = {\n apiKey: string\n /**\n * OpenAI model to use for translation.\n *\n * @default 'gpt-4o'\n *\n * @example\n * model: 'gpt-4o-mini'\n */\n model?: (string & {}) | ChatModel\n /**\n * Custom system prompt builder for translation.\n * Receives context with source/target languages and the default prompt.\n *\n * @example\n * // Add custom instructions\n * systemPrompt: ({ sourceLang, targetLang, defaultPrompt }) =>\n * `${defaultPrompt}\\nUse formal language. Keep brand names unchanged.`\n *\n * @example\n * // Completely custom prompt\n * systemPrompt: ({ sourceLang, targetLang }) =>\n * `Translate JSON values from ${sourceLang} to ${targetLang}. Be concise.`\n */\n systemPrompt?: SystemPromptBuilder\n /**\n * When enabled, simulates translations without making actual API calls to OpenAI.\n *\n * - `true` — uses default transformer that reverses the text\n * - `{ transform, timeout? }` — custom transformer with optional delay\n *\n * @example\n * // Default behavior (reverse text, no delay)\n * dryRun: true\n *\n * @example\n * // Custom transformer with delay\n * dryRun: {\n * transform: (text) => `[TRANSLATED] ${text}`,\n * timeout: 1000, // 1 second delay\n * }\n *\n * @default false\n */\n dryRun?: boolean | DryRunConfig\n}\n\n/** @deprecated Use `createOpenAIProvider` function instead */\nexport class OpenAITranslationProvider implements TranslationProvider {\n private openAiClient: OpenAI\n\n constructor(private readonly config: OpenAIProviderConfig) {\n this.openAiClient = new OpenAI({ apiKey: config.apiKey })\n }\n\n async translate(content: TranslationInput, souceLng: string, targetLng: string): Promise<TranslationOutput | null> {\n if (this.config.dryRun) {\n console.info('[DRY RUN] Translation simulation:', {\n content,\n sourceLang: souceLng,\n targetLang: targetLng,\n provider: 'OpenAI',\n })\n\n const timeout = this.getDryRunTimeout()\n if (timeout > 0) await new Promise((resolve) => setTimeout(resolve, timeout))\n\n const transformer = this.getDryRunTransformer()\n return this.createMockTranslation(content, transformer)\n }\n\n const systemPrompt = this.buildSystemPrompt(souceLng, targetLng)\n\n const chatCompletion = await this.openAiClient.chat.completions.create({\n messages: [\n { role: 'system', content: systemPrompt },\n { role: 'user', content: JSON.stringify(content) },\n ],\n model: this.config.model ?? 'gpt-4o',\n temperature: 0,\n top_p: 1,\n frequency_penalty: 0,\n presence_penalty: 0,\n response_format: { type: 'json_object' },\n })\n\n const translatedContent = chatCompletion.choices[0].message.content\n if (!translatedContent) return null\n\n try {\n return JSON.parse(translatedContent)\n } catch {\n return null\n }\n }\n\n /**\n * Builds the system prompt for translation.\n */\n private buildSystemPrompt(sourceLang: string, targetLang: string): string {\n const defaultPrompt = `Translate the values from the JSON that the user will send you${sourceLang ? ` from ${sourceLang}` : ''} into ${targetLang}. Keep all JSON keys exactly as they are, only translate the values.\nThe response should be a valid JSON object with the same structure and keys as the input, but with translated values.\nMaintain any special formatting, placeholders, or variables within the values if they exist.`\n\n if (this.config.systemPrompt) {\n return this.config.systemPrompt({ sourceLang, targetLang, defaultPrompt })\n }\n\n return defaultPrompt\n }\n\n /**\n * Returns the transformer function for dry run mode.\n * If dryRun is an object with transform, returns it.\n * If dryRun is true, returns the default transformer that reverses text.\n */\n private getDryRunTransformer(): DryRunTransformer {\n if (typeof this.config.dryRun === 'object' && this.config.dryRun.transform) {\n return this.config.dryRun.transform\n }\n return (text: string) => text.split('').reverse().join('')\n }\n\n /**\n * Returns the timeout for dry run mode.\n * If dryRun is an object with timeout, returns it.\n * Otherwise returns 0 (no delay).\n */\n private getDryRunTimeout(): number {\n if (typeof this.config.dryRun === 'object' && this.config.dryRun.timeout) {\n return this.config.dryRun.timeout\n }\n return 0\n }\n\n private async createMockTranslation(\n content: TranslationInput,\n transformer: DryRunTransformer,\n ): Promise<TranslationOutput | null> {\n try {\n const mockTranslation = await this.transformObjectValues(content, async (value) => {\n if (typeof value === 'string' && value.trim()) return transformer(value)\n return value\n })\n\n return mockTranslation as TranslationOutput\n } catch {\n return null\n }\n }\n\n /**\n * Recursively transforms the values of an object or array using the provided transformer function.\n * @param obj The object or value to transform.\n * @param transformer The function to apply to each value.\n * @returns The transformed object, array, or value.\n */\n private async transformObjectValues(\n obj: unknown,\n transformer: (value: unknown) => unknown | Promise<unknown>,\n ): Promise<unknown> {\n if (Array.isArray(obj)) {\n return Promise.all(obj.map((item) => this.transformObjectValues(item, transformer)))\n }\n\n if (isObject(obj)) {\n const result: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(obj)) {\n result[key] = await this.transformObjectValues(value, transformer)\n }\n return result\n }\n\n return transformer(obj)\n }\n}\n\n/**\n * Creates an OpenAI translation provider.\n *\n * @example\n * ```ts\n * // Basic usage\n * createOpenAIProvider({ apiKey: process.env.OPENAI_API_KEY })\n *\n * // With options\n * createOpenAIProvider({\n * apiKey: process.env.OPENAI_API_KEY,\n * model: 'gpt-4o-mini',\n * systemPrompt: ({ defaultPrompt }) => `${defaultPrompt}\\nUse formal language.`,\n * })\n * ```\n */\nexport function createOpenAIProvider(config: OpenAIProviderConfig): OpenAITranslationProvider {\n return new OpenAITranslationProvider(config)\n}\n"],"names":["OpenAI","isObject","OpenAITranslationProvider","openAiClient","config","apiKey","translate","content","souceLng","targetLng","dryRun","console","info","sourceLang","targetLang","provider","timeout","getDryRunTimeout","Promise","resolve","setTimeout","transformer","getDryRunTransformer","createMockTranslation","systemPrompt","buildSystemPrompt","chatCompletion","chat","completions","create","messages","role","JSON","stringify","model","temperature","top_p","frequency_penalty","presence_penalty","response_format","type","translatedContent","choices","message","parse","defaultPrompt","transform","text","split","reverse","join","mockTranslation","transformObjectValues","value","trim","obj","Array","isArray","all","map","item","result","key","Object","entries","createOpenAIProvider"],"mappings":"AAAA,OAAOA,YAAY,SAAQ;AAG3B,SAASC,QAAQ,QAAQ,eAAc;AAoFvC,4DAA4D,GAC5D,OAAO,MAAMC;;IACHC,aAAoB;IAE5B,YAAY,AAAiBC,MAA4B,CAAE;aAA9BA,SAAAA;QAC3B,IAAI,CAACD,YAAY,GAAG,IAAIH,OAAO;YAAEK,QAAQD,OAAOC,MAAM;QAAC;IACzD;IAEA,MAAMC,UAAUC,OAAyB,EAAEC,QAAgB,EAAEC,SAAiB,EAAqC;QACjH,IAAI,IAAI,CAACL,MAAM,CAACM,MAAM,EAAE;YACtBC,QAAQC,IAAI,CAAC,qCAAqC;gBAChDL;gBACAM,YAAYL;gBACZM,YAAYL;gBACZM,UAAU;YACZ;YAEA,MAAMC,UAAU,IAAI,CAACC,gBAAgB;YACrC,IAAID,UAAU,GAAG,MAAM,IAAIE,QAAQ,CAACC,UAAYC,WAAWD,SAASH;YAEpE,MAAMK,cAAc,IAAI,CAACC,oBAAoB;YAC7C,OAAO,IAAI,CAACC,qBAAqB,CAAChB,SAASc;QAC7C;QAEA,MAAMG,eAAe,IAAI,CAACC,iBAAiB,CAACjB,UAAUC;QAEtD,MAAMiB,iBAAiB,MAAM,IAAI,CAACvB,YAAY,CAACwB,IAAI,CAACC,WAAW,CAACC,MAAM,CAAC;YACrEC,UAAU;gBACR;oBAAEC,MAAM;oBAAUxB,SAASiB;gBAAa;gBACxC;oBAAEO,MAAM;oBAAQxB,SAASyB,KAAKC,SAAS,CAAC1B;gBAAS;aAClD;YACD2B,OAAO,IAAI,CAAC9B,MAAM,CAAC8B,KAAK,IAAI;YAC5BC,aAAa;YACbC,OAAO;YACPC,mBAAmB;YACnBC,kBAAkB;YAClBC,iBAAiB;gBAAEC,MAAM;YAAc;QACzC;QAEA,MAAMC,oBAAoBf,eAAegB,OAAO,CAAC,EAAE,CAACC,OAAO,CAACpC,OAAO;QACnE,IAAI,CAACkC,mBAAmB,OAAO;QAE/B,IAAI;YACF,OAAOT,KAAKY,KAAK,CAACH;QACpB,EAAE,OAAM;YACN,OAAO;QACT;IACF;IAEA;;GAEC,GACD,AAAQhB,kBAAkBZ,UAAkB,EAAEC,UAAkB,EAAU;QACxE,MAAM+B,gBAAgB,CAAC,8DAA8D,EAAEhC,aAAa,CAAC,MAAM,EAAEA,YAAY,GAAG,GAAG,MAAM,EAAEC,WAAW;;4FAE1D,CAAC;QAEzF,IAAI,IAAI,CAACV,MAAM,CAACoB,YAAY,EAAE;YAC5B,OAAO,IAAI,CAACpB,MAAM,CAACoB,YAAY,CAAC;gBAAEX;gBAAYC;gBAAY+B;YAAc;QAC1E;QAEA,OAAOA;IACT;IAEA;;;;GAIC,GACD,AAAQvB,uBAA0C;QAChD,IAAI,OAAO,IAAI,CAAClB,MAAM,CAACM,MAAM,KAAK,YAAY,IAAI,CAACN,MAAM,CAACM,MAAM,CAACoC,SAAS,EAAE;YAC1E,OAAO,IAAI,CAAC1C,MAAM,CAACM,MAAM,CAACoC,SAAS;QACrC;QACA,OAAO,CAACC,OAAiBA,KAAKC,KAAK,CAAC,IAAIC,OAAO,GAAGC,IAAI,CAAC;IACzD;IAEA;;;;GAIC,GACD,AAAQjC,mBAA2B;QACjC,IAAI,OAAO,IAAI,CAACb,MAAM,CAACM,MAAM,KAAK,YAAY,IAAI,CAACN,MAAM,CAACM,MAAM,CAACM,OAAO,EAAE;YACxE,OAAO,IAAI,CAACZ,MAAM,CAACM,MAAM,CAACM,OAAO;QACnC;QACA,OAAO;IACT;IAEA,MAAcO,sBACZhB,OAAyB,EACzBc,WAA8B,EACK;QACnC,IAAI;YACF,MAAM8B,kBAAkB,MAAM,IAAI,CAACC,qBAAqB,CAAC7C,SAAS,OAAO8C;gBACvE,IAAI,OAAOA,UAAU,YAAYA,MAAMC,IAAI,IAAI,OAAOjC,YAAYgC;gBAClE,OAAOA;YACT;YAEA,OAAOF;QACT,EAAE,OAAM;YACN,OAAO;QACT;IACF;IAEA;;;;;GAKC,GACD,MAAcC,sBACZG,GAAY,EACZlC,WAA2D,EACzC;QAClB,IAAImC,MAAMC,OAAO,CAACF,MAAM;YACtB,OAAOrC,QAAQwC,GAAG,CAACH,IAAII,GAAG,CAAC,CAACC,OAAS,IAAI,CAACR,qBAAqB,CAACQ,MAAMvC;QACxE;QAEA,IAAIpB,SAASsD,MAAM;YACjB,MAAMM,SAAkC,CAAC;YACzC,KAAK,MAAM,CAACC,KAAKT,MAAM,IAAIU,OAAOC,OAAO,CAACT,KAAM;gBAC9CM,MAAM,CAACC,IAAI,GAAG,MAAM,IAAI,CAACV,qBAAqB,CAACC,OAAOhC;YACxD;YACA,OAAOwC;QACT;QAEA,OAAOxC,YAAYkC;IACrB;AACF;AAEA;;;;;;;;;;;;;;;CAeC,GACD,OAAO,SAASU,qBAAqB7D,MAA4B;IAC/D,OAAO,IAAIF,0BAA0BE;AACvC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=OpenAITranslation.provider.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OpenAITranslation.provider.test.d.ts","sourceRoot":"","sources":["../../../../src/server/modules/translation-providers/OpenAITranslation.provider.test.ts"],"names":[],"mappings":""}
@@ -1,214 +0,0 @@
1
- import { describe, it, expect, vi, beforeEach } from 'vitest';
2
- import { OpenAITranslationProvider } from './OpenAITranslation.provider';
3
- // Mock OpenAI
4
- vi.mock('openai', () => ({
5
- default: vi.fn().mockImplementation(() => ({
6
- chat: {
7
- completions: {
8
- create: vi.fn(),
9
- },
10
- },
11
- })),
12
- }));
13
- describe('OpenAITranslationProvider', () => {
14
- let provider;
15
- let mockCreate;
16
- beforeEach(async () => {
17
- vi.clearAllMocks();
18
- // Get the mocked OpenAI class
19
- const OpenAI = (await import('openai')).default;
20
- mockCreate = vi.fn();
21
- OpenAI.mockImplementation(() => ({
22
- chat: {
23
- completions: {
24
- create: mockCreate,
25
- },
26
- },
27
- }));
28
- provider = new OpenAITranslationProvider({ apiKey: 'test-api-key' });
29
- });
30
- describe('translate', () => {
31
- it('calls OpenAI API with correct parameters', async () => {
32
- mockCreate.mockResolvedValue({
33
- choices: [{ message: { content: '{"0": "Hallo"}' } }],
34
- });
35
- await provider.translate({ 0: 'Hello' }, 'en', 'de');
36
- expect(mockCreate).toHaveBeenCalledWith(expect.objectContaining({
37
- model: 'gpt-4o',
38
- temperature: 0,
39
- response_format: { type: 'json_object' },
40
- messages: expect.arrayContaining([
41
- expect.objectContaining({ role: 'system' }),
42
- expect.objectContaining({
43
- role: 'user',
44
- content: '{"0":"Hello"}',
45
- }),
46
- ]),
47
- }));
48
- });
49
- it('returns parsed JSON response', async () => {
50
- mockCreate.mockResolvedValue({
51
- choices: [{ message: { content: '{"0": "Titel", "1": "Inhalt"}' } }],
52
- });
53
- const result = await provider.translate({ 0: 'Title', 1: 'Content' }, 'en', 'de');
54
- expect(result).toEqual({ 0: 'Titel', 1: 'Inhalt' });
55
- });
56
- it('returns null when API returns empty content', async () => {
57
- mockCreate.mockResolvedValue({
58
- choices: [{ message: { content: null } }],
59
- });
60
- const result = await provider.translate({ 0: 'Hello' }, 'en', 'de');
61
- expect(result).toBeNull();
62
- });
63
- it('returns null when API returns invalid JSON', async () => {
64
- mockCreate.mockResolvedValue({
65
- choices: [{ message: { content: 'not valid json' } }],
66
- });
67
- const result = await provider.translate({ 0: 'Hello' }, 'en', 'de');
68
- expect(result).toBeNull();
69
- });
70
- it('includes source language in system prompt when provided', async () => {
71
- mockCreate.mockResolvedValue({
72
- choices: [{ message: { content: '{}' } }],
73
- });
74
- await provider.translate({ 0: 'Hello' }, 'en', 'de');
75
- expect(mockCreate).toHaveBeenCalledWith(expect.objectContaining({
76
- messages: expect.arrayContaining([
77
- expect.objectContaining({
78
- role: 'system',
79
- content: expect.stringContaining('from en'),
80
- }),
81
- ]),
82
- }));
83
- });
84
- });
85
- describe('dryRun mode', () => {
86
- describe('with dryRun: true (default transformer, no delay)', () => {
87
- beforeEach(async () => {
88
- provider = new OpenAITranslationProvider({ apiKey: 'test-key', dryRun: true });
89
- });
90
- it('does not call OpenAI API in dry run mode', async () => {
91
- await provider.translate({ 0: 'Hello' }, 'en', 'de');
92
- expect(mockCreate).not.toHaveBeenCalled();
93
- });
94
- it('returns mock translation with reversed text', async () => {
95
- const result = await provider.translate({ 0: 'Hello World' }, 'en', 'de');
96
- expect(result).toEqual({ 0: 'dlroW olleH' });
97
- });
98
- it('handles multiple indexed entries in dry run', async () => {
99
- const content = {
100
- 0: 'First text',
101
- 1: 'Second text',
102
- 2: 'Third text',
103
- };
104
- const result = await provider.translate(content, 'en', 'fr');
105
- expect(result).toEqual({
106
- 0: 'txet tsriF',
107
- 1: 'txet dnoceS',
108
- 2: 'txet drihT',
109
- });
110
- });
111
- it('preserves empty strings in dry run', async () => {
112
- const content = {
113
- 0: 'Hello',
114
- 1: '',
115
- 2: 'World',
116
- };
117
- const result = await provider.translate(content, 'en', 'de');
118
- expect(result).toEqual({
119
- 0: 'olleH',
120
- 1: '',
121
- 2: 'dlroW',
122
- });
123
- });
124
- it('handles whitespace-only strings in dry run', async () => {
125
- const content = {
126
- 0: 'Hello',
127
- 1: ' ',
128
- 2: 'World',
129
- };
130
- const result = await provider.translate(content, 'en', 'de');
131
- // Whitespace-only strings are not transformed (value.trim() is empty)
132
- expect(result).toEqual({
133
- 0: 'olleH',
134
- 1: ' ',
135
- 2: 'dlroW',
136
- });
137
- });
138
- });
139
- describe('with custom transformer config', () => {
140
- it('uses custom transformer function', async () => {
141
- provider = new OpenAITranslationProvider({
142
- apiKey: 'test-key',
143
- dryRun: {
144
- transform: (text) => `[TRANSLATED] ${text}`,
145
- },
146
- });
147
- const result = await provider.translate({ 0: 'Hello World' }, 'en', 'de');
148
- expect(result).toEqual({ 0: '[TRANSLATED] Hello World' });
149
- });
150
- it('uses custom transformer for multiple entries', async () => {
151
- provider = new OpenAITranslationProvider({
152
- apiKey: 'test-key',
153
- dryRun: {
154
- transform: (text) => text.toUpperCase(),
155
- },
156
- });
157
- const content = {
158
- 0: 'hello',
159
- 1: 'world',
160
- };
161
- const result = await provider.translate(content, 'en', 'fr');
162
- expect(result).toEqual({
163
- 0: 'HELLO',
164
- 1: 'WORLD',
165
- });
166
- });
167
- it('does not call OpenAI API with custom transformer', async () => {
168
- provider = new OpenAITranslationProvider({
169
- apiKey: 'test-key',
170
- dryRun: {
171
- transform: (text) => `mock: ${text}`,
172
- },
173
- });
174
- await provider.translate({ 0: 'Test' }, 'en', 'de');
175
- expect(mockCreate).not.toHaveBeenCalled();
176
- });
177
- it('respects timeout option', async () => {
178
- vi.useFakeTimers();
179
- provider = new OpenAITranslationProvider({
180
- apiKey: 'test-key',
181
- dryRun: {
182
- transform: (text) => `[T] ${text}`,
183
- timeout: 1000,
184
- },
185
- });
186
- const translatePromise = provider.translate({ 0: 'Hello' }, 'en', 'de');
187
- // Should not resolve immediately
188
- await vi.advanceTimersByTimeAsync(500);
189
- // Advance past timeout
190
- await vi.advanceTimersByTimeAsync(600);
191
- const result = await translatePromise;
192
- expect(result).toEqual({ 0: '[T] Hello' });
193
- vi.useRealTimers();
194
- });
195
- it('supports async transformer function', async () => {
196
- provider = new OpenAITranslationProvider({
197
- apiKey: 'test-key',
198
- dryRun: {
199
- transform: async (text) => {
200
- // Simulate async operation (e.g., external API call)
201
- await new Promise((resolve) => setTimeout(resolve, 10));
202
- return `[ASYNC] ${text}`;
203
- },
204
- },
205
- });
206
- const result = await provider.translate({ 0: 'Hello', 1: 'World' }, 'en', 'de');
207
- expect(result).toEqual({
208
- 0: '[ASYNC] Hello',
209
- 1: '[ASYNC] World',
210
- });
211
- });
212
- });
213
- });
214
- });
@@ -1 +0,0 @@
1
- {"version":3,"file":"TranslationProvider.interface.d.ts","sourceRoot":"","sources":["../../../../src/server/modules/translation-providers/TranslationProvider.interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAA;AAErC;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAA;AAE/D;;;;;;;GAOG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAA;AAEhE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;;;OAOG;IACH,SAAS,CAAC,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;CAC5G"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/server/modules/translation-providers/TranslationProvider.interface.ts"],"sourcesContent":["/**\n * Numeric index used as key in translation input and output.\n * Represents the position of text in the original document structure.\n */\nexport type TranslationIndex = number\n\n/**\n * Input map of text content for translation.\n * Keys are numeric indices that must be preserved in the output.\n * Values are the text strings to translate.\n *\n * @example\n * { 0: \"Hello\", 1: \"World\", 2: \"Welcome to our site\" }\n */\nexport type TranslationInput = Record<TranslationIndex, string>\n\n/**\n * Output of translation operation.\n * Must have the same keys as input, with translated values.\n *\n * @example\n * // Input: { 0: \"Hello\", 1: \"World\" }\n * // Output: { 0: \"Привет\", 1: \"Мир\" }\n */\nexport type TranslationOutput = Record<TranslationIndex, string>\n\n/**\n * Interface for translation service providers.\n *\n * Implementations must:\n * - Preserve all numeric keys from input\n * - Return translated text values for each key\n * - Return null on translation failure\n * - Handle empty input gracefully\n *\n * @example\n * ```typescript\n * class MyProvider implements TranslationProvider {\n * async translate(input, sourceLng, targetLng) {\n * // Input: { 0: \"Hello\", 1: \"World\" }\n * // Output: { 0: \"Bonjour\", 1: \"Monde\" }\n * const output = await myTranslationAPI.translate(input, targetLng)\n * return output\n * }\n * }\n * ```\n */\nexport interface TranslationProvider {\n /**\n * Translates indexed text content from source to target language.\n *\n * @param input - Map of index to text string. Keys must be preserved in output.\n * @param sourceLng - Source language code (e.g., 'en', 'de'). May be empty for auto-detect.\n * @param targetLng - Target language code (e.g., 'fr', 'es').\n * @returns Translated output with same keys, or null on failure.\n */\n translate(input: TranslationInput, sourceLng: string, targetLng: string): Promise<TranslationOutput | null>\n}\n"],"names":[],"mappings":"AAAA;;;CAGC,GAuBD;;;;;;;;;;;;;;;;;;;;CAoBC,GACD,WAUC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/server/modules/translation-providers/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,iCAAiC,CAAA;AACxC,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,mBAAmB,GACzB,MAAM,8BAA8B,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/server/modules/translation-providers/index.ts"],"sourcesContent":["export type {\n TranslationProvider,\n TranslationInput,\n TranslationOutput,\n TranslationIndex,\n} from './TranslationProvider.interface'\nexport {\n OpenAITranslationProvider,\n createOpenAIProvider,\n type OpenAIProviderConfig,\n type DryRunConfig,\n type SystemPromptContext,\n} from './OpenAITranslation.provider'\n"],"names":["OpenAITranslationProvider","createOpenAIProvider"],"mappings":"AAMA,SACEA,yBAAyB,EACzBC,oBAAoB,QAIf,+BAA8B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnyAccessGuard.d.ts","sourceRoot":"","sources":["../../../../src/server/shared/access/AnyAccessGuard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;GAEG;AACH,qBAAa,cAAe,YAAW,WAAW;IAC1C,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC;CAGhC"}