@enbox/gitd 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +177 -0
- package/README.md +134 -0
- package/dist/esm/ci.js +76 -0
- package/dist/esm/ci.js.map +1 -0
- package/dist/esm/cli/agent.js +86 -0
- package/dist/esm/cli/agent.js.map +1 -0
- package/dist/esm/cli/commands/ci.js +278 -0
- package/dist/esm/cli/commands/ci.js.map +1 -0
- package/dist/esm/cli/commands/clone.js +77 -0
- package/dist/esm/cli/commands/clone.js.map +1 -0
- package/dist/esm/cli/commands/daemon.js +132 -0
- package/dist/esm/cli/commands/daemon.js.map +1 -0
- package/dist/esm/cli/commands/github-api.js +36 -0
- package/dist/esm/cli/commands/github-api.js.map +1 -0
- package/dist/esm/cli/commands/init.js +69 -0
- package/dist/esm/cli/commands/init.js.map +1 -0
- package/dist/esm/cli/commands/issue.js +293 -0
- package/dist/esm/cli/commands/issue.js.map +1 -0
- package/dist/esm/cli/commands/log.js +90 -0
- package/dist/esm/cli/commands/log.js.map +1 -0
- package/dist/esm/cli/commands/migrate.js +444 -0
- package/dist/esm/cli/commands/migrate.js.map +1 -0
- package/dist/esm/cli/commands/notification.js +141 -0
- package/dist/esm/cli/commands/notification.js.map +1 -0
- package/dist/esm/cli/commands/org.js +353 -0
- package/dist/esm/cli/commands/org.js.map +1 -0
- package/dist/esm/cli/commands/patch.js +375 -0
- package/dist/esm/cli/commands/patch.js.map +1 -0
- package/dist/esm/cli/commands/registry.js +501 -0
- package/dist/esm/cli/commands/registry.js.map +1 -0
- package/dist/esm/cli/commands/release.js +197 -0
- package/dist/esm/cli/commands/release.js.map +1 -0
- package/dist/esm/cli/commands/repo.js +148 -0
- package/dist/esm/cli/commands/repo.js.map +1 -0
- package/dist/esm/cli/commands/serve.js +148 -0
- package/dist/esm/cli/commands/serve.js.map +1 -0
- package/dist/esm/cli/commands/setup.js +92 -0
- package/dist/esm/cli/commands/setup.js.map +1 -0
- package/dist/esm/cli/commands/shim.js +75 -0
- package/dist/esm/cli/commands/shim.js.map +1 -0
- package/dist/esm/cli/commands/social.js +206 -0
- package/dist/esm/cli/commands/social.js.map +1 -0
- package/dist/esm/cli/commands/web.js +36 -0
- package/dist/esm/cli/commands/web.js.map +1 -0
- package/dist/esm/cli/commands/wiki.js +185 -0
- package/dist/esm/cli/commands/wiki.js.map +1 -0
- package/dist/esm/cli/flags.js +29 -0
- package/dist/esm/cli/flags.js.map +1 -0
- package/dist/esm/cli/main.js +331 -0
- package/dist/esm/cli/main.js.map +1 -0
- package/dist/esm/cli/repo-context.js +53 -0
- package/dist/esm/cli/repo-context.js.map +1 -0
- package/dist/esm/daemon/adapter.js +18 -0
- package/dist/esm/daemon/adapter.js.map +1 -0
- package/dist/esm/daemon/adapters/github.js +112 -0
- package/dist/esm/daemon/adapters/github.js.map +1 -0
- package/dist/esm/daemon/adapters/go.js +51 -0
- package/dist/esm/daemon/adapters/go.js.map +1 -0
- package/dist/esm/daemon/adapters/index.js +32 -0
- package/dist/esm/daemon/adapters/index.js.map +1 -0
- package/dist/esm/daemon/adapters/npm.js +51 -0
- package/dist/esm/daemon/adapters/npm.js.map +1 -0
- package/dist/esm/daemon/adapters/oci.js +62 -0
- package/dist/esm/daemon/adapters/oci.js.map +1 -0
- package/dist/esm/daemon/index.js +12 -0
- package/dist/esm/daemon/index.js.map +1 -0
- package/dist/esm/daemon/server.js +167 -0
- package/dist/esm/daemon/server.js.map +1 -0
- package/dist/esm/git-remote/credential-helper.js +106 -0
- package/dist/esm/git-remote/credential-helper.js.map +1 -0
- package/dist/esm/git-remote/credential-main.js +109 -0
- package/dist/esm/git-remote/credential-main.js.map +1 -0
- package/dist/esm/git-remote/index.js +10 -0
- package/dist/esm/git-remote/index.js.map +1 -0
- package/dist/esm/git-remote/main.js +78 -0
- package/dist/esm/git-remote/main.js.map +1 -0
- package/dist/esm/git-remote/parse-url.js +60 -0
- package/dist/esm/git-remote/parse-url.js.map +1 -0
- package/dist/esm/git-remote/resolve.js +175 -0
- package/dist/esm/git-remote/resolve.js.map +1 -0
- package/dist/esm/git-remote/service.js +82 -0
- package/dist/esm/git-remote/service.js.map +1 -0
- package/dist/esm/git-server/auth.js +211 -0
- package/dist/esm/git-server/auth.js.map +1 -0
- package/dist/esm/git-server/bundle-restore.js +180 -0
- package/dist/esm/git-server/bundle-restore.js.map +1 -0
- package/dist/esm/git-server/bundle-sync.js +233 -0
- package/dist/esm/git-server/bundle-sync.js.map +1 -0
- package/dist/esm/git-server/did-service.js +73 -0
- package/dist/esm/git-server/did-service.js.map +1 -0
- package/dist/esm/git-server/git-backend.js +186 -0
- package/dist/esm/git-server/git-backend.js.map +1 -0
- package/dist/esm/git-server/http-handler.js +295 -0
- package/dist/esm/git-server/http-handler.js.map +1 -0
- package/dist/esm/git-server/index.js +16 -0
- package/dist/esm/git-server/index.js.map +1 -0
- package/dist/esm/git-server/push-authorizer.js +62 -0
- package/dist/esm/git-server/push-authorizer.js.map +1 -0
- package/dist/esm/git-server/ref-sync.js +132 -0
- package/dist/esm/git-server/ref-sync.js.map +1 -0
- package/dist/esm/git-server/server.js +185 -0
- package/dist/esm/git-server/server.js.map +1 -0
- package/dist/esm/git-server/verify.js +109 -0
- package/dist/esm/git-server/verify.js.map +1 -0
- package/dist/esm/github-shim/helpers.js +273 -0
- package/dist/esm/github-shim/helpers.js.map +1 -0
- package/dist/esm/github-shim/index.js +13 -0
- package/dist/esm/github-shim/index.js.map +1 -0
- package/dist/esm/github-shim/issues.js +318 -0
- package/dist/esm/github-shim/issues.js.map +1 -0
- package/dist/esm/github-shim/pulls.js +423 -0
- package/dist/esm/github-shim/pulls.js.map +1 -0
- package/dist/esm/github-shim/releases.js +154 -0
- package/dist/esm/github-shim/releases.js.map +1 -0
- package/dist/esm/github-shim/repos.js +86 -0
- package/dist/esm/github-shim/repos.js.map +1 -0
- package/dist/esm/github-shim/server.js +351 -0
- package/dist/esm/github-shim/server.js.map +1 -0
- package/dist/esm/github-shim/users.js +61 -0
- package/dist/esm/github-shim/users.js.map +1 -0
- package/dist/esm/index.js +26 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/indexer/api.js +132 -0
- package/dist/esm/indexer/api.js.map +1 -0
- package/dist/esm/indexer/crawler.js +256 -0
- package/dist/esm/indexer/crawler.js.map +1 -0
- package/dist/esm/indexer/index.js +9 -0
- package/dist/esm/indexer/index.js.map +1 -0
- package/dist/esm/indexer/main.js +76 -0
- package/dist/esm/indexer/main.js.map +1 -0
- package/dist/esm/indexer/store.js +334 -0
- package/dist/esm/indexer/store.js.map +1 -0
- package/dist/esm/issues.js +133 -0
- package/dist/esm/issues.js.map +1 -0
- package/dist/esm/notifications.js +47 -0
- package/dist/esm/notifications.js.map +1 -0
- package/dist/esm/org.js +90 -0
- package/dist/esm/org.js.map +1 -0
- package/dist/esm/patches.js +136 -0
- package/dist/esm/patches.js.map +1 -0
- package/dist/esm/refs.js +54 -0
- package/dist/esm/refs.js.map +1 -0
- package/dist/esm/registry.js +81 -0
- package/dist/esm/registry.js.map +1 -0
- package/dist/esm/releases.js +78 -0
- package/dist/esm/releases.js.map +1 -0
- package/dist/esm/repo.js +150 -0
- package/dist/esm/repo.js.map +1 -0
- package/dist/esm/resolver/index.js +10 -0
- package/dist/esm/resolver/index.js.map +1 -0
- package/dist/esm/resolver/resolve.js +189 -0
- package/dist/esm/resolver/resolve.js.map +1 -0
- package/dist/esm/resolver/trust-chain.js +155 -0
- package/dist/esm/resolver/trust-chain.js.map +1 -0
- package/dist/esm/resolver/verify.js +186 -0
- package/dist/esm/resolver/verify.js.map +1 -0
- package/dist/esm/shims/go/index.js +9 -0
- package/dist/esm/shims/go/index.js.map +1 -0
- package/dist/esm/shims/go/proxy.js +275 -0
- package/dist/esm/shims/go/proxy.js.map +1 -0
- package/dist/esm/shims/go/server.js +70 -0
- package/dist/esm/shims/go/server.js.map +1 -0
- package/dist/esm/shims/index.js +15 -0
- package/dist/esm/shims/index.js.map +1 -0
- package/dist/esm/shims/npm/index.js +9 -0
- package/dist/esm/shims/npm/index.js.map +1 -0
- package/dist/esm/shims/npm/registry.js +234 -0
- package/dist/esm/shims/npm/registry.js.map +1 -0
- package/dist/esm/shims/npm/server.js +72 -0
- package/dist/esm/shims/npm/server.js.map +1 -0
- package/dist/esm/shims/oci/index.js +9 -0
- package/dist/esm/shims/oci/index.js.map +1 -0
- package/dist/esm/shims/oci/registry.js +276 -0
- package/dist/esm/shims/oci/registry.js.map +1 -0
- package/dist/esm/shims/oci/server.js +82 -0
- package/dist/esm/shims/oci/server.js.map +1 -0
- package/dist/esm/social.js +70 -0
- package/dist/esm/social.js.map +1 -0
- package/dist/esm/web/html.js +123 -0
- package/dist/esm/web/html.js.map +1 -0
- package/dist/esm/web/index.js +7 -0
- package/dist/esm/web/index.js.map +1 -0
- package/dist/esm/web/routes.js +420 -0
- package/dist/esm/web/routes.js.map +1 -0
- package/dist/esm/web/server.js +225 -0
- package/dist/esm/web/server.js.map +1 -0
- package/dist/esm/wiki.js +63 -0
- package/dist/esm/wiki.js.map +1 -0
- package/dist/types/ci.d.ts +203 -0
- package/dist/types/ci.d.ts.map +1 -0
- package/dist/types/cli/agent.d.ts +59 -0
- package/dist/types/cli/agent.d.ts.map +1 -0
- package/dist/types/cli/commands/ci.d.ts +16 -0
- package/dist/types/cli/commands/ci.d.ts.map +1 -0
- package/dist/types/cli/commands/clone.d.ts +13 -0
- package/dist/types/cli/commands/clone.d.ts.map +1 -0
- package/dist/types/cli/commands/daemon.d.ts +29 -0
- package/dist/types/cli/commands/daemon.d.ts.map +1 -0
- package/dist/types/cli/commands/github-api.d.ts +14 -0
- package/dist/types/cli/commands/github-api.d.ts.map +1 -0
- package/dist/types/cli/commands/init.d.ts +11 -0
- package/dist/types/cli/commands/init.d.ts.map +1 -0
- package/dist/types/cli/commands/issue.d.ts +16 -0
- package/dist/types/cli/commands/issue.d.ts.map +1 -0
- package/dist/types/cli/commands/log.d.ts +13 -0
- package/dist/types/cli/commands/log.d.ts.map +1 -0
- package/dist/types/cli/commands/migrate.d.ts +19 -0
- package/dist/types/cli/commands/migrate.d.ts.map +1 -0
- package/dist/types/cli/commands/notification.d.ts +16 -0
- package/dist/types/cli/commands/notification.d.ts.map +1 -0
- package/dist/types/cli/commands/org.d.ts +19 -0
- package/dist/types/cli/commands/org.d.ts.map +1 -0
- package/dist/types/cli/commands/patch.d.ts +17 -0
- package/dist/types/cli/commands/patch.d.ts.map +1 -0
- package/dist/types/cli/commands/registry.d.ts +25 -0
- package/dist/types/cli/commands/registry.d.ts.map +1 -0
- package/dist/types/cli/commands/release.d.ts +13 -0
- package/dist/types/cli/commands/release.d.ts.map +1 -0
- package/dist/types/cli/commands/repo.d.ts +15 -0
- package/dist/types/cli/commands/repo.d.ts.map +1 -0
- package/dist/types/cli/commands/serve.d.ts +22 -0
- package/dist/types/cli/commands/serve.d.ts.map +1 -0
- package/dist/types/cli/commands/setup.d.ts +16 -0
- package/dist/types/cli/commands/setup.d.ts.map +1 -0
- package/dist/types/cli/commands/shim.d.ts +16 -0
- package/dist/types/cli/commands/shim.d.ts.map +1 -0
- package/dist/types/cli/commands/social.d.ts +19 -0
- package/dist/types/cli/commands/social.d.ts.map +1 -0
- package/dist/types/cli/commands/web.d.ts +14 -0
- package/dist/types/cli/commands/web.d.ts.map +1 -0
- package/dist/types/cli/commands/wiki.d.ts +14 -0
- package/dist/types/cli/commands/wiki.d.ts.map +1 -0
- package/dist/types/cli/flags.d.ts +16 -0
- package/dist/types/cli/flags.d.ts.map +1 -0
- package/dist/types/cli/main.d.ts +69 -0
- package/dist/types/cli/main.d.ts.map +1 -0
- package/dist/types/cli/repo-context.d.ts +30 -0
- package/dist/types/cli/repo-context.d.ts.map +1 -0
- package/dist/types/daemon/adapter.d.ts +74 -0
- package/dist/types/daemon/adapter.d.ts.map +1 -0
- package/dist/types/daemon/adapters/github.d.ts +10 -0
- package/dist/types/daemon/adapters/github.d.ts.map +1 -0
- package/dist/types/daemon/adapters/go.d.ts +10 -0
- package/dist/types/daemon/adapters/go.d.ts.map +1 -0
- package/dist/types/daemon/adapters/index.d.ts +22 -0
- package/dist/types/daemon/adapters/index.d.ts.map +1 -0
- package/dist/types/daemon/adapters/npm.d.ts +10 -0
- package/dist/types/daemon/adapters/npm.d.ts.map +1 -0
- package/dist/types/daemon/adapters/oci.d.ts +10 -0
- package/dist/types/daemon/adapters/oci.d.ts.map +1 -0
- package/dist/types/daemon/index.d.ts +14 -0
- package/dist/types/daemon/index.d.ts.map +1 -0
- package/dist/types/daemon/server.d.ts +55 -0
- package/dist/types/daemon/server.d.ts.map +1 -0
- package/dist/types/git-remote/credential-helper.d.ts +49 -0
- package/dist/types/git-remote/credential-helper.d.ts.map +1 -0
- package/dist/types/git-remote/credential-main.d.ts +24 -0
- package/dist/types/git-remote/credential-main.d.ts.map +1 -0
- package/dist/types/git-remote/index.d.ts +10 -0
- package/dist/types/git-remote/index.d.ts.map +1 -0
- package/dist/types/git-remote/main.d.ts +23 -0
- package/dist/types/git-remote/main.d.ts.map +1 -0
- package/dist/types/git-remote/parse-url.d.ts +32 -0
- package/dist/types/git-remote/parse-url.d.ts.map +1 -0
- package/dist/types/git-remote/resolve.d.ts +30 -0
- package/dist/types/git-remote/resolve.d.ts.map +1 -0
- package/dist/types/git-remote/service.d.ts +75 -0
- package/dist/types/git-remote/service.d.ts.map +1 -0
- package/dist/types/git-server/auth.d.ts +129 -0
- package/dist/types/git-server/auth.d.ts.map +1 -0
- package/dist/types/git-server/bundle-restore.d.ts +48 -0
- package/dist/types/git-server/bundle-restore.d.ts.map +1 -0
- package/dist/types/git-server/bundle-sync.d.ts +90 -0
- package/dist/types/git-server/bundle-sync.d.ts.map +1 -0
- package/dist/types/git-server/did-service.d.ts +26 -0
- package/dist/types/git-server/did-service.d.ts.map +1 -0
- package/dist/types/git-server/git-backend.d.ts +84 -0
- package/dist/types/git-server/git-backend.d.ts.map +1 -0
- package/dist/types/git-server/http-handler.d.ts +73 -0
- package/dist/types/git-server/http-handler.d.ts.map +1 -0
- package/dist/types/git-server/index.d.ts +16 -0
- package/dist/types/git-server/index.d.ts.map +1 -0
- package/dist/types/git-server/push-authorizer.d.ts +38 -0
- package/dist/types/git-server/push-authorizer.d.ts.map +1 -0
- package/dist/types/git-server/ref-sync.d.ts +52 -0
- package/dist/types/git-server/ref-sync.d.ts.map +1 -0
- package/dist/types/git-server/server.d.ts +70 -0
- package/dist/types/git-server/server.d.ts.map +1 -0
- package/dist/types/git-server/verify.d.ts +12 -0
- package/dist/types/git-server/verify.d.ts.map +1 -0
- package/dist/types/github-shim/helpers.d.ts +108 -0
- package/dist/types/github-shim/helpers.d.ts.map +1 -0
- package/dist/types/github-shim/index.d.ts +15 -0
- package/dist/types/github-shim/index.d.ts.map +1 -0
- package/dist/types/github-shim/issues.d.ts +24 -0
- package/dist/types/github-shim/issues.d.ts.map +1 -0
- package/dist/types/github-shim/pulls.d.ts +31 -0
- package/dist/types/github-shim/pulls.d.ts.map +1 -0
- package/dist/types/github-shim/releases.d.ts +18 -0
- package/dist/types/github-shim/releases.d.ts.map +1 -0
- package/dist/types/github-shim/repos.d.ts +21 -0
- package/dist/types/github-shim/repos.d.ts.map +1 -0
- package/dist/types/github-shim/server.d.ts +53 -0
- package/dist/types/github-shim/server.d.ts.map +1 -0
- package/dist/types/github-shim/users.d.ts +17 -0
- package/dist/types/github-shim/users.d.ts.map +1 -0
- package/dist/types/index.d.ts +26 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/indexer/api.d.ts +32 -0
- package/dist/types/indexer/api.d.ts.map +1 -0
- package/dist/types/indexer/crawler.d.ts +72 -0
- package/dist/types/indexer/crawler.d.ts.map +1 -0
- package/dist/types/indexer/index.d.ts +12 -0
- package/dist/types/indexer/index.d.ts.map +1 -0
- package/dist/types/indexer/main.d.ts +21 -0
- package/dist/types/indexer/main.d.ts.map +1 -0
- package/dist/types/indexer/store.d.ts +168 -0
- package/dist/types/indexer/store.d.ts.map +1 -0
- package/dist/types/issues.d.ts +395 -0
- package/dist/types/issues.d.ts.map +1 -0
- package/dist/types/notifications.d.ts +93 -0
- package/dist/types/notifications.d.ts.map +1 -0
- package/dist/types/org.d.ts +232 -0
- package/dist/types/org.d.ts.map +1 -0
- package/dist/types/patches.d.ts +410 -0
- package/dist/types/patches.d.ts.map +1 -0
- package/dist/types/refs.d.ts +114 -0
- package/dist/types/refs.d.ts.map +1 -0
- package/dist/types/registry.d.ts +212 -0
- package/dist/types/registry.d.ts.map +1 -0
- package/dist/types/releases.d.ts +204 -0
- package/dist/types/releases.d.ts.map +1 -0
- package/dist/types/repo.d.ts +450 -0
- package/dist/types/repo.d.ts.map +1 -0
- package/dist/types/resolver/index.d.ts +13 -0
- package/dist/types/resolver/index.d.ts.map +1 -0
- package/dist/types/resolver/resolve.d.ts +80 -0
- package/dist/types/resolver/resolve.d.ts.map +1 -0
- package/dist/types/resolver/trust-chain.d.ts +54 -0
- package/dist/types/resolver/trust-chain.d.ts.map +1 -0
- package/dist/types/resolver/verify.d.ts +62 -0
- package/dist/types/resolver/verify.d.ts.map +1 -0
- package/dist/types/shims/go/index.d.ts +11 -0
- package/dist/types/shims/go/index.d.ts.map +1 -0
- package/dist/types/shims/go/proxy.d.ts +51 -0
- package/dist/types/shims/go/proxy.d.ts.map +1 -0
- package/dist/types/shims/go/server.d.ts +23 -0
- package/dist/types/shims/go/server.d.ts.map +1 -0
- package/dist/types/shims/index.d.ts +18 -0
- package/dist/types/shims/index.d.ts.map +1 -0
- package/dist/types/shims/npm/index.d.ts +11 -0
- package/dist/types/shims/npm/index.d.ts.map +1 -0
- package/dist/types/shims/npm/registry.d.ts +46 -0
- package/dist/types/shims/npm/registry.d.ts.map +1 -0
- package/dist/types/shims/npm/server.d.ts +23 -0
- package/dist/types/shims/npm/server.d.ts.map +1 -0
- package/dist/types/shims/oci/index.d.ts +11 -0
- package/dist/types/shims/oci/index.d.ts.map +1 -0
- package/dist/types/shims/oci/registry.d.ts +56 -0
- package/dist/types/shims/oci/registry.d.ts.map +1 -0
- package/dist/types/shims/oci/server.d.ts +23 -0
- package/dist/types/shims/oci/server.d.ts.map +1 -0
- package/dist/types/social.d.ts +162 -0
- package/dist/types/social.d.ts.map +1 -0
- package/dist/types/web/html.d.ts +23 -0
- package/dist/types/web/html.d.ts.map +1 -0
- package/dist/types/web/index.d.ts +8 -0
- package/dist/types/web/index.d.ts.map +1 -0
- package/dist/types/web/routes.d.ts +21 -0
- package/dist/types/web/routes.d.ts.map +1 -0
- package/dist/types/web/server.d.ts +38 -0
- package/dist/types/web/server.d.ts.map +1 -0
- package/dist/types/wiki.d.ts +143 -0
- package/dist/types/wiki.d.ts.map +1 -0
- package/package.json +108 -0
- package/schemas/ci/check-run.json +23 -0
- package/schemas/ci/check-suite.json +23 -0
- package/schemas/issues/assignment.json +17 -0
- package/schemas/issues/comment.json +14 -0
- package/schemas/issues/issue.json +20 -0
- package/schemas/issues/label.json +17 -0
- package/schemas/issues/reaction.json +14 -0
- package/schemas/issues/status-change.json +14 -0
- package/schemas/notifications/notification.json +20 -0
- package/schemas/org/org-member.json +17 -0
- package/schemas/org/org.json +26 -0
- package/schemas/org/team-member.json +17 -0
- package/schemas/org/team.json +17 -0
- package/schemas/patches/merge-result.json +14 -0
- package/schemas/patches/patch-status-change.json +14 -0
- package/schemas/patches/patch.json +20 -0
- package/schemas/patches/review-comment.json +17 -0
- package/schemas/patches/review.json +14 -0
- package/schemas/patches/revision.json +30 -0
- package/schemas/refs/git-ref.json +32 -0
- package/schemas/registry/attestation.json +23 -0
- package/schemas/registry/package-version.json +23 -0
- package/schemas/registry/package.json +32 -0
- package/schemas/releases/release.json +17 -0
- package/schemas/repo/collaborator.json +17 -0
- package/schemas/repo/repo.json +35 -0
- package/schemas/repo/settings.json +39 -0
- package/schemas/repo/topic.json +14 -0
- package/schemas/repo/webhook.json +26 -0
- package/schemas/social/activity.json +23 -0
- package/schemas/social/follow.json +17 -0
- package/schemas/social/star.json +20 -0
- package/schemas/wiki/wiki-history.json +20 -0
- package/schemas/wiki/wiki-page.json +17 -0
- package/src/ci.ts +118 -0
- package/src/cli/agent.ts +117 -0
- package/src/cli/commands/ci.ts +300 -0
- package/src/cli/commands/clone.ts +78 -0
- package/src/cli/commands/daemon.ts +129 -0
- package/src/cli/commands/github-api.ts +30 -0
- package/src/cli/commands/init.ts +69 -0
- package/src/cli/commands/issue.ts +321 -0
- package/src/cli/commands/log.ts +106 -0
- package/src/cli/commands/migrate.ts +525 -0
- package/src/cli/commands/notification.ts +148 -0
- package/src/cli/commands/org.ts +381 -0
- package/src/cli/commands/patch.ts +413 -0
- package/src/cli/commands/registry.ts +542 -0
- package/src/cli/commands/release.ts +189 -0
- package/src/cli/commands/repo.ts +160 -0
- package/src/cli/commands/serve.ts +153 -0
- package/src/cli/commands/setup.ts +97 -0
- package/src/cli/commands/shim.ts +79 -0
- package/src/cli/commands/social.ts +221 -0
- package/src/cli/commands/web.ts +30 -0
- package/src/cli/commands/wiki.ts +199 -0
- package/src/cli/flags.ts +28 -0
- package/src/cli/main.ts +350 -0
- package/src/cli/repo-context.ts +55 -0
- package/src/daemon/adapter.ts +95 -0
- package/src/daemon/adapters/github.ts +86 -0
- package/src/daemon/adapters/go.ts +47 -0
- package/src/daemon/adapters/index.ts +36 -0
- package/src/daemon/adapters/npm.ts +47 -0
- package/src/daemon/adapters/oci.ts +59 -0
- package/src/daemon/index.ts +16 -0
- package/src/daemon/server.ts +204 -0
- package/src/git-remote/credential-helper.ts +114 -0
- package/src/git-remote/credential-main.ts +118 -0
- package/src/git-remote/index.ts +10 -0
- package/src/git-remote/main.ts +74 -0
- package/src/git-remote/parse-url.ts +81 -0
- package/src/git-remote/resolve.ts +207 -0
- package/src/git-remote/service.ts +126 -0
- package/src/git-server/auth.ts +308 -0
- package/src/git-server/bundle-restore.ts +217 -0
- package/src/git-server/bundle-sync.ts +300 -0
- package/src/git-server/did-service.ts +77 -0
- package/src/git-server/git-backend.ts +222 -0
- package/src/git-server/http-handler.ts +386 -0
- package/src/git-server/index.ts +16 -0
- package/src/git-server/push-authorizer.ts +77 -0
- package/src/git-server/ref-sync.ts +166 -0
- package/src/git-server/server.ts +236 -0
- package/src/git-server/verify.ts +116 -0
- package/src/github-shim/helpers.ts +311 -0
- package/src/github-shim/index.ts +35 -0
- package/src/github-shim/issues.ts +389 -0
- package/src/github-shim/pulls.ts +500 -0
- package/src/github-shim/releases.ts +185 -0
- package/src/github-shim/repos.ts +95 -0
- package/src/github-shim/server.ts +334 -0
- package/src/github-shim/users.ts +63 -0
- package/src/index.ts +26 -0
- package/src/indexer/api.ts +162 -0
- package/src/indexer/crawler.ts +290 -0
- package/src/indexer/index.ts +22 -0
- package/src/indexer/main.ts +83 -0
- package/src/indexer/store.ts +408 -0
- package/src/issues.ts +200 -0
- package/src/notifications.ts +80 -0
- package/src/org.ts +147 -0
- package/src/patches.ts +203 -0
- package/src/refs.ts +94 -0
- package/src/registry.ts +132 -0
- package/src/releases.ts +124 -0
- package/src/repo.ts +234 -0
- package/src/resolver/index.ts +42 -0
- package/src/resolver/resolve.ts +244 -0
- package/src/resolver/trust-chain.ts +217 -0
- package/src/resolver/verify.ts +237 -0
- package/src/shims/go/index.ts +14 -0
- package/src/shims/go/proxy.ts +336 -0
- package/src/shims/go/server.ts +82 -0
- package/src/shims/index.ts +20 -0
- package/src/shims/npm/index.ts +14 -0
- package/src/shims/npm/registry.ts +288 -0
- package/src/shims/npm/server.ts +84 -0
- package/src/shims/oci/index.ts +14 -0
- package/src/shims/oci/registry.ts +334 -0
- package/src/shims/oci/server.ts +94 -0
- package/src/social.ts +116 -0
- package/src/web/html.ts +120 -0
- package/src/web/index.ts +8 -0
- package/src/web/routes.ts +449 -0
- package/src/web/server.ts +256 -0
- package/src/wiki.ts +102 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git bundle → DWN sync — creates/updates a git bundle as a DWN record.
|
|
3
|
+
*
|
|
4
|
+
* After a successful `git push`, this module generates a `git bundle` from
|
|
5
|
+
* the bare repository and writes it as a ForgeRepo `bundle` record.
|
|
6
|
+
* Incremental bundles are created when a previous bundle exists; periodic
|
|
7
|
+
* squash writes compact all incrementals into a single full bundle.
|
|
8
|
+
*
|
|
9
|
+
* Bundle sync flow:
|
|
10
|
+
* 1. Query existing bundle records for the repo (sorted by timestamp desc)
|
|
11
|
+
* 2. If no bundles exist → create full bundle (`git bundle create --all`)
|
|
12
|
+
* 3. If bundles exist → create incremental bundle since last tip commit
|
|
13
|
+
* 4. Every N pushes (configurable), create a squash bundle (full bundle
|
|
14
|
+
* with `squash: true`) which purges all older bundle records
|
|
15
|
+
*
|
|
16
|
+
* The bundle data (binary `application/x-git-bundle`) is stored as the
|
|
17
|
+
* record payload. Queryable metadata is stored in tags.
|
|
18
|
+
*
|
|
19
|
+
* @module
|
|
20
|
+
*/
|
|
21
|
+
import type { ForgeRepoProtocol } from '../repo.js';
|
|
22
|
+
import type { ForgeRepoSchemaMap } from '../repo.js';
|
|
23
|
+
import type { OnPushComplete } from './ref-sync.js';
|
|
24
|
+
import type { TypedWeb5 } from '@enbox/api';
|
|
25
|
+
/** Options for creating a bundle syncer. */
|
|
26
|
+
export type BundleSyncOptions = {
|
|
27
|
+
/** The typed ForgeRepoProtocol Web5 handle. */
|
|
28
|
+
repo: TypedWeb5<typeof ForgeRepoProtocol.definition, ForgeRepoSchemaMap>;
|
|
29
|
+
/** The repo's contextId (from the ForgeRepoProtocol repo record). */
|
|
30
|
+
repoContextId: string;
|
|
31
|
+
/**
|
|
32
|
+
* Repo visibility — controls whether bundle records are encrypted.
|
|
33
|
+
*
|
|
34
|
+
* - `'private'` → bundles are JWE-encrypted (only key-holders can read)
|
|
35
|
+
* - `'public'` → bundles are plaintext (IPFS-friendly, globally readable)
|
|
36
|
+
*
|
|
37
|
+
* The protocol must be installed with `encryption: true` for private repos
|
|
38
|
+
* to work (this injects `$encryption` keys on all protocol paths).
|
|
39
|
+
*
|
|
40
|
+
* @default 'public'
|
|
41
|
+
*/
|
|
42
|
+
visibility?: 'public' | 'private';
|
|
43
|
+
/**
|
|
44
|
+
* Number of incremental bundles to accumulate before squashing.
|
|
45
|
+
* When this threshold is reached, the next bundle write is a squash
|
|
46
|
+
* that replaces all older bundles with a single full bundle.
|
|
47
|
+
*
|
|
48
|
+
* @default 5
|
|
49
|
+
*/
|
|
50
|
+
squashThreshold?: number;
|
|
51
|
+
};
|
|
52
|
+
/** Metadata about a generated git bundle. */
|
|
53
|
+
export type BundleInfo = {
|
|
54
|
+
/** Path to the bundle file on disk. */
|
|
55
|
+
path: string;
|
|
56
|
+
/** SHA of the tip commit (HEAD of default branch). */
|
|
57
|
+
tipCommit: string;
|
|
58
|
+
/** Whether this is a full bundle (all refs) or incremental. */
|
|
59
|
+
isFull: boolean;
|
|
60
|
+
/** Number of refs included in the bundle. */
|
|
61
|
+
refCount: number;
|
|
62
|
+
/** File size in bytes. */
|
|
63
|
+
size: number;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Create an `onPushComplete` callback that syncs a git bundle to a DWN record.
|
|
67
|
+
*
|
|
68
|
+
* @param options - Bundle sync configuration
|
|
69
|
+
* @returns An async callback to invoke after a successful push
|
|
70
|
+
*/
|
|
71
|
+
export declare function createBundleSyncer(options: BundleSyncOptions): OnPushComplete;
|
|
72
|
+
/**
|
|
73
|
+
* Create a full git bundle containing all refs and all reachable objects.
|
|
74
|
+
*
|
|
75
|
+
* @param repoPath - Path to the bare git repository
|
|
76
|
+
* @returns Bundle metadata and file path
|
|
77
|
+
*/
|
|
78
|
+
export declare function createFullBundle(repoPath: string): Promise<BundleInfo>;
|
|
79
|
+
/**
|
|
80
|
+
* Create an incremental git bundle containing only objects since a base commit.
|
|
81
|
+
*
|
|
82
|
+
* The bundle uses the base commit as a prerequisite, meaning the consumer
|
|
83
|
+
* must already have it to apply the incremental bundle.
|
|
84
|
+
*
|
|
85
|
+
* @param repoPath - Path to the bare git repository
|
|
86
|
+
* @param baseCommit - The commit SHA to use as the prerequisite (exclude point)
|
|
87
|
+
* @returns Bundle metadata and file path
|
|
88
|
+
*/
|
|
89
|
+
export declare function createIncrementalBundle(repoPath: string, baseCommit: string): Promise<BundleInfo>;
|
|
90
|
+
//# sourceMappingURL=bundle-sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle-sync.d.ts","sourceRoot":"","sources":["../../../src/git-server/bundle-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAY5C,4CAA4C;AAC5C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,+CAA+C;IAC/C,IAAI,EAAE,SAAS,CAAC,OAAO,iBAAiB,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC;IAEzE,qEAAqE;IACrE,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;;;;;;;OAUG;IACH,UAAU,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAElC;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,6CAA6C;AAC7C,MAAM,MAAM,UAAU,GAAG;IACvB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAC;IAClB,+DAA+D;IAC/D,MAAM,EAAE,OAAO,CAAC;IAChB,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAMF;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,GAAG,cAAc,CA2E7E;AAMD;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAgB5E;AAED;;;;;;;;;GASG;AACH,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,UAAU,CAAC,CAiBrB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DID document service management for git transport.
|
|
3
|
+
*
|
|
4
|
+
* Adds or updates a `GitTransport` service entry in a DID document,
|
|
5
|
+
* advertising the git smart HTTP endpoint for the `git-remote-did` helper.
|
|
6
|
+
*
|
|
7
|
+
* This module works with the agent's DID API to persist and publish
|
|
8
|
+
* service updates. For `did:dht`, the updated document is republished
|
|
9
|
+
* to the DHT network.
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
import type { Web5 } from '@enbox/api';
|
|
14
|
+
/**
|
|
15
|
+
* Register a GitTransport service endpoint in the agent's DID document.
|
|
16
|
+
*
|
|
17
|
+
* If a GitTransport service already exists, its endpoint is updated.
|
|
18
|
+
* Otherwise, a new service entry is created. The updated DID document
|
|
19
|
+
* is persisted in the agent store and (for did:dht) republished.
|
|
20
|
+
*
|
|
21
|
+
* @param web5 - The Web5 instance (provides agent DID and did API)
|
|
22
|
+
* @param endpoint - The git transport HTTPS URL (e.g. `https://git.example.com`)
|
|
23
|
+
* @throws If the agent does not support DID updates
|
|
24
|
+
*/
|
|
25
|
+
export declare function registerGitService(web5: Web5, endpoint: string): Promise<void>;
|
|
26
|
+
//# sourceMappingURL=did-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"did-service.d.ts","sourceRoot":"","sources":["../../../src/git-server/did-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAevC;;;;;;;;;;GAUG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAqCpF"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git backend — wraps Git CLI commands for bare repository management.
|
|
3
|
+
*
|
|
4
|
+
* Provides a thin abstraction over `git init --bare`, `git upload-pack`, and
|
|
5
|
+
* `git receive-pack` for use by the smart HTTP transport handler.
|
|
6
|
+
*
|
|
7
|
+
* All repositories are stored as bare repos under a configurable base
|
|
8
|
+
* directory, organized by DID: `<basePath>/<did-hash>/<repo-name>.git`
|
|
9
|
+
*
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
/** Options for creating a GitBackend instance. */
|
|
13
|
+
export type GitBackendOptions = {
|
|
14
|
+
/**
|
|
15
|
+
* Base directory for storing bare repositories.
|
|
16
|
+
* Repos are stored as `<basePath>/<did-hash>/<repo>.git`
|
|
17
|
+
*/
|
|
18
|
+
basePath: string;
|
|
19
|
+
};
|
|
20
|
+
/** Readable stream from a git subprocess. */
|
|
21
|
+
export type GitProcess = {
|
|
22
|
+
/** The subprocess stdout (pack data). */
|
|
23
|
+
stdout: ReadableStream<Uint8Array>;
|
|
24
|
+
/** The subprocess stdin for writing request data. */
|
|
25
|
+
stdin: WritableStream<Uint8Array>;
|
|
26
|
+
/** Promise that resolves with the exit code when the process completes. */
|
|
27
|
+
exitCode: Promise<number>;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Manages bare git repositories on the filesystem and spawns git subprocess
|
|
31
|
+
* for smart HTTP transport.
|
|
32
|
+
*/
|
|
33
|
+
export declare class GitBackend {
|
|
34
|
+
private readonly _basePath;
|
|
35
|
+
constructor(options: GitBackendOptions);
|
|
36
|
+
/** Get the base path for all repositories. */
|
|
37
|
+
get basePath(): string;
|
|
38
|
+
/**
|
|
39
|
+
* Compute the filesystem path for a repository.
|
|
40
|
+
*
|
|
41
|
+
* @param did - The DID of the repository owner
|
|
42
|
+
* @param repo - The repository name
|
|
43
|
+
* @returns Absolute path to the bare repo directory
|
|
44
|
+
* @throws If the repo name contains path traversal characters
|
|
45
|
+
*/
|
|
46
|
+
repoPath(did: string, repo: string): string;
|
|
47
|
+
/**
|
|
48
|
+
* Check whether a repository exists on disk.
|
|
49
|
+
*
|
|
50
|
+
* @param did - The DID of the repository owner
|
|
51
|
+
* @param repo - The repository name
|
|
52
|
+
*/
|
|
53
|
+
exists(did: string, repo: string): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Initialize a new bare repository.
|
|
56
|
+
*
|
|
57
|
+
* @param did - The DID of the repository owner
|
|
58
|
+
* @param repo - The repository name
|
|
59
|
+
* @returns The path to the new bare repository
|
|
60
|
+
* @throws If `git init --bare` fails
|
|
61
|
+
*/
|
|
62
|
+
initRepo(did: string, repo: string): Promise<string>;
|
|
63
|
+
/**
|
|
64
|
+
* Spawn `git upload-pack` for fetch/clone operations.
|
|
65
|
+
*
|
|
66
|
+
* @param did - The DID of the repository owner
|
|
67
|
+
* @param repo - The repository name
|
|
68
|
+
* @returns A GitProcess with stdin/stdout streams for the subprocess
|
|
69
|
+
* @throws If the repository does not exist
|
|
70
|
+
*/
|
|
71
|
+
uploadPack(did: string, repo: string): GitProcess;
|
|
72
|
+
/**
|
|
73
|
+
* Spawn `git receive-pack` for push operations.
|
|
74
|
+
*
|
|
75
|
+
* @param did - The DID of the repository owner
|
|
76
|
+
* @param repo - The repository name
|
|
77
|
+
* @returns A GitProcess with stdin/stdout streams for the subprocess
|
|
78
|
+
* @throws If the repository does not exist
|
|
79
|
+
*/
|
|
80
|
+
receivePack(did: string, repo: string): GitProcess;
|
|
81
|
+
/** Throw if the repo doesn't exist on disk. */
|
|
82
|
+
private _assertRepoExists;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=git-backend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-backend.d.ts","sourceRoot":"","sources":["../../../src/git-server/git-backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAYH,kDAAkD;AAClD,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,6CAA6C;AAC7C,MAAM,MAAM,UAAU,GAAG;IACvB,yCAAyC;IACzC,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IAEnC,qDAAqD;IACrD,KAAK,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IAElC,2EAA2E;IAC3E,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3B,CAAC;AAMF;;;GAGG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEhB,OAAO,EAAE,iBAAiB;IAI7C,8CAA8C;IAC9C,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED;;;;;;;OAOG;IACI,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAYlD;;;;;OAKG;IACI,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO;IAKjD;;;;;;;OAOG;IACU,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAYjE;;;;;;;OAOG;IACI,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU;IAMxD;;;;;;;OAOG;IACI,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU;IAMzD,+CAA+C;IAC/C,OAAO,CAAC,iBAAiB;CAK1B"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git smart HTTP transport handler.
|
|
3
|
+
*
|
|
4
|
+
* Implements the server side of Git's smart HTTP protocol (v1):
|
|
5
|
+
* - `GET /<did>/<repo>/info/refs?service=git-upload-pack` — ref discovery (clone/fetch)
|
|
6
|
+
* - `POST /<did>/<repo>/git-upload-pack` — pack negotiation (clone/fetch)
|
|
7
|
+
* - `GET /<did>/<repo>/info/refs?service=git-receive-pack` — ref discovery (push)
|
|
8
|
+
* - `POST /<did>/<repo>/git-receive-pack` — receive pack (push)
|
|
9
|
+
*
|
|
10
|
+
* When `onRepoNotFound` is provided, the handler auto-restores repos from
|
|
11
|
+
* DWN bundle records on first access (cold-start). This enables commodity
|
|
12
|
+
* git hosts to serve repos they've never seen before.
|
|
13
|
+
*
|
|
14
|
+
* The handler is a pure function `(Request) => Response | Promise<Response>`
|
|
15
|
+
* suitable for use with `Bun.serve()`, `Deno.serve()`, or any fetch-compatible
|
|
16
|
+
* HTTP runtime.
|
|
17
|
+
*
|
|
18
|
+
* URL format: `/<did>/<repo>/...`
|
|
19
|
+
* The DID is URL-encoded in the path (colons are preserved since they're
|
|
20
|
+
* valid in path segments).
|
|
21
|
+
*
|
|
22
|
+
* @module
|
|
23
|
+
*/
|
|
24
|
+
import type { GitBackend } from './git-backend.js';
|
|
25
|
+
/** Options for creating the git HTTP handler. */
|
|
26
|
+
export type GitHttpHandlerOptions = {
|
|
27
|
+
/** The git backend for repository operations. */
|
|
28
|
+
backend: GitBackend;
|
|
29
|
+
/**
|
|
30
|
+
* Optional authentication callback for push operations.
|
|
31
|
+
* Called before `git-receive-pack` is allowed to proceed.
|
|
32
|
+
* Should return `true` if the request is authorized.
|
|
33
|
+
*
|
|
34
|
+
* @param request - The incoming HTTP request
|
|
35
|
+
* @param did - The repository owner's DID
|
|
36
|
+
* @param repo - The repository name
|
|
37
|
+
*/
|
|
38
|
+
authenticatePush?: (request: Request, did: string, repo: string) => Promise<boolean>;
|
|
39
|
+
/**
|
|
40
|
+
* Optional callback invoked after a successful `git receive-pack` (push).
|
|
41
|
+
* Use this for post-push operations like syncing refs to DWN records.
|
|
42
|
+
*
|
|
43
|
+
* @param did - The repository owner's DID
|
|
44
|
+
* @param repo - The repository name
|
|
45
|
+
* @param repoPath - Filesystem path to the bare repository
|
|
46
|
+
*/
|
|
47
|
+
onPushComplete?: (did: string, repo: string, repoPath: string) => Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Optional callback invoked when a clone/fetch request arrives for a
|
|
50
|
+
* repository that doesn't exist on disk. Implementations can restore
|
|
51
|
+
* the repo from DWN bundle records.
|
|
52
|
+
*
|
|
53
|
+
* @param did - The repository owner's DID
|
|
54
|
+
* @param repo - The repository name
|
|
55
|
+
* @param repoPath - The filesystem path where the repo should be created
|
|
56
|
+
* @returns `true` if the repo was restored successfully
|
|
57
|
+
*/
|
|
58
|
+
onRepoNotFound?: (did: string, repo: string, repoPath: string) => Promise<boolean>;
|
|
59
|
+
/**
|
|
60
|
+
* Optional path prefix to strip from incoming URLs.
|
|
61
|
+
* For example, if the sidecar is mounted at `/git`, set this to `/git`.
|
|
62
|
+
* @default ''
|
|
63
|
+
*/
|
|
64
|
+
pathPrefix?: string;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Create a fetch-compatible HTTP handler for Git smart HTTP transport.
|
|
68
|
+
*
|
|
69
|
+
* @param options - Handler configuration
|
|
70
|
+
* @returns A function that handles incoming HTTP requests
|
|
71
|
+
*/
|
|
72
|
+
export declare function createGitHttpHandler(options: GitHttpHandlerOptions): (request: Request) => Response | Promise<Response>;
|
|
73
|
+
//# sourceMappingURL=http-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-handler.d.ts","sourceRoot":"","sources":["../../../src/git-server/http-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAMnD,iDAAiD;AACjD,MAAM,MAAM,qBAAqB,GAAG;IAClC,iDAAiD;IACjD,OAAO,EAAE,UAAU,CAAC;IAEpB;;;;;;;;OAQG;IACH,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAErF;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhF;;;;;;;;;OASG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAEnF;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAcF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,qBAAqB,GAC7B,CAAC,OAAO,EAAE,OAAO,KAAK,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAgHpD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git transport server — smart HTTP git backend with DID-based push auth.
|
|
3
|
+
*
|
|
4
|
+
* @module git-server
|
|
5
|
+
*/
|
|
6
|
+
export * from './auth.js';
|
|
7
|
+
export * from './bundle-restore.js';
|
|
8
|
+
export * from './bundle-sync.js';
|
|
9
|
+
export * from './did-service.js';
|
|
10
|
+
export * from './git-backend.js';
|
|
11
|
+
export * from './http-handler.js';
|
|
12
|
+
export * from './push-authorizer.js';
|
|
13
|
+
export * from './ref-sync.js';
|
|
14
|
+
export * from './server.js';
|
|
15
|
+
export * from './verify.js';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/git-server/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DWN-based push authorization — checks collaborator roles in the DWN.
|
|
3
|
+
*
|
|
4
|
+
* When a DID attempts to push to a repository, this module queries the
|
|
5
|
+
* DWN for `repo/maintainer` and `repo/contributor` role records to
|
|
6
|
+
* determine if the pusher is authorized.
|
|
7
|
+
*
|
|
8
|
+
* Authorization rules:
|
|
9
|
+
* - The repo owner (DID that owns the DWN) can always push
|
|
10
|
+
* - DIDs with a `maintainer` role record can push
|
|
11
|
+
* - DIDs with a `contributor` role record can push
|
|
12
|
+
* - All other DIDs are rejected
|
|
13
|
+
*
|
|
14
|
+
* @module
|
|
15
|
+
*/
|
|
16
|
+
import type { TypedWeb5 } from '@enbox/api';
|
|
17
|
+
import type { ForgeRepoProtocol } from '../repo.js';
|
|
18
|
+
import type { ForgeRepoSchemaMap } from '../repo.js';
|
|
19
|
+
import type { PushAuthorizer } from './auth.js';
|
|
20
|
+
/** Options for creating a DWN-based push authorizer. */
|
|
21
|
+
export type DwnPushAuthorizerOptions = {
|
|
22
|
+
/** The typed ForgeRepoProtocol Web5 handle. */
|
|
23
|
+
repo: TypedWeb5<typeof ForgeRepoProtocol.definition, ForgeRepoSchemaMap>;
|
|
24
|
+
/** The DID of the DWN owner (server operator). */
|
|
25
|
+
ownerDid: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Create a `PushAuthorizer` that checks DWN collaborator role records.
|
|
29
|
+
*
|
|
30
|
+
* The authorizer queries the ForgeRepoProtocol for `maintainer` and
|
|
31
|
+
* `contributor` role records matching the pusher's DID. The repo owner
|
|
32
|
+
* is always authorized.
|
|
33
|
+
*
|
|
34
|
+
* @param options - Authorizer configuration
|
|
35
|
+
* @returns A PushAuthorizer callback
|
|
36
|
+
*/
|
|
37
|
+
export declare function createDwnPushAuthorizer(options: DwnPushAuthorizerOptions): PushAuthorizer;
|
|
38
|
+
//# sourceMappingURL=push-authorizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push-authorizer.d.ts","sourceRoot":"","sources":["../../../src/git-server/push-authorizer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAMhD,wDAAwD;AACxD,MAAM,MAAM,wBAAwB,GAAG;IACrC,+CAA+C;IAC/C,IAAI,EAAE,SAAS,CAAC,OAAO,iBAAiB,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC;IACzE,kDAAkD;IAClD,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAMF;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,wBAAwB,GAAG,cAAc,CA2BzF"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git ref → DWN sync — mirrors git branch/tag refs as ForgeRefs records.
|
|
3
|
+
*
|
|
4
|
+
* After a successful `git push`, this module reads the current refs from
|
|
5
|
+
* the bare repository and creates or updates corresponding DWN records
|
|
6
|
+
* using the ForgeRefsProtocol.
|
|
7
|
+
*
|
|
8
|
+
* Ref sync flow:
|
|
9
|
+
* 1. Run `git for-each-ref` on the bare repo to enumerate current refs
|
|
10
|
+
* 2. Query existing DWN ref records for the repo
|
|
11
|
+
* 3. Create new records for refs that don't exist in DWN
|
|
12
|
+
* 4. Update existing records whose target (SHA) has changed
|
|
13
|
+
* 5. Delete DWN records for refs that no longer exist in git
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
import type { TypedWeb5 } from '@enbox/api';
|
|
18
|
+
import type { ForgeRefsProtocol } from '../refs.js';
|
|
19
|
+
import type { ForgeRefsSchemaMap } from '../refs.js';
|
|
20
|
+
/** A git ref as read from `git for-each-ref`. */
|
|
21
|
+
export type GitRef = {
|
|
22
|
+
/** Full ref name, e.g. `refs/heads/main` or `refs/tags/v1.0.0`. */
|
|
23
|
+
name: string;
|
|
24
|
+
/** The commit SHA this ref points to. */
|
|
25
|
+
target: string;
|
|
26
|
+
/** Ref type discriminator. */
|
|
27
|
+
type: 'branch' | 'tag';
|
|
28
|
+
};
|
|
29
|
+
/** Options for syncing refs. */
|
|
30
|
+
export type RefSyncOptions = {
|
|
31
|
+
/** The typed ForgeRefsProtocol Web5 handle. */
|
|
32
|
+
refs: TypedWeb5<typeof ForgeRefsProtocol.definition, ForgeRefsSchemaMap>;
|
|
33
|
+
/** The repo's contextId (from the ForgeRepoProtocol repo record). */
|
|
34
|
+
repoContextId: string;
|
|
35
|
+
};
|
|
36
|
+
/** Callback for post-push ref synchronization. */
|
|
37
|
+
export type OnPushComplete = (did: string, repo: string, repoPath: string) => Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Create an `onPushComplete` callback that syncs git refs to DWN records.
|
|
40
|
+
*
|
|
41
|
+
* @param options - Ref sync configuration
|
|
42
|
+
* @returns An async callback to invoke after a successful push
|
|
43
|
+
*/
|
|
44
|
+
export declare function createRefSyncer(options: RefSyncOptions): OnPushComplete;
|
|
45
|
+
/**
|
|
46
|
+
* Read all refs from a bare git repository using `git for-each-ref`.
|
|
47
|
+
*
|
|
48
|
+
* @param repoPath - Path to the bare git repository
|
|
49
|
+
* @returns Array of GitRef objects
|
|
50
|
+
*/
|
|
51
|
+
export declare function readGitRefs(repoPath: string): Promise<GitRef[]>;
|
|
52
|
+
//# sourceMappingURL=ref-sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ref-sync.d.ts","sourceRoot":"","sources":["../../../src/git-server/ref-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAI5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAMrD,iDAAiD;AACjD,MAAM,MAAM,MAAM,GAAG;IACnB,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,IAAI,EAAE,QAAQ,GAAG,KAAK,CAAC;CACxB,CAAC;AAEF,gCAAgC;AAChC,MAAM,MAAM,cAAc,GAAG;IAC3B,+CAA+C;IAC/C,IAAI,EAAE,SAAS,CAAC,OAAO,iBAAiB,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC;IACzE,qEAAqE;IACrE,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,kDAAkD;AAClD,MAAM,MAAM,cAAc,GAAG,CAC3B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,KACb,OAAO,CAAC,IAAI,CAAC,CAAC;AAMnB;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,cAAc,GAAG,cAAc,CAiDvE;AAMD;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAmBrE"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git transport sidecar server.
|
|
3
|
+
*
|
|
4
|
+
* A standalone HTTP server that serves Git smart HTTP transport alongside
|
|
5
|
+
* a DWN. Uses Node.js `http` module for maximum compatibility.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { createGitServer } from '@enbox/gitd/git-server/server';
|
|
10
|
+
*
|
|
11
|
+
* const server = createGitServer({
|
|
12
|
+
* basePath : '/var/lib/gitd/repos',
|
|
13
|
+
* port : 9418,
|
|
14
|
+
* });
|
|
15
|
+
*
|
|
16
|
+
* console.log(`Git server listening on port ${server.port}`);
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @module
|
|
20
|
+
*/
|
|
21
|
+
import { GitBackend } from './git-backend.js';
|
|
22
|
+
/** Configuration for the git transport sidecar server. */
|
|
23
|
+
export type GitServerOptions = {
|
|
24
|
+
/** Base directory for storing bare repositories. */
|
|
25
|
+
basePath: string;
|
|
26
|
+
/** TCP port to listen on. Use 0 for a random available port. @default 9418 */
|
|
27
|
+
port?: number;
|
|
28
|
+
/** Hostname to bind to. @default '0.0.0.0' */
|
|
29
|
+
hostname?: string;
|
|
30
|
+
/** Optional path prefix for the HTTP handler (e.g. `/git`). */
|
|
31
|
+
pathPrefix?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Optional authentication callback for push operations.
|
|
34
|
+
* @see GitHttpHandlerOptions.authenticatePush
|
|
35
|
+
*/
|
|
36
|
+
authenticatePush?: (request: Request, did: string, repo: string) => Promise<boolean>;
|
|
37
|
+
/**
|
|
38
|
+
* Optional callback invoked after a successful push.
|
|
39
|
+
* @see GitHttpHandlerOptions.onPushComplete
|
|
40
|
+
*/
|
|
41
|
+
onPushComplete?: (did: string, repo: string, repoPath: string) => Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Optional callback invoked when a repo is not found on disk.
|
|
44
|
+
* Implementations can restore the repo from DWN bundle records.
|
|
45
|
+
* @see GitHttpHandlerOptions.onRepoNotFound
|
|
46
|
+
*/
|
|
47
|
+
onRepoNotFound?: (did: string, repo: string, repoPath: string) => Promise<boolean>;
|
|
48
|
+
/**
|
|
49
|
+
* Maximum request body size in bytes for POST requests (git pack data).
|
|
50
|
+
* @default 50 * 1024 * 1024 (50 MB)
|
|
51
|
+
*/
|
|
52
|
+
maxBodySize?: number;
|
|
53
|
+
};
|
|
54
|
+
/** A running git server instance. */
|
|
55
|
+
export type GitServer = {
|
|
56
|
+
/** The TCP port the server is listening on. */
|
|
57
|
+
port: number;
|
|
58
|
+
/** The git backend managing repositories. */
|
|
59
|
+
backend: GitBackend;
|
|
60
|
+
/** Stop the server. Returns a promise that resolves when fully closed. */
|
|
61
|
+
stop(): Promise<void>;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Create and start a git transport sidecar server.
|
|
65
|
+
*
|
|
66
|
+
* @param options - Server configuration
|
|
67
|
+
* @returns A promise resolving to a running GitServer instance
|
|
68
|
+
*/
|
|
69
|
+
export declare function createGitServer(options: GitServerOptions): Promise<GitServer>;
|
|
70
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/git-server/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAOH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAS9C,0DAA0D;AAC1D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAC;IAEjB,8EAA8E;IAC9E,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAErF;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhF;;;;OAIG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAEnF;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,qCAAqC;AACrC,MAAM,MAAM,SAAS,GAAG;IACtB,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IAEb,6CAA6C;IAC7C,OAAO,EAAE,UAAU,CAAC;IAEpB,0EAA0E;IAC1E,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB,CAAC;AAMF;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC,CAwGnF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DID-based signature verification for push authentication.
|
|
3
|
+
*
|
|
4
|
+
* Resolves a DID document, extracts the Ed25519 authentication key,
|
|
5
|
+
* and verifies the signature. This is the production implementation
|
|
6
|
+
* of the `SignatureVerifier` callback used by `createPushAuthenticator`.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import type { SignatureVerifier } from './auth.js';
|
|
11
|
+
export declare function createDidSignatureVerifier(): SignatureVerifier;
|
|
12
|
+
//# sourceMappingURL=verify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/git-server/verify.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAuCnD,wBAAgB,0BAA0B,IAAI,iBAAiB,CA6B9D"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared helpers for the GitHub API compatibility shim.
|
|
3
|
+
*
|
|
4
|
+
* Provides DID-to-numeric-ID hashing, `from` option building, repo
|
|
5
|
+
* record lookup, GitHub-style owner objects, pagination, and standard
|
|
6
|
+
* response headers.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import type { AgentContext } from '../cli/agent.js';
|
|
11
|
+
/** GitHub-style owner sub-object synthesized from a DID. */
|
|
12
|
+
export type GitHubOwner = {
|
|
13
|
+
login: string;
|
|
14
|
+
id: number;
|
|
15
|
+
type: string;
|
|
16
|
+
avatar_url: string;
|
|
17
|
+
html_url: string;
|
|
18
|
+
url: string;
|
|
19
|
+
};
|
|
20
|
+
/** Repo metadata extracted from a DWN repo record. */
|
|
21
|
+
export type RepoInfo = {
|
|
22
|
+
name: string;
|
|
23
|
+
description: string;
|
|
24
|
+
defaultBranch: string;
|
|
25
|
+
contextId: string;
|
|
26
|
+
visibility: string;
|
|
27
|
+
dateCreated: string;
|
|
28
|
+
timestamp: string;
|
|
29
|
+
};
|
|
30
|
+
/** Pagination parameters parsed from query string. */
|
|
31
|
+
export type PaginationParams = {
|
|
32
|
+
page: number;
|
|
33
|
+
perPage: number;
|
|
34
|
+
};
|
|
35
|
+
/** Standard JSON API response shape. */
|
|
36
|
+
export type JsonResponse = {
|
|
37
|
+
status: number;
|
|
38
|
+
headers: Record<string, string>;
|
|
39
|
+
body: string;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Deterministic numeric ID from a DWN string identifier.
|
|
43
|
+
*
|
|
44
|
+
* Uses a simple FNV-1a-inspired hash to produce a positive 32-bit
|
|
45
|
+
* integer — sufficient for GitHub API compatibility where consumers
|
|
46
|
+
* expect numeric IDs.
|
|
47
|
+
*/
|
|
48
|
+
export declare function numericId(id: string): number;
|
|
49
|
+
/**
|
|
50
|
+
* Build the `from` option for a DWN query. When the target is the
|
|
51
|
+
* local agent's own DID we omit `from`; otherwise set it so the SDK
|
|
52
|
+
* routes the message to the remote DWN.
|
|
53
|
+
*/
|
|
54
|
+
export declare function fromOpt(ctx: AgentContext, targetDid: string): string | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Look up the singleton repo record for a target DID. Returns `null`
|
|
57
|
+
* if no repo record exists.
|
|
58
|
+
*/
|
|
59
|
+
export declare function getRepoRecord(ctx: AgentContext, targetDid: string): Promise<RepoInfo | null>;
|
|
60
|
+
/**
|
|
61
|
+
* Build a GitHub-style owner sub-object from a DID. The DID itself is
|
|
62
|
+
* used as the `login` field since DIDs are globally unique identifiers
|
|
63
|
+
* (just like GitHub usernames).
|
|
64
|
+
*/
|
|
65
|
+
export declare function buildOwner(did: string, baseUrl: string): GitHubOwner;
|
|
66
|
+
/**
|
|
67
|
+
* Build the base API URL from request context. Defaults to
|
|
68
|
+
* `http://localhost:<port>` for local development.
|
|
69
|
+
*/
|
|
70
|
+
export declare function buildApiUrl(url: URL): string;
|
|
71
|
+
/** Parse `page` and `per_page` from the URL query string. */
|
|
72
|
+
export declare function parsePagination(url: URL): PaginationParams;
|
|
73
|
+
/** Apply pagination to an array and return the slice. */
|
|
74
|
+
export declare function paginate<T>(items: T[], params: PaginationParams): T[];
|
|
75
|
+
/** Build Link header value for pagination. */
|
|
76
|
+
export declare function buildLinkHeader(baseUrl: string, path: string, page: number, perPage: number, totalItems: number): string | null;
|
|
77
|
+
/** Standard headers for all GitHub API shim responses. */
|
|
78
|
+
export declare function baseHeaders(): Record<string, string>;
|
|
79
|
+
/** Build a successful JSON response. */
|
|
80
|
+
export declare function jsonOk(data: unknown, extraHeaders?: Record<string, string>): JsonResponse;
|
|
81
|
+
/** Build a 404 JSON response. */
|
|
82
|
+
export declare function jsonNotFound(message: string): JsonResponse;
|
|
83
|
+
/** Build a 201 Created JSON response. */
|
|
84
|
+
export declare function jsonCreated(data: unknown, extraHeaders?: Record<string, string>): JsonResponse;
|
|
85
|
+
/** Build a 422 JSON response (validation error). */
|
|
86
|
+
export declare function jsonValidationError(message: string): JsonResponse;
|
|
87
|
+
/** Build a 405 Method Not Allowed JSON response. */
|
|
88
|
+
export declare function jsonMethodNotAllowed(message: string): JsonResponse;
|
|
89
|
+
/**
|
|
90
|
+
* Get the next sequential issue number.
|
|
91
|
+
* Returns `max(existing numbers) + 1`, or 1 if no issues exist.
|
|
92
|
+
*/
|
|
93
|
+
export declare function getNextIssueNumber(ctx: AgentContext, repoContextId: string): Promise<number>;
|
|
94
|
+
/**
|
|
95
|
+
* Get the next sequential patch number.
|
|
96
|
+
*/
|
|
97
|
+
export declare function getNextPatchNumber(ctx: AgentContext, repoContextId: string): Promise<number>;
|
|
98
|
+
/** Convert an ISO date string to GitHub's ISO 8601 format. */
|
|
99
|
+
export declare function toISODate(dateStr: string | undefined): string;
|
|
100
|
+
/** Build a 401 Unauthorized JSON response. */
|
|
101
|
+
export declare function jsonUnauthorized(message: string): JsonResponse;
|
|
102
|
+
/**
|
|
103
|
+
* Validate a Bearer token from the Authorization header.
|
|
104
|
+
* Returns `true` if the token matches `GITD_API_TOKEN`, or if
|
|
105
|
+
* no token is configured (open access).
|
|
106
|
+
*/
|
|
107
|
+
export declare function validateBearerToken(authHeader: string | null): boolean;
|
|
108
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/github-shim/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAMpD,4DAA4D;AAC5D,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAG,MAAM,CAAC;IACf,EAAE,EAAG,MAAM,CAAC;IACZ,IAAI,EAAG,MAAM,CAAC;IACd,UAAU,EAAG,MAAM,CAAC;IACpB,QAAQ,EAAG,MAAM,CAAC;IAClB,GAAG,EAAG,MAAM,CAAC;CACd,CAAC;AAEF,sDAAsD;AACtD,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAG,MAAM,CAAC;IACd,WAAW,EAAG,MAAM,CAAC;IACrB,aAAa,EAAG,MAAM,CAAC;IACvB,SAAS,EAAG,MAAM,CAAC;IACnB,UAAU,EAAG,MAAM,CAAC;IACpB,WAAW,EAAG,MAAM,CAAC;IACrB,SAAS,EAAG,MAAM,CAAC;CACpB,CAAC;AAEF,sDAAsD;AACtD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAG,MAAM,CAAC;IACd,OAAO,EAAG,MAAM,CAAC;CAClB,CAAC;AAEF,wCAAwC;AACxC,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAG,MAAM,CAAC;IAChB,OAAO,EAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,IAAI,EAAG,MAAM,CAAC;CACf,CAAC;AAMF;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAO5C;AAMD;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEhF;AAED;;;GAGG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAkBlG;AAMD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,WAAW,CASpE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAE5C;AAMD,6DAA6D;AAC7D,wBAAgB,eAAe,CAAC,GAAG,EAAE,GAAG,GAAG,gBAAgB,CAI1D;AAED,yDAAyD;AACzD,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,gBAAgB,GAAG,CAAC,EAAE,CAGrE;AAED,8CAA8C;AAC9C,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAe/H;AAMD,0DAA0D;AAC1D,wBAAgB,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUpD;AAED,wCAAwC;AACxC,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,YAAY,CAMzF;AAED,iCAAiC;AACjC,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAM1D;AAED,yCAAyC;AACzC,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,YAAY,CAM9F;AAED,oDAAoD;AACpD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAMjE;AAED,oDAAoD;AACpD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAMlE;AAMD;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAalG;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAalG;AAED,8DAA8D;AAC9D,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAI7D;AAMD,8CAA8C;AAC9C,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAM9D;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAYtE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub API compatibility shim — barrel exports.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
export { handleShimRequest, startShimServer } from './server.js';
|
|
7
|
+
export type { ShimServerOptions } from './server.js';
|
|
8
|
+
export { handleGetRepo, buildRepoResponse } from './repos.js';
|
|
9
|
+
export { handleCreateIssue, handleCreateIssueComment, handleGetIssue, handleListIssueComments, handleListIssues, handleUpdateIssue } from './issues.js';
|
|
10
|
+
export { handleCreatePull, handleCreatePullReview, handleGetPull, handleListPullReviews, handleListPulls, handleMergePull, handleUpdatePull } from './pulls.js';
|
|
11
|
+
export { handleCreateRelease, handleGetReleaseByTag, handleListReleases } from './releases.js';
|
|
12
|
+
export { handleGetUser } from './users.js';
|
|
13
|
+
export { buildApiUrl, buildLinkHeader, buildOwner, fromOpt, getNextIssueNumber, getNextPatchNumber, getRepoRecord, numericId, paginate, parsePagination, toISODate, } from './helpers.js';
|
|
14
|
+
export type { GitHubOwner, JsonResponse, PaginationParams, RepoInfo, } from './helpers.js';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/github-shim/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACjE,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,cAAc,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACxJ,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,aAAa,EAAE,qBAAqB,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAChK,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EACL,WAAW,EACX,eAAe,EACf,UAAU,EACV,OAAO,EACP,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,SAAS,EACT,QAAQ,EACR,eAAe,EACf,SAAS,GACV,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,QAAQ,GACT,MAAM,cAAc,CAAC"}
|