@ref0/git 0.6.0 → 0.7.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/dist/access/namespace.d.mts +2 -0
- package/dist/access/private-refs.d.mts +6 -29
- package/dist/access/private-refs.mjs +28 -13
- package/dist/access/public.d.mts +6 -0
- package/dist/access/public.mjs +9 -0
- package/dist/auth/access-jwt.d.mts +10 -6
- package/dist/auth/access-jwt.mjs +59 -40
- package/dist/auth/auth-namespace.d.mts +6 -0
- package/dist/auth/auth-namespace.mjs +12 -0
- package/dist/auth/auth.d.mts +3 -6
- package/dist/auth/auth.mjs +2 -9
- package/dist/auth/authorize.mjs +4 -5
- package/dist/auth/fences.d.mts +1 -1
- package/dist/auth/host-function.mjs +17 -8
- package/dist/auth/identify.mjs +2 -1
- package/dist/auth/namespaces.d.mts +2 -2
- package/dist/auth/token-rows.mjs +1 -1
- package/dist/auth/tokens-layer.d.mts +42 -0
- package/dist/auth/tokens-layer.mjs +29 -0
- package/dist/auth/tokens-namespace.d.mts +2 -0
- package/dist/auth/tokens-public.d.mts +6 -0
- package/dist/auth/tokens-public.mjs +29 -0
- package/dist/auth/tokens.d.mts +13 -6
- package/dist/auth/tokens.mjs +5 -5
- package/dist/auth.d.mts +2 -2
- package/dist/auth.mjs +2 -2
- package/dist/client/git-http.mjs +1 -1
- package/dist/client/local.mjs +4 -3
- package/dist/client/remote-helper.mjs +3 -8
- package/dist/client/remote.mjs +26 -7
- package/dist/client/run-remote-helper.d.mts +1 -1
- package/dist/client/run-remote-helper.mjs +2 -2
- package/dist/client/slice-push.d.mts +1 -1
- package/dist/contracts/access.d.mts +18 -10
- package/dist/contracts/access.mjs +17 -0
- package/dist/contracts/actors.d.mts +17 -1
- package/dist/contracts/actors.mjs +8 -1
- package/dist/contracts/authorize.d.mts +7 -4
- package/dist/contracts/blobs.d.mts +1 -1
- package/dist/contracts/blobs.mjs +1 -1
- package/dist/contracts/calls-spent.d.mts +6 -4
- package/dist/contracts/calls-spent.mjs +10 -8
- package/dist/contracts/commits.d.mts +2 -2
- package/dist/contracts/commits.mjs +1 -1
- package/dist/contracts/engine.d.mts +1 -1
- package/dist/contracts/events.d.mts +33 -22
- package/dist/contracts/events.mjs +13 -4
- package/dist/contracts/files.d.mts +2 -2
- package/dist/contracts/files.mjs +1 -1
- package/dist/contracts/forks.d.mts +58 -58
- package/dist/contracts/forks.mjs +1 -1
- package/dist/contracts/git-events.d.mts +50 -0
- package/dist/contracts/git-events.mjs +23 -0
- package/dist/contracts/git-hooks.d.mts +37 -0
- package/dist/contracts/git-hooks.mjs +10 -0
- package/dist/contracts/git.d.mts +93 -42
- package/dist/contracts/git.mjs +6 -5
- package/dist/contracts/ids.d.mts +16 -0
- package/dist/contracts/ids.mjs +19 -4
- package/dist/contracts/lfs.d.mts +2 -0
- package/dist/contracts/namespaces.d.mts +2 -2
- package/dist/contracts/objects.d.mts +1 -1
- package/dist/contracts/opaque.mjs +9 -0
- package/dist/contracts/operations.d.mts +293 -100
- package/dist/contracts/promises.d.mts +2 -0
- package/dist/contracts/push-uploads.d.mts +4 -1
- package/dist/contracts/push-uploads.mjs +9 -4
- package/dist/contracts/queue.d.mts +218 -47
- package/dist/contracts/queue.mjs +81 -6
- package/dist/contracts/refs.d.mts +30 -8
- package/dist/contracts/refs.mjs +1 -1
- package/dist/contracts/remote.d.mts +42 -21
- package/dist/contracts/remote.mjs +22 -0
- package/dist/contracts/repo-records.d.mts +2 -2
- package/dist/contracts/repos.d.mts +126 -79
- package/dist/contracts/repos.mjs +43 -5
- package/dist/contracts/result.d.mts +46 -31
- package/dist/contracts/result.mjs +43 -16
- package/dist/contracts/rules.d.mts +50 -44
- package/dist/contracts/rules.mjs +5 -1
- package/dist/contracts/server.d.mts +282 -198
- package/dist/contracts/services.d.mts +1 -7
- package/dist/contracts/services.mjs +1 -3
- package/dist/contracts/signin.d.mts +140 -43
- package/dist/contracts/signin.mjs +35 -1
- package/dist/contracts/store.d.mts +1 -1
- package/dist/contracts/sync.d.mts +112 -90
- package/dist/contracts/sync.mjs +34 -7
- package/dist/contracts/tags.d.mts +1 -1
- package/dist/contracts/tags.mjs +1 -1
- package/dist/contracts/tokens.d.mts +232 -57
- package/dist/contracts/tokens.mjs +80 -19
- package/dist/contracts/topics.d.mts +22 -10
- package/dist/contracts/topics.mjs +6 -3
- package/dist/contracts/trees.d.mts +2 -2
- package/dist/contracts/trees.mjs +1 -1
- package/dist/contracts/work.d.mts +2 -2
- package/dist/contracts/work.mjs +2 -2
- package/dist/core/access.d.mts +10 -10
- package/dist/core/access.mjs +31 -8
- package/dist/core/clock.mjs +1 -1
- package/dist/core/events/deliver.d.mts +3 -2
- package/dist/core/events/deliver.mjs +170 -92
- package/dist/core/forks.mjs +49 -24
- package/dist/core/hooks/groups.d.mts +27 -0
- package/dist/core/hooks/groups.mjs +74 -0
- package/dist/core/hooks/namespace.d.mts +2 -0
- package/dist/core/hooks/order.d.mts +2 -2
- package/dist/core/hooks/order.mjs +6 -6
- package/dist/core/hooks/public.d.mts +7 -0
- package/dist/core/hooks/public.mjs +5 -0
- package/dist/core/imports.mjs +94 -10
- package/dist/core/index-job.mjs +11 -8
- package/dist/core/merge-parts.d.mts +1 -1
- package/dist/core/merge-parts.mjs +1 -1
- package/dist/core/mirror-rows.mjs +18 -0
- package/dist/core/names.mjs +1 -1
- package/dist/core/namespaces.d.mts +2 -1
- package/dist/core/objects/commit-writes.mjs +5 -5
- package/dist/core/objects/merges.mjs +1 -1
- package/dist/core/objects/objects-layer.mjs +1 -1
- package/dist/core/objects/reading.mjs +52 -7
- package/dist/core/objects/tree-edits.mjs +13 -28
- package/dist/core/objects/trees.mjs +4 -4
- package/dist/core/objects/writing.mjs +3 -3
- package/dist/core/own-writes.mjs +1 -1
- package/dist/core/parts.d.mts +22 -3
- package/dist/core/parts.mjs +5 -3
- package/dist/core/promise.mjs +23 -3
- package/dist/core/purge.d.mts +2 -2
- package/dist/core/purge.mjs +80 -30
- package/dist/core/push.mjs +55 -74
- package/dist/core/receipts.d.mts +2 -2
- package/dist/core/receipts.mjs +28 -4
- package/dist/core/ref-index-job.mjs +4 -4
- package/dist/core/ref-view.mjs +2 -2
- package/dist/core/refs.mjs +41 -10
- package/dist/core/registered-records.mjs +30 -0
- package/dist/core/{claim-rows.mjs → registered-rows.mjs} +6 -6
- package/dist/core/repack.d.mts +2 -2
- package/dist/core/repack.mjs +11 -9
- package/dist/core/repo-info.mjs +59 -25
- package/dist/core/repos.mjs +17 -11
- package/dist/core/rules/changes.mjs +2 -2
- package/dist/core/rules/commit-changes.mjs +1 -1
- package/dist/core/rules/context.d.mts +4 -5
- package/dist/core/rules/context.mjs +3 -4
- package/dist/core/rules/fetch.mjs +74 -21
- package/dist/core/saved-caller-views.d.mts +72 -0
- package/dist/core/saved-caller-views.mjs +123 -0
- package/dist/core/saved-callers-public.d.mts +5 -0
- package/dist/core/saved-callers-public.mjs +10 -0
- package/dist/core/saved-callers.mjs +95 -0
- package/dist/core/seam.d.mts +12 -1
- package/dist/core/seam.mjs +4 -2
- package/dist/core/tokens.mjs +5 -1
- package/dist/core/view.d.mts +1 -1
- package/dist/core/view.mjs +1 -1
- package/dist/core/work.mjs +6 -5
- package/dist/effect.d.mts +2 -2
- package/dist/effect.mjs +2 -2
- package/dist/engine/content.d.mts +2 -2
- package/dist/engine/content.mjs +1 -1
- package/dist/engine/diff.mjs +2 -2
- package/dist/engine/merge-base-walk.d.mts +2 -2
- package/dist/engine/merge-base-walk.mjs +1 -1
- package/dist/engine/merge-renames.mjs +1 -1
- package/dist/engine/reads.d.mts +2 -2
- package/dist/engine/reads.mjs +1 -1
- package/dist/engine/xdiff.d.mts +1 -1
- package/dist/engine/xdiff.mjs +2 -2
- package/dist/event-streams/event-streams.d.mts +6 -2
- package/dist/event-streams/event-streams.mjs +6 -2
- package/dist/event-streams/stream.mjs +5 -2
- package/dist/extend.d.mts +3 -3
- package/dist/extend.mjs +3 -2
- package/dist/http/answers.mjs +4 -3
- package/dist/http/core-parts.mjs +2 -2
- package/dist/http/handler.mjs +1 -1
- package/dist/http/parts.d.mts +1 -0
- package/dist/http/push-uploads.mjs +7 -5
- package/dist/http/receive-pack.mjs +3 -3
- package/dist/http/upload-pack.mjs +6 -5
- package/dist/index.d.mts +33 -20
- package/dist/index.mjs +13 -7
- package/dist/lfs/base.d.mts +2 -2
- package/dist/lfs/calls.mjs +3 -2
- package/dist/lfs/layer.d.mts +5 -4
- package/dist/lfs/layer.mjs +17 -16
- package/dist/lfs/locks.mjs +3 -3
- package/dist/lfs/objects.d.mts +3 -2
- package/dist/lfs/objects.mjs +149 -34
- package/dist/lfs/pointers.mjs +1 -1
- package/dist/lfs/purge.mjs +1 -1
- package/dist/lfs/rows.mjs +1 -1
- package/dist/lfs/upkeep.mjs +13 -9
- package/dist/lfs/wire.mjs +1 -1
- package/dist/protocol/bytes/buffers.d.mts +1 -1
- package/dist/protocol/bytes/buffers.mjs +1 -1
- package/dist/protocol/bytes/deflate.d.mts +1 -1
- package/dist/protocol/bytes/deflate.mjs +1 -1
- package/dist/protocol/bytes/hmac-sha256.mjs +3 -6
- package/dist/protocol/bytes/inflate.d.mts +1 -1
- package/dist/protocol/bytes/inflate.mjs +1 -1
- package/dist/protocol/bytes/sha1.d.mts +1 -1
- package/dist/protocol/bytes/sha1.mjs +2 -2
- package/dist/protocol/diff/read.d.mts +1 -1
- package/dist/protocol/diff/read.mjs +1 -1
- package/dist/protocol/diff/tree-diff.d.mts +1 -1
- package/dist/protocol/diff/tree-diff.mjs +11 -11
- package/dist/protocol/objects/lfs-pointer.mjs +6 -1
- package/dist/protocol/objects/tag.mjs +1 -1
- package/dist/protocol/objects/tree.mjs +1 -1
- package/dist/protocol/packs/graph.mjs +1 -1
- package/dist/protocol/packs/idx.d.mts +1 -1
- package/dist/protocol/packs/idx.mjs +1 -1
- package/dist/protocol/packs/parts.mjs +1 -1
- package/dist/protocol/packs/reader.d.mts +1 -1
- package/dist/protocol/packs/reader.mjs +2 -2
- package/dist/protocol/packs/write-error.d.mts +1 -1
- package/dist/protocol/packs/write-error.mjs +1 -1
- package/dist/protocol/packs/writer.mjs +4 -4
- package/dist/protocol/wire/advertisement.d.mts +1 -1
- package/dist/protocol/wire/advertisement.mjs +1 -1
- package/dist/protocol/wire/fetch.d.mts +1 -1
- package/dist/protocol/wire/fetch.mjs +1 -1
- package/dist/protocol/wire/lines.d.mts +1 -1
- package/dist/protocol/wire/lines.mjs +2 -2
- package/dist/protocol/wire/push-uploads.mjs +4 -2
- package/dist/protocol/wire/receive-pack.d.mts +1 -1
- package/dist/protocol/wire/receive-pack.mjs +1 -1
- package/dist/protocol/wire/report-status.d.mts +1 -1
- package/dist/protocol/wire/report-status.mjs +1 -1
- package/dist/protocol/wire/v2.d.mts +2 -2
- package/dist/protocol/wire/v2.mjs +2 -2
- package/dist/queue/advance.mjs +155 -63
- package/dist/queue/callers.mjs +56 -69
- package/dist/queue/calls.mjs +20 -11
- package/dist/queue/commit.mjs +28 -22
- package/dist/queue/host.d.mts +10 -11
- package/dist/queue/host.mjs +15 -7
- package/dist/queue/lanes.mjs +9 -18
- package/dist/queue/layer.d.mts +3 -3
- package/dist/queue/layer.mjs +11 -10
- package/dist/queue/limits.mjs +17 -5
- package/dist/queue/rows.mjs +5 -10
- package/dist/queue/schedule.mjs +6 -5
- package/dist/queue/search.mjs +8 -13
- package/dist/queue/state.mjs +7 -2
- package/dist/queue/trim.mjs +10 -5
- package/dist/rest/api.d.mts +1 -1
- package/dist/rest/blobs.d.mts +20 -20
- package/dist/rest/caller.d.mts +22 -20
- package/dist/rest/client.mjs +6 -6
- package/dist/rest/commits.d.mts +335 -335
- package/dist/rest/errors.d.mts +10 -10
- package/dist/rest/errors.mjs +1 -1
- package/dist/rest/events.d.mts +13 -11
- package/dist/rest/events.mjs +3 -1
- package/dist/rest/files.d.mts +30 -30
- package/dist/rest/forks.d.mts +150 -150
- package/dist/rest/handler.mjs +4 -3
- package/dist/rest/handlers.mjs +13 -7
- package/dist/rest/layer.d.mts +3 -3
- package/dist/rest/layer.mjs +8 -7
- package/dist/rest/listen.mjs +2 -2
- package/dist/rest/me.d.mts +18 -20
- package/dist/rest/me.mjs +1 -1
- package/dist/rest/merges.d.mts +10 -10
- package/dist/rest/queue.d.mts +140 -140
- package/dist/rest/queue.mjs +1 -1
- package/dist/rest/refs.d.mts +95 -95
- package/dist/rest/refs.mjs +1 -1
- package/dist/rest/repos.d.mts +127 -127
- package/dist/rest/tags.d.mts +30 -30
- package/dist/rest/tokens.d.mts +250 -260
- package/dist/rest/tokens.mjs +10 -42
- package/dist/rest/topics.d.mts +63 -63
- package/dist/rest/topics.mjs +1 -1
- package/dist/rest/trees.d.mts +106 -106
- package/dist/rest/wire.d.mts +6 -4
- package/dist/rest/wire.mjs +4 -3
- package/dist/rest/work.d.mts +69 -69
- package/dist/rest/work.mjs +1 -1
- package/dist/server/check-fetch.mjs +9 -0
- package/dist/server/extension.mjs +3 -115
- package/dist/server/git-layer.d.mts +20 -3
- package/dist/server/git-layer.mjs +30 -19
- package/dist/server/git-namespace.d.mts +4 -4
- package/dist/server/git-namespace.mjs +6 -4
- package/dist/server/joined.d.mts +83 -0
- package/dist/server/joined.mjs +91 -0
- package/dist/server/registry.d.mts +7 -3
- package/dist/server/registry.mjs +135 -31
- package/dist/server/routes.mjs +2 -2
- package/dist/server/server.d.mts +9 -2
- package/dist/server/server.mjs +279 -191
- package/dist/signin/context.d.mts +2 -1
- package/dist/signin/context.mjs +32 -37
- package/dist/signin/device.mjs +5 -5
- package/dist/signin/forms.mjs +1 -1
- package/dist/signin/grants.d.mts +2 -3
- package/dist/signin/grants.mjs +5 -5
- package/dist/signin/layer.d.mts +9 -0
- package/dist/signin/layer.mjs +41 -0
- package/dist/signin/namespace.d.mts +2 -0
- package/dist/signin/public.d.mts +6 -0
- package/dist/signin/public.mjs +5 -0
- package/dist/signin/route.mjs +47 -21
- package/dist/signin/web.mjs +3 -3
- package/dist/signin/wire.mjs +1 -1
- package/dist/storage/calls.d.mts +1 -1
- package/dist/storage/calls.mjs +4 -4
- package/dist/storage/clean-up.mjs +12 -5
- package/dist/storage/counted-bucket.mjs +34 -51
- package/dist/storage/fetch.mjs +1 -1
- package/dist/storage/host-bucket.mjs +1 -1
- package/dist/storage/index-build.d.mts +2 -2
- package/dist/storage/index-build.mjs +3 -3
- package/dist/storage/index-fetch.mjs +10 -6
- package/dist/storage/index-graph.mjs +1 -1
- package/dist/storage/index-layers.mjs +1 -1
- package/dist/storage/index-visible.mjs +1 -1
- package/dist/storage/memory-budget.mjs +7 -1
- package/dist/storage/merge-cut.mjs +24 -1
- package/dist/storage/merge-fence.mjs +1 -1
- package/dist/storage/merge-plan.mjs +5 -2
- package/dist/storage/merge-row.mjs +1 -1
- package/dist/storage/merge-stream.mjs +16 -7
- package/dist/storage/merge-write.mjs +1 -1
- package/dist/storage/merge.d.mts +2 -2
- package/dist/storage/merge.mjs +1 -1
- package/dist/storage/object-rows.d.mts +2 -2
- package/dist/storage/object-rows.mjs +3 -3
- package/dist/storage/pack-ranges.d.mts +3 -1
- package/dist/storage/pack-ranges.mjs +168 -69
- package/dist/storage/pack-reads.mjs +4 -4
- package/dist/storage/pack-receive.d.mts +1 -1
- package/dist/storage/pack-receive.mjs +7 -9
- package/dist/storage/packs.d.mts +1 -1
- package/dist/storage/packs.mjs +45 -52
- package/dist/storage/placed-reads.mjs +81 -15
- package/dist/storage/prune-seen.mjs +126 -0
- package/dist/storage/prune-walk.mjs +87 -99
- package/dist/storage/prune.mjs +49 -14
- package/dist/storage/push-uploads.mjs +4 -2
- package/dist/storage/quarantine.d.mts +2 -2
- package/dist/storage/ready.d.mts +2 -2
- package/dist/storage/ready.mjs +3 -3
- package/dist/storage/receive-files.mjs +1 -1
- package/dist/storage/receive-links.mjs +1 -1
- package/dist/storage/receive-state.d.mts +2 -2
- package/dist/storage/receive-state.mjs +1 -1
- package/dist/storage/receive-steps.mjs +1 -1
- package/dist/storage/repack-contained.mjs +2 -2
- package/dist/storage/repack-job.d.mts +2 -2
- package/dist/storage/repack-job.mjs +5 -4
- package/dist/storage/repack.d.mts +1 -1
- package/dist/storage/repack.mjs +9 -3
- package/dist/storage/rows.d.mts +2 -2
- package/dist/storage/rows.mjs +1 -1
- package/dist/storage/runs.d.mts +2 -2
- package/dist/storage/runs.mjs +15 -6
- package/dist/storage/send-list.mjs +6 -6
- package/dist/storage/single-flight.mjs +2 -2
- package/dist/storage/swap-walk.mjs +1 -1
- package/dist/storage/unpack.mjs +1 -1
- package/dist/store/call-count.d.mts +1 -1
- package/dist/store/call-count.mjs +125 -34
- package/dist/store/catalogue.d.mts +1 -1
- package/dist/store/catalogue.mjs +2 -2
- package/dist/store/crossing.mjs +2 -6
- package/dist/store/cursor-seal.mjs +1 -1
- package/dist/store/errors.d.mts +7 -3
- package/dist/store/errors.mjs +41 -13
- package/dist/store/job-try.mjs +119 -15
- package/dist/store/list-job.mjs +5 -5
- package/dist/store/outbox.d.mts +2 -2
- package/dist/store/outbox.mjs +75 -16
- package/dist/store/promises.d.mts +2 -2
- package/dist/store/promises.mjs +31 -6
- package/dist/store/queue-jobs.mjs +1 -1
- package/dist/store/records.d.mts +2 -2
- package/dist/store/records.mjs +16 -24
- package/dist/store/ref-rows.d.mts +2 -2
- package/dist/store/ref-rows.mjs +6 -6
- package/dist/store/reservations.mjs +35 -8
- package/dist/store/scopes.mjs +6 -4
- package/dist/store/topic-jobs.mjs +8 -8
- package/dist/sync/bound.d.mts +1 -3
- package/dist/sync/bound.mjs +30 -42
- package/dist/sync/bridge.d.mts +6 -0
- package/dist/sync/bridge.mjs +29 -0
- package/dist/sync/github.d.mts +5 -6
- package/dist/sync/github.mjs +37 -42
- package/dist/sync/http.mjs +15 -0
- package/dist/sync/import.mjs +17 -18
- package/dist/sync/layer.d.mts +9 -0
- package/dist/sync/layer.mjs +68 -0
- package/dist/sync/mirror.mjs +137 -58
- package/dist/sync/publish.mjs +3 -6
- package/dist/sync/step.mjs +217 -79
- package/dist/sync/tries.mjs +22 -15
- package/dist/sync.d.mts +3 -6
- package/dist/sync.mjs +3 -6
- package/dist/topics/advance.mjs +205 -90
- package/dist/topics/calls.mjs +8 -8
- package/dist/topics/directory.mjs +35 -12
- package/dist/topics/host.d.mts +5 -8
- package/dist/topics/host.mjs +42 -19
- package/dist/topics/layer.d.mts +381 -0
- package/dist/topics/layer.mjs +62 -0
- package/dist/topics/members.mjs +1 -1
- package/dist/topics/namespace.d.mts +2 -0
- package/dist/topics/public.d.mts +6 -0
- package/dist/topics/public.mjs +13 -0
- package/dist/topics/rows.mjs +12 -3
- package/dist/topics/topic.mjs +11 -10
- package/package.json +8 -13
- package/dist/access.d.mts +0 -2
- package/dist/access.mjs +0 -1
- package/dist/core/hooks/post-receive.mjs +0 -216
- package/dist/core/hooks/pre-receive.d.mts +0 -12
- package/dist/core/hooks/pre-receive.mjs +0 -36
- package/dist/server/extension.d.mts +0 -21
- package/dist/sync/import.d.mts +0 -10
- package/dist/sync/jobs.d.mts +0 -9
- package/dist/sync/jobs.mjs +0 -75
- package/dist/sync/mirror.d.mts +0 -13
- package/dist/sync/publish.d.mts +0 -6
- /package/dist/core/{claim-rows.d.mts → registered-rows.d.mts} +0 -0
|
@@ -1,35 +1,32 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Duration } from "./promises.mjs";
|
|
2
2
|
import { AccessOption } from "./access.mjs";
|
|
3
3
|
import { Authorize } from "./authorize.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { Caller, GitAuth, GitAuthorize } from "./actors.mjs";
|
|
5
5
|
import { BlobCalls, Blobs } from "./blobs.mjs";
|
|
6
6
|
import { CommitCalls, Commits } from "./commits.mjs";
|
|
7
|
-
import {
|
|
7
|
+
import { Events } from "./events.mjs";
|
|
8
8
|
import { FileCalls, Files } from "./files.mjs";
|
|
9
9
|
import { ForkCalls, Forks } from "./forks.mjs";
|
|
10
|
-
import {
|
|
11
|
-
import { InternalRepoId, RepoName } from "./ids.mjs";
|
|
10
|
+
import { RepoName } from "./ids.mjs";
|
|
12
11
|
import { LfsCalls, LfsFeature } from "./lfs.mjs";
|
|
13
12
|
import { MergeCalls } from "./merges.mjs";
|
|
14
|
-
import {
|
|
15
|
-
import { MergeQueueCalls, MergeQueueLayerOptions
|
|
16
|
-
import { Operation } from "./operations.mjs";
|
|
13
|
+
import { EffectiveLimits, IndexedObjectsFactory, ObjectsFactory } from "./objects.mjs";
|
|
14
|
+
import { MergeQueueCalls, MergeQueueLayerOptions } from "./queue.mjs";
|
|
17
15
|
import { PushOptions } from "./push-uploads.mjs";
|
|
18
16
|
import { RefCalls, Refs } from "./refs.mjs";
|
|
19
|
-
import { RepoCalls,
|
|
17
|
+
import { RepoCalls, Repos } from "./repos.mjs";
|
|
20
18
|
import { RepoRecords } from "./repo-records.mjs";
|
|
21
|
-
import { EffectCalls } from "./services.mjs";
|
|
22
|
-
import { ImportState } from "./sync.mjs";
|
|
23
19
|
import { TagCalls, Tags } from "./tags.mjs";
|
|
24
20
|
import { TreeCalls, Trees } from "./trees.mjs";
|
|
25
|
-
import { Awaitable, GitError,
|
|
26
|
-
import { FetchRule,
|
|
27
|
-
import {
|
|
28
|
-
import { TokenCalls,
|
|
21
|
+
import { Awaitable, GitError, Result } from "./result.mjs";
|
|
22
|
+
import { FetchRule, PushRule, Rules } from "./rules.mjs";
|
|
23
|
+
import { SignInLayerOptions } from "./signin.mjs";
|
|
24
|
+
import { TokenCalls, TokensFeature } from "./tokens.mjs";
|
|
29
25
|
import { Work, WorkCalls } from "./work.mjs";
|
|
30
26
|
import { TopicCalls, TopicsFactory } from "./topics.mjs";
|
|
31
|
-
import { Bucket, CallLimits, JobDefinition, JobQueue, Records } from "@ref0/infra";
|
|
32
27
|
import * as Effect from "effect/Effect";
|
|
28
|
+
import * as Schema from "effect/Schema";
|
|
29
|
+
import { Bucket, CallLimits, JobQueue, Records } from "@ref0/infra";
|
|
33
30
|
import * as Layer from "effect/Layer";
|
|
34
31
|
import * as ManagedRuntime from "effect/ManagedRuntime";
|
|
35
32
|
/** The call modules' services, which a server's runtime holds, each deciding for its `by`. */
|
|
@@ -47,29 +44,273 @@ export type GitNeeds = Records.Records | JobQueue.JobQueue | CallLimits.CallLimi
|
|
|
47
44
|
export type GitAdapter = Layer.Layer<never, Error> | readonly Layer.Layer<never, Error>[];
|
|
48
45
|
/** What `adapter` gives. */
|
|
49
46
|
export type ProvidedBy<A extends GitAdapter> = A extends readonly (infer L extends Layer.Any)[] ? Layer.Success<L> : A extends Layer.Any ? Layer.Success<A> : never;
|
|
50
|
-
export
|
|
51
|
-
readonly
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
47
|
+
export declare const ResolveInput: Schema.Struct<{
|
|
48
|
+
readonly actor: Schema.Union<readonly [Schema.Struct<{
|
|
49
|
+
readonly id: Schema.String;
|
|
50
|
+
readonly anonymous: Schema.optionalKey<Schema.Literal<false>>;
|
|
51
|
+
readonly meta: Schema.optionalKey<Schema.Unknown>;
|
|
52
|
+
}>, Schema.Struct<{
|
|
53
|
+
readonly anonymous: Schema.Literal<true>;
|
|
54
|
+
readonly meta: Schema.optionalKey<Schema.Unknown>;
|
|
55
|
+
}>]>;
|
|
56
|
+
readonly url: Schema.declare<URL, URL>;
|
|
57
|
+
readonly path: Schema.String;
|
|
58
|
+
readonly signal: Schema.declare<AbortSignal, AbortSignal>;
|
|
59
|
+
}>;
|
|
60
|
+
export type ResolveInput = typeof ResolveInput.Type;
|
|
55
61
|
/** Names the repo an HTTP request means, after identification. Direct calls name it already. */
|
|
56
62
|
export type Resolve = (input: ResolveInput) => Awaitable<RepoName | undefined>;
|
|
57
|
-
export
|
|
63
|
+
export declare const HostFunctionFailure: Schema.Struct<{
|
|
58
64
|
/** Also returned to the caller, in the error's context. */
|
|
59
|
-
readonly id:
|
|
60
|
-
readonly function:
|
|
61
|
-
readonly timedOut:
|
|
62
|
-
readonly repo
|
|
63
|
-
readonly operation
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
readonly id: Schema.String;
|
|
66
|
+
readonly function: Schema.Literals<readonly ["auth", "authorize", "approvalPage", "grants", "rules.push", "rules.fetch", "hooks", "resolve", "join", "queue.merge", "queue.lanes", "queue.bisect", "queue.schedule", "topics.prepare", "topics.required"]>;
|
|
67
|
+
readonly timedOut: Schema.Boolean;
|
|
68
|
+
readonly repo: Schema.optionalKey<Schema.String>;
|
|
69
|
+
readonly operation: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
70
|
+
readonly kind: Schema.Literals<readonly ["fetch", "read", "object.create", "repo.create", "repo.update", "repo.delete"]>;
|
|
71
|
+
readonly repo: Schema.String;
|
|
72
|
+
}>, Schema.Struct<{
|
|
73
|
+
readonly kind: Schema.Literal<"push">;
|
|
74
|
+
readonly repo: Schema.String;
|
|
75
|
+
readonly updates: Schema.$Array<Schema.Struct<{
|
|
76
|
+
readonly ref: Schema.String;
|
|
77
|
+
readonly from: Schema.NullOr<Schema.String>;
|
|
78
|
+
readonly to: Schema.NullOr<Schema.String>;
|
|
79
|
+
}>>;
|
|
80
|
+
}>, Schema.Struct<{
|
|
81
|
+
readonly kind: Schema.Literal<"files.allow">;
|
|
82
|
+
readonly repo: Schema.String;
|
|
83
|
+
readonly ref: Schema.String;
|
|
84
|
+
readonly paths: Schema.$Array<Schema.String>;
|
|
85
|
+
}>, Schema.Struct<{
|
|
86
|
+
readonly kind: Schema.Literals<readonly ["protect.bypass", "lock.bypass"]>;
|
|
87
|
+
readonly repo: Schema.String;
|
|
88
|
+
readonly ref: Schema.String;
|
|
89
|
+
readonly move: Schema.Literals<readonly ["fast-forward", "force", "delete"]>;
|
|
90
|
+
readonly source: Schema.Literals<readonly ["git", "api", "queue", "import"]>;
|
|
91
|
+
}>, Schema.Struct<{
|
|
92
|
+
readonly kind: Schema.Literal<"repo.list">;
|
|
93
|
+
readonly prefix: Schema.optionalKey<Schema.String>;
|
|
94
|
+
}>, Schema.Struct<{
|
|
95
|
+
readonly kind: Schema.Literals<readonly ["fork.create", "fork.sync"]>;
|
|
96
|
+
readonly repo: Schema.String;
|
|
97
|
+
readonly holder: Schema.String;
|
|
98
|
+
}>, Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
|
|
99
|
+
readonly repo: Schema.String;
|
|
100
|
+
readonly prefix: Schema.optionalKey<Schema.Never>;
|
|
101
|
+
readonly subject: Schema.Struct<{
|
|
102
|
+
readonly id: Schema.String;
|
|
103
|
+
}>;
|
|
104
|
+
readonly actor: Schema.optionalKey<Schema.Struct<{
|
|
105
|
+
readonly id: Schema.String;
|
|
106
|
+
}>>;
|
|
107
|
+
readonly kind: Schema.Literal<"token.create">;
|
|
108
|
+
}>, Schema.Struct<{
|
|
109
|
+
readonly prefix: Schema.String;
|
|
110
|
+
readonly repo: Schema.optionalKey<Schema.Never>;
|
|
111
|
+
readonly subject: Schema.Struct<{
|
|
112
|
+
readonly id: Schema.String;
|
|
113
|
+
}>;
|
|
114
|
+
readonly actor: Schema.optionalKey<Schema.Struct<{
|
|
115
|
+
readonly id: Schema.String;
|
|
116
|
+
}>>;
|
|
117
|
+
readonly kind: Schema.Literal<"token.create">;
|
|
118
|
+
}>]>, Schema.Union<readonly [Schema.Struct<{
|
|
119
|
+
readonly repo: Schema.String;
|
|
120
|
+
readonly prefix: Schema.optionalKey<Schema.Never>;
|
|
121
|
+
readonly kind: Schema.Literal<"token.revoke">;
|
|
122
|
+
readonly subject: Schema.Struct<{
|
|
123
|
+
readonly id: Schema.String;
|
|
124
|
+
}>;
|
|
125
|
+
}>, Schema.Struct<{
|
|
126
|
+
readonly prefix: Schema.String;
|
|
127
|
+
readonly repo: Schema.optionalKey<Schema.Never>;
|
|
128
|
+
readonly kind: Schema.Literal<"token.revoke">;
|
|
129
|
+
readonly subject: Schema.Struct<{
|
|
130
|
+
readonly id: Schema.String;
|
|
131
|
+
}>;
|
|
132
|
+
}>]>, Schema.Struct<{
|
|
133
|
+
readonly repo: Schema.String;
|
|
134
|
+
readonly prefix: Schema.optionalKey<Schema.Never>;
|
|
135
|
+
readonly kind: Schema.Literal<"token.list">;
|
|
136
|
+
}>, Schema.Struct<{
|
|
137
|
+
readonly prefix: Schema.String;
|
|
138
|
+
readonly repo: Schema.optionalKey<Schema.Never>;
|
|
139
|
+
readonly kind: Schema.Literal<"token.list">;
|
|
140
|
+
}>]>, Schema.Struct<{
|
|
141
|
+
readonly kind: Schema.Literal<"queue.add">;
|
|
142
|
+
readonly repo: Schema.String;
|
|
143
|
+
readonly entry: Schema.Struct<{
|
|
144
|
+
readonly target: Schema.String;
|
|
145
|
+
readonly source: Schema.String;
|
|
146
|
+
readonly head: Schema.String;
|
|
147
|
+
readonly key: Schema.String;
|
|
148
|
+
readonly priority: Schema.optionalKey<Schema.Number>;
|
|
149
|
+
readonly meta: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
150
|
+
}>;
|
|
151
|
+
}>, Schema.Struct<{
|
|
152
|
+
readonly kind: Schema.Literals<readonly ["queue.hold", "queue.restart"]>;
|
|
153
|
+
readonly repo: Schema.String;
|
|
154
|
+
readonly target: Schema.String;
|
|
155
|
+
readonly entry: Schema.optionalKey<Schema.String>;
|
|
156
|
+
}>, Schema.Struct<{
|
|
157
|
+
readonly kind: Schema.Literal<"queue.remove">;
|
|
158
|
+
readonly repo: Schema.String;
|
|
159
|
+
readonly entry: Schema.String;
|
|
160
|
+
}>, Schema.Struct<{
|
|
161
|
+
readonly kind: Schema.Literals<readonly ["queue.report", "queue.retry"]>;
|
|
162
|
+
readonly repo: Schema.String;
|
|
163
|
+
readonly candidate: Schema.String;
|
|
164
|
+
}>, Schema.Struct<{
|
|
165
|
+
readonly kind: Schema.Literal<"queue.release">;
|
|
166
|
+
readonly repo: Schema.String;
|
|
167
|
+
readonly hold: Schema.String;
|
|
168
|
+
}>, Schema.Struct<{
|
|
169
|
+
readonly kind: Schema.Literals<readonly ["topic.add", "topic.remove", "topic.report", "topic.read"]>;
|
|
170
|
+
readonly topic: Schema.optionalKey<Schema.String>;
|
|
171
|
+
}>, Schema.Struct<{
|
|
172
|
+
readonly kind: Schema.Literals<readonly ["work.list", "work.retry", "work.discard"]>;
|
|
173
|
+
readonly repo: Schema.String;
|
|
174
|
+
readonly name: Schema.optionalKey<Schema.String>;
|
|
175
|
+
readonly key: Schema.optionalKey<Schema.String>;
|
|
176
|
+
}>, Schema.Struct<{
|
|
177
|
+
readonly kind: Schema.Literal<"refs.private">;
|
|
178
|
+
readonly repo: Schema.String;
|
|
179
|
+
readonly patterns: Schema.$Array<Schema.String>;
|
|
180
|
+
}>, Schema.Struct<{
|
|
181
|
+
readonly kind: Schema.Literal<"me">;
|
|
182
|
+
}>]>>;
|
|
183
|
+
}>;
|
|
184
|
+
export type HostFunctionFailure = typeof HostFunctionFailure.Type;
|
|
185
|
+
export declare const Refusal: Schema.Struct<{
|
|
186
|
+
readonly code: Schema.Literals<readonly ("ALREADY_EXISTS" | "DATA_LOSS" | "DEADLINE_EXCEEDED" | "FAILED_PRECONDITION" | "INTERNAL" | "INVALID_ARGUMENT" | "NOT_ALLOWED" | "NOT_FOUND" | "RESOURCE_EXHAUSTED" | "UNAUTHENTICATED" | "UNAVAILABLE")[]>;
|
|
187
|
+
readonly message: Schema.String;
|
|
188
|
+
readonly function: Schema.optionalKey<Schema.Literals<readonly ["auth", "authorize", "approvalPage", "grants", "rules.push", "rules.fetch", "hooks", "resolve", "join", "queue.merge", "queue.lanes", "queue.bisect", "queue.schedule", "topics.prepare", "topics.required"]>>;
|
|
189
|
+
readonly repo: Schema.optionalKey<Schema.String>;
|
|
190
|
+
readonly operation: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
191
|
+
readonly kind: Schema.Literals<readonly ["fetch", "read", "object.create", "repo.create", "repo.update", "repo.delete"]>;
|
|
192
|
+
readonly repo: Schema.String;
|
|
193
|
+
}>, Schema.Struct<{
|
|
194
|
+
readonly kind: Schema.Literal<"push">;
|
|
195
|
+
readonly repo: Schema.String;
|
|
196
|
+
readonly updates: Schema.$Array<Schema.Struct<{
|
|
197
|
+
readonly ref: Schema.String;
|
|
198
|
+
readonly from: Schema.NullOr<Schema.String>;
|
|
199
|
+
readonly to: Schema.NullOr<Schema.String>;
|
|
200
|
+
}>>;
|
|
201
|
+
}>, Schema.Struct<{
|
|
202
|
+
readonly kind: Schema.Literal<"files.allow">;
|
|
203
|
+
readonly repo: Schema.String;
|
|
204
|
+
readonly ref: Schema.String;
|
|
205
|
+
readonly paths: Schema.$Array<Schema.String>;
|
|
206
|
+
}>, Schema.Struct<{
|
|
207
|
+
readonly kind: Schema.Literals<readonly ["protect.bypass", "lock.bypass"]>;
|
|
208
|
+
readonly repo: Schema.String;
|
|
209
|
+
readonly ref: Schema.String;
|
|
210
|
+
readonly move: Schema.Literals<readonly ["fast-forward", "force", "delete"]>;
|
|
211
|
+
readonly source: Schema.Literals<readonly ["git", "api", "queue", "import"]>;
|
|
212
|
+
}>, Schema.Struct<{
|
|
213
|
+
readonly kind: Schema.Literal<"repo.list">;
|
|
214
|
+
readonly prefix: Schema.optionalKey<Schema.String>;
|
|
215
|
+
}>, Schema.Struct<{
|
|
216
|
+
readonly kind: Schema.Literals<readonly ["fork.create", "fork.sync"]>;
|
|
217
|
+
readonly repo: Schema.String;
|
|
218
|
+
readonly holder: Schema.String;
|
|
219
|
+
}>, Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
|
|
220
|
+
readonly repo: Schema.String;
|
|
221
|
+
readonly prefix: Schema.optionalKey<Schema.Never>;
|
|
222
|
+
readonly subject: Schema.Struct<{
|
|
223
|
+
readonly id: Schema.String;
|
|
224
|
+
}>;
|
|
225
|
+
readonly actor: Schema.optionalKey<Schema.Struct<{
|
|
226
|
+
readonly id: Schema.String;
|
|
227
|
+
}>>;
|
|
228
|
+
readonly kind: Schema.Literal<"token.create">;
|
|
229
|
+
}>, Schema.Struct<{
|
|
230
|
+
readonly prefix: Schema.String;
|
|
231
|
+
readonly repo: Schema.optionalKey<Schema.Never>;
|
|
232
|
+
readonly subject: Schema.Struct<{
|
|
233
|
+
readonly id: Schema.String;
|
|
234
|
+
}>;
|
|
235
|
+
readonly actor: Schema.optionalKey<Schema.Struct<{
|
|
236
|
+
readonly id: Schema.String;
|
|
237
|
+
}>>;
|
|
238
|
+
readonly kind: Schema.Literal<"token.create">;
|
|
239
|
+
}>]>, Schema.Union<readonly [Schema.Struct<{
|
|
240
|
+
readonly repo: Schema.String;
|
|
241
|
+
readonly prefix: Schema.optionalKey<Schema.Never>;
|
|
242
|
+
readonly kind: Schema.Literal<"token.revoke">;
|
|
243
|
+
readonly subject: Schema.Struct<{
|
|
244
|
+
readonly id: Schema.String;
|
|
245
|
+
}>;
|
|
246
|
+
}>, Schema.Struct<{
|
|
247
|
+
readonly prefix: Schema.String;
|
|
248
|
+
readonly repo: Schema.optionalKey<Schema.Never>;
|
|
249
|
+
readonly kind: Schema.Literal<"token.revoke">;
|
|
250
|
+
readonly subject: Schema.Struct<{
|
|
251
|
+
readonly id: Schema.String;
|
|
252
|
+
}>;
|
|
253
|
+
}>]>, Schema.Struct<{
|
|
254
|
+
readonly repo: Schema.String;
|
|
255
|
+
readonly prefix: Schema.optionalKey<Schema.Never>;
|
|
256
|
+
readonly kind: Schema.Literal<"token.list">;
|
|
257
|
+
}>, Schema.Struct<{
|
|
258
|
+
readonly prefix: Schema.String;
|
|
259
|
+
readonly repo: Schema.optionalKey<Schema.Never>;
|
|
260
|
+
readonly kind: Schema.Literal<"token.list">;
|
|
261
|
+
}>]>, Schema.Struct<{
|
|
262
|
+
readonly kind: Schema.Literal<"queue.add">;
|
|
263
|
+
readonly repo: Schema.String;
|
|
264
|
+
readonly entry: Schema.Struct<{
|
|
265
|
+
readonly target: Schema.String;
|
|
266
|
+
readonly source: Schema.String;
|
|
267
|
+
readonly head: Schema.String;
|
|
268
|
+
readonly key: Schema.String;
|
|
269
|
+
readonly priority: Schema.optionalKey<Schema.Number>;
|
|
270
|
+
readonly meta: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
271
|
+
}>;
|
|
272
|
+
}>, Schema.Struct<{
|
|
273
|
+
readonly kind: Schema.Literals<readonly ["queue.hold", "queue.restart"]>;
|
|
274
|
+
readonly repo: Schema.String;
|
|
275
|
+
readonly target: Schema.String;
|
|
276
|
+
readonly entry: Schema.optionalKey<Schema.String>;
|
|
277
|
+
}>, Schema.Struct<{
|
|
278
|
+
readonly kind: Schema.Literal<"queue.remove">;
|
|
279
|
+
readonly repo: Schema.String;
|
|
280
|
+
readonly entry: Schema.String;
|
|
281
|
+
}>, Schema.Struct<{
|
|
282
|
+
readonly kind: Schema.Literals<readonly ["queue.report", "queue.retry"]>;
|
|
283
|
+
readonly repo: Schema.String;
|
|
284
|
+
readonly candidate: Schema.String;
|
|
285
|
+
}>, Schema.Struct<{
|
|
286
|
+
readonly kind: Schema.Literal<"queue.release">;
|
|
287
|
+
readonly repo: Schema.String;
|
|
288
|
+
readonly hold: Schema.String;
|
|
289
|
+
}>, Schema.Struct<{
|
|
290
|
+
readonly kind: Schema.Literals<readonly ["topic.add", "topic.remove", "topic.report", "topic.read"]>;
|
|
291
|
+
readonly topic: Schema.optionalKey<Schema.String>;
|
|
292
|
+
}>, Schema.Struct<{
|
|
293
|
+
readonly kind: Schema.Literals<readonly ["work.list", "work.retry", "work.discard"]>;
|
|
294
|
+
readonly repo: Schema.String;
|
|
295
|
+
readonly name: Schema.optionalKey<Schema.String>;
|
|
296
|
+
readonly key: Schema.optionalKey<Schema.String>;
|
|
297
|
+
}>, Schema.Struct<{
|
|
298
|
+
readonly kind: Schema.Literal<"refs.private">;
|
|
299
|
+
readonly repo: Schema.String;
|
|
300
|
+
readonly patterns: Schema.$Array<Schema.String>;
|
|
301
|
+
}>, Schema.Struct<{
|
|
302
|
+
readonly kind: Schema.Literal<"me">;
|
|
303
|
+
}>]>>;
|
|
304
|
+
readonly actor: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
305
|
+
readonly id: Schema.String;
|
|
306
|
+
readonly anonymous: Schema.optionalKey<Schema.Literal<false>>;
|
|
307
|
+
readonly meta: Schema.optionalKey<Schema.Unknown>;
|
|
308
|
+
}>, Schema.Struct<{
|
|
309
|
+
readonly anonymous: Schema.Literal<true>;
|
|
310
|
+
readonly meta: Schema.optionalKey<Schema.Unknown>;
|
|
311
|
+
}>]>>;
|
|
312
|
+
}>;
|
|
313
|
+
export type Refusal = typeof Refusal.Type;
|
|
73
314
|
/** Each piece adds its own options: C's are these. */
|
|
74
315
|
export interface GitServerOptions<A extends GitAdapter = GitAdapter> {
|
|
75
316
|
readonly adapter: A;
|
|
@@ -99,9 +340,7 @@ export interface GitServerOptions<A extends GitAdapter = GitAdapter> {
|
|
|
99
340
|
/** `topics()`: `git.topics`, their jobs and their events, across the repos a `queue` has. */
|
|
100
341
|
readonly topics?: TopicsFactory;
|
|
101
342
|
/** Serves GitHub's device flow and the web flow at `/login/...`; needs `tokens`. */
|
|
102
|
-
readonly signIn?:
|
|
103
|
-
/** Where each scope's events go, a batch at a time, in `seq` order: Git writes none without it. */
|
|
104
|
-
readonly events?: EventsHandler | EventDelivery;
|
|
343
|
+
readonly signIn?: SignInLayerOptions;
|
|
105
344
|
readonly auth?: GitAuth;
|
|
106
345
|
readonly authorize?: GitAuthorize;
|
|
107
346
|
/**
|
|
@@ -111,7 +350,6 @@ export interface GitServerOptions<A extends GitAdapter = GitAdapter> {
|
|
|
111
350
|
* Until 2a's `Git.layer`, and gone in 2c.
|
|
112
351
|
*/
|
|
113
352
|
readonly rules?: readonly (PushRule | FetchRule | Effect.Effect<PushRule | FetchRule, GitError>)[];
|
|
114
|
-
readonly hooks?: GitHooks;
|
|
115
353
|
readonly basePath?: string;
|
|
116
354
|
readonly resolve?: Resolve;
|
|
117
355
|
readonly onError?: (cause: unknown, failed: HostFunctionFailure) => void;
|
|
@@ -133,7 +371,7 @@ export interface GitServerOptions<A extends GitAdapter = GitAdapter> {
|
|
|
133
371
|
readonly maxDuration?: Duration;
|
|
134
372
|
}
|
|
135
373
|
/**
|
|
136
|
-
* `access`, private branches from
|
|
374
|
+
* `access`, private branches from `PrivateRefs.layer`, only over objects that keep the
|
|
137
375
|
* reachability index, `packs()`: a caller's view of a repo's objects is read from it.
|
|
138
376
|
*/
|
|
139
377
|
type AccessSetup = {
|
|
@@ -174,17 +412,12 @@ export interface GitServer<R = never> extends ServerCalls {
|
|
|
174
412
|
readonly fetch: (request: Request) => Promise<Response>;
|
|
175
413
|
/** `undefined` only for a URL Git doesn't own. */
|
|
176
414
|
readonly route: (request: Request) => Promise<Response | undefined>;
|
|
177
|
-
/**
|
|
178
|
-
|
|
179
|
-
* its request is now counts into the count of the request that opened it, so a revoke still
|
|
180
|
-
* reaches the stream and its every call is bounded (Q855 (5), Q915).
|
|
181
|
-
*/
|
|
182
|
-
readonly identify: (request: Request, counted?: GitRequest) => Promise<Result<Caller>>;
|
|
415
|
+
/** Who `request` is, as `authorize` sees it: its token's, its grant's, or the host's session's. */
|
|
416
|
+
readonly identify: (request: Request) => Promise<Result<Caller>>;
|
|
183
417
|
/**
|
|
184
418
|
* The isolate's runtime, over the adapter's Layers and Git's own wiring, which registers Git's
|
|
185
419
|
* jobs on the adapter's queue: built at most once, starting as the tick that made the server
|
|
186
|
-
* ends, so
|
|
187
|
-
* them. A failed build stays failed: every call answers `UNAVAILABLE`, and `fetch` a 503. It
|
|
420
|
+
* ends, so a joined Layer joins in that tick, and a module that only runs jobs has them. A failed build stays failed: every call answers `UNAVAILABLE`, and `fetch` a 503. It
|
|
188
421
|
* holds `RepoRecords`, `Authorize`, `Refs`, `Rules`, `Events` and the call modules' services beside
|
|
189
422
|
* `R`, the adapter's services, and `Tokens` with `tokens`, for an Effect host to read. Named here, so a host's inferred server type names only
|
|
190
423
|
* its adapter's services. The bridge until SV's step 2c.
|
|
@@ -193,153 +426,4 @@ export interface GitServer<R = never> extends ServerCalls {
|
|
|
193
426
|
/** Disposes `runtime`. */
|
|
194
427
|
readonly close: () => Promise<void>;
|
|
195
428
|
}
|
|
196
|
-
/** What a package built on Git, such as `@ref0/github`, adds to one server. */
|
|
197
|
-
export interface GitExtension {
|
|
198
|
-
/** Named other than `git.…`, as Git's own jobs are. */
|
|
199
|
-
readonly jobs?: readonly JobDefinition[];
|
|
200
|
-
readonly pushRules?: readonly PushRule[];
|
|
201
|
-
readonly grants?: readonly GrantResolver[];
|
|
202
|
-
/**
|
|
203
|
-
* Runs in the server's build, after Git's own wiring and before the extension's jobs are
|
|
204
|
-
* registered, with the adapter as promises: the bridge until SV's step 2b-1 deletes it with
|
|
205
|
-
* `extendGit` (Q1030).
|
|
206
|
-
*/
|
|
207
|
-
readonly bind?: (adapter: BoundAdapter) => void;
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* The adapter as `GitExtension.bind` takes it: the store and clock as the bridge's promise shapes,
|
|
211
|
-
* and the bucket as infra's `Bucket` service, through the server's door, each call charged by the
|
|
212
|
-
* `bucketCall` that makes it (Q1114).
|
|
213
|
-
*/
|
|
214
|
-
export interface BoundAdapter {
|
|
215
|
-
readonly store: Store;
|
|
216
|
-
readonly bucket: Bucket$1 | undefined;
|
|
217
|
-
readonly clock: Clock;
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* One request's count of the calls Git makes for it, which only `ExtendedGit.request` makes, with
|
|
221
|
-
* nothing a package reads: one built by hand counts nothing. A bridge, as `ExtendedGit` is (#725):
|
|
222
|
-
* SV's step 2b-1 deletes it with `ExtendedGit` (Q1030).
|
|
223
|
-
*/
|
|
224
|
-
export interface GitRequest {
|
|
225
|
-
readonly kind: 'git-request';
|
|
226
|
-
}
|
|
227
|
-
export interface ExtendedGit {
|
|
228
|
-
/**
|
|
229
|
-
* Where the server serves Git's URLs, as it routes by them: `''` at the host's root, else one
|
|
230
|
-
* leading slash and no trailing one, as `/git`. A package builds its links to Git's routes on it.
|
|
231
|
-
*/
|
|
232
|
-
readonly basePath: string;
|
|
233
|
-
/**
|
|
234
|
-
* The `keys` of the one queue the server was made with, which every repo's queue has:
|
|
235
|
-
* `undefined` for a function of the repo, whose repos may each have another, or no queue.
|
|
236
|
-
* A bridge, as `ExtendedGit` is: SV's step 2b-1 deletes it with `extendGit` (Q1030).
|
|
237
|
-
*/
|
|
238
|
-
readonly queueKeys: QueueKeys | undefined;
|
|
239
|
-
readonly internalId: (repo: RepoName) => Promise<InternalRepoId>;
|
|
240
|
-
/**
|
|
241
|
-
* Once the server's build has ended: success when it's built, `UNAVAILABLE` naming its failure
|
|
242
|
-
* when it failed, as every call then answers. It rejects once the server is closed, as its calls
|
|
243
|
-
* do. A package that serves over what its `bind` was handed waits on it first, since a step
|
|
244
|
-
* after that bind can still fail the build. Like a call, it starts the build, which closes
|
|
245
|
-
* joins: ask it as a call is handled, never while extensions still join. The bridge until SV's
|
|
246
|
-
* step 2b-1 deletes it with `ExtendedGit` (Q1030).
|
|
247
|
-
*/
|
|
248
|
-
readonly ready: () => Promise<Result<void>>;
|
|
249
|
-
/**
|
|
250
|
-
* A new count of one request's calls, bounded as a push's is, by the adapter's `callLimits`: a
|
|
251
|
-
* package makes one as it serves each request and hands it to `callsFor`, `effectCallsFor`,
|
|
252
|
-
* `access`, `effectAccess` and the server's `identify`, so every store and bucket call they make counts into one
|
|
253
|
-
* count beside any `CallBudget` provided, and is refused past the bound, `RESOURCE_EXHAUSTED`,
|
|
254
|
-
* "The N subrequests allowed are spent", as a Git fetch is (#725). A bridge, as Q787 names one:
|
|
255
|
-
* SV's step 2b-1 deletes it with `ExtendedGit`, and the count rides the request's context
|
|
256
|
-
* (Q783, Q1030).
|
|
257
|
-
*/
|
|
258
|
-
readonly request: () => GitRequest;
|
|
259
|
-
/**
|
|
260
|
-
* `internalId` as an Effect, its refusal Git's error, not an `Error`'s cause. These Effect twins,
|
|
261
|
-
* `effectRepo`, `effectAccess`, `effectGrantAgain` and `effectHostCalls` beside it, each go
|
|
262
|
-
* through the server's door as their Promise twins do, so one the closing outlives dies closed,
|
|
263
|
-
* count their store calls into the `CallBudget` provided around them, and answer one spent as its
|
|
264
|
-
* refusal, as `effectCallsFor`'s calls do (Q830). Their names are a bridge's (Q787): SV's step
|
|
265
|
-
* 2b-1 deletes them with `ExtendedGit` (Q783, Q1030).
|
|
266
|
-
*/
|
|
267
|
-
readonly effectInternalId: (repo: RepoName) => Effect.Effect<InternalRepoId, GitError>;
|
|
268
|
-
/**
|
|
269
|
-
* The server's calls, each deciding for `caller`, the one `identify` answered: its token's scope
|
|
270
|
-
* or its grant caps every call, whatever actor an input names (Q106). A bridge, as Q787 names
|
|
271
|
-
* one: the Promise face of `effectCallsFor`'s calls, which no `CallBudget` reaches, since
|
|
272
|
-
* Effect's context stops at a Promise. Given `request`, each call counts into it, as `request`
|
|
273
|
-
* says. SV's step 2b-1 deletes it, with `hostCalls` and `ExtendedGit` (Q783, Q1030).
|
|
274
|
-
*/
|
|
275
|
-
readonly callsFor: (caller: Caller, request?: GitRequest) => ServerCalls;
|
|
276
|
-
/**
|
|
277
|
-
* `callsFor`'s calls as Effects: the same calls, under the same guards, deciding for `caller`
|
|
278
|
-
* alike. Each store and bucket call one makes counts into the `CallBudget` provided around it,
|
|
279
|
-
* and is refused once that budget is spent (Q825). Given `request`, each counts into it too, as
|
|
280
|
-
* the Promise `callsFor`'s do. With neither, nothing bounds its calls. Its name is a bridge's
|
|
281
|
-
* (Q787): SV's step 2b-1 deletes it with `ExtendedGit` (Q783, Q1030).
|
|
282
|
-
*/
|
|
283
|
-
readonly effectCallsFor: (caller: Caller, request?: GitRequest) => EffectCalls<ServerCalls>;
|
|
284
|
-
/** The repo's record now, or `undefined` once it's deleted: the reverse of `internalId`. */
|
|
285
|
-
readonly repo: (internalId: InternalRepoId) => Promise<RepoRecord | undefined>;
|
|
286
|
-
/** `repo` as an Effect, as `effectInternalId` is `internalId`'s. */
|
|
287
|
-
readonly effectRepo: (internalId: InternalRepoId) => Effect.Effect<RepoRecord | undefined, GitError>;
|
|
288
|
-
/**
|
|
289
|
-
* The server's calls with no caller, for host code such as a job: they skip `authorize`, but for
|
|
290
|
-
* a push rule's `protect.bypass` or `lock.bypass`, which they never get. Limits, push rules and
|
|
291
|
-
* write keys apply as for a caller. A host's own calls never lift a rule, so a host that needs
|
|
292
|
-
* to lift one makes the call as a caller its `authorize` accepts. No input's `actor` is read, as
|
|
293
|
-
* with `callsFor`, and their events carry no actor (Q223). A bridge, as Q787 names one: SV's
|
|
294
|
-
* step 2b-1 deletes it, with the Promise `callsFor` and `ExtendedGit` (Q783, Q1030).
|
|
295
|
-
*/
|
|
296
|
-
readonly hostCalls: () => ServerCalls;
|
|
297
|
-
/** `hostCalls`' calls as Effects, as `effectCallsFor`'s are `callsFor`'s. */
|
|
298
|
-
readonly effectHostCalls: () => EffectCalls<ServerCalls>;
|
|
299
|
-
/**
|
|
300
|
-
* The ceiling Git's own calls apply to `caller` on `repo` (Q251): its token's scope when the
|
|
301
|
-
* token covers the repo, its grant's when the grant reaches it, `undefined` when either doesn't.
|
|
302
|
-
* A caller with neither, such as a host's session, answers `'write'`: Git sets it no ceiling, so
|
|
303
|
-
* the host's `authorize` alone decides. A drop-in's own writes check it beside `authorize`.
|
|
304
|
-
* Given `request`, its calls count into it, as `callsFor`'s do.
|
|
305
|
-
*/
|
|
306
|
-
readonly access: (caller: Caller, repo: RepoName, request?: GitRequest) => Promise<TokenScope | undefined>;
|
|
307
|
-
/**
|
|
308
|
-
* `access` as an Effect, as `effectInternalId` is `internalId`'s. Given `internalId`, the repo
|
|
309
|
-
* the caller holds `repo` to, the ceiling is on that repo, and no catalogue read finds it.
|
|
310
|
-
*/
|
|
311
|
-
readonly effectAccess: (caller: Caller, repo: RepoName, request?: GitRequest, internalId?: InternalRepoId) => Effect.Effect<TokenScope | undefined, GitError>;
|
|
312
|
-
/**
|
|
313
|
-
* Where the repo's `git.sync.import` stands, `undefined` for a repo no import made, read as
|
|
314
|
-
* `effectRepo` reads, through the door and into a provided `CallBudget`, with no caller: the
|
|
315
|
-
* extension has decided who may ask. A drop-in that lands records over a repo's history asks it
|
|
316
|
-
* first, since only `done` holds that history (Q882).
|
|
317
|
-
*/
|
|
318
|
-
readonly importState: (internalId: InternalRepoId) => Effect.Effect<ImportState | undefined, GitError>;
|
|
319
|
-
/**
|
|
320
|
-
* The caller the extensions' resolver named `resolver` gives back for `input.id` now, through its
|
|
321
|
-
* `again`, acting for `input.actor` and, if given, `input.subject`, its grant attached as
|
|
322
|
-
* `identify` attaches one: `callsFor` holds it to the grant's scope ceiling and `reaches` on
|
|
323
|
-
* every call, as on any request, whatever `authorize` says. `undefined` when no resolver has that
|
|
324
|
-
* name, or its grant ended, acts for someone else or has another `id`: a refusal and nothing
|
|
325
|
-
* else, so a host or extension never falls back to a broader caller on it. `input.signal` is
|
|
326
|
-
* optional, and joined with Git's own: a caller's signal that aborts, such as a download that
|
|
327
|
-
* ends, stops the resolver's read.
|
|
328
|
-
*/
|
|
329
|
-
readonly grantAgain: (resolver: string, input: GrantAgainRequest) => Promise<Caller | undefined>;
|
|
330
|
-
/** `grantAgain` as an Effect, as `effectInternalId` is `internalId`'s. */
|
|
331
|
-
readonly effectGrantAgain: (resolver: string, input: GrantAgainRequest) => Effect.Effect<Caller | undefined, GitError>;
|
|
332
|
-
/**
|
|
333
|
-
* Which grant made `caller`: the resolver's name and the grant's `id`, as Git attached them when
|
|
334
|
-
* `identify` or `grantAgain` made it, or `undefined` for any caller no resolver made. It's Git's
|
|
335
|
-
* own word, and the only one to trust: a caller's `grant` field is whatever its builder wrote, so
|
|
336
|
-
* a caller built by hand, or one whose `grant` was rewritten, answers its real grant or none.
|
|
337
|
-
* Work that keeps a caller's grant, such as a link or a queued entry, keeps this, and asks
|
|
338
|
-
* `grantAgain` with it later.
|
|
339
|
-
*/
|
|
340
|
-
readonly grantOf: (caller: Caller) => {
|
|
341
|
-
readonly resolver: string;
|
|
342
|
-
readonly id: string;
|
|
343
|
-
} | undefined;
|
|
344
|
-
}
|
|
345
429
|
export {};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Caller } from "./actors.mjs";
|
|
2
2
|
import { GitClient as GitClient$1 } from "./client.mjs";
|
|
3
|
-
import { EventDelivery, EventsInput } from "./events.mjs";
|
|
4
|
-
import { SavedHandlerOptions } from "./handlers.mjs";
|
|
5
3
|
import { GitError, Result } from "./result.mjs";
|
|
6
4
|
import { GitStore as GitStore$1 } from "./store.mjs";
|
|
7
5
|
import * as Effect from "effect/Effect";
|
|
@@ -17,11 +15,7 @@ export type EffectCalls<T, R = never> = { readonly [K in keyof T]: NonNullable<T
|
|
|
17
15
|
* direct calls do. A call module's service holds these, and its accessors pass `by` on.
|
|
18
16
|
*/
|
|
19
17
|
export type ByCalls<T, R = never> = EffectCalls<{ readonly [K in keyof T]: T[K] extends ((...args: infer Args) => infer Answer) ? (...args: [...Args, by?: Caller]) => Answer : never; }, R>;
|
|
20
|
-
/** `events` as an Effect: a failure, a defect or an interruption sends the whole batch again. */
|
|
21
|
-
export interface EffectGitEvents extends SavedHandlerOptions<(input: EventsInput) => Effect.Effect<void, unknown>> {}
|
|
22
18
|
/** A client of one remote, as `effectGitClient` makes it. */
|
|
23
19
|
export declare const GitClient: Context.Service<EffectCalls<GitClient$1, never>, EffectCalls<GitClient$1, never>>;
|
|
24
20
|
export declare const GitStore: Context.Service<EffectCalls<GitStore$1, never>, EffectCalls<GitStore$1, never>>;
|
|
25
|
-
export declare const GitCaller: Context.Service<Caller<unknown>, Caller<unknown>>;
|
|
26
|
-
/** The host's `events`, for a server made with Effect: `EventDelivery` on the Promise surface. */
|
|
27
|
-
export declare const GitEvents: Context.Service<EventDelivery, EffectGitEvents>;
|
|
21
|
+
export declare const GitCaller: Context.Service<Caller<unknown>, Caller<unknown>>;
|
|
@@ -4,6 +4,4 @@ import * as Context from "effect/Context";
|
|
|
4
4
|
const GitClient = /* @__PURE__ */ Context.Service("@ref0/git/GitClient");
|
|
5
5
|
const GitStore = /* @__PURE__ */ Context.Service("@ref0/git/GitStore");
|
|
6
6
|
const GitCaller = /* @__PURE__ */ Context.Service("@ref0/git/GitCaller");
|
|
7
|
-
|
|
8
|
-
const GitEvents = /* @__PURE__ */ Context.Service("@ref0/git/GitEvents");
|
|
9
|
-
export { GitCaller, GitClient, GitEvents, GitStore };
|
|
7
|
+
export { GitCaller, GitClient, GitStore };
|