@ref0/git 0.12.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 +3 -3
- 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 +11 -1
- package/dist/contracts/git.d.mts +18 -7
- 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 +23 -18
- package/dist/contracts/result.mjs +17 -4
- 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 +79 -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.mjs +27 -5
- package/dist/core/ancestry.d.mts +9 -0
- package/dist/core/ancestry.mjs +6 -6
- package/dist/core/asked.mjs +42 -4
- package/dist/core/call-names.mjs +1 -0
- package/dist/core/call-services.mjs +2 -1
- package/dist/core/events/deliver.mjs +10 -2
- package/dist/core/forks.mjs +3 -3
- package/dist/core/imports.mjs +147 -9
- 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/parts.d.mts +6 -1
- 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 +98 -26
- package/dist/core/receipts.mjs +26 -10
- package/dist/core/ref-view.mjs +59 -5
- package/dist/core/refs.mjs +13 -8
- package/dist/core/repack.mjs +11 -8
- package/dist/core/repo-info.mjs +16 -9
- package/dist/core/repos.mjs +30 -14
- 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 +3 -3
- package/dist/extend.mjs +2 -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 +114 -56
- 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/objects.d.mts +6 -0
- package/dist/lfs/objects.mjs +68 -41
- 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/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 +31 -23
- 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 +273 -240
- 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 +127 -115
- package/dist/rest/forks.d.mts +121 -97
- 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 +2 -1
- 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 +282 -226
- package/dist/rest/refs.d.mts +205 -176
- package/dist/rest/repos.d.mts +108 -80
- package/dist/rest/tags.d.mts +24 -12
- package/dist/rest/tokens.d.mts +235 -211
- package/dist/rest/topics.d.mts +53 -33
- package/dist/rest/trees.d.mts +105 -89
- 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 +3 -3
- 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 +133 -212
- 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 +28 -4
- package/dist/storage/pack-reads.mjs +8 -8
- 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-walk.mjs +54 -16
- package/dist/storage/prune.mjs +629 -196
- package/dist/storage/push-uploads.mjs +36 -12
- package/dist/storage/quarantine.mjs +9 -9
- 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 +9 -7
- package/dist/store/repo-record.mjs +102 -19
- 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 +55 -43
- package/dist/sync/http.mjs +36 -1
- package/dist/sync/import.mjs +1 -0
- 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 +210 -137
- package/dist/sync/smart-http.mjs +4 -2
- package/dist/sync/step.mjs +25 -5
- package/dist/sync/tries.mjs +45 -14
- package/dist/sync.d.mts +2 -2
- 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 -5
- 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
|
@@ -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 };
|
|
@@ -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 };
|