@valkyrianlabs/payload-markdown-docs 0.3.1 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/README.md +79 -171
  2. package/dist/admin/DocsSetManager.js +5 -3
  3. package/dist/admin/DocsSetManager.js.map +1 -1
  4. package/dist/admin/docsSetManagerData.d.ts +6 -5
  5. package/dist/admin/docsSetManagerData.js +60 -33
  6. package/dist/admin/docsSetManagerData.js.map +1 -1
  7. package/dist/admin/docsSetManagerTypes.d.ts +12 -9
  8. package/dist/admin/docsSetManagerTypes.js.map +1 -1
  9. package/dist/cli/commands/manifest.js +1 -2
  10. package/dist/cli/commands/manifest.js.map +1 -1
  11. package/dist/cli/commands/plan.js +1 -2
  12. package/dist/cli/commands/plan.js.map +1 -1
  13. package/dist/cli/commands/push.js +19 -12
  14. package/dist/cli/commands/push.js.map +1 -1
  15. package/dist/cli/commands/validate.js +11 -6
  16. package/dist/cli/commands/validate.js.map +1 -1
  17. package/dist/cli/index.js +6 -15
  18. package/dist/cli/index.js.map +1 -1
  19. package/dist/cli/parseArgs.js +0 -3
  20. package/dist/cli/parseArgs.js.map +1 -1
  21. package/dist/cli/types.d.ts +0 -3
  22. package/dist/cli/types.js.map +1 -1
  23. package/dist/collections/docs.js +0 -24
  24. package/dist/collections/docs.js.map +1 -1
  25. package/dist/collections/docsGroups.js +8 -9
  26. package/dist/collections/docsGroups.js.map +1 -1
  27. package/dist/collections/docsKeys.d.ts +5 -0
  28. package/dist/collections/docsKeys.js +44 -0
  29. package/dist/collections/docsKeys.js.map +1 -0
  30. package/dist/collections/docsSets.js +47 -202
  31. package/dist/collections/docsSets.js.map +1 -1
  32. package/dist/collections/docsTrusted.d.ts +5 -0
  33. package/dist/collections/docsTrusted.js +60 -0
  34. package/dist/collections/docsTrusted.js.map +1 -0
  35. package/dist/collections/index.d.ts +4 -0
  36. package/dist/collections/index.js +2 -0
  37. package/dist/collections/index.js.map +1 -1
  38. package/dist/constants.d.ts +3 -1
  39. package/dist/constants.js +3 -1
  40. package/dist/constants.js.map +1 -1
  41. package/dist/endpoints/sync.d.ts +6 -7
  42. package/dist/endpoints/sync.js +57 -124
  43. package/dist/endpoints/sync.js.map +1 -1
  44. package/dist/index.d.ts +2 -2
  45. package/dist/index.js +1 -1
  46. package/dist/index.js.map +1 -1
  47. package/dist/next/PayloadMarkdownDocsPage.js +2 -6
  48. package/dist/next/PayloadMarkdownDocsPage.js.map +1 -1
  49. package/dist/next/index.d.ts +2 -0
  50. package/dist/next/index.js +1 -0
  51. package/dist/next/index.js.map +1 -1
  52. package/dist/next/links.d.ts +11 -0
  53. package/dist/next/links.js +79 -0
  54. package/dist/next/links.js.map +1 -0
  55. package/dist/next/markdown.js +91 -19
  56. package/dist/next/markdown.js.map +1 -1
  57. package/dist/next/metadata.js +6 -6
  58. package/dist/next/metadata.js.map +1 -1
  59. package/dist/next/records.js +13 -23
  60. package/dist/next/records.js.map +1 -1
  61. package/dist/next/route.js +141 -49
  62. package/dist/next/route.js.map +1 -1
  63. package/dist/next/types.d.ts +0 -14
  64. package/dist/next/types.js.map +1 -1
  65. package/dist/payload/docsKeys.d.ts +20 -0
  66. package/dist/payload/docsKeys.js +29 -0
  67. package/dist/payload/docsKeys.js.map +1 -0
  68. package/dist/payload/docsSets.d.ts +32 -6
  69. package/dist/payload/docsSets.js +146 -83
  70. package/dist/payload/docsSets.js.map +1 -1
  71. package/dist/payload/docsTrusted.d.ts +16 -0
  72. package/dist/payload/docsTrusted.js +49 -0
  73. package/dist/payload/docsTrusted.js.map +1 -0
  74. package/dist/payload/index.d.ts +5 -1
  75. package/dist/payload/index.js +3 -1
  76. package/dist/payload/index.js.map +1 -1
  77. package/dist/plugin.js +36 -9
  78. package/dist/plugin.js.map +1 -1
  79. package/dist/security/ed25519Keys.d.ts +9 -0
  80. package/dist/security/ed25519Keys.js +183 -0
  81. package/dist/security/ed25519Keys.js.map +1 -0
  82. package/dist/security/githubOidc.d.ts +18 -5
  83. package/dist/security/githubOidc.js +44 -16
  84. package/dist/security/githubOidc.js.map +1 -1
  85. package/dist/security/index.d.ts +2 -1
  86. package/dist/security/index.js +1 -0
  87. package/dist/security/index.js.map +1 -1
  88. package/dist/security/sign.js +3 -12
  89. package/dist/security/sign.js.map +1 -1
  90. package/dist/security/verify.js +3 -12
  91. package/dist/security/verify.js.map +1 -1
  92. package/dist/skills/codex/SKILL.md +3 -4
  93. package/dist/skills/codex/examples/github-actions.md +0 -2
  94. package/dist/skills/codex/reference/admin.md +0 -6
  95. package/dist/skills/codex/reference/routing.md +2 -1
  96. package/dist/skills/codex/reference/sync.md +7 -5
  97. package/dist/skills/codex/reference/troubleshooting.md +3 -4
  98. package/dist/skills/codex/reference/workflow.md +0 -1
  99. package/dist/sync/manifest.d.ts +1 -3
  100. package/dist/sync/manifest.js +2 -3
  101. package/dist/sync/manifest.js.map +1 -1
  102. package/dist/sync/validate.js +1 -2
  103. package/dist/sync/validate.js.map +1 -1
  104. package/dist/types.d.ts +7 -50
  105. package/dist/types.js.map +1 -1
  106. package/package.json +6 -4
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/cli/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nimport type { CliCommandName, CliResult, ParsedCliArgs } from './types.js'\n\nimport { runInstallCommand } from './commands/install.js'\nimport { runKeygenCommand } from './commands/keygen.js'\nimport { runManifestCommand } from './commands/manifest.js'\nimport { runPlanCommand } from './commands/plan.js'\nimport { runPushCommand } from './commands/push.js'\nimport { runValidateCommand } from './commands/validate.js'\nimport { getFlagString, parseCliArgs } from './parseArgs.js'\n\nconst helpText = `payload-markdown-docs\n\nUsage:\n payload-markdown-docs validate <docs-root> [options]\n payload-markdown-docs manifest <docs-root> [options]\n payload-markdown-docs plan <docs-root> [options]\n payload-markdown-docs push <docs-root> [options]\n payload-markdown-docs keygen [options]\n payload-markdown-docs install skill --codex [options]\n\nCommands:\n validate Validate a local Markdown docs directory.\n manifest Print a JSON docs manifest for a local Markdown docs directory.\n plan Build a dry sync plan against optional existing docs records.\n push Sign and upload a docs manifest to a Payload sync endpoint.\n keygen Generate Ed25519 keys for signed sync.\n install Install local AI-agent guidance for docs maintenance.\n`\n\nconst commandHelp: Record<Exclude<CliCommandName, 'help'>, string> = {\n install: `payload-markdown-docs install skill --codex\n\nAliases:\n payload-markdown-docs install ai-skill --codex\n payload-markdown-docs install skill --agent codex\n\nOptions:\n --codex Install the Codex skill pack.\n --agent <codex> Agent target. Currently only codex.\n --out <path> Output directory. Defaults to .agents/skills/payload-markdown-docs.\n --docs-root <path> Docs root to mention in installed guidance. Defaults to ./docs.\n --package-manager <name> pnpm, npm, yarn, or bun. Auto-detected when omitted.\n --force Overwrite existing skill files.\n --dry-run Print planned files without writing.\n --help Show this help.\n\nInstalls local AI-agent guidance only. It does not sync docs, call Payload, or run package manager commands.\n`,\n keygen: `payload-markdown-docs keygen\n\nOptions:\n --format <pem|base64> Output key format. Defaults to pem.\n --out <dir> Write docs-sync-public.pem and docs-sync-private.pem.\n --force Overwrite existing key files when used with --out.\n --help Show this help.\n`,\n manifest: `payload-markdown-docs manifest <docs-root>\n\nOptions:\n --source <id> Manifest source id. Defaults to local-docs.\n --root <path> Manifest source root label.\n --route-base <route> Route base for validation. Defaults to /docs.\n --repository <repo> Source repository metadata.\n --branch <branch> Source branch metadata.\n --commit <sha> Source commit metadata.\n --pretty Pretty-print JSON.\n --max-files <number> Maximum file count.\n --max-file-bytes <number> Maximum single file size.\n --max-total-bytes <number> Maximum total Markdown bytes.\n --help Show this help.\n`,\n plan: `payload-markdown-docs plan <docs-root>\n\nOptions:\n --existing <path> JSON array of existing docs records.\n --delete-behavior <value> archive, delete, draft, or ignore.\n --json Print full plan JSON.\n --pretty Pretty-print JSON output.\n --source <id> Manifest source id. Defaults to local-docs.\n --root <path> Manifest source root label.\n --route-base <route> Route base for validation. Defaults to /docs.\n --repository <repo> Source repository metadata.\n --branch <branch> Source branch metadata.\n --commit <sha> Source commit metadata.\n --max-files <number> Maximum file count.\n --max-file-bytes <number> Maximum single file size.\n --max-total-bytes <number> Maximum total Markdown bytes.\n --help Show this help.\n`,\n push: `payload-markdown-docs push <docs-root>\n\nOptions:\n --endpoint <url> Full Payload sync endpoint URL.\n --key-id <id> Server-configured Ed25519 key id.\n --private-key-file <path> PEM private key file from keygen.\n --private-key-env <name> Environment variable containing the private key.\n --github-oidc Use GitHub Actions OIDC bearer auth instead of Ed25519.\n --oidc-audience <value> GitHub OIDC audience. Defaults to payload-markdown-docs.\n --oidc-token-env <name> Environment variable containing an already-fetched OIDC token.\n --dry-run Upload as dry-run mode. This is the default.\n --sync Upload as sync mode. Requires server sync.allowWrites.\n --publish Request published output. Server must allow publishing.\n --delete-behavior <value> archive, delete, draft, or ignore. Defaults to archive.\n --json Print structured JSON output.\n --pretty Pretty-print JSON output with --json.\n --source <id> Manifest source id. Defaults to local-docs.\n --root <path> Manifest source root label.\n --route-base <route> Route base for local validation. Defaults to /docs.\n --repository <repo> Source repository metadata.\n --branch <branch> Source branch metadata.\n --commit <sha> Source commit metadata.\n --max-files <number> Maximum file count.\n --max-file-bytes <number> Maximum single file size.\n --max-total-bytes <number> Maximum total Markdown bytes.\n --help Show this help.\n\nExamples:\n Ed25519:\n payload-markdown-docs push ./docs --endpoint \"$DOCS_SYNC_ENDPOINT\" --source main-docs --key-id github-actions-main --private-key-env DOCS_SYNC_PRIVATE_KEY --sync\n\n GitHub OIDC:\n payload-markdown-docs push ./docs --endpoint \"$DOCS_SYNC_ENDPOINT\" --source main-docs --github-oidc --oidc-audience payload-markdown-docs --sync\n\nGitHub OIDC requires workflow permissions: id-token: write and contents: read.\nHard delete requires explicit server sync.allowHardDelete. Existing collection and block targets are not supported yet.\n`,\n validate: `payload-markdown-docs validate <docs-root>\n\nOptions:\n --json Print validation JSON.\n --pretty Pretty-print JSON output.\n --source <id> Manifest source id. Defaults to local-docs.\n --root <path> Manifest source root label.\n --route-base <route> Route base for validation. Defaults to /docs.\n --repository <repo> Source repository metadata.\n --branch <branch> Source branch metadata.\n --commit <sha> Source commit metadata.\n --max-files <number> Maximum file count.\n --max-file-bytes <number> Maximum single file size.\n --max-total-bytes <number> Maximum total Markdown bytes.\n --help Show this help.\n`,\n}\n\nconst getHelpForArgs = (args: ParsedCliArgs): string => {\n if (args.command !== 'help') {\n return commandHelp[args.command]\n }\n\n const topic = getFlagString(args, 'topic') ?? args.positionals[0]\n\n if (\n topic === 'keygen' ||\n topic === 'install' ||\n topic === 'manifest' ||\n topic === 'plan' ||\n topic === 'push' ||\n topic === 'validate'\n ) {\n return commandHelp[topic]\n }\n\n return helpText\n}\n\nexport const runCli = async (argv: string[]): Promise<CliResult> => {\n try {\n const parsed = parseCliArgs(argv)\n\n if (!parsed.ok) {\n return {\n exitCode: 1,\n stderr: `${parsed.error}\\n`,\n }\n }\n\n if (parsed.args.command === 'help' || parsed.args.flags.help === true) {\n return {\n exitCode: 0,\n stdout: getHelpForArgs(parsed.args),\n }\n }\n\n if (parsed.args.command === 'keygen') {\n return runKeygenCommand(parsed.args)\n }\n\n if (parsed.args.command === 'install') {\n return runInstallCommand(parsed.args)\n }\n\n if (parsed.args.command === 'manifest') {\n return runManifestCommand(parsed.args)\n }\n\n if (parsed.args.command === 'plan') {\n return runPlanCommand(parsed.args)\n }\n\n if (parsed.args.command === 'push') {\n return runPushCommand(parsed.args)\n }\n\n if (parsed.args.command === 'validate') {\n return runValidateCommand(parsed.args)\n }\n\n return {\n exitCode: 1,\n stderr: 'Unknown command.\\n',\n }\n } catch (error) {\n return {\n exitCode: 2,\n stderr: error instanceof Error ? `${error.message}\\n` : 'Unexpected internal error.\\n',\n }\n }\n}\n\nconst isCliEntrypoint = (): boolean => {\n if (!process.argv[1]) {\n return false\n }\n\n return fileURLToPath(import.meta.url) === path.resolve(process.argv[1])\n}\n\nif (isCliEntrypoint()) {\n const result = await runCli(process.argv.slice(2))\n\n if (result.stdout) {\n process.stdout.write(result.stdout)\n }\n\n if (result.stderr) {\n process.stderr.write(result.stderr)\n }\n\n process.exitCode = result.exitCode\n}\n"],"names":["path","fileURLToPath","runInstallCommand","runKeygenCommand","runManifestCommand","runPlanCommand","runPushCommand","runValidateCommand","getFlagString","parseCliArgs","helpText","commandHelp","install","keygen","manifest","plan","push","validate","getHelpForArgs","args","command","topic","positionals","runCli","argv","parsed","ok","exitCode","stderr","error","flags","help","stdout","Error","message","isCliEntrypoint","process","url","resolve","result","slice","write"],"mappings":";AAEA,OAAOA,UAAU,YAAW;AAC5B,SAASC,aAAa,QAAQ,WAAU;AAIxC,SAASC,iBAAiB,QAAQ,wBAAuB;AACzD,SAASC,gBAAgB,QAAQ,uBAAsB;AACvD,SAASC,kBAAkB,QAAQ,yBAAwB;AAC3D,SAASC,cAAc,QAAQ,qBAAoB;AACnD,SAASC,cAAc,QAAQ,qBAAoB;AACnD,SAASC,kBAAkB,QAAQ,yBAAwB;AAC3D,SAASC,aAAa,EAAEC,YAAY,QAAQ,iBAAgB;AAE5D,MAAMC,WAAW,CAAC;;;;;;;;;;;;;;;;;AAiBlB,CAAC;AAED,MAAMC,cAA+D;IACnEC,SAAS,CAAC;;;;;;;;;;;;;;;;;AAiBZ,CAAC;IACCC,QAAQ,CAAC;;;;;;;AAOX,CAAC;IACCC,UAAU,CAAC;;;;;;;;;;;;;;AAcb,CAAC;IACCC,MAAM,CAAC;;;;;;;;;;;;;;;;;AAiBT,CAAC;IACCC,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCT,CAAC;IACCC,UAAU,CAAC;;;;;;;;;;;;;;;AAeb,CAAC;AACD;AAEA,MAAMC,iBAAiB,CAACC;IACtB,IAAIA,KAAKC,OAAO,KAAK,QAAQ;QAC3B,OAAOT,WAAW,CAACQ,KAAKC,OAAO,CAAC;IAClC;IAEA,MAAMC,QAAQb,cAAcW,MAAM,YAAYA,KAAKG,WAAW,CAAC,EAAE;IAEjE,I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AAC;AAED,MAAMC,kBAAkB;IACtB,IAAI,CAACC,QAAQZ,IAAI,CAAC,EAAE,EAAE;QACpB,OAAO;IACT;IAEA,OAAOvB,cAAc,YAAYoC,GAAG,MAAMrC,KAAKsC,OAAO,CAACF,QAAQZ,IAAI,CAAC,EAAE;AACxE;AAEA,IAAIW,mBAAmB;IACrB,MAAMI,SAAS,MAAMhB,OAAOa,QAAQZ,IAAI,CAACgB,KAAK,CAAC;IAE/C,IAAID,OAAOP,MAAM,EAAE;QACjBI,QAAQJ,MAAM,CAACS,KAAK,CAACF,OAAOP,MAAM;IACpC;IAEA,IAAIO,OAAOX,MAAM,EAAE;QACjBQ,QAAQR,MAAM,CAACa,KAAK,CAACF,OAAOX,MAAM;IACpC;IAEAQ,QAAQT,QAAQ,GAAGY,OAAOZ,QAAQ;AACpC"}
1
+ {"version":3,"sources":["../../src/cli/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nimport type { CliCommandName, CliResult, ParsedCliArgs } from './types.js'\n\nimport { runInstallCommand } from './commands/install.js'\nimport { runKeygenCommand } from './commands/keygen.js'\nimport { runManifestCommand } from './commands/manifest.js'\nimport { runPlanCommand } from './commands/plan.js'\nimport { runPushCommand } from './commands/push.js'\nimport { runValidateCommand } from './commands/validate.js'\nimport { getFlagString, parseCliArgs } from './parseArgs.js'\n\nconst helpText = `payload-markdown-docs\n\nUsage:\n payload-markdown-docs validate <docs-root> [options]\n payload-markdown-docs manifest <docs-root> [options]\n payload-markdown-docs plan <docs-root> [options]\n payload-markdown-docs push <docs-root> [options]\n payload-markdown-docs keygen [options]\n payload-markdown-docs install skill --codex [options]\n\nCommands:\n validate Validate a local Markdown docs directory.\n manifest Print a JSON docs manifest for a local Markdown docs directory.\n plan Build a dry sync plan against optional existing docs records.\n push Sign and upload a docs manifest to a Payload sync endpoint.\n keygen Generate Ed25519 keys for signed sync.\n install Install local AI-agent guidance for docs maintenance.\n`\n\nconst commandHelp: Record<Exclude<CliCommandName, 'help'>, string> = {\n install: `payload-markdown-docs install skill --codex\n\nAliases:\n payload-markdown-docs install ai-skill --codex\n payload-markdown-docs install skill --agent codex\n\nOptions:\n --codex Install the Codex skill pack.\n --agent <codex> Agent target. Currently only codex.\n --out <path> Output directory. Defaults to .agents/skills/payload-markdown-docs.\n --docs-root <path> Docs root to mention in installed guidance. Defaults to ./docs.\n --package-manager <name> pnpm, npm, yarn, or bun. Auto-detected when omitted.\n --force Overwrite existing skill files.\n --dry-run Print planned files without writing.\n --help Show this help.\n\nInstalls local AI-agent guidance only. It does not sync docs, call Payload, or run package manager commands.\n`,\n keygen: `payload-markdown-docs keygen\n\nOptions:\n --format <pem|base64> Output key format. Defaults to pem.\n --out <dir> Write docs-sync-public.pem and docs-sync-private.pem.\n --force Overwrite existing key files when used with --out.\n --help Show this help.\n`,\n manifest: `payload-markdown-docs manifest <docs-root>\n\nOptions:\n --source <id> Docs set slug. Defaults to the GitHub repository name in GitHub Actions, otherwise local-docs.\n --repository <repo> Source repository metadata.\n --branch <branch> Source branch metadata.\n --commit <sha> Source commit metadata.\n --pretty Pretty-print JSON.\n --max-files <number> Maximum file count.\n --max-file-bytes <number> Maximum single file size.\n --max-total-bytes <number> Maximum total Markdown bytes.\n --help Show this help.\n`,\n plan: `payload-markdown-docs plan <docs-root>\n\nOptions:\n --existing <path> JSON array of existing docs records.\n --delete-behavior <value> archive, delete, draft, or ignore.\n --json Print full plan JSON.\n --pretty Pretty-print JSON output.\n --source <id> Docs set slug. Defaults to the GitHub repository name in GitHub Actions, otherwise local-docs.\n --repository <repo> Source repository metadata.\n --branch <branch> Source branch metadata.\n --commit <sha> Source commit metadata.\n --max-files <number> Maximum file count.\n --max-file-bytes <number> Maximum single file size.\n --max-total-bytes <number> Maximum total Markdown bytes.\n --help Show this help.\n`,\n push: `payload-markdown-docs push <docs-root>\n\nOptions:\n --endpoint <url> Full Payload sync endpoint URL.\n --key-id <id> Server-configured Ed25519 key id.\n --private-key-file <path> Private key file from keygen, or an unencrypted OpenSSH Ed25519 key.\n --private-key-env <name> Environment variable containing the private key.\n --github-oidc Use GitHub Actions OIDC bearer auth instead of Ed25519.\n --oidc-token-env <name> Environment variable containing an already-fetched OIDC token.\n --dry-run Upload as dry-run mode. This is the default.\n --sync Upload as sync mode. Requires server sync.allowWrites.\n --publish Request published output. Server must allow publishing.\n --delete-behavior <value> archive, delete, draft, or ignore. Defaults to archive.\n --json Print structured JSON output.\n --pretty Pretty-print JSON output with --json.\n --source <id> Docs set slug. Defaults to the GitHub repository name in GitHub Actions, otherwise local-docs.\n --repository <repo> Source repository metadata.\n --branch <branch> Source branch metadata.\n --commit <sha> Source commit metadata.\n --max-files <number> Maximum file count.\n --max-file-bytes <number> Maximum single file size.\n --max-total-bytes <number> Maximum total Markdown bytes.\n --help Show this help.\n\nExamples:\n Ed25519:\n payload-markdown-docs push ./docs --endpoint \"$DOCS_SYNC_ENDPOINT\" --source main-docs --key-id github-actions-main --private-key-env DOCS_SYNC_PRIVATE_KEY --sync\n\n GitHub OIDC:\n payload-markdown-docs push ./docs --endpoint \"$DOCS_SYNC_ENDPOINT\" --github-oidc --sync\n\nGitHub OIDC requires workflow permissions: id-token: write and contents: read.\nHard delete requires explicit server sync.allowHardDelete. Existing collection and block targets are not supported yet.\n`,\n validate: `payload-markdown-docs validate <docs-root>\n\nOptions:\n --json Print validation JSON.\n --pretty Pretty-print JSON output.\n --source <id> Docs set slug. Defaults to the GitHub repository name in GitHub Actions, otherwise local-docs.\n --repository <repo> Source repository metadata.\n --branch <branch> Source branch metadata.\n --commit <sha> Source commit metadata.\n --max-files <number> Maximum file count.\n --max-file-bytes <number> Maximum single file size.\n --max-total-bytes <number> Maximum total Markdown bytes.\n --help Show this help.\n`,\n}\n\nconst getHelpForArgs = (args: ParsedCliArgs): string => {\n if (args.command !== 'help') {\n return commandHelp[args.command]\n }\n\n const topic = getFlagString(args, 'topic') ?? args.positionals[0]\n\n if (\n topic === 'keygen' ||\n topic === 'install' ||\n topic === 'manifest' ||\n topic === 'plan' ||\n topic === 'push' ||\n topic === 'validate'\n ) {\n return commandHelp[topic]\n }\n\n return helpText\n}\n\nexport const runCli = async (argv: string[]): Promise<CliResult> => {\n try {\n const parsed = parseCliArgs(argv)\n\n if (!parsed.ok) {\n return {\n exitCode: 1,\n stderr: `${parsed.error}\\n`,\n }\n }\n\n if (parsed.args.command === 'help' || parsed.args.flags.help === true) {\n return {\n exitCode: 0,\n stdout: getHelpForArgs(parsed.args),\n }\n }\n\n if (parsed.args.command === 'keygen') {\n return runKeygenCommand(parsed.args)\n }\n\n if (parsed.args.command === 'install') {\n return runInstallCommand(parsed.args)\n }\n\n if (parsed.args.command === 'manifest') {\n return runManifestCommand(parsed.args)\n }\n\n if (parsed.args.command === 'plan') {\n return runPlanCommand(parsed.args)\n }\n\n if (parsed.args.command === 'push') {\n return runPushCommand(parsed.args)\n }\n\n if (parsed.args.command === 'validate') {\n return runValidateCommand(parsed.args)\n }\n\n return {\n exitCode: 1,\n stderr: 'Unknown command.\\n',\n }\n } catch (error) {\n return {\n exitCode: 2,\n stderr: error instanceof Error ? `${error.message}\\n` : 'Unexpected internal error.\\n',\n }\n }\n}\n\nconst isCliEntrypoint = (): boolean => {\n if (!process.argv[1]) {\n return false\n }\n\n return fileURLToPath(import.meta.url) === path.resolve(process.argv[1])\n}\n\nif (isCliEntrypoint()) {\n const result = await runCli(process.argv.slice(2))\n\n if (result.stdout) {\n process.stdout.write(result.stdout)\n }\n\n if (result.stderr) {\n process.stderr.write(result.stderr)\n }\n\n process.exitCode = result.exitCode\n}\n"],"names":["path","fileURLToPath","runInstallCommand","runKeygenCommand","runManifestCommand","runPlanCommand","runPushCommand","runValidateCommand","getFlagString","parseCliArgs","helpText","commandHelp","install","keygen","manifest","plan","push","validate","getHelpForArgs","args","command","topic","positionals","runCli","argv","parsed","ok","exitCode","stderr","error","flags","help","stdout","Error","message","isCliEntrypoint","process","url","resolve","result","slice","write"],"mappings":";AAE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AK,CAACF,OAAOP,MAAM;IACpC;IAEA,IAAIO,OAAOX,MAAM,EAAE;QACjBQ,QAAQR,MAAM,CAACa,KAAK,CAACF,OAAOX,MAAM;IACpC;IAEAQ,QAAQT,QAAQ,GAAGY,OAAOZ,QAAQ;AACpC"}
@@ -14,8 +14,6 @@ const docsValueFlags = new Set([
14
14
  'max-files',
15
15
  'max-total-bytes',
16
16
  'repository',
17
- 'root',
18
- 'route-base',
19
17
  'source'
20
18
  ]);
