@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,6 +1,6 @@
|
|
|
1
1
|
import { Operation } from "./operations.mjs";
|
|
2
2
|
import { RefAudience } from "./access.mjs";
|
|
3
|
-
import { Accepted,
|
|
3
|
+
import { Accepted, DecisionAnswer } from "./result.mjs";
|
|
4
4
|
import { TokenInfo } from "./tokens.mjs";
|
|
5
5
|
import * as Schema from "effect/Schema";
|
|
6
6
|
/**
|
|
@@ -124,8 +124,6 @@ export declare const AuthInput: Schema.Struct<{
|
|
|
124
124
|
readonly signal: Schema.declare<AbortSignal, AbortSignal>;
|
|
125
125
|
}>;
|
|
126
126
|
export type AuthInput = typeof AuthInput.Type;
|
|
127
|
-
/** Who is calling: `undefined` for a credential it doesn't know. */
|
|
128
|
-
export type GitAuth<Meta = unknown> = (input: AuthInput) => Awaitable<Actor<Meta> | undefined>;
|
|
129
127
|
/**
|
|
130
128
|
* The extension's grant resolver that identified a caller, by its `name`, for reading only: Git
|
|
131
129
|
* never trusts it, so a caller built by hand with it is a plain caller. To keep a caller's grant,
|
|
@@ -173,35 +171,5 @@ export type AuthorizeInput<Meta = unknown> = Acting<Meta> & {
|
|
|
173
171
|
readonly repo?: RepoAccess;
|
|
174
172
|
readonly signal: AbortSignal;
|
|
175
173
|
};
|
|
176
|
-
/**
|
|
177
|
-
* Whether they may. A merge queue's publish asks again, for each entry, as the caller that added
|
|
178
|
-
* it, with `at: 'queued'` and no actor `meta`: decide it from the actor's ID, and never grant on
|
|
179
|
-
* `meta`'s absence.
|
|
180
|
-
*
|
|
181
|
-
* A refusal reaches the caller exactly as it's returned when it names a code of
|
|
182
|
-
* its own, such as `FAILED_PRECONDITION`: Git can't tell who may know a repo exists, so it passes
|
|
183
|
-
* that code on. The default refusal, `reject` with no code, `NOT_ALLOWED` or `NOT_FOUND`, answers
|
|
184
|
-
* a stranger as for a repo that isn't there: `UNAUTHENTICATED` when anonymous, so Git asks to sign
|
|
185
|
-
* in, and `NOT_FOUND` when signed in. A refusal of anything but a read or a create, whatever its code,
|
|
186
|
-
* reaches only a caller you'd let read the repo; anyone else gets your answer to a read, and a
|
|
187
|
-
* name with no repo answers as a read of it would. So return the
|
|
188
|
-
* default refusal to anyone who may not know a private repo exists, and a code of your own only
|
|
189
|
-
* to a caller who may.
|
|
190
|
-
*
|
|
191
|
-
* A `token.create` names whom the token is for, its `subject`, and any `actor` acting for them,
|
|
192
|
-
* since a token's caller is its subject: refuse one a caller mints for anyone they may not act as.
|
|
193
|
-
* Decided 21 Nov by the coordinator.
|
|
194
|
-
*
|
|
195
|
-
* A `refs.private` operation, asked only of a server made with `access`, is accepted with the
|
|
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.
|
|
200
|
-
*
|
|
201
|
-
* Decide about a repo by its `repo.internalId`, the repo the call then acts on. A name can move
|
|
202
|
-
* between repos while you decide: swap two repos' names and back around one call, and a host that
|
|
203
|
-
* decides by `repo.name` alone answers about the other repo (the coordinator, Q871, 25 Nov).
|
|
204
|
-
*/
|
|
205
|
-
export type GitAuthorize<Meta = unknown> = (input: AuthorizeInput<Meta>) => Awaitable<AuthorizeAnswer>;
|
|
206
|
-
/** What `authorize` answers: a decision, or for `refs.private`, the caller's ref audience. */
|
|
174
|
+
/** What a `Policy` answers: a decision, or for `refs.private`, the caller's ref audience. */
|
|
207
175
|
export type AuthorizeAnswer = DecisionAnswer | Accepted<RefAudience>;
|
|
@@ -1,15 +1,15 @@
|
|
|
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 { ReadOptions } from "./engine.mjs";
|
|
5
4
|
import { Oid, RepoName } from "./ids.mjs";
|
|
6
5
|
import { Bytes } from "./object-values.mjs";
|
|
7
6
|
import { RepoInput } from "./repos.mjs";
|
|
7
|
+
import { GitError } from "./result.mjs";
|
|
8
8
|
import * as Effect from "effect/Effect";
|
|
9
9
|
import * as Schema from "effect/Schema";
|
|
10
10
|
import * as Context from "effect/Context";
|
|
11
11
|
declare namespace blobs_d_exports {
|
|
12
|
-
export { Acting, Blob, BlobCalls, BlobCreateInput, Blobs, CreatedObject, ObjectInput, create, get };
|
|
12
|
+
export { Acting, Blob, BlobCalls, BlobCreateInput, Blobs, BlobsRead, CreatedObject, GetMany, GetManyInput, ObjectInput, create, get, getMany };
|
|
13
13
|
}
|
|
14
14
|
/** A call's input with the actor it acts for, and the repo it resolved its first argument to. */
|
|
15
15
|
export type Acting<Input> = Input & ActorInput & Pick<RepoInput, 'internalId'>;
|
|
@@ -24,6 +24,25 @@ export declare const Blob: Schema.Struct<{
|
|
|
24
24
|
readonly bytes: Schema.declare<ReadableStream<Uint8Array<ArrayBufferLike>>, ReadableStream<Uint8Array<ArrayBufferLike>>>;
|
|
25
25
|
}>;
|
|
26
26
|
export type Blob = typeof Blob.Type;
|
|
27
|
+
/** Blobs by their IDs: 1 to `objectsReadMost`, duplicates allowed; another count fails `INVALID_ARGUMENT`. */
|
|
28
|
+
export declare const GetMany: Schema.Struct<{
|
|
29
|
+
readonly oids: Schema.$Array<Schema.String>;
|
|
30
|
+
}>;
|
|
31
|
+
export type GetMany = typeof GetMany.Type;
|
|
32
|
+
export interface GetManyInput extends ReadOptions, GetMany {}
|
|
33
|
+
/**
|
|
34
|
+
* What `blobs.getMany` read: `blobs` then `left` is `oids`, in the order asked. `left` is the
|
|
35
|
+
* tail past what the call may hold at once, which `blobs.get` reads a blob at a time.
|
|
36
|
+
*/
|
|
37
|
+
export declare const BlobsRead: Schema.Struct<{
|
|
38
|
+
readonly blobs: Schema.$Array<Schema.Struct<{
|
|
39
|
+
readonly oid: Schema.String;
|
|
40
|
+
readonly size: Schema.Int;
|
|
41
|
+
readonly bytes: Schema.declare<ReadableStream<Uint8Array<ArrayBufferLike>>, ReadableStream<Uint8Array<ArrayBufferLike>>>;
|
|
42
|
+
}>>;
|
|
43
|
+
readonly left: Schema.$Array<Schema.String>;
|
|
44
|
+
}>;
|
|
45
|
+
export type BlobsRead = typeof BlobsRead.Type;
|
|
27
46
|
/** A blob's bytes, up to 16 MiB, read whole before it's written. */
|
|
28
47
|
export interface BlobCreateInput extends WriteInput, Pick<RepoInput, 'internalId'> {
|
|
29
48
|
readonly bytes: Bytes;
|
|
@@ -36,24 +55,44 @@ export type CreatedObject = typeof CreatedObject.Type;
|
|
|
36
55
|
export interface BlobCalls {
|
|
37
56
|
/**
|
|
38
57
|
* Any blob the repo holds, its `bytes` streamed and checked against its ID as they go: a
|
|
39
|
-
* mismatch errors the stream with `DATA_LOSS`. Its `bytes` limit has no default, so the
|
|
40
|
-
*
|
|
58
|
+
* mismatch errors the stream with `DATA_LOSS`. Its `bytes` limit has no default, so the largest
|
|
59
|
+
* file a host may let a push take, 1 GiB, caps it. `RESOURCE_EXHAUSTED` with `object-too-large` comes before the first
|
|
41
60
|
* byte for a blob past the `bytes` limit the caller sets, or one stored as a delta past 16 MiB.
|
|
42
61
|
* `milliseconds` limits the call until it answers, not the stream after it.
|
|
43
62
|
*/
|
|
44
|
-
readonly get: (repo: RepoName, input: Acting<ObjectInput>) =>
|
|
63
|
+
readonly get: (repo: RepoName, input: Acting<ObjectInput>) => Effect.Effect<Blob, GitError>;
|
|
64
|
+
/**
|
|
65
|
+
* Blobs by their IDs, read in one opened repo, a batch of whole objects at a time: `blobs` then
|
|
66
|
+
* `left` is `oids`, in the order asked, a duplicate answered at each of its places. `left` is
|
|
67
|
+
* the tail past what the call may hold at once, the `bytes` limit when the caller sets it, which
|
|
68
|
+
* `get` reads a blob at a time; at least the first blob is always answered. 1 to
|
|
69
|
+
* `objectsReadMost` IDs; an ID the repo lacks, or the caller can't see, fails the call
|
|
70
|
+
* `NOT_FOUND`, and one that isn't a blob `INVALID_ARGUMENT`, each checked as it's read: one in
|
|
71
|
+
* `left` when it's read again. `milliseconds` limits the call. Read or cancel each answered
|
|
72
|
+
* blob's `bytes` within 30 s of the answer: one still unread then errors `RESOURCE_EXHAUSTED`,
|
|
73
|
+
* as the call holds what it read for them until each ends.
|
|
74
|
+
*/
|
|
75
|
+
readonly getMany: (repo: RepoName, input: Acting<GetManyInput>) => Effect.Effect<BlobsRead, GitError>;
|
|
45
76
|
/** A blob, written as its own commit: past 16 MiB `RESOURCE_EXHAUSTED` with `object-too-large`. */
|
|
46
|
-
readonly create: (repo: RepoName, input: BlobCreateInput) =>
|
|
77
|
+
readonly create: (repo: RepoName, input: BlobCreateInput) => Effect.Effect<CreatedObject, GitError>;
|
|
47
78
|
}
|
|
48
79
|
declare const Blobs_base: Context.ServiceClass<Blobs, "@ref0/git/Blobs", EffectCalls<{
|
|
49
|
-
readonly get: (repo: string, input: Acting<ObjectInput>, by?: Caller<unknown> | undefined) =>
|
|
80
|
+
readonly get: (repo: string, input: Acting<ObjectInput>, by?: Caller<unknown> | undefined) => Effect.Effect<{
|
|
50
81
|
readonly oid: string;
|
|
51
82
|
readonly size: number;
|
|
52
83
|
readonly bytes: ReadableStream<Uint8Array<ArrayBufferLike>>;
|
|
53
|
-
}
|
|
54
|
-
readonly
|
|
84
|
+
}, GitError, never>;
|
|
85
|
+
readonly getMany: (repo: string, input: Acting<GetManyInput>, by?: Caller<unknown> | undefined) => Effect.Effect<{
|
|
86
|
+
readonly blobs: readonly {
|
|
87
|
+
readonly oid: string;
|
|
88
|
+
readonly size: number;
|
|
89
|
+
readonly bytes: ReadableStream<Uint8Array<ArrayBufferLike>>;
|
|
90
|
+
}[];
|
|
91
|
+
readonly left: readonly string[];
|
|
92
|
+
}, GitError, never>;
|
|
93
|
+
readonly create: (repo: string, input: BlobCreateInput, by?: Caller<unknown> | undefined) => Effect.Effect<{
|
|
55
94
|
readonly oid: string;
|
|
56
|
-
}
|
|
95
|
+
}, GitError, never>;
|
|
57
96
|
}, never>>;
|
|
58
97
|
/**
|
|
59
98
|
* A repo's blobs, read and written. `BlobCalls` as Effects, each deciding for `by`. The server builds it inside its runtime's
|
|
@@ -65,6 +104,14 @@ export declare const get: (repo: RepoName, input: Acting<ObjectInput>, by?: Call
|
|
|
65
104
|
readonly size: number;
|
|
66
105
|
readonly bytes: ReadableStream<Uint8Array<ArrayBufferLike>>;
|
|
67
106
|
}, GitError, Blobs>;
|
|
107
|
+
export declare const getMany: (repo: RepoName, input: Acting<GetManyInput>, by?: Caller) => Effect.Effect<{
|
|
108
|
+
readonly blobs: readonly {
|
|
109
|
+
readonly oid: string;
|
|
110
|
+
readonly size: number;
|
|
111
|
+
readonly bytes: ReadableStream<Uint8Array<ArrayBufferLike>>;
|
|
112
|
+
}[];
|
|
113
|
+
readonly left: readonly string[];
|
|
114
|
+
}, GitError, Blobs>;
|
|
68
115
|
export declare const create: (repo: RepoName, input: BlobCreateInput, by?: Caller) => Effect.Effect<{
|
|
69
116
|
readonly oid: string;
|
|
70
117
|
}, GitError, Blobs>;
|
package/dist/contracts/blobs.mjs
CHANGED
|
@@ -8,9 +8,12 @@ import * as Context from "effect/Context";
|
|
|
8
8
|
var blobs_exports = /* @__PURE__ */ __exportAll({
|
|
9
9
|
Blob: () => Blob,
|
|
10
10
|
Blobs: () => Blobs,
|
|
11
|
+
BlobsRead: () => BlobsRead,
|
|
11
12
|
CreatedObject: () => CreatedObject,
|
|
13
|
+
GetMany: () => GetMany,
|
|
12
14
|
create: () => create,
|
|
13
|
-
get: () => get
|
|
15
|
+
get: () => get,
|
|
16
|
+
getMany: () => getMany
|
|
14
17
|
});
|
|
15
18
|
/** A blob: its ID, its size in bytes, and its bytes, streamed. */
|
|
16
19
|
const Blob = /* @__PURE__ */ Schema.Struct({
|
|
@@ -18,6 +21,16 @@ const Blob = /* @__PURE__ */ Schema.Struct({
|
|
|
18
21
|
size: Schema.Int,
|
|
19
22
|
bytes: Bytes
|
|
20
23
|
});
|
|
24
|
+
/** Blobs by their IDs: 1 to `objectsReadMost`, duplicates allowed; another count fails `INVALID_ARGUMENT`. */
|
|
25
|
+
const GetMany = /* @__PURE__ */ Schema.Struct({ oids: Schema.Array(Oid) });
|
|
26
|
+
/**
|
|
27
|
+
* What `blobs.getMany` read: `blobs` then `left` is `oids`, in the order asked. `left` is the
|
|
28
|
+
* tail past what the call may hold at once, which `blobs.get` reads a blob at a time.
|
|
29
|
+
*/
|
|
30
|
+
const BlobsRead = /* @__PURE__ */ Schema.Struct({
|
|
31
|
+
blobs: Schema.Array(Blob),
|
|
32
|
+
left: Schema.Array(Oid)
|
|
33
|
+
});
|
|
21
34
|
/** An object a write made, by its ID. */
|
|
22
35
|
const CreatedObject = /* @__PURE__ */ Schema.Struct({ oid: Oid }).annotate({ identifier: "CreatedObject" });
|
|
23
36
|
/**
|
|
@@ -26,5 +39,6 @@ const CreatedObject = /* @__PURE__ */ Schema.Struct({ oid: Oid }).annotate({ ide
|
|
|
26
39
|
*/
|
|
27
40
|
var Blobs = class extends (/* @__PURE__ */ Context.Service()("@ref0/git/Blobs")) {};
|
|
28
41
|
const get = (repo, input, by) => Effect.flatMap(Effect.service(Blobs), (calls) => calls.get(repo, input, by));
|
|
42
|
+
const getMany = (repo, input, by) => Effect.flatMap(Effect.service(Blobs), (calls) => calls.getMany(repo, input, by));
|
|
29
43
|
const create = (repo, input, by) => Effect.flatMap(Effect.service(Blobs), (calls) => calls.create(repo, input, by));
|
|
30
|
-
export { Blob, Blobs, CreatedObject, blobs_exports, create, get };
|
|
44
|
+
export { Blob, Blobs, BlobsRead, CreatedObject, GetMany, blobs_exports, create, get, getMany };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CallLimits } from "@ref0/infra";
|
|
2
|
+
/**
|
|
3
|
+
* One `CallBudget`'s allowance: its limits, and its count kept in it. Only `CallBudget.make` makes
|
|
4
|
+
* one, so a budget written by hand, which would count nothing, doesn't type-check.
|
|
5
|
+
*/
|
|
6
|
+
export declare class CallAllowance {
|
|
7
|
+
#private;
|
|
8
|
+
/** The most of each kind of call the budget allows. Left out, a kind has no limit. */
|
|
9
|
+
readonly limits: CallLimits.CallLimits['Service'];
|
|
10
|
+
/** The name its spent refusal gives it, as `CallBudget.make` was given it, if any. */
|
|
11
|
+
readonly name: string | undefined;
|
|
12
|
+
private constructor();
|
|
13
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// src/contracts/call-allowance.ts
|
|
2
|
+
let hooks;
|
|
3
|
+
/** What `CallAllowance`'s constructor takes to make one: module-private, so only `make` can. */
|
|
4
|
+
const madeHere = Symbol("ref0/git CallAllowance");
|
|
5
|
+
/**
|
|
6
|
+
* One `CallBudget`'s allowance: its limits, and its count kept in it. Only `CallBudget.make` makes
|
|
7
|
+
* one, so a budget written by hand, which would count nothing, doesn't type-check.
|
|
8
|
+
*/
|
|
9
|
+
var CallAllowance = class CallAllowance {
|
|
10
|
+
/** The most of each kind of call the budget allows. Left out, a kind has no limit. */
|
|
11
|
+
limits;
|
|
12
|
+
/** The name its spent refusal gives it, as `CallBudget.make` was given it, if any. */
|
|
13
|
+
name;
|
|
14
|
+
#made;
|
|
15
|
+
#parent;
|
|
16
|
+
/** Whether it's a request's, as `requestBudget` makes one, whose commit mark outlasts a run. */
|
|
17
|
+
#request;
|
|
18
|
+
#committed = false;
|
|
19
|
+
static {
|
|
20
|
+
hooks = {
|
|
21
|
+
madeOf: (budget) => budget.#made,
|
|
22
|
+
parentOf: (budget) => budget.#parent,
|
|
23
|
+
markCommitted: (budget) => {
|
|
24
|
+
if (budget.#request) budget.#committed = true;
|
|
25
|
+
},
|
|
26
|
+
committedOf: (budget) => budget.#committed,
|
|
27
|
+
budgetOf: (limits, parent, name, request = false, shared) => new CallAllowance(madeHere, limits, parent, name, request, shared === void 0 ? void 0 : shared.#made)
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
constructor(token, limits, parent, name, request, made = {
|
|
31
|
+
bucket: 0,
|
|
32
|
+
subrequests: 0
|
|
33
|
+
}) {
|
|
34
|
+
if (token !== madeHere) throw new TypeError("A CallAllowance is made only by CallBudget.make");
|
|
35
|
+
this.limits = limits;
|
|
36
|
+
this.name = name;
|
|
37
|
+
this.#made = made;
|
|
38
|
+
this.#parent = parent;
|
|
39
|
+
this.#request = request;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
/** The hooks `store/call-count.ts` counts with, which `CallAllowance`'s definition set. */
|
|
43
|
+
const allowanceHooks = () => hooks;
|
|
44
|
+
export { CallAllowance, allowanceHooks };
|
|
@@ -145,10 +145,15 @@ const spentRefusalOf = (cause) => {
|
|
|
145
145
|
const tryUnlessSpent = (run, caught) => Effect.tryPromise({
|
|
146
146
|
try: run,
|
|
147
147
|
catch: (cause) => new Caught(cause)
|
|
148
|
-
}).pipe(Effect.catch(({ cause }) =>
|
|
148
|
+
}).pipe(Effect.catch(({ cause }) => failUnlessSpent(cause, caught)));
|
|
149
|
+
/**
|
|
150
|
+
* `cause`, a failure already in hand, as `caught` makes it, but one past a call bound, `spentAt` of
|
|
151
|
+
* it, the defect it is: `tryUnlessSpent`'s answer to a rejection, for a cause no Promise holds.
|
|
152
|
+
*/
|
|
153
|
+
const failUnlessSpent = (cause, caught) => {
|
|
149
154
|
const spent = spentAt(cause);
|
|
150
155
|
return spent === void 0 ? Effect.fail(caught(cause)) : Effect.die(spent);
|
|
151
|
-
}
|
|
156
|
+
};
|
|
152
157
|
/** A rejection `tryUnlessSpent` holds until it tells a spent bound from the rest. */
|
|
153
158
|
var Caught = class {
|
|
154
159
|
cause;
|
|
@@ -189,4 +194,4 @@ const answerOf = (exit, signal) => {
|
|
|
189
194
|
if (signal?.aborted === true && Cause.hasInterruptsOnly(exit.cause)) throw signal.reason;
|
|
190
195
|
throw Cause.squash(exit.cause);
|
|
191
196
|
};
|
|
192
|
-
export { CallsSpent, answerFailed, answerOf, callLimitIn, callLimitTry, catchSpent, fromAnswer, ownSpentOf, spentAt, spentIn, spentOf, spentRefusal, spentRefusalOf, tryUnlessSpent };
|
|
197
|
+
export { CallsSpent, answerFailed, answerOf, callLimitIn, callLimitTry, catchSpent, failUnlessSpent, fromAnswer, ownSpentOf, spentAt, spentIn, spentOf, spentRefusal, spentRefusalOf, tryUnlessSpent };
|
|
@@ -2,15 +2,16 @@ import { BlobCalls } from "./blobs.mjs";
|
|
|
2
2
|
import { CommitCalls } from "./commits.mjs";
|
|
3
3
|
import { FileCalls } from "./files.mjs";
|
|
4
4
|
import { Oid, RefName, RepoName } from "./ids.mjs";
|
|
5
|
-
import { Filter } from "./object-values.mjs";
|
|
6
5
|
import { MergeCalls } from "./merges.mjs";
|
|
6
|
+
import { Filter } from "./object-values.mjs";
|
|
7
7
|
import { ObjectsFactory } from "./objects.mjs";
|
|
8
8
|
import { Ref, RefApplied, RefCalls, RefEdit, RefRejected, RefsUpdated } from "./refs.mjs";
|
|
9
9
|
import { RemoteOptions, WithoutActor, WithoutSignal } from "./remote.mjs";
|
|
10
|
-
import {
|
|
10
|
+
import { GitError } from "./result.mjs";
|
|
11
11
|
import { EffectCalls } from "./services.mjs";
|
|
12
12
|
import { TagCalls } from "./tags.mjs";
|
|
13
13
|
import { TreeCalls } from "./trees.mjs";
|
|
14
|
+
import * as Effect from "effect/Effect";
|
|
14
15
|
import { Listing, Page, Records } from "@ref0/infra";
|
|
15
16
|
import * as Layer from "effect/Layer";
|
|
16
17
|
/**
|
|
@@ -35,13 +36,18 @@ export interface RemoteRefsInput {
|
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
37
38
|
* `refs`: branch names, such as `main`, or full names; every branch and tag when left out.
|
|
38
|
-
* `depth`: commits of history from each tip, a shallow fetch
|
|
39
|
-
*
|
|
40
|
-
*
|
|
39
|
+
* `depth`: commits of history from each tip, a shallow fetch, as `git fetch --depth`. `deepen`:
|
|
40
|
+
* commits more past a shallow repo's edge, as `git fetch --deepen`. `unshallow`: the whole
|
|
41
|
+
* history of a shallow repo, as `git fetch --unshallow`, refused on a repo that isn't shallow.
|
|
42
|
+
* A fetch takes at most one of the three. `filter`: objects left out, a partial fetch, such as
|
|
43
|
+
* `{ kind: 'blob:none' }`. `force`: move a local ref that holds commits the remote's tip doesn't
|
|
44
|
+
* to that tip anyway, as `git fetch --force` does.
|
|
41
45
|
*/
|
|
42
46
|
export interface ClientFetchInput {
|
|
43
47
|
readonly refs?: readonly RefName[];
|
|
44
48
|
readonly depth?: number;
|
|
49
|
+
readonly deepen?: number;
|
|
50
|
+
readonly unshallow?: true;
|
|
45
51
|
readonly filter?: Filter;
|
|
46
52
|
readonly force?: boolean;
|
|
47
53
|
}
|
|
@@ -70,25 +76,23 @@ export interface ClientPushInput {
|
|
|
70
76
|
}
|
|
71
77
|
/** A server's call group as a client makes it: no repo, no actor, and no `signal`. */
|
|
72
78
|
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 {
|
|
75
|
-
readonly remoteRefs: (input?: RemoteRefsInput) => Promise<Result<Listing<Ref>>>;
|
|
76
|
-
readonly fetch: (input?: ClientFetchInput) => Promise<Result<ClientFetchResult>>;
|
|
77
|
-
readonly push: (input: ClientPushInput) => Promise<Result<RefsUpdated>>;
|
|
78
|
-
readonly refs: Localize<RefCalls>;
|
|
79
|
-
readonly blobs: Localize<BlobCalls>;
|
|
80
|
-
readonly trees: Localize<TreeCalls>;
|
|
81
|
-
readonly commits: Localize<CommitCalls>;
|
|
82
|
-
readonly tags: Localize<TagCalls>;
|
|
83
|
-
readonly files: Localize<FileCalls>;
|
|
84
|
-
readonly merges: Localize<MergeCalls>;
|
|
85
|
-
}
|
|
86
79
|
/**
|
|
87
80
|
* A client of one remote, as `GitClient.make` gives it: `remoteRefs`, `fetch` and `push` on the
|
|
88
81
|
* remote, and the server's calls on its own storage, with no repo. Each call is an Effect that
|
|
89
82
|
* fails with the call's `GitError`.
|
|
90
83
|
*/
|
|
91
|
-
export type GitClientCalls =
|
|
84
|
+
export type GitClientCalls = {
|
|
85
|
+
readonly remoteRefs: (input?: RemoteRefsInput) => Effect.Effect<Listing<Ref>, GitError>;
|
|
86
|
+
readonly fetch: (input?: ClientFetchInput) => Effect.Effect<ClientFetchResult, GitError>;
|
|
87
|
+
readonly push: (input: ClientPushInput) => Effect.Effect<RefsUpdated, GitError>;
|
|
88
|
+
readonly refs: Localize<EffectCalls<RefCalls>>;
|
|
89
|
+
readonly blobs: Localize<EffectCalls<BlobCalls>>;
|
|
90
|
+
readonly trees: Localize<EffectCalls<TreeCalls>>;
|
|
91
|
+
readonly commits: Localize<EffectCalls<CommitCalls>>;
|
|
92
|
+
readonly tags: Localize<EffectCalls<TagCalls>>;
|
|
93
|
+
readonly files: Localize<EffectCalls<FileCalls>>;
|
|
94
|
+
readonly merges: Localize<EffectCalls<MergeCalls>>;
|
|
95
|
+
};
|
|
92
96
|
/** A list call's input: the page it starts from. */
|
|
93
97
|
export interface PagedInput {
|
|
94
98
|
readonly page?: Page;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { EffectCalls } from "./services.mjs";
|
|
2
|
-
import { GitError, Result } from "./result.mjs";
|
|
3
2
|
import { Caller, WriteInput } from "./actors.mjs";
|
|
4
3
|
import { Acting, ObjectInput } from "./blobs.mjs";
|
|
5
4
|
import { Commit, MergeBases, ReadOptions, ReadPage, TreeChanges } from "./engine.mjs";
|
|
6
5
|
import { Oid, RepoName } from "./ids.mjs";
|
|
7
6
|
import { RepoInput } from "./repos.mjs";
|
|
8
7
|
import { TreeEdit } from "./trees.mjs";
|
|
8
|
+
import { GitError } from "./result.mjs";
|
|
9
9
|
import * as Effect from "effect/Effect";
|
|
10
10
|
import * as Schema from "effect/Schema";
|
|
11
11
|
import { Listing } from "@ref0/infra";
|
|
12
12
|
import * as Context from "effect/Context";
|
|
13
13
|
declare namespace commits_d_exports {
|
|
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, logEmailsMost, mergeBase, pick, revert };
|
|
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, logEmailsMost, logExcludeMost, mergeBase, pick, revert };
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* A revision, as a call names a commit: a full object ID, a full ref name, `HEAD` for the
|
|
@@ -23,15 +23,23 @@ export declare const Revision: Schema.String;
|
|
|
23
23
|
export type Revision = typeof Revision.Type;
|
|
24
24
|
/** The most addresses a log's `authors` or `committers` names. */
|
|
25
25
|
export declare const logEmailsMost = 100;
|
|
26
|
+
/** The most revisions a log's `exclude` names. */
|
|
27
|
+
export declare const logExcludeMost = 100;
|
|
26
28
|
/**
|
|
27
|
-
* `git log <ref> [-- <path>]`: newest first; with `path`, only the commits that
|
|
29
|
+
* `git log <ref> [^<exclude>…] [-- <path>]`: newest first; with `path`, only the commits that
|
|
30
|
+
* changed it. `exclude` is Git's `^rev`: the commits `ref` has that none of them has, each
|
|
31
|
+
* resolved as the caller as `ref` is. Like Git's, that walk marks the whole range before its
|
|
32
|
+
* first page, so its cost is the range's, whatever the page's size; `path` doesn't take it.
|
|
28
33
|
* `authors` and `committers` keep the commits whose author's or committer's email is one they
|
|
29
34
|
* name, compared without case. `since` and `until` keep the commits committed at or after and at
|
|
30
35
|
* or before them, as `git log --since` and `--until` do, and as with `--since` the walk follows no
|
|
31
36
|
* commit committed before `since`, so it stops along each line at the first older one.
|
|
37
|
+
* In process a page holds up to `logLimitMost`, 1,001, for a caller that reads a range whole in
|
|
38
|
+
* one walk; the REST API's pages hold up to 200, as every list's do.
|
|
32
39
|
*/
|
|
33
40
|
export declare const Log: Schema.Struct<{
|
|
34
41
|
readonly ref: Schema.String;
|
|
42
|
+
readonly exclude: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
35
43
|
readonly path: Schema.optionalKey<Schema.String>;
|
|
36
44
|
readonly authors: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
37
45
|
readonly committers: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
@@ -281,21 +289,21 @@ export type CommitPick = typeof CommitPick.Type;
|
|
|
281
289
|
export interface CommitPickInput extends WriteInput, CommitPick, Pick<RepoInput, 'internalId'> {}
|
|
282
290
|
export interface CommitCalls {
|
|
283
291
|
/** A commit by its ID; a tag's ID peels to its commit. */
|
|
284
|
-
readonly get: (repo: RepoName, input: Acting<ObjectInput>) =>
|
|
285
|
-
readonly list: (repo: RepoName, input: Acting<LogInput>) =>
|
|
292
|
+
readonly get: (repo: RepoName, input: Acting<ObjectInput>) => Effect.Effect<Commit, GitError>;
|
|
293
|
+
readonly list: (repo: RepoName, input: Acting<LogInput>) => Effect.Effect<Listing<Commit>, GitError>;
|
|
286
294
|
/** `git merge-base --all`. */
|
|
287
|
-
readonly mergeBase: (repo: RepoName, input: Acting<CommitsMergeBaseInput>) =>
|
|
288
|
-
readonly diff: (repo: RepoName, input: Acting<CommitDiffInput>) =>
|
|
289
|
-
readonly compare: (repo: RepoName, input: Acting<CompareInput>) =>
|
|
295
|
+
readonly mergeBase: (repo: RepoName, input: Acting<CommitsMergeBaseInput>) => Effect.Effect<MergeBases, GitError>;
|
|
296
|
+
readonly diff: (repo: RepoName, input: Acting<CommitDiffInput>) => Effect.Effect<TreeChanges, GitError>;
|
|
297
|
+
readonly compare: (repo: RepoName, input: Acting<CompareInput>) => Effect.Effect<Compare, GitError>;
|
|
290
298
|
/** A commit, written with the tree its changes make, and its ref moved when it names one. */
|
|
291
|
-
readonly create: (repo: RepoName, input: CommitCreateInput) =>
|
|
299
|
+
readonly create: (repo: RepoName, input: CommitCreateInput) => Effect.Effect<Commit, GitError>;
|
|
292
300
|
/** A conflict fails `FAILED_PRECONDITION` with `merge-conflict`, and writes nothing. */
|
|
293
|
-
readonly revert: (repo: RepoName, input: CommitRevertInput) =>
|
|
301
|
+
readonly revert: (repo: RepoName, input: CommitRevertInput) => Effect.Effect<Commit, GitError>;
|
|
294
302
|
/** A conflict fails `FAILED_PRECONDITION` with `merge-conflict`, and writes nothing. */
|
|
295
|
-
readonly pick: (repo: RepoName, input: CommitPickInput) =>
|
|
303
|
+
readonly pick: (repo: RepoName, input: CommitPickInput) => Effect.Effect<Commit, GitError>;
|
|
296
304
|
}
|
|
297
305
|
declare const Commits_base: Context.ServiceClass<Commits, "@ref0/git/Commits", EffectCalls<{
|
|
298
|
-
readonly get: (repo: string, input: Acting<ObjectInput>, by?: Caller<unknown> | undefined) =>
|
|
306
|
+
readonly get: (repo: string, input: Acting<ObjectInput>, by?: Caller<unknown> | undefined) => Effect.Effect<{
|
|
299
307
|
readonly oid: string;
|
|
300
308
|
readonly tree: string;
|
|
301
309
|
readonly parents: readonly string[];
|
|
@@ -314,8 +322,8 @@ declare const Commits_base: Context.ServiceClass<Commits, "@ref0/git/Commits", E
|
|
|
314
322
|
readonly subject: string;
|
|
315
323
|
readonly message: string;
|
|
316
324
|
readonly signature?: string;
|
|
317
|
-
}
|
|
318
|
-
readonly list: (repo: string, input: Acting<LogInput>, by?: Caller<unknown> | undefined) =>
|
|
325
|
+
}, GitError, never>;
|
|
326
|
+
readonly list: (repo: string, input: Acting<LogInput>, by?: Caller<unknown> | undefined) => Effect.Effect<Listing<{
|
|
319
327
|
readonly oid: string;
|
|
320
328
|
readonly tree: string;
|
|
321
329
|
readonly parents: readonly string[];
|
|
@@ -334,12 +342,12 @@ declare const Commits_base: Context.ServiceClass<Commits, "@ref0/git/Commits", E
|
|
|
334
342
|
readonly subject: string;
|
|
335
343
|
readonly message: string;
|
|
336
344
|
readonly signature?: string;
|
|
337
|
-
}
|
|
338
|
-
readonly mergeBase: (repo: string, input: Acting<CommitsMergeBaseInput>, by?: Caller<unknown> | undefined) =>
|
|
345
|
+
}>, GitError, never>;
|
|
346
|
+
readonly mergeBase: (repo: string, input: Acting<CommitsMergeBaseInput>, by?: Caller<unknown> | undefined) => Effect.Effect<{
|
|
339
347
|
readonly bases: readonly string[];
|
|
340
|
-
}
|
|
341
|
-
readonly diff: (repo: string, input: Acting<CommitDiffInput>, by?: Caller<unknown> | undefined) =>
|
|
342
|
-
readonly compare: (repo: string, input: Acting<CompareInput>, by?: Caller<unknown> | undefined) =>
|
|
348
|
+
}, GitError, never>;
|
|
349
|
+
readonly diff: (repo: string, input: Acting<CommitDiffInput>, by?: Caller<unknown> | undefined) => Effect.Effect<TreeChanges, GitError, never>;
|
|
350
|
+
readonly compare: (repo: string, input: Acting<CompareInput>, by?: Caller<unknown> | undefined) => Effect.Effect<{
|
|
343
351
|
readonly base: string;
|
|
344
352
|
readonly head: string;
|
|
345
353
|
readonly mergeBase?: string;
|
|
@@ -392,8 +400,8 @@ declare const Commits_base: Context.ServiceClass<Commits, "@ref0/git/Commits", E
|
|
|
392
400
|
readonly next?: string;
|
|
393
401
|
readonly renamesSkipped?: "memory-limit" | "rename-limit";
|
|
394
402
|
};
|
|
395
|
-
}
|
|
396
|
-
readonly create: (repo: string, input: CommitCreateInput, by?: Caller<unknown> | undefined) =>
|
|
403
|
+
}, GitError, never>;
|
|
404
|
+
readonly create: (repo: string, input: CommitCreateInput, by?: Caller<unknown> | undefined) => Effect.Effect<{
|
|
397
405
|
readonly oid: string;
|
|
398
406
|
readonly tree: string;
|
|
399
407
|
readonly parents: readonly string[];
|
|
@@ -412,8 +420,8 @@ declare const Commits_base: Context.ServiceClass<Commits, "@ref0/git/Commits", E
|
|
|
412
420
|
readonly subject: string;
|
|
413
421
|
readonly message: string;
|
|
414
422
|
readonly signature?: string;
|
|
415
|
-
}
|
|
416
|
-
readonly revert: (repo: string, input: CommitRevertInput, by?: Caller<unknown> | undefined) =>
|
|
423
|
+
}, GitError, never>;
|
|
424
|
+
readonly revert: (repo: string, input: CommitRevertInput, by?: Caller<unknown> | undefined) => Effect.Effect<{
|
|
417
425
|
readonly oid: string;
|
|
418
426
|
readonly tree: string;
|
|
419
427
|
readonly parents: readonly string[];
|
|
@@ -432,8 +440,8 @@ declare const Commits_base: Context.ServiceClass<Commits, "@ref0/git/Commits", E
|
|
|
432
440
|
readonly subject: string;
|
|
433
441
|
readonly message: string;
|
|
434
442
|
readonly signature?: string;
|
|
435
|
-
}
|
|
436
|
-
readonly pick: (repo: string, input: CommitPickInput, by?: Caller<unknown> | undefined) =>
|
|
443
|
+
}, GitError, never>;
|
|
444
|
+
readonly pick: (repo: string, input: CommitPickInput, by?: Caller<unknown> | undefined) => Effect.Effect<{
|
|
437
445
|
readonly oid: string;
|
|
438
446
|
readonly tree: string;
|
|
439
447
|
readonly parents: readonly string[];
|
|
@@ -452,7 +460,7 @@ declare const Commits_base: Context.ServiceClass<Commits, "@ref0/git/Commits", E
|
|
|
452
460
|
readonly subject: string;
|
|
453
461
|
readonly message: string;
|
|
454
462
|
readonly signature?: string;
|
|
455
|
-
}
|
|
463
|
+
}, GitError, never>;
|
|
456
464
|
}, never>>;
|
|
457
465
|
/**
|
|
458
466
|
* A repo's commits: read, walked, compared, and written, reverted or picked. `CommitCalls` as Effects, each deciding for `by`. The server builds it inside its runtime's
|
|
@@ -28,6 +28,7 @@ var commits_exports = /* @__PURE__ */ __exportAll({
|
|
|
28
28
|
get: () => get,
|
|
29
29
|
list: () => list,
|
|
30
30
|
logEmailsMost: () => 100,
|
|
31
|
+
logExcludeMost: () => 100,
|
|
31
32
|
mergeBase: () => mergeBase,
|
|
32
33
|
pick: () => pick,
|
|
33
34
|
revert: () => revert
|
|
@@ -46,15 +47,22 @@ const logEmailsMost = 100;
|
|
|
46
47
|
* none, and at most `logEmailsMost`.
|
|
47
48
|
*/
|
|
48
49
|
const LogEmails = /* @__PURE__ */ Schema.Array(Schema.String).check(Schema.isMinLength(1, { message: "named no address: leave the field out instead" }), Schema.isMaxLength(100, { message: `named more than 100 addresses` }));
|
|
50
|
+
const LogExclude = /* @__PURE__ */ Schema.Array(Revision).check(Schema.isMaxLength(100, { message: `named more than 100 revisions` }));
|
|
49
51
|
/**
|
|
50
|
-
* `git log <ref> [-- <path>]`: newest first; with `path`, only the commits that
|
|
52
|
+
* `git log <ref> [^<exclude>…] [-- <path>]`: newest first; with `path`, only the commits that
|
|
53
|
+
* changed it. `exclude` is Git's `^rev`: the commits `ref` has that none of them has, each
|
|
54
|
+
* resolved as the caller as `ref` is. Like Git's, that walk marks the whole range before its
|
|
55
|
+
* first page, so its cost is the range's, whatever the page's size; `path` doesn't take it.
|
|
51
56
|
* `authors` and `committers` keep the commits whose author's or committer's email is one they
|
|
52
57
|
* name, compared without case. `since` and `until` keep the commits committed at or after and at
|
|
53
58
|
* or before them, as `git log --since` and `--until` do, and as with `--since` the walk follows no
|
|
54
59
|
* commit committed before `since`, so it stops along each line at the first older one.
|
|
60
|
+
* In process a page holds up to `logLimitMost`, 1,001, for a caller that reads a range whole in
|
|
61
|
+
* one walk; the REST API's pages hold up to 200, as every list's do.
|
|
55
62
|
*/
|
|
56
63
|
const Log = /* @__PURE__ */ Schema.Struct({
|
|
57
64
|
ref: Revision,
|
|
65
|
+
exclude: Schema.optionalKey(LogExclude),
|
|
58
66
|
path: Schema.optionalKey(Schema.String),
|
|
59
67
|
authors: Schema.optionalKey(LogEmails),
|
|
60
68
|
committers: Schema.optionalKey(LogEmails),
|
|
@@ -47,9 +47,14 @@ export declare const Commit: Schema.Struct<{
|
|
|
47
47
|
readonly signature: Schema.optionalKey<Schema.String>;
|
|
48
48
|
}>;
|
|
49
49
|
export type Commit = typeof Commit.Type;
|
|
50
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* What a new annotated tag names: the object it points at, its name, its tagger and message, and,
|
|
52
|
+
* where the caller says it, the type it expects that object to be, which a write of another type's
|
|
53
|
+
* object refuses `INVALID_ARGUMENT`, writing nothing.
|
|
54
|
+
*/
|
|
51
55
|
export declare const TagFields: Schema.Struct<{
|
|
52
56
|
readonly object: Schema.String;
|
|
57
|
+
readonly type: Schema.optionalKey<Schema.Literals<readonly ["commit", "tree", "blob"]>>;
|
|
53
58
|
readonly tag: Schema.String;
|
|
54
59
|
readonly tagger: Schema.Struct<{
|
|
55
60
|
readonly name: Schema.String;
|
|
@@ -39,9 +39,18 @@ const Commit = /* @__PURE__ */ Schema.Struct({
|
|
|
39
39
|
message: Schema.String,
|
|
40
40
|
signature: Schema.optionalKey(Schema.String)
|
|
41
41
|
}).annotate({ identifier: "Commit" });
|
|
42
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* What a new annotated tag names: the object it points at, its name, its tagger and message, and,
|
|
44
|
+
* where the caller says it, the type it expects that object to be, which a write of another type's
|
|
45
|
+
* object refuses `INVALID_ARGUMENT`, writing nothing.
|
|
46
|
+
*/
|
|
43
47
|
const TagFields = /* @__PURE__ */ Schema.Struct({
|
|
44
48
|
object: Oid,
|
|
49
|
+
type: Schema.optionalKey(Schema.Literals([
|
|
50
|
+
"commit",
|
|
51
|
+
"tree",
|
|
52
|
+
"blob"
|
|
53
|
+
])),
|
|
45
54
|
tag: Schema.String,
|
|
46
55
|
tagger: Signature,
|
|
47
56
|
message: Schema.String
|