@ref0/git 0.11.0 → 0.14.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 +8 -7
- package/dist/auth/auth.d.mts +2 -2
- package/dist/auth/auth.mjs +3 -6
- package/dist/auth/authorize.mjs +1 -17
- package/dist/auth/helpers.mjs +3 -11
- package/dist/auth/host-services.mjs +11 -0
- package/dist/auth/policy.d.mts +27 -7
- package/dist/auth/policy.mjs +8 -4
- package/dist/auth/tokens-layer.d.mts +1 -2
- package/dist/auth/tokens-layer.mjs +2 -3
- package/dist/auth/tokens-public.d.mts +3 -3
- package/dist/auth/tokens.d.mts +1 -8
- package/dist/auth/tokens.mjs +1 -8
- package/dist/auth.d.mts +1 -4
- package/dist/auth.mjs +1 -3
- package/dist/client/git-http.mjs +18 -4
- package/dist/client/push-upload.mjs +33 -7
- package/dist/client/remote.mjs +94 -28
- package/dist/client/slice-push.d.mts +1 -1
- package/dist/contracts/access.d.mts +8 -8
- package/dist/contracts/actors.d.mts +2 -34
- package/dist/contracts/blobs.d.mts +2 -2
- package/dist/contracts/client.d.mts +8 -3
- package/dist/contracts/commits.d.mts +10 -2
- package/dist/contracts/commits.mjs +9 -1
- package/dist/contracts/files.d.mts +2 -2
- package/dist/contracts/forks.d.mts +14 -3
- package/dist/contracts/git.d.mts +41 -12
- package/dist/contracts/git.mjs +3 -2
- package/dist/contracts/lfs.d.mts +0 -7
- package/dist/contracts/objects.d.mts +80 -10
- 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/refs.d.mts +28 -6
- package/dist/contracts/remote.mjs +1 -3
- package/dist/contracts/repo-records.d.mts +1 -0
- package/dist/contracts/repos.d.mts +90 -2
- package/dist/contracts/repos.mjs +29 -2
- package/dist/contracts/result.d.mts +30 -23
- package/dist/contracts/result.mjs +24 -9
- package/dist/contracts/rules.d.mts +22 -22
- package/dist/contracts/server.d.mts +28 -77
- package/dist/contracts/signin.d.mts +1 -1
- package/dist/contracts/sync.d.mts +90 -19
- package/dist/contracts/sync.mjs +34 -10
- package/dist/contracts/tokens.d.mts +1 -6
- package/dist/contracts/tokens.mjs +1 -2
- package/dist/contracts/topics.d.mts +0 -5
- package/dist/contracts/work.d.mts +66 -2
- package/dist/contracts/work.mjs +8 -1
- package/dist/core/access.d.mts +1 -0
- package/dist/core/access.mjs +34 -13
- package/dist/core/ancestry.d.mts +9 -0
- package/dist/core/ancestry.mjs +6 -6
- package/dist/core/asked.mjs +68 -0
- package/dist/core/call-names.mjs +1 -0
- package/dist/core/call-services.mjs +2 -1
- package/dist/core/events/deliver.d.mts +1 -0
- package/dist/core/events/deliver.mjs +15 -3
- package/dist/core/forks.mjs +42 -16
- package/dist/core/imports.mjs +156 -13
- package/dist/core/index-job.mjs +9 -6
- package/dist/core/job-view.mjs +8 -9
- package/dist/core/mirror-rows.mjs +19 -4
- package/dist/core/objects/commits.mjs +16 -6
- package/dist/core/objects/reading.mjs +17 -9
- package/dist/core/parts.d.mts +8 -2
- package/dist/core/parts.mjs +1 -4
- package/dist/core/purge.mjs +76 -6
- package/dist/core/push-decide.mjs +1 -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 +107 -32
- package/dist/core/receipts.mjs +26 -10
- package/dist/core/ref-view.mjs +59 -5
- package/dist/core/refs.mjs +18 -10
- package/dist/core/registered-rows.mjs +7 -5
- package/dist/core/repack.mjs +16 -11
- package/dist/core/repo-info.mjs +16 -9
- package/dist/core/repos.mjs +30 -14
- package/dist/core/saved-caller-views.d.mts +18 -0
- package/dist/core/saved-caller-views.mjs +17 -4
- package/dist/core/saved-callers-public.d.mts +3 -3
- package/dist/core/saved-callers-public.mjs +3 -2
- package/dist/core/saved-callers.d.mts +7 -0
- package/dist/core/seam.mjs +2 -2
- package/dist/core/view.d.mts +6 -0
- package/dist/core/view.mjs +45 -12
- package/dist/core/work.mjs +47 -22
- package/dist/effect.d.mts +3 -1
- package/dist/effect.mjs +3 -1
- package/dist/engine/reads.mjs +13 -6
- 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 +1 -1
- package/dist/event-streams/stream.mjs +1 -1
- package/dist/extend.d.mts +4 -3
- package/dist/extend.mjs +3 -2
- package/dist/http/answers.mjs +4 -2
- package/dist/http/core-parts.mjs +64 -15
- package/dist/http/handler.mjs +2 -2
- package/dist/http/node.mjs +5 -4
- package/dist/http/parts.d.mts +1 -0
- package/dist/http/push-upload-job.mjs +503 -0
- package/dist/http/push-uploads.d.mts +1 -0
- package/dist/http/push-uploads.mjs +120 -59
- package/dist/http/upload-pack.mjs +7 -6
- package/dist/index.d.mts +23 -24
- package/dist/index.mjs +4 -7
- package/dist/lfs/base.d.mts +7 -3
- package/dist/lfs/base.mjs +2 -1
- package/dist/lfs/copy.d.mts +46 -0
- package/dist/lfs/copy.mjs +26 -0
- package/dist/lfs/layer.mjs +4 -2
- package/dist/lfs/locks.mjs +14 -9
- package/dist/lfs/objects.d.mts +6 -0
- package/dist/lfs/objects.mjs +95 -61
- package/dist/lfs/rows.d.mts +13 -0
- package/dist/lfs/service.d.mts +1 -7
- package/dist/lfs/service.mjs +1 -9
- package/dist/lfs/upload-most.mjs +5 -5
- package/dist/node.d.mts +2 -2
- 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/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 +1 -1
- package/dist/queue/calls.mjs +21 -1
- package/dist/queue/host.d.mts +1 -7
- package/dist/queue/host.mjs +1 -7
- package/dist/queue/layer.mjs +1 -1
- package/dist/queue/trim.mjs +1 -1
- package/dist/rest/blobs.d.mts +16 -8
- package/dist/rest/blobs.mjs +1 -1
- package/dist/rest/caller.d.mts +49 -9
- package/dist/rest/caller.mjs +1 -1
- package/dist/rest/client.d.mts +10 -3
- package/dist/rest/client.mjs +4 -0
- package/dist/rest/commits.d.mts +272 -239
- package/dist/rest/errors.d.mts +24 -4
- package/dist/rest/events.d.mts +9 -6
- package/dist/rest/events.mjs +1 -2
- package/dist/rest/files.d.mts +112 -100
- package/dist/rest/forks.d.mts +146 -122
- package/dist/rest/handler.mjs +4 -57
- package/dist/rest/handlers.d.mts +1 -1
- package/dist/rest/handlers.mjs +18 -4
- package/dist/rest/layer.mjs +10 -2
- package/dist/rest/me.d.mts +8 -4
- package/dist/rest/merges.d.mts +8 -4
- package/dist/rest/paths.mjs +1 -0
- package/dist/rest/queue.d.mts +292 -236
- package/dist/rest/refs.d.mts +98 -69
- package/dist/rest/repos.d.mts +133 -105
- package/dist/rest/tags.d.mts +100 -88
- package/dist/rest/tokens.d.mts +192 -168
- package/dist/rest/topics.d.mts +154 -134
- package/dist/rest/trees.d.mts +32 -16
- package/dist/rest/work.d.mts +467 -20
- package/dist/rest/work.mjs +8 -0
- package/dist/server/edge-node.d.mts +9 -13
- package/dist/server/edge-node.mjs +9 -12
- package/dist/server/git-layer.d.mts +1 -6
- package/dist/server/git-layer.mjs +2 -2
- package/dist/server/git-namespace.d.mts +4 -4
- package/dist/server/joined.d.mts +15 -22
- package/dist/server/joined.mjs +5 -29
- package/dist/server/lifecycle.mjs +107 -23
- package/dist/server/registry.mjs +9 -1
- package/dist/server/server.mjs +139 -216
- package/dist/storage/budget.mjs +2 -2
- package/dist/storage/clean-up.mjs +13 -10
- package/dist/storage/fetch.mjs +13 -8
- package/dist/storage/file-limits.mjs +24 -0
- package/dist/storage/index-build.d.mts +1 -0
- package/dist/storage/index-build.mjs +106 -62
- package/dist/storage/index-fetch.mjs +16 -3
- package/dist/storage/index-reach.mjs +33 -5
- package/dist/storage/index-remap.mjs +8 -1
- package/dist/storage/index-shallow.mjs +5 -3
- package/dist/storage/largest-files.mjs +48 -0
- package/dist/storage/lfs-pointers.mjs +10 -1
- package/dist/storage/loose.mjs +3 -1
- package/dist/storage/memory-budget.mjs +154 -8
- package/dist/storage/merge-cut.mjs +5 -4
- package/dist/storage/pack-reads.mjs +246 -34
- package/dist/storage/pack-receive.mjs +83 -25
- package/dist/storage/packs.mjs +37 -21
- package/dist/storage/prune-keep.mjs +203 -34
- package/dist/storage/prune-seen.mjs +11 -6
- package/dist/storage/prune-walk.mjs +219 -81
- package/dist/storage/prune.mjs +629 -196
- package/dist/storage/push-uploads.mjs +36 -12
- package/dist/storage/quarantine.mjs +9 -7
- package/dist/storage/ready.mjs +47 -19
- package/dist/storage/receive-bounds.mjs +29 -8
- package/dist/storage/receive-state.mjs +8 -0
- package/dist/storage/receive-steps.mjs +71 -18
- package/dist/storage/repack.d.mts +1 -1
- package/dist/storage/repack.mjs +1 -8
- package/dist/storage/rows.mjs +12 -1
- package/dist/storage/shallow.d.mts +1 -0
- package/dist/storage/shallow.mjs +26 -4
- package/dist/storage/stream-whole.mjs +5 -2
- package/dist/storage/visible.mjs +29 -1
- package/dist/storage/walk.mjs +2 -1
- package/dist/store/catalogue.mjs +1 -0
- 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 -2
- package/dist/store/cursor-seal.mjs +26 -14
- package/dist/store/errors.mjs +9 -1
- package/dist/store/records.d.mts +2 -0
- package/dist/store/records.mjs +9 -6
- package/dist/store/repo-record.d.mts +27 -0
- package/dist/store/repo-record.mjs +141 -4
- package/dist/store/scopes.mjs +10 -2
- 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 +63 -42
- package/dist/sync/http.mjs +36 -1
- package/dist/sync/import.mjs +4 -2
- package/dist/sync/layer.mjs +6 -2
- package/dist/sync/lfs-batch.mjs +119 -0
- package/dist/sync/lfs-copy.mjs +251 -0
- package/dist/sync/mirror.mjs +227 -147
- package/dist/sync/said.mjs +204 -0
- package/dist/sync/smart-http.mjs +4 -2
- package/dist/sync/step.mjs +33 -13
- package/dist/sync/tries.mjs +71 -24
- package/dist/sync.d.mts +2 -2
- package/dist/topics/advance.mjs +10 -3
- package/dist/topics/host.mjs +1 -19
- package/dist/topics/layer.mjs +1 -1
- package/package.json +3 -8
- package/dist/auth/bridge.mjs +0 -30
- package/dist/auth/helpers.d.mts +0 -17
- package/dist/core/purge.d.mts +0 -8
- package/dist/core/registered-rows.d.mts +0 -4
- package/dist/core/repack.d.mts +0 -11
- package/dist/http/handler.d.mts +0 -2
- package/dist/rest/handler.d.mts +0 -21
- package/dist/rest.d.mts +0 -2
- package/dist/rest.mjs +0 -1
- 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/topics/host.d.mts +0 -7
package/dist/contracts/git.d.mts
CHANGED
|
@@ -15,8 +15,9 @@ import * as Stream from "effect/Stream";
|
|
|
15
15
|
/**
|
|
16
16
|
* The host, acting as itself (Q223): the caller host code's calls name, as `hostCalls()` do. A
|
|
17
17
|
* 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
|
|
18
|
+
* private or not, but an owned prefix's, which only its owner reads, and lists every repo. Only
|
|
19
|
+
* this one value is the host: a copy of it, or any caller built to look like it, is an anonymous
|
|
20
|
+
* caller, refused what a stranger is.
|
|
20
21
|
*/
|
|
21
22
|
export declare const host: Caller;
|
|
22
23
|
/** Whether `caller` is `host` itself, the one value that is. */
|
|
@@ -40,11 +41,19 @@ export interface RegisterInput {
|
|
|
40
41
|
*/
|
|
41
42
|
readonly repoScopes?: (repo: InternalRepoId) => readonly string[];
|
|
42
43
|
/**
|
|
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
|
-
*
|
|
44
|
+
* A registered prefix, such as `refs/queue/`: a ref under it only the registration moves, and
|
|
45
|
+
* only a caller who reads every private pattern sees, or with `refsReadBy: 'owner'` only the
|
|
46
|
+
* registration. No two registrations' prefixes overlap, none overlaps Git's own `refs/import/`,
|
|
47
|
+
* and none is under `refs/heads/` or `refs/tags/`.
|
|
46
48
|
*/
|
|
47
49
|
readonly refs?: `refs/${string}/`;
|
|
50
|
+
/**
|
|
51
|
+
* Who reads `refs`' refs. `readers`, when left out: a caller who reads every private pattern, as
|
|
52
|
+
* above. `owner`: the registration alone, with its `owner` on `refs.get`. No listing, count,
|
|
53
|
+
* fetch, fork or other `refs.get` shows one, whatever the caller reads, such as the drop-in's
|
|
54
|
+
* merge fences. Given with no `refs`, it fails the build.
|
|
55
|
+
*/
|
|
56
|
+
readonly refsReadBy?: 'readers' | 'owner';
|
|
48
57
|
/**
|
|
49
58
|
* Prefixes whose refs `Git.host` writes for someone with `refs.update`'s `onBehalfOf`, such as
|
|
50
59
|
* `refs/pull/`: every reader of the repo sees them, and anyone with push may move them too. Each
|
|
@@ -54,8 +63,10 @@ export interface RegisterInput {
|
|
|
54
63
|
readonly publishes?: readonly `refs/${string}/`[];
|
|
55
64
|
}
|
|
56
65
|
/**
|
|
57
|
-
* What only a registered prefix's owner holds: it moves the prefix's refs, which no one else
|
|
58
|
-
*
|
|
66
|
+
* What only a registered prefix's owner holds: it moves the prefix's refs, which no one else does,
|
|
67
|
+
* and reads them through any view. An owned prefix's, registered with `refsReadBy: 'owner'`, no
|
|
68
|
+
* one else reads either. Only Git's registry makes one, as a registration's `owner`: a copy of it
|
|
69
|
+
* owns nothing.
|
|
59
70
|
*/
|
|
60
71
|
export interface RefOwner {
|
|
61
72
|
readonly prefix: `refs/${string}/`;
|
|
@@ -127,28 +138,46 @@ export interface RegisteredWrites {
|
|
|
127
138
|
/** When the repo's upkeep runs next, in `git.repack`: the registration's upkeep steps then. */
|
|
128
139
|
readonly wake?: Moment;
|
|
129
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* A repo as `authorize` was asked of it: the name asked, and the name and visibility its record held
|
|
143
|
+
* when the open read it. A read given one holds the repo to it, as the open's confirm would have.
|
|
144
|
+
*/
|
|
145
|
+
export interface AskedRepo {
|
|
146
|
+
readonly name: RepoName;
|
|
147
|
+
readonly record: {
|
|
148
|
+
readonly name: RepoName;
|
|
149
|
+
readonly public: boolean;
|
|
150
|
+
};
|
|
151
|
+
}
|
|
130
152
|
/**
|
|
131
153
|
* A registration's rows in each repo's scope: collections under `<registration name>/`, and nothing else. A read
|
|
132
154
|
* or a write of another collection, the repo's own record, refs, objects or another registration's, is a
|
|
133
155
|
* defect.
|
|
134
156
|
*/
|
|
135
157
|
export interface RegisteredRows {
|
|
136
|
-
/**
|
|
137
|
-
|
|
158
|
+
/**
|
|
159
|
+
* `reads` at one version of `repo`'s scope. With `asked`, the repo's record is read with them and
|
|
160
|
+
* held to it: a repo deleted, renamed or made public or private since it opened is `NOT_FOUND`.
|
|
161
|
+
*/
|
|
162
|
+
readonly read: (repo: InternalRepoId, reads: readonly Read[], asked?: AskedRepo) => Effect.Effect<RegisteredSnapshot, GitError>;
|
|
138
163
|
/**
|
|
139
164
|
* `reads` for `caller`'s write to `repo`, read with its record and the caller's grant fence at
|
|
140
165
|
* one version, so a commit at that version fails once the repo's deleted or the grant revoked.
|
|
141
|
-
* A deleted repo is `NOT_FOUND`, and a revoked grant the fence's refusal.
|
|
166
|
+
* A deleted repo is `NOT_FOUND`, and a revoked grant the fence's refusal. With `asked`, the record
|
|
167
|
+
* is held to it too, as `read` says.
|
|
142
168
|
*/
|
|
143
169
|
readonly readFenced: (caller: Caller, repo: {
|
|
144
170
|
readonly internalId: InternalRepoId;
|
|
145
171
|
readonly name: RepoName;
|
|
146
|
-
}, reads: readonly Read[]) => Effect.Effect<RegisteredSnapshot, GitError>;
|
|
172
|
+
}, reads: readonly Read[], asked?: AskedRepo) => Effect.Effect<RegisteredSnapshot, GitError>;
|
|
147
173
|
/** The repo `repo` was forked from, by its record, while it's kept: `undefined` for none. */
|
|
148
174
|
readonly source: (repo: InternalRepoId) => Effect.Effect<InternalRepoId | undefined, GitError>;
|
|
149
175
|
/** One commit at `at`, a version read: one since moved it fails, `ok: false`. */
|
|
150
176
|
readonly commit: (repo: InternalRepoId, at: number, writes: RegisteredWrites) => Effect.Effect<Committed, GitError>;
|
|
151
|
-
/**
|
|
177
|
+
/**
|
|
178
|
+
* Rows at keys none holds, outside the version: a key held fails `ALREADY_EXISTS`, and a repo
|
|
179
|
+
* with no record, or a deleted one, `NOT_FOUND`, so an add never makes a purged scope again.
|
|
180
|
+
*/
|
|
152
181
|
readonly add: (repo: InternalRepoId, writes: Omit<RegisteredWrites, 'delete'>) => Effect.Effect<void, GitError>;
|
|
153
182
|
}
|
|
154
183
|
/** What a route's handler is given: the request, and the path's `:name` parts, decoded. */
|
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. */
|
package/dist/contracts/lfs.d.mts
CHANGED
|
@@ -17,13 +17,6 @@ export interface LfsOptions {
|
|
|
17
17
|
/** The CPU one of the host's requests may use, in milliseconds, as a Worker's `limits.cpu_ms`. */
|
|
18
18
|
readonly cpuMs?: number;
|
|
19
19
|
}
|
|
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
20
|
/** An LFS object, by its oid, the SHA-256 of its bytes in 64 hex digits. */
|
|
28
21
|
export interface LfsGetInput extends ActorInput, Pick<RepoInput, 'internalId'> {
|
|
29
22
|
readonly oid: string;
|
|
@@ -212,11 +212,11 @@ export interface ReceiveInput extends CallInput {
|
|
|
212
212
|
readonly cutMost?: number;
|
|
213
213
|
}
|
|
214
214
|
/**
|
|
215
|
-
*
|
|
216
|
-
* and the boundary, needs and cut's most
|
|
217
|
-
*
|
|
215
|
+
* A pack to stage for its receive in steps, an import segment's or a push upload's: its bytes, as
|
|
216
|
+
* `receive` takes them, and the boundary, needs and cut's most, or the shallow lines, its steps
|
|
217
|
+
* check as `ReceiveInput` says. Sync's import and a push upload's job stage one.
|
|
218
218
|
*/
|
|
219
|
-
export type StageInput = Omit<ReceiveInput, 'partial'
|
|
219
|
+
export type StageInput = Omit<ReceiveInput, 'partial'>;
|
|
220
220
|
/** A segment's pack staged: its ID, which each step and the landing name, and its bytes. */
|
|
221
221
|
export interface Staged {
|
|
222
222
|
readonly pack: string;
|
|
@@ -234,6 +234,29 @@ export interface StepInput extends CallInput {
|
|
|
234
234
|
readonly pack: string;
|
|
235
235
|
readonly objects: number;
|
|
236
236
|
readonly needs?: readonly Oid[];
|
|
237
|
+
/**
|
|
238
|
+
* The bytes a streaming step reads before it pauses, a push upload's `pushStepBytesOf` its host's
|
|
239
|
+
* CPU: its pack then streams in as many steps as that takes. A step pauses only between entries,
|
|
240
|
+
* so it reads its share and at most the entry it's in, a blob past the share whole. With none,
|
|
241
|
+
* an import segment's eighth, in at most `receiveStreamStepsMost`.
|
|
242
|
+
*/
|
|
243
|
+
readonly share?: number;
|
|
244
|
+
/**
|
|
245
|
+
* The step lists the push's largest blobs, carried from step to step, as `Quarantine.largest`:
|
|
246
|
+
* core then names a file past `pushes.files`' sizes by its path whichever way the push came
|
|
247
|
+
* (#2468). It reads an entry whole to four times its `share`, what the try's CPU leaves past the
|
|
248
|
+
* share, 240 MiB at Workers' 30 s, and refuses a larger one at its header, by its offset in the
|
|
249
|
+
* pack, before reading it: one step can't read it whole within its CPU, so a file from 240 MiB
|
|
250
|
+
* to 1 GiB at 30 s is refused by its offset rather than its path. It also pauses between
|
|
251
|
+
* entries once it has inflated 12 shares, its entries' data and its deltas' results, though it
|
|
252
|
+
* read less than its share, so with one more delta it stays within its try's CPU before its
|
|
253
|
+
* state's reads and its commit, and resolves each delta to its largest entry where that's under
|
|
254
|
+
* 16 MiB, a chain still to 16 MiB in all, refusing a larger one `delta-too-large` with a message
|
|
255
|
+
* that names that smaller limit (#2500).
|
|
256
|
+
* A push upload's steps set it. Left out, as an import's are, a file past 100 MiB is refused as
|
|
257
|
+
* it's read, by its offset. A host whose own objects ignore it keeps refusing by offset.
|
|
258
|
+
*/
|
|
259
|
+
readonly largest?: true;
|
|
237
260
|
}
|
|
238
261
|
/**
|
|
239
262
|
* What one step of a staged receive ended at: paused, with the step its next try runs, or the
|
|
@@ -309,6 +332,20 @@ export interface Quarantine {
|
|
|
309
332
|
* parse isn't listed. A receive past `lfsPointersMost` of them is refused.
|
|
310
333
|
*/
|
|
311
334
|
readonly lfsPointers: LfsPointers;
|
|
335
|
+
/**
|
|
336
|
+
* The push's largest blobs, each with its size, its result's for a delta, largest first: at most
|
|
337
|
+
* `largestFilesMost` (64), so the largest is always among them. Core holds a push to its file
|
|
338
|
+
* limits by them (#2395). A push upload's receive in steps lists them too, carried from one step
|
|
339
|
+
* to the next, as `StepInput.largest` says (#2468). Left out by an import's receive in steps, and
|
|
340
|
+
* by a storage that doesn't say: no file of such a push is held to a limit past what its storage
|
|
341
|
+
* reads.
|
|
342
|
+
*/
|
|
343
|
+
readonly largest?: readonly LargeFile[];
|
|
344
|
+
/**
|
|
345
|
+
* Whether `largest` left out blobs no larger than its last, the push holding more than
|
|
346
|
+
* `largestFilesMost`: when each listed is past a limit, others may be too, and a refusal says so.
|
|
347
|
+
*/
|
|
348
|
+
readonly largestPartial?: boolean;
|
|
312
349
|
/** What the storage keeps for the push's rules, when it keeps any: core releases it. */
|
|
313
350
|
readonly allotment?: Allotment;
|
|
314
351
|
/**
|
|
@@ -334,6 +371,11 @@ export interface Quarantine {
|
|
|
334
371
|
*/
|
|
335
372
|
readonly cut?: readonly SegmentCut[];
|
|
336
373
|
}
|
|
374
|
+
/** A blob a receive took, by its ID, and its size in bytes, as `git cat-file -s` gives it. */
|
|
375
|
+
export interface LargeFile {
|
|
376
|
+
readonly oid: Oid;
|
|
377
|
+
readonly size: number;
|
|
378
|
+
}
|
|
337
379
|
/**
|
|
338
380
|
* Where a receive's links resolved. A pack counts outside cruft while it's listed and isn't cruft;
|
|
339
381
|
* a row while it's still there, since only a pass step deletes a row whose object it leaves in
|
|
@@ -366,8 +408,18 @@ export interface ObjectsFetchInput extends CallInput {
|
|
|
366
408
|
* fetch.
|
|
367
409
|
*/
|
|
368
410
|
readonly thin?: true;
|
|
411
|
+
/**
|
|
412
|
+
* The repo's roots, read in the same snapshot as the refs the request names: storage's walks see
|
|
413
|
+
* each as a commit with no parents, and its answer names those its pack sends as `shallow`.
|
|
414
|
+
* Absent, the repo has none.
|
|
415
|
+
*/
|
|
416
|
+
readonly roots?: readonly Oid[];
|
|
369
417
|
}
|
|
370
418
|
export interface FetchAnswer {
|
|
419
|
+
/**
|
|
420
|
+
* The commits the client is to hold without their parents: those the request's depth cuts at,
|
|
421
|
+
* and the repo's roots its pack sends, as Git's server names a shallow repo's own.
|
|
422
|
+
*/
|
|
371
423
|
readonly shallow: readonly Oid[];
|
|
372
424
|
readonly unshallow: readonly Oid[];
|
|
373
425
|
readonly objects: number;
|
|
@@ -474,10 +526,12 @@ export interface MaintainInput extends CallInput {
|
|
|
474
526
|
*/
|
|
475
527
|
readonly steps?: 'prune' | 'others';
|
|
476
528
|
/**
|
|
477
|
-
*
|
|
478
|
-
* more: a prune pass's merge under way is dropped then, never yielded to
|
|
529
|
+
* When the repo was deleted, for a deleted repo, whose `repack` row's run takes its packs out and
|
|
530
|
+
* whose pass runs no more: a prune pass's merge under way is dropped then, never yielded to, and
|
|
531
|
+
* clean-up abandons each open `quarantine` row by the delete's `fetchLimits`, not its own
|
|
532
|
+
* `removeAt`; the `staged` row each leaves still waits its grace after (#1558).
|
|
479
533
|
*/
|
|
480
|
-
readonly deleted?:
|
|
534
|
+
readonly deleted?: Moment;
|
|
481
535
|
}
|
|
482
536
|
/**
|
|
483
537
|
* One step of upkeep, its change for the core to commit. `more`: another step is due now. `due`:
|
|
@@ -606,7 +660,7 @@ export interface ObjectsOpenInput<NeedsBucket extends boolean = boolean> {
|
|
|
606
660
|
}
|
|
607
661
|
/**
|
|
608
662
|
* How bytes are kept: `packs()` or `loose()`. `needsBucket` carries the requirement, and
|
|
609
|
-
* `
|
|
663
|
+
* `Git.layer` opens it once per server, keeping no state for any one repo.
|
|
610
664
|
*/
|
|
611
665
|
export interface ObjectsFactory<NeedsBucket extends boolean = boolean> {
|
|
612
666
|
readonly needsBucket: NeedsBucket;
|
|
@@ -661,7 +715,7 @@ export interface VisibleSet {
|
|
|
661
715
|
}
|
|
662
716
|
/**
|
|
663
717
|
* A server's opened objects that keep the reachability index, which a caller's view of a repo
|
|
664
|
-
* reads from: `
|
|
718
|
+
* reads from: `PrivateRefs.layer` takes only these.
|
|
665
719
|
*/
|
|
666
720
|
export interface IndexedObjects extends GitObjects {
|
|
667
721
|
/**
|
|
@@ -676,6 +730,17 @@ export interface IndexedObjects extends GitObjects {
|
|
|
676
730
|
* repo lacks.
|
|
677
731
|
*/
|
|
678
732
|
readonly seen: (set: VisibleSet) => GitObjects;
|
|
733
|
+
/**
|
|
734
|
+
* Which of `input.roots` the commits `input.tips` reach in `listed`, by the index `input.row`
|
|
735
|
+
* names, which a v0 listing tells as `shallow` lines to a caller who doesn't see every ref. A
|
|
736
|
+
* pure fast path: its answer is always the one a walk of the commits from the tips to its end
|
|
737
|
+
* gives, following no root's parents, and it's `undefined` where the index can't give it, as
|
|
738
|
+
* where none covers `listed`. A root the tips don't reach costs it no call. Without it, or where
|
|
739
|
+
* it's `undefined`, the server walks the visible commits to their end, within its want walk's
|
|
740
|
+
* 10,000 objects, and past that refuses the listing with `RESOURCE_EXHAUSTED`, reason
|
|
741
|
+
* `walk-limit`.
|
|
742
|
+
*/
|
|
743
|
+
readonly rootsReached?: (listed: Listed, input: VisibleInput) => Effect.Effect<ReadonlySet<Oid> | undefined, GitError>;
|
|
679
744
|
}
|
|
680
745
|
/** A commit a push brings, with its parents, as its receive listed it. */
|
|
681
746
|
export interface PushedCommit {
|
|
@@ -701,7 +766,7 @@ export interface GitObjects {
|
|
|
701
766
|
/**
|
|
702
767
|
* The most objects one push may carry here, which receive-pack advertises as
|
|
703
768
|
* `ref0-push-objects=<most>`, so ref0's remote helper cuts a bigger push into slices that each
|
|
704
|
-
* fit (Q901): `packs()`' `
|
|
769
|
+
* fit (Q901): `packs()`' `pushObjectsMostOf` its memory, `loose()`'s `looseObjectsMost`. A host's own
|
|
705
770
|
* objects with none advertise none, and the helper pushes whole.
|
|
706
771
|
*/
|
|
707
772
|
readonly pushObjectsMost?: number;
|
|
@@ -885,6 +950,11 @@ export interface IndexTryInput extends CallInput {
|
|
|
885
950
|
readonly failed?: {
|
|
886
951
|
readonly reason: string;
|
|
887
952
|
};
|
|
953
|
+
/**
|
|
954
|
+
* The repo's roots, read at the same version as the tips and the row. Absent, it has none. An
|
|
955
|
+
* index built over other roots is stale: the try builds it again whole.
|
|
956
|
+
*/
|
|
957
|
+
readonly roots?: readonly Oid[];
|
|
888
958
|
/**
|
|
889
959
|
* This try follows a moved answer, so a moved listing counts as failed and the step updates.
|
|
890
960
|
* The job reads the tips, the listing and the row again at a fresh version before it sets it.
|
|
@@ -330,6 +330,9 @@ export declare const Operation: Schema.Union<readonly [Schema.Struct<{
|
|
|
330
330
|
readonly repo: Schema.String;
|
|
331
331
|
readonly name: Schema.optionalKey<Schema.String>;
|
|
332
332
|
readonly key: Schema.optionalKey<Schema.String>;
|
|
333
|
+
}>, Schema.Struct<{
|
|
334
|
+
readonly kind: Schema.Literal<"work.listById">;
|
|
335
|
+
readonly internalId: Schema.TemplateLiteral<readonly ["r_", Schema.String]>;
|
|
333
336
|
}>, Schema.Struct<{
|
|
334
337
|
readonly kind: Schema.Literal<"refs.private">;
|
|
335
338
|
readonly repo: Schema.String;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RefName, RepoName, TopicId } from "./ids.mjs";
|
|
1
|
+
import { InternalRepoId, RefName, RepoName, TopicId } from "./ids.mjs";
|
|
2
2
|
import { CandidateId, EntryFields, EntryId, HoldId } from "./queue.mjs";
|
|
3
3
|
import { RefEdit, RefSource } from "./refs.mjs";
|
|
4
4
|
import { ActorId } from "./actors.mjs";
|
|
@@ -188,6 +188,15 @@ const WorkOperation = /* @__PURE__ */ Schema.Struct({
|
|
|
188
188
|
name: Schema.optionalKey(JobRef.fields.name),
|
|
189
189
|
key: Schema.optionalKey(JobRef.fields.key)
|
|
190
190
|
});
|
|
191
|
+
/**
|
|
192
|
+
* Admin-only: a repo's work by its internal ID, and works on a deleted record. `Policy.signedIn`
|
|
193
|
+
* refuses it to everyone, `NOT_ALLOWED`; only a host's own policy grants it, as `ref0-git init`'s
|
|
194
|
+
* does for its admin. No token scope's ceiling names it, and no name opens it, so it names no repo.
|
|
195
|
+
*/
|
|
196
|
+
const WorkByIdOperation = /* @__PURE__ */ Schema.Struct({
|
|
197
|
+
kind: Schema.Literal("work.listById"),
|
|
198
|
+
internalId: InternalRepoId
|
|
199
|
+
});
|
|
191
200
|
const Operation = /* @__PURE__ */ Schema.Union([
|
|
192
201
|
RepoOperation,
|
|
193
202
|
PushOperation,
|
|
@@ -203,7 +212,8 @@ const Operation = /* @__PURE__ */ Schema.Union([
|
|
|
203
212
|
QueueReleaseOperation,
|
|
204
213
|
TopicOperation,
|
|
205
214
|
WorkOperation,
|
|
215
|
+
WorkByIdOperation,
|
|
206
216
|
RefsPrivateOperation,
|
|
207
217
|
MeOperation
|
|
208
218
|
]);
|
|
209
|
-
export { BypassOperation, FilesAllowOperation, ForkOperation, MeOperation, Operation, PushOperation, QueueAddOperation, QueueCandidateOperation, QueueEntryOperation, QueueReleaseOperation, QueueTargetOperation, RefsPrivateOperation, RepoListOperation, RepoOperation, TokenCreateOperation, TokenOperation, TokenParties, TokenRevokeOperation, TopicOperation, WorkOperation };
|
|
219
|
+
export { BypassOperation, FilesAllowOperation, ForkOperation, MeOperation, Operation, PushOperation, QueueAddOperation, QueueCandidateOperation, QueueEntryOperation, QueueReleaseOperation, QueueTargetOperation, RefsPrivateOperation, RepoListOperation, RepoOperation, TokenCreateOperation, TokenOperation, TokenParties, TokenRevokeOperation, TopicOperation, WorkByIdOperation, WorkOperation };
|
|
@@ -1,7 +1,39 @@
|
|
|
1
1
|
import * as Schema from "effect/Schema";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* How a server takes pushes: a large one's pack can go straight to the bucket, and its files and
|
|
4
|
+
* its repo are held to sizes.
|
|
5
|
+
*/
|
|
3
6
|
export interface PushOptions {
|
|
4
|
-
readonly upload
|
|
7
|
+
readonly upload?: PushUploadOptions;
|
|
8
|
+
readonly files?: PushFileOptions;
|
|
9
|
+
readonly repo?: PushRepoOptions;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The sizes a repo a push lands in is held to, in bytes of its `RepoStats.ownBytes` once the push
|
|
13
|
+
* lands, which leaves Git LFS out (#2395). Past `warnAbove`, 5 GiB by default as GitHub advises, or
|
|
14
|
+
* `false` for none, every Git push that lands is told on band 2; an API write lands with no
|
|
15
|
+
* warning, as with a file's. Past `refuseAbove`, which has no default, a push or an API write that
|
|
16
|
+
* adds bytes is refused, `repo-too-large`; one that only deletes or moves refs still lands.
|
|
17
|
+
* `warnAbove` is below `refuseAbove` when both are set.
|
|
18
|
+
*/
|
|
19
|
+
export interface PushRepoOptions {
|
|
20
|
+
readonly warnAbove?: number | false;
|
|
21
|
+
readonly refuseAbove?: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The sizes a pushed file is held to, in bytes, as GitHub holds them (#2395). A push carrying a
|
|
25
|
+
* file past `refuseAbove`, 100 MiB by default, is refused: each ref is told why, with the file's
|
|
26
|
+
* path, its size and how to track it with Git LFS. One past `warnAbove`, 50 MiB by default, or
|
|
27
|
+
* `false` for none, is taken, and a Git push is told on band 2; an API write gets no warning.
|
|
28
|
+
* `refuseAbove` is at most 1 GiB, a push's pack's own bound, and `warnAbove` is below it. A blob
|
|
29
|
+
* pushed whole counts, though `.gitattributes` names it for Git LFS. A push uploaded in steps is
|
|
30
|
+
* held to these as a streamed one is, but a file past what its step's CPU reads, as
|
|
31
|
+
* `StepInput.largest` says, is refused by its offset (#2468). An import received in steps, as
|
|
32
|
+
* `packs()` stages one, refuses a file past 100 MiB as it reads it, whatever these say.
|
|
33
|
+
*/
|
|
34
|
+
export interface PushFileOptions {
|
|
35
|
+
readonly warnAbove?: number | false;
|
|
36
|
+
readonly refuseAbove?: number;
|
|
5
37
|
}
|
|
6
38
|
/**
|
|
7
39
|
* A push whose pack is larger than `above` bytes may upload it to the bucket in parts, past the
|
|
@@ -50,8 +82,10 @@ export declare const PushUploadPart: Schema.Struct<{
|
|
|
50
82
|
export type PushUploadPart = typeof PushUploadPart.Type;
|
|
51
83
|
/**
|
|
52
84
|
* `POST <repo>/push-uploads/{upload}/complete`, with each part's number and ETag in order, as the
|
|
53
|
-
* bucket's `UploadPart`.
|
|
54
|
-
*
|
|
85
|
+
* bucket's `UploadPart`. The first hands the pack to the server's steps, and it answers
|
|
86
|
+
* `PushUploadReceiving` with 202 and `Retry-After` while they receive it; a client sends the same
|
|
87
|
+
* complete again until it answers what `git-receive-pack` answers: report-status-v2 on
|
|
88
|
+
* side-band-64k, the same report each time.
|
|
55
89
|
*/
|
|
56
90
|
export declare const FinishPushUpload: Schema.Struct<{
|
|
57
91
|
readonly parts: Schema.$Array<Schema.Struct<{
|
|
@@ -59,4 +93,9 @@ export declare const FinishPushUpload: Schema.Struct<{
|
|
|
59
93
|
readonly etag: Schema.String;
|
|
60
94
|
}>>;
|
|
61
95
|
}>;
|
|
62
|
-
export type FinishPushUpload = typeof FinishPushUpload.Type;
|
|
96
|
+
export type FinishPushUpload = typeof FinishPushUpload.Type;
|
|
97
|
+
/** Complete's 202, while the server receives the pack: the receive's steps taken so far. */
|
|
98
|
+
export declare const PushUploadReceiving: Schema.Struct<{
|
|
99
|
+
readonly step: Schema.Int;
|
|
100
|
+
}>;
|
|
101
|
+
export type PushUploadReceiving = typeof PushUploadReceiving.Type;
|
|
@@ -43,17 +43,21 @@ const PushUploadStarted = /* @__PURE__ */ Schema.Struct({
|
|
|
43
43
|
const PushUploadPart = /* @__PURE__ */ Schema.Struct({ url: Schema.String });
|
|
44
44
|
/**
|
|
45
45
|
* `POST <repo>/push-uploads/{upload}/complete`, with each part's number and ETag in order, as the
|
|
46
|
-
* bucket's `UploadPart`.
|
|
47
|
-
*
|
|
46
|
+
* bucket's `UploadPart`. The first hands the pack to the server's steps, and it answers
|
|
47
|
+
* `PushUploadReceiving` with 202 and `Retry-After` while they receive it; a client sends the same
|
|
48
|
+
* complete again until it answers what `git-receive-pack` answers: report-status-v2 on
|
|
49
|
+
* side-band-64k, the same report each time.
|
|
48
50
|
*/
|
|
49
51
|
const FinishPushUpload = /* @__PURE__ */ Schema.Struct({ parts: Schema.Array(Schema.Struct({
|
|
50
52
|
part: Schema.Int,
|
|
51
53
|
etag: Schema.String
|
|
52
54
|
})) });
|
|
55
|
+
/** Complete's 202, while the server receives the pack: the receive's steps taken so far. */
|
|
56
|
+
const PushUploadReceiving = /* @__PURE__ */ Schema.Struct({ step: Schema.Int });
|
|
53
57
|
/** What a client POSTs to a push upload's routes: begin's body, complete's, or a part's, which is empty. */
|
|
54
58
|
const PushUploadRequest = /* @__PURE__ */ Schema.Union([
|
|
55
59
|
BeginPushUpload,
|
|
56
60
|
FinishPushUpload,
|
|
57
61
|
Schema.Record(Schema.String, Schema.Never)
|
|
58
62
|
]);
|
|
59
|
-
export { BeginPushUpload, FinishPushUpload, PushUploadPart, PushUploadRequest, PushUploadStarted };
|
|
63
|
+
export { BeginPushUpload, FinishPushUpload, PushUploadPart, PushUploadReceiving, PushUploadRequest, PushUploadStarted };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ByCalls, EffectCalls } from "./services.mjs";
|
|
2
2
|
import { ActorInput, Caller, WriteInput } from "./actors.mjs";
|
|
3
|
+
import { RefOwner } from "./git.mjs";
|
|
3
4
|
import { RefName, RepoName } from "./ids.mjs";
|
|
4
5
|
import { RepoInput } from "./repos.mjs";
|
|
5
6
|
import { GitError, Result } from "./result.mjs";
|
|
@@ -8,7 +9,7 @@ import * as Schema from "effect/Schema";
|
|
|
8
9
|
import { Listing, Page } from "@ref0/infra";
|
|
9
10
|
import * as Context from "effect/Context";
|
|
10
11
|
declare namespace refs_d_exports {
|
|
11
|
-
export { Ref, RefApplied, RefCalls, RefCount, RefCountFields, RefCountInput, RefEdit, RefInput, RefList, RefListInput, RefOutcome, RefProtection, RefRejected, RefSource, RefUpdate, RefUpdateKind, Refs, RefsCalls, RefsProtections, RefsProtectionsInput, RefsSees, RefsSeesInput, RefsUpdate, RefsUpdateInput, RefsUpdated, count, get, list, maxProtectionRefs, maxSeenRefs, protection, protections, sees, update };
|
|
12
|
+
export { Ref, RefApplied, RefCalls, RefCount, RefCountFields, RefCountInput, RefEdit, RefGetInput, RefInput, RefList, RefListInput, RefOutcome, RefProtection, RefRejected, RefSource, RefUpdate, RefUpdateKind, Refs, RefsCalls, RefsProtections, RefsProtectionsInput, RefsSees, RefsSeesInput, RefsUpdate, RefsUpdateInput, RefsUpdated, count, get, list, maxProtectionRefs, maxSeenRefs, protection, protections, sees, update };
|
|
12
13
|
}
|
|
13
14
|
/** Who moved a ref; Git sets it. */
|
|
14
15
|
export declare const RefSource: Schema.Literals<readonly ["git", "api", "queue", "import"]>;
|
|
@@ -37,6 +38,18 @@ export type Ref = typeof Ref.Type;
|
|
|
37
38
|
export interface RefInput extends ActorInput, Pick<RepoInput, 'internalId'> {
|
|
38
39
|
readonly ref: RefName;
|
|
39
40
|
}
|
|
41
|
+
/** `refs.get`'s input: a ref, read as its caller sees it, or as its prefix's `owner`. */
|
|
42
|
+
export interface RefGetInput extends RefInput {
|
|
43
|
+
/**
|
|
44
|
+
* The registered prefix's owner, `Registration.owner`, which its registration's own `Git.register`
|
|
45
|
+
* returned: with it, the call also reads the refs under that prefix, through a caller's
|
|
46
|
+
* narrowed view as well as a whole one. A prefix registered with `refsReadBy: 'owner'` it alone
|
|
47
|
+
* reads, whatever the caller sees. Pass only your own: Git compares it by
|
|
48
|
+
* identity, so a copy, another registration's or one built with the same fields owns nothing.
|
|
49
|
+
* It's an in-process value, which no HTTP, RPC or CLI input carries.
|
|
50
|
+
*/
|
|
51
|
+
readonly owner?: RefOwner;
|
|
52
|
+
}
|
|
40
53
|
/** The most names one `refs.sees` call takes: a page of 50 pulls, each with its two refs. */
|
|
41
54
|
export declare const maxSeenRefs = 100;
|
|
42
55
|
export declare const RefsSees: Schema.Struct<{
|
|
@@ -111,6 +124,14 @@ export interface RefsUpdateInput extends WriteInput, Pick<RepoInput, 'internalId
|
|
|
111
124
|
* or both together, is `INVALID_ARGUMENT`.
|
|
112
125
|
*/
|
|
113
126
|
readonly onBehalfOf?: Caller;
|
|
127
|
+
/**
|
|
128
|
+
* The registered prefix's owner, `Registration.owner`, which its registration's own `Git.register`
|
|
129
|
+
* returned: with it, the call moves the refs under that prefix, which no other caller moves,
|
|
130
|
+
* beside the refs it names that the caller may. Pass only your own: Git compares it by
|
|
131
|
+
* identity, so a copy, another registration's or one built with the same fields owns nothing.
|
|
132
|
+
* It's an in-process value, which no HTTP, RPC or CLI input carries.
|
|
133
|
+
*/
|
|
134
|
+
readonly owner?: RefOwner;
|
|
114
135
|
}
|
|
115
136
|
export declare const RefApplied: Schema.Struct<{
|
|
116
137
|
readonly kind: Schema.Literal<"applied">;
|
|
@@ -204,7 +225,7 @@ export declare const RefOutcome: Schema.Union<readonly [Schema.Struct<{
|
|
|
204
225
|
readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
|
|
205
226
|
readonly hint: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
|
|
206
227
|
readonly context: Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
207
|
-
reason: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["too-large", "rate-limited", "walk-limit", "diff-limit", "object-too-large", "delta-too-large", "response-too-large", "too-many-pointers", "fetch-plan-too-large", "too-many-store-calls", "call-budget", "events-undelivered", "events-waiting", "name-churn", "queue-full", "queue-targets-full", "too-many-gitmodules-and-gitattributes", "prune-walk-too-large", "job-step-calls", "job-step-yielded"]>, Schema.decodeTo<Schema.String, Schema.String, never, never>]>>;
|
|
228
|
+
reason: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["too-large", "rate-limited", "walk-limit", "diff-limit", "object-too-large", "repo-too-large", "delta-too-large", "response-too-large", "too-many-pointers", "fetch-plan-too-large", "too-many-store-calls", "call-budget", "events-undelivered", "events-waiting", "name-churn", "queue-full", "queue-targets-full", "too-many-gitmodules-and-gitattributes", "prune-walk-too-large", "job-step-calls", "job-step-yielded"]>, Schema.decodeTo<Schema.String, Schema.String, never, never>]>>;
|
|
208
229
|
indexBytes: Schema.optionalKey<Schema.Number>;
|
|
209
230
|
pushBytes: Schema.optionalKey<Schema.Number>;
|
|
210
231
|
most: Schema.optionalKey<Schema.Number>;
|
|
@@ -220,9 +241,10 @@ export declare const RefOutcome: Schema.Union<readonly [Schema.Struct<{
|
|
|
220
241
|
readonly hint: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
|
|
221
242
|
readonly context: Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
222
243
|
id: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
|
|
223
|
-
reason: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["busy", "packs-awaiting-repack", "awaiting-index", "may-have-saved", "too-many-writes"]>, Schema.decodeTo<Schema.String, Schema.String, never, never>]>>;
|
|
244
|
+
reason: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["busy", "packs-awaiting-repack", "awaiting-index", "may-have-saved", "too-many-writes", "starting"]>, Schema.decodeTo<Schema.String, Schema.String, never, never>]>>;
|
|
224
245
|
packs: Schema.optionalKey<Schema.Number>;
|
|
225
246
|
most: Schema.optionalKey<Schema.Number>;
|
|
247
|
+
retryAfter: Schema.optionalKey<Schema.Number>;
|
|
226
248
|
}>, readonly [Schema.$Record<Schema.String, Schema.Union<readonly [Schema.decodeTo<Schema.String, Schema.String, never, never>, Schema.Number, Schema.Boolean, Schema.$Array<Schema.decodeTo<Schema.String, Schema.String, never, never>>, Schema.Undefined]>>]>>;
|
|
227
249
|
}>)[]>;
|
|
228
250
|
}>]>;
|
|
@@ -242,7 +264,7 @@ export declare const RefProtection: Schema.Struct<{
|
|
|
242
264
|
}>;
|
|
243
265
|
export type RefProtection = typeof RefProtection.Type;
|
|
244
266
|
export interface RefCalls {
|
|
245
|
-
readonly get: (repo: RepoName, input:
|
|
267
|
+
readonly get: (repo: RepoName, input: RefGetInput) => Promise<Result<Ref>>;
|
|
246
268
|
/**
|
|
247
269
|
* The protection `Rules.protect` and `Rules.lock` give `ref`, whether or not it exists:
|
|
248
270
|
* `undefined` where neither names it. Custom push rules aren't told.
|
|
@@ -273,7 +295,7 @@ export interface RefCalls {
|
|
|
273
295
|
/** `RefCalls` as Effects, each deciding for `by`, as `ByCalls` says. */
|
|
274
296
|
export type RefsCalls<R = never> = ByCalls<RefCalls, R>;
|
|
275
297
|
declare const Refs_base: Context.ServiceClass<Refs, "@ref0/git/Refs", EffectCalls<{
|
|
276
|
-
readonly get: (repo: string, input:
|
|
298
|
+
readonly get: (repo: string, input: RefGetInput, by?: Caller<unknown> | undefined) => Promise<Result<{
|
|
277
299
|
readonly name: string;
|
|
278
300
|
readonly oid: string;
|
|
279
301
|
}>>;
|
|
@@ -298,7 +320,7 @@ declare const Refs_base: Context.ServiceClass<Refs, "@ref0/git/Refs", EffectCall
|
|
|
298
320
|
* its runtime's build, as it does `RepoRecords`, so it has no `layer`.
|
|
299
321
|
*/
|
|
300
322
|
export declare class Refs extends /* @__PURE__ */ Refs_base {}
|
|
301
|
-
export declare const get: (repo: RepoName, input:
|
|
323
|
+
export declare const get: (repo: RepoName, input: RefGetInput, by?: Caller) => Effect.Effect<{
|
|
302
324
|
readonly name: string;
|
|
303
325
|
readonly oid: string;
|
|
304
326
|
}, GitError, Refs>;
|
|
@@ -11,12 +11,10 @@ const BearerCredential = /* @__PURE__ */ Schema.Struct({ token: Schema.String })
|
|
|
11
11
|
const ClientCredential = /* @__PURE__ */ Schema.Union([BasicCredential, BearerCredential]);
|
|
12
12
|
/** A value, or a function for short-lived credentials: after a 401 it runs once more. */
|
|
13
13
|
const ClientCredentials = /* @__PURE__ */ Schema.Union([ClientCredential, FunctionValue()]);
|
|
14
|
-
/** A request's sender in place of `fetch`, held as itself. */
|
|
15
|
-
const Transport = /* @__PURE__ */ FunctionValue();
|
|
16
14
|
/** A request that failed: its status, or `0` when no answer came, and its error when it sent one. */
|
|
17
15
|
const TransportFailure = /* @__PURE__ */ Schema.Struct({
|
|
18
16
|
status: Schema.Int,
|
|
19
17
|
error: Schema.optionalKey(GitErrorValue)
|
|
20
18
|
});
|
|
21
19
|
Schema.Int;
|
|
22
|
-
export { BasicCredential, BearerCredential, ClientCredential, ClientCredentials,
|
|
20
|
+
export { BasicCredential, BearerCredential, ClientCredential, ClientCredentials, TransportFailure };
|
|
@@ -30,5 +30,6 @@ export declare const record: (repo: InternalRepoId) => Effect.Effect<{
|
|
|
30
30
|
readonly upstream?: string;
|
|
31
31
|
readonly upstreamInternalId?: `r_${string}`;
|
|
32
32
|
readonly createdAt: number;
|
|
33
|
+
readonly renamedSeq?: number;
|
|
33
34
|
} | undefined, GitError, RepoRecords>;
|
|
34
35
|
export { repo_records_d_exports };
|