@ref0/git 0.11.0 → 0.12.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 +5 -4
- package/dist/contracts/forks.d.mts +3 -2
- package/dist/contracts/git.d.mts +23 -5
- package/dist/contracts/result.d.mts +7 -5
- package/dist/contracts/result.mjs +7 -5
- package/dist/contracts/sync.d.mts +11 -0
- package/dist/core/access.d.mts +1 -0
- package/dist/core/access.mjs +10 -11
- package/dist/core/asked.mjs +30 -0
- package/dist/core/events/deliver.d.mts +1 -0
- package/dist/core/events/deliver.mjs +5 -1
- package/dist/core/forks.mjs +39 -13
- package/dist/core/imports.mjs +9 -4
- package/dist/core/objects/reading.mjs +17 -9
- package/dist/core/parts.d.mts +2 -1
- package/dist/core/push.mjs +11 -8
- package/dist/core/refs.mjs +6 -3
- package/dist/core/registered-rows.d.mts +1 -0
- package/dist/core/registered-rows.mjs +7 -5
- package/dist/core/repack.mjs +5 -3
- package/dist/core/saved-caller-views.d.mts +18 -0
- package/dist/core/saved-caller-views.mjs +17 -4
- package/dist/core/saved-callers-public.d.mts +3 -3
- package/dist/core/saved-callers-public.mjs +3 -2
- package/dist/core/saved-callers.d.mts +7 -0
- package/dist/extend.d.mts +2 -1
- package/dist/extend.mjs +2 -1
- package/dist/http/push-uploads.mjs +6 -3
- package/dist/lfs/locks.mjs +14 -9
- package/dist/lfs/objects.mjs +27 -20
- package/dist/queue/calls.mjs +21 -1
- package/dist/rest/blobs.d.mts +15 -15
- package/dist/rest/commits.d.mts +191 -191
- package/dist/rest/files.d.mts +70 -70
- package/dist/rest/forks.d.mts +72 -72
- package/dist/rest/layer.mjs +8 -1
- package/dist/rest/queue.d.mts +212 -212
- package/dist/rest/refs.d.mts +148 -148
- package/dist/rest/repos.d.mts +47 -47
- package/dist/rest/tags.d.mts +76 -76
- package/dist/rest/tokens.d.mts +101 -101
- package/dist/rest/topics.d.mts +112 -112
- package/dist/rest/trees.d.mts +73 -73
- package/dist/rest/work.d.mts +39 -39
- package/dist/server/git-namespace.d.mts +3 -3
- package/dist/server/server.mjs +6 -4
- package/dist/storage/memory-budget.mjs +128 -6
- package/dist/storage/merge-cut.mjs +5 -4
- package/dist/storage/pack-reads.mjs +239 -27
- package/dist/storage/prune-seen.mjs +11 -6
- package/dist/storage/prune-walk.mjs +168 -68
- package/dist/storage/quarantine.mjs +2 -0
- package/dist/store/repo-record.d.mts +25 -0
- package/dist/store/repo-record.mjs +55 -1
- package/dist/sync/github.mjs +10 -1
- package/dist/sync/import.mjs +3 -2
- package/dist/sync/mirror.mjs +24 -17
- package/dist/sync/said.mjs +204 -0
- package/dist/sync/step.mjs +8 -8
- package/dist/sync/tries.mjs +34 -18
- package/dist/topics/advance.mjs +10 -3
- package/package.json +3 -3
package/dist/rest/forks.d.mts
CHANGED
|
@@ -1,15 +1,40 @@
|
|
|
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 ForksApiGroup_base: HttpApiGroup.HttpApiGroup<"forks", HttpApiEndpoint.HttpApiEndpoint<"
|
|
4
|
+
declare const ForksApiGroup_base: HttpApiGroup.HttpApiGroup<"forks", HttpApiEndpoint.HttpApiEndpoint<"list", "GET", "/repos/:repo/-/forks", Schema.toCodecStringTree<Schema.Struct<{
|
|
5
5
|
repo: Schema.String;
|
|
6
|
-
}>>,
|
|
7
|
-
readonly
|
|
8
|
-
readonly
|
|
9
|
-
|
|
6
|
+
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
7
|
+
readonly after: Schema.optionalKey<Schema.String>;
|
|
8
|
+
readonly limit: Schema.optionalKey<Schema.Int>;
|
|
9
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
10
|
+
readonly items: Schema.mutable<Schema.$Array<Schema.Struct<{
|
|
10
11
|
readonly name: Schema.String;
|
|
11
|
-
readonly
|
|
12
|
-
|
|
12
|
+
readonly defaultBranch: Schema.optionalKey<Schema.String>;
|
|
13
|
+
readonly public: Schema.Boolean;
|
|
14
|
+
readonly upstream: Schema.optionalKey<Schema.String>;
|
|
15
|
+
readonly stats: Schema.Struct<{
|
|
16
|
+
readonly repo: Schema.String;
|
|
17
|
+
readonly refs: Schema.Number;
|
|
18
|
+
readonly packs: Schema.optionalKey<Schema.Number>;
|
|
19
|
+
readonly packBytes: Schema.optionalKey<Schema.Number>;
|
|
20
|
+
readonly ownBytes: Schema.optionalKey<Schema.Number>;
|
|
21
|
+
readonly pushedAt: Schema.optionalKey<Schema.Number>;
|
|
22
|
+
readonly maintainedAt: Schema.optionalKey<Schema.Number>;
|
|
23
|
+
}>;
|
|
24
|
+
readonly work: Schema.optionalKey<Schema.Struct<{
|
|
25
|
+
readonly waiting: Schema.Number;
|
|
26
|
+
readonly oldestDue: Schema.optionalKey<Schema.Number>;
|
|
27
|
+
readonly failed: Schema.Number;
|
|
28
|
+
readonly oldestFailed: Schema.optionalKey<Schema.Number>;
|
|
29
|
+
readonly index: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
30
|
+
readonly state: Schema.Literal<"refused">;
|
|
31
|
+
readonly retryAt: Schema.Number;
|
|
32
|
+
}>, Schema.Struct<{
|
|
33
|
+
readonly state: Schema.Literal<"too-large">;
|
|
34
|
+
}>]>>;
|
|
35
|
+
}>>;
|
|
36
|
+
}>>>;
|
|
37
|
+
readonly next: Schema.optionalKey<Schema.String>;
|
|
13
38
|
}>>, Schema.toCodecJson<HttpApiSchema.encodeToWithHeaders<Schema.Codec<{
|
|
14
39
|
readonly code: "ALREADY_EXISTS";
|
|
15
40
|
readonly message: string;
|
|
@@ -837,35 +862,14 @@ declare const ForksApiGroup_base: HttpApiGroup.HttpApiGroup<"forks", HttpApiEndp
|
|
|
837
862
|
}>, {
|
|
838
863
|
"ref0-code": Schema.String;
|
|
839
864
|
'www-authenticate': Schema.String;
|
|
840
|
-
}>>, GitCallerMiddleware, GitRestServices> | HttpApiEndpoint.HttpApiEndpoint<"
|
|
865
|
+
}>>, GitCallerMiddleware, GitRestServices> | HttpApiEndpoint.HttpApiEndpoint<"fetch", "POST", "/repos/:repo/-/forks/fetch", Schema.toCodecStringTree<Schema.Struct<{
|
|
841
866
|
repo: Schema.String;
|
|
842
|
-
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
readonly
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
readonly upstream: Schema.optionalKey<Schema.String>;
|
|
849
|
-
readonly stats: Schema.Struct<{
|
|
850
|
-
readonly repo: Schema.String;
|
|
851
|
-
readonly refs: Schema.Number;
|
|
852
|
-
readonly packs: Schema.optionalKey<Schema.Number>;
|
|
853
|
-
readonly packBytes: Schema.optionalKey<Schema.Number>;
|
|
854
|
-
readonly ownBytes: Schema.optionalKey<Schema.Number>;
|
|
855
|
-
readonly pushedAt: Schema.optionalKey<Schema.Number>;
|
|
856
|
-
readonly maintainedAt: Schema.optionalKey<Schema.Number>;
|
|
857
|
-
}>;
|
|
858
|
-
readonly work: Schema.optionalKey<Schema.Struct<{
|
|
859
|
-
readonly waiting: Schema.Number;
|
|
860
|
-
readonly oldestDue: Schema.optionalKey<Schema.Number>;
|
|
861
|
-
readonly failed: Schema.Number;
|
|
862
|
-
readonly oldestFailed: Schema.optionalKey<Schema.Number>;
|
|
863
|
-
readonly index: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
864
|
-
readonly state: Schema.Literal<"refused">;
|
|
865
|
-
readonly retryAt: Schema.Number;
|
|
866
|
-
}>, Schema.Struct<{
|
|
867
|
-
readonly state: Schema.Literal<"too-large">;
|
|
868
|
-
}>]>>;
|
|
867
|
+
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
868
|
+
readonly source: Schema.String;
|
|
869
|
+
readonly head: Schema.optionalKey<Schema.String>;
|
|
870
|
+
readonly tips: Schema.$Array<Schema.Struct<{
|
|
871
|
+
readonly name: Schema.String;
|
|
872
|
+
readonly oid: Schema.String;
|
|
869
873
|
}>>;
|
|
870
874
|
}>>, Schema.toCodecJson<HttpApiSchema.encodeToWithHeaders<Schema.Codec<{
|
|
871
875
|
readonly code: "ALREADY_EXISTS";
|
|
@@ -1266,12 +1270,10 @@ declare const ForksApiGroup_base: HttpApiGroup.HttpApiGroup<"forks", HttpApiEndp
|
|
|
1266
1270
|
}>, {
|
|
1267
1271
|
"ref0-code": Schema.String;
|
|
1268
1272
|
'www-authenticate': Schema.String;
|
|
1269
|
-
}>>, GitCallerMiddleware, GitRestServices> | HttpApiEndpoint.HttpApiEndpoint<"
|
|
1273
|
+
}>>, GitCallerMiddleware, GitRestServices> | HttpApiEndpoint.HttpApiEndpoint<"sync", "POST", "/repos/:repo/-/forks/sync", Schema.toCodecStringTree<Schema.Struct<{
|
|
1270
1274
|
repo: Schema.String;
|
|
1271
1275
|
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
1272
|
-
|
|
1273
|
-
readonly key: Schema.optionalKey<Schema.String>;
|
|
1274
|
-
readonly name: Schema.optionalKey<Schema.String>;
|
|
1276
|
+
key: Schema.optionalKey<Schema.String>;
|
|
1275
1277
|
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
1276
1278
|
readonly name: Schema.String;
|
|
1277
1279
|
readonly defaultBranch: Schema.optionalKey<Schema.String>;
|
|
@@ -1697,40 +1699,38 @@ declare const ForksApiGroup_base: HttpApiGroup.HttpApiGroup<"forks", HttpApiEndp
|
|
|
1697
1699
|
}>, {
|
|
1698
1700
|
"ref0-code": Schema.String;
|
|
1699
1701
|
'www-authenticate': Schema.String;
|
|
1700
|
-
}>>, GitCallerMiddleware, GitRestServices> | HttpApiEndpoint.HttpApiEndpoint<"
|
|
1702
|
+
}>>, GitCallerMiddleware, GitRestServices> | HttpApiEndpoint.HttpApiEndpoint<"create", "POST", "/repos/:repo/-/forks", Schema.toCodecStringTree<Schema.Struct<{
|
|
1701
1703
|
repo: Schema.String;
|
|
1702
|
-
}>>, Schema.
|
|
1703
|
-
readonly
|
|
1704
|
-
readonly
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
}>>>;
|
|
1733
|
-
readonly next: Schema.optionalKey<Schema.String>;
|
|
1704
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
1705
|
+
readonly holder: Schema.String;
|
|
1706
|
+
readonly key: Schema.optionalKey<Schema.String>;
|
|
1707
|
+
readonly name: Schema.optionalKey<Schema.String>;
|
|
1708
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
1709
|
+
readonly name: Schema.String;
|
|
1710
|
+
readonly defaultBranch: Schema.optionalKey<Schema.String>;
|
|
1711
|
+
readonly public: Schema.Boolean;
|
|
1712
|
+
readonly upstream: Schema.optionalKey<Schema.String>;
|
|
1713
|
+
readonly stats: Schema.Struct<{
|
|
1714
|
+
readonly repo: Schema.String;
|
|
1715
|
+
readonly refs: Schema.Number;
|
|
1716
|
+
readonly packs: Schema.optionalKey<Schema.Number>;
|
|
1717
|
+
readonly packBytes: Schema.optionalKey<Schema.Number>;
|
|
1718
|
+
readonly ownBytes: Schema.optionalKey<Schema.Number>;
|
|
1719
|
+
readonly pushedAt: Schema.optionalKey<Schema.Number>;
|
|
1720
|
+
readonly maintainedAt: Schema.optionalKey<Schema.Number>;
|
|
1721
|
+
}>;
|
|
1722
|
+
readonly work: Schema.optionalKey<Schema.Struct<{
|
|
1723
|
+
readonly waiting: Schema.Number;
|
|
1724
|
+
readonly oldestDue: Schema.optionalKey<Schema.Number>;
|
|
1725
|
+
readonly failed: Schema.Number;
|
|
1726
|
+
readonly oldestFailed: Schema.optionalKey<Schema.Number>;
|
|
1727
|
+
readonly index: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
1728
|
+
readonly state: Schema.Literal<"refused">;
|
|
1729
|
+
readonly retryAt: Schema.Number;
|
|
1730
|
+
}>, Schema.Struct<{
|
|
1731
|
+
readonly state: Schema.Literal<"too-large">;
|
|
1732
|
+
}>]>>;
|
|
1733
|
+
}>>;
|
|
1734
1734
|
}>>, Schema.toCodecJson<HttpApiSchema.encodeToWithHeaders<Schema.Codec<{
|
|
1735
1735
|
readonly code: "ALREADY_EXISTS";
|
|
1736
1736
|
readonly message: string;
|
package/dist/rest/layer.mjs
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { register } from "../contracts/git.mjs";
|
|
3
|
+
import { MergeParts, mergePartsOption } from "../core/merge-parts.mjs";
|
|
3
4
|
import { ServerSeam } from "../core/seam.mjs";
|
|
4
5
|
import { GitRestServices } from "./caller.mjs";
|
|
5
6
|
import { notFound, restApp } from "./handler.mjs";
|
|
6
7
|
import * as Effect from "effect/Effect";
|
|
8
|
+
import * as Option from "effect/Option";
|
|
7
9
|
import * as Context from "effect/Context";
|
|
8
10
|
import * as Layer from "effect/Layer";
|
|
9
11
|
// src/rest/layer.ts
|
|
@@ -24,8 +26,9 @@ const restRoots = [
|
|
|
24
26
|
const layer = () => Layer.effectDiscard(Effect.gen(function* () {
|
|
25
27
|
const built = yield* (yield* ServerSeam).parts;
|
|
26
28
|
const rest = yield* register({ name: "rest" });
|
|
29
|
+
const merges = yield* mergePartsOption;
|
|
27
30
|
const { basePath, identify, callsFor, tokensOn, authorize, listen, renamedTo } = built;
|
|
28
|
-
const
|
|
31
|
+
const own = Context.make(GitRestServices, {
|
|
29
32
|
basePath,
|
|
30
33
|
identify,
|
|
31
34
|
callsFor,
|
|
@@ -33,6 +36,10 @@ const layer = () => Layer.effectDiscard(Effect.gen(function* () {
|
|
|
33
36
|
authorize,
|
|
34
37
|
listen
|
|
35
38
|
});
|
|
39
|
+
const services = Option.match(merges, {
|
|
40
|
+
onNone: () => own,
|
|
41
|
+
onSome: (parts) => Context.add(own, MergeParts, parts)
|
|
42
|
+
});
|
|
36
43
|
const renamedFor = (request, repo) => Effect.flatMap(identify(request), (caller) => renamedTo(caller, repo));
|
|
37
44
|
const { owned } = yield* Effect.acquireRelease(Effect.sync(() => restApp({
|
|
38
45
|
basePath,
|