skywriter 1.0.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 +16 -0
- package/README.md +852 -0
- package/dist/cli/commands/host.d.ts +6 -0
- package/dist/cli/commands/host.d.ts.map +1 -0
- package/dist/cli/commands/host.js +52 -0
- package/dist/cli/commands/host.js.map +1 -0
- package/dist/cli/commands/init.d.ts +15 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +207 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/login.d.ts +18 -0
- package/dist/cli/commands/login.d.ts.map +1 -0
- package/dist/cli/commands/login.js +152 -0
- package/dist/cli/commands/login.js.map +1 -0
- package/dist/cli/commands/logout.d.ts +15 -0
- package/dist/cli/commands/logout.d.ts.map +1 -0
- package/dist/cli/commands/logout.js +62 -0
- package/dist/cli/commands/logout.js.map +1 -0
- package/dist/cli/commands/pull.d.ts +19 -0
- package/dist/cli/commands/pull.d.ts.map +1 -0
- package/dist/cli/commands/pull.js +44 -0
- package/dist/cli/commands/pull.js.map +1 -0
- package/dist/cli/commands/push.d.ts +9 -0
- package/dist/cli/commands/push.d.ts.map +1 -0
- package/dist/cli/commands/push.js +49 -0
- package/dist/cli/commands/push.js.map +1 -0
- package/dist/cli/commands/removeServer.d.ts +9 -0
- package/dist/cli/commands/removeServer.d.ts.map +1 -0
- package/dist/cli/commands/removeServer.js +55 -0
- package/dist/cli/commands/removeServer.js.map +1 -0
- package/dist/cli/commands/render.d.ts +6 -0
- package/dist/cli/commands/render.d.ts.map +1 -0
- package/dist/cli/commands/render.js +11 -0
- package/dist/cli/commands/render.js.map +1 -0
- package/dist/cli/commands/serve.d.ts +7 -0
- package/dist/cli/commands/serve.d.ts.map +1 -0
- package/dist/cli/commands/serve.js +55 -0
- package/dist/cli/commands/serve.js.map +1 -0
- package/dist/cli/commands/sessions.d.ts +6 -0
- package/dist/cli/commands/sessions.d.ts.map +1 -0
- package/dist/cli/commands/sessions.js +24 -0
- package/dist/cli/commands/sessions.js.map +1 -0
- package/dist/cli/commands/settings.d.ts +10 -0
- package/dist/cli/commands/settings.d.ts.map +1 -0
- package/dist/cli/commands/settings.js +69 -0
- package/dist/cli/commands/settings.js.map +1 -0
- package/dist/cli/commands/switchServer.d.ts +9 -0
- package/dist/cli/commands/switchServer.d.ts.map +1 -0
- package/dist/cli/commands/switchServer.js +52 -0
- package/dist/cli/commands/switchServer.js.map +1 -0
- package/dist/cli/commands/vscodeInit.d.ts +13 -0
- package/dist/cli/commands/vscodeInit.d.ts.map +1 -0
- package/dist/cli/commands/vscodeInit.js +152 -0
- package/dist/cli/commands/vscodeInit.js.map +1 -0
- package/dist/cli/commands/whoami.d.ts +6 -0
- package/dist/cli/commands/whoami.d.ts.map +1 -0
- package/dist/cli/commands/whoami.js +67 -0
- package/dist/cli/commands/whoami.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +5 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/middleware/checkDuplicatePath.d.ts +19 -0
- package/dist/cli/middleware/checkDuplicatePath.d.ts.map +1 -0
- package/dist/cli/middleware/checkDuplicatePath.js +45 -0
- package/dist/cli/middleware/checkDuplicatePath.js.map +1 -0
- package/dist/cli/middleware/redirectRoot.d.ts +18 -0
- package/dist/cli/middleware/redirectRoot.d.ts.map +1 -0
- package/dist/cli/middleware/redirectRoot.js +44 -0
- package/dist/cli/middleware/redirectRoot.js.map +1 -0
- package/dist/cli/middleware/serveDocument.d.ts +10 -0
- package/dist/cli/middleware/serveDocument.d.ts.map +1 -0
- package/dist/cli/middleware/serveDocument.js +104 -0
- package/dist/cli/middleware/serveDocument.js.map +1 -0
- package/dist/cli/middleware/serveUploads.d.ts +20 -0
- package/dist/cli/middleware/serveUploads.d.ts.map +1 -0
- package/dist/cli/middleware/serveUploads.js +93 -0
- package/dist/cli/middleware/serveUploads.js.map +1 -0
- package/dist/cli/middleware/types.d.ts +43 -0
- package/dist/cli/middleware/types.d.ts.map +1 -0
- package/dist/cli/middleware/types.js +2 -0
- package/dist/cli/middleware/types.js.map +1 -0
- package/dist/cli/pathOperations/deletePathUploads.d.ts +6 -0
- package/dist/cli/pathOperations/deletePathUploads.d.ts.map +1 -0
- package/dist/cli/pathOperations/deletePathUploads.js +68 -0
- package/dist/cli/pathOperations/deletePathUploads.js.map +1 -0
- package/dist/cli/pathOperations/downloadPathUploads.d.ts +6 -0
- package/dist/cli/pathOperations/downloadPathUploads.d.ts.map +1 -0
- package/dist/cli/pathOperations/downloadPathUploads.js +156 -0
- package/dist/cli/pathOperations/downloadPathUploads.js.map +1 -0
- package/dist/cli/pathOperations/pullPathViaGit.d.ts +9 -0
- package/dist/cli/pathOperations/pullPathViaGit.d.ts.map +1 -0
- package/dist/cli/pathOperations/pullPathViaGit.js +86 -0
- package/dist/cli/pathOperations/pullPathViaGit.js.map +1 -0
- package/dist/cli/pathOperations/pullPathViaTar.d.ts +14 -0
- package/dist/cli/pathOperations/pullPathViaTar.d.ts.map +1 -0
- package/dist/cli/pathOperations/pullPathViaTar.js +252 -0
- package/dist/cli/pathOperations/pullPathViaTar.js.map +1 -0
- package/dist/cli/pathOperations/pushPathViaGit.d.ts +9 -0
- package/dist/cli/pathOperations/pushPathViaGit.d.ts.map +1 -0
- package/dist/cli/pathOperations/pushPathViaGit.js +49 -0
- package/dist/cli/pathOperations/pushPathViaGit.js.map +1 -0
- package/dist/cli/pathOperations/pushPathViaTar.d.ts +6 -0
- package/dist/cli/pathOperations/pushPathViaTar.d.ts.map +1 -0
- package/dist/cli/pathOperations/pushPathViaTar.js +63 -0
- package/dist/cli/pathOperations/pushPathViaTar.js.map +1 -0
- package/dist/cli/pathOperations/uploadPathUploads.d.ts +6 -0
- package/dist/cli/pathOperations/uploadPathUploads.d.ts.map +1 -0
- package/dist/cli/pathOperations/uploadPathUploads.js +114 -0
- package/dist/cli/pathOperations/uploadPathUploads.js.map +1 -0
- package/dist/cli/pathOperations/validatePathSettings.d.ts +14 -0
- package/dist/cli/pathOperations/validatePathSettings.d.ts.map +1 -0
- package/dist/cli/pathOperations/validatePathSettings.js +191 -0
- package/dist/cli/pathOperations/validatePathSettings.js.map +1 -0
- package/dist/cli/utils/assemble.d.ts +22 -0
- package/dist/cli/utils/assemble.d.ts.map +1 -0
- package/dist/cli/utils/assemble.js +219 -0
- package/dist/cli/utils/assemble.js.map +1 -0
- package/dist/cli/utils/cliName.d.ts +3 -0
- package/dist/cli/utils/cliName.d.ts.map +1 -0
- package/dist/cli/utils/cliName.js +17 -0
- package/dist/cli/utils/cliName.js.map +1 -0
- package/dist/cli/utils/codeWorkspace.d.ts +13 -0
- package/dist/cli/utils/codeWorkspace.d.ts.map +1 -0
- package/dist/cli/utils/codeWorkspace.js +20 -0
- package/dist/cli/utils/codeWorkspace.js.map +1 -0
- package/dist/cli/utils/colors.d.ts +14 -0
- package/dist/cli/utils/colors.d.ts.map +1 -0
- package/dist/cli/utils/colors.js +22 -0
- package/dist/cli/utils/colors.js.map +1 -0
- package/dist/cli/utils/config.d.ts +35 -0
- package/dist/cli/utils/config.d.ts.map +1 -0
- package/dist/cli/utils/config.js +95 -0
- package/dist/cli/utils/config.js.map +1 -0
- package/dist/cli/utils/copilotInstructions.d.ts +5 -0
- package/dist/cli/utils/copilotInstructions.d.ts.map +1 -0
- package/dist/cli/utils/copilotInstructions.js +101 -0
- package/dist/cli/utils/copilotInstructions.js.map +1 -0
- package/dist/cli/utils/createLoggedFs.d.ts +17 -0
- package/dist/cli/utils/createLoggedFs.d.ts.map +1 -0
- package/dist/cli/utils/createLoggedFs.js +106 -0
- package/dist/cli/utils/createLoggedFs.js.map +1 -0
- package/dist/cli/utils/credentials.d.ts +38 -0
- package/dist/cli/utils/credentials.d.ts.map +1 -0
- package/dist/cli/utils/credentials.js +400 -0
- package/dist/cli/utils/credentials.js.map +1 -0
- package/dist/cli/utils/discover.d.ts +26 -0
- package/dist/cli/utils/discover.d.ts.map +1 -0
- package/dist/cli/utils/discover.js +209 -0
- package/dist/cli/utils/discover.js.map +1 -0
- package/dist/cli/utils/formatPlan.d.ts +40 -0
- package/dist/cli/utils/formatPlan.d.ts.map +1 -0
- package/dist/cli/utils/formatPlan.js +148 -0
- package/dist/cli/utils/formatPlan.js.map +1 -0
- package/dist/cli/utils/git.d.ts +17 -0
- package/dist/cli/utils/git.d.ts.map +1 -0
- package/dist/cli/utils/git.js +57 -0
- package/dist/cli/utils/git.js.map +1 -0
- package/dist/cli/utils/gitUrl.d.ts +7 -0
- package/dist/cli/utils/gitUrl.d.ts.map +1 -0
- package/dist/cli/utils/gitUrl.js +23 -0
- package/dist/cli/utils/gitUrl.js.map +1 -0
- package/dist/cli/utils/log.d.ts +22 -0
- package/dist/cli/utils/log.d.ts.map +1 -0
- package/dist/cli/utils/log.js +31 -0
- package/dist/cli/utils/log.js.map +1 -0
- package/dist/cli/utils/logData.d.ts +5 -0
- package/dist/cli/utils/logData.d.ts.map +1 -0
- package/dist/cli/utils/logData.js +65 -0
- package/dist/cli/utils/logData.js.map +1 -0
- package/dist/cli/utils/loggedFetch.d.ts +4 -0
- package/dist/cli/utils/loggedFetch.d.ts.map +1 -0
- package/dist/cli/utils/loggedFetch.js +15 -0
- package/dist/cli/utils/loggedFetch.js.map +1 -0
- package/dist/cli/utils/pageContext.d.ts +50 -0
- package/dist/cli/utils/pageContext.d.ts.map +1 -0
- package/dist/cli/utils/pageContext.js +86 -0
- package/dist/cli/utils/pageContext.js.map +1 -0
- package/dist/cli/utils/parseDocumentPath.d.ts +13 -0
- package/dist/cli/utils/parseDocumentPath.d.ts.map +1 -0
- package/dist/cli/utils/parseDocumentPath.js +35 -0
- package/dist/cli/utils/parseDocumentPath.js.map +1 -0
- package/dist/cli/utils/populateCache.d.ts +12 -0
- package/dist/cli/utils/populateCache.d.ts.map +1 -0
- package/dist/cli/utils/populateCache.js +21 -0
- package/dist/cli/utils/populateCache.js.map +1 -0
- package/dist/cli/utils/prefixLog.d.ts +21 -0
- package/dist/cli/utils/prefixLog.d.ts.map +1 -0
- package/dist/cli/utils/prefixLog.js +73 -0
- package/dist/cli/utils/prefixLog.js.map +1 -0
- package/dist/cli/utils/program.d.ts +7 -0
- package/dist/cli/utils/program.d.ts.map +1 -0
- package/dist/cli/utils/program.js +266 -0
- package/dist/cli/utils/program.js.map +1 -0
- package/dist/cli/utils/promptExec.d.ts +27 -0
- package/dist/cli/utils/promptExec.d.ts.map +1 -0
- package/dist/cli/utils/promptExec.js +47 -0
- package/dist/cli/utils/promptExec.js.map +1 -0
- package/dist/cli/utils/pullHarness.d.ts +15 -0
- package/dist/cli/utils/pullHarness.d.ts.map +1 -0
- package/dist/cli/utils/pullHarness.js +101 -0
- package/dist/cli/utils/pullHarness.js.map +1 -0
- package/dist/cli/utils/pullViaGit.d.ts +6 -0
- package/dist/cli/utils/pullViaGit.d.ts.map +1 -0
- package/dist/cli/utils/pullViaGit.js +13 -0
- package/dist/cli/utils/pullViaGit.js.map +1 -0
- package/dist/cli/utils/pullViaTar.d.ts +10 -0
- package/dist/cli/utils/pullViaTar.d.ts.map +1 -0
- package/dist/cli/utils/pullViaTar.js +15 -0
- package/dist/cli/utils/pullViaTar.js.map +1 -0
- package/dist/cli/utils/pushHarness.d.ts +24 -0
- package/dist/cli/utils/pushHarness.d.ts.map +1 -0
- package/dist/cli/utils/pushHarness.js +82 -0
- package/dist/cli/utils/pushHarness.js.map +1 -0
- package/dist/cli/utils/pushViaGit.d.ts +6 -0
- package/dist/cli/utils/pushViaGit.d.ts.map +1 -0
- package/dist/cli/utils/pushViaGit.js +16 -0
- package/dist/cli/utils/pushViaGit.js.map +1 -0
- package/dist/cli/utils/pushViaTar.d.ts +6 -0
- package/dist/cli/utils/pushViaTar.d.ts.map +1 -0
- package/dist/cli/utils/pushViaTar.js +9 -0
- package/dist/cli/utils/pushViaTar.js.map +1 -0
- package/dist/cli/utils/resolveTarget.d.ts +23 -0
- package/dist/cli/utils/resolveTarget.d.ts.map +1 -0
- package/dist/cli/utils/resolveTarget.js +43 -0
- package/dist/cli/utils/resolveTarget.js.map +1 -0
- package/dist/cli/utils/settingsValidation.d.ts +23 -0
- package/dist/cli/utils/settingsValidation.d.ts.map +1 -0
- package/dist/cli/utils/settingsValidation.js +176 -0
- package/dist/cli/utils/settingsValidation.js.map +1 -0
- package/dist/cli/utils/types.d.ts +33 -0
- package/dist/cli/utils/types.d.ts.map +1 -0
- package/dist/cli/utils/types.js +2 -0
- package/dist/cli/utils/types.js.map +1 -0
- package/dist/cli/utils/validateAndGetFilesFromDir.d.ts +10 -0
- package/dist/cli/utils/validateAndGetFilesFromDir.d.ts.map +1 -0
- package/dist/cli/utils/validateAndGetFilesFromDir.js +74 -0
- package/dist/cli/utils/validateAndGetFilesFromDir.js.map +1 -0
- package/dist/cli/utils/watchForChanges.d.ts +7 -0
- package/dist/cli/utils/watchForChanges.d.ts.map +1 -0
- package/dist/cli/utils/watchForChanges.js +44 -0
- package/dist/cli/utils/watchForChanges.js.map +1 -0
- package/dist/db/index.d.ts +5 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +23 -0
- package/dist/db/index.js.map +1 -0
- package/dist/editor.bundle.dev.js +30823 -0
- package/dist/editor.bundle.dev.js.map +7 -0
- package/dist/editor.bundle.js +30347 -0
- package/dist/editor.bundle.js.map +7 -0
- package/dist/editor.bundle.prod.js +1373 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/operations/addRedirect.d.ts +20 -0
- package/dist/operations/addRedirect.d.ts.map +1 -0
- package/dist/operations/addRedirect.js +46 -0
- package/dist/operations/addRedirect.js.map +1 -0
- package/dist/operations/addUpload.d.ts +29 -0
- package/dist/operations/addUpload.d.ts.map +1 -0
- package/dist/operations/addUpload.js +96 -0
- package/dist/operations/addUpload.js.map +1 -0
- package/dist/operations/addUploadsFromContent.d.ts +27 -0
- package/dist/operations/addUploadsFromContent.d.ts.map +1 -0
- package/dist/operations/addUploadsFromContent.js +311 -0
- package/dist/operations/addUploadsFromContent.js.map +1 -0
- package/dist/operations/clearDraft.d.ts +17 -0
- package/dist/operations/clearDraft.d.ts.map +1 -0
- package/dist/operations/clearDraft.js +56 -0
- package/dist/operations/clearDraft.js.map +1 -0
- package/dist/operations/createDocumentRecord.d.ts +11 -0
- package/dist/operations/createDocumentRecord.d.ts.map +1 -0
- package/dist/operations/createDocumentRecord.js +100 -0
- package/dist/operations/createDocumentRecord.js.map +1 -0
- package/dist/operations/createRoute.d.ts +6 -0
- package/dist/operations/createRoute.d.ts.map +1 -0
- package/dist/operations/createRoute.js +10 -0
- package/dist/operations/createRoute.js.map +1 -0
- package/dist/operations/createSession.d.ts +21 -0
- package/dist/operations/createSession.d.ts.map +1 -0
- package/dist/operations/createSession.js +27 -0
- package/dist/operations/createSession.js.map +1 -0
- package/dist/operations/deleteSession.d.ts +13 -0
- package/dist/operations/deleteSession.d.ts.map +1 -0
- package/dist/operations/deleteSession.js +15 -0
- package/dist/operations/deleteSession.js.map +1 -0
- package/dist/operations/findDocument.d.ts +18 -0
- package/dist/operations/findDocument.d.ts.map +1 -0
- package/dist/operations/findDocument.js +53 -0
- package/dist/operations/findDocument.js.map +1 -0
- package/dist/operations/getAllUploadsForDocument.d.ts +11 -0
- package/dist/operations/getAllUploadsForDocument.d.ts.map +1 -0
- package/dist/operations/getAllUploadsForDocument.js +15 -0
- package/dist/operations/getAllUploadsForDocument.js.map +1 -0
- package/dist/operations/getDocumentClientState.d.ts +30 -0
- package/dist/operations/getDocumentClientState.d.ts.map +1 -0
- package/dist/operations/getDocumentClientState.js +246 -0
- package/dist/operations/getDocumentClientState.js.map +1 -0
- package/dist/operations/getDocumentInstance.d.ts +7 -0
- package/dist/operations/getDocumentInstance.d.ts.map +1 -0
- package/dist/operations/getDocumentInstance.js +32 -0
- package/dist/operations/getDocumentInstance.js.map +1 -0
- package/dist/operations/getDocumentRecord.d.ts +6 -0
- package/dist/operations/getDocumentRecord.d.ts.map +1 -0
- package/dist/operations/getDocumentRecord.js +8 -0
- package/dist/operations/getDocumentRecord.js.map +1 -0
- package/dist/operations/getDualDocument.d.ts +28 -0
- package/dist/operations/getDualDocument.d.ts.map +1 -0
- package/dist/operations/getDualDocument.js +81 -0
- package/dist/operations/getDualDocument.js.map +1 -0
- package/dist/operations/getDualDocuments.d.ts +26 -0
- package/dist/operations/getDualDocuments.d.ts.map +1 -0
- package/dist/operations/getDualDocuments.js +130 -0
- package/dist/operations/getDualDocuments.js.map +1 -0
- package/dist/operations/getOptimisticDocument.d.ts +6 -0
- package/dist/operations/getOptimisticDocument.d.ts.map +1 -0
- package/dist/operations/getOptimisticDocument.js +30 -0
- package/dist/operations/getOptimisticDocument.js.map +1 -0
- package/dist/operations/getPage.d.ts +18 -0
- package/dist/operations/getPage.d.ts.map +1 -0
- package/dist/operations/getPage.js +31 -0
- package/dist/operations/getPage.js.map +1 -0
- package/dist/operations/getPages.d.ts +18 -0
- package/dist/operations/getPages.d.ts.map +1 -0
- package/dist/operations/getPages.js +30 -0
- package/dist/operations/getPages.js.map +1 -0
- package/dist/operations/getRedirects.d.ts +13 -0
- package/dist/operations/getRedirects.d.ts.map +1 -0
- package/dist/operations/getRedirects.js +30 -0
- package/dist/operations/getRedirects.js.map +1 -0
- package/dist/operations/getRenderDocument.d.ts +18 -0
- package/dist/operations/getRenderDocument.d.ts.map +1 -0
- package/dist/operations/getRenderDocument.js +27 -0
- package/dist/operations/getRenderDocument.js.map +1 -0
- package/dist/operations/getRenderDocumentWithAssociations.d.ts +15 -0
- package/dist/operations/getRenderDocumentWithAssociations.d.ts.map +1 -0
- package/dist/operations/getRenderDocumentWithAssociations.js +64 -0
- package/dist/operations/getRenderDocumentWithAssociations.js.map +1 -0
- package/dist/operations/getRenderDocuments.d.ts +16 -0
- package/dist/operations/getRenderDocuments.d.ts.map +1 -0
- package/dist/operations/getRenderDocuments.js +25 -0
- package/dist/operations/getRenderDocuments.js.map +1 -0
- package/dist/operations/getUpload.d.ts +25 -0
- package/dist/operations/getUpload.d.ts.map +1 -0
- package/dist/operations/getUpload.js +37 -0
- package/dist/operations/getUpload.js.map +1 -0
- package/dist/operations/getUploads.d.ts +25 -0
- package/dist/operations/getUploads.d.ts.map +1 -0
- package/dist/operations/getUploads.js +76 -0
- package/dist/operations/getUploads.js.map +1 -0
- package/dist/operations/getUsersCount.d.ts +12 -0
- package/dist/operations/getUsersCount.d.ts.map +1 -0
- package/dist/operations/getUsersCount.js +12 -0
- package/dist/operations/getUsersCount.js.map +1 -0
- package/dist/operations/login.d.ts +20 -0
- package/dist/operations/login.d.ts.map +1 -0
- package/dist/operations/login.js +38 -0
- package/dist/operations/login.js.map +1 -0
- package/dist/operations/removeDocument.d.ts +19 -0
- package/dist/operations/removeDocument.d.ts.map +1 -0
- package/dist/operations/removeDocument.js +54 -0
- package/dist/operations/removeDocument.js.map +1 -0
- package/dist/operations/removeRedirect.d.ts +15 -0
- package/dist/operations/removeRedirect.d.ts.map +1 -0
- package/dist/operations/removeRedirect.js +71 -0
- package/dist/operations/removeRedirect.js.map +1 -0
- package/dist/operations/removeUpload.d.ts +21 -0
- package/dist/operations/removeUpload.d.ts.map +1 -0
- package/dist/operations/removeUpload.js +49 -0
- package/dist/operations/removeUpload.js.map +1 -0
- package/dist/operations/search.d.ts +19 -0
- package/dist/operations/search.d.ts.map +1 -0
- package/dist/operations/search.js +109 -0
- package/dist/operations/search.js.map +1 -0
- package/dist/operations/seedIfEmpty.d.ts +7 -0
- package/dist/operations/seedIfEmpty.d.ts.map +1 -0
- package/dist/operations/seedIfEmpty.js +100 -0
- package/dist/operations/seedIfEmpty.js.map +1 -0
- package/dist/operations/signup.d.ts +21 -0
- package/dist/operations/signup.d.ts.map +1 -0
- package/dist/operations/signup.js +45 -0
- package/dist/operations/signup.js.map +1 -0
- package/dist/operations/types.d.ts +223 -0
- package/dist/operations/types.d.ts.map +1 -0
- package/dist/operations/types.js +2 -0
- package/dist/operations/types.js.map +1 -0
- package/dist/operations/updateUpload.d.ts +27 -0
- package/dist/operations/updateUpload.d.ts.map +1 -0
- package/dist/operations/updateUpload.js +78 -0
- package/dist/operations/updateUpload.js.map +1 -0
- package/dist/operations/updateViaArchive.d.ts +23 -0
- package/dist/operations/updateViaArchive.d.ts.map +1 -0
- package/dist/operations/updateViaArchive.js +229 -0
- package/dist/operations/updateViaArchive.js.map +1 -0
- package/dist/operations/upsert.d.ts +26 -0
- package/dist/operations/upsert.d.ts.map +1 -0
- package/dist/operations/upsert.js +257 -0
- package/dist/operations/upsert.js.map +1 -0
- package/dist/operations/utils/common.d.ts +2 -0
- package/dist/operations/utils/common.d.ts.map +1 -0
- package/dist/operations/utils/common.js +2 -0
- package/dist/operations/utils/common.js.map +1 -0
- package/dist/operations/utils/contentType.d.ts +2 -0
- package/dist/operations/utils/contentType.d.ts.map +1 -0
- package/dist/operations/utils/contentType.js +66 -0
- package/dist/operations/utils/contentType.js.map +1 -0
- package/dist/operations/utils/dataType.d.ts +7 -0
- package/dist/operations/utils/dataType.d.ts.map +1 -0
- package/dist/operations/utils/dataType.js +35 -0
- package/dist/operations/utils/dataType.js.map +1 -0
- package/dist/operations/utils/generateUniqueFilename.d.ts +7 -0
- package/dist/operations/utils/generateUniqueFilename.d.ts.map +1 -0
- package/dist/operations/utils/generateUniqueFilename.js +38 -0
- package/dist/operations/utils/generateUniqueFilename.js.map +1 -0
- package/dist/operations/utils/hasEtaTemplates.d.ts +2 -0
- package/dist/operations/utils/hasEtaTemplates.d.ts.map +1 -0
- package/dist/operations/utils/hasEtaTemplates.js +10 -0
- package/dist/operations/utils/hasEtaTemplates.js.map +1 -0
- package/dist/operations/utils/normalizeDocumentQuery.d.ts +12 -0
- package/dist/operations/utils/normalizeDocumentQuery.d.ts.map +1 -0
- package/dist/operations/utils/normalizeDocumentQuery.js +45 -0
- package/dist/operations/utils/normalizeDocumentQuery.js.map +1 -0
- package/dist/operations/utils/utils.d.ts +4 -0
- package/dist/operations/utils/utils.d.ts.map +1 -0
- package/dist/operations/utils/utils.js +4 -0
- package/dist/operations/utils/utils.js.map +1 -0
- package/dist/operations/validateSession.d.ts +17 -0
- package/dist/operations/validateSession.d.ts.map +1 -0
- package/dist/operations/validateSession.js +27 -0
- package/dist/operations/validateSession.js.map +1 -0
- package/dist/render/index.d.ts +9 -0
- package/dist/render/index.d.ts.map +1 -0
- package/dist/render/index.js +347 -0
- package/dist/render/index.js.map +1 -0
- package/dist/render/utils/base.d.ts +74 -0
- package/dist/render/utils/base.d.ts.map +1 -0
- package/dist/render/utils/base.js +290 -0
- package/dist/render/utils/base.js.map +1 -0
- package/dist/render/utils/extractRawBlocks.d.ts +10 -0
- package/dist/render/utils/extractRawBlocks.d.ts.map +1 -0
- package/dist/render/utils/extractRawBlocks.js +28 -0
- package/dist/render/utils/extractRawBlocks.js.map +1 -0
- package/dist/render/utils/rawBlocks.d.ts +10 -0
- package/dist/render/utils/rawBlocks.d.ts.map +1 -0
- package/dist/render/utils/rawBlocks.js +28 -0
- package/dist/render/utils/rawBlocks.js.map +1 -0
- package/dist/render/utils/usageTracker.d.ts +10 -0
- package/dist/render/utils/usageTracker.d.ts.map +1 -0
- package/dist/render/utils/usageTracker.js +87 -0
- package/dist/render/utils/usageTracker.js.map +1 -0
- package/dist/responder/index.d.ts +34 -0
- package/dist/responder/index.d.ts.map +1 -0
- package/dist/responder/index.js +546 -0
- package/dist/responder/index.js.map +1 -0
- package/dist/server/index.d.ts +7 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +54 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/middleware/authorize.d.ts +3 -0
- package/dist/server/middleware/authorize.d.ts.map +1 -0
- package/dist/server/middleware/authorize.js +15 -0
- package/dist/server/middleware/authorize.js.map +1 -0
- package/dist/server/middleware/establishAuth.d.ts +3 -0
- package/dist/server/middleware/establishAuth.d.ts.map +1 -0
- package/dist/server/middleware/establishAuth.js +45 -0
- package/dist/server/middleware/establishAuth.js.map +1 -0
- package/dist/server/middleware/log.d.ts +3 -0
- package/dist/server/middleware/log.d.ts.map +1 -0
- package/dist/server/middleware/log.js +12 -0
- package/dist/server/middleware/log.js.map +1 -0
- package/dist/server/middleware/requirePathMatch.d.ts +3 -0
- package/dist/server/middleware/requirePathMatch.d.ts.map +1 -0
- package/dist/server/middleware/requirePathMatch.js +25 -0
- package/dist/server/middleware/requirePathMatch.js.map +1 -0
- package/dist/server/middleware/requireQuery.d.ts +3 -0
- package/dist/server/middleware/requireQuery.d.ts.map +1 -0
- package/dist/server/middleware/requireQuery.js +24 -0
- package/dist/server/middleware/requireQuery.js.map +1 -0
- package/dist/server/middleware/withDb.d.ts +4 -0
- package/dist/server/middleware/withDb.d.ts.map +1 -0
- package/dist/server/middleware/withDb.js +7 -0
- package/dist/server/middleware/withDb.js.map +1 -0
- package/dist/server/routes/assets.d.ts +4 -0
- package/dist/server/routes/assets.d.ts.map +1 -0
- package/dist/server/routes/assets.js +178 -0
- package/dist/server/routes/assets.js.map +1 -0
- package/dist/server/routes/documents.d.ts +4 -0
- package/dist/server/routes/documents.d.ts.map +1 -0
- package/dist/server/routes/documents.js +40 -0
- package/dist/server/routes/documents.js.map +1 -0
- package/dist/server/routes/edit.d.ts +22 -0
- package/dist/server/routes/edit.d.ts.map +1 -0
- package/dist/server/routes/edit.js +494 -0
- package/dist/server/routes/edit.js.map +1 -0
- package/dist/server/routes/git.d.ts +4 -0
- package/dist/server/routes/git.d.ts.map +1 -0
- package/dist/server/routes/git.js +612 -0
- package/dist/server/routes/git.js.map +1 -0
- package/dist/server/routes/readUpload.d.ts +4 -0
- package/dist/server/routes/readUpload.d.ts.map +1 -0
- package/dist/server/routes/readUpload.js +57 -0
- package/dist/server/routes/readUpload.js.map +1 -0
- package/dist/server/utils/NotFoundError.d.ts +9 -0
- package/dist/server/utils/NotFoundError.d.ts.map +1 -0
- package/dist/server/utils/NotFoundError.js +16 -0
- package/dist/server/utils/NotFoundError.js.map +1 -0
- package/dist/server/utils/editor.css +1535 -0
- package/dist/server/utils/htmlEditorPage.d.ts +6 -0
- package/dist/server/utils/htmlEditorPage.d.ts.map +1 -0
- package/dist/server/utils/htmlEditorPage.js +518 -0
- package/dist/server/utils/htmlEditorPage.js.map +1 -0
- package/dist/server/utils/htmlLoginPage.d.ts +6 -0
- package/dist/server/utils/htmlLoginPage.d.ts.map +1 -0
- package/dist/server/utils/htmlLoginPage.js +134 -0
- package/dist/server/utils/htmlLoginPage.js.map +1 -0
- package/dist/server/utils/layout.css +153 -0
- package/dist/server/utils/types.d.ts +18 -0
- package/dist/server/utils/types.d.ts.map +1 -0
- package/dist/server/utils/types.js +2 -0
- package/dist/server/utils/types.js.map +1 -0
- package/dist/server-bin/index.d.ts +2 -0
- package/dist/server-bin/index.d.ts.map +1 -0
- package/dist/server-bin/index.js +26 -0
- package/dist/server-bin/index.js.map +1 -0
- package/dist/utils/functionContext.d.ts +12 -0
- package/dist/utils/functionContext.d.ts.map +1 -0
- package/dist/utils/functionContext.js +19 -0
- package/dist/utils/functionContext.js.map +1 -0
- package/dist/utils/functionContextClient.d.ts +23 -0
- package/dist/utils/functionContextClient.d.ts.map +1 -0
- package/dist/utils/functionContextClient.js +93 -0
- package/dist/utils/functionContextClient.js.map +1 -0
- package/dist/utils/stringifyData.d.ts +2 -0
- package/dist/utils/stringifyData.d.ts.map +1 -0
- package/dist/utils/stringifyData.js +23 -0
- package/dist/utils/stringifyData.js.map +1 -0
- package/dist/utils/stripImageExif.d.ts +14 -0
- package/dist/utils/stripImageExif.d.ts.map +1 -0
- package/dist/utils/stripImageExif.js +112 -0
- package/dist/utils/stripImageExif.js.map +1 -0
- package/dist/utils/types.d.ts +81 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/types.js +2 -0
- package/dist/utils/types.js.map +1 -0
- package/migrations/1770796673000_initial-schema.js +178 -0
- package/package.json +97 -0
- package/pages/skywriter/.github/copilot-instructions.md +94 -0
- package/pages/skywriter/content.md +862 -0
- package/pages/skywriter/data.json +1 -0
- package/pages/skywriter/doc.code-workspace +15 -0
- package/pages/skywriter/script.js +1 -0
- package/pages/skywriter/server.js +1 -0
- package/pages/skywriter/settings.json +11 -0
- package/pages/skywriter/style.css +167 -0
- package/pages/skywriter/template/content.eta +55 -0
- package/pages/skywriter/template/data.json +1 -0
- package/pages/skywriter/template/script.js +512 -0
- package/pages/skywriter/template/server.js +27 -0
- package/pages/skywriter/template/settings.json +11 -0
- package/pages/skywriter/template/style.css +447 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { join, resolve } from 'node:path';
|
|
2
|
+
import { readSettings, normalizePath } from "../utils/pageContext.js";
|
|
3
|
+
import { createLoggedFs } from "../utils/createLoggedFs.js";
|
|
4
|
+
// --- Helpers ---
|
|
5
|
+
async function getUploadsFromDir(dir, fs) {
|
|
6
|
+
try {
|
|
7
|
+
await fs.access(dir);
|
|
8
|
+
const stats = await fs.stat(dir);
|
|
9
|
+
if (!stats.isDirectory())
|
|
10
|
+
return [];
|
|
11
|
+
const files = await fs.readdir(dir);
|
|
12
|
+
const results = [];
|
|
13
|
+
for (const file of files) {
|
|
14
|
+
if (file.startsWith('.'))
|
|
15
|
+
continue;
|
|
16
|
+
const filePath = join(dir, file);
|
|
17
|
+
const fileStat = await fs.stat(filePath);
|
|
18
|
+
if (fileStat.isFile()) {
|
|
19
|
+
results.push(file);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return results;
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function dirLabel(dir) {
|
|
29
|
+
return dir === '.' ? '' : `${dir}/`;
|
|
30
|
+
}
|
|
31
|
+
// --- Uploads sync check ---
|
|
32
|
+
async function checkUploadsSync(absDir, settings, fs) {
|
|
33
|
+
const issues = [];
|
|
34
|
+
const uploadsDir = join(absDir, 'uploads');
|
|
35
|
+
const uploadsExist = await fs.directoryExists(uploadsDir);
|
|
36
|
+
if (!uploadsExist)
|
|
37
|
+
return issues;
|
|
38
|
+
const localUploads = await getUploadsFromDir(uploadsDir, fs);
|
|
39
|
+
const currentUploads = settings.uploads || [];
|
|
40
|
+
const newUploads = localUploads.filter(f => !currentUploads.includes(f));
|
|
41
|
+
const removedUploads = currentUploads.filter(f => !localUploads.includes(f));
|
|
42
|
+
if (newUploads.length > 0 || removedUploads.length > 0) {
|
|
43
|
+
const parts = [];
|
|
44
|
+
if (newUploads.length > 0)
|
|
45
|
+
parts.push(`add ${newUploads.join(', ')}`);
|
|
46
|
+
if (removedUploads.length > 0)
|
|
47
|
+
parts.push(`remove ${removedUploads.join(', ')}`);
|
|
48
|
+
issues.push({
|
|
49
|
+
message: `settings.json uploads out of sync: ${parts.join('; ')}`,
|
|
50
|
+
fix: `Sync settings.json uploads array`,
|
|
51
|
+
apply: async () => {
|
|
52
|
+
await fs.updateJsonProperty(join(absDir, 'settings.json'), ['uploads'], localUploads);
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return issues;
|
|
57
|
+
}
|
|
58
|
+
// --- Build child PathContext ---
|
|
59
|
+
function buildChildCtx(parentCtx, childName, childSettings, forbiddenPaths) {
|
|
60
|
+
const childDir = parentCtx.dir === '.' ? childName : join(parentCtx.dir, childName);
|
|
61
|
+
return {
|
|
62
|
+
...parentCtx,
|
|
63
|
+
reference: childName,
|
|
64
|
+
path: childSettings.path,
|
|
65
|
+
normalizedPath: normalizePath(childSettings.path),
|
|
66
|
+
settings: childSettings,
|
|
67
|
+
dir: childDir,
|
|
68
|
+
absoluteDir: resolve(parentCtx.absoluteDir, childName),
|
|
69
|
+
log: parentCtx.log.prefix(childName),
|
|
70
|
+
forbiddenPaths,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
// --- Main PathOperation ---
|
|
74
|
+
/**
|
|
75
|
+
* Validate settings.json for a path and its children (template/slot).
|
|
76
|
+
* Fractal: applies the same validation at each level.
|
|
77
|
+
* Returns a list of issues, each optionally with a fix.
|
|
78
|
+
*/
|
|
79
|
+
export const validatePathSettings = async (ctx) => {
|
|
80
|
+
const issues = [];
|
|
81
|
+
const fs = createLoggedFs(ctx.log, ctx.absoluteDir);
|
|
82
|
+
const { settings, dir } = ctx;
|
|
83
|
+
// Resolve file paths against absoluteDir so operations work regardless of process.cwd()
|
|
84
|
+
const absDir = ctx.absoluteDir;
|
|
85
|
+
// 1. Validate path field
|
|
86
|
+
if (!settings.path) {
|
|
87
|
+
issues.push({ message: `${dirLabel(dir)}settings.json is missing the "path" field` });
|
|
88
|
+
return issues;
|
|
89
|
+
}
|
|
90
|
+
// 2. Check path doesn't collide with forbidden (parent/sibling) paths
|
|
91
|
+
const forbidden = ctx.forbiddenPaths || [];
|
|
92
|
+
if (forbidden.includes(settings.path)) {
|
|
93
|
+
issues.push({
|
|
94
|
+
message: `${dirLabel(dir)}settings.json path "${settings.path}" collides with a parent or sibling path`,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
// 3. Discover children
|
|
98
|
+
const templateDir = join(absDir, 'template');
|
|
99
|
+
const slotDir = join(absDir, 'slot');
|
|
100
|
+
const templateLabel = `${dirLabel(dir)}template/`;
|
|
101
|
+
const slotLabel = `${dirLabel(dir)}slot/`;
|
|
102
|
+
const templateExists = await fs.directoryExists(templateDir);
|
|
103
|
+
const slotExists = await fs.directoryExists(slotDir);
|
|
104
|
+
const templateSettings = templateExists ? await readSettings(templateDir, fs) : null;
|
|
105
|
+
const slotSettings = slotExists ? await readSettings(slotDir, fs) : null;
|
|
106
|
+
// 4. Check child settings.json existence — create if missing
|
|
107
|
+
if (templateExists && !templateSettings) {
|
|
108
|
+
const templatePath = settings.template_path || `${settings.path}/template`;
|
|
109
|
+
issues.push({
|
|
110
|
+
message: `${templateLabel}settings.json is missing`,
|
|
111
|
+
fix: `Create ${templateLabel}settings.json with path "${templatePath}"`,
|
|
112
|
+
apply: async () => {
|
|
113
|
+
await fs.writeFile(join(templateDir, 'settings.json'), JSON.stringify({ path: templatePath }, null, 2) + '\n');
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
if (slotExists && !slotSettings) {
|
|
118
|
+
const slotPath = settings.slot_path || `${settings.path}/slot`;
|
|
119
|
+
issues.push({
|
|
120
|
+
message: `${slotLabel}settings.json is missing`,
|
|
121
|
+
fix: `Create ${slotLabel}settings.json with path "${slotPath}"`,
|
|
122
|
+
apply: async () => {
|
|
123
|
+
await fs.writeFile(join(slotDir, 'settings.json'), JSON.stringify({ path: slotPath }, null, 2) + '\n');
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
// 5. Template dir exists but template_path not set in parent
|
|
128
|
+
if (templateExists && !settings.template_path) {
|
|
129
|
+
const templatePath = templateSettings?.path || `${settings.path}/template`;
|
|
130
|
+
issues.push({
|
|
131
|
+
message: `${dirLabel(dir)}Template directory exists but template_path is not set in settings.json`,
|
|
132
|
+
fix: `Set template_path to "${templatePath}"`,
|
|
133
|
+
apply: async () => {
|
|
134
|
+
await fs.updateJsonProperty(join(absDir, 'settings.json'), ['template_path'], templatePath);
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
// 6. Slot dir exists but slot_path not set in parent
|
|
139
|
+
if (slotExists && !settings.slot_path) {
|
|
140
|
+
const slotPath = slotSettings?.path || `${settings.path}/slot`;
|
|
141
|
+
issues.push({
|
|
142
|
+
message: `${dirLabel(dir)}Slot directory exists but slot_path is not set in settings.json`,
|
|
143
|
+
fix: `Set slot_path to "${slotPath}"`,
|
|
144
|
+
apply: async () => {
|
|
145
|
+
await fs.updateJsonProperty(join(absDir, 'settings.json'), ['slot_path'], slotPath);
|
|
146
|
+
},
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
// 7. Template path mismatch between parent's template_path and template/settings.json
|
|
150
|
+
if (templateExists && settings.template_path && templateSettings) {
|
|
151
|
+
if (templateSettings.path !== settings.template_path) {
|
|
152
|
+
issues.push({
|
|
153
|
+
message: `template_path "${settings.template_path}" differs from ${templateLabel}settings.json path "${templateSettings.path}"`,
|
|
154
|
+
fix: `Update template_path to "${templateSettings.path}"`,
|
|
155
|
+
apply: async () => {
|
|
156
|
+
await fs.updateJsonProperty(join(absDir, 'settings.json'), ['template_path'], templateSettings.path);
|
|
157
|
+
},
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
// 8. Slot path mismatch between parent's slot_path and slot/settings.json
|
|
162
|
+
if (slotExists && settings.slot_path && slotSettings) {
|
|
163
|
+
if (slotSettings.path !== settings.slot_path) {
|
|
164
|
+
issues.push({
|
|
165
|
+
message: `slot_path "${settings.slot_path}" differs from ${slotLabel}settings.json path "${slotSettings.path}"`,
|
|
166
|
+
fix: `Update slot_path to "${slotSettings.path}"`,
|
|
167
|
+
apply: async () => {
|
|
168
|
+
await fs.updateJsonProperty(join(absDir, 'settings.json'), ['slot_path'], slotSettings.path);
|
|
169
|
+
},
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
// 9. Uploads sync for this level
|
|
174
|
+
issues.push(...(await checkUploadsSync(absDir, settings, fs)));
|
|
175
|
+
// 10. Build forbidden paths for children (no child should reuse parent or sibling paths)
|
|
176
|
+
const childForbidden = [settings.path, ...forbidden];
|
|
177
|
+
// 11. Fractally validate template
|
|
178
|
+
if (templateExists && templateSettings) {
|
|
179
|
+
const templateForbidden = [...childForbidden, ...(slotSettings?.path ? [slotSettings.path] : [])];
|
|
180
|
+
const templateCtx = buildChildCtx(ctx, 'template', templateSettings, templateForbidden);
|
|
181
|
+
issues.push(...(await validatePathSettings(templateCtx)));
|
|
182
|
+
}
|
|
183
|
+
// 12. Fractally validate slot
|
|
184
|
+
if (slotExists && slotSettings) {
|
|
185
|
+
const slotForbidden = [...childForbidden, ...(templateSettings?.path ? [templateSettings.path] : [])];
|
|
186
|
+
const slotCtx = buildChildCtx(ctx, 'slot', slotSettings, slotForbidden);
|
|
187
|
+
issues.push(...(await validatePathSettings(slotCtx)));
|
|
188
|
+
}
|
|
189
|
+
return issues;
|
|
190
|
+
};
|
|
191
|
+
//# sourceMappingURL=validatePathSettings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validatePathSettings.js","sourceRoot":"","sources":["../../../src/cli/pathOperations/validatePathSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAE,OAAO,EAAC,MAAM,WAAW,CAAA;AAEvC,OAAO,EAAC,YAAY,EAAE,aAAa,EAAC,MAAM,yBAAyB,CAAA;AACnE,OAAO,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAA;AAUzD,kBAAkB;AAElB,KAAK,UAAU,iBAAiB,CAAC,GAAW,EAAE,EAAY;IACxD,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QACpB,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAChC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;YAAE,OAAO,EAAE,CAAA;QACnC,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;QACnC,MAAM,OAAO,GAAa,EAAE,CAAA;QAC5B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;gBAAE,SAAQ;YAClC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;YAChC,MAAM,QAAQ,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;YACxC,IAAI,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;gBACtB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACpB,CAAC;QACH,CAAC;QACD,OAAO,OAAO,CAAA;IAChB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,CAAA;QACjG,MAAM,WAAW,GAAG,aAAa,CAAC,GAAG,EAAE,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,CAAA;QACvF,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,oBAAoB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAA;IAC3D,CAAC;IAED,8BAA8B;IAC9B,IAAI,UAAU,IAAI,YAAY,EAAE,CAAC;QAC/B,MAAM,aAAa,GAAG,CAAC,GAAG,cAAc,EAAE,GAAG,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;QACrG,MAAM,OAAO,GAAG,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,CAAC,CAAA;QACvE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IACvD,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { RenderDocument } from '../../operations/types.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Options for assembleDocument
|
|
4
|
+
*/
|
|
5
|
+
interface AssembleOptions {
|
|
6
|
+
/** Whether this is a nested template/slot (prevents recursive template/slot loading) */
|
|
7
|
+
isNested?: boolean;
|
|
8
|
+
/** Optional resolver to find template/slot by path from a document graph */
|
|
9
|
+
resolveDocumentPath?: (path: string) => Promise<string | null>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Assemble a RenderDocument from local files in the specified directory
|
|
13
|
+
* This creates an in-memory representation of the document without touching the database
|
|
14
|
+
*
|
|
15
|
+
* @param dir - Directory path to read files from (defaults to current working directory)
|
|
16
|
+
* @param options - Assembly options including isNested flag and optional path resolver
|
|
17
|
+
* @returns RenderDocument assembled from local files
|
|
18
|
+
* @throws Error if required files are missing
|
|
19
|
+
*/
|
|
20
|
+
export declare function assemble(dir?: string, optionsOrIsNested?: boolean | AssembleOptions): Promise<RenderDocument>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=assemble.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assemble.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/assemble.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAa,cAAc,EAAC,MAAM,2BAA2B,CAAA;AA4GzE;;GAEG;AACH,UAAU,eAAe;IACvB,wFAAwF;IACxF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,4EAA4E;IAC5E,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;CAC/D;AAED;;;;;;;;GAQG;AACH,wBAAsB,QAAQ,CAC5B,GAAG,GAAE,MAAsB,EAC3B,iBAAiB,GAAE,OAAO,GAAG,eAAuB,GACnD,OAAO,CAAC,cAAc,CAAC,CAoJzB"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { readFile, readdir } from 'node:fs/promises';
|
|
2
|
+
import { extname, join } from 'node:path';
|
|
3
|
+
/**
|
|
4
|
+
* Read all local document files from the specified directory
|
|
5
|
+
*/
|
|
6
|
+
async function readLocalFiles(dir = '.') {
|
|
7
|
+
const files = await readdir(dir);
|
|
8
|
+
const result = {};
|
|
9
|
+
// Find content file (content.* or index.html)
|
|
10
|
+
const contentFiles = files.filter(f => f.startsWith('content.'));
|
|
11
|
+
const hasIndexHtml = files.includes('index.html');
|
|
12
|
+
const totalContentFiles = contentFiles.length + (hasIndexHtml ? 1 : 0);
|
|
13
|
+
if (totalContentFiles > 1) {
|
|
14
|
+
const foundFiles = [...contentFiles, ...(hasIndexHtml ? ['index.html'] : [])];
|
|
15
|
+
throw new Error(`Multiple content files found: ${foundFiles.join(', ')}. Only one content file (content.* or index.html) is allowed per directory.`);
|
|
16
|
+
}
|
|
17
|
+
if (contentFiles.length === 1) {
|
|
18
|
+
result.content = await readFile(join(dir, contentFiles[0]), 'utf-8');
|
|
19
|
+
}
|
|
20
|
+
else if (hasIndexHtml) {
|
|
21
|
+
result.content = await readFile(join(dir, 'index.html'), 'utf-8');
|
|
22
|
+
}
|
|
23
|
+
// Find data file (data.*)
|
|
24
|
+
const dataFiles = files.filter(f => f.startsWith('data.'));
|
|
25
|
+
if (dataFiles.length === 1) {
|
|
26
|
+
result.data = await readFile(join(dir, dataFiles[0]), 'utf-8');
|
|
27
|
+
}
|
|
28
|
+
// Read optional files
|
|
29
|
+
try {
|
|
30
|
+
result.style = await readFile(join(dir, 'style.css'), 'utf-8');
|
|
31
|
+
}
|
|
32
|
+
catch { }
|
|
33
|
+
try {
|
|
34
|
+
result.script = await readFile(join(dir, 'script.js'), 'utf-8');
|
|
35
|
+
}
|
|
36
|
+
catch { }
|
|
37
|
+
try {
|
|
38
|
+
result.server = await readFile(join(dir, 'server.js'), 'utf-8');
|
|
39
|
+
}
|
|
40
|
+
catch { }
|
|
41
|
+
// Read settings.json
|
|
42
|
+
try {
|
|
43
|
+
const settingsContent = await readFile(join(dir, 'settings.json'), 'utf-8');
|
|
44
|
+
const settings = JSON.parse(settingsContent);
|
|
45
|
+
result.path = settings.path;
|
|
46
|
+
result.title = settings.title;
|
|
47
|
+
result.template_path = settings.template_path;
|
|
48
|
+
result.slot_path = settings.slot_path;
|
|
49
|
+
result.mime_type = settings.mime_type;
|
|
50
|
+
}
|
|
51
|
+
catch { }
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Determine content type based on file extension
|
|
56
|
+
*/
|
|
57
|
+
function getContentType(filename) {
|
|
58
|
+
const ext = extname(filename).toLowerCase();
|
|
59
|
+
const typeMap = {
|
|
60
|
+
'.md': 'text/markdown',
|
|
61
|
+
'.html': 'text/html',
|
|
62
|
+
'.eta': 'text/html', // ETA templates render to HTML
|
|
63
|
+
'.txt': 'text/plain',
|
|
64
|
+
};
|
|
65
|
+
return typeMap[ext] || 'text/plain';
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Determine data type based on file extension
|
|
69
|
+
*/
|
|
70
|
+
function getDataType(filename) {
|
|
71
|
+
const ext = extname(filename).toLowerCase();
|
|
72
|
+
const typeMap = {
|
|
73
|
+
'.yaml': 'yaml',
|
|
74
|
+
'.yml': 'yaml',
|
|
75
|
+
'.json': 'json',
|
|
76
|
+
'.toml': 'toml',
|
|
77
|
+
};
|
|
78
|
+
return typeMap[ext] || null;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Check if content has ETA templates
|
|
82
|
+
*/
|
|
83
|
+
function hasEtaTemplates(content) {
|
|
84
|
+
return /<%[\s\S]*?%>/.test(content);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Assemble a RenderDocument from local files in the specified directory
|
|
88
|
+
* This creates an in-memory representation of the document without touching the database
|
|
89
|
+
*
|
|
90
|
+
* @param dir - Directory path to read files from (defaults to current working directory)
|
|
91
|
+
* @param options - Assembly options including isNested flag and optional path resolver
|
|
92
|
+
* @returns RenderDocument assembled from local files
|
|
93
|
+
* @throws Error if required files are missing
|
|
94
|
+
*/
|
|
95
|
+
export async function assemble(dir = process.cwd(), optionsOrIsNested = false) {
|
|
96
|
+
// Handle legacy boolean parameter
|
|
97
|
+
const options = typeof optionsOrIsNested === 'boolean' ? { isNested: optionsOrIsNested } : optionsOrIsNested;
|
|
98
|
+
const { isNested = false, resolveDocumentPath } = options;
|
|
99
|
+
const files = await readLocalFiles(dir);
|
|
100
|
+
// Validate required files
|
|
101
|
+
if (files.content === undefined) {
|
|
102
|
+
throw new Error('No content file found (e.g., content.md)');
|
|
103
|
+
}
|
|
104
|
+
// Default to root path if not specified (for local serve)
|
|
105
|
+
const documentPath = files.path || '/';
|
|
106
|
+
// Find content file for metadata
|
|
107
|
+
const allFiles = await readdir(dir);
|
|
108
|
+
const contentFile = allFiles.find(f => f.startsWith('content.')) || (allFiles.includes('index.html') ? 'index.html' : undefined);
|
|
109
|
+
const dataFile = allFiles.find(f => f.startsWith('data.'));
|
|
110
|
+
if (!contentFile) {
|
|
111
|
+
throw new Error('Content file not found');
|
|
112
|
+
}
|
|
113
|
+
const content = files.content;
|
|
114
|
+
const contentTypeValue = getContentType(contentFile);
|
|
115
|
+
const dataTypeValue = dataFile ? getDataType(dataFile) : null;
|
|
116
|
+
const hasEta = hasEtaTemplates(content);
|
|
117
|
+
const mimeType = files.mime_type || 'text/html; charset=UTF-8';
|
|
118
|
+
// Normalize extension: .md, .html, and .eta all become .html since they render to HTML
|
|
119
|
+
const actualExtension = extname(contentFile).toLowerCase();
|
|
120
|
+
const extension = ['.md', '.html', '.eta'].includes(actualExtension) ? '.html' : actualExtension;
|
|
121
|
+
// Create a minimal RenderDocument structure
|
|
122
|
+
const now = new Date();
|
|
123
|
+
const document = {
|
|
124
|
+
// Core document fields
|
|
125
|
+
id: 0, // Placeholder ID for in-memory document
|
|
126
|
+
path: documentPath,
|
|
127
|
+
published: false,
|
|
128
|
+
redirect: false,
|
|
129
|
+
// Document instance fields
|
|
130
|
+
title: files.title || 'Untitled',
|
|
131
|
+
content: content,
|
|
132
|
+
data: files.data || '',
|
|
133
|
+
style: files.style || '',
|
|
134
|
+
script: files.script || '',
|
|
135
|
+
server: files.server || '',
|
|
136
|
+
template_id: null,
|
|
137
|
+
slot_id: null,
|
|
138
|
+
content_type: contentTypeValue,
|
|
139
|
+
data_type: dataTypeValue,
|
|
140
|
+
has_eta: hasEta,
|
|
141
|
+
mime_type: mimeType,
|
|
142
|
+
extension: extension,
|
|
143
|
+
created_at: now,
|
|
144
|
+
updated_at: now,
|
|
145
|
+
// Render document specific fields
|
|
146
|
+
draft: true, // Local files are considered drafts
|
|
147
|
+
redirects: [],
|
|
148
|
+
uploads: [],
|
|
149
|
+
};
|
|
150
|
+
// Only load template/slot for top-level documents, not for nested templates/slots
|
|
151
|
+
if (!isNested) {
|
|
152
|
+
// Assemble slot if slot_path is present in settings
|
|
153
|
+
if (files.slot_path) {
|
|
154
|
+
let slotDoc = null;
|
|
155
|
+
// First try local slot/ directory
|
|
156
|
+
try {
|
|
157
|
+
const slotDir = join(dir, 'slot');
|
|
158
|
+
slotDoc = await assemble(slotDir, { isNested: true });
|
|
159
|
+
// Validate slot path matches
|
|
160
|
+
if (slotDoc.path !== files.slot_path) {
|
|
161
|
+
throw new Error(`Slot path mismatch: settings.json specifies "${files.slot_path}" but slot/settings.json has "${slotDoc.path}"`);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
if (error.code !== 'ENOENT') {
|
|
166
|
+
throw error;
|
|
167
|
+
}
|
|
168
|
+
// Local slot/ directory not found, try resolver
|
|
169
|
+
if (resolveDocumentPath) {
|
|
170
|
+
const resolvedPath = await resolveDocumentPath(files.slot_path);
|
|
171
|
+
if (resolvedPath) {
|
|
172
|
+
slotDoc = await assemble(resolvedPath, { isNested: true });
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (slotDoc) {
|
|
177
|
+
document.slot = slotDoc;
|
|
178
|
+
}
|
|
179
|
+
else if (!resolveDocumentPath) {
|
|
180
|
+
// Only throw if there's no resolver (legacy single-document mode)
|
|
181
|
+
throw new Error(`Slot directory not found: settings.json references slot_path "${files.slot_path}" but no slot/ directory exists`);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
// Assemble template if template_path is present in settings
|
|
185
|
+
if (files.template_path) {
|
|
186
|
+
let templateDoc = null;
|
|
187
|
+
// First try local template/ directory
|
|
188
|
+
try {
|
|
189
|
+
const templateDir = join(dir, 'template');
|
|
190
|
+
templateDoc = await assemble(templateDir, { isNested: true });
|
|
191
|
+
// Validate template path matches
|
|
192
|
+
if (templateDoc.path !== files.template_path) {
|
|
193
|
+
throw new Error(`Template path mismatch: settings.json specifies "${files.template_path}" but template/settings.json has "${templateDoc.path}"`);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
catch (error) {
|
|
197
|
+
if (error.code !== 'ENOENT') {
|
|
198
|
+
throw error;
|
|
199
|
+
}
|
|
200
|
+
// Local template/ directory not found, try resolver
|
|
201
|
+
if (resolveDocumentPath) {
|
|
202
|
+
const resolvedPath = await resolveDocumentPath(files.template_path);
|
|
203
|
+
if (resolvedPath) {
|
|
204
|
+
templateDoc = await assemble(resolvedPath, { isNested: true });
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (templateDoc) {
|
|
209
|
+
document.template = templateDoc;
|
|
210
|
+
}
|
|
211
|
+
else if (!resolveDocumentPath) {
|
|
212
|
+
// Only throw if there's no resolver (legacy single-document mode)
|
|
213
|
+
throw new Error(`Template directory not found: settings.json references template_path "${files.template_path}" but no template/ directory exists`);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return document;
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=assemble.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assemble.js","sourceRoot":"","sources":["../../../src/cli/utils/assemble.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAE,OAAO,EAAC,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAC,OAAO,EAAE,IAAI,EAAC,MAAM,WAAW,CAAA;AAgBvC;;GAEG;AACH,KAAK,UAAU,cAAc,CAAC,MAAc,GAAG;IAC7C,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAA;IAChC,MAAM,MAAM,GAAe,EAAE,CAAA;IAE7B,8CAA8C;IAC9C,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAA;IAChE,MAAM,YAAY,GAAG,KAAK,CAAC,QAAQ,CAAC,YAAY,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AAK,CAAC,aAAa,CAAC,CAAA;oBACnE,IAAI,YAAY,EAAE,CAAC;wBACjB,WAAW,GAAG,MAAM,QAAQ,CAAC,YAAY,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAA;oBAC9D,CAAC;gBACH,CAAC;YACH,CAAC;YAED,IAAI,WAAW,EAAE,CAAC;gBAChB,QAAQ,CAAC,QAAQ,GAAG,WAAW,CAAA;YACjC,CAAC;iBAAM,IAAI,CAAC,mBAAmB,EAAE,CAAC;gBAChC,kEAAkE;gBAClE,MAAM,IAAI,KAAK,CACb,yEAAyE,KAAK,CAAC,aAAa,qCAAqC,CAClI,CAAA;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cliName.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/cliName.ts"],"names":[],"mappings":"AAGA,wBAAgB,UAAU,IAAI,MAAM,CAYnC;AAED,wBAAgB,QAAQ,IAAI,MAAM,CAEjC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
export function getCliName() {
|
|
4
|
+
const packageJsonUrl = new URL('../../../package.json', import.meta.url);
|
|
5
|
+
const text = readFileSync(fileURLToPath(packageJsonUrl), 'utf8');
|
|
6
|
+
const parsed = JSON.parse(text);
|
|
7
|
+
const bin = parsed.bin;
|
|
8
|
+
const firstKey = bin ? Object.keys(bin)[0] : undefined;
|
|
9
|
+
if (!firstKey) {
|
|
10
|
+
throw new Error('Unable to determine CLI name from package.json `bin` field');
|
|
11
|
+
}
|
|
12
|
+
return firstKey;
|
|
13
|
+
}
|
|
14
|
+
export function getCliId() {
|
|
15
|
+
return getCliName().replace(/[^a-zA-Z0-9._-]/g, '-');
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=cliName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cliName.js","sourceRoot":"","sources":["../../../src/cli/utils/cliName.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,SAAS,CAAA;AACpC,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAA;AAEtC,MAAM,UAAU,UAAU;IACxB,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,uBAAuB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACxE,MAAM,IAAI,GAAG,YAAY,CAAC,aAAa,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,CAAA;IAChE,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAmC,CAAA;IAEjE,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAA;IACtB,MAAM,QAAQ,GAAG,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IACtD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAA;IAC/E,CAAC;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC;AAED,MAAM,UAAU,QAAQ;IACtB,OAAO,UAAU,EAAE,CAAC,OAAO,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAA;AACtD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface WorkspaceFolder {
|
|
2
|
+
name: string;
|
|
3
|
+
path: string;
|
|
4
|
+
}
|
|
5
|
+
export interface Workspace {
|
|
6
|
+
folders: WorkspaceFolder[];
|
|
7
|
+
settings: {
|
|
8
|
+
'terminal.integrated.cwd': string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export declare const codeWorkspace: Workspace;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=codeWorkspace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codeWorkspace.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/codeWorkspace.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,eAAe,EAAE,CAAA;IAC1B,QAAQ,EAAE;QACR,yBAAyB,EAAE,MAAM,CAAA;KAClC,CAAA;CACF;AAED,eAAO,MAAM,aAAa,EAAE,SAkB3B,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const codeWorkspace = {
|
|
2
|
+
folders: [
|
|
3
|
+
{
|
|
4
|
+
name: 'root',
|
|
5
|
+
path: '.',
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
name: 'template',
|
|
9
|
+
path: 'template',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: 'slot',
|
|
13
|
+
path: 'slot',
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
settings: {
|
|
17
|
+
'terminal.integrated.cwd': '${workspaceFolder:root}',
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=codeWorkspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codeWorkspace.js","sourceRoot":"","sources":["../../../src/cli/utils/codeWorkspace.ts"],"names":[],"mappings":"AAYA,MAAM,CAAC,MAAM,aAAa,GAAc;IACtC,OAAO,EAAE;QACP;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,GAAG;SACV;QACD;YACE,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,UAAU;SACjB;QACD;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,MAAM;SACb;KACF;IACD,QAAQ,EAAE;QACR,yBAAyB,EAAE,yBAAyB;KACrD;CACF,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple ANSI color utilities for CLI output
|
|
3
|
+
* No external dependencies - uses standard ANSI escape codes
|
|
4
|
+
*/
|
|
5
|
+
export declare const bold: (s: string) => string;
|
|
6
|
+
export declare const dim: (s: string) => string;
|
|
7
|
+
export declare const red: (s: string) => string;
|
|
8
|
+
export declare const green: (s: string) => string;
|
|
9
|
+
export declare const yellow: (s: string) => string;
|
|
10
|
+
export declare const blue: (s: string) => string;
|
|
11
|
+
export declare const magenta: (s: string) => string;
|
|
12
|
+
export declare const cyan: (s: string) => string;
|
|
13
|
+
export declare const gray: (s: string) => string;
|
|
14
|
+
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/colors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,eAAO,MAAM,IAAI,GAAI,GAAG,MAAM,WAA6B,CAAA;AAC3D,eAAO,MAAM,GAAG,GAAI,GAAG,MAAM,WAA6B,CAAA;AAG1D,eAAO,MAAM,GAAG,GAAI,GAAG,MAAM,WAA8B,CAAA;AAC3D,eAAO,MAAM,KAAK,GAAI,GAAG,MAAM,WAA8B,CAAA;AAC7D,eAAO,MAAM,MAAM,GAAI,GAAG,MAAM,WAA8B,CAAA;AAC9D,eAAO,MAAM,IAAI,GAAI,GAAG,MAAM,WAA8B,CAAA;AAC5D,eAAO,MAAM,OAAO,GAAI,GAAG,MAAM,WAA8B,CAAA;AAC/D,eAAO,MAAM,IAAI,GAAI,GAAG,MAAM,WAA8B,CAAA;AAE5D,eAAO,MAAM,IAAI,GAAI,GAAG,MAAM,WAA8B,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple ANSI color utilities for CLI output
|
|
3
|
+
* No external dependencies - uses standard ANSI escape codes
|
|
4
|
+
*/
|
|
5
|
+
// Check if colors should be disabled (NO_COLOR env var or non-TTY)
|
|
6
|
+
const supportsColor = process.stdout.isTTY && !process.env.NO_COLOR;
|
|
7
|
+
const code = (n) => (supportsColor ? `\x1b[${n}m` : '');
|
|
8
|
+
// Reset (internal use)
|
|
9
|
+
const reset = code(0);
|
|
10
|
+
// Styles
|
|
11
|
+
export const bold = (s) => `${code(1)}${s}${reset}`;
|
|
12
|
+
export const dim = (s) => `${code(2)}${s}${reset}`;
|
|
13
|
+
// Colors
|
|
14
|
+
export const red = (s) => `${code(31)}${s}${reset}`;
|
|
15
|
+
export const green = (s) => `${code(32)}${s}${reset}`;
|
|
16
|
+
export const yellow = (s) => `${code(33)}${s}${reset}`;
|
|
17
|
+
export const blue = (s) => `${code(34)}${s}${reset}`;
|
|
18
|
+
export const magenta = (s) => `${code(35)}${s}${reset}`;
|
|
19
|
+
export const cyan = (s) => `${code(36)}${s}${reset}`;
|
|
20
|
+
const _cyanBright = (s) => `${code(96)}${s}${reset}`;
|
|
21
|
+
export const gray = (s) => `${code(90)}${s}${reset}`;
|
|
22
|
+
//# sourceMappingURL=colors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.js","sourceRoot":"","sources":["../../../src/cli/utils/colors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,mEAAmE;AACnE,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAA;AAEnE,MAAM,IAAI,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;AAE/D,uBAAuB;AACvB,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;AAErB,SAAS;AACT,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CA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
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import type { CliContext } from './types.ts';
|
|
3
|
+
import type { PrefixLog } from './prefixLog.ts';
|
|
4
|
+
interface CliConfig {
|
|
5
|
+
serverUrl: string;
|
|
6
|
+
username: string;
|
|
7
|
+
password: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Sanitize server URL by removing trailing slashes, paths, queries, etc.
|
|
11
|
+
*/
|
|
12
|
+
export declare function sanitizeServerUrl(url: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Parsed and resolved source: server URL, document path, and credentials.
|
|
15
|
+
* Attached to CliContext by push/pull commands so downstream handlers
|
|
16
|
+
* don't need to re-parse the positional argument.
|
|
17
|
+
*/
|
|
18
|
+
interface ResolvedSource {
|
|
19
|
+
serverUrl: string;
|
|
20
|
+
documentPath: string;
|
|
21
|
+
username: string;
|
|
22
|
+
password: string;
|
|
23
|
+
auth: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Parse a source argument and resolve credentials for the target server.
|
|
27
|
+
* Handles all source formats: full URL, /path, bare name.
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveSource(ctx: CliContext, log: PrefixLog, source: string): Promise<ResolvedSource>;
|
|
30
|
+
/**
|
|
31
|
+
* Read the CLI configuration file (uses default server or specified server)
|
|
32
|
+
*/
|
|
33
|
+
export declare function readConfig(ctx: CliContext, log: PrefixLog, serverUrl?: string, username?: string): Promise<CliConfig>;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/config.ts"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,YAAY,CAAA;AAC1C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAA;AAE7C,UAAU,SAAS;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQrD;AAwBD;;;;GAIG;AACH,UAAU,cAAc;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;GAGG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAa5G;AAqBD;;GAEG;AACH,wBAAsB,UAAU,CAC9B,GAAG,EAAE,UAAU,EACf,GAAG,EAAE,SAAS,EACd,SAAS,CAAC,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,SAAS,CAAC,CAuBpB"}
|