@open-mercato/documents 0.6.8-develop.7016.1.4ed7b1e49d
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 +88 -0
- package/build.mjs +23 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +7 -0
- package/dist/modules/documents/acl.js +15 -0
- package/dist/modules/documents/acl.js.map +7 -0
- package/dist/modules/documents/api/[id]/archive/route.js +116 -0
- package/dist/modules/documents/api/[id]/archive/route.js.map +7 -0
- package/dist/modules/documents/api/[id]/attachments/[attachmentId]/route.js +155 -0
- package/dist/modules/documents/api/[id]/attachments/[attachmentId]/route.js.map +7 -0
- package/dist/modules/documents/api/[id]/attachments/route.js +153 -0
- package/dist/modules/documents/api/[id]/attachments/route.js.map +7 -0
- package/dist/modules/documents/api/[id]/collab-token/route.js +180 -0
- package/dist/modules/documents/api/[id]/collab-token/route.js.map +7 -0
- package/dist/modules/documents/api/[id]/comments/access-check/route.js +86 -0
- package/dist/modules/documents/api/[id]/comments/access-check/route.js.map +7 -0
- package/dist/modules/documents/api/[id]/comments/route.js +387 -0
- package/dist/modules/documents/api/[id]/comments/route.js.map +7 -0
- package/dist/modules/documents/api/[id]/content/route.js +143 -0
- package/dist/modules/documents/api/[id]/content/route.js.map +7 -0
- package/dist/modules/documents/api/[id]/duplicate/route.js +200 -0
- package/dist/modules/documents/api/[id]/duplicate/route.js.map +7 -0
- package/dist/modules/documents/api/[id]/export/route.js +421 -0
- package/dist/modules/documents/api/[id]/export/route.js.map +7 -0
- package/dist/modules/documents/api/[id]/favorite/route.js +96 -0
- package/dist/modules/documents/api/[id]/favorite/route.js.map +7 -0
- package/dist/modules/documents/api/[id]/links/[linkId]/route.js +85 -0
- package/dist/modules/documents/api/[id]/links/[linkId]/route.js.map +7 -0
- package/dist/modules/documents/api/[id]/links/route.js +257 -0
- package/dist/modules/documents/api/[id]/links/route.js.map +7 -0
- package/dist/modules/documents/api/[id]/principals/route.js +299 -0
- package/dist/modules/documents/api/[id]/principals/route.js.map +7 -0
- package/dist/modules/documents/api/[id]/route.js +246 -0
- package/dist/modules/documents/api/[id]/route.js.map +7 -0
- package/dist/modules/documents/api/[id]/shares/route.js +335 -0
- package/dist/modules/documents/api/[id]/shares/route.js.map +7 -0
- package/dist/modules/documents/api/[id]/unarchive/route.js +39 -0
- package/dist/modules/documents/api/[id]/unarchive/route.js.map +7 -0
- package/dist/modules/documents/api/[id]/versions/[versionId]/restore/route.js +133 -0
- package/dist/modules/documents/api/[id]/versions/[versionId]/restore/route.js.map +7 -0
- package/dist/modules/documents/api/[id]/versions/[versionId]/route.js +93 -0
- package/dist/modules/documents/api/[id]/versions/[versionId]/route.js.map +7 -0
- package/dist/modules/documents/api/[id]/versions/route.js +193 -0
- package/dist/modules/documents/api/[id]/versions/route.js.map +7 -0
- package/dist/modules/documents/api/[id]/watch/route.js +97 -0
- package/dist/modules/documents/api/[id]/watch/route.js.map +7 -0
- package/dist/modules/documents/api/_commands.js +34 -0
- package/dist/modules/documents/api/_commands.js.map +7 -0
- package/dist/modules/documents/api/_shared.js +490 -0
- package/dist/modules/documents/api/_shared.js.map +7 -0
- package/dist/modules/documents/api/folders/route.js +256 -0
- package/dist/modules/documents/api/folders/route.js.map +7 -0
- package/dist/modules/documents/api/instantiate/route.js +108 -0
- package/dist/modules/documents/api/instantiate/route.js.map +7 -0
- package/dist/modules/documents/api/route.js +322 -0
- package/dist/modules/documents/api/route.js.map +7 -0
- package/dist/modules/documents/api/templates/[templateId]/preview/route.js +94 -0
- package/dist/modules/documents/api/templates/[templateId]/preview/route.js.map +7 -0
- package/dist/modules/documents/api/templates/[templateId]/route.js +82 -0
- package/dist/modules/documents/api/templates/[templateId]/route.js.map +7 -0
- package/dist/modules/documents/api/templates/route.js +344 -0
- package/dist/modules/documents/api/templates/route.js.map +7 -0
- package/dist/modules/documents/backend/documents/DocumentsPageClient.js +160 -0
- package/dist/modules/documents/backend/documents/DocumentsPageClient.js.map +7 -0
- package/dist/modules/documents/backend/documents/DocumentsTable.js +143 -0
- package/dist/modules/documents/backend/documents/DocumentsTable.js.map +7 -0
- package/dist/modules/documents/backend/documents/FolderDialog.js +55 -0
- package/dist/modules/documents/backend/documents/FolderDialog.js.map +7 -0
- package/dist/modules/documents/backend/documents/FolderTree.js +40 -0
- package/dist/modules/documents/backend/documents/FolderTree.js.map +7 -0
- package/dist/modules/documents/backend/documents/MoveDocumentDialog.js +64 -0
- package/dist/modules/documents/backend/documents/MoveDocumentDialog.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/CommentAnchorNavigation.js +77 -0
- package/dist/modules/documents/backend/documents/[id]/CommentAnchorNavigation.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/CommentComposer.js +126 -0
- package/dist/modules/documents/backend/documents/[id]/CommentComposer.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/CommentThreadList.js +88 -0
- package/dist/modules/documents/backend/documents/[id]/CommentThreadList.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/CommentsRail.js +123 -0
- package/dist/modules/documents/backend/documents/[id]/CommentsRail.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/DocumentCanvas.js +91 -0
- package/dist/modules/documents/backend/documents/[id]/DocumentCanvas.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/DocumentEditorErrorBoundary.js +27 -0
- package/dist/modules/documents/backend/documents/[id]/DocumentEditorErrorBoundary.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/DocumentEditorIsland.js +50 -0
- package/dist/modules/documents/backend/documents/[id]/DocumentEditorIsland.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/DocumentEditorSurface.js +168 -0
- package/dist/modules/documents/backend/documents/[id]/DocumentEditorSurface.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/DocumentNavigator.js +129 -0
- package/dist/modules/documents/backend/documents/[id]/DocumentNavigator.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/DocumentPageClient.js +429 -0
- package/dist/modules/documents/backend/documents/[id]/DocumentPageClient.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/EditorColorTools.js +68 -0
- package/dist/modules/documents/backend/documents/[id]/EditorColorTools.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/EditorStatusPresence.js +69 -0
- package/dist/modules/documents/backend/documents/[id]/EditorStatusPresence.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/EditorToolbar.js +151 -0
- package/dist/modules/documents/backend/documents/[id]/EditorToolbar.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/ExportMenu.js +121 -0
- package/dist/modules/documents/backend/documents/[id]/ExportMenu.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/MentionPicker.js +114 -0
- package/dist/modules/documents/backend/documents/[id]/MentionPicker.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/OutlinePane.js +70 -0
- package/dist/modules/documents/backend/documents/[id]/OutlinePane.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/RecordFieldsDialog.js +157 -0
- package/dist/modules/documents/backend/documents/[id]/RecordFieldsDialog.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/RelatedRecordsPanel.js +266 -0
- package/dist/modules/documents/backend/documents/[id]/RelatedRecordsPanel.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/VersionHistoryPanel.js +227 -0
- package/dist/modules/documents/backend/documents/[id]/VersionHistoryPanel.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/VersionPreviewDialog.js +157 -0
- package/dist/modules/documents/backend/documents/[id]/VersionPreviewDialog.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/commentTypes.js +150 -0
- package/dist/modules/documents/backend/documents/[id]/commentTypes.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/componentCapabilities.js +13 -0
- package/dist/modules/documents/backend/documents/[id]/componentCapabilities.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/documentPagination.js +295 -0
- package/dist/modules/documents/backend/documents/[id]/documentPagination.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/editorPresenceStyles.js +81 -0
- package/dist/modules/documents/backend/documents/[id]/editorPresenceStyles.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/editorTypes.js +52 -0
- package/dist/modules/documents/backend/documents/[id]/editorTypes.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/page.js +10 -0
- package/dist/modules/documents/backend/documents/[id]/page.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/page.meta.js +16 -0
- package/dist/modules/documents/backend/documents/[id]/page.meta.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/relatedRecordModel.js +38 -0
- package/dist/modules/documents/backend/documents/[id]/relatedRecordModel.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/restoreVersion.js +33 -0
- package/dist/modules/documents/backend/documents/[id]/restoreVersion.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/useDocumentCollaboration.js +392 -0
- package/dist/modules/documents/backend/documents/[id]/useDocumentCollaboration.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/useDocumentComments.js +253 -0
- package/dist/modules/documents/backend/documents/[id]/useDocumentComments.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/useDocumentEditor.js +149 -0
- package/dist/modules/documents/backend/documents/[id]/useDocumentEditor.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/useDocumentTitle.js +82 -0
- package/dist/modules/documents/backend/documents/[id]/useDocumentTitle.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/useEditorInsertions.js +144 -0
- package/dist/modules/documents/backend/documents/[id]/useEditorInsertions.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/useFallbackContentPersistence.js +237 -0
- package/dist/modules/documents/backend/documents/[id]/useFallbackContentPersistence.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/useMentionPicker.js +216 -0
- package/dist/modules/documents/backend/documents/[id]/useMentionPicker.js.map +7 -0
- package/dist/modules/documents/backend/documents/[id]/versionHistoryModel.js +25 -0
- package/dist/modules/documents/backend/documents/[id]/versionHistoryModel.js.map +7 -0
- package/dist/modules/documents/backend/documents/components/EntityPicker.js +156 -0
- package/dist/modules/documents/backend/documents/components/EntityPicker.js.map +7 -0
- package/dist/modules/documents/backend/documents/components/EntityPickerResults.js +46 -0
- package/dist/modules/documents/backend/documents/components/EntityPickerResults.js.map +7 -0
- package/dist/modules/documents/backend/documents/components/NewFromTemplateDialog.js +127 -0
- package/dist/modules/documents/backend/documents/components/NewFromTemplateDialog.js.map +7 -0
- package/dist/modules/documents/backend/documents/components/PrincipalPicker.js +84 -0
- package/dist/modules/documents/backend/documents/components/PrincipalPicker.js.map +7 -0
- package/dist/modules/documents/backend/documents/components/ShareDialog.js +77 -0
- package/dist/modules/documents/backend/documents/components/ShareDialog.js.map +7 -0
- package/dist/modules/documents/backend/documents/components/ShareDialogAddForm.js +93 -0
- package/dist/modules/documents/backend/documents/components/ShareDialogAddForm.js.map +7 -0
- package/dist/modules/documents/backend/documents/components/ShareDialogList.js +82 -0
- package/dist/modules/documents/backend/documents/components/ShareDialogList.js.map +7 -0
- package/dist/modules/documents/backend/documents/components/TemplateBodyEditor.js +96 -0
- package/dist/modules/documents/backend/documents/components/TemplateBodyEditor.js.map +7 -0
- package/dist/modules/documents/backend/documents/components/TemplateEditorDialog.js +169 -0
- package/dist/modules/documents/backend/documents/components/TemplateEditorDialog.js.map +7 -0
- package/dist/modules/documents/backend/documents/components/TemplatePreview.js +38 -0
- package/dist/modules/documents/backend/documents/components/TemplatePreview.js.map +7 -0
- package/dist/modules/documents/backend/documents/components/TemplateSlotFields.js +69 -0
- package/dist/modules/documents/backend/documents/components/TemplateSlotFields.js.map +7 -0
- package/dist/modules/documents/backend/documents/components/TemplateSlotsEditor.js +71 -0
- package/dist/modules/documents/backend/documents/components/TemplateSlotsEditor.js.map +7 -0
- package/dist/modules/documents/backend/documents/components/principalPickerModel.js +63 -0
- package/dist/modules/documents/backend/documents/components/principalPickerModel.js.map +7 -0
- package/dist/modules/documents/backend/documents/components/shareDialogModel.js +68 -0
- package/dist/modules/documents/backend/documents/components/shareDialogModel.js.map +7 -0
- package/dist/modules/documents/backend/documents/components/templateUi.js +89 -0
- package/dist/modules/documents/backend/documents/components/templateUi.js.map +7 -0
- package/dist/modules/documents/backend/documents/components/useAvailableEntityRegistry.js +30 -0
- package/dist/modules/documents/backend/documents/components/useAvailableEntityRegistry.js.map +7 -0
- package/dist/modules/documents/backend/documents/components/useEntitySearch.js +191 -0
- package/dist/modules/documents/backend/documents/components/useEntitySearch.js.map +7 -0
- package/dist/modules/documents/backend/documents/components/usePrincipalPicker.js +221 -0
- package/dist/modules/documents/backend/documents/components/usePrincipalPicker.js.map +7 -0
- package/dist/modules/documents/backend/documents/components/useShareDialog.js +236 -0
- package/dist/modules/documents/backend/documents/components/useShareDialog.js.map +7 -0
- package/dist/modules/documents/backend/documents/components/useTemplateDetail.js +49 -0
- package/dist/modules/documents/backend/documents/components/useTemplateDetail.js.map +7 -0
- package/dist/modules/documents/backend/documents/components/useTemplateInstantiation.js +234 -0
- package/dist/modules/documents/backend/documents/components/useTemplateInstantiation.js.map +7 -0
- package/dist/modules/documents/backend/documents/documentUi.js +106 -0
- package/dist/modules/documents/backend/documents/documentUi.js.map +7 -0
- package/dist/modules/documents/backend/documents/documentsListTypes.js +132 -0
- package/dist/modules/documents/backend/documents/documentsListTypes.js.map +7 -0
- package/dist/modules/documents/backend/documents/page.js +9 -0
- package/dist/modules/documents/backend/documents/page.js.map +7 -0
- package/dist/modules/documents/backend/documents/page.meta.js +26 -0
- package/dist/modules/documents/backend/documents/page.meta.js.map +7 -0
- package/dist/modules/documents/backend/documents/templates/TemplatesPageClient.js +91 -0
- package/dist/modules/documents/backend/documents/templates/TemplatesPageClient.js.map +7 -0
- package/dist/modules/documents/backend/documents/templates/TemplatesTable.js +58 -0
- package/dist/modules/documents/backend/documents/templates/TemplatesTable.js.map +7 -0
- package/dist/modules/documents/backend/documents/templates/page.js +9 -0
- package/dist/modules/documents/backend/documents/templates/page.js.map +7 -0
- package/dist/modules/documents/backend/documents/templates/page.meta.js +34 -0
- package/dist/modules/documents/backend/documents/templates/page.meta.js.map +7 -0
- package/dist/modules/documents/backend/documents/templates/useTemplatesPage.js +139 -0
- package/dist/modules/documents/backend/documents/templates/useTemplatesPage.js.map +7 -0
- package/dist/modules/documents/backend/documents/useDocumentsList.js +314 -0
- package/dist/modules/documents/backend/documents/useDocumentsList.js.map +7 -0
- package/dist/modules/documents/ce.js +8 -0
- package/dist/modules/documents/ce.js.map +7 -0
- package/dist/modules/documents/commands/aggregate.js +99 -0
- package/dist/modules/documents/commands/aggregate.js.map +7 -0
- package/dist/modules/documents/commands/attachments.js +252 -0
- package/dist/modules/documents/commands/attachments.js.map +7 -0
- package/dist/modules/documents/commands/comments.js +782 -0
- package/dist/modules/documents/commands/comments.js.map +7 -0
- package/dist/modules/documents/commands/content.js +238 -0
- package/dist/modules/documents/commands/content.js.map +7 -0
- package/dist/modules/documents/commands/document-crud.js +505 -0
- package/dist/modules/documents/commands/document-crud.js.map +7 -0
- package/dist/modules/documents/commands/documents.js +473 -0
- package/dist/modules/documents/commands/documents.js.map +7 -0
- package/dist/modules/documents/commands/duplicate.js +640 -0
- package/dist/modules/documents/commands/duplicate.js.map +7 -0
- package/dist/modules/documents/commands/favorites.js +150 -0
- package/dist/modules/documents/commands/favorites.js.map +7 -0
- package/dist/modules/documents/commands/folders.js +420 -0
- package/dist/modules/documents/commands/folders.js.map +7 -0
- package/dist/modules/documents/commands/index.js +64 -0
- package/dist/modules/documents/commands/index.js.map +7 -0
- package/dist/modules/documents/commands/interceptors.js +300 -0
- package/dist/modules/documents/commands/interceptors.js.map +7 -0
- package/dist/modules/documents/commands/lifecycle.js +249 -0
- package/dist/modules/documents/commands/lifecycle.js.map +7 -0
- package/dist/modules/documents/commands/links.js +410 -0
- package/dist/modules/documents/commands/links.js.map +7 -0
- package/dist/modules/documents/commands/mutation-helpers.js +42 -0
- package/dist/modules/documents/commands/mutation-helpers.js.map +7 -0
- package/dist/modules/documents/commands/projection-types.js +1 -0
- package/dist/modules/documents/commands/projection-types.js.map +7 -0
- package/dist/modules/documents/commands/shared.js +143 -0
- package/dist/modules/documents/commands/shared.js.map +7 -0
- package/dist/modules/documents/commands/shares.js +527 -0
- package/dist/modules/documents/commands/shares.js.map +7 -0
- package/dist/modules/documents/commands/side-effects.js +103 -0
- package/dist/modules/documents/commands/side-effects.js.map +7 -0
- package/dist/modules/documents/commands/templates.js +461 -0
- package/dist/modules/documents/commands/templates.js.map +7 -0
- package/dist/modules/documents/commands/versions.js +432 -0
- package/dist/modules/documents/commands/versions.js.map +7 -0
- package/dist/modules/documents/commands/watchers.js +164 -0
- package/dist/modules/documents/commands/watchers.js.map +7 -0
- package/dist/modules/documents/data/entities.js +653 -0
- package/dist/modules/documents/data/entities.js.map +7 -0
- package/dist/modules/documents/data/extensions.js +44 -0
- package/dist/modules/documents/data/extensions.js.map +7 -0
- package/dist/modules/documents/data/validators.js +219 -0
- package/dist/modules/documents/data/validators.js.map +7 -0
- package/dist/modules/documents/di.js +35 -0
- package/dist/modules/documents/di.js.map +7 -0
- package/dist/modules/documents/encryption.js +12 -0
- package/dist/modules/documents/encryption.js.map +7 -0
- package/dist/modules/documents/events.js +27 -0
- package/dist/modules/documents/events.js.map +7 -0
- package/dist/modules/documents/index.js +19 -0
- package/dist/modules/documents/index.js.map +7 -0
- package/dist/modules/documents/lib/attachmentServicePort.js +30 -0
- package/dist/modules/documents/lib/attachmentServicePort.js.map +7 -0
- package/dist/modules/documents/lib/capabilities.js +32 -0
- package/dist/modules/documents/lib/capabilities.js.map +7 -0
- package/dist/modules/documents/lib/collabCloseEvents.js +17 -0
- package/dist/modules/documents/lib/collabCloseEvents.js.map +7 -0
- package/dist/modules/documents/lib/collabEndpoint.js +22 -0
- package/dist/modules/documents/lib/collabEndpoint.js.map +7 -0
- package/dist/modules/documents/lib/collabMaterializer.js +107 -0
- package/dist/modules/documents/lib/collabMaterializer.js.map +7 -0
- package/dist/modules/documents/lib/collabToken.js +120 -0
- package/dist/modules/documents/lib/collabToken.js.map +7 -0
- package/dist/modules/documents/lib/collaborationAwareness.js +68 -0
- package/dist/modules/documents/lib/collaborationAwareness.js.map +7 -0
- package/dist/modules/documents/lib/commentAnchors.js +15 -0
- package/dist/modules/documents/lib/commentAnchors.js.map +7 -0
- package/dist/modules/documents/lib/constants.js +25 -0
- package/dist/modules/documents/lib/constants.js.map +7 -0
- package/dist/modules/documents/lib/contentService.js +248 -0
- package/dist/modules/documents/lib/contentService.js.map +7 -0
- package/dist/modules/documents/lib/displayLabels.js +23 -0
- package/dist/modules/documents/lib/displayLabels.js.map +7 -0
- package/dist/modules/documents/lib/docxRenderer.js +601 -0
- package/dist/modules/documents/lib/docxRenderer.js.map +7 -0
- package/dist/modules/documents/lib/duplicateContent.js +22 -0
- package/dist/modules/documents/lib/duplicateContent.js.map +7 -0
- package/dist/modules/documents/lib/editorConfig.js +287 -0
- package/dist/modules/documents/lib/editorConfig.js.map +7 -0
- package/dist/modules/documents/lib/entityLinks.js +148 -0
- package/dist/modules/documents/lib/entityLinks.js.map +7 -0
- package/dist/modules/documents/lib/entityRegistry.js +258 -0
- package/dist/modules/documents/lib/entityRegistry.js.map +7 -0
- package/dist/modules/documents/lib/entityRegistry.server.js +189 -0
- package/dist/modules/documents/lib/entityRegistry.server.js.map +7 -0
- package/dist/modules/documents/lib/entityRegistryAvailability.server.js +9 -0
- package/dist/modules/documents/lib/entityRegistryAvailability.server.js.map +7 -0
- package/dist/modules/documents/lib/entitySuggestion.js +50 -0
- package/dist/modules/documents/lib/entitySuggestion.js.map +7 -0
- package/dist/modules/documents/lib/favorites.js +22 -0
- package/dist/modules/documents/lib/favorites.js.map +7 -0
- package/dist/modules/documents/lib/folderHierarchySerialization.js +19 -0
- package/dist/modules/documents/lib/folderHierarchySerialization.js.map +7 -0
- package/dist/modules/documents/lib/historyLimits.js +100 -0
- package/dist/modules/documents/lib/historyLimits.js.map +7 -0
- package/dist/modules/documents/lib/historyPolicy.js +14 -0
- package/dist/modules/documents/lib/historyPolicy.js.map +7 -0
- package/dist/modules/documents/lib/organizationAccess.js +17 -0
- package/dist/modules/documents/lib/organizationAccess.js.map +7 -0
- package/dist/modules/documents/lib/pdfHtml.js +62 -0
- package/dist/modules/documents/lib/pdfHtml.js.map +7 -0
- package/dist/modules/documents/lib/pdfRenderer.js +284 -0
- package/dist/modules/documents/lib/pdfRenderer.js.map +7 -0
- package/dist/modules/documents/lib/permissions.js +222 -0
- package/dist/modules/documents/lib/permissions.js.map +7 -0
- package/dist/modules/documents/lib/platformServices.js +35 -0
- package/dist/modules/documents/lib/platformServices.js.map +7 -0
- package/dist/modules/documents/lib/recordFieldInsertion.js +58 -0
- package/dist/modules/documents/lib/recordFieldInsertion.js.map +7 -0
- package/dist/modules/documents/lib/requestBody.js +80 -0
- package/dist/modules/documents/lib/requestBody.js.map +7 -0
- package/dist/modules/documents/lib/resourceLimits.js +62 -0
- package/dist/modules/documents/lib/resourceLimits.js.map +7 -0
- package/dist/modules/documents/lib/shareCounts.js +25 -0
- package/dist/modules/documents/lib/shareCounts.js.map +7 -0
- package/dist/modules/documents/lib/templateFill.js +84 -0
- package/dist/modules/documents/lib/templateFill.js.map +7 -0
- package/dist/modules/documents/lib/templateInstantiation.js +147 -0
- package/dist/modules/documents/lib/templateInstantiation.js.map +7 -0
- package/dist/modules/documents/lib/templatePreviewDigest.js +82 -0
- package/dist/modules/documents/lib/templatePreviewDigest.js.map +7 -0
- package/dist/modules/documents/lib/templateSeeds.js +201 -0
- package/dist/modules/documents/lib/templateSeeds.js.map +7 -0
- package/dist/modules/documents/lib/userLabels.js +37 -0
- package/dist/modules/documents/lib/userLabels.js.map +7 -0
- package/dist/modules/documents/lib/versionContent.js +131 -0
- package/dist/modules/documents/lib/versionContent.js.map +7 -0
- package/dist/modules/documents/lib/versionLabels.js +12 -0
- package/dist/modules/documents/lib/versionLabels.js.map +7 -0
- package/dist/modules/documents/lib/versioning.js +14 -0
- package/dist/modules/documents/lib/versioning.js.map +7 -0
- package/dist/modules/documents/lib/visibility.js +422 -0
- package/dist/modules/documents/lib/visibility.js.map +7 -0
- package/dist/modules/documents/lib/watchers.js +106 -0
- package/dist/modules/documents/lib/watchers.js.map +7 -0
- package/dist/modules/documents/migrations/Migration20260708163836_documents.js +44 -0
- package/dist/modules/documents/migrations/Migration20260708163836_documents.js.map +7 -0
- package/dist/modules/documents/migrations/Migration20260709164720_documents.js +17 -0
- package/dist/modules/documents/migrations/Migration20260709164720_documents.js.map +7 -0
- package/dist/modules/documents/migrations/Migration20260710002318_documents.js +32 -0
- package/dist/modules/documents/migrations/Migration20260710002318_documents.js.map +7 -0
- package/dist/modules/documents/migrations/Migration20260710071003_documents.js +13 -0
- package/dist/modules/documents/migrations/Migration20260710071003_documents.js.map +7 -0
- package/dist/modules/documents/migrations/Migration20260712120000_documents.js +13 -0
- package/dist/modules/documents/migrations/Migration20260712120000_documents.js.map +7 -0
- package/dist/modules/documents/migrations/Migration20260712183000_documents.js +14 -0
- package/dist/modules/documents/migrations/Migration20260712183000_documents.js.map +7 -0
- package/dist/modules/documents/migrations/Migration20260713092156_documents.js +29 -0
- package/dist/modules/documents/migrations/Migration20260713092156_documents.js.map +7 -0
- package/dist/modules/documents/migrations/Migration20260717000000_documents.js +37 -0
- package/dist/modules/documents/migrations/Migration20260717000000_documents.js.map +7 -0
- package/dist/modules/documents/notifications.js +47 -0
- package/dist/modules/documents/notifications.js.map +7 -0
- package/dist/modules/documents/search.js +101 -0
- package/dist/modules/documents/search.js.map +7 -0
- package/dist/modules/documents/setup.js +19 -0
- package/dist/modules/documents/setup.js.map +7 -0
- package/dist/modules/documents/widgets/injection/related-documents/LinkDocumentDialog.js +214 -0
- package/dist/modules/documents/widgets/injection/related-documents/LinkDocumentDialog.js.map +7 -0
- package/dist/modules/documents/widgets/injection/related-documents/context.js +84 -0
- package/dist/modules/documents/widgets/injection/related-documents/context.js.map +7 -0
- package/dist/modules/documents/widgets/injection/related-documents/useRelatedDocuments.js +98 -0
- package/dist/modules/documents/widgets/injection/related-documents/useRelatedDocuments.js.map +7 -0
- package/dist/modules/documents/widgets/injection/related-documents/widget.client.js +83 -0
- package/dist/modules/documents/widgets/injection/related-documents/widget.client.js.map +7 -0
- package/dist/modules/documents/widgets/injection/related-documents/widget.js +19 -0
- package/dist/modules/documents/widgets/injection/related-documents/widget.js.map +7 -0
- package/dist/modules/documents/widgets/injection-table.js +21 -0
- package/dist/modules/documents/widgets/injection-table.js.map +7 -0
- package/dist/server/documents-collab-server.js +2260 -0
- package/dist/server/documents-collab-server.js.map +7 -0
- package/generated/entities/document/index.ts +12 -0
- package/generated/entities/document_attachment/index.ts +9 -0
- package/generated/entities/document_comment/index.ts +14 -0
- package/generated/entities/document_content/index.ts +11 -0
- package/generated/entities/document_entity_link/index.ts +19 -0
- package/generated/entities/document_favorite/index.ts +7 -0
- package/generated/entities/document_folder/index.ts +9 -0
- package/generated/entities/document_share/index.ts +11 -0
- package/generated/entities/document_template/index.ts +13 -0
- package/generated/entities/document_version/index.ts +9 -0
- package/generated/entities/document_watcher/index.ts +7 -0
- package/generated/entities.ids.generated.ts +21 -0
- package/generated/entity-fields-registry.ts +151 -0
- package/jest.config.cjs +34 -0
- package/package.json +149 -0
- package/server/documents-collab-server.ts +3416 -0
- package/src/index.ts +1 -0
- package/src/modules/documents/acl.ts +11 -0
- package/src/modules/documents/api/[id]/archive/route.ts +132 -0
- package/src/modules/documents/api/[id]/attachments/[attachmentId]/route.ts +166 -0
- package/src/modules/documents/api/[id]/attachments/route.ts +173 -0
- package/src/modules/documents/api/[id]/collab-token/route.ts +203 -0
- package/src/modules/documents/api/[id]/comments/access-check/route.ts +96 -0
- package/src/modules/documents/api/[id]/comments/route.ts +442 -0
- package/src/modules/documents/api/[id]/content/route.ts +156 -0
- package/src/modules/documents/api/[id]/duplicate/route.ts +231 -0
- package/src/modules/documents/api/[id]/export/route.ts +535 -0
- package/src/modules/documents/api/[id]/favorite/route.ts +110 -0
- package/src/modules/documents/api/[id]/links/[linkId]/route.ts +92 -0
- package/src/modules/documents/api/[id]/links/route.ts +301 -0
- package/src/modules/documents/api/[id]/principals/route.ts +375 -0
- package/src/modules/documents/api/[id]/route.ts +267 -0
- package/src/modules/documents/api/[id]/shares/route.ts +372 -0
- package/src/modules/documents/api/[id]/unarchive/route.ts +42 -0
- package/src/modules/documents/api/[id]/versions/[versionId]/restore/route.ts +152 -0
- package/src/modules/documents/api/[id]/versions/[versionId]/route.ts +100 -0
- package/src/modules/documents/api/[id]/versions/route.ts +207 -0
- package/src/modules/documents/api/[id]/watch/route.ts +111 -0
- package/src/modules/documents/api/_commands.ts +53 -0
- package/src/modules/documents/api/_shared.ts +676 -0
- package/src/modules/documents/api/folders/route.ts +287 -0
- package/src/modules/documents/api/instantiate/route.ts +114 -0
- package/src/modules/documents/api/route.ts +362 -0
- package/src/modules/documents/api/templates/[templateId]/preview/route.ts +97 -0
- package/src/modules/documents/api/templates/[templateId]/route.ts +92 -0
- package/src/modules/documents/api/templates/route.ts +370 -0
- package/src/modules/documents/backend/documents/DocumentsPageClient.tsx +150 -0
- package/src/modules/documents/backend/documents/DocumentsTable.tsx +168 -0
- package/src/modules/documents/backend/documents/FolderDialog.tsx +62 -0
- package/src/modules/documents/backend/documents/FolderTree.tsx +72 -0
- package/src/modules/documents/backend/documents/MoveDocumentDialog.tsx +70 -0
- package/src/modules/documents/backend/documents/[id]/CommentAnchorNavigation.ts +88 -0
- package/src/modules/documents/backend/documents/[id]/CommentComposer.tsx +136 -0
- package/src/modules/documents/backend/documents/[id]/CommentThreadList.tsx +131 -0
- package/src/modules/documents/backend/documents/[id]/CommentsRail.tsx +138 -0
- package/src/modules/documents/backend/documents/[id]/DocumentCanvas.tsx +111 -0
- package/src/modules/documents/backend/documents/[id]/DocumentEditorErrorBoundary.tsx +39 -0
- package/src/modules/documents/backend/documents/[id]/DocumentEditorIsland.tsx +50 -0
- package/src/modules/documents/backend/documents/[id]/DocumentEditorSurface.tsx +162 -0
- package/src/modules/documents/backend/documents/[id]/DocumentNavigator.tsx +129 -0
- package/src/modules/documents/backend/documents/[id]/DocumentPageClient.tsx +463 -0
- package/src/modules/documents/backend/documents/[id]/EditorColorTools.tsx +71 -0
- package/src/modules/documents/backend/documents/[id]/EditorStatusPresence.tsx +78 -0
- package/src/modules/documents/backend/documents/[id]/EditorToolbar.tsx +108 -0
- package/src/modules/documents/backend/documents/[id]/ExportMenu.tsx +144 -0
- package/src/modules/documents/backend/documents/[id]/MentionPicker.tsx +137 -0
- package/src/modules/documents/backend/documents/[id]/OutlinePane.tsx +98 -0
- package/src/modules/documents/backend/documents/[id]/RecordFieldsDialog.tsx +185 -0
- package/src/modules/documents/backend/documents/[id]/RelatedRecordsPanel.tsx +320 -0
- package/src/modules/documents/backend/documents/[id]/VersionHistoryPanel.tsx +244 -0
- package/src/modules/documents/backend/documents/[id]/VersionPreviewDialog.tsx +197 -0
- package/src/modules/documents/backend/documents/[id]/commentTypes.ts +192 -0
- package/src/modules/documents/backend/documents/[id]/componentCapabilities.ts +17 -0
- package/src/modules/documents/backend/documents/[id]/documentPagination.ts +352 -0
- package/src/modules/documents/backend/documents/[id]/editorPresenceStyles.ts +77 -0
- package/src/modules/documents/backend/documents/[id]/editorTypes.ts +84 -0
- package/src/modules/documents/backend/documents/[id]/page.meta.ts +12 -0
- package/src/modules/documents/backend/documents/[id]/page.tsx +6 -0
- package/src/modules/documents/backend/documents/[id]/relatedRecordModel.ts +49 -0
- package/src/modules/documents/backend/documents/[id]/restoreVersion.ts +49 -0
- package/src/modules/documents/backend/documents/[id]/useDocumentCollaboration.ts +458 -0
- package/src/modules/documents/backend/documents/[id]/useDocumentComments.ts +286 -0
- package/src/modules/documents/backend/documents/[id]/useDocumentEditor.ts +157 -0
- package/src/modules/documents/backend/documents/[id]/useDocumentTitle.ts +77 -0
- package/src/modules/documents/backend/documents/[id]/useEditorInsertions.ts +147 -0
- package/src/modules/documents/backend/documents/[id]/useFallbackContentPersistence.ts +277 -0
- package/src/modules/documents/backend/documents/[id]/useMentionPicker.ts +259 -0
- package/src/modules/documents/backend/documents/[id]/versionHistoryModel.ts +29 -0
- package/src/modules/documents/backend/documents/components/EntityPicker.tsx +171 -0
- package/src/modules/documents/backend/documents/components/EntityPickerResults.tsx +64 -0
- package/src/modules/documents/backend/documents/components/NewFromTemplateDialog.tsx +136 -0
- package/src/modules/documents/backend/documents/components/PrincipalPicker.tsx +90 -0
- package/src/modules/documents/backend/documents/components/ShareDialog.tsx +88 -0
- package/src/modules/documents/backend/documents/components/ShareDialogAddForm.tsx +113 -0
- package/src/modules/documents/backend/documents/components/ShareDialogList.tsx +117 -0
- package/src/modules/documents/backend/documents/components/TemplateBodyEditor.tsx +96 -0
- package/src/modules/documents/backend/documents/components/TemplateEditorDialog.tsx +171 -0
- package/src/modules/documents/backend/documents/components/TemplatePreview.tsx +43 -0
- package/src/modules/documents/backend/documents/components/TemplateSlotFields.tsx +72 -0
- package/src/modules/documents/backend/documents/components/TemplateSlotsEditor.tsx +72 -0
- package/src/modules/documents/backend/documents/components/principalPickerModel.ts +86 -0
- package/src/modules/documents/backend/documents/components/shareDialogModel.ts +94 -0
- package/src/modules/documents/backend/documents/components/templateUi.ts +128 -0
- package/src/modules/documents/backend/documents/components/useAvailableEntityRegistry.ts +43 -0
- package/src/modules/documents/backend/documents/components/useEntitySearch.ts +197 -0
- package/src/modules/documents/backend/documents/components/usePrincipalPicker.ts +165 -0
- package/src/modules/documents/backend/documents/components/useShareDialog.ts +267 -0
- package/src/modules/documents/backend/documents/components/useTemplateDetail.ts +54 -0
- package/src/modules/documents/backend/documents/components/useTemplateInstantiation.ts +252 -0
- package/src/modules/documents/backend/documents/documentUi.ts +134 -0
- package/src/modules/documents/backend/documents/documentsListTypes.ts +163 -0
- package/src/modules/documents/backend/documents/page.meta.ts +24 -0
- package/src/modules/documents/backend/documents/page.tsx +5 -0
- package/src/modules/documents/backend/documents/templates/TemplatesPageClient.tsx +93 -0
- package/src/modules/documents/backend/documents/templates/TemplatesTable.tsx +71 -0
- package/src/modules/documents/backend/documents/templates/page.meta.ts +32 -0
- package/src/modules/documents/backend/documents/templates/page.tsx +5 -0
- package/src/modules/documents/backend/documents/templates/useTemplatesPage.tsx +148 -0
- package/src/modules/documents/backend/documents/useDocumentsList.tsx +305 -0
- package/src/modules/documents/ce.ts +6 -0
- package/src/modules/documents/commands/aggregate.ts +128 -0
- package/src/modules/documents/commands/attachments.ts +309 -0
- package/src/modules/documents/commands/comments.ts +966 -0
- package/src/modules/documents/commands/content.ts +294 -0
- package/src/modules/documents/commands/document-crud.ts +609 -0
- package/src/modules/documents/commands/documents.ts +581 -0
- package/src/modules/documents/commands/duplicate.ts +772 -0
- package/src/modules/documents/commands/favorites.ts +171 -0
- package/src/modules/documents/commands/folders.ts +506 -0
- package/src/modules/documents/commands/index.ts +33 -0
- package/src/modules/documents/commands/interceptors.ts +402 -0
- package/src/modules/documents/commands/lifecycle.ts +333 -0
- package/src/modules/documents/commands/links.ts +486 -0
- package/src/modules/documents/commands/mutation-helpers.ts +48 -0
- package/src/modules/documents/commands/projection-types.ts +77 -0
- package/src/modules/documents/commands/shared.ts +219 -0
- package/src/modules/documents/commands/shares.ts +612 -0
- package/src/modules/documents/commands/side-effects.ts +130 -0
- package/src/modules/documents/commands/templates.ts +522 -0
- package/src/modules/documents/commands/versions.ts +537 -0
- package/src/modules/documents/commands/watchers.ts +181 -0
- package/src/modules/documents/data/entities.ts +631 -0
- package/src/modules/documents/data/extensions.ts +42 -0
- package/src/modules/documents/data/validators.ts +248 -0
- package/src/modules/documents/di.ts +33 -0
- package/src/modules/documents/encryption.ts +14 -0
- package/src/modules/documents/events.ts +23 -0
- package/src/modules/documents/i18n/.hardcoded-allowlist.json +9 -0
- package/src/modules/documents/i18n/de.json +522 -0
- package/src/modules/documents/i18n/en.json +522 -0
- package/src/modules/documents/i18n/es.json +522 -0
- package/src/modules/documents/i18n/ko.json +522 -0
- package/src/modules/documents/i18n/pl.json +522 -0
- package/src/modules/documents/index.ts +17 -0
- package/src/modules/documents/lib/attachmentServicePort.ts +94 -0
- package/src/modules/documents/lib/capabilities.ts +57 -0
- package/src/modules/documents/lib/collabCloseEvents.ts +26 -0
- package/src/modules/documents/lib/collabEndpoint.ts +43 -0
- package/src/modules/documents/lib/collabMaterializer.ts +140 -0
- package/src/modules/documents/lib/collabToken.ts +170 -0
- package/src/modules/documents/lib/collaborationAwareness.ts +102 -0
- package/src/modules/documents/lib/commentAnchors.ts +19 -0
- package/src/modules/documents/lib/constants.ts +39 -0
- package/src/modules/documents/lib/contentService.ts +340 -0
- package/src/modules/documents/lib/displayLabels.ts +31 -0
- package/src/modules/documents/lib/docxRenderer.ts +685 -0
- package/src/modules/documents/lib/duplicateContent.ts +32 -0
- package/src/modules/documents/lib/editorConfig.ts +371 -0
- package/src/modules/documents/lib/entityLinks.ts +250 -0
- package/src/modules/documents/lib/entityRegistry.server.ts +267 -0
- package/src/modules/documents/lib/entityRegistry.ts +345 -0
- package/src/modules/documents/lib/entityRegistryAvailability.server.ts +19 -0
- package/src/modules/documents/lib/entitySuggestion.ts +61 -0
- package/src/modules/documents/lib/favorites.ts +35 -0
- package/src/modules/documents/lib/folderHierarchySerialization.ts +34 -0
- package/src/modules/documents/lib/historyLimits.ts +154 -0
- package/src/modules/documents/lib/historyPolicy.ts +7 -0
- package/src/modules/documents/lib/organizationAccess.ts +44 -0
- package/src/modules/documents/lib/pdfHtml.ts +65 -0
- package/src/modules/documents/lib/pdfRenderer.ts +367 -0
- package/src/modules/documents/lib/permissions.ts +299 -0
- package/src/modules/documents/lib/platformServices.ts +70 -0
- package/src/modules/documents/lib/recordFieldInsertion.ts +72 -0
- package/src/modules/documents/lib/requestBody.ts +97 -0
- package/src/modules/documents/lib/resourceLimits.ts +94 -0
- package/src/modules/documents/lib/shareCounts.ts +44 -0
- package/src/modules/documents/lib/templateFill.ts +138 -0
- package/src/modules/documents/lib/templateInstantiation.ts +206 -0
- package/src/modules/documents/lib/templatePreviewDigest.ts +122 -0
- package/src/modules/documents/lib/templateSeeds.ts +248 -0
- package/src/modules/documents/lib/userLabels.ts +58 -0
- package/src/modules/documents/lib/versionContent.ts +163 -0
- package/src/modules/documents/lib/versionLabels.ts +9 -0
- package/src/modules/documents/lib/versioning.ts +29 -0
- package/src/modules/documents/lib/visibility.ts +610 -0
- package/src/modules/documents/lib/watchers.ts +129 -0
- package/src/modules/documents/migrations/.snapshot-open-mercato.json +2892 -0
- package/src/modules/documents/migrations/Migration20260708163836_documents.ts +50 -0
- package/src/modules/documents/migrations/Migration20260709164720_documents.ts +19 -0
- package/src/modules/documents/migrations/Migration20260710002318_documents.ts +35 -0
- package/src/modules/documents/migrations/Migration20260710071003_documents.ts +13 -0
- package/src/modules/documents/migrations/Migration20260712120000_documents.ts +13 -0
- package/src/modules/documents/migrations/Migration20260712183000_documents.ts +12 -0
- package/src/modules/documents/migrations/Migration20260713092156_documents.ts +43 -0
- package/src/modules/documents/migrations/Migration20260717000000_documents.ts +40 -0
- package/src/modules/documents/notifications.ts +45 -0
- package/src/modules/documents/search.ts +118 -0
- package/src/modules/documents/setup.ts +19 -0
- package/src/modules/documents/widgets/injection/related-documents/LinkDocumentDialog.tsx +224 -0
- package/src/modules/documents/widgets/injection/related-documents/context.ts +101 -0
- package/src/modules/documents/widgets/injection/related-documents/useRelatedDocuments.ts +112 -0
- package/src/modules/documents/widgets/injection/related-documents/widget.client.tsx +76 -0
- package/src/modules/documents/widgets/injection/related-documents/widget.ts +19 -0
- package/src/modules/documents/widgets/injection-table.ts +20 -0
- package/tsconfig.json +9 -0
- package/watch.mjs +6 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Migration } from "@mikro-orm/migrations";
|
|
2
|
+
class Migration20260708163836_documents extends Migration {
|
|
3
|
+
up() {
|
|
4
|
+
this.addSql(`create table "documents" ("id" uuid not null default gen_random_uuid(), "organization_id" uuid not null, "tenant_id" uuid not null, "title" varchar(512) not null, "folder_id" uuid null, "owner_user_id" uuid not null, "created_by_user_id" uuid not null, "is_active" boolean not null default true, "created_at" timestamptz not null, "updated_at" timestamptz not null, "deleted_at" timestamptz null, primary key ("id"));`);
|
|
5
|
+
this.addSql(`create index "documents_owner_idx" on "documents" ("owner_user_id");`);
|
|
6
|
+
this.addSql(`create index "documents_folder_idx" on "documents" ("folder_id");`);
|
|
7
|
+
this.addSql(`create index "documents_scope_idx" on "documents" ("organization_id", "tenant_id", "deleted_at");`);
|
|
8
|
+
this.addSql(`create table "document_attachments" ("id" uuid not null default gen_random_uuid(), "organization_id" uuid not null, "tenant_id" uuid not null, "document_id" uuid not null, "attachment_id" uuid not null, "created_by_user_id" uuid not null, "created_at" timestamptz not null, "deleted_at" timestamptz null, primary key ("id"));`);
|
|
9
|
+
this.addSql(`create index "document_attachments_attachment_idx" on "document_attachments" ("attachment_id");`);
|
|
10
|
+
this.addSql(`create index "document_attachments_document_idx" on "document_attachments" ("document_id");`);
|
|
11
|
+
this.addSql(`create index "document_attachments_scope_idx" on "document_attachments" ("organization_id", "tenant_id", "deleted_at");`);
|
|
12
|
+
this.addSql(`create table "document_comments" ("id" uuid not null default gen_random_uuid(), "organization_id" uuid not null, "tenant_id" uuid not null, "document_id" uuid not null, "parent_comment_id" uuid null, "author_user_id" uuid not null, "body" text not null, "anchor" jsonb null, "resolved_at" timestamptz null, "resolved_by_user_id" uuid null, "created_at" timestamptz not null, "updated_at" timestamptz not null, "deleted_at" timestamptz null, primary key ("id"));`);
|
|
13
|
+
this.addSql(`create index "document_comments_parent_idx" on "document_comments" ("parent_comment_id");`);
|
|
14
|
+
this.addSql(`create index "document_comments_document_idx" on "document_comments" ("document_id");`);
|
|
15
|
+
this.addSql(`create index "document_comments_scope_idx" on "document_comments" ("organization_id", "tenant_id", "deleted_at");`);
|
|
16
|
+
this.addSql(`create table "document_contents" ("id" uuid not null default gen_random_uuid(), "document_id" uuid not null, "organization_id" uuid not null, "tenant_id" uuid not null, "yjs_state" bytea null, "content_html" text null, "content_text" text null, "created_at" timestamptz not null, "updated_at" timestamptz not null, "deleted_at" timestamptz null, primary key ("id"));`);
|
|
17
|
+
this.addSql(`create index "document_contents_scope_idx" on "document_contents" ("organization_id", "tenant_id");`);
|
|
18
|
+
this.addSql(`alter table "document_contents" add constraint "document_contents_document_unique" unique ("document_id");`);
|
|
19
|
+
this.addSql(`create table "document_folders" ("id" uuid not null default gen_random_uuid(), "organization_id" uuid not null, "tenant_id" uuid not null, "name" varchar(256) not null, "parent_folder_id" uuid null, "owner_user_id" uuid not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, "deleted_at" timestamptz null, primary key ("id"));`);
|
|
20
|
+
this.addSql(`create index "document_folders_owner_idx" on "document_folders" ("owner_user_id");`);
|
|
21
|
+
this.addSql(`create index "document_folders_parent_idx" on "document_folders" ("parent_folder_id");`);
|
|
22
|
+
this.addSql(`create index "document_folders_scope_idx" on "document_folders" ("organization_id", "tenant_id", "deleted_at");`);
|
|
23
|
+
this.addSql(`create table "document_shares" ("id" uuid not null default gen_random_uuid(), "organization_id" uuid not null, "tenant_id" uuid not null, "document_id" uuid not null, "principal_type" varchar(16) not null, "principal_id" uuid not null, "permission" varchar(16) not null, "created_by_user_id" uuid not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, "deleted_at" timestamptz null, primary key ("id"));`);
|
|
24
|
+
this.addSql(`create unique index "document_shares_active_principal_unique" on "document_shares" ("document_id", "principal_type", "principal_id") where "deleted_at" is null;`);
|
|
25
|
+
this.addSql(`create index "document_shares_document_idx" on "document_shares" ("document_id");`);
|
|
26
|
+
this.addSql(`create index "document_shares_scope_idx" on "document_shares" ("organization_id", "tenant_id", "deleted_at");`);
|
|
27
|
+
this.addSql(`create table "document_versions" ("id" uuid not null default gen_random_uuid(), "organization_id" uuid not null, "tenant_id" uuid not null, "document_id" uuid not null, "label" varchar(256) null, "yjs_snapshot" bytea not null, "content_html" text null, "created_by_user_id" uuid not null, "created_at" timestamptz not null, primary key ("id"));`);
|
|
28
|
+
this.addSql(`create index "document_versions_document_idx" on "document_versions" ("document_id", "created_at");`);
|
|
29
|
+
this.addSql(`create index "document_versions_scope_idx" on "document_versions" ("organization_id", "tenant_id");`);
|
|
30
|
+
}
|
|
31
|
+
down() {
|
|
32
|
+
this.addSql(`drop table if exists "document_versions" cascade;`);
|
|
33
|
+
this.addSql(`drop table if exists "document_shares" cascade;`);
|
|
34
|
+
this.addSql(`drop table if exists "document_folders" cascade;`);
|
|
35
|
+
this.addSql(`drop table if exists "document_contents" cascade;`);
|
|
36
|
+
this.addSql(`drop table if exists "document_comments" cascade;`);
|
|
37
|
+
this.addSql(`drop table if exists "document_attachments" cascade;`);
|
|
38
|
+
this.addSql(`drop table if exists "documents" cascade;`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
Migration20260708163836_documents
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=Migration20260708163836_documents.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/documents/migrations/Migration20260708163836_documents.ts"],
|
|
4
|
+
"sourcesContent": ["import { Migration } from '@mikro-orm/migrations';\n\nexport class Migration20260708163836_documents extends Migration {\n\n override up(): void | Promise<void> {\n this.addSql(`create table \"documents\" (\"id\" uuid not null default gen_random_uuid(), \"organization_id\" uuid not null, \"tenant_id\" uuid not null, \"title\" varchar(512) not null, \"folder_id\" uuid null, \"owner_user_id\" uuid not null, \"created_by_user_id\" uuid not null, \"is_active\" boolean not null default true, \"created_at\" timestamptz not null, \"updated_at\" timestamptz not null, \"deleted_at\" timestamptz null, primary key (\"id\"));`);\n this.addSql(`create index \"documents_owner_idx\" on \"documents\" (\"owner_user_id\");`);\n this.addSql(`create index \"documents_folder_idx\" on \"documents\" (\"folder_id\");`);\n this.addSql(`create index \"documents_scope_idx\" on \"documents\" (\"organization_id\", \"tenant_id\", \"deleted_at\");`);\n\n this.addSql(`create table \"document_attachments\" (\"id\" uuid not null default gen_random_uuid(), \"organization_id\" uuid not null, \"tenant_id\" uuid not null, \"document_id\" uuid not null, \"attachment_id\" uuid not null, \"created_by_user_id\" uuid not null, \"created_at\" timestamptz not null, \"deleted_at\" timestamptz null, primary key (\"id\"));`);\n this.addSql(`create index \"document_attachments_attachment_idx\" on \"document_attachments\" (\"attachment_id\");`);\n this.addSql(`create index \"document_attachments_document_idx\" on \"document_attachments\" (\"document_id\");`);\n this.addSql(`create index \"document_attachments_scope_idx\" on \"document_attachments\" (\"organization_id\", \"tenant_id\", \"deleted_at\");`);\n\n this.addSql(`create table \"document_comments\" (\"id\" uuid not null default gen_random_uuid(), \"organization_id\" uuid not null, \"tenant_id\" uuid not null, \"document_id\" uuid not null, \"parent_comment_id\" uuid null, \"author_user_id\" uuid not null, \"body\" text not null, \"anchor\" jsonb null, \"resolved_at\" timestamptz null, \"resolved_by_user_id\" uuid null, \"created_at\" timestamptz not null, \"updated_at\" timestamptz not null, \"deleted_at\" timestamptz null, primary key (\"id\"));`);\n this.addSql(`create index \"document_comments_parent_idx\" on \"document_comments\" (\"parent_comment_id\");`);\n this.addSql(`create index \"document_comments_document_idx\" on \"document_comments\" (\"document_id\");`);\n this.addSql(`create index \"document_comments_scope_idx\" on \"document_comments\" (\"organization_id\", \"tenant_id\", \"deleted_at\");`);\n\n this.addSql(`create table \"document_contents\" (\"id\" uuid not null default gen_random_uuid(), \"document_id\" uuid not null, \"organization_id\" uuid not null, \"tenant_id\" uuid not null, \"yjs_state\" bytea null, \"content_html\" text null, \"content_text\" text null, \"created_at\" timestamptz not null, \"updated_at\" timestamptz not null, \"deleted_at\" timestamptz null, primary key (\"id\"));`);\n this.addSql(`create index \"document_contents_scope_idx\" on \"document_contents\" (\"organization_id\", \"tenant_id\");`);\n this.addSql(`alter table \"document_contents\" add constraint \"document_contents_document_unique\" unique (\"document_id\");`);\n\n this.addSql(`create table \"document_folders\" (\"id\" uuid not null default gen_random_uuid(), \"organization_id\" uuid not null, \"tenant_id\" uuid not null, \"name\" varchar(256) not null, \"parent_folder_id\" uuid null, \"owner_user_id\" uuid not null, \"created_at\" timestamptz not null, \"updated_at\" timestamptz not null, \"deleted_at\" timestamptz null, primary key (\"id\"));`);\n this.addSql(`create index \"document_folders_owner_idx\" on \"document_folders\" (\"owner_user_id\");`);\n this.addSql(`create index \"document_folders_parent_idx\" on \"document_folders\" (\"parent_folder_id\");`);\n this.addSql(`create index \"document_folders_scope_idx\" on \"document_folders\" (\"organization_id\", \"tenant_id\", \"deleted_at\");`);\n\n this.addSql(`create table \"document_shares\" (\"id\" uuid not null default gen_random_uuid(), \"organization_id\" uuid not null, \"tenant_id\" uuid not null, \"document_id\" uuid not null, \"principal_type\" varchar(16) not null, \"principal_id\" uuid not null, \"permission\" varchar(16) not null, \"created_by_user_id\" uuid not null, \"created_at\" timestamptz not null, \"updated_at\" timestamptz not null, \"deleted_at\" timestamptz null, primary key (\"id\"));`);\n this.addSql(`create unique index \"document_shares_active_principal_unique\" on \"document_shares\" (\"document_id\", \"principal_type\", \"principal_id\") where \"deleted_at\" is null;`);\n this.addSql(`create index \"document_shares_document_idx\" on \"document_shares\" (\"document_id\");`);\n this.addSql(`create index \"document_shares_scope_idx\" on \"document_shares\" (\"organization_id\", \"tenant_id\", \"deleted_at\");`);\n\n this.addSql(`create table \"document_versions\" (\"id\" uuid not null default gen_random_uuid(), \"organization_id\" uuid not null, \"tenant_id\" uuid not null, \"document_id\" uuid not null, \"label\" varchar(256) null, \"yjs_snapshot\" bytea not null, \"content_html\" text null, \"created_by_user_id\" uuid not null, \"created_at\" timestamptz not null, primary key (\"id\"));`);\n this.addSql(`create index \"document_versions_document_idx\" on \"document_versions\" (\"document_id\", \"created_at\");`);\n this.addSql(`create index \"document_versions_scope_idx\" on \"document_versions\" (\"organization_id\", \"tenant_id\");`);\n }\n\n override down(): void | Promise<void> {\n this.addSql(`drop table if exists \"document_versions\" cascade;`);\n this.addSql(`drop table if exists \"document_shares\" cascade;`);\n this.addSql(`drop table if exists \"document_folders\" cascade;`);\n this.addSql(`drop table if exists \"document_contents\" cascade;`);\n this.addSql(`drop table if exists \"document_comments\" cascade;`);\n this.addSql(`drop table if exists \"document_attachments\" cascade;`);\n this.addSql(`drop table if exists \"documents\" cascade;`);\n }\n\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,iBAAiB;AAEnB,MAAM,0CAA0C,UAAU;AAAA,EAEtD,KAA2B;AAClC,SAAK,OAAO,maAAma;AAC/a,SAAK,OAAO,sEAAsE;AAClF,SAAK,OAAO,mEAAmE;AAC/E,SAAK,OAAO,mGAAmG;AAE/G,SAAK,OAAO,uUAAuU;AACnV,SAAK,OAAO,iGAAiG;AAC7G,SAAK,OAAO,6FAA6F;AACzG,SAAK,OAAO,yHAAyH;AAErI,SAAK,OAAO,+cAA+c;AAC3d,SAAK,OAAO,2FAA2F;AACvG,SAAK,OAAO,uFAAuF;AACnG,SAAK,OAAO,mHAAmH;AAE/H,SAAK,OAAO,gXAAgX;AAC5X,SAAK,OAAO,qGAAqG;AACjH,SAAK,OAAO,4GAA4G;AAExH,SAAK,OAAO,iWAAiW;AAC7W,SAAK,OAAO,oFAAoF;AAChG,SAAK,OAAO,wFAAwF;AACpG,SAAK,OAAO,iHAAiH;AAE7H,SAAK,OAAO,8aAA8a;AAC1b,SAAK,OAAO,kKAAkK;AAC9K,SAAK,OAAO,mFAAmF;AAC/F,SAAK,OAAO,+GAA+G;AAE3H,SAAK,OAAO,0VAA0V;AACtW,SAAK,OAAO,qGAAqG;AACjH,SAAK,OAAO,qGAAqG;AAAA,EACnH;AAAA,EAES,OAA6B;AACpC,SAAK,OAAO,mDAAmD;AAC/D,SAAK,OAAO,iDAAiD;AAC7D,SAAK,OAAO,kDAAkD;AAC9D,SAAK,OAAO,mDAAmD;AAC/D,SAAK,OAAO,mDAAmD;AAC/D,SAAK,OAAO,sDAAsD;AAClE,SAAK,OAAO,2CAA2C;AAAA,EACzD;AAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Migration } from "@mikro-orm/migrations";
|
|
2
|
+
class Migration20260709164720_documents extends Migration {
|
|
3
|
+
up() {
|
|
4
|
+
this.addSql(`create table "document_templates" ("id" uuid not null default gen_random_uuid(), "organization_id" uuid not null, "tenant_id" uuid not null, "name" varchar(256) not null, "description" text null, "body_html" text not null, "context_slots" jsonb null, "created_by_user_id" uuid not null, "is_active" boolean not null default true, "created_at" timestamptz not null, "updated_at" timestamptz not null, "deleted_at" timestamptz null, primary key ("id"));`);
|
|
5
|
+
this.addSql(`create index "document_templates_scope_idx" on "document_templates" ("organization_id", "tenant_id", "deleted_at");`);
|
|
6
|
+
this.addSql(`alter table "document_comments" add "mentions" jsonb null;`);
|
|
7
|
+
}
|
|
8
|
+
down() {
|
|
9
|
+
this.addSql(`alter table "document_comments" drop column "mentions";`);
|
|
10
|
+
this.addSql(`drop index if exists "document_templates_scope_idx";`);
|
|
11
|
+
this.addSql(`drop table if exists "document_templates" cascade;`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
Migration20260709164720_documents
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=Migration20260709164720_documents.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/documents/migrations/Migration20260709164720_documents.ts"],
|
|
4
|
+
"sourcesContent": ["import { Migration } from '@mikro-orm/migrations';\n\nexport class Migration20260709164720_documents extends Migration {\n\n override up(): void | Promise<void> {\n this.addSql(`create table \"document_templates\" (\"id\" uuid not null default gen_random_uuid(), \"organization_id\" uuid not null, \"tenant_id\" uuid not null, \"name\" varchar(256) not null, \"description\" text null, \"body_html\" text not null, \"context_slots\" jsonb null, \"created_by_user_id\" uuid not null, \"is_active\" boolean not null default true, \"created_at\" timestamptz not null, \"updated_at\" timestamptz not null, \"deleted_at\" timestamptz null, primary key (\"id\"));`);\n this.addSql(`create index \"document_templates_scope_idx\" on \"document_templates\" (\"organization_id\", \"tenant_id\", \"deleted_at\");`);\n\n this.addSql(`alter table \"document_comments\" add \"mentions\" jsonb null;`);\n }\n\n override down(): void | Promise<void> {\n this.addSql(`alter table \"document_comments\" drop column \"mentions\";`);\n\n this.addSql(`drop index if exists \"document_templates_scope_idx\";`);\n this.addSql(`drop table if exists \"document_templates\" cascade;`);\n }\n\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,iBAAiB;AAEnB,MAAM,0CAA0C,UAAU;AAAA,EAEtD,KAA2B;AAClC,SAAK,OAAO,qcAAqc;AACjd,SAAK,OAAO,qHAAqH;AAEjI,SAAK,OAAO,4DAA4D;AAAA,EAC1E;AAAA,EAES,OAA6B;AACpC,SAAK,OAAO,yDAAyD;AAErE,SAAK,OAAO,sDAAsD;AAClE,SAAK,OAAO,oDAAoD;AAAA,EAClE;AAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Migration } from "@mikro-orm/migrations";
|
|
2
|
+
class Migration20260710002318_documents extends Migration {
|
|
3
|
+
up() {
|
|
4
|
+
this.addSql(`create table "document_entity_links" ("id" uuid not null default gen_random_uuid(), "organization_id" uuid not null, "tenant_id" uuid not null, "document_id" uuid not null, "customer_entity_id" uuid null, "customer_kind" varchar(16) null, "deal_id" uuid null, "product_id" uuid null, "catalog_offer_id" uuid null, "quote_id" uuid null, "sales_order_id" uuid null, "label_snapshot" text not null, "href_snapshot" varchar(1024) not null, "source" varchar(24) not null, "created_by_user_id" uuid not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, "deleted_at" timestamptz null, primary key ("id"));`);
|
|
5
|
+
this.addSql(`create index "document_entity_links_sales_order_reverse_idx" on "document_entity_links" ("tenant_id", "organization_id", "sales_order_id") where "sales_order_id" is not null and "deleted_at" is null;`);
|
|
6
|
+
this.addSql(`create index "document_entity_links_quote_reverse_idx" on "document_entity_links" ("tenant_id", "organization_id", "quote_id") where "quote_id" is not null and "deleted_at" is null;`);
|
|
7
|
+
this.addSql(`create index "document_entity_links_catalog_offer_reverse_idx" on "document_entity_links" ("tenant_id", "organization_id", "catalog_offer_id") where "catalog_offer_id" is not null and "deleted_at" is null;`);
|
|
8
|
+
this.addSql(`create index "document_entity_links_product_reverse_idx" on "document_entity_links" ("tenant_id", "organization_id", "product_id") where "product_id" is not null and "deleted_at" is null;`);
|
|
9
|
+
this.addSql(`create index "document_entity_links_deal_reverse_idx" on "document_entity_links" ("tenant_id", "organization_id", "deal_id") where "deal_id" is not null and "deleted_at" is null;`);
|
|
10
|
+
this.addSql(`create index "document_entity_links_customer_reverse_idx" on "document_entity_links" ("tenant_id", "organization_id", "customer_entity_id") where "customer_entity_id" is not null and "deleted_at" is null;`);
|
|
11
|
+
this.addSql(`create unique index "document_entity_links_sales_order_active_uq" on "document_entity_links" ("document_id", "sales_order_id") where "sales_order_id" is not null and "deleted_at" is null;`);
|
|
12
|
+
this.addSql(`create unique index "document_entity_links_quote_active_uq" on "document_entity_links" ("document_id", "quote_id") where "quote_id" is not null and "deleted_at" is null;`);
|
|
13
|
+
this.addSql(`create unique index "document_entity_links_catalog_offer_active_uq" on "document_entity_links" ("document_id", "catalog_offer_id") where "catalog_offer_id" is not null and "deleted_at" is null;`);
|
|
14
|
+
this.addSql(`create unique index "document_entity_links_product_active_uq" on "document_entity_links" ("document_id", "product_id") where "product_id" is not null and "deleted_at" is null;`);
|
|
15
|
+
this.addSql(`create unique index "document_entity_links_deal_active_uq" on "document_entity_links" ("document_id", "deal_id") where "deal_id" is not null and "deleted_at" is null;`);
|
|
16
|
+
this.addSql(`create unique index "document_entity_links_customer_active_uq" on "document_entity_links" ("document_id", "customer_entity_id") where "customer_entity_id" is not null and "deleted_at" is null;`);
|
|
17
|
+
this.addSql(`create index "document_entity_links_document_lookup_idx" on "document_entity_links" ("tenant_id", "organization_id", "document_id", "deleted_at");`);
|
|
18
|
+
this.addSql(`alter table "document_entity_links" add constraint "document_entity_links_customer_kind_chk" check ((("customer_entity_id" is not null and "customer_kind" in ('person', 'company')) or ("customer_entity_id" is null and "customer_kind" is null)));`);
|
|
19
|
+
this.addSql(`alter table "document_entity_links" add constraint "document_entity_links_exactly_one_target_chk" check (num_nonnulls("customer_entity_id", "deal_id", "product_id", "catalog_offer_id", "quote_id", "sales_order_id") = 1);`);
|
|
20
|
+
this.addSql(`alter table "document_templates" add "seed_key" varchar(128) null;`);
|
|
21
|
+
this.addSql(`create unique index "document_templates_active_seed_key_uq" on "document_templates" ("tenant_id", "organization_id", "seed_key") where "seed_key" is not null and "deleted_at" is null;`);
|
|
22
|
+
}
|
|
23
|
+
down() {
|
|
24
|
+
this.addSql(`drop index if exists "document_templates_active_seed_key_uq";`);
|
|
25
|
+
this.addSql(`alter table "document_templates" drop column "seed_key";`);
|
|
26
|
+
this.addSql(`drop table if exists "document_entity_links" cascade;`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
Migration20260710002318_documents
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=Migration20260710002318_documents.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/documents/migrations/Migration20260710002318_documents.ts"],
|
|
4
|
+
"sourcesContent": ["import { Migration } from '@mikro-orm/migrations';\n\nexport class Migration20260710002318_documents extends Migration {\n\n override up(): void | Promise<void> {\n this.addSql(`create table \"document_entity_links\" (\"id\" uuid not null default gen_random_uuid(), \"organization_id\" uuid not null, \"tenant_id\" uuid not null, \"document_id\" uuid not null, \"customer_entity_id\" uuid null, \"customer_kind\" varchar(16) null, \"deal_id\" uuid null, \"product_id\" uuid null, \"catalog_offer_id\" uuid null, \"quote_id\" uuid null, \"sales_order_id\" uuid null, \"label_snapshot\" text not null, \"href_snapshot\" varchar(1024) not null, \"source\" varchar(24) not null, \"created_by_user_id\" uuid not null, \"created_at\" timestamptz not null, \"updated_at\" timestamptz not null, \"deleted_at\" timestamptz null, primary key (\"id\"));`);\n this.addSql(`create index \"document_entity_links_sales_order_reverse_idx\" on \"document_entity_links\" (\"tenant_id\", \"organization_id\", \"sales_order_id\") where \"sales_order_id\" is not null and \"deleted_at\" is null;`);\n this.addSql(`create index \"document_entity_links_quote_reverse_idx\" on \"document_entity_links\" (\"tenant_id\", \"organization_id\", \"quote_id\") where \"quote_id\" is not null and \"deleted_at\" is null;`);\n this.addSql(`create index \"document_entity_links_catalog_offer_reverse_idx\" on \"document_entity_links\" (\"tenant_id\", \"organization_id\", \"catalog_offer_id\") where \"catalog_offer_id\" is not null and \"deleted_at\" is null;`);\n this.addSql(`create index \"document_entity_links_product_reverse_idx\" on \"document_entity_links\" (\"tenant_id\", \"organization_id\", \"product_id\") where \"product_id\" is not null and \"deleted_at\" is null;`);\n this.addSql(`create index \"document_entity_links_deal_reverse_idx\" on \"document_entity_links\" (\"tenant_id\", \"organization_id\", \"deal_id\") where \"deal_id\" is not null and \"deleted_at\" is null;`);\n this.addSql(`create index \"document_entity_links_customer_reverse_idx\" on \"document_entity_links\" (\"tenant_id\", \"organization_id\", \"customer_entity_id\") where \"customer_entity_id\" is not null and \"deleted_at\" is null;`);\n this.addSql(`create unique index \"document_entity_links_sales_order_active_uq\" on \"document_entity_links\" (\"document_id\", \"sales_order_id\") where \"sales_order_id\" is not null and \"deleted_at\" is null;`);\n this.addSql(`create unique index \"document_entity_links_quote_active_uq\" on \"document_entity_links\" (\"document_id\", \"quote_id\") where \"quote_id\" is not null and \"deleted_at\" is null;`);\n this.addSql(`create unique index \"document_entity_links_catalog_offer_active_uq\" on \"document_entity_links\" (\"document_id\", \"catalog_offer_id\") where \"catalog_offer_id\" is not null and \"deleted_at\" is null;`);\n this.addSql(`create unique index \"document_entity_links_product_active_uq\" on \"document_entity_links\" (\"document_id\", \"product_id\") where \"product_id\" is not null and \"deleted_at\" is null;`);\n this.addSql(`create unique index \"document_entity_links_deal_active_uq\" on \"document_entity_links\" (\"document_id\", \"deal_id\") where \"deal_id\" is not null and \"deleted_at\" is null;`);\n this.addSql(`create unique index \"document_entity_links_customer_active_uq\" on \"document_entity_links\" (\"document_id\", \"customer_entity_id\") where \"customer_entity_id\" is not null and \"deleted_at\" is null;`);\n this.addSql(`create index \"document_entity_links_document_lookup_idx\" on \"document_entity_links\" (\"tenant_id\", \"organization_id\", \"document_id\", \"deleted_at\");`);\n\n this.addSql(`alter table \"document_entity_links\" add constraint \"document_entity_links_customer_kind_chk\" check (((\"customer_entity_id\" is not null and \"customer_kind\" in ('person', 'company')) or (\"customer_entity_id\" is null and \"customer_kind\" is null)));`);\n this.addSql(`alter table \"document_entity_links\" add constraint \"document_entity_links_exactly_one_target_chk\" check (num_nonnulls(\"customer_entity_id\", \"deal_id\", \"product_id\", \"catalog_offer_id\", \"quote_id\", \"sales_order_id\") = 1);`);\n\n this.addSql(`alter table \"document_templates\" add \"seed_key\" varchar(128) null;`);\n this.addSql(`create unique index \"document_templates_active_seed_key_uq\" on \"document_templates\" (\"tenant_id\", \"organization_id\", \"seed_key\") where \"seed_key\" is not null and \"deleted_at\" is null;`);\n }\n\n override down(): void | Promise<void> {\n this.addSql(`drop index if exists \"document_templates_active_seed_key_uq\";`);\n this.addSql(`alter table \"document_templates\" drop column \"seed_key\";`);\n\n this.addSql(`drop table if exists \"document_entity_links\" cascade;`);\n }\n\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,iBAAiB;AAEnB,MAAM,0CAA0C,UAAU;AAAA,EAEtD,KAA2B;AAClC,SAAK,OAAO,knBAAknB;AAC9nB,SAAK,OAAO,yMAAyM;AACrN,SAAK,OAAO,uLAAuL;AACnM,SAAK,OAAO,+MAA+M;AAC3N,SAAK,OAAO,6LAA6L;AACzM,SAAK,OAAO,oLAAoL;AAChM,SAAK,OAAO,8MAA8M;AAC1N,SAAK,OAAO,6LAA6L;AACzM,SAAK,OAAO,2KAA2K;AACvL,SAAK,OAAO,mMAAmM;AAC/M,SAAK,OAAO,iLAAiL;AAC7L,SAAK,OAAO,wKAAwK;AACpL,SAAK,OAAO,kMAAkM;AAC9M,SAAK,OAAO,oJAAoJ;AAEhK,SAAK,OAAO,uPAAuP;AACnQ,SAAK,OAAO,8NAA8N;AAE1O,SAAK,OAAO,oEAAoE;AAChF,SAAK,OAAO,yLAAyL;AAAA,EACvM;AAAA,EAES,OAA6B;AACpC,SAAK,OAAO,+DAA+D;AAC3E,SAAK,OAAO,0DAA0D;AAEtE,SAAK,OAAO,uDAAuD;AAAA,EACrE;AAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Migration } from "@mikro-orm/migrations";
|
|
2
|
+
class Migration20260710071003_documents extends Migration {
|
|
3
|
+
up() {
|
|
4
|
+
this.addSql(`alter table "document_contents" add "collaboration_generation" int not null default 1;`);
|
|
5
|
+
}
|
|
6
|
+
down() {
|
|
7
|
+
this.addSql(`alter table "document_contents" drop column "collaboration_generation";`);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
Migration20260710071003_documents
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=Migration20260710071003_documents.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/documents/migrations/Migration20260710071003_documents.ts"],
|
|
4
|
+
"sourcesContent": ["import { Migration } from '@mikro-orm/migrations';\n\nexport class Migration20260710071003_documents extends Migration {\n\n override up(): void | Promise<void> {\n this.addSql(`alter table \"document_contents\" add \"collaboration_generation\" int not null default 1;`);\n }\n\n override down(): void | Promise<void> {\n this.addSql(`alter table \"document_contents\" drop column \"collaboration_generation\";`);\n }\n\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,iBAAiB;AAEnB,MAAM,0CAA0C,UAAU;AAAA,EAEtD,KAA2B;AAClC,SAAK,OAAO,wFAAwF;AAAA,EACtG;AAAA,EAES,OAA6B;AACpC,SAAK,OAAO,yEAAyE;AAAA,EACvF;AAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Migration } from "@mikro-orm/migrations";
|
|
2
|
+
class Migration20260712120000_documents extends Migration {
|
|
3
|
+
up() {
|
|
4
|
+
this.addSql(`create index "documents_list_sort_idx" on "documents" ("organization_id", "tenant_id", "updated_at") where "deleted_at" is null;`);
|
|
5
|
+
}
|
|
6
|
+
down() {
|
|
7
|
+
this.addSql(`drop index if exists "documents_list_sort_idx";`);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
Migration20260712120000_documents
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=Migration20260712120000_documents.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/documents/migrations/Migration20260712120000_documents.ts"],
|
|
4
|
+
"sourcesContent": ["import { Migration } from '@mikro-orm/migrations';\n\nexport class Migration20260712120000_documents extends Migration {\n\n override up(): void | Promise<void> {\n this.addSql(`create index \"documents_list_sort_idx\" on \"documents\" (\"organization_id\", \"tenant_id\", \"updated_at\") where \"deleted_at\" is null;`);\n }\n\n override down(): void | Promise<void> {\n this.addSql(`drop index if exists \"documents_list_sort_idx\";`);\n }\n\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,iBAAiB;AAEnB,MAAM,0CAA0C,UAAU;AAAA,EAEtD,KAA2B;AAClC,SAAK,OAAO,kIAAkI;AAAA,EAChJ;AAAA,EAES,OAA6B;AACpC,SAAK,OAAO,iDAAiD;AAAA,EAC/D;AAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Migration } from "@mikro-orm/migrations";
|
|
2
|
+
class Migration20260712183000_documents extends Migration {
|
|
3
|
+
up() {
|
|
4
|
+
this.addSql('alter table "document_attachments" add column "updated_at" timestamptz not null default now();');
|
|
5
|
+
this.addSql('alter table "document_attachments" alter column "updated_at" drop default;');
|
|
6
|
+
}
|
|
7
|
+
down() {
|
|
8
|
+
this.addSql('alter table "document_attachments" drop column "updated_at";');
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
Migration20260712183000_documents
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=Migration20260712183000_documents.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/documents/migrations/Migration20260712183000_documents.ts"],
|
|
4
|
+
"sourcesContent": ["import { Migration } from '@mikro-orm/migrations'\n\nexport class Migration20260712183000_documents extends Migration {\n override up(): void {\n this.addSql('alter table \"document_attachments\" add column \"updated_at\" timestamptz not null default now();')\n this.addSql('alter table \"document_attachments\" alter column \"updated_at\" drop default;')\n }\n\n override down(): void {\n this.addSql('alter table \"document_attachments\" drop column \"updated_at\";')\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,iBAAiB;AAEnB,MAAM,0CAA0C,UAAU;AAAA,EACtD,KAAW;AAClB,SAAK,OAAO,gGAAgG;AAC5G,SAAK,OAAO,4EAA4E;AAAA,EAC1F;AAAA,EAES,OAAa;AACpB,SAAK,OAAO,8DAA8D;AAAA,EAC5E;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Migration } from "@mikro-orm/migrations";
|
|
2
|
+
class Migration20260713092156_documents extends Migration {
|
|
3
|
+
up() {
|
|
4
|
+
this.addSql(`alter table "document_folders" add constraint "document_folders_parent_folder_id_foreign" foreign key ("parent_folder_id") references "document_folders" ("id") on delete set null;`);
|
|
5
|
+
this.addSql(`alter table "documents" add constraint "documents_folder_id_foreign" foreign key ("folder_id") references "document_folders" ("id") on delete set null;`);
|
|
6
|
+
this.addSql(`alter table "document_entity_links" add constraint "document_entity_links_document_id_foreign" foreign key ("document_id") references "documents" ("id") on delete cascade;`);
|
|
7
|
+
this.addSql(`alter table "document_contents" add constraint "document_contents_document_id_foreign" foreign key ("document_id") references "documents" ("id") on delete cascade;`);
|
|
8
|
+
this.addSql(`alter table "document_comments" add constraint "document_comments_document_id_foreign" foreign key ("document_id") references "documents" ("id") on delete cascade;`);
|
|
9
|
+
this.addSql(`alter table "document_comments" add constraint "document_comments_parent_comment_id_foreign" foreign key ("parent_comment_id") references "document_comments" ("id") on delete set null;`);
|
|
10
|
+
this.addSql(`alter table "document_attachments" add constraint "document_attachments_document_id_foreign" foreign key ("document_id") references "documents" ("id") on delete cascade;`);
|
|
11
|
+
this.addSql(`alter table "document_shares" add constraint "document_shares_document_id_foreign" foreign key ("document_id") references "documents" ("id") on delete cascade;`);
|
|
12
|
+
this.addSql(`alter table "document_versions" add constraint "document_versions_document_id_foreign" foreign key ("document_id") references "documents" ("id") on delete cascade;`);
|
|
13
|
+
}
|
|
14
|
+
down() {
|
|
15
|
+
this.addSql(`alter table "document_attachments" drop constraint if exists "document_attachments_document_id_foreign";`);
|
|
16
|
+
this.addSql(`alter table "document_comments" drop constraint if exists "document_comments_document_id_foreign";`);
|
|
17
|
+
this.addSql(`alter table "document_comments" drop constraint if exists "document_comments_parent_comment_id_foreign";`);
|
|
18
|
+
this.addSql(`alter table "document_contents" drop constraint if exists "document_contents_document_id_foreign";`);
|
|
19
|
+
this.addSql(`alter table "document_entity_links" drop constraint if exists "document_entity_links_document_id_foreign";`);
|
|
20
|
+
this.addSql(`alter table "document_folders" drop constraint if exists "document_folders_parent_folder_id_foreign";`);
|
|
21
|
+
this.addSql(`alter table "document_shares" drop constraint if exists "document_shares_document_id_foreign";`);
|
|
22
|
+
this.addSql(`alter table "document_versions" drop constraint if exists "document_versions_document_id_foreign";`);
|
|
23
|
+
this.addSql(`alter table "documents" drop constraint if exists "documents_folder_id_foreign";`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
Migration20260713092156_documents
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=Migration20260713092156_documents.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/documents/migrations/Migration20260713092156_documents.ts"],
|
|
4
|
+
"sourcesContent": ["import { Migration } from '@mikro-orm/migrations';\n\nexport class Migration20260713092156_documents extends Migration {\n\n override up(): void | Promise<void> {\n this.addSql(`alter table \"document_folders\" add constraint \"document_folders_parent_folder_id_foreign\" foreign key (\"parent_folder_id\") references \"document_folders\" (\"id\") on delete set null;`);\n\n this.addSql(`alter table \"documents\" add constraint \"documents_folder_id_foreign\" foreign key (\"folder_id\") references \"document_folders\" (\"id\") on delete set null;`);\n\n this.addSql(`alter table \"document_entity_links\" add constraint \"document_entity_links_document_id_foreign\" foreign key (\"document_id\") references \"documents\" (\"id\") on delete cascade;`);\n\n this.addSql(`alter table \"document_contents\" add constraint \"document_contents_document_id_foreign\" foreign key (\"document_id\") references \"documents\" (\"id\") on delete cascade;`);\n\n this.addSql(`alter table \"document_comments\" add constraint \"document_comments_document_id_foreign\" foreign key (\"document_id\") references \"documents\" (\"id\") on delete cascade;`);\n this.addSql(`alter table \"document_comments\" add constraint \"document_comments_parent_comment_id_foreign\" foreign key (\"parent_comment_id\") references \"document_comments\" (\"id\") on delete set null;`);\n\n this.addSql(`alter table \"document_attachments\" add constraint \"document_attachments_document_id_foreign\" foreign key (\"document_id\") references \"documents\" (\"id\") on delete cascade;`);\n\n this.addSql(`alter table \"document_shares\" add constraint \"document_shares_document_id_foreign\" foreign key (\"document_id\") references \"documents\" (\"id\") on delete cascade;`);\n\n this.addSql(`alter table \"document_versions\" add constraint \"document_versions_document_id_foreign\" foreign key (\"document_id\") references \"documents\" (\"id\") on delete cascade;`);\n }\n\n override down(): void | Promise<void> {\n this.addSql(`alter table \"document_attachments\" drop constraint if exists \"document_attachments_document_id_foreign\";`);\n\n this.addSql(`alter table \"document_comments\" drop constraint if exists \"document_comments_document_id_foreign\";`);\n this.addSql(`alter table \"document_comments\" drop constraint if exists \"document_comments_parent_comment_id_foreign\";`);\n\n this.addSql(`alter table \"document_contents\" drop constraint if exists \"document_contents_document_id_foreign\";`);\n\n this.addSql(`alter table \"document_entity_links\" drop constraint if exists \"document_entity_links_document_id_foreign\";`);\n\n this.addSql(`alter table \"document_folders\" drop constraint if exists \"document_folders_parent_folder_id_foreign\";`);\n\n this.addSql(`alter table \"document_shares\" drop constraint if exists \"document_shares_document_id_foreign\";`);\n\n this.addSql(`alter table \"document_versions\" drop constraint if exists \"document_versions_document_id_foreign\";`);\n\n this.addSql(`alter table \"documents\" drop constraint if exists \"documents_folder_id_foreign\";`);\n }\n\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,iBAAiB;AAEnB,MAAM,0CAA0C,UAAU;AAAA,EAEtD,KAA2B;AAClC,SAAK,OAAO,qLAAqL;AAEjM,SAAK,OAAO,yJAAyJ;AAErK,SAAK,OAAO,6KAA6K;AAEzL,SAAK,OAAO,qKAAqK;AAEjL,SAAK,OAAO,qKAAqK;AACjL,SAAK,OAAO,0LAA0L;AAEtM,SAAK,OAAO,2KAA2K;AAEvL,SAAK,OAAO,iKAAiK;AAE7K,SAAK,OAAO,qKAAqK;AAAA,EACnL;AAAA,EAES,OAA6B;AACpC,SAAK,OAAO,0GAA0G;AAEtH,SAAK,OAAO,oGAAoG;AAChH,SAAK,OAAO,0GAA0G;AAEtH,SAAK,OAAO,oGAAoG;AAEhH,SAAK,OAAO,4GAA4G;AAExH,SAAK,OAAO,uGAAuG;AAEnH,SAAK,OAAO,gGAAgG;AAE5G,SAAK,OAAO,oGAAoG;AAEhH,SAAK,OAAO,kFAAkF;AAAA,EAChG;AAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Migration } from "@mikro-orm/migrations";
|
|
2
|
+
class Migration20260717000000_documents extends Migration {
|
|
3
|
+
up() {
|
|
4
|
+
this.addSql(`alter table "documents" add "archived_at" timestamptz null;`);
|
|
5
|
+
this.addSql(`alter table "document_entity_links" add "linked_document_id" uuid null;`);
|
|
6
|
+
this.addSql(`alter table "document_entity_links" drop constraint if exists "document_entity_links_exactly_one_target_chk";`);
|
|
7
|
+
this.addSql(`alter table "document_entity_links" add constraint "document_entity_links_exactly_one_target_chk" check (num_nonnulls("customer_entity_id", "deal_id", "product_id", "catalog_offer_id", "quote_id", "sales_order_id", "linked_document_id") = 1);`);
|
|
8
|
+
this.addSql(`alter table "document_entity_links" add constraint "document_entity_links_no_self_link_chk" check ("document_id" <> "linked_document_id");`);
|
|
9
|
+
this.addSql(`alter table "document_entity_links" add constraint "document_entity_links_linked_document_id_foreign" foreign key ("linked_document_id") references "documents" ("id") on delete cascade;`);
|
|
10
|
+
this.addSql(`create unique index "document_entity_links_linked_document_active_uq" on "document_entity_links" ("document_id", "linked_document_id") where "linked_document_id" is not null and "deleted_at" is null;`);
|
|
11
|
+
this.addSql(`create index "document_entity_links_linked_document_reverse_idx" on "document_entity_links" ("tenant_id", "organization_id", "linked_document_id") where "linked_document_id" is not null and "deleted_at" is null;`);
|
|
12
|
+
this.addSql(`create table "document_favorites" ("id" uuid not null default gen_random_uuid(), "document_id" uuid not null, "user_id" uuid not null, "organization_id" uuid not null, "tenant_id" uuid not null, "created_at" timestamptz not null, "deleted_at" timestamptz null, primary key ("id"));`);
|
|
13
|
+
this.addSql(`create unique index "document_favorites_active_user_uq" on "document_favorites" ("document_id", "user_id") where "deleted_at" is null;`);
|
|
14
|
+
this.addSql(`create index "document_favorites_user_lookup_idx" on "document_favorites" ("tenant_id", "organization_id", "user_id");`);
|
|
15
|
+
this.addSql(`alter table "document_favorites" add constraint "document_favorites_document_id_foreign" foreign key ("document_id") references "documents" ("id") on delete cascade;`);
|
|
16
|
+
this.addSql(`create table "document_watchers" ("id" uuid not null default gen_random_uuid(), "document_id" uuid not null, "user_id" uuid not null, "organization_id" uuid not null, "tenant_id" uuid not null, "created_at" timestamptz not null, "deleted_at" timestamptz null, primary key ("id"));`);
|
|
17
|
+
this.addSql(`create unique index "document_watchers_active_user_uq" on "document_watchers" ("document_id", "user_id") where "deleted_at" is null;`);
|
|
18
|
+
this.addSql(`create index "document_watchers_user_lookup_idx" on "document_watchers" ("tenant_id", "organization_id", "user_id");`);
|
|
19
|
+
this.addSql(`alter table "document_watchers" add constraint "document_watchers_document_id_foreign" foreign key ("document_id") references "documents" ("id") on delete cascade;`);
|
|
20
|
+
}
|
|
21
|
+
down() {
|
|
22
|
+
this.addSql(`drop table if exists "document_watchers" cascade;`);
|
|
23
|
+
this.addSql(`drop table if exists "document_favorites" cascade;`);
|
|
24
|
+
this.addSql(`drop index if exists "document_entity_links_linked_document_reverse_idx";`);
|
|
25
|
+
this.addSql(`drop index if exists "document_entity_links_linked_document_active_uq";`);
|
|
26
|
+
this.addSql(`alter table "document_entity_links" drop constraint if exists "document_entity_links_linked_document_id_foreign";`);
|
|
27
|
+
this.addSql(`alter table "document_entity_links" drop constraint if exists "document_entity_links_no_self_link_chk";`);
|
|
28
|
+
this.addSql(`alter table "document_entity_links" drop constraint if exists "document_entity_links_exactly_one_target_chk";`);
|
|
29
|
+
this.addSql(`alter table "document_entity_links" drop column "linked_document_id";`);
|
|
30
|
+
this.addSql(`alter table "document_entity_links" add constraint "document_entity_links_exactly_one_target_chk" check (num_nonnulls("customer_entity_id", "deal_id", "product_id", "catalog_offer_id", "quote_id", "sales_order_id") = 1);`);
|
|
31
|
+
this.addSql(`alter table "documents" drop column "archived_at";`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
Migration20260717000000_documents
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=Migration20260717000000_documents.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/documents/migrations/Migration20260717000000_documents.ts"],
|
|
4
|
+
"sourcesContent": ["import { Migration } from '@mikro-orm/migrations'\n\nexport class Migration20260717000000_documents extends Migration {\n override up(): void | Promise<void> {\n this.addSql(`alter table \"documents\" add \"archived_at\" timestamptz null;`)\n\n this.addSql(`alter table \"document_entity_links\" add \"linked_document_id\" uuid null;`)\n this.addSql(`alter table \"document_entity_links\" drop constraint if exists \"document_entity_links_exactly_one_target_chk\";`)\n this.addSql(`alter table \"document_entity_links\" add constraint \"document_entity_links_exactly_one_target_chk\" check (num_nonnulls(\"customer_entity_id\", \"deal_id\", \"product_id\", \"catalog_offer_id\", \"quote_id\", \"sales_order_id\", \"linked_document_id\") = 1);`)\n this.addSql(`alter table \"document_entity_links\" add constraint \"document_entity_links_no_self_link_chk\" check (\"document_id\" <> \"linked_document_id\");`)\n this.addSql(`alter table \"document_entity_links\" add constraint \"document_entity_links_linked_document_id_foreign\" foreign key (\"linked_document_id\") references \"documents\" (\"id\") on delete cascade;`)\n this.addSql(`create unique index \"document_entity_links_linked_document_active_uq\" on \"document_entity_links\" (\"document_id\", \"linked_document_id\") where \"linked_document_id\" is not null and \"deleted_at\" is null;`)\n this.addSql(`create index \"document_entity_links_linked_document_reverse_idx\" on \"document_entity_links\" (\"tenant_id\", \"organization_id\", \"linked_document_id\") where \"linked_document_id\" is not null and \"deleted_at\" is null;`)\n\n this.addSql(`create table \"document_favorites\" (\"id\" uuid not null default gen_random_uuid(), \"document_id\" uuid not null, \"user_id\" uuid not null, \"organization_id\" uuid not null, \"tenant_id\" uuid not null, \"created_at\" timestamptz not null, \"deleted_at\" timestamptz null, primary key (\"id\"));`)\n this.addSql(`create unique index \"document_favorites_active_user_uq\" on \"document_favorites\" (\"document_id\", \"user_id\") where \"deleted_at\" is null;`)\n this.addSql(`create index \"document_favorites_user_lookup_idx\" on \"document_favorites\" (\"tenant_id\", \"organization_id\", \"user_id\");`)\n this.addSql(`alter table \"document_favorites\" add constraint \"document_favorites_document_id_foreign\" foreign key (\"document_id\") references \"documents\" (\"id\") on delete cascade;`)\n\n this.addSql(`create table \"document_watchers\" (\"id\" uuid not null default gen_random_uuid(), \"document_id\" uuid not null, \"user_id\" uuid not null, \"organization_id\" uuid not null, \"tenant_id\" uuid not null, \"created_at\" timestamptz not null, \"deleted_at\" timestamptz null, primary key (\"id\"));`)\n this.addSql(`create unique index \"document_watchers_active_user_uq\" on \"document_watchers\" (\"document_id\", \"user_id\") where \"deleted_at\" is null;`)\n this.addSql(`create index \"document_watchers_user_lookup_idx\" on \"document_watchers\" (\"tenant_id\", \"organization_id\", \"user_id\");`)\n this.addSql(`alter table \"document_watchers\" add constraint \"document_watchers_document_id_foreign\" foreign key (\"document_id\") references \"documents\" (\"id\") on delete cascade;`)\n }\n\n override down(): void | Promise<void> {\n this.addSql(`drop table if exists \"document_watchers\" cascade;`)\n this.addSql(`drop table if exists \"document_favorites\" cascade;`)\n\n this.addSql(`drop index if exists \"document_entity_links_linked_document_reverse_idx\";`)\n this.addSql(`drop index if exists \"document_entity_links_linked_document_active_uq\";`)\n this.addSql(`alter table \"document_entity_links\" drop constraint if exists \"document_entity_links_linked_document_id_foreign\";`)\n this.addSql(`alter table \"document_entity_links\" drop constraint if exists \"document_entity_links_no_self_link_chk\";`)\n this.addSql(`alter table \"document_entity_links\" drop constraint if exists \"document_entity_links_exactly_one_target_chk\";`)\n this.addSql(`alter table \"document_entity_links\" drop column \"linked_document_id\";`)\n this.addSql(`alter table \"document_entity_links\" add constraint \"document_entity_links_exactly_one_target_chk\" check (num_nonnulls(\"customer_entity_id\", \"deal_id\", \"product_id\", \"catalog_offer_id\", \"quote_id\", \"sales_order_id\") = 1);`)\n\n this.addSql(`alter table \"documents\" drop column \"archived_at\";`)\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,iBAAiB;AAEnB,MAAM,0CAA0C,UAAU;AAAA,EACtD,KAA2B;AAClC,SAAK,OAAO,6DAA6D;AAEzE,SAAK,OAAO,yEAAyE;AACrF,SAAK,OAAO,+GAA+G;AAC3H,SAAK,OAAO,oPAAoP;AAChQ,SAAK,OAAO,4IAA4I;AACxJ,SAAK,OAAO,2LAA2L;AACvM,SAAK,OAAO,yMAAyM;AACrN,SAAK,OAAO,qNAAqN;AAEjO,SAAK,OAAO,2RAA2R;AACvS,SAAK,OAAO,wIAAwI;AACpJ,SAAK,OAAO,wHAAwH;AACpI,SAAK,OAAO,uKAAuK;AAEnL,SAAK,OAAO,0RAA0R;AACtS,SAAK,OAAO,sIAAsI;AAClJ,SAAK,OAAO,sHAAsH;AAClI,SAAK,OAAO,qKAAqK;AAAA,EACnL;AAAA,EAES,OAA6B;AACpC,SAAK,OAAO,mDAAmD;AAC/D,SAAK,OAAO,oDAAoD;AAEhE,SAAK,OAAO,2EAA2E;AACvF,SAAK,OAAO,yEAAyE;AACrF,SAAK,OAAO,mHAAmH;AAC/H,SAAK,OAAO,yGAAyG;AACrH,SAAK,OAAO,+GAA+G;AAC3H,SAAK,OAAO,uEAAuE;AACnF,SAAK,OAAO,8NAA8N;AAE1O,SAAK,OAAO,oDAAoD;AAAA,EAClE;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const notificationTypes = [
|
|
2
|
+
{
|
|
3
|
+
type: "documents.comment.mentioned",
|
|
4
|
+
module: "documents",
|
|
5
|
+
titleKey: "documents.notifications.comment.mentioned.title",
|
|
6
|
+
bodyKey: "documents.notifications.comment.mentioned.body",
|
|
7
|
+
icon: "at-sign",
|
|
8
|
+
severity: "info",
|
|
9
|
+
// sourceEntityId stores the comment id, so no {sourceEntityId} href template
|
|
10
|
+
// can resolve to the document URL; creation always passes an explicit
|
|
11
|
+
// document-scoped linkHref (see commands/interceptors.ts).
|
|
12
|
+
actions: [],
|
|
13
|
+
expiresAfterHours: 168
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
type: "documents.watch.commented",
|
|
17
|
+
module: "documents",
|
|
18
|
+
titleKey: "documents.notifications.watch.commented.title",
|
|
19
|
+
bodyKey: "documents.notifications.watch.commented.body",
|
|
20
|
+
icon: "bell",
|
|
21
|
+
severity: "info",
|
|
22
|
+
// sourceEntityId stores the comment id, so no {sourceEntityId} href template
|
|
23
|
+
// can resolve to the document URL; creation always passes an explicit
|
|
24
|
+
// document-scoped linkHref (see commands/interceptors.ts).
|
|
25
|
+
actions: [],
|
|
26
|
+
expiresAfterHours: 168
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
type: "documents.watch.changed",
|
|
30
|
+
module: "documents",
|
|
31
|
+
titleKey: "documents.notifications.watch.changed.title",
|
|
32
|
+
bodyKey: "documents.notifications.watch.changed.body",
|
|
33
|
+
icon: "bell",
|
|
34
|
+
severity: "info",
|
|
35
|
+
// sourceEntityId stores the changed resource id, so no {sourceEntityId}
|
|
36
|
+
// href template can resolve to the document URL; creation always passes
|
|
37
|
+
// an explicit document-scoped linkHref (see commands/interceptors.ts).
|
|
38
|
+
actions: [],
|
|
39
|
+
expiresAfterHours: 168
|
|
40
|
+
}
|
|
41
|
+
];
|
|
42
|
+
var notifications_default = notificationTypes;
|
|
43
|
+
export {
|
|
44
|
+
notifications_default as default,
|
|
45
|
+
notificationTypes
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=notifications.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/modules/documents/notifications.ts"],
|
|
4
|
+
"sourcesContent": ["import type { NotificationTypeDefinition } from '@open-mercato/shared/modules/notifications/types'\n\nexport const notificationTypes: NotificationTypeDefinition[] = [\n {\n type: 'documents.comment.mentioned',\n module: 'documents',\n titleKey: 'documents.notifications.comment.mentioned.title',\n bodyKey: 'documents.notifications.comment.mentioned.body',\n icon: 'at-sign',\n severity: 'info',\n // sourceEntityId stores the comment id, so no {sourceEntityId} href template\n // can resolve to the document URL; creation always passes an explicit\n // document-scoped linkHref (see commands/interceptors.ts).\n actions: [],\n expiresAfterHours: 168,\n },\n {\n type: 'documents.watch.commented',\n module: 'documents',\n titleKey: 'documents.notifications.watch.commented.title',\n bodyKey: 'documents.notifications.watch.commented.body',\n icon: 'bell',\n severity: 'info',\n // sourceEntityId stores the comment id, so no {sourceEntityId} href template\n // can resolve to the document URL; creation always passes an explicit\n // document-scoped linkHref (see commands/interceptors.ts).\n actions: [],\n expiresAfterHours: 168,\n },\n {\n type: 'documents.watch.changed',\n module: 'documents',\n titleKey: 'documents.notifications.watch.changed.title',\n bodyKey: 'documents.notifications.watch.changed.body',\n icon: 'bell',\n severity: 'info',\n // sourceEntityId stores the changed resource id, so no {sourceEntityId}\n // href template can resolve to the document URL; creation always passes\n // an explicit document-scoped linkHref (see commands/interceptors.ts).\n actions: [],\n expiresAfterHours: 168,\n },\n]\n\nexport default notificationTypes\n"],
|
|
5
|
+
"mappings": "AAEO,MAAM,oBAAkD;AAAA,EAC7D;AAAA,IACE,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,SAAS;AAAA,IACT,MAAM;AAAA,IACN,UAAU;AAAA;AAAA;AAAA;AAAA,IAIV,SAAS,CAAC;AAAA,IACV,mBAAmB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,SAAS;AAAA,IACT,MAAM;AAAA,IACN,UAAU;AAAA;AAAA;AAAA;AAAA,IAIV,SAAS,CAAC;AAAA,IACV,mBAAmB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,SAAS;AAAA,IACT,MAAM;AAAA,IACN,UAAU;AAAA;AAAA;AAAA;AAAA,IAIV,SAAS,CAAC;AAAA,IACV,mBAAmB;AAAA,EACrB;AACF;AAEA,IAAO,wBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { resolveTranslations } from "@open-mercato/shared/lib/i18n/server";
|
|
2
|
+
import { findOneWithDecryption } from "@open-mercato/shared/lib/encryption/find";
|
|
3
|
+
import { DocumentContent } from "./data/entities.js";
|
|
4
|
+
import { DOCUMENTS_ENTITY_IDS } from "./lib/constants.js";
|
|
5
|
+
function pickString(...values) {
|
|
6
|
+
for (const value of values) {
|
|
7
|
+
if (typeof value !== "string") continue;
|
|
8
|
+
const trimmed = value.trim();
|
|
9
|
+
if (trimmed.length > 0) return trimmed;
|
|
10
|
+
}
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
function isContainerLike(value) {
|
|
14
|
+
return typeof value === "object" && value !== null && "resolve" in value && typeof value.resolve === "function";
|
|
15
|
+
}
|
|
16
|
+
function isEntityManager(value) {
|
|
17
|
+
return typeof value === "object" && value !== null && "findOne" in value && typeof value.findOne === "function";
|
|
18
|
+
}
|
|
19
|
+
function buildPresenter(t, ctx) {
|
|
20
|
+
return {
|
|
21
|
+
// Search presenters must never surface opaque database identifiers as a
|
|
22
|
+
// user-facing fallback. A missing/decrypted-away title remains a generic,
|
|
23
|
+
// localized document label while the record id is used only for routing.
|
|
24
|
+
title: pickString(ctx.record.title) ?? t("documents.search.badge.document", "Document"),
|
|
25
|
+
subtitle: pickString(ctx.record.folder_name, ctx.record.folderName) ?? void 0,
|
|
26
|
+
icon: "file-text",
|
|
27
|
+
badge: t("documents.search.badge.document", "Document")
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
async function resolveContentText(ctx) {
|
|
31
|
+
const direct = pickString(ctx.record.content_text, ctx.record.contentText);
|
|
32
|
+
if (direct) return direct;
|
|
33
|
+
if (!isContainerLike(ctx.container) || typeof ctx.record.id !== "string") return null;
|
|
34
|
+
const tenantId = pickString(ctx.tenantId);
|
|
35
|
+
const organizationId = pickString(ctx.organizationId);
|
|
36
|
+
if (!tenantId || !organizationId) return null;
|
|
37
|
+
const em = ctx.container.resolve("em");
|
|
38
|
+
if (!isEntityManager(em)) return null;
|
|
39
|
+
const content = await findOneWithDecryption(
|
|
40
|
+
em,
|
|
41
|
+
DocumentContent,
|
|
42
|
+
{
|
|
43
|
+
documentId: ctx.record.id,
|
|
44
|
+
deletedAt: null,
|
|
45
|
+
tenantId,
|
|
46
|
+
organizationId
|
|
47
|
+
},
|
|
48
|
+
{ fields: ["contentText"] },
|
|
49
|
+
{ tenantId, organizationId }
|
|
50
|
+
);
|
|
51
|
+
return pickString(content?.contentText);
|
|
52
|
+
}
|
|
53
|
+
async function buildDocumentSource(ctx) {
|
|
54
|
+
const { t } = await resolveTranslations();
|
|
55
|
+
const title = pickString(ctx.record.title);
|
|
56
|
+
const contentText = await resolveContentText(ctx);
|
|
57
|
+
const text = [title, contentText].filter((value) => Boolean(value));
|
|
58
|
+
if (text.length === 0) return null;
|
|
59
|
+
return {
|
|
60
|
+
text,
|
|
61
|
+
presenter: buildPresenter(t, ctx),
|
|
62
|
+
checksumSource: {
|
|
63
|
+
record: ctx.record,
|
|
64
|
+
contentText,
|
|
65
|
+
customFields: ctx.customFields
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
const searchConfig = {
|
|
70
|
+
entities: [
|
|
71
|
+
{
|
|
72
|
+
entityId: DOCUMENTS_ENTITY_IDS.document,
|
|
73
|
+
// Global cross-entity search is only feature-gated (search.view) with no per-record ACL
|
|
74
|
+
// filter, so indexing per-document-private title/content here would expose them to any
|
|
75
|
+
// org user holding documents.view — bypassing per-doc sharing. Disabled for M1; secure
|
|
76
|
+
// per-doc-filtered document search is deferred until the search layer gains a per-record
|
|
77
|
+
// visibility hook. In M1, documents are found via the permission-filtered list route
|
|
78
|
+
// (/api/documents?search=). The reindex calls elsewhere safely no-op while this is off.
|
|
79
|
+
enabled: false,
|
|
80
|
+
priority: 9,
|
|
81
|
+
fieldPolicy: {
|
|
82
|
+
searchable: ["title", "content_text"],
|
|
83
|
+
excluded: ["yjs_state", "content_html"]
|
|
84
|
+
},
|
|
85
|
+
buildSource: buildDocumentSource,
|
|
86
|
+
formatResult: async (ctx) => {
|
|
87
|
+
const { t } = await resolveTranslations();
|
|
88
|
+
return buildPresenter(t, ctx);
|
|
89
|
+
},
|
|
90
|
+
resolveUrl: async (ctx) => `/backend/documents/${encodeURIComponent(String(ctx.record.id))}`
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
};
|
|
94
|
+
const config = searchConfig;
|
|
95
|
+
var search_default = searchConfig;
|
|
96
|
+
export {
|
|
97
|
+
config,
|
|
98
|
+
search_default as default,
|
|
99
|
+
searchConfig
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/modules/documents/search.ts"],
|
|
4
|
+
"sourcesContent": ["import type {\n SearchBuildContext,\n SearchIndexSource,\n SearchModuleConfig,\n SearchResultPresenter,\n} from '@open-mercato/shared/modules/search'\nimport type { TranslateFn } from '@open-mercato/shared/lib/i18n/context'\nimport { resolveTranslations } from '@open-mercato/shared/lib/i18n/server'\nimport { findOneWithDecryption } from '@open-mercato/shared/lib/encryption/find'\nimport type { EntityManager } from '@mikro-orm/postgresql'\nimport { DocumentContent } from './data/entities'\nimport { DOCUMENTS_ENTITY_IDS } from './lib/constants'\n\ntype ContainerLike = {\n resolve: (name: string) => unknown\n}\n\nfunction pickString(...values: Array<unknown>): string | null {\n for (const value of values) {\n if (typeof value !== 'string') continue\n const trimmed = value.trim()\n if (trimmed.length > 0) return trimmed\n }\n return null\n}\n\nfunction isContainerLike(value: unknown): value is ContainerLike {\n return typeof value === 'object' && value !== null && 'resolve' in value && typeof value.resolve === 'function'\n}\n\nfunction isEntityManager(value: unknown): value is EntityManager {\n return typeof value === 'object' && value !== null && 'findOne' in value && typeof value.findOne === 'function'\n}\n\nfunction buildPresenter(t: TranslateFn, ctx: SearchBuildContext): SearchResultPresenter {\n return {\n // Search presenters must never surface opaque database identifiers as a\n // user-facing fallback. A missing/decrypted-away title remains a generic,\n // localized document label while the record id is used only for routing.\n title: pickString(ctx.record.title) ?? t('documents.search.badge.document', 'Document'),\n subtitle: pickString(ctx.record.folder_name, ctx.record.folderName) ?? undefined,\n icon: 'file-text',\n badge: t('documents.search.badge.document', 'Document'),\n }\n}\n\nasync function resolveContentText(ctx: SearchBuildContext): Promise<string | null> {\n const direct = pickString(ctx.record.content_text, ctx.record.contentText)\n if (direct) return direct\n if (!isContainerLike(ctx.container) || typeof ctx.record.id !== 'string') return null\n // Both ownership predicates are mandatory. A build context missing either\n // scope value must refuse the read rather than widen it to a documentId-only\n // lookup that would cross tenant/organization boundaries.\n const tenantId = pickString(ctx.tenantId)\n const organizationId = pickString(ctx.organizationId)\n if (!tenantId || !organizationId) return null\n const em = ctx.container.resolve('em')\n if (!isEntityManager(em)) return null\n const content = await findOneWithDecryption(\n em,\n DocumentContent,\n {\n documentId: ctx.record.id,\n deletedAt: null,\n tenantId,\n organizationId,\n },\n { fields: ['contentText'] as const },\n { tenantId, organizationId },\n )\n return pickString(content?.contentText)\n}\n\nasync function buildDocumentSource(ctx: SearchBuildContext): Promise<SearchIndexSource | null> {\n const { t } = await resolveTranslations()\n const title = pickString(ctx.record.title)\n const contentText = await resolveContentText(ctx)\n const text = [title, contentText].filter((value): value is string => Boolean(value))\n if (text.length === 0) return null\n return {\n text,\n presenter: buildPresenter(t, ctx),\n checksumSource: {\n record: ctx.record,\n contentText,\n customFields: ctx.customFields,\n },\n }\n}\n\nexport const searchConfig: SearchModuleConfig = {\n entities: [\n {\n entityId: DOCUMENTS_ENTITY_IDS.document,\n // Global cross-entity search is only feature-gated (search.view) with no per-record ACL\n // filter, so indexing per-document-private title/content here would expose them to any\n // org user holding documents.view \u2014 bypassing per-doc sharing. Disabled for M1; secure\n // per-doc-filtered document search is deferred until the search layer gains a per-record\n // visibility hook. In M1, documents are found via the permission-filtered list route\n // (/api/documents?search=). The reindex calls elsewhere safely no-op while this is off.\n enabled: false,\n priority: 9,\n fieldPolicy: {\n searchable: ['title', 'content_text'],\n excluded: ['yjs_state', 'content_html'],\n },\n buildSource: buildDocumentSource,\n formatResult: async (ctx) => {\n const { t } = await resolveTranslations()\n return buildPresenter(t, ctx)\n },\n resolveUrl: async (ctx) => `/backend/documents/${encodeURIComponent(String(ctx.record.id))}`,\n },\n ],\n}\n\nexport const config = searchConfig\nexport default searchConfig\n"],
|
|
5
|
+
"mappings": "AAOA,SAAS,2BAA2B;AACpC,SAAS,6BAA6B;AAEtC,SAAS,uBAAuB;AAChC,SAAS,4BAA4B;AAMrC,SAAS,cAAc,QAAuC;AAC5D,aAAW,SAAS,QAAQ;AAC1B,QAAI,OAAO,UAAU,SAAU;AAC/B,UAAM,UAAU,MAAM,KAAK;AAC3B,QAAI,QAAQ,SAAS,EAAG,QAAO;AAAA,EACjC;AACA,SAAO;AACT;AAEA,SAAS,gBAAgB,OAAwC;AAC/D,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,aAAa,SAAS,OAAO,MAAM,YAAY;AACvG;AAEA,SAAS,gBAAgB,OAAwC;AAC/D,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,aAAa,SAAS,OAAO,MAAM,YAAY;AACvG;AAEA,SAAS,eAAe,GAAgB,KAAgD;AACtF,SAAO;AAAA;AAAA;AAAA;AAAA,IAIL,OAAO,WAAW,IAAI,OAAO,KAAK,KAAK,EAAE,mCAAmC,UAAU;AAAA,IACtF,UAAU,WAAW,IAAI,OAAO,aAAa,IAAI,OAAO,UAAU,KAAK;AAAA,IACvE,MAAM;AAAA,IACN,OAAO,EAAE,mCAAmC,UAAU;AAAA,EACxD;AACF;AAEA,eAAe,mBAAmB,KAAiD;AACjF,QAAM,SAAS,WAAW,IAAI,OAAO,cAAc,IAAI,OAAO,WAAW;AACzE,MAAI,OAAQ,QAAO;AACnB,MAAI,CAAC,gBAAgB,IAAI,SAAS,KAAK,OAAO,IAAI,OAAO,OAAO,SAAU,QAAO;AAIjF,QAAM,WAAW,WAAW,IAAI,QAAQ;AACxC,QAAM,iBAAiB,WAAW,IAAI,cAAc;AACpD,MAAI,CAAC,YAAY,CAAC,eAAgB,QAAO;AACzC,QAAM,KAAK,IAAI,UAAU,QAAQ,IAAI;AACrC,MAAI,CAAC,gBAAgB,EAAE,EAAG,QAAO;AACjC,QAAM,UAAU,MAAM;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,YAAY,IAAI,OAAO;AAAA,MACvB,WAAW;AAAA,MACX;AAAA,MACA;AAAA,IACF;AAAA,IACA,EAAE,QAAQ,CAAC,aAAa,EAAW;AAAA,IACnC,EAAE,UAAU,eAAe;AAAA,EAC7B;AACA,SAAO,WAAW,SAAS,WAAW;AACxC;AAEA,eAAe,oBAAoB,KAA4D;AAC7F,QAAM,EAAE,EAAE,IAAI,MAAM,oBAAoB;AACxC,QAAM,QAAQ,WAAW,IAAI,OAAO,KAAK;AACzC,QAAM,cAAc,MAAM,mBAAmB,GAAG;AAChD,QAAM,OAAO,CAAC,OAAO,WAAW,EAAE,OAAO,CAAC,UAA2B,QAAQ,KAAK,CAAC;AACnF,MAAI,KAAK,WAAW,EAAG,QAAO;AAC9B,SAAO;AAAA,IACL;AAAA,IACA,WAAW,eAAe,GAAG,GAAG;AAAA,IAChC,gBAAgB;AAAA,MACd,QAAQ,IAAI;AAAA,MACZ;AAAA,MACA,cAAc,IAAI;AAAA,IACpB;AAAA,EACF;AACF;AAEO,MAAM,eAAmC;AAAA,EAC9C,UAAU;AAAA,IACR;AAAA,MACE,UAAU,qBAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAO/B,SAAS;AAAA,MACT,UAAU;AAAA,MACV,aAAa;AAAA,QACX,YAAY,CAAC,SAAS,cAAc;AAAA,QACpC,UAAU,CAAC,aAAa,cAAc;AAAA,MACxC;AAAA,MACA,aAAa;AAAA,MACb,cAAc,OAAO,QAAQ;AAC3B,cAAM,EAAE,EAAE,IAAI,MAAM,oBAAoB;AACxC,eAAO,eAAe,GAAG,GAAG;AAAA,MAC9B;AAAA,MACA,YAAY,OAAO,QAAQ,sBAAsB,mBAAmB,OAAO,IAAI,OAAO,EAAE,CAAC,CAAC;AAAA,IAC5F;AAAA,EACF;AACF;AAEO,MAAM,SAAS;AACtB,IAAO,iBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { seedDefaultDocumentTemplates } from "./lib/templateSeeds.js";
|
|
2
|
+
const setup = {
|
|
3
|
+
async onTenantCreated({ em, tenantId, organizationId }) {
|
|
4
|
+
await seedDefaultDocumentTemplates(em, { tenantId, organizationId });
|
|
5
|
+
},
|
|
6
|
+
async seedDefaults({ em, tenantId, organizationId }) {
|
|
7
|
+
await seedDefaultDocumentTemplates(em, { tenantId, organizationId });
|
|
8
|
+
},
|
|
9
|
+
defaultRoleFeatures: {
|
|
10
|
+
admin: ["documents.*"],
|
|
11
|
+
employee: ["documents.view", "documents.create", "documents.edit", "documents.share"]
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
var setup_default = setup;
|
|
15
|
+
export {
|
|
16
|
+
setup_default as default,
|
|
17
|
+
setup
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/modules/documents/setup.ts"],
|
|
4
|
+
"sourcesContent": ["import type { ModuleSetupConfig } from '@open-mercato/shared/modules/setup'\nimport { seedDefaultDocumentTemplates } from './lib/templateSeeds'\n\nexport const setup: ModuleSetupConfig = {\n async onTenantCreated({ em, tenantId, organizationId }) {\n await seedDefaultDocumentTemplates(em, { tenantId, organizationId })\n },\n\n async seedDefaults({ em, tenantId, organizationId }) {\n await seedDefaultDocumentTemplates(em, { tenantId, organizationId })\n },\n\n defaultRoleFeatures: {\n admin: ['documents.*'],\n employee: ['documents.view', 'documents.create', 'documents.edit', 'documents.share'],\n },\n}\n\nexport default setup\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,oCAAoC;AAEtC,MAAM,QAA2B;AAAA,EACtC,MAAM,gBAAgB,EAAE,IAAI,UAAU,eAAe,GAAG;AACtD,UAAM,6BAA6B,IAAI,EAAE,UAAU,eAAe,CAAC;AAAA,EACrE;AAAA,EAEA,MAAM,aAAa,EAAE,IAAI,UAAU,eAAe,GAAG;AACnD,UAAM,6BAA6B,IAAI,EAAE,UAAU,eAAe,CAAC;AAAA,EACrE;AAAA,EAEA,qBAAqB;AAAA,IACnB,OAAO,CAAC,aAAa;AAAA,IACrB,UAAU,CAAC,kBAAkB,oBAAoB,kBAAkB,iBAAiB;AAAA,EACtF;AACF;AAEA,IAAO,gBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|