@aopslab/domain-dm-docman 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +6 -0
- package/README.md +26 -0
- package/dist/application/errors/AssetServiceError.d.ts +20 -0
- package/dist/application/errors/AssetServiceError.js +13 -0
- package/dist/application/errors/AssetVersionServiceError.d.ts +20 -0
- package/dist/application/errors/AssetVersionServiceError.js +13 -0
- package/dist/application/errors/DocumentGroupServiceError.d.ts +20 -0
- package/dist/application/errors/DocumentGroupServiceError.js +16 -0
- package/dist/application/errors/DocumentSectionLinkServiceError.d.ts +20 -0
- package/dist/application/errors/DocumentSectionLinkServiceError.js +16 -0
- package/dist/application/errors/DocumentServiceError.d.ts +20 -0
- package/dist/application/errors/DocumentServiceError.js +16 -0
- package/dist/application/errors/DocumentVersionServiceError.d.ts +20 -0
- package/dist/application/errors/DocumentVersionServiceError.js +16 -0
- package/dist/application/errors/EmbedServiceError.d.ts +20 -0
- package/dist/application/errors/EmbedServiceError.js +16 -0
- package/dist/application/errors/PageEmbedLinkServiceError.d.ts +20 -0
- package/dist/application/errors/PageEmbedLinkServiceError.js +16 -0
- package/dist/application/errors/PageServiceError.d.ts +20 -0
- package/dist/application/errors/PageServiceError.js +16 -0
- package/dist/application/errors/PageSnippetLinkServiceError.d.ts +20 -0
- package/dist/application/errors/PageSnippetLinkServiceError.js +16 -0
- package/dist/application/errors/PageVersionServiceError.d.ts +20 -0
- package/dist/application/errors/PageVersionServiceError.js +16 -0
- package/dist/application/errors/SectionPageLinkServiceError.d.ts +20 -0
- package/dist/application/errors/SectionPageLinkServiceError.js +16 -0
- package/dist/application/errors/SectionServiceError.d.ts +20 -0
- package/dist/application/errors/SectionServiceError.js +16 -0
- package/dist/application/errors/SnippetServiceError.d.ts +20 -0
- package/dist/application/errors/SnippetServiceError.js +16 -0
- package/dist/application/errors/index.d.ts +1 -0
- package/dist/application/errors/index.js +1 -0
- package/dist/application/factories/RepositoryFactoryAsset.d.ts +4 -0
- package/dist/application/factories/RepositoryFactoryAsset.js +7 -0
- package/dist/application/factories/RepositoryFactoryAssetVersion.d.ts +4 -0
- package/dist/application/factories/RepositoryFactoryAssetVersion.js +7 -0
- package/dist/application/factories/RepositoryFactoryDocument.d.ts +4 -0
- package/dist/application/factories/RepositoryFactoryDocument.js +7 -0
- package/dist/application/factories/RepositoryFactoryDocumentGroup.d.ts +4 -0
- package/dist/application/factories/RepositoryFactoryDocumentGroup.js +7 -0
- package/dist/application/factories/RepositoryFactoryDocumentIndexEntry.d.ts +4 -0
- package/dist/application/factories/RepositoryFactoryDocumentIndexEntry.js +7 -0
- package/dist/application/factories/RepositoryFactoryDocumentSectionLink.d.ts +4 -0
- package/dist/application/factories/RepositoryFactoryDocumentSectionLink.js +7 -0
- package/dist/application/factories/RepositoryFactoryDocumentVersion.d.ts +4 -0
- package/dist/application/factories/RepositoryFactoryDocumentVersion.js +7 -0
- package/dist/application/factories/RepositoryFactoryEmbed.d.ts +4 -0
- package/dist/application/factories/RepositoryFactoryEmbed.js +7 -0
- package/dist/application/factories/RepositoryFactoryPage.d.ts +4 -0
- package/dist/application/factories/RepositoryFactoryPage.js +7 -0
- package/dist/application/factories/RepositoryFactoryPageEmbedLink.d.ts +4 -0
- package/dist/application/factories/RepositoryFactoryPageEmbedLink.js +7 -0
- package/dist/application/factories/RepositoryFactoryPageSnippetLink.d.ts +4 -0
- package/dist/application/factories/RepositoryFactoryPageSnippetLink.js +7 -0
- package/dist/application/factories/RepositoryFactoryPageVersion.d.ts +4 -0
- package/dist/application/factories/RepositoryFactoryPageVersion.js +7 -0
- package/dist/application/factories/RepositoryFactorySection.d.ts +4 -0
- package/dist/application/factories/RepositoryFactorySection.js +7 -0
- package/dist/application/factories/RepositoryFactorySectionPageLink.d.ts +4 -0
- package/dist/application/factories/RepositoryFactorySectionPageLink.js +7 -0
- package/dist/application/factories/RepositoryFactorySnippet.d.ts +4 -0
- package/dist/application/factories/RepositoryFactorySnippet.js +7 -0
- package/dist/application/factories/ServiceAssetBuilder.d.ts +30 -0
- package/dist/application/factories/ServiceAssetBuilder.js +80 -0
- package/dist/application/factories/ServiceAssetFactory.d.ts +11 -0
- package/dist/application/factories/ServiceAssetFactory.js +15 -0
- package/dist/application/factories/ServiceAssetVersionBuilder.d.ts +30 -0
- package/dist/application/factories/ServiceAssetVersionBuilder.js +80 -0
- package/dist/application/factories/ServiceAssetVersionFactory.d.ts +11 -0
- package/dist/application/factories/ServiceAssetVersionFactory.js +15 -0
- package/dist/application/factories/ServiceDocumentBuilder.d.ts +30 -0
- package/dist/application/factories/ServiceDocumentBuilder.js +83 -0
- package/dist/application/factories/ServiceDocumentFactory.d.ts +11 -0
- package/dist/application/factories/ServiceDocumentFactory.js +15 -0
- package/dist/application/factories/ServiceDocumentGroupBuilder.d.ts +30 -0
- package/dist/application/factories/ServiceDocumentGroupBuilder.js +83 -0
- package/dist/application/factories/ServiceDocumentGroupFactory.d.ts +11 -0
- package/dist/application/factories/ServiceDocumentGroupFactory.js +15 -0
- package/dist/application/factories/ServiceDocumentSectionLinkBuilder.d.ts +30 -0
- package/dist/application/factories/ServiceDocumentSectionLinkBuilder.js +83 -0
- package/dist/application/factories/ServiceDocumentSectionLinkFactory.d.ts +11 -0
- package/dist/application/factories/ServiceDocumentSectionLinkFactory.js +15 -0
- package/dist/application/factories/ServiceDocumentVersionBuilder.d.ts +30 -0
- package/dist/application/factories/ServiceDocumentVersionBuilder.js +83 -0
- package/dist/application/factories/ServiceDocumentVersionFactory.d.ts +11 -0
- package/dist/application/factories/ServiceDocumentVersionFactory.js +15 -0
- package/dist/application/factories/ServiceEmbedBuilder.d.ts +30 -0
- package/dist/application/factories/ServiceEmbedBuilder.js +83 -0
- package/dist/application/factories/ServiceEmbedFactory.d.ts +11 -0
- package/dist/application/factories/ServiceEmbedFactory.js +15 -0
- package/dist/application/factories/ServicePageBuilder.d.ts +30 -0
- package/dist/application/factories/ServicePageBuilder.js +83 -0
- package/dist/application/factories/ServicePageEmbedLinkBuilder.d.ts +30 -0
- package/dist/application/factories/ServicePageEmbedLinkBuilder.js +83 -0
- package/dist/application/factories/ServicePageEmbedLinkFactory.d.ts +11 -0
- package/dist/application/factories/ServicePageEmbedLinkFactory.js +15 -0
- package/dist/application/factories/ServicePageFactory.d.ts +11 -0
- package/dist/application/factories/ServicePageFactory.js +15 -0
- package/dist/application/factories/ServicePageSnippetLinkBuilder.d.ts +30 -0
- package/dist/application/factories/ServicePageSnippetLinkBuilder.js +83 -0
- package/dist/application/factories/ServicePageSnippetLinkFactory.d.ts +11 -0
- package/dist/application/factories/ServicePageSnippetLinkFactory.js +15 -0
- package/dist/application/factories/ServicePageVersionBuilder.d.ts +34 -0
- package/dist/application/factories/ServicePageVersionBuilder.js +121 -0
- package/dist/application/factories/ServicePageVersionFactory.d.ts +11 -0
- package/dist/application/factories/ServicePageVersionFactory.js +15 -0
- package/dist/application/factories/ServiceSectionBuilder.d.ts +30 -0
- package/dist/application/factories/ServiceSectionBuilder.js +83 -0
- package/dist/application/factories/ServiceSectionFactory.d.ts +11 -0
- package/dist/application/factories/ServiceSectionFactory.js +15 -0
- package/dist/application/factories/ServiceSectionPageLinkBuilder.d.ts +30 -0
- package/dist/application/factories/ServiceSectionPageLinkBuilder.js +83 -0
- package/dist/application/factories/ServiceSectionPageLinkFactory.d.ts +11 -0
- package/dist/application/factories/ServiceSectionPageLinkFactory.js +15 -0
- package/dist/application/factories/ServiceSnippetBuilder.d.ts +30 -0
- package/dist/application/factories/ServiceSnippetBuilder.js +83 -0
- package/dist/application/factories/ServiceSnippetFactory.d.ts +11 -0
- package/dist/application/factories/ServiceSnippetFactory.js +15 -0
- package/dist/application/factories/drizzleDialect.d.ts +16 -0
- package/dist/application/factories/drizzleDialect.js +36 -0
- package/dist/application/factories/index.d.ts +43 -0
- package/dist/application/factories/index.js +44 -0
- package/dist/application/ports/inbound/IAssetServicePort.d.ts +14 -0
- package/dist/application/ports/inbound/IAssetServicePort.js +1 -0
- package/dist/application/ports/inbound/IAssetVersionServicePort.d.ts +14 -0
- package/dist/application/ports/inbound/IAssetVersionServicePort.js +1 -0
- package/dist/application/ports/inbound/IDocumentGroupServicePort.d.ts +14 -0
- package/dist/application/ports/inbound/IDocumentGroupServicePort.js +1 -0
- package/dist/application/ports/inbound/IDocumentSectionLinkServicePort.d.ts +16 -0
- package/dist/application/ports/inbound/IDocumentSectionLinkServicePort.js +1 -0
- package/dist/application/ports/inbound/IDocumentServicePort.d.ts +300 -0
- package/dist/application/ports/inbound/IDocumentServicePort.js +1 -0
- package/dist/application/ports/inbound/IDocumentVersionServicePort.d.ts +106 -0
- package/dist/application/ports/inbound/IDocumentVersionServicePort.js +1 -0
- package/dist/application/ports/inbound/IEmbedServicePort.d.ts +14 -0
- package/dist/application/ports/inbound/IEmbedServicePort.js +1 -0
- package/dist/application/ports/inbound/IPageEmbedLinkServicePort.d.ts +14 -0
- package/dist/application/ports/inbound/IPageEmbedLinkServicePort.js +1 -0
- package/dist/application/ports/inbound/IPageServicePort.d.ts +14 -0
- package/dist/application/ports/inbound/IPageServicePort.js +1 -0
- package/dist/application/ports/inbound/IPageSnippetLinkServicePort.d.ts +14 -0
- package/dist/application/ports/inbound/IPageSnippetLinkServicePort.js +1 -0
- package/dist/application/ports/inbound/IPageVersionServicePort.d.ts +14 -0
- package/dist/application/ports/inbound/IPageVersionServicePort.js +1 -0
- package/dist/application/ports/inbound/ISectionPageLinkServicePort.d.ts +14 -0
- package/dist/application/ports/inbound/ISectionPageLinkServicePort.js +1 -0
- package/dist/application/ports/inbound/ISectionServicePort.d.ts +14 -0
- package/dist/application/ports/inbound/ISectionServicePort.js +1 -0
- package/dist/application/ports/inbound/ISnippetServicePort.d.ts +14 -0
- package/dist/application/ports/inbound/ISnippetServicePort.js +1 -0
- package/dist/application/ports/inbound/index.d.ts +14 -0
- package/dist/application/ports/inbound/index.js +15 -0
- package/dist/application/ports/repository-ports/IRepositoryPortAsset.d.ts +5 -0
- package/dist/application/ports/repository-ports/IRepositoryPortAsset.js +1 -0
- package/dist/application/ports/repository-ports/IRepositoryPortAssetVersion.d.ts +5 -0
- package/dist/application/ports/repository-ports/IRepositoryPortAssetVersion.js +1 -0
- package/dist/application/ports/repository-ports/IRepositoryPortDocument.d.ts +10 -0
- package/dist/application/ports/repository-ports/IRepositoryPortDocument.js +1 -0
- package/dist/application/ports/repository-ports/IRepositoryPortDocumentGroup.d.ts +10 -0
- package/dist/application/ports/repository-ports/IRepositoryPortDocumentGroup.js +1 -0
- package/dist/application/ports/repository-ports/IRepositoryPortDocumentIndexEntry.d.ts +5 -0
- package/dist/application/ports/repository-ports/IRepositoryPortDocumentIndexEntry.js +1 -0
- package/dist/application/ports/repository-ports/IRepositoryPortDocumentSectionLink.d.ts +21 -0
- package/dist/application/ports/repository-ports/IRepositoryPortDocumentSectionLink.js +1 -0
- package/dist/application/ports/repository-ports/IRepositoryPortDocumentVersion.d.ts +10 -0
- package/dist/application/ports/repository-ports/IRepositoryPortDocumentVersion.js +1 -0
- package/dist/application/ports/repository-ports/IRepositoryPortEmbed.d.ts +10 -0
- package/dist/application/ports/repository-ports/IRepositoryPortEmbed.js +1 -0
- package/dist/application/ports/repository-ports/IRepositoryPortPage.d.ts +10 -0
- package/dist/application/ports/repository-ports/IRepositoryPortPage.js +1 -0
- package/dist/application/ports/repository-ports/IRepositoryPortPageEmbedLink.d.ts +10 -0
- package/dist/application/ports/repository-ports/IRepositoryPortPageEmbedLink.js +1 -0
- package/dist/application/ports/repository-ports/IRepositoryPortPageSnippetLink.d.ts +10 -0
- package/dist/application/ports/repository-ports/IRepositoryPortPageSnippetLink.js +1 -0
- package/dist/application/ports/repository-ports/IRepositoryPortPageVersion.d.ts +10 -0
- package/dist/application/ports/repository-ports/IRepositoryPortPageVersion.js +1 -0
- package/dist/application/ports/repository-ports/IRepositoryPortSection.d.ts +10 -0
- package/dist/application/ports/repository-ports/IRepositoryPortSection.js +1 -0
- package/dist/application/ports/repository-ports/IRepositoryPortSectionPageLink.d.ts +10 -0
- package/dist/application/ports/repository-ports/IRepositoryPortSectionPageLink.js +1 -0
- package/dist/application/ports/repository-ports/IRepositoryPortSnippet.d.ts +10 -0
- package/dist/application/ports/repository-ports/IRepositoryPortSnippet.js +1 -0
- package/dist/application/ports/repository-ports/index.d.ts +15 -0
- package/dist/application/ports/repository-ports/index.js +16 -0
- package/dist/application/services/documentCascadeDelete.d.ts +47 -0
- package/dist/application/services/documentCascadeDelete.js +202 -0
- package/dist/application/services/documentComposeSupport.d.ts +30 -0
- package/dist/application/services/documentComposeSupport.js +285 -0
- package/dist/application/services/documentIndexSupport.d.ts +7 -0
- package/dist/application/services/documentIndexSupport.js +28 -0
- package/dist/application/services/documentPublishSupport.d.ts +14 -0
- package/dist/application/services/documentPublishSupport.js +39 -0
- package/dist/application/services/documentRetrievalAiSupport.d.ts +21 -0
- package/dist/application/services/documentRetrievalAiSupport.js +114 -0
- package/dist/application/services/index.d.ts +14 -0
- package/dist/application/services/index.js +15 -0
- package/dist/application/services/service.asset.d.ts +25 -0
- package/dist/application/services/service.asset.js +58 -0
- package/dist/application/services/service.assetVersion.d.ts +25 -0
- package/dist/application/services/service.assetVersion.js +58 -0
- package/dist/application/services/service.document.d.ts +167 -0
- package/dist/application/services/service.document.js +2860 -0
- package/dist/application/services/service.documentGroup.d.ts +25 -0
- package/dist/application/services/service.documentGroup.js +58 -0
- package/dist/application/services/service.documentSectionLink.d.ts +27 -0
- package/dist/application/services/service.documentSectionLink.js +69 -0
- package/dist/application/services/service.documentVersion.d.ts +66 -0
- package/dist/application/services/service.documentVersion.js +715 -0
- package/dist/application/services/service.embed.d.ts +25 -0
- package/dist/application/services/service.embed.js +58 -0
- package/dist/application/services/service.page.d.ts +25 -0
- package/dist/application/services/service.page.js +58 -0
- package/dist/application/services/service.pageEmbedLink.d.ts +25 -0
- package/dist/application/services/service.pageEmbedLink.js +58 -0
- package/dist/application/services/service.pageSnippetLink.d.ts +25 -0
- package/dist/application/services/service.pageSnippetLink.js +58 -0
- package/dist/application/services/service.pageVersion.d.ts +31 -0
- package/dist/application/services/service.pageVersion.js +114 -0
- package/dist/application/services/service.section.d.ts +25 -0
- package/dist/application/services/service.section.js +58 -0
- package/dist/application/services/service.sectionPageLink.d.ts +25 -0
- package/dist/application/services/service.sectionPageLink.js +58 -0
- package/dist/application/services/service.snippet.d.ts +25 -0
- package/dist/application/services/service.snippet.js +58 -0
- package/dist/application/services/service.zod-validation.d.ts +11 -0
- package/dist/application/services/service.zod-validation.js +14 -0
- package/dist/domain/domain.d.ts +8 -0
- package/dist/domain/domain.js +9 -0
- package/dist/domain/dto/index.d.ts +1 -0
- package/dist/domain/dto/index.js +1 -0
- package/dist/domain/index.d.ts +4 -0
- package/dist/domain/index.js +4 -0
- package/dist/domain/models/asset/IbmAsset.d.ts +5 -0
- package/dist/domain/models/asset/IbmAsset.js +18 -0
- package/dist/domain/models/asset/index.d.ts +2 -0
- package/dist/domain/models/asset/index.js +2 -0
- package/dist/domain/models/asset/zod.schema.d.ts +39 -0
- package/dist/domain/models/asset/zod.schema.js +22 -0
- package/dist/domain/models/assetVersion/IbmAssetVersion.d.ts +6 -0
- package/dist/domain/models/assetVersion/IbmAssetVersion.js +25 -0
- package/dist/domain/models/assetVersion/index.d.ts +2 -0
- package/dist/domain/models/assetVersion/index.js +2 -0
- package/dist/domain/models/assetVersion/zod.schema.d.ts +71 -0
- package/dist/domain/models/assetVersion/zod.schema.js +37 -0
- package/dist/domain/models/document/IbmDocument.d.ts +8 -0
- package/dist/domain/models/document/IbmDocument.js +30 -0
- package/dist/domain/models/document/index.d.ts +2 -0
- package/dist/domain/models/document/index.js +2 -0
- package/dist/domain/models/document/zod.schema.d.ts +157 -0
- package/dist/domain/models/document/zod.schema.js +31 -0
- package/dist/domain/models/documentGroup/IbmDocumentGroup.d.ts +5 -0
- package/dist/domain/models/documentGroup/IbmDocumentGroup.js +17 -0
- package/dist/domain/models/documentGroup/index.d.ts +2 -0
- package/dist/domain/models/documentGroup/index.js +2 -0
- package/dist/domain/models/documentGroup/zod.schema.d.ts +27 -0
- package/dist/domain/models/documentGroup/zod.schema.js +22 -0
- package/dist/domain/models/documentIndexEntry/IbmDocumentIndexEntry.d.ts +6 -0
- package/dist/domain/models/documentIndexEntry/IbmDocumentIndexEntry.js +50 -0
- package/dist/domain/models/documentIndexEntry/index.d.ts +2 -0
- package/dist/domain/models/documentIndexEntry/index.js +2 -0
- package/dist/domain/models/documentIndexEntry/zod.schema.d.ts +112 -0
- package/dist/domain/models/documentIndexEntry/zod.schema.js +55 -0
- package/dist/domain/models/documentSectionLink/IbmDocumentSectionLink.d.ts +5 -0
- package/dist/domain/models/documentSectionLink/IbmDocumentSectionLink.js +23 -0
- package/dist/domain/models/documentSectionLink/index.d.ts +2 -0
- package/dist/domain/models/documentSectionLink/index.js +2 -0
- package/dist/domain/models/documentSectionLink/zod.schema.d.ts +65 -0
- package/dist/domain/models/documentSectionLink/zod.schema.js +80 -0
- package/dist/domain/models/documentVersion/IbmDocumentVersion.d.ts +8 -0
- package/dist/domain/models/documentVersion/IbmDocumentVersion.js +25 -0
- package/dist/domain/models/documentVersion/index.d.ts +2 -0
- package/dist/domain/models/documentVersion/index.js +2 -0
- package/dist/domain/models/documentVersion/zod.schema.d.ts +75 -0
- package/dist/domain/models/documentVersion/zod.schema.js +26 -0
- package/dist/domain/models/embed/IbmEmbed.d.ts +5 -0
- package/dist/domain/models/embed/IbmEmbed.js +19 -0
- package/dist/domain/models/embed/index.d.ts +2 -0
- package/dist/domain/models/embed/index.js +2 -0
- package/dist/domain/models/embed/zod.schema.d.ts +39 -0
- package/dist/domain/models/embed/zod.schema.js +24 -0
- package/dist/domain/models/index.d.ts +15 -0
- package/dist/domain/models/index.js +16 -0
- package/dist/domain/models/page/IbmPage.d.ts +8 -0
- package/dist/domain/models/page/IbmPage.js +20 -0
- package/dist/domain/models/page/index.d.ts +2 -0
- package/dist/domain/models/page/index.js +2 -0
- package/dist/domain/models/page/zod.schema.d.ts +57 -0
- package/dist/domain/models/page/zod.schema.js +21 -0
- package/dist/domain/models/pageEmbedLink/IbmPageEmbedLink.d.ts +5 -0
- package/dist/domain/models/pageEmbedLink/IbmPageEmbedLink.js +14 -0
- package/dist/domain/models/pageEmbedLink/index.d.ts +2 -0
- package/dist/domain/models/pageEmbedLink/index.js +2 -0
- package/dist/domain/models/pageEmbedLink/zod.schema.d.ts +21 -0
- package/dist/domain/models/pageEmbedLink/zod.schema.js +19 -0
- package/dist/domain/models/pageSnippetLink/IbmPageSnippetLink.d.ts +5 -0
- package/dist/domain/models/pageSnippetLink/IbmPageSnippetLink.js +15 -0
- package/dist/domain/models/pageSnippetLink/index.d.ts +2 -0
- package/dist/domain/models/pageSnippetLink/index.js +2 -0
- package/dist/domain/models/pageSnippetLink/zod.schema.d.ts +23 -0
- package/dist/domain/models/pageSnippetLink/zod.schema.js +20 -0
- package/dist/domain/models/pageVersion/IbmPageVersion.d.ts +8 -0
- package/dist/domain/models/pageVersion/IbmPageVersion.js +23 -0
- package/dist/domain/models/pageVersion/index.d.ts +2 -0
- package/dist/domain/models/pageVersion/index.js +2 -0
- package/dist/domain/models/pageVersion/zod.schema.d.ts +77 -0
- package/dist/domain/models/pageVersion/zod.schema.js +24 -0
- package/dist/domain/models/section/IbmSection.d.ts +8 -0
- package/dist/domain/models/section/IbmSection.js +20 -0
- package/dist/domain/models/section/index.d.ts +2 -0
- package/dist/domain/models/section/index.js +2 -0
- package/dist/domain/models/section/zod.schema.d.ts +57 -0
- package/dist/domain/models/section/zod.schema.js +21 -0
- package/dist/domain/models/sectionPageLink/IbmSectionPageLink.d.ts +5 -0
- package/dist/domain/models/sectionPageLink/IbmSectionPageLink.js +18 -0
- package/dist/domain/models/sectionPageLink/index.d.ts +2 -0
- package/dist/domain/models/sectionPageLink/index.js +2 -0
- package/dist/domain/models/sectionPageLink/zod.schema.d.ts +29 -0
- package/dist/domain/models/sectionPageLink/zod.schema.js +23 -0
- package/dist/domain/models/snippet/IbmSnippet.d.ts +5 -0
- package/dist/domain/models/snippet/IbmSnippet.js +17 -0
- package/dist/domain/models/snippet/index.d.ts +2 -0
- package/dist/domain/models/snippet/index.js +2 -0
- package/dist/domain/models/snippet/zod.schema.d.ts +27 -0
- package/dist/domain/models/snippet/zod.schema.js +22 -0
- package/dist/domain/types.d.ts +1 -0
- package/dist/domain/types.js +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/infrastructure/db/asset/drizzle/drizzle.mapper.asset.d.ts +31 -0
- package/dist/infrastructure/db/asset/drizzle/drizzle.mapper.asset.js +6 -0
- package/dist/infrastructure/db/asset/drizzle/drizzle.schema.asset.d.ts +250 -0
- package/dist/infrastructure/db/asset/drizzle/drizzle.schema.asset.js +24 -0
- package/dist/infrastructure/db/asset/drizzle/drizzle.schema.asset.sqlite.d.ts +272 -0
- package/dist/infrastructure/db/asset/drizzle/drizzle.schema.asset.sqlite.js +25 -0
- package/dist/infrastructure/db/asset/drizzle/index.d.ts +2 -0
- package/dist/infrastructure/db/asset/drizzle/index.js +2 -0
- package/dist/infrastructure/db/assetVersion/drizzle/drizzle.mapper.assetVersion.d.ts +45 -0
- package/dist/infrastructure/db/assetVersion/drizzle/drizzle.mapper.assetVersion.js +6 -0
- package/dist/infrastructure/db/assetVersion/drizzle/drizzle.schema.assetVersion.d.ts +371 -0
- package/dist/infrastructure/db/assetVersion/drizzle/drizzle.schema.assetVersion.js +30 -0
- package/dist/infrastructure/db/assetVersion/drizzle/drizzle.schema.assetVersion.sqlite.d.ts +397 -0
- package/dist/infrastructure/db/assetVersion/drizzle/drizzle.schema.assetVersion.sqlite.js +31 -0
- package/dist/infrastructure/db/assetVersion/drizzle/index.d.ts +2 -0
- package/dist/infrastructure/db/assetVersion/drizzle/index.js +2 -0
- package/dist/infrastructure/db/document/drizzle/drizzle.mapper.document.d.ts +98 -0
- package/dist/infrastructure/db/document/drizzle/drizzle.mapper.document.js +6 -0
- package/dist/infrastructure/db/document/drizzle/drizzle.schema.document.d.ts +394 -0
- package/dist/infrastructure/db/document/drizzle/drizzle.schema.document.js +34 -0
- package/dist/infrastructure/db/document/drizzle/drizzle.schema.document.sqlite.d.ts +424 -0
- package/dist/infrastructure/db/document/drizzle/drizzle.schema.document.sqlite.js +35 -0
- package/dist/infrastructure/db/document/drizzle/index.d.ts +2 -0
- package/dist/infrastructure/db/document/drizzle/index.js +2 -0
- package/dist/infrastructure/db/documentGroup/drizzle/drizzle.mapper.documentGroup.d.ts +29 -0
- package/dist/infrastructure/db/documentGroup/drizzle/drizzle.mapper.documentGroup.js +6 -0
- package/dist/infrastructure/db/documentGroup/drizzle/drizzle.schema.documentGroup.d.ts +233 -0
- package/dist/infrastructure/db/documentGroup/drizzle/drizzle.schema.documentGroup.js +22 -0
- package/dist/infrastructure/db/documentGroup/drizzle/drizzle.schema.documentGroup.sqlite.d.ts +253 -0
- package/dist/infrastructure/db/documentGroup/drizzle/drizzle.schema.documentGroup.sqlite.js +23 -0
- package/dist/infrastructure/db/documentGroup/drizzle/index.d.ts +2 -0
- package/dist/infrastructure/db/documentGroup/drizzle/index.js +2 -0
- package/dist/infrastructure/db/documentIndexEntry/drizzle/drizzle.mapper.documentIndexEntry.d.ts +95 -0
- package/dist/infrastructure/db/documentIndexEntry/drizzle/drizzle.mapper.documentIndexEntry.js +12 -0
- package/dist/infrastructure/db/documentIndexEntry/drizzle/drizzle.schema.documentIndexEntry.d.ts +792 -0
- package/dist/infrastructure/db/documentIndexEntry/drizzle/drizzle.schema.documentIndexEntry.js +57 -0
- package/dist/infrastructure/db/documentIndexEntry/drizzle/drizzle.schema.documentIndexEntry.sqlite.d.ts +854 -0
- package/dist/infrastructure/db/documentIndexEntry/drizzle/drizzle.schema.documentIndexEntry.sqlite.js +58 -0
- package/dist/infrastructure/db/documentIndexEntry/drizzle/index.d.ts +2 -0
- package/dist/infrastructure/db/documentIndexEntry/drizzle/index.js +2 -0
- package/dist/infrastructure/db/documentSectionLink/drizzle/drizzle.mapper.documentSectionLink.d.ts +41 -0
- package/dist/infrastructure/db/documentSectionLink/drizzle/drizzle.mapper.documentSectionLink.js +12 -0
- package/dist/infrastructure/db/documentSectionLink/drizzle/drizzle.schema.documentSectionLink.d.ts +335 -0
- package/dist/infrastructure/db/documentSectionLink/drizzle/drizzle.schema.documentSectionLink.js +29 -0
- package/dist/infrastructure/db/documentSectionLink/drizzle/drizzle.schema.documentSectionLink.sqlite.d.ts +357 -0
- package/dist/infrastructure/db/documentSectionLink/drizzle/drizzle.schema.documentSectionLink.sqlite.js +30 -0
- package/dist/infrastructure/db/documentSectionLink/drizzle/index.d.ts +2 -0
- package/dist/infrastructure/db/documentSectionLink/drizzle/index.js +2 -0
- package/dist/infrastructure/db/documentVersion/drizzle/drizzle.mapper.documentVersion.d.ts +54 -0
- package/dist/infrastructure/db/documentVersion/drizzle/drizzle.mapper.documentVersion.js +7 -0
- package/dist/infrastructure/db/documentVersion/drizzle/drizzle.schema.documentVersion.d.ts +301 -0
- package/dist/infrastructure/db/documentVersion/drizzle/drizzle.schema.documentVersion.js +30 -0
- package/dist/infrastructure/db/documentVersion/drizzle/drizzle.schema.documentVersion.sqlite.d.ts +323 -0
- package/dist/infrastructure/db/documentVersion/drizzle/drizzle.schema.documentVersion.sqlite.js +27 -0
- package/dist/infrastructure/db/documentVersion/drizzle/index.d.ts +2 -0
- package/dist/infrastructure/db/documentVersion/drizzle/index.js +2 -0
- package/dist/infrastructure/db/domain-naming.d.ts +2 -0
- package/dist/infrastructure/db/domain-naming.js +57 -0
- package/dist/infrastructure/db/embed/drizzle/drizzle.mapper.embed.d.ts +33 -0
- package/dist/infrastructure/db/embed/drizzle/drizzle.mapper.embed.js +5 -0
- package/dist/infrastructure/db/embed/drizzle/drizzle.schema.embed.d.ts +267 -0
- package/dist/infrastructure/db/embed/drizzle/drizzle.schema.embed.js +24 -0
- package/dist/infrastructure/db/embed/drizzle/drizzle.schema.embed.sqlite.d.ts +291 -0
- package/dist/infrastructure/db/embed/drizzle/drizzle.schema.embed.sqlite.js +25 -0
- package/dist/infrastructure/db/embed/drizzle/index.d.ts +2 -0
- package/dist/infrastructure/db/embed/drizzle/index.js +2 -0
- package/dist/infrastructure/db/page/drizzle/drizzle.mapper.page.d.ts +44 -0
- package/dist/infrastructure/db/page/drizzle/drizzle.mapper.page.js +5 -0
- package/dist/infrastructure/db/page/drizzle/drizzle.schema.page.d.ts +218 -0
- package/dist/infrastructure/db/page/drizzle/drizzle.schema.page.js +20 -0
- package/dist/infrastructure/db/page/drizzle/drizzle.schema.page.sqlite.d.ts +234 -0
- package/dist/infrastructure/db/page/drizzle/drizzle.schema.page.sqlite.js +21 -0
- package/dist/infrastructure/db/page/drizzle/index.d.ts +2 -0
- package/dist/infrastructure/db/page/drizzle/index.js +2 -0
- package/dist/infrastructure/db/pageEmbedLink/drizzle/drizzle.mapper.pageEmbedLink.d.ts +23 -0
- package/dist/infrastructure/db/pageEmbedLink/drizzle/drizzle.mapper.pageEmbedLink.js +5 -0
- package/dist/infrastructure/db/pageEmbedLink/drizzle/drizzle.schema.pageEmbedLink.d.ts +180 -0
- package/dist/infrastructure/db/pageEmbedLink/drizzle/drizzle.schema.pageEmbedLink.js +18 -0
- package/dist/infrastructure/db/pageEmbedLink/drizzle/drizzle.schema.pageEmbedLink.sqlite.d.ts +194 -0
- package/dist/infrastructure/db/pageEmbedLink/drizzle/drizzle.schema.pageEmbedLink.sqlite.js +19 -0
- package/dist/infrastructure/db/pageEmbedLink/drizzle/index.d.ts +2 -0
- package/dist/infrastructure/db/pageEmbedLink/drizzle/index.js +2 -0
- package/dist/infrastructure/db/pageSnippetLink/drizzle/drizzle.mapper.pageSnippetLink.d.ts +25 -0
- package/dist/infrastructure/db/pageSnippetLink/drizzle/drizzle.mapper.pageSnippetLink.js +7 -0
- package/dist/infrastructure/db/pageSnippetLink/drizzle/drizzle.schema.pageSnippetLink.d.ts +197 -0
- package/dist/infrastructure/db/pageSnippetLink/drizzle/drizzle.schema.pageSnippetLink.js +19 -0
- package/dist/infrastructure/db/pageSnippetLink/drizzle/drizzle.schema.pageSnippetLink.sqlite.d.ts +211 -0
- package/dist/infrastructure/db/pageSnippetLink/drizzle/drizzle.schema.pageSnippetLink.sqlite.js +20 -0
- package/dist/infrastructure/db/pageSnippetLink/drizzle/index.d.ts +2 -0
- package/dist/infrastructure/db/pageSnippetLink/drizzle/index.js +2 -0
- package/dist/infrastructure/db/pageVersion/drizzle/drizzle.mapper.pageVersion.d.ts +50 -0
- package/dist/infrastructure/db/pageVersion/drizzle/drizzle.mapper.pageVersion.js +6 -0
- package/dist/infrastructure/db/pageVersion/drizzle/drizzle.schema.pageVersion.d.ts +271 -0
- package/dist/infrastructure/db/pageVersion/drizzle/drizzle.schema.pageVersion.js +23 -0
- package/dist/infrastructure/db/pageVersion/drizzle/drizzle.schema.pageVersion.sqlite.d.ts +289 -0
- package/dist/infrastructure/db/pageVersion/drizzle/drizzle.schema.pageVersion.sqlite.js +24 -0
- package/dist/infrastructure/db/pageVersion/drizzle/index.d.ts +2 -0
- package/dist/infrastructure/db/pageVersion/drizzle/index.js +2 -0
- package/dist/infrastructure/db/section/drizzle/drizzle.mapper.section.d.ts +44 -0
- package/dist/infrastructure/db/section/drizzle/drizzle.mapper.section.js +5 -0
- package/dist/infrastructure/db/section/drizzle/drizzle.schema.section.d.ts +216 -0
- package/dist/infrastructure/db/section/drizzle/drizzle.schema.section.js +20 -0
- package/dist/infrastructure/db/section/drizzle/drizzle.schema.section.sqlite.d.ts +234 -0
- package/dist/infrastructure/db/section/drizzle/drizzle.schema.section.sqlite.js +21 -0
- package/dist/infrastructure/db/section/drizzle/index.d.ts +2 -0
- package/dist/infrastructure/db/section/drizzle/index.js +2 -0
- package/dist/infrastructure/db/sectionPageLink/drizzle/drizzle.mapper.sectionPageLink.d.ts +31 -0
- package/dist/infrastructure/db/sectionPageLink/drizzle/drizzle.mapper.sectionPageLink.js +7 -0
- package/dist/infrastructure/db/sectionPageLink/drizzle/drizzle.schema.sectionPageLink.d.ts +248 -0
- package/dist/infrastructure/db/sectionPageLink/drizzle/drizzle.schema.sectionPageLink.js +22 -0
- package/dist/infrastructure/db/sectionPageLink/drizzle/drizzle.schema.sectionPageLink.sqlite.d.ts +264 -0
- package/dist/infrastructure/db/sectionPageLink/drizzle/drizzle.schema.sectionPageLink.sqlite.js +23 -0
- package/dist/infrastructure/db/sectionPageLink/drizzle/index.d.ts +2 -0
- package/dist/infrastructure/db/sectionPageLink/drizzle/index.js +2 -0
- package/dist/infrastructure/db/snippet/drizzle/drizzle.mapper.snippet.d.ts +29 -0
- package/dist/infrastructure/db/snippet/drizzle/drizzle.mapper.snippet.js +5 -0
- package/dist/infrastructure/db/snippet/drizzle/drizzle.schema.snippet.d.ts +233 -0
- package/dist/infrastructure/db/snippet/drizzle/drizzle.schema.snippet.js +22 -0
- package/dist/infrastructure/db/snippet/drizzle/drizzle.schema.snippet.sqlite.d.ts +253 -0
- package/dist/infrastructure/db/snippet/drizzle/drizzle.schema.snippet.sqlite.js +23 -0
- package/dist/infrastructure/db/snippet/drizzle/index.d.ts +2 -0
- package/dist/infrastructure/db/snippet/drizzle/index.js +2 -0
- package/dist/infrastructure/repositories/asset/drizzle/AssetDrizzleRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/asset/drizzle/AssetDrizzleRepo.js +8 -0
- package/dist/infrastructure/repositories/asset/drizzle/AssetDrizzleSqliteRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/asset/drizzle/AssetDrizzleSqliteRepo.js +8 -0
- package/dist/infrastructure/repositories/assetVersion/drizzle/AssetVersionDrizzleRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/assetVersion/drizzle/AssetVersionDrizzleRepo.js +8 -0
- package/dist/infrastructure/repositories/assetVersion/drizzle/AssetVersionDrizzleSqliteRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/assetVersion/drizzle/AssetVersionDrizzleSqliteRepo.js +12 -0
- package/dist/infrastructure/repositories/document/drizzle/DocumentDrizzleRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/document/drizzle/DocumentDrizzleRepo.js +8 -0
- package/dist/infrastructure/repositories/document/drizzle/DocumentDrizzleSqliteRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/document/drizzle/DocumentDrizzleSqliteRepo.js +8 -0
- package/dist/infrastructure/repositories/documentGroup/drizzle/DocumentGroupDrizzleRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/documentGroup/drizzle/DocumentGroupDrizzleRepo.js +8 -0
- package/dist/infrastructure/repositories/documentGroup/drizzle/DocumentGroupDrizzleSqliteRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/documentGroup/drizzle/DocumentGroupDrizzleSqliteRepo.js +8 -0
- package/dist/infrastructure/repositories/documentIndexEntry/drizzle/DocumentIndexEntryDrizzleRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/documentIndexEntry/drizzle/DocumentIndexEntryDrizzleRepo.js +12 -0
- package/dist/infrastructure/repositories/documentIndexEntry/drizzle/DocumentIndexEntryDrizzleSqliteRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/documentIndexEntry/drizzle/DocumentIndexEntryDrizzleSqliteRepo.js +12 -0
- package/dist/infrastructure/repositories/documentSectionLink/drizzle/DocumentSectionLinkDrizzleRepo.d.ts +15 -0
- package/dist/infrastructure/repositories/documentSectionLink/drizzle/DocumentSectionLinkDrizzleRepo.js +41 -0
- package/dist/infrastructure/repositories/documentSectionLink/drizzle/DocumentSectionLinkDrizzleSqliteRepo.d.ts +15 -0
- package/dist/infrastructure/repositories/documentSectionLink/drizzle/DocumentSectionLinkDrizzleSqliteRepo.js +40 -0
- package/dist/infrastructure/repositories/documentVersion/drizzle/DocumentVersionDrizzleRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/documentVersion/drizzle/DocumentVersionDrizzleRepo.js +8 -0
- package/dist/infrastructure/repositories/documentVersion/drizzle/DocumentVersionDrizzleSqliteRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/documentVersion/drizzle/DocumentVersionDrizzleSqliteRepo.js +8 -0
- package/dist/infrastructure/repositories/embed/drizzle/EmbedDrizzleRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/embed/drizzle/EmbedDrizzleRepo.js +8 -0
- package/dist/infrastructure/repositories/embed/drizzle/EmbedDrizzleSqliteRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/embed/drizzle/EmbedDrizzleSqliteRepo.js +8 -0
- package/dist/infrastructure/repositories/index.d.ts +30 -0
- package/dist/infrastructure/repositories/index.js +31 -0
- package/dist/infrastructure/repositories/page/drizzle/PageDrizzleRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/page/drizzle/PageDrizzleRepo.js +8 -0
- package/dist/infrastructure/repositories/page/drizzle/PageDrizzleSqliteRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/page/drizzle/PageDrizzleSqliteRepo.js +8 -0
- package/dist/infrastructure/repositories/pageEmbedLink/drizzle/PageEmbedLinkDrizzleRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/pageEmbedLink/drizzle/PageEmbedLinkDrizzleRepo.js +8 -0
- package/dist/infrastructure/repositories/pageEmbedLink/drizzle/PageEmbedLinkDrizzleSqliteRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/pageEmbedLink/drizzle/PageEmbedLinkDrizzleSqliteRepo.js +8 -0
- package/dist/infrastructure/repositories/pageSnippetLink/drizzle/PageSnippetLinkDrizzleRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/pageSnippetLink/drizzle/PageSnippetLinkDrizzleRepo.js +8 -0
- package/dist/infrastructure/repositories/pageSnippetLink/drizzle/PageSnippetLinkDrizzleSqliteRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/pageSnippetLink/drizzle/PageSnippetLinkDrizzleSqliteRepo.js +8 -0
- package/dist/infrastructure/repositories/pageVersion/drizzle/PageVersionDrizzleRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/pageVersion/drizzle/PageVersionDrizzleRepo.js +8 -0
- package/dist/infrastructure/repositories/pageVersion/drizzle/PageVersionDrizzleSqliteRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/pageVersion/drizzle/PageVersionDrizzleSqliteRepo.js +8 -0
- package/dist/infrastructure/repositories/section/drizzle/SectionDrizzleRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/section/drizzle/SectionDrizzleRepo.js +8 -0
- package/dist/infrastructure/repositories/section/drizzle/SectionDrizzleSqliteRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/section/drizzle/SectionDrizzleSqliteRepo.js +8 -0
- package/dist/infrastructure/repositories/sectionPageLink/drizzle/SectionPageLinkDrizzleRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/sectionPageLink/drizzle/SectionPageLinkDrizzleRepo.js +8 -0
- package/dist/infrastructure/repositories/sectionPageLink/drizzle/SectionPageLinkDrizzleSqliteRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/sectionPageLink/drizzle/SectionPageLinkDrizzleSqliteRepo.js +8 -0
- package/dist/infrastructure/repositories/snippet/drizzle/SnippetDrizzleRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/snippet/drizzle/SnippetDrizzleRepo.js +8 -0
- package/dist/infrastructure/repositories/snippet/drizzle/SnippetDrizzleSqliteRepo.d.ts +12 -0
- package/dist/infrastructure/repositories/snippet/drizzle/SnippetDrizzleSqliteRepo.js +8 -0
- package/dist/public/factories/index.d.ts +2 -0
- package/dist/public/factories/index.js +2 -0
- package/dist/public/index.d.ts +5 -0
- package/dist/public/index.js +5 -0
- package/dist/public/models/index.d.ts +3 -0
- package/dist/public/models/index.js +4 -0
- package/dist/public/ports/index.d.ts +1 -0
- package/dist/public/ports/index.js +2 -0
- package/dist/public/repository-ports/index.d.ts +1 -0
- package/dist/public/repository-ports/index.js +2 -0
- package/dist/public/services/index.d.ts +1 -0
- package/dist/public/services/index.js +2 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.js +1 -0
- package/package.json +84 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { XfLogger } from '@aopslab/xf-logger';
|
|
3
|
+
import type { IRepositoryPortEmbed } from '../ports/repository-ports/index.js';
|
|
4
|
+
import type { IEmbedServicePort } from '../ports/inbound/index.js';
|
|
5
|
+
import { EmbedServiceError } from '../errors/EmbedServiceError.js';
|
|
6
|
+
import { IbmEmbed, IbmEmbedInsert } from '../../domain/models/index.js';
|
|
7
|
+
import { DbQueryOptions } from '@aopslab/xf-db';
|
|
8
|
+
export interface EmbedServiceDependencies {
|
|
9
|
+
}
|
|
10
|
+
export interface EmbedServiceOptions {
|
|
11
|
+
embedRepository: IRepositoryPortEmbed;
|
|
12
|
+
serviceDependencies?: Partial<EmbedServiceDependencies>;
|
|
13
|
+
logger?: XfLogger;
|
|
14
|
+
locale?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class EmbedService implements IEmbedServicePort {
|
|
17
|
+
private readonly embedRepository;
|
|
18
|
+
private readonly logger?;
|
|
19
|
+
constructor(options: EmbedServiceOptions);
|
|
20
|
+
getById(id: string, options?: DbQueryOptions<IbmEmbed>): Effect.Effect<IbmEmbed | null, EmbedServiceError>;
|
|
21
|
+
create(data: IbmEmbedInsert): Effect.Effect<IbmEmbed, EmbedServiceError>;
|
|
22
|
+
listEmbeds(filter?: Partial<IbmEmbed>, options?: DbQueryOptions<IbmEmbed>): Effect.Effect<IbmEmbed[], EmbedServiceError>;
|
|
23
|
+
updateEmbed(id: string, patch: Partial<IbmEmbed>): Effect.Effect<IbmEmbed, EmbedServiceError>;
|
|
24
|
+
removeEmbed(id: string): Effect.Effect<void, EmbedServiceError>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { pipe } from 'effect/Function';
|
|
3
|
+
import { validateInput, XfErrorFactory, effectErrorInfo } from '@aopslab/xf-core';
|
|
4
|
+
import { embedZodSchemaInsert } from '../../domain/models/index.js';
|
|
5
|
+
import { validateBmInputWithSchema } from './service.zod-validation.js';
|
|
6
|
+
import { mapDbError } from '@aopslab/xf-db';
|
|
7
|
+
export class EmbedService {
|
|
8
|
+
embedRepository;
|
|
9
|
+
logger;
|
|
10
|
+
constructor(options) {
|
|
11
|
+
this.embedRepository = options.embedRepository;
|
|
12
|
+
this.logger = options.logger?.child({ module: this.constructor.name });
|
|
13
|
+
}
|
|
14
|
+
getById(id, options) {
|
|
15
|
+
const stage = 'EmbedService::getById';
|
|
16
|
+
return pipe(validateInput(id, 'id', { stage }), Effect.flatMap((id) => this.embedRepository.findById(id, options).pipe(Effect.mapError(mapDbError({ stage, operation: 'findById', factory: XfErrorFactory.notFound })))), Effect.tapError((e) => Effect.sync(() => {
|
|
17
|
+
const info = effectErrorInfo(e);
|
|
18
|
+
this.logger?.error({ error: info.unwrapped, stage }, 'Error in getById');
|
|
19
|
+
})));
|
|
20
|
+
}
|
|
21
|
+
create(data) {
|
|
22
|
+
const stage = 'EmbedService::create';
|
|
23
|
+
return pipe(validateInput(data, 'data', { stage }), Effect.flatMap((data) => validateBmInputWithSchema({
|
|
24
|
+
input: data,
|
|
25
|
+
schema: embedZodSchemaInsert,
|
|
26
|
+
stage,
|
|
27
|
+
operation: 'EmbedService::create.embedZodSchemaInsert',
|
|
28
|
+
field: 'data',
|
|
29
|
+
})), Effect.flatMap((data) => this.embedRepository.create(data).pipe(Effect.mapError(mapDbError({ stage, operation: 'create', factory: XfErrorFactory.createFailed })))));
|
|
30
|
+
}
|
|
31
|
+
listEmbeds(filter = {}, options) {
|
|
32
|
+
const stage = 'EmbedService::listEmbeds';
|
|
33
|
+
return pipe(validateInput(filter, 'filter', { stage }), Effect.flatMap((filter) => this.embedRepository.find({ matchEq: filter, options }).pipe(Effect.mapError(mapDbError({ stage, operation: 'find', factory: XfErrorFactory.notFound })))), Effect.tapError((e) => Effect.sync(() => {
|
|
34
|
+
const info = effectErrorInfo(e);
|
|
35
|
+
this.logger?.error({ error: info.unwrapped, stage }, 'Error in listEmbeds');
|
|
36
|
+
})));
|
|
37
|
+
}
|
|
38
|
+
updateEmbed(id, patch) {
|
|
39
|
+
const stage = 'EmbedService::updateEmbed';
|
|
40
|
+
if (!patch || Object.keys(patch).length === 0) {
|
|
41
|
+
return Effect.fail(XfErrorFactory.inputRequired({ field: 'patch', stage }));
|
|
42
|
+
}
|
|
43
|
+
return pipe(validateInput(id, 'id', { stage }), Effect.flatMap((entityId) => validateBmInputWithSchema({
|
|
44
|
+
input: patch,
|
|
45
|
+
schema: embedZodSchemaInsert.partial().strict(),
|
|
46
|
+
stage,
|
|
47
|
+
operation: 'EmbedService::updateEmbed.embedZodSchemaInsert.patch',
|
|
48
|
+
field: 'patch',
|
|
49
|
+
}).pipe(Effect.map(() => entityId))), Effect.flatMap((entityId) => this.embedRepository.patchById(entityId, patch).pipe(Effect.mapError(mapDbError({ stage, operation: 'patchById', factory: XfErrorFactory.upsertFailed })))), Effect.tapError((e) => Effect.sync(() => {
|
|
50
|
+
const info = effectErrorInfo(e);
|
|
51
|
+
this.logger?.error({ error: info.unwrapped, stage }, 'Error in updateEmbed');
|
|
52
|
+
})));
|
|
53
|
+
}
|
|
54
|
+
removeEmbed(id) {
|
|
55
|
+
const stage = 'EmbedService::removeEmbed';
|
|
56
|
+
return pipe(validateInput(id, 'id', { stage }), Effect.flatMap((entityId) => this.embedRepository.deleteById(entityId).pipe(Effect.mapError(mapDbError({ stage, operation: 'deleteById', factory: XfErrorFactory.upsertFailed })))), Effect.map(() => undefined));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { XfLogger } from '@aopslab/xf-logger';
|
|
3
|
+
import type { IRepositoryPortPage } from '../ports/repository-ports/index.js';
|
|
4
|
+
import type { IPageServicePort } from '../ports/inbound/index.js';
|
|
5
|
+
import { PageServiceError } from '../errors/PageServiceError.js';
|
|
6
|
+
import { IbmPage, IbmPageInsert } from '../../domain/models/index.js';
|
|
7
|
+
import { DbQueryOptions } from '@aopslab/xf-db';
|
|
8
|
+
export interface PageServiceDependencies {
|
|
9
|
+
}
|
|
10
|
+
export interface PageServiceOptions {
|
|
11
|
+
pageRepository: IRepositoryPortPage;
|
|
12
|
+
serviceDependencies?: Partial<PageServiceDependencies>;
|
|
13
|
+
logger?: XfLogger;
|
|
14
|
+
locale?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class PageService implements IPageServicePort {
|
|
17
|
+
private readonly pageRepository;
|
|
18
|
+
private readonly logger?;
|
|
19
|
+
constructor(options: PageServiceOptions);
|
|
20
|
+
getById(id: string, options?: DbQueryOptions<IbmPage>): Effect.Effect<IbmPage | null, PageServiceError>;
|
|
21
|
+
create(data: IbmPageInsert): Effect.Effect<IbmPage, PageServiceError>;
|
|
22
|
+
listPages(filter?: Partial<IbmPage>, options?: DbQueryOptions<IbmPage>): Effect.Effect<IbmPage[], PageServiceError>;
|
|
23
|
+
updatePage(id: string, patch: Partial<IbmPage>): Effect.Effect<IbmPage, PageServiceError>;
|
|
24
|
+
removePage(id: string): Effect.Effect<void, PageServiceError>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { pipe } from 'effect/Function';
|
|
3
|
+
import { validateInput, XfErrorFactory, effectErrorInfo } from '@aopslab/xf-core';
|
|
4
|
+
import { pageZodSchemaInsert } from '../../domain/models/index.js';
|
|
5
|
+
import { validateBmInputWithSchema } from './service.zod-validation.js';
|
|
6
|
+
import { mapDbError } from '@aopslab/xf-db';
|
|
7
|
+
export class PageService {
|
|
8
|
+
pageRepository;
|
|
9
|
+
logger;
|
|
10
|
+
constructor(options) {
|
|
11
|
+
this.pageRepository = options.pageRepository;
|
|
12
|
+
this.logger = options.logger?.child({ module: this.constructor.name });
|
|
13
|
+
}
|
|
14
|
+
getById(id, options) {
|
|
15
|
+
const stage = 'PageService::getById';
|
|
16
|
+
return pipe(validateInput(id, 'id', { stage }), Effect.flatMap((id) => this.pageRepository.findById(id, options).pipe(Effect.mapError(mapDbError({ stage, operation: 'findById', factory: XfErrorFactory.notFound })))), Effect.tapError((e) => Effect.sync(() => {
|
|
17
|
+
const info = effectErrorInfo(e);
|
|
18
|
+
this.logger?.error({ error: info.unwrapped, stage }, 'Error in getById');
|
|
19
|
+
})));
|
|
20
|
+
}
|
|
21
|
+
create(data) {
|
|
22
|
+
const stage = 'PageService::create';
|
|
23
|
+
return pipe(validateInput(data, 'data', { stage }), Effect.flatMap((data) => validateBmInputWithSchema({
|
|
24
|
+
input: data,
|
|
25
|
+
schema: pageZodSchemaInsert,
|
|
26
|
+
stage,
|
|
27
|
+
operation: 'PageService::create.pageZodSchemaInsert',
|
|
28
|
+
field: 'data',
|
|
29
|
+
})), Effect.flatMap((data) => this.pageRepository.create(data).pipe(Effect.mapError(mapDbError({ stage, operation: 'create', factory: XfErrorFactory.createFailed })))));
|
|
30
|
+
}
|
|
31
|
+
listPages(filter = {}, options) {
|
|
32
|
+
const stage = 'PageService::listPages';
|
|
33
|
+
return pipe(validateInput(filter, 'filter', { stage }), Effect.flatMap((filter) => this.pageRepository.find({ matchEq: filter, options }).pipe(Effect.mapError(mapDbError({ stage, operation: 'find', factory: XfErrorFactory.notFound })))), Effect.tapError((e) => Effect.sync(() => {
|
|
34
|
+
const info = effectErrorInfo(e);
|
|
35
|
+
this.logger?.error({ error: info.unwrapped, stage }, 'Error in listPages');
|
|
36
|
+
})));
|
|
37
|
+
}
|
|
38
|
+
updatePage(id, patch) {
|
|
39
|
+
const stage = 'PageService::updatePage';
|
|
40
|
+
if (!patch || Object.keys(patch).length === 0) {
|
|
41
|
+
return Effect.fail(XfErrorFactory.inputRequired({ field: 'patch', stage }));
|
|
42
|
+
}
|
|
43
|
+
return pipe(validateInput(id, 'id', { stage }), Effect.flatMap((entityId) => validateBmInputWithSchema({
|
|
44
|
+
input: patch,
|
|
45
|
+
schema: pageZodSchemaInsert.partial().strict(),
|
|
46
|
+
stage,
|
|
47
|
+
operation: 'PageService::updatePage.pageZodSchemaInsert.patch',
|
|
48
|
+
field: 'patch',
|
|
49
|
+
}).pipe(Effect.map(() => entityId))), Effect.flatMap((entityId) => this.pageRepository.patchById(entityId, patch).pipe(Effect.mapError(mapDbError({ stage, operation: 'patchById', factory: XfErrorFactory.upsertFailed })))), Effect.tapError((e) => Effect.sync(() => {
|
|
50
|
+
const info = effectErrorInfo(e);
|
|
51
|
+
this.logger?.error({ error: info.unwrapped, stage }, 'Error in updatePage');
|
|
52
|
+
})));
|
|
53
|
+
}
|
|
54
|
+
removePage(id) {
|
|
55
|
+
const stage = 'PageService::removePage';
|
|
56
|
+
return pipe(validateInput(id, 'id', { stage }), Effect.flatMap((entityId) => this.pageRepository.deleteById(entityId).pipe(Effect.mapError(mapDbError({ stage, operation: 'deleteById', factory: XfErrorFactory.upsertFailed })))), Effect.map(() => undefined));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { XfLogger } from '@aopslab/xf-logger';
|
|
3
|
+
import type { IRepositoryPortPageEmbedLink } from '../ports/repository-ports/index.js';
|
|
4
|
+
import type { IPageEmbedLinkServicePort } from '../ports/inbound/index.js';
|
|
5
|
+
import { PageEmbedLinkServiceError } from '../errors/PageEmbedLinkServiceError.js';
|
|
6
|
+
import { IbmPageEmbedLink, IbmPageEmbedLinkInsert } from '../../domain/models/index.js';
|
|
7
|
+
import { DbQueryOptions } from '@aopslab/xf-db';
|
|
8
|
+
export interface PageEmbedLinkServiceDependencies {
|
|
9
|
+
}
|
|
10
|
+
export interface PageEmbedLinkServiceOptions {
|
|
11
|
+
pageEmbedLinkRepository: IRepositoryPortPageEmbedLink;
|
|
12
|
+
serviceDependencies?: Partial<PageEmbedLinkServiceDependencies>;
|
|
13
|
+
logger?: XfLogger;
|
|
14
|
+
locale?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class PageEmbedLinkService implements IPageEmbedLinkServicePort {
|
|
17
|
+
private readonly pageEmbedLinkRepository;
|
|
18
|
+
private readonly logger?;
|
|
19
|
+
constructor(options: PageEmbedLinkServiceOptions);
|
|
20
|
+
getById(id: string, options?: DbQueryOptions<IbmPageEmbedLink>): Effect.Effect<IbmPageEmbedLink | null, PageEmbedLinkServiceError>;
|
|
21
|
+
create(data: IbmPageEmbedLinkInsert): Effect.Effect<IbmPageEmbedLink, PageEmbedLinkServiceError>;
|
|
22
|
+
listPageEmbedLinks(filter?: Partial<IbmPageEmbedLink>, options?: DbQueryOptions<IbmPageEmbedLink>): Effect.Effect<IbmPageEmbedLink[], PageEmbedLinkServiceError>;
|
|
23
|
+
updatePageEmbedLink(id: string, patch: Partial<IbmPageEmbedLink>): Effect.Effect<IbmPageEmbedLink, PageEmbedLinkServiceError>;
|
|
24
|
+
removePageEmbedLink(id: string): Effect.Effect<void, PageEmbedLinkServiceError>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { pipe } from 'effect/Function';
|
|
3
|
+
import { validateInput, XfErrorFactory, effectErrorInfo } from '@aopslab/xf-core';
|
|
4
|
+
import { pageEmbedLinkZodSchemaInsert } from '../../domain/models/index.js';
|
|
5
|
+
import { validateBmInputWithSchema } from './service.zod-validation.js';
|
|
6
|
+
import { mapDbError } from '@aopslab/xf-db';
|
|
7
|
+
export class PageEmbedLinkService {
|
|
8
|
+
pageEmbedLinkRepository;
|
|
9
|
+
logger;
|
|
10
|
+
constructor(options) {
|
|
11
|
+
this.pageEmbedLinkRepository = options.pageEmbedLinkRepository;
|
|
12
|
+
this.logger = options.logger?.child({ module: this.constructor.name });
|
|
13
|
+
}
|
|
14
|
+
getById(id, options) {
|
|
15
|
+
const stage = 'PageEmbedLinkService::getById';
|
|
16
|
+
return pipe(validateInput(id, 'id', { stage }), Effect.flatMap((id) => this.pageEmbedLinkRepository.findById(id, options).pipe(Effect.mapError(mapDbError({ stage, operation: 'findById', factory: XfErrorFactory.notFound })))), Effect.tapError((e) => Effect.sync(() => {
|
|
17
|
+
const info = effectErrorInfo(e);
|
|
18
|
+
this.logger?.error({ error: info.unwrapped, stage }, 'Error in getById');
|
|
19
|
+
})));
|
|
20
|
+
}
|
|
21
|
+
create(data) {
|
|
22
|
+
const stage = 'PageEmbedLinkService::create';
|
|
23
|
+
return pipe(validateInput(data, 'data', { stage }), Effect.flatMap((data) => validateBmInputWithSchema({
|
|
24
|
+
input: data,
|
|
25
|
+
schema: pageEmbedLinkZodSchemaInsert,
|
|
26
|
+
stage,
|
|
27
|
+
operation: 'PageEmbedLinkService::create.pageEmbedLinkZodSchemaInsert',
|
|
28
|
+
field: 'data',
|
|
29
|
+
})), Effect.flatMap((data) => this.pageEmbedLinkRepository.create(data).pipe(Effect.mapError(mapDbError({ stage, operation: 'create', factory: XfErrorFactory.createFailed })))));
|
|
30
|
+
}
|
|
31
|
+
listPageEmbedLinks(filter = {}, options) {
|
|
32
|
+
const stage = 'PageEmbedLinkService::listPageEmbedLinks';
|
|
33
|
+
return pipe(validateInput(filter, 'filter', { stage }), Effect.flatMap((filter) => this.pageEmbedLinkRepository.find({ matchEq: filter, options }).pipe(Effect.mapError(mapDbError({ stage, operation: 'find', factory: XfErrorFactory.notFound })))), Effect.tapError((e) => Effect.sync(() => {
|
|
34
|
+
const info = effectErrorInfo(e);
|
|
35
|
+
this.logger?.error({ error: info.unwrapped, stage }, 'Error in listPageEmbedLinks');
|
|
36
|
+
})));
|
|
37
|
+
}
|
|
38
|
+
updatePageEmbedLink(id, patch) {
|
|
39
|
+
const stage = 'PageEmbedLinkService::updatePageEmbedLink';
|
|
40
|
+
if (!patch || Object.keys(patch).length === 0) {
|
|
41
|
+
return Effect.fail(XfErrorFactory.inputRequired({ field: 'patch', stage }));
|
|
42
|
+
}
|
|
43
|
+
return pipe(validateInput(id, 'id', { stage }), Effect.flatMap((entityId) => validateBmInputWithSchema({
|
|
44
|
+
input: patch,
|
|
45
|
+
schema: pageEmbedLinkZodSchemaInsert.partial().strict(),
|
|
46
|
+
stage,
|
|
47
|
+
operation: 'PageEmbedLinkService::updatePageEmbedLink.pageEmbedLinkZodSchemaInsert.patch',
|
|
48
|
+
field: 'patch',
|
|
49
|
+
}).pipe(Effect.map(() => entityId))), Effect.flatMap((entityId) => this.pageEmbedLinkRepository.patchById(entityId, patch).pipe(Effect.mapError(mapDbError({ stage, operation: 'patchById', factory: XfErrorFactory.upsertFailed })))), Effect.tapError((e) => Effect.sync(() => {
|
|
50
|
+
const info = effectErrorInfo(e);
|
|
51
|
+
this.logger?.error({ error: info.unwrapped, stage }, 'Error in updatePageEmbedLink');
|
|
52
|
+
})));
|
|
53
|
+
}
|
|
54
|
+
removePageEmbedLink(id) {
|
|
55
|
+
const stage = 'PageEmbedLinkService::removePageEmbedLink';
|
|
56
|
+
return pipe(validateInput(id, 'id', { stage }), Effect.flatMap((entityId) => this.pageEmbedLinkRepository.deleteById(entityId).pipe(Effect.mapError(mapDbError({ stage, operation: 'deleteById', factory: XfErrorFactory.upsertFailed })))), Effect.map(() => undefined));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { XfLogger } from '@aopslab/xf-logger';
|
|
3
|
+
import type { IRepositoryPortPageSnippetLink } from '../ports/repository-ports/index.js';
|
|
4
|
+
import type { IPageSnippetLinkServicePort } from '../ports/inbound/index.js';
|
|
5
|
+
import { PageSnippetLinkServiceError } from '../errors/PageSnippetLinkServiceError.js';
|
|
6
|
+
import { IbmPageSnippetLink, IbmPageSnippetLinkInsert } from '../../domain/models/index.js';
|
|
7
|
+
import { DbQueryOptions } from '@aopslab/xf-db';
|
|
8
|
+
export interface PageSnippetLinkServiceDependencies {
|
|
9
|
+
}
|
|
10
|
+
export interface PageSnippetLinkServiceOptions {
|
|
11
|
+
pageSnippetLinkRepository: IRepositoryPortPageSnippetLink;
|
|
12
|
+
serviceDependencies?: Partial<PageSnippetLinkServiceDependencies>;
|
|
13
|
+
logger?: XfLogger;
|
|
14
|
+
locale?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class PageSnippetLinkService implements IPageSnippetLinkServicePort {
|
|
17
|
+
private readonly pageSnippetLinkRepository;
|
|
18
|
+
private readonly logger?;
|
|
19
|
+
constructor(options: PageSnippetLinkServiceOptions);
|
|
20
|
+
getById(id: string, options?: DbQueryOptions<IbmPageSnippetLink>): Effect.Effect<IbmPageSnippetLink | null, PageSnippetLinkServiceError>;
|
|
21
|
+
create(data: IbmPageSnippetLinkInsert): Effect.Effect<IbmPageSnippetLink, PageSnippetLinkServiceError>;
|
|
22
|
+
listPageSnippetLinks(filter?: Partial<IbmPageSnippetLink>, options?: DbQueryOptions<IbmPageSnippetLink>): Effect.Effect<IbmPageSnippetLink[], PageSnippetLinkServiceError>;
|
|
23
|
+
updatePageSnippetLink(id: string, patch: Partial<IbmPageSnippetLink>): Effect.Effect<IbmPageSnippetLink, PageSnippetLinkServiceError>;
|
|
24
|
+
removePageSnippetLink(id: string): Effect.Effect<void, PageSnippetLinkServiceError>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { pipe } from 'effect/Function';
|
|
3
|
+
import { validateInput, XfErrorFactory, effectErrorInfo } from '@aopslab/xf-core';
|
|
4
|
+
import { pageSnippetLinkZodSchemaInsert } from '../../domain/models/index.js';
|
|
5
|
+
import { validateBmInputWithSchema } from './service.zod-validation.js';
|
|
6
|
+
import { mapDbError } from '@aopslab/xf-db';
|
|
7
|
+
export class PageSnippetLinkService {
|
|
8
|
+
pageSnippetLinkRepository;
|
|
9
|
+
logger;
|
|
10
|
+
constructor(options) {
|
|
11
|
+
this.pageSnippetLinkRepository = options.pageSnippetLinkRepository;
|
|
12
|
+
this.logger = options.logger?.child({ module: this.constructor.name });
|
|
13
|
+
}
|
|
14
|
+
getById(id, options) {
|
|
15
|
+
const stage = 'PageSnippetLinkService::getById';
|
|
16
|
+
return pipe(validateInput(id, 'id', { stage }), Effect.flatMap((id) => this.pageSnippetLinkRepository.findById(id, options).pipe(Effect.mapError(mapDbError({ stage, operation: 'findById', factory: XfErrorFactory.notFound })))), Effect.tapError((e) => Effect.sync(() => {
|
|
17
|
+
const info = effectErrorInfo(e);
|
|
18
|
+
this.logger?.error({ error: info.unwrapped, stage }, 'Error in getById');
|
|
19
|
+
})));
|
|
20
|
+
}
|
|
21
|
+
create(data) {
|
|
22
|
+
const stage = 'PageSnippetLinkService::create';
|
|
23
|
+
return pipe(validateInput(data, 'data', { stage }), Effect.flatMap((data) => validateBmInputWithSchema({
|
|
24
|
+
input: data,
|
|
25
|
+
schema: pageSnippetLinkZodSchemaInsert,
|
|
26
|
+
stage,
|
|
27
|
+
operation: 'PageSnippetLinkService::create.pageSnippetLinkZodSchemaInsert',
|
|
28
|
+
field: 'data',
|
|
29
|
+
})), Effect.flatMap((data) => this.pageSnippetLinkRepository.create(data).pipe(Effect.mapError(mapDbError({ stage, operation: 'create', factory: XfErrorFactory.createFailed })))));
|
|
30
|
+
}
|
|
31
|
+
listPageSnippetLinks(filter = {}, options) {
|
|
32
|
+
const stage = 'PageSnippetLinkService::listPageSnippetLinks';
|
|
33
|
+
return pipe(validateInput(filter, 'filter', { stage }), Effect.flatMap((filter) => this.pageSnippetLinkRepository.find({ matchEq: filter, options }).pipe(Effect.mapError(mapDbError({ stage, operation: 'find', factory: XfErrorFactory.notFound })))), Effect.tapError((e) => Effect.sync(() => {
|
|
34
|
+
const info = effectErrorInfo(e);
|
|
35
|
+
this.logger?.error({ error: info.unwrapped, stage }, 'Error in listPageSnippetLinks');
|
|
36
|
+
})));
|
|
37
|
+
}
|
|
38
|
+
updatePageSnippetLink(id, patch) {
|
|
39
|
+
const stage = 'PageSnippetLinkService::updatePageSnippetLink';
|
|
40
|
+
if (!patch || Object.keys(patch).length === 0) {
|
|
41
|
+
return Effect.fail(XfErrorFactory.inputRequired({ field: 'patch', stage }));
|
|
42
|
+
}
|
|
43
|
+
return pipe(validateInput(id, 'id', { stage }), Effect.flatMap((entityId) => validateBmInputWithSchema({
|
|
44
|
+
input: patch,
|
|
45
|
+
schema: pageSnippetLinkZodSchemaInsert.partial().strict(),
|
|
46
|
+
stage,
|
|
47
|
+
operation: 'PageSnippetLinkService::updatePageSnippetLink.pageSnippetLinkZodSchemaInsert.patch',
|
|
48
|
+
field: 'patch',
|
|
49
|
+
}).pipe(Effect.map(() => entityId))), Effect.flatMap((entityId) => this.pageSnippetLinkRepository.patchById(entityId, patch).pipe(Effect.mapError(mapDbError({ stage, operation: 'patchById', factory: XfErrorFactory.upsertFailed })))), Effect.tapError((e) => Effect.sync(() => {
|
|
50
|
+
const info = effectErrorInfo(e);
|
|
51
|
+
this.logger?.error({ error: info.unwrapped, stage }, 'Error in updatePageSnippetLink');
|
|
52
|
+
})));
|
|
53
|
+
}
|
|
54
|
+
removePageSnippetLink(id) {
|
|
55
|
+
const stage = 'PageSnippetLinkService::removePageSnippetLink';
|
|
56
|
+
return pipe(validateInput(id, 'id', { stage }), Effect.flatMap((entityId) => this.pageSnippetLinkRepository.deleteById(entityId).pipe(Effect.mapError(mapDbError({ stage, operation: 'deleteById', factory: XfErrorFactory.upsertFailed })))), Effect.map(() => undefined));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { XfLogger } from '@aopslab/xf-logger';
|
|
3
|
+
import type { IRepositoryPortDocumentSectionLink, IRepositoryPortPageVersion, IRepositoryPortSectionPageLink } from '../ports/repository-ports/index.js';
|
|
4
|
+
import type { IPageVersionServicePort } from '../ports/inbound/index.js';
|
|
5
|
+
import { PageVersionServiceError } from '../errors/PageVersionServiceError.js';
|
|
6
|
+
import { IbmPageVersion, IbmPageVersionInsert } from '../../domain/models/index.js';
|
|
7
|
+
import { DbQueryOptions } from '@aopslab/xf-db';
|
|
8
|
+
export interface PageVersionServiceDependencies {
|
|
9
|
+
documentSectionLinkRepository?: IRepositoryPortDocumentSectionLink;
|
|
10
|
+
sectionPageLinkRepository?: IRepositoryPortSectionPageLink;
|
|
11
|
+
}
|
|
12
|
+
export interface PageVersionServiceOptions {
|
|
13
|
+
pageVersionRepository: IRepositoryPortPageVersion;
|
|
14
|
+
serviceDependencies?: Partial<PageVersionServiceDependencies>;
|
|
15
|
+
logger?: XfLogger;
|
|
16
|
+
locale?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare class PageVersionService implements IPageVersionServicePort {
|
|
19
|
+
private readonly pageVersionRepository;
|
|
20
|
+
private readonly documentSectionLinkRepository?;
|
|
21
|
+
private readonly sectionPageLinkRepository?;
|
|
22
|
+
private readonly logger?;
|
|
23
|
+
constructor(options: PageVersionServiceOptions);
|
|
24
|
+
getById(id: string, options?: DbQueryOptions<IbmPageVersion>): Effect.Effect<IbmPageVersion | null, PageVersionServiceError>;
|
|
25
|
+
create(data: IbmPageVersionInsert): Effect.Effect<IbmPageVersion, PageVersionServiceError>;
|
|
26
|
+
listPageVersions(filter?: Partial<IbmPageVersion>, options?: DbQueryOptions<IbmPageVersion>): Effect.Effect<IbmPageVersion[], PageVersionServiceError>;
|
|
27
|
+
updatePageVersion(id: string, patch: Partial<IbmPageVersion>): Effect.Effect<IbmPageVersion, PageVersionServiceError>;
|
|
28
|
+
removePageVersion(id: string): Effect.Effect<void, PageVersionServiceError>;
|
|
29
|
+
private ensurePageVersionIsUnlinked;
|
|
30
|
+
private requireDependency;
|
|
31
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { pipe } from 'effect/Function';
|
|
3
|
+
import { validateInput, XfErrorFactory, effectErrorInfo } from '@aopslab/xf-core';
|
|
4
|
+
import { pageVersionZodSchemaInsert } from '../../domain/models/index.js';
|
|
5
|
+
import { validateBmInputWithSchema } from './service.zod-validation.js';
|
|
6
|
+
import { mapDbError } from '@aopslab/xf-db';
|
|
7
|
+
export class PageVersionService {
|
|
8
|
+
pageVersionRepository;
|
|
9
|
+
documentSectionLinkRepository;
|
|
10
|
+
sectionPageLinkRepository;
|
|
11
|
+
logger;
|
|
12
|
+
constructor(options) {
|
|
13
|
+
const deps = options.serviceDependencies ?? {};
|
|
14
|
+
this.pageVersionRepository = options.pageVersionRepository;
|
|
15
|
+
this.documentSectionLinkRepository = deps.documentSectionLinkRepository;
|
|
16
|
+
this.sectionPageLinkRepository = deps.sectionPageLinkRepository;
|
|
17
|
+
this.logger = options.logger?.child({ module: this.constructor.name });
|
|
18
|
+
}
|
|
19
|
+
getById(id, options) {
|
|
20
|
+
const stage = 'PageVersionService::getById';
|
|
21
|
+
return pipe(validateInput(id, 'id', { stage }), Effect.flatMap((id) => this.pageVersionRepository.findById(id, options).pipe(Effect.mapError(mapDbError({ stage, operation: 'findById', factory: XfErrorFactory.notFound })))), Effect.tapError((e) => Effect.sync(() => {
|
|
22
|
+
const info = effectErrorInfo(e);
|
|
23
|
+
this.logger?.error({ error: info.unwrapped, stage }, 'Error in getById');
|
|
24
|
+
})));
|
|
25
|
+
}
|
|
26
|
+
create(data) {
|
|
27
|
+
const stage = 'PageVersionService::create';
|
|
28
|
+
return pipe(validateInput(data, 'data', { stage }), Effect.flatMap((data) => validateBmInputWithSchema({
|
|
29
|
+
input: data,
|
|
30
|
+
schema: pageVersionZodSchemaInsert,
|
|
31
|
+
stage,
|
|
32
|
+
operation: 'PageVersionService::create.pageVersionZodSchemaInsert',
|
|
33
|
+
field: 'data',
|
|
34
|
+
})), Effect.flatMap((data) => this.pageVersionRepository.create(data).pipe(Effect.mapError(mapDbError({ stage, operation: 'create', factory: XfErrorFactory.createFailed })))));
|
|
35
|
+
}
|
|
36
|
+
listPageVersions(filter = {}, options) {
|
|
37
|
+
const stage = 'PageVersionService::listPageVersions';
|
|
38
|
+
return pipe(validateInput(filter, 'filter', { stage }), Effect.flatMap((filter) => this.pageVersionRepository.find({ matchEq: filter, options }).pipe(Effect.mapError(mapDbError({ stage, operation: 'find', factory: XfErrorFactory.notFound })))), Effect.tapError((e) => Effect.sync(() => {
|
|
39
|
+
const info = effectErrorInfo(e);
|
|
40
|
+
this.logger?.error({ error: info.unwrapped, stage }, 'Error in listPageVersions');
|
|
41
|
+
})));
|
|
42
|
+
}
|
|
43
|
+
updatePageVersion(id, patch) {
|
|
44
|
+
const stage = 'PageVersionService::updatePageVersion';
|
|
45
|
+
if (!patch || Object.keys(patch).length === 0) {
|
|
46
|
+
return Effect.fail(XfErrorFactory.inputRequired({ field: 'patch', stage }));
|
|
47
|
+
}
|
|
48
|
+
return pipe(validateInput(id, 'id', { stage }), Effect.flatMap((entityId) => validateBmInputWithSchema({
|
|
49
|
+
input: patch,
|
|
50
|
+
schema: pageVersionZodSchemaInsert.partial().strict(),
|
|
51
|
+
stage,
|
|
52
|
+
operation: 'PageVersionService::updatePageVersion.pageVersionZodSchemaInsert.patch',
|
|
53
|
+
field: 'patch',
|
|
54
|
+
}).pipe(Effect.map(() => entityId))), Effect.flatMap((entityId) => this.pageVersionRepository.patchById(entityId, patch).pipe(Effect.mapError(mapDbError({ stage, operation: 'patchById', factory: XfErrorFactory.upsertFailed })))), Effect.tapError((e) => Effect.sync(() => {
|
|
55
|
+
const info = effectErrorInfo(e);
|
|
56
|
+
this.logger?.error({ error: info.unwrapped, stage }, 'Error in updatePageVersion');
|
|
57
|
+
})));
|
|
58
|
+
}
|
|
59
|
+
removePageVersion(id) {
|
|
60
|
+
const stage = 'PageVersionService::removePageVersion';
|
|
61
|
+
return Effect.gen(this, function* (_) {
|
|
62
|
+
const entityId = yield* _(validateInput(id, 'id', { stage }));
|
|
63
|
+
yield* _(this.ensurePageVersionIsUnlinked(entityId, stage, 'removePageVersion'));
|
|
64
|
+
yield* _(this.pageVersionRepository.deleteById(entityId).pipe(Effect.mapError(mapDbError({ stage, operation: 'deleteById', factory: XfErrorFactory.upsertFailed }))));
|
|
65
|
+
return undefined;
|
|
66
|
+
}).pipe(Effect.tapError((e) => Effect.sync(() => {
|
|
67
|
+
const info = effectErrorInfo(e);
|
|
68
|
+
this.logger?.error({ error: info.unwrapped, stage }, 'Error in removePageVersion');
|
|
69
|
+
})));
|
|
70
|
+
}
|
|
71
|
+
ensurePageVersionIsUnlinked(pageVersionId, stage, operation) {
|
|
72
|
+
return Effect.gen(this, function* (_) {
|
|
73
|
+
const documentSectionLinkRepository = yield* _(this.requireDependency(this.documentSectionLinkRepository, 'documentSectionLinkRepository', stage, operation));
|
|
74
|
+
const sectionPageLinkRepository = yield* _(this.requireDependency(this.sectionPageLinkRepository, 'sectionPageLinkRepository', stage, operation));
|
|
75
|
+
const [documentLinks, sectionLinks] = yield* _(Effect.all([
|
|
76
|
+
documentSectionLinkRepository.find({ matchEq: { pageVersionId } }).pipe(Effect.mapError(mapDbError({
|
|
77
|
+
stage,
|
|
78
|
+
operation: 'documentSectionLinkRepository.find(pageVersionId)',
|
|
79
|
+
factory: XfErrorFactory.upsertFailed,
|
|
80
|
+
}))),
|
|
81
|
+
sectionPageLinkRepository.find({ matchEq: { pageVersionId } }).pipe(Effect.mapError(mapDbError({
|
|
82
|
+
stage,
|
|
83
|
+
operation: 'sectionPageLinkRepository.find(pageVersionId)',
|
|
84
|
+
factory: XfErrorFactory.upsertFailed,
|
|
85
|
+
}))),
|
|
86
|
+
]));
|
|
87
|
+
const documentLinkCount = Array.isArray(documentLinks) ? documentLinks.length : 0;
|
|
88
|
+
const sectionLinkCount = Array.isArray(sectionLinks) ? sectionLinks.length : 0;
|
|
89
|
+
if (documentLinkCount === 0 && sectionLinkCount === 0) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
return yield* _(Effect.fail(XfErrorFactory.upsertFailed({
|
|
93
|
+
stage,
|
|
94
|
+
operation: 'checkPageVersionUsage',
|
|
95
|
+
message: 'Page version is still linked in document or section outlines.',
|
|
96
|
+
data: {
|
|
97
|
+
pageVersionId,
|
|
98
|
+
documentLinkCount,
|
|
99
|
+
sectionLinkCount,
|
|
100
|
+
},
|
|
101
|
+
})));
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
requireDependency(dependency, name, stage, operation) {
|
|
105
|
+
if (dependency)
|
|
106
|
+
return Effect.succeed(dependency);
|
|
107
|
+
return Effect.fail(XfErrorFactory.configurationError({
|
|
108
|
+
stage,
|
|
109
|
+
operation,
|
|
110
|
+
message: `Missing dependency: ${name}`,
|
|
111
|
+
debug: { dependency: name },
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { XfLogger } from '@aopslab/xf-logger';
|
|
3
|
+
import type { IRepositoryPortSection } from '../ports/repository-ports/index.js';
|
|
4
|
+
import type { ISectionServicePort } from '../ports/inbound/index.js';
|
|
5
|
+
import { SectionServiceError } from '../errors/SectionServiceError.js';
|
|
6
|
+
import { IbmSection, IbmSectionInsert } from '../../domain/models/index.js';
|
|
7
|
+
import { DbQueryOptions } from '@aopslab/xf-db';
|
|
8
|
+
export interface SectionServiceDependencies {
|
|
9
|
+
}
|
|
10
|
+
export interface SectionServiceOptions {
|
|
11
|
+
sectionRepository: IRepositoryPortSection;
|
|
12
|
+
serviceDependencies?: Partial<SectionServiceDependencies>;
|
|
13
|
+
logger?: XfLogger;
|
|
14
|
+
locale?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class SectionService implements ISectionServicePort {
|
|
17
|
+
private readonly sectionRepository;
|
|
18
|
+
private readonly logger?;
|
|
19
|
+
constructor(options: SectionServiceOptions);
|
|
20
|
+
getById(id: string, options?: DbQueryOptions<IbmSection>): Effect.Effect<IbmSection | null, SectionServiceError>;
|
|
21
|
+
create(data: IbmSectionInsert): Effect.Effect<IbmSection, SectionServiceError>;
|
|
22
|
+
listSections(filter?: Partial<IbmSection>, options?: DbQueryOptions<IbmSection>): Effect.Effect<IbmSection[], SectionServiceError>;
|
|
23
|
+
updateSection(id: string, patch: Partial<IbmSection>): Effect.Effect<IbmSection, SectionServiceError>;
|
|
24
|
+
removeSection(id: string): Effect.Effect<void, SectionServiceError>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { pipe } from 'effect/Function';
|
|
3
|
+
import { validateInput, XfErrorFactory, effectErrorInfo } from '@aopslab/xf-core';
|
|
4
|
+
import { sectionZodSchemaInsert } from '../../domain/models/index.js';
|
|
5
|
+
import { validateBmInputWithSchema } from './service.zod-validation.js';
|
|
6
|
+
import { mapDbError } from '@aopslab/xf-db';
|
|
7
|
+
export class SectionService {
|
|
8
|
+
sectionRepository;
|
|
9
|
+
logger;
|
|
10
|
+
constructor(options) {
|
|
11
|
+
this.sectionRepository = options.sectionRepository;
|
|
12
|
+
this.logger = options.logger?.child({ module: this.constructor.name });
|
|
13
|
+
}
|
|
14
|
+
getById(id, options) {
|
|
15
|
+
const stage = 'SectionService::getById';
|
|
16
|
+
return pipe(validateInput(id, 'id', { stage }), Effect.flatMap((id) => this.sectionRepository.findById(id, options).pipe(Effect.mapError(mapDbError({ stage, operation: 'findById', factory: XfErrorFactory.notFound })))), Effect.tapError((e) => Effect.sync(() => {
|
|
17
|
+
const info = effectErrorInfo(e);
|
|
18
|
+
this.logger?.error({ error: info.unwrapped, stage }, 'Error in getById');
|
|
19
|
+
})));
|
|
20
|
+
}
|
|
21
|
+
create(data) {
|
|
22
|
+
const stage = 'SectionService::create';
|
|
23
|
+
return pipe(validateInput(data, 'data', { stage }), Effect.flatMap((data) => validateBmInputWithSchema({
|
|
24
|
+
input: data,
|
|
25
|
+
schema: sectionZodSchemaInsert,
|
|
26
|
+
stage,
|
|
27
|
+
operation: 'SectionService::create.sectionZodSchemaInsert',
|
|
28
|
+
field: 'data',
|
|
29
|
+
})), Effect.flatMap((data) => this.sectionRepository.create(data).pipe(Effect.mapError(mapDbError({ stage, operation: 'create', factory: XfErrorFactory.createFailed })))));
|
|
30
|
+
}
|
|
31
|
+
listSections(filter = {}, options) {
|
|
32
|
+
const stage = 'SectionService::listSections';
|
|
33
|
+
return pipe(validateInput(filter, 'filter', { stage }), Effect.flatMap((filter) => this.sectionRepository.find({ matchEq: filter, options }).pipe(Effect.mapError(mapDbError({ stage, operation: 'find', factory: XfErrorFactory.notFound })))), Effect.tapError((e) => Effect.sync(() => {
|
|
34
|
+
const info = effectErrorInfo(e);
|
|
35
|
+
this.logger?.error({ error: info.unwrapped, stage }, 'Error in listSections');
|
|
36
|
+
})));
|
|
37
|
+
}
|
|
38
|
+
updateSection(id, patch) {
|
|
39
|
+
const stage = 'SectionService::updateSection';
|
|
40
|
+
if (!patch || Object.keys(patch).length === 0) {
|
|
41
|
+
return Effect.fail(XfErrorFactory.inputRequired({ field: 'patch', stage }));
|
|
42
|
+
}
|
|
43
|
+
return pipe(validateInput(id, 'id', { stage }), Effect.flatMap((entityId) => validateBmInputWithSchema({
|
|
44
|
+
input: patch,
|
|
45
|
+
schema: sectionZodSchemaInsert.partial().strict(),
|
|
46
|
+
stage,
|
|
47
|
+
operation: 'SectionService::updateSection.sectionZodSchemaInsert.patch',
|
|
48
|
+
field: 'patch',
|
|
49
|
+
}).pipe(Effect.map(() => entityId))), Effect.flatMap((entityId) => this.sectionRepository.patchById(entityId, patch).pipe(Effect.mapError(mapDbError({ stage, operation: 'patchById', factory: XfErrorFactory.upsertFailed })))), Effect.tapError((e) => Effect.sync(() => {
|
|
50
|
+
const info = effectErrorInfo(e);
|
|
51
|
+
this.logger?.error({ error: info.unwrapped, stage }, 'Error in updateSection');
|
|
52
|
+
})));
|
|
53
|
+
}
|
|
54
|
+
removeSection(id) {
|
|
55
|
+
const stage = 'SectionService::removeSection';
|
|
56
|
+
return pipe(validateInput(id, 'id', { stage }), Effect.flatMap((entityId) => this.sectionRepository.deleteById(entityId).pipe(Effect.mapError(mapDbError({ stage, operation: 'deleteById', factory: XfErrorFactory.upsertFailed })))), Effect.map(() => undefined));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { XfLogger } from '@aopslab/xf-logger';
|
|
3
|
+
import type { IRepositoryPortSectionPageLink } from '../ports/repository-ports/index.js';
|
|
4
|
+
import type { ISectionPageLinkServicePort } from '../ports/inbound/index.js';
|
|
5
|
+
import { SectionPageLinkServiceError } from '../errors/SectionPageLinkServiceError.js';
|
|
6
|
+
import { IbmSectionPageLink, IbmSectionPageLinkInsert } from '../../domain/models/index.js';
|
|
7
|
+
import { DbQueryOptions } from '@aopslab/xf-db';
|
|
8
|
+
export interface SectionPageLinkServiceDependencies {
|
|
9
|
+
}
|
|
10
|
+
export interface SectionPageLinkServiceOptions {
|
|
11
|
+
sectionPageLinkRepository: IRepositoryPortSectionPageLink;
|
|
12
|
+
serviceDependencies?: Partial<SectionPageLinkServiceDependencies>;
|
|
13
|
+
logger?: XfLogger;
|
|
14
|
+
locale?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class SectionPageLinkService implements ISectionPageLinkServicePort {
|
|
17
|
+
private readonly sectionPageLinkRepository;
|
|
18
|
+
private readonly logger?;
|
|
19
|
+
constructor(options: SectionPageLinkServiceOptions);
|
|
20
|
+
getById(id: string, options?: DbQueryOptions<IbmSectionPageLink>): Effect.Effect<IbmSectionPageLink | null, SectionPageLinkServiceError>;
|
|
21
|
+
create(data: IbmSectionPageLinkInsert): Effect.Effect<IbmSectionPageLink, SectionPageLinkServiceError>;
|
|
22
|
+
listSectionPageLinks(filter?: Partial<IbmSectionPageLink>, options?: DbQueryOptions<IbmSectionPageLink>): Effect.Effect<IbmSectionPageLink[], SectionPageLinkServiceError>;
|
|
23
|
+
updateSectionPageLink(id: string, patch: Partial<IbmSectionPageLink>): Effect.Effect<IbmSectionPageLink, SectionPageLinkServiceError>;
|
|
24
|
+
removeSectionPageLink(id: string): Effect.Effect<void, SectionPageLinkServiceError>;
|
|
25
|
+
}
|