@walde.ai/walde-sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +47 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/sdk/contracts/frontend-content/v1/content-format-v1.d.ts +8 -0
- package/dist/sdk/contracts/frontend-content/v1/content-format-v1.d.ts.map +1 -0
- package/dist/sdk/contracts/frontend-content/v1/content-format-v1.js +2 -0
- package/dist/sdk/contracts/frontend-content/v1/content-format-v1.js.map +1 -0
- package/dist/sdk/contracts/frontend-content/v1/content-part-v1.d.ts +8 -0
- package/dist/sdk/contracts/frontend-content/v1/content-part-v1.d.ts.map +1 -0
- package/dist/sdk/contracts/frontend-content/v1/content-part-v1.js +2 -0
- package/dist/sdk/contracts/frontend-content/v1/content-part-v1.js.map +1 -0
- package/dist/sdk/contracts/frontend-content/v1/frontend-content-v1.d.ts +13 -0
- package/dist/sdk/contracts/frontend-content/v1/frontend-content-v1.d.ts.map +1 -0
- package/dist/sdk/contracts/frontend-content/v1/frontend-content-v1.js +2 -0
- package/dist/sdk/contracts/frontend-content/v1/frontend-content-v1.js.map +1 -0
- package/dist/sdk/contracts/manifest/v1/manifest-content-v1.d.ts +12 -0
- package/dist/sdk/contracts/manifest/v1/manifest-content-v1.d.ts.map +1 -0
- package/dist/sdk/contracts/manifest/v1/manifest-content-v1.js +2 -0
- package/dist/sdk/contracts/manifest/v1/manifest-content-v1.js.map +1 -0
- package/dist/sdk/contracts/manifest/v1/manifest-v1.d.ts +9 -0
- package/dist/sdk/contracts/manifest/v1/manifest-v1.d.ts.map +1 -0
- package/dist/sdk/contracts/manifest/v1/manifest-v1.js +2 -0
- package/dist/sdk/contracts/manifest/v1/manifest-v1.js.map +1 -0
- package/dist/sdk/domain/entities/content-format.d.ts +9 -0
- package/dist/sdk/domain/entities/content-format.d.ts.map +1 -0
- package/dist/sdk/domain/entities/content-format.js +12 -0
- package/dist/sdk/domain/entities/content-format.js.map +1 -0
- package/dist/sdk/domain/entities/content-part.d.ts +26 -0
- package/dist/sdk/domain/entities/content-part.d.ts.map +1 -0
- package/dist/sdk/domain/entities/content-part.js +36 -0
- package/dist/sdk/domain/entities/content-part.js.map +1 -0
- package/dist/sdk/domain/entities/content-state.d.ts +8 -0
- package/dist/sdk/domain/entities/content-state.d.ts.map +1 -0
- package/dist/sdk/domain/entities/content-state.js +9 -0
- package/dist/sdk/domain/entities/content-state.js.map +1 -0
- package/dist/sdk/domain/entities/content-version.d.ts +27 -0
- package/dist/sdk/domain/entities/content-version.d.ts.map +1 -0
- package/dist/sdk/domain/entities/content-version.js +37 -0
- package/dist/sdk/domain/entities/content-version.js.map +1 -0
- package/dist/sdk/domain/entities/content.d.ts +21 -0
- package/dist/sdk/domain/entities/content.d.ts.map +1 -0
- package/dist/sdk/domain/entities/content.js +26 -0
- package/dist/sdk/domain/entities/content.js.map +1 -0
- package/dist/sdk/domain/entities/credentials.d.ts +14 -0
- package/dist/sdk/domain/entities/credentials.d.ts.map +1 -0
- package/dist/sdk/domain/entities/credentials.js +20 -0
- package/dist/sdk/domain/entities/credentials.js.map +1 -0
- package/dist/sdk/domain/entities/dns-entry.d.ts +10 -0
- package/dist/sdk/domain/entities/dns-entry.d.ts.map +1 -0
- package/dist/sdk/domain/entities/dns-entry.js +14 -0
- package/dist/sdk/domain/entities/dns-entry.js.map +1 -0
- package/dist/sdk/domain/entities/file.d.ts +14 -0
- package/dist/sdk/domain/entities/file.d.ts.map +1 -0
- package/dist/sdk/domain/entities/file.js +17 -0
- package/dist/sdk/domain/entities/file.js.map +1 -0
- package/dist/sdk/domain/entities/format-part.d.ts +16 -0
- package/dist/sdk/domain/entities/format-part.d.ts.map +1 -0
- package/dist/sdk/domain/entities/format-part.js +2 -0
- package/dist/sdk/domain/entities/format-part.js.map +1 -0
- package/dist/sdk/domain/entities/format.d.ts +14 -0
- package/dist/sdk/domain/entities/format.d.ts.map +1 -0
- package/dist/sdk/domain/entities/format.js +23 -0
- package/dist/sdk/domain/entities/format.js.map +1 -0
- package/dist/sdk/domain/entities/frontend-content.d.ts +13 -0
- package/dist/sdk/domain/entities/frontend-content.d.ts.map +1 -0
- package/dist/sdk/domain/entities/frontend-content.js +16 -0
- package/dist/sdk/domain/entities/frontend-content.js.map +1 -0
- package/dist/sdk/domain/entities/key-value-part.d.ts +20 -0
- package/dist/sdk/domain/entities/key-value-part.d.ts.map +1 -0
- package/dist/sdk/domain/entities/key-value-part.js +31 -0
- package/dist/sdk/domain/entities/key-value-part.js.map +1 -0
- package/dist/sdk/domain/entities/manifest-content.d.ts +12 -0
- package/dist/sdk/domain/entities/manifest-content.d.ts.map +1 -0
- package/dist/sdk/domain/entities/manifest-content.js +18 -0
- package/dist/sdk/domain/entities/manifest-content.js.map +1 -0
- package/dist/sdk/domain/entities/manifest.d.ts +9 -0
- package/dist/sdk/domain/entities/manifest.d.ts.map +1 -0
- package/dist/sdk/domain/entities/manifest.js +10 -0
- package/dist/sdk/domain/entities/manifest.js.map +1 -0
- package/dist/sdk/domain/entities/markdown-part.d.ts +14 -0
- package/dist/sdk/domain/entities/markdown-part.d.ts.map +1 -0
- package/dist/sdk/domain/entities/markdown-part.js +15 -0
- package/dist/sdk/domain/entities/markdown-part.js.map +1 -0
- package/dist/sdk/domain/entities/site.d.ts +16 -0
- package/dist/sdk/domain/entities/site.d.ts.map +1 -0
- package/dist/sdk/domain/entities/site.js +21 -0
- package/dist/sdk/domain/entities/site.js.map +1 -0
- package/dist/sdk/domain/entities/string-part.d.ts +14 -0
- package/dist/sdk/domain/entities/string-part.d.ts.map +1 -0
- package/dist/sdk/domain/entities/string-part.js +15 -0
- package/dist/sdk/domain/entities/string-part.js.map +1 -0
- package/dist/sdk/domain/entities/ui-upload-credentials.d.ts +22 -0
- package/dist/sdk/domain/entities/ui-upload-credentials.d.ts.map +1 -0
- package/dist/sdk/domain/entities/ui-upload-credentials.js +38 -0
- package/dist/sdk/domain/entities/ui-upload-credentials.js.map +1 -0
- package/dist/sdk/domain/entities/walde-admin-config.d.ts +51 -0
- package/dist/sdk/domain/entities/walde-admin-config.d.ts.map +1 -0
- package/dist/sdk/domain/entities/walde-admin-config.js +69 -0
- package/dist/sdk/domain/entities/walde-admin-config.js.map +1 -0
- package/dist/sdk/domain/entities/workspace-config.d.ts +20 -0
- package/dist/sdk/domain/entities/workspace-config.d.ts.map +1 -0
- package/dist/sdk/domain/entities/workspace-config.js +17 -0
- package/dist/sdk/domain/entities/workspace-config.js.map +1 -0
- package/dist/sdk/domain/errors/index.d.ts +11 -0
- package/dist/sdk/domain/errors/index.d.ts.map +1 -0
- package/dist/sdk/domain/errors/index.js +11 -0
- package/dist/sdk/domain/errors/index.js.map +1 -0
- package/dist/sdk/domain/errors/walde-authentication-error.d.ts +21 -0
- package/dist/sdk/domain/errors/walde-authentication-error.d.ts.map +1 -0
- package/dist/sdk/domain/errors/walde-authentication-error.js +23 -0
- package/dist/sdk/domain/errors/walde-authentication-error.js.map +1 -0
- package/dist/sdk/domain/errors/walde-configuration-error.d.ts +21 -0
- package/dist/sdk/domain/errors/walde-configuration-error.d.ts.map +1 -0
- package/dist/sdk/domain/errors/walde-configuration-error.js +23 -0
- package/dist/sdk/domain/errors/walde-configuration-error.js.map +1 -0
- package/dist/sdk/domain/errors/walde-error.d.ts +9 -0
- package/dist/sdk/domain/errors/walde-error.d.ts.map +1 -0
- package/dist/sdk/domain/errors/walde-error.js +12 -0
- package/dist/sdk/domain/errors/walde-error.js.map +1 -0
- package/dist/sdk/domain/errors/walde-local-error.d.ts +22 -0
- package/dist/sdk/domain/errors/walde-local-error.d.ts.map +1 -0
- package/dist/sdk/domain/errors/walde-local-error.js +24 -0
- package/dist/sdk/domain/errors/walde-local-error.js.map +1 -0
- package/dist/sdk/domain/errors/walde-network-error.d.ts +21 -0
- package/dist/sdk/domain/errors/walde-network-error.d.ts.map +1 -0
- package/dist/sdk/domain/errors/walde-network-error.js +23 -0
- package/dist/sdk/domain/errors/walde-network-error.js.map +1 -0
- package/dist/sdk/domain/errors/walde-system-error.d.ts +10 -0
- package/dist/sdk/domain/errors/walde-system-error.d.ts.map +1 -0
- package/dist/sdk/domain/errors/walde-system-error.js +13 -0
- package/dist/sdk/domain/errors/walde-system-error.js.map +1 -0
- package/dist/sdk/domain/errors/walde-unexpected-error.d.ts +21 -0
- package/dist/sdk/domain/errors/walde-unexpected-error.d.ts.map +1 -0
- package/dist/sdk/domain/errors/walde-unexpected-error.js +23 -0
- package/dist/sdk/domain/errors/walde-unexpected-error.js.map +1 -0
- package/dist/sdk/domain/errors/walde-usage-error.d.ts +21 -0
- package/dist/sdk/domain/errors/walde-usage-error.d.ts.map +1 -0
- package/dist/sdk/domain/errors/walde-usage-error.js +23 -0
- package/dist/sdk/domain/errors/walde-usage-error.js.map +1 -0
- package/dist/sdk/domain/errors/walde-user-error.d.ts +9 -0
- package/dist/sdk/domain/errors/walde-user-error.d.ts.map +1 -0
- package/dist/sdk/domain/errors/walde-user-error.js +11 -0
- package/dist/sdk/domain/errors/walde-user-error.js.map +1 -0
- package/dist/sdk/domain/errors/walde-validation-error.d.ts +20 -0
- package/dist/sdk/domain/errors/walde-validation-error.d.ts.map +1 -0
- package/dist/sdk/domain/errors/walde-validation-error.js +22 -0
- package/dist/sdk/domain/errors/walde-validation-error.js.map +1 -0
- package/dist/sdk/domain/interactors/api-call.d.ts +19 -0
- package/dist/sdk/domain/interactors/api-call.d.ts.map +1 -0
- package/dist/sdk/domain/interactors/api-call.js +31 -0
- package/dist/sdk/domain/interactors/api-call.js.map +1 -0
- package/dist/sdk/domain/interactors/associate-site-certificates.d.ts +11 -0
- package/dist/sdk/domain/interactors/associate-site-certificates.d.ts.map +1 -0
- package/dist/sdk/domain/interactors/associate-site-certificates.js +20 -0
- package/dist/sdk/domain/interactors/associate-site-certificates.js.map +1 -0
- package/dist/sdk/domain/interactors/content/list-contents.d.ts +16 -0
- package/dist/sdk/domain/interactors/content/list-contents.d.ts.map +1 -0
- package/dist/sdk/domain/interactors/content/list-contents.js +18 -0
- package/dist/sdk/domain/interactors/content/list-contents.js.map +1 -0
- package/dist/sdk/domain/interactors/content/parse-content-file.d.ts +19 -0
- package/dist/sdk/domain/interactors/content/parse-content-file.d.ts.map +1 -0
- package/dist/sdk/domain/interactors/content/parse-content-file.js +68 -0
- package/dist/sdk/domain/interactors/content/parse-content-file.js.map +1 -0
- package/dist/sdk/domain/interactors/content/push-content.d.ts +21 -0
- package/dist/sdk/domain/interactors/content/push-content.d.ts.map +1 -0
- package/dist/sdk/domain/interactors/content/push-content.js +31 -0
- package/dist/sdk/domain/interactors/content/push-content.js.map +1 -0
- package/dist/sdk/domain/interactors/create-site.d.ts +9 -0
- package/dist/sdk/domain/interactors/create-site.d.ts.map +1 -0
- package/dist/sdk/domain/interactors/create-site.js +19 -0
- package/dist/sdk/domain/interactors/create-site.js.map +1 -0
- package/dist/sdk/domain/interactors/get-credentials.d.ts +14 -0
- package/dist/sdk/domain/interactors/get-credentials.d.ts.map +1 -0
- package/dist/sdk/domain/interactors/get-credentials.js +16 -0
- package/dist/sdk/domain/interactors/get-credentials.js.map +1 -0
- package/dist/sdk/domain/interactors/get-token.d.ts +13 -0
- package/dist/sdk/domain/interactors/get-token.d.ts.map +1 -0
- package/dist/sdk/domain/interactors/get-token.js +21 -0
- package/dist/sdk/domain/interactors/get-token.js.map +1 -0
- package/dist/sdk/domain/interactors/list-sites.d.ts +9 -0
- package/dist/sdk/domain/interactors/list-sites.d.ts.map +1 -0
- package/dist/sdk/domain/interactors/list-sites.js +17 -0
- package/dist/sdk/domain/interactors/list-sites.js.map +1 -0
- package/dist/sdk/domain/interactors/refresh-credentials.d.ts +16 -0
- package/dist/sdk/domain/interactors/refresh-credentials.d.ts.map +1 -0
- package/dist/sdk/domain/interactors/refresh-credentials.js +25 -0
- package/dist/sdk/domain/interactors/refresh-credentials.js.map +1 -0
- package/dist/sdk/domain/interactors/ui/upload-ui-from-folder.d.ts +24 -0
- package/dist/sdk/domain/interactors/ui/upload-ui-from-folder.d.ts.map +1 -0
- package/dist/sdk/domain/interactors/ui/upload-ui-from-folder.js +58 -0
- package/dist/sdk/domain/interactors/ui/upload-ui-from-folder.js.map +1 -0
- package/dist/sdk/domain/interactors/update-site.d.ts +9 -0
- package/dist/sdk/domain/interactors/update-site.d.ts.map +1 -0
- package/dist/sdk/domain/interactors/update-site.js +19 -0
- package/dist/sdk/domain/interactors/update-site.js.map +1 -0
- package/dist/sdk/domain/interactors/workspace/init-workspace.d.ts +19 -0
- package/dist/sdk/domain/interactors/workspace/init-workspace.d.ts.map +1 -0
- package/dist/sdk/domain/interactors/workspace/init-workspace.js +26 -0
- package/dist/sdk/domain/interactors/workspace/init-workspace.js.map +1 -0
- package/dist/sdk/domain/ports/backend/backend-client.d.ts +7 -0
- package/dist/sdk/domain/ports/backend/backend-client.d.ts.map +1 -0
- package/dist/sdk/domain/ports/backend/backend-client.js +2 -0
- package/dist/sdk/domain/ports/backend/backend-client.js.map +1 -0
- package/dist/sdk/domain/ports/in/content-file-reader.d.ts +15 -0
- package/dist/sdk/domain/ports/in/content-file-reader.d.ts.map +1 -0
- package/dist/sdk/domain/ports/in/content-file-reader.js +2 -0
- package/dist/sdk/domain/ports/in/content-file-reader.js.map +1 -0
- package/dist/sdk/domain/ports/in/token-provider.d.ts +10 -0
- package/dist/sdk/domain/ports/in/token-provider.d.ts.map +1 -0
- package/dist/sdk/domain/ports/in/token-provider.js +2 -0
- package/dist/sdk/domain/ports/in/token-provider.js.map +1 -0
- package/dist/sdk/domain/ports/out/backend-communication.d.ts +22 -0
- package/dist/sdk/domain/ports/out/backend-communication.d.ts.map +1 -0
- package/dist/sdk/domain/ports/out/backend-communication.js +2 -0
- package/dist/sdk/domain/ports/out/backend-communication.js.map +1 -0
- package/dist/sdk/domain/ports/out/content-file-writer.d.ts +12 -0
- package/dist/sdk/domain/ports/out/content-file-writer.d.ts.map +1 -0
- package/dist/sdk/domain/ports/out/content-file-writer.js +2 -0
- package/dist/sdk/domain/ports/out/content-file-writer.js.map +1 -0
- package/dist/sdk/domain/ports/out/content-repo.d.ts +27 -0
- package/dist/sdk/domain/ports/out/content-repo.d.ts.map +1 -0
- package/dist/sdk/domain/ports/out/content-repo.js +2 -0
- package/dist/sdk/domain/ports/out/content-repo.js.map +1 -0
- package/dist/sdk/domain/ports/out/credentials-provider.d.ts +15 -0
- package/dist/sdk/domain/ports/out/credentials-provider.d.ts.map +1 -0
- package/dist/sdk/domain/ports/out/credentials-provider.js +2 -0
- package/dist/sdk/domain/ports/out/credentials-provider.js.map +1 -0
- package/dist/sdk/domain/ports/out/file-system-reader.d.ts +13 -0
- package/dist/sdk/domain/ports/out/file-system-reader.d.ts.map +1 -0
- package/dist/sdk/domain/ports/out/file-system-reader.js +2 -0
- package/dist/sdk/domain/ports/out/file-system-reader.js.map +1 -0
- package/dist/sdk/domain/ports/out/remote-files-repo.d.ts +20 -0
- package/dist/sdk/domain/ports/out/remote-files-repo.d.ts.map +1 -0
- package/dist/sdk/domain/ports/out/remote-files-repo.js +2 -0
- package/dist/sdk/domain/ports/out/remote-files-repo.js.map +1 -0
- package/dist/sdk/domain/ports/out/site-repository.d.ts +35 -0
- package/dist/sdk/domain/ports/out/site-repository.d.ts.map +1 -0
- package/dist/sdk/domain/ports/out/site-repository.js +2 -0
- package/dist/sdk/domain/ports/out/site-repository.js.map +1 -0
- package/dist/sdk/domain/ports/out/token-refresh-provider.d.ts +11 -0
- package/dist/sdk/domain/ports/out/token-refresh-provider.d.ts.map +1 -0
- package/dist/sdk/domain/ports/out/token-refresh-provider.js +2 -0
- package/dist/sdk/domain/ports/out/token-refresh-provider.js.map +1 -0
- package/dist/sdk/domain/ports/out/ui-upload-credentials-repo.d.ts +11 -0
- package/dist/sdk/domain/ports/out/ui-upload-credentials-repo.d.ts.map +1 -0
- package/dist/sdk/domain/ports/out/ui-upload-credentials-repo.js +2 -0
- package/dist/sdk/domain/ports/out/ui-upload-credentials-repo.js.map +1 -0
- package/dist/sdk/domain/ports/out/upload-progress-callback.d.ts +26 -0
- package/dist/sdk/domain/ports/out/upload-progress-callback.d.ts.map +1 -0
- package/dist/sdk/domain/ports/out/upload-progress-callback.js +2 -0
- package/dist/sdk/domain/ports/out/upload-progress-callback.js.map +1 -0
- package/dist/sdk/domain/ports/out/workspace-config-repo.d.ts +25 -0
- package/dist/sdk/domain/ports/out/workspace-config-repo.d.ts.map +1 -0
- package/dist/sdk/domain/ports/out/workspace-config-repo.js +2 -0
- package/dist/sdk/domain/ports/out/workspace-config-repo.js.map +1 -0
- package/dist/sdk/index.d.ts +35 -0
- package/dist/sdk/index.d.ts.map +1 -0
- package/dist/sdk/index.js +35 -0
- package/dist/sdk/index.js.map +1 -0
- package/dist/sdk/infra/adapters/api-client.d.ts +58 -0
- package/dist/sdk/infra/adapters/api-client.d.ts.map +1 -0
- package/dist/sdk/infra/adapters/api-client.js +73 -0
- package/dist/sdk/infra/adapters/api-client.js.map +1 -0
- package/dist/sdk/infra/adapters/base-http-client.d.ts +25 -0
- package/dist/sdk/infra/adapters/base-http-client.d.ts.map +1 -0
- package/dist/sdk/infra/adapters/base-http-client.js +110 -0
- package/dist/sdk/infra/adapters/base-http-client.js.map +1 -0
- package/dist/sdk/infra/adapters/cognito-token-refresh-provider.d.ts +16 -0
- package/dist/sdk/infra/adapters/cognito-token-refresh-provider.d.ts.map +1 -0
- package/dist/sdk/infra/adapters/cognito-token-refresh-provider.js +46 -0
- package/dist/sdk/infra/adapters/cognito-token-refresh-provider.js.map +1 -0
- package/dist/sdk/infra/adapters/default-http-client.d.ts +38 -0
- package/dist/sdk/infra/adapters/default-http-client.d.ts.map +1 -0
- package/dist/sdk/infra/adapters/default-http-client.js +133 -0
- package/dist/sdk/infra/adapters/default-http-client.js.map +1 -0
- package/dist/sdk/infra/adapters/default-token-provider.d.ts +14 -0
- package/dist/sdk/infra/adapters/default-token-provider.d.ts.map +1 -0
- package/dist/sdk/infra/adapters/default-token-provider.js +23 -0
- package/dist/sdk/infra/adapters/default-token-provider.js.map +1 -0
- package/dist/sdk/infra/adapters/filesystem/file-content-reader.d.ts +16 -0
- package/dist/sdk/infra/adapters/filesystem/file-content-reader.d.ts.map +1 -0
- package/dist/sdk/infra/adapters/filesystem/file-content-reader.js +27 -0
- package/dist/sdk/infra/adapters/filesystem/file-content-reader.js.map +1 -0
- package/dist/sdk/infra/adapters/filesystem/file-content-writer.d.ts +13 -0
- package/dist/sdk/infra/adapters/filesystem/file-content-writer.d.ts.map +1 -0
- package/dist/sdk/infra/adapters/filesystem/file-content-writer.js +36 -0
- package/dist/sdk/infra/adapters/filesystem/file-content-writer.js.map +1 -0
- package/dist/sdk/infra/adapters/filesystem/file-system-local-files-reader.d.ts +21 -0
- package/dist/sdk/infra/adapters/filesystem/file-system-local-files-reader.d.ts.map +1 -0
- package/dist/sdk/infra/adapters/filesystem/file-system-local-files-reader.js +52 -0
- package/dist/sdk/infra/adapters/filesystem/file-system-local-files-reader.js.map +1 -0
- package/dist/sdk/infra/adapters/frontend-http-client.d.ts +12 -0
- package/dist/sdk/infra/adapters/frontend-http-client.d.ts.map +1 -0
- package/dist/sdk/infra/adapters/frontend-http-client.js +18 -0
- package/dist/sdk/infra/adapters/frontend-http-client.js.map +1 -0
- package/dist/sdk/infra/adapters/http/http-content-repo.d.ts +33 -0
- package/dist/sdk/infra/adapters/http/http-content-repo.d.ts.map +1 -0
- package/dist/sdk/infra/adapters/http/http-content-repo.js +85 -0
- package/dist/sdk/infra/adapters/http/http-content-repo.js.map +1 -0
- package/dist/sdk/infra/adapters/repositories/aws-s3-files-repo.d.ts +22 -0
- package/dist/sdk/infra/adapters/repositories/aws-s3-files-repo.d.ts.map +1 -0
- package/dist/sdk/infra/adapters/repositories/aws-s3-files-repo.js +73 -0
- package/dist/sdk/infra/adapters/repositories/aws-s3-files-repo.js.map +1 -0
- package/dist/sdk/infra/adapters/repositories/credentials-file-repo.d.ts +18 -0
- package/dist/sdk/infra/adapters/repositories/credentials-file-repo.d.ts.map +1 -0
- package/dist/sdk/infra/adapters/repositories/credentials-file-repo.js +41 -0
- package/dist/sdk/infra/adapters/repositories/credentials-file-repo.js.map +1 -0
- package/dist/sdk/infra/adapters/repositories/default-walde-admin-config.d.ts +11 -0
- package/dist/sdk/infra/adapters/repositories/default-walde-admin-config.d.ts.map +1 -0
- package/dist/sdk/infra/adapters/repositories/default-walde-admin-config.js +20 -0
- package/dist/sdk/infra/adapters/repositories/default-walde-admin-config.js.map +1 -0
- package/dist/sdk/infra/adapters/repositories/file-walde-admin-config.d.ts +11 -0
- package/dist/sdk/infra/adapters/repositories/file-walde-admin-config.d.ts.map +1 -0
- package/dist/sdk/infra/adapters/repositories/file-walde-admin-config.js +38 -0
- package/dist/sdk/infra/adapters/repositories/file-walde-admin-config.js.map +1 -0
- package/dist/sdk/infra/adapters/repositories/file-workspace-config-repo.d.ts +26 -0
- package/dist/sdk/infra/adapters/repositories/file-workspace-config-repo.d.ts.map +1 -0
- package/dist/sdk/infra/adapters/repositories/file-workspace-config-repo.js +86 -0
- package/dist/sdk/infra/adapters/repositories/file-workspace-config-repo.js.map +1 -0
- package/dist/sdk/infra/adapters/repositories/http-site-repo.d.ts +15 -0
- package/dist/sdk/infra/adapters/repositories/http-site-repo.d.ts.map +1 -0
- package/dist/sdk/infra/adapters/repositories/http-site-repo.js +51 -0
- package/dist/sdk/infra/adapters/repositories/http-site-repo.js.map +1 -0
- package/dist/sdk/infra/adapters/repositories/static-walde-admin-config.d.ts +9 -0
- package/dist/sdk/infra/adapters/repositories/static-walde-admin-config.d.ts.map +1 -0
- package/dist/sdk/infra/adapters/repositories/static-walde-admin-config.js +13 -0
- package/dist/sdk/infra/adapters/repositories/static-walde-admin-config.js.map +1 -0
- package/dist/sdk/infra/adapters/repositories/writer-api-aws-ui-upload-credentials-repo.d.ts +15 -0
- package/dist/sdk/infra/adapters/repositories/writer-api-aws-ui-upload-credentials-repo.d.ts.map +1 -0
- package/dist/sdk/infra/adapters/repositories/writer-api-aws-ui-upload-credentials-repo.js +25 -0
- package/dist/sdk/infra/adapters/repositories/writer-api-aws-ui-upload-credentials-repo.js.map +1 -0
- package/dist/sdk/infra/backend/walde-client.d.ts +13 -0
- package/dist/sdk/infra/backend/walde-client.d.ts.map +1 -0
- package/dist/sdk/infra/backend/walde-client.js +29 -0
- package/dist/sdk/infra/backend/walde-client.js.map +1 -0
- package/dist/sdk/infra/factories/s3-files-repo-factory.d.ts +9 -0
- package/dist/sdk/infra/factories/s3-files-repo-factory.d.ts.map +1 -0
- package/dist/sdk/infra/factories/s3-files-repo-factory.js +10 -0
- package/dist/sdk/infra/factories/s3-files-repo-factory.js.map +1 -0
- package/dist/sdk/infra/factories/walde-admin-config-factory.d.ts +24 -0
- package/dist/sdk/infra/factories/walde-admin-config-factory.d.ts.map +1 -0
- package/dist/sdk/infra/factories/walde-admin-config-factory.js +99 -0
- package/dist/sdk/infra/factories/walde-admin-config-factory.js.map +1 -0
- package/dist/sdk/infra/factories/walde-admin-factory.d.ts +17 -0
- package/dist/sdk/infra/factories/walde-admin-factory.d.ts.map +1 -0
- package/dist/sdk/infra/factories/walde-admin-factory.js +42 -0
- package/dist/sdk/infra/factories/walde-admin-factory.js.map +1 -0
- package/dist/sdk/infra/factories/walde-factory.d.ts +13 -0
- package/dist/sdk/infra/factories/walde-factory.d.ts.map +1 -0
- package/dist/sdk/infra/factories/walde-factory.js +19 -0
- package/dist/sdk/infra/factories/walde-factory.js.map +1 -0
- package/dist/sdk/infra/futures/api-future.d.ts +15 -0
- package/dist/sdk/infra/futures/api-future.d.ts.map +1 -0
- package/dist/sdk/infra/futures/api-future.js +28 -0
- package/dist/sdk/infra/futures/api-future.js.map +1 -0
- package/dist/sdk/infra/futures/content-future.d.ts +26 -0
- package/dist/sdk/infra/futures/content-future.d.ts.map +1 -0
- package/dist/sdk/infra/futures/content-future.js +63 -0
- package/dist/sdk/infra/futures/content-future.js.map +1 -0
- package/dist/sdk/infra/futures/content-item-future.d.ts +25 -0
- package/dist/sdk/infra/futures/content-item-future.d.ts.map +1 -0
- package/dist/sdk/infra/futures/content-item-future.js +47 -0
- package/dist/sdk/infra/futures/content-item-future.js.map +1 -0
- package/dist/sdk/infra/futures/content-iterator.d.ts +44 -0
- package/dist/sdk/infra/futures/content-iterator.d.ts.map +1 -0
- package/dist/sdk/infra/futures/content-iterator.js +123 -0
- package/dist/sdk/infra/futures/content-iterator.js.map +1 -0
- package/dist/sdk/infra/futures/content-list-future.d.ts +16 -0
- package/dist/sdk/infra/futures/content-list-future.d.ts.map +1 -0
- package/dist/sdk/infra/futures/content-list-future.js +19 -0
- package/dist/sdk/infra/futures/content-list-future.js.map +1 -0
- package/dist/sdk/infra/futures/contents-future.d.ts +23 -0
- package/dist/sdk/infra/futures/contents-future.d.ts.map +1 -0
- package/dist/sdk/infra/futures/contents-future.js +33 -0
- package/dist/sdk/infra/futures/contents-future.js.map +1 -0
- package/dist/sdk/infra/futures/credentials-future.d.ts +14 -0
- package/dist/sdk/infra/futures/credentials-future.d.ts.map +1 -0
- package/dist/sdk/infra/futures/credentials-future.js +67 -0
- package/dist/sdk/infra/futures/credentials-future.js.map +1 -0
- package/dist/sdk/infra/futures/frontend-contents-future.d.ts +37 -0
- package/dist/sdk/infra/futures/frontend-contents-future.d.ts.map +1 -0
- package/dist/sdk/infra/futures/frontend-contents-future.js +62 -0
- package/dist/sdk/infra/futures/frontend-contents-future.js.map +1 -0
- package/dist/sdk/infra/futures/manifest-future.d.ts +18 -0
- package/dist/sdk/infra/futures/manifest-future.d.ts.map +1 -0
- package/dist/sdk/infra/futures/manifest-future.js +28 -0
- package/dist/sdk/infra/futures/manifest-future.js.map +1 -0
- package/dist/sdk/infra/futures/site-future.d.ts +41 -0
- package/dist/sdk/infra/futures/site-future.d.ts.map +1 -0
- package/dist/sdk/infra/futures/site-future.js +113 -0
- package/dist/sdk/infra/futures/site-future.js.map +1 -0
- package/dist/sdk/infra/futures/sites-future.d.ts +19 -0
- package/dist/sdk/infra/futures/sites-future.d.ts.map +1 -0
- package/dist/sdk/infra/futures/sites-future.js +35 -0
- package/dist/sdk/infra/futures/sites-future.js.map +1 -0
- package/dist/sdk/infra/futures/ui-future.d.ts +25 -0
- package/dist/sdk/infra/futures/ui-future.d.ts.map +1 -0
- package/dist/sdk/infra/futures/ui-future.js +35 -0
- package/dist/sdk/infra/futures/ui-future.js.map +1 -0
- package/dist/sdk/infra/futures/walde-admin-future.d.ts +41 -0
- package/dist/sdk/infra/futures/walde-admin-future.d.ts.map +1 -0
- package/dist/sdk/infra/futures/walde-admin-future.js +50 -0
- package/dist/sdk/infra/futures/walde-admin-future.js.map +1 -0
- package/dist/sdk/infra/futures/walde-future.d.ts +40 -0
- package/dist/sdk/infra/futures/walde-future.d.ts.map +1 -0
- package/dist/sdk/infra/futures/walde-future.js +66 -0
- package/dist/sdk/infra/futures/walde-future.js.map +1 -0
- package/dist/sdk/infra/futures/workspace-future.d.ts +38 -0
- package/dist/sdk/infra/futures/workspace-future.d.ts.map +1 -0
- package/dist/sdk/infra/futures/workspace-future.js +45 -0
- package/dist/sdk/infra/futures/workspace-future.js.map +1 -0
- package/dist/sdk/infra/mappers/dto/frontend-content-dto-mapper.d.ts +20 -0
- package/dist/sdk/infra/mappers/dto/frontend-content-dto-mapper.d.ts.map +1 -0
- package/dist/sdk/infra/mappers/dto/frontend-content-dto-mapper.js +54 -0
- package/dist/sdk/infra/mappers/dto/frontend-content-dto-mapper.js.map +1 -0
- package/dist/sdk/infra/mappers/dto/manifest-dto-mapper.d.ts +24 -0
- package/dist/sdk/infra/mappers/dto/manifest-dto-mapper.d.ts.map +1 -0
- package/dist/sdk/infra/mappers/dto/manifest-dto-mapper.js +49 -0
- package/dist/sdk/infra/mappers/dto/manifest-dto-mapper.js.map +1 -0
- package/dist/sdk/make-walde-admin.d.ts +15 -0
- package/dist/sdk/make-walde-admin.d.ts.map +1 -0
- package/dist/sdk/make-walde-admin.js +8 -0
- package/dist/sdk/make-walde-admin.js.map +1 -0
- package/dist/sdk/make-walde.d.ts +12 -0
- package/dist/sdk/make-walde.d.ts.map +1 -0
- package/dist/sdk/make-walde.js +8 -0
- package/dist/sdk/make-walde.js.map +1 -0
- package/dist/std/domain/entities/future.d.ts +28 -0
- package/dist/std/domain/entities/future.d.ts.map +1 -0
- package/dist/std/domain/entities/future.js +21 -0
- package/dist/std/domain/entities/future.js.map +1 -0
- package/dist/std/domain/entities/option.d.ts +53 -0
- package/dist/std/domain/entities/option.d.ts.map +1 -0
- package/dist/std/domain/entities/option.js +58 -0
- package/dist/std/domain/entities/option.js.map +1 -0
- package/dist/std/domain/entities/result.d.ts +87 -0
- package/dist/std/domain/entities/result.d.ts.map +1 -0
- package/dist/std/domain/entities/result.js +104 -0
- package/dist/std/domain/entities/result.js.map +1 -0
- package/dist/std/index.d.ts +6 -0
- package/dist/std/index.d.ts.map +1 -0
- package/dist/std/index.js +4 -0
- package/dist/std/index.js.map +1 -0
- package/package.json +33 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { readdir, readFile, stat } from 'fs/promises';
|
|
2
|
+
import { join, relative } from 'path';
|
|
3
|
+
import { File } from '@/sdk/domain/entities/file';
|
|
4
|
+
import { WaldeLocalError } from '@/sdk/domain/errors';
|
|
5
|
+
/**
|
|
6
|
+
* Reads files from the local filesystem
|
|
7
|
+
*/
|
|
8
|
+
export class FileSystemLocalFilesReader {
|
|
9
|
+
/**
|
|
10
|
+
* Recursively reads all files from a directory
|
|
11
|
+
* @param directoryPath - The path to the directory to read
|
|
12
|
+
* @returns Array of File entities with relative paths
|
|
13
|
+
*/
|
|
14
|
+
async readAllFiles(directoryPath) {
|
|
15
|
+
const files = [];
|
|
16
|
+
await this.readDirectoryRecursive(directoryPath, directoryPath, files);
|
|
17
|
+
return files;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Recursively reads files from a directory
|
|
21
|
+
* @param currentPath - Current directory being processed
|
|
22
|
+
* @param basePath - Base directory for calculating relative paths
|
|
23
|
+
* @param files - Array to accumulate files
|
|
24
|
+
*/
|
|
25
|
+
async readDirectoryRecursive(currentPath, basePath, files) {
|
|
26
|
+
try {
|
|
27
|
+
const entries = await readdir(currentPath);
|
|
28
|
+
for (const entry of entries) {
|
|
29
|
+
const fullPath = join(currentPath, entry);
|
|
30
|
+
const stats = await stat(fullPath);
|
|
31
|
+
if (stats.isDirectory()) {
|
|
32
|
+
// Skip hidden directories and common build/dependency directories
|
|
33
|
+
if (!entry.startsWith('.') && !['node_modules', 'dist', 'build'].includes(entry)) {
|
|
34
|
+
await this.readDirectoryRecursive(fullPath, basePath, files);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
else if (stats.isFile()) {
|
|
38
|
+
// Skip hidden files
|
|
39
|
+
if (!entry.startsWith('.')) {
|
|
40
|
+
const relativePath = relative(basePath, fullPath);
|
|
41
|
+
const content = await readFile(fullPath);
|
|
42
|
+
files.push(new File(relativePath, content));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
throw new WaldeLocalError('Failed to read directory', error, { currentPath });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=file-system-local-files-reader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system-local-files-reader.js","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/filesystem/file-system-local-files-reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;GAEG;AACH,MAAM,OAAO,0BAA0B;IACrC;;;;OAIG;IACI,KAAK,CAAC,YAAY,CAAC,aAAqB;QAC7C,MAAM,KAAK,GAAW,EAAE,CAAC;QACzB,MAAM,IAAI,CAAC,sBAAsB,CAAC,aAAa,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;QACvE,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACK,KAAK,CAAC,sBAAsB,CAClC,WAAmB,EACnB,QAAgB,EAChB,KAAa;QAEb,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;YAE3C,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;gBAC5B,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;gBAC1C,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAEnC,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;oBACxB,kEAAkE;oBAClE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;wBACjF,MAAM,IAAI,CAAC,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;oBAC/D,CAAC;gBACH,CAAC;qBAAM,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;oBAC1B,oBAAoB;oBACpB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;wBAC3B,MAAM,YAAY,GAAG,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;wBAClD,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC;wBACzC,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;oBAC9C,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,eAAe,CAAC,0BAA0B,EAAE,KAAc,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;QACzF,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseHttpClient } from './base-http-client';
|
|
2
|
+
/**
|
|
3
|
+
* HTTP client for making unauthenticated frontend API requests
|
|
4
|
+
*/
|
|
5
|
+
export declare class FrontendHttpClient extends BaseHttpClient {
|
|
6
|
+
constructor(baseUrl: string);
|
|
7
|
+
/**
|
|
8
|
+
* Get basic headers without authentication
|
|
9
|
+
*/
|
|
10
|
+
protected getHeaders(): Record<string, string>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=frontend-http-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontend-http-client.d.ts","sourceRoot":"","sources":["../../../../src/sdk/infra/adapters/frontend-http-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,cAAc;gBACxC,OAAO,EAAE,MAAM;IAI3B;;OAEG;IACH,SAAS,CAAC,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAK/C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseHttpClient } from './base-http-client';
|
|
2
|
+
/**
|
|
3
|
+
* HTTP client for making unauthenticated frontend API requests
|
|
4
|
+
*/
|
|
5
|
+
export class FrontendHttpClient extends BaseHttpClient {
|
|
6
|
+
constructor(baseUrl) {
|
|
7
|
+
super(baseUrl);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Get basic headers without authentication
|
|
11
|
+
*/
|
|
12
|
+
getHeaders() {
|
|
13
|
+
return {
|
|
14
|
+
'Content-Type': 'application/json',
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=frontend-http-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontend-http-client.js","sourceRoot":"","sources":["../../../../src/sdk/infra/adapters/frontend-http-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,cAAc;IACpD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAED;;OAEG;IACO,UAAU;QAClB,OAAO;YACL,cAAc,EAAE,kBAAkB;SACnC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ContentRepo } from '@/sdk/domain/ports/out/content-repo';
|
|
2
|
+
import { Content } from '@/sdk/domain/entities/content';
|
|
3
|
+
import { ContentVersion } from '@/sdk/domain/entities/content-version';
|
|
4
|
+
import { ApiClient } from '@/sdk/infra/adapters/api-client';
|
|
5
|
+
/**
|
|
6
|
+
* HTTP implementation of ContentRepo using ApiClient for standard response handling
|
|
7
|
+
*/
|
|
8
|
+
export declare class HttpContentRepo implements ContentRepo {
|
|
9
|
+
private readonly apiClient;
|
|
10
|
+
constructor(apiClient: ApiClient);
|
|
11
|
+
/**
|
|
12
|
+
* Lists contents for a site
|
|
13
|
+
*/
|
|
14
|
+
list(siteId: string): Promise<Content[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Pushes content and version to the API
|
|
17
|
+
* @param content - The content entity
|
|
18
|
+
* @param contentVersion - The content version entity
|
|
19
|
+
* @returns Promise resolving to the created/updated content with ID
|
|
20
|
+
*/
|
|
21
|
+
pushContent(content: Content, contentVersion: ContentVersion): Promise<Content>;
|
|
22
|
+
/**
|
|
23
|
+
* Gets all contents, optionally filtered by site
|
|
24
|
+
* @param siteId - Optional site identifier to filter by
|
|
25
|
+
* @returns Promise resolving to array of contents
|
|
26
|
+
*/
|
|
27
|
+
getAll(siteId?: string): Promise<Content[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Transform ContentParts map to API format
|
|
30
|
+
*/
|
|
31
|
+
private transformParts;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=http-content-repo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-content-repo.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/http/http-content-repo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAEvE,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AA0B5D;;GAEG;AACH,qBAAa,eAAgB,YAAW,WAAW;IAE/C,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAGvC;;OAEG;IACU,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAIrD;;;;;OAKG;IACU,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAmC5F;;;;OAIG;IACU,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IA0BxD;;OAEG;IACH,OAAO,CAAC,cAAc;CAYvB"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Content } from '@/sdk/domain/entities/content';
|
|
2
|
+
import { WaldeUnexpectedError } from '@/sdk/domain/errors';
|
|
3
|
+
/**
|
|
4
|
+
* HTTP implementation of ContentRepo using ApiClient for standard response handling
|
|
5
|
+
*/
|
|
6
|
+
export class HttpContentRepo {
|
|
7
|
+
apiClient;
|
|
8
|
+
constructor(apiClient) {
|
|
9
|
+
this.apiClient = apiClient;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Lists contents for a site
|
|
13
|
+
*/
|
|
14
|
+
async list(siteId) {
|
|
15
|
+
return this.getAll(siteId);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Pushes content and version to the API
|
|
19
|
+
* @param content - The content entity
|
|
20
|
+
* @param contentVersion - The content version entity
|
|
21
|
+
* @returns Promise resolving to the created/updated content with ID
|
|
22
|
+
*/
|
|
23
|
+
async pushContent(content, contentVersion) {
|
|
24
|
+
// Transform entities to API format matching specs/body.json
|
|
25
|
+
const payload = {
|
|
26
|
+
...(content.id && { id: content.id }),
|
|
27
|
+
name: content.name,
|
|
28
|
+
key: content.key,
|
|
29
|
+
state: content.state,
|
|
30
|
+
siteId: content.siteId,
|
|
31
|
+
format: {
|
|
32
|
+
id: contentVersion.format.id
|
|
33
|
+
},
|
|
34
|
+
parts: this.transformParts(contentVersion.getParts())
|
|
35
|
+
};
|
|
36
|
+
try {
|
|
37
|
+
// Use correct endpoint: /v1/contents/<id> for updates, /v1/contents for new content
|
|
38
|
+
const endpoint = content.id ? `/v1/contents/${content.id}` : '/v1/contents';
|
|
39
|
+
// ApiClient automatically extracts payload from standard response format
|
|
40
|
+
const response = await this.apiClient.post(endpoint, payload);
|
|
41
|
+
// Return updated Content with ID from response payload
|
|
42
|
+
return new Content(response.id, content.siteId, content.name, content.key, content.state);
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
// Preserve the original error with response data
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Gets all contents, optionally filtered by site
|
|
51
|
+
* @param siteId - Optional site identifier to filter by
|
|
52
|
+
* @returns Promise resolving to array of contents
|
|
53
|
+
*/
|
|
54
|
+
async getAll(siteId) {
|
|
55
|
+
try {
|
|
56
|
+
// Backend returns all content regardless of siteId parameter, so just get all
|
|
57
|
+
const response = await this.apiClient.get('/v1/contents');
|
|
58
|
+
// Map API response to Content entities
|
|
59
|
+
const allContents = response.map(item => new Content(item.id, item.siteId, item.name, item.key, item.state));
|
|
60
|
+
// Client-side filtering by siteId if provided
|
|
61
|
+
if (siteId) {
|
|
62
|
+
return allContents.filter(content => content.siteId === siteId);
|
|
63
|
+
}
|
|
64
|
+
// Return all contents if no siteId filter
|
|
65
|
+
return allContents;
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
throw new WaldeUnexpectedError('Failed to get contents', error);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Transform ContentParts map to API format
|
|
73
|
+
*/
|
|
74
|
+
transformParts(parts) {
|
|
75
|
+
const result = {};
|
|
76
|
+
for (const [key, part] of parts) {
|
|
77
|
+
result[key] = {
|
|
78
|
+
data: part.data,
|
|
79
|
+
format: part.format
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
return result;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=http-content-repo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-content-repo.js","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/http/http-content-repo.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { RemoteFilesRepo } from '@/sdk/domain/ports/out/remote-files-repo';
|
|
2
|
+
import { File } from '@/sdk/domain/entities/file';
|
|
3
|
+
import { UiUploadCredentials } from '@/sdk/domain/entities/ui-upload-credentials';
|
|
4
|
+
/**
|
|
5
|
+
* AWS S3 implementation for uploading UI files
|
|
6
|
+
*/
|
|
7
|
+
export declare class AwsS3FilesRepo implements RemoteFilesRepo {
|
|
8
|
+
constructor();
|
|
9
|
+
/**
|
|
10
|
+
* Upload files to AWS S3 using temporary credentials
|
|
11
|
+
*/
|
|
12
|
+
uploadFiles(files: File[], credentials: UiUploadCredentials): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Upload a single file to AWS S3 using temporary credentials
|
|
15
|
+
*/
|
|
16
|
+
uploadFile(file: File, credentials: UiUploadCredentials): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Determine content type based on file extension
|
|
19
|
+
*/
|
|
20
|
+
private getContentType;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=aws-s3-files-repo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aws-s3-files-repo.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/repositories/aws-s3-files-repo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAGlF;;GAEG;AACH,qBAAa,cAAe,YAAW,eAAe;;IAGpD;;OAEG;IACU,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAOxF;;OAEG;IACU,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAyBpF;;OAEG;IACH,OAAO,CAAC,cAAc;CA2BvB"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { S3Client, PutObjectCommand } from '@aws-sdk/client-s3';
|
|
2
|
+
import { WaldeLocalError } from '@/sdk/domain/errors';
|
|
3
|
+
/**
|
|
4
|
+
* AWS S3 implementation for uploading UI files
|
|
5
|
+
*/
|
|
6
|
+
export class AwsS3FilesRepo {
|
|
7
|
+
constructor() { }
|
|
8
|
+
/**
|
|
9
|
+
* Upload files to AWS S3 using temporary credentials
|
|
10
|
+
*/
|
|
11
|
+
async uploadFiles(files, credentials) {
|
|
12
|
+
// Upload all files - errors will be thrown and handled by the interactor
|
|
13
|
+
for (const file of files) {
|
|
14
|
+
await this.uploadFile(file, credentials);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Upload a single file to AWS S3 using temporary credentials
|
|
19
|
+
*/
|
|
20
|
+
async uploadFile(file, credentials) {
|
|
21
|
+
// Create S3 client with temporary AWS credentials and region from credentials
|
|
22
|
+
const s3Client = new S3Client({
|
|
23
|
+
region: credentials.region,
|
|
24
|
+
credentials: {
|
|
25
|
+
accessKeyId: credentials.accessKey,
|
|
26
|
+
secretAccessKey: credentials.secretKey,
|
|
27
|
+
sessionToken: credentials.sessionToken
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
const command = new PutObjectCommand({
|
|
31
|
+
Bucket: credentials.bucketName,
|
|
32
|
+
Key: file.path,
|
|
33
|
+
Body: file.content,
|
|
34
|
+
ContentType: this.getContentType(file.path)
|
|
35
|
+
});
|
|
36
|
+
try {
|
|
37
|
+
await s3Client.send(command);
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
throw new WaldeLocalError('Failed to upload to S3', error, { filePath: file.path });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Determine content type based on file extension
|
|
45
|
+
*/
|
|
46
|
+
getContentType(filePath) {
|
|
47
|
+
const extension = filePath.split('.').pop()?.toLowerCase();
|
|
48
|
+
switch (extension) {
|
|
49
|
+
case 'html':
|
|
50
|
+
return 'text/html';
|
|
51
|
+
case 'css':
|
|
52
|
+
return 'text/css';
|
|
53
|
+
case 'js':
|
|
54
|
+
return 'application/javascript';
|
|
55
|
+
case 'json':
|
|
56
|
+
return 'application/json';
|
|
57
|
+
case 'png':
|
|
58
|
+
return 'image/png';
|
|
59
|
+
case 'jpg':
|
|
60
|
+
case 'jpeg':
|
|
61
|
+
return 'image/jpeg';
|
|
62
|
+
case 'gif':
|
|
63
|
+
return 'image/gif';
|
|
64
|
+
case 'svg':
|
|
65
|
+
return 'image/svg+xml';
|
|
66
|
+
case 'ico':
|
|
67
|
+
return 'image/x-icon';
|
|
68
|
+
default:
|
|
69
|
+
return 'application/octet-stream';
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=aws-s3-files-repo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aws-s3-files-repo.js","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/repositories/aws-s3-files-repo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAIhE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;GAEG;AACH,MAAM,OAAO,cAAc;IACzB,gBAAe,CAAC;IAEhB;;OAEG;IACI,KAAK,CAAC,WAAW,CAAC,KAAa,EAAE,WAAgC;QACtE,yEAAyE;QACzE,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,UAAU,CAAC,IAAU,EAAE,WAAgC;QAClE,8EAA8E;QAC9E,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC;YAC5B,MAAM,EAAE,WAAW,CAAC,MAAM;YAC1B,WAAW,EAAE;gBACX,WAAW,EAAE,WAAW,CAAC,SAAS;gBAClC,eAAe,EAAE,WAAW,CAAC,SAAS;gBACtC,YAAY,EAAE,WAAW,CAAC,YAAY;aACvC;SACF,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,IAAI,gBAAgB,CAAC;YACnC,MAAM,EAAE,WAAW,CAAC,UAAU;YAC9B,GAAG,EAAE,IAAI,CAAC,IAAI;YACd,IAAI,EAAE,IAAI,CAAC,OAAO;YAClB,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC;SAC5C,CAAC,CAAC;QAEH,IAAI,CAAC;YACH,MAAM,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,eAAe,CAAC,wBAAwB,EAAE,KAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAC/F,CAAC;IACH,CAAC;IAED;;OAEG;IACK,cAAc,CAAC,QAAgB;QACrC,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE,CAAC;QAE3D,QAAQ,SAAS,EAAE,CAAC;YAClB,KAAK,MAAM;gBACT,OAAO,WAAW,CAAC;YACrB,KAAK,KAAK;gBACR,OAAO,UAAU,CAAC;YACpB,KAAK,IAAI;gBACP,OAAO,wBAAwB,CAAC;YAClC,KAAK,MAAM;gBACT,OAAO,kBAAkB,CAAC;YAC5B,KAAK,KAAK;gBACR,OAAO,WAAW,CAAC;YACrB,KAAK,KAAK,CAAC;YACX,KAAK,MAAM;gBACT,OAAO,YAAY,CAAC;YACtB,KAAK,KAAK;gBACR,OAAO,WAAW,CAAC;YACrB,KAAK,KAAK;gBACR,OAAO,eAAe,CAAC;YACzB,KAAK,KAAK;gBACR,OAAO,cAAc,CAAC;YACxB;gBACE,OAAO,0BAA0B,CAAC;QACtC,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CredentialsProvider } from '@/sdk/domain/ports/out/credentials-provider';
|
|
2
|
+
import { Credentials } from '@/sdk/domain/entities/credentials';
|
|
3
|
+
/**
|
|
4
|
+
* File-based repository for user credentials
|
|
5
|
+
*/
|
|
6
|
+
export declare class CredentialsFileRepo implements CredentialsProvider {
|
|
7
|
+
private readonly filePath;
|
|
8
|
+
constructor(filePath: string);
|
|
9
|
+
/**
|
|
10
|
+
* Retrieve user credentials from JSON file
|
|
11
|
+
*/
|
|
12
|
+
retrieve(): Promise<Credentials>;
|
|
13
|
+
/**
|
|
14
|
+
* Save user credentials to JSON file
|
|
15
|
+
*/
|
|
16
|
+
save(credentials: Credentials): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=credentials-file-repo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials-file-repo.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/repositories/credentials-file-repo.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE;;GAEG;AACH,qBAAa,mBAAoB,YAAW,mBAAmB;IACjD,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,MAAM;IAE7C;;OAEG;IACU,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC;IAe7C;;OAEG;IACU,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAc3D"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import { Credentials } from '@/sdk/domain/entities/credentials';
|
|
4
|
+
/**
|
|
5
|
+
* File-based repository for user credentials
|
|
6
|
+
*/
|
|
7
|
+
export class CredentialsFileRepo {
|
|
8
|
+
filePath;
|
|
9
|
+
constructor(filePath) {
|
|
10
|
+
this.filePath = filePath;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Retrieve user credentials from JSON file
|
|
14
|
+
*/
|
|
15
|
+
async retrieve() {
|
|
16
|
+
try {
|
|
17
|
+
const fileContent = fs.readFileSync(this.filePath, 'utf-8');
|
|
18
|
+
const data = JSON.parse(fileContent);
|
|
19
|
+
return new Credentials(data.accessToken, data.refreshToken, data.idToken);
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
return new Credentials('', '', '');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Save user credentials to JSON file
|
|
27
|
+
*/
|
|
28
|
+
async save(credentials) {
|
|
29
|
+
const data = {
|
|
30
|
+
accessToken: credentials.accessToken,
|
|
31
|
+
refreshToken: credentials.refreshToken,
|
|
32
|
+
idToken: credentials.idToken
|
|
33
|
+
};
|
|
34
|
+
const dir = path.dirname(this.filePath);
|
|
35
|
+
if (!fs.existsSync(dir)) {
|
|
36
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
37
|
+
}
|
|
38
|
+
fs.writeFileSync(this.filePath, JSON.stringify(data, null, 2));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=credentials-file-repo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials-file-repo.js","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/repositories/credentials-file-repo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE;;GAEG;AACH,MAAM,OAAO,mBAAmB;IACD;IAA7B,YAA6B,QAAgB;QAAhB,aAAQ,GAAR,QAAQ,CAAQ;IAAG,CAAC;IAEjD;;OAEG;IACI,KAAK,CAAC,QAAQ;QACnB,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC5D,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YAErC,OAAO,IAAI,WAAW,CACpB,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,CACb,CAAC;QACJ,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,IAAI,WAAW,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAAC,WAAwB;QACxC,MAAM,IAAI,GAAG;YACX,WAAW,EAAE,WAAW,CAAC,WAAW;YACpC,YAAY,EAAE,WAAW,CAAC,YAAY;YACtC,OAAO,EAAE,WAAW,CAAC,OAAO;SAC7B,CAAC;QAEF,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACxC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACxB,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACzC,CAAC;QAED,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACjE,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StaticWaldeAdminConfig } from './static-walde-admin-config';
|
|
2
|
+
/**
|
|
3
|
+
* Factory for creating default configuration with fallback values
|
|
4
|
+
*/
|
|
5
|
+
export declare class DefaultWaldeAdminConfig {
|
|
6
|
+
/**
|
|
7
|
+
* Create a StaticWaldeAdminConfig with default values
|
|
8
|
+
*/
|
|
9
|
+
static create(): StaticWaldeAdminConfig;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=default-walde-admin-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-walde-admin-config.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/repositories/default-walde-admin-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAGrE;;GAEG;AACH,qBAAa,uBAAuB;IAClC;;OAEG;WACW,MAAM,IAAI,sBAAsB;CAW/C"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { StaticWaldeAdminConfig } from './static-walde-admin-config';
|
|
2
|
+
/**
|
|
3
|
+
* Factory for creating default configuration with fallback values
|
|
4
|
+
*/
|
|
5
|
+
export class DefaultWaldeAdminConfig {
|
|
6
|
+
/**
|
|
7
|
+
* Create a StaticWaldeAdminConfig with default values
|
|
8
|
+
*/
|
|
9
|
+
static create() {
|
|
10
|
+
const defaultConfig = {
|
|
11
|
+
endpoint: 'https://api.walde.ai',
|
|
12
|
+
clientId: '2na3vdtebghu3se9rvimtuiaej',
|
|
13
|
+
region: 'eu-central-1',
|
|
14
|
+
userPoolId: 'eu-central-1_XLyUuL5PG'
|
|
15
|
+
};
|
|
16
|
+
// Cast to partial for StaticWaldeAdminConfig constructor
|
|
17
|
+
return new StaticWaldeAdminConfig(defaultConfig);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=default-walde-admin-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-walde-admin-config.js","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/repositories/default-walde-admin-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAGrE;;GAEG;AACH,MAAM,OAAO,uBAAuB;IAClC;;OAEG;IACI,MAAM,CAAC,MAAM;QAClB,MAAM,aAAa,GAAyB;YAC1C,QAAQ,EAAE,sBAAsB;YAChC,QAAQ,EAAE,4BAA4B;YACtC,MAAM,EAAE,cAAc;YACtB,UAAU,EAAE,wBAAwB;SACrC,CAAC;QAEF,yDAAyD;QACzD,OAAO,IAAI,sBAAsB,CAAC,aAA4C,CAAC,CAAC;IAClF,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WaldeAdminConfig, PartialWaldeAdminConfigData } from '@/sdk/domain/entities/walde-admin-config';
|
|
2
|
+
/**
|
|
3
|
+
* File-based configuration implementation
|
|
4
|
+
*/
|
|
5
|
+
export declare class FileWaldeAdminConfig extends WaldeAdminConfig {
|
|
6
|
+
private filePath;
|
|
7
|
+
constructor(filePath: string);
|
|
8
|
+
private loadFromFile;
|
|
9
|
+
protected createInstance(data: PartialWaldeAdminConfigData): FileWaldeAdminConfig;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=file-walde-admin-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-walde-admin-config.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/repositories/file-walde-admin-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AAGzG;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,gBAAgB;IACxD,OAAO,CAAC,QAAQ,CAAS;gBAEb,QAAQ,EAAE,MAAM;IAM5B,OAAO,CAAC,YAAY;IAkBpB,SAAS,CAAC,cAAc,CAAC,IAAI,EAAE,2BAA2B,GAAG,oBAAoB;CAMlF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { WaldeAdminConfig } from '@/sdk/domain/entities/walde-admin-config';
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
/**
|
|
4
|
+
* File-based configuration implementation
|
|
5
|
+
*/
|
|
6
|
+
export class FileWaldeAdminConfig extends WaldeAdminConfig {
|
|
7
|
+
filePath;
|
|
8
|
+
constructor(filePath) {
|
|
9
|
+
super();
|
|
10
|
+
this.filePath = filePath;
|
|
11
|
+
this.loadFromFile();
|
|
12
|
+
}
|
|
13
|
+
loadFromFile() {
|
|
14
|
+
if (fs.existsSync(this.filePath)) {
|
|
15
|
+
try {
|
|
16
|
+
const fileContent = fs.readFileSync(this.filePath, 'utf8');
|
|
17
|
+
const configData = JSON.parse(fileContent);
|
|
18
|
+
this.data = {
|
|
19
|
+
endpoint: configData.endpoint,
|
|
20
|
+
clientId: configData.clientId,
|
|
21
|
+
region: configData.region,
|
|
22
|
+
userPoolId: configData.userPoolId
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
// File exists but is invalid, keep empty config
|
|
27
|
+
this.data = {};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
createInstance(data) {
|
|
32
|
+
// Create a new FileWaldeAdminConfig with the same file path but merged data
|
|
33
|
+
const merged = new FileWaldeAdminConfig(this.filePath);
|
|
34
|
+
merged.data = data;
|
|
35
|
+
return merged;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=file-walde-admin-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-walde-admin-config.js","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/repositories/file-walde-admin-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAA+B,MAAM,0CAA0C,CAAC;AACzG,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,gBAAgB;IAChD,QAAQ,CAAS;IAEzB,YAAY,QAAgB;QAC1B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAEO,YAAY;QAClB,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YACjC,IAAI,CAAC;gBACH,MAAM,WAAW,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;gBAC3D,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;gBAC3C,IAAI,CAAC,IAAI,GAAG;oBACV,QAAQ,EAAE,UAAU,CAAC,QAAQ;oBAC7B,QAAQ,EAAE,UAAU,CAAC,QAAQ;oBAC7B,MAAM,EAAE,UAAU,CAAC,MAAM;oBACzB,UAAU,EAAE,UAAU,CAAC,UAAU;iBAClC,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,gDAAgD;gBAChD,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;YACjB,CAAC;QACH,CAAC;IACH,CAAC;IAES,cAAc,CAAC,IAAiC;QACxD,4EAA4E;QAC5E,MAAM,MAAM,GAAG,IAAI,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvD,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;QACnB,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { WorkspaceConfigRepo } from '@/sdk/domain/ports/out/workspace-config-repo';
|
|
2
|
+
import { WorkspaceConfig } from '@/sdk/domain/entities/workspace-config';
|
|
3
|
+
/**
|
|
4
|
+
* File system implementation of WorkspaceConfigRepo
|
|
5
|
+
*/
|
|
6
|
+
export declare class FileWorkspaceConfigRepo implements WorkspaceConfigRepo {
|
|
7
|
+
/**
|
|
8
|
+
* Saves workspace configuration to walde.json
|
|
9
|
+
* @param targetPath - Directory path where walde.json should be created
|
|
10
|
+
* @param config - Workspace configuration to save
|
|
11
|
+
*/
|
|
12
|
+
save(targetPath: string, config: WorkspaceConfig): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Loads workspace configuration from walde.json
|
|
15
|
+
* @param targetPath - Directory path where walde.json is located
|
|
16
|
+
* @returns Promise resolving to workspace configuration
|
|
17
|
+
*/
|
|
18
|
+
load(targetPath: string): Promise<WorkspaceConfig>;
|
|
19
|
+
/**
|
|
20
|
+
* Searches for workspace configuration starting from the given path and moving up the directory tree
|
|
21
|
+
* @param startPath - Starting directory path (defaults to current working directory)
|
|
22
|
+
* @returns Promise resolving to workspace configuration or null if not found
|
|
23
|
+
*/
|
|
24
|
+
findWorkspace(startPath?: string): Promise<WorkspaceConfig | null>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=file-workspace-config-repo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-workspace-config-repo.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/repositories/file-workspace-config-repo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AAKzE;;GAEG;AACH,qBAAa,uBAAwB,YAAW,mBAAmB;IACjE;;;;OAIG;IACU,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAkB7E;;;;OAIG;IACU,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAyB/D;;;;OAIG;IACU,aAAa,CAAC,SAAS,GAAE,MAAsB,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;CAsB/F"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { WorkspaceConfig } from '@/sdk/domain/entities/workspace-config';
|
|
2
|
+
import { promises as fs } from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { WaldeLocalError } from '@/sdk/domain/errors';
|
|
5
|
+
/**
|
|
6
|
+
* File system implementation of WorkspaceConfigRepo
|
|
7
|
+
*/
|
|
8
|
+
export class FileWorkspaceConfigRepo {
|
|
9
|
+
/**
|
|
10
|
+
* Saves workspace configuration to walde.json
|
|
11
|
+
* @param targetPath - Directory path where walde.json should be created
|
|
12
|
+
* @param config - Workspace configuration to save
|
|
13
|
+
*/
|
|
14
|
+
async save(targetPath, config) {
|
|
15
|
+
const configPath = path.join(targetPath, 'walde.json');
|
|
16
|
+
const configData = {
|
|
17
|
+
siteId: config.siteId,
|
|
18
|
+
paths: config.paths
|
|
19
|
+
};
|
|
20
|
+
try {
|
|
21
|
+
// Ensure target directory exists
|
|
22
|
+
await fs.mkdir(targetPath, { recursive: true });
|
|
23
|
+
await fs.writeFile(configPath, JSON.stringify(configData, null, 2), 'utf-8');
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
throw new WaldeLocalError('Failed to save workspace configuration', error, { configPath });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Loads workspace configuration from walde.json
|
|
31
|
+
* @param targetPath - Directory path where walde.json is located
|
|
32
|
+
* @returns Promise resolving to workspace configuration
|
|
33
|
+
*/
|
|
34
|
+
async load(targetPath) {
|
|
35
|
+
const configPath = path.join(targetPath, 'walde.json');
|
|
36
|
+
try {
|
|
37
|
+
const configContent = await fs.readFile(configPath, 'utf-8');
|
|
38
|
+
const configData = JSON.parse(configContent);
|
|
39
|
+
// Handle both old and new format for backward compatibility during development
|
|
40
|
+
let paths;
|
|
41
|
+
if (configData.paths) {
|
|
42
|
+
paths = configData.paths;
|
|
43
|
+
}
|
|
44
|
+
else if (configData.contentPath) {
|
|
45
|
+
// Legacy format - convert to new format
|
|
46
|
+
paths = { content: configData.contentPath, ui: 'ui' };
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
// Default paths
|
|
50
|
+
paths = { content: 'content', ui: 'ui' };
|
|
51
|
+
}
|
|
52
|
+
return new WorkspaceConfig(configData.siteId, paths);
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
throw new WaldeLocalError('Failed to load workspace configuration', error);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Searches for workspace configuration starting from the given path and moving up the directory tree
|
|
60
|
+
* @param startPath - Starting directory path (defaults to current working directory)
|
|
61
|
+
* @returns Promise resolving to workspace configuration or null if not found
|
|
62
|
+
*/
|
|
63
|
+
async findWorkspace(startPath = process.cwd()) {
|
|
64
|
+
let currentPath = path.resolve(startPath);
|
|
65
|
+
const root = path.parse(currentPath).root;
|
|
66
|
+
while (currentPath !== root) {
|
|
67
|
+
try {
|
|
68
|
+
const config = await this.load(currentPath);
|
|
69
|
+
return config;
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
// Continue searching up the directory tree
|
|
73
|
+
currentPath = path.dirname(currentPath);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// Check root directory as well
|
|
77
|
+
try {
|
|
78
|
+
const config = await this.load(currentPath);
|
|
79
|
+
return config;
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=file-workspace-config-repo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-workspace-config-repo.js","sourceRoot":"","sources":["../../../../../src/sdk/infra/adapters/repositories/file-workspace-config-repo.ts"],"names":[],"mappings":"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"}
|