@focus-reactive/payload-plugin-translator 0.6.1 → 0.7.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/README.md +55 -0
- package/dist/client/app/cache/CacheProvider.d.ts +1 -1
- package/dist/client/app/cache/CacheProvider.export.d.ts +1 -1
- package/dist/client/app/cache/CacheProvider.export.js +2 -2
- package/dist/client/app/cache/CacheProvider.js +5 -5
- package/dist/client/app/config/TranslateKitConfigContext.d.ts +1 -1
- package/dist/client/app/config/TranslateKitConfigContext.js +3 -3
- package/dist/client/app/config/index.d.ts +2 -2
- package/dist/client/app/config/index.js +1 -1
- package/dist/client/entities/translation/api/mutations/useCancelCollectionTranslations.js +7 -7
- package/dist/client/entities/translation/api/mutations/useCancelDocumentTranslation.js +7 -7
- package/dist/client/entities/translation/api/mutations/useQueueDocumentTranslation.d.ts +1 -1
- package/dist/client/entities/translation/api/mutations/useQueueDocumentTranslation.js +8 -8
- package/dist/client/entities/translation/api/mutations/useQueueDocumentTranslations.js +6 -6
- package/dist/client/entities/translation/api/mutations/useRunDocumentTranslation.js +7 -7
- package/dist/client/entities/translation/api/mutations/useTranslateField.d.ts +1 -1
- package/dist/client/entities/translation/api/queries/useCollectionTranslationStatus.d.ts +2 -2
- package/dist/client/entities/translation/api/queries/useCollectionTranslationStatus.js +9 -10
- package/dist/client/entities/translation/api/queries/useDocumentTranslation.d.ts +2 -2
- package/dist/client/entities/translation/api/queries/useDocumentTranslation.js +9 -10
- package/dist/client/entities/translation/index.d.ts +12 -12
- package/dist/client/entities/translation/index.js +11 -11
- package/dist/client/entities/translation/model/types.d.ts +1 -1
- package/dist/client/entities/translation/ui/CompletedTranslationStatus/CompletedTranslationStatus.js +12 -12
- package/dist/client/entities/translation/ui/CompletedTranslationStatus/index.d.ts +1 -1
- package/dist/client/entities/translation/ui/CompletedTranslationStatus/index.js +1 -1
- package/dist/client/entities/translation/ui/CompletedTranslationStatus/styles.module.scss +1 -1
- package/dist/client/entities/translation/ui/FailedTranslationStatus/FailedTranslationStatus.js +8 -8
- package/dist/client/entities/translation/ui/FailedTranslationStatus/index.d.ts +1 -1
- package/dist/client/entities/translation/ui/FailedTranslationStatus/index.js +1 -1
- package/dist/client/entities/translation/ui/FailedTranslationStatus/styles.module.scss +1 -1
- package/dist/client/entities/translation/ui/PendingTranslationStatus/PendingTranslationStatus.js +14 -14
- package/dist/client/entities/translation/ui/PendingTranslationStatus/index.d.ts +1 -1
- package/dist/client/entities/translation/ui/PendingTranslationStatus/index.js +1 -1
- package/dist/client/entities/translation/ui/RunningTranslationStatus/RunningTranslationStatus.js +13 -13
- package/dist/client/entities/translation/ui/RunningTranslationStatus/index.d.ts +1 -1
- package/dist/client/entities/translation/ui/RunningTranslationStatus/index.js +1 -1
- package/dist/client/entities/translation/ui/TranslationDirection/TranslationDirection.d.ts +1 -1
- package/dist/client/entities/translation/ui/TranslationDirection/TranslationDirection.js +2 -2
- package/dist/client/entities/translation/ui/TranslationDirection/index.d.ts +1 -1
- package/dist/client/entities/translation/ui/TranslationDirection/index.js +1 -1
- package/dist/client/entities/translation/ui/TranslationDirection/styles.module.scss +1 -1
- package/dist/client/features/collection-translation-form/index.client.d.ts +1 -1
- package/dist/client/features/collection-translation-form/index.client.js +1 -1
- package/dist/client/features/collection-translation-form/index.d.ts +3 -3
- package/dist/client/features/collection-translation-form/index.js +2 -2
- package/dist/client/features/collection-translation-form/model/constants.d.ts +1 -1
- package/dist/client/features/collection-translation-form/model/constants.js +9 -9
- package/dist/client/features/collection-translation-form/model/form-model.d.ts +1 -1
- package/dist/client/features/collection-translation-form/model/index.d.ts +1 -1
- package/dist/client/features/collection-translation-form/model/index.js +1 -1
- package/dist/client/features/collection-translation-form/model/schema.d.ts +1 -1
- package/dist/client/features/collection-translation-form/model/schema.js +6 -6
- package/dist/client/features/collection-translation-form/ui/CollectionTranslationForm.d.ts +1 -1
- package/dist/client/features/collection-translation-form/ui/index.d.ts +1 -1
- package/dist/client/features/collection-translation-form/ui/index.js +1 -1
- package/dist/client/features/collection-translation-form/ui/styles.module.scss +1 -1
- package/dist/client/features/collection-translation-popup/index.d.ts +1 -1
- package/dist/client/features/collection-translation-popup/index.js +1 -1
- package/dist/client/features/collection-translation-popup/ui/CollectionTranslationPopup.d.ts +1 -1
- package/dist/client/features/collection-translation-popup/ui/styles.module.scss +1 -1
- package/dist/client/features/collection-translation-progress/index.d.ts +1 -1
- package/dist/client/features/collection-translation-progress/index.js +1 -1
- package/dist/client/features/collection-translation-progress/ui/CollectionTranslationProgress.d.ts +2 -2
- package/dist/client/features/collection-translation-progress/ui/CollectionTranslationProgress.js +13 -13
- package/dist/client/features/collection-translation-progress/ui/styles.module.scss +1 -1
- package/dist/client/features/document-translation-progress-failed/index.d.ts +1 -1
- package/dist/client/features/document-translation-progress-failed/index.js +1 -1
- package/dist/client/features/document-translation-progress-failed/ui/DocumentTranslationProgressFailed.d.ts +2 -2
- package/dist/client/features/document-translation-progress-failed/ui/DocumentTranslationProgressFailed.js +3 -3
- package/dist/client/features/document-translation-progress-pending/index.d.ts +1 -1
- package/dist/client/features/document-translation-progress-pending/index.js +1 -1
- package/dist/client/features/document-translation-progress-pending/ui/DocumentTranslationProgressPending.d.ts +2 -2
- package/dist/client/features/document-translation-progress-pending/ui/DocumentTranslationProgressPending.js +5 -5
- package/dist/client/features/document-translation-progress-running/index.d.ts +1 -1
- package/dist/client/features/document-translation-progress-running/index.js +1 -1
- package/dist/client/features/document-translation-progress-running/ui/DocumentTranslationProgressRunning.d.ts +2 -2
- package/dist/client/features/document-translation-progress-running/ui/DocumentTranslationProgressRunning.js +3 -3
- package/dist/client/features/open-document-translation-popup/index.d.ts +1 -1
- package/dist/client/features/open-document-translation-popup/index.js +1 -1
- package/dist/client/features/open-document-translation-popup/ui/styles.module.scss +1 -1
- package/dist/client/features/translate-document-form/index.client.d.ts +1 -1
- package/dist/client/features/translate-document-form/index.client.js +1 -1
- package/dist/client/features/translate-document-form/index.d.ts +3 -3
- package/dist/client/features/translate-document-form/index.js +2 -2
- package/dist/client/features/translate-document-form/model/constants.d.ts +1 -1
- package/dist/client/features/translate-document-form/model/constants.js +11 -11
- package/dist/client/features/translate-document-form/model/form-model.d.ts +1 -1
- package/dist/client/features/translate-document-form/model/index.d.ts +1 -1
- package/dist/client/features/translate-document-form/model/index.js +1 -1
- package/dist/client/features/translate-document-form/model/schema.d.ts +1 -1
- package/dist/client/features/translate-document-form/model/schema.js +5 -5
- package/dist/client/features/translate-document-form/ui/DocumentTranslationForm.d.ts +1 -1
- package/dist/client/features/translate-document-form/ui/index.d.ts +1 -1
- package/dist/client/features/translate-document-form/ui/index.js +1 -1
- package/dist/client/features/translate-document-form/ui/styles.module.scss +1 -1
- package/dist/client/shared/lib/errors/handleApiError.d.ts +1 -1
- package/dist/client/shared/lib/errors/handleApiError.js +2 -2
- package/dist/client/shared/lib/forms/handle-form-error.d.ts +1 -1
- package/dist/client/shared/lib/forms/handle-form-error.js +6 -6
- package/dist/client/shared/lib/payload/hooks/useCollectionDashboardUrlParams.d.ts +1 -1
- package/dist/client/shared/lib/payload/hooks/useCollectionDashboardUrlParams.js +1 -1
- package/dist/client/shared/lib/payload/hooks/useCollectionDocumentUrlParams.d.ts +1 -1
- package/dist/client/shared/lib/payload/hooks/useCollectionDocumentUrlParams.js +2 -2
- package/dist/client/shared/lib/payload/hooks/useLocaleOptions.js +2 -2
- package/dist/client/shared/lib/utils/errors/handleApiError.d.ts +1 -1
- package/dist/client/shared/lib/utils/errors/handleApiError.js +2 -2
- package/dist/client/shared/lib/utils/react/useToggle.js +1 -1
- package/dist/client/shared/providers/CacheClientProvider/CacheClientProvider.factory.d.ts +2 -2
- package/dist/client/shared/providers/CacheClientProvider/CacheClientProvider.factory.js +3 -3
- package/dist/client/shared/providers/CacheClientProvider/index.d.ts +1 -1
- package/dist/client/shared/providers/CacheClientProvider/index.js +1 -1
- package/dist/client/shared/types/AccessGuard.d.ts +1 -1
- package/dist/client/shared/ui/Alert/Alert.d.ts +2 -2
- package/dist/client/shared/ui/Alert/Alert.js +18 -18
- package/dist/client/shared/ui/Alert/index.d.ts +1 -1
- package/dist/client/shared/ui/Alert/index.js +1 -1
- package/dist/client/shared/ui/Alert/styles.module.scss +1 -1
- package/dist/client/shared/ui/Button/index.d.ts +1 -1
- package/dist/client/shared/ui/Button/index.js +1 -1
- package/dist/client/shared/ui/Button/styles.module.scss +6 -3
- package/dist/client/shared/ui/Checkbox/Checkbox.d.ts +2 -2
- package/dist/client/shared/ui/Checkbox/Checkbox.js +4 -4
- package/dist/client/shared/ui/Checkbox/index.d.ts +1 -1
- package/dist/client/shared/ui/Checkbox/index.js +1 -1
- package/dist/client/shared/ui/Checkbox/styles.module.scss +1 -1
- package/dist/client/shared/ui/ColorIndicator/ColorIndicator.d.ts +2 -2
- package/dist/client/shared/ui/ColorIndicator/ColorIndicator.js +2 -2
- package/dist/client/shared/ui/ColorIndicator/index.d.ts +1 -1
- package/dist/client/shared/ui/ColorIndicator/index.js +1 -1
- package/dist/client/shared/ui/ColorIndicator/styles.module.scss +1 -1
- package/dist/client/shared/ui/Description/Description.d.ts +3 -3
- package/dist/client/shared/ui/Description/Description.js +4 -4
- package/dist/client/shared/ui/Description/index.d.ts +1 -1
- package/dist/client/shared/ui/Description/index.js +1 -1
- package/dist/client/shared/ui/Description/styles.module.scss +1 -1
- package/dist/client/shared/ui/Divider/Divider.d.ts +4 -4
- package/dist/client/shared/ui/Divider/Divider.js +4 -4
- package/dist/client/shared/ui/Divider/index.d.ts +1 -1
- package/dist/client/shared/ui/Divider/index.js +1 -1
- package/dist/client/shared/ui/Divider/styles.module.scss +1 -1
- package/dist/client/shared/ui/Label/Label.d.ts +2 -2
- package/dist/client/shared/ui/Label/Label.js +3 -3
- package/dist/client/shared/ui/Label/index.d.ts +1 -1
- package/dist/client/shared/ui/Label/index.js +1 -1
- package/dist/client/shared/ui/Label/styles.module.scss +1 -1
- package/dist/client/shared/ui/Loading/Loading.d.ts +1 -1
- package/dist/client/shared/ui/Loading/Loading.js +9 -9
- package/dist/client/shared/ui/Loading/index.d.ts +1 -1
- package/dist/client/shared/ui/Loading/index.js +1 -1
- package/dist/client/shared/ui/Loading/styles.module.scss +2 -2
- package/dist/client/shared/ui/Popup/Popup.d.ts +1 -1
- package/dist/client/shared/ui/Popup/index.d.ts +1 -1
- package/dist/client/shared/ui/Popup/index.js +1 -1
- package/dist/client/shared/ui/Popup/styles.module.scss +1 -1
- package/dist/client/shared/ui/ProgressBar/ProgressBar.d.ts +2 -2
- package/dist/client/shared/ui/ProgressBar/ProgressBar.js +3 -3
- package/dist/client/shared/ui/ProgressBar/index.d.ts +1 -1
- package/dist/client/shared/ui/ProgressBar/index.js +1 -1
- package/dist/client/shared/ui/ProgressBar/styles.module.scss +1 -1
- package/dist/client/shared/ui/Select/index.d.ts +1 -1
- package/dist/client/shared/ui/Select/index.js +1 -1
- package/dist/client/shared/ui/Select/styles.module.scss +1 -1
- package/dist/client/shared/ui/StatusCounter/StatusCounter.d.ts +2 -2
- package/dist/client/shared/ui/StatusCounter/StatusCounter.js +13 -13
- package/dist/client/shared/ui/StatusCounter/index.d.ts +1 -1
- package/dist/client/shared/ui/StatusCounter/index.js +1 -1
- package/dist/client/shared/ui/StatusCounter/styles.module.scss +1 -1
- package/dist/client/shared/ui/StatusIndicator/StatusIndicator.d.ts +3 -3
- package/dist/client/shared/ui/StatusIndicator/StatusIndicator.js +4 -4
- package/dist/client/shared/ui/StatusIndicator/index.d.ts +1 -1
- package/dist/client/shared/ui/StatusIndicator/index.js +1 -1
- package/dist/client/shared/ui/StatusIndicator/styles.module.scss +1 -1
- package/dist/client/shared/ui/Tooltip/Tooltip.d.ts +2 -2
- package/dist/client/shared/ui/Tooltip/Tooltip.js +4 -4
- package/dist/client/shared/ui/Tooltip/index.d.ts +1 -1
- package/dist/client/shared/ui/Tooltip/index.js +1 -1
- package/dist/client/shared/ui/Tooltip/styles.module.scss +5 -5
- package/dist/client/shared/ui/form/FormCheckbox/FormCheckbox.d.ts +1 -1
- package/dist/client/shared/ui/form/FormCheckbox/FormCheckbox.js +6 -6
- package/dist/client/shared/ui/form/FormCheckbox/index.d.ts +1 -1
- package/dist/client/shared/ui/form/FormCheckbox/index.js +1 -1
- package/dist/client/shared/ui/form/FormCheckbox/styles.module.scss +1 -1
- package/dist/client/shared/ui/form/FormCheckboxPublish/FormCheckboxPublish.js +5 -5
- package/dist/client/shared/ui/form/FormCheckboxPublish/index.d.ts +1 -1
- package/dist/client/shared/ui/form/FormCheckboxPublish/index.js +1 -1
- package/dist/client/shared/ui/form/FormCheckboxPublish/styles.module.scss +1 -1
- package/dist/client/shared/ui/form/FormSelect/FormSelect.d.ts +5 -5
- package/dist/client/shared/ui/form/FormSelect/FormSelect.js +9 -9
- package/dist/client/shared/ui/form/FormSelect/index.d.ts +1 -1
- package/dist/client/shared/ui/form/FormSelect/index.js +1 -1
- package/dist/client/shared/ui/form/FormSelectLocale/FormSelectLocale.d.ts +1 -1
- package/dist/client/shared/ui/form/FormSelectLocale/FormSelectLocale.js +2 -2
- package/dist/client/shared/ui/form/FormSelectLocale/index.d.ts +1 -1
- package/dist/client/shared/ui/form/FormSelectLocale/index.js +1 -1
- package/dist/client/shared/ui/form/FormSelectStrategy/FormSelectStrategy.d.ts +2 -2
- package/dist/client/shared/ui/form/FormSelectStrategy/FormSelectStrategy.js +9 -9
- package/dist/client/shared/ui/form/FormSelectStrategy/index.d.ts +2 -2
- package/dist/client/shared/ui/form/FormSelectStrategy/index.js +1 -1
- package/dist/client/shared/ui/form/FormSelectStrategy/styles.module.scss +1 -1
- package/dist/client/shared/utils/componentPath.js +1 -1
- package/dist/client/widgets/bulk-translation-dashboard/index.d.ts +1 -1
- package/dist/client/widgets/bulk-translation-dashboard/index.js +1 -1
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.export.d.ts +2 -2
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.export.js +3 -3
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.js +11 -11
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.server.d.ts +2 -2
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.server.js +3 -3
- package/dist/client/widgets/bulk-translation-dashboard/ui/index.d.ts +1 -1
- package/dist/client/widgets/bulk-translation-dashboard/ui/index.js +1 -1
- package/dist/client/widgets/translate-document/index.d.ts +1 -1
- package/dist/client/widgets/translate-document/index.js +1 -1
- package/dist/client/widgets/translate-document/ui/TranslateDocument.export.d.ts +3 -3
- package/dist/client/widgets/translate-document/ui/TranslateDocument.export.js +3 -3
- package/dist/client/widgets/translate-document/ui/TranslateDocument.js +16 -16
- package/dist/client/widgets/translate-document/ui/TranslateDocument.server.d.ts +2 -2
- package/dist/client/widgets/translate-document/ui/TranslateDocument.server.js +3 -3
- package/dist/client/widgets/translate-document/ui/index.d.ts +1 -1
- package/dist/client/widgets/translate-document/ui/index.js +1 -1
- package/dist/client/widgets/translate-field-control/ui/TranslateFieldControl.export.d.ts +1 -1
- package/dist/client/widgets/translate-field-control/ui/styles.module.scss +1 -1
- package/dist/{server/modules/translation-levels → composition/levels}/collectionLevel.d.ts +1 -1
- package/dist/{server/modules/translation-levels → composition/levels}/collectionLevel.js +1 -1
- package/dist/{server/modules/translation-levels → composition/levels}/documentLevel.d.ts +1 -1
- package/dist/{server/modules/translation-levels → composition/levels}/documentLevel.js +1 -1
- package/dist/{server/modules/translation-levels → composition/levels}/fieldLevel.d.ts +1 -1
- package/dist/{server/modules/translation-levels → composition/levels}/fieldLevel.js +1 -1
- package/dist/composition/levels/index.d.ts +3 -0
- package/dist/composition/levels/index.js +5 -0
- package/dist/{server/modules/translation-levels → composition/levels}/useDocTranslationApi.d.ts +1 -1
- package/dist/{server/modules/translation-levels → composition/levels}/useDocTranslationApi.js +1 -1
- package/dist/core/content-projection/computeSourceFingerprint.d.ts +15 -0
- package/dist/core/content-projection/computeSourceFingerprint.js +19 -0
- package/dist/core/content-projection/contentProjector.d.ts +28 -0
- package/dist/core/content-projection/contentProjector.js +97 -0
- package/dist/core/content-projection/fingerprinter.d.ts +28 -0
- package/dist/core/content-projection/fingerprinter.js +29 -0
- package/dist/core/content-projection/idPath.d.ts +48 -0
- package/dist/core/content-projection/idPath.js +64 -0
- package/dist/core/content-projection/translatableLeaf.d.ts +27 -0
- package/dist/core/content-projection/translatableLeaf.js +37 -0
- package/dist/core/field-config/getFieldConfig.d.ts +23 -0
- package/dist/{server/shared → core}/field-config/getFieldConfig.js +5 -5
- package/dist/{server/shared → core}/field-config/index.d.ts +3 -3
- package/dist/core/field-config/index.js +4 -0
- package/dist/{server/shared → core}/field-traversal/findFieldByPath.d.ts +2 -3
- package/dist/core/field-traversal/guards.d.ts +19 -0
- package/dist/core/field-traversal/guards.js +20 -0
- package/dist/core/field-traversal/index.d.ts +7 -0
- package/dist/core/field-traversal/index.js +7 -0
- package/dist/{server/shared → core}/field-traversal/kernel.d.ts +7 -8
- package/dist/{server/shared → core}/field-traversal/kernel.js +6 -6
- package/dist/core/field-traversal/predicates.d.ts +24 -0
- package/dist/core/field-traversal/predicates.js +17 -0
- package/dist/{server/shared → core}/field-traversal/types.d.ts +129 -27
- package/dist/{server/shared → core}/field-traversal/types.js +6 -0
- package/dist/{server/shared → core}/field-traversal/walkFields.d.ts +2 -3
- package/dist/core/index.d.ts +12 -0
- package/dist/core/index.js +15 -0
- package/dist/{server/shared → core}/lexical/collectTextNodes.d.ts +1 -1
- package/dist/{server/shared → core}/lexical/collectTextNodes.js +1 -1
- package/dist/{server/shared → core}/lexical/guards.d.ts +1 -1
- package/dist/{server/shared → core}/lexical/guards.js +4 -4
- package/dist/core/lexical/index.d.ts +6 -0
- package/dist/core/lexical/index.js +6 -0
- package/dist/{server/shared → core}/lexical/isEmptyRichText.d.ts +1 -1
- package/dist/{server/shared → core}/lexical/isEmptyRichText.js +3 -3
- package/dist/{server/shared → core}/lexical/traverseLexicalTree.d.ts +1 -1
- package/dist/{server/shared → core}/lexical/traverseLexicalTree.js +1 -1
- package/dist/core/lexical/types.d.ts +33 -0
- package/dist/core/lexical/types.js +11 -0
- package/dist/core/provenance/ProvenanceStore.interface.d.ts +99 -0
- package/dist/core/provenance/ProvenanceStore.interface.js +37 -0
- package/dist/core/provenance/index.d.ts +1 -0
- package/dist/core/provenance/index.js +5 -0
- package/dist/{server/modules → core}/translation-pipeline/TranslationPipeline.d.ts +4 -4
- package/dist/{server/modules → core}/translation-pipeline/TranslationPipeline.js +1 -1
- package/dist/{server/modules → core}/translation-pipeline/stages/data-reconciler/DataReconciler.d.ts +2 -2
- package/dist/{server/modules → core}/translation-pipeline/stages/data-reconciler/DataReconciler.js +3 -2
- package/dist/core/translation-pipeline/stages/data-reconciler/index.d.ts +2 -0
- package/dist/core/translation-pipeline/stages/data-reconciler/index.js +4 -0
- package/dist/{server/modules → core}/translation-pipeline/stages/field-collector/FieldChunkCollector.d.ts +2 -2
- package/dist/{server/modules → core}/translation-pipeline/stages/field-collector/FieldChunkCollector.js +18 -4
- package/dist/{server/modules → core}/translation-pipeline/stages/field-collector/FieldChunkCollector.stage.d.ts +2 -2
- package/dist/{server/modules → core}/translation-pipeline/stages/field-collector/FieldChunkCollector.stage.js +2 -2
- package/dist/core/translation-pipeline/stages/field-collector/index.d.ts +2 -0
- package/dist/core/translation-pipeline/stages/field-collector/index.js +4 -0
- package/dist/core/translation-pipeline/stages/index.d.ts +6 -0
- package/dist/core/translation-pipeline/stages/index.js +7 -0
- package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/PlainTextExpander.d.ts +2 -2
- package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/PlainTextExpander.js +2 -2
- package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/RichTextExpander.d.ts +2 -2
- package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/RichTextExpander.js +3 -3
- package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/TextChunkExpander.d.ts +2 -2
- package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/TextChunkExpander.stage.d.ts +2 -2
- package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/TextChunkExpander.stage.js +4 -4
- package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/TextExpander.interface.d.ts +1 -1
- package/dist/core/translation-pipeline/stages/text-expander/index.d.ts +6 -0
- package/dist/core/translation-pipeline/stages/text-expander/index.js +6 -0
- package/dist/{server/modules → core}/translation-pipeline/stages/translation/Translation.stage.d.ts +2 -2
- package/dist/{server/modules → core}/translation-pipeline/stages/translation/Translation.stage.js +1 -1
- package/dist/core/translation-pipeline/stages/translation/index.d.ts +1 -0
- package/dist/core/translation-pipeline/stages/translation/index.js +3 -0
- package/dist/{server/modules → core}/translation-pipeline/stages/translation-applicator/TranslationMutator.d.ts +1 -1
- package/dist/{server/modules → core}/translation-pipeline/stages/translation-applicator/TranslationMutator.js +1 -1
- package/dist/{server/modules → core}/translation-pipeline/stages/translation-applicator/TranslationMutator.stage.d.ts +1 -1
- package/dist/{server/modules → core}/translation-pipeline/stages/translation-applicator/TranslationMutator.stage.js +2 -2
- package/dist/core/translation-pipeline/stages/translation-applicator/index.d.ts +2 -0
- package/dist/core/translation-pipeline/stages/translation-applicator/index.js +4 -0
- package/dist/{server/modules → core}/translation-pipeline/strategies/Overwrite.strategy.d.ts +1 -1
- package/dist/{server/modules → core}/translation-pipeline/strategies/Overwrite.strategy.js +1 -1
- package/dist/{server/modules → core}/translation-pipeline/strategies/SkipExisting.strategy.d.ts +1 -1
- package/dist/{server/modules → core}/translation-pipeline/strategies/SkipExisting.strategy.js +3 -1
- package/dist/core/translation-pipeline/strategies/index.d.ts +13 -0
- package/dist/{server/modules → core}/translation-pipeline/strategies/index.js +4 -4
- package/dist/{server/modules → core}/translation-pipeline/translateContent.d.ts +2 -2
- package/dist/{server/modules → core}/translation-pipeline/types/FieldChunk.d.ts +3 -3
- package/dist/{server/modules → core}/translation-pipeline/types/Pipeline.d.ts +2 -2
- package/dist/{server/modules → core}/translation-pipeline/types/PipelineContext.d.ts +4 -4
- package/dist/{server/modules → core}/translation-pipeline/types/TextChunk.d.ts +3 -3
- package/dist/{server/modules → core}/translation-pipeline/types/TextChunk.js +2 -2
- package/dist/core/translation-pipeline/types/index.d.ts +5 -0
- package/dist/core/translation-pipeline/types/index.js +3 -0
- package/dist/core/translation-providers/index.d.ts +1 -0
- package/dist/core/translation-providers/index.js +5 -0
- package/dist/core/utils/index.d.ts +2 -0
- package/dist/core/utils/index.js +4 -0
- package/dist/{server/shared → core}/utils/isEmpty.js +2 -2
- package/dist/{server/shared → core}/utils/isObject.js +1 -1
- package/dist/field-actions.d.ts +1 -1
- package/dist/field-config.d.ts +1 -1
- package/dist/field-config.js +1 -1
- package/dist/index.d.ts +7 -4
- package/dist/index.js +4 -4
- package/dist/plugin.d.ts +27 -1
- package/dist/plugin.js +56 -16
- package/dist/server/features/_lib/collection-utils.d.ts +1 -1
- package/dist/server/features/_lib/index.d.ts +1 -1
- package/dist/server/features/_lib/index.js +1 -1
- package/dist/server/features/cancel/index.d.ts +1 -1
- package/dist/server/features/cancel/index.js +1 -1
- package/dist/server/features/cancel-by-collection/index.d.ts +1 -1
- package/dist/server/features/cancel-by-collection/index.js +1 -1
- package/dist/server/features/cancel-by-collection/model.d.ts +2 -2
- package/dist/server/features/cancel-by-collection/model.js +1 -1
- package/dist/server/features/createTranslationRoutes.d.ts +1 -1
- package/dist/server/features/enqueue-translation/index.d.ts +1 -1
- package/dist/server/features/enqueue-translation/index.js +1 -1
- package/dist/server/features/enqueue-translation/model.d.ts +2 -2
- package/dist/server/features/enqueue-translation/model.js +4 -4
- package/dist/server/features/get-collection-status/index.d.ts +1 -1
- package/dist/server/features/get-collection-status/index.js +1 -1
- package/dist/server/features/get-collection-status/model.d.ts +3 -3
- package/dist/server/features/get-collection-status/model.js +1 -1
- package/dist/server/features/get-document-status/index.d.ts +2 -2
- package/dist/server/features/get-document-status/index.js +2 -2
- package/dist/server/features/run-translation/index.d.ts +1 -1
- package/dist/server/features/run-translation/index.js +1 -1
- package/dist/server/features/translate-document/handler.d.ts +6 -3
- package/dist/server/features/translate-document/handler.js +28 -2
- package/dist/server/features/translate-document/index.d.ts +1 -1
- package/dist/server/features/translate-document/model.d.ts +2 -7
- package/dist/server/features/translate-document/model.js +1 -2
- package/dist/server/features/translate-field/handler.js +1 -1
- package/dist/server/features/translate-field/index.d.ts +2 -1
- package/dist/server/features/translate-field/model.d.ts +2 -19
- package/dist/server/features/translate-field/resolveFieldSubtree.js +1 -1
- package/dist/server/features/translate-field/route.d.ts +1 -1
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +3 -3
- package/dist/server/modules/index.d.ts +2 -2
- package/dist/server/modules/index.js +2 -2
- package/dist/server/modules/lifecycle/LifecycleNotifier.d.ts +21 -0
- package/dist/server/modules/lifecycle/LifecycleNotifier.js +38 -0
- package/dist/server/modules/lifecycle/index.d.ts +4 -0
- package/dist/server/modules/lifecycle/index.js +7 -0
- package/dist/server/modules/lifecycle/taskMapping.d.ts +7 -0
- package/dist/server/modules/lifecycle/taskMapping.js +16 -0
- package/dist/server/modules/lifecycle/types.d.ts +45 -0
- package/dist/server/modules/lifecycle/types.js +21 -0
- package/dist/server/modules/lifecycle/withQueuedNotification.d.ts +9 -0
- package/dist/server/modules/lifecycle/withQueuedNotification.js +19 -0
- package/dist/server/modules/provenance/PayloadProvenanceStore.d.ts +21 -0
- package/dist/server/modules/provenance/PayloadProvenanceStore.js +109 -0
- package/dist/server/modules/provenance/index.d.ts +5 -0
- package/dist/server/modules/provenance/index.js +8 -0
- package/dist/server/modules/provenance/provenanceCleanupHook.d.ts +18 -0
- package/dist/server/modules/provenance/provenanceCleanupHook.js +41 -0
- package/dist/server/modules/provenance/provenanceCollection.d.ts +23 -0
- package/dist/server/modules/provenance/provenanceCollection.js +82 -0
- package/dist/server/modules/provenance/slugGuard.d.ts +16 -0
- package/dist/server/modules/provenance/slugGuard.js +19 -0
- package/dist/server/modules/task-runner/TaskRunner.interface.d.ts +2 -2
- package/dist/server/modules/task-runner/TaskRunnerProvider.interface.d.ts +1 -1
- package/dist/server/modules/task-runner/index.d.ts +1 -1
- package/dist/server/modules/task-runner/payload-jobs-runner/index.d.ts +2 -2
- package/dist/server/modules/task-runner/payload-jobs-runner/index.js +1 -1
- package/dist/server/modules/task-runner/sync-runner/index.d.ts +1 -1
- package/dist/server/modules/task-runner/sync-runner/index.js +1 -1
- package/dist/server/modules/translation-levels/PluginConfigBuilder.d.ts +3 -3
- package/dist/server/modules/translation-levels/index.d.ts +1 -4
- package/dist/server/modules/translation-levels/index.js +1 -3
- package/dist/server/modules/translation-levels/types.d.ts +3 -3
- package/dist/server/shared/access/AnyAccessGuard.d.ts +1 -1
- package/dist/server/shared/access/handler.d.ts +1 -1
- package/dist/server/shared/access/index.d.ts +3 -3
- package/dist/server/shared/access/index.js +1 -1
- package/dist/server/shared/access/types.d.ts +1 -1
- package/dist/server/shared/guards/collection-guards.d.ts +1 -1
- package/dist/server/shared/guards/collection-guards.js +2 -2
- package/dist/server/shared/guards/field-guards.d.ts +9 -20
- package/dist/server/shared/guards/field-guards.js +5 -20
- package/dist/server/shared/guards/index.d.ts +3 -3
- package/dist/server/shared/guards/index.js +2 -2
- package/dist/server/shared/http/ServerResponse.js +15 -15
- package/dist/server/shared/http/index.d.ts +3 -3
- package/dist/server/shared/http/index.js +3 -3
- package/dist/server/shared/http/withAccessCheck.d.ts +2 -2
- package/dist/server/shared/http/withAccessCheck.js +1 -1
- package/dist/server/shared/http/withErrorHandler.js +3 -3
- package/dist/server/shared/index.d.ts +6 -5
- package/dist/server/shared/index.js +4 -3
- package/dist/server/shared/utils/filterLocalizedFields.js +2 -2
- package/dist/server/shared/utils/getByPath.js +2 -2
- package/dist/server/shared/utils/index.d.ts +9 -9
- package/dist/server/shared/utils/index.js +8 -8
- package/dist/server/shared/utils/normalizePath.js +3 -3
- package/dist/server/shared/utils/setByPath.js +2 -2
- package/dist/translation-providers/index.d.ts +2 -0
- package/dist/translation-providers/index.js +10 -0
- package/dist/{server/modules/translation-providers → translation-providers/openai}/OpenAITranslation.provider.d.ts +1 -1
- package/dist/{server/modules/translation-providers → translation-providers/openai}/OpenAITranslation.provider.js +1 -1
- package/dist/translation-providers/openai/index.d.ts +1 -0
- package/dist/translation-providers/openai/index.js +5 -0
- package/dist/types/CollectionSchemaMap.d.ts +6 -0
- package/dist/types/CollectionSchemaMap.js +6 -0
- package/dist/{client/shared/types → types}/PayloadComponentExport.d.ts +1 -1
- package/dist/types/index.d.ts +4 -1
- package/dist/types/wire/field-translation.d.ts +17 -0
- package/dist/types/wire/field-translation.js +7 -0
- package/package.json +3 -1
- package/dist/server/modules/translation-pipeline/stages/data-reconciler/index.d.ts +0 -2
- package/dist/server/modules/translation-pipeline/stages/data-reconciler/index.js +0 -4
- package/dist/server/modules/translation-pipeline/stages/field-collector/index.d.ts +0 -2
- package/dist/server/modules/translation-pipeline/stages/field-collector/index.js +0 -4
- package/dist/server/modules/translation-pipeline/stages/index.d.ts +0 -6
- package/dist/server/modules/translation-pipeline/stages/index.js +0 -7
- package/dist/server/modules/translation-pipeline/stages/text-expander/index.d.ts +0 -6
- package/dist/server/modules/translation-pipeline/stages/text-expander/index.js +0 -6
- package/dist/server/modules/translation-pipeline/stages/translation/index.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/stages/translation/index.js +0 -3
- package/dist/server/modules/translation-pipeline/stages/translation-applicator/index.d.ts +0 -2
- package/dist/server/modules/translation-pipeline/stages/translation-applicator/index.js +0 -4
- package/dist/server/modules/translation-pipeline/strategies/index.d.ts +0 -13
- package/dist/server/modules/translation-pipeline/types/index.d.ts +0 -5
- package/dist/server/modules/translation-pipeline/types/index.js +0 -3
- package/dist/server/modules/translation-providers/index.d.ts +0 -2
- package/dist/server/modules/translation-providers/index.js +0 -3
- package/dist/server/shared/field-config/getFieldConfig.d.ts +0 -20
- package/dist/server/shared/field-config/index.js +0 -4
- package/dist/server/shared/field-traversal/index.d.ts +0 -5
- package/dist/server/shared/field-traversal/index.js +0 -5
- package/dist/server/shared/lexical/index.d.ts +0 -6
- package/dist/server/shared/lexical/index.js +0 -6
- package/dist/server/shared/lexical/types.d.ts +0 -19
- package/dist/server/shared/lexical/types.js +0 -8
- /package/dist/{server/shared → core}/field-config/types.d.ts +0 -0
- /package/dist/{server/shared → core}/field-config/types.js +0 -0
- /package/dist/{server/shared → core}/field-traversal/findFieldByPath.js +0 -0
- /package/dist/{server/shared → core}/field-traversal/walkFields.js +0 -0
- /package/dist/{server/modules → core}/translation-pipeline/index.d.ts +0 -0
- /package/dist/{server/modules → core}/translation-pipeline/index.js +0 -0
- /package/dist/{server/modules → core}/translation-pipeline/stages/data-reconciler/DataReconciler.stage.d.ts +0 -0
- /package/dist/{server/modules → core}/translation-pipeline/stages/data-reconciler/DataReconciler.stage.js +0 -0
- /package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/TextChunkExpander.js +0 -0
- /package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/TextExpander.interface.js +0 -0
- /package/dist/{server/modules → core}/translation-pipeline/strategies/TranslationStrategy.interface.d.ts +0 -0
- /package/dist/{server/modules → core}/translation-pipeline/strategies/TranslationStrategy.interface.js +0 -0
- /package/dist/{server/modules → core}/translation-pipeline/translateContent.js +0 -0
- /package/dist/{server/modules → core}/translation-pipeline/types/FieldChunk.js +0 -0
- /package/dist/{server/modules → core}/translation-pipeline/types/Pipeline.js +0 -0
- /package/dist/{server/modules → core}/translation-pipeline/types/PipelineContext.js +0 -0
- /package/dist/{server/modules → core}/translation-providers/TranslationProvider.interface.d.ts +0 -0
- /package/dist/{server/modules → core}/translation-providers/TranslationProvider.interface.js +0 -0
- /package/dist/{server/shared → core}/utils/isEmpty.d.ts +0 -0
- /package/dist/{server/shared → core}/utils/isObject.d.ts +0 -0
- /package/dist/{client/shared/types → types}/PayloadComponentExport.js +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CollectionAfterDeleteHook, Config } from "payload";
|
|
2
|
+
import type { ProvenanceStoreFactory } from "./PayloadProvenanceStore";
|
|
3
|
+
/**
|
|
4
|
+
* Build the `afterDelete` hook that cascade-deletes a document's provenance rows for `provenanceSlug`.
|
|
5
|
+
*
|
|
6
|
+
* Best-effort by design: the store's delete runs in its own transaction (the store does not thread
|
|
7
|
+
* `req`), and any failure is swallowed and logged — so cleanup can never roll back or fail the user's
|
|
8
|
+
* document delete. `id` is `number | string`, so it is stringified to match the stored `documentId`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function makeProvenanceCleanupHook(storeFactory: ProvenanceStoreFactory, provenanceSlug: string): CollectionAfterDeleteHook;
|
|
11
|
+
/**
|
|
12
|
+
* Attach the provenance cleanup hook to every managed (translatable) collection on `config`, appending
|
|
13
|
+
* to any consumer-supplied `afterDelete` array. Idempotent per `provenanceSlug`: a collection that
|
|
14
|
+
* already carries this slug's cleanup hook is skipped, so a repeated `init()` never stacks duplicates,
|
|
15
|
+
* yet a second instance with a different slug still attaches its own hook. The sidecar collection is
|
|
16
|
+
* never in `managedSlugs`, so it is never hooked (no recursion).
|
|
17
|
+
*/
|
|
18
|
+
export declare function injectProvenanceCleanup(config: Config, managedSlugs: Set<string>, storeFactory: ProvenanceStoreFactory, provenanceSlug: string): void;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build the `afterDelete` hook that cascade-deletes a document's provenance rows for `provenanceSlug`.
|
|
3
|
+
*
|
|
4
|
+
* Best-effort by design: the store's delete runs in its own transaction (the store does not thread
|
|
5
|
+
* `req`), and any failure is swallowed and logged — so cleanup can never roll back or fail the user's
|
|
6
|
+
* document delete. `id` is `number | string`, so it is stringified to match the stored `documentId`.
|
|
7
|
+
*/ export function makeProvenanceCleanupHook(storeFactory, provenanceSlug) {
|
|
8
|
+
const hook = async ({ id, collection, req })=>{
|
|
9
|
+
try {
|
|
10
|
+
const store = storeFactory(req.payload);
|
|
11
|
+
await store.deleteByDocument(collection.slug, String(id));
|
|
12
|
+
} catch (error) {
|
|
13
|
+
req.payload.logger.error({
|
|
14
|
+
err: error,
|
|
15
|
+
collection: collection.slug,
|
|
16
|
+
documentId: String(id),
|
|
17
|
+
msg: "translator: failed to clean up provenance records after document delete"
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
hook.__translatorProvenanceCleanup = provenanceSlug;
|
|
22
|
+
return hook;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Attach the provenance cleanup hook to every managed (translatable) collection on `config`, appending
|
|
26
|
+
* to any consumer-supplied `afterDelete` array. Idempotent per `provenanceSlug`: a collection that
|
|
27
|
+
* already carries this slug's cleanup hook is skipped, so a repeated `init()` never stacks duplicates,
|
|
28
|
+
* yet a second instance with a different slug still attaches its own hook. The sidecar collection is
|
|
29
|
+
* never in `managedSlugs`, so it is never hooked (no recursion).
|
|
30
|
+
*/ export function injectProvenanceCleanup(config, managedSlugs, storeFactory, provenanceSlug) {
|
|
31
|
+
const hook = makeProvenanceCleanupHook(storeFactory, provenanceSlug);
|
|
32
|
+
for (const collection of config.collections ?? []){
|
|
33
|
+
if (!managedSlugs.has(collection.slug)) continue;
|
|
34
|
+
collection.hooks ??= {};
|
|
35
|
+
collection.hooks.afterDelete ??= [];
|
|
36
|
+
const alreadyInjected = collection.hooks.afterDelete.some((existing)=>existing.__translatorProvenanceCleanup === provenanceSlug);
|
|
37
|
+
if (!alreadyInjected) collection.hooks.afterDelete.push(hook);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=provenanceCleanupHook.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CollectionConfig } from "payload";
|
|
2
|
+
/** Default slug for the provenance sidecar collection. Overridable via `provenance.slug`. */
|
|
3
|
+
export declare const DEFAULT_PROVENANCE_SLUG = "translator-provenance";
|
|
4
|
+
/**
|
|
5
|
+
* True for the plugin's own provenance sidecar collection. Recognised by the {@link PROVENANCE_MARKER}
|
|
6
|
+
* on `custom` (not the slug, which is consumer-configurable), so plugin wiring can stay idempotent on
|
|
7
|
+
* a repeated run and the slug-collision guard can ignore an already-added sidecar.
|
|
8
|
+
*/
|
|
9
|
+
export declare function isProvenanceCollection(collection: {
|
|
10
|
+
custom?: unknown;
|
|
11
|
+
}): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Build the Payload config for the provenance sidecar collection.
|
|
14
|
+
*
|
|
15
|
+
* Deliberately minimal and DB-portable — only `text`/`date` fields and one composite index — so the
|
|
16
|
+
* same config yields a trivial migration on SQL (Postgres/SQLite) and an inferred collection on
|
|
17
|
+
* MongoDB. The collection is hidden from the admin UI: it is plugin-managed bookkeeping, not editor
|
|
18
|
+
* content. The composite index on `(collectionSlug, documentId, targetLocale)` is the upsert key.
|
|
19
|
+
*
|
|
20
|
+
* The plugin ships only this config; the consumer's Payload creates the table (see the design doc's
|
|
21
|
+
* SQL-migration note). Enabled only when the consumer opts in via `provenance` (wired in slice B).
|
|
22
|
+
*/
|
|
23
|
+
export declare function makeProvenanceCollection(slug?: string): CollectionConfig;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/** Default slug for the provenance sidecar collection. Overridable via `provenance.slug`. */ export const DEFAULT_PROVENANCE_SLUG = "translator-provenance";
|
|
2
|
+
/** The `custom` marker tagging the plugin's own provenance sidecar (set + read in this module). */ const PROVENANCE_MARKER = "translatorProvenance";
|
|
3
|
+
/**
|
|
4
|
+
* True for the plugin's own provenance sidecar collection. Recognised by the {@link PROVENANCE_MARKER}
|
|
5
|
+
* on `custom` (not the slug, which is consumer-configurable), so plugin wiring can stay idempotent on
|
|
6
|
+
* a repeated run and the slug-collision guard can ignore an already-added sidecar.
|
|
7
|
+
*/ export function isProvenanceCollection(collection) {
|
|
8
|
+
return collection.custom?.[PROVENANCE_MARKER] === true;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Build the Payload config for the provenance sidecar collection.
|
|
12
|
+
*
|
|
13
|
+
* Deliberately minimal and DB-portable — only `text`/`date` fields and one composite index — so the
|
|
14
|
+
* same config yields a trivial migration on SQL (Postgres/SQLite) and an inferred collection on
|
|
15
|
+
* MongoDB. The collection is hidden from the admin UI: it is plugin-managed bookkeeping, not editor
|
|
16
|
+
* content. The composite index on `(collectionSlug, documentId, targetLocale)` is the upsert key.
|
|
17
|
+
*
|
|
18
|
+
* The plugin ships only this config; the consumer's Payload creates the table (see the design doc's
|
|
19
|
+
* SQL-migration note). Enabled only when the consumer opts in via `provenance` (wired in slice B).
|
|
20
|
+
*/ export function makeProvenanceCollection(slug = DEFAULT_PROVENANCE_SLUG) {
|
|
21
|
+
return {
|
|
22
|
+
slug,
|
|
23
|
+
admin: {
|
|
24
|
+
hidden: true
|
|
25
|
+
},
|
|
26
|
+
// Marker so plugin wiring can recognise its own collection ({@link isProvenanceCollection}) — lets
|
|
27
|
+
// a repeated plugin run stay idempotent and lets the slug-collision guard ignore its own sidecar.
|
|
28
|
+
custom: {
|
|
29
|
+
[PROVENANCE_MARKER]: true
|
|
30
|
+
},
|
|
31
|
+
fields: [
|
|
32
|
+
{
|
|
33
|
+
name: "collectionSlug",
|
|
34
|
+
type: "text",
|
|
35
|
+
required: true,
|
|
36
|
+
index: true
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "documentId",
|
|
40
|
+
type: "text",
|
|
41
|
+
required: true,
|
|
42
|
+
index: true
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "targetLocale",
|
|
46
|
+
type: "text",
|
|
47
|
+
required: true
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "sourceLocale",
|
|
51
|
+
type: "text",
|
|
52
|
+
required: true
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "sourceFingerprint",
|
|
56
|
+
type: "text",
|
|
57
|
+
required: true
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "translatedAt",
|
|
61
|
+
type: "date",
|
|
62
|
+
required: true
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "dismissedFingerprint",
|
|
66
|
+
type: "text"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
indexes: [
|
|
70
|
+
{
|
|
71
|
+
fields: [
|
|
72
|
+
"collectionSlug",
|
|
73
|
+
"documentId",
|
|
74
|
+
"targetLocale"
|
|
75
|
+
],
|
|
76
|
+
unique: true
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=provenanceCollection.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fail fast if the provenance sidecar slug collides with a collection the consumer already defines.
|
|
3
|
+
* Sharing a table would silently corrupt both — better a clear startup error telling the consumer to
|
|
4
|
+
* set `provenance.slug`.
|
|
5
|
+
*
|
|
6
|
+
* Compares by exact slug: this catches the common footgun — a consumer collection already using this
|
|
7
|
+
* slug — and is correct on every adapter (on MongoDB the slug IS the collection name). It does NOT
|
|
8
|
+
* try to model SQL table-name derivation: `@payloadcms/drizzle` snake-cases slugs and honours
|
|
9
|
+
* `dbName` overrides, so case/separator variants (`translatorProvenance` vs `translator-provenance`)
|
|
10
|
+
* or `dbName` collisions are not detected here. Robust table-name collision detection, if it proves
|
|
11
|
+
* necessary, belongs at plugin init where the full `CollectionConfig` (including `dbName`) is
|
|
12
|
+
* available — not in this slug-only helper.
|
|
13
|
+
*/
|
|
14
|
+
export declare function assertProvenanceSlugFree(slug: string, collections: ReadonlyArray<{
|
|
15
|
+
slug: string;
|
|
16
|
+
}>): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fail fast if the provenance sidecar slug collides with a collection the consumer already defines.
|
|
3
|
+
* Sharing a table would silently corrupt both — better a clear startup error telling the consumer to
|
|
4
|
+
* set `provenance.slug`.
|
|
5
|
+
*
|
|
6
|
+
* Compares by exact slug: this catches the common footgun — a consumer collection already using this
|
|
7
|
+
* slug — and is correct on every adapter (on MongoDB the slug IS the collection name). It does NOT
|
|
8
|
+
* try to model SQL table-name derivation: `@payloadcms/drizzle` snake-cases slugs and honours
|
|
9
|
+
* `dbName` overrides, so case/separator variants (`translatorProvenance` vs `translator-provenance`)
|
|
10
|
+
* or `dbName` collisions are not detected here. Robust table-name collision detection, if it proves
|
|
11
|
+
* necessary, belongs at plugin init where the full `CollectionConfig` (including `dbName`) is
|
|
12
|
+
* available — not in this slug-only helper.
|
|
13
|
+
*/ export function assertProvenanceSlugFree(slug, collections) {
|
|
14
|
+
if (collections.some((collection)=>collection.slug === slug)) {
|
|
15
|
+
throw new Error(`[payload-plugin-translator] provenance slug "${slug}" collides with an existing collection. ` + "Set a distinct slug via the plugin's provenance.slug option.");
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=slugGuard.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CollectionSlug } from
|
|
2
|
-
import type { Task, TaskInput, RunResult } from
|
|
1
|
+
import type { CollectionSlug } from "payload";
|
|
2
|
+
import type { Task, TaskInput, RunResult } from "./types";
|
|
3
3
|
/**
|
|
4
4
|
* Interface for task execution backends.
|
|
5
5
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CollectionSlug, Config, Payload } from "payload";
|
|
2
2
|
import type { TaskRunner } from "./TaskRunner.interface";
|
|
3
3
|
import type { ID } from "./types";
|
|
4
|
-
import type { TranslationStrategyName } from "
|
|
4
|
+
import type { TranslationStrategyName } from "../../../core/translation-pipeline/strategies";
|
|
5
5
|
/**
|
|
6
6
|
* Input for task handler callback
|
|
7
7
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { TaskRunnerProvider, TaskRunnerFactory, TaskRunnerContext } from "./TaskRunnerProvider.interface";
|
|
1
|
+
export type { TaskRunnerProvider, TaskRunnerFactory, TaskRunnerContext, } from "./TaskRunnerProvider.interface";
|
|
2
2
|
export type { Task, TaskStatus } from "./types";
|
|
3
3
|
export { createPayloadJobsRunner } from "./payload-jobs-runner";
|
|
4
4
|
export type { PayloadJobsRunnerOptions } from "./payload-jobs-runner";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { createPayloadJobsRunner } from
|
|
2
|
-
export type { PayloadJobsRunnerOptions } from
|
|
1
|
+
export { createPayloadJobsRunner } from "./PayloadJobsRunnerProvider";
|
|
2
|
+
export type { PayloadJobsRunnerOptions } from "./types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { createSyncRunner } from
|
|
1
|
+
export { createSyncRunner } from "./SyncRunnerProvider";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { CollectionConfig, Config, Endpoint } from "payload";
|
|
2
2
|
import type { AccessGuard } from "../../../types/AccessGuard";
|
|
3
|
-
import type { RawPayloadComponentExport } from "../../../
|
|
4
|
-
import type { CollectionSchemaMap } from "
|
|
5
|
-
import type { TranslationProvider } from "
|
|
3
|
+
import type { RawPayloadComponentExport } from "../../../types/PayloadComponentExport";
|
|
4
|
+
import type { CollectionSchemaMap } from "../../../types/CollectionSchemaMap";
|
|
5
|
+
import type { TranslationProvider } from "../../../core/translation-providers";
|
|
6
6
|
import type { TaskRunnerFactory } from "../task-runner";
|
|
7
7
|
import type { CollectionAdminSlot, LevelContext } from "./types";
|
|
8
8
|
type ConfigModifier = (config: Config) => Config;
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
export type { TranslationLevel } from "./types";
|
|
2
|
-
export { documentLevel } from "./documentLevel";
|
|
3
|
-
export { collectionLevel } from "./collectionLevel";
|
|
4
|
-
export { fieldLevel } from "./fieldLevel";
|
|
1
|
+
export type { TranslationLevel, LevelContext, CollectionAdminSlot } from "./types";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { CollectionConfig, Endpoint } from "payload";
|
|
2
2
|
import type { AccessGuard } from "../../../types/AccessGuard";
|
|
3
|
-
import type { RawPayloadComponentExport } from "../../../
|
|
4
|
-
import type { CollectionSchemaMap } from "
|
|
5
|
-
import type { TranslationProvider } from "
|
|
3
|
+
import type { RawPayloadComponentExport } from "../../../types/PayloadComponentExport";
|
|
4
|
+
import type { CollectionSchemaMap } from "../../../types/CollectionSchemaMap";
|
|
5
|
+
import type { TranslationProvider } from "../../../core/translation-providers";
|
|
6
6
|
import type { TaskRunnerFactory } from "../task-runner";
|
|
7
7
|
export type CollectionAdminSlot = "beforeDocumentControls" | "beforeListTable";
|
|
8
8
|
/**
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { AccessGuard, AccessGuardRequest } from
|
|
2
|
-
export { AnyAccessGuard } from
|
|
3
|
-
export type { Handler } from
|
|
1
|
+
export type { AccessGuard, AccessGuardRequest } from "./types";
|
|
2
|
+
export { AnyAccessGuard } from "./AnyAccessGuard";
|
|
3
|
+
export type { Handler } from "./handler";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { AccessGuard, AccessGuardRequest } from
|
|
1
|
+
export type { AccessGuard, AccessGuardRequest } from "../../../types/AccessGuard";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Type guard: Checks if versions config is an object (not boolean).
|
|
3
3
|
*/ function isVersionsObject(versions) {
|
|
4
|
-
return typeof versions ===
|
|
4
|
+
return typeof versions === "object" && versions !== null;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* Checks if a collection has drafts enabled.
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
const { versions } = collection;
|
|
11
11
|
if (!versions) return false;
|
|
12
12
|
if (!isVersionsObject(versions)) return false;
|
|
13
|
-
return
|
|
13
|
+
return "drafts" in versions && Boolean(versions.drafts);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
//# sourceMappingURL=collection-guards.js.map
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
import type { Field, RichTextField,
|
|
1
|
+
import type { Field, RichTextField, TextareaField, TextField } from "payload";
|
|
2
2
|
/** Translatable field types that contain text content */
|
|
3
3
|
export type TranslatableField = RichTextField | TextareaField | TextField;
|
|
4
4
|
/**
|
|
5
5
|
* Type guard: Checks if a field contains translatable text content (text, textarea, richText).
|
|
6
|
+
* Narrows a `{ type: string }`-shaped field to the concrete Payload {@link TranslatableField}
|
|
7
|
+
* union.
|
|
6
8
|
*/
|
|
7
|
-
export declare function isTranslatableField(field:
|
|
9
|
+
export declare function isTranslatableField(field: {
|
|
10
|
+
type: string;
|
|
11
|
+
}): field is TranslatableField;
|
|
8
12
|
/**
|
|
9
13
|
* Type guard: Checks if a field has the `localized` property set to true.
|
|
10
14
|
*/
|
|
11
|
-
export declare function isLocalizedField
|
|
15
|
+
export declare function isLocalizedField<T extends {
|
|
16
|
+
localized?: boolean;
|
|
17
|
+
}>(field: T): field is T & {
|
|
12
18
|
localized: true;
|
|
13
19
|
};
|
|
14
20
|
/**
|
|
@@ -17,20 +23,3 @@ export declare function isLocalizedField(field: Field): field is Field & {
|
|
|
17
23
|
export declare function isRelationshipField(field: Field): field is Field & {
|
|
18
24
|
relationTo: unknown;
|
|
19
25
|
};
|
|
20
|
-
/**
|
|
21
|
-
* Type guard: Checks if a field is a tabs field.
|
|
22
|
-
*/
|
|
23
|
-
export declare function isTabsField(field: Field): field is TabsField;
|
|
24
|
-
/**
|
|
25
|
-
* Type guard: Checks if value is a block item (has blockType property).
|
|
26
|
-
*/
|
|
27
|
-
export declare function isBlockItem(value: unknown): value is Record<string, unknown> & {
|
|
28
|
-
blockType: string;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Type guard: Checks if value has a fields array property.
|
|
32
|
-
* Works with Field, Tab, or any object with fields.
|
|
33
|
-
*/
|
|
34
|
-
export declare function hasFields(value: unknown): value is {
|
|
35
|
-
fields: Field[];
|
|
36
|
-
};
|
|
@@ -1,34 +1,19 @@
|
|
|
1
|
-
import { isObject } from '../utils';
|
|
2
1
|
/**
|
|
3
2
|
* Type guard: Checks if a field contains translatable text content (text, textarea, richText).
|
|
3
|
+
* Narrows a `{ type: string }`-shaped field to the concrete Payload {@link TranslatableField}
|
|
4
|
+
* union.
|
|
4
5
|
*/ export function isTranslatableField(field) {
|
|
5
|
-
return field.type ===
|
|
6
|
+
return field.type === "text" || field.type === "textarea" || field.type === "richText";
|
|
6
7
|
}
|
|
7
8
|
/**
|
|
8
9
|
* Type guard: Checks if a field has the `localized` property set to true.
|
|
9
10
|
*/ export function isLocalizedField(field) {
|
|
10
|
-
return
|
|
11
|
+
return "localized" in field && field.localized === true;
|
|
11
12
|
}
|
|
12
13
|
/**
|
|
13
14
|
* Type guard: Checks if a field is a relationship or upload field (should be skipped).
|
|
14
15
|
*/ export function isRelationshipField(field) {
|
|
15
|
-
return
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Type guard: Checks if a field is a tabs field.
|
|
19
|
-
*/ export function isTabsField(field) {
|
|
20
|
-
return field.type === 'tabs';
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Type guard: Checks if value is a block item (has blockType property).
|
|
24
|
-
*/ export function isBlockItem(value) {
|
|
25
|
-
return isObject(value) && 'blockType' in value && typeof value.blockType === 'string';
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Type guard: Checks if value has a fields array property.
|
|
29
|
-
* Works with Field, Tab, or any object with fields.
|
|
30
|
-
*/ export function hasFields(value) {
|
|
31
|
-
return isObject(value) && 'fields' in value && Array.isArray(value.fields);
|
|
16
|
+
return "relationTo" in field && field.relationTo !== undefined;
|
|
32
17
|
}
|
|
33
18
|
|
|
34
19
|
//# sourceMappingURL=field-guards.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { TranslatableField } from
|
|
2
|
-
export { isTranslatableField, isLocalizedField, isRelationshipField
|
|
3
|
-
export { collectionHasDrafts } from
|
|
1
|
+
export type { TranslatableField } from "./field-guards";
|
|
2
|
+
export { isTranslatableField, isLocalizedField, isRelationshipField } from "./field-guards";
|
|
3
|
+
export { collectionHasDrafts } from "./collection-guards";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { isTranslatableField, isLocalizedField, isRelationshipField
|
|
2
|
-
export { collectionHasDrafts } from
|
|
1
|
+
export { isTranslatableField, isLocalizedField, isRelationshipField } from "./field-guards";
|
|
2
|
+
export { collectionHasDrafts } from "./collection-guards";
|
|
3
3
|
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -13,7 +13,7 @@ export class ServerResponse {
|
|
|
13
13
|
status: 201
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
static accepted(message =
|
|
16
|
+
static accepted(message = "Request accepted") {
|
|
17
17
|
return Response.json({
|
|
18
18
|
message
|
|
19
19
|
}, {
|
|
@@ -25,7 +25,7 @@ export class ServerResponse {
|
|
|
25
25
|
status: 204
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
-
static badRequest(message =
|
|
28
|
+
static badRequest(message = "Bad request", details) {
|
|
29
29
|
const body = details ? {
|
|
30
30
|
message,
|
|
31
31
|
details
|
|
@@ -36,42 +36,42 @@ export class ServerResponse {
|
|
|
36
36
|
status: 400
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
static unauthorized(message =
|
|
39
|
+
static unauthorized(message = "Unauthorized") {
|
|
40
40
|
return Response.json({
|
|
41
41
|
message
|
|
42
42
|
}, {
|
|
43
43
|
status: 401
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
static forbidden(message =
|
|
46
|
+
static forbidden(message = "Forbidden") {
|
|
47
47
|
return Response.json({
|
|
48
48
|
message
|
|
49
49
|
}, {
|
|
50
50
|
status: 403
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
-
static notFound(message =
|
|
53
|
+
static notFound(message = "Resource not found") {
|
|
54
54
|
return Response.json({
|
|
55
55
|
message
|
|
56
56
|
}, {
|
|
57
57
|
status: 404
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
static methodNotAllowed(message =
|
|
60
|
+
static methodNotAllowed(message = "Method not allowed") {
|
|
61
61
|
return Response.json({
|
|
62
62
|
message
|
|
63
63
|
}, {
|
|
64
64
|
status: 405
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
static conflict(message =
|
|
67
|
+
static conflict(message = "Conflict") {
|
|
68
68
|
return Response.json({
|
|
69
69
|
message
|
|
70
70
|
}, {
|
|
71
71
|
status: 409
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
-
static unprocessableEntity(message =
|
|
74
|
+
static unprocessableEntity(message = "Unprocessable entity", details) {
|
|
75
75
|
const body = details ? {
|
|
76
76
|
message,
|
|
77
77
|
details
|
|
@@ -82,42 +82,42 @@ export class ServerResponse {
|
|
|
82
82
|
status: 422
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
|
-
static tooManyRequests(message =
|
|
85
|
+
static tooManyRequests(message = "Too many requests") {
|
|
86
86
|
return Response.json({
|
|
87
87
|
message
|
|
88
88
|
}, {
|
|
89
89
|
status: 429
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
static internalServerError(message =
|
|
92
|
+
static internalServerError(message = "Internal server error") {
|
|
93
93
|
return Response.json({
|
|
94
94
|
message
|
|
95
95
|
}, {
|
|
96
96
|
status: 500
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
|
-
static notImplemented(message =
|
|
99
|
+
static notImplemented(message = "Not implemented") {
|
|
100
100
|
return Response.json({
|
|
101
101
|
message
|
|
102
102
|
}, {
|
|
103
103
|
status: 501
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
|
-
static badGateway(message =
|
|
106
|
+
static badGateway(message = "Bad gateway") {
|
|
107
107
|
return Response.json({
|
|
108
108
|
message
|
|
109
109
|
}, {
|
|
110
110
|
status: 502
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
|
-
static serviceUnavailable(message =
|
|
113
|
+
static serviceUnavailable(message = "Service unavailable") {
|
|
114
114
|
return Response.json({
|
|
115
115
|
message
|
|
116
116
|
}, {
|
|
117
117
|
status: 503
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
|
-
static gatewayTimeout(message =
|
|
120
|
+
static gatewayTimeout(message = "Gateway timeout") {
|
|
121
121
|
return Response.json({
|
|
122
122
|
message
|
|
123
123
|
}, {
|
|
@@ -126,7 +126,7 @@ export class ServerResponse {
|
|
|
126
126
|
}
|
|
127
127
|
static validationError(details) {
|
|
128
128
|
return Response.json({
|
|
129
|
-
message:
|
|
129
|
+
message: "Validation error",
|
|
130
130
|
details
|
|
131
131
|
}, {
|
|
132
132
|
status: 400
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { ServerResponse } from
|
|
2
|
-
export { withErrorHandler } from
|
|
3
|
-
export { withAccessCheck } from
|
|
1
|
+
export { ServerResponse } from "./ServerResponse";
|
|
2
|
+
export { withErrorHandler } from "./withErrorHandler";
|
|
3
|
+
export { withAccessCheck } from "./withAccessCheck";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { ServerResponse } from
|
|
2
|
-
export { withErrorHandler } from
|
|
3
|
-
export { withAccessCheck } from
|
|
1
|
+
export { ServerResponse } from "./ServerResponse";
|
|
2
|
+
export { withErrorHandler } from "./withErrorHandler";
|
|
3
|
+
export { withAccessCheck } from "./withAccessCheck";
|
|
4
4
|
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PayloadRequest } from
|
|
2
|
-
import type { AccessGuard } from
|
|
1
|
+
import type { PayloadRequest } from "payload";
|
|
2
|
+
import type { AccessGuard } from "../access/types";
|
|
3
3
|
/**
|
|
4
4
|
* Wraps handler with access check.
|
|
5
5
|
* Returns 403 Forbidden if access guard denies the request.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { APIError } from
|
|
2
|
-
import { ServerResponse } from
|
|
1
|
+
import { APIError } from "payload";
|
|
2
|
+
import { ServerResponse } from "./ServerResponse";
|
|
3
3
|
/**
|
|
4
4
|
* Wraps async handler with error handling.
|
|
5
5
|
* Catches APIError and generic Error, returns appropriate HTTP response.
|
|
@@ -8,7 +8,7 @@ import { ServerResponse } from './ServerResponse';
|
|
|
8
8
|
try {
|
|
9
9
|
return await handler(...args);
|
|
10
10
|
} catch (e) {
|
|
11
|
-
console.error(
|
|
11
|
+
console.error("[TranslateKit] Handler error:", e);
|
|
12
12
|
if (e instanceof APIError) {
|
|
13
13
|
return ServerResponse.custom(e.message, e.status);
|
|
14
14
|
}
|