@mdfriday/foundry 26.4.19 → 26.5.1
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/dist/cjs/index.js +1 -1
- package/dist/cjs/obsidian/mobile.js +1 -1
- package/dist/cjs/worker/pool-manager.js +341 -362
- package/dist/cjs/worker/worker-node.js +110 -132
- package/dist/esm/index.js +1 -1
- package/dist/esm/obsidian/mobile.js +1 -1
- package/dist/types/internal/application/batch-task-queue.d.ts +17 -0
- package/dist/types/internal/application/container.d.ts +68 -1
- package/dist/types/internal/application/identity.d.ts +173 -0
- package/dist/types/internal/application/incremental-build-coordinator.d.ts +28 -0
- package/dist/types/internal/application/incremental-ssg.d.ts +4 -0
- package/dist/types/internal/application/index.d.ts +5 -4
- package/dist/types/internal/application/publish.d.ts +37 -0
- package/dist/types/internal/application/ssg-parallel.d.ts +6 -0
- package/dist/types/internal/application/ssg.d.ts +15 -0
- package/dist/types/internal/application/wiki-service-config.d.ts +65 -0
- package/dist/types/internal/application/wiki-service.d.ts +199 -0
- package/dist/types/internal/application/worker/pool-manager.d.ts +43 -0
- package/dist/types/internal/application/worker/worker-browser.d.ts +6 -0
- package/dist/types/internal/application/worker/worker-main.d.ts +12 -0
- package/dist/types/internal/application/worker/worker-state.d.ts +23 -0
- package/dist/types/internal/application/workspace.d.ts +98 -0
- package/dist/types/internal/domain/config/entity/config.d.ts +40 -0
- package/dist/types/internal/domain/config/entity/language.d.ts +51 -0
- package/dist/types/internal/domain/config/entity/markdown.d.ts +36 -0
- package/dist/types/internal/domain/config/entity/module.d.ts +36 -0
- package/dist/types/internal/domain/config/entity/root.d.ts +39 -0
- package/dist/types/internal/domain/config/entity/service.d.ts +36 -0
- package/dist/types/internal/domain/config/entity/social.d.ts +43 -0
- package/dist/types/internal/domain/config/entity/taxonomy.d.ts +39 -0
- package/dist/types/internal/domain/config/factory/config.d.ts +3 -0
- package/dist/types/internal/domain/config/factory/loader.d.ts +24 -0
- package/dist/types/internal/domain/config/factory/provider.d.ts +10 -0
- package/dist/types/internal/domain/config/factory/sourcedescriptor.d.ts +12 -0
- package/dist/types/internal/domain/config/type.d.ts +56 -0
- package/dist/types/internal/domain/config/vo/language.d.ts +6 -0
- package/dist/types/internal/domain/config/vo/markdown.d.ts +13 -0
- package/dist/types/internal/domain/config/vo/module.d.ts +9 -0
- package/dist/types/internal/domain/config/vo/root.d.ts +6 -0
- package/dist/types/internal/domain/config/vo/service.d.ts +6 -0
- package/dist/types/internal/domain/config/vo/social.d.ts +16 -0
- package/dist/types/internal/domain/config/vo/taxonomy.d.ts +12 -0
- package/dist/types/internal/domain/content/entity/content.d.ts +36 -0
- package/dist/types/internal/domain/content/entity/page.d.ts +23 -0
- package/dist/types/internal/domain/content/entity/pagebuilder.d.ts +83 -0
- package/dist/types/internal/domain/content/entity/pagecollector.d.ts +3 -0
- package/dist/types/internal/domain/content/entity/pagecontent.d.ts +14 -0
- package/dist/types/internal/domain/content/entity/pagemap.d.ts +69 -0
- package/dist/types/internal/domain/content/entity/pagesource.d.ts +52 -0
- package/dist/types/internal/domain/content/entity/pagetrees.d.ts +12 -0
- package/dist/types/internal/domain/content/entity/paginator.d.ts +19 -0
- package/dist/types/internal/domain/content/entity/section.d.ts +15 -0
- package/dist/types/internal/domain/content/entity/shortcode.d.ts +39 -0
- package/dist/types/internal/domain/content/entity/standalone.d.ts +9 -0
- package/dist/types/internal/domain/content/entity/taxonomy.d.ts +15 -0
- package/dist/types/internal/domain/content/entity/term.d.ts +6 -0
- package/dist/types/internal/domain/content/entity/translator.d.ts +22 -0
- package/dist/types/internal/domain/content/type.d.ts +6 -0
- package/dist/types/internal/domain/content/vo/classifier.d.ts +24 -0
- package/dist/types/internal/domain/content/vo/frontmatter.d.ts +65 -0
- package/dist/types/internal/domain/content/vo/kind.d.ts +10 -0
- package/dist/types/internal/domain/fs/entity/basefs.d.ts +23 -0
- package/dist/types/internal/domain/fs/entity/fs.d.ts +13 -0
- package/dist/types/internal/domain/fs/entity/originfs.d.ts +6 -0
- package/dist/types/internal/domain/fs/entity/overlaydir.d.ts +44 -0
- package/dist/types/internal/domain/fs/entity/overlayfs.d.ts +79 -0
- package/dist/types/internal/domain/fs/entity/service.d.ts +15 -0
- package/dist/types/internal/domain/fs/factory/fs.d.ts +4 -0
- package/dist/types/internal/domain/fs/type.d.ts +95 -0
- package/dist/types/internal/domain/fs/vo/dir.d.ts +41 -0
- package/dist/types/internal/domain/fs/vo/file.d.ts +28 -0
- package/dist/types/internal/domain/fs/vo/fileinfo.d.ts +23 -0
- package/dist/types/internal/domain/fs/vo/filemeta.d.ts +45 -0
- package/dist/types/internal/domain/fs/vo/filesystemscollector.d.ts +17 -0
- package/dist/types/internal/domain/fs/vo/filevitural.d.ts +8 -0
- package/dist/types/internal/domain/fs/vo/osfs.d.ts +12 -0
- package/dist/types/internal/domain/fs/vo/overlay-factory.d.ts +4 -0
- package/dist/types/internal/domain/fs/vo/overlayfs-factory.d.ts +42 -0
- package/dist/types/internal/domain/fs/vo/overlayoptions.d.ts +44 -0
- package/dist/types/internal/domain/fs/vo/static-copier.d.ts +22 -0
- package/dist/types/internal/domain/fs/vo/walkway.d.ts +22 -0
- package/dist/types/internal/domain/identity/entity/user.d.ts +100 -0
- package/dist/types/internal/domain/identity/factory/user-factory.d.ts +183 -0
- package/dist/types/internal/domain/identity/repository/index.d.ts +30 -0
- package/dist/types/internal/domain/identity/type.d.ts +17 -0
- package/dist/types/internal/domain/identity/value-object/device.d.ts +26 -0
- package/dist/types/internal/domain/identity/value-object/email.d.ts +29 -0
- package/dist/types/internal/domain/identity/value-object/license.d.ts +91 -0
- package/dist/types/internal/domain/identity/value-object/server-config.d.ts +37 -0
- package/dist/types/internal/domain/identity/value-object/sync-config.d.ts +47 -0
- package/dist/types/internal/domain/identity/value-object/token.d.ts +35 -0
- package/dist/types/internal/domain/markdown/entity/markdown.d.ts +41 -0
- package/dist/types/internal/domain/markdown/factory/it/config.d.ts +60 -0
- package/dist/types/internal/domain/markdown/factory/it/index.d.ts +21 -1
- package/dist/types/internal/domain/markdown/factory/it/parserresult.d.ts +3 -0
- package/dist/types/internal/domain/markdown/factory/it/plugins/callout-plugin.d.ts +40 -0
- package/dist/types/internal/domain/markdown/factory/it/plugins/latex-plugin.d.ts +23 -0
- package/dist/types/internal/domain/markdown/factory/it/plugins/mermaid-plugin.d.ts +24 -0
- package/dist/types/internal/domain/markdown/factory/it/plugins/tag-plugin.d.ts +71 -0
- package/dist/types/internal/domain/markdown/factory/it/plugins/wikilink-plugin.d.ts +28 -0
- package/dist/types/internal/domain/markdown/factory/it/plugins/wikilink.d.ts +31 -0
- package/dist/types/internal/domain/markdown/factory/it/tableofcontents.d.ts +21 -0
- package/dist/types/internal/domain/markdown/factory/it/util/path.d.ts +11 -0
- package/dist/types/internal/domain/markdown/factory/it/util/slugger-fallback.d.ts +6 -0
- package/dist/types/internal/domain/markdown/type.d.ts +159 -0
- package/dist/types/internal/domain/markdown/vo/config.d.ts +48 -0
- package/dist/types/internal/domain/markdown/vo/content.d.ts +92 -0
- package/dist/types/internal/domain/markdown/vo/context.d.ts +9 -0
- package/dist/types/internal/domain/markdown/vo/highlight.d.ts +15 -0
- package/dist/types/internal/domain/markdown/vo/pageparser.d.ts +9 -0
- package/dist/types/internal/domain/markdown/vo/parseinfo.d.ts +36 -0
- package/dist/types/internal/domain/markdown/vo/parserresult.d.ts +6 -0
- package/dist/types/internal/domain/markdown/vo/shortcode.d.ts +31 -1
- package/dist/types/internal/domain/markdown/vo/tableofcontents.d.ts +21 -0
- package/dist/types/internal/domain/module/entity/lang.d.ts +12 -0
- package/dist/types/internal/domain/module/entity/module.d.ts +73 -0
- package/dist/types/internal/domain/module/factory/module.d.ts +6 -0
- package/dist/types/internal/domain/module/type.d.ts +58 -0
- package/dist/types/internal/domain/module/vo/cache.d.ts +48 -0
- package/dist/types/internal/domain/module/vo/httpclient.d.ts +14 -0
- package/dist/types/internal/domain/module/vo/module.d.ts +76 -0
- package/dist/types/internal/domain/module/vo/mount.d.ts +39 -0
- package/dist/types/internal/domain/module/vo/themes.d.ts +38 -0
- package/dist/types/internal/domain/module/vo/zipextractor.d.ts +31 -0
- package/dist/types/internal/domain/paths/entity/path.d.ts +28 -0
- package/dist/types/internal/domain/paths/factory/pathfactory.d.ts +82 -0
- package/dist/types/internal/domain/paths/type.d.ts +133 -1
- package/dist/types/internal/domain/paths/vo/pathcomponents.d.ts +94 -0
- package/dist/types/internal/domain/paths/vo/pathparser.d.ts +77 -0
- package/dist/types/internal/domain/publish/entity/publisher.d.ts +26 -0
- package/dist/types/internal/domain/publish/factory/publisher-factory.d.ts +17 -0
- package/dist/types/internal/domain/publish/repository/http-client.d.ts +21 -0
- package/dist/types/internal/domain/publish/repository/manifest-repository.d.ts +27 -0
- package/dist/types/internal/domain/publish/type.d.ts +49 -0
- package/dist/types/internal/domain/publish/value-object/ftp-publisher.d.ts +30 -0
- package/dist/types/internal/domain/publish/value-object/mdfriday-publisher.d.ts +57 -0
- package/dist/types/internal/domain/publish/value-object/netlify-publisher.d.ts +55 -0
- package/dist/types/internal/domain/publish/value-object/publish-config.d.ts +38 -0
- package/dist/types/internal/domain/publish/value-object/publish-manifest.d.ts +50 -0
- package/dist/types/internal/domain/resources/entity/http.d.ts +11 -0
- package/dist/types/internal/domain/resources/entity/integrity.d.ts +4 -0
- package/dist/types/internal/domain/resources/entity/minifier.d.ts +4 -0
- package/dist/types/internal/domain/resources/entity/publisher.d.ts +24 -0
- package/dist/types/internal/domain/resources/entity/resource.d.ts +4 -0
- package/dist/types/internal/domain/resources/entity/resources.d.ts +40 -0
- package/dist/types/internal/domain/resources/entity/template.d.ts +4 -0
- package/dist/types/internal/domain/resources/factory/resource.d.ts +4 -0
- package/dist/types/internal/domain/site/entity/language.d.ts +55 -0
- package/dist/types/internal/domain/site/entity/menu-builder.d.ts +50 -0
- package/dist/types/internal/domain/site/entity/navigation.d.ts +8 -0
- package/dist/types/internal/domain/site/entity/page.d.ts +88 -0
- package/dist/types/internal/domain/site/entity/pagegraph.d.ts +85 -0
- package/dist/types/internal/domain/site/entity/pager.d.ts +6 -0
- package/dist/types/internal/domain/site/entity/publisher.d.ts +26 -0
- package/dist/types/internal/domain/site/entity/ref.d.ts +27 -0
- package/dist/types/internal/domain/site/entity/site.d.ts +178 -0
- package/dist/types/internal/domain/site/factory/navigation-factory.d.ts +6 -0
- package/dist/types/internal/domain/site/factory/site.d.ts +4 -0
- package/dist/types/internal/domain/site/service/html-link-processor.d.ts +44 -0
- package/dist/types/internal/domain/site/type.d.ts +100 -0
- package/dist/types/internal/domain/site/valueobject/author.d.ts +16 -0
- package/dist/types/internal/domain/site/valueobject/baseurl.d.ts +39 -0
- package/dist/types/internal/domain/site/valueobject/menu.d.ts +49 -0
- package/dist/types/internal/domain/site/valueobject/organization.d.ts +37 -0
- package/dist/types/internal/domain/site/valueobject/path.d.ts +50 -0
- package/dist/types/internal/domain/site/valueobject/version.d.ts +14 -0
- package/dist/types/internal/domain/template/entity/executor.d.ts +22 -0
- package/dist/types/internal/domain/template/entity/lookup.d.ts +55 -0
- package/dist/types/internal/domain/template/entity/parser.d.ts +40 -0
- package/dist/types/internal/domain/template/entity/template.d.ts +87 -0
- package/dist/types/internal/domain/template/factory/template.d.ts +61 -0
- package/dist/types/internal/domain/template/type.d.ts +109 -0
- package/dist/types/internal/domain/template/vo/baseof.d.ts +47 -0
- package/dist/types/internal/domain/template/vo/info.d.ts +28 -0
- package/dist/types/internal/domain/template/vo/namespace.d.ts +91 -0
- package/dist/types/internal/domain/template/vo/registry.d.ts +160 -0
- package/dist/types/internal/domain/wiki/entity/concept.d.ts +31 -0
- package/dist/types/internal/domain/wiki/entity/connection.d.ts +29 -0
- package/dist/types/internal/domain/wiki/entity/conversation.d.ts +65 -0
- package/dist/types/internal/domain/wiki/entity/embedding-index.d.ts +60 -0
- package/dist/types/internal/domain/wiki/entity/entity.d.ts +32 -0
- package/dist/types/internal/domain/wiki/entity/knowledge-base.d.ts +292 -0
- package/dist/types/internal/domain/wiki/entity/operation-log.d.ts +82 -0
- package/dist/types/internal/domain/wiki/factory/wiki-factory.d.ts +41 -0
- package/dist/types/internal/domain/wiki/index.d.ts +22 -0
- package/dist/types/internal/domain/wiki/repository/conversation-repository.interface.d.ts +29 -0
- package/dist/types/internal/domain/wiki/repository/crypto-service.d.ts +16 -0
- package/dist/types/internal/domain/wiki/repository/embedding-provider.d.ts +12 -0
- package/dist/types/internal/domain/wiki/repository/file-system.d.ts +43 -0
- package/dist/types/internal/domain/wiki/repository/index.d.ts +14 -0
- package/dist/types/internal/domain/wiki/repository/kb-repository.interface.d.ts +30 -0
- package/dist/types/internal/domain/wiki/repository/llm-http-client.d.ts +40 -0
- package/dist/types/internal/domain/wiki/repository/llm-provider.d.ts +34 -0
- package/dist/types/internal/domain/wiki/repository/path-service.d.ts +32 -0
- package/dist/types/internal/domain/wiki/repository/wiki-page-repository.interface.d.ts +49 -0
- package/dist/types/internal/domain/wiki/value-object/connection-type.d.ts +24 -0
- package/dist/types/internal/domain/wiki/value-object/content-annotator.d.ts +61 -0
- package/dist/types/internal/domain/wiki/value-object/entity-id.d.ts +17 -0
- package/dist/types/internal/domain/wiki/value-object/entity-type.d.ts +24 -0
- package/dist/types/internal/domain/wiki/value-object/extraction-parser.d.ts +27 -0
- package/dist/types/internal/domain/wiki/value-object/extraction-result.d.ts +32 -0
- package/dist/types/internal/domain/wiki/value-object/retrieval.d.ts +228 -0
- package/dist/types/internal/domain/wiki/value-object/source-record.d.ts +17 -0
- package/dist/types/internal/domain/wiki/value-object/wiki-config.d.ts +40 -0
- package/dist/types/internal/domain/wiki/value-object/wiki-index-generator.d.ts +31 -0
- package/dist/types/internal/domain/wiki/value-object/wiki-page-renderer.d.ts +42 -0
- package/dist/types/internal/domain/workspace/entity/authentication.d.ts +29 -0
- package/dist/types/internal/domain/workspace/entity/project.d.ts +173 -0
- package/dist/types/internal/domain/workspace/entity/workspace.d.ts +85 -0
- package/dist/types/internal/domain/workspace/factory/workspace-factory.d.ts +107 -0
- package/dist/types/internal/domain/workspace/repository/file-system.d.ts +241 -0
- package/dist/types/internal/domain/workspace/repository/index.d.ts +6 -0
- package/dist/types/internal/domain/workspace/repository.d.ts +72 -0
- package/dist/types/internal/domain/workspace/type.d.ts +18 -0
- package/dist/types/internal/domain/workspace/value-object/folder-structure.d.ts +41 -0
- package/dist/types/internal/domain/workspace/value-object/project-metadata.d.ts +36 -0
- package/dist/types/internal/domain/workspace/value-object/workspace-metadata.d.ts +7 -0
- package/dist/types/internal/infrastructure/embedding/embedding-provider.interface.d.ts +33 -0
- package/dist/types/internal/infrastructure/embedding/index.d.ts +5 -0
- package/dist/types/internal/infrastructure/embedding/ollama-embedding-provider.d.ts +24 -0
- package/dist/types/internal/infrastructure/http/netlify-http-client.d.ts +20 -0
- package/dist/types/internal/infrastructure/http/node-http-client.d.ts +3 -0
- package/dist/types/internal/infrastructure/index.d.ts +8 -0
- package/dist/types/internal/infrastructure/llm/fetch-http-client.d.ts +24 -0
- package/dist/types/internal/infrastructure/llm/index.d.ts +6 -0
- package/dist/types/internal/infrastructure/llm/llm-config.d.ts +80 -0
- package/dist/types/internal/infrastructure/llm/lmstudio-provider.d.ts +55 -0
- package/dist/types/internal/infrastructure/llm/node-llm-http-client.d.ts +21 -0
- package/dist/types/internal/infrastructure/llm/ollama-provider.d.ts +17 -0
- package/dist/types/internal/infrastructure/llm/openai-compatible-provider.d.ts +70 -0
- package/dist/types/internal/infrastructure/llm/provider-factory.d.ts +36 -0
- package/dist/types/internal/infrastructure/llm/provider.d.ts +77 -0
- package/dist/types/internal/infrastructure/node/index.d.ts +11 -0
- package/dist/types/internal/infrastructure/node/node-conversation-repository.d.ts +21 -0
- package/dist/types/internal/infrastructure/node/node-crypto-service.d.ts +10 -0
- package/dist/types/internal/infrastructure/node/node-file-system.d.ts +29 -0
- package/dist/types/internal/infrastructure/node/node-kb-repository.d.ts +18 -0
- package/dist/types/internal/infrastructure/node/node-path-service.d.ts +14 -0
- package/dist/types/internal/infrastructure/node/node-wiki-page-repository.d.ts +25 -0
- package/dist/types/internal/infrastructure/persistence/node-file-system.d.ts +8 -0
- package/dist/types/internal/infrastructure/persistence/node-manifest-repository.d.ts +31 -0
- package/dist/types/internal/infrastructure/persistence/node-snapshot-repository.d.ts +28 -0
- package/dist/types/internal/infrastructure/persistence/node-workspace-repository.d.ts +9 -0
- package/dist/types/pkg/cahce/cache.d.ts +56 -0
- package/dist/types/pkg/lang/data.d.ts +21 -0
- package/dist/types/pkg/lang/index.d.ts +46 -0
- package/dist/types/pkg/lang/service.d.ts +49 -0
- package/dist/types/pkg/lang/types.d.ts +29 -0
- package/dist/types/pkg/log/http.d.ts +16 -0
- package/dist/types/pkg/log/manager.d.ts +57 -0
- package/dist/types/pkg/maps/scratch.d.ts +25 -0
- package/dist/types/pkg/md/parser/item.d.ts +3 -3
- package/dist/types/pkg/media/type.d.ts +19 -0
- package/dist/types/pkg/page-filter/index.d.ts +29 -0
- package/dist/types/pkg/paths/index.d.ts +9 -0
- package/dist/types/pkg/text/index.d.ts +4 -0
- package/dist/types/pkg/web/server/livereload-server.d.ts +7 -0
- package/dist/types/pkg/web/watcher/content-file-watcher.d.ts +3 -0
- package/package.json +21 -15
- package/dist/types/index.d.ts +0 -20
- package/dist/types/internal/interfaces/obsidian/adapters/identity-adapter.d.ts +0 -5
- package/dist/types/internal/interfaces/obsidian/adapters/index.d.ts +0 -2
- package/dist/types/internal/interfaces/obsidian/adapters/workspace-adapter.d.ts +0 -8
- package/dist/types/internal/interfaces/obsidian/desktop/adapters/identity-adapter.d.ts +0 -6
- package/dist/types/internal/interfaces/obsidian/desktop/adapters/index.d.ts +0 -2
- package/dist/types/internal/interfaces/obsidian/desktop/adapters/workspace-adapter.d.ts +0 -12
- package/dist/types/internal/interfaces/obsidian/desktop/container.d.ts +0 -7
- package/dist/types/internal/interfaces/obsidian/desktop/index.d.ts +0 -22
- package/dist/types/internal/interfaces/obsidian/index.d.ts +0 -7
- package/dist/types/internal/interfaces/obsidian/mobile/adapters/identity-adapter.d.ts +0 -9
- package/dist/types/internal/interfaces/obsidian/mobile/adapters/index.d.ts +0 -2
- package/dist/types/internal/interfaces/obsidian/mobile/adapters/workspace-adapter.d.ts +0 -13
- package/dist/types/internal/interfaces/obsidian/mobile/config-types.d.ts +0 -13
- package/dist/types/internal/interfaces/obsidian/mobile/container.d.ts +0 -6
- package/dist/types/internal/interfaces/obsidian/mobile/index.d.ts +0 -16
- package/dist/types/internal/interfaces/obsidian/mobile.d.ts +0 -2
- package/dist/types/internal/interfaces/obsidian/services/auth.service.d.ts +0 -11
- package/dist/types/internal/interfaces/obsidian/services/build.service.d.ts +0 -9
- package/dist/types/internal/interfaces/obsidian/services/config.service.d.ts +0 -31
- package/dist/types/internal/interfaces/obsidian/services/domain.service.d.ts +0 -15
- package/dist/types/internal/interfaces/obsidian/services/license.service.d.ts +0 -22
- package/dist/types/internal/interfaces/obsidian/services/project.service.d.ts +0 -17
- package/dist/types/internal/interfaces/obsidian/services/publish.service.d.ts +0 -11
- package/dist/types/internal/interfaces/obsidian/services/serve.service.d.ts +0 -18
- package/dist/types/internal/interfaces/obsidian/services/workspace.service.d.ts +0 -10
- package/dist/types/internal/interfaces/obsidian/types/auth.d.ts +0 -27
- package/dist/types/internal/interfaces/obsidian/types/build.d.ts +0 -23
- package/dist/types/internal/interfaces/obsidian/types/config.d.ts +0 -16
- package/dist/types/internal/interfaces/obsidian/types/domain.d.ts +0 -46
- package/dist/types/internal/interfaces/obsidian/types/index.d.ts +0 -9
- package/dist/types/internal/interfaces/obsidian/types/license.d.ts +0 -87
- package/dist/types/internal/interfaces/obsidian/types/project.d.ts +0 -56
- package/dist/types/internal/interfaces/obsidian/types/publish.d.ts +0 -33
- package/dist/types/internal/interfaces/obsidian/types/serve.d.ts +0 -46
- package/dist/types/internal/interfaces/obsidian/types/workspace.d.ts +0 -27
- package/dist/types/pkg/log/browser-manager.d.ts +0 -20
- package/dist/types/pkg/log/browser.d.ts +0 -25
- package/dist/types/pkg/media/buildin.d.ts +0 -3
|
@@ -1,119 +1,239 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path processor interface - main entry point for path processing
|
|
3
|
+
*/
|
|
1
4
|
export interface PathProcessor {
|
|
2
5
|
parse(component: string, path: string): Path;
|
|
3
6
|
parseIdentity(component: string, path: string): StringIdentity;
|
|
4
7
|
parseBaseAndBaseNameNoIdentifier(component: string, path: string): [string, string];
|
|
5
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Path represents a parsed path with all its components and metadata
|
|
11
|
+
*/
|
|
6
12
|
export interface Path extends PathInfo, PathOperations, PathMetadata {
|
|
13
|
+
/**
|
|
14
|
+
* Get the unnormalized version of this path (preserves original case)
|
|
15
|
+
*/
|
|
7
16
|
unnormalized(): Path;
|
|
8
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* PathInfo provides basic path information access
|
|
20
|
+
*/
|
|
9
21
|
export interface PathInfo {
|
|
22
|
+
/** Component returns the component for this path (e.g. "content") */
|
|
10
23
|
component(): string;
|
|
24
|
+
/** Path returns the full path */
|
|
11
25
|
path(): string;
|
|
26
|
+
/** Name returns the last element of path */
|
|
12
27
|
name(): string;
|
|
28
|
+
/** NameNoExt returns the last element of path without any extension */
|
|
13
29
|
nameNoExt(): string;
|
|
30
|
+
/** NameNoLang returns the last element of path without any language identifier */
|
|
14
31
|
nameNoLang(): string;
|
|
32
|
+
/** Dir returns all but the last element of path, typically the path's directory */
|
|
15
33
|
dir(): string;
|
|
34
|
+
/** Ext returns the file extension */
|
|
16
35
|
ext(): string;
|
|
36
|
+
/** Lang returns the language identifier */
|
|
17
37
|
lang(): string;
|
|
38
|
+
/** Section returns the first path element (section) */
|
|
18
39
|
section(): string;
|
|
40
|
+
/** Sections returns all section path elements as an array */
|
|
19
41
|
sections(): string[];
|
|
42
|
+
/** Container returns the base name of the container directory for this path */
|
|
20
43
|
container(): string;
|
|
44
|
+
/** ContainerDir returns the container directory for this path */
|
|
21
45
|
containerDir(): string;
|
|
22
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* PathOperations provides path manipulation operations
|
|
49
|
+
*/
|
|
23
50
|
export interface PathOperations {
|
|
51
|
+
/** Base returns the path without any identifiers for content files */
|
|
24
52
|
base(): string;
|
|
53
|
+
/** BaseNoLeadingSlash returns the base path without the leading slash */
|
|
25
54
|
baseNoLeadingSlash(): string;
|
|
55
|
+
/** BaseNameNoIdentifier returns the logical base name for a resource without any identifier */
|
|
26
56
|
baseNameNoIdentifier(): string;
|
|
57
|
+
/** NameNoIdentifier returns the last element of path without any identifier */
|
|
27
58
|
nameNoIdentifier(): string;
|
|
59
|
+
/** PathNoLang returns the Path but with any language identifier removed */
|
|
28
60
|
pathNoLang(): string;
|
|
61
|
+
/** PathNoIdentifier returns the Path but with any identifier removed */
|
|
29
62
|
pathNoIdentifier(): string;
|
|
63
|
+
/** PathRel returns the path relative to the given owner */
|
|
30
64
|
pathRel(owner: Path): string;
|
|
65
|
+
/** BaseRel returns the base path relative to the given owner */
|
|
31
66
|
baseRel(owner: Path): string;
|
|
67
|
+
/** TrimLeadingSlash returns a copy of the Path with the leading slash removed */
|
|
32
68
|
trimLeadingSlash(): Path;
|
|
69
|
+
/** Identifier returns the identifier at the given index */
|
|
33
70
|
identifier(index: number): string;
|
|
71
|
+
/** Identifiers returns all identifiers */
|
|
34
72
|
identifiers(): string[];
|
|
35
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* PathMetadata provides metadata about the path
|
|
76
|
+
*/
|
|
36
77
|
export interface PathMetadata {
|
|
78
|
+
/** BundleType returns the bundle type */
|
|
37
79
|
bundleType(): PathType;
|
|
80
|
+
/** IsContent returns true if the path is a content file */
|
|
38
81
|
isContent(): boolean;
|
|
82
|
+
/** IsBundle returns true if this is a bundle */
|
|
39
83
|
isBundle(): boolean;
|
|
84
|
+
/** IsBranchBundle returns true if this is a branch bundle */
|
|
40
85
|
isBranchBundle(): boolean;
|
|
86
|
+
/** IsLeafBundle returns true if this is a leaf bundle */
|
|
41
87
|
isLeafBundle(): boolean;
|
|
88
|
+
/** IsHTML returns true if the extension indicates HTML content */
|
|
42
89
|
isHTML(): boolean;
|
|
90
|
+
/** Disabled returns true if the path is disabled */
|
|
43
91
|
disabled(): boolean;
|
|
92
|
+
/** ForBundleType returns a copy of the path with the specified bundle type */
|
|
44
93
|
forBundleType(type: PathType): Path;
|
|
45
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* StringIdentity represents a unique string identifier for a path
|
|
97
|
+
*/
|
|
46
98
|
export interface StringIdentity {
|
|
47
99
|
identifierBase(): string;
|
|
48
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* PathType enum represents different types of paths
|
|
103
|
+
*/
|
|
49
104
|
export declare enum PathType {
|
|
105
|
+
/** A generic resource, e.g. a JSON file */
|
|
50
106
|
File = 0,
|
|
107
|
+
/** A resource of a content type with front matter */
|
|
51
108
|
ContentResource = 1,
|
|
109
|
+
/** E.g. /blog/my-post.md */
|
|
52
110
|
ContentSingle = 2,
|
|
111
|
+
/** Leaf bundles, e.g. /blog/my-post/index.md */
|
|
53
112
|
Leaf = 3,
|
|
113
|
+
/** Branch bundles, e.g. /blog/_index.md */
|
|
54
114
|
Branch = 4
|
|
55
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* PathParser configuration interface
|
|
118
|
+
*/
|
|
56
119
|
export interface PathParserConfig {
|
|
120
|
+
/** Normalize paths to lowercase */
|
|
57
121
|
normalize?: boolean;
|
|
122
|
+
/** Replace spaces with hyphens */
|
|
58
123
|
replaceSpaces?: boolean;
|
|
124
|
+
/** Custom normalization function */
|
|
59
125
|
normalizer?: (path: string) => string;
|
|
60
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* LowHigh represents a range with low and high positions
|
|
129
|
+
*/
|
|
61
130
|
export interface LowHigh {
|
|
62
131
|
low: number;
|
|
63
132
|
high: number;
|
|
64
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* PathComponents represents the parsed components of a path
|
|
136
|
+
*/
|
|
65
137
|
export interface PathComponents {
|
|
138
|
+
/** The original path string */
|
|
66
139
|
original: string;
|
|
140
|
+
/** The normalized path string */
|
|
67
141
|
normalized: string;
|
|
142
|
+
/** Position information for various path parts */
|
|
68
143
|
positions: PathPositions;
|
|
144
|
+
/** Parsed identifiers (extensions, language codes, etc.) */
|
|
69
145
|
identifiers: LowHigh[];
|
|
146
|
+
/** Bundle type if this is a content path */
|
|
70
147
|
bundleType: PathType;
|
|
148
|
+
/** Whether this path is disabled */
|
|
71
149
|
disabled: boolean;
|
|
150
|
+
/** Component type (content, static, layouts, etc.) */
|
|
72
151
|
component?: string | undefined;
|
|
73
152
|
}
|
|
153
|
+
/**
|
|
154
|
+
* PathPositions holds position information for different parts of the path
|
|
155
|
+
*/
|
|
74
156
|
export interface PathPositions {
|
|
157
|
+
/** Container directory positions */
|
|
75
158
|
containerLow: number;
|
|
76
159
|
containerHigh: number;
|
|
160
|
+
/** Section position */
|
|
77
161
|
sectionHigh: number;
|
|
162
|
+
/** Language identifier position */
|
|
78
163
|
identifierLanguage: number;
|
|
79
164
|
}
|
|
165
|
+
/**
|
|
166
|
+
* PathNormalizer interface for custom path normalization strategies
|
|
167
|
+
*/
|
|
80
168
|
export interface PathNormalizer {
|
|
81
169
|
normalize(path: string): string;
|
|
82
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* BasicPathNormalizer provides Hugo's basic normalization rules
|
|
173
|
+
*/
|
|
83
174
|
export interface BasicPathNormalizer extends PathNormalizer {
|
|
175
|
+
/** Normalize to lowercase */
|
|
84
176
|
toLowerCase: boolean;
|
|
177
|
+
/** Replace spaces with hyphens */
|
|
85
178
|
replaceSpaces: boolean;
|
|
86
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* PathValidator interface for validating paths
|
|
182
|
+
*/
|
|
87
183
|
export interface PathValidator {
|
|
88
184
|
validate(path: string): ValidationResult;
|
|
89
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
* ValidationResult represents the result of path validation
|
|
188
|
+
*/
|
|
90
189
|
export interface ValidationResult {
|
|
91
190
|
valid: boolean;
|
|
92
191
|
errors: string[];
|
|
93
192
|
warnings: string[];
|
|
94
193
|
}
|
|
194
|
+
/**
|
|
195
|
+
* FileExtensionChecker interface for checking file extensions
|
|
196
|
+
*/
|
|
95
197
|
export interface FileExtensionChecker {
|
|
96
198
|
isContentExt(ext: string): boolean;
|
|
97
199
|
isHTML(ext: string): boolean;
|
|
98
200
|
hasExt(path: string): boolean;
|
|
99
201
|
}
|
|
202
|
+
/**
|
|
203
|
+
* PathFactory interface for creating Path instances
|
|
204
|
+
*/
|
|
100
205
|
export interface PathFactory {
|
|
101
206
|
create(component: string, path: string, config?: PathParserConfig): Path;
|
|
102
207
|
createFromComponents(components: PathComponents): Path;
|
|
103
208
|
}
|
|
209
|
+
/**
|
|
210
|
+
* PathPool interface for object pooling to improve performance
|
|
211
|
+
*/
|
|
104
212
|
export interface PathPool {
|
|
105
213
|
get(): Path;
|
|
106
214
|
put(path: Path): void;
|
|
107
215
|
}
|
|
216
|
+
/**
|
|
217
|
+
* PathVisitor interface for visitor pattern on paths
|
|
218
|
+
*/
|
|
108
219
|
export interface PathVisitor<T> {
|
|
109
220
|
visit(path: Path): T;
|
|
110
221
|
}
|
|
222
|
+
/**
|
|
223
|
+
* PathFilter interface for filtering paths
|
|
224
|
+
*/
|
|
111
225
|
export interface PathFilter {
|
|
112
226
|
accept(path: Path): boolean;
|
|
113
227
|
}
|
|
228
|
+
/**
|
|
229
|
+
* PathTransformer interface for transforming paths
|
|
230
|
+
*/
|
|
114
231
|
export interface PathTransformer {
|
|
115
232
|
transform(path: Path): Path;
|
|
116
233
|
}
|
|
234
|
+
/**
|
|
235
|
+
* Error types for path processing
|
|
236
|
+
*/
|
|
117
237
|
export declare class PathError extends Error {
|
|
118
238
|
readonly path?: string | undefined;
|
|
119
239
|
constructor(message: string, path?: string | undefined);
|
|
@@ -125,6 +245,9 @@ export declare class PathValidationError extends PathError {
|
|
|
125
245
|
readonly validationErrors?: string[] | undefined;
|
|
126
246
|
constructor(message: string, path?: string, validationErrors?: string[] | undefined);
|
|
127
247
|
}
|
|
248
|
+
/**
|
|
249
|
+
* Utility type for path processing results
|
|
250
|
+
*/
|
|
128
251
|
export type PathResult<T> = {
|
|
129
252
|
success: true;
|
|
130
253
|
data: T;
|
|
@@ -132,6 +255,9 @@ export type PathResult<T> = {
|
|
|
132
255
|
success: false;
|
|
133
256
|
error: PathError;
|
|
134
257
|
};
|
|
258
|
+
/**
|
|
259
|
+
* Constants for common file extensions and patterns
|
|
260
|
+
*/
|
|
135
261
|
export declare const PATH_CONSTANTS: {
|
|
136
262
|
readonly CONTENT_EXTENSIONS: readonly [".md", ".markdown", ".mdown", ".mkd", ".mkdn", ".html", ".htm", ".xml"];
|
|
137
263
|
readonly HTML_EXTENSIONS: readonly [".html", ".htm"];
|
|
@@ -139,7 +265,7 @@ export declare const PATH_CONSTANTS: {
|
|
|
139
265
|
readonly PATH_SEPARATOR: "/";
|
|
140
266
|
readonly EXTENSION_SEPARATOR: ".";
|
|
141
267
|
readonly LANGUAGE_SEPARATOR: ".";
|
|
142
|
-
readonly SYSTEM_PATH_SEPARATOR:
|
|
268
|
+
readonly SYSTEM_PATH_SEPARATOR: "/" | "\\";
|
|
143
269
|
readonly COMPONENT_FOLDER_CONTENT: "content";
|
|
144
270
|
readonly COMPONENT_FOLDER_STATIC: "static";
|
|
145
271
|
readonly COMPONENT_FOLDER_LAYOUTS: "layouts";
|
|
@@ -149,5 +275,11 @@ export declare const PATH_CONSTANTS: {
|
|
|
149
275
|
readonly COMPONENT_FOLDER_I18N: "i18n";
|
|
150
276
|
readonly normalizePath: (path: string) => string;
|
|
151
277
|
};
|
|
278
|
+
/**
|
|
279
|
+
* Helper function type for checking if a path has an extension
|
|
280
|
+
*/
|
|
152
281
|
export type HasExtFunction = (path: string) => boolean;
|
|
282
|
+
/**
|
|
283
|
+
* Helper function type for normalizing path strings
|
|
284
|
+
*/
|
|
153
285
|
export type NormalizePathFunction = (path: string) => string;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { PathComponents, PathPositions, LowHigh, PathType } from '../type';
|
|
2
|
+
/**
|
|
3
|
+
* PathComponentsImpl implements the PathComponents interface
|
|
4
|
+
* Represents the parsed components of a path with position information
|
|
5
|
+
*/
|
|
2
6
|
export declare class PathComponentsImpl implements PathComponents {
|
|
3
7
|
readonly original: string;
|
|
4
8
|
readonly normalized: string;
|
|
@@ -8,46 +12,136 @@ export declare class PathComponentsImpl implements PathComponents {
|
|
|
8
12
|
readonly disabled: boolean;
|
|
9
13
|
readonly component?: string | undefined;
|
|
10
14
|
constructor(original: string, normalized: string, positions: PathPositions, identifiers: LowHigh[], bundleType: PathType, disabled?: boolean, component?: string | undefined);
|
|
15
|
+
/**
|
|
16
|
+
* Create a new PathComponents with updated bundle type
|
|
17
|
+
*/
|
|
11
18
|
withBundleType(bundleType: PathType): PathComponents;
|
|
19
|
+
/**
|
|
20
|
+
* Create a new PathComponents with disabled flag
|
|
21
|
+
*/
|
|
12
22
|
withDisabled(disabled: boolean): PathComponents;
|
|
23
|
+
/**
|
|
24
|
+
* Check if this path has any identifiers
|
|
25
|
+
*/
|
|
13
26
|
hasIdentifiers(): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Get the first identifier (usually the file extension)
|
|
29
|
+
*/
|
|
14
30
|
firstIdentifier(): LowHigh | null;
|
|
31
|
+
/**
|
|
32
|
+
* Get the last identifier
|
|
33
|
+
*/
|
|
15
34
|
lastIdentifier(): LowHigh | null;
|
|
35
|
+
/**
|
|
36
|
+
* Get identifier at specific index
|
|
37
|
+
*/
|
|
16
38
|
getIdentifier(index: number): LowHigh | null;
|
|
39
|
+
/**
|
|
40
|
+
* Check if this is a content component
|
|
41
|
+
*/
|
|
17
42
|
isContentComponent(component: string): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Create a copy of PathComponents
|
|
45
|
+
*/
|
|
18
46
|
clone(): PathComponents;
|
|
47
|
+
/**
|
|
48
|
+
* Convert to string representation for debugging
|
|
49
|
+
*/
|
|
19
50
|
toString(): string;
|
|
20
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* PathPositionsImpl implements the PathPositions interface
|
|
54
|
+
*/
|
|
21
55
|
export declare class PathPositionsImpl implements PathPositions {
|
|
22
56
|
containerLow: number;
|
|
23
57
|
containerHigh: number;
|
|
24
58
|
sectionHigh: number;
|
|
25
59
|
identifierLanguage: number;
|
|
26
60
|
constructor(containerLow?: number, containerHigh?: number, sectionHigh?: number, identifierLanguage?: number);
|
|
61
|
+
/**
|
|
62
|
+
* Reset all positions to default values
|
|
63
|
+
*/
|
|
27
64
|
reset(): void;
|
|
65
|
+
/**
|
|
66
|
+
* Check if container positions are set
|
|
67
|
+
*/
|
|
28
68
|
hasContainer(): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Check if section position is set
|
|
71
|
+
*/
|
|
29
72
|
hasSection(): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Check if language identifier position is set
|
|
75
|
+
*/
|
|
30
76
|
hasLanguageIdentifier(): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Create a copy of PathPositions
|
|
79
|
+
*/
|
|
31
80
|
clone(): PathPositions;
|
|
32
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* LowHighImpl implements the LowHigh interface
|
|
84
|
+
*/
|
|
33
85
|
export declare class LowHighImpl implements LowHigh {
|
|
34
86
|
readonly low: number;
|
|
35
87
|
readonly high: number;
|
|
36
88
|
constructor(low: number, high: number);
|
|
89
|
+
/**
|
|
90
|
+
* Get the length of the range
|
|
91
|
+
*/
|
|
37
92
|
length(): number;
|
|
93
|
+
/**
|
|
94
|
+
* Check if the range is empty
|
|
95
|
+
*/
|
|
38
96
|
isEmpty(): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Check if a position is within this range
|
|
99
|
+
*/
|
|
39
100
|
contains(position: number): boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Create a substring from the given string using this range
|
|
103
|
+
*/
|
|
40
104
|
substring(str: string): string;
|
|
105
|
+
/**
|
|
106
|
+
* Convert to string representation
|
|
107
|
+
*/
|
|
41
108
|
toString(): string;
|
|
42
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* Factory functions for creating path components
|
|
112
|
+
*/
|
|
43
113
|
export declare class PathComponentsFactory {
|
|
114
|
+
/**
|
|
115
|
+
* Create empty PathComponents
|
|
116
|
+
*/
|
|
44
117
|
static createEmpty(original?: string, bundleType?: PathType): PathComponents;
|
|
118
|
+
/**
|
|
119
|
+
* Create PathComponents from basic information
|
|
120
|
+
*/
|
|
45
121
|
static create(original: string, normalized?: string, bundleType?: PathType): PathComponents;
|
|
122
|
+
/**
|
|
123
|
+
* Create PathComponents with full information
|
|
124
|
+
*/
|
|
46
125
|
static createFull(original: string, normalized: string, positions: PathPositions, identifiers: LowHigh[], bundleType: PathType, disabled?: boolean): PathComponents;
|
|
47
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Utility functions for working with path components
|
|
129
|
+
*/
|
|
48
130
|
export declare class PathComponentsUtils {
|
|
131
|
+
/**
|
|
132
|
+
* Extract string value using LowHigh range
|
|
133
|
+
*/
|
|
49
134
|
static extractString(str: string, range: LowHigh): string;
|
|
135
|
+
/**
|
|
136
|
+
* Extract multiple string values using LowHigh ranges
|
|
137
|
+
*/
|
|
50
138
|
static extractStrings(str: string, ranges: LowHigh[]): string[];
|
|
139
|
+
/**
|
|
140
|
+
* Find identifier index by position
|
|
141
|
+
*/
|
|
51
142
|
static findIdentifierIndex(identifiers: LowHigh[], position: number): number;
|
|
143
|
+
/**
|
|
144
|
+
* Merge two PathComponents (useful for inheritance scenarios)
|
|
145
|
+
*/
|
|
52
146
|
static merge(base: PathComponents, override: Partial<PathComponents>): PathComponents;
|
|
53
147
|
}
|
|
@@ -1,54 +1,131 @@
|
|
|
1
1
|
import { PathProcessor, PathParserConfig, PathNormalizer, FileExtensionChecker, StringIdentity } from '../type';
|
|
2
2
|
import { Path } from '../entity/path';
|
|
3
|
+
/**
|
|
4
|
+
* PathProcessorImpl implements the PathProcessor interface
|
|
5
|
+
* Main entry point for path processing operations
|
|
6
|
+
*/
|
|
3
7
|
export declare class PathProcessorImpl implements PathProcessor {
|
|
4
8
|
private normalizer;
|
|
5
9
|
private extChecker;
|
|
6
10
|
constructor(normalizer?: PathNormalizer, extChecker?: FileExtensionChecker);
|
|
11
|
+
/**
|
|
12
|
+
* Parse a path with component information
|
|
13
|
+
*/
|
|
7
14
|
parse(component: string, path: string): Path;
|
|
15
|
+
/**
|
|
16
|
+
* Parse and return only the identity
|
|
17
|
+
*/
|
|
8
18
|
parseIdentity(component: string, path: string): StringIdentity;
|
|
19
|
+
/**
|
|
20
|
+
* Parse and return base and base name without identifier
|
|
21
|
+
*/
|
|
9
22
|
parseBaseAndBaseNameNoIdentifier(component: string, path: string): [string, string];
|
|
23
|
+
/**
|
|
24
|
+
* Create PathComponents from path information
|
|
25
|
+
*/
|
|
10
26
|
private createPathComponents;
|
|
27
|
+
/**
|
|
28
|
+
* Detect bundle type based on filename and component
|
|
29
|
+
*/
|
|
11
30
|
private detectBundleType;
|
|
31
|
+
/**
|
|
32
|
+
* Check if file is a content file based on extension
|
|
33
|
+
*/
|
|
12
34
|
private isContentFile;
|
|
35
|
+
/**
|
|
36
|
+
* Get file extension without dot
|
|
37
|
+
*/
|
|
13
38
|
private getFileExtension;
|
|
39
|
+
/**
|
|
40
|
+
* Calculate positions for different path parts
|
|
41
|
+
* Exact replica of Go version - parse from right to left
|
|
42
|
+
*/
|
|
14
43
|
private calculatePathPositions;
|
|
44
|
+
/**
|
|
45
|
+
* Extract identifiers from filename (only file extensions)
|
|
46
|
+
* Treats only the last dot-separated part as the file extension
|
|
47
|
+
* This preserves dots in the base filename (e.g., "my.article.md" -> base="my.article", ext=".md")
|
|
48
|
+
*/
|
|
15
49
|
private extractIdentifiers;
|
|
16
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* PathParsingNormalizer implements normalization rules specifically for path parsing
|
|
53
|
+
* Uses per-space-to-dash conversion for maintaining exact Hugo path behavior
|
|
54
|
+
*/
|
|
17
55
|
export declare class PathParsingNormalizer implements PathNormalizer {
|
|
18
56
|
readonly toLowerCase: boolean;
|
|
19
57
|
readonly replaceSpaces: boolean;
|
|
20
58
|
constructor(toLowerCase?: boolean, replaceSpaces?: boolean);
|
|
21
59
|
normalize(path: string): string;
|
|
22
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* BasicPathNormalizer implements Hugo's basic normalization rules
|
|
63
|
+
*/
|
|
23
64
|
export declare class BasicPathNormalizer implements PathNormalizer {
|
|
24
65
|
readonly toLowerCase: boolean;
|
|
25
66
|
readonly replaceSpaces: boolean;
|
|
26
67
|
constructor(toLowerCase?: boolean, replaceSpaces?: boolean);
|
|
27
68
|
normalize(path: string): string;
|
|
28
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* DefaultFileExtensionChecker implements basic file extension checking
|
|
72
|
+
*/
|
|
29
73
|
export declare class DefaultFileExtensionChecker implements FileExtensionChecker {
|
|
30
74
|
isContentExt(ext: string): boolean;
|
|
31
75
|
isHTML(ext: string): boolean;
|
|
32
76
|
hasExt(path: string): boolean;
|
|
33
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* ConfigurablePathNormalizer allows custom normalization rules
|
|
80
|
+
*/
|
|
34
81
|
export declare class ConfigurablePathNormalizer implements PathNormalizer {
|
|
35
82
|
private rules;
|
|
36
83
|
constructor(config?: PathParserConfig);
|
|
37
84
|
normalize(path: string): string;
|
|
85
|
+
/**
|
|
86
|
+
* Add a custom normalization rule
|
|
87
|
+
*/
|
|
38
88
|
addRule(rule: (path: string) => string): void;
|
|
89
|
+
/**
|
|
90
|
+
* Clear all rules
|
|
91
|
+
*/
|
|
39
92
|
clearRules(): void;
|
|
40
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* Path parsing utilities
|
|
96
|
+
*/
|
|
41
97
|
export declare class PathParserUtils {
|
|
98
|
+
/**
|
|
99
|
+
* Parse a path string into basic components
|
|
100
|
+
*/
|
|
42
101
|
static parseBasic(path: string): {
|
|
43
102
|
dir: string;
|
|
44
103
|
name: string;
|
|
45
104
|
ext: string;
|
|
46
105
|
nameWithoutExt: string;
|
|
47
106
|
};
|
|
107
|
+
/**
|
|
108
|
+
* Join path segments
|
|
109
|
+
*/
|
|
48
110
|
static join(...segments: string[]): string;
|
|
111
|
+
/**
|
|
112
|
+
* Normalize a path string using basic rules
|
|
113
|
+
*/
|
|
49
114
|
static normalizeBasic(path: string): string;
|
|
115
|
+
/**
|
|
116
|
+
* Check if a path represents a bundle
|
|
117
|
+
*/
|
|
50
118
|
static isBundle(path: string): boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Extract section from path
|
|
121
|
+
*/
|
|
51
122
|
static extractSection(path: string): string;
|
|
123
|
+
/**
|
|
124
|
+
* Remove extension from path
|
|
125
|
+
*/
|
|
52
126
|
static removeExtension(path: string): string;
|
|
127
|
+
/**
|
|
128
|
+
* Check if path has extension
|
|
129
|
+
*/
|
|
53
130
|
static hasExtension(path: string): boolean;
|
|
54
131
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { Publisher, PublishType, AnyPublishConfig, PublishResult, PublishProgressCallback } from '../type';
|
|
2
2
|
import { ManifestRepository } from '../repository/manifest-repository';
|
|
3
|
+
/**
|
|
4
|
+
* Publisher Aggregator (聚合根)
|
|
5
|
+
*
|
|
6
|
+
* 使用策略模式,将具体发布逻辑委托给策略实现
|
|
7
|
+
*/
|
|
3
8
|
export declare class PublisherAggregator implements Publisher {
|
|
4
9
|
private readonly projectId;
|
|
5
10
|
private readonly projectPath;
|
|
@@ -7,18 +12,39 @@ export declare class PublisherAggregator implements Publisher {
|
|
|
7
12
|
private readonly strategy;
|
|
8
13
|
private readonly manifestRepo;
|
|
9
14
|
constructor(projectId: string, projectPath: string, config: AnyPublishConfig, strategy: Publisher, manifestRepo: ManifestRepository);
|
|
15
|
+
/**
|
|
16
|
+
* Execute publish (委托给策略)
|
|
17
|
+
*/
|
|
10
18
|
publish(sourceDir: string, options?: {
|
|
11
19
|
incremental?: boolean;
|
|
12
20
|
force?: boolean;
|
|
13
21
|
onProgress?: PublishProgressCallback;
|
|
14
22
|
}): Promise<PublishResult>;
|
|
23
|
+
/**
|
|
24
|
+
* Test connection (委托给策略)
|
|
25
|
+
*/
|
|
15
26
|
testConnection(): Promise<{
|
|
16
27
|
success: boolean;
|
|
17
28
|
error?: string;
|
|
18
29
|
}>;
|
|
30
|
+
/**
|
|
31
|
+
* Get config
|
|
32
|
+
*/
|
|
19
33
|
getConfig(): AnyPublishConfig;
|
|
34
|
+
/**
|
|
35
|
+
* Get type
|
|
36
|
+
*/
|
|
20
37
|
getType(): PublishType;
|
|
38
|
+
/**
|
|
39
|
+
* Get project ID
|
|
40
|
+
*/
|
|
21
41
|
getProjectId(): string;
|
|
42
|
+
/**
|
|
43
|
+
* Get project path
|
|
44
|
+
*/
|
|
22
45
|
getProjectPath(): string;
|
|
46
|
+
/**
|
|
47
|
+
* Get remote config for manifest
|
|
48
|
+
*/
|
|
23
49
|
private getRemoteConfig;
|
|
24
50
|
}
|
|
@@ -2,12 +2,29 @@ import { PublisherAggregator } from '../entity/publisher';
|
|
|
2
2
|
import { AnyPublishConfig } from '../type';
|
|
3
3
|
import { ManifestRepository } from '../repository/manifest-repository';
|
|
4
4
|
import { HttpClient } from '../repository/http-client';
|
|
5
|
+
/**
|
|
6
|
+
* Publisher Factory
|
|
7
|
+
*
|
|
8
|
+
* 根据配置创建对应的 Publisher 聚合根
|
|
9
|
+
*/
|
|
5
10
|
export declare class PublisherFactory {
|
|
6
11
|
private readonly manifestRepo;
|
|
7
12
|
private readonly httpClient;
|
|
8
13
|
constructor(manifestRepo: ManifestRepository, httpClient: HttpClient);
|
|
14
|
+
/**
|
|
15
|
+
* Create Publisher Aggregator with appropriate strategy
|
|
16
|
+
*/
|
|
9
17
|
create(projectId: string, projectPath: string, config: AnyPublishConfig): PublisherAggregator;
|
|
18
|
+
/**
|
|
19
|
+
* Create FTP Publisher strategy
|
|
20
|
+
*/
|
|
10
21
|
private createFtpPublisher;
|
|
22
|
+
/**
|
|
23
|
+
* Create Netlify Publisher strategy
|
|
24
|
+
*/
|
|
11
25
|
private createNetlifyPublisher;
|
|
26
|
+
/**
|
|
27
|
+
* Create MDFriday Publisher strategy
|
|
28
|
+
*/
|
|
12
29
|
private createMDFridayPublisher;
|
|
13
30
|
}
|
|
@@ -1,9 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP Client Interface for Publish Domain
|
|
3
|
+
*
|
|
4
|
+
* 定义发布域需要的 HTTP 能力
|
|
5
|
+
* 由基础设施层实现
|
|
6
|
+
*/
|
|
1
7
|
export interface HttpClient {
|
|
8
|
+
/**
|
|
9
|
+
* POST JSON data
|
|
10
|
+
*/
|
|
2
11
|
postJSON(url: string, data: any, headers?: Record<string, string>): Promise<HttpResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* POST multipart form data (for file uploads)
|
|
14
|
+
*/
|
|
3
15
|
postMultipart(url: string, formData: Record<string, any>, headers?: Record<string, string>): Promise<HttpResponse>;
|
|
16
|
+
/**
|
|
17
|
+
* PUT binary data
|
|
18
|
+
*/
|
|
4
19
|
putBinary(url: string, data: Buffer | Uint8Array, headers?: Record<string, string>): Promise<HttpResponse>;
|
|
20
|
+
/**
|
|
21
|
+
* GET request
|
|
22
|
+
*/
|
|
5
23
|
get(url: string, headers?: Record<string, string>): Promise<HttpResponse>;
|
|
6
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* HTTP Response
|
|
27
|
+
*/
|
|
7
28
|
export interface HttpResponse {
|
|
8
29
|
status: number;
|
|
9
30
|
ok: boolean;
|