@ref0/git 0.6.0 → 0.8.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 +26 -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 +35 -29
- package/dist/auth/bridge.mjs +8 -8
- package/dist/auth/fences.d.mts +1 -2
- package/dist/auth/fences.mjs +1 -1
- package/dist/auth/grants.d.mts +0 -1
- package/dist/auth/grants.mjs +2 -2
- package/dist/auth/host-function.d.mts +1 -7
- package/dist/auth/host-function.mjs +51 -42
- package/dist/auth/identify.d.mts +0 -1
- package/dist/auth/identify.mjs +3 -2
- package/dist/auth/namespaces.d.mts +2 -2
- package/dist/auth/policy.d.mts +7 -4
- package/dist/auth/policy.mjs +13 -10
- package/dist/auth/token-rows.mjs +3 -6
- package/dist/auth/tokens-layer.d.mts +40 -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 +31 -0
- package/dist/auth/tokens.d.mts +19 -7
- package/dist/auth/tokens.mjs +12 -6
- package/dist/auth.d.mts +2 -2
- package/dist/auth.mjs +2 -2
- package/dist/client/client.d.mts +22 -15
- package/dist/client/client.mjs +31 -27
- package/dist/client/git-http.mjs +23 -6
- package/dist/client/local.mjs +5 -4
- package/dist/client/namespace.d.mts +2 -0
- package/dist/client/push-upload.d.mts +1 -0
- package/dist/client/push-upload.mjs +169 -2
- package/dist/client/remote-helper.mjs +5 -12
- package/dist/client/remote.mjs +63 -22
- package/dist/client/run-remote-helper.d.mts +1 -1
- package/dist/client/run-remote-helper.mjs +6 -6
- package/dist/client/slice-push.d.mts +1 -1
- package/dist/client/transport.mjs +26 -19
- package/dist/contracts/access.d.mts +18 -10
- package/dist/contracts/access.mjs +17 -0
- package/dist/contracts/actors.d.mts +73 -28
- package/dist/contracts/actors.mjs +45 -2
- package/dist/contracts/authorize.d.mts +26 -17
- package/dist/contracts/blobs.d.mts +1 -1
- package/dist/contracts/blobs.mjs +1 -1
- package/dist/contracts/callers.mjs +40 -0
- package/dist/contracts/calls-spent.d.mts +6 -4
- package/dist/contracts/calls-spent.mjs +10 -8
- package/dist/contracts/client.d.mts +16 -9
- 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 +45 -32
- package/dist/contracts/events.mjs +21 -10
- package/dist/contracts/files.d.mts +44 -44
- package/dist/contracts/files.mjs +1 -1
- package/dist/contracts/forks.d.mts +34 -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 +254 -0
- package/dist/contracts/git-hooks.mjs +12 -0
- package/dist/contracts/git.d.mts +93 -42
- package/dist/contracts/git.mjs +6 -5
- package/dist/contracts/grants.d.mts +46 -27
- package/dist/contracts/ids.d.mts +16 -0
- package/dist/contracts/ids.mjs +19 -4
- package/dist/contracts/lfs.d.mts +19 -4
- package/dist/contracts/merges.d.mts +7 -7
- package/dist/contracts/namespaces.d.mts +2 -2
- package/dist/contracts/objects.d.mts +21 -5
- package/dist/contracts/opaque.mjs +27 -0
- package/dist/contracts/operations.d.mts +301 -101
- package/dist/contracts/operations.mjs +209 -0
- 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 +220 -49
- package/dist/contracts/queue.mjs +68 -6
- package/dist/contracts/refs.d.mts +30 -8
- package/dist/contracts/refs.mjs +1 -1
- package/dist/contracts/remote.d.mts +53 -23
- package/dist/contracts/remote.mjs +22 -0
- package/dist/contracts/repo-records.d.mts +2 -2
- package/dist/contracts/repos.d.mts +100 -82
- package/dist/contracts/repos.mjs +47 -8
- package/dist/contracts/result.d.mts +73 -41
- package/dist/contracts/result.mjs +74 -17
- package/dist/contracts/rules.d.mts +734 -68
- package/dist/contracts/rules.mjs +84 -1
- package/dist/contracts/server.d.mts +20 -206
- package/dist/contracts/services.d.mts +1 -10
- package/dist/contracts/services.mjs +1 -5
- package/dist/contracts/signin.d.mts +140 -43
- package/dist/contracts/signin.mjs +36 -3
- package/dist/contracts/store.d.mts +1 -1
- package/dist/contracts/sync.d.mts +109 -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 +247 -60
- package/dist/contracts/tokens.mjs +93 -21
- package/dist/contracts/topics.d.mts +59 -20
- package/dist/contracts/topics.mjs +14 -5
- 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 -12
- package/dist/core/access.mjs +45 -11
- package/dist/core/clock.mjs +1 -1
- package/dist/core/events/deliver.d.mts +3 -2
- package/dist/core/events/deliver.mjs +188 -92
- package/dist/core/forks.mjs +78 -34
- package/dist/core/hooks/groups.d.mts +26 -0
- package/dist/core/hooks/groups.mjs +73 -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/loose-tally.mjs +46 -0
- 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 +4 -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 -17
- package/dist/core/purge.d.mts +2 -2
- package/dist/core/purge.mjs +89 -34
- package/dist/core/push.mjs +67 -79
- 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 +16 -8
- 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 +30 -23
- package/dist/core/repo-info.mjs +62 -26
- package/dist/core/repos.mjs +18 -11
- package/dist/core/rules/changes.mjs +2 -2
- package/dist/core/rules/check.mjs +10 -10
- package/dist/core/rules/commit-changes.mjs +1 -1
- package/dist/core/rules/context.d.mts +7 -6
- package/dist/core/rules/context.mjs +18 -16
- package/dist/core/rules/fetch.mjs +78 -31
- 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 +7 -2
- 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 -4
- package/dist/effect.mjs +2 -4
- package/dist/engine/commits.mjs +19 -47
- 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/failures.d.mts +1 -2
- package/dist/engine/failures.mjs +1 -3
- package/dist/engine/merge-base-walk.mjs +57 -142
- package/dist/engine/merge-bases.mjs +5 -5
- package/dist/engine/merge-renames.mjs +1 -1
- package/dist/engine/merge.mjs +16 -14
- 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 +2 -3
- package/dist/extend.mjs +2 -2
- package/dist/http/answers.mjs +4 -3
- package/dist/http/core-parts.mjs +3 -4
- package/dist/http/handler.mjs +12 -32
- package/dist/http/parts.d.mts +1 -1
- 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 +44 -24
- package/dist/index.mjs +17 -8
- package/dist/lfs/base.d.mts +8 -5
- package/dist/lfs/base.mjs +2 -1
- package/dist/lfs/calls.mjs +3 -2
- package/dist/lfs/layer.d.mts +9 -7
- package/dist/lfs/layer.mjs +37 -22
- package/dist/lfs/locks.mjs +3 -3
- package/dist/lfs/objects.d.mts +3 -2
- package/dist/lfs/objects.mjs +235 -71
- package/dist/lfs/pointers.mjs +70 -19
- package/dist/lfs/purge.mjs +7 -3
- package/dist/lfs/rows.mjs +25 -8
- package/dist/lfs/service.d.mts +6 -3
- package/dist/lfs/service.mjs +8 -2
- package/dist/lfs/upkeep.mjs +53 -31
- package/dist/lfs/upload-most.mjs +41 -0
- package/dist/lfs/uploaded.mjs +59 -0
- 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/bytes/sha256-hasher.mjs +51 -0
- package/dist/protocol/bytes/text.mjs +6 -1
- 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/fsck.mjs +6 -3
- 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 +190 -68
- package/dist/queue/callers.mjs +56 -69
- package/dist/queue/calls.mjs +10 -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 +13 -10
- package/dist/queue/schedule.mjs +7 -6
- package/dist/queue/search.mjs +11 -17
- 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-namespace.d.mts +2 -0
- package/dist/rest/client.d.mts +32 -8
- package/dist/rest/client.mjs +314 -388
- package/dist/rest/commits.d.mts +284 -284
- 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 +48 -48
- package/dist/rest/forks.d.mts +131 -143
- package/dist/rest/handler.mjs +4 -3
- package/dist/rest/handlers.mjs +15 -8
- package/dist/rest/layer.d.mts +3 -3
- package/dist/rest/layer.mjs +8 -7
- package/dist/rest/listen.d.mts +8 -6
- package/dist/rest/listen.mjs +33 -77
- package/dist/rest/me.d.mts +18 -20
- package/dist/rest/me.mjs +1 -1
- package/dist/rest/merges.d.mts +17 -17
- package/dist/rest/queue.d.mts +140 -140
- package/dist/rest/queue.mjs +1 -1
- package/dist/rest/refs.d.mts +214 -214
- package/dist/rest/refs.mjs +1 -1
- package/dist/rest/repos.d.mts +123 -135
- 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 +162 -162
- package/dist/rest/topics.mjs +1 -1
- package/dist/rest/trees.d.mts +117 -117
- package/dist/rest/wire.d.mts +7 -5
- package/dist/rest/wire.mjs +4 -3
- package/dist/rest/work.d.mts +69 -69
- package/dist/rest/work.mjs +1 -1
- package/dist/rest.d.mts +1 -7
- package/dist/rest.mjs +1 -5
- package/dist/server/check-fetch.mjs +9 -0
- package/dist/server/extension.mjs +3 -115
- package/dist/server/git-layer.d.mts +30 -5
- package/dist/server/git-layer.mjs +59 -29
- 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/server.d.mts +9 -3
- package/dist/server/server.mjs +277 -208
- package/dist/signin/context.d.mts +2 -2
- package/dist/signin/context.mjs +28 -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 +15 -6
- package/dist/storage/counted-bucket.mjs +34 -51
- package/dist/storage/fetch.mjs +1 -1
- package/dist/storage/fsck.mjs +12 -2
- package/dist/storage/graph-rebuild.mjs +262 -0
- package/dist/storage/host-bucket.mjs +1 -1
- package/dist/storage/index-build.d.mts +2 -2
- package/dist/storage/index-build.mjs +103 -15
- 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/lfs-pointers.d.mts +5 -5
- package/dist/storage/lfs-pointers.mjs +37 -11
- package/dist/storage/loose.mjs +4 -1
- package/dist/storage/memory-budget.mjs +8 -2
- package/dist/storage/merge-cut.mjs +24 -1
- package/dist/storage/merge-fence.mjs +82 -20
- package/dist/storage/merge-most.mjs +1 -0
- package/dist/storage/merge-plan.mjs +5 -2
- package/dist/storage/merge-row.mjs +17 -5
- package/dist/storage/merge-stream.mjs +25 -13
- 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 +20 -4
- 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 +17 -15
- package/dist/storage/packs.d.mts +1 -1
- package/dist/storage/packs.mjs +103 -79
- 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 +113 -50
- 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 +15 -6
- 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 +2 -2
- package/dist/storage/receive-steps.mjs +1 -1
- package/dist/storage/repack-contained.mjs +24 -16
- package/dist/storage/repack-job.d.mts +2 -2
- package/dist/storage/repack-job.mjs +5 -4
- package/dist/storage/repack.d.mts +2 -2
- package/dist/storage/repack.mjs +12 -5
- 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 +8 -1
- package/dist/store/call-count.d.mts +24 -4
- package/dist/store/call-count.mjs +158 -44
- 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 +22 -24
- package/dist/store/ref-rows.d.mts +2 -2
- package/dist/store/ref-rows.mjs +6 -6
- package/dist/store/repo-record.mjs +29 -12
- package/dist/store/reservations.mjs +35 -8
- package/dist/store/scopes.mjs +12 -5
- 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/github.d.mts +5 -6
- package/dist/sync/github.mjs +37 -42
- package/dist/sync/http.mjs +15 -0
- package/dist/sync/import.mjs +30 -19
- package/dist/sync/layer.d.mts +13 -0
- package/dist/sync/layer.mjs +73 -0
- package/dist/sync/mirror.mjs +137 -58
- package/dist/sync/publish.mjs +3 -6
- package/dist/sync/step.mjs +223 -85
- 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 +210 -94
- 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 +39 -10
- 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/engine/merge-base-walk.d.mts +0 -3
- package/dist/server/extension.d.mts +0 -21
- package/dist/server/routes.d.mts +0 -32
- package/dist/server/routes.mjs +0 -69
- 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,22 +1,26 @@
|
|
|
1
1
|
import { RefName } from "./ids.mjs";
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
import * as Context from "effect/Context";
|
|
2
4
|
/**
|
|
3
5
|
* What `authorize` accepts a `refs.private` operation with: the patterns, of those it was asked
|
|
4
6
|
* about, whose refs the caller sees, and those whose commits the caller may publish. A list left
|
|
5
7
|
* out is empty.
|
|
6
8
|
*/
|
|
7
|
-
export
|
|
8
|
-
readonly read
|
|
9
|
-
readonly publish
|
|
10
|
-
}
|
|
9
|
+
export declare const RefAudience: Schema.Struct<{
|
|
10
|
+
readonly read: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
11
|
+
readonly publish: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
12
|
+
}>;
|
|
13
|
+
export type RefAudience = typeof RefAudience.Type;
|
|
11
14
|
/**
|
|
12
15
|
* Ref names from `from`, and before `to`, in the stores' id order: with no `to`, to the end of the
|
|
13
16
|
* names under the listing's prefix. A `to` ending in U+0000, which no ref name holds, ends just
|
|
14
17
|
* after the name before it, so a span can end at one name.
|
|
15
18
|
*/
|
|
16
|
-
export
|
|
17
|
-
readonly from:
|
|
18
|
-
readonly to
|
|
19
|
-
}
|
|
19
|
+
export declare const HiddenSpan: Schema.Struct<{
|
|
20
|
+
readonly from: Schema.String;
|
|
21
|
+
readonly to: Schema.optionalKey<Schema.String>;
|
|
22
|
+
}>;
|
|
23
|
+
export type HiddenSpan = typeof HiddenSpan.Type;
|
|
20
24
|
/**
|
|
21
25
|
* Which refs one caller sees, from its `refs.private` answer. A ref it doesn't see answers as a
|
|
22
26
|
* missing one on every surface. `whole` is true when it reads every pattern: then it sees every
|
|
@@ -95,7 +99,7 @@ export interface RefView {
|
|
|
95
99
|
readonly publishes: (pattern: RefName) => boolean;
|
|
96
100
|
}
|
|
97
101
|
/**
|
|
98
|
-
* Private branches, as `
|
|
102
|
+
* Private branches, as `PrivateRefs.layer` configures them, for `createGitServer`'s
|
|
99
103
|
* `access`. Without it, everyone who may read a repo sees all of it, and none of this runs.
|
|
100
104
|
*/
|
|
101
105
|
export interface AccessOption {
|
|
@@ -115,4 +119,8 @@ export interface AccessOption {
|
|
|
115
119
|
* whole caller sees.
|
|
116
120
|
*/
|
|
117
121
|
readonly refViewOf: (audience: RefAudience, hidden: readonly string[]) => RefView;
|
|
118
|
-
}
|
|
122
|
+
}
|
|
123
|
+
declare const PrivateRefs_base: Context.ServiceClass<PrivateRefs, "@ref0/git/PrivateRefs", AccessOption>;
|
|
124
|
+
/** A host's ref view, provided under Git.layer; absent, every ref is listed. */
|
|
125
|
+
export declare class PrivateRefs extends /* @__PURE__ */ PrivateRefs_base {}
|
|
126
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RefName } from "./ids.mjs";
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
import * as Context from "effect/Context";
|
|
4
|
+
// src/contracts/access.ts
|
|
5
|
+
/**
|
|
6
|
+
* What `authorize` accepts a `refs.private` operation with: the patterns, of those it was asked
|
|
7
|
+
* about, whose refs the caller sees, and those whose commits the caller may publish. A list left
|
|
8
|
+
* out is empty.
|
|
9
|
+
*/
|
|
10
|
+
const RefAudience = /* @__PURE__ */ Schema.Struct({
|
|
11
|
+
read: Schema.optionalKey(Schema.Array(RefName)),
|
|
12
|
+
publish: Schema.optionalKey(Schema.Array(RefName))
|
|
13
|
+
});
|
|
14
|
+
Schema.String, Schema.optionalKey(Schema.String);
|
|
15
|
+
/** A host's ref view, provided under Git.layer; absent, every ref is listed. */
|
|
16
|
+
var PrivateRefs = class extends (/* @__PURE__ */ Context.Service()("@ref0/git/PrivateRefs")) {};
|
|
17
|
+
export { PrivateRefs, RefAudience };
|
|
@@ -27,15 +27,31 @@ export interface AnonymousActor<Meta = unknown> {
|
|
|
27
27
|
readonly anonymous: true;
|
|
28
28
|
readonly meta?: Meta;
|
|
29
29
|
}
|
|
30
|
+
/** An `AnonymousActor` as JSON names one, its `meta` unread. */
|
|
31
|
+
export declare const AnonymousActor: Schema.Struct<{
|
|
32
|
+
readonly anonymous: Schema.Literal<true>;
|
|
33
|
+
readonly meta: Schema.optionalKey<Schema.Unknown>;
|
|
34
|
+
}>;
|
|
30
35
|
export type Actor<Meta = unknown> = NamedActor<Meta> | AnonymousActor<Meta>;
|
|
36
|
+
/** An `Actor` as JSON names one, its `meta` unread. */
|
|
37
|
+
export declare const Actor: Schema.Union<readonly [Schema.Struct<{
|
|
38
|
+
readonly id: Schema.String;
|
|
39
|
+
readonly anonymous: Schema.optionalKey<Schema.Literal<false>>;
|
|
40
|
+
readonly meta: Schema.optionalKey<Schema.Unknown>;
|
|
41
|
+
}>, Schema.Struct<{
|
|
42
|
+
readonly anonymous: Schema.Literal<true>;
|
|
43
|
+
readonly meta: Schema.optionalKey<Schema.Unknown>;
|
|
44
|
+
}>]>;
|
|
31
45
|
/**
|
|
32
46
|
* The actor of a merge queue's publish of an entry, asked again after it waited: its ID alone. It
|
|
33
47
|
* has no `meta`, which was a snapshot of the sign-in at `queue.add`, and replaying it would decide
|
|
34
48
|
* the publish on what held then.
|
|
35
49
|
*/
|
|
36
|
-
export
|
|
37
|
-
readonly
|
|
38
|
-
|
|
50
|
+
export declare const QueuedActor: Schema.Struct<{
|
|
51
|
+
readonly id: Schema.String;
|
|
52
|
+
readonly anonymous: Schema.optionalKey<Schema.Literal<false>>;
|
|
53
|
+
}>;
|
|
54
|
+
export type QueuedActor = typeof QueuedActor.Type;
|
|
39
55
|
/**
|
|
40
56
|
* Who a check is asked about. `at: 'queued'`: the merge queue's publish of an entry that waited,
|
|
41
57
|
* asked again as the caller that added it, its actor named by ID alone, with no `meta`. Narrow on
|
|
@@ -49,9 +65,10 @@ export type Acting<Meta = unknown> = {
|
|
|
49
65
|
readonly at: 'queued';
|
|
50
66
|
readonly actor: QueuedActor;
|
|
51
67
|
};
|
|
52
|
-
export
|
|
53
|
-
readonly signal
|
|
54
|
-
}
|
|
68
|
+
export declare const CallInput: Schema.Struct<{
|
|
69
|
+
readonly signal: Schema.optionalKey<Schema.declare<AbortSignal, AbortSignal>>;
|
|
70
|
+
}>;
|
|
71
|
+
export type CallInput = typeof CallInput.Type;
|
|
55
72
|
/** Every call names who it acts for, reads included, and `authorize` decides it. */
|
|
56
73
|
export interface ActorInput<Meta = unknown> extends CallInput {
|
|
57
74
|
readonly actor: Actor<Meta>;
|
|
@@ -66,40 +83,64 @@ export interface ActorInput<Meta = unknown> extends CallInput {
|
|
|
66
83
|
* receipts: only the writes do. A key past `maxWriteKeyLength` bytes in UTF-8 is
|
|
67
84
|
* `INVALID_ARGUMENT`, `context.field` naming it.
|
|
68
85
|
* `tokens.create`'s key is refused for the token's life instead, since its secret is shown once.
|
|
86
|
+
* A resent fork key answers the fork as it is now, read as `repos.get` reads it for that caller,
|
|
87
|
+
* while every other key answers as it first did. An object write, such as `blobs.create` or
|
|
88
|
+
* `commits.create`, sent again once its repo is deleted answers `NOT_FOUND`, as any call on the
|
|
89
|
+
* repo does then: its answer reads objects the delete lets go of.
|
|
69
90
|
*/
|
|
70
91
|
export interface WriteInput<Meta = unknown> extends ActorInput<Meta> {
|
|
71
92
|
readonly key?: string;
|
|
72
93
|
}
|
|
73
|
-
export
|
|
74
|
-
readonly kind:
|
|
75
|
-
readonly username:
|
|
76
|
-
readonly password:
|
|
77
|
-
}
|
|
78
|
-
export
|
|
79
|
-
|
|
80
|
-
readonly
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
export
|
|
84
|
-
|
|
85
|
-
readonly
|
|
86
|
-
readonly
|
|
87
|
-
|
|
94
|
+
export declare const CredentialsBasic: Schema.Struct<{
|
|
95
|
+
readonly kind: Schema.Literal<"basic">;
|
|
96
|
+
readonly username: Schema.String;
|
|
97
|
+
readonly password: Schema.String;
|
|
98
|
+
}>;
|
|
99
|
+
export type CredentialsBasic = typeof CredentialsBasic.Type;
|
|
100
|
+
export declare const CredentialsBearer: Schema.Struct<{
|
|
101
|
+
readonly kind: Schema.Literal<"bearer">;
|
|
102
|
+
readonly token: Schema.String;
|
|
103
|
+
}>;
|
|
104
|
+
export type CredentialsBearer = typeof CredentialsBearer.Type;
|
|
105
|
+
export declare const Credentials: Schema.Union<readonly [Schema.Struct<{
|
|
106
|
+
readonly kind: Schema.Literal<"basic">;
|
|
107
|
+
readonly username: Schema.String;
|
|
108
|
+
readonly password: Schema.String;
|
|
109
|
+
}>, Schema.Struct<{
|
|
110
|
+
readonly kind: Schema.Literal<"bearer">;
|
|
111
|
+
readonly token: Schema.String;
|
|
112
|
+
}>]>;
|
|
113
|
+
export type Credentials = typeof Credentials.Type;
|
|
114
|
+
export declare const AuthInput: Schema.Struct<{
|
|
115
|
+
readonly request: Schema.declare<Request, Request>;
|
|
116
|
+
readonly credentials: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
117
|
+
readonly kind: Schema.Literal<"basic">;
|
|
118
|
+
readonly username: Schema.String;
|
|
119
|
+
readonly password: Schema.String;
|
|
120
|
+
}>, Schema.Struct<{
|
|
121
|
+
readonly kind: Schema.Literal<"bearer">;
|
|
122
|
+
readonly token: Schema.String;
|
|
123
|
+
}>]>>;
|
|
124
|
+
readonly signal: Schema.declare<AbortSignal, AbortSignal>;
|
|
125
|
+
}>;
|
|
126
|
+
export type AuthInput = typeof AuthInput.Type;
|
|
88
127
|
/** Who is calling: `undefined` for a credential it doesn't know. */
|
|
89
128
|
export type GitAuth<Meta = unknown> = (input: AuthInput) => Awaitable<Actor<Meta> | undefined>;
|
|
90
129
|
/**
|
|
91
130
|
* The extension's grant resolver that identified a caller, by its `name`, for reading only: Git
|
|
92
131
|
* never trusts it, so a caller built by hand with it is a plain caller. To keep a caller's grant,
|
|
93
|
-
* such as a link or a queued entry does, read `
|
|
132
|
+
* such as a link or a queued entry does, read `Authorize.grantOf`.
|
|
94
133
|
*/
|
|
95
|
-
export
|
|
96
|
-
readonly resolver:
|
|
97
|
-
}
|
|
134
|
+
export declare const CallerGrant: Schema.Struct<{
|
|
135
|
+
readonly resolver: Schema.String;
|
|
136
|
+
}>;
|
|
137
|
+
export type CallerGrant = typeof CallerGrant.Type;
|
|
98
138
|
/**
|
|
99
139
|
* `subject`: whom the actor acts for. `token`: set when the credential is one of Git's tokens.
|
|
100
140
|
* `grant`: set when an extension's grant resolver identified the caller, and absent for a token
|
|
101
141
|
* or the host's `auth`. `at: 'queued'`: the merge queue publishing an entry as the caller that
|
|
102
|
-
* added it, its token and grant identified again, its actor with no `meta`.
|
|
142
|
+
* added it, its token and grant identified again, its actor with no `meta`. Its Schema is
|
|
143
|
+
* `callers.ts`' `Caller`.
|
|
103
144
|
*/
|
|
104
145
|
export interface Caller<Meta = unknown> {
|
|
105
146
|
readonly actor: Actor<Meta>;
|
|
@@ -122,7 +163,8 @@ export type RepoAccess = typeof RepoAccess.Type;
|
|
|
122
163
|
/**
|
|
123
164
|
* `subject` and `token`: the caller's, as `Caller` has them. With `at: 'queued'`, the merge
|
|
124
165
|
* queue's publish of an entry that waited, asked as the caller that added it, again: its actor
|
|
125
|
-
* is its ID alone, with no `meta`, and its token is the one it added with, read again live.
|
|
166
|
+
* is its ID alone, with no `meta`, and its token is the one it added with, read again live. Its
|
|
167
|
+
* Schema is `callers.ts`' `AuthorizeInput`.
|
|
126
168
|
*/
|
|
127
169
|
export type AuthorizeInput<Meta = unknown> = Acting<Meta> & {
|
|
128
170
|
readonly subject?: ActorId;
|
|
@@ -151,7 +193,10 @@ export type AuthorizeInput<Meta = unknown> = Acting<Meta> & {
|
|
|
151
193
|
* Decided 21 Nov by the coordinator.
|
|
152
194
|
*
|
|
153
195
|
* A `refs.private` operation, asked only of a server made with `access`, is accepted with the
|
|
154
|
-
* caller's `RefAudience`: `accept({ read, publish })`. Any other is accepted with no value.
|
|
196
|
+
* caller's `RefAudience`: `accept({ read, publish })`. Any other is accepted with no value. One
|
|
197
|
+
* asked with no `repo` is an import's, before it makes the repo the operation names: decide it
|
|
198
|
+
* from the caller, the name and the patterns, as `repo.create`, and read no repo, as none is
|
|
199
|
+
* there yet. An importer who reads fewer than every pattern is refused the import.
|
|
155
200
|
*
|
|
156
201
|
* Decide about a repo by its `repo.internalId`, the repo the call then acts on. A name can move
|
|
157
202
|
* between repos while you decide: swap two repos' names and back around one call, and a host that
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AbortSignalValue } from "./opaque.mjs";
|
|
1
2
|
import { PinnedRepo } from "./repos.mjs";
|
|
2
3
|
import * as Schema from "effect/Schema";
|
|
3
4
|
// src/contracts/actors.ts
|
|
@@ -13,5 +14,47 @@ const NamedActor = /* @__PURE__ */ Schema.Struct({
|
|
|
13
14
|
anonymous: Schema.optionalKey(Schema.Literal(false)),
|
|
14
15
|
meta: Schema.optionalKey(Schema.Unknown)
|
|
15
16
|
});
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
/** An `AnonymousActor` as JSON names one, its `meta` unread. */
|
|
18
|
+
const AnonymousActor = /* @__PURE__ */ Schema.Struct({
|
|
19
|
+
anonymous: Schema.Literal(true),
|
|
20
|
+
meta: Schema.optionalKey(Schema.Unknown)
|
|
21
|
+
});
|
|
22
|
+
/** An `Actor` as JSON names one, its `meta` unread. */
|
|
23
|
+
const Actor = /* @__PURE__ */ Schema.Union([NamedActor, AnonymousActor]);
|
|
24
|
+
/**
|
|
25
|
+
* The actor of a merge queue's publish of an entry, asked again after it waited: its ID alone. It
|
|
26
|
+
* has no `meta`, which was a snapshot of the sign-in at `queue.add`, and replaying it would decide
|
|
27
|
+
* the publish on what held then.
|
|
28
|
+
*/
|
|
29
|
+
const QueuedActor = /* @__PURE__ */ Schema.Struct({
|
|
30
|
+
...ActorId.fields,
|
|
31
|
+
anonymous: Schema.optionalKey(Schema.Literal(false))
|
|
32
|
+
});
|
|
33
|
+
const CallInput = /* @__PURE__ */ Schema.Struct({ signal: Schema.optionalKey(AbortSignalValue) });
|
|
34
|
+
const CredentialsBasic = /* @__PURE__ */ Schema.Struct({
|
|
35
|
+
kind: Schema.Literal("basic"),
|
|
36
|
+
username: Schema.String,
|
|
37
|
+
password: Schema.String
|
|
38
|
+
});
|
|
39
|
+
const CredentialsBearer = /* @__PURE__ */ Schema.Struct({
|
|
40
|
+
kind: Schema.Literal("bearer"),
|
|
41
|
+
token: Schema.String
|
|
42
|
+
});
|
|
43
|
+
const Credentials = /* @__PURE__ */ Schema.Union([CredentialsBasic, CredentialsBearer]);
|
|
44
|
+
Schema.optionalKey(Credentials);
|
|
45
|
+
/**
|
|
46
|
+
* The extension's grant resolver that identified a caller, by its `name`, for reading only: Git
|
|
47
|
+
* never trusts it, so a caller built by hand with it is a plain caller. To keep a caller's grant,
|
|
48
|
+
* such as a link or a queued entry does, read `Authorize.grantOf`.
|
|
49
|
+
*/
|
|
50
|
+
const CallerGrant = /* @__PURE__ */ Schema.Struct({ resolver: Schema.String });
|
|
51
|
+
/**
|
|
52
|
+
* The repo an operation names, when it exists: its name, its visibility and which repo it is
|
|
53
|
+
* underneath, all read in one snapshot. `internalId` stays with the repo across a rename, so a
|
|
54
|
+
* host that keys its grants by it decides about the repo the call then acts on.
|
|
55
|
+
*/
|
|
56
|
+
const RepoAccess = /* @__PURE__ */ Schema.Struct({
|
|
57
|
+
...PinnedRepo.fields,
|
|
58
|
+
public: Schema.Boolean
|
|
59
|
+
});
|
|
60
|
+
export { Actor, ActorId, AnonymousActor, CallInput, CallerGrant, Credentials, CredentialsBasic, CredentialsBearer, NamedActor, QueuedActor, RepoAccess };
|
|
@@ -4,11 +4,11 @@ import { GrantAgainRequest } from "./grants.mjs";
|
|
|
4
4
|
import { InternalRepoId, RefName, RepoName } from "./ids.mjs";
|
|
5
5
|
import { Operation } from "./operations.mjs";
|
|
6
6
|
import { GitError } from "./result.mjs";
|
|
7
|
-
import {
|
|
7
|
+
import { GrantScope } from "./tokens.mjs";
|
|
8
8
|
import * as Effect from "effect/Effect";
|
|
9
9
|
import * as Context from "effect/Context";
|
|
10
10
|
declare namespace authorize_d_exports {
|
|
11
|
-
export { Authorize, AuthorizeRequest, CeilingInput, audience, ceiling, check, grantAgain, grantOf };
|
|
11
|
+
export { AudienceInput, Authorize, AuthorizeRequest, CeilingInput, audience, ceiling, check, grantAgain, grantOf };
|
|
12
12
|
}
|
|
13
13
|
/** What `check` is asked: who acts, what they do, and the repo it names, when it names one. */
|
|
14
14
|
export interface AuthorizeRequest {
|
|
@@ -27,29 +27,39 @@ export interface CeilingInput {
|
|
|
27
27
|
readonly repo: RepoName;
|
|
28
28
|
readonly internalId?: InternalRepoId;
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* What `audience` is asked: who acts and the private patterns, about `repo`, a repo that exists,
|
|
32
|
+
* or `creating`, the name of one an import is about to make, which no repo has yet.
|
|
33
|
+
*/
|
|
34
|
+
export type AudienceInput = {
|
|
35
|
+
readonly caller: Caller;
|
|
36
|
+
readonly patterns: readonly RefName[];
|
|
37
|
+
} & ({
|
|
38
|
+
readonly repo: RepoAccess;
|
|
39
|
+
readonly creating?: never;
|
|
40
|
+
} | {
|
|
41
|
+
readonly creating: RepoName;
|
|
42
|
+
readonly repo?: never;
|
|
43
|
+
});
|
|
30
44
|
declare const Authorize_base: Context.ServiceClass<Authorize, "@ref0/git/Authorize", {
|
|
31
45
|
/** Nothing when `request.caller` may do `request.operation`, else the refusal. */
|
|
32
46
|
readonly check: (request: AuthorizeRequest) => Effect.Effect<void, GitError>;
|
|
33
47
|
/** `refs.private`'s answer for `patterns`, for a server with `access`. */
|
|
34
|
-
readonly audience: (input:
|
|
35
|
-
readonly caller: Caller;
|
|
36
|
-
readonly repo: RepoAccess;
|
|
37
|
-
readonly patterns: readonly RefName[];
|
|
38
|
-
}) => Effect.Effect<RefAudience, GitError>;
|
|
48
|
+
readonly audience: (input: AudienceInput) => Effect.Effect<RefAudience, GitError>;
|
|
39
49
|
/**
|
|
40
50
|
* Git's own ceiling on `caller` for `repo`: its token's scope when the token covers the repo,
|
|
41
|
-
* its grant's when the grant reaches it, `undefined` when either doesn't, and `'write'` for
|
|
42
|
-
*
|
|
51
|
+
* its grant's when the grant reaches it, `undefined` when either doesn't, and `'write'` for an
|
|
52
|
+
* `admin` token or a caller with neither.
|
|
43
53
|
*/
|
|
44
|
-
readonly ceiling: (input: CeilingInput) => Effect.Effect<
|
|
45
|
-
/** The resolver and grant that gave `caller`, if a grant did.
|
|
54
|
+
readonly ceiling: (input: CeilingInput) => Effect.Effect<GrantScope | undefined, GitError>;
|
|
55
|
+
/** The resolver and grant that gave `caller`, if a grant did. */
|
|
46
56
|
readonly grantOf: (caller: Caller) => {
|
|
47
57
|
readonly resolver: string;
|
|
48
58
|
readonly id: string;
|
|
49
59
|
} | undefined;
|
|
50
60
|
/**
|
|
51
61
|
* The caller the resolver named `resolver` gives back for `request.id` now, or `undefined` when
|
|
52
|
-
* none has that name or its grant ended.
|
|
62
|
+
* none has that name or its grant ended.
|
|
53
63
|
*/
|
|
54
64
|
readonly grantAgain: (input: {
|
|
55
65
|
readonly resolver: string;
|
|
@@ -64,11 +74,10 @@ declare const Authorize_base: Context.ServiceClass<Authorize, "@ref0/git/Authori
|
|
|
64
74
|
*/
|
|
65
75
|
export declare class Authorize extends /* @__PURE__ */ Authorize_base {}
|
|
66
76
|
export declare const check: (request: AuthorizeRequest) => Effect.Effect<void, GitError, Authorize>;
|
|
67
|
-
export declare const audience: (input: {
|
|
68
|
-
readonly
|
|
69
|
-
readonly
|
|
70
|
-
|
|
71
|
-
}) => Effect.Effect<RefAudience, GitError, Authorize>;
|
|
77
|
+
export declare const audience: (input: AudienceInput) => Effect.Effect<{
|
|
78
|
+
readonly read?: readonly string[];
|
|
79
|
+
readonly publish?: readonly string[];
|
|
80
|
+
}, GitError, Authorize>;
|
|
72
81
|
export declare const ceiling: (input: CeilingInput) => Effect.Effect<"read" | "report" | "write" | undefined, GitError, Authorize>;
|
|
73
82
|
export declare const grantOf: (caller: Caller) => Effect.Effect<{
|
|
74
83
|
readonly resolver: string;
|
|
@@ -5,8 +5,8 @@ import { ReadOptions } from "./engine.mjs";
|
|
|
5
5
|
import { Oid, RepoName } from "./ids.mjs";
|
|
6
6
|
import { Bytes } from "./object-values.mjs";
|
|
7
7
|
import { RepoInput } from "./repos.mjs";
|
|
8
|
-
import * as Schema from "effect/Schema";
|
|
9
8
|
import * as Effect from "effect/Effect";
|
|
9
|
+
import * as Schema from "effect/Schema";
|
|
10
10
|
import * as Context from "effect/Context";
|
|
11
11
|
declare namespace blobs_d_exports {
|
|
12
12
|
export { Acting, Blob, BlobCalls, BlobCreateInput, Blobs, CreatedObject, ObjectInput, create, get };
|
package/dist/contracts/blobs.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { Oid } from "./ids.mjs";
|
|
3
3
|
import { Bytes } from "./object-values.mjs";
|
|
4
|
-
import * as Schema from "effect/Schema";
|
|
5
4
|
import * as Effect from "effect/Effect";
|
|
5
|
+
import * as Schema from "effect/Schema";
|
|
6
6
|
import * as Context from "effect/Context";
|
|
7
7
|
// src/contracts/blobs.ts
|
|
8
8
|
var blobs_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Actor, ActorId, CallInput, CallerGrant, QueuedActor, RepoAccess } from "./actors.mjs";
|
|
2
|
+
import "./opaque.mjs";
|
|
3
|
+
import "./operations.mjs";
|
|
4
|
+
import { TokenInfo } from "./tokens.mjs";
|
|
5
|
+
import * as Schema from "effect/Schema";
|
|
6
|
+
// src/contracts/callers.ts
|
|
7
|
+
/** An `Acting`: by the caller, or queued. */
|
|
8
|
+
const Acting = /* @__PURE__ */ Schema.Union([Schema.Struct({
|
|
9
|
+
at: Schema.optionalKey(Schema.Never),
|
|
10
|
+
actor: Actor
|
|
11
|
+
}), Schema.Struct({
|
|
12
|
+
at: Schema.Literal("queued"),
|
|
13
|
+
actor: QueuedActor
|
|
14
|
+
})]);
|
|
15
|
+
const ActorInput = /* @__PURE__ */ Schema.Struct({
|
|
16
|
+
...CallInput.fields,
|
|
17
|
+
actor: Actor
|
|
18
|
+
});
|
|
19
|
+
({ ...ActorInput.fields }), Schema.optionalKey(Schema.String);
|
|
20
|
+
/** A `Caller` as Git identified it. */
|
|
21
|
+
const Caller = /* @__PURE__ */ Schema.Struct({
|
|
22
|
+
actor: Actor,
|
|
23
|
+
subject: Schema.optionalKey(ActorId),
|
|
24
|
+
token: Schema.optionalKey(TokenInfo),
|
|
25
|
+
grant: Schema.optionalKey(CallerGrant),
|
|
26
|
+
at: Schema.optionalKey(Schema.Literal("queued"))
|
|
27
|
+
});
|
|
28
|
+
Schema.optionalKey(ActorId), Schema.optionalKey(TokenInfo), Schema.optionalKey(RepoAccess);
|
|
29
|
+
/**
|
|
30
|
+
* The Schema of a shape typed `Acting & { …fields }`: each arm of `Acting` with `fields`, so a
|
|
31
|
+
* queued arm's actor is read as `QueuedActor`'s.
|
|
32
|
+
*/
|
|
33
|
+
const actingWith = (fields) => Schema.Union([Schema.Struct({
|
|
34
|
+
...Acting.members[0].fields,
|
|
35
|
+
...fields
|
|
36
|
+
}), Schema.Struct({
|
|
37
|
+
...Acting.members[1].fields,
|
|
38
|
+
...fields
|
|
39
|
+
})]);
|
|
40
|
+
export { Acting, ActorInput, Caller, actingWith };
|
|
@@ -4,9 +4,11 @@ import "effect/Cause";
|
|
|
4
4
|
import "effect/Exit";
|
|
5
5
|
/**
|
|
6
6
|
* The refusal of the spent bound `cause` holds, `spentAt`'s, or `undefined` for a cause that holds
|
|
7
|
-
* none
|
|
8
|
-
* with (Q826)
|
|
9
|
-
* `answerSpent` can't reach, since Effect's context stops at a Promise. The
|
|
10
|
-
*
|
|
7
|
+
* none. A Promise edge reads it for its answer, such as a host's route catching what a door's
|
|
8
|
+
* defect rejected with (Q826): a bridge, as Q787 names one, carrying a spent bound across a
|
|
9
|
+
* Promise edge, where `answerSpent` can't reach, since Effect's context stops at a Promise. The
|
|
10
|
+
* drop-in's import reads it too, outside Git, where `answerSpent` isn't exported: a spent
|
|
11
|
+
* publication answers `RESOURCE_EXHAUSTED`, typed. The drop-in's Effect step 2b (Q783) deletes
|
|
12
|
+
* the edges' reads with the Promise edges, once its routes answer as Effects.
|
|
11
13
|
*/
|
|
12
14
|
export declare const spentRefusalOf: (cause: unknown) => GitError | undefined;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { gitError } from "./result.mjs";
|
|
2
|
-
import { isInfraError } from "@ref0/infra";
|
|
3
2
|
import * as Effect from "effect/Effect";
|
|
4
|
-
import * as
|
|
5
|
-
import * as EffectResult from "effect/Result";
|
|
3
|
+
import * as Option from "effect/Option";
|
|
6
4
|
import * as Cause from "effect/Cause";
|
|
7
5
|
import * as Exit from "effect/Exit";
|
|
8
|
-
import * as
|
|
6
|
+
import * as EffectResult from "effect/Result";
|
|
7
|
+
import { isInfraError } from "@ref0/infra";
|
|
8
|
+
import * as Predicate from "effect/Predicate";
|
|
9
9
|
// src/contracts/calls-spent.ts
|
|
10
10
|
/**
|
|
11
11
|
* A call that never started, or that the platform refused, past a bound: `most` of `bound`'s calls
|
|
@@ -128,10 +128,12 @@ const catchSpent = (effect, spent) => Effect.catchCause(effect, (cause) => {
|
|
|
128
128
|
});
|
|
129
129
|
/**
|
|
130
130
|
* The refusal of the spent bound `cause` holds, `spentAt`'s, or `undefined` for a cause that holds
|
|
131
|
-
* none
|
|
132
|
-
* with (Q826)
|
|
133
|
-
* `answerSpent` can't reach, since Effect's context stops at a Promise. The
|
|
134
|
-
*
|
|
131
|
+
* none. A Promise edge reads it for its answer, such as a host's route catching what a door's
|
|
132
|
+
* defect rejected with (Q826): a bridge, as Q787 names one, carrying a spent bound across a
|
|
133
|
+
* Promise edge, where `answerSpent` can't reach, since Effect's context stops at a Promise. The
|
|
134
|
+
* drop-in's import reads it too, outside Git, where `answerSpent` isn't exported: a spent
|
|
135
|
+
* publication answers `RESOURCE_EXHAUSTED`, typed. The drop-in's Effect step 2b (Q783) deletes
|
|
136
|
+
* the edges' reads with the Promise edges, once its routes answer as Effects.
|
|
135
137
|
*/
|
|
136
138
|
const spentRefusalOf = (cause) => {
|
|
137
139
|
const spent = spentAt(cause);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { CallInput } from "./actors.mjs";
|
|
2
1
|
import { BlobCalls } from "./blobs.mjs";
|
|
3
2
|
import { CommitCalls } from "./commits.mjs";
|
|
4
|
-
import { Filter } from "./object-values.mjs";
|
|
5
3
|
import { FileCalls } from "./files.mjs";
|
|
6
4
|
import { Oid, RefName, RepoName } from "./ids.mjs";
|
|
5
|
+
import { Filter } from "./object-values.mjs";
|
|
7
6
|
import { MergeCalls } from "./merges.mjs";
|
|
8
7
|
import { ObjectsFactory } from "./objects.mjs";
|
|
9
8
|
import { Ref, RefApplied, RefCalls, RefEdit, RefRejected, RefsUpdated } from "./refs.mjs";
|
|
10
|
-
import { RemoteOptions, WithoutActor } from "./remote.mjs";
|
|
9
|
+
import { RemoteOptions, WithoutActor, WithoutSignal } from "./remote.mjs";
|
|
11
10
|
import { Result } from "./result.mjs";
|
|
11
|
+
import { EffectCalls } from "./services.mjs";
|
|
12
12
|
import { TagCalls } from "./tags.mjs";
|
|
13
13
|
import { TreeCalls } from "./trees.mjs";
|
|
14
14
|
import { Listing, Page, Records } from "@ref0/infra";
|
|
@@ -28,7 +28,7 @@ export interface GitClientOptions extends RemoteOptions {
|
|
|
28
28
|
readonly adapter?: ClientAdapter;
|
|
29
29
|
readonly objects?: ObjectsFactory<false>;
|
|
30
30
|
}
|
|
31
|
-
export interface RemoteRefsInput
|
|
31
|
+
export interface RemoteRefsInput {
|
|
32
32
|
/** Only refs whose full name starts with it, such as `refs/heads/`. */
|
|
33
33
|
readonly prefix?: string;
|
|
34
34
|
readonly page?: Page;
|
|
@@ -39,7 +39,7 @@ export interface RemoteRefsInput extends CallInput {
|
|
|
39
39
|
* partial fetch, such as `{ kind: 'blob:none' }`. `force`: move a local ref that holds commits
|
|
40
40
|
* the remote's tip doesn't to that tip anyway, as `git fetch --force` does.
|
|
41
41
|
*/
|
|
42
|
-
export interface ClientFetchInput
|
|
42
|
+
export interface ClientFetchInput {
|
|
43
43
|
readonly refs?: readonly RefName[];
|
|
44
44
|
readonly depth?: number;
|
|
45
45
|
readonly filter?: Filter;
|
|
@@ -63,14 +63,15 @@ export interface ClientFetchResult {
|
|
|
63
63
|
readonly updates: readonly (RefApplied | RefForced | RefRejected)[];
|
|
64
64
|
}
|
|
65
65
|
/** `from` is the remote's tip as last seen; `atomic`: all move or none, where the remote can. */
|
|
66
|
-
export interface ClientPushInput
|
|
66
|
+
export interface ClientPushInput {
|
|
67
67
|
readonly updates: readonly RefEdit[];
|
|
68
68
|
readonly atomic?: boolean;
|
|
69
69
|
readonly pushOptions?: readonly string[];
|
|
70
70
|
}
|
|
71
|
-
/** A server's call group as a client makes it: no repo, and no
|
|
72
|
-
export type Localize<Calls> = { readonly [Key in keyof Calls]: Calls[Key] extends ((repo: RepoName, input: infer Input) => infer Answer) ? (input: WithoutActor<Input
|
|
73
|
-
|
|
71
|
+
/** A server's call group as a client makes it: no repo, no actor, and no `signal`. */
|
|
72
|
+
export type Localize<Calls> = { readonly [Key in keyof Calls]: Calls[Key] extends ((repo: RepoName, input: infer Input) => infer Answer) ? (input: WithoutSignal<WithoutActor<Input>>) => Answer : never; };
|
|
73
|
+
/** A client's calls as their Promise twins describe them: `GitClientCalls` is their Effect face. */
|
|
74
|
+
export interface GitClientPromises {
|
|
74
75
|
readonly remoteRefs: (input?: RemoteRefsInput) => Promise<Result<Listing<Ref>>>;
|
|
75
76
|
readonly fetch: (input?: ClientFetchInput) => Promise<Result<ClientFetchResult>>;
|
|
76
77
|
readonly push: (input: ClientPushInput) => Promise<Result<RefsUpdated>>;
|
|
@@ -82,6 +83,12 @@ export interface GitClient {
|
|
|
82
83
|
readonly files: Localize<FileCalls>;
|
|
83
84
|
readonly merges: Localize<MergeCalls>;
|
|
84
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* A client of one remote, as `GitClient.make` gives it: `remoteRefs`, `fetch` and `push` on the
|
|
88
|
+
* remote, and the server's calls on its own storage, with no repo. Each call is an Effect that
|
|
89
|
+
* fails with the call's `GitError`.
|
|
90
|
+
*/
|
|
91
|
+
export type GitClientCalls = EffectCalls<GitClientPromises>;
|
|
85
92
|
/** A list call's input: the page it starts from. */
|
|
86
93
|
export interface PagedInput {
|
|
87
94
|
readonly page?: Page;
|
|
@@ -6,9 +6,9 @@ import { Commit, MergeBases, ReadOptions, ReadPage, TreeChanges } from "./engine
|
|
|
6
6
|
import { Oid, RepoName } from "./ids.mjs";
|
|
7
7
|
import { RepoInput } from "./repos.mjs";
|
|
8
8
|
import { TreeEdit } from "./trees.mjs";
|
|
9
|
-
import { Listing } from "@ref0/infra";
|
|
10
|
-
import * as Schema from "effect/Schema";
|
|
11
9
|
import * as Effect from "effect/Effect";
|
|
10
|
+
import * as Schema from "effect/Schema";
|
|
11
|
+
import { Listing } from "@ref0/infra";
|
|
12
12
|
import * as Context from "effect/Context";
|
|
13
13
|
declare namespace commits_d_exports {
|
|
14
14
|
export { CommitCalls, CommitCreate, CommitCreateFields, CommitCreateInput, CommitDiff, CommitDiffInput, CommitMessage, CommitPick, CommitPickInput, CommitRevert, CommitRevertInput, Commits, CommitsMergeBase, CommitsMergeBaseInput, Compare, CompareInput, CompareRange, ComparisonFile, ComparisonFileFields, LineCounts, Log, LogInput, RefPublication, Revision, compare, create, diff, get, list, mergeBase, pick, revert };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { Commit, DiffListing, Listing, Page, Signature, TreeChangeFields } from "./engine.mjs";
|
|
3
3
|
import { Oid, RefName } from "./ids.mjs";
|
|
4
|
-
import * as Schema from "effect/Schema";
|
|
5
4
|
import * as Effect from "effect/Effect";
|
|
5
|
+
import * as Schema from "effect/Schema";
|
|
6
6
|
import * as Context from "effect/Context";
|
|
7
7
|
// src/contracts/commits.ts
|
|
8
8
|
var commits_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CallInput } from "./actors.mjs";
|
|
2
2
|
import { Oid } from "./ids.mjs";
|
|
3
3
|
import { Bytes, ObjectType, ReadLimits } from "./object-values.mjs";
|
|
4
|
-
import { Listing, Page } from "@ref0/infra";
|
|
5
4
|
import * as Schema from "effect/Schema";
|
|
5
|
+
import { Listing, Page } from "@ref0/infra";
|
|
6
6
|
export interface ReadOptions extends CallInput {
|
|
7
7
|
readonly limits?: ReadLimits;
|
|
8
8
|
}
|