@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,7 +1,34 @@
|
|
|
1
1
|
import { PublishManifest } from '../value-object/publish-manifest';
|
|
2
|
+
/**
|
|
3
|
+
* Manifest Repository Interface
|
|
4
|
+
*
|
|
5
|
+
* 管理发布清单的持久化
|
|
6
|
+
*/
|
|
2
7
|
export interface ManifestRepository {
|
|
8
|
+
/**
|
|
9
|
+
* Load manifest for a project and publish method
|
|
10
|
+
* Returns null if manifest doesn't exist
|
|
11
|
+
*
|
|
12
|
+
* @param projectPath
|
|
13
|
+
* @param publishMethod
|
|
14
|
+
* @param suffix - Optional suffix for manifest file (e.g., 'free', 'custom' for mdfriday)
|
|
15
|
+
*/
|
|
3
16
|
loadManifest(projectPath: string, publishMethod: 'ftp' | 'netlify' | 'mdfriday', suffix?: string): Promise<PublishManifest | null>;
|
|
17
|
+
/**
|
|
18
|
+
* Save manifest after successful publish
|
|
19
|
+
*
|
|
20
|
+
* @param projectPath
|
|
21
|
+
* @param manifest
|
|
22
|
+
* @param suffix - Optional suffix for manifest file (e.g., 'free', 'custom' for mdfriday)
|
|
23
|
+
*/
|
|
4
24
|
saveManifest(projectPath: string, manifest: PublishManifest, suffix?: string): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Generate manifest from directory
|
|
27
|
+
* Scans all files in publicDir and creates manifest
|
|
28
|
+
*/
|
|
5
29
|
generateManifest(projectId: string, publicDir: string, publishMethod: 'ftp' | 'netlify' | 'mdfriday', remoteConfig?: any): Promise<PublishManifest>;
|
|
30
|
+
/**
|
|
31
|
+
* Delete manifest
|
|
32
|
+
*/
|
|
6
33
|
deleteManifest(projectPath: string, publishMethod: 'ftp' | 'netlify' | 'mdfriday', suffix?: string): Promise<boolean>;
|
|
7
34
|
}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Publish Domain Types
|
|
3
|
+
*
|
|
4
|
+
* 发布领域的核心类型定义
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Publish Type
|
|
8
|
+
*/
|
|
1
9
|
export type PublishType = 'ftp' | 'netlify' | 'mdfriday';
|
|
10
|
+
/**
|
|
11
|
+
* Progress Info
|
|
12
|
+
*/
|
|
2
13
|
export interface PublishProgressInfo {
|
|
3
14
|
phase: 'scanning' | 'uploading' | 'deploying' | 'complete';
|
|
4
15
|
percentage: number;
|
|
@@ -9,7 +20,13 @@ export interface PublishProgressInfo {
|
|
|
9
20
|
bytesTransferred?: number;
|
|
10
21
|
bytesTotal?: number;
|
|
11
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Progress Callback
|
|
25
|
+
*/
|
|
12
26
|
export type PublishProgressCallback = (progress: PublishProgressInfo) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Publish Result
|
|
29
|
+
*/
|
|
13
30
|
export interface PublishResult {
|
|
14
31
|
success: boolean;
|
|
15
32
|
url?: string;
|
|
@@ -18,9 +35,15 @@ export interface PublishResult {
|
|
|
18
35
|
duration: number;
|
|
19
36
|
error?: string;
|
|
20
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Base Publish Config
|
|
40
|
+
*/
|
|
21
41
|
export interface BasePublishConfig {
|
|
22
42
|
type: PublishType;
|
|
23
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* FTP Publish Config
|
|
46
|
+
*/
|
|
24
47
|
export interface FtpPublishConfig extends BasePublishConfig {
|
|
25
48
|
type: 'ftp';
|
|
26
49
|
host: string;
|
|
@@ -30,11 +53,17 @@ export interface FtpPublishConfig extends BasePublishConfig {
|
|
|
30
53
|
remotePath: string;
|
|
31
54
|
secure: boolean;
|
|
32
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Netlify Publish Config
|
|
58
|
+
*/
|
|
33
59
|
export interface NetlifyPublishConfig extends BasePublishConfig {
|
|
34
60
|
type: 'netlify';
|
|
35
61
|
accessToken: string;
|
|
36
62
|
siteId: string;
|
|
37
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* MDFriday Publish Config
|
|
66
|
+
*/
|
|
38
67
|
export interface MDFridayPublishConfig extends BasePublishConfig {
|
|
39
68
|
type: 'mdfriday';
|
|
40
69
|
apiUrl?: string;
|
|
@@ -44,17 +73,37 @@ export interface MDFridayPublishConfig extends BasePublishConfig {
|
|
|
44
73
|
accessToken?: string;
|
|
45
74
|
licenseKey?: string;
|
|
46
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Any Publish Config
|
|
78
|
+
*/
|
|
47
79
|
export type AnyPublishConfig = FtpPublishConfig | NetlifyPublishConfig | MDFridayPublishConfig;
|
|
80
|
+
/**
|
|
81
|
+
* Publisher Interface (Strategy)
|
|
82
|
+
*
|
|
83
|
+
* 定义发布策略的接口
|
|
84
|
+
*/
|
|
48
85
|
export interface Publisher {
|
|
86
|
+
/**
|
|
87
|
+
* Execute publish
|
|
88
|
+
*/
|
|
49
89
|
publish(sourceDir: string, options?: {
|
|
50
90
|
incremental?: boolean;
|
|
51
91
|
force?: boolean;
|
|
52
92
|
onProgress?: PublishProgressCallback;
|
|
53
93
|
}): Promise<PublishResult>;
|
|
94
|
+
/**
|
|
95
|
+
* Test connection (optional)
|
|
96
|
+
*/
|
|
54
97
|
testConnection?(): Promise<{
|
|
55
98
|
success: boolean;
|
|
56
99
|
error?: string;
|
|
57
100
|
}>;
|
|
101
|
+
/**
|
|
102
|
+
* Get config
|
|
103
|
+
*/
|
|
58
104
|
getConfig(): AnyPublishConfig;
|
|
105
|
+
/**
|
|
106
|
+
* Get type
|
|
107
|
+
*/
|
|
59
108
|
getType(): PublishType;
|
|
60
109
|
}
|
|
@@ -1,22 +1,52 @@
|
|
|
1
1
|
import { Publisher, PublishType, FtpPublishConfig, PublishResult, PublishProgressCallback } from '../type';
|
|
2
2
|
import { ManifestRepository } from '../repository/manifest-repository';
|
|
3
|
+
/**
|
|
4
|
+
* FTP Publisher Strategy (Value Object)
|
|
5
|
+
*
|
|
6
|
+
* FTP 发布策略实现 - 参考 Obsidian Friday 的成熟实现
|
|
7
|
+
*/
|
|
3
8
|
export declare class FtpPublisher implements Publisher {
|
|
4
9
|
private readonly config;
|
|
5
10
|
private readonly manifestRepo;
|
|
6
11
|
private readonly projectId;
|
|
7
12
|
private readonly projectPath;
|
|
8
13
|
constructor(config: FtpPublishConfig, manifestRepo: ManifestRepository, projectId: string, projectPath: string);
|
|
14
|
+
/**
|
|
15
|
+
* Execute FTP publish
|
|
16
|
+
*/
|
|
9
17
|
publish(sourceDir: string, options?: {
|
|
10
18
|
incremental?: boolean;
|
|
11
19
|
onProgress?: PublishProgressCallback;
|
|
12
20
|
}): Promise<PublishResult>;
|
|
21
|
+
/**
|
|
22
|
+
* Test FTP connection
|
|
23
|
+
*/
|
|
13
24
|
testConnection(): Promise<{
|
|
14
25
|
success: boolean;
|
|
15
26
|
error?: string;
|
|
16
27
|
}>;
|
|
28
|
+
/**
|
|
29
|
+
* Get config
|
|
30
|
+
*/
|
|
17
31
|
getConfig(): FtpPublishConfig;
|
|
32
|
+
/**
|
|
33
|
+
* Get type
|
|
34
|
+
*/
|
|
18
35
|
getType(): PublishType;
|
|
36
|
+
/**
|
|
37
|
+
* Connect with automatic fallback
|
|
38
|
+
* Try plain FTP first (faster), then FTPS if that fails
|
|
39
|
+
* 参考 Friday 的 connectWithFallback 实现
|
|
40
|
+
*/
|
|
19
41
|
private connectWithFallback;
|
|
42
|
+
/**
|
|
43
|
+
* Upload a single file with retry mechanism
|
|
44
|
+
* This handles the case where a previous upload left a 0-byte file on the server
|
|
45
|
+
* 参考 Friday 的 uploadFileWithRetry 实现
|
|
46
|
+
*/
|
|
20
47
|
private uploadFileWithRetry;
|
|
48
|
+
/**
|
|
49
|
+
* Get file lists (changed and deleted)
|
|
50
|
+
*/
|
|
21
51
|
private getFileLists;
|
|
22
52
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { Publisher, PublishType, MDFridayPublishConfig, PublishResult, PublishProgressCallback } from '../type';
|
|
2
2
|
import { ManifestRepository } from '../repository/manifest-repository';
|
|
3
3
|
import { HttpClient } from '../repository/http-client';
|
|
4
|
+
/**
|
|
5
|
+
* MDFriday Publisher Strategy (Value Object)
|
|
6
|
+
*
|
|
7
|
+
* Publishes to MDFriday platform (share/sub/custom/enterprise)
|
|
8
|
+
* Follows DDD principles like FTP and Netlify publishers
|
|
9
|
+
*/
|
|
4
10
|
export declare class MDFridayPublisher implements Publisher {
|
|
5
11
|
private readonly config;
|
|
6
12
|
private readonly manifestRepo;
|
|
@@ -8,23 +14,74 @@ export declare class MDFridayPublisher implements Publisher {
|
|
|
8
14
|
private readonly projectId;
|
|
9
15
|
private readonly projectPath;
|
|
10
16
|
constructor(config: MDFridayPublishConfig, manifestRepo: ManifestRepository, httpClient: HttpClient, projectId: string, projectPath: string);
|
|
17
|
+
/**
|
|
18
|
+
* Execute MDFriday publish
|
|
19
|
+
*/
|
|
11
20
|
publish(sourceDir: string, options?: {
|
|
12
21
|
incremental?: boolean;
|
|
13
22
|
onProgress?: PublishProgressCallback;
|
|
14
23
|
}): Promise<PublishResult>;
|
|
24
|
+
/**
|
|
25
|
+
* Test MDFriday connection
|
|
26
|
+
*/
|
|
15
27
|
testConnection(): Promise<{
|
|
16
28
|
success: boolean;
|
|
17
29
|
error?: string;
|
|
18
30
|
}>;
|
|
31
|
+
/**
|
|
32
|
+
* Get config
|
|
33
|
+
*/
|
|
19
34
|
getConfig(): MDFridayPublishConfig;
|
|
35
|
+
/**
|
|
36
|
+
* Get type
|
|
37
|
+
*/
|
|
20
38
|
getType(): PublishType;
|
|
39
|
+
/**
|
|
40
|
+
* Get file lists for incremental or full publish
|
|
41
|
+
* Similar to FtpPublisher.getFileLists()
|
|
42
|
+
*
|
|
43
|
+
* @returns changedFiles - Files that are new or modified
|
|
44
|
+
* @returns allFiles - All current files in sourceDir
|
|
45
|
+
*/
|
|
21
46
|
private getFileLists;
|
|
47
|
+
/**
|
|
48
|
+
* Create incremental ZIP containing only specified files
|
|
49
|
+
* Maintains directory structure
|
|
50
|
+
*/
|
|
22
51
|
private createIncrementalZip;
|
|
52
|
+
/**
|
|
53
|
+
* Create ZIP file from directory
|
|
54
|
+
* Similar to old Netlify implementation
|
|
55
|
+
*/
|
|
23
56
|
private createZipFromDirectory;
|
|
57
|
+
/**
|
|
58
|
+
* Upload ZIP to MDFriday
|
|
59
|
+
*
|
|
60
|
+
* POST /api/mdf/preview?type=MDFPreview
|
|
61
|
+
* FormData with: type, path, id, name, size, asset
|
|
62
|
+
*/
|
|
24
63
|
private uploadToMDFriday;
|
|
64
|
+
/**
|
|
65
|
+
* Deploy preview
|
|
66
|
+
*
|
|
67
|
+
* POST /api/mdf/preview/deploy?type=MDFPreview&id={id}
|
|
68
|
+
* FormData with: type, id, host_name, license_key
|
|
69
|
+
*/
|
|
25
70
|
private deployPreview;
|
|
71
|
+
/**
|
|
72
|
+
* Build multipart form data for upload
|
|
73
|
+
*/
|
|
26
74
|
private buildFormData;
|
|
75
|
+
/**
|
|
76
|
+
* Get API URL
|
|
77
|
+
*/
|
|
27
78
|
private getApiUrl;
|
|
79
|
+
/**
|
|
80
|
+
* Simulate upload progress
|
|
81
|
+
*/
|
|
28
82
|
private simulateUploadProgress;
|
|
83
|
+
/**
|
|
84
|
+
* Format bytes to human-readable string
|
|
85
|
+
*/
|
|
29
86
|
private formatBytes;
|
|
30
87
|
}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { Publisher, PublishType, NetlifyPublishConfig, PublishResult, PublishProgressCallback } from '../type';
|
|
2
2
|
import { ManifestRepository } from '../repository/manifest-repository';
|
|
3
3
|
import { HttpClient } from '../repository/http-client';
|
|
4
|
+
/**
|
|
5
|
+
* Netlify Publisher Strategy (Value Object)
|
|
6
|
+
*
|
|
7
|
+
* Uses Netlify's recommended Digest Deploy API with file-level uploads
|
|
8
|
+
* Follows DDD principles:
|
|
9
|
+
* - Domain logic in this class
|
|
10
|
+
* - Infrastructure services injected (ManifestRepository, HttpClient)
|
|
11
|
+
* - Similar architecture to FTP Publisher
|
|
12
|
+
*/
|
|
4
13
|
export declare class NetlifyPublisher implements Publisher {
|
|
5
14
|
private readonly config;
|
|
6
15
|
private readonly manifestRepo;
|
|
@@ -8,21 +17,67 @@ export declare class NetlifyPublisher implements Publisher {
|
|
|
8
17
|
private readonly projectId;
|
|
9
18
|
private readonly projectPath;
|
|
10
19
|
constructor(config: NetlifyPublishConfig, manifestRepo: ManifestRepository, httpClient: HttpClient, projectId: string, projectPath: string);
|
|
20
|
+
/**
|
|
21
|
+
* Execute Netlify publish using Digest Deploy API
|
|
22
|
+
*/
|
|
11
23
|
publish(sourceDir: string, options?: {
|
|
12
24
|
incremental?: boolean;
|
|
13
25
|
onProgress?: PublishProgressCallback;
|
|
14
26
|
}): Promise<PublishResult>;
|
|
27
|
+
/**
|
|
28
|
+
* Test Netlify connection
|
|
29
|
+
*/
|
|
15
30
|
testConnection(): Promise<{
|
|
16
31
|
success: boolean;
|
|
17
32
|
error?: string;
|
|
18
33
|
}>;
|
|
34
|
+
/**
|
|
35
|
+
* Get config
|
|
36
|
+
*/
|
|
19
37
|
getConfig(): NetlifyPublishConfig;
|
|
38
|
+
/**
|
|
39
|
+
* Get type
|
|
40
|
+
*/
|
|
20
41
|
getType(): PublishType;
|
|
42
|
+
/**
|
|
43
|
+
* Get file lists (changed and unchanged)
|
|
44
|
+
* Similar to FTP implementation
|
|
45
|
+
*/
|
|
21
46
|
private getFileLists;
|
|
47
|
+
/**
|
|
48
|
+
* Create deploy with file digests
|
|
49
|
+
*
|
|
50
|
+
* POST /sites/:site_id/deploys
|
|
51
|
+
* Body: { files: { "path": "sha1_hash", ... } }
|
|
52
|
+
*
|
|
53
|
+
* IMPORTANT: Netlify returns { required: ["sha1_hash1", "sha1_hash2"] }
|
|
54
|
+
* The required array contains SHA1 hashes, NOT file paths!
|
|
55
|
+
* We need to create a reverse mapping: hash → filepath
|
|
56
|
+
*/
|
|
22
57
|
private createDeployWithDigests;
|
|
58
|
+
/**
|
|
59
|
+
* Upload required files
|
|
60
|
+
*
|
|
61
|
+
* PUT /deploys/:deploy_id/files/:path
|
|
62
|
+
* Content-Type: application/octet-stream
|
|
63
|
+
* Body: file_binary_content
|
|
64
|
+
*/
|
|
23
65
|
private uploadRequiredFiles;
|
|
66
|
+
/**
|
|
67
|
+
* Upload a single file with retry mechanism
|
|
68
|
+
* Similar to FTP implementation
|
|
69
|
+
*/
|
|
24
70
|
private uploadFileWithRetry;
|
|
71
|
+
/**
|
|
72
|
+
* Wait for deployment to be ready
|
|
73
|
+
*/
|
|
25
74
|
private waitForDeployment;
|
|
75
|
+
/**
|
|
76
|
+
* Get the site URL
|
|
77
|
+
*/
|
|
26
78
|
private getSiteUrl;
|
|
79
|
+
/**
|
|
80
|
+
* Format bytes to human-readable string
|
|
81
|
+
*/
|
|
27
82
|
private formatBytes;
|
|
28
83
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FTP Configuration Value Object
|
|
3
|
+
*/
|
|
1
4
|
export interface FTPConfig {
|
|
2
5
|
host: string;
|
|
3
6
|
port: number;
|
|
@@ -6,16 +9,27 @@ export interface FTPConfig {
|
|
|
6
9
|
remotePath: string;
|
|
7
10
|
secure: boolean;
|
|
8
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Netlify Configuration Value Object
|
|
14
|
+
*/
|
|
9
15
|
export interface NetlifyConfig {
|
|
10
16
|
accessToken: string;
|
|
11
17
|
siteId: string;
|
|
12
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* MDFriday Configuration Value Object
|
|
21
|
+
*/
|
|
13
22
|
export interface MDFridayConfig {
|
|
14
23
|
enabled: boolean;
|
|
15
24
|
type: 'share' | 'sub' | 'custom' | 'enterprise';
|
|
16
25
|
autoPublish: boolean;
|
|
17
26
|
licenseKey?: string;
|
|
18
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Workspace Publish Configuration Value Object
|
|
30
|
+
*
|
|
31
|
+
* 从 workspace global config 中提取发布配置
|
|
32
|
+
*/
|
|
19
33
|
export declare class WorkspacePublishConfig {
|
|
20
34
|
readonly ftp?: FTPConfig;
|
|
21
35
|
readonly netlify?: NetlifyConfig;
|
|
@@ -25,12 +39,36 @@ export declare class WorkspacePublishConfig {
|
|
|
25
39
|
netlify?: NetlifyConfig;
|
|
26
40
|
mdfriday?: MDFridayConfig;
|
|
27
41
|
});
|
|
42
|
+
/**
|
|
43
|
+
* Check if FTP is configured
|
|
44
|
+
*/
|
|
28
45
|
hasFTP(): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Check if Netlify is configured
|
|
48
|
+
*/
|
|
29
49
|
hasNetlify(): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Check if MDFriday is configured
|
|
52
|
+
*/
|
|
30
53
|
hasMDFriday(): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Get FTP config
|
|
56
|
+
*/
|
|
31
57
|
getFTPConfig(): FTPConfig | null;
|
|
58
|
+
/**
|
|
59
|
+
* Get Netlify config
|
|
60
|
+
*/
|
|
32
61
|
getNetlifyConfig(): NetlifyConfig | null;
|
|
62
|
+
/**
|
|
63
|
+
* Get MDFriday config
|
|
64
|
+
*/
|
|
33
65
|
getMDFridayConfig(): MDFridayConfig | null;
|
|
66
|
+
/**
|
|
67
|
+
* Create from global workspace config
|
|
68
|
+
*/
|
|
34
69
|
static fromGlobalConfig(globalConfig: any): WorkspacePublishConfig;
|
|
70
|
+
/**
|
|
71
|
+
* Merge with command-line config override
|
|
72
|
+
*/
|
|
35
73
|
merge(override: Partial<FTPConfig | NetlifyConfig | MDFridayConfig>, method: 'ftp' | 'netlify' | 'mdfriday'): WorkspacePublishConfig;
|
|
36
74
|
}
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Manifest File Entry
|
|
3
|
+
* 表示已发布文件的元数据
|
|
4
|
+
*/
|
|
1
5
|
export interface ManifestFileEntry {
|
|
2
6
|
hash: string;
|
|
3
7
|
size: number;
|
|
4
8
|
mtime: number;
|
|
5
9
|
relativePath: string;
|
|
6
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Publish Manifest Value Object
|
|
13
|
+
*
|
|
14
|
+
* 发布清单,记录已发布的文件信息,用于增量发布
|
|
15
|
+
*/
|
|
7
16
|
export declare class PublishManifest {
|
|
8
17
|
private readonly projectId;
|
|
9
18
|
private readonly publishMethod;
|
|
@@ -17,18 +26,59 @@ export declare class PublishManifest {
|
|
|
17
26
|
files: Map<string, ManifestFileEntry> | Record<string, ManifestFileEntry>;
|
|
18
27
|
remoteConfig?: any;
|
|
19
28
|
});
|
|
29
|
+
/**
|
|
30
|
+
* Get project ID
|
|
31
|
+
*/
|
|
20
32
|
getProjectId(): string;
|
|
33
|
+
/**
|
|
34
|
+
* Get publish method
|
|
35
|
+
*/
|
|
21
36
|
getPublishMethod(): string;
|
|
37
|
+
/**
|
|
38
|
+
* Get last publish time
|
|
39
|
+
*/
|
|
22
40
|
getLastPublishTime(): number;
|
|
41
|
+
/**
|
|
42
|
+
* Get remote config
|
|
43
|
+
*/
|
|
23
44
|
getRemoteConfig(): any;
|
|
45
|
+
/**
|
|
46
|
+
* Get all file paths
|
|
47
|
+
*/
|
|
24
48
|
getAllFiles(): string[];
|
|
49
|
+
/**
|
|
50
|
+
* Get file entry
|
|
51
|
+
*/
|
|
25
52
|
getFile(relativePath: string): ManifestFileEntry | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Check if file exists
|
|
55
|
+
*/
|
|
26
56
|
hasFile(relativePath: string): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Get total file count
|
|
59
|
+
*/
|
|
27
60
|
getFileCount(): number;
|
|
61
|
+
/**
|
|
62
|
+
* Get changed files compared to new manifest
|
|
63
|
+
* Returns files that are new or have different hash
|
|
64
|
+
*/
|
|
28
65
|
getChangedFiles(newManifest: PublishManifest): string[];
|
|
66
|
+
/**
|
|
67
|
+
* Get deleted files compared to new manifest
|
|
68
|
+
* Returns files that exist in old manifest but not in new
|
|
69
|
+
*/
|
|
29
70
|
getDeletedFiles(newManifest: PublishManifest): string[];
|
|
71
|
+
/**
|
|
72
|
+
* Serialize to JSON
|
|
73
|
+
*/
|
|
30
74
|
toJSON(): any;
|
|
75
|
+
/**
|
|
76
|
+
* Deserialize from JSON
|
|
77
|
+
*/
|
|
31
78
|
static fromJSON(json: any): PublishManifest;
|
|
79
|
+
/**
|
|
80
|
+
* Create new manifest
|
|
81
|
+
*/
|
|
32
82
|
static create(data: {
|
|
33
83
|
projectId: string;
|
|
34
84
|
publishMethod: 'ftp' | 'netlify' | 'mdfriday';
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HttpClient for fetching remote content via HTTP/HTTPS
|
|
3
|
+
* Uses Node.js http/https modules to avoid CORS issues in Obsidian plugin environment
|
|
4
|
+
* Focuses solely on HTTP requests and returns string content
|
|
5
|
+
*/
|
|
1
6
|
export declare class HttpClient {
|
|
2
7
|
private defaultTimeout;
|
|
3
8
|
private defaultHeaders;
|
|
9
|
+
/**
|
|
10
|
+
* Fetch content from a remote URI using Node.js http/https modules
|
|
11
|
+
* @param uri - The URI to fetch content from
|
|
12
|
+
* @param options - Optional request configuration
|
|
13
|
+
* @returns Promise<string | null> - The fetched content as string or null if failed
|
|
14
|
+
*/
|
|
4
15
|
fromRemote(uri: string, options?: {
|
|
5
16
|
headers?: Record<string, string>;
|
|
6
17
|
timeout?: number;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { Resource } from '../type';
|
|
2
|
+
/**
|
|
3
|
+
* IntegrityClient provides fingerprinting and integrity generation for resources
|
|
4
|
+
* This implements the Fingerprint operation
|
|
5
|
+
*/
|
|
2
6
|
export declare class IntegrityClient {
|
|
3
7
|
fingerprint(resource: Resource, algo?: string): Promise<Resource>;
|
|
4
8
|
generateIntegrity(content: string): string;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { Resource, MinifierClient as IMinifierClient } from '../type';
|
|
2
|
+
/**
|
|
3
|
+
* MinifierClient for minification of Resource objects. Supported minifiers are:
|
|
4
|
+
* css, html, js, json, svg and xml.
|
|
5
|
+
*/
|
|
2
6
|
export declare class MinifierClient implements IMinifierClient {
|
|
3
7
|
private minifiers;
|
|
4
8
|
minifyOutput: boolean;
|
|
@@ -1,12 +1,36 @@
|
|
|
1
1
|
import { URLConfig } from '../type';
|
|
2
2
|
import { Fs, File } from '../../fs/type';
|
|
3
|
+
/**
|
|
4
|
+
* Publisher for Resources domain
|
|
5
|
+
* TypeScript equivalent of golang/internal/domain/resources/entity/publisher.go
|
|
6
|
+
*/
|
|
3
7
|
export declare class Publisher {
|
|
4
8
|
private pubFs;
|
|
5
9
|
private urlSvc;
|
|
6
10
|
constructor(pubFs: Fs, urlSvc: URLConfig);
|
|
11
|
+
/**
|
|
12
|
+
* PublishContentToTarget publishes string content to target path
|
|
13
|
+
* TypeScript equivalent of PublishContentToTarget method from Go
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* OpenPublishFileForWriting opens a file for writing in the publish directory
|
|
17
|
+
* TypeScript equivalent of OpenPublishFileForWriting method from Go
|
|
18
|
+
*/
|
|
7
19
|
openPublishFileForWriting(filename: string): Promise<FileWritable>;
|
|
20
|
+
/**
|
|
21
|
+
* Helper method to open files for writing using a MultiWriter approach
|
|
22
|
+
* TypeScript equivalent of helpers.OpenFilesForWriting function from Go
|
|
23
|
+
*/
|
|
8
24
|
private openFilesForWriting;
|
|
25
|
+
/**
|
|
26
|
+
* OpenFileForWriting opens or creates the given file. If the target directory
|
|
27
|
+
* does not exist, it gets created.
|
|
28
|
+
* TypeScript equivalent of OpenFileForWriting function from Go
|
|
29
|
+
*/
|
|
9
30
|
private openFileForWriting;
|
|
31
|
+
/**
|
|
32
|
+
* Helper to check if error is a file not found error
|
|
33
|
+
*/
|
|
10
34
|
private isFileNotFoundError;
|
|
11
35
|
}
|
|
12
36
|
import { Writable } from 'stream';
|
|
@@ -30,6 +30,10 @@ export declare class ResourceImpl implements IResource, ResourceCopier {
|
|
|
30
30
|
relPermalink(): string;
|
|
31
31
|
permalink(): string;
|
|
32
32
|
private publish;
|
|
33
|
+
/**
|
|
34
|
+
* Helper method to copy stream content to file
|
|
35
|
+
* TypeScript equivalent of golang's io.Copy functionality
|
|
36
|
+
*/
|
|
33
37
|
private copyStreamToFile;
|
|
34
38
|
targetPath(): string;
|
|
35
39
|
data(): any;
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { Resources as IResources, Resource, OpenReadSeekCloser, Workspace, MinifierClient as IMinifierClient, IntegrityClient as IIntegrityClient, TemplateClient as ITemplateClient, TemplateSvc } from '../type';
|
|
2
|
+
/**
|
|
3
|
+
* Resources aggregation root - the main entry point for all resource operations
|
|
4
|
+
* Implements the four main operations: GetResource, ExecuteAsTemplate, Minify, Fingerprint
|
|
5
|
+
*
|
|
6
|
+
* This is the main aggregation root for the Resources domain following DDD principles.
|
|
7
|
+
* All resource operations should go through this class.
|
|
8
|
+
*/
|
|
2
9
|
export declare class Resources implements IResources {
|
|
3
10
|
private cache;
|
|
4
11
|
private workspace;
|
|
@@ -12,18 +19,51 @@ export declare class Resources implements IResources {
|
|
|
12
19
|
private httpClient;
|
|
13
20
|
constructor(workspace: Workspace);
|
|
14
21
|
setTemplateSvc(templateSvc: TemplateSvc): void;
|
|
22
|
+
/**
|
|
23
|
+
* GetResource - First primary operation: get a resource by pathname
|
|
24
|
+
* Supports caching for performance optimization
|
|
25
|
+
*/
|
|
15
26
|
getResource(pathname: string): Promise<Resource | null>;
|
|
27
|
+
/**
|
|
28
|
+
* GetResourceWithOpener - Alternative way to get resource with custom opener
|
|
29
|
+
*/
|
|
16
30
|
getResourceWithOpener(pathname: string, opener: OpenReadSeekCloser): Promise<Resource | null>;
|
|
31
|
+
/**
|
|
32
|
+
* ExecuteAsTemplate - Second primary operation: execute resource as template
|
|
33
|
+
* Supports template execution with data binding
|
|
34
|
+
*/
|
|
17
35
|
executeAsTemplate(resource: Resource, targetPath: string, data: any): Promise<Resource>;
|
|
36
|
+
/**
|
|
37
|
+
* Minify - Third primary operation: minify a resource
|
|
38
|
+
* Supports CSS, JS, HTML, JSON, SVG, and XML minification
|
|
39
|
+
*/
|
|
18
40
|
minify(resource: Resource): Promise<Resource>;
|
|
41
|
+
/**
|
|
42
|
+
* Fingerprint - Fourth primary operation: add fingerprint to resource
|
|
43
|
+
* Supports integrity generation and filename fingerprinting
|
|
44
|
+
*/
|
|
19
45
|
fingerprint(resource: Resource): Promise<Resource>;
|
|
46
|
+
/**
|
|
47
|
+
* FromRemote - Fifth primary operation: get resource from remote URI
|
|
48
|
+
* Supports fetching resources from HTTP/HTTPS URLs with caching
|
|
49
|
+
*/
|
|
20
50
|
getRemote(uri: string): Promise<Resource | null>;
|
|
21
51
|
cacheKey(key: string): string;
|
|
52
|
+
/**
|
|
53
|
+
* Client accessors for external access
|
|
54
|
+
*/
|
|
22
55
|
getMinifierClient(): IMinifierClient;
|
|
23
56
|
getIntegrityClient(): IIntegrityClient;
|
|
24
57
|
setTemplateClient(client: ITemplateClient): void;
|
|
58
|
+
/**
|
|
59
|
+
* Private helper methods
|
|
60
|
+
*/
|
|
25
61
|
private buildResource;
|
|
26
62
|
private getMediaTypeFromExtension;
|
|
27
63
|
private createReadSeekCloser;
|
|
64
|
+
/**
|
|
65
|
+
* Create ReadSeekCloser from string content
|
|
66
|
+
* This follows golang's NewReadSeekerNoOpCloserFromString pattern
|
|
67
|
+
*/
|
|
28
68
|
private newReadSeekerNoOpCloserFromString;
|
|
29
69
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { Resource, TemplateClient as ITemplateClient, TemplateSvc } from '../type';
|
|
2
|
+
/**
|
|
3
|
+
* TemplateClient provides template execution functionality for resources
|
|
4
|
+
* This implements the ExecuteAsTemplate operation following golang version
|
|
5
|
+
*/
|
|
2
6
|
export declare class TemplateClient implements ITemplateClient {
|
|
3
7
|
private templateExecutor;
|
|
4
8
|
constructor(templateExecutor: TemplateSvc);
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { Resources } from '../entity/resources';
|
|
2
2
|
import { Workspace } from '../type';
|
|
3
|
+
/**
|
|
4
|
+
* Factory function to create Resources aggregation root
|
|
5
|
+
* This provides the main entry point for the resources domain
|
|
6
|
+
*/
|
|
3
7
|
export declare function createResources(workspace: Workspace): Resources;
|