@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
|
@@ -83,16 +83,17 @@ const receivePackCapabilities = (agent, offers = {}) => [
|
|
|
83
83
|
];
|
|
84
84
|
/**
|
|
85
85
|
* `info/refs` for `service` in v0, as `encodeAdvertisement` writes it, with none of the refs under
|
|
86
|
-
* `table`'s prefixes: a server's own, its registered prefixes among them.
|
|
86
|
+
* `table`'s prefixes: a server's own, its registered prefixes among them. `roots` are upload-pack's
|
|
87
|
+
* `shallow` lines, as `advertisementPages` writes them.
|
|
87
88
|
*/
|
|
88
|
-
const advertisementOf = /* @__PURE__ */ Effect.fnUntraced(function* (service, served, capabilities, table) {
|
|
89
|
+
const advertisementOf = /* @__PURE__ */ Effect.fnUntraced(function* (service, served, capabilities, table, roots = []) {
|
|
89
90
|
const head = headOf(served);
|
|
90
91
|
const lines = advertisementPages(service, service === "git-upload-pack" && head !== void 0 ? { headRef: head } : {}, capabilities, table);
|
|
91
92
|
const refs = served.refs.toSorted((a, b) => byName(a.name, b.name));
|
|
92
93
|
return joinedBytes([
|
|
93
94
|
yield* lines.start,
|
|
94
95
|
yield* lines.page(refs),
|
|
95
|
-
yield* lines.end
|
|
96
|
+
yield* lines.end(roots)
|
|
96
97
|
]);
|
|
97
98
|
});
|
|
98
99
|
/**
|
|
@@ -118,6 +119,10 @@ const onLines = (what, texts) => {
|
|
|
118
119
|
* `info/refs` for `service` in v0, a page at a time: the service line, its flush and `HEAD`, then
|
|
119
120
|
* each page's refs, `capabilities` on the first line written, each tag's peel after it for
|
|
120
121
|
* `git-upload-pack`, and a ref-less line for the capabilities when no ref came, then the flush.
|
|
122
|
+
* Before the flush, `git-upload-pack`'s writes a `shallow` line for each root `end` is given, as
|
|
123
|
+
* Git's own upload-pack writes a shallow repo's grafts: a v0 fetch that asks for no depth has no
|
|
124
|
+
* other place to be told where the history stops, and Git's client writes them to a clone's
|
|
125
|
+
* shallow file.
|
|
121
126
|
*/
|
|
122
127
|
const advertisementPages = (service, listed, capabilities, table) => {
|
|
123
128
|
const uploading = service === "git-upload-pack";
|
|
@@ -139,7 +144,7 @@ const advertisementPages = (service, listed, capabilities, table) => {
|
|
|
139
144
|
const shown = refs.filter((ref) => listsRef(table, ref.name, []));
|
|
140
145
|
return Effect.andThen(onLines("advertisement", shown.map((ref) => ref.name)), () => textLines(lines(shown), false));
|
|
141
146
|
},
|
|
142
|
-
end: Effect.suspend(() => textLines(first ? [`${zero} capabilities^{}\0${caps}\n`] : [], true))
|
|
147
|
+
end: (roots) => Effect.suspend(() => textLines([...first ? [`${zero} capabilities^{}\0${caps}\n`] : [], ...uploading ? roots.map((root) => `shallow ${root}\n`) : []], true))
|
|
143
148
|
};
|
|
144
149
|
};
|
|
145
150
|
/**
|
|
@@ -12,11 +12,13 @@ export declare const encodeErr: (message: string) => Effect.Effect<Uint8Array<Ar
|
|
|
12
12
|
* A prefix whose refs are Git's own: only `owner`, the registration that registered it or an import,
|
|
13
13
|
* moves one, and no push or API call does. v0 never advertises them. v2's `ls-refs`, and
|
|
14
14
|
* `refs.list`, list one only for an asked prefix under it when `underPrefix` is `listed`, and never
|
|
15
|
-
* when it's `hidden`, nor does a fetch reach a commit only a `hidden` one holds.
|
|
15
|
+
* when it's `hidden`, nor does a fetch reach a commit only a `hidden` one holds. An `owned` one is
|
|
16
|
+
* the owner's alone: no listing, count, fetch, fork or `refs.get` shows it to anyone else, a caller
|
|
17
|
+
* who reads every private pattern included.
|
|
16
18
|
*/
|
|
17
19
|
export interface HiddenRefs {
|
|
18
20
|
readonly owner: RefOwner;
|
|
19
|
-
readonly underPrefix: 'listed' | 'hidden';
|
|
21
|
+
readonly underPrefix: 'listed' | 'hidden' | 'owned';
|
|
20
22
|
/** Who moves them, as a refusal says it. */
|
|
21
23
|
readonly mover: string;
|
|
22
24
|
}
|
|
@@ -95,13 +95,19 @@ const gitsOwnRefs = [{
|
|
|
95
95
|
}];
|
|
96
96
|
/**
|
|
97
97
|
* A registered prefix's row, as the registry adds it for a registration with `refs`: listed for a prefix
|
|
98
|
-
* under it,
|
|
98
|
+
* under it, or `owned`, the registration's alone, when it registered `refsReadBy: 'owner'`, and moved only by
|
|
99
|
+
* the registration, which a refusal names.
|
|
99
100
|
*/
|
|
100
|
-
const registeredRow = (owner) => ({
|
|
101
|
+
const registeredRow = (owner, owned = false) => ({
|
|
101
102
|
owner,
|
|
102
|
-
underPrefix: "listed",
|
|
103
|
+
underPrefix: owned ? "owned" : "listed",
|
|
103
104
|
mover: `the ${owner.owner} feature`
|
|
104
105
|
});
|
|
106
|
+
/**
|
|
107
|
+
* Whether `name`, or every ref under the prefix `name` when it ends in `/`, is under an `owned`
|
|
108
|
+
* prefix: one no caller's view sees, which only its owner's, `viewOf`'s, adds back.
|
|
109
|
+
*/
|
|
110
|
+
const ownedAway = (table, name) => hiddenUnder(table, name)?.underPrefix === "owned";
|
|
105
111
|
/** `table`'s hidden prefix `name` is under, if any. */
|
|
106
112
|
const hiddenUnder = (table, name) => table.find((hidden) => name.startsWith(hidden.owner.prefix));
|
|
107
113
|
/**
|
|
@@ -111,7 +117,7 @@ const hiddenUnder = (table, name) => table.find((hidden) => name.startsWith(hidd
|
|
|
111
117
|
const gitsOwnMove = (table, as, ref) => as !== void 0 && hiddenUnder(table, ref)?.owner === as;
|
|
112
118
|
/**
|
|
113
119
|
* Whether a host's own listing for `prefix` shows `name`, as `refs.list` does: a ref under a
|
|
114
|
-
* hidden prefix only for a prefix under it, of
|
|
120
|
+
* hidden prefix only for a prefix under it, of any kind, since the host's code asks for it.
|
|
115
121
|
*/
|
|
116
122
|
const hostLists = (table, name, prefix) => {
|
|
117
123
|
const hidden = hiddenUnder(table, name);
|
|
@@ -129,4 +135,4 @@ const listsRef = (table, name, prefixes) => {
|
|
|
129
135
|
if (prefixes.length === 0) return hidden === void 0;
|
|
130
136
|
return prefixes.some((prefix) => name.startsWith(prefix) && (hidden === void 0 || hidden.underPrefix === "listed" && prefix.startsWith(hidden.owner.prefix)));
|
|
131
137
|
};
|
|
132
|
-
export { byName, decoded, encodeErr, fetchReaches, gitsOwnMove, gitsOwnRefs, hiddenUnder, hostLists, importOwner, isWord, listsRef, readSection, refusedText, registeredRow, textLines, unwritable };
|
|
138
|
+
export { byName, decoded, encodeErr, fetchReaches, gitsOwnMove, gitsOwnRefs, hiddenUnder, hostLists, importOwner, isWord, listsRef, ownedAway, readSection, refusedText, registeredRow, textLines, unwritable };
|
|
@@ -17,4 +17,16 @@ const pushUploadAbove = (capabilities) => {
|
|
|
17
17
|
const above = Number(raw);
|
|
18
18
|
return Number.isSafeInteger(above) ? above : void 0;
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
/** `seconds` within `retryAfterLeast` and `retryAfterMost`, whole. */
|
|
21
|
+
const retryAfterOf = (seconds) => Math.min(Math.max(Math.ceil(seconds), 1), 10);
|
|
22
|
+
/**
|
|
23
|
+
* The least time a claimed upload keeps before its row's `removeAt`, set at begin a day past its
|
|
24
|
+
* links' hour: complete claims an upload only this long or more before it, so upkeep leaves its
|
|
25
|
+
* push at least this long to be received. It's also how long a client sends complete again while
|
|
26
|
+
* it answers 202, counted from its first, so a client never gives up on an upload upkeep could
|
|
27
|
+
* delete sooner; the server may still land it after. At `removeAt` upkeep deletes the upload's
|
|
28
|
+
* rows, its answer with them, so a step still running then finds them gone, stops, and keeps no
|
|
29
|
+
* report.
|
|
30
|
+
*/
|
|
31
|
+
const completeMost = 432e5;
|
|
32
|
+
export { completeMost, pushUploadAbove, pushUploadCapability, pushUploadOffer, retryAfterOf };
|
|
@@ -127,7 +127,7 @@ const lsRefsOf = /* @__PURE__ */ Effect.fnUntraced(function* (served, asked, tab
|
|
|
127
127
|
return joinedBytes([
|
|
128
128
|
yield* lines.start,
|
|
129
129
|
yield* lines.page(refs),
|
|
130
|
-
yield* lines.end
|
|
130
|
+
yield* lines.end([])
|
|
131
131
|
]);
|
|
132
132
|
});
|
|
133
133
|
/**
|
|
@@ -151,7 +151,7 @@ const lsRefsPages = (listed, asked, table) => {
|
|
|
151
151
|
return {
|
|
152
152
|
start: Effect.suspend(() => lines(served.head === void 0 ? [] : [served.head], () => headLines(served, asked))),
|
|
153
153
|
page: (refs) => Effect.suspend(() => lines(refs.map((ref) => ref.name), () => refs.filter((ref) => listsRef(table, ref.name, asked.prefixes)).map((ref) => `${ref.oid} ${ref.name}${peeled(ref.peeled)}\n`))),
|
|
154
|
-
end: textLines([], true)
|
|
154
|
+
end: () => textLines([], true)
|
|
155
155
|
};
|
|
156
156
|
};
|
|
157
157
|
/**
|
package/dist/protocol.d.mts
CHANGED
|
@@ -5,6 +5,8 @@ import { WireDecodeError, WireEncodeError } from "./protocol/bytes/errors.mjs";
|
|
|
5
5
|
import { InflateError, Inflated, MemberInflater, inflaterBytes, memberInflater } from "./protocol/bytes/inflate.mjs";
|
|
6
6
|
import { joinedBytes } from "./protocol/bytes/joined.mjs";
|
|
7
7
|
import { Sha1, Sha1State, decodeSha1State, sha1Of } from "./protocol/bytes/sha1.mjs";
|
|
8
|
+
import { Sha256, Sha256State, decodeSha256State } from "./protocol/bytes/sha256.mjs";
|
|
9
|
+
import { Sha256Hasher, nativeSha256Hasher } from "./protocol/bytes/sha256-hasher.mjs";
|
|
8
10
|
import { DiffEntry, DiffStatus, parseDiffRaw } from "./protocol/diff/diff-raw.mjs";
|
|
9
11
|
import { DiffError, DiffLimits, DiffRead, defaultDiffLimits } from "./protocol/diff/read.mjs";
|
|
10
12
|
import { LineCount, LineCounter, PairedChanges, WireDiffInput, countLines, pairRenames, walkTrees } from "./protocol/diff/tree-diff.mjs";
|
|
@@ -29,4 +31,4 @@ import { AckMode, FetchAnswerHead, FetchAnswerStart, FetchRound, encodeAcknowled
|
|
|
29
31
|
import { PushStart, PushStartRead, RefCommand, encodePushStart, maxPushOptionBytes, maxPushOptions, pushOptionsRefusal, readPushStart, withCommands } from "./protocol/wire/receive-pack.mjs";
|
|
30
32
|
import { PushReport, PushReportRead, RefResult, ReportFormat, encodePushReport, readPushReport } from "./protocol/wire/report-status.mjs";
|
|
31
33
|
import { LsRefs, LsRefsAnswer, V2Advertised, V2Command, V2Request, encodeLsRefs, encodeV2Capabilities, encodeV2Request, lsRefsArguments, maxPrefixes, readLsRefs, readLsRefsAnswer, readV2Capabilities, readV2Request, v2Capabilities } from "./protocol/wire/v2.mjs";
|
|
32
|
-
export { AckMode, AdvertisedRef, type Band, BufferError, BufferMeter, type ByteEntry, DeflateError, DeltaError, DeltaFault, type DeltaInput, type DeltaOutput, type DiffEntry, DiffError, type DiffLimits, type DiffRead, type DiffStatus, type FetchAnswerHead, type FetchAnswerStart, FetchRound, type GitService, type IndexedEntry, type IndexedObject, type IndexerLimits, type IndexerReads, InflateError, type Inflated, type LineCount, type LineCounter, LsRefs, LsRefsAnswer, type MemberDeflater, type MemberInflater, type PackBase, type PackCopied, type PackCopy, type PackDigest, type PackEnd, type PackEntry, type PackEntryAt, type PackEntryEnd, type PackEntryKind, PackError, PackFault, type PackHasher, type PackIndex, PackIndexError, PackIndexFault, PackIndexer, type PackLimits, type PackObject, type PackObjects, type PackOutput, type PackPart, PackParts, type PackPaused, type PackRead, type PackResume, type PackReverse, type PackSink, type PackSource, type PackStream, type PackStreamOptions, PackTransportError, PackWriteError, PackWriteFault, type PackWriteLimits, type PackWritten, type PairedChanges, type PausingSink, type Pkt, type PktRead, PushReport, type PushReportRead, PushStart, type PushStartRead, type RawObject, RefCommand, RefResult, type ReportFormat, type Resolved, type ResolvedObject, ServedRefs, Sha1, Sha1State, type SourceRefs, type Step, type TreeItem, type UnindexableWhy, V2Advertised, V2Command, V2Request, WireDecodeError, type WireDiffInput, WireEncodeError, advertisedHead, advertisedRefs, advertisedSource, allotOrFail, allotScoped, appliedDelta, applyDelta, boundedSource, capacityOf, compareEntries, copyPieceBytes, countLines, crc32Start, crc32Update, decodeCommit, decodeSha1State, decodeTag, defaultDiffLimits, deflateWhole, deflatedMost, deflaterBytes, delimPkt, emptyTree, encodeAcknowledgments, encodeAdvertisement, encodeCommit, encodeErr, encodeFetchRound, encodeLsRefs, encodePkt, encodePushReport, encodePushStart, encodeTag, encodeTextPkt, encodeTree, encodeV0Acks, encodeV2Capabilities, encodeV2Request, entryHeader, fetchAnswerEnd, fetchAnswerStart, filterSpec, flushPkt, headOf, inflaterBytes, isObjectType, joinedBytes, lsRefsArguments, maxBandData, maxPktData, maxPrefixes, maxPushOptionBytes, maxPushOptions, maxSmallBandData, memberDeflater, memberInflater, notOurRef, objectId, objectTypes, onBand, onRoundBand, packEnd, packIndexBytes, packObjectBytes, packPageObjects, packParts, packPieceBytes, packReadBytes, packReverseBytes, packStream, packfileLine, pairRenames, parseDiffRaw, parseFilter, parseTreeBytes, pktText, pushOptionsRefusal, readEntryAt, readEntryHeader, readFetch, readFetchRound, readLsRefs, readLsRefsAnswer, readPack, readPackFrom, readPackIndex, readPackReverse, readPkt, readPushReport, readPushStart, readV0FetchAnswer, readV2Capabilities, readV2FetchAnswer, readV2Request, receivePackCapabilities, sha1Of, stepEffect, subjectOf, treeMatches, uploadPackCapabilities, v2Capabilities, walkTrees, wholeObjectBytes, withCommands, writePack, writePackIndex };
|
|
34
|
+
export { AckMode, AdvertisedRef, type Band, BufferError, BufferMeter, type ByteEntry, DeflateError, DeltaError, DeltaFault, type DeltaInput, type DeltaOutput, type DiffEntry, DiffError, type DiffLimits, type DiffRead, type DiffStatus, type FetchAnswerHead, type FetchAnswerStart, FetchRound, type GitService, type IndexedEntry, type IndexedObject, type IndexerLimits, type IndexerReads, InflateError, type Inflated, type LineCount, type LineCounter, LsRefs, LsRefsAnswer, type MemberDeflater, type MemberInflater, type PackBase, type PackCopied, type PackCopy, type PackDigest, type PackEnd, type PackEntry, type PackEntryAt, type PackEntryEnd, type PackEntryKind, PackError, PackFault, type PackHasher, type PackIndex, PackIndexError, PackIndexFault, PackIndexer, type PackLimits, type PackObject, type PackObjects, type PackOutput, type PackPart, PackParts, type PackPaused, type PackRead, type PackResume, type PackReverse, type PackSink, type PackSource, type PackStream, type PackStreamOptions, PackTransportError, PackWriteError, PackWriteFault, type PackWriteLimits, type PackWritten, type PairedChanges, type PausingSink, type Pkt, type PktRead, PushReport, type PushReportRead, PushStart, type PushStartRead, type RawObject, RefCommand, RefResult, type ReportFormat, type Resolved, type ResolvedObject, ServedRefs, Sha1, Sha1State, Sha256, type Sha256Hasher, Sha256State, type SourceRefs, type Step, type TreeItem, type UnindexableWhy, V2Advertised, V2Command, V2Request, WireDecodeError, type WireDiffInput, WireEncodeError, advertisedHead, advertisedRefs, advertisedSource, allotOrFail, allotScoped, appliedDelta, applyDelta, boundedSource, capacityOf, compareEntries, copyPieceBytes, countLines, crc32Start, crc32Update, decodeCommit, decodeSha1State, decodeSha256State, decodeTag, defaultDiffLimits, deflateWhole, deflatedMost, deflaterBytes, delimPkt, emptyTree, encodeAcknowledgments, encodeAdvertisement, encodeCommit, encodeErr, encodeFetchRound, encodeLsRefs, encodePkt, encodePushReport, encodePushStart, encodeTag, encodeTextPkt, encodeTree, encodeV0Acks, encodeV2Capabilities, encodeV2Request, entryHeader, fetchAnswerEnd, fetchAnswerStart, filterSpec, flushPkt, headOf, inflaterBytes, isObjectType, joinedBytes, lsRefsArguments, maxBandData, maxPktData, maxPrefixes, maxPushOptionBytes, maxPushOptions, maxSmallBandData, memberDeflater, memberInflater, nativeSha256Hasher, notOurRef, objectId, objectTypes, onBand, onRoundBand, packEnd, packIndexBytes, packObjectBytes, packPageObjects, packParts, packPieceBytes, packReadBytes, packReverseBytes, packStream, packfileLine, pairRenames, parseDiffRaw, parseFilter, parseTreeBytes, pktText, pushOptionsRefusal, readEntryAt, readEntryHeader, readFetch, readFetchRound, readLsRefs, readLsRefsAnswer, readPack, readPackFrom, readPackIndex, readPackReverse, readPkt, readPushReport, readPushStart, readV0FetchAnswer, readV2Capabilities, readV2FetchAnswer, readV2Request, receivePackCapabilities, sha1Of, stepEffect, subjectOf, treeMatches, uploadPackCapabilities, v2Capabilities, walkTrees, wholeObjectBytes, withCommands, writePack, writePackIndex };
|
package/dist/protocol.mjs
CHANGED
|
@@ -5,6 +5,8 @@ import { WireDecodeError, WireEncodeError } from "./protocol/bytes/errors.mjs";
|
|
|
5
5
|
import { InflateError, inflaterBytes, memberInflater } from "./protocol/bytes/inflate.mjs";
|
|
6
6
|
import { joinedBytes } from "./protocol/bytes/joined.mjs";
|
|
7
7
|
import { Sha1, Sha1State, decodeSha1State, sha1Of } from "./protocol/bytes/sha1.mjs";
|
|
8
|
+
import { Sha256, Sha256State, decodeSha256State } from "./protocol/bytes/sha256.mjs";
|
|
9
|
+
import { nativeSha256Hasher } from "./protocol/bytes/sha256-hasher.mjs";
|
|
8
10
|
import { parseDiffRaw } from "./protocol/diff/diff-raw.mjs";
|
|
9
11
|
import { DiffError, defaultDiffLimits } from "./protocol/diff/read.mjs";
|
|
10
12
|
import { countLines, pairRenames, walkTrees } from "./protocol/diff/tree-diff.mjs";
|
|
@@ -29,4 +31,4 @@ import { AckMode, FetchRound, encodeAcknowledgments, encodeFetchRound, encodeV0A
|
|
|
29
31
|
import { PushStart, RefCommand, encodePushStart, maxPushOptionBytes, maxPushOptions, pushOptionsRefusal, readPushStart, withCommands } from "./protocol/wire/receive-pack.mjs";
|
|
30
32
|
import { PushReport, RefResult, encodePushReport, readPushReport } from "./protocol/wire/report-status.mjs";
|
|
31
33
|
import { LsRefs, LsRefsAnswer, V2Advertised, V2Command, V2Request, encodeLsRefs, encodeV2Capabilities, encodeV2Request, lsRefsArguments, maxPrefixes, readLsRefs, readLsRefsAnswer, readV2Capabilities, readV2Request, v2Capabilities } from "./protocol/wire/v2.mjs";
|
|
32
|
-
export { AckMode, AdvertisedRef, BufferError, BufferMeter, DeflateError, DeltaError, DeltaFault, DiffError, FetchRound, InflateError, LsRefs, LsRefsAnswer, PackError, PackFault, PackIndexError, PackIndexFault, PackIndexer, PackParts, PackTransportError, PackWriteError, PackWriteFault, PushReport, PushStart, RefCommand, RefResult, ServedRefs, Sha1, Sha1State, V2Advertised, V2Command, V2Request, WireDecodeError, WireEncodeError, advertisedHead, advertisedRefs, advertisedSource, allotOrFail, allotScoped, appliedDelta, applyDelta, boundedSource, capacityOf, compareEntries, copyPieceBytes, countLines, crc32Start, crc32Update, decodeCommit, decodeSha1State, decodeTag, defaultDiffLimits, deflateWhole, deflatedMost, deflaterBytes, delimPkt, emptyTree, encodeAcknowledgments, encodeAdvertisement, encodeCommit, encodeErr, encodeFetchRound, encodeLsRefs, encodePkt, encodePushReport, encodePushStart, encodeTag, encodeTextPkt, encodeTree, encodeV0Acks, encodeV2Capabilities, encodeV2Request, entryHeader, fetchAnswerEnd, fetchAnswerStart, filterSpec, flushPkt, headOf, inflaterBytes, isObjectType, joinedBytes, lsRefsArguments, maxBandData, maxPktData, maxPrefixes, maxPushOptionBytes, maxPushOptions, maxSmallBandData, memberDeflater, memberInflater, notOurRef, objectId, objectTypes, onBand, onRoundBand, packEnd, packIndexBytes, packObjectBytes, packPageObjects, packParts, packPieceBytes, packReadBytes, packReverseBytes, packStream, packfileLine, pairRenames, parseDiffRaw, parseFilter, parseTreeBytes, pktText, pushOptionsRefusal, readEntryAt, readEntryHeader, readFetch, readFetchRound, readLsRefs, readLsRefsAnswer, readPack, readPackFrom, readPackIndex, readPackReverse, readPkt, readPushReport, readPushStart, readV0FetchAnswer, readV2Capabilities, readV2FetchAnswer, readV2Request, receivePackCapabilities, sha1Of, stepEffect, subjectOf, treeMatches, uploadPackCapabilities, v2Capabilities, walkTrees, wholeObjectBytes, withCommands, writePack, writePackIndex };
|
|
34
|
+
export { AckMode, AdvertisedRef, BufferError, BufferMeter, DeflateError, DeltaError, DeltaFault, DiffError, FetchRound, InflateError, LsRefs, LsRefsAnswer, PackError, PackFault, PackIndexError, PackIndexFault, PackIndexer, PackParts, PackTransportError, PackWriteError, PackWriteFault, PushReport, PushStart, RefCommand, RefResult, ServedRefs, Sha1, Sha1State, Sha256, Sha256State, V2Advertised, V2Command, V2Request, WireDecodeError, WireEncodeError, advertisedHead, advertisedRefs, advertisedSource, allotOrFail, allotScoped, appliedDelta, applyDelta, boundedSource, capacityOf, compareEntries, copyPieceBytes, countLines, crc32Start, crc32Update, decodeCommit, decodeSha1State, decodeSha256State, decodeTag, defaultDiffLimits, deflateWhole, deflatedMost, deflaterBytes, delimPkt, emptyTree, encodeAcknowledgments, encodeAdvertisement, encodeCommit, encodeErr, encodeFetchRound, encodeLsRefs, encodePkt, encodePushReport, encodePushStart, encodeTag, encodeTextPkt, encodeTree, encodeV0Acks, encodeV2Capabilities, encodeV2Request, entryHeader, fetchAnswerEnd, fetchAnswerStart, filterSpec, flushPkt, headOf, inflaterBytes, isObjectType, joinedBytes, lsRefsArguments, maxBandData, maxPktData, maxPrefixes, maxPushOptionBytes, maxPushOptions, maxSmallBandData, memberDeflater, memberInflater, nativeSha256Hasher, notOurRef, objectId, objectTypes, onBand, onRoundBand, packEnd, packIndexBytes, packObjectBytes, packPageObjects, packParts, packPieceBytes, packReadBytes, packReverseBytes, packStream, packfileLine, pairRenames, parseDiffRaw, parseFilter, parseTreeBytes, pktText, pushOptionsRefusal, readEntryAt, readEntryHeader, readFetch, readFetchRound, readLsRefs, readLsRefsAnswer, readPack, readPackFrom, readPackIndex, readPackReverse, readPkt, readPushReport, readPushStart, readV0FetchAnswer, readV2Capabilities, readV2FetchAnswer, readV2Request, receivePackCapabilities, sha1Of, stepEffect, subjectOf, treeMatches, uploadPackCapabilities, v2Capabilities, walkTrees, wholeObjectBytes, withCommands, writePack, writePackIndex };
|
package/dist/queue/advance.mjs
CHANGED
|
@@ -1266,7 +1266,7 @@ const TimeoutJob = /* @__PURE__ */ Job.make(timeoutName, {
|
|
|
1266
1266
|
retry: queueJobRetry
|
|
1267
1267
|
});
|
|
1268
1268
|
/**
|
|
1269
|
-
* The queue's jobs over `host`, which `
|
|
1269
|
+
* The queue's jobs over `host`, which `MergeQueue.layer` registers beside Git's own, each passing its
|
|
1270
1270
|
* last failure on to `onFailure` once it holds its target.
|
|
1271
1271
|
*/
|
|
1272
1272
|
const queueJobs = (host, onFailure) => {
|
package/dist/queue/host.d.mts
CHANGED
|
@@ -8,7 +8,7 @@ import * as Effect from "effect/Effect";
|
|
|
8
8
|
import { Records } from "@ref0/infra";
|
|
9
9
|
import * as Context from "effect/Context";
|
|
10
10
|
/**
|
|
11
|
-
* What the queue runs over, which `
|
|
11
|
+
* What the queue runs over, which `MergeQueue.layer` makes: the server's services, which its jobs
|
|
12
12
|
* run over, as its pushes' queueing does, and the queue each repo has, if any.
|
|
13
13
|
*/
|
|
14
14
|
export interface QueueHost {
|
|
@@ -36,10 +36,4 @@ declare const QueueBase_base: Context.ServiceClass<QueueBase, "@ref0/git/queue/Q
|
|
|
36
36
|
* queue's host for `git push -o queue` and the checks the seal runs. No entry point names it.
|
|
37
37
|
*/
|
|
38
38
|
export declare class QueueBase extends /* @__PURE__ */ QueueBase_base {}
|
|
39
|
-
/**
|
|
40
|
-
* One queue every repo has, as `createGitServer`'s `queue` takes it, checked now as `checkQueue`
|
|
41
|
-
* checks it, so a bad one throws its `TypeError` where the host writes it. A bridge: it goes with
|
|
42
|
-
* `createGitServer` in 2c-3b.
|
|
43
|
-
*/
|
|
44
|
-
export declare const mergeQueue: (options: MergeQueueOptions) => MergeQueueOptions;
|
|
45
39
|
export {};
|
package/dist/queue/host.mjs
CHANGED
|
@@ -65,12 +65,6 @@ const checkQueue = (options) => {
|
|
|
65
65
|
checkWhole("entryCommits", entryCommits, queueLimits.entryCommitsMost);
|
|
66
66
|
return options;
|
|
67
67
|
};
|
|
68
|
-
/**
|
|
69
|
-
* One queue every repo has, as `createGitServer`'s `queue` takes it, checked now as `checkQueue`
|
|
70
|
-
* checks it, so a bad one throws its `TypeError` where the host writes it. A bridge: it goes with
|
|
71
|
-
* `createGitServer` in 2c-3b.
|
|
72
|
-
*/
|
|
73
|
-
const mergeQueue = (options) => checkQueue(options);
|
|
74
68
|
/** The `keys` every repo's queue has: `undefined` for a queue per repo, whose repos may differ. */
|
|
75
69
|
const queueKeysOf = (options) => Predicate.isFunction(options) ? void 0 : options.keys;
|
|
76
70
|
/**
|
|
@@ -91,4 +85,4 @@ const queueOptions = (options) => {
|
|
|
91
85
|
catch: (cause) => gitError("UNAVAILABLE", "The server could not find this repo’s merge queue", { cause })
|
|
92
86
|
});
|
|
93
87
|
};
|
|
94
|
-
export { QueueBase, QueueInternals, checkQueue, checkTimeout, isTimeout,
|
|
88
|
+
export { QueueBase, QueueInternals, checkQueue, checkTimeout, isTimeout, queueKeysOf, queueOptions };
|
package/dist/queue/layer.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { register } from "../contracts/git.mjs";
|
|
2
2
|
import { MergeQueue } from "../contracts/queue.mjs";
|
|
3
3
|
import { MergeParts, Merges, mergePartsOption } from "../core/merge-parts.mjs";
|
|
4
|
-
import { acting } from "../core/
|
|
4
|
+
import { acting } from "../core/access.mjs";
|
|
5
5
|
import { queueJobs } from "./advance.mjs";
|
|
6
6
|
import { queueCalls } from "./calls.mjs";
|
|
7
7
|
import { QueueBase, QueueInternals, queueKeysOf, queueOptions } from "./host.mjs";
|
package/dist/queue/trim.mjs
CHANGED
|
@@ -280,7 +280,7 @@ const TrimJob = /* @__PURE__ */ Job.make(trimName, {
|
|
|
280
280
|
retry: queueJobRetry
|
|
281
281
|
});
|
|
282
282
|
/**
|
|
283
|
-
* `queue.trim` over `host`, which `
|
|
283
|
+
* `queue.trim` over `host`, which `MergeQueue.layer` registers beside the queue's other jobs: its
|
|
284
284
|
* time is the host's clock, as the other jobs' is. A try that fails its last retry passes its
|
|
285
285
|
* failure to `onFailure`, so the host's `repo.work.failed` names it and `work.retry` runs it again:
|
|
286
286
|
* a failed job's row stays failed whatever a target's first write saves.
|
package/dist/rest/blobs.d.mts
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import { GitCallerMiddleware, GitRestServices } from "./caller.mjs";
|
|
2
2
|
import * as Schema from "effect/Schema";
|
|
3
3
|
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/http-api";
|
|
4
|
-
declare const BlobsApiGroup_base: HttpApiGroup.HttpApiGroup<"blobs", HttpApiEndpoint.HttpApiEndpoint<"
|
|
4
|
+
declare const BlobsApiGroup_base: HttpApiGroup.HttpApiGroup<"blobs", HttpApiEndpoint.HttpApiEndpoint<"create", "POST", "/repos/:repo/-/blobs", Schema.toCodecStringTree<Schema.Struct<{
|
|
5
5
|
repo: Schema.String;
|
|
6
|
-
oid: Schema.String;
|
|
7
6
|
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
readonly
|
|
11
|
-
|
|
12
|
-
}>>, never, never, HttpApiSchema.WithHeaders<HttpApiSchema.StreamUint8Array, Schema.toCodecStringTree<Schema.Struct<{
|
|
13
|
-
etag: Schema.String;
|
|
14
|
-
'content-length': Schema.NumberFromString;
|
|
15
|
-
}>>>, Schema.toCodecJson<HttpApiSchema.encodeToWithHeaders<Schema.Codec<{
|
|
7
|
+
key: Schema.optionalKey<Schema.String>;
|
|
8
|
+
}>>, HttpApiSchema.StreamUint8Array, never, Schema.toCodecJson<Schema.Struct<{
|
|
9
|
+
readonly oid: Schema.String;
|
|
10
|
+
}>>, Schema.toCodecJson<HttpApiSchema.encodeToWithHeaders<Schema.Codec<{
|
|
16
11
|
readonly code: "ALREADY_EXISTS";
|
|
17
12
|
readonly message: string;
|
|
18
13
|
readonly hint?: string;
|
|
@@ -116,6 +111,7 @@ declare const BlobsApiGroup_base: HttpApiGroup.HttpApiGroup<"blobs", HttpApiEndp
|
|
|
116
111
|
readonly reason?: string;
|
|
117
112
|
readonly packs?: number;
|
|
118
113
|
readonly most?: number;
|
|
114
|
+
readonly retryAfter?: number;
|
|
119
115
|
};
|
|
120
116
|
}, unknown, never, never>, Schema.Codec<{
|
|
121
117
|
readonly code: "ALREADY_EXISTS";
|
|
@@ -221,6 +217,7 @@ declare const BlobsApiGroup_base: HttpApiGroup.HttpApiGroup<"blobs", HttpApiEndp
|
|
|
221
217
|
readonly reason?: string;
|
|
222
218
|
readonly packs?: number;
|
|
223
219
|
readonly most?: number;
|
|
220
|
+
readonly retryAfter?: number;
|
|
224
221
|
};
|
|
225
222
|
}, unknown, never, never>, {
|
|
226
223
|
"ref0-code": Schema.String;
|
|
@@ -296,7 +293,7 @@ declare const BlobsApiGroup_base: HttpApiGroup.HttpApiGroup<"blobs", HttpApiEndp
|
|
|
296
293
|
readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
|
|
297
294
|
readonly hint: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
|
|
298
295
|
readonly context: Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
299
|
-
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>]>>;
|
|
296
|
+
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>]>>;
|
|
300
297
|
indexBytes: Schema.optionalKey<Schema.Number>;
|
|
301
298
|
pushBytes: Schema.optionalKey<Schema.Number>;
|
|
302
299
|
most: Schema.optionalKey<Schema.Number>;
|
|
@@ -312,9 +309,10 @@ declare const BlobsApiGroup_base: HttpApiGroup.HttpApiGroup<"blobs", HttpApiEndp
|
|
|
312
309
|
readonly hint: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
|
|
313
310
|
readonly context: Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
314
311
|
id: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
|
|
315
|
-
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>]>>;
|
|
312
|
+
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>]>>;
|
|
316
313
|
packs: Schema.optionalKey<Schema.Number>;
|
|
317
314
|
most: Schema.optionalKey<Schema.Number>;
|
|
315
|
+
retryAfter: Schema.optionalKey<Schema.Number>;
|
|
318
316
|
}>, 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]>>]>>;
|
|
319
317
|
}>, Schema.Struct<{
|
|
320
318
|
readonly code: Schema.Literal<"ALREADY_EXISTS">;
|
|
@@ -388,7 +386,7 @@ declare const BlobsApiGroup_base: HttpApiGroup.HttpApiGroup<"blobs", HttpApiEndp
|
|
|
388
386
|
readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
|
|
389
387
|
readonly hint: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
|
|
390
388
|
readonly context: Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
391
|
-
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>]>>;
|
|
389
|
+
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>]>>;
|
|
392
390
|
indexBytes: Schema.optionalKey<Schema.Number>;
|
|
393
391
|
pushBytes: Schema.optionalKey<Schema.Number>;
|
|
394
392
|
most: Schema.optionalKey<Schema.Number>;
|
|
@@ -404,20 +402,26 @@ declare const BlobsApiGroup_base: HttpApiGroup.HttpApiGroup<"blobs", HttpApiEndp
|
|
|
404
402
|
readonly hint: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
|
|
405
403
|
readonly context: Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
406
404
|
id: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
|
|
407
|
-
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>]>>;
|
|
405
|
+
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>]>>;
|
|
408
406
|
packs: Schema.optionalKey<Schema.Number>;
|
|
409
407
|
most: Schema.optionalKey<Schema.Number>;
|
|
408
|
+
retryAfter: Schema.optionalKey<Schema.Number>;
|
|
410
409
|
}>, 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]>>]>>;
|
|
411
410
|
}>, {
|
|
412
411
|
"ref0-code": Schema.String;
|
|
413
412
|
'www-authenticate': Schema.String;
|
|
414
|
-
}>>, GitCallerMiddleware, GitRestServices> | HttpApiEndpoint.HttpApiEndpoint<"
|
|
413
|
+
}>>, GitCallerMiddleware, GitRestServices> | HttpApiEndpoint.HttpApiEndpoint<"get", "GET", "/repos/:repo/-/blobs/:oid", Schema.toCodecStringTree<Schema.Struct<{
|
|
415
414
|
repo: Schema.String;
|
|
415
|
+
oid: Schema.String;
|
|
416
416
|
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
readonly
|
|
420
|
-
|
|
417
|
+
readonly objects: Schema.optionalKey<Schema.Int>;
|
|
418
|
+
readonly bytes: Schema.optionalKey<Schema.Int>;
|
|
419
|
+
readonly entries: Schema.optionalKey<Schema.Int>;
|
|
420
|
+
readonly milliseconds: Schema.optionalKey<Schema.Int>;
|
|
421
|
+
}>>, never, never, HttpApiSchema.WithHeaders<HttpApiSchema.StreamUint8Array, Schema.toCodecStringTree<Schema.Struct<{
|
|
422
|
+
etag: Schema.String;
|
|
423
|
+
'content-length': Schema.NumberFromString;
|
|
424
|
+
}>>>, Schema.toCodecJson<HttpApiSchema.encodeToWithHeaders<Schema.Codec<{
|
|
421
425
|
readonly code: "ALREADY_EXISTS";
|
|
422
426
|
readonly message: string;
|
|
423
427
|
readonly hint?: string;
|
|
@@ -521,6 +525,7 @@ declare const BlobsApiGroup_base: HttpApiGroup.HttpApiGroup<"blobs", HttpApiEndp
|
|
|
521
525
|
readonly reason?: string;
|
|
522
526
|
readonly packs?: number;
|
|
523
527
|
readonly most?: number;
|
|
528
|
+
readonly retryAfter?: number;
|
|
524
529
|
};
|
|
525
530
|
}, unknown, never, never>, Schema.Codec<{
|
|
526
531
|
readonly code: "ALREADY_EXISTS";
|
|
@@ -626,6 +631,7 @@ declare const BlobsApiGroup_base: HttpApiGroup.HttpApiGroup<"blobs", HttpApiEndp
|
|
|
626
631
|
readonly reason?: string;
|
|
627
632
|
readonly packs?: number;
|
|
628
633
|
readonly most?: number;
|
|
634
|
+
readonly retryAfter?: number;
|
|
629
635
|
};
|
|
630
636
|
}, unknown, never, never>, {
|
|
631
637
|
"ref0-code": Schema.String;
|
|
@@ -701,7 +707,7 @@ declare const BlobsApiGroup_base: HttpApiGroup.HttpApiGroup<"blobs", HttpApiEndp
|
|
|
701
707
|
readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
|
|
702
708
|
readonly hint: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
|
|
703
709
|
readonly context: Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
704
|
-
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>]>>;
|
|
710
|
+
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>]>>;
|
|
705
711
|
indexBytes: Schema.optionalKey<Schema.Number>;
|
|
706
712
|
pushBytes: Schema.optionalKey<Schema.Number>;
|
|
707
713
|
most: Schema.optionalKey<Schema.Number>;
|
|
@@ -717,9 +723,10 @@ declare const BlobsApiGroup_base: HttpApiGroup.HttpApiGroup<"blobs", HttpApiEndp
|
|
|
717
723
|
readonly hint: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
|
|
718
724
|
readonly context: Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
719
725
|
id: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
|
|
720
|
-
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>]>>;
|
|
726
|
+
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>]>>;
|
|
721
727
|
packs: Schema.optionalKey<Schema.Number>;
|
|
722
728
|
most: Schema.optionalKey<Schema.Number>;
|
|
729
|
+
retryAfter: Schema.optionalKey<Schema.Number>;
|
|
723
730
|
}>, 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]>>]>>;
|
|
724
731
|
}>, Schema.Struct<{
|
|
725
732
|
readonly code: Schema.Literal<"ALREADY_EXISTS">;
|
|
@@ -793,7 +800,7 @@ declare const BlobsApiGroup_base: HttpApiGroup.HttpApiGroup<"blobs", HttpApiEndp
|
|
|
793
800
|
readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
|
|
794
801
|
readonly hint: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
|
|
795
802
|
readonly context: Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
796
|
-
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>]>>;
|
|
803
|
+
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>]>>;
|
|
797
804
|
indexBytes: Schema.optionalKey<Schema.Number>;
|
|
798
805
|
pushBytes: Schema.optionalKey<Schema.Number>;
|
|
799
806
|
most: Schema.optionalKey<Schema.Number>;
|
|
@@ -809,9 +816,10 @@ declare const BlobsApiGroup_base: HttpApiGroup.HttpApiGroup<"blobs", HttpApiEndp
|
|
|
809
816
|
readonly hint: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
|
|
810
817
|
readonly context: Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
811
818
|
id: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
|
|
812
|
-
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>]>>;
|
|
819
|
+
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>]>>;
|
|
813
820
|
packs: Schema.optionalKey<Schema.Number>;
|
|
814
821
|
most: Schema.optionalKey<Schema.Number>;
|
|
822
|
+
retryAfter: Schema.optionalKey<Schema.Number>;
|
|
815
823
|
}>, 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]>>]>>;
|
|
816
824
|
}>, {
|
|
817
825
|
"ref0-code": Schema.String;
|
package/dist/rest/blobs.mjs
CHANGED
|
@@ -28,7 +28,7 @@ var BlobsApiGroup = class extends HttpApiGroup.make("blobs").add(HttpApiEndpoint
|
|
|
28
28
|
query: LimitsFields,
|
|
29
29
|
success: BlobBytes,
|
|
30
30
|
error: GitErrors
|
|
31
|
-
}).annotateMerge(OpenApi.annotations({ description: "A blob's bytes, streamed and checked against its ID as they go: a body that ends short of its `Content-Length` failed the check, as `DATA_LOSS`. `bytes` has no default, so the file
|
|
31
|
+
}).annotateMerge(OpenApi.annotations({ description: "A blob's bytes, streamed and checked against its ID as they go: a body that ends short of its `Content-Length` failed the check, as `DATA_LOSS`. `bytes` has no default, so the largest file a host may let a push take, 1 GiB, caps it. `object-too-large` comes before the first byte, past a `bytes` the caller sets or for a blob stored as a delta past 16 MiB. `milliseconds` limits the call until it answers, not the body after it." })), HttpApiEndpoint.post("create", "/repos/:repo/-/blobs", {
|
|
32
32
|
params: RepoParam,
|
|
33
33
|
query: WriteKey,
|
|
34
34
|
payload: HttpApiSchema.StreamUint8Array({ contentType: "application/octet-stream" }),
|