21
19
  const docsBooleanFlags = new Set([
@@ -32,7 +30,6 @@ const pushValueFlags = new Set([
32
30
  'delete-behavior',
33
31
  'endpoint',
34
32
  'key-id',
35
- 'oidc-audience',
36
33
  'oidc-token-env',
37
34
  'private-key-env',
38
35
  'private-key-file',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/cli/parseArgs.ts"],"sourcesContent":["import type {\n CliCommandName,\n CliFlagValue,\n CliParseResult,\n CliResult,\n ParsedCliArgs,\n} from './types.js'\n\nconst commands = new Set<CliCommandName>([\n 'help',\n 'install',\n 'keygen',\n 'manifest',\n 'plan',\n 'push',\n 'validate',\n])\n\nconst docsValueFlags = new Set([\n 'branch',\n 'commit',\n 'max-file-bytes',\n 'max-files',\n 'max-total-bytes',\n 'repository',\n 'root',\n 'route-base',\n 'source',\n])\n\nconst docsBooleanFlags = new Set(['help', 'json', 'pretty'])\nconst planValueFlags = new Set(['delete-behavior', 'existing', ...docsValueFlags])\nconst pushValueFlags = new Set([\n 'delete-behavior',\n 'endpoint',\n 'key-id',\n 'oidc-audience',\n 'oidc-token-env',\n 'private-key-env',\n 'private-key-file',\n ...docsValueFlags,\n])\nconst pushBooleanFlags = new Set([\n 'dry-run',\n 'github-oidc',\n 'help',\n 'json',\n 'pretty',\n 'publish',\n 'sync',\n])\nconst installValueFlags = new Set([\n 'agent',\n 'docs-root',\n 'out',\n 'package-manager',\n])\nconst installBooleanFlags = new Set(['codex', 'dry-run', 'force', 'help'])\nconst keygenValueFlags = new Set(['format', 'out'])\nconst keygenBooleanFlags = new Set(['force', 'help'])\n\nconst knownCommand = (command: string): command is CliCommandName =>\n commands.has(command as CliCommandName)\n\nconst normalizeFlagName = (input: string): string => input.slice(2)\n\nconst allowedFlagsForCommand = (\n command: CliCommandName,\n): {\n boolean: Set<string>\n value: Set<string>\n} => {\n if (command === 'keygen') {\n return {\n boolean: keygenBooleanFlags,\n value: keygenValueFlags,\n }\n }\n\n if (command === 'install') {\n return {\n boolean: installBooleanFlags,\n value: installValueFlags,\n }\n }\n\n if (command === 'plan') {\n return {\n boolean: docsBooleanFlags,\n value: planValueFlags,\n }\n }\n\n if (command === 'push') {\n return {\n boolean: pushBooleanFlags,\n value: pushValueFlags,\n }\n }\n\n if (command === 'manifest' || command === 'validate') {\n return {\n boolean: docsBooleanFlags,\n value: docsValueFlags,\n }\n }\n\n return {\n boolean: new Set(['help']),\n value: new Set(),\n }\n}\n\nexport const parseCliArgs = (argv: string[]): CliParseResult => {\n if (argv.length === 0 || argv[0] === '--help' || argv[0] === '-h') {\n return {\n args: {\n command: 'help',\n flags: {\n help: true,\n },\n positionals: [],\n },\n ok: true,\n }\n }\n\n const [rawCommand, ...rest] = argv\n\n if (!rawCommand || rawCommand.startsWith('-')) {\n return {\n error: 'Missing command. Run payload-markdown-docs --help.',\n ok: false,\n }\n }\n\n if (!knownCommand(rawCommand)) {\n return {\n error: `Unknown command \"${rawCommand}\". Run payload-markdown-docs --help.`,\n ok: false,\n }\n }\n\n if (rawCommand === 'help') {\n const [topic] = rest\n\n if (topic && !knownCommand(topic)) {\n return {\n error: `Unknown help topic \"${topic}\".`,\n ok: false,\n }\n }\n\n return {\n args: {\n command: 'help',\n flags: topic ? { topic } : {},\n positionals: topic ? [topic] : [],\n },\n ok: true,\n }\n }\n\n const allowedFlags = allowedFlagsForCommand(rawCommand)\n const flags: Record<string, CliFlagValue> = {}\n const positionals: string[] = []\n\n for (let index = 0; index < rest.length; index += 1) {\n const token = rest[index]\n\n if (!token) {\n continue\n }\n\n if (!token.startsWith('--')) {\n positionals.push(token)\n continue\n }\n\n const flagName = normalizeFlagName(token)\n\n if (allowedFlags.boolean.has(flagName)) {\n flags[flagName] = true\n continue\n }\n\n if (!allowedFlags.value.has(flagName)) {\n return {\n error: `Unknown flag \"--${flagName}\" for ${rawCommand}.`,\n ok: false,\n }\n }\n\n const value = rest[index + 1]\n\n if (!value || value.startsWith('--')) {\n return {\n error: `Flag \"--${flagName}\" requires a value.`,\n ok: false,\n }\n }\n\n flags[flagName] = value\n index += 1\n }\n\n return {\n args: {\n command: rawCommand,\n flags,\n positionals,\n },\n ok: true,\n }\n}\n\nexport const getFlagString = (\n args: ParsedCliArgs,\n name: string,\n): string | undefined => {\n const value = args.flags[name]\n\n return typeof value === 'string' ? value : undefined\n}\n\nexport const getFlagBoolean = (args: ParsedCliArgs, name: string): boolean =>\n args.flags[name] === true\n\nexport const parseIntegerFlag = (\n args: ParsedCliArgs,\n name: string,\n): CliResult | number | undefined => {\n const value = getFlagString(args, name)\n\n if (value === undefined) {\n return undefined\n }\n\n const parsed = Number(value)\n\n if (!Number.isInteger(parsed) || parsed < 0) {\n return {\n exitCode: 1,\n stderr: `Flag \"--${name}\" must be a non-negative integer.\\n`,\n }\n }\n\n return parsed\n}\n"],"names":["commands","Set","docsValueFlags","docsBooleanFlags","planValueFlags","pushValueFlags","pushBooleanFlags","installValueFlags","installBooleanFlags","keygenValueFlags","keygenBooleanFlags","knownCommand","command","has","normalizeFlagName","input","slice","allowedFlagsForCommand","boolean","value","parseCliArgs","argv","length","args","flags","help","positionals","ok","rawCommand","rest","startsWith","error","topic","allowedFlags","index","token","push","flagName","getFlagString","name","undefined","getFlagBoolean","parseIntegerFlag","parsed","Number","isInteger","exitCode","stderr"],"mappings":"AAQA,MAAMA,WAAW,IAAIC,IAAoB;IACvC;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,MAAMC,iBAAiB,IAAID,IAAI;IAC7B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD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KAAK,CAACN,GAAG,CAACwB,WAAW;YACrC,OAAO;gBACLN,OAAO,CAAC,gBAAgB,EAAEM,SAAS,MAAM,EAAET,WAAW,CAAC,CAAC;gBACxDD,IAAI;YACN;QACF;QAEA,MAAMR,QAAQU,IAAI,CAACK,QAAQ,EAAE;QAE7B,IAAI,CAACf,SAASA,MAAMW,UAAU,CAAC,OAAO;YACpC,OAAO;gBACLC,OAAO,CAAC,QAAQ,EAAEM,SAAS,mBAAmB,CAAC;gBAC/CV,IAAI;YACN;QACF;QAEAH,KAAK,CAACa,SAAS,GAAGlB;QAClBe,SAAS;IACX;IAEA,OAAO;QACLX,MAAM;YACJX,SAASgB;YACTJ;YACAE;QACF;QACAC,IAAI;IACN;AACF,EAAC;AAED,OAAO,MAAMW,gBAAgB,CAC3Bf,MACAgB;IAEA,MAAMpB,QAAQI,KAAKC,KAAK,CAACe,KAAK;IAE9B,OAAO,OAAOpB,UAAU,WAAWA,QAAQqB;AAC7C,EAAC;AAED,OAAO,MAAMC,iBAAiB,CAAClB,MAAqBgB,OAClDhB,KAAKC,KAAK,CAACe,KAAK,KAAK,KAAI;AAE3B,OAAO,MAAMG,mBAAmB,CAC9BnB,MACAgB;IAEA,MAAMpB,QAAQmB,cAAcf,MAAMgB;IAElC,IAAIpB,UAAUqB,WAAW;QACvB,OAAOA;IACT;IAEA,MAAMG,SAASC,OAAOzB;IAEtB,IAAI,CAACyB,OAAOC,SAAS,CAACF,WAAWA,SAAS,GAAG;QAC3C,OAAO;YACLG,UAAU;YACVC,QAAQ,CAAC,QAAQ,EAAER,KAAK,mCAAmC,CAAC;QAC9D;IACF;IAEA,OAAOI;AACT,EAAC"}
1
+ {"version":3,"sources":["../../src/cli/parseArgs.ts"],"sourcesContent":["import type {\n CliCommandName,\n CliFlagValue,\n CliParseResult,\n CliResult,\n ParsedCliArgs,\n} from './types.js'\n\nconst commands = new Set<CliCommandName>([\n 'help',\n 'install',\n 'keygen',\n 'manifest',\n 'plan',\n 'push',\n 'validate',\n])\n\nconst docsValueFlags = new Set([\n 'branch',\n 'commit',\n 'max-file-bytes',\n 'max-files',\n 'max-total-bytes',\n 'repository',\n 'source',\n])\n\nconst docsBooleanFlags = new Set(['help', 'json', 'pretty'])\nconst planValueFlags = new Set(['delete-behavior', 'existing', ...docsValueFlags])\nconst pushValueFlags = new Set([\n 'delete-behavior',\n 'endpoint',\n 'key-id',\n 'oidc-token-env',\n 'private-key-env',\n 'private-key-file',\n ...docsValueFlags,\n])\nconst pushBooleanFlags = new Set([\n 'dry-run',\n 'github-oidc',\n 'help',\n 'json',\n 'pretty',\n 'publish',\n 'sync',\n])\nconst installValueFlags = new Set([\n 'agent',\n 'docs-root',\n 'out',\n 'package-manager',\n])\nconst installBooleanFlags = new Set(['codex', 'dry-run', 'force', 'help'])\nconst keygenValueFlags = new Set(['format', 'out'])\nconst keygenBooleanFlags = new Set(['force', 'help'])\n\nconst knownCommand = (command: string): command is CliCommandName =>\n commands.has(command as CliCommandName)\n\nconst normalizeFlagName = (input: string): string => input.slice(2)\n\nconst allowedFlagsForCommand = (\n command: CliCommandName,\n): {\n boolean: Set<string>\n value: Set<string>\n} => {\n if (command === 'keygen') {\n return {\n boolean: keygenBooleanFlags,\n value: keygenValueFlags,\n }\n }\n\n if (command === 'install') {\n return {\n boolean: installBooleanFlags,\n value: installValueFlags,\n }\n }\n\n if (command === 'plan') {\n return {\n boolean: docsBooleanFlags,\n value: planValueFlags,\n }\n }\n\n if (command === 'push') {\n return {\n boolean: pushBooleanFlags,\n value: pushValueFlags,\n }\n }\n\n if (command === 'manifest' || command === 'validate') {\n return {\n boolean: docsBooleanFlags,\n value: docsValueFlags,\n }\n }\n\n return {\n boolean: new Set(['help']),\n value: new Set(),\n }\n}\n\nexport const parseCliArgs = (argv: string[]): CliParseResult => {\n if (argv.length === 0 || argv[0] === '--help' || argv[0] === '-h') {\n return {\n args: {\n command: 'help',\n flags: {\n help: true,\n },\n positionals: [],\n },\n ok: true,\n }\n }\n\n const [rawCommand, ...rest] = argv\n\n if (!rawCommand || rawCommand.startsWith('-')) {\n return {\n error: 'Missing command. Run payload-markdown-docs --help.',\n ok: false,\n }\n }\n\n if (!knownCommand(rawCommand)) {\n return {\n error: `Unknown command \"${rawCommand}\". Run payload-markdown-docs --help.`,\n ok: false,\n }\n }\n\n if (rawCommand === 'help') {\n const [topic] = rest\n\n if (topic && !knownCommand(topic)) {\n return {\n error: `Unknown help topic \"${topic}\".`,\n ok: false,\n }\n }\n\n return {\n args: {\n command: 'help',\n flags: topic ? { topic } : {},\n positionals: topic ? [topic] : [],\n },\n ok: true,\n }\n }\n\n const allowedFlags = allowedFlagsForCommand(rawCommand)\n const flags: Record<string, CliFlagValue> = {}\n const positionals: string[] = []\n\n for (let index = 0; index < rest.length; index += 1) {\n const token = rest[index]\n\n if (!token) {\n continue\n }\n\n if (!token.startsWith('--')) {\n positionals.push(token)\n continue\n }\n\n const flagName = normalizeFlagName(token)\n\n if (allowedFlags.boolean.has(flagName)) {\n flags[flagName] = true\n continue\n }\n\n if (!allowedFlags.value.has(flagName)) {\n return {\n error: `Unknown flag \"--${flagName}\" for ${rawCommand}.`,\n ok: false,\n }\n }\n\n const value = rest[index + 1]\n\n if (!value || value.startsWith('--')) {\n return {\n error: `Flag \"--${flagName}\" requires a value.`,\n ok: false,\n }\n }\n\n flags[flagName] = value\n index += 1\n }\n\n return {\n args: {\n command: rawCommand,\n flags,\n positionals,\n },\n ok: true,\n }\n}\n\nexport const getFlagString = (\n args: ParsedCliArgs,\n name: string,\n): string | undefined => {\n const value = args.flags[name]\n\n return typeof value === 'string' ? value : undefined\n}\n\nexport const getFlagBoolean = (args: ParsedCliArgs, name: string): boolean =>\n args.flags[name] === true\n\nexport const parseIntegerFlag = (\n args: ParsedCliArgs,\n name: string,\n): CliResult | number | undefined => {\n const value = getFlagString(args, name)\n\n if (value === undefined) {\n return undefined\n }\n\n const parsed = Number(value)\n\n if (!Number.isInteger(parsed) || parsed < 0) {\n return {\n exitCode: 1,\n stderr: `Flag \"--${name}\" must be a non-negative integer.\\n`,\n }\n }\n\n return parsed\n}\n"],"names":["commands","Set","docsValueFlags","docsBooleanFlags","planValueFlags","pushValueFlags","pushBooleanFlags","installValueFlags","installBooleanFlags","keygenValueFlags","keygenBooleanFlags","knownCommand","command","has","normalizeFlagName","input","slice","allowedFlagsForCommand","boolean","value","parseCliArgs","argv","length","args","flags","help","positionals","ok","rawCommand","rest","startsWith","error","topic","allowedFlags","index","token","push","flagName","getFlagString","name","undefined","getFlagBoolean","parseIntegerFlag","parsed","Number","isInteger","exitCode","stderr"],"mappings":"AAQA,MAAMA,WAAW,IAAIC,IAAoB;IACvC;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,MAAMC,iBAAiB,IAAID,IAAI;IAC7B;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,MAAME,mBAAmB,IAAIF,IAAI;IAAC;IAAQ;IAAQ;CAAS;AAC3D,MAAMG,iBAAiB,IAAIH,IAAI;IAAC;IAAmB;OAAeC;CAAe;AACjF,MAAMG,iBAAiB,IAAIJ,IAAI;IAC7B;IACA;IACA;IACA;IACA;IACA;OACGC;CACJ;AACD,MAAMI,mBAAmB,IAAIL,IAAI;IAC/B;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AACD,MAAMM,oBAAoB,IAAIN,IAAI;IAChC;IACA;IACA;IACA;CACD;AACD,MAAMO,sBAAsB,IAAIP,IAAI;IAAC;IAAS;IAAW;IAAS;CAAO;AACzE,MAAMQ,mBAAmB,IAAIR,IAAI;IAAC;IAAU;CAAM;AAClD,MAAMS,qBAAqB,IAAIT,IAAI;IAAC;IAAS;CAAO;AAEpD,MAAMU,eAAe,CAACC,UACpBZ,SAASa,GAAG,CAACD;AAEf,MAAME,oBAAoB,CAACC,QAA0BA,MAAMC,KAAK,CAAC;AAEjE,MAAMC,yBAAyB,CAC7BL;IAKA,IAAIA,YAAY,UAAU;QACxB,OAAO;YACLM,SAASR;YACTS,OAAOV;QACT;IACF;IAEA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AC9BnB,MACAgB;IAEA,MAAMpB,QAAQmB,cAAcf,MAAMgB;IAElC,IAAIpB,UAAUqB,WAAW;QACvB,OAAOA;IACT;IAEA,MAAMG,SAASC,OAAOzB;IAEtB,IAAI,CAACyB,OAAOC,SAAS,CAACF,WAAWA,SAAS,GAAG;QAC3C,OAAO;YACLG,UAAU;YACVC,QAAQ,CAAC,QAAQ,EAAER,KAAK,mCAAmC,CAAC;QAC9D;IACF;IAEA,OAAOI;AACT,EAAC"}
@@ -27,9 +27,7 @@ export type DocsCommandOptions = {
27
27
  maxFiles?: number;
28
28
  maxTotalBytes?: number;
29
29
  repository?: string;
30
- routeBase?: string;
31
30
  sourceId: string;
32
- sourceRoot?: string;
33
31
  };
34
32
  export type PlanCommandOptions = {
35
33
  deleteBehavior?: DocsDeleteBehavior;
@@ -46,6 +44,5 @@ export type PushCommandOptions = {
46
44
  privateKey: string;
47
45
  } | {
48
46
  authMode: 'github-oidc';
49
- oidcAudience: string;
50
47
  oidcTokenEnv?: string;
51
48
  }) & DocsCommandOptions;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/cli/types.ts"],"sourcesContent":["import type { DocsDeleteBehavior } from '../sync/index.js'\n\nexport type CliCommandName =\n | 'help'\n | 'install'\n | 'keygen'\n | 'manifest'\n | 'plan'\n | 'push'\n | 'validate'\n\nexport type CliFlagValue = boolean | string\n\nexport type CliFlags = Record<string, CliFlagValue>\n\nexport type ParsedCliArgs = {\n command: CliCommandName\n flags: CliFlags\n positionals: string[]\n}\n\nexport type CliParseResult =\n | {\n args: ParsedCliArgs\n ok: true\n }\n | {\n error: string\n ok: false\n }\n\nexport type CliResult = {\n exitCode: 0 | 1 | 2\n stderr?: string\n stdout?: string\n}\n\nexport type DocsCommandOptions = {\n branch?: string\n commit?: string\n docsRoot: string\n maxFileBytes?: number\n maxFiles?: number\n maxTotalBytes?: number\n repository?: string\n routeBase?: string\n sourceId: string\n sourceRoot?: string\n}\n\nexport type PlanCommandOptions = {\n deleteBehavior?: DocsDeleteBehavior\n existingPath?: string\n} & DocsCommandOptions\n\nexport type PushCommandOptions = {\n deleteBehavior?: DocsDeleteBehavior\n endpoint: string\n mode: 'dry-run' | 'sync'\n publish: boolean\n} & (\n | {\n authMode: 'ed25519'\n keyId: string\n privateKey: string\n }\n | {\n authMode: 'github-oidc'\n oidcAudience: string\n oidcTokenEnv?: string\n }\n) &\n DocsCommandOptions\n"],"names":[],"mappings":"AAuDA,WAiBoB"}
1
+ {"version":3,"sources":["../../src/cli/types.ts"],"sourcesContent":["import type { DocsDeleteBehavior } from '../sync/index.js'\n\nexport type CliCommandName =\n | 'help'\n | 'install'\n | 'keygen'\n | 'manifest'\n | 'plan'\n | 'push'\n | 'validate'\n\nexport type CliFlagValue = boolean | string\n\nexport type CliFlags = Record<string, CliFlagValue>\n\nexport type ParsedCliArgs = {\n command: CliCommandName\n flags: CliFlags\n positionals: string[]\n}\n\nexport type CliParseResult =\n | {\n args: ParsedCliArgs\n ok: true\n }\n | {\n error: string\n ok: false\n }\n\nexport type CliResult = {\n exitCode: 0 | 1 | 2\n stderr?: string\n stdout?: string\n}\n\nexport type DocsCommandOptions = {\n branch?: string\n commit?: string\n docsRoot: string\n maxFileBytes?: number\n maxFiles?: number\n maxTotalBytes?: number\n repository?: string\n sourceId: string\n}\n\nexport type PlanCommandOptions = {\n deleteBehavior?: DocsDeleteBehavior\n existingPath?: string\n} & DocsCommandOptions\n\nexport type PushCommandOptions = {\n deleteBehavior?: DocsDeleteBehavior\n endpoint: string\n mode: 'dry-run' | 'sync'\n publish: boolean\n} & (\n | {\n authMode: 'ed25519'\n keyId: string\n privateKey: string\n }\n | {\n authMode: 'github-oidc'\n oidcTokenEnv?: string\n }\n) &\n DocsCommandOptions\n"],"names":[],"mappings":"AAqDA,WAgBoB"}
@@ -83,30 +83,6 @@ export const createDocsCollection = ({ slug, docsSetsCollectionSlug, enableDraft
83
83
  name: 'hideFromNav',
84
84
  type: 'checkbox',
85
85
  defaultValue: false
86
- },
87
- {
88
- name: 'theme',
89
- type: 'text'
90
- },
91
- {
92
- name: 'heroEyebrow',
93
- type: 'text'
94
- },
95
- {
96
- name: 'heroTitle',
97
- type: 'text'
98
- },
99
- {
100
- name: 'heroDescription',
101
- type: 'textarea'
102
- },
103
- {
104
- name: 'seoTitle',
105
- type: 'text'
106
- },
107
- {
108
- name: 'seoDescription',
109
- type: 'textarea'
110
86
  }
111
87
  ]
112
88
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/docs.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload'\n\nimport { markdownField } from '@valkyrianlabs/payload-markdown'\n\nimport { MANAGED_BY } from '../constants.js'\n\nexport type CreateDocsCollectionOptions = {\n docsSetsCollectionSlug?: string\n enableDrafts?: boolean\n markdownFieldName: string\n slug: string\n syncRunsCollectionSlug?: string\n}\n\nexport const createDocsCollection = ({\n slug,\n docsSetsCollectionSlug,\n enableDrafts = false,\n markdownFieldName,\n syncRunsCollectionSlug,\n}: CreateDocsCollectionOptions): CollectionConfig => ({\n slug,\n admin: {\n defaultColumns: ['title', 'route', 'sourcePath', 'updatedAt'],\n hidden: true,\n useAsTitle: 'title',\n },\n fields: [\n {\n name: 'title',\n type: 'text',\n required: true,\n },\n {\n name: 'navTitle',\n type: 'text',\n },\n {\n name: 'description',\n type: 'textarea',\n },\n {\n name: 'route',\n type: 'text',\n index: true,\n required: true,\n unique: true,\n },\n {\n name: 'sourcePath',\n type: 'text',\n index: true,\n required: true,\n },\n ...(docsSetsCollectionSlug\n ? [\n {\n name: 'docsSet',\n type: 'relationship' as const,\n index: true,\n relationTo: docsSetsCollectionSlug,\n },\n ]\n : []),\n {\n name: 'sourceHash',\n type: 'text',\n index: true,\n },\n {\n name: 'depth',\n type: 'number',\n defaultValue: 0,\n },\n {\n name: 'order',\n type: 'number',\n defaultValue: 0,\n },\n {\n name: 'parent',\n type: 'relationship',\n relationTo: slug,\n },\n markdownField({\n name: markdownFieldName,\n label: 'Content',\n }),\n {\n name: 'overrides',\n type: 'group',\n fields: [\n {\n name: 'navTitle',\n type: 'text',\n },\n {\n name: 'hideFromNav',\n type: 'checkbox',\n defaultValue: false,\n },\n {\n name: 'theme',\n type: 'text',\n },\n {\n name: 'heroEyebrow',\n type: 'text',\n },\n {\n name: 'heroTitle',\n type: 'text',\n },\n {\n name: 'heroDescription',\n type: 'textarea',\n },\n {\n name: 'seoTitle',\n type: 'text',\n },\n {\n name: 'seoDescription',\n type: 'textarea',\n },\n ],\n },\n {\n name: 'sync',\n type: 'group',\n fields: [\n {\n name: 'sourceId',\n type: 'text',\n index: true,\n },\n {\n name: 'sourcePath',\n type: 'text',\n index: true,\n },\n {\n name: 'sourceHashAtLastSync',\n type: 'text',\n index: true,\n },\n {\n name: 'lastSyncedAt',\n type: 'date',\n },\n ...(syncRunsCollectionSlug\n ? [\n {\n name: 'lastSyncRunId',\n type: 'relationship' as const,\n relationTo: syncRunsCollectionSlug,\n },\n ]\n : []),\n {\n name: 'managedBy',\n type: 'text',\n defaultValue: MANAGED_BY,\n },\n {\n name: 'archived',\n type: 'checkbox',\n defaultValue: false,\n index: true,\n },\n {\n name: 'archivedAt',\n type: 'date',\n },\n ],\n },\n ],\n ...(enableDrafts\n ? {\n versions: {\n drafts: true,\n },\n }\n : {}),\n})\n"],"names":["markdownField","MANAGED_BY","createDocsCollection","slug","docsSetsCollectionSlug","enableDrafts","markdownFieldName","syncRunsCollectionSlug","admin","defaultColumns","hidden","useAsTitle","fields","name","type","required","index","unique","relationTo","defaultValue","label","versions","drafts"],"mappings":"AAEA,SAASA,aAAa,QAAQ,kCAAiC;AAE/D,SAASC,UAAU,QAAQ,kBAAiB;AAU5C,OAAO,MAAMC,uBAAuB,CAAC,EACnCC,IAAI,EACJC,sBAAsB,EACtBC,eAAe,KAAK,EACpBC,iBAAiB,EACjBC,sBAAsB,EACM,GAAwB,CAAA;QACpDJ;QACAK,OAAO;YACLC,gBAAgB;gBAAC;gBAAS;gBAAS;gBAAc;aAAY;YAC7DC,QAAQ;YACRC,YAAY;QACd;QACAC,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;gBACNC,UAAU;YACZ;YACA;gBACEF,MAAM;gBACNC,MAAM;YACR;YACA;gBACED,MAAM;gBACNC,MAAM;YACR;YACA;gBACED,MAAM;gBACNC,MAAM;gBACNE,OAAO;gBACPD,UAAU;gBACVE,QAAQ;YACV;YACA;gBACEJ,MAAM;gBACNC,MAAM;gBACNE,OAAO;gBACPD,UAAU;YACZ;eACIX,yBACA;gBACE;oBACES,MAAM;oBACNC,MAAM;oBACNE,OAAO;oBACPE,YAAYd;gBACd;aACD,GACD,EAAE;YACN;gBACES,MAAM;gBACNC,MAAM;gBACNE,OAAO;YACT;YACA;gBACEH,MAAM;gBACNC,MAAM;gBACNK,cAAc;YAChB;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNK,cAAc;YAChB;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNI,YAAYf;YACd;YACAH,cAAc;gBACZa,MAAMP;gBACNc,OAAO;YACT;YACA;gBACEP,MAAM;gBACNC,MAAM;gBACNF,QAAQ;oBACN;wBACEC,MAAM;wBACNC,MAAM;oBACR;oBACA;wBACED,MAAM;wBACNC,MAAM;wBACNK,cAAc;oBAChB;oBACA;wBACEN,MAAM;wBACNC,MAAM;oBACR;oBACA;wBACED,MAAM;wBACNC,MAAM;oBACR;oBACA;wBACED,MAAM;wBACNC,MAAM;oBACR;oBACA;wBACED,MAAM;wBACNC,MAAM;oBACR;oBACA;wBACED,MAAM;wBACNC,MAAM;oBACR;oBACA;wBACED,MAAM;wBACNC,MAAM;oBACR;iBACD;YACH;YACA;gBACED,MAAM;gBACNC,MAAM;gBACNF,QAAQ;oBACN;wBACEC,MAAM;wBACNC,MAAM;wBACNE,OAAO;oBACT;oBACA;wBACEH,MAAM;wBACNC,MAAM;wBACNE,OAAO;oBACT;oBACA;wBACEH,MAAM;wBACNC,MAAM;wBACNE,OAAO;oBACT;oBACA;wBACEH,MAAM;wBACNC,MAAM;oBACR;uBACIP,yBACA;wBACE;4BACEM,MAAM;4BACNC,MAAM;4BACNI,YAAYX;wBACd;qBACD,GACD,EAAE;oBACN;wBACEM,MAAM;wBACNC,MAAM;wBACNK,cAAclB;oBAChB;oBACA;wBACEY,MAAM;wBACNC,MAAM;wBACNK,cAAc;wBACdH,OAAO;oBACT;oBACA;wBACEH,MAAM;wBACNC,MAAM;oBACR;iBACD;YACH;SACD;QACD,GAAIT,eACA;YACEgB,UAAU;gBACRC,QAAQ;YACV;QACF,IACA,CAAC,CAAC;IACR,CAAA,EAAE"}
1
+ {"version":3,"sources":["../../src/collections/docs.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload'\n\nimport { markdownField } from '@valkyrianlabs/payload-markdown'\n\nimport { MANAGED_BY } from '../constants.js'\n\nexport type CreateDocsCollectionOptions = {\n docsSetsCollectionSlug?: string\n enableDrafts?: boolean\n markdownFieldName: string\n slug: string\n syncRunsCollectionSlug?: string\n}\n\nexport const createDocsCollection = ({\n slug,\n docsSetsCollectionSlug,\n enableDrafts = false,\n markdownFieldName,\n syncRunsCollectionSlug,\n}: CreateDocsCollectionOptions): CollectionConfig => ({\n slug,\n admin: {\n defaultColumns: ['title', 'route', 'sourcePath', 'updatedAt'],\n hidden: true,\n useAsTitle: 'title',\n },\n fields: [\n {\n name: 'title',\n type: 'text',\n required: true,\n },\n {\n name: 'navTitle',\n type: 'text',\n },\n {\n name: 'description',\n type: 'textarea',\n },\n {\n name: 'route',\n type: 'text',\n index: true,\n required: true,\n unique: true,\n },\n {\n name: 'sourcePath',\n type: 'text',\n index: true,\n required: true,\n },\n ...(docsSetsCollectionSlug\n ? [\n {\n name: 'docsSet',\n type: 'relationship' as const,\n index: true,\n relationTo: docsSetsCollectionSlug,\n },\n ]\n : []),\n {\n name: 'sourceHash',\n type: 'text',\n index: true,\n },\n {\n name: 'depth',\n type: 'number',\n defaultValue: 0,\n },\n {\n name: 'order',\n type: 'number',\n defaultValue: 0,\n },\n {\n name: 'parent',\n type: 'relationship',\n relationTo: slug,\n },\n markdownField({\n name: markdownFieldName,\n label: 'Content',\n }),\n {\n name: 'overrides',\n type: 'group',\n fields: [\n {\n name: 'navTitle',\n type: 'text',\n },\n {\n name: 'hideFromNav',\n type: 'checkbox',\n defaultValue: false,\n },\n ],\n },\n {\n name: 'sync',\n type: 'group',\n fields: [\n {\n name: 'sourceId',\n type: 'text',\n index: true,\n },\n {\n name: 'sourcePath',\n type: 'text',\n index: true,\n },\n {\n name: 'sourceHashAtLastSync',\n type: 'text',\n index: true,\n },\n {\n name: 'lastSyncedAt',\n type: 'date',\n },\n ...(syncRunsCollectionSlug\n ? [\n {\n name: 'lastSyncRunId',\n type: 'relationship' as const,\n relationTo: syncRunsCollectionSlug,\n },\n ]\n : []),\n {\n name: 'managedBy',\n type: 'text',\n defaultValue: MANAGED_BY,\n },\n {\n name: 'archived',\n type: 'checkbox',\n defaultValue: false,\n index: true,\n },\n {\n name: 'archivedAt',\n type: 'date',\n },\n ],\n },\n ],\n ...(enableDrafts\n ? {\n versions: {\n drafts: true,\n },\n }\n : {}),\n})\n"],"names":["markdownField","MANAGED_BY","createDocsCollection","slug","docsSetsCollectionSlug","enableDrafts","markdownFieldName","syncRunsCollectionSlug","admin","defaultColumns","hidden","useAsTitle","fields","name","type","required","index","unique","relationTo","defaultValue","label","versions","drafts"],"mappings":"AAEA,SAASA,aAAa,QAAQ,kCAAiC;AAE/D,SAASC,UAAU,QAAQ,kBAAiB;AAU5C,OAAO,MAAMC,uBAAuB,CAAC,EACnCC,IAAI,EACJC,sBAAsB,EACtBC,eAAe,KAAK,EACpBC,iBAAiB,EACjBC,sBAAsB,EACM,GAAwB,CAAA;QACpDJ;QACAK,OAAO;YACLC,gBAAgB;gBAAC;gBAAS;gBAAS;gBAAc;aAAY;YAC7DC,QAAQ;YACRC,YAAY;QACd;QACAC,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;gBACNC,UAAU;YACZ;YACA;gBACEF,MAAM;gBACNC,MAAM;YACR;YACA;gBACED,MAAM;gBACNC,MAAM;YACR;YACA;gBACED,MAAM;gBACNC,MAAM;gBACNE,OAAO;gBACPD,UAAU;gBACVE,QAAQ;YACV;YACA;gBACEJ,MAAM;gBACNC,MAAM;gBACNE,OAAO;gBACPD,UAAU;YACZ;eACIX,yBACA;gBACE;oBACES,MAAM;oBACNC,MAAM;oBACNE,OAAO;oBACPE,YAAYd;gBACd;aACD,GACD,EAAE;YACN;gBACES,MAAM;gBACNC,MAAM;gBACNE,OAAO;YACT;YACA;gBACEH,MAAM;gBACNC,MAAM;gBACNK,cAAc;YAChB;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNK,cAAc;YAChB;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNI,YAAYf;YACd;YACAH,cAAc;gBACZa,MAAMP;gBACNc,OAAO;YACT;YACA;gBACEP,MAAM;gBACNC,MAAM;gBACNF,QAAQ;oBACN;wBACEC,MAAM;wBACNC,MAAM;oBACR;oBACA;wBACED,MAAM;wBACNC,MAAM;wBACNK,cAAc;oBAChB;iBACD;YACH;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNF,QAAQ;oBACN;wBACEC,MAAM;wBACNC,MAAM;wBACNE,OAAO;oBACT;oBACA;wBACEH,MAAM;wBACNC,MAAM;wBACNE,OAAO;oBACT;oBACA;wBACEH,MAAM;wBACNC,MAAM;wBACNE,OAAO;oBACT;oBACA;wBACEH,MAAM;wBACNC,MAAM;oBACR;uBACIP,yBACA;wBACE;4BACEM,MAAM;4BACNC,MAAM;4BACNI,YAAYX;wBACd;qBACD,GACD,EAAE;oBACN;wBACEM,MAAM;wBACNC,MAAM;wBACNK,cAAclB;oBAChB;oBACA;wBACEY,MAAM;wBACNC,MAAM;wBACNK,cAAc;wBACdH,OAAO;oBACT;oBACA;wBACEH,MAAM;wBACNC,MAAM;oBACR;iBACD;YACH;SACD;QACD,GAAIT,eACA;YACEgB,UAAU;gBACRC,QAAQ;YACV;QACF,IACA,CAAC,CAAC;IACR,CAAA,EAAE"}
@@ -1,13 +1,14 @@
1
+ import { DOCS_GLOBALS_ADMIN_GROUP } from '../constants.js';
1
2
  export const createDocsGroupsCollection = ({ slug })=>({
2
3
  slug,
3
4
  admin: {
4
5
  defaultColumns: [
5
6
  'title',
6
- 'routePath',
7
+ 'slug',
7
8
  'serveIndex',
8
9
  'updatedAt'
9
10
  ],
10
- group: 'Docs',
11
+ group: DOCS_GLOBALS_ADMIN_GROUP,
11
12
  useAsTitle: 'title'
12
13
  },
13
14
  fields: [
@@ -27,12 +28,6 @@ export const createDocsGroupsCollection = ({ slug })=>({
27
28
  type: 'relationship',
28
29
  relationTo: slug
29
30
  },
30
- {
31
- name: 'routePath',
32
- type: 'text',
33
- index: true,
34
- required: true
35
- },
36
31
  {
37
32
  name: 'description',
38
33
  type: 'textarea'
@@ -51,7 +46,11 @@ export const createDocsGroupsCollection = ({ slug })=>({
51
46
  type: 'checkbox',
52
47
  defaultValue: false
53
48
  }
54
- ]
49
+ ],
50
+ labels: {
51
+ plural: 'Groups',
52
+ singular: 'Group'
53
+ }
55
54
  });
56
55
 
57
56
  //# sourceMappingURL=docsGroups.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/docsGroups.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload'\n\nexport type CreateDocsGroupsCollectionOptions = {\n slug: string\n}\n\nexport const createDocsGroupsCollection = ({\n slug,\n}: CreateDocsGroupsCollectionOptions): CollectionConfig => ({\n slug,\n admin: {\n defaultColumns: ['title', 'routePath', 'serveIndex', 'updatedAt'],\n group: 'Docs',\n useAsTitle: 'title',\n },\n fields: [\n {\n name: 'title',\n type: 'text',\n required: true,\n },\n {\n name: 'slug',\n type: 'text',\n index: true,\n required: true,\n },\n {\n name: 'parent',\n type: 'relationship',\n relationTo: slug,\n },\n {\n name: 'routePath',\n type: 'text',\n index: true,\n required: true,\n },\n {\n name: 'description',\n type: 'textarea',\n },\n {\n name: 'navTitle',\n type: 'text',\n },\n {\n name: 'order',\n type: 'number',\n defaultValue: 0,\n },\n {\n name: 'serveIndex',\n type: 'checkbox',\n defaultValue: false,\n },\n ],\n})\n"],"names":["createDocsGroupsCollection","slug","admin","defaultColumns","group","useAsTitle","fields","name","type","required","index","relationTo","defaultValue"],"mappings":"AAMA,OAAO,MAAMA,6BAA6B,CAAC,EACzCC,IAAI,EAC8B,GAAwB,CAAA;QAC1DA;QACAC,OAAO;YACLC,gBAAgB;gBAAC;gBAAS;gBAAa;gBAAc;aAAY;YACjEC,OAAO;YACPC,YAAY;QACd;QACAC,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;gBACNC,UAAU;YACZ;YACA;gBACEF,MAAM;gBACNC,MAAM;gBACNE,OAAO;gBACPD,UAAU;YACZ;YACA;gBACEF,MAAM;gBACNC,MAAM;gBACNG,YAAYV;YACd;YACA;gBACEM,MAAM;gBACNC,MAAM;gBACNE,OAAO;gBACPD,UAAU;YACZ;YACA;gBACEF,MAAM;gBACNC,MAAM;YACR;YACA;gBACED,MAAM;gBACNC,MAAM;YACR;YACA;gBACED,MAAM;gBACNC,MAAM;gBACNI,cAAc;YAChB;YACA;gBACEL,MAAM;gBACNC,MAAM;gBACNI,cAAc;YAChB;SACD;IACH,CAAA,EAAE"}
1
+ {"version":3,"sources":["../../src/collections/docsGroups.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload'\n\nimport { DOCS_GLOBALS_ADMIN_GROUP } from '../constants.js'\n\nexport type CreateDocsGroupsCollectionOptions = {\n slug: string\n}\n\nexport const createDocsGroupsCollection = ({\n slug,\n}: CreateDocsGroupsCollectionOptions): CollectionConfig => ({\n slug,\n admin: {\n defaultColumns: ['title', 'slug', 'serveIndex', 'updatedAt'],\n group: DOCS_GLOBALS_ADMIN_GROUP,\n useAsTitle: 'title',\n },\n fields: [\n {\n name: 'title',\n type: 'text',\n required: true,\n },\n {\n name: 'slug',\n type: 'text',\n index: true,\n required: true,\n },\n {\n name: 'parent',\n type: 'relationship',\n relationTo: slug,\n },\n {\n name: 'description',\n type: 'textarea',\n },\n {\n name: 'navTitle',\n type: 'text',\n },\n {\n name: 'order',\n type: 'number',\n defaultValue: 0,\n },\n {\n name: 'serveIndex',\n type: 'checkbox',\n defaultValue: false,\n },\n ],\n labels: {\n plural: 'Groups',\n singular: 'Group',\n },\n})\n"],"names":["DOCS_GLOBALS_ADMIN_GROUP","createDocsGroupsCollection","slug","admin","defaultColumns","group","useAsTitle","fields","name","type","required","index","relationTo","defaultValue","labels","plural","singular"],"mappings":"AAEA,SAASA,wBAAwB,QAAQ,kBAAiB;AAM1D,OAAO,MAAMC,6BAA6B,CAAC,EACzCC,IAAI,EAC8B,GAAwB,CAAA;QAC1DA;QACAC,OAAO;YACLC,gBAAgB;gBAAC;gBAAS;gBAAQ;gBAAc;aAAY;YAC5DC,OAAOL;YACPM,YAAY;QACd;QACAC,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;gBACNC,UAAU;YACZ;YACA;gBACEF,MAAM;gBACNC,MAAM;gBACNE,OAAO;gBACPD,UAAU;YACZ;YACA;gBACEF,MAAM;gBACNC,MAAM;gBACNG,YAAYV;YACd;YACA;gBACEM,MAAM;gBACNC,MAAM;YACR;YACA;gBACED,MAAM;gBACNC,MAAM;YACR;YACA;gBACED,MAAM;gBACNC,MAAM;gBACNI,cAAc;YAChB;YACA;gBACEL,MAAM;gBACNC,MAAM;gBACNI,cAAc;YAChB;SACD;QACDC,QAAQ;YACNC,QAAQ;YACRC,UAAU;QACZ;IACF,CAAA,EAAE"}
@@ -0,0 +1,5 @@
1
+ import type { CollectionConfig } from 'payload';
2
+ export type CreateDocsKeysCollectionOptions = {
3
+ slug: string;
4
+ };
5
+ export declare const createDocsKeysCollection: ({ slug, }: CreateDocsKeysCollectionOptions) => CollectionConfig;
@@ -0,0 +1,44 @@
1
+ import { DOCS_GLOBALS_ADMIN_GROUP } from '../constants.js';
2
+ export const createDocsKeysCollection = ({ slug })=>({
3
+ slug,
4
+ admin: {
5
+ defaultColumns: [
6
+ 'title',
7
+ 'keyId',
8
+ 'updatedAt'
9
+ ],
10
+ group: DOCS_GLOBALS_ADMIN_GROUP,
11
+ useAsTitle: 'title'
12
+ },
13
+ fields: [
14
+ {
15
+ name: 'title',
16
+ type: 'text',
17
+ required: true
18
+ },
19
+ {
20
+ name: 'keyId',
21
+ type: 'text',
22
+ admin: {
23
+ description: 'Identifier sent by signed docs sync requests. Keep this stable for each publishing environment.'
24
+ },
25
+ index: true,
26
+ required: true,
27
+ unique: true
28
+ },
29
+ {
30
+ name: 'publicKey',
31
+ type: 'textarea',
32
+ admin: {
33
+ description: 'Ed25519 public key allowed to publish docs. Private keys never belong in Payload.'
34
+ },
35
+ required: true
36
+ }
37
+ ],
38
+ labels: {
39
+ plural: 'Keys',
40
+ singular: 'Key'
41
+ }
42
+ });
43
+
44
+ //# sourceMappingURL=docsKeys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/collections/docsKeys.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload'\n\nimport { DOCS_GLOBALS_ADMIN_GROUP } from '../constants.js'\n\nexport type CreateDocsKeysCollectionOptions = {\n slug: string\n}\n\nexport const createDocsKeysCollection = ({\n slug,\n}: CreateDocsKeysCollectionOptions): CollectionConfig => ({\n slug,\n admin: {\n defaultColumns: ['title', 'keyId', 'updatedAt'],\n group: DOCS_GLOBALS_ADMIN_GROUP,\n useAsTitle: 'title',\n },\n fields: [\n {\n name: 'title',\n type: 'text',\n required: true,\n },\n {\n name: 'keyId',\n type: 'text',\n admin: {\n description:\n 'Identifier sent by signed docs sync requests. Keep this stable for each publishing environment.',\n },\n index: true,\n required: true,\n unique: true,\n },\n {\n name: 'publicKey',\n type: 'textarea',\n admin: {\n description:\n 'Ed25519 public key allowed to publish docs. Private keys never belong in Payload.',\n },\n required: true,\n },\n ],\n labels: {\n plural: 'Keys',\n singular: 'Key',\n },\n})\n"],"names":["DOCS_GLOBALS_ADMIN_GROUP","createDocsKeysCollection","slug","admin","defaultColumns","group","useAsTitle","fields","name","type","required","description","index","unique","labels","plural","singular"],"mappings":"AAEA,SAASA,wBAAwB,QAAQ,kBAAiB;AAM1D,OAAO,MAAMC,2BAA2B,CAAC,EACvCC,IAAI,EAC4B,GAAwB,CAAA;QACxDA;QACAC,OAAO;YACLC,gBAAgB;gBAAC;gBAAS;gBAAS;aAAY;YAC/CC,OAAOL;YACPM,YAAY;QACd;QACAC,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;gBACNC,UAAU;YACZ;YACA;gBACEF,MAAM;gBACNC,MAAM;gBACNN,OAAO;oBACLQ,aACE;gBACJ;gBACAC,OAAO;gBACPF,UAAU;gBACVG,QAAQ;YACV;YACA;gBACEL,MAAM;gBACNC,MAAM;gBACNN,OAAO;oBACLQ,aACE;gBACJ;gBACAD,UAAU;YACZ;SACD;QACDI,QAAQ;YACNC,QAAQ;YACRC,UAAU;QACZ;IACF,CAAA,EAAE"}
@@ -1,14 +1,14 @@
1
- import { DOCS_SET_MANAGER_COMPONENT } from '../constants.js';
1
+ import { DOCS_GLOBALS_ADMIN_GROUP, DOCS_SET_MANAGER_COMPONENT } from '../constants.js';
2
2
  export const createDocsSetsCollection = ({ slug, docsCollectionSlug, docsGroupsCollectionSlug, syncRunsCollectionSlug })=>({
3
3
  slug,
4
4
  admin: {
5
5
  defaultColumns: [
6
6
  'title',
7
- 'sourceId',
8
- 'routeBase',
7
+ 'slug',
8
+ 'branch',
9
9
  'updatedAt'
10
10
  ],
11
- group: 'Docs',
11
+ group: DOCS_GLOBALS_ADMIN_GROUP,
12
12
  useAsTitle: 'title'
13
13
  },
14
14
  fields: [
@@ -21,230 +21,70 @@ export const createDocsSetsCollection = ({ slug, docsCollectionSlug, docsGroupsC
21
21
  name: 'slug',
22
22
  type: 'text',
23
23
  index: true,
24
- required: true
25
- },
26
- {
27
- name: 'sourceId',
28
- type: 'text',
29
- index: true,
30
24
  required: true,
31
25
  unique: true
32
26
  },
33
- {
34
- name: 'sourceRoot',
35
- type: 'text',
36
- defaultValue: 'docs'
37
- },
38
27
  {
39
28
  name: 'group',
40
29
  type: 'relationship',
41
30
  relationTo: docsGroupsCollectionSlug
42
31
  },
43
32
  {
44
- name: 'routeBase',
33
+ name: 'branch',
45
34
  type: 'text',
46
- index: true,
47
- required: true,
48
- unique: true
49
- },
50
- {
51
- name: 'description',
52
- type: 'textarea'
35
+ admin: {
36
+ description: 'Git branch allowed to publish this docs set. The full Git ref is handled internally.'
37
+ },
38
+ defaultValue: 'main'
53
39
  },
54
40
  {
55
- name: 'navTitle',
56
- type: 'text'
41
+ name: 'allowPullRequests',
42
+ type: 'checkbox',
43
+ admin: {
44
+ description: 'Allow GitHub pull request events to dry-run or publish this docs set.'
45
+ },
46
+ defaultValue: false
57
47
  },
58
48
  {
59
- name: 'order',
60
- type: 'number',
61
- defaultValue: 0
49
+ name: 'description',
50
+ type: 'textarea'
62
51
  },
63
52
  {
64
- name: 'auth',
53
+ name: 'advancedSecurity',
65
54
  type: 'group',
66
55
  admin: {
67
- description: 'Source-specific sync authentication policy. Use this instead of hardcoding docs sources in payload.config.ts.'
56
+ description: 'Optional workflow lock-down. Leave disabled to allow any workflow from a trusted GitHub owner/repository and branch.'
68
57
  },
69
58
  fields: [
70
59
  {
71
- name: 'ed25519',
72
- type: 'group',
73
- fields: [
74
- {
75
- name: 'keys',
76
- type: 'array',
77
- admin: {
78
- description: 'Public keys allowed to sync this docs set from local machines or non-GitHub CI.'
79
- },
80
- fields: [
81
- {
82
- name: 'keyId',
83
- type: 'text',
84
- required: true
85
- },
86
- {
87
- name: 'publicKey',
88
- type: 'textarea',
89
- required: true
90
- }
91
- ]
92
- },
93
- {
94
- name: 'maxSkewSeconds',
95
- type: 'number'
96
- },
97
- {
98
- name: 'nonceTtlSeconds',
99
- type: 'number'
100
- }
101
- ]
60
+ name: 'enabled',
61
+ type: 'checkbox',
62
+ admin: {
63
+ description: 'When enabled, only the workflow refs listed below can publish this docs set.'
64
+ },
65
+ defaultValue: false
102
66
  },
103
67
  {
104
- name: 'githubOidc',
105
- type: 'group',
68
+ name: 'allowedWorkflowRefs',
69
+ type: 'array',
70
+ admin: {
71
+ condition: (_data, siblingData)=>siblingData?.enabled === true,
72
+ description: 'Exact GitHub workflow refs, for example owner/repo/.github/workflows/publish-docs.yml@refs/heads/main.'
73
+ },
106
74
  fields: [
107
75
  {
108
- name: 'enabled',
109
- type: 'checkbox',
110
- defaultValue: false
111
- },
112
- {
113
- name: 'audience',
76
+ name: 'value',
114
77
  type: 'text',
115
- admin: {
116
- description: 'Optional override. Defaults to the plugin-level GitHub OIDC audience.'
117
- }
118
- },
119
- {
120
- name: 'allowedRepositories',
121
- type: 'array',
122
- admin: {
123
- description: 'GitHub repositories allowed to sync this docs set, for example valkyrianlabs/payload-markdown-docs.'
124
- },
125
- fields: [
126
- {
127
- name: 'value',
128
- type: 'text',
129
- required: true
130
- }
131
- ]
132
- },
133
- {
134
- name: 'allowedRepositoryOwners',
135
- type: 'array',
136
- fields: [
137
- {
138
- name: 'value',
139
- type: 'text',
140
- required: true
141
- }
142
- ]
143
- },
144
- {
145
- name: 'allowedRefs',
146
- type: 'array',
147
- admin: {
148
- description: 'Exact Git refs such as refs/heads/main or refs/tags/v0.2.1.'
149
- },
150
- fields: [
151
- {
152
- name: 'value',
153
- type: 'text',
154
- required: true
155
- }
156
- ]
157
- },
158
- {
159
- name: 'allowedWorkflows',
160
- type: 'array',
161
- fields: [
162
- {
163
- name: 'value',
164
- type: 'text',
165
- required: true
166
- }
167
- ]
168
- },
169
- {
170
- name: 'allowedWorkflowRefs',
171
- type: 'array',
172
- fields: [
173
- {
174
- name: 'value',
175
- type: 'text',
176
- required: true
177
- }
178
- ]
179
- },
180
- {
181
- name: 'allowedEnvironments',
182
- type: 'array',
183
- fields: [
184
- {
185
- name: 'value',
186
- type: 'text',
187
- required: true
188
- }
189
- ]
190
- },
191
- {
192
- name: 'allowPullRequests',
193
- type: 'checkbox',
194
- defaultValue: false
195
- },
196
- {
197
- name: 'issuer',
198
- type: 'text'
199
- },
200
- {
201
- name: 'jwksUrl',
202
- type: 'text'
203
- },
204
- {
205
- name: 'maxSkewSeconds',
206
- type: 'number'
78
+ required: true
207
79
  }
208
- ]
209
- }
210
- ]
211
- },
212
- {
213
- name: 'defaults',
214
- type: 'group',
215
- fields: [
216
- {
217
- name: 'theme',
218
- type: 'text'
219
- },
220
- {
221
- name: 'heroEyebrow',
222
- type: 'text'
223
- },
224
- {
225
- name: 'heroTitle',
226
- type: 'text'
227
- },
228
- {
229
- name: 'heroDescription',
230
- type: 'textarea'
231
- },
232
- {
233
- name: 'seoTitle',
234
- type: 'text'
235
- },
236
- {
237
- name: 'seoDescription',
238
- type: 'textarea'
239
- },
240
- {
241
- name: 'sidebarMode',
242
- type: 'select',
243
- options: [
244
- 'auto',
245
- 'manual',
246
- 'hidden'
247
- ]
80
+ ],
81
+ validate: (value, { siblingData })=>{
82
+ const advancedSecurityData = typeof siblingData === 'object' && siblingData !== null ? siblingData : undefined;
83
+ if (advancedSecurityData?.enabled === true && (!Array.isArray(value) || value.length === 0)) {
84
+ return 'Add at least one workflow ref or disable advanced security.';
85
+ }
86
+ return true;
87
+ }
248
88
  }
249
89
  ]
250
90
  },
@@ -296,12 +136,17 @@ export const createDocsSetsCollection = ({ slug, docsCollectionSlug, docsGroupsC
296
136
  },
297
137
  custom: {
298
138
  docsCollectionSlug,
139
+ docsGroupsCollectionSlug,
299
140
  docsSetsCollectionSlug: slug
300
141
  }
301
142
  }
302
143
  }
303
144
  ] : []
304
- ]
145
+ ],
146
+ labels: {
147
+ plural: 'Sets',
148
+ singular: 'Set'
149
+ }
305
150
  });
306
151
 
307
152
  //# sourceMappingURL=docsSets.js.map