@ref0/git 0.4.0 → 0.6.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 -4
- package/dist/auth/authorize.mjs +9 -4
- package/dist/auth/identify.d.mts +5 -3
- package/dist/auth/tokens.mjs +12 -11
- package/dist/client/local.mjs +2 -0
- package/dist/client/slice-push.d.mts +1 -1
- package/dist/contracts/access.d.mts +6 -2
- package/dist/contracts/authorize.d.mts +14 -10
- package/dist/contracts/events.d.mts +32 -5
- package/dist/contracts/events.mjs +14 -3
- package/dist/contracts/git.d.mts +68 -3
- package/dist/contracts/grants.d.mts +6 -1
- package/dist/contracts/lfs.d.mts +5 -2
- package/dist/contracts/objects.d.mts +7 -2
- package/dist/contracts/promises.d.mts +2 -14
- package/dist/contracts/push-uploads.d.mts +1 -1
- package/dist/contracts/queue.d.mts +15 -7
- package/dist/contracts/refs.d.mts +1 -1
- package/dist/contracts/result.d.mts +9 -5
- package/dist/contracts/result.mjs +5 -0
- package/dist/contracts/server.d.mts +13 -6
- package/dist/contracts/work.d.mts +1 -1
- package/dist/core/access.mjs +17 -1
- package/dist/core/call-names.d.mts +3 -1
- package/dist/core/claim-rows.d.mts +4 -0
- package/dist/core/claim-rows.mjs +53 -0
- package/dist/core/events/deliver.d.mts +12 -0
- package/dist/core/events/deliver.mjs +367 -145
- package/dist/core/events/seen.mjs +17 -3
- package/dist/core/forks.mjs +82 -20
- package/dist/core/hooks/post-receive.mjs +20 -17
- package/dist/core/index-job.mjs +23 -17
- package/dist/core/parts.d.mts +6 -0
- package/dist/core/purge.d.mts +8 -0
- package/dist/core/purge.mjs +16 -21
- package/dist/core/push-decide.mjs +26 -4
- package/dist/core/push.mjs +57 -20
- package/dist/core/ref-index-job.mjs +9 -14
- package/dist/core/ref-index.d.mts +1 -0
- package/dist/core/ref-index.mjs +28 -8
- package/dist/core/ref-view.mjs +14 -9
- package/dist/core/refs.mjs +13 -11
- package/dist/core/repack.d.mts +2 -1
- package/dist/core/repack.mjs +66 -118
- package/dist/core/repos.mjs +5 -5
- package/dist/core/rules/check.mjs +7 -6
- package/dist/core/rules/context.d.mts +1 -1
- package/dist/core/seam.d.mts +56 -9
- package/dist/core/seam.mjs +7 -1
- package/dist/core/still-takes.mjs +75 -0
- package/dist/core/view.d.mts +1 -0
- package/dist/core/view.mjs +8 -9
- package/dist/core/work.mjs +1 -1
- package/dist/extend.d.mts +2 -1
- package/dist/http/core-parts.mjs +19 -11
- package/dist/http/handler.mjs +2 -2
- package/dist/http/node.d.mts +2 -23
- package/dist/http/parts.d.mts +1 -0
- package/dist/http/push-uploads.d.mts +10 -2
- package/dist/http/push-uploads.mjs +31 -34
- package/dist/http/receive-pack.mjs +5 -3
- package/dist/http/upload-pack.mjs +2 -2
- package/dist/index.d.mts +11 -7
- package/dist/index.mjs +5 -3
- package/dist/lfs/base.d.mts +32 -0
- package/dist/lfs/base.mjs +8 -0
- package/dist/lfs/calls.mjs +21 -12
- package/dist/lfs/layer.d.mts +27 -0
- package/dist/lfs/layer.mjs +64 -0
- package/dist/lfs/locks.mjs +13 -27
- package/dist/lfs/namespace.d.mts +2 -0
- package/dist/lfs/objects.d.mts +23 -4
- package/dist/lfs/objects.mjs +65 -81
- package/dist/lfs/pointers.mjs +8 -6
- package/dist/lfs/public.d.mts +5 -0
- package/dist/lfs/public.mjs +8 -0
- package/dist/lfs/purge.mjs +19 -25
- package/dist/lfs/rows.mjs +22 -10
- package/dist/lfs/service.d.mts +9 -4
- package/dist/lfs/service.mjs +3 -12
- package/dist/lfs/upkeep.mjs +34 -49
- package/dist/node.d.mts +3 -2
- package/dist/node.mjs +1 -1
- package/dist/protocol/wire/advertisement.d.mts +4 -10
- package/dist/protocol/wire/advertisement.mjs +16 -12
- package/dist/protocol/wire/lines.d.mts +14 -2
- package/dist/protocol/wire/lines.mjs +32 -21
- package/dist/protocol/wire/v2.d.mts +4 -15
- package/dist/protocol/wire/v2.mjs +16 -14
- package/dist/queue/advance.mjs +78 -55
- package/dist/queue/calls.mjs +4 -2
- package/dist/queue/commit.mjs +20 -13
- package/dist/queue/host.d.mts +2 -2
- package/dist/queue/layer.d.mts +4 -2
- package/dist/queue/layer.mjs +8 -3
- package/dist/queue/limits.mjs +36 -6
- package/dist/queue/rows.mjs +14 -5
- package/dist/queue/state.mjs +19 -5
- package/dist/queue/steps.mjs +10 -4
- package/dist/queue/trim.mjs +284 -0
- package/dist/rest/blobs.d.mts +19 -19
- package/dist/rest/caller.d.mts +4 -4
- package/dist/rest/commits.d.mts +96 -96
- package/dist/rest/errors.d.mts +2 -2
- package/dist/rest/events.d.mts +2 -2
- package/dist/rest/files.d.mts +54 -54
- package/dist/rest/forks.d.mts +87 -87
- package/dist/rest/handler.mjs +13 -5
- package/dist/rest/layer.d.mts +14 -0
- package/dist/rest/layer.mjs +52 -0
- package/dist/rest/me.d.mts +2 -2
- package/dist/rest/merges.d.mts +2 -2
- package/dist/rest/namespace.d.mts +2 -0
- package/dist/rest/queue.d.mts +208 -208
- package/dist/rest/refs.d.mts +131 -131
- package/dist/rest/repos.d.mts +12 -12
- package/dist/rest/tags.d.mts +70 -70
- package/dist/rest/tokens.d.mts +23 -23
- package/dist/rest/topics.d.mts +111 -111
- package/dist/rest/trees.d.mts +57 -57
- package/dist/rest/wire.d.mts +2 -0
- package/dist/rest/wire.mjs +2 -2
- package/dist/rest/work.d.mts +6 -6
- package/dist/server/edge-node.d.mts +20 -0
- package/dist/server/edge-node.mjs +20 -0
- package/dist/server/edge.d.mts +10 -0
- package/dist/server/edge.mjs +23 -0
- package/dist/server/extension.mjs +1 -1
- package/dist/server/git-layer.d.mts +15 -4
- package/dist/server/git-layer.mjs +13 -2
- package/dist/server/git-namespace.d.mts +5 -4
- package/dist/server/git-namespace.mjs +6 -3
- package/dist/server/registry.d.mts +3 -0
- package/dist/server/registry.mjs +58 -7
- package/dist/server/server.d.mts +3 -0
- package/dist/server/server.mjs +81 -39
- package/dist/server/uploads.d.mts +14 -0
- package/dist/server/uploads.mjs +15 -0
- package/dist/storage/calls.d.mts +7 -8
- package/dist/storage/calls.mjs +14 -14
- package/dist/storage/clean-up.mjs +59 -29
- package/dist/storage/host-bucket.mjs +16 -1
- package/dist/storage/index-build.d.mts +1 -1
- package/dist/storage/layout.mjs +5 -0
- package/dist/storage/merge.d.mts +1 -1
- package/dist/storage/push-uploads.mjs +12 -16
- package/dist/storage/quarantine.d.mts +1 -1
- package/dist/storage/quarantine.mjs +51 -12
- package/dist/storage/receive-bounds.d.mts +1 -1
- package/dist/storage/repack-job.d.mts +1 -1
- package/dist/storage/repack-job.mjs +7 -14
- package/dist/storage/rows.mjs +42 -3
- package/dist/storage/runs.d.mts +1 -1
- package/dist/store/job-try.mjs +26 -0
- package/dist/store/list-job.mjs +22 -16
- package/dist/store/outbox.mjs +38 -12
- package/dist/store/promises.d.mts +6 -1
- package/dist/store/promises.mjs +74 -89
- package/dist/store/queue-jobs.mjs +22 -1
- package/dist/store/scopes.mjs +0 -10
- package/dist/sync/mirror.d.mts +1 -1
- package/dist/sync/mirror.mjs +1 -1
- package/dist/sync/publish.mjs +12 -7
- package/dist/sync/step.mjs +4 -0
- package/package.json +3 -3
- package/dist/lfs/repo.mjs +0 -42
- package/dist/storage/promise-calls.mjs +0 -29
package/dist/http/core-parts.mjs
CHANGED
|
@@ -17,7 +17,7 @@ import { decodePacks } from "../store/git-store.mjs";
|
|
|
17
17
|
import { ReachedMark, markHolds } from "../store/records.mjs";
|
|
18
18
|
import { readRecord } from "../store/repo-record.mjs";
|
|
19
19
|
import { collections, reachedKey } from "../store/scopes.mjs";
|
|
20
|
-
import { fetchReaches } from "../protocol/wire/lines.mjs";
|
|
20
|
+
import { fetchReaches, hiddenUnder } from "../protocol/wire/lines.mjs";
|
|
21
21
|
import { read } from "../core/objects/objects.mjs";
|
|
22
22
|
import * as Effect from "effect/Effect";
|
|
23
23
|
import * as Context from "effect/Context";
|
|
@@ -64,9 +64,9 @@ const headOf = (branch) => branch.startsWith("refs/") ? branch : `refs/heads/${b
|
|
|
64
64
|
* want of every ref Git advertises. Anything less builds, so a `--single-branch` clone isn't sent
|
|
65
65
|
* the other branches' objects.
|
|
66
66
|
*/
|
|
67
|
-
const fullClone = (request, refs) => {
|
|
67
|
+
const fullClone = (table, request, refs) => {
|
|
68
68
|
const wants = new Set(request.wants);
|
|
69
|
-
return request.haves.length === 0 && request.shallows.length === 0 && request.depth === void 0 && request.deepenRelative !== true && request.filter === void 0 && refs.every((ref) => !fetchReaches(ref.name) || wants.has(ref.oid));
|
|
69
|
+
return request.haves.length === 0 && request.shallows.length === 0 && request.depth === void 0 && request.deepenRelative !== true && request.filter === void 0 && refs.every((ref) => !fetchReaches(table, ref.name) || wants.has(ref.oid));
|
|
70
70
|
};
|
|
71
71
|
const coreHttpParts = (parts, options = {}) => {
|
|
72
72
|
const { needs } = parts;
|
|
@@ -152,7 +152,8 @@ const coreHttpParts = (parts, options = {}) => {
|
|
|
152
152
|
head,
|
|
153
153
|
refs
|
|
154
154
|
} : { refs };
|
|
155
|
-
const
|
|
155
|
+
const hidden = core.hiddenRefs();
|
|
156
|
+
const shown = refs.filter((ref) => fetchReaches(hidden, ref.name)).length;
|
|
156
157
|
const [markRow] = markRows;
|
|
157
158
|
const mark = markRow === void 0 ? void 0 : yield* decodeRow(ReachedMark, markRow, "The reached mark");
|
|
158
159
|
const seesAll = refView.whole && shown === refRows.length;
|
|
@@ -233,9 +234,14 @@ const coreHttpParts = (parts, options = {}) => {
|
|
|
233
234
|
after = later.last;
|
|
234
235
|
return yield* refsOf(later);
|
|
235
236
|
});
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
|
|
237
|
+
const hidden = core.hiddenRefs();
|
|
238
|
+
const listed = {
|
|
239
|
+
next: Effect.provideContext(next, needs),
|
|
240
|
+
hidden
|
|
241
|
+
};
|
|
242
|
+
const shown = hiddenUnder(hidden, head) === void 0;
|
|
243
|
+
if (shown && refView.sees(head)) listed.head = head;
|
|
244
|
+
if (shown && headRef !== void 0) listed.headRef = headRef;
|
|
239
245
|
return listed;
|
|
240
246
|
});
|
|
241
247
|
/**
|
|
@@ -250,8 +256,9 @@ const coreHttpParts = (parts, options = {}) => {
|
|
|
250
256
|
repo
|
|
251
257
|
}), Effect.fail(refused));
|
|
252
258
|
const served = (caller, repo, at) => {
|
|
259
|
+
const hidden = core.hiddenRefs();
|
|
253
260
|
const tips = new Set(at.refs.refs.flatMap((ref) => {
|
|
254
|
-
if (!fetchReaches(ref.name)) return [];
|
|
261
|
+
if (!fetchReaches(hidden, ref.name)) return [];
|
|
255
262
|
return ref.peeled === void 0 ? [ref.oid] : [ref.oid, ref.peeled];
|
|
256
263
|
}));
|
|
257
264
|
const tags = at.refs.refs.flatMap((ref) => ref.name.startsWith("refs/tags/") ? [ref.oid] : []);
|
|
@@ -282,7 +289,7 @@ const coreHttpParts = (parts, options = {}) => {
|
|
|
282
289
|
signal
|
|
283
290
|
};
|
|
284
291
|
const unruled = (yield* fetchRulesOf()).length === 0;
|
|
285
|
-
if (at.whole && unruled && fullClone(request, at.refs.refs)) fetching.whole = true;
|
|
292
|
+
if (at.whole && unruled && fullClone(core.hiddenRefs(), request, at.refs.refs)) fetching.whole = true;
|
|
286
293
|
if (request.thinPack === true && at.seesAll && unruled) fetching.thin = true;
|
|
287
294
|
return yield* at.objects.fetch(at.listed, fetching);
|
|
288
295
|
})
|
|
@@ -290,11 +297,14 @@ const coreHttpParts = (parts, options = {}) => {
|
|
|
290
297
|
};
|
|
291
298
|
const receiving = (caller, repo, at) => ({
|
|
292
299
|
refs: at.refs,
|
|
300
|
+
hidden: core.hiddenRefs(),
|
|
293
301
|
push: (input) => Effect.provideContext(pushed(stored, caller, repo, input, options.queue), needs)
|
|
294
302
|
});
|
|
295
303
|
const http = {
|
|
296
304
|
basePath: parts.basePath,
|
|
297
305
|
agent: serverAgent,
|
|
306
|
+
lfs: options.lfs ?? (() => void 0),
|
|
307
|
+
uploads: options.uploads ?? (() => void 0),
|
|
298
308
|
identify: parts.identify,
|
|
299
309
|
renamedTo: parts.renamedTo,
|
|
300
310
|
fetchOpen: (caller, repo) => Effect.map(openRepo(caller, {
|
|
@@ -314,8 +324,6 @@ const coreHttpParts = (parts, options = {}) => {
|
|
|
314
324
|
}, { peel: false }).pipe(Effect.map((at) => receiving(caller, repo, at)), Effect.catch((error) => readersOnly(caller, repo, error)), Effect.provideContext(needs))
|
|
315
325
|
};
|
|
316
326
|
if (options.resolve !== void 0) http.resolve = options.resolve;
|
|
317
|
-
if (options.lfs !== void 0) http.lfs = options.lfs;
|
|
318
|
-
if (options.uploads !== void 0) http.uploads = options.uploads;
|
|
319
327
|
if (options.pushObjectsMost !== void 0) http.pushObjectsMost = options.pushObjectsMost;
|
|
320
328
|
if (options.maxDuration !== void 0) http.maxDuration = options.maxDuration;
|
|
321
329
|
if (options.calls !== void 0) http.fetchCalls = options.calls;
|
package/dist/http/handler.mjs
CHANGED
|
@@ -29,7 +29,7 @@ const gitHttp = (parts) => {
|
|
|
29
29
|
const lfsOff = "This server has no Git LFS: its host turns it on";
|
|
30
30
|
/** A request to Git LFS's API: its refusals are LFS's JSON, as git-lfs reads them. */
|
|
31
31
|
const lfsRoute = /* @__PURE__ */ Effect.fnUntraced(function* (parts, git, url, request) {
|
|
32
|
-
const
|
|
32
|
+
const lfs = parts.lfs();
|
|
33
33
|
if (lfs === void 0) return lfsAnswer(404, { message: lfsOff });
|
|
34
34
|
const caller = yield* parts.identify(request);
|
|
35
35
|
const repo = yield* repoOf(parts, git, url, caller);
|
|
@@ -44,7 +44,7 @@ const lfsRoute = /* @__PURE__ */ Effect.fnUntraced(function* (parts, git, url, r
|
|
|
44
44
|
}, (route) => routeEdge(route, lfsRefusal));
|
|
45
45
|
/** A large push's upload: its refusals are a push's, as `git-remote-ref0` reads them. */
|
|
46
46
|
const uploadRoute = /* @__PURE__ */ Effect.fnUntraced(function* (parts, git, url, request) {
|
|
47
|
-
const
|
|
47
|
+
const uploads = parts.uploads();
|
|
48
48
|
if (uploads === void 0) return told(404, "This server takes no push uploads");
|
|
49
49
|
if (request.method !== "POST") return told(405, "Method not allowed", { allow: "POST" });
|
|
50
50
|
const caller = yield* parts.identify(request);
|
package/dist/http/node.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../contracts/server.mjs";
|
|
2
2
|
/**
|
|
3
3
|
* What `toNodeHandler` reads of `node:http`'s request, which Express's extends: this package has
|
|
4
4
|
* no Node types, so the few members used are typed here.
|
|
@@ -43,28 +43,7 @@ export interface NodeResponse {
|
|
|
43
43
|
}
|
|
44
44
|
/** A listener for `node:http`'s `createServer`, or an Express route. */
|
|
45
45
|
export type NodeHandler = (request: NodeRequest, response: NodeResponse) => void;
|
|
46
|
-
/**
|
|
47
|
-
* A Git server, or any `fetch`, as a `node:http` or `node:http2` listener or an Express route:
|
|
48
|
-
* `createServer(toNodeHandler(git))`; beside an app's own routes, `toNodeMiddleware`. The body
|
|
49
|
-
* streams to Git unread. The response streams back as Node can take it, and a client that
|
|
50
|
-
* disconnects or resets its stream before the response ends, which a `close` of the HTTP/2
|
|
51
|
-
* stream, or the HTTP/1 response, before `writableEnded` says, aborts the request's `signal`, which ends Git's reads and leaves it
|
|
52
|
-
* unanswered. A request whose URL can't be read, such as one with a malformed `Host`, is answered
|
|
53
|
-
* 400. Over HTTP/2, `node:http2` keeps a stream open while its client's end is, as for a `HEAD`
|
|
54
|
-
* whose client never ends it: that holds only the client's own stream.
|
|
55
|
-
*/
|
|
56
|
-
export declare const toNodeHandler: (handler: Pick<GitServer, 'fetch'>) => NodeHandler;
|
|
57
46
|
/** Express's `next`: the request goes on to the app's own middleware and routes. */
|
|
58
47
|
export type NodeNext = () => void;
|
|
59
48
|
/** An Express middleware, or `next` for a request it doesn't answer. */
|
|
60
|
-
export type NodeMiddleware = (request: NodeRequest, response: NodeResponse, next: NodeNext) => void;
|
|
61
|
-
/**
|
|
62
|
-
* A Git server, or any `fetch`, beside an app's own routes, as an Express middleware:
|
|
63
|
-
* `app.use(toNodeMiddleware(git, (url) => gitPathOf(url, '/git')))`, before any body parser. A
|
|
64
|
-
* request `pathOf` names is answered at the path it gives, as `toNodeHandler` answers it, the
|
|
65
|
-
* query kept; every other goes on to `next`, its body unread. `pathOf` is handed the URL `fetch`
|
|
66
|
-
* gets, with its dot segments resolved, so the path Express routed by never decides. A URL that
|
|
67
|
-
* can't be read goes on to `next` too. It calls `next` synchronously, before it returns, or not
|
|
68
|
-
* at all, so a framework's hook, as Fastify's `onRequest` is, can tell by then whether it answers.
|
|
69
|
-
*/
|
|
70
|
-
export declare const toNodeMiddleware: (handler: Pick<GitServer, 'fetch'>, pathOf: (url: URL) => string | undefined) => NodeMiddleware;
|
|
49
|
+
export type NodeMiddleware = (request: NodeRequest, response: NodeResponse, next: NodeNext) => void;
|
package/dist/http/parts.d.mts
CHANGED
|
@@ -7,6 +7,7 @@ import "../contracts/server.mjs";
|
|
|
7
7
|
import "../auth/identify.mjs";
|
|
8
8
|
import "../store/call-count.mjs";
|
|
9
9
|
import "../protocol/wire/advertisement.mjs";
|
|
10
|
+
import "../protocol/wire/lines.mjs";
|
|
10
11
|
import "../lfs/service.mjs";
|
|
11
12
|
import "./push-uploads.mjs";
|
|
12
13
|
import "effect/Effect";
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import "../contracts/promises.mjs";
|
|
2
1
|
import "../contracts/actors.mjs";
|
|
3
2
|
import "../contracts/ids.mjs";
|
|
3
|
+
import { Bucket, Uploads } from "../contracts/objects.mjs";
|
|
4
4
|
import "../contracts/result.mjs";
|
|
5
5
|
import "../core/parts.mjs";
|
|
6
6
|
import "./parts.mjs";
|
|
7
7
|
import "./paths.mjs";
|
|
8
8
|
import "effect/Effect";
|
|
9
|
-
import "effect/Context";
|
|
9
|
+
import "effect/Context";
|
|
10
|
+
/**
|
|
11
|
+
* Where a server stages push uploads: the bucket, which charges each call, and the host's uploads,
|
|
12
|
+
* which sign and join its parts.
|
|
13
|
+
*/
|
|
14
|
+
export interface PushStaging {
|
|
15
|
+
readonly bucket: Bucket;
|
|
16
|
+
readonly uploads: Uploads;
|
|
17
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { BeginPushUpload, FinishPushUpload, PushUploadPart, PushUploadStarted } from "../contracts/push-uploads.mjs";
|
|
2
2
|
import { fail, gitError } from "../contracts/result.mjs";
|
|
3
|
+
import { openFor } from "../core/access.mjs";
|
|
3
4
|
import { CoreParts } from "../core/parts.mjs";
|
|
4
|
-
import { openFor } from "../lfs/repo.mjs";
|
|
5
5
|
import { pushOptionsRefusal } from "../protocol/wire/receive-pack.mjs";
|
|
6
6
|
import { pushReasonsCapability } from "../protocol/wire/push-limits.mjs";
|
|
7
7
|
import { decodeJson } from "../protocol/wire/json.mjs";
|
|
8
|
-
import { bucketCall,
|
|
8
|
+
import { bucketCall, bucketStream, readWhole } from "../storage/calls.mjs";
|
|
9
9
|
import { PushUploadRow, completeMost, endUpload, partBytes, partLinkLife, partSizeOf, partsOf, pushPackTooLarge, pushUploadGrace, pushUploadKey, pushUploadLife, pushUploadMost, pushUploadRead, pushUploadRowKey } from "../storage/push-uploads.mjs";
|
|
10
10
|
import { afterWrites, bestEffort, decodeRow, storeCall } from "../store/errors.mjs";
|
|
11
11
|
import { randomText } from "../store/random.mjs";
|
|
12
12
|
import { newChangeId, repoScope } from "../store/scopes.mjs";
|
|
13
13
|
import { gitAnswer, resultType } from "./answers.mjs";
|
|
14
|
-
import { brokenBody, plainBody, readWhole } from "./bodies.mjs";
|
|
14
|
+
import { brokenBody, plainBody, readWhole as readWhole$1 } from "./bodies.mjs";
|
|
15
15
|
import { refusalLog, reportOf, routeCounted, thrownLog } from "./receive-pack.mjs";
|
|
16
16
|
import * as Schema from "effect/Schema";
|
|
17
17
|
import * as Effect from "effect/Effect";
|
|
@@ -23,17 +23,17 @@ const bodyMost = 1048576;
|
|
|
23
23
|
/** A pack's header: `PACK`, its version, and how many objects it holds. */
|
|
24
24
|
const packHeader = 12;
|
|
25
25
|
const zero = "0".repeat(40);
|
|
26
|
-
/** Push uploads over `needs`, the server's, staged in `
|
|
27
|
-
const pushUploads = (needs,
|
|
26
|
+
/** Push uploads over `needs`, the server's, staged in `staging`, offered above `above` bytes. */
|
|
27
|
+
const pushUploads = (needs, staging, above) => ({
|
|
28
28
|
above,
|
|
29
29
|
serve: (parts, call) => {
|
|
30
30
|
const { route } = call;
|
|
31
|
-
if (route.kind === "begin") return routeCounted(parts, Effect.provideContext(begin(
|
|
31
|
+
if (route.kind === "begin") return routeCounted(parts, Effect.provideContext(begin(staging.uploads, call), needs));
|
|
32
32
|
if (route.kind === "part") {
|
|
33
|
-
const parted = part(
|
|
33
|
+
const parted = part(staging.uploads, call, route.upload, route.part);
|
|
34
34
|
return routeCounted(parts, Effect.provideContext(parted, needs));
|
|
35
35
|
}
|
|
36
|
-
return routeCounted(parts, complete(
|
|
36
|
+
return routeCounted(parts, complete(staging, parts, call, route.upload).pipe(Effect.tapError((error) => refusalLog(call.repo, error)), Effect.provideContext(needs)));
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
/** `body` as `schema`'s JSON, the answer a push upload's begin or part gives. */
|
|
@@ -46,7 +46,7 @@ const jsonAnswer = (schema, body) => new Response(Schema.encodeSync(Schema.fromJ
|
|
|
46
46
|
});
|
|
47
47
|
/** `request`'s JSON, decoded as `schema`; a refusal names the first check it fails. */
|
|
48
48
|
const bodyOf = /* @__PURE__ */ Effect.fnUntraced(function* (request, schema) {
|
|
49
|
-
const bytes = yield* readWhole(yield* plainBody(request), bodyMost, brokenBody(request));
|
|
49
|
+
const bytes = yield* readWhole$1(yield* plainBody(request), bodyMost, brokenBody(request));
|
|
50
50
|
const decoded = decodeJson(schema)(new TextDecoder().decode(bytes));
|
|
51
51
|
return yield* Result.match(decoded, {
|
|
52
52
|
onFailure: (why) => fail("INVALID_ARGUMENT", `The push upload's body isn't the JSON it takes: ${why}`),
|
|
@@ -70,7 +70,7 @@ const beginRefusal = (body) => {
|
|
|
70
70
|
* `git.repack` due at its `removeAt` to end it. A crash between leaves an upload no link was
|
|
71
71
|
* given for, which the bucket's lifecycle drops.
|
|
72
72
|
*/
|
|
73
|
-
const begin = /* @__PURE__ */ Effect.fnUntraced(function* (
|
|
73
|
+
const begin = /* @__PURE__ */ Effect.fnUntraced(function* (uploads, call) {
|
|
74
74
|
const body = yield* bodyOf(call.request, BeginPushUpload);
|
|
75
75
|
const refused = beginRefusal(body);
|
|
76
76
|
if (refused !== void 0) return yield* Effect.fail(refused);
|
|
@@ -79,7 +79,7 @@ const begin = /* @__PURE__ */ Effect.fnUntraced(function* (bucket, call) {
|
|
|
79
79
|
const at = yield* Clock$1.currentTimeMillis;
|
|
80
80
|
const upload = randomText(16);
|
|
81
81
|
const key = pushUploadKey(repo.internalId, upload);
|
|
82
|
-
const uploadId = yield* bucketCall(
|
|
82
|
+
const uploadId = yield* bucketCall(uploads.beginUpload(key));
|
|
83
83
|
const expiresAt = at + pushUploadLife;
|
|
84
84
|
const removeAt = expiresAt + pushUploadGrace;
|
|
85
85
|
const row = {
|
|
@@ -105,7 +105,7 @@ const begin = /* @__PURE__ */ Effect.fnUntraced(function* (bucket, call) {
|
|
|
105
105
|
}));
|
|
106
106
|
return jsonAnswer(PushUploadStarted, {
|
|
107
107
|
upload,
|
|
108
|
-
partSize: partSizeOf(body.bytes,
|
|
108
|
+
partSize: partSizeOf(body.bytes, uploads.maxParts),
|
|
109
109
|
expiresAt
|
|
110
110
|
});
|
|
111
111
|
});
|
|
@@ -122,23 +122,22 @@ const rowOf = /* @__PURE__ */ Effect.fnUntraced(function* (repo, upload, actor)
|
|
|
122
122
|
};
|
|
123
123
|
});
|
|
124
124
|
/** `POST <repo>/push-uploads/{upload}/parts/{part}`: a PUT link for the part, while it's open. */
|
|
125
|
-
const part = /* @__PURE__ */ Effect.fnUntraced(function* (
|
|
125
|
+
const part = /* @__PURE__ */ Effect.fnUntraced(function* (uploads, call, upload, number) {
|
|
126
126
|
const repo = yield* openFor(call.caller, call.repo, true);
|
|
127
127
|
const actor = yield* actorOf(call.caller);
|
|
128
128
|
const { row } = yield* rowOf(repo.internalId, upload, actor);
|
|
129
129
|
const at = yield* Clock$1.currentTimeMillis;
|
|
130
130
|
if (row.state !== "open" || at >= row.expiresAt) return yield* ended(upload);
|
|
131
|
-
const size = partSizeOf(row.bytes,
|
|
131
|
+
const size = partSizeOf(row.bytes, uploads.maxParts);
|
|
132
132
|
const count = partsOf(row.bytes, size);
|
|
133
133
|
if (number > count) return yield* fail("INVALID_ARGUMENT", `The upload has ${count} parts`);
|
|
134
134
|
const expiresAt = Math.min(at + partLinkLife, row.expiresAt);
|
|
135
135
|
const bytes = partBytes(row.bytes, number, size);
|
|
136
|
-
const url = yield* bucketCall(
|
|
136
|
+
const url = yield* bucketCall(uploads.uploadUrl(row.key, {
|
|
137
137
|
expiresAt,
|
|
138
138
|
uploadId: row.uploadId,
|
|
139
139
|
part: number,
|
|
140
|
-
bytes
|
|
141
|
-
signal
|
|
140
|
+
bytes
|
|
142
141
|
}));
|
|
143
142
|
return jsonAnswer(PushUploadPart, { url });
|
|
144
143
|
});
|
|
@@ -171,13 +170,11 @@ const claim = /* @__PURE__ */ Effect.fnUntraced(function* (repo, upload, actor,
|
|
|
171
170
|
});
|
|
172
171
|
/** How many objects the staged pack's header says, or `undefined` when it isn't a pack. */
|
|
173
172
|
const objectsOf = /* @__PURE__ */ Effect.fnUntraced(function* (bucket, key) {
|
|
174
|
-
const
|
|
173
|
+
const bytes = yield* readWhole(bucket, key, {
|
|
175
174
|
offset: 0,
|
|
176
175
|
length: packHeader
|
|
177
|
-
}
|
|
178
|
-
if (
|
|
179
|
-
const bytes = new Uint8Array(yield* bucketTry(() => new Response(stream).arrayBuffer()));
|
|
180
|
-
if (bytes.length < packHeader) return void 0;
|
|
176
|
+
});
|
|
177
|
+
if (bytes === void 0 || bytes.length < packHeader) return void 0;
|
|
181
178
|
const header = new DataView(bytes.buffer, bytes.byteOffset, packHeader);
|
|
182
179
|
return header.getUint32(0) === 1346454347 ? header.getUint32(8) : void 0;
|
|
183
180
|
});
|
|
@@ -207,13 +204,13 @@ const startOf = (row) => ({
|
|
|
207
204
|
* answers `git-receive-pack`'s report; then the upload ends, its key deleted and its row `ended`,
|
|
208
205
|
* and upkeep at its `removeAt` deletes both.
|
|
209
206
|
*/
|
|
210
|
-
const complete = /* @__PURE__ */ Effect.fnUntraced(function* (
|
|
207
|
+
const complete = /* @__PURE__ */ Effect.fnUntraced(function* (staging, parts, call, upload) {
|
|
211
208
|
const finish = yield* bodyOf(call.request, FinishPushUpload);
|
|
212
209
|
const repo = yield* openFor(call.caller, call.repo, true);
|
|
213
210
|
const actor = yield* actorOf(call.caller);
|
|
214
211
|
const receiving = yield* parts.receive(call.caller, call.repo);
|
|
215
|
-
const row = yield* claim(repo.internalId, upload, actor, finish.parts,
|
|
216
|
-
const pushed = yield* pushStaged(
|
|
212
|
+
const row = yield* claim(repo.internalId, upload, actor, finish.parts, staging.uploads.maxParts);
|
|
213
|
+
const pushed = yield* pushStaged(staging, receiving.push, call.request, row, finish.parts).pipe(Effect.map(Result.mapError(afterWrites)), Effect.mapError(afterWrites), Effect.ensuring(ending(staging, repo.internalId, upload, row)));
|
|
217
214
|
yield* thrownLog(call.repo, pushed);
|
|
218
215
|
return gitAnswer(resultType("git-receive-pack"), yield* reportOf(startOf(row), pushed));
|
|
219
216
|
});
|
|
@@ -237,18 +234,18 @@ const checkedParts = (row, size, named, listed) => {
|
|
|
237
234
|
* The parts checked and joined, then the pack they make pushed, or why it can't be. The join names
|
|
238
235
|
* the ETags the bucket listed, so a part sent again after the check makes the bucket refuse it.
|
|
239
236
|
*/
|
|
240
|
-
const pushStaged = /* @__PURE__ */ Effect.fnUntraced(function* (bucket, push, request, row, named) {
|
|
241
|
-
const listed = yield* Effect.result(bucketCall(
|
|
242
|
-
const size = partSizeOf(row.bytes,
|
|
237
|
+
const pushStaged = /* @__PURE__ */ Effect.fnUntraced(function* ({ bucket, uploads }, push, request, row, named) {
|
|
238
|
+
const listed = yield* Effect.result(bucketCall(uploads.listParts(row.key, row.uploadId)));
|
|
239
|
+
const size = partSizeOf(row.bytes, uploads.maxParts);
|
|
243
240
|
const parts = Result.flatMap(listed, (listing) => checkedParts(row, size, named, listing));
|
|
244
241
|
if (Result.isFailure(parts)) return Result.fail(parts.failure);
|
|
245
|
-
const stored = yield* Effect.result(bucketCall(
|
|
242
|
+
const stored = yield* Effect.result(bucketCall(uploads.completeUpload(row.key, {
|
|
246
243
|
uploadId: row.uploadId,
|
|
247
244
|
parts: parts.success
|
|
248
|
-
}
|
|
245
|
+
})));
|
|
249
246
|
if (Result.isFailure(stored)) return Result.fail(stored.failure);
|
|
250
247
|
const objects = yield* objectsOf(bucket, row.key);
|
|
251
|
-
const bytes = objects === void 0 ? void 0 : yield*
|
|
248
|
+
const bytes = objects === void 0 ? void 0 : yield* bucketStream(bucket, row.key);
|
|
252
249
|
if (objects === void 0 || bytes === void 0) return Result.fail(gitError("INVALID_ARGUMENT", "the push's pack is missing or isn't a pack"));
|
|
253
250
|
const input = {
|
|
254
251
|
request,
|
|
@@ -270,8 +267,8 @@ const pushStaged = /* @__PURE__ */ Effect.fnUntraced(function* (bucket, push, re
|
|
|
270
267
|
* A row upkeep already deleted, under a complete stalled past `removeAt`, stays deleted. An end
|
|
271
268
|
* refused, as past a spent count, is logged at warning, and upkeep ends it instead.
|
|
272
269
|
*/
|
|
273
|
-
const ending = /* @__PURE__ */ Effect.fnUntraced(function* (
|
|
274
|
-
yield* endUpload(bucket, row);
|
|
270
|
+
const ending = /* @__PURE__ */ Effect.fnUntraced(function* (staging, repo, upload, row) {
|
|
271
|
+
yield* endUpload(staging.bucket, staging.uploads, row);
|
|
275
272
|
const { store } = yield* CoreParts;
|
|
276
273
|
const snapshot = yield* storeCall(() => store.read(repoScope(repo), [pushUploadRead(upload)]));
|
|
277
274
|
if ((snapshot.results[0] ?? []).length === 0) return;
|
|
@@ -286,7 +283,7 @@ const ending = /* @__PURE__ */ Effect.fnUntraced(function* (bucket, repo, upload
|
|
|
286
283
|
}
|
|
287
284
|
}]
|
|
288
285
|
}));
|
|
289
|
-
}, (ended,
|
|
286
|
+
}, (ended, _staging, repo, upload, row) => bestEffort(ended, (error) => Effect.logWarning("An upload's end was refused: upkeep ends it at its removeAt").pipe(Effect.annotateLogs({
|
|
290
287
|
repo,
|
|
291
288
|
upload,
|
|
292
289
|
key: row.key,
|
|
@@ -5,7 +5,7 @@ import { answerSpent } from "../store/errors.mjs";
|
|
|
5
5
|
import { joinedBytes } from "../protocol/bytes/joined.mjs";
|
|
6
6
|
import { onBand } from "../protocol/framing/band.mjs";
|
|
7
7
|
import { dataPkt, maxPktData } from "../protocol/framing/pkt-line.mjs";
|
|
8
|
-
import {
|
|
8
|
+
import { advertisementOf, receivePackCapabilities } from "../protocol/wire/advertisement.mjs";
|
|
9
9
|
import { pushOptionsRefusal, readPushStart } from "../protocol/wire/receive-pack.mjs";
|
|
10
10
|
import { reasonPrefix } from "../protocol/wire/push-limits.mjs";
|
|
11
11
|
import { encodePushReport } from "../protocol/wire/report-status.mjs";
|
|
@@ -46,11 +46,13 @@ const unwritable = (error) => gitError("INTERNAL", `Git's answer can't be writte
|
|
|
46
46
|
*/
|
|
47
47
|
const receivePackRefs = (parts, caller, repo, missing) => routeCounted(parts, Effect.gen(function* () {
|
|
48
48
|
const receiving = yield* parts.receive(caller, repo);
|
|
49
|
-
const body = yield*
|
|
49
|
+
const body = yield* advertisementOf(service, receiving.refs, receivePackCapabilities(parts.agent, offersOf(parts)), receiving.hidden);
|
|
50
50
|
return gitAnswer(advertisementType(service), body);
|
|
51
51
|
}).pipe(Effect.catchTag("WireEncodeError", (error) => Effect.fail(unwritable(error))), Effect.catch(missing)));
|
|
52
52
|
/** What receive-pack offers past Git's own: the upload, and what one push may carry. */
|
|
53
|
-
const offersOf = (
|
|
53
|
+
const offersOf = (parts) => {
|
|
54
|
+
const { pushObjectsMost } = parts;
|
|
55
|
+
const uploads = parts.uploads();
|
|
54
56
|
const limits = {};
|
|
55
57
|
if (pushObjectsMost !== void 0) limits.objects = pushObjectsMost;
|
|
56
58
|
if (uploads === void 0) return { limits };
|
|
@@ -110,7 +110,7 @@ const uploadPackRefs = (parts, caller, repo, request, started, missing) => {
|
|
|
110
110
|
if (asksV2(request)) return gitAnswer(advertisementType(service), yield* encodeV2Capabilities(v2Capabilities(parts.agent)));
|
|
111
111
|
const listed = yield* open.lists;
|
|
112
112
|
const capabilities = uploadPackCapabilities(servedHead(listed), parts.agent);
|
|
113
|
-
const body = yield* listingBody(advertisementPages(service, listed, capabilities), listed.next, (message) => encodeRefusedAdvertisement(service, message), deadline, request);
|
|
113
|
+
const body = yield* listingBody(advertisementPages(service, listed, capabilities, listed.hidden), listed.next, (message) => encodeRefusedAdvertisement(service, message), deadline, request);
|
|
114
114
|
return gitAnswer(advertisementType(service), body);
|
|
115
115
|
}).pipe(Effect.catchTag("WireEncodeError", (error) => Effect.fail(unwritable(error))), Effect.catch(missing));
|
|
116
116
|
return countedRequest(parts, Effect.fail)(answered);
|
|
@@ -168,7 +168,7 @@ const uploadPack = (parts, caller, repo, request, started) => {
|
|
|
168
168
|
if (command.command === "ls-refs") {
|
|
169
169
|
const asked = yield* readLsRefs(command);
|
|
170
170
|
const listed = yield* open.lists;
|
|
171
|
-
const pages = yield* listingBody(lsRefsPages(listed, asked), listed.next, encodeErr, deadline, request);
|
|
171
|
+
const pages = yield* listingBody(lsRefsPages(listed, asked, listed.hidden), listed.next, encodeErr, deadline, request);
|
|
172
172
|
return gitAnswer(resultType(service), pages);
|
|
173
173
|
}
|
|
174
174
|
const served = yield* open.serve;
|
package/dist/index.d.mts
CHANGED
|
@@ -8,8 +8,10 @@ import "./server/namespaces.mjs";
|
|
|
8
8
|
import "./core/namespaces.mjs";
|
|
9
9
|
import "./auth/namespaces.mjs";
|
|
10
10
|
import "./event-streams/namespace.mjs";
|
|
11
|
+
import "./rest/namespace.mjs";
|
|
11
12
|
import "./merges/namespace.mjs";
|
|
12
13
|
import "./queue/namespace.mjs";
|
|
14
|
+
import "./lfs/namespace.mjs";
|
|
13
15
|
import { mergeQueue } from "./queue/host.mjs";
|
|
14
16
|
import { CommitCalls, CommitCreateInput, CommitDiffInput, Compare, CompareInput, ComparisonFile, LineCounts, LogInput, RefPublication, Revision, commits_d_exports } from "./contracts/commits.mjs";
|
|
15
17
|
import { Commit, DiffListing, MergeBaseInput, MergeBases, MergeLabels, MergeTree, ObjectWrite, ObjectWrites, PathObject, ReadOptions, ReadPage, RenamesSkipped, Signature, Tag, TagFields, TreeChange, TreeChanges, TreeDiffInput, TreeMergeInput, WalkInput } from "./contracts/engine.mjs";
|
|
@@ -21,22 +23,22 @@ import { MergeAnswer, MergeCalls, MergeCreateInput } from "./contracts/merges.mj
|
|
|
21
23
|
import { HandlerOptions, SavedHandlerOptions } from "./contracts/handlers.mjs";
|
|
22
24
|
import { Grant, GrantAgainInput, GrantAgainRequest, GrantInput, GrantReachInput, GrantResolver } from "./contracts/grants.mjs";
|
|
23
25
|
import { GitScope, InternalRepoId, Oid, RefName, RepoName, TopicId, isInternalId } from "./contracts/ids.mjs";
|
|
26
|
+
import { authorize_d_exports } from "./contracts/authorize.mjs";
|
|
24
27
|
import { Allotment, CopyRow, CopyRowsInput, CopyRowsPage, EffectiveLimits, FetchAnswer, GitObject, GitObjects, HoldingsInput, HoldingsWalked, IndexCalls, IndexReachInput, IndexReached, IndexStatus, IndexTip, IndexTry, IndexTryInput, LinkedObjects, MaintainInput, ObjectHeader, ObjectHeadersInput, ObjectReadInput, ObjectReadResult, ObjectReader, ObjectReaderInput, ObjectSizesInput, ObjectsChange, ObjectsFactory, ObjectsFetchInput, ObjectsOpenInput, ObjectsRead, ObjectsReadInput, ObjectsStarting, ObjectsStartingInput, ObjectsStep, PushedCommit, PushedCommitsInput, Quarantine, ReadObject, ReadObjects, ReceiveInput, ShareInput, StageInput, Staged, StepAnswer, StepInput, WholeObject } from "./contracts/objects.mjs";
|
|
25
28
|
import { BypassOperation, FilesAllowOperation, ForkOperation, MeOperation, Operation, OperationKind, PushOperation, QueueAddOperation, QueueCandidateOperation, QueueEntryOperation, QueueReleaseOperation, QueueTargetOperation, RefsPrivateOperation, RepoListOperation, RepoOperation, TokenCreateOperation, TokenOperation, TokenParties, TopicOperation, WorkOperation } from "./contracts/operations.mjs";
|
|
26
|
-
import { authorize_d_exports } from "./contracts/authorize.mjs";
|
|
27
29
|
import { AddResult, Added, BatchOptions, Bisect, Candidate, CandidateCloseReason, CandidateId, CandidateReportInput, CandidateResult, CandidateState, CandidatesResult, Entry, EntryFailureReason, EntryFields, EntryGroups, EntryHoldInput, EntryHoldsInput, EntryId, EntryResult, EntryState, Held, Hold, HoldFields, HoldId, HoldResult, HoldsResult, JoinInput, Judged, LanesInput, MergeInput, MergeMethod, MergePlan, MergeQueueCalls, MergeQueueLayerOptions, MergeQueueOptions, MetaValue, PreviousQueueSchedule, QueueAddInput, QueueFailureCounts, QueueKeys, QueueListInput, QueueListResult, QueueMeta, QueueOf, QueueRecent, QueueTargetInput, QueueView, ReleaseResult, Released, RemoveResult, Removed, Report, ReportDetails, ReportOptions, ReportResult, Reported, RestartResult, Restarted, Retried, RetryResult, ScheduleOption, TargetHoldInput } from "./contracts/queue.mjs";
|
|
30
|
+
import { repo_records_d_exports } from "./contracts/repo-records.mjs";
|
|
28
31
|
import { Ref, RefCalls, RefCount, RefCountInput, RefEdit, RefInput, RefListInput, RefProtection, RefSource, RefUpdate, RefUpdateKind, RefsUpdateInput, RefsUpdated, refs_d_exports } from "./contracts/refs.mjs";
|
|
29
32
|
import { BasicCredential, BearerCredential, ClientCredential, ClientCredentials, CredentialInput, RemoteCalls, RemoteOptions, TransportFailure, TransportRetry, WithoutActor } from "./contracts/remote.mjs";
|
|
30
|
-
import { repo_records_d_exports } from "./contracts/repo-records.mjs";
|
|
31
33
|
import { PinnedRepo, RepoCalls, RepoCatalogueEntry, RepoCreateInput, RepoDeleted, RepoIndexHold, RepoInfo, RepoInput, RepoListInput, RepoListOrder, RepoRecord, RepoRenameInput, RepoStats, RepoUpdateInput, RepoWork, repos_d_exports } from "./contracts/repos.mjs";
|
|
32
34
|
import { PeelInput, Peeled, TagCalls, TagCreateInput, peelMost, peelTagsMost, tags_d_exports } from "./contracts/tags.mjs";
|
|
33
35
|
import { Prepare, PrepareInput, Topic, TopicAddInput, TopicCalls, TopicCandidate, TopicEntry, TopicEntryInput, TopicFailure, TopicFailureReason, TopicListInput, TopicMergedEntry, TopicReportInput, TopicReportOptions, TopicReportQuestion, TopicState, TopicTarget, TopicWait, TopicsFactory, TopicsOptions } from "./contracts/topics.mjs";
|
|
34
36
|
import { TreeCalls, TreeCreateInput, TreeEdit, TreeEntry, TreeInput, trees_d_exports } from "./contracts/trees.mjs";
|
|
37
|
+
import { auth_d_exports } from "./auth/auth.mjs";
|
|
35
38
|
import { BlobLimit, BlobNone, Bytes, FetchRequest, Filter, LfsPointers, ObjectType, ReadLimits, TreeFilter, allotmentWithin, objectsReadMost } from "./contracts/object-values.mjs";
|
|
39
|
+
import { policy_d_exports } from "./auth/policy.mjs";
|
|
36
40
|
import { Accepted, Awaitable, ContextValue, DataLossContext, DataLossReason, DecisionAnswer, ErrorContext, ExistingContext, ExistingReason, FailureResult, GitError, GitErrorBody, GitErrorCode, GitErrorContexts, GitErrorFields, GitErrorInput, GitErrorTagged, HostErrorContext, HostFunctionName, InvalidInputContext, InvalidInputReason, MissingContext, MissingReason, NotAllowedContext, NotAllowedReason, PreconditionContext, PreconditionReason, RefusalReason, RejectInput, Rejected, ResourceContext, ResourceReason, Result, Success, UnavailableContext, UnavailableReason, Verdict, accept, gitError, httpStatus, isGitError, isRefusalReason, reject } from "./contracts/result.mjs";
|
|
37
|
-
import { auth_d_exports } from "./auth/auth.mjs";
|
|
38
41
|
import { SliceRefusal } from "./client/slice-push.mjs";
|
|
39
|
-
import { policy_d_exports } from "./auth/policy.mjs";
|
|
40
42
|
import { gitPathOf } from "./http/paths.mjs";
|
|
41
43
|
import { git_namespace_d_exports } from "./server/git-namespace.mjs";
|
|
42
44
|
import { createGitServer } from "./server/server.mjs";
|
|
@@ -50,11 +52,13 @@ import { loose, looseLimits } from "./storage/loose.mjs";
|
|
|
50
52
|
import { PacksOptions, UnpackOptions, packs } from "./storage/packs.mjs";
|
|
51
53
|
import { event_streams_d_exports } from "./event-streams/event-streams.mjs";
|
|
52
54
|
import { PacksMemory, packsMemory } from "./storage/packs-memory.mjs";
|
|
53
|
-
import {
|
|
55
|
+
import { layer_d_exports } from "./rest/layer.mjs";
|
|
54
56
|
import { Option, RepackOptions } from "./storage/repack.mjs";
|
|
55
|
-
import { public_d_exports } from "./
|
|
57
|
+
import { public_d_exports as public_d_exports$2 } from "./merges/public.mjs";
|
|
56
58
|
import "./core/rules/namespace.mjs";
|
|
59
|
+
import { public_d_exports as public_d_exports$1 } from "./queue/public.mjs";
|
|
57
60
|
import { FetchAdjustment, FetchRule, FetchRuleInput, FileRuleOptions, GitHooks, PostReceive, PostReceiveInput, PreReceive, ProtectOptions, PushContext, PushFacts, PushHookInput, PushRule, PushRuleInput, RefPatterns, RuleOperation } from "./contracts/rules.mjs";
|
|
61
|
+
import { public_d_exports } from "./lfs/public.mjs";
|
|
58
62
|
import { BeginPushUpload, FinishPushUpload, PushOptions, PushUploadOptions, PushUploadPart, PushUploadStarted } from "./contracts/push-uploads.mjs";
|
|
59
63
|
import { BoundAdapter, ExtendedGit, GitAdapter, GitExtension, GitNeeds, GitRequest, GitServer, GitServerOptions, HostFunctionFailure, ProvidedBy, Refusal, Resolve, ResolveInput, ServerCalls, ServerSetup } from "./contracts/server.mjs";
|
|
60
64
|
import { ImportState } from "./contracts/sync.mjs";
|
|
@@ -63,4 +67,4 @@ import { GitStore, GitStoreAddInput, GitStoreCommitInput, GitStoreReadInput, Hel
|
|
|
63
67
|
import { CreatedToken, PrefixTarget, TokenCalls, TokenCoverage, TokenCreateInput, TokenFields, TokenId, TokenInfo, TokenListInput, TokenRecord, TokenScope, TokenState, TokenTarget, TokensFeature, TrustedWriteInput, VerifiedToken, tokens_d_exports } from "./contracts/tokens.mjs";
|
|
64
68
|
import { rules_d_exports } from "./core/rules/rules.mjs";
|
|
65
69
|
import { WorkCalls, WorkItem, WorkListInput, WorkWriteInput, work_d_exports } from "./contracts/work.mjs";
|
|
66
|
-
export { type Accepted, type AccessOption, type Acting, type Actor, type ActorId, type ActorInput, type AddResult, type Added, type Allotment, type AnonymousActor, type ApprovalBase, type ApprovalDecision, type ApprovalPageContext, type ApprovalPageInput, type ApprovalPrompt, type ApprovedGrant, auth_d_exports as Auth, type AuthInput, authorize_d_exports as Authorize, type AuthorizeAnswer, type AuthorizeInput, type Awaitable, type BasicCredential, type BatchOptions, type BearerCredential, type BeforeAfter, BeginPushUpload, type Bisect, type Blob, type BlobCalls, type BlobCreateInput, BlobLimit, BlobNone, blobs_d_exports as Blobs, type BoundAdapter, type BypassOperation, type Bytes, type CallInput, type Caller, type CallerGrant, type Candidate, type CandidateCloseReason, type CandidateClosed, type CandidateClosedFields, type CandidateId, type CandidateOpened, type CandidateReportInput, type CandidateReported, type CandidateResult, type CandidateState, type CandidatesResult, type ClientAdapter, type ClientCredential, type ClientCredentials, type ClientFetchInput, type ClientFetchResult, type ClientPushInput, type Commit, type CommitCalls, type CommitCreateInput, type CommitDiffInput, commits_d_exports as Commits, type Compare, type CompareInput, type ComparisonFile, type ConfirmApprovalPage, ContextValue, type CopyRow, type CopyRowsInput, type CopyRowsPage, type CreatedObject, type CreatedToken, type CredentialInput, type Credentials, type CredentialsBasic, type CredentialsBearer, DataLossContext, DataLossReason, type DecisionAnswer, type DeniedGrant, type DeviceApproval, type DeviceCodePage, type DeviceCodeRequest, type DeviceCodeResponse, type DeviceExchange, type DiffListing, type EffectiveLimits, type Entry, type EntryAdded, type EntryFailed, type EntryFailureReason, type EntryFields, type EntryGroups, type EntryHoldInput, type EntryHoldsInput, type EntryId, type EntryMerged, type EntryRemoved, type EntryResult, type EntryRetried, type EntryState, ErrorContext, type EventDelivery, type EventEnvelope, type EventFeature, event_streams_d_exports as EventStreams, events_d_exports as Events, type EventsHandler, type EventsInput, ExistingContext, ExistingReason, type ExtendedGit, type FailureResult, type FeedItem, type FenceReason, type FencedPack, type FetchAdjustment, type FetchAnswer, FetchRequest, type FetchRule, type FetchRuleInput, type File, type FileCalls, type FileDiff, type FileReadInput, type FileRuleOptions, files_d_exports as Files, type FilesAllowOperation, type FilesDiffInput, type FilesListInput, type FilesRead, Filter, FinishPushUpload, type ForkCalls, type ForkCreateInput, type ForkFetched, type ForkGetInput, type ForkHolder, type ForkListInput, type ForkOperation, forks_d_exports as Forks, git_namespace_d_exports as Git, type GitAdapter, type GitAuth, type GitAuthorize, type GitClient, type GitClientOptions, type GitError, GitErrorBody, type GitErrorCode, type GitErrorContexts, type GitErrorFields, type GitErrorInput, type GitErrorTagged, type GitEvent, type GitExtension, type GitHooks, type GitNeeds, type GitObject, type GitObjects, type GitRequest, type GitScope, type GitServer, type GitServerOptions, type GitSignInOptions, type GitStore, type GitStoreAddInput, type GitStoreCommitInput, type GitStoreReadInput, type Grant, type GrantAgainInput, type GrantAgainRequest, type GrantInput, type GrantReachInput, type GrantResolver, type HandlerOptions, type Held, type HeldPack, type HiddenSpan, type Hold, type HoldEvent, type HoldEventFields, type HoldFields, type HoldId, type HoldResult, type Holding, type HoldingsInput, type HoldingsWalked, type HoldsResult, HostErrorContext, type HostFunctionFailure, type HostFunctionName, type ImportState, type IndexCalls, type IndexReachInput, type IndexReached, type IndexRefusal, type IndexStatus, type IndexTip, type IndexTry, type IndexTryInput, InternalRepoId, InvalidInputContext, InvalidInputReason, type JoinInput, type Judged, type LanesInput, type LfsCalls, type LfsFeature, type LfsGetInput, type LfsObject, type LfsPointers, type LfsPointersBuilder, type LineCounts, type LinkedObjects, type Listed, type ListedInput, type Localize, type LogInput, type MaintainInput, type MeOperation, type MergeAnswer, type MergeBaseInput, type MergeBases, type MergeCalls, type MergeCreateInput, type MergeInput, type MergeLabels, type MergeMethod, type MergePlan, public_d_exports as MergeQueue, type MergeQueueCalls, type MergeQueueLayerOptions, type MergeQueueOptions, type MergeTree, public_d_exports$1 as Merges, type MetaValue, MissingContext, MissingReason, type NamedActor, NotAllowedContext, NotAllowedReason, type OAuthClient, type OAuthError, type OAuthTokenResponse, type ObjectHeader, type ObjectHeadersInput, type ObjectInput, type ObjectReadInput, type ObjectReadResult, type ObjectReader, type ObjectReaderInput, type ObjectSizesInput, type ObjectType, type ObjectWrite, type ObjectWrites, objects_namespace_d_exports as Objects, type ObjectsChange, type ObjectsFactory, type ObjectsFetchInput, type ObjectsOpenInput, type ObjectsRead, type ObjectsReadInput, type ObjectsStarting, type ObjectsStartingInput, type ObjectsStep, type Oid, type Operation, type OperationKind, type Option, type Pack, type PacksMemory, type PacksOptions, type PagedInput, type PathObject, type PeelInput, type Peeled, type PinnedRepo, policy_d_exports as Policy, type PostReceive, type PostReceiveInput, type PreReceive, PreconditionContext, PreconditionReason, type PrefixTarget, type Prepare, type PrepareInput, type PreviousQueueSchedule, type ProtectOptions, type ProvidedBy, type PushContext, type PushFacts, type PushHookInput, type PushOperation, type PushOptions, type PushRule, type PushRuleInput, type PushUploadOptions, PushUploadPart, PushUploadStarted, type PushedCommit, type PushedCommitsInput, type Quarantine, type QueueAddInput, type QueueAddOperation, type QueueCandidateOperation, type QueueEntryOperation, type QueueEvent, type QueueFailureCounts, type QueueKeys, type QueueListInput, type QueueListResult, type QueueMeta, type QueueOf, type QueueRecent, type QueueReleaseOperation, type QueueRestarted, type QueueTargetInput, type QueueTargetOperation, type QueueView, type ReadLimits, type ReadObject, type ReadObjects, type ReadOptions, type ReadPage, type ReceiveInput, type Ref, type RefAudience, type RefCalls, type RefCount, type RefCountInput, type RefEdit, type RefForced, type RefInput, type RefListInput, type RefName, type RefPatterns, type RefProtection, type RefPublication, type RefPush, type RefSource, type RefUpdate, type RefUpdateKind, type RefUpdated, type RefView, refs_d_exports as Refs, type RefsPrivateOperation, type RefsUpdateInput, type RefsUpdated, type Refusal, type RefusalReason, type RejectInput, type Rejected, type ReleaseResult, type Released, type RemoteCalls, type RemoteOptions, type RemoteRefsInput, type RemoveResult, type Removed, type RenamesSkipped, type RepackOptions, type RepoAccess, type RepoCalls, type RepoCatalogueEntry, type RepoCreateInput, type RepoCreated, type RepoDeleted, type RepoDeletedEvent, type RepoEnvelope, type RepoEvent, type RepoIndexHold, type RepoIndexRefused, type RepoInfo, type RepoInput, type RepoJobFailed, type RepoListInput, type RepoListOperation, type RepoListOrder, type RepoMaintained, type RepoName, type RepoOperation, type RepoRecord, repo_records_d_exports as RepoRecords, type RepoRenameInput, type RepoRenamed, type RepoStats, type RepoUpdateInput, type RepoVisibilityChanged, type RepoWork, type RepoWorkFailed, type Report, type ReportDetails, type ReportOptions, type ReportResult, type Reported, repos_d_exports as Repos, type Resolve, type ResolveInput, ResourceContext, ResourceReason, type RestartResult, type Restarted, type Result, type Retried, type RetryResult, type Revision, type RuleOperation, rules_d_exports as Rules, type SavedHandlerOptions, type ScheduleOption, type ServerCalls, type ServerSetup, type ShareInput, type Signature, type SliceRefusal, type StageInput, type Staged, type StepAnswer, type StepInput, type Success, type Tag, type TagCalls, type TagCreateInput, type TagFields, tags_d_exports as Tags, type TargetHoldInput, type TokenCalls, type TokenCoverage, type TokenCreateInput, type TokenCreateOperation, type TokenEvent, type TokenEventFields, type TokenFields, type TokenId, type TokenInfo, type TokenListInput, type TokenOperation, type TokenParties, type TokenRecord, type TokenScope, type TokenState, type TokenTarget, tokens_d_exports as Tokens, type TokensFeature, type Topic, type TopicAddInput, type TopicAdded, type TopicCalls, type TopicCandidate, type TopicEntry, type TopicEntryInput, type TopicEnvelope, type TopicEvent, type TopicFailed, type TopicFailure, type TopicFailureReason, type TopicId, type TopicListInput, type TopicMerged, type TopicMergedEntry, type TopicOpened, type TopicOperation, type TopicRemoved, type TopicReportInput, type TopicReportOptions, type TopicReportQuestion, type TopicReported, type TopicState, type TopicTarget, type TopicWait, type TopicWorkFailed, type TopicsFactory, type TopicsOptions, type TransportFailure, type TransportRetry, type TreeCalls, type TreeChange, type TreeChanges, type TreeCreateInput, type TreeDiffInput, type TreeEdit, type TreeEntry, TreeFilter, type TreeInput, type TreeMergeInput, trees_d_exports as Trees, type TrustedWriteInput, UnavailableContext, UnavailableReason, type UnpackOptions, Verdict, type VerifiedToken, type WalkInput, type WebApproval, type WebAuthorize, type WebExchange, type WholeObject, type WithoutActor, work_d_exports as Work, type WorkCalls, type WorkItem, type WorkListInput, type WorkOperation, type WorkWriteInput, type WriteInput, accept, allotmentWithin, branchRef, createGitClient, createGitServer, gitError, gitPathOf, httpStatus, isGitError, isInternalId, isRefusalReason, lfs, lfsPointerOid, lfsPointers, loose, looseLimits, maxLfsPointerBytes, mergeQueue, objectsReadMost, packs, packsMemory, paginate, peelMost, peelTagsMost, reject, shortTarget, topics };
|
|
70
|
+
export { type Accepted, type AccessOption, type Acting, type Actor, type ActorId, type ActorInput, type AddResult, type Added, type Allotment, type AnonymousActor, type ApprovalBase, type ApprovalDecision, type ApprovalPageContext, type ApprovalPageInput, type ApprovalPrompt, type ApprovedGrant, auth_d_exports as Auth, type AuthInput, authorize_d_exports as Authorize, type AuthorizeAnswer, type AuthorizeInput, type Awaitable, type BasicCredential, type BatchOptions, type BearerCredential, type BeforeAfter, BeginPushUpload, type Bisect, type Blob, type BlobCalls, type BlobCreateInput, BlobLimit, BlobNone, blobs_d_exports as Blobs, type BoundAdapter, type BypassOperation, type Bytes, type CallInput, type Caller, type CallerGrant, type Candidate, type CandidateCloseReason, type CandidateClosed, type CandidateClosedFields, type CandidateId, type CandidateOpened, type CandidateReportInput, type CandidateReported, type CandidateResult, type CandidateState, type CandidatesResult, type ClientAdapter, type ClientCredential, type ClientCredentials, type ClientFetchInput, type ClientFetchResult, type ClientPushInput, type Commit, type CommitCalls, type CommitCreateInput, type CommitDiffInput, commits_d_exports as Commits, type Compare, type CompareInput, type ComparisonFile, type ConfirmApprovalPage, ContextValue, type CopyRow, type CopyRowsInput, type CopyRowsPage, type CreatedObject, type CreatedToken, type CredentialInput, type Credentials, type CredentialsBasic, type CredentialsBearer, DataLossContext, DataLossReason, type DecisionAnswer, type DeniedGrant, type DeviceApproval, type DeviceCodePage, type DeviceCodeRequest, type DeviceCodeResponse, type DeviceExchange, type DiffListing, type EffectiveLimits, type Entry, type EntryAdded, type EntryFailed, type EntryFailureReason, type EntryFields, type EntryGroups, type EntryHoldInput, type EntryHoldsInput, type EntryId, type EntryMerged, type EntryRemoved, type EntryResult, type EntryRetried, type EntryState, ErrorContext, type EventDelivery, type EventEnvelope, type EventFeature, event_streams_d_exports as EventStreams, events_d_exports as Events, type EventsHandler, type EventsInput, ExistingContext, ExistingReason, type ExtendedGit, type FailureResult, type FeedItem, type FenceReason, type FencedPack, type FetchAdjustment, type FetchAnswer, FetchRequest, type FetchRule, type FetchRuleInput, type File, type FileCalls, type FileDiff, type FileReadInput, type FileRuleOptions, files_d_exports as Files, type FilesAllowOperation, type FilesDiffInput, type FilesListInput, type FilesRead, Filter, FinishPushUpload, type ForkCalls, type ForkCreateInput, type ForkFetched, type ForkGetInput, type ForkHolder, type ForkListInput, type ForkOperation, forks_d_exports as Forks, git_namespace_d_exports as Git, type GitAdapter, type GitAuth, type GitAuthorize, type GitClient, type GitClientOptions, type GitError, GitErrorBody, type GitErrorCode, type GitErrorContexts, type GitErrorFields, type GitErrorInput, type GitErrorTagged, type GitEvent, type GitExtension, type GitHooks, type GitNeeds, type GitObject, type GitObjects, type GitRequest, type GitScope, type GitServer, type GitServerOptions, type GitSignInOptions, type GitStore, type GitStoreAddInput, type GitStoreCommitInput, type GitStoreReadInput, type Grant, type GrantAgainInput, type GrantAgainRequest, type GrantInput, type GrantReachInput, type GrantResolver, type HandlerOptions, type Held, type HeldPack, type HiddenSpan, type Hold, type HoldEvent, type HoldEventFields, type HoldFields, type HoldId, type HoldResult, type Holding, type HoldingsInput, type HoldingsWalked, type HoldsResult, HostErrorContext, type HostFunctionFailure, type HostFunctionName, type ImportState, type IndexCalls, type IndexReachInput, type IndexReached, type IndexRefusal, type IndexStatus, type IndexTip, type IndexTry, type IndexTryInput, InternalRepoId, InvalidInputContext, InvalidInputReason, type JoinInput, type Judged, type LanesInput, public_d_exports as Lfs, type LfsCalls, type LfsFeature, type LfsGetInput, type LfsObject, type LfsPointers, type LfsPointersBuilder, type LineCounts, type LinkedObjects, type Listed, type ListedInput, type Localize, type LogInput, type MaintainInput, type MeOperation, type MergeAnswer, type MergeBaseInput, type MergeBases, type MergeCalls, type MergeCreateInput, type MergeInput, type MergeLabels, type MergeMethod, type MergePlan, public_d_exports$1 as MergeQueue, type MergeQueueCalls, type MergeQueueLayerOptions, type MergeQueueOptions, type MergeTree, public_d_exports$2 as Merges, type MetaValue, MissingContext, MissingReason, type NamedActor, NotAllowedContext, NotAllowedReason, type OAuthClient, type OAuthError, type OAuthTokenResponse, type ObjectHeader, type ObjectHeadersInput, type ObjectInput, type ObjectReadInput, type ObjectReadResult, type ObjectReader, type ObjectReaderInput, type ObjectSizesInput, type ObjectType, type ObjectWrite, type ObjectWrites, objects_namespace_d_exports as Objects, type ObjectsChange, type ObjectsFactory, type ObjectsFetchInput, type ObjectsOpenInput, type ObjectsRead, type ObjectsReadInput, type ObjectsStarting, type ObjectsStartingInput, type ObjectsStep, type Oid, type Operation, type OperationKind, type Option, type Pack, type PacksMemory, type PacksOptions, type PagedInput, type PathObject, type PeelInput, type Peeled, type PinnedRepo, policy_d_exports as Policy, type PostReceive, type PostReceiveInput, type PreReceive, PreconditionContext, PreconditionReason, type PrefixTarget, type Prepare, type PrepareInput, type PreviousQueueSchedule, type ProtectOptions, type ProvidedBy, type PushContext, type PushFacts, type PushHookInput, type PushOperation, type PushOptions, type PushRule, type PushRuleInput, type PushUploadOptions, PushUploadPart, PushUploadStarted, type PushedCommit, type PushedCommitsInput, type Quarantine, type QueueAddInput, type QueueAddOperation, type QueueCandidateOperation, type QueueEntryOperation, type QueueEvent, type QueueFailureCounts, type QueueKeys, type QueueListInput, type QueueListResult, type QueueMeta, type QueueOf, type QueueRecent, type QueueReleaseOperation, type QueueRestarted, type QueueTargetInput, type QueueTargetOperation, type QueueView, type ReadLimits, type ReadObject, type ReadObjects, type ReadOptions, type ReadPage, type ReceiveInput, type Ref, type RefAudience, type RefCalls, type RefCount, type RefCountInput, type RefEdit, type RefForced, type RefInput, type RefListInput, type RefName, type RefPatterns, type RefProtection, type RefPublication, type RefPush, type RefSource, type RefUpdate, type RefUpdateKind, type RefUpdated, type RefView, refs_d_exports as Refs, type RefsPrivateOperation, type RefsUpdateInput, type RefsUpdated, type Refusal, type RefusalReason, type RejectInput, type Rejected, type ReleaseResult, type Released, type RemoteCalls, type RemoteOptions, type RemoteRefsInput, type RemoveResult, type Removed, type RenamesSkipped, type RepackOptions, type RepoAccess, type RepoCalls, type RepoCatalogueEntry, type RepoCreateInput, type RepoCreated, type RepoDeleted, type RepoDeletedEvent, type RepoEnvelope, type RepoEvent, type RepoIndexHold, type RepoIndexRefused, type RepoInfo, type RepoInput, type RepoJobFailed, type RepoListInput, type RepoListOperation, type RepoListOrder, type RepoMaintained, type RepoName, type RepoOperation, type RepoRecord, repo_records_d_exports as RepoRecords, type RepoRenameInput, type RepoRenamed, type RepoStats, type RepoUpdateInput, type RepoVisibilityChanged, type RepoWork, type RepoWorkFailed, type Report, type ReportDetails, type ReportOptions, type ReportResult, type Reported, repos_d_exports as Repos, type Resolve, type ResolveInput, ResourceContext, ResourceReason, layer_d_exports as Rest, type RestartResult, type Restarted, type Result, type Retried, type RetryResult, type Revision, type RuleOperation, rules_d_exports as Rules, type SavedHandlerOptions, type ScheduleOption, type ServerCalls, type ServerSetup, type ShareInput, type Signature, type SliceRefusal, type StageInput, type Staged, type StepAnswer, type StepInput, type Success, type Tag, type TagCalls, type TagCreateInput, type TagFields, tags_d_exports as Tags, type TargetHoldInput, type TokenCalls, type TokenCoverage, type TokenCreateInput, type TokenCreateOperation, type TokenEvent, type TokenEventFields, type TokenFields, type TokenId, type TokenInfo, type TokenListInput, type TokenOperation, type TokenParties, type TokenRecord, type TokenScope, type TokenState, type TokenTarget, tokens_d_exports as Tokens, type TokensFeature, type Topic, type TopicAddInput, type TopicAdded, type TopicCalls, type TopicCandidate, type TopicEntry, type TopicEntryInput, type TopicEnvelope, type TopicEvent, type TopicFailed, type TopicFailure, type TopicFailureReason, type TopicId, type TopicListInput, type TopicMerged, type TopicMergedEntry, type TopicOpened, type TopicOperation, type TopicRemoved, type TopicReportInput, type TopicReportOptions, type TopicReportQuestion, type TopicReported, type TopicState, type TopicTarget, type TopicWait, type TopicWorkFailed, type TopicsFactory, type TopicsOptions, type TransportFailure, type TransportRetry, type TreeCalls, type TreeChange, type TreeChanges, type TreeCreateInput, type TreeDiffInput, type TreeEdit, type TreeEntry, TreeFilter, type TreeInput, type TreeMergeInput, trees_d_exports as Trees, type TrustedWriteInput, UnavailableContext, UnavailableReason, type UnpackOptions, Verdict, type VerifiedToken, type WalkInput, type WebApproval, type WebAuthorize, type WebExchange, type WholeObject, type WithoutActor, work_d_exports as Work, type WorkCalls, type WorkItem, type WorkListInput, type WorkOperation, type WorkWriteInput, type WriteInput, accept, allotmentWithin, branchRef, createGitClient, createGitServer, gitError, gitPathOf, httpStatus, isGitError, isInternalId, isRefusalReason, lfs, lfsPointerOid, lfsPointers, loose, looseLimits, maxLfsPointerBytes, mergeQueue, objectsReadMost, packs, packsMemory, paginate, peelMost, peelTagsMost, reject, shortTarget, topics };
|
package/dist/index.mjs
CHANGED
|
@@ -17,8 +17,10 @@ import { objects_namespace_exports } from "./core/objects/objects-namespace.mjs"
|
|
|
17
17
|
import { auth_exports } from "./auth/auth.mjs";
|
|
18
18
|
import { policy_exports } from "./auth/policy.mjs";
|
|
19
19
|
import { event_streams_exports } from "./event-streams/event-streams.mjs";
|
|
20
|
-
import {
|
|
21
|
-
import { public_exports } from "./
|
|
20
|
+
import { layer_exports } from "./rest/layer.mjs";
|
|
21
|
+
import { public_exports as public_exports$2 } from "./merges/public.mjs";
|
|
22
|
+
import { public_exports as public_exports$1 } from "./queue/public.mjs";
|
|
23
|
+
import { public_exports } from "./lfs/public.mjs";
|
|
22
24
|
import { mergeQueue } from "./queue/host.mjs";
|
|
23
25
|
import { InternalRepoId, isInternalId } from "./contracts/ids.mjs";
|
|
24
26
|
import { BlobLimit, BlobNone, FetchRequest, Filter, TreeFilter, allotmentWithin, objectsReadMost } from "./contracts/object-values.mjs";
|
|
@@ -35,4 +37,4 @@ import { packs } from "./storage/packs.mjs";
|
|
|
35
37
|
import { packsMemory } from "./storage/packs-memory.mjs";
|
|
36
38
|
import { rules_exports } from "./core/rules/rules.mjs";
|
|
37
39
|
import { BeginPushUpload, FinishPushUpload, PushUploadPart, PushUploadStarted } from "./contracts/push-uploads.mjs";
|
|
38
|
-
export { auth_exports as Auth, authorize_exports as Authorize, BeginPushUpload, BlobLimit, BlobNone, blobs_exports as Blobs, commits_exports as Commits, ContextValue, DataLossContext, DataLossReason, ErrorContext, event_streams_exports as EventStreams, events_exports as Events, ExistingContext, ExistingReason, FetchRequest, files_exports as Files, Filter, FinishPushUpload, forks_exports as Forks, git_namespace_exports as Git, GitErrorBody, HostErrorContext, InternalRepoId, InvalidInputContext, InvalidInputReason, public_exports as
|
|
40
|
+
export { auth_exports as Auth, authorize_exports as Authorize, BeginPushUpload, BlobLimit, BlobNone, blobs_exports as Blobs, commits_exports as Commits, ContextValue, DataLossContext, DataLossReason, ErrorContext, event_streams_exports as EventStreams, events_exports as Events, ExistingContext, ExistingReason, FetchRequest, files_exports as Files, Filter, FinishPushUpload, forks_exports as Forks, git_namespace_exports as Git, GitErrorBody, HostErrorContext, InternalRepoId, InvalidInputContext, InvalidInputReason, public_exports as Lfs, public_exports$1 as MergeQueue, public_exports$2 as Merges, MissingContext, MissingReason, NotAllowedContext, NotAllowedReason, objects_namespace_exports as Objects, policy_exports as Policy, PreconditionContext, PreconditionReason, PushUploadPart, PushUploadStarted, refs_exports as Refs, repo_records_exports as RepoRecords, repos_exports as Repos, ResourceContext, ResourceReason, layer_exports as Rest, rules_exports as Rules, tags_exports as Tags, tokens_exports as Tokens, TreeFilter, trees_exports as Trees, UnavailableContext, UnavailableReason, Verdict, work_exports as Work, accept, allotmentWithin, branchRef, createGitClient, createGitServer, gitError, gitPathOf, httpStatus, isGitError, isInternalId, isRefusalReason, lfs, lfsPointerOid, lfsPointers, loose, looseLimits, maxLfsPointerBytes, mergeQueue, objectsReadMost, packs, packsMemory, paginate, peelMost, peelTagsMost, reject, shortTarget, topics };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { LfsObject } from "../contracts/lfs.mjs";
|
|
2
|
+
import { GitError } from "../contracts/result.mjs";
|
|
3
|
+
import { ClaimedCheck } from "../core/rules/context.mjs";
|
|
4
|
+
import { Bucket, Links } from "../contracts/objects.mjs";
|
|
5
|
+
import { CoreNeeds } from "../core/parts.mjs";
|
|
6
|
+
import { ObjectRead } from "./objects.mjs";
|
|
7
|
+
import { LfsService } from "./service.mjs";
|
|
8
|
+
import * as Effect from "effect/Effect";
|
|
9
|
+
import * as Context from "effect/Context";
|
|
10
|
+
/** A listed object's bytes, as `objectOf` reads them over LFS's parts. */
|
|
11
|
+
export type LfsRead = (read: ObjectRead) => Effect.Effect<LfsObject, GitError, CoreNeeds>;
|
|
12
|
+
/**
|
|
13
|
+
* What LFS attaches to the server: its routes, which Git's handler serves, its push check, and its
|
|
14
|
+
* object reads, which `git.lfs.get` calls.
|
|
15
|
+
*/
|
|
16
|
+
export interface LfsAttached {
|
|
17
|
+
readonly service: LfsService;
|
|
18
|
+
readonly check: ClaimedCheck;
|
|
19
|
+
readonly read: LfsRead;
|
|
20
|
+
}
|
|
21
|
+
declare const LfsBase_base: Context.ServiceClass<LfsBase, "@ref0/git/lfs/LfsBase", {
|
|
22
|
+
readonly needs: Context.Context<CoreNeeds>;
|
|
23
|
+
readonly bucket: Bucket | undefined;
|
|
24
|
+
readonly links: Links | undefined;
|
|
25
|
+
readonly attach: (lfs: LfsAttached) => Effect.Effect<void>;
|
|
26
|
+
}>;
|
|
27
|
+
/**
|
|
28
|
+
* What `Git.layer` gives `Lfs.layer`: the server's services, the adapter's bucket, each call it
|
|
29
|
+
* makes charged, and its links, when it has them; and `attach`, once, before the seal.
|
|
30
|
+
*/
|
|
31
|
+
export declare class LfsBase extends /* @__PURE__ */ LfsBase_base {}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
// src/lfs/base.ts
|
|
3
|
+
/**
|
|
4
|
+
* What `Git.layer` gives `Lfs.layer`: the server's services, the adapter's bucket, each call it
|
|
5
|
+
* makes charged, and its links, when it has them; and `attach`, once, before the seal.
|
|
6
|
+
*/
|
|
7
|
+
var LfsBase = class extends (/* @__PURE__ */ Context.Service()("@ref0/git/lfs/LfsBase")) {};
|
|
8
|
+
export { LfsBase };
|
package/dist/lfs/calls.mjs
CHANGED
|
@@ -1,16 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { fail } from "../contracts/result.mjs";
|
|
2
|
+
import { callerFor, openFor } from "../core/access.mjs";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
3
4
|
// src/lfs/calls.ts
|
|
4
|
-
/**
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* `lfs.get`: an object's bytes as the Worker's download reads them, for a call, not a client, through
|
|
7
|
+
* `read`, the one `Lfs.layer` attached. Without it, every object is `NOT_FOUND` to a caller who may
|
|
8
|
+
* read the repo. The drop-in's contents and archives call it until they move onto `Lfs` (2c).
|
|
9
|
+
*/
|
|
10
|
+
const lfsCalls = (read, bound) => {
|
|
6
11
|
const callerOf = callerFor(bound);
|
|
7
|
-
return { get: (repo, { oid, size, signal, internalId, ...input }) =>
|
|
8
|
-
caller
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
return { get: (repo, { oid, size, signal, internalId, ...input }) => {
|
|
13
|
+
const caller = callerOf(input);
|
|
14
|
+
const reading = read();
|
|
15
|
+
return reading === void 0 ? Effect.andThen(openFor(caller, repo, false, internalId), fail("NOT_FOUND", "Object does not exist")) : reading({
|
|
16
|
+
caller,
|
|
17
|
+
repo,
|
|
18
|
+
oid,
|
|
19
|
+
size,
|
|
20
|
+
signal,
|
|
21
|
+
internalId
|
|
22
|
+
});
|
|
23
|
+
} };
|
|
15
24
|
};
|
|
16
25
|
export { lfsCalls };
|