@valkyrianlabs/payload-markdown-docs 0.3.1 → 0.4.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/README.md +76 -176
- package/dist/admin/DocsSetManager.js +5 -3
- package/dist/admin/DocsSetManager.js.map +1 -1
- package/dist/admin/docsSetManagerData.d.ts +6 -5
- package/dist/admin/docsSetManagerData.js +60 -33
- package/dist/admin/docsSetManagerData.js.map +1 -1
- package/dist/admin/docsSetManagerTypes.d.ts +12 -9
- package/dist/admin/docsSetManagerTypes.js.map +1 -1
- package/dist/cli/commands/manifest.js +1 -2
- package/dist/cli/commands/manifest.js.map +1 -1
- package/dist/cli/commands/plan.js +1 -2
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/push.js +2 -5
- package/dist/cli/commands/push.js.map +1 -1
- package/dist/cli/commands/validate.js +11 -6
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/index.js +5 -14
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/parseArgs.js +0 -3
- package/dist/cli/parseArgs.js.map +1 -1
- package/dist/cli/types.d.ts +0 -3
- package/dist/cli/types.js.map +1 -1
- package/dist/collections/docs.js +0 -24
- package/dist/collections/docs.js.map +1 -1
- package/dist/collections/docsGroups.js +8 -9
- package/dist/collections/docsGroups.js.map +1 -1
- package/dist/collections/docsKeys.d.ts +5 -0
- package/dist/collections/docsKeys.js +44 -0
- package/dist/collections/docsKeys.js.map +1 -0
- package/dist/collections/docsSets.js +47 -202
- package/dist/collections/docsSets.js.map +1 -1
- package/dist/collections/docsTrusted.d.ts +5 -0
- package/dist/collections/docsTrusted.js +60 -0
- package/dist/collections/docsTrusted.js.map +1 -0
- package/dist/collections/index.d.ts +4 -0
- package/dist/collections/index.js +2 -0
- package/dist/collections/index.js.map +1 -1
- package/dist/constants.d.ts +3 -1
- package/dist/constants.js +3 -1
- package/dist/constants.js.map +1 -1
- package/dist/endpoints/sync.d.ts +6 -7
- package/dist/endpoints/sync.js +57 -124
- package/dist/endpoints/sync.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/next/PayloadMarkdownDocsPage.js +2 -6
- package/dist/next/PayloadMarkdownDocsPage.js.map +1 -1
- package/dist/next/index.d.ts +2 -0
- package/dist/next/index.js +1 -0
- package/dist/next/index.js.map +1 -1
- package/dist/next/links.d.ts +11 -0
- package/dist/next/links.js +79 -0
- package/dist/next/links.js.map +1 -0
- package/dist/next/markdown.js +91 -19
- package/dist/next/markdown.js.map +1 -1
- package/dist/next/metadata.js +6 -6
- package/dist/next/metadata.js.map +1 -1
- package/dist/next/records.js +13 -23
- package/dist/next/records.js.map +1 -1
- package/dist/next/route.js +141 -49
- package/dist/next/route.js.map +1 -1
- package/dist/next/types.d.ts +0 -14
- package/dist/next/types.js.map +1 -1
- package/dist/payload/docsKeys.d.ts +20 -0
- package/dist/payload/docsKeys.js +29 -0
- package/dist/payload/docsKeys.js.map +1 -0
- package/dist/payload/docsSets.d.ts +32 -6
- package/dist/payload/docsSets.js +146 -83
- package/dist/payload/docsSets.js.map +1 -1
- package/dist/payload/docsTrusted.d.ts +16 -0
- package/dist/payload/docsTrusted.js +49 -0
- package/dist/payload/docsTrusted.js.map +1 -0
- package/dist/payload/index.d.ts +5 -1
- package/dist/payload/index.js +3 -1
- package/dist/payload/index.js.map +1 -1
- package/dist/plugin.js +36 -9
- package/dist/plugin.js.map +1 -1
- package/dist/security/githubOidc.d.ts +18 -5
- package/dist/security/githubOidc.js +44 -16
- package/dist/security/githubOidc.js.map +1 -1
- package/dist/security/index.d.ts +1 -1
- package/dist/security/index.js.map +1 -1
- package/dist/skills/codex/SKILL.md +3 -4
- package/dist/skills/codex/examples/github-actions.md +0 -2
- package/dist/skills/codex/reference/admin.md +0 -6
- package/dist/skills/codex/reference/routing.md +2 -1
- package/dist/skills/codex/reference/sync.md +7 -5
- package/dist/skills/codex/reference/troubleshooting.md +3 -4
- package/dist/skills/codex/reference/workflow.md +0 -1
- package/dist/sync/manifest.d.ts +1 -3
- package/dist/sync/manifest.js +2 -3
- package/dist/sync/manifest.js.map +1 -1
- package/dist/sync/validate.js +1 -2
- package/dist/sync/validate.js.map +1 -1
- package/dist/types.d.ts +7 -50
- package/dist/types.js.map +1 -1
- package/package.json +4 -4
package/dist/cli/index.js.map
CHANGED
|
@@ -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,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AAK,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> 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-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":";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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,OAAON,IAAI,CAACC,OAAO,KAAK,QAAQ;YAClC,OAAOf,eAAeoB,OAAON,IAAI;QACnC;QAEA,IAAIM,OAAON,IAAI,CAACC,OAAO,KAAK,QAAQ;YAClC,OAAOd,eAAemB,OAAON,IAAI;QACnC;QAEA,IAAIM,OAAON,IAAI,CAACC,OAAO,KAAK,YAAY;YACtC,OAAOb,mBAAmBkB,OAAON,IAAI;QACvC;QAEA,OAAO;YACLQ,UAAU;YACVC,QAAQ;QACV;IACF,EAAE,OAAOC,OAAO;QACd,OAAO;YACLF,UAAU;YACVC,QAAQC,iBAAiBI,QAAQ,GAAGJ,MAAMK,OAAO,CAAC,EAAE,CAAC,GAAG;QAC1D;IACF;AACF,EAAC;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"}
|
package/dist/cli/parseArgs.js
CHANGED
|
@@ -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 '
|
|
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;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AAO;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"}
|
package/dist/cli/types.d.ts
CHANGED
|
@@ -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;
|
package/dist/cli/types.js.map
CHANGED
|
@@ -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
|
|
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"}
|
package/dist/collections/docs.js
CHANGED
|
@@ -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
|
|
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
|
-
'
|
|
7
|
+
'slug',
|
|
7
8
|
'serveIndex',
|
|
8
9
|
'updatedAt'
|
|
9
10
|
],
|
|
10
|
-
group:
|
|
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', '
|
|
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,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
|
-
'
|
|
8
|
-
'
|
|
7
|
+
'slug',
|
|
8
|
+
'branch',
|
|
9
9
|
'updatedAt'
|
|
10
10
|
],
|
|
11
|
-
group:
|
|
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: '
|
|
33
|
+
name: 'branch',
|
|
45
34
|
type: 'text',
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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: '
|
|
56
|
-
type: '
|
|
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: '
|
|
60
|
-
type: '
|
|
61
|
-
defaultValue: 0
|
|
49
|
+
name: 'description',
|
|
50
|
+
type: 'textarea'
|
|
62
51
|
},
|
|
63
52
|
{
|
|
64
|
-
name: '
|
|
53
|
+
name: 'advancedSecurity',
|
|
65
54
|
type: 'group',
|
|
66
55
|
admin: {
|
|
67
|
-
description: '
|
|
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: '
|
|
72
|
-
type: '
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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: '
|
|
105
|
-
type: '
|
|
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: '
|
|
109
|
-
type: 'checkbox',
|
|
110
|
-
defaultValue: false
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
name: 'audience',
|
|
76
|
+
name: 'value',
|
|
114
77
|
type: 'text',
|
|
115
|
-
|
|
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
|
-
|
|
214
|
-
|
|
215
|
-
|
|
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
|