@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
|
@@ -7,7 +7,7 @@ import * as Schema from "effect/Schema";
|
|
|
7
7
|
import { Listing, Page } from "@ref0/infra";
|
|
8
8
|
import * as Context from "effect/Context";
|
|
9
9
|
declare namespace repos_d_exports {
|
|
10
|
-
export { JobCounts$1 as JobCounts, Moment$1 as Moment, PinnedRepo, RepoCalls, RepoCatalogueEntry, RepoCreate, RepoCreateInput, RepoDeleted, RepoGetInput, RepoIndexHold, RepoInfo, RepoInfoStats, RepoInput, RepoListInput, RepoListOrder, RepoRecord, RepoRenameInput, RepoStats, RepoUpdateInput, RepoWork, Repos, create, remove as delete, get, list, rename, update };
|
|
10
|
+
export { JobCounts$1 as JobCounts, Moment$1 as Moment, PinnedRepo, RenamedRepo, RepoCalls, RepoCatalogueEntry, RepoCreate, RepoCreateInput, RepoDeleted, RepoGetInput, RepoIndexHold, RepoInfo, RepoInfoStats, RepoInput, RepoListInput, RepoListOrder, RepoRecord, RepoRenameInput, RepoStats, RepoUpdateInput, RepoWork, Repos, create, remove as delete, get, list, rename, update };
|
|
11
11
|
}
|
|
12
12
|
/** A moment in milliseconds since the epoch, as `@ref0/infra`'s `Moment` is. */
|
|
13
13
|
declare const Moment$1: Schema.Number;
|
|
@@ -103,6 +103,12 @@ export declare const RepoInfo: Schema.Struct<{
|
|
|
103
103
|
readonly defaultBranch: Schema.optionalKey<Schema.String>;
|
|
104
104
|
readonly public: Schema.Boolean;
|
|
105
105
|
readonly upstream: Schema.optionalKey<Schema.String>;
|
|
106
|
+
/**
|
|
107
|
+
* Whether the repo's history stops short of its first commits: true while it holds roots, the
|
|
108
|
+
* commits a shallow import or a shallow fetch ends at, and false once none is left. Told to
|
|
109
|
+
* every caller, since it names no commit.
|
|
110
|
+
*/
|
|
111
|
+
readonly shallow: Schema.Boolean;
|
|
106
112
|
/**
|
|
107
113
|
* The repo's stats as this caller may know them: all of them for a caller with the whole view,
|
|
108
114
|
* and for one a private pattern restricts, only `repo`, `refs` and `pushedAt`, as
|
|
@@ -140,6 +146,64 @@ export declare const RepoInfo: Schema.Struct<{
|
|
|
140
146
|
}>>;
|
|
141
147
|
}>;
|
|
142
148
|
export type RepoInfo = typeof RepoInfo.Type;
|
|
149
|
+
/**
|
|
150
|
+
* A rename's answer: the repo under its new name, and `seq`, the place in the name's event
|
|
151
|
+
* sequence of the `repo.renamed` the rename's commit wrote, so a host matches its own work to that
|
|
152
|
+
* event, as the drop-in keys a transfer's grants by the repo and `seq`. A key sent again answers the
|
|
153
|
+
* same `seq`. Left out when the server keeps no events, with no delivery, since no event is written
|
|
154
|
+
* and the sequence doesn't move: two renames there would otherwise answer one `seq`. It's the host's,
|
|
155
|
+
* so only a call in the host's process answers it: REST, and the client over it, leave it out.
|
|
156
|
+
*/
|
|
157
|
+
export declare const RenamedRepo: Schema.Struct<{
|
|
158
|
+
readonly name: Schema.String;
|
|
159
|
+
/** Left out when the caller can't see it, a branch a private pattern matches. */
|
|
160
|
+
readonly defaultBranch: Schema.optionalKey<Schema.String>;
|
|
161
|
+
readonly public: Schema.Boolean;
|
|
162
|
+
readonly upstream: Schema.optionalKey<Schema.String>;
|
|
163
|
+
/**
|
|
164
|
+
* Whether the repo's history stops short of its first commits: true while it holds roots, the
|
|
165
|
+
* commits a shallow import or a shallow fetch ends at, and false once none is left. Told to
|
|
166
|
+
* every caller, since it names no commit.
|
|
167
|
+
*/
|
|
168
|
+
readonly shallow: Schema.Boolean;
|
|
169
|
+
/**
|
|
170
|
+
* The repo's stats as this caller may know them: all of them for a caller with the whole view,
|
|
171
|
+
* and for one a private pattern restricts, only `repo`, `refs` and `pushedAt`, as
|
|
172
|
+
* `RepoInfoStats` says.
|
|
173
|
+
*/
|
|
174
|
+
readonly stats: Schema.Struct<{
|
|
175
|
+
readonly repo: Schema.String;
|
|
176
|
+
readonly refs: Schema.Number;
|
|
177
|
+
/** As `RepoStats` counts it; left out for a caller a private pattern restricts. */
|
|
178
|
+
readonly packs: Schema.optionalKey<Schema.Number>;
|
|
179
|
+
/** As `RepoStats` counts it; left out for a caller a private pattern restricts. */
|
|
180
|
+
readonly packBytes: Schema.optionalKey<Schema.Number>;
|
|
181
|
+
/** As `RepoStats` counts it; left out for a caller a private pattern restricts. */
|
|
182
|
+
readonly ownBytes: Schema.optionalKey<Schema.Number>;
|
|
183
|
+
/** When a ref this caller sees last moved: the whole repo's for a caller with the whole view. */
|
|
184
|
+
readonly pushedAt: Schema.optionalKey<Schema.Number>;
|
|
185
|
+
/** As `RepoStats` keeps it; left out for a caller a private pattern restricts. */
|
|
186
|
+
readonly maintainedAt: Schema.optionalKey<Schema.Number>;
|
|
187
|
+
}>;
|
|
188
|
+
/**
|
|
189
|
+
* The repo's jobs, for a caller with the whole view, as `RepoInfoStats` names it; left out for
|
|
190
|
+
* one a private pattern restricts, since a push it can't see moves the jobs.
|
|
191
|
+
*/
|
|
192
|
+
readonly work: Schema.optionalKey<Schema.Struct<{
|
|
193
|
+
readonly waiting: Schema.Number;
|
|
194
|
+
readonly oldestDue: Schema.optionalKey<Schema.Number>;
|
|
195
|
+
readonly failed: Schema.Number;
|
|
196
|
+
readonly oldestFailed: Schema.optionalKey<Schema.Number>;
|
|
197
|
+
readonly index: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
198
|
+
readonly state: Schema.Literal<"refused">;
|
|
199
|
+
readonly retryAt: Schema.Number;
|
|
200
|
+
}>, Schema.Struct<{
|
|
201
|
+
readonly state: Schema.Literal<"too-large">;
|
|
202
|
+
}>]>>;
|
|
203
|
+
}>>;
|
|
204
|
+
readonly seq: Schema.optionalKey<Schema.Int>;
|
|
205
|
+
}>;
|
|
206
|
+
export type RenamedRepo = typeof RenamedRepo.Type;
|
|
143
207
|
/**
|
|
144
208
|
* A repo's name together with the internal ID it held when a request resolved it. A rename moves
|
|
145
209
|
* the name to another internal ID, so a call that holds both acts on the repo it resolved.
|
|
@@ -166,6 +230,14 @@ export declare const RepoRecord: Schema.Struct<{
|
|
|
166
230
|
/** A fork's source's internal ID, kept after the source is renamed or deleted, beside `upstream`. */
|
|
167
231
|
readonly upstreamInternalId: Schema.optionalKey<Schema.TemplateLiteral<readonly ["r_", Schema.String]>>;
|
|
168
232
|
readonly createdAt: Schema.Number;
|
|
233
|
+
/**
|
|
234
|
+
* The `seq` of the rename that gave the repo its name now, as `RenamedRepo.seq` answered it:
|
|
235
|
+
* absent for a repo never renamed, and when the server keeps no events. The host's alone, never
|
|
236
|
+
* on the wire. A host stamps its own work with it, so its work for a rename's event delivered
|
|
237
|
+
* late tells what came after: the drop-in stamps each grant, and a move drops the team grants
|
|
238
|
+
* whose stamp is `<` its `seq`.
|
|
239
|
+
*/
|
|
240
|
+
readonly renamedSeq: Schema.optionalKey<Schema.Int>;
|
|
169
241
|
}>;
|
|
170
242
|
export type RepoRecord = typeof RepoRecord.Type;
|
|
171
243
|
/** A create's own fields. Its actor, key and signal are `WriteInput`'s, with no JSON form. */
|
|
@@ -274,9 +346,15 @@ export type RepoDeleted = Record<string, never>;
|
|
|
274
346
|
export interface RepoCalls {
|
|
275
347
|
readonly create: (input: RepoCreateInput) => Promise<Result<RepoInfo>>;
|
|
276
348
|
readonly get: (repo: RepoName, input: RepoGetInput) => Promise<Result<RepoInfo>>;
|
|
349
|
+
/**
|
|
350
|
+
* The repos the caller may read, by name. Each name is as its repo's record held it when the page
|
|
351
|
+
* read it, before `authorize` was asked of it: a repo renamed, deleted or made private while the
|
|
352
|
+
* page's checks ran may be listed as it was, once, and a `get` by that name answers as the repo is
|
|
353
|
+
* now, naming where a rename took it to a caller who may read it there. No item is read again.
|
|
354
|
+
*/
|
|
277
355
|
readonly list: (input: RepoListInput) => Promise<Result<Listing<RepoName>>>;
|
|
278
356
|
readonly update: (repo: RepoName, input: RepoUpdateInput) => Promise<Result<RepoInfo>>;
|
|
279
|
-
readonly rename: (repo: RepoName, input: RepoRenameInput) => Promise<Result<
|
|
357
|
+
readonly rename: (repo: RepoName, input: RepoRenameInput) => Promise<Result<RenamedRepo>>;
|
|
280
358
|
readonly delete: (repo: RepoName, input: WriteInput & Pick<RepoInput, 'internalId'>) => Promise<Result<RepoDeleted>>;
|
|
281
359
|
}
|
|
282
360
|
/**
|
|
@@ -300,6 +378,7 @@ declare const Repos_base: Context.ServiceClass<Repos, "@ref0/git/Repos", EffectC
|
|
|
300
378
|
readonly defaultBranch?: string;
|
|
301
379
|
readonly public: boolean;
|
|
302
380
|
readonly upstream?: string;
|
|
381
|
+
readonly shallow: boolean;
|
|
303
382
|
readonly stats: {
|
|
304
383
|
readonly repo: string;
|
|
305
384
|
readonly refs: number;
|
|
@@ -327,6 +406,7 @@ declare const Repos_base: Context.ServiceClass<Repos, "@ref0/git/Repos", EffectC
|
|
|
327
406
|
readonly defaultBranch?: string;
|
|
328
407
|
readonly public: boolean;
|
|
329
408
|
readonly upstream?: string;
|
|
409
|
+
readonly shallow: boolean;
|
|
330
410
|
readonly stats: {
|
|
331
411
|
readonly repo: string;
|
|
332
412
|
readonly refs: number;
|
|
@@ -355,6 +435,7 @@ declare const Repos_base: Context.ServiceClass<Repos, "@ref0/git/Repos", EffectC
|
|
|
355
435
|
readonly defaultBranch?: string;
|
|
356
436
|
readonly public: boolean;
|
|
357
437
|
readonly upstream?: string;
|
|
438
|
+
readonly shallow: boolean;
|
|
358
439
|
readonly stats: {
|
|
359
440
|
readonly repo: string;
|
|
360
441
|
readonly refs: number;
|
|
@@ -382,6 +463,7 @@ declare const Repos_base: Context.ServiceClass<Repos, "@ref0/git/Repos", EffectC
|
|
|
382
463
|
readonly defaultBranch?: string;
|
|
383
464
|
readonly public: boolean;
|
|
384
465
|
readonly upstream?: string;
|
|
466
|
+
readonly shallow: boolean;
|
|
385
467
|
readonly stats: {
|
|
386
468
|
readonly repo: string;
|
|
387
469
|
readonly refs: number;
|
|
@@ -403,6 +485,7 @@ declare const Repos_base: Context.ServiceClass<Repos, "@ref0/git/Repos", EffectC
|
|
|
403
485
|
readonly state: "too-large";
|
|
404
486
|
};
|
|
405
487
|
};
|
|
488
|
+
readonly seq?: number;
|
|
406
489
|
}>>;
|
|
407
490
|
readonly delete: (repo: string, input: WriteInput<unknown> & Pick<RepoInput, "internalId">, by?: Caller<unknown> | undefined) => Promise<Result<RepoDeleted>>;
|
|
408
491
|
}, never>>;
|
|
@@ -416,6 +499,7 @@ export declare const create: (input: RepoCreateInput, by?: Caller) => Effect.Eff
|
|
|
416
499
|
readonly defaultBranch?: string;
|
|
417
500
|
readonly public: boolean;
|
|
418
501
|
readonly upstream?: string;
|
|
502
|
+
readonly shallow: boolean;
|
|
419
503
|
readonly stats: {
|
|
420
504
|
readonly repo: string;
|
|
421
505
|
readonly refs: number;
|
|
@@ -443,6 +527,7 @@ export declare const get: (repo: RepoName, input: ActorInput & Pick<RepoInput, '
|
|
|
443
527
|
readonly defaultBranch?: string;
|
|
444
528
|
readonly public: boolean;
|
|
445
529
|
readonly upstream?: string;
|
|
530
|
+
readonly shallow: boolean;
|
|
446
531
|
readonly stats: {
|
|
447
532
|
readonly repo: string;
|
|
448
533
|
readonly refs: number;
|
|
@@ -471,6 +556,7 @@ export declare const update: (repo: RepoName, input: RepoUpdateInput, by?: Calle
|
|
|
471
556
|
readonly defaultBranch?: string;
|
|
472
557
|
readonly public: boolean;
|
|
473
558
|
readonly upstream?: string;
|
|
559
|
+
readonly shallow: boolean;
|
|
474
560
|
readonly stats: {
|
|
475
561
|
readonly repo: string;
|
|
476
562
|
readonly refs: number;
|
|
@@ -498,6 +584,7 @@ export declare const rename: (repo: RepoName, input: RepoRenameInput, by?: Calle
|
|
|
498
584
|
readonly defaultBranch?: string;
|
|
499
585
|
readonly public: boolean;
|
|
500
586
|
readonly upstream?: string;
|
|
587
|
+
readonly shallow: boolean;
|
|
501
588
|
readonly stats: {
|
|
502
589
|
readonly repo: string;
|
|
503
590
|
readonly refs: number;
|
|
@@ -519,6 +606,7 @@ export declare const rename: (repo: RepoName, input: RepoRenameInput, by?: Calle
|
|
|
519
606
|
readonly state: "too-large";
|
|
520
607
|
};
|
|
521
608
|
};
|
|
609
|
+
readonly seq?: number;
|
|
522
610
|
}, GitError, Repos>;
|
|
523
611
|
declare const remove: (repo: RepoName, input: WriteInput & Pick<RepoInput, 'internalId'>, by?: Caller) => Effect.Effect<RepoDeleted, GitError, Repos>;
|
|
524
612
|
export { JobCounts$1 as JobCounts, Moment$1 as Moment, remove as delete, repos_d_exports };
|
package/dist/contracts/repos.mjs
CHANGED
|
@@ -8,6 +8,7 @@ var repos_exports = /* @__PURE__ */ __exportAll({
|
|
|
8
8
|
JobCounts: () => JobCounts,
|
|
9
9
|
Moment: () => Moment,
|
|
10
10
|
PinnedRepo: () => PinnedRepo,
|
|
11
|
+
RenamedRepo: () => RenamedRepo,
|
|
11
12
|
RepoCatalogueEntry: () => RepoCatalogueEntry,
|
|
12
13
|
RepoCreate: () => RepoCreate,
|
|
13
14
|
RepoIndexHold: () => RepoIndexHold,
|
|
@@ -104,6 +105,12 @@ const RepoInfo = /* @__PURE__ */ Schema.Struct({
|
|
|
104
105
|
public: Schema.Boolean,
|
|
105
106
|
upstream: Schema.optionalKey(RepoName),
|
|
106
107
|
/**
|
|
108
|
+
* Whether the repo's history stops short of its first commits: true while it holds roots, the
|
|
109
|
+
* commits a shallow import or a shallow fetch ends at, and false once none is left. Told to
|
|
110
|
+
* every caller, since it names no commit.
|
|
111
|
+
*/
|
|
112
|
+
shallow: Schema.Boolean,
|
|
113
|
+
/**
|
|
107
114
|
* The repo's stats as this caller may know them: all of them for a caller with the whole view,
|
|
108
115
|
* and for one a private pattern restricts, only `repo`, `refs` and `pushedAt`, as
|
|
109
116
|
* `RepoInfoStats` says.
|
|
@@ -116,6 +123,18 @@ const RepoInfo = /* @__PURE__ */ Schema.Struct({
|
|
|
116
123
|
work: Schema.optionalKey(RepoWork)
|
|
117
124
|
}).annotate({ identifier: "RepoInfo" });
|
|
118
125
|
/**
|
|
126
|
+
* A rename's answer: the repo under its new name, and `seq`, the place in the name's event
|
|
127
|
+
* sequence of the `repo.renamed` the rename's commit wrote, so a host matches its own work to that
|
|
128
|
+
* event, as the drop-in keys a transfer's grants by the repo and `seq`. A key sent again answers the
|
|
129
|
+
* same `seq`. Left out when the server keeps no events, with no delivery, since no event is written
|
|
130
|
+
* and the sequence doesn't move: two renames there would otherwise answer one `seq`. It's the host's,
|
|
131
|
+
* so only a call in the host's process answers it: REST, and the client over it, leave it out.
|
|
132
|
+
*/
|
|
133
|
+
const RenamedRepo = /* @__PURE__ */ Schema.Struct({
|
|
134
|
+
...RepoInfo.fields,
|
|
135
|
+
seq: Schema.optionalKey(Schema.Int)
|
|
136
|
+
}).annotate({ identifier: "RenamedRepo" });
|
|
137
|
+
/**
|
|
119
138
|
* A repo's name together with the internal ID it held when a request resolved it. A rename moves
|
|
120
139
|
* the name to another internal ID, so a call that holds both acts on the repo it resolved.
|
|
121
140
|
*/
|
|
@@ -138,7 +157,15 @@ const RepoRecord = /* @__PURE__ */ Schema.Struct({
|
|
|
138
157
|
upstream: Schema.optionalKey(RepoName),
|
|
139
158
|
/** A fork's source's internal ID, kept after the source is renamed or deleted, beside `upstream`. */
|
|
140
159
|
upstreamInternalId: Schema.optionalKey(InternalRepoId),
|
|
141
|
-
createdAt: Moment
|
|
160
|
+
createdAt: Moment,
|
|
161
|
+
/**
|
|
162
|
+
* The `seq` of the rename that gave the repo its name now, as `RenamedRepo.seq` answered it:
|
|
163
|
+
* absent for a repo never renamed, and when the server keeps no events. The host's alone, never
|
|
164
|
+
* on the wire. A host stamps its own work with it, so its work for a rename's event delivered
|
|
165
|
+
* late tells what came after: the drop-in stamps each grant, and a move drops the team grants
|
|
166
|
+
* whose stamp is `<` its `seq`.
|
|
167
|
+
*/
|
|
168
|
+
renamedSeq: Schema.optionalKey(Schema.Int)
|
|
142
169
|
});
|
|
143
170
|
/** A create's own fields. Its actor, key and signal are `WriteInput`'s, with no JSON form. */
|
|
144
171
|
const RepoCreate = /* @__PURE__ */ Schema.Struct({
|
|
@@ -172,4 +199,4 @@ const list = (input, by) => Effect.flatMap(Effect.service(Repos), (calls) => cal
|
|
|
172
199
|
const update = (repo, input, by) => Effect.flatMap(Effect.service(Repos), (calls) => calls.update(repo, input, by));
|
|
173
200
|
const rename = (repo, input, by) => Effect.flatMap(Effect.service(Repos), (calls) => calls.rename(repo, input, by));
|
|
174
201
|
const remove = (repo, input, by) => Effect.flatMap(Effect.service(Repos), (calls) => calls.delete(repo, input, by));
|
|
175
|
-
export { JobCounts, Moment, PinnedRepo, RepoCatalogueEntry, RepoCreate, RepoIndexHold, RepoInfo, RepoInfoStats, RepoRecord, RepoStats, RepoWork, Repos, create, remove as delete, get, list, rename, repos_exports, update };
|
|
202
|
+
export { JobCounts, Moment, PinnedRepo, RenamedRepo, RepoCatalogueEntry, RepoCreate, RepoIndexHold, RepoInfo, RepoInfoStats, RepoRecord, RepoStats, RepoWork, Repos, create, remove as delete, get, list, rename, repos_exports, update };
|
|
@@ -98,11 +98,17 @@ export type PreconditionContext = typeof PreconditionContext.Type;
|
|
|
98
98
|
* add or hold may fit once one leaves. `queue-targets-full` is a write onto a new target once the
|
|
99
99
|
* repo's queues hold as many targets as they may, which no leave mends: queue onto one it holds.
|
|
100
100
|
*
|
|
101
|
-
* `
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
101
|
+
* `repo-too-large` is a push that would take its repo's `ownBytes` past the server's
|
|
102
|
+
* `pushes.repo.refuseAbove`, which no default sets. Only a push that adds bytes is refused, so one
|
|
103
|
+
* that deletes or moves refs still lands.
|
|
104
|
+
*
|
|
105
|
+
* `prune-walk-too-large` is upkeep's prune pass, refused at one of the bounds its message names:
|
|
106
|
+
* - its walk's charge past the step's allotment, its seen set of a bit an object beside a fixed
|
|
107
|
+
* room for its packs' indexes, `pruneIndexFloor`'s 32 MiB: past about 141,500,000 objects at
|
|
108
|
+
* the default memory. Raise `packs()`' `memory` past its default of 128,000,000 bytes, on a
|
|
109
|
+
* host with the room, such as Node; a Worker's isolate has no more;
|
|
110
|
+
* - a listed pack whose index alone passes that room, past about 1,048,000 objects: a push's,
|
|
111
|
+
* since a merge cuts each pack it writes to fit;
|
|
106
112
|
* - one step of the walk past a try's calls: raise the adapter's `callLimits`, on Cloudflare its
|
|
107
113
|
* `subrequests` up to the Worker's own `limits.subrequests`, and `packs()`' `callLimits` where
|
|
108
114
|
* it sets lower ones.
|
|
@@ -124,14 +130,14 @@ export type PreconditionContext = typeof PreconditionContext.Type;
|
|
|
124
130
|
* tries it again by the job's policy, and the next try goes on from what it saved. Its context is
|
|
125
131
|
* `job-step-calls`', and each try it takes spends one of the job's attempts.
|
|
126
132
|
*/
|
|
127
|
-
export declare const ResourceReason: 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"]>;
|
|
133
|
+
export declare const ResourceReason: 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"]>;
|
|
128
134
|
/**
|
|
129
135
|
* A push refused `too-large` by the repo's pack indexes it reads: those indexes' bytes in
|
|
130
136
|
* `indexBytes`, the push's own beside them in `pushBytes`, and the most the server's memory could
|
|
131
137
|
* give it in `most`.
|
|
132
138
|
*/
|
|
133
139
|
export declare const ResourceContext: Schema.StructWithRest<Schema.Struct<{
|
|
134
|
-
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>]>>;
|
|
140
|
+
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>]>>;
|
|
135
141
|
indexBytes: Schema.optionalKey<Schema.Number>;
|
|
136
142
|
pushBytes: Schema.optionalKey<Schema.Number>;
|
|
137
143
|
most: Schema.optionalKey<Schema.Number>;
|
|
@@ -166,14 +172,21 @@ export type HostErrorContext = typeof HostErrorContext.Type;
|
|
|
166
172
|
* index is rebuilt for the server's patterns: the same call is served once the index is built.
|
|
167
173
|
* `may-have-saved`: the write may have landed, so read it back before sending it again.
|
|
168
174
|
* `too-many-writes`: other writes won every try, so no ref changed; sending the same request again
|
|
169
|
-
* is safe.
|
|
175
|
+
* is safe. `starting`: the server's build failed on weather, and a call once `retryAfter` seconds
|
|
176
|
+
* pass starts it again.
|
|
177
|
+
*/
|
|
178
|
+
export declare const UnavailableReason: Schema.Literals<readonly ["busy", "packs-awaiting-repack", "awaiting-index", "may-have-saved", "too-many-writes", "starting"]>;
|
|
179
|
+
/**
|
|
180
|
+
* `UNAVAILABLE`'s context: `reason` says why, and `retryAfter`, the seconds to wait, comes with
|
|
181
|
+
* `starting`, as HTTP's `Retry-After` does. Both are additions: a caller that reads neither meets
|
|
182
|
+
* `UNAVAILABLE` and a 503, as it did when a failed build answered that way for good.
|
|
170
183
|
*/
|
|
171
|
-
export declare const UnavailableReason: Schema.Literals<readonly ["busy", "packs-awaiting-repack", "awaiting-index", "may-have-saved", "too-many-writes"]>;
|
|
172
184
|
export declare const UnavailableContext: Schema.StructWithRest<Schema.Struct<{
|
|
173
185
|
id: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
|
|
174
|
-
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>]>>;
|
|
186
|
+
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>]>>;
|
|
175
187
|
packs: Schema.optionalKey<Schema.Number>;
|
|
176
188
|
most: Schema.optionalKey<Schema.Number>;
|
|
189
|
+
retryAfter: Schema.optionalKey<Schema.Number>;
|
|
177
190
|
}>, 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]>>]>;
|
|
178
191
|
export type UnavailableContext = typeof UnavailableContext.Type;
|
|
179
192
|
/** Each code's context. */
|
|
@@ -208,7 +221,7 @@ export declare const gitErrorContexts: {
|
|
|
208
221
|
tip: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
|
|
209
222
|
}>, 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]>>]>;
|
|
210
223
|
readonly RESOURCE_EXHAUSTED: Schema.StructWithRest<Schema.Struct<{
|
|
211
|
-
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>]>>;
|
|
224
|
+
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>]>>;
|
|
212
225
|
indexBytes: Schema.optionalKey<Schema.Number>;
|
|
213
226
|
pushBytes: Schema.optionalKey<Schema.Number>;
|
|
214
227
|
most: Schema.optionalKey<Schema.Number>;
|
|
@@ -218,9 +231,10 @@ export declare const gitErrorContexts: {
|
|
|
218
231
|
}>, 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]>>]>;
|
|
219
232
|
readonly UNAVAILABLE: Schema.StructWithRest<Schema.Struct<{
|
|
220
233
|
id: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
|
|
221
|
-
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>]>>;
|
|
234
|
+
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>]>>;
|
|
222
235
|
packs: Schema.optionalKey<Schema.Number>;
|
|
223
236
|
most: Schema.optionalKey<Schema.Number>;
|
|
237
|
+
retryAfter: Schema.optionalKey<Schema.Number>;
|
|
224
238
|
}>, 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]>>]>;
|
|
225
239
|
readonly DATA_LOSS: Schema.StructWithRest<Schema.Struct<{
|
|
226
240
|
reason: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["event-version", "graph-length", "merge-incomplete"]>, Schema.decodeTo<Schema.String, Schema.String, never, never>]>>;
|
|
@@ -302,7 +316,7 @@ export declare const GitErrorBody: Schema.Union<(Schema.Struct<{
|
|
|
302
316
|
readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
|
|
303
317
|
readonly hint: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
|
|
304
318
|
readonly context: Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
305
|
-
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>]>>;
|
|
319
|
+
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>]>>;
|
|
306
320
|
indexBytes: Schema.optionalKey<Schema.Number>;
|
|
307
321
|
pushBytes: Schema.optionalKey<Schema.Number>;
|
|
308
322
|
most: Schema.optionalKey<Schema.Number>;
|
|
@@ -318,14 +332,15 @@ export declare const GitErrorBody: Schema.Union<(Schema.Struct<{
|
|
|
318
332
|
readonly hint: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
|
|
319
333
|
readonly context: Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
320
334
|
id: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
|
|
321
|
-
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>]>>;
|
|
335
|
+
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>]>>;
|
|
322
336
|
packs: Schema.optionalKey<Schema.Number>;
|
|
323
337
|
most: Schema.optionalKey<Schema.Number>;
|
|
338
|
+
retryAfter: Schema.optionalKey<Schema.Number>;
|
|
324
339
|
}>, 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]>>]>>;
|
|
325
340
|
}>)[]>;
|
|
326
341
|
export type GitErrorBody = typeof GitErrorBody.Type;
|
|
327
342
|
/** Every reason a refusal names, each once, by code: what `ref0-push-reasons` tells. */
|
|
328
|
-
declare const refusalReasonLists: readonly [Schema.Literals<readonly ["ofs-delta", "fsck", "provider-unknown", "body-ended", "link-wrong-type", "tag-target-missing", "object-missing", "boundary-not-in-pack", "too-many-short-ids", "too-many-parents"]>, Schema.Literals<readonly ["files-refused", "entry-unpublishable", "fetch-depth-unsupported"]>, Schema.Literals<readonly ["key-reused"]>, Schema.Literals<readonly ["no-queue", "no-sync", "no-topics", "ambiguous"]>, Schema.Literals<readonly ["cursor-expired", "diverged", "merge-conflict", "candidate-superseded", "candidate-cancelled", "entry-gone", "ref-conflict", "newer-format", "changed-while-checked", "unsupported-attribute", "unrelated-histories", "unsupported-virtual-base", "own-repo", "not-a-fork", "no-copy-rows", "shallow-root", "shallow-upload", "import-cancelled", "importing", "history-not-imported", "stage-gone", "remote-refused", "atomic-partner", "merges-off", "no-releases"]>, 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.Literals<readonly ["busy", "packs-awaiting-repack", "awaiting-index", "may-have-saved", "too-many-writes"]>, Schema.Literals<readonly ["event-version", "graph-length", "merge-incomplete"]>];
|
|
343
|
+
declare const refusalReasonLists: readonly [Schema.Literals<readonly ["ofs-delta", "fsck", "provider-unknown", "body-ended", "link-wrong-type", "tag-target-missing", "object-missing", "boundary-not-in-pack", "too-many-short-ids", "too-many-parents"]>, Schema.Literals<readonly ["files-refused", "entry-unpublishable", "fetch-depth-unsupported"]>, Schema.Literals<readonly ["key-reused"]>, Schema.Literals<readonly ["no-queue", "no-sync", "no-topics", "ambiguous"]>, Schema.Literals<readonly ["cursor-expired", "diverged", "merge-conflict", "candidate-superseded", "candidate-cancelled", "entry-gone", "ref-conflict", "newer-format", "changed-while-checked", "unsupported-attribute", "unrelated-histories", "unsupported-virtual-base", "own-repo", "not-a-fork", "no-copy-rows", "shallow-root", "shallow-upload", "import-cancelled", "importing", "history-not-imported", "stage-gone", "remote-refused", "atomic-partner", "merges-off", "no-releases"]>, 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.Literals<readonly ["busy", "packs-awaiting-repack", "awaiting-index", "may-have-saved", "too-many-writes", "starting"]>, Schema.Literals<readonly ["event-version", "graph-length", "merge-incomplete"]>];
|
|
329
344
|
/** A refusal's reason, of every code whose context names one. */
|
|
330
345
|
export type RefusalReason = (typeof refusalReasonLists)[number]['Type'];
|
|
331
346
|
export interface GitErrorFields {
|
|
@@ -412,14 +427,6 @@ export interface Accepted<Data = undefined> {
|
|
|
412
427
|
}
|
|
413
428
|
/** A host check's answer: `decisionAnswer` reads one a host's JavaScript gave. */
|
|
414
429
|
export type DecisionAnswer<Data = undefined> = Accepted<Data> | Rejected;
|
|
415
|
-
/** With no value, it fits any answer: a fetch rule's as well as a push rule's. */
|
|
416
|
-
export declare function accept(): Accepted<never>;
|
|
417
|
-
export declare function accept<Data>(value: Data): Accepted<Data>;
|
|
418
|
-
/**
|
|
419
|
-
* A host function's refusal of `input`, read field by field: a `GitError` given as `input` keeps
|
|
420
|
-
* `message` off its enumerable keys, so a spread of one would drop it.
|
|
421
|
-
*/
|
|
422
|
-
export declare const reject: ({ code, message, hint, context }: RejectInput) => Rejected;
|
|
423
430
|
/**
|
|
424
431
|
* The host functions Git runs, by the name its logs give each. When one throws, fails or runs past
|
|
425
432
|
* its timeout, its caller gets a fixed sentence and a failure ID, and the runtime's Logger gets a
|
|
@@ -179,11 +179,17 @@ const PreconditionContext = contextOf({
|
|
|
179
179
|
* add or hold may fit once one leaves. `queue-targets-full` is a write onto a new target once the
|
|
180
180
|
* repo's queues hold as many targets as they may, which no leave mends: queue onto one it holds.
|
|
181
181
|
*
|
|
182
|
-
* `
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
182
|
+
* `repo-too-large` is a push that would take its repo's `ownBytes` past the server's
|
|
183
|
+
* `pushes.repo.refuseAbove`, which no default sets. Only a push that adds bytes is refused, so one
|
|
184
|
+
* that deletes or moves refs still lands.
|
|
185
|
+
*
|
|
186
|
+
* `prune-walk-too-large` is upkeep's prune pass, refused at one of the bounds its message names:
|
|
187
|
+
* - its walk's charge past the step's allotment, its seen set of a bit an object beside a fixed
|
|
188
|
+
* room for its packs' indexes, `pruneIndexFloor`'s 32 MiB: past about 141,500,000 objects at
|
|
189
|
+
* the default memory. Raise `packs()`' `memory` past its default of 128,000,000 bytes, on a
|
|
190
|
+
* host with the room, such as Node; a Worker's isolate has no more;
|
|
191
|
+
* - a listed pack whose index alone passes that room, past about 1,048,000 objects: a push's,
|
|
192
|
+
* since a merge cuts each pack it writes to fit;
|
|
187
193
|
* - one step of the walk past a try's calls: raise the adapter's `callLimits`, on Cloudflare its
|
|
188
194
|
* `subrequests` up to the Worker's own `limits.subrequests`, and `packs()`' `callLimits` where
|
|
189
195
|
* it sets lower ones.
|
|
@@ -211,6 +217,7 @@ const ResourceReason = /* @__PURE__ */ Schema.Literals([
|
|
|
211
217
|
"walk-limit",
|
|
212
218
|
"diff-limit",
|
|
213
219
|
"object-too-large",
|
|
220
|
+
"repo-too-large",
|
|
214
221
|
"delta-too-large",
|
|
215
222
|
"response-too-large",
|
|
216
223
|
"too-many-pointers",
|
|
@@ -265,20 +272,28 @@ const HostErrorContext = contextOf({ id: Schema.optionalKey(BodyText) });
|
|
|
265
272
|
* index is rebuilt for the server's patterns: the same call is served once the index is built.
|
|
266
273
|
* `may-have-saved`: the write may have landed, so read it back before sending it again.
|
|
267
274
|
* `too-many-writes`: other writes won every try, so no ref changed; sending the same request again
|
|
268
|
-
* is safe.
|
|
275
|
+
* is safe. `starting`: the server's build failed on weather, and a call once `retryAfter` seconds
|
|
276
|
+
* pass starts it again.
|
|
269
277
|
*/
|
|
270
278
|
const UnavailableReason = /* @__PURE__ */ Schema.Literals([
|
|
271
279
|
"busy",
|
|
272
280
|
"packs-awaiting-repack",
|
|
273
281
|
"awaiting-index",
|
|
274
282
|
"may-have-saved",
|
|
275
|
-
"too-many-writes"
|
|
276
|
-
|
|
283
|
+
"too-many-writes",
|
|
284
|
+
"starting"
|
|
285
|
+
]).annotate({ description: "`may-have-saved`: the write may have landed; read it back before you send it again. `too-many-writes`: other writes won every try, so no ref changed; sending the same request again is safe. `starting`: the server failed to start and starts again once `retryAfter` seconds pass." });
|
|
286
|
+
/**
|
|
287
|
+
* `UNAVAILABLE`'s context: `reason` says why, and `retryAfter`, the seconds to wait, comes with
|
|
288
|
+
* `starting`, as HTTP's `Retry-After` does. Both are additions: a caller that reads neither meets
|
|
289
|
+
* `UNAVAILABLE` and a 503, as it did when a failed build answered that way for good.
|
|
290
|
+
*/
|
|
277
291
|
const UnavailableContext = contextOf({
|
|
278
292
|
id: Schema.optionalKey(BodyText),
|
|
279
293
|
reason: reasonOf(UnavailableReason),
|
|
280
294
|
packs: Count,
|
|
281
|
-
most: Count
|
|
295
|
+
most: Count,
|
|
296
|
+
retryAfter: Count
|
|
282
297
|
});
|
|
283
298
|
/**
|
|
284
299
|
* A code's refusal as it crosses HTTP: its fields by name, so neither its tag nor what HTTP strips,
|
|
@@ -574,6 +574,17 @@ declare const FetchRuleOf: Schema.Struct<{
|
|
|
574
574
|
type FetchRuleOf = typeof FetchRuleOf.Type;
|
|
575
575
|
/** A clone or fetch over Git's protocol, with its HTTP request and what its client asked. */
|
|
576
576
|
export declare const FetchGitRuleInput: Schema.Struct<{
|
|
577
|
+
readonly actor: Schema.Union<readonly [Schema.Struct<{
|
|
578
|
+
readonly id: Schema.String;
|
|
579
|
+
readonly anonymous: Schema.optionalKey<Schema.Literal<false>>;
|
|
580
|
+
readonly meta: Schema.optionalKey<Schema.Unknown>;
|
|
581
|
+
}>, Schema.Struct<{
|
|
582
|
+
readonly anonymous: Schema.Literal<true>;
|
|
583
|
+
readonly meta: Schema.optionalKey<Schema.Unknown>;
|
|
584
|
+
}>]>;
|
|
585
|
+
readonly repo: Schema.String;
|
|
586
|
+
readonly kind: Schema.Literal<"git">;
|
|
587
|
+
readonly request: Schema.declare<Request, Request>;
|
|
577
588
|
readonly wants: Schema.mutable<Schema.$Array<Schema.String>>;
|
|
578
589
|
readonly haves: Schema.mutable<Schema.$Array<Schema.String>>;
|
|
579
590
|
readonly shallows: Schema.mutable<Schema.$Array<Schema.String>>;
|
|
@@ -590,17 +601,6 @@ export declare const FetchGitRuleInput: Schema.Struct<{
|
|
|
590
601
|
}>]>>;
|
|
591
602
|
readonly includeTag: Schema.Boolean;
|
|
592
603
|
readonly thinPack: Schema.optionalKey<Schema.Literal<true>>;
|
|
593
|
-
readonly actor: Schema.Union<readonly [Schema.Struct<{
|
|
594
|
-
readonly id: Schema.String;
|
|
595
|
-
readonly anonymous: Schema.optionalKey<Schema.Literal<false>>;
|
|
596
|
-
readonly meta: Schema.optionalKey<Schema.Unknown>;
|
|
597
|
-
}>, Schema.Struct<{
|
|
598
|
-
readonly anonymous: Schema.Literal<true>;
|
|
599
|
-
readonly meta: Schema.optionalKey<Schema.Unknown>;
|
|
600
|
-
}>]>;
|
|
601
|
-
readonly repo: Schema.String;
|
|
602
|
-
readonly kind: Schema.Literal<"git">;
|
|
603
|
-
readonly request: Schema.declare<Request, Request>;
|
|
604
604
|
}>;
|
|
605
605
|
export type FetchGitRuleInput = typeof FetchGitRuleInput.Type;
|
|
606
606
|
/**
|
|
@@ -673,6 +673,17 @@ export declare const FetchReadRuleInput: Schema.Union<readonly [Schema.Struct<{
|
|
|
673
673
|
*/
|
|
674
674
|
export type FetchRuleInput = FetchGitRuleInput | FetchReadRuleInput;
|
|
675
675
|
export declare const FetchRuleInput: Schema.Union<readonly [Schema.Struct<{
|
|
676
|
+
readonly actor: Schema.Union<readonly [Schema.Struct<{
|
|
677
|
+
readonly id: Schema.String;
|
|
678
|
+
readonly anonymous: Schema.optionalKey<Schema.Literal<false>>;
|
|
679
|
+
readonly meta: Schema.optionalKey<Schema.Unknown>;
|
|
680
|
+
}>, Schema.Struct<{
|
|
681
|
+
readonly anonymous: Schema.Literal<true>;
|
|
682
|
+
readonly meta: Schema.optionalKey<Schema.Unknown>;
|
|
683
|
+
}>]>;
|
|
684
|
+
readonly repo: Schema.String;
|
|
685
|
+
readonly kind: Schema.Literal<"git">;
|
|
686
|
+
readonly request: Schema.declare<Request, Request>;
|
|
676
687
|
readonly wants: Schema.mutable<Schema.$Array<Schema.String>>;
|
|
677
688
|
readonly haves: Schema.mutable<Schema.$Array<Schema.String>>;
|
|
678
689
|
readonly shallows: Schema.mutable<Schema.$Array<Schema.String>>;
|
|
@@ -689,17 +700,6 @@ export declare const FetchRuleInput: Schema.Union<readonly [Schema.Struct<{
|
|
|
689
700
|
}>]>>;
|
|
690
701
|
readonly includeTag: Schema.Boolean;
|
|
691
702
|
readonly thinPack: Schema.optionalKey<Schema.Literal<true>>;
|
|
692
|
-
readonly actor: Schema.Union<readonly [Schema.Struct<{
|
|
693
|
-
readonly id: Schema.String;
|
|
694
|
-
readonly anonymous: Schema.optionalKey<Schema.Literal<false>>;
|
|
695
|
-
readonly meta: Schema.optionalKey<Schema.Unknown>;
|
|
696
|
-
}>, Schema.Struct<{
|
|
697
|
-
readonly anonymous: Schema.Literal<true>;
|
|
698
|
-
readonly meta: Schema.optionalKey<Schema.Unknown>;
|
|
699
|
-
}>]>;
|
|
700
|
-
readonly repo: Schema.String;
|
|
701
|
-
readonly kind: Schema.Literal<"git">;
|
|
702
|
-
readonly request: Schema.declare<Request, Request>;
|
|
703
703
|
}>, Schema.Union<readonly [Schema.Struct<{
|
|
704
704
|
readonly actor: Schema.Union<readonly [Schema.Struct<{
|
|
705
705
|
readonly id: Schema.String;
|