@ref0/git 0.12.0 → 0.20.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/private-refs.mjs +3 -3
- package/dist/auth/access-jwt.mjs +2 -2
- package/dist/auth/auth.d.mts +2 -2
- package/dist/auth/auth.mjs +3 -6
- package/dist/auth/authorize.mjs +4 -20
- package/dist/auth/fences.d.mts +1 -2
- package/dist/auth/fences.mjs +3 -3
- package/dist/auth/grants.mjs +4 -4
- package/dist/auth/helpers.mjs +3 -11
- package/dist/auth/host-function.mjs +18 -1
- package/dist/auth/host-services.mjs +11 -0
- package/dist/auth/identify.d.mts +1 -1
- package/dist/auth/identify.mjs +3 -3
- package/dist/auth/policy.d.mts +27 -7
- package/dist/auth/policy.mjs +8 -4
- package/dist/auth/token-cleanup.mjs +67 -0
- package/dist/auth/token-rows.mjs +1 -1
- package/dist/auth/token-text.mjs +9 -1
- package/dist/auth/tokens-base.d.mts +35 -0
- package/dist/auth/tokens-base.mjs +13 -0
- package/dist/auth/tokens-layer.d.mts +2 -28
- package/dist/auth/tokens-layer.mjs +6 -12
- package/dist/auth/tokens-public.d.mts +3 -3
- package/dist/auth/tokens.d.mts +7 -17
- package/dist/auth/tokens.mjs +9 -87
- package/dist/auth.d.mts +1 -4
- package/dist/auth.mjs +1 -3
- package/dist/client/answer.mjs +21 -42
- package/dist/client/client.d.mts +2 -4
- package/dist/client/git-http.mjs +35 -11
- package/dist/client/local.mjs +14 -13
- package/dist/client/push-upload.mjs +39 -12
- package/dist/client/remote.mjs +95 -31
- package/dist/client/run-remote-helper.d.mts +1 -0
- package/dist/client/run-remote-helper.mjs +58 -24
- package/dist/client/slice-push.d.mts +1 -1
- package/dist/client/transport.mjs +105 -46
- package/dist/contracts/access.d.mts +8 -8
- package/dist/contracts/actors.d.mts +2 -34
- package/dist/contracts/blobs.d.mts +57 -10
- package/dist/contracts/blobs.mjs +16 -2
- package/dist/contracts/call-allowance.d.mts +13 -0
- package/dist/contracts/call-allowance.mjs +44 -0
- package/dist/contracts/calls-spent.mjs +8 -3
- package/dist/contracts/client.d.mts +23 -19
- package/dist/contracts/commits.d.mts +34 -26
- package/dist/contracts/commits.mjs +9 -1
- package/dist/contracts/engine.d.mts +6 -1
- package/dist/contracts/engine.mjs +10 -1
- package/dist/contracts/files.d.mts +12 -12
- package/dist/contracts/forks.d.mts +27 -17
- package/dist/contracts/git-events.d.mts +29 -1
- package/dist/contracts/git-hooks.d.mts +1 -1
- package/dist/contracts/git.d.mts +39 -7
- package/dist/contracts/git.mjs +3 -2
- package/dist/contracts/grants.d.mts +24 -4
- package/dist/contracts/handlers.d.mts +1 -1
- package/dist/contracts/lfs.d.mts +28 -9
- package/dist/contracts/merges.d.mts +3 -2
- package/dist/contracts/objects.d.mts +103 -35
- package/dist/contracts/operations.d.mts +3 -0
- package/dist/contracts/operations.mjs +12 -2
- package/dist/contracts/push-uploads.d.mts +44 -5
- package/dist/contracts/push-uploads.mjs +7 -3
- package/dist/contracts/queue.d.mts +40 -12
- package/dist/contracts/queue.mjs +3 -4
- package/dist/contracts/refs.d.mts +50 -25
- package/dist/contracts/remote.d.mts +6 -7
- package/dist/contracts/remote.mjs +5 -4
- package/dist/contracts/repo-records.d.mts +1 -0
- package/dist/contracts/repos.d.mts +106 -127
- package/dist/contracts/repos.mjs +33 -4
- package/dist/contracts/result.d.mts +49 -25
- package/dist/contracts/result.mjs +52 -11
- package/dist/contracts/rules.d.mts +22 -22
- package/dist/contracts/server.d.mts +37 -111
- package/dist/contracts/services.d.mts +1 -1
- package/dist/contracts/signin.d.mts +1 -1
- package/dist/contracts/store.d.mts +6 -5
- package/dist/contracts/sync.d.mts +90 -26
- package/dist/contracts/sync.mjs +45 -11
- package/dist/contracts/tags.d.mts +10 -10
- package/dist/contracts/time.d.mts +3 -0
- package/dist/contracts/{promises.mjs → time.mjs} +1 -1
- package/dist/contracts/tokens.d.mts +15 -22
- package/dist/contracts/tokens.mjs +3 -3
- package/dist/contracts/topics.d.mts +1 -6
- package/dist/contracts/trees.d.mts +12 -12
- package/dist/contracts/work.d.mts +87 -12
- package/dist/contracts/work.mjs +8 -1
- package/dist/core/access.d.mts +1 -2
- package/dist/core/access.mjs +46 -13
- package/dist/core/ancestry.d.mts +10 -0
- package/dist/core/ancestry.mjs +6 -6
- package/dist/core/asked.mjs +43 -5
- package/dist/core/call-names.mjs +7 -1
- package/dist/core/call-services.mjs +13 -4
- package/dist/core/events/deliver.d.mts +1 -2
- package/dist/core/events/deliver.mjs +48 -33
- package/dist/core/events/retired.mjs +119 -0
- package/dist/core/forks.mjs +931 -435
- package/dist/core/hooks/groups.mjs +1 -1
- package/dist/core/imports.mjs +159 -15
- package/dist/core/index-job.mjs +128 -37
- package/dist/core/index-lost.d.mts +1 -2
- package/dist/core/index-lost.mjs +2 -2
- package/dist/core/job-view.mjs +8 -9
- package/dist/core/loose-tally.mjs +1 -1
- package/dist/core/mirror-rows.mjs +19 -4
- package/dist/core/objects/blobs.mjs +129 -3
- package/dist/core/objects/commits.mjs +16 -6
- package/dist/core/objects/lines.mjs +2 -2
- package/dist/core/objects/merges.mjs +4 -1
- package/dist/core/objects/objects-layer.d.mts +1 -1
- package/dist/core/objects/objects-layer.mjs +3 -3
- package/dist/core/objects/reading.mjs +24 -13
- package/dist/core/objects/tags.mjs +4 -1
- package/dist/core/objects/trees.mjs +2 -2
- package/dist/core/objects/writing.mjs +2 -2
- package/dist/core/own-writes.mjs +1 -1
- package/dist/core/parts.d.mts +10 -6
- package/dist/core/parts.mjs +3 -11
- package/dist/core/promise.mjs +9 -12
- package/dist/core/purge.mjs +316 -42
- package/dist/core/push-decide.mjs +3 -1
- package/dist/core/push-files.d.mts +12 -0
- package/dist/core/push-files.mjs +225 -0
- package/dist/core/push-repo.d.mts +8 -0
- package/dist/core/push-repo.mjs +56 -0
- package/dist/core/push.d.mts +17 -0
- package/dist/core/push.mjs +153 -70
- package/dist/core/receipts.mjs +34 -13
- package/dist/core/ref-index-job.mjs +4 -4
- package/dist/core/ref-view.mjs +61 -7
- package/dist/core/refs.mjs +18 -13
- package/dist/core/registered-rows.mjs +2 -2
- package/dist/core/repack.mjs +46 -28
- package/dist/core/repo-info.mjs +19 -12
- package/dist/core/repos.mjs +50 -22
- package/dist/core/rules/commit-changes.d.mts +0 -1
- package/dist/core/saved-caller-views.d.mts +7 -2
- package/dist/core/saved-caller-views.mjs +2 -2
- package/dist/core/saved-callers.d.mts +19 -2
- package/dist/core/seam.d.mts +16 -26
- package/dist/core/seam.mjs +7 -28
- package/dist/core/tokens.mjs +1 -1
- package/dist/core/view.d.mts +6 -0
- package/dist/core/view.mjs +51 -26
- package/dist/core/work.mjs +105 -35
- package/dist/effect.d.mts +5 -12
- package/dist/effect.mjs +3 -10
- package/dist/engine/failures.mjs +2 -1
- package/dist/engine/reads.mjs +17 -10
- package/dist/engine/walk.mjs +4 -4
- package/dist/event-streams/event-streams.d.mts +1 -1
- package/dist/event-streams/event-streams.mjs +1 -1
- package/dist/event-streams/stream.d.mts +3 -3
- package/dist/event-streams/stream.mjs +38 -15
- package/dist/extend.d.mts +4 -5
- package/dist/extend.mjs +3 -2
- package/dist/http/answers.mjs +12 -7
- package/dist/http/core-parts.mjs +129 -64
- package/dist/http/handler.mjs +36 -9
- package/dist/http/node.d.mts +14 -1
- package/dist/http/node.mjs +61 -31
- package/dist/http/parts.d.mts +2 -0
- package/dist/http/push-upload-job.mjs +507 -0
- package/dist/http/push-uploads.d.mts +1 -0
- package/dist/http/push-uploads.mjs +142 -69
- package/dist/http/upload-pack.mjs +10 -9
- package/dist/index.d.mts +27 -28
- package/dist/index.mjs +5 -8
- package/dist/lfs/answer.mjs +37 -0
- package/dist/lfs/base.d.mts +9 -3
- package/dist/lfs/base.mjs +27 -2
- package/dist/lfs/copy.d.mts +60 -0
- package/dist/lfs/copy.mjs +109 -0
- package/dist/lfs/layer.d.mts +15 -1
- package/dist/lfs/layer.mjs +28 -13
- package/dist/lfs/locks.mjs +2 -2
- package/dist/lfs/objects.d.mts +7 -0
- package/dist/lfs/objects.mjs +152 -55
- package/dist/lfs/pointers.mjs +2 -2
- package/dist/lfs/rows.d.mts +13 -0
- package/dist/lfs/rows.mjs +42 -8
- package/dist/lfs/service.d.mts +1 -7
- package/dist/lfs/service.mjs +1 -9
- package/dist/lfs/upkeep.mjs +48 -14
- package/dist/lfs/upload-most.mjs +5 -5
- package/dist/lfs/wire.mjs +6 -31
- package/dist/merges/merges.mjs +2 -2
- package/dist/node.d.mts +3 -3
- package/dist/protocol/bytes/buffers.mjs +13 -5
- package/dist/protocol/bytes/reader.mjs +6 -1
- package/dist/protocol/bytes/sha256-hasher.d.mts +15 -0
- package/dist/protocol/bytes/sha256.d.mts +32 -0
- package/dist/protocol/bytes/sha256.mjs +105 -49
- package/dist/protocol/bytes/streams.mjs +27 -1
- package/dist/protocol/diff/read.d.mts +4 -3
- package/dist/protocol/diff/read.mjs +8 -3
- package/dist/protocol/objects/lfs-pointer.d.mts +14 -2
- package/dist/protocol/objects/lfs-pointer.mjs +1 -3
- package/dist/protocol/objects/links-raw.mjs +24 -10
- package/dist/protocol/objects/tag.d.mts +1 -1
- package/dist/protocol/objects/tree.mjs +23 -6
- package/dist/protocol/packs/delta.d.mts +6 -3
- package/dist/protocol/packs/delta.mjs +96 -32
- package/dist/protocol/packs/idx.d.mts +2 -1
- package/dist/protocol/packs/idx.mjs +22 -3
- package/dist/protocol/packs/parts.d.mts +4 -1
- package/dist/protocol/packs/parts.mjs +10 -7
- package/dist/protocol/packs/reader.d.mts +5 -0
- package/dist/protocol/packs/reader.mjs +3 -2
- package/dist/protocol/packs/writer.mjs +26 -8
- package/dist/protocol/wire/advertisement.mjs +9 -4
- package/dist/protocol/wire/lines.d.mts +4 -2
- package/dist/protocol/wire/lines.mjs +11 -5
- package/dist/protocol/wire/push-uploads.mjs +13 -1
- package/dist/protocol/wire/v2.mjs +2 -2
- package/dist/protocol.d.mts +3 -1
- package/dist/protocol.mjs +3 -1
- package/dist/queue/advance.mjs +22 -25
- package/dist/queue/base.d.mts +55 -0
- package/dist/queue/base.mjs +44 -0
- package/dist/queue/calls.mjs +51 -54
- package/dist/queue/commit.mjs +1 -1
- package/dist/queue/host.d.mts +2 -22
- package/dist/queue/host.mjs +2 -13
- package/dist/queue/layer.d.mts +2 -1
- package/dist/queue/layer.mjs +11 -4
- package/dist/queue/limits.mjs +2 -0
- package/dist/queue/push-option.mjs +9 -24
- package/dist/queue/schedule.mjs +1 -1
- package/dist/queue/state.mjs +2 -10
- package/dist/queue/trim.mjs +6 -4
- package/dist/rest/blobs.mjs +29 -5
- package/dist/rest/caller.d.mts +4 -4231
- package/dist/rest/caller.mjs +5 -1
- package/dist/rest/client.d.mts +15 -5
- package/dist/rest/client.mjs +23 -2
- package/dist/rest/events.mjs +1 -2
- package/dist/rest/handler.mjs +4 -57
- package/dist/rest/handlers.mjs +68 -9
- package/dist/rest/layer.d.mts +2 -2
- package/dist/rest/layer.mjs +7 -13
- package/dist/rest/me.d.mts +3 -428
- package/dist/rest/paths.mjs +1 -0
- package/dist/rest/work.mjs +8 -0
- package/dist/server/check-fetch.mjs +3 -3
- package/dist/server/edge-node.d.mts +14 -15
- package/dist/server/edge-node.mjs +12 -12
- package/dist/server/edge.d.mts +21 -7
- package/dist/server/edge.mjs +32 -11
- package/dist/server/extension.mjs +1 -1
- package/dist/server/git-layer.d.mts +6 -11
- package/dist/server/git-layer.mjs +29 -23
- package/dist/server/git-namespace.d.mts +5 -4
- package/dist/server/git-namespace.mjs +3 -2
- package/dist/server/joined.d.mts +21 -40
- package/dist/server/joined.mjs +11 -62
- package/dist/server/lifecycle.mjs +65 -69
- package/dist/server/registry.mjs +28 -3
- package/dist/server/server.mjs +245 -465
- package/dist/signin/context.d.mts +1 -2
- package/dist/signin/layer.d.mts +1 -1
- package/dist/signin/layer.mjs +1 -1
- package/dist/storage/allotted.mjs +18 -3
- package/dist/storage/batch-upkeep.mjs +274 -0
- package/dist/{core/purge.d.mts → storage/batches.d.mts} +4 -4
- package/dist/storage/batches.mjs +344 -0
- package/dist/storage/budget.mjs +2 -2
- package/dist/storage/calls.d.mts +1 -2
- package/dist/storage/calls.mjs +144 -158
- package/dist/storage/chunks.d.mts +9 -0
- package/dist/storage/chunks.mjs +297 -0
- package/dist/storage/clean-up.mjs +85 -19
- package/dist/storage/counted-bucket.mjs +4 -4
- package/dist/storage/fetch.d.mts +1 -0
- package/dist/storage/fetch.mjs +298 -216
- package/dist/storage/file-limits.mjs +24 -0
- package/dist/storage/host-bucket.mjs +1 -2
- package/dist/storage/id-mix.mjs +19 -5
- package/dist/storage/index-bitmaps.mjs +9 -2
- package/dist/storage/index-build.d.mts +1 -1
- package/dist/storage/index-build.mjs +185 -84
- package/dist/storage/index-fetch.mjs +128 -74
- package/dist/storage/index-files.d.mts +3 -0
- package/dist/storage/index-files.mjs +10 -5
- package/dist/storage/index-graph.mjs +72 -22
- package/dist/storage/index-reach.mjs +33 -5
- package/dist/storage/index-remap.mjs +208 -65
- package/dist/storage/index-shallow.mjs +5 -3
- package/dist/storage/index-whole.mjs +127 -0
- package/dist/storage/largest-files.mjs +48 -0
- package/dist/storage/layout.mjs +23 -0
- package/dist/storage/lfs-pointers.mjs +10 -1
- package/dist/storage/loose.d.mts +7 -4
- package/dist/storage/loose.mjs +214 -67
- package/dist/storage/memory-budget.mjs +44 -8
- package/dist/storage/merge-plan.mjs +3 -2
- package/dist/storage/merge-row.mjs +7 -1
- package/dist/storage/merge-stream.mjs +164 -25
- package/dist/storage/merge-walk.mjs +8 -4
- package/dist/storage/merge-write.mjs +1 -1
- package/dist/storage/merge.d.mts +1 -1
- package/dist/storage/merge.mjs +1 -1
- package/dist/storage/object-rows.d.mts +1 -0
- package/dist/storage/object-rows.mjs +385 -65
- package/dist/storage/oid-table.mjs +171 -0
- package/dist/storage/pack-order.mjs +8 -4
- package/dist/storage/pack-ranges.d.mts +1 -2
- package/dist/storage/pack-ranges.mjs +4 -5
- package/dist/storage/pack-reads.d.mts +2 -1
- package/dist/storage/pack-reads.mjs +165 -49
- package/dist/storage/pack-receive.d.mts +1 -1
- package/dist/storage/pack-receive.mjs +85 -27
- package/dist/storage/packs.d.mts +1 -1
- package/dist/storage/packs.mjs +172 -86
- package/dist/storage/placed-reads.mjs +1 -1
- package/dist/storage/plan-columns.d.mts +4 -0
- package/dist/storage/plan-columns.mjs +238 -0
- package/dist/storage/prune-keep.mjs +299 -37
- package/dist/storage/prune-walk.mjs +240 -62
- package/dist/storage/prune.mjs +749 -213
- package/dist/storage/push-allotment.mjs +91 -12
- package/dist/storage/push-uploads.mjs +40 -16
- package/dist/storage/pushed-commits.mjs +4 -2
- package/dist/storage/quarantine.d.mts +1 -1
- package/dist/storage/quarantine.mjs +9 -9
- package/dist/storage/range-cache.mjs +125 -8
- package/dist/storage/ready.d.mts +1 -1
- package/dist/storage/ready.mjs +55 -25
- package/dist/storage/receive-bounds.mjs +51 -15
- package/dist/storage/receive-state.mjs +8 -0
- package/dist/storage/receive-steps.mjs +71 -18
- package/dist/storage/repack-backlog.mjs +6 -3
- package/dist/storage/repack.d.mts +2 -2
- package/dist/storage/repack.mjs +1 -8
- package/dist/storage/rows.d.mts +1 -1
- package/dist/storage/rows.mjs +13 -2
- package/dist/storage/runs.mjs +195 -43
- package/dist/storage/send-list.d.mts +1 -0
- package/dist/storage/send-list.mjs +54 -10
- package/dist/storage/shallow.d.mts +1 -0
- package/dist/storage/shallow.mjs +26 -4
- package/dist/storage/single-flight.mjs +13 -7
- package/dist/storage/stream-whole.mjs +132 -28
- package/dist/storage/unpack.mjs +371 -79
- package/dist/storage/visible.mjs +31 -3
- package/dist/storage/walk.mjs +194 -39
- package/dist/storage/wants.mjs +5 -5
- package/dist/store/bodies.mjs +38 -0
- package/dist/store/call-count.d.mts +8 -12
- package/dist/store/call-count.mjs +34 -46
- package/dist/store/catalogue.d.mts +2 -2
- package/dist/store/catalogue.mjs +146 -35
- package/dist/store/crossing.mjs +1 -3
- package/dist/store/cursor-seal-namespace.d.mts +2 -0
- package/dist/store/cursor-seal-public.d.mts +5 -0
- package/dist/store/cursor-seal-public.mjs +5 -0
- package/dist/store/cursor-seal.d.mts +16 -3
- package/dist/store/cursor-seal.mjs +40 -18
- package/dist/store/door.mjs +183 -0
- package/dist/store/errors.d.mts +3 -4
- package/dist/store/errors.mjs +24 -34
- package/dist/store/git-store.mjs +25 -7
- package/dist/store/job-try.mjs +9 -32
- package/dist/store/list-job.mjs +44 -8
- package/dist/store/records.d.mts +5 -0
- package/dist/store/records.mjs +12 -6
- package/dist/store/repo-record.d.mts +10 -9
- package/dist/store/repo-record.mjs +123 -28
- package/dist/store/reservations.mjs +1 -1
- package/dist/store/scopes.mjs +21 -2
- package/dist/store/settle.mjs +4 -4
- package/dist/sync/bound.d.mts +2 -0
- package/dist/sync/bound.mjs +11 -2
- package/dist/sync/github.d.mts +6 -1
- package/dist/sync/github.mjs +56 -44
- package/dist/sync/http.mjs +36 -1
- package/dist/sync/import.mjs +32 -18
- package/dist/sync/layer.mjs +6 -2
- package/dist/sync/lfs-batch.mjs +118 -0
- package/dist/sync/lfs-copy.mjs +262 -0
- package/dist/sync/mirror.mjs +227 -151
- package/dist/sync/said.mjs +16 -37
- package/dist/sync/smart-http.mjs +4 -2
- package/dist/sync/step.mjs +58 -30
- package/dist/sync/tries.mjs +52 -21
- package/dist/sync.d.mts +2 -2
- package/dist/topics/advance.mjs +10 -11
- package/dist/topics/base.d.mts +15 -0
- package/dist/topics/base.mjs +8 -0
- package/dist/topics/host.mjs +2 -20
- package/dist/topics/layer.d.mts +4 -9
- package/dist/topics/layer.mjs +3 -4
- package/dist/topics/members.mjs +4 -4
- package/dist/topics/public.d.mts +2 -1
- package/dist/topics/topic.mjs +2 -2
- package/package.json +5 -9
- package/dist/auth/bridge.mjs +0 -30
- package/dist/auth/helpers.d.mts +0 -17
- package/dist/contracts/promises.d.mts +0 -39
- package/dist/core/call-names.d.mts +0 -3
- package/dist/core/clock.mjs +0 -18
- package/dist/core/registered-rows.d.mts +0 -5
- package/dist/core/repack.d.mts +0 -11
- package/dist/http/handler.d.mts +0 -2
- package/dist/lfs/calls.mjs +0 -26
- package/dist/rest/api.d.mts +0 -23
- package/dist/rest/blobs.d.mts +0 -825
- package/dist/rest/commits.d.mts +0 -3510
- package/dist/rest/errors.d.mts +0 -2104
- package/dist/rest/events.d.mts +0 -423
- package/dist/rest/files.d.mts +0 -1330
- package/dist/rest/forks.d.mts +0 -2136
- package/dist/rest/handler.d.mts +0 -21
- package/dist/rest/handlers.d.mts +0 -8
- package/dist/rest/merges.d.mts +0 -473
- package/dist/rest/queue.d.mts +0 -5861
- package/dist/rest/refs.d.mts +0 -2959
- package/dist/rest/repos.d.mts +0 -2539
- package/dist/rest/tags.d.mts +0 -1304
- package/dist/rest/tokens.d.mts +0 -2590
- package/dist/rest/topics.d.mts +0 -2204
- package/dist/rest/trees.d.mts +0 -1693
- package/dist/rest/work.d.mts +0 -1248
- package/dist/rest.d.mts +0 -2
- package/dist/rest.mjs +0 -1
- package/dist/server/lifecycle.d.mts +0 -2
- package/dist/server/registry.d.mts +0 -16
- package/dist/server/server.d.mts +0 -36
- package/dist/storage/repack-job.d.mts +0 -3
- package/dist/store/promises.d.mts +0 -11
- package/dist/store/promises.mjs +0 -327
- package/dist/topics/host.d.mts +0 -7
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EffectCalls } from "./services.mjs";
|
|
2
|
-
import { GitError, Result } from "./result.mjs";
|
|
3
2
|
import { Caller } from "./actors.mjs";
|
|
4
3
|
import { Acting } from "./blobs.mjs";
|
|
5
4
|
import { DiffListing, ReadPage } from "./engine.mjs";
|
|
6
5
|
import { RepoName } from "./ids.mjs";
|
|
6
|
+
import { GitError } from "./result.mjs";
|
|
7
7
|
import { TreeEntry } from "./trees.mjs";
|
|
8
8
|
import * as Effect from "effect/Effect";
|
|
9
9
|
import * as Schema from "effect/Schema";
|
|
@@ -152,18 +152,18 @@ export declare const FileDiff: Schema.Union<readonly [Schema.Struct<{
|
|
|
152
152
|
export type FileDiff = typeof FileDiff.Type;
|
|
153
153
|
export interface FileCalls {
|
|
154
154
|
/**
|
|
155
|
-
* Files at a revision, each its `bytes` streamed as `blobs.get` streams a blob, to the
|
|
156
|
-
*
|
|
155
|
+
* Files at a revision, each its `bytes` streamed as `blobs.get` streams a blob, to the largest
|
|
156
|
+
* file a host may let a push take, 1 GiB. A page holds as many as fit 8 MiB as base64, and a file past it alone, which
|
|
157
157
|
* REST sends with no content and its client streams from the blob route. Its `bytes` limit has
|
|
158
158
|
* no default for a file's bytes: when the caller sets one, the page's files count against it.
|
|
159
159
|
*/
|
|
160
|
-
readonly read: (repo: RepoName, input: Acting<FileReadInput>) =>
|
|
161
|
-
readonly list: (repo: RepoName, input: Acting<FilesListInput>) =>
|
|
160
|
+
readonly read: (repo: RepoName, input: Acting<FileReadInput>) => Effect.Effect<FilesRead, GitError>;
|
|
161
|
+
readonly list: (repo: RepoName, input: Acting<FilesListInput>) => Effect.Effect<Listing<TreeEntry>, GitError>;
|
|
162
162
|
/** `git diff <base> <head> -- <paths>`, a file at a time: `patch` unless `format` is `hunks`. */
|
|
163
|
-
readonly diff: (repo: RepoName, input: Acting<FilesDiffInput>) =>
|
|
163
|
+
readonly diff: (repo: RepoName, input: Acting<FilesDiffInput>) => Effect.Effect<DiffListing<FileDiff>, GitError>;
|
|
164
164
|
}
|
|
165
165
|
declare const Files_base: Context.ServiceClass<Files, "@ref0/git/Files", EffectCalls<{
|
|
166
|
-
readonly read: (repo: string, input: Acting<FileReadInput>, by?: Caller<unknown> | undefined) =>
|
|
166
|
+
readonly read: (repo: string, input: Acting<FileReadInput>, by?: Caller<unknown> | undefined) => Effect.Effect<{
|
|
167
167
|
readonly files: {
|
|
168
168
|
readonly items: {
|
|
169
169
|
readonly path: string;
|
|
@@ -175,8 +175,8 @@ declare const Files_base: Context.ServiceClass<Files, "@ref0/git/Files", EffectC
|
|
|
175
175
|
readonly next?: string;
|
|
176
176
|
};
|
|
177
177
|
readonly missing: readonly string[];
|
|
178
|
-
}
|
|
179
|
-
readonly list: (repo: string, input: Acting<FilesListInput>, by?: Caller<unknown> | undefined) =>
|
|
178
|
+
}, GitError, never>;
|
|
179
|
+
readonly list: (repo: string, input: Acting<FilesListInput>, by?: Caller<unknown> | undefined) => Effect.Effect<Listing<{
|
|
180
180
|
readonly name: string;
|
|
181
181
|
readonly path: string;
|
|
182
182
|
readonly mode: string;
|
|
@@ -184,8 +184,8 @@ declare const Files_base: Context.ServiceClass<Files, "@ref0/git/Files", EffectC
|
|
|
184
184
|
readonly oid: string;
|
|
185
185
|
readonly size?: number;
|
|
186
186
|
readonly pathBytes?: Uint8Array<ArrayBufferLike>;
|
|
187
|
-
}
|
|
188
|
-
readonly diff: (repo: string, input: Acting<FilesDiffInput>, by?: Caller<unknown> | undefined) =>
|
|
187
|
+
}>, GitError, never>;
|
|
188
|
+
readonly diff: (repo: string, input: Acting<FilesDiffInput>, by?: Caller<unknown> | undefined) => Effect.Effect<DiffListing<{
|
|
189
189
|
readonly status: "A" | "D" | "M" | "R" | "T";
|
|
190
190
|
readonly path: string;
|
|
191
191
|
readonly from?: string;
|
|
@@ -236,7 +236,7 @@ declare const Files_base: Context.ServiceClass<Files, "@ref0/git/Files", EffectC
|
|
|
236
236
|
readonly noNewline?: true;
|
|
237
237
|
}[];
|
|
238
238
|
}[];
|
|
239
|
-
}
|
|
239
|
+
}>, GitError, never>;
|
|
240
240
|
}, never>>;
|
|
241
241
|
/**
|
|
242
242
|
* A repo's files at a revision: read, listed and compared. `FileCalls` as Effects, each deciding for `by`. The server builds it inside its runtime's
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EffectCalls } from "./services.mjs";
|
|
2
|
-
import { GitError, Result } from "./result.mjs";
|
|
3
2
|
import { ActorInput, Caller, WriteInput } from "./actors.mjs";
|
|
4
3
|
import { RepoName } from "./ids.mjs";
|
|
5
4
|
import { RepoInfo, RepoInput } from "./repos.mjs";
|
|
5
|
+
import { GitError } from "./result.mjs";
|
|
6
6
|
import * as Effect from "effect/Effect";
|
|
7
7
|
import * as Schema from "effect/Schema";
|
|
8
8
|
import { Listing, Page } from "@ref0/infra";
|
|
@@ -57,16 +57,18 @@ export interface ForkCalls {
|
|
|
57
57
|
* `FAILED_PRECONDITION`, `reason: 'own-repo'`, when the default `id` is `repo` itself, as the
|
|
58
58
|
* holder's own repo is (Q327).
|
|
59
59
|
*/
|
|
60
|
-
readonly create: (repo: RepoName, input: ForkCreateInput) =>
|
|
60
|
+
readonly create: (repo: RepoName, input: ForkCreateInput) => Effect.Effect<RepoInfo, GitError>;
|
|
61
61
|
/** The holder's fork of `repo`, by the source's internal ID, across either's renames. */
|
|
62
|
-
readonly get: (repo: RepoName, input: ForkGetInput) =>
|
|
62
|
+
readonly get: (repo: RepoName, input: ForkGetInput) => Effect.Effect<RepoInfo, GitError>;
|
|
63
63
|
/**
|
|
64
64
|
* `repo`'s live forks, the newest first, each named as it's named now. A fork the caller may not
|
|
65
65
|
* read is left out, and nothing counts it, so a page can be short while `next` says more may
|
|
66
66
|
* follow. Each `next` is sealed for this source's list and names no fork, and one that isn't a
|
|
67
|
-
* `next` of it is `INVALID_ARGUMENT`.
|
|
67
|
+
* `next` of it is `INVALID_ARGUMENT`. Unlike `Repos.list`'s names, each fork is read again
|
|
68
|
+
* once `authorize` answers, and one renamed or made public or private meanwhile is asked of again
|
|
69
|
+
* as it is now, so none is listed as it was.
|
|
68
70
|
*/
|
|
69
|
-
readonly list: (repo: RepoName, input: ForkListInput) =>
|
|
71
|
+
readonly list: (repo: RepoName, input: ForkListInput) => Effect.Effect<Listing<RepoInfo>, GitError>;
|
|
70
72
|
/**
|
|
71
73
|
* Fast-forwards the fork's default branch to its source's, in one commit that takes the
|
|
72
74
|
* source's list as `create` does, and leaves its other refs alone. A fork whose branch has
|
|
@@ -76,7 +78,7 @@ export interface ForkCalls {
|
|
|
76
78
|
* A fork whose default branch, or its source's, the caller can't see is `FAILED_PRECONDITION`,
|
|
77
79
|
* naming neither, the same whether or not the branch exists.
|
|
78
80
|
*/
|
|
79
|
-
readonly sync: (fork: RepoName, input: WriteInput & Pick<RepoInput, 'internalId'>) =>
|
|
81
|
+
readonly sync: (fork: RepoName, input: WriteInput & Pick<RepoInput, 'internalId'>) => Effect.Effect<RepoInfo, GitError>;
|
|
80
82
|
/**
|
|
81
83
|
* Copies every object its source lists into the fork, as `sync` does, and moves no ref, as
|
|
82
84
|
* `git fetch upstream` does: the caller decides the move, such as `merges.create` of a diverged
|
|
@@ -92,14 +94,15 @@ export interface ForkCalls {
|
|
|
92
94
|
* leaves no ref at a missing object. Refused as `sync` is, but never `diverged`, nor for a
|
|
93
95
|
* default branch the caller can't see: `head` is left out instead.
|
|
94
96
|
*/
|
|
95
|
-
readonly fetch: (fork: RepoName, input: ActorInput & Pick<RepoInput, 'internalId'>) =>
|
|
97
|
+
readonly fetch: (fork: RepoName, input: ActorInput & Pick<RepoInput, 'internalId'>) => Effect.Effect<ForkFetched, GitError>;
|
|
96
98
|
}
|
|
97
99
|
declare const Forks_base: Context.ServiceClass<Forks, "@ref0/git/Forks", EffectCalls<{
|
|
98
|
-
readonly create: (repo: string, input: ForkCreateInput, by?: Caller<unknown> | undefined) =>
|
|
100
|
+
readonly create: (repo: string, input: ForkCreateInput, by?: Caller<unknown> | undefined) => Effect.Effect<{
|
|
99
101
|
readonly name: string;
|
|
100
102
|
readonly defaultBranch?: string;
|
|
101
103
|
readonly public: boolean;
|
|
102
104
|
readonly upstream?: string;
|
|
105
|
+
readonly shallow: boolean;
|
|
103
106
|
readonly stats: {
|
|
104
107
|
readonly repo: string;
|
|
105
108
|
readonly refs: number;
|
|
@@ -121,12 +124,13 @@ declare const Forks_base: Context.ServiceClass<Forks, "@ref0/git/Forks", EffectC
|
|
|
121
124
|
readonly state: "too-large";
|
|
122
125
|
};
|
|
123
126
|
};
|
|
124
|
-
}
|
|
125
|
-
readonly get: (repo: string, input: ForkGetInput, by?: Caller<unknown> | undefined) =>
|
|
127
|
+
}, GitError, never>;
|
|
128
|
+
readonly get: (repo: string, input: ForkGetInput, by?: Caller<unknown> | undefined) => Effect.Effect<{
|
|
126
129
|
readonly name: string;
|
|
127
130
|
readonly defaultBranch?: string;
|
|
128
131
|
readonly public: boolean;
|
|
129
132
|
readonly upstream?: string;
|
|
133
|
+
readonly shallow: boolean;
|
|
130
134
|
readonly stats: {
|
|
131
135
|
readonly repo: string;
|
|
132
136
|
readonly refs: number;
|
|
@@ -148,12 +152,13 @@ declare const Forks_base: Context.ServiceClass<Forks, "@ref0/git/Forks", EffectC
|
|
|
148
152
|
readonly state: "too-large";
|
|
149
153
|
};
|
|
150
154
|
};
|
|
151
|
-
}
|
|
152
|
-
readonly list: (repo: string, input: ForkListInput, by?: Caller<unknown> | undefined) =>
|
|
155
|
+
}, GitError, never>;
|
|
156
|
+
readonly list: (repo: string, input: ForkListInput, by?: Caller<unknown> | undefined) => Effect.Effect<Listing<{
|
|
153
157
|
readonly name: string;
|
|
154
158
|
readonly defaultBranch?: string;
|
|
155
159
|
readonly public: boolean;
|
|
156
160
|
readonly upstream?: string;
|
|
161
|
+
readonly shallow: boolean;
|
|
157
162
|
readonly stats: {
|
|
158
163
|
readonly repo: string;
|
|
159
164
|
readonly refs: number;
|
|
@@ -175,12 +180,13 @@ declare const Forks_base: Context.ServiceClass<Forks, "@ref0/git/Forks", EffectC
|
|
|
175
180
|
readonly state: "too-large";
|
|
176
181
|
};
|
|
177
182
|
};
|
|
178
|
-
}
|
|
179
|
-
readonly sync: (fork: string, input: WriteInput<unknown> & Pick<RepoInput, "internalId">, by?: Caller<unknown> | undefined) =>
|
|
183
|
+
}>, GitError, never>;
|
|
184
|
+
readonly sync: (fork: string, input: WriteInput<unknown> & Pick<RepoInput, "internalId">, by?: Caller<unknown> | undefined) => Effect.Effect<{
|
|
180
185
|
readonly name: string;
|
|
181
186
|
readonly defaultBranch?: string;
|
|
182
187
|
readonly public: boolean;
|
|
183
188
|
readonly upstream?: string;
|
|
189
|
+
readonly shallow: boolean;
|
|
184
190
|
readonly stats: {
|
|
185
191
|
readonly repo: string;
|
|
186
192
|
readonly refs: number;
|
|
@@ -202,15 +208,15 @@ declare const Forks_base: Context.ServiceClass<Forks, "@ref0/git/Forks", EffectC
|
|
|
202
208
|
readonly state: "too-large";
|
|
203
209
|
};
|
|
204
210
|
};
|
|
205
|
-
}
|
|
206
|
-
readonly fetch: (fork: string, input: ActorInput<unknown> & Pick<RepoInput, "internalId">, by?: Caller<unknown> | undefined) =>
|
|
211
|
+
}, GitError, never>;
|
|
212
|
+
readonly fetch: (fork: string, input: ActorInput<unknown> & Pick<RepoInput, "internalId">, by?: Caller<unknown> | undefined) => Effect.Effect<{
|
|
207
213
|
readonly source: string;
|
|
208
214
|
readonly head?: string;
|
|
209
215
|
readonly tips: readonly {
|
|
210
216
|
readonly name: string;
|
|
211
217
|
readonly oid: string;
|
|
212
218
|
}[];
|
|
213
|
-
}
|
|
219
|
+
}, GitError, never>;
|
|
214
220
|
}, never>>;
|
|
215
221
|
/**
|
|
216
222
|
* A repo's forks: made, read, listed, and synced with or fetched from their parent. `ForkCalls` as Effects, each deciding for `by`. The server builds it inside its runtime's
|
|
@@ -222,6 +228,7 @@ export declare const create: (repo: RepoName, input: ForkCreateInput, by?: Calle
|
|
|
222
228
|
readonly defaultBranch?: string;
|
|
223
229
|
readonly public: boolean;
|
|
224
230
|
readonly upstream?: string;
|
|
231
|
+
readonly shallow: boolean;
|
|
225
232
|
readonly stats: {
|
|
226
233
|
readonly repo: string;
|
|
227
234
|
readonly refs: number;
|
|
@@ -249,6 +256,7 @@ export declare const get: (repo: RepoName, input: ForkGetInput, by?: Caller) =>
|
|
|
249
256
|
readonly defaultBranch?: string;
|
|
250
257
|
readonly public: boolean;
|
|
251
258
|
readonly upstream?: string;
|
|
259
|
+
readonly shallow: boolean;
|
|
252
260
|
readonly stats: {
|
|
253
261
|
readonly repo: string;
|
|
254
262
|
readonly refs: number;
|
|
@@ -276,6 +284,7 @@ export declare const list: (repo: RepoName, input: ForkListInput, by?: Caller) =
|
|
|
276
284
|
readonly defaultBranch?: string;
|
|
277
285
|
readonly public: boolean;
|
|
278
286
|
readonly upstream?: string;
|
|
287
|
+
readonly shallow: boolean;
|
|
279
288
|
readonly stats: {
|
|
280
289
|
readonly repo: string;
|
|
281
290
|
readonly refs: number;
|
|
@@ -303,6 +312,7 @@ export declare const sync: (fork: RepoName, input: WriteInput & Pick<RepoInput,
|
|
|
303
312
|
readonly defaultBranch?: string;
|
|
304
313
|
readonly public: boolean;
|
|
305
314
|
readonly upstream?: string;
|
|
315
|
+
readonly shallow: boolean;
|
|
306
316
|
readonly stats: {
|
|
307
317
|
readonly repo: string;
|
|
308
318
|
readonly refs: number;
|
|
@@ -2,7 +2,7 @@ import { GitEvent } from "./events.mjs";
|
|
|
2
2
|
import { SavedHandlerOptions } from "./handlers.mjs";
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
declare namespace git_events_d_exports {
|
|
5
|
-
export { DeliveryOptions, EventType, Group, GroupHandler, Handlers, Run, group };
|
|
5
|
+
export { DeliveryOptions, EventType, EventsOptions, Group, GroupHandler, Handlers, Run, group };
|
|
6
6
|
}
|
|
7
7
|
/** An event's type, such as `ref.updated`. */
|
|
8
8
|
export type EventType = GitEvent['type'];
|
|
@@ -19,6 +19,34 @@ export interface Run<Event extends GitEvent = GitEvent> {
|
|
|
19
19
|
* at most for three days by default.
|
|
20
20
|
*/
|
|
21
21
|
export type DeliveryOptions = Omit<SavedHandlerOptions<unknown>, 'handler'>;
|
|
22
|
+
/**
|
|
23
|
+
* The host's events settings, `Git.layer`'s `events`. `retired` names each delivery the host has
|
|
24
|
+
* dropped for good, at most 64, `retiredLimit`, each under a delivery name's rules. Once each
|
|
25
|
+
* instance is live, it writes the list as its rows in `git/repos`, and deletes the row of a name
|
|
26
|
+
* the list no longer holds, till the write lands or a later start's does. The store orders the
|
|
27
|
+
* starts: a start whose write lands after a later start's writes nothing, and so does one whose
|
|
28
|
+
* list the rows already hold. A name it runs through `Git.addDelivery` too fails the start.
|
|
29
|
+
*
|
|
30
|
+
* A deleted repo's `git.purge` waits on the job of a delivery the server doesn't run, as on any
|
|
31
|
+
* delivery's, until a retirement row names it: then it claims and ends the job, unless a try of it
|
|
32
|
+
* runs. A restore, a start that runs the delivery again, takes effect when its write lands: a
|
|
33
|
+
* purge's end decided before then stands, and a settle it decided can still land after.
|
|
34
|
+
*
|
|
35
|
+
* Never change a name here and its `Git.addDelivery` in the same deploy (#2602). Mid-rollout, the
|
|
36
|
+
* start whose write lands last wins, whatever its list, so an instance that still runs the delivery
|
|
37
|
+
* could find it retired. To retire one, a deploy drops its `Git.addDelivery`, and once that deploy
|
|
38
|
+
* has rolled out, the next adds its name here. A queue claims only the jobs of the deliveries it
|
|
39
|
+
* registers, so an instance that still registers it, mid-deploy, goes on sending to it until it
|
|
40
|
+
* restarts.
|
|
41
|
+
*
|
|
42
|
+
* Retiring gives up what the delivery was owed: the purge settles its job unsent, `repo.deleted`
|
|
43
|
+
* included, and deletes the repo's events. To run it again, a deploy drops its name here, and once
|
|
44
|
+
* that has rolled out, the next adds its `Git.addDelivery` back: it then sends what the repos that
|
|
45
|
+
* remain owe it, and never what a purge settled while it was retired.
|
|
46
|
+
*/
|
|
47
|
+
export interface EventsOptions {
|
|
48
|
+
readonly retired?: readonly string[];
|
|
49
|
+
}
|
|
22
50
|
/** One handler of a group: the types it takes, and what it runs for a run of them. */
|
|
23
51
|
export interface GroupHandler<R> {
|
|
24
52
|
readonly types: ReadonlySet<EventType>;
|
package/dist/contracts/git.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Caller } from "./actors.mjs";
|
|
2
|
+
import { CallAllowance } from "./call-allowance.mjs";
|
|
2
3
|
import { TreeChange } from "./engine.mjs";
|
|
3
4
|
import { DeliveryOptions, Group } from "./git-events.mjs";
|
|
4
5
|
import { GrantResolver } from "./grants.mjs";
|
|
@@ -12,11 +13,13 @@ import * as Option from "effect/Option";
|
|
|
12
13
|
import { Committed, CurrentJob, Job, Key, Moment, Read, Records, Row, WatchedRow } from "@ref0/infra";
|
|
13
14
|
import * as Context from "effect/Context";
|
|
14
15
|
import * as Stream from "effect/Stream";
|
|
16
|
+
import * as Duration from "effect/Duration";
|
|
15
17
|
/**
|
|
16
18
|
* The host, acting as itself (Q223): the caller host code's calls name, as `hostCalls()` do. A
|
|
17
19
|
* call made by it skips the host's `authorize`, but for a push rule's bypass, sees every ref,
|
|
18
|
-
* private or not,
|
|
19
|
-
* caller built to look like it, is an anonymous
|
|
20
|
+
* private or not, but an owned prefix's, which only its owner reads, and lists every repo. Only
|
|
21
|
+
* this one value is the host: a copy of it, or any caller built to look like it, is an anonymous
|
|
22
|
+
* caller, refused what a stranger is.
|
|
20
23
|
*/
|
|
21
24
|
export declare const host: Caller;
|
|
22
25
|
/** Whether `caller` is `host` itself, the one value that is. */
|
|
@@ -40,11 +43,19 @@ export interface RegisterInput {
|
|
|
40
43
|
*/
|
|
41
44
|
readonly repoScopes?: (repo: InternalRepoId) => readonly string[];
|
|
42
45
|
/**
|
|
43
|
-
* A registered prefix, such as `refs/queue/`: a ref under it only the registration moves, and
|
|
44
|
-
* caller who reads every private pattern sees
|
|
45
|
-
*
|
|
46
|
+
* A registered prefix, such as `refs/queue/`: a ref under it only the registration moves, and
|
|
47
|
+
* only a caller who reads every private pattern sees, or with `refsReadBy: 'owner'` only the
|
|
48
|
+
* registration. No two registrations' prefixes overlap, none overlaps Git's own `refs/import/`,
|
|
49
|
+
* and none is under `refs/heads/` or `refs/tags/`.
|
|
46
50
|
*/
|
|
47
51
|
readonly refs?: `refs/${string}/`;
|
|
52
|
+
/**
|
|
53
|
+
* Who reads `refs`' refs. `readers`, when left out: a caller who reads every private pattern, as
|
|
54
|
+
* above. `owner`: the registration alone, with its `owner` on `refs.get`. No listing, count,
|
|
55
|
+
* fetch, fork or other `refs.get` shows one, whatever the caller reads, such as the drop-in's
|
|
56
|
+
* merge fences. Given with no `refs`, it fails the build.
|
|
57
|
+
*/
|
|
58
|
+
readonly refsReadBy?: 'readers' | 'owner';
|
|
48
59
|
/**
|
|
49
60
|
* Prefixes whose refs `Git.host` writes for someone with `refs.update`'s `onBehalfOf`, such as
|
|
50
61
|
* `refs/pull/`: every reader of the repo sees them, and anyone with push may move them too. Each
|
|
@@ -54,8 +65,10 @@ export interface RegisterInput {
|
|
|
54
65
|
readonly publishes?: readonly `refs/${string}/`[];
|
|
55
66
|
}
|
|
56
67
|
/**
|
|
57
|
-
* What only a registered prefix's owner holds: it moves the prefix's refs, which no one else
|
|
58
|
-
*
|
|
68
|
+
* What only a registered prefix's owner holds: it moves the prefix's refs, which no one else does,
|
|
69
|
+
* and reads them through any view. An owned prefix's, registered with `refsReadBy: 'owner'`, no
|
|
70
|
+
* one else reads either. Only Git's registry makes one, as a registration's `owner`: a copy of it
|
|
71
|
+
* owns nothing.
|
|
59
72
|
*/
|
|
60
73
|
export interface RefOwner {
|
|
61
74
|
readonly prefix: `refs/${string}/`;
|
|
@@ -201,6 +214,25 @@ export interface Registration {
|
|
|
201
214
|
readonly rows: RegisteredRows;
|
|
202
215
|
/** Charged records held to the registration's scopes; failures are GitError, outside access a defect. */
|
|
203
216
|
readonly records: RegisteredRecords;
|
|
217
|
+
/** The server's `basePath`, which Git's routes and a registration's own sit beneath: `''` at the root. */
|
|
218
|
+
readonly basePath: string;
|
|
219
|
+
/**
|
|
220
|
+
* The server's `fetchLimits.milliseconds`: core's purge drops a deleted repo's scopes, the
|
|
221
|
+
* registration's among them, no sooner than this past the delete, so a write that read the repo
|
|
222
|
+
* live and lands by `heldUntil` lands before the drop.
|
|
223
|
+
*/
|
|
224
|
+
readonly fetchWindow: Duration.Duration;
|
|
225
|
+
/**
|
|
226
|
+
* Adds `check` to `Git.layer`'s seal, which runs it once every feature has built, after the push
|
|
227
|
+
* rules' sources and before any job registers: a check that dies fails the build with its defect.
|
|
228
|
+
*/
|
|
229
|
+
readonly addSealCheck: (check: Effect.Effect<void>) => Effect.Effect<void>;
|
|
230
|
+
/**
|
|
231
|
+
* A fresh budget for one request the registration serves, counting from its first call against
|
|
232
|
+
* the adapter's whole `callLimits`, as Git's REST counts one. Provided as `CallBudget`, it nests
|
|
233
|
+
* every call the request makes.
|
|
234
|
+
*/
|
|
235
|
+
readonly allowance: () => CallAllowance;
|
|
204
236
|
readonly addPushCheck: (check: Hook<PushCheck>) => Effect.Effect<void>;
|
|
205
237
|
/**
|
|
206
238
|
* The registration's one delivery, named after it, its job `git.deliver.<registration name>`: `group`'s
|
package/dist/contracts/git.mjs
CHANGED
|
@@ -4,8 +4,9 @@ import * as Context from "effect/Context";
|
|
|
4
4
|
/**
|
|
5
5
|
* The host, acting as itself (Q223): the caller host code's calls name, as `hostCalls()` do. A
|
|
6
6
|
* call made by it skips the host's `authorize`, but for a push rule's bypass, sees every ref,
|
|
7
|
-
* private or not,
|
|
8
|
-
* caller built to look like it, is an anonymous
|
|
7
|
+
* private or not, but an owned prefix's, which only its owner reads, and lists every repo. Only
|
|
8
|
+
* this one value is the host: a copy of it, or any caller built to look like it, is an anonymous
|
|
9
|
+
* caller, refused what a stranger is.
|
|
9
10
|
*/
|
|
10
11
|
const host = Object.freeze({ actor: Object.freeze({ anonymous: true }) });
|
|
11
12
|
/** Whether `caller` is `host` itself, the one value that is. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GitError } from "./result.mjs";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
2
3
|
import * as Schema from "effect/Schema";
|
|
3
4
|
export declare const GrantInput: Schema.Struct<{
|
|
4
5
|
readonly credentials: Schema.Union<readonly [Schema.Struct<{
|
|
@@ -49,7 +50,14 @@ export declare const Grant: Schema.Struct<{
|
|
|
49
50
|
* that repo from the list.
|
|
50
51
|
*/
|
|
51
52
|
readonly reach: Schema.optionalKey<Schema.String>;
|
|
52
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Whether this grant reaches `input.repo`. Runs in the caller's fiber, so ordinary fiber
|
|
55
|
+
* interruption stops its reads; implementers must also honour `input.signal` (including one
|
|
56
|
+
* already aborted), stop reading, and fail with a typed `UNAVAILABLE` `GitError` on abort
|
|
57
|
+
* (for example, failing immediately when `input.signal.aborted` and otherwise racing the read
|
|
58
|
+
* against an `Effect.callback` listening for `'abort'` with `Effect.raceFirst`).
|
|
59
|
+
*/
|
|
60
|
+
readonly reaches: Schema.declare<(input: GrantReachInput) => Effect.Effect<boolean, GitError>, (input: GrantReachInput) => Effect.Effect<boolean, GitError>>;
|
|
53
61
|
}>;
|
|
54
62
|
export type Grant = typeof Grant.Type;
|
|
55
63
|
/** A grant asked for again by the `id` it had, with the actor and subject it acted as then. */
|
|
@@ -79,6 +87,18 @@ export type GrantAgainRequest = Omit<GrantAgainInput, 'signal'> & {
|
|
|
79
87
|
*/
|
|
80
88
|
export interface GrantResolver {
|
|
81
89
|
readonly name: string;
|
|
82
|
-
|
|
83
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Runs in the caller's fiber, so ordinary fiber interruption stops its reads; implementers must
|
|
92
|
+
* also honour `input.signal` (including one already aborted), stop reading, and fail with a
|
|
93
|
+
* typed `UNAVAILABLE` `GitError` on abort (for example, failing immediately when
|
|
94
|
+
* `input.signal.aborted` and otherwise racing the read against an `Effect.callback` listening
|
|
95
|
+
* for `'abort'` with `Effect.raceFirst`).
|
|
96
|
+
*/
|
|
97
|
+
readonly resolve: (input: GrantInput) => Effect.Effect<Grant | undefined, GitError>;
|
|
98
|
+
/**
|
|
99
|
+
* Runs in the caller's fiber, with the same `input.signal` contract as `resolve`: honour an
|
|
100
|
+
* already-aborted or later-aborted signal, stop reading, and fail with a typed `UNAVAILABLE`
|
|
101
|
+
* `GitError`.
|
|
102
|
+
*/
|
|
103
|
+
readonly again: (input: GrantAgainInput) => Effect.Effect<Grant | undefined, GitError>;
|
|
84
104
|
}
|
package/dist/contracts/lfs.d.mts
CHANGED
|
@@ -2,8 +2,9 @@ import { ActorInput } from "./actors.mjs";
|
|
|
2
2
|
import { RepoName } from "./ids.mjs";
|
|
3
3
|
import "./objects.mjs";
|
|
4
4
|
import { RepoInput } from "./repos.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { GitError } from "./result.mjs";
|
|
6
6
|
import { Bytes } from "./object-values.mjs";
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
7
8
|
/**
|
|
8
9
|
* The caps an upload through the server meets, on a bucket that signs no links, so each upload's
|
|
9
10
|
* bytes stream through it: an upload past what they let finish is refused at the batch, 422, and
|
|
@@ -17,13 +18,6 @@ export interface LfsOptions {
|
|
|
17
18
|
/** The CPU one of the host's requests may use, in milliseconds, as a Worker's `limits.cpu_ms`. */
|
|
18
19
|
readonly cpuMs?: number;
|
|
19
20
|
}
|
|
20
|
-
/**
|
|
21
|
-
* Turns on Git LFS: `lfs()`, from `@ref0/git`, which `createGitServer` builds `Lfs.layer()` for,
|
|
22
|
-
* with its options. A bucket alone turns nothing on.
|
|
23
|
-
*/
|
|
24
|
-
export interface LfsFeature extends LfsOptions {
|
|
25
|
-
readonly kind: 'lfs';
|
|
26
|
-
}
|
|
27
21
|
/** An LFS object, by its oid, the SHA-256 of its bytes in 64 hex digits. */
|
|
28
22
|
export interface LfsGetInput extends ActorInput, Pick<RepoInput, 'internalId'> {
|
|
29
23
|
readonly oid: string;
|
|
@@ -32,6 +26,20 @@ export interface LfsGetInput extends ActorInput, Pick<RepoInput, 'internalId'> {
|
|
|
32
26
|
/** The HTTP request the read serves, which the host's fetch rules see: none for a direct read. */
|
|
33
27
|
readonly request?: Request | undefined;
|
|
34
28
|
}
|
|
29
|
+
/** LFS objects, each by the oid and size its pointer names: 1 to 1,000, duplicates allowed. */
|
|
30
|
+
export interface LfsGetManyInput extends ActorInput, Pick<RepoInput, 'internalId'> {
|
|
31
|
+
readonly objects: readonly {
|
|
32
|
+
readonly oid: string;
|
|
33
|
+
readonly size: number;
|
|
34
|
+
}[];
|
|
35
|
+
/**
|
|
36
|
+
* What ends the handle: its owner aborts it when the work the read serves ends, answered or not,
|
|
37
|
+
* and an open after it, or opening as it comes, fails `handle-ended`.
|
|
38
|
+
*/
|
|
39
|
+
readonly signal: AbortSignal;
|
|
40
|
+
/** The HTTP request the read serves, which the host's fetch rules see: none for a direct read. */
|
|
41
|
+
readonly request?: Request | undefined;
|
|
42
|
+
}
|
|
35
43
|
/** An LFS object: its oid, its size in bytes, and its bytes, streamed from the bucket. */
|
|
36
44
|
export interface LfsObject {
|
|
37
45
|
readonly oid: string;
|
|
@@ -46,5 +54,16 @@ export interface LfsCalls {
|
|
|
46
54
|
* or on a server without `Lfs.layer()`; `DATA_LOSS` for a listed object whose bytes are gone. `signal`
|
|
47
55
|
* aborted cancels the bucket's stream.
|
|
48
56
|
*/
|
|
49
|
-
readonly get: (repo: RepoName, input: LfsGetInput) =>
|
|
57
|
+
readonly get: (repo: RepoName, input: LfsGetInput) => Effect.Effect<LfsObject, GitError>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* What `Lfs.getMany` answered: `readable`, each object the caller may read, by its oid and size,
|
|
61
|
+
* in the order asked, and `open`, which reads one of them from the bucket.
|
|
62
|
+
*/
|
|
63
|
+
export interface LfsObjects {
|
|
64
|
+
readonly readable: readonly {
|
|
65
|
+
readonly oid: string;
|
|
66
|
+
readonly size: number;
|
|
67
|
+
}[];
|
|
68
|
+
readonly open: (oid: string) => Effect.Effect<LfsObject, GitError>;
|
|
50
69
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { WriteInput } from "./actors.mjs";
|
|
2
2
|
import { RepoName } from "./ids.mjs";
|
|
3
3
|
import { RepoInput } from "./repos.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { GitError } from "./result.mjs";
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
5
6
|
import * as Schema from "effect/Schema";
|
|
6
7
|
/**
|
|
7
8
|
* `git merge --no-ff <theirs>` on the branch `ours`, published there: a merge commit whose
|
|
@@ -81,5 +82,5 @@ export declare const MergeAnswer: Schema.Union<readonly [Schema.Struct<{
|
|
|
81
82
|
export type MergeAnswer = typeof MergeAnswer.Type;
|
|
82
83
|
export interface MergeCalls {
|
|
83
84
|
/** A conflict fails `FAILED_PRECONDITION` with `merge-conflict`, and writes nothing. */
|
|
84
|
-
readonly create: (repo: RepoName, input: MergeCreateInput) =>
|
|
85
|
+
readonly create: (repo: RepoName, input: MergeCreateInput) => Effect.Effect<MergeAnswer, GitError>;
|
|
85
86
|
}
|