@focus-reactive/payload-plugin-translator 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +410 -0
- package/dist/client/app/cache/CacheProvider.d.ts +7 -0
- package/dist/client/app/cache/CacheProvider.d.ts.map +1 -0
- package/dist/client/app/cache/CacheProvider.export.d.ts +9 -0
- package/dist/client/app/cache/CacheProvider.export.d.ts.map +1 -0
- package/dist/client/app/cache/CacheProvider.export.js +12 -0
- package/dist/client/app/cache/CacheProvider.export.js.map +1 -0
- package/dist/client/app/cache/CacheProvider.js +18 -0
- package/dist/client/app/cache/CacheProvider.js.map +1 -0
- package/dist/client/app/cache/CacheProvider.jsx +11 -0
- package/dist/client/app/config/TranslateKitConfigContext.d.ts +9 -0
- package/dist/client/app/config/TranslateKitConfigContext.d.ts.map +1 -0
- package/dist/client/app/config/TranslateKitConfigContext.js +23 -0
- package/dist/client/app/config/TranslateKitConfigContext.js.map +1 -0
- package/dist/client/app/config/TranslateKitConfigContext.jsx +13 -0
- package/dist/client/app/config/index.d.ts +3 -0
- package/dist/client/app/config/index.d.ts.map +1 -0
- package/dist/client/app/config/index.js +3 -0
- package/dist/client/app/config/index.js.map +1 -0
- package/dist/client/entities/translation/api/mutations/useCancelCollectionTranslations.d.ts +6 -0
- package/dist/client/entities/translation/api/mutations/useCancelCollectionTranslations.d.ts.map +1 -0
- package/dist/client/entities/translation/api/mutations/useCancelCollectionTranslations.js +27 -0
- package/dist/client/entities/translation/api/mutations/useCancelCollectionTranslations.js.map +1 -0
- package/dist/client/entities/translation/api/mutations/useCancelDocumentTranslation.d.ts +6 -0
- package/dist/client/entities/translation/api/mutations/useCancelDocumentTranslation.d.ts.map +1 -0
- package/dist/client/entities/translation/api/mutations/useCancelDocumentTranslation.js +34 -0
- package/dist/client/entities/translation/api/mutations/useCancelDocumentTranslation.js.map +1 -0
- package/dist/client/entities/translation/api/mutations/useQueueDocumentTranslation.d.ts +13 -0
- package/dist/client/entities/translation/api/mutations/useQueueDocumentTranslation.d.ts.map +1 -0
- package/dist/client/entities/translation/api/mutations/useQueueDocumentTranslation.js +33 -0
- package/dist/client/entities/translation/api/mutations/useQueueDocumentTranslation.js.map +1 -0
- package/dist/client/entities/translation/api/mutations/useQueueDocumentTranslations.d.ts +9 -0
- package/dist/client/entities/translation/api/mutations/useQueueDocumentTranslations.d.ts.map +1 -0
- package/dist/client/entities/translation/api/mutations/useQueueDocumentTranslations.js +20 -0
- package/dist/client/entities/translation/api/mutations/useQueueDocumentTranslations.js.map +1 -0
- package/dist/client/entities/translation/api/mutations/useRunDocumentTranslation.d.ts +6 -0
- package/dist/client/entities/translation/api/mutations/useRunDocumentTranslation.d.ts.map +1 -0
- package/dist/client/entities/translation/api/mutations/useRunDocumentTranslation.js +27 -0
- package/dist/client/entities/translation/api/mutations/useRunDocumentTranslation.js.map +1 -0
- package/dist/client/entities/translation/api/queries/useCollectionTranslationStatus.d.ts +179 -0
- package/dist/client/entities/translation/api/queries/useCollectionTranslationStatus.d.ts.map +1 -0
- package/dist/client/entities/translation/api/queries/useCollectionTranslationStatus.js +67 -0
- package/dist/client/entities/translation/api/queries/useCollectionTranslationStatus.js.map +1 -0
- package/dist/client/entities/translation/api/queries/useDocumentTranslation.d.ts +180 -0
- package/dist/client/entities/translation/api/queries/useDocumentTranslation.d.ts.map +1 -0
- package/dist/client/entities/translation/api/queries/useDocumentTranslation.js +55 -0
- package/dist/client/entities/translation/api/queries/useDocumentTranslation.js.map +1 -0
- package/dist/client/entities/translation/index.d.ts +21 -0
- package/dist/client/entities/translation/index.d.ts.map +1 -0
- package/dist/client/entities/translation/index.js +21 -0
- package/dist/client/entities/translation/index.js.map +1 -0
- package/dist/client/entities/translation/model/enums.d.ts +7 -0
- package/dist/client/entities/translation/model/enums.d.ts.map +1 -0
- package/dist/client/entities/translation/model/enums.js +9 -0
- package/dist/client/entities/translation/model/enums.js.map +1 -0
- package/dist/client/entities/translation/model/types.d.ts +48 -0
- package/dist/client/entities/translation/model/types.d.ts.map +1 -0
- package/dist/client/entities/translation/model/types.js +3 -0
- package/dist/client/entities/translation/model/types.js.map +1 -0
- package/dist/client/entities/translation/ui/CompletedTranslationStatus/CompletedTranslationStatus.d.ts +8 -0
- package/dist/client/entities/translation/ui/CompletedTranslationStatus/CompletedTranslationStatus.d.ts.map +1 -0
- package/dist/client/entities/translation/ui/CompletedTranslationStatus/CompletedTranslationStatus.js +45 -0
- package/dist/client/entities/translation/ui/CompletedTranslationStatus/CompletedTranslationStatus.js.map +1 -0
- package/dist/client/entities/translation/ui/CompletedTranslationStatus/CompletedTranslationStatus.jsx +25 -0
- package/dist/client/entities/translation/ui/CompletedTranslationStatus/index.d.ts +2 -0
- package/dist/client/entities/translation/ui/CompletedTranslationStatus/index.d.ts.map +1 -0
- package/dist/client/entities/translation/ui/CompletedTranslationStatus/index.js +3 -0
- package/dist/client/entities/translation/ui/CompletedTranslationStatus/index.js.map +1 -0
- package/dist/client/entities/translation/ui/FailedTranslationStatus/FailedTranslationStatus.d.ts +10 -0
- package/dist/client/entities/translation/ui/FailedTranslationStatus/FailedTranslationStatus.d.ts.map +1 -0
- package/dist/client/entities/translation/ui/FailedTranslationStatus/FailedTranslationStatus.js +54 -0
- package/dist/client/entities/translation/ui/FailedTranslationStatus/FailedTranslationStatus.js.map +1 -0
- package/dist/client/entities/translation/ui/FailedTranslationStatus/FailedTranslationStatus.jsx +24 -0
- package/dist/client/entities/translation/ui/FailedTranslationStatus/index.d.ts +2 -0
- package/dist/client/entities/translation/ui/FailedTranslationStatus/index.d.ts.map +1 -0
- package/dist/client/entities/translation/ui/FailedTranslationStatus/index.js +3 -0
- package/dist/client/entities/translation/ui/FailedTranslationStatus/index.js.map +1 -0
- package/dist/client/entities/translation/ui/PendingTranslationStatus/PendingTranslationStatus.d.ts +12 -0
- package/dist/client/entities/translation/ui/PendingTranslationStatus/PendingTranslationStatus.d.ts.map +1 -0
- package/dist/client/entities/translation/ui/PendingTranslationStatus/PendingTranslationStatus.js +83 -0
- package/dist/client/entities/translation/ui/PendingTranslationStatus/PendingTranslationStatus.js.map +1 -0
- package/dist/client/entities/translation/ui/PendingTranslationStatus/PendingTranslationStatus.jsx +38 -0
- package/dist/client/entities/translation/ui/PendingTranslationStatus/index.d.ts +2 -0
- package/dist/client/entities/translation/ui/PendingTranslationStatus/index.d.ts.map +1 -0
- package/dist/client/entities/translation/ui/PendingTranslationStatus/index.js +3 -0
- package/dist/client/entities/translation/ui/PendingTranslationStatus/index.js.map +1 -0
- package/dist/client/entities/translation/ui/RunningTranslationStatus/RunningTranslationStatus.d.ts +11 -0
- package/dist/client/entities/translation/ui/RunningTranslationStatus/RunningTranslationStatus.d.ts.map +1 -0
- package/dist/client/entities/translation/ui/RunningTranslationStatus/RunningTranslationStatus.js +66 -0
- package/dist/client/entities/translation/ui/RunningTranslationStatus/RunningTranslationStatus.js.map +1 -0
- package/dist/client/entities/translation/ui/RunningTranslationStatus/RunningTranslationStatus.jsx +32 -0
- package/dist/client/entities/translation/ui/RunningTranslationStatus/index.d.ts +2 -0
- package/dist/client/entities/translation/ui/RunningTranslationStatus/index.d.ts.map +1 -0
- package/dist/client/entities/translation/ui/RunningTranslationStatus/index.js +3 -0
- package/dist/client/entities/translation/ui/RunningTranslationStatus/index.js.map +1 -0
- package/dist/client/entities/translation/ui/TranslationDirection/TranslationDirection.d.ts +8 -0
- package/dist/client/entities/translation/ui/TranslationDirection/TranslationDirection.d.ts.map +1 -0
- package/dist/client/entities/translation/ui/TranslationDirection/TranslationDirection.js +28 -0
- package/dist/client/entities/translation/ui/TranslationDirection/TranslationDirection.js.map +1 -0
- package/dist/client/entities/translation/ui/TranslationDirection/TranslationDirection.jsx +16 -0
- package/dist/client/entities/translation/ui/TranslationDirection/index.d.ts +2 -0
- package/dist/client/entities/translation/ui/TranslationDirection/index.d.ts.map +1 -0
- package/dist/client/entities/translation/ui/TranslationDirection/index.js +3 -0
- package/dist/client/entities/translation/ui/TranslationDirection/index.js.map +1 -0
- package/dist/client/features/collection-translation-form/index.client.d.ts +2 -0
- package/dist/client/features/collection-translation-form/index.client.d.ts.map +1 -0
- package/dist/client/features/collection-translation-form/index.client.js +3 -0
- package/dist/client/features/collection-translation-form/index.client.js.map +1 -0
- package/dist/client/features/collection-translation-form/index.d.ts +4 -0
- package/dist/client/features/collection-translation-form/index.d.ts.map +1 -0
- package/dist/client/features/collection-translation-form/index.js +4 -0
- package/dist/client/features/collection-translation-form/index.js.map +1 -0
- package/dist/client/features/collection-translation-form/model/constants.d.ts +16 -0
- package/dist/client/features/collection-translation-form/model/constants.d.ts.map +1 -0
- package/dist/client/features/collection-translation-form/model/constants.js +16 -0
- package/dist/client/features/collection-translation-form/model/constants.js.map +1 -0
- package/dist/client/features/collection-translation-form/model/form-model.d.ts +12 -0
- package/dist/client/features/collection-translation-form/model/form-model.d.ts.map +1 -0
- package/dist/client/features/collection-translation-form/model/form-model.js +32 -0
- package/dist/client/features/collection-translation-form/model/form-model.js.map +1 -0
- package/dist/client/features/collection-translation-form/model/index.d.ts +9 -0
- package/dist/client/features/collection-translation-form/model/index.d.ts.map +1 -0
- package/dist/client/features/collection-translation-form/model/index.js +6 -0
- package/dist/client/features/collection-translation-form/model/index.js.map +1 -0
- package/dist/client/features/collection-translation-form/model/schema.d.ts +23 -0
- package/dist/client/features/collection-translation-form/model/schema.d.ts.map +1 -0
- package/dist/client/features/collection-translation-form/model/schema.js +14 -0
- package/dist/client/features/collection-translation-form/model/schema.js.map +1 -0
- package/dist/client/features/collection-translation-form/ui/CollectionTranslationForm.d.ts +11 -0
- package/dist/client/features/collection-translation-form/ui/CollectionTranslationForm.d.ts.map +1 -0
- package/dist/client/features/collection-translation-form/ui/CollectionTranslationForm.js +64 -0
- package/dist/client/features/collection-translation-form/ui/CollectionTranslationForm.js.map +1 -0
- package/dist/client/features/collection-translation-form/ui/CollectionTranslationForm.jsx +25 -0
- package/dist/client/features/collection-translation-form/ui/index.d.ts +2 -0
- package/dist/client/features/collection-translation-form/ui/index.d.ts.map +1 -0
- package/dist/client/features/collection-translation-form/ui/index.js +3 -0
- package/dist/client/features/collection-translation-form/ui/index.js.map +1 -0
- package/dist/client/features/collection-translation-popup/index.d.ts +2 -0
- package/dist/client/features/collection-translation-popup/index.d.ts.map +1 -0
- package/dist/client/features/collection-translation-popup/index.js +3 -0
- package/dist/client/features/collection-translation-popup/index.js.map +1 -0
- package/dist/client/features/collection-translation-popup/ui/CollectionTranslationPopup.d.ts +8 -0
- package/dist/client/features/collection-translation-popup/ui/CollectionTranslationPopup.d.ts.map +1 -0
- package/dist/client/features/collection-translation-popup/ui/CollectionTranslationPopup.js +48 -0
- package/dist/client/features/collection-translation-popup/ui/CollectionTranslationPopup.js.map +1 -0
- package/dist/client/features/collection-translation-popup/ui/CollectionTranslationPopup.jsx +23 -0
- package/dist/client/features/collection-translation-progress/index.d.ts +2 -0
- package/dist/client/features/collection-translation-progress/index.d.ts.map +1 -0
- package/dist/client/features/collection-translation-progress/index.js +3 -0
- package/dist/client/features/collection-translation-progress/index.js.map +1 -0
- package/dist/client/features/collection-translation-progress/ui/CollectionTranslationProgress.d.ts +9 -0
- package/dist/client/features/collection-translation-progress/ui/CollectionTranslationProgress.d.ts.map +1 -0
- package/dist/client/features/collection-translation-progress/ui/CollectionTranslationProgress.js +108 -0
- package/dist/client/features/collection-translation-progress/ui/CollectionTranslationProgress.js.map +1 -0
- package/dist/client/features/collection-translation-progress/ui/CollectionTranslationProgress.jsx +47 -0
- package/dist/client/features/document-translation-progress-failed/index.d.ts +2 -0
- package/dist/client/features/document-translation-progress-failed/index.d.ts.map +1 -0
- package/dist/client/features/document-translation-progress-failed/index.js +3 -0
- package/dist/client/features/document-translation-progress-failed/index.js.map +1 -0
- package/dist/client/features/document-translation-progress-failed/ui/DocumentTranslationProgressFailed.d.ts +7 -0
- package/dist/client/features/document-translation-progress-failed/ui/DocumentTranslationProgressFailed.d.ts.map +1 -0
- package/dist/client/features/document-translation-progress-failed/ui/DocumentTranslationProgressFailed.js +28 -0
- package/dist/client/features/document-translation-progress-failed/ui/DocumentTranslationProgressFailed.js.map +1 -0
- package/dist/client/features/document-translation-progress-failed/ui/DocumentTranslationProgressFailed.jsx +19 -0
- package/dist/client/features/document-translation-progress-pending/index.d.ts +2 -0
- package/dist/client/features/document-translation-progress-pending/index.d.ts.map +1 -0
- package/dist/client/features/document-translation-progress-pending/index.js +3 -0
- package/dist/client/features/document-translation-progress-pending/index.js.map +1 -0
- package/dist/client/features/document-translation-progress-pending/ui/DocumentTranslationProgressPending.d.ts +7 -0
- package/dist/client/features/document-translation-progress-pending/ui/DocumentTranslationProgressPending.d.ts.map +1 -0
- package/dist/client/features/document-translation-progress-pending/ui/DocumentTranslationProgressPending.js +44 -0
- package/dist/client/features/document-translation-progress-pending/ui/DocumentTranslationProgressPending.js.map +1 -0
- package/dist/client/features/document-translation-progress-pending/ui/DocumentTranslationProgressPending.jsx +34 -0
- package/dist/client/features/document-translation-progress-running/index.d.ts +2 -0
- package/dist/client/features/document-translation-progress-running/index.d.ts.map +1 -0
- package/dist/client/features/document-translation-progress-running/index.js +3 -0
- package/dist/client/features/document-translation-progress-running/index.js.map +1 -0
- package/dist/client/features/document-translation-progress-running/ui/DocumentTranslationProgressRunning.d.ts +7 -0
- package/dist/client/features/document-translation-progress-running/ui/DocumentTranslationProgressRunning.d.ts.map +1 -0
- package/dist/client/features/document-translation-progress-running/ui/DocumentTranslationProgressRunning.js +28 -0
- package/dist/client/features/document-translation-progress-running/ui/DocumentTranslationProgressRunning.js.map +1 -0
- package/dist/client/features/document-translation-progress-running/ui/DocumentTranslationProgressRunning.jsx +19 -0
- package/dist/client/features/open-document-translation-popup/index.d.ts +2 -0
- package/dist/client/features/open-document-translation-popup/index.d.ts.map +1 -0
- package/dist/client/features/open-document-translation-popup/index.js +3 -0
- package/dist/client/features/open-document-translation-popup/index.js.map +1 -0
- package/dist/client/features/open-document-translation-popup/ui/OpenDocumentTranslationPopup.d.ts +10 -0
- package/dist/client/features/open-document-translation-popup/ui/OpenDocumentTranslationPopup.d.ts.map +1 -0
- package/dist/client/features/open-document-translation-popup/ui/OpenDocumentTranslationPopup.js +35 -0
- package/dist/client/features/open-document-translation-popup/ui/OpenDocumentTranslationPopup.js.map +1 -0
- package/dist/client/features/open-document-translation-popup/ui/OpenDocumentTranslationPopup.jsx +15 -0
- package/dist/client/features/translate-document-form/index.client.d.ts +2 -0
- package/dist/client/features/translate-document-form/index.client.d.ts.map +1 -0
- package/dist/client/features/translate-document-form/index.client.js +3 -0
- package/dist/client/features/translate-document-form/index.client.js.map +1 -0
- package/dist/client/features/translate-document-form/index.d.ts +4 -0
- package/dist/client/features/translate-document-form/index.d.ts.map +1 -0
- package/dist/client/features/translate-document-form/index.js +4 -0
- package/dist/client/features/translate-document-form/index.js.map +1 -0
- package/dist/client/features/translate-document-form/model/constants.d.ts +18 -0
- package/dist/client/features/translate-document-form/model/constants.d.ts.map +1 -0
- package/dist/client/features/translate-document-form/model/constants.js +18 -0
- package/dist/client/features/translate-document-form/model/constants.js.map +1 -0
- package/dist/client/features/translate-document-form/model/form-model.d.ts +12 -0
- package/dist/client/features/translate-document-form/model/form-model.d.ts.map +1 -0
- package/dist/client/features/translate-document-form/model/form-model.js +32 -0
- package/dist/client/features/translate-document-form/model/form-model.js.map +1 -0
- package/dist/client/features/translate-document-form/model/index.d.ts +9 -0
- package/dist/client/features/translate-document-form/model/index.d.ts.map +1 -0
- package/dist/client/features/translate-document-form/model/index.js +6 -0
- package/dist/client/features/translate-document-form/model/index.js.map +1 -0
- package/dist/client/features/translate-document-form/model/schema.d.ts +26 -0
- package/dist/client/features/translate-document-form/model/schema.d.ts.map +1 -0
- package/dist/client/features/translate-document-form/model/schema.js +15 -0
- package/dist/client/features/translate-document-form/model/schema.js.map +1 -0
- package/dist/client/features/translate-document-form/ui/DocumentTranslationForm.d.ts +10 -0
- package/dist/client/features/translate-document-form/ui/DocumentTranslationForm.d.ts.map +1 -0
- package/dist/client/features/translate-document-form/ui/DocumentTranslationForm.js +57 -0
- package/dist/client/features/translate-document-form/ui/DocumentTranslationForm.js.map +1 -0
- package/dist/client/features/translate-document-form/ui/DocumentTranslationForm.jsx +24 -0
- package/dist/client/features/translate-document-form/ui/index.d.ts +2 -0
- package/dist/client/features/translate-document-form/ui/index.d.ts.map +1 -0
- package/dist/client/features/translate-document-form/ui/index.js +3 -0
- package/dist/client/features/translate-document-form/ui/index.js.map +1 -0
- package/dist/client/shared/lib/assets/icons/LanguageTranslateIcon.d.ts +2 -0
- package/dist/client/shared/lib/assets/icons/LanguageTranslateIcon.d.ts.map +1 -0
- package/dist/client/shared/lib/assets/icons/LanguageTranslateIcon.js +18 -0
- package/dist/client/shared/lib/assets/icons/LanguageTranslateIcon.js.map +1 -0
- package/dist/client/shared/lib/assets/icons/LanguageTranslateIcon.jsx +4 -0
- package/dist/client/shared/lib/assets/icons/QuestionCircleIcon.d.ts +2 -0
- package/dist/client/shared/lib/assets/icons/QuestionCircleIcon.d.ts.map +1 -0
- package/dist/client/shared/lib/assets/icons/QuestionCircleIcon.js +16 -0
- package/dist/client/shared/lib/assets/icons/QuestionCircleIcon.js.map +1 -0
- package/dist/client/shared/lib/assets/icons/QuestionCircleIcon.jsx +3 -0
- package/dist/client/shared/lib/assets/icons/ReloadIcon.d.ts +2 -0
- package/dist/client/shared/lib/assets/icons/ReloadIcon.d.ts.map +1 -0
- package/dist/client/shared/lib/assets/icons/ReloadIcon.js +14 -0
- package/dist/client/shared/lib/assets/icons/ReloadIcon.js.map +1 -0
- package/dist/client/shared/lib/assets/icons/ReloadIcon.jsx +3 -0
- package/dist/client/shared/lib/errors/handleApiError.d.ts +8 -0
- package/dist/client/shared/lib/errors/handleApiError.d.ts.map +1 -0
- package/dist/client/shared/lib/errors/handleApiError.js +24 -0
- package/dist/client/shared/lib/errors/handleApiError.js.map +1 -0
- package/dist/client/shared/lib/forms/handle-form-error.d.ts +3 -0
- package/dist/client/shared/lib/forms/handle-form-error.d.ts.map +1 -0
- package/dist/client/shared/lib/forms/handle-form-error.js +26 -0
- package/dist/client/shared/lib/forms/handle-form-error.js.map +1 -0
- package/dist/client/shared/lib/payload/hooks/useCollectionDashboardUrlParams.d.ts +7 -0
- package/dist/client/shared/lib/payload/hooks/useCollectionDashboardUrlParams.d.ts.map +1 -0
- package/dist/client/shared/lib/payload/hooks/useCollectionDashboardUrlParams.js +12 -0
- package/dist/client/shared/lib/payload/hooks/useCollectionDashboardUrlParams.js.map +1 -0
- package/dist/client/shared/lib/payload/hooks/useCollectionDocumentUrlParams.d.ts +9 -0
- package/dist/client/shared/lib/payload/hooks/useCollectionDocumentUrlParams.d.ts.map +1 -0
- package/dist/client/shared/lib/payload/hooks/useCollectionDocumentUrlParams.js +14 -0
- package/dist/client/shared/lib/payload/hooks/useCollectionDocumentUrlParams.js.map +1 -0
- package/dist/client/shared/lib/payload/hooks/useLocaleOptions.d.ts +5 -0
- package/dist/client/shared/lib/payload/hooks/useLocaleOptions.d.ts.map +1 -0
- package/dist/client/shared/lib/payload/hooks/useLocaleOptions.js +13 -0
- package/dist/client/shared/lib/payload/hooks/useLocaleOptions.js.map +1 -0
- package/dist/client/shared/lib/utils/errors/handleApiError.d.ts +8 -0
- package/dist/client/shared/lib/utils/errors/handleApiError.d.ts.map +1 -0
- package/dist/client/shared/lib/utils/errors/handleApiError.js +24 -0
- package/dist/client/shared/lib/utils/errors/handleApiError.js.map +1 -0
- package/dist/client/shared/lib/utils/react/useToggle.d.ts +7 -0
- package/dist/client/shared/lib/utils/react/useToggle.d.ts.map +1 -0
- package/dist/client/shared/lib/utils/react/useToggle.js +24 -0
- package/dist/client/shared/lib/utils/react/useToggle.js.map +1 -0
- package/dist/client/shared/providers/CacheClientProvider/CacheClientProvider.factory.d.ts +32 -0
- package/dist/client/shared/providers/CacheClientProvider/CacheClientProvider.factory.d.ts.map +1 -0
- package/dist/client/shared/providers/CacheClientProvider/CacheClientProvider.factory.js +66 -0
- package/dist/client/shared/providers/CacheClientProvider/CacheClientProvider.factory.js.map +1 -0
- package/dist/client/shared/providers/CacheClientProvider/index.d.ts +2 -0
- package/dist/client/shared/providers/CacheClientProvider/index.d.ts.map +1 -0
- package/dist/client/shared/providers/CacheClientProvider/index.js +3 -0
- package/dist/client/shared/providers/CacheClientProvider/index.js.map +1 -0
- package/dist/client/shared/types/AccessGuard.d.ts +12 -0
- package/dist/client/shared/types/AccessGuard.d.ts.map +1 -0
- package/dist/client/shared/types/AccessGuard.js +3 -0
- package/dist/client/shared/types/AccessGuard.js.map +1 -0
- package/dist/client/shared/types/PayloadComponentExport.d.ts +3 -0
- package/dist/client/shared/types/PayloadComponentExport.d.ts.map +1 -0
- package/dist/client/shared/types/PayloadComponentExport.js +3 -0
- package/dist/client/shared/types/PayloadComponentExport.js.map +1 -0
- package/dist/client/shared/ui/Alert/Alert.d.ts +10 -0
- package/dist/client/shared/ui/Alert/Alert.d.ts.map +1 -0
- package/dist/client/shared/ui/Alert/Alert.js +40 -0
- package/dist/client/shared/ui/Alert/Alert.js.map +1 -0
- package/dist/client/shared/ui/Alert/Alert.jsx +33 -0
- package/dist/client/shared/ui/Alert/index.d.ts +2 -0
- package/dist/client/shared/ui/Alert/index.d.ts.map +1 -0
- package/dist/client/shared/ui/Alert/index.js +3 -0
- package/dist/client/shared/ui/Alert/index.js.map +1 -0
- package/dist/client/shared/ui/Button/Button.d.ts +12 -0
- package/dist/client/shared/ui/Button/Button.d.ts.map +1 -0
- package/dist/client/shared/ui/Button/Button.js +47 -0
- package/dist/client/shared/ui/Button/Button.js.map +1 -0
- package/dist/client/shared/ui/Button/Button.jsx +35 -0
- package/dist/client/shared/ui/Button/index.d.ts +2 -0
- package/dist/client/shared/ui/Button/index.d.ts.map +1 -0
- package/dist/client/shared/ui/Button/index.js +3 -0
- package/dist/client/shared/ui/Button/index.js.map +1 -0
- package/dist/client/shared/ui/Checkbox/Checkbox.d.ts +7 -0
- package/dist/client/shared/ui/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/client/shared/ui/Checkbox/Checkbox.js +14 -0
- package/dist/client/shared/ui/Checkbox/Checkbox.js.map +1 -0
- package/dist/client/shared/ui/Checkbox/Checkbox.jsx +6 -0
- package/dist/client/shared/ui/Checkbox/index.d.ts +2 -0
- package/dist/client/shared/ui/Checkbox/index.d.ts.map +1 -0
- package/dist/client/shared/ui/Checkbox/index.js +3 -0
- package/dist/client/shared/ui/Checkbox/index.js.map +1 -0
- package/dist/client/shared/ui/ColorIndicator/ColorIndicator.d.ts +9 -0
- package/dist/client/shared/ui/ColorIndicator/ColorIndicator.d.ts.map +1 -0
- package/dist/client/shared/ui/ColorIndicator/ColorIndicator.js +13 -0
- package/dist/client/shared/ui/ColorIndicator/ColorIndicator.js.map +1 -0
- package/dist/client/shared/ui/ColorIndicator/ColorIndicator.jsx +7 -0
- package/dist/client/shared/ui/ColorIndicator/index.d.ts +2 -0
- package/dist/client/shared/ui/ColorIndicator/index.d.ts.map +1 -0
- package/dist/client/shared/ui/ColorIndicator/index.js +3 -0
- package/dist/client/shared/ui/ColorIndicator/index.js.map +1 -0
- package/dist/client/shared/ui/Description/Description.d.ts +8 -0
- package/dist/client/shared/ui/Description/Description.d.ts.map +1 -0
- package/dist/client/shared/ui/Description/Description.js +15 -0
- package/dist/client/shared/ui/Description/Description.js.map +1 -0
- package/dist/client/shared/ui/Description/Description.jsx +7 -0
- package/dist/client/shared/ui/Description/index.d.ts +2 -0
- package/dist/client/shared/ui/Description/index.d.ts.map +1 -0
- package/dist/client/shared/ui/Description/index.js +3 -0
- package/dist/client/shared/ui/Description/index.js.map +1 -0
- package/dist/client/shared/ui/Divider/Divider.d.ts +11 -0
- package/dist/client/shared/ui/Divider/Divider.d.ts.map +1 -0
- package/dist/client/shared/ui/Divider/Divider.js +17 -0
- package/dist/client/shared/ui/Divider/Divider.js.map +1 -0
- package/dist/client/shared/ui/Divider/Divider.jsx +7 -0
- package/dist/client/shared/ui/Divider/index.d.ts +2 -0
- package/dist/client/shared/ui/Divider/index.d.ts.map +1 -0
- package/dist/client/shared/ui/Divider/index.js +3 -0
- package/dist/client/shared/ui/Divider/index.js.map +1 -0
- package/dist/client/shared/ui/Label/Label.d.ts +7 -0
- package/dist/client/shared/ui/Label/Label.d.ts.map +1 -0
- package/dist/client/shared/ui/Label/Label.js +20 -0
- package/dist/client/shared/ui/Label/Label.js.map +1 -0
- package/dist/client/shared/ui/Label/Label.jsx +9 -0
- package/dist/client/shared/ui/Label/index.d.ts +2 -0
- package/dist/client/shared/ui/Label/index.d.ts.map +1 -0
- package/dist/client/shared/ui/Label/index.js +3 -0
- package/dist/client/shared/ui/Label/index.js.map +1 -0
- package/dist/client/shared/ui/Loading/Loading.d.ts +8 -0
- package/dist/client/shared/ui/Loading/Loading.d.ts.map +1 -0
- package/dist/client/shared/ui/Loading/Loading.js +26 -0
- package/dist/client/shared/ui/Loading/Loading.js.map +1 -0
- package/dist/client/shared/ui/Loading/Loading.jsx +11 -0
- package/dist/client/shared/ui/Loading/index.d.ts +2 -0
- package/dist/client/shared/ui/Loading/index.d.ts.map +1 -0
- package/dist/client/shared/ui/Loading/index.js +3 -0
- package/dist/client/shared/ui/Loading/index.js.map +1 -0
- package/dist/client/shared/ui/Popup/Popup.d.ts +11 -0
- package/dist/client/shared/ui/Popup/Popup.d.ts.map +1 -0
- package/dist/client/shared/ui/Popup/Popup.js +27 -0
- package/dist/client/shared/ui/Popup/Popup.js.map +1 -0
- package/dist/client/shared/ui/Popup/Popup.jsx +13 -0
- package/dist/client/shared/ui/Popup/index.d.ts +2 -0
- package/dist/client/shared/ui/Popup/index.d.ts.map +1 -0
- package/dist/client/shared/ui/Popup/index.js +3 -0
- package/dist/client/shared/ui/Popup/index.js.map +1 -0
- package/dist/client/shared/ui/ProgressBar/ProgressBar.d.ts +10 -0
- package/dist/client/shared/ui/ProgressBar/ProgressBar.d.ts.map +1 -0
- package/dist/client/shared/ui/ProgressBar/ProgressBar.js +29 -0
- package/dist/client/shared/ui/ProgressBar/ProgressBar.js.map +1 -0
- package/dist/client/shared/ui/ProgressBar/ProgressBar.jsx +11 -0
- package/dist/client/shared/ui/ProgressBar/index.d.ts +2 -0
- package/dist/client/shared/ui/ProgressBar/index.d.ts.map +1 -0
- package/dist/client/shared/ui/ProgressBar/index.js +3 -0
- package/dist/client/shared/ui/ProgressBar/index.js.map +1 -0
- package/dist/client/shared/ui/Select/Select.d.ts +20 -0
- package/dist/client/shared/ui/Select/Select.d.ts.map +1 -0
- package/dist/client/shared/ui/Select/Select.js +54 -0
- package/dist/client/shared/ui/Select/Select.js.map +1 -0
- package/dist/client/shared/ui/Select/Select.jsx +41 -0
- package/dist/client/shared/ui/Select/index.d.ts +2 -0
- package/dist/client/shared/ui/Select/index.d.ts.map +1 -0
- package/dist/client/shared/ui/Select/index.js +3 -0
- package/dist/client/shared/ui/Select/index.js.map +1 -0
- package/dist/client/shared/ui/StatusCounter/StatusCounter.d.ts +11 -0
- package/dist/client/shared/ui/StatusCounter/StatusCounter.d.ts.map +1 -0
- package/dist/client/shared/ui/StatusCounter/StatusCounter.js +45 -0
- package/dist/client/shared/ui/StatusCounter/StatusCounter.js.map +1 -0
- package/dist/client/shared/ui/StatusCounter/StatusCounter.jsx +26 -0
- package/dist/client/shared/ui/StatusCounter/index.d.ts +2 -0
- package/dist/client/shared/ui/StatusCounter/index.d.ts.map +1 -0
- package/dist/client/shared/ui/StatusCounter/index.js +3 -0
- package/dist/client/shared/ui/StatusCounter/index.js.map +1 -0
- package/dist/client/shared/ui/StatusIndicator/StatusIndicator.d.ts +10 -0
- package/dist/client/shared/ui/StatusIndicator/StatusIndicator.d.ts.map +1 -0
- package/dist/client/shared/ui/StatusIndicator/StatusIndicator.js +20 -0
- package/dist/client/shared/ui/StatusIndicator/StatusIndicator.js.map +1 -0
- package/dist/client/shared/ui/StatusIndicator/StatusIndicator.jsx +10 -0
- package/dist/client/shared/ui/StatusIndicator/index.d.ts +2 -0
- package/dist/client/shared/ui/StatusIndicator/index.d.ts.map +1 -0
- package/dist/client/shared/ui/StatusIndicator/index.js +3 -0
- package/dist/client/shared/ui/StatusIndicator/index.js.map +1 -0
- package/dist/client/shared/ui/Tooltip/Tooltip.d.ts +11 -0
- package/dist/client/shared/ui/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/client/shared/ui/Tooltip/Tooltip.js +32 -0
- package/dist/client/shared/ui/Tooltip/Tooltip.js.map +1 -0
- package/dist/client/shared/ui/Tooltip/Tooltip.jsx +16 -0
- package/dist/client/shared/ui/Tooltip/index.d.ts +2 -0
- package/dist/client/shared/ui/Tooltip/index.d.ts.map +1 -0
- package/dist/client/shared/ui/Tooltip/index.js +3 -0
- package/dist/client/shared/ui/Tooltip/index.js.map +1 -0
- package/dist/client/shared/ui/form/FormCheckbox/FormCheckbox.d.ts +11 -0
- package/dist/client/shared/ui/form/FormCheckbox/FormCheckbox.d.ts.map +1 -0
- package/dist/client/shared/ui/form/FormCheckbox/FormCheckbox.js +51 -0
- package/dist/client/shared/ui/form/FormCheckbox/FormCheckbox.js.map +1 -0
- package/dist/client/shared/ui/form/FormCheckbox/FormCheckbox.jsx +24 -0
- package/dist/client/shared/ui/form/FormCheckbox/index.d.ts +2 -0
- package/dist/client/shared/ui/form/FormCheckbox/index.d.ts.map +1 -0
- package/dist/client/shared/ui/form/FormCheckbox/index.js +3 -0
- package/dist/client/shared/ui/form/FormCheckbox/index.js.map +1 -0
- package/dist/client/shared/ui/form/FormCheckboxPublish/FormCheckboxPublish.d.ts +8 -0
- package/dist/client/shared/ui/form/FormCheckboxPublish/FormCheckboxPublish.d.ts.map +1 -0
- package/dist/client/shared/ui/form/FormCheckboxPublish/FormCheckboxPublish.js +37 -0
- package/dist/client/shared/ui/form/FormCheckboxPublish/FormCheckboxPublish.js.map +1 -0
- package/dist/client/shared/ui/form/FormCheckboxPublish/FormCheckboxPublish.jsx +21 -0
- package/dist/client/shared/ui/form/FormCheckboxPublish/index.d.ts +2 -0
- package/dist/client/shared/ui/form/FormCheckboxPublish/index.d.ts.map +1 -0
- package/dist/client/shared/ui/form/FormCheckboxPublish/index.js +3 -0
- package/dist/client/shared/ui/form/FormCheckboxPublish/index.js.map +1 -0
- package/dist/client/shared/ui/form/FormSelect/FormSelect.d.ts +20 -0
- package/dist/client/shared/ui/form/FormSelect/FormSelect.d.ts.map +1 -0
- package/dist/client/shared/ui/form/FormSelect/FormSelect.js +88 -0
- package/dist/client/shared/ui/form/FormSelect/FormSelect.js.map +1 -0
- package/dist/client/shared/ui/form/FormSelect/FormSelect.jsx +44 -0
- package/dist/client/shared/ui/form/FormSelect/index.d.ts +2 -0
- package/dist/client/shared/ui/form/FormSelect/index.d.ts.map +1 -0
- package/dist/client/shared/ui/form/FormSelect/index.js +3 -0
- package/dist/client/shared/ui/form/FormSelect/index.js.map +1 -0
- package/dist/client/shared/ui/form/FormSelectLocale/FormSelectLocale.d.ts +12 -0
- package/dist/client/shared/ui/form/FormSelectLocale/FormSelectLocale.d.ts.map +1 -0
- package/dist/client/shared/ui/form/FormSelectLocale/FormSelectLocale.js +19 -0
- package/dist/client/shared/ui/form/FormSelectLocale/FormSelectLocale.js.map +1 -0
- package/dist/client/shared/ui/form/FormSelectLocale/FormSelectLocale.jsx +6 -0
- package/dist/client/shared/ui/form/FormSelectLocale/index.d.ts +2 -0
- package/dist/client/shared/ui/form/FormSelectLocale/index.d.ts.map +1 -0
- package/dist/client/shared/ui/form/FormSelectLocale/index.js +3 -0
- package/dist/client/shared/ui/form/FormSelectLocale/index.js.map +1 -0
- package/dist/client/shared/ui/form/FormSelectStrategy/FormSelectStrategy.d.ts +19 -0
- package/dist/client/shared/ui/form/FormSelectStrategy/FormSelectStrategy.d.ts.map +1 -0
- package/dist/client/shared/ui/form/FormSelectStrategy/FormSelectStrategy.js +59 -0
- package/dist/client/shared/ui/form/FormSelectStrategy/FormSelectStrategy.js.map +1 -0
- package/dist/client/shared/ui/form/FormSelectStrategy/FormSelectStrategy.jsx +25 -0
- package/dist/client/shared/ui/form/FormSelectStrategy/index.d.ts +3 -0
- package/dist/client/shared/ui/form/FormSelectStrategy/index.d.ts.map +1 -0
- package/dist/client/shared/ui/form/FormSelectStrategy/index.js +3 -0
- package/dist/client/shared/ui/form/FormSelectStrategy/index.js.map +1 -0
- package/dist/client/shared/utils/componentPath.d.ts +6 -0
- package/dist/client/shared/utils/componentPath.d.ts.map +1 -0
- package/dist/client/shared/utils/componentPath.js +9 -0
- package/dist/client/shared/utils/componentPath.js.map +1 -0
- package/dist/client/widgets/bulk-translation-dashboard/index.d.ts +2 -0
- package/dist/client/widgets/bulk-translation-dashboard/index.d.ts.map +1 -0
- package/dist/client/widgets/bulk-translation-dashboard/index.js +3 -0
- package/dist/client/widgets/bulk-translation-dashboard/index.js.map +1 -0
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.d.ts +6 -0
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.d.ts.map +1 -0
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.export.d.ts +9 -0
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.export.d.ts.map +1 -0
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.export.js +15 -0
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.export.js.map +1 -0
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.export.jsx +11 -0
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.js +78 -0
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.js.map +1 -0
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.jsx +55 -0
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.server.d.ts +8 -0
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.server.d.ts.map +1 -0
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.server.js +24 -0
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.server.js.map +1 -0
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.server.jsx +17 -0
- package/dist/client/widgets/bulk-translation-dashboard/ui/index.d.ts +2 -0
- package/dist/client/widgets/bulk-translation-dashboard/ui/index.d.ts.map +1 -0
- package/dist/client/widgets/bulk-translation-dashboard/ui/index.js +3 -0
- package/dist/client/widgets/bulk-translation-dashboard/ui/index.js.map +1 -0
- package/dist/client/widgets/translate-document/index.d.ts +2 -0
- package/dist/client/widgets/translate-document/index.d.ts.map +1 -0
- package/dist/client/widgets/translate-document/index.js +3 -0
- package/dist/client/widgets/translate-document/index.js.map +1 -0
- package/dist/client/widgets/translate-document/ui/TranslateDocument.d.ts +6 -0
- package/dist/client/widgets/translate-document/ui/TranslateDocument.d.ts.map +1 -0
- package/dist/client/widgets/translate-document/ui/TranslateDocument.export.d.ts +11 -0
- package/dist/client/widgets/translate-document/ui/TranslateDocument.export.d.ts.map +1 -0
- package/dist/client/widgets/translate-document/ui/TranslateDocument.export.js +18 -0
- package/dist/client/widgets/translate-document/ui/TranslateDocument.export.js.map +1 -0
- package/dist/client/widgets/translate-document/ui/TranslateDocument.js +87 -0
- package/dist/client/widgets/translate-document/ui/TranslateDocument.js.map +1 -0
- package/dist/client/widgets/translate-document/ui/TranslateDocument.jsx +55 -0
- package/dist/client/widgets/translate-document/ui/TranslateDocument.server.d.ts +9 -0
- package/dist/client/widgets/translate-document/ui/TranslateDocument.server.d.ts.map +1 -0
- package/dist/client/widgets/translate-document/ui/TranslateDocument.server.js +23 -0
- package/dist/client/widgets/translate-document/ui/TranslateDocument.server.js.map +1 -0
- package/dist/client/widgets/translate-document/ui/TranslateDocument.server.jsx +16 -0
- package/dist/client/widgets/translate-document/ui/index.d.ts +2 -0
- package/dist/client/widgets/translate-document/ui/index.d.ts.map +1 -0
- package/dist/client/widgets/translate-document/ui/index.js +3 -0
- package/dist/client/widgets/translate-document/ui/index.js.map +1 -0
- package/dist/field-config.d.ts +48 -0
- package/dist/field-config.d.ts.map +1 -0
- package/dist/field-config.js +49 -0
- package/dist/field-config.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +63 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +110 -0
- package/dist/plugin.js.map +1 -0
- package/dist/server/features/_lib/collection-utils.d.ts +10 -0
- package/dist/server/features/_lib/collection-utils.d.ts.map +1 -0
- package/dist/server/features/_lib/collection-utils.js +20 -0
- package/dist/server/features/_lib/collection-utils.js.map +1 -0
- package/dist/server/features/_lib/index.d.ts +2 -0
- package/dist/server/features/_lib/index.d.ts.map +1 -0
- package/dist/server/features/_lib/index.js +3 -0
- package/dist/server/features/_lib/index.js.map +1 -0
- package/dist/server/features/cancel/handler.d.ts +11 -0
- package/dist/server/features/cancel/handler.d.ts.map +1 -0
- package/dist/server/features/cancel/handler.js +20 -0
- package/dist/server/features/cancel/handler.js.map +1 -0
- package/dist/server/features/cancel/handler.test.d.ts +2 -0
- package/dist/server/features/cancel/handler.test.d.ts.map +1 -0
- package/dist/server/features/cancel/handler.test.js +63 -0
- package/dist/server/features/cancel/index.d.ts +2 -0
- package/dist/server/features/cancel/index.d.ts.map +1 -0
- package/dist/server/features/cancel/index.js +3 -0
- package/dist/server/features/cancel/index.js.map +1 -0
- package/dist/server/features/cancel/model.d.ts +12 -0
- package/dist/server/features/cancel/model.d.ts.map +1 -0
- package/dist/server/features/cancel/model.js +8 -0
- package/dist/server/features/cancel/model.js.map +1 -0
- package/dist/server/features/cancel/route.d.ts +8 -0
- package/dist/server/features/cancel/route.d.ts.map +1 -0
- package/dist/server/features/cancel/route.js +14 -0
- package/dist/server/features/cancel/route.js.map +1 -0
- package/dist/server/features/cancel-by-collection/handler.d.ts +13 -0
- package/dist/server/features/cancel-by-collection/handler.d.ts.map +1 -0
- package/dist/server/features/cancel-by-collection/handler.js +28 -0
- package/dist/server/features/cancel-by-collection/handler.js.map +1 -0
- package/dist/server/features/cancel-by-collection/handler.test.d.ts +2 -0
- package/dist/server/features/cancel-by-collection/handler.test.d.ts.map +1 -0
- package/dist/server/features/cancel-by-collection/handler.test.js +126 -0
- package/dist/server/features/cancel-by-collection/index.d.ts +2 -0
- package/dist/server/features/cancel-by-collection/index.d.ts.map +1 -0
- package/dist/server/features/cancel-by-collection/index.js +3 -0
- package/dist/server/features/cancel-by-collection/index.js.map +1 -0
- package/dist/server/features/cancel-by-collection/model.d.ts +19 -0
- package/dist/server/features/cancel-by-collection/model.d.ts.map +1 -0
- package/dist/server/features/cancel-by-collection/model.js +8 -0
- package/dist/server/features/cancel-by-collection/model.js.map +1 -0
- package/dist/server/features/cancel-by-collection/route.d.ts +9 -0
- package/dist/server/features/cancel-by-collection/route.d.ts.map +1 -0
- package/dist/server/features/cancel-by-collection/route.js +14 -0
- package/dist/server/features/cancel-by-collection/route.js.map +1 -0
- package/dist/server/features/enqueue-translation/handler.d.ts +13 -0
- package/dist/server/features/enqueue-translation/handler.d.ts.map +1 -0
- package/dist/server/features/enqueue-translation/handler.js +37 -0
- package/dist/server/features/enqueue-translation/handler.js.map +1 -0
- package/dist/server/features/enqueue-translation/handler.test.d.ts +2 -0
- package/dist/server/features/enqueue-translation/handler.test.d.ts.map +1 -0
- package/dist/server/features/enqueue-translation/handler.test.js +115 -0
- package/dist/server/features/enqueue-translation/index.d.ts +2 -0
- package/dist/server/features/enqueue-translation/index.d.ts.map +1 -0
- package/dist/server/features/enqueue-translation/index.js +3 -0
- package/dist/server/features/enqueue-translation/index.js.map +1 -0
- package/dist/server/features/enqueue-translation/model.d.ts +37 -0
- package/dist/server/features/enqueue-translation/model.d.ts.map +1 -0
- package/dist/server/features/enqueue-translation/model.js +17 -0
- package/dist/server/features/enqueue-translation/model.js.map +1 -0
- package/dist/server/features/enqueue-translation/route.d.ts +9 -0
- package/dist/server/features/enqueue-translation/route.d.ts.map +1 -0
- package/dist/server/features/enqueue-translation/route.js +14 -0
- package/dist/server/features/enqueue-translation/route.js.map +1 -0
- package/dist/server/features/get-collection-status/handler.d.ts +13 -0
- package/dist/server/features/get-collection-status/handler.d.ts.map +1 -0
- package/dist/server/features/get-collection-status/handler.js +29 -0
- package/dist/server/features/get-collection-status/handler.js.map +1 -0
- package/dist/server/features/get-collection-status/handler.test.d.ts +2 -0
- package/dist/server/features/get-collection-status/handler.test.d.ts.map +1 -0
- package/dist/server/features/get-collection-status/handler.test.js +108 -0
- package/dist/server/features/get-collection-status/index.d.ts +2 -0
- package/dist/server/features/get-collection-status/index.d.ts.map +1 -0
- package/dist/server/features/get-collection-status/index.js +3 -0
- package/dist/server/features/get-collection-status/index.js.map +1 -0
- package/dist/server/features/get-collection-status/model.d.ts +34 -0
- package/dist/server/features/get-collection-status/model.d.ts.map +1 -0
- package/dist/server/features/get-collection-status/model.js +8 -0
- package/dist/server/features/get-collection-status/model.js.map +1 -0
- package/dist/server/features/get-collection-status/route.d.ts +9 -0
- package/dist/server/features/get-collection-status/route.d.ts.map +1 -0
- package/dist/server/features/get-collection-status/route.js +14 -0
- package/dist/server/features/get-collection-status/route.js.map +1 -0
- package/dist/server/features/get-document-status/handler.d.ts +13 -0
- package/dist/server/features/get-document-status/handler.d.ts.map +1 -0
- package/dist/server/features/get-document-status/handler.js +27 -0
- package/dist/server/features/get-document-status/handler.js.map +1 -0
- package/dist/server/features/get-document-status/handler.test.d.ts +2 -0
- package/dist/server/features/get-document-status/handler.test.d.ts.map +1 -0
- package/dist/server/features/get-document-status/handler.test.js +138 -0
- package/dist/server/features/get-document-status/index.d.ts +3 -0
- package/dist/server/features/get-document-status/index.d.ts.map +1 -0
- package/dist/server/features/get-document-status/index.js +4 -0
- package/dist/server/features/get-document-status/index.js.map +1 -0
- package/dist/server/features/get-document-status/model.d.ts +59 -0
- package/dist/server/features/get-document-status/model.d.ts.map +1 -0
- package/dist/server/features/get-document-status/model.js +33 -0
- package/dist/server/features/get-document-status/model.js.map +1 -0
- package/dist/server/features/get-document-status/route.d.ts +9 -0
- package/dist/server/features/get-document-status/route.d.ts.map +1 -0
- package/dist/server/features/get-document-status/route.js +14 -0
- package/dist/server/features/get-document-status/route.js.map +1 -0
- package/dist/server/features/index.d.ts +7 -0
- package/dist/server/features/index.d.ts.map +1 -0
- package/dist/server/features/index.js +8 -0
- package/dist/server/features/index.js.map +1 -0
- package/dist/server/features/run-translation/handler.d.ts +11 -0
- package/dist/server/features/run-translation/handler.d.ts.map +1 -0
- package/dist/server/features/run-translation/handler.js +28 -0
- package/dist/server/features/run-translation/handler.js.map +1 -0
- package/dist/server/features/run-translation/handler.test.d.ts +2 -0
- package/dist/server/features/run-translation/handler.test.d.ts.map +1 -0
- package/dist/server/features/run-translation/handler.test.js +98 -0
- package/dist/server/features/run-translation/index.d.ts +2 -0
- package/dist/server/features/run-translation/index.d.ts.map +1 -0
- package/dist/server/features/run-translation/index.js +3 -0
- package/dist/server/features/run-translation/index.js.map +1 -0
- package/dist/server/features/run-translation/model.d.ts +12 -0
- package/dist/server/features/run-translation/model.d.ts.map +1 -0
- package/dist/server/features/run-translation/model.js +8 -0
- package/dist/server/features/run-translation/model.js.map +1 -0
- package/dist/server/features/run-translation/route.d.ts +8 -0
- package/dist/server/features/run-translation/route.d.ts.map +1 -0
- package/dist/server/features/run-translation/route.js +14 -0
- package/dist/server/features/run-translation/route.js.map +1 -0
- package/dist/server/features/translate-document/handler.d.ts +19 -0
- package/dist/server/features/translate-document/handler.d.ts.map +1 -0
- package/dist/server/features/translate-document/handler.js +69 -0
- package/dist/server/features/translate-document/handler.js.map +1 -0
- package/dist/server/features/translate-document/handler.test.d.ts +2 -0
- package/dist/server/features/translate-document/handler.test.d.ts.map +1 -0
- package/dist/server/features/translate-document/handler.test.js +171 -0
- package/dist/server/features/translate-document/index.d.ts +4 -0
- package/dist/server/features/translate-document/index.d.ts.map +1 -0
- package/dist/server/features/translate-document/index.js +4 -0
- package/dist/server/features/translate-document/index.js.map +1 -0
- package/dist/server/features/translate-document/model.d.ts +53 -0
- package/dist/server/features/translate-document/model.d.ts.map +1 -0
- package/dist/server/features/translate-document/model.js +30 -0
- package/dist/server/features/translate-document/model.js.map +1 -0
- package/dist/server/features/translate-document/task.d.ts +41 -0
- package/dist/server/features/translate-document/task.d.ts.map +1 -0
- package/dist/server/features/translate-document/task.js +44 -0
- package/dist/server/features/translate-document/task.js.map +1 -0
- package/dist/server/index.d.ts +4 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +5 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/modules/index.d.ts +3 -0
- package/dist/server/modules/index.d.ts.map +1 -0
- package/dist/server/modules/index.js +4 -0
- package/dist/server/modules/index.js.map +1 -0
- package/dist/server/modules/task-runner/TaskRunner.interface.d.ts +31 -0
- package/dist/server/modules/task-runner/TaskRunner.interface.d.ts.map +1 -0
- package/dist/server/modules/task-runner/TaskRunner.interface.js +10 -0
- package/dist/server/modules/task-runner/TaskRunner.interface.js.map +1 -0
- package/dist/server/modules/task-runner/TaskRunnerProvider.interface.d.ts +46 -0
- package/dist/server/modules/task-runner/TaskRunnerProvider.interface.d.ts.map +1 -0
- package/dist/server/modules/task-runner/TaskRunnerProvider.interface.js +11 -0
- package/dist/server/modules/task-runner/TaskRunnerProvider.interface.js.map +1 -0
- package/dist/server/modules/task-runner/index.d.ts +7 -0
- package/dist/server/modules/task-runner/index.d.ts.map +1 -0
- package/dist/server/modules/task-runner/index.js +4 -0
- package/dist/server/modules/task-runner/index.js.map +1 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/PayloadJobsRunnerProvider.d.ts +20 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/PayloadJobsRunnerProvider.d.ts.map +1 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/PayloadJobsRunnerProvider.js +128 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/PayloadJobsRunnerProvider.js.map +1 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/PayloadJobsTaskRunner.d.ts +31 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/PayloadJobsTaskRunner.d.ts.map +1 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/PayloadJobsTaskRunner.js +165 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/PayloadJobsTaskRunner.js.map +1 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/PayloadJobsTaskRunner.test.d.ts +2 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/PayloadJobsTaskRunner.test.d.ts.map +1 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/PayloadJobsTaskRunner.test.js +188 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/index.d.ts +3 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/index.d.ts.map +1 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/index.js +3 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/index.js.map +1 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/normalizeJob.d.ts +7 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/normalizeJob.d.ts.map +1 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/normalizeJob.js +40 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/normalizeJob.js.map +1 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/normalizeJob.test.d.ts +2 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/normalizeJob.test.d.ts.map +1 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/normalizeJob.test.js +169 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/types.d.ts +85 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/types.d.ts.map +1 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/types.js +5 -0
- package/dist/server/modules/task-runner/payload-jobs-runner/types.js.map +1 -0
- package/dist/server/modules/task-runner/sync-runner/SyncRunnerProvider.d.ts +25 -0
- package/dist/server/modules/task-runner/sync-runner/SyncRunnerProvider.d.ts.map +1 -0
- package/dist/server/modules/task-runner/sync-runner/SyncRunnerProvider.js +42 -0
- package/dist/server/modules/task-runner/sync-runner/SyncRunnerProvider.js.map +1 -0
- package/dist/server/modules/task-runner/sync-runner/SyncTaskRunner.d.ts +23 -0
- package/dist/server/modules/task-runner/sync-runner/SyncTaskRunner.d.ts.map +1 -0
- package/dist/server/modules/task-runner/sync-runner/SyncTaskRunner.js +72 -0
- package/dist/server/modules/task-runner/sync-runner/SyncTaskRunner.js.map +1 -0
- package/dist/server/modules/task-runner/sync-runner/SyncTaskRunner.test.d.ts +2 -0
- package/dist/server/modules/task-runner/sync-runner/SyncTaskRunner.test.d.ts.map +1 -0
- package/dist/server/modules/task-runner/sync-runner/SyncTaskRunner.test.js +148 -0
- package/dist/server/modules/task-runner/sync-runner/index.d.ts +2 -0
- package/dist/server/modules/task-runner/sync-runner/index.d.ts.map +1 -0
- package/dist/server/modules/task-runner/sync-runner/index.js +3 -0
- package/dist/server/modules/task-runner/sync-runner/index.js.map +1 -0
- package/dist/server/modules/task-runner/sync-runner/types.d.ts +18 -0
- package/dist/server/modules/task-runner/sync-runner/types.d.ts.map +1 -0
- package/dist/server/modules/task-runner/sync-runner/types.js +5 -0
- package/dist/server/modules/task-runner/sync-runner/types.js.map +1 -0
- package/dist/server/modules/task-runner/types.d.ts +41 -0
- package/dist/server/modules/task-runner/types.d.ts.map +1 -0
- package/dist/server/modules/task-runner/types.js +5 -0
- package/dist/server/modules/task-runner/types.js.map +1 -0
- package/dist/server/modules/translation-pipeline/TranslationPipeline.d.ts +35 -0
- package/dist/server/modules/translation-pipeline/TranslationPipeline.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/TranslationPipeline.js +55 -0
- package/dist/server/modules/translation-pipeline/TranslationPipeline.js.map +1 -0
- package/dist/server/modules/translation-pipeline/TranslationPipeline.test.d.ts +2 -0
- package/dist/server/modules/translation-pipeline/TranslationPipeline.test.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/TranslationPipeline.test.js +552 -0
- package/dist/server/modules/translation-pipeline/index.d.ts +4 -0
- package/dist/server/modules/translation-pipeline/index.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/index.js +4 -0
- package/dist/server/modules/translation-pipeline/index.js.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/data-reconciler/DataReconciler.d.ts +26 -0
- package/dist/server/modules/translation-pipeline/stages/data-reconciler/DataReconciler.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/data-reconciler/DataReconciler.js +97 -0
- package/dist/server/modules/translation-pipeline/stages/data-reconciler/DataReconciler.js.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/data-reconciler/DataReconciler.stage.d.ts +9 -0
- package/dist/server/modules/translation-pipeline/stages/data-reconciler/DataReconciler.stage.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/data-reconciler/DataReconciler.stage.js +15 -0
- package/dist/server/modules/translation-pipeline/stages/data-reconciler/DataReconciler.stage.js.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/data-reconciler/DataReconciler.test.d.ts +2 -0
- package/dist/server/modules/translation-pipeline/stages/data-reconciler/DataReconciler.test.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/data-reconciler/DataReconciler.test.js +294 -0
- package/dist/server/modules/translation-pipeline/stages/data-reconciler/index.d.ts +3 -0
- package/dist/server/modules/translation-pipeline/stages/data-reconciler/index.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/data-reconciler/index.js +4 -0
- package/dist/server/modules/translation-pipeline/stages/data-reconciler/index.js.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/field-collector/FieldChunkCollector.d.ts +35 -0
- package/dist/server/modules/translation-pipeline/stages/field-collector/FieldChunkCollector.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/field-collector/FieldChunkCollector.js +128 -0
- package/dist/server/modules/translation-pipeline/stages/field-collector/FieldChunkCollector.js.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/field-collector/FieldChunkCollector.stage.d.ts +13 -0
- package/dist/server/modules/translation-pipeline/stages/field-collector/FieldChunkCollector.stage.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/field-collector/FieldChunkCollector.stage.js +23 -0
- package/dist/server/modules/translation-pipeline/stages/field-collector/FieldChunkCollector.stage.js.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/field-collector/FieldChunkCollector.test.d.ts +2 -0
- package/dist/server/modules/translation-pipeline/stages/field-collector/FieldChunkCollector.test.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/field-collector/FieldChunkCollector.test.js +737 -0
- package/dist/server/modules/translation-pipeline/stages/field-collector/index.d.ts +3 -0
- package/dist/server/modules/translation-pipeline/stages/field-collector/index.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/field-collector/index.js +4 -0
- package/dist/server/modules/translation-pipeline/stages/field-collector/index.js.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/index.d.ts +7 -0
- package/dist/server/modules/translation-pipeline/stages/index.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/index.js +7 -0
- package/dist/server/modules/translation-pipeline/stages/index.js.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/PlainTextExpander.d.ts +10 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/PlainTextExpander.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/PlainTextExpander.js +28 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/PlainTextExpander.js.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/RichTextExpander.d.ts +10 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/RichTextExpander.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/RichTextExpander.js +32 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/RichTextExpander.js.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/TextChunkExpander.d.ts +24 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/TextChunkExpander.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/TextChunkExpander.js +34 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/TextChunkExpander.js.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/TextChunkExpander.stage.d.ts +11 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/TextChunkExpander.stage.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/TextChunkExpander.stage.js +29 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/TextChunkExpander.stage.js.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/TextChunkExpander.test.d.ts +2 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/TextChunkExpander.test.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/TextChunkExpander.test.js +396 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/TextExpander.interface.d.ts +27 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/TextExpander.interface.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/TextExpander.interface.js +6 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/TextExpander.interface.js.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/index.d.ts +7 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/index.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/index.js +6 -0
- package/dist/server/modules/translation-pipeline/stages/text-expander/index.js.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/translation/Translation.stage.d.ts +11 -0
- package/dist/server/modules/translation-pipeline/stages/translation/Translation.stage.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/translation/Translation.stage.js +23 -0
- package/dist/server/modules/translation-pipeline/stages/translation/Translation.stage.js.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/translation/index.d.ts +2 -0
- package/dist/server/modules/translation-pipeline/stages/translation/index.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/translation/index.js +3 -0
- package/dist/server/modules/translation-pipeline/stages/translation/index.js.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/translation-applicator/TranslationMutator.d.ts +18 -0
- package/dist/server/modules/translation-pipeline/stages/translation-applicator/TranslationMutator.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/translation-applicator/TranslationMutator.js +27 -0
- package/dist/server/modules/translation-pipeline/stages/translation-applicator/TranslationMutator.js.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/translation-applicator/TranslationMutator.stage.d.ts +8 -0
- package/dist/server/modules/translation-pipeline/stages/translation-applicator/TranslationMutator.stage.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/translation-applicator/TranslationMutator.stage.js +15 -0
- package/dist/server/modules/translation-pipeline/stages/translation-applicator/TranslationMutator.stage.js.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/translation-applicator/TranslationMutator.test.d.ts +2 -0
- package/dist/server/modules/translation-pipeline/stages/translation-applicator/TranslationMutator.test.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/translation-applicator/TranslationMutator.test.js +110 -0
- package/dist/server/modules/translation-pipeline/stages/translation-applicator/index.d.ts +3 -0
- package/dist/server/modules/translation-pipeline/stages/translation-applicator/index.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/stages/translation-applicator/index.js +4 -0
- package/dist/server/modules/translation-pipeline/stages/translation-applicator/index.js.map +1 -0
- package/dist/server/modules/translation-pipeline/strategies/Overwrite.strategy.d.ts +9 -0
- package/dist/server/modules/translation-pipeline/strategies/Overwrite.strategy.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/strategies/Overwrite.strategy.js +11 -0
- package/dist/server/modules/translation-pipeline/strategies/Overwrite.strategy.js.map +1 -0
- package/dist/server/modules/translation-pipeline/strategies/Overwrite.strategy.test.d.ts +2 -0
- package/dist/server/modules/translation-pipeline/strategies/Overwrite.strategy.test.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/strategies/Overwrite.strategy.test.js +36 -0
- package/dist/server/modules/translation-pipeline/strategies/SkipExisting.strategy.d.ts +10 -0
- package/dist/server/modules/translation-pipeline/strategies/SkipExisting.strategy.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/strategies/SkipExisting.strategy.js +19 -0
- package/dist/server/modules/translation-pipeline/strategies/SkipExisting.strategy.js.map +1 -0
- package/dist/server/modules/translation-pipeline/strategies/SkipExisting.strategy.test.d.ts +2 -0
- package/dist/server/modules/translation-pipeline/strategies/SkipExisting.strategy.test.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/strategies/SkipExisting.strategy.test.js +77 -0
- package/dist/server/modules/translation-pipeline/strategies/TranslationStrategy.interface.d.ts +22 -0
- package/dist/server/modules/translation-pipeline/strategies/TranslationStrategy.interface.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/strategies/TranslationStrategy.interface.js +10 -0
- package/dist/server/modules/translation-pipeline/strategies/TranslationStrategy.interface.js.map +1 -0
- package/dist/server/modules/translation-pipeline/strategies/index.d.ts +14 -0
- package/dist/server/modules/translation-pipeline/strategies/index.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/strategies/index.js +16 -0
- package/dist/server/modules/translation-pipeline/strategies/index.js.map +1 -0
- package/dist/server/modules/translation-pipeline/types/FieldChunk.d.ts +18 -0
- package/dist/server/modules/translation-pipeline/types/FieldChunk.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/types/FieldChunk.js +8 -0
- package/dist/server/modules/translation-pipeline/types/FieldChunk.js.map +1 -0
- package/dist/server/modules/translation-pipeline/types/Pipeline.d.ts +21 -0
- package/dist/server/modules/translation-pipeline/types/Pipeline.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/types/Pipeline.js +6 -0
- package/dist/server/modules/translation-pipeline/types/Pipeline.js.map +1 -0
- package/dist/server/modules/translation-pipeline/types/PipelineContext.d.ts +28 -0
- package/dist/server/modules/translation-pipeline/types/PipelineContext.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/types/PipelineContext.js +6 -0
- package/dist/server/modules/translation-pipeline/types/PipelineContext.js.map +1 -0
- package/dist/server/modules/translation-pipeline/types/TextChunk.d.ts +43 -0
- package/dist/server/modules/translation-pipeline/types/TextChunk.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/types/TextChunk.js +12 -0
- package/dist/server/modules/translation-pipeline/types/TextChunk.js.map +1 -0
- package/dist/server/modules/translation-pipeline/types/index.d.ts +6 -0
- package/dist/server/modules/translation-pipeline/types/index.d.ts.map +1 -0
- package/dist/server/modules/translation-pipeline/types/index.js +3 -0
- package/dist/server/modules/translation-pipeline/types/index.js.map +1 -0
- package/dist/server/modules/translation-providers/OpenAITranslation.provider.d.ts +128 -0
- package/dist/server/modules/translation-providers/OpenAITranslation.provider.d.ts.map +1 -0
- package/dist/server/modules/translation-providers/OpenAITranslation.provider.js +138 -0
- package/dist/server/modules/translation-providers/OpenAITranslation.provider.js.map +1 -0
- package/dist/server/modules/translation-providers/OpenAITranslation.provider.test.d.ts +2 -0
- package/dist/server/modules/translation-providers/OpenAITranslation.provider.test.d.ts.map +1 -0
- package/dist/server/modules/translation-providers/OpenAITranslation.provider.test.js +214 -0
- package/dist/server/modules/translation-providers/TranslationProvider.interface.d.ts +56 -0
- package/dist/server/modules/translation-providers/TranslationProvider.interface.d.ts.map +1 -0
- package/dist/server/modules/translation-providers/TranslationProvider.interface.js +26 -0
- package/dist/server/modules/translation-providers/TranslationProvider.interface.js.map +1 -0
- package/dist/server/modules/translation-providers/index.d.ts +3 -0
- package/dist/server/modules/translation-providers/index.d.ts.map +1 -0
- package/dist/server/modules/translation-providers/index.js +3 -0
- package/dist/server/modules/translation-providers/index.js.map +1 -0
- package/dist/server/shared/access/AnyAccessGuard.d.ts +8 -0
- package/dist/server/shared/access/AnyAccessGuard.d.ts.map +1 -0
- package/dist/server/shared/access/AnyAccessGuard.js +9 -0
- package/dist/server/shared/access/AnyAccessGuard.js.map +1 -0
- package/dist/server/shared/access/handler.d.ts +8 -0
- package/dist/server/shared/access/handler.d.ts.map +1 -0
- package/dist/server/shared/access/handler.js +5 -0
- package/dist/server/shared/access/handler.js.map +1 -0
- package/dist/server/shared/access/index.d.ts +4 -0
- package/dist/server/shared/access/index.d.ts.map +1 -0
- package/dist/server/shared/access/index.js +3 -0
- package/dist/server/shared/access/index.js.map +1 -0
- package/dist/server/shared/access/types.d.ts +2 -0
- package/dist/server/shared/access/types.d.ts.map +1 -0
- package/dist/server/shared/access/types.js +3 -0
- package/dist/server/shared/access/types.js.map +1 -0
- package/dist/server/shared/field-config/getFieldConfig.d.ts +21 -0
- package/dist/server/shared/field-config/getFieldConfig.d.ts.map +1 -0
- package/dist/server/shared/field-config/getFieldConfig.js +29 -0
- package/dist/server/shared/field-config/getFieldConfig.js.map +1 -0
- package/dist/server/shared/field-config/getFieldConfig.test.d.ts +2 -0
- package/dist/server/shared/field-config/getFieldConfig.test.d.ts.map +1 -0
- package/dist/server/shared/field-config/getFieldConfig.test.js +74 -0
- package/dist/server/shared/field-config/index.d.ts +4 -0
- package/dist/server/shared/field-config/index.d.ts.map +1 -0
- package/dist/server/shared/field-config/index.js +4 -0
- package/dist/server/shared/field-config/index.js.map +1 -0
- package/dist/server/shared/field-config/types.d.ts +39 -0
- package/dist/server/shared/field-config/types.d.ts.map +1 -0
- package/dist/server/shared/field-config/types.js +22 -0
- package/dist/server/shared/field-config/types.js.map +1 -0
- package/dist/server/shared/guards/collection-guards.d.ts +7 -0
- package/dist/server/shared/guards/collection-guards.d.ts.map +1 -0
- package/dist/server/shared/guards/collection-guards.js +16 -0
- package/dist/server/shared/guards/collection-guards.js.map +1 -0
- package/dist/server/shared/guards/field-guards.d.ts +37 -0
- package/dist/server/shared/guards/field-guards.d.ts.map +1 -0
- package/dist/server/shared/guards/field-guards.js +34 -0
- package/dist/server/shared/guards/field-guards.js.map +1 -0
- package/dist/server/shared/guards/field-guards.test.d.ts +2 -0
- package/dist/server/shared/guards/field-guards.test.d.ts.map +1 -0
- package/dist/server/shared/guards/field-guards.test.js +166 -0
- package/dist/server/shared/guards/index.d.ts +4 -0
- package/dist/server/shared/guards/index.d.ts.map +1 -0
- package/dist/server/shared/guards/index.js +4 -0
- package/dist/server/shared/guards/index.js.map +1 -0
- package/dist/server/shared/http/ServerResponse.d.ts +24 -0
- package/dist/server/shared/http/ServerResponse.d.ts.map +1 -0
- package/dist/server/shared/http/ServerResponse.js +165 -0
- package/dist/server/shared/http/ServerResponse.js.map +1 -0
- package/dist/server/shared/http/ServerResponse.test.d.ts +2 -0
- package/dist/server/shared/http/ServerResponse.test.d.ts.map +1 -0
- package/dist/server/shared/http/ServerResponse.test.js +161 -0
- package/dist/server/shared/http/index.d.ts +4 -0
- package/dist/server/shared/http/index.d.ts.map +1 -0
- package/dist/server/shared/http/index.js +5 -0
- package/dist/server/shared/http/index.js.map +1 -0
- package/dist/server/shared/http/withAccessCheck.d.ts +8 -0
- package/dist/server/shared/http/withAccessCheck.d.ts.map +1 -0
- package/dist/server/shared/http/withAccessCheck.js +16 -0
- package/dist/server/shared/http/withAccessCheck.js.map +1 -0
- package/dist/server/shared/http/withAccessCheck.test.d.ts +2 -0
- package/dist/server/shared/http/withAccessCheck.test.d.ts.map +1 -0
- package/dist/server/shared/http/withAccessCheck.test.js +46 -0
- package/dist/server/shared/http/withErrorHandler.d.ts +6 -0
- package/dist/server/shared/http/withErrorHandler.d.ts.map +1 -0
- package/dist/server/shared/http/withErrorHandler.js +23 -0
- package/dist/server/shared/http/withErrorHandler.js.map +1 -0
- package/dist/server/shared/http/withErrorHandler.test.d.ts +2 -0
- package/dist/server/shared/http/withErrorHandler.test.d.ts.map +1 -0
- package/dist/server/shared/http/withErrorHandler.test.js +69 -0
- package/dist/server/shared/index.d.ts +11 -0
- package/dist/server/shared/index.d.ts.map +1 -0
- package/dist/server/shared/index.js +13 -0
- package/dist/server/shared/index.js.map +1 -0
- package/dist/server/shared/lexical/collectTextNodes.d.ts +10 -0
- package/dist/server/shared/lexical/collectTextNodes.d.ts.map +1 -0
- package/dist/server/shared/lexical/collectTextNodes.js +31 -0
- package/dist/server/shared/lexical/collectTextNodes.js.map +1 -0
- package/dist/server/shared/lexical/collectTextNodes.test.d.ts +2 -0
- package/dist/server/shared/lexical/collectTextNodes.test.d.ts.map +1 -0
- package/dist/server/shared/lexical/collectTextNodes.test.js +120 -0
- package/dist/server/shared/lexical/guards.d.ts +20 -0
- package/dist/server/shared/lexical/guards.d.ts.map +1 -0
- package/dist/server/shared/lexical/guards.js +18 -0
- package/dist/server/shared/lexical/guards.js.map +1 -0
- package/dist/server/shared/lexical/guards.test.d.ts +2 -0
- package/dist/server/shared/lexical/guards.test.d.ts.map +1 -0
- package/dist/server/shared/lexical/guards.test.js +160 -0
- package/dist/server/shared/lexical/index.d.ts +7 -0
- package/dist/server/shared/lexical/index.d.ts.map +1 -0
- package/dist/server/shared/lexical/index.js +6 -0
- package/dist/server/shared/lexical/index.js.map +1 -0
- package/dist/server/shared/lexical/isEmptyRichText.d.ts +14 -0
- package/dist/server/shared/lexical/isEmptyRichText.d.ts.map +1 -0
- package/dist/server/shared/lexical/isEmptyRichText.js +31 -0
- package/dist/server/shared/lexical/isEmptyRichText.js.map +1 -0
- package/dist/server/shared/lexical/isEmptyRichText.test.d.ts +2 -0
- package/dist/server/shared/lexical/isEmptyRichText.test.d.ts.map +1 -0
- package/dist/server/shared/lexical/isEmptyRichText.test.js +251 -0
- package/dist/server/shared/lexical/traverseLexicalTree.d.ts +11 -0
- package/dist/server/shared/lexical/traverseLexicalTree.d.ts.map +1 -0
- package/dist/server/shared/lexical/traverseLexicalTree.js +19 -0
- package/dist/server/shared/lexical/traverseLexicalTree.js.map +1 -0
- package/dist/server/shared/lexical/traverseLexicalTree.test.d.ts +2 -0
- package/dist/server/shared/lexical/traverseLexicalTree.test.d.ts.map +1 -0
- package/dist/server/shared/lexical/traverseLexicalTree.test.js +112 -0
- package/dist/server/shared/lexical/types.d.ts +20 -0
- package/dist/server/shared/lexical/types.d.ts.map +1 -0
- package/dist/server/shared/lexical/types.js +8 -0
- package/dist/server/shared/lexical/types.js.map +1 -0
- package/dist/server/shared/utils/LazyMap.d.ts +71 -0
- package/dist/server/shared/utils/LazyMap.d.ts.map +1 -0
- package/dist/server/shared/utils/LazyMap.js +95 -0
- package/dist/server/shared/utils/LazyMap.js.map +1 -0
- package/dist/server/shared/utils/LazyMap.test.d.ts +2 -0
- package/dist/server/shared/utils/LazyMap.test.d.ts.map +1 -0
- package/dist/server/shared/utils/LazyMap.test.js +262 -0
- package/dist/server/shared/utils/filterLocalizedFields.d.ts +11 -0
- package/dist/server/shared/utils/filterLocalizedFields.d.ts.map +1 -0
- package/dist/server/shared/utils/filterLocalizedFields.js +72 -0
- package/dist/server/shared/utils/filterLocalizedFields.js.map +1 -0
- package/dist/server/shared/utils/filterLocalizedFields.test.d.ts +2 -0
- package/dist/server/shared/utils/filterLocalizedFields.test.d.ts.map +1 -0
- package/dist/server/shared/utils/filterLocalizedFields.test.js +338 -0
- package/dist/server/shared/utils/getByPath.d.ts +9 -0
- package/dist/server/shared/utils/getByPath.d.ts.map +1 -0
- package/dist/server/shared/utils/getByPath.js +18 -0
- package/dist/server/shared/utils/getByPath.js.map +1 -0
- package/dist/server/shared/utils/getByPath.test.d.ts +2 -0
- package/dist/server/shared/utils/getByPath.test.d.ts.map +1 -0
- package/dist/server/shared/utils/getByPath.test.js +33 -0
- package/dist/server/shared/utils/index.d.ts +10 -0
- package/dist/server/shared/utils/index.d.ts.map +1 -0
- package/dist/server/shared/utils/index.js +10 -0
- package/dist/server/shared/utils/index.js.map +1 -0
- package/dist/server/shared/utils/isEmpty.d.ts +9 -0
- package/dist/server/shared/utils/isEmpty.d.ts.map +1 -0
- package/dist/server/shared/utils/isEmpty.js +15 -0
- package/dist/server/shared/utils/isEmpty.js.map +1 -0
- package/dist/server/shared/utils/isEmpty.test.d.ts +2 -0
- package/dist/server/shared/utils/isEmpty.test.d.ts.map +1 -0
- package/dist/server/shared/utils/isEmpty.test.js +60 -0
- package/dist/server/shared/utils/isObject.d.ts +5 -0
- package/dist/server/shared/utils/isObject.d.ts.map +1 -0
- package/dist/server/shared/utils/isObject.js +7 -0
- package/dist/server/shared/utils/isObject.js.map +1 -0
- package/dist/server/shared/utils/isObject.test.d.ts +2 -0
- package/dist/server/shared/utils/isObject.test.d.ts.map +1 -0
- package/dist/server/shared/utils/isObject.test.js +57 -0
- package/dist/server/shared/utils/normalizePath.d.ts +16 -0
- package/dist/server/shared/utils/normalizePath.d.ts.map +1 -0
- package/dist/server/shared/utils/normalizePath.js +22 -0
- package/dist/server/shared/utils/normalizePath.js.map +1 -0
- package/dist/server/shared/utils/normalizePath.test.d.ts +2 -0
- package/dist/server/shared/utils/normalizePath.test.d.ts.map +1 -0
- package/dist/server/shared/utils/normalizePath.test.js +33 -0
- package/dist/server/shared/utils/pipe.d.ts +5 -0
- package/dist/server/shared/utils/pipe.d.ts.map +1 -0
- package/dist/server/shared/utils/pipe.js +5 -0
- package/dist/server/shared/utils/pipe.js.map +1 -0
- package/dist/server/shared/utils/pipe.test.d.ts +2 -0
- package/dist/server/shared/utils/pipe.test.d.ts.map +1 -0
- package/dist/server/shared/utils/pipe.test.js +55 -0
- package/dist/server/shared/utils/setByPath.d.ts +11 -0
- package/dist/server/shared/utils/setByPath.d.ts.map +1 -0
- package/dist/server/shared/utils/setByPath.js +26 -0
- package/dist/server/shared/utils/setByPath.js.map +1 -0
- package/dist/server/shared/utils/setByPath.test.d.ts +2 -0
- package/dist/server/shared/utils/setByPath.test.d.ts.map +1 -0
- package/dist/server/shared/utils/setByPath.test.js +46 -0
- package/dist/types/AccessGuard.d.ts +12 -0
- package/dist/types/AccessGuard.d.ts.map +1 -0
- package/dist/types/AccessGuard.js +3 -0
- package/dist/types/AccessGuard.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/vitest-env.d.js +3 -0
- package/dist/vitest-env.d.js.map +1 -0
- package/package.json +91 -0
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { TranslationProvider, TranslationInput, TranslationOutput } from './TranslationProvider.interface';
|
|
2
|
+
import { ChatModel } from 'openai/resources/index.mjs';
|
|
3
|
+
/**
|
|
4
|
+
* Function to transform text in dry run mode.
|
|
5
|
+
* Receives the original text and returns the transformed text.
|
|
6
|
+
*/
|
|
7
|
+
type DryRunTransformer = (text: string) => string | Promise<string>;
|
|
8
|
+
/**
|
|
9
|
+
* Configuration for dry run mode with custom transformer.
|
|
10
|
+
*/
|
|
11
|
+
export type DryRunConfig = {
|
|
12
|
+
/** Custom transformer function for text */
|
|
13
|
+
transform: DryRunTransformer;
|
|
14
|
+
/** Delay in milliseconds before returning mock translation (simulates API latency) */
|
|
15
|
+
timeout?: number;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Context passed to the system prompt builder function.
|
|
19
|
+
*/
|
|
20
|
+
export type SystemPromptContext = {
|
|
21
|
+
/** Source language code (e.g., 'en', 'de') */
|
|
22
|
+
sourceLang: string;
|
|
23
|
+
/** Target language code (e.g., 'fr', 'es') */
|
|
24
|
+
targetLang: string;
|
|
25
|
+
/** Default system prompt that can be extended or replaced */
|
|
26
|
+
defaultPrompt: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Function to build a custom system prompt for translation.
|
|
30
|
+
*/
|
|
31
|
+
type SystemPromptBuilder = (context: SystemPromptContext) => string;
|
|
32
|
+
export type OpenAIProviderConfig = {
|
|
33
|
+
apiKey: string;
|
|
34
|
+
/**
|
|
35
|
+
* OpenAI model to use for translation.
|
|
36
|
+
*
|
|
37
|
+
* @default 'gpt-4o'
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* model: 'gpt-4o-mini'
|
|
41
|
+
*/
|
|
42
|
+
model?: (string & {}) | ChatModel;
|
|
43
|
+
/**
|
|
44
|
+
* Custom system prompt builder for translation.
|
|
45
|
+
* Receives context with source/target languages and the default prompt.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // Add custom instructions
|
|
49
|
+
* systemPrompt: ({ sourceLang, targetLang, defaultPrompt }) =>
|
|
50
|
+
* `${defaultPrompt}\nUse formal language. Keep brand names unchanged.`
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* // Completely custom prompt
|
|
54
|
+
* systemPrompt: ({ sourceLang, targetLang }) =>
|
|
55
|
+
* `Translate JSON values from ${sourceLang} to ${targetLang}. Be concise.`
|
|
56
|
+
*/
|
|
57
|
+
systemPrompt?: SystemPromptBuilder;
|
|
58
|
+
/**
|
|
59
|
+
* When enabled, simulates translations without making actual API calls to OpenAI.
|
|
60
|
+
*
|
|
61
|
+
* - `true` — uses default transformer that reverses the text
|
|
62
|
+
* - `{ transform, timeout? }` — custom transformer with optional delay
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* // Default behavior (reverse text, no delay)
|
|
66
|
+
* dryRun: true
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* // Custom transformer with delay
|
|
70
|
+
* dryRun: {
|
|
71
|
+
* transform: (text) => `[TRANSLATED] ${text}`,
|
|
72
|
+
* timeout: 1000, // 1 second delay
|
|
73
|
+
* }
|
|
74
|
+
*
|
|
75
|
+
* @default false
|
|
76
|
+
*/
|
|
77
|
+
dryRun?: boolean | DryRunConfig;
|
|
78
|
+
};
|
|
79
|
+
/** @deprecated Use `createOpenAIProvider` function instead */
|
|
80
|
+
export declare class OpenAITranslationProvider implements TranslationProvider {
|
|
81
|
+
private readonly config;
|
|
82
|
+
private openAiClient;
|
|
83
|
+
constructor(config: OpenAIProviderConfig);
|
|
84
|
+
translate(content: TranslationInput, souceLng: string, targetLng: string): Promise<TranslationOutput | null>;
|
|
85
|
+
/**
|
|
86
|
+
* Builds the system prompt for translation.
|
|
87
|
+
*/
|
|
88
|
+
private buildSystemPrompt;
|
|
89
|
+
/**
|
|
90
|
+
* Returns the transformer function for dry run mode.
|
|
91
|
+
* If dryRun is an object with transform, returns it.
|
|
92
|
+
* If dryRun is true, returns the default transformer that reverses text.
|
|
93
|
+
*/
|
|
94
|
+
private getDryRunTransformer;
|
|
95
|
+
/**
|
|
96
|
+
* Returns the timeout for dry run mode.
|
|
97
|
+
* If dryRun is an object with timeout, returns it.
|
|
98
|
+
* Otherwise returns 0 (no delay).
|
|
99
|
+
*/
|
|
100
|
+
private getDryRunTimeout;
|
|
101
|
+
private createMockTranslation;
|
|
102
|
+
/**
|
|
103
|
+
* Recursively transforms the values of an object or array using the provided transformer function.
|
|
104
|
+
* @param obj The object or value to transform.
|
|
105
|
+
* @param transformer The function to apply to each value.
|
|
106
|
+
* @returns The transformed object, array, or value.
|
|
107
|
+
*/
|
|
108
|
+
private transformObjectValues;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Creates an OpenAI translation provider.
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```ts
|
|
115
|
+
* // Basic usage
|
|
116
|
+
* createOpenAIProvider({ apiKey: process.env.OPENAI_API_KEY })
|
|
117
|
+
*
|
|
118
|
+
* // With options
|
|
119
|
+
* createOpenAIProvider({
|
|
120
|
+
* apiKey: process.env.OPENAI_API_KEY,
|
|
121
|
+
* model: 'gpt-4o-mini',
|
|
122
|
+
* systemPrompt: ({ defaultPrompt }) => `${defaultPrompt}\nUse formal language.`,
|
|
123
|
+
* })
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
export declare function createOpenAIProvider(config: OpenAIProviderConfig): OpenAITranslationProvider;
|
|
127
|
+
export {};
|
|
128
|
+
//# sourceMappingURL=OpenAITranslation.provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import OpenAI from 'openai';
|
|
2
|
+
import { isObject } from '../../shared';
|
|
3
|
+
/** @deprecated Use `createOpenAIProvider` function instead */ export class OpenAITranslationProvider {
|
|
4
|
+
config;
|
|
5
|
+
openAiClient;
|
|
6
|
+
constructor(config){
|
|
7
|
+
this.config = config;
|
|
8
|
+
this.openAiClient = new OpenAI({
|
|
9
|
+
apiKey: config.apiKey
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
async translate(content, souceLng, targetLng) {
|
|
13
|
+
if (this.config.dryRun) {
|
|
14
|
+
console.info('[DRY RUN] Translation simulation:', {
|
|
15
|
+
content,
|
|
16
|
+
sourceLang: souceLng,
|
|
17
|
+
targetLang: targetLng,
|
|
18
|
+
provider: 'OpenAI'
|
|
19
|
+
});
|
|
20
|
+
const timeout = this.getDryRunTimeout();
|
|
21
|
+
if (timeout > 0) await new Promise((resolve)=>setTimeout(resolve, timeout));
|
|
22
|
+
const transformer = this.getDryRunTransformer();
|
|
23
|
+
return this.createMockTranslation(content, transformer);
|
|
24
|
+
}
|
|
25
|
+
const systemPrompt = this.buildSystemPrompt(souceLng, targetLng);
|
|
26
|
+
const chatCompletion = await this.openAiClient.chat.completions.create({
|
|
27
|
+
messages: [
|
|
28
|
+
{
|
|
29
|
+
role: 'system',
|
|
30
|
+
content: systemPrompt
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
role: 'user',
|
|
34
|
+
content: JSON.stringify(content)
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
model: this.config.model ?? 'gpt-4o',
|
|
38
|
+
temperature: 0,
|
|
39
|
+
top_p: 1,
|
|
40
|
+
frequency_penalty: 0,
|
|
41
|
+
presence_penalty: 0,
|
|
42
|
+
response_format: {
|
|
43
|
+
type: 'json_object'
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
const translatedContent = chatCompletion.choices[0].message.content;
|
|
47
|
+
if (!translatedContent) return null;
|
|
48
|
+
try {
|
|
49
|
+
return JSON.parse(translatedContent);
|
|
50
|
+
} catch {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Builds the system prompt for translation.
|
|
56
|
+
*/ buildSystemPrompt(sourceLang, targetLang) {
|
|
57
|
+
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.
|
|
58
|
+
The response should be a valid JSON object with the same structure and keys as the input, but with translated values.
|
|
59
|
+
Maintain any special formatting, placeholders, or variables within the values if they exist.`;
|
|
60
|
+
if (this.config.systemPrompt) {
|
|
61
|
+
return this.config.systemPrompt({
|
|
62
|
+
sourceLang,
|
|
63
|
+
targetLang,
|
|
64
|
+
defaultPrompt
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return defaultPrompt;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Returns the transformer function for dry run mode.
|
|
71
|
+
* If dryRun is an object with transform, returns it.
|
|
72
|
+
* If dryRun is true, returns the default transformer that reverses text.
|
|
73
|
+
*/ getDryRunTransformer() {
|
|
74
|
+
if (typeof this.config.dryRun === 'object' && this.config.dryRun.transform) {
|
|
75
|
+
return this.config.dryRun.transform;
|
|
76
|
+
}
|
|
77
|
+
return (text)=>text.split('').reverse().join('');
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Returns the timeout for dry run mode.
|
|
81
|
+
* If dryRun is an object with timeout, returns it.
|
|
82
|
+
* Otherwise returns 0 (no delay).
|
|
83
|
+
*/ getDryRunTimeout() {
|
|
84
|
+
if (typeof this.config.dryRun === 'object' && this.config.dryRun.timeout) {
|
|
85
|
+
return this.config.dryRun.timeout;
|
|
86
|
+
}
|
|
87
|
+
return 0;
|
|
88
|
+
}
|
|
89
|
+
async createMockTranslation(content, transformer) {
|
|
90
|
+
try {
|
|
91
|
+
const mockTranslation = await this.transformObjectValues(content, async (value)=>{
|
|
92
|
+
if (typeof value === 'string' && value.trim()) return transformer(value);
|
|
93
|
+
return value;
|
|
94
|
+
});
|
|
95
|
+
return mockTranslation;
|
|
96
|
+
} catch {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Recursively transforms the values of an object or array using the provided transformer function.
|
|
102
|
+
* @param obj The object or value to transform.
|
|
103
|
+
* @param transformer The function to apply to each value.
|
|
104
|
+
* @returns The transformed object, array, or value.
|
|
105
|
+
*/ async transformObjectValues(obj, transformer) {
|
|
106
|
+
if (Array.isArray(obj)) {
|
|
107
|
+
return Promise.all(obj.map((item)=>this.transformObjectValues(item, transformer)));
|
|
108
|
+
}
|
|
109
|
+
if (isObject(obj)) {
|
|
110
|
+
const result = {};
|
|
111
|
+
for (const [key, value] of Object.entries(obj)){
|
|
112
|
+
result[key] = await this.transformObjectValues(value, transformer);
|
|
113
|
+
}
|
|
114
|
+
return result;
|
|
115
|
+
}
|
|
116
|
+
return transformer(obj);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Creates an OpenAI translation provider.
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```ts
|
|
124
|
+
* // Basic usage
|
|
125
|
+
* createOpenAIProvider({ apiKey: process.env.OPENAI_API_KEY })
|
|
126
|
+
*
|
|
127
|
+
* // With options
|
|
128
|
+
* createOpenAIProvider({
|
|
129
|
+
* apiKey: process.env.OPENAI_API_KEY,
|
|
130
|
+
* model: 'gpt-4o-mini',
|
|
131
|
+
* systemPrompt: ({ defaultPrompt }) => `${defaultPrompt}\nUse formal language.`,
|
|
132
|
+
* })
|
|
133
|
+
* ```
|
|
134
|
+
*/ export function createOpenAIProvider(config) {
|
|
135
|
+
return new OpenAITranslationProvider(config);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
//# sourceMappingURL=OpenAITranslation.provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenAITranslation.provider.test.d.ts","sourceRoot":"","sources":["../../../../src/server/modules/translation-providers/OpenAITranslation.provider.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,214 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Numeric index used as key in translation input and output.
|
|
3
|
+
* Represents the position of text in the original document structure.
|
|
4
|
+
*/
|
|
5
|
+
export type TranslationIndex = number;
|
|
6
|
+
/**
|
|
7
|
+
* Input map of text content for translation.
|
|
8
|
+
* Keys are numeric indices that must be preserved in the output.
|
|
9
|
+
* Values are the text strings to translate.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* { 0: "Hello", 1: "World", 2: "Welcome to our site" }
|
|
13
|
+
*/
|
|
14
|
+
export type TranslationInput = Record<TranslationIndex, string>;
|
|
15
|
+
/**
|
|
16
|
+
* Output of translation operation.
|
|
17
|
+
* Must have the same keys as input, with translated values.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* // Input: { 0: "Hello", 1: "World" }
|
|
21
|
+
* // Output: { 0: "Привет", 1: "Мир" }
|
|
22
|
+
*/
|
|
23
|
+
export type TranslationOutput = Record<TranslationIndex, string>;
|
|
24
|
+
/**
|
|
25
|
+
* Interface for translation service providers.
|
|
26
|
+
*
|
|
27
|
+
* Implementations must:
|
|
28
|
+
* - Preserve all numeric keys from input
|
|
29
|
+
* - Return translated text values for each key
|
|
30
|
+
* - Return null on translation failure
|
|
31
|
+
* - Handle empty input gracefully
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* class MyProvider implements TranslationProvider {
|
|
36
|
+
* async translate(input, sourceLng, targetLng) {
|
|
37
|
+
* // Input: { 0: "Hello", 1: "World" }
|
|
38
|
+
* // Output: { 0: "Bonjour", 1: "Monde" }
|
|
39
|
+
* const output = await myTranslationAPI.translate(input, targetLng)
|
|
40
|
+
* return output
|
|
41
|
+
* }
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export interface TranslationProvider {
|
|
46
|
+
/**
|
|
47
|
+
* Translates indexed text content from source to target language.
|
|
48
|
+
*
|
|
49
|
+
* @param input - Map of index to text string. Keys must be preserved in output.
|
|
50
|
+
* @param sourceLng - Source language code (e.g., 'en', 'de'). May be empty for auto-detect.
|
|
51
|
+
* @param targetLng - Target language code (e.g., 'fr', 'es').
|
|
52
|
+
* @returns Translated output with same keys, or null on failure.
|
|
53
|
+
*/
|
|
54
|
+
translate(input: TranslationInput, sourceLng: string, targetLng: string): Promise<TranslationOutput | null>;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=TranslationProvider.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Numeric index used as key in translation input and output.
|
|
3
|
+
* Represents the position of text in the original document structure.
|
|
4
|
+
*/ /**
|
|
5
|
+
* Interface for translation service providers.
|
|
6
|
+
*
|
|
7
|
+
* Implementations must:
|
|
8
|
+
* - Preserve all numeric keys from input
|
|
9
|
+
* - Return translated text values for each key
|
|
10
|
+
* - Return null on translation failure
|
|
11
|
+
* - Handle empty input gracefully
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* class MyProvider implements TranslationProvider {
|
|
16
|
+
* async translate(input, sourceLng, targetLng) {
|
|
17
|
+
* // Input: { 0: "Hello", 1: "World" }
|
|
18
|
+
* // Output: { 0: "Bonjour", 1: "Monde" }
|
|
19
|
+
* const output = await myTranslationAPI.translate(input, targetLng)
|
|
20
|
+
* return output
|
|
21
|
+
* }
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/ export { };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=TranslationProvider.interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { TranslationProvider, TranslationInput, TranslationOutput, TranslationIndex, } from './TranslationProvider.interface';
|
|
2
|
+
export { OpenAITranslationProvider, createOpenAIProvider, type OpenAIProviderConfig, type DryRunConfig, type SystemPromptContext, } from './OpenAITranslation.provider';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|