@ref0/git 0.9.0 → 0.10.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/contracts/commits.d.mts +14 -2
- package/dist/contracts/commits.mjs +22 -3
- package/dist/contracts/refs.mjs +3 -1
- package/dist/core/events/seen.mjs +5 -4
- package/dist/core/job-view.mjs +20 -0
- package/dist/core/ref-view.mjs +1 -25
- package/dist/core/work.mjs +47 -4
- package/dist/engine/walk.mjs +51 -13
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +3 -3
- package/dist/lfs/upload-most.mjs +1 -1
- package/dist/rest/commits.d.mts +90 -86
- package/dist/rest/forks.d.mts +72 -72
- package/dist/rest/refs.d.mts +142 -142
- package/dist/rest/repos.d.mts +41 -41
- package/dist/rest/topics.d.mts +104 -104
- package/dist/rest/trees.d.mts +61 -61
- package/package.json +3 -3
|
@@ -11,7 +11,7 @@ import * as Schema from "effect/Schema";
|
|
|
11
11
|
import { Listing } from "@ref0/infra";
|
|
12
12
|
import * as Context from "effect/Context";
|
|
13
13
|
declare namespace commits_d_exports {
|
|
14
|
-
export { CommitCalls, CommitCreate, CommitCreateFields, CommitCreateInput, CommitDiff, CommitDiffInput, CommitMessage, CommitPick, CommitPickInput, CommitRevert, CommitRevertInput, Commits, CommitsMergeBase, CommitsMergeBaseInput, Compare, CompareInput, CompareRange, ComparisonFile, ComparisonFileFields, LineCounts, Log, LogInput, RefPublication, Revision, compare, create, diff, get, list, mergeBase, pick, revert };
|
|
14
|
+
export { CommitCalls, CommitCreate, CommitCreateFields, CommitCreateInput, CommitDiff, CommitDiffInput, CommitMessage, CommitPick, CommitPickInput, CommitRevert, CommitRevertInput, Commits, CommitsMergeBase, CommitsMergeBaseInput, Compare, CompareInput, CompareRange, ComparisonFile, ComparisonFileFields, LineCounts, Log, LogInput, RefPublication, Revision, compare, create, diff, get, list, logEmailsMost, mergeBase, pick, revert };
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* A revision, as a call names a commit: a full object ID, a full ref name, `HEAD` for the
|
|
@@ -21,10 +21,22 @@ declare namespace commits_d_exports {
|
|
|
21
21
|
*/
|
|
22
22
|
export declare const Revision: Schema.String;
|
|
23
23
|
export type Revision = typeof Revision.Type;
|
|
24
|
-
/**
|
|
24
|
+
/** The most addresses a log's `authors` or `committers` names. */
|
|
25
|
+
export declare const logEmailsMost = 100;
|
|
26
|
+
/**
|
|
27
|
+
* `git log <ref> [-- <path>]`: newest first; with `path`, only the commits that changed it.
|
|
28
|
+
* `authors` and `committers` keep the commits whose author's or committer's email is one they
|
|
29
|
+
* name, compared without case. `since` and `until` keep the commits committed at or after and at
|
|
30
|
+
* or before them, as `git log --since` and `--until` do, and as with `--since` the walk follows no
|
|
31
|
+
* commit committed before `since`, so it stops along each line at the first older one.
|
|
32
|
+
*/
|
|
25
33
|
export declare const Log: Schema.Struct<{
|
|
26
34
|
readonly ref: Schema.String;
|
|
27
35
|
readonly path: Schema.optionalKey<Schema.String>;
|
|
36
|
+
readonly authors: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
37
|
+
readonly committers: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
38
|
+
readonly since: Schema.optionalKey<Schema.Number>;
|
|
39
|
+
readonly until: Schema.optionalKey<Schema.Number>;
|
|
28
40
|
}>;
|
|
29
41
|
export type Log = typeof Log.Type;
|
|
30
42
|
export interface LogInput extends ReadPage, Log {}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { Commit, DiffListing, Listing, Page, Signature, TreeChangeFields } from "./engine.mjs";
|
|
3
3
|
import { Oid, RefName } from "./ids.mjs";
|
|
4
|
+
import { Moment } from "./repos.mjs";
|
|
4
5
|
import * as Effect from "effect/Effect";
|
|
5
6
|
import * as Schema from "effect/Schema";
|
|
6
7
|
import * as Context from "effect/Context";
|
|
@@ -26,6 +27,7 @@ var commits_exports = /* @__PURE__ */ __exportAll({
|
|
|
26
27
|
diff: () => diff,
|
|
27
28
|
get: () => get,
|
|
28
29
|
list: () => list,
|
|
30
|
+
logEmailsMost: () => 100,
|
|
29
31
|
mergeBase: () => mergeBase,
|
|
30
32
|
pick: () => pick,
|
|
31
33
|
revert: () => revert
|
|
@@ -37,10 +39,27 @@ var commits_exports = /* @__PURE__ */ __exportAll({
|
|
|
37
39
|
* commit.
|
|
38
40
|
*/
|
|
39
41
|
const Revision = Schema.String;
|
|
40
|
-
/**
|
|
42
|
+
/** The most addresses a log's `authors` or `committers` names. */
|
|
43
|
+
const logEmailsMost = 100;
|
|
44
|
+
/**
|
|
45
|
+
* A log's `authors` or `committers`: at least one address, since a query sends an empty list as
|
|
46
|
+
* none, and at most `logEmailsMost`.
|
|
47
|
+
*/
|
|
48
|
+
const LogEmails = /* @__PURE__ */ Schema.Array(Schema.String).check(Schema.isMinLength(1, { message: "named no address: leave the field out instead" }), Schema.isMaxLength(100, { message: `named more than 100 addresses` }));
|
|
49
|
+
/**
|
|
50
|
+
* `git log <ref> [-- <path>]`: newest first; with `path`, only the commits that changed it.
|
|
51
|
+
* `authors` and `committers` keep the commits whose author's or committer's email is one they
|
|
52
|
+
* name, compared without case. `since` and `until` keep the commits committed at or after and at
|
|
53
|
+
* or before them, as `git log --since` and `--until` do, and as with `--since` the walk follows no
|
|
54
|
+
* commit committed before `since`, so it stops along each line at the first older one.
|
|
55
|
+
*/
|
|
41
56
|
const Log = /* @__PURE__ */ Schema.Struct({
|
|
42
57
|
ref: Revision,
|
|
43
|
-
path: Schema.optionalKey(Schema.String)
|
|
58
|
+
path: Schema.optionalKey(Schema.String),
|
|
59
|
+
authors: Schema.optionalKey(LogEmails),
|
|
60
|
+
committers: Schema.optionalKey(LogEmails),
|
|
61
|
+
since: Schema.optionalKey(Moment),
|
|
62
|
+
until: Schema.optionalKey(Moment)
|
|
44
63
|
});
|
|
45
64
|
const CommitsMergeBase = /* @__PURE__ */ Schema.Struct({ commits: Schema.Array(Revision) });
|
|
46
65
|
/** `git diff <base> <head>`, as `diff-tree -r -M` lists it: renames unless `renames` is false. */
|
|
@@ -144,4 +163,4 @@ const compare = (repo, input, by) => Effect.flatMap(Effect.service(Commits), (ca
|
|
|
144
163
|
const create = (repo, input, by) => Effect.flatMap(Effect.service(Commits), (calls) => calls.create(repo, input, by));
|
|
145
164
|
const revert = (repo, input, by) => Effect.flatMap(Effect.service(Commits), (calls) => calls.revert(repo, input, by));
|
|
146
165
|
const pick = (repo, input, by) => Effect.flatMap(Effect.service(Commits), (calls) => calls.pick(repo, input, by));
|
|
147
|
-
export { CommitCreate, CommitDiff, CommitMessage, CommitPick, CommitRevert, Commits, CommitsMergeBase, Compare, CompareRange, ComparisonFile, ComparisonFileFields, LineCounts, Log, RefPublication, Revision, commits_exports, compare, create, diff, get, list, mergeBase, pick, revert };
|
|
166
|
+
export { CommitCreate, CommitDiff, CommitMessage, CommitPick, CommitRevert, Commits, CommitsMergeBase, Compare, CompareRange, ComparisonFile, ComparisonFileFields, LineCounts, Log, RefPublication, Revision, commits_exports, compare, create, diff, get, list, logEmailsMost, mergeBase, pick, revert };
|
package/dist/contracts/refs.mjs
CHANGED
|
@@ -58,6 +58,8 @@ const Ref = /* @__PURE__ */ Schema.Struct({
|
|
|
58
58
|
name: RefName,
|
|
59
59
|
oid: Oid
|
|
60
60
|
}).annotate({ identifier: "Ref" });
|
|
61
|
+
/** The most names one `refs.sees` call takes: a page of 50 pulls, each with its two refs. */
|
|
62
|
+
const maxSeenRefs = 100;
|
|
61
63
|
const RefsSees = /* @__PURE__ */ Schema.Struct({
|
|
62
64
|
/** Full ref names, `maxSeenRefs` at most, which needn't exist. */
|
|
63
65
|
refs: Schema.Array(RefName).annotate({ description: "Full ref names, 100 at most, which needn't exist" }) });
|
|
@@ -114,4 +116,4 @@ const sees = (repo, input, by) => Effect.flatMap(Effect.service(Refs), (refs) =>
|
|
|
114
116
|
const list = (repo, input, by) => Effect.flatMap(Effect.service(Refs), (refs) => refs.list(repo, input, by));
|
|
115
117
|
const count = (repo, input, by) => Effect.flatMap(Effect.service(Refs), (refs) => refs.count(repo, input, by));
|
|
116
118
|
const update = (repo, input, by) => Effect.flatMap(Effect.service(Refs), (refs) => refs.update(repo, input, by));
|
|
117
|
-
export { Ref, RefApplied, RefCount, RefCountFields, RefEdit, RefList, RefOutcome, RefProtection, RefSource, RefUpdate, RefUpdateKind, Refs, RefsProtections, RefsSees, RefsUpdate, count, get, list, protection, protections, refs_exports, sees, update };
|
|
119
|
+
export { Ref, RefApplied, RefCount, RefCountFields, RefEdit, RefList, RefOutcome, RefProtection, RefSource, RefUpdate, RefUpdateKind, Refs, RefsProtections, RefsSees, RefsUpdate, count, get, list, maxSeenRefs, protection, protections, refs_exports, sees, update };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shownEvent } from "../../store/outbox.mjs";
|
|
2
|
-
import { seesJob } from "../
|
|
2
|
+
import { seesJob } from "../job-view.mjs";
|
|
3
3
|
// src/core/events/seen.ts
|
|
4
4
|
/** Which of `RefPush`'s counts `ref` is in: a branch's, a tag's, or neither. */
|
|
5
5
|
const countOf = (ref) => {
|
|
@@ -37,7 +37,8 @@ const pushCounts = (access, moved) => {
|
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
39
|
/**
|
|
40
|
-
* Whether a caller who isn't whole sees `event`: every ref it names, a job's by `seesJob
|
|
40
|
+
* Whether a caller who isn't whole sees `event`: every ref it names, a job's by `seesJob`, and
|
|
41
|
+
* nothing of the repo's size, so no `repo.maintained` and no index round's refusal. A queue
|
|
41
42
|
* event that names only an entry or a candidate is never seen, since only the event that added
|
|
42
43
|
* the entry names its refs, and a candidate's ref is the queue's own (Q749). A topic's events are
|
|
43
44
|
* in its own scope, never a repo's, and a caller sees none here.
|
|
@@ -48,11 +49,11 @@ const seesEvent = (refView, event) => {
|
|
|
48
49
|
case "repo.deleted":
|
|
49
50
|
case "repo.renamed":
|
|
50
51
|
case "repo.visibility.changed":
|
|
51
|
-
case "repo.maintained":
|
|
52
52
|
case "token.created":
|
|
53
53
|
case "token.revoked": return true;
|
|
54
54
|
case "ref.updated": return refView.sees(event.ref);
|
|
55
|
-
case "repo.
|
|
55
|
+
case "repo.maintained": return refView.whole;
|
|
56
|
+
case "repo.work.failed": return "name" in event ? seesJob(refView, event) : refView.whole;
|
|
56
57
|
case "queue.entry.added": return refView.sees(event.target) && refView.sees(event.source);
|
|
57
58
|
case "queue.hold.created":
|
|
58
59
|
case "queue.hold.released": return "target" in event && refView.sees(event.target);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { advanceName } from "../store/queue-jobs.mjs";
|
|
2
|
+
import { mirrorJobName } from "../store/records.mjs";
|
|
3
|
+
// src/core/job-view.ts
|
|
4
|
+
/**
|
|
5
|
+
* The job kinds in a repo's scope that a caller who doesn't see every ref may see, each keyed by
|
|
6
|
+
* the ref it's of: a mirror's ref, and an advance's target. Such a caller sees one only when it
|
|
7
|
+
* sees the ref. Deny by default: every other kind, and any kind added later that isn't here, is
|
|
8
|
+
* seen only by a caller who sees every ref (#2195). A candidate's build and timeout name its ref
|
|
9
|
+
* under `refs/queue/` (Q749), a trim its target or the ID it trimmed up to, and a job over the
|
|
10
|
+
* whole repo, its upkeep's, its index builds', its listing's or its import's, may say in its
|
|
11
|
+
* failure or progress how big the repo is, which a hidden push moves. A delivery's job,
|
|
12
|
+
* `git.deliver.<name>`, a hidden push alone saves.
|
|
13
|
+
*/
|
|
14
|
+
const refKeyed = /* @__PURE__ */ new Set([mirrorJobName, advanceName]);
|
|
15
|
+
/**
|
|
16
|
+
* Whether a caller with `refView` sees `job`: `list`, `retry` and `discard` answer one it doesn't
|
|
17
|
+
* as a missing one, and the event stream leaves out its `repo.work.failed`.
|
|
18
|
+
*/
|
|
19
|
+
const seesJob = (refView, job) => refView.whole || refKeyed.has(job.name) && refView.sees(job.key);
|
|
20
|
+
export { seesJob };
|
package/dist/core/ref-view.mjs
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { fail } from "../contracts/result.mjs";
|
|
2
2
|
import { readToken, tokenState } from "../auth/token-rows.mjs";
|
|
3
3
|
import { withRequestHold } from "../store/call-count.mjs";
|
|
4
|
-
import { advanceName, buildName, timeoutName, trimName } from "../store/queue-jobs.mjs";
|
|
5
|
-
import { mirrorJobName } from "../store/records.mjs";
|
|
6
4
|
import { CoreParts } from "./parts.mjs";
|
|
7
5
|
import { Authorize, audience, check, grantOf } from "../contracts/authorize.mjs";
|
|
8
6
|
import * as Clock$1 from "effect/Clock";
|
|
@@ -24,28 +22,6 @@ const wholeView = {
|
|
|
24
22
|
reads: () => true,
|
|
25
23
|
publishes: () => true
|
|
26
24
|
};
|
|
27
|
-
const keyRef = (refView, key) => refView.sees(key);
|
|
28
|
-
const wholeOnly = (refView) => refView.whole;
|
|
29
|
-
/**
|
|
30
|
-
* The ref each job kind in a repo's scope names, by its key, so a caller sees the job only when it
|
|
31
|
-
* sees the ref: `list`, `retry` and `discard` answer a job of a ref it can't see as a missing one,
|
|
32
|
-
* and the event stream leaves out its `repo.work.failed`. A mirror's ref and a queue's target are
|
|
33
|
-
* the key, and a candidate's key is its ID, whose ref under `refs/queue/` only a caller who sees
|
|
34
|
-
* every ref sees (Q749), as does `queue.trim`, whose data names the target or the ID it trimmed up
|
|
35
|
-
* to. A kind left out names no ref.
|
|
36
|
-
*/
|
|
37
|
-
const refKeyedJobs = /* @__PURE__ */ new Map([
|
|
38
|
-
[mirrorJobName, keyRef],
|
|
39
|
-
[advanceName, keyRef],
|
|
40
|
-
[buildName, wholeOnly],
|
|
41
|
-
[timeoutName, wholeOnly],
|
|
42
|
-
[trimName, wholeOnly]
|
|
43
|
-
]);
|
|
44
|
-
/** Whether a caller with `refView` sees `job`: any job of a kind `refKeyedJobs` leaves out. */
|
|
45
|
-
const seesJob = (refView, job) => {
|
|
46
|
-
const sees = refKeyedJobs.get(job.name);
|
|
47
|
-
return sees === void 0 || refView.whole || sees(refView, job.key);
|
|
48
|
-
};
|
|
49
25
|
/**
|
|
50
26
|
* A request's `refs.private` answers, by repo and caller, so a request asks once for each however
|
|
51
27
|
* many times it opens a repo: a write opens it twice, and 10,000 refs make one call.
|
|
@@ -176,4 +152,4 @@ const creatingRefView = /* @__PURE__ */ Effect.fnUntraced(function* (caller, nam
|
|
|
176
152
|
const { access, hiddenRefs } = yield* CoreParts;
|
|
177
153
|
return yield* askRefView(access, caller, { creating: name }, prefixesOf(hiddenRefs()));
|
|
178
154
|
});
|
|
179
|
-
export { AudienceMemo, ViewedMemo, accessAgain, creatingRefView, refViewAgain, refViewIn,
|
|
155
|
+
export { AudienceMemo, ViewedMemo, accessAgain, creatingRefView, refViewAgain, refViewIn, viewedIn, wholeView, withAudienceMemo };
|
package/dist/core/work.mjs
CHANGED
|
@@ -1,17 +1,47 @@
|
|
|
1
1
|
import { keepsEvents } from "../contracts/events.mjs";
|
|
2
|
+
import { badCursor } from "../engine/reads.mjs";
|
|
3
|
+
import { utf8 } from "../protocol/bytes/text.mjs";
|
|
2
4
|
import { afterCommit } from "../store/call-count.mjs";
|
|
5
|
+
import { listBound } from "../store/cursor-seal.mjs";
|
|
3
6
|
import { storeCall } from "../store/errors.mjs";
|
|
4
7
|
import { keptKey } from "../store/records.mjs";
|
|
5
8
|
import { newChangeId, repoScope } from "../store/scopes.mjs";
|
|
6
9
|
import { callerFor, contended, openRepo, repoAccess } from "./access.mjs";
|
|
7
10
|
import { isDeliverJob, skipFailed } from "./events/deliver.mjs";
|
|
8
|
-
import {
|
|
11
|
+
import { seesJob } from "./job-view.mjs";
|
|
12
|
+
import { refViewIn } from "./ref-view.mjs";
|
|
9
13
|
import { heldReceipt, receiptAnswered, receiptReads, receiptWrites } from "./receipts.mjs";
|
|
10
14
|
import { fail } from "../contracts/result.mjs";
|
|
11
15
|
import { CoreParts, QueueParts } from "./parts.mjs";
|
|
12
16
|
import * as Clock$1 from "effect/Clock";
|
|
13
17
|
import * as Effect from "effect/Effect";
|
|
18
|
+
import { limits } from "@ref0/infra";
|
|
14
19
|
// src/core/work.ts
|
|
20
|
+
/**
|
|
21
|
+
* The UTF-8 bytes a `work.list` cursor's text is padded to before it's sealed, the seal's own
|
|
22
|
+
* measure, so a sealed cursor's length tells nothing of the job it ends on, such as a hidden one.
|
|
23
|
+
* A store's cursor is a job's name and key as JSON: at most 256 and 1,024 bytes of them, each byte
|
|
24
|
+
* at most 6 once escaped, as `\u001f` is, and 7 of brackets, quotes and a comma. Then the length
|
|
25
|
+
* prefix, at most 5.
|
|
26
|
+
*/
|
|
27
|
+
const workCursorBytes = 6 * (limits.nameBytes + limits.keyBytes) + 7 + 5;
|
|
28
|
+
/**
|
|
29
|
+
* A store's `cursor` as a `work.list` cursor's text: its length in UTF-16 units, then it, padded
|
|
30
|
+
* with spaces to `workCursorBytes`. `INTERNAL` for a store's cursor past them, which no store here
|
|
31
|
+
* writes.
|
|
32
|
+
*/
|
|
33
|
+
const workCursorText = (cursor) => {
|
|
34
|
+
const text = `${cursor.length}:${cursor}`;
|
|
35
|
+
const bytes = utf8(text).byteLength;
|
|
36
|
+
return bytes > workCursorBytes ? fail("INTERNAL", `The store's cursor holds ${bytes} bytes, past the ${workCursorBytes} a work.list cursor holds`) : Effect.succeed(text + " ".repeat(workCursorBytes - bytes));
|
|
37
|
+
};
|
|
38
|
+
/** The store's cursor an opened `work.list` cursor's text holds, or none when it isn't one. */
|
|
39
|
+
const storeCursor = (text) => {
|
|
40
|
+
const length = /^(\d+):/.exec(text);
|
|
41
|
+
if (length === null) return void 0;
|
|
42
|
+
const start = length[0].length;
|
|
43
|
+
return text.slice(start, start + Number(length[1]));
|
|
44
|
+
};
|
|
15
45
|
/** Commits a work write's receipt, and `git.repack` due to sweep it, at the scope's `expect`. */
|
|
16
46
|
const commitReceipt = (internalId, write) => Effect.flatMap(Effect.service(CoreParts), (core) => storeCall(() => {
|
|
17
47
|
const receipt = receiptWrites(write.kept, write.answer, core.repackJobRow);
|
|
@@ -102,14 +132,27 @@ const workCalls = (bound) => {
|
|
|
102
132
|
const { internalId } = opened;
|
|
103
133
|
const repoOf = repoAccess(opened);
|
|
104
134
|
const refView = yield* refViewIn(caller, repoOf);
|
|
135
|
+
const core = yield* CoreParts;
|
|
136
|
+
const sealed = core.access !== void 0;
|
|
137
|
+
const bound = listBound("work.list", internalId, input.state ?? "");
|
|
138
|
+
const sent = input.page?.after;
|
|
139
|
+
const opens = sent === void 0 || !sealed ? sent : yield* core.cursors.open(bound, sent);
|
|
140
|
+
const after = sealed && opens !== void 0 ? storeCursor(opens) : opens;
|
|
141
|
+
if (sent !== void 0 && after === void 0) return yield* badCursor();
|
|
105
142
|
const request = {};
|
|
106
143
|
if (input.state !== void 0) request.state = input.state;
|
|
107
|
-
if (input.page !== void 0)
|
|
144
|
+
if (input.page !== void 0) {
|
|
145
|
+
const page = { ...input.page };
|
|
146
|
+
if (after !== void 0) page.after = after;
|
|
147
|
+
request.page = page;
|
|
148
|
+
}
|
|
108
149
|
const { jobs } = yield* QueueParts;
|
|
109
150
|
const listed = yield* storeCall(() => jobs.list(repoScope(internalId), request));
|
|
151
|
+
const items = listed.items.filter((item) => seesJob(refView, item));
|
|
152
|
+
if (listed.next === void 0) return { items };
|
|
110
153
|
return {
|
|
111
|
-
|
|
112
|
-
|
|
154
|
+
items,
|
|
155
|
+
next: sealed ? yield* core.cursors.seal(bound, yield* workCursorText(listed.next)) : listed.next
|
|
113
156
|
};
|
|
114
157
|
}),
|
|
115
158
|
retry: write("work.retry"),
|
package/dist/engine/walk.mjs
CHANGED
|
@@ -133,12 +133,37 @@ var RevWalk = class {
|
|
|
133
133
|
return left - 1;
|
|
134
134
|
}
|
|
135
135
|
};
|
|
136
|
+
/** The filter's part of a cursor's digest, so a cursor of one filter can't page another. */
|
|
137
|
+
const filterKey = (filter) => [
|
|
138
|
+
filter.authors?.join("\n"),
|
|
139
|
+
filter.committers?.join("\n"),
|
|
140
|
+
filter.since,
|
|
141
|
+
filter.until
|
|
142
|
+
].map((part) => String(part ?? "")).join("\0");
|
|
143
|
+
const addressesOf = (named) => named === void 0 ? void 0 : new Set(named.map((email) => email.toLowerCase()));
|
|
144
|
+
/** Whether `filter` keeps a commit the walk lists. */
|
|
145
|
+
const keeperOf = (filter) => {
|
|
146
|
+
const authors = addressesOf(filter.authors);
|
|
147
|
+
const committers = addressesOf(filter.committers);
|
|
148
|
+
const { since, until } = filter;
|
|
149
|
+
return (commit) => (authors === void 0 || authors.has(commit.author.email.toLowerCase())) && (committers === void 0 || committers.has(commit.committer.email.toLowerCase())) && (since === void 0 || commit.committer.at >= since) && (until === void 0 || commit.committer.at <= until);
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Git's `max_age` stop: a commit committed before `since`, which a walk without `haves` neither
|
|
153
|
+
* lists nor follows to its parents, and `limit_list` marks uninteresting.
|
|
154
|
+
*/
|
|
155
|
+
const staleOf = ({ since }) => (commit) => since !== void 0 && commit.committer.at < since;
|
|
156
|
+
/** `limit_list`'s `min_age` skip: a commit committed after `until`, which leaves its date unset. */
|
|
157
|
+
const youngOf = ({ until }) => (commit) => until !== void 0 && commit.committer.at > until;
|
|
136
158
|
/** `limit_list`, then the commits it kept that are still interesting. */
|
|
137
|
-
const limited = /* @__PURE__ */ Effect.fnUntraced(function* (walk, take) {
|
|
159
|
+
const limited = /* @__PURE__ */ Effect.fnUntraced(function* (walk, take, filter = {}) {
|
|
160
|
+
const stale = staleOf(filter);
|
|
161
|
+
const young = youngOf(filter);
|
|
138
162
|
const kept = [];
|
|
139
163
|
let date = Number.POSITIVE_INFINITY;
|
|
140
164
|
let left = slop;
|
|
141
165
|
for (let commit = walk.list.pop(); commit !== void 0; commit = walk.list.pop()) {
|
|
166
|
+
if (stale(commit)) walk.mark(commit.oid, uninteresting);
|
|
142
167
|
yield* walk.parents(commit);
|
|
143
168
|
if (walk.has(commit.oid, uninteresting)) {
|
|
144
169
|
walk.markParents(commit);
|
|
@@ -146,6 +171,7 @@ const limited = /* @__PURE__ */ Effect.fnUntraced(function* (walk, take) {
|
|
|
146
171
|
if (left > 0) continue;
|
|
147
172
|
break;
|
|
148
173
|
}
|
|
174
|
+
if (young(commit)) continue;
|
|
149
175
|
date = timeOf(commit);
|
|
150
176
|
kept.push(commit);
|
|
151
177
|
}
|
|
@@ -154,9 +180,13 @@ const limited = /* @__PURE__ */ Effect.fnUntraced(function* (walk, take) {
|
|
|
154
180
|
if (!take(commit)) return;
|
|
155
181
|
}
|
|
156
182
|
});
|
|
157
|
-
/**
|
|
158
|
-
|
|
183
|
+
/**
|
|
184
|
+
* The walk without `haves`: each commit listed as it's taken, reading only as far as `take`, and
|
|
185
|
+
* none past a `stale` one on its line.
|
|
186
|
+
*/
|
|
187
|
+
const unlimited = /* @__PURE__ */ Effect.fnUntraced(function* (walk, take, stale = () => false) {
|
|
159
188
|
for (let commit = walk.list.pop(); commit !== void 0; commit = walk.list.pop()) {
|
|
189
|
+
if (stale(commit)) continue;
|
|
160
190
|
yield* walk.parents(commit);
|
|
161
191
|
if (!take(commit)) return;
|
|
162
192
|
}
|
|
@@ -184,8 +214,9 @@ const started = /* @__PURE__ */ Effect.fnUntraced(function* (reader, wants, have
|
|
|
184
214
|
return walk;
|
|
185
215
|
});
|
|
186
216
|
/**
|
|
187
|
-
* `rev-list <wants> ^<haves>`, a page at a time
|
|
188
|
-
*
|
|
217
|
+
* `rev-list <wants> ^<haves>`, a page at a time, keeping what its `LogFilter` keeps, as Git's
|
|
218
|
+
* `--author`, `--committer`, `--max-age` and `--min-age` do. Each walk here sees each of `roots`
|
|
219
|
+
* as having no parents, as Git's shallow grafts make a repo's roots.
|
|
189
220
|
*/
|
|
190
221
|
const walkHistory = /* @__PURE__ */ Effect.fnUntraced(function* (read, input, call, roots = noRepoRoots) {
|
|
191
222
|
const haves = input.haves ?? [];
|
|
@@ -194,9 +225,11 @@ const walkHistory = /* @__PURE__ */ Effect.fnUntraced(function* (read, input, ca
|
|
|
194
225
|
"walk",
|
|
195
226
|
...input.wants,
|
|
196
227
|
"^",
|
|
197
|
-
...haves
|
|
228
|
+
...haves,
|
|
229
|
+
filterKey(input)
|
|
198
230
|
]);
|
|
199
|
-
|
|
231
|
+
const stale = staleOf(input);
|
|
232
|
+
return yield* paged(read, input, digest, (walk, take) => haves.length > 0 ? limited(walk, take, input) : unlimited(walk, take, stale), call, roots);
|
|
200
233
|
});
|
|
201
234
|
/** `rev-list --count <wants> ^<haves>`: how many commits the walk lists, within its limits. */
|
|
202
235
|
const countHistory = /* @__PURE__ */ Effect.fnUntraced(function* (read, input, call, roots = noRepoRoots) {
|
|
@@ -248,15 +281,17 @@ const walkPath = /* @__PURE__ */ Effect.fnUntraced(function* (read, input, roots
|
|
|
248
281
|
const digest = yield* inputDigest([
|
|
249
282
|
"walk-path",
|
|
250
283
|
input.want,
|
|
251
|
-
input.path
|
|
284
|
+
input.path,
|
|
285
|
+
filterKey(input)
|
|
252
286
|
]);
|
|
287
|
+
const stale = staleOf(input);
|
|
253
288
|
return yield* paged(read, {
|
|
254
289
|
...input,
|
|
255
290
|
wants: [input.want]
|
|
256
|
-
}, digest, (walk, take) => simplified(walk, parts, take), void 0, roots);
|
|
291
|
+
}, digest, (walk, take) => simplified(walk, parts, take, stale), void 0, roots);
|
|
257
292
|
});
|
|
258
293
|
/** The walk without `haves`, each commit's parents simplified at `parts` as `walkPath` says. */
|
|
259
|
-
const simplified = /* @__PURE__ */ Effect.fnUntraced(function* (walk, parts, take) {
|
|
294
|
+
const simplified = /* @__PURE__ */ Effect.fnUntraced(function* (walk, parts, take, stale) {
|
|
260
295
|
const atPath = /* @__PURE__ */ new Map();
|
|
261
296
|
const entryOf = Effect.fnUntraced(function* (commit) {
|
|
262
297
|
const held = atPath.get(commit.oid);
|
|
@@ -267,6 +302,7 @@ const simplified = /* @__PURE__ */ Effect.fnUntraced(function* (walk, parts, tak
|
|
|
267
302
|
return key;
|
|
268
303
|
});
|
|
269
304
|
for (let commit = walk.list.pop(); commit !== void 0; commit = walk.list.pop()) {
|
|
305
|
+
if (stale(commit)) continue;
|
|
270
306
|
const own = yield* entryOf(commit);
|
|
271
307
|
let follow = commit.parents;
|
|
272
308
|
let shown = commit.parents.length > 0 || own !== "";
|
|
@@ -285,18 +321,20 @@ const simplified = /* @__PURE__ */ Effect.fnUntraced(function* (walk, parts, tak
|
|
|
285
321
|
}
|
|
286
322
|
});
|
|
287
323
|
/**
|
|
288
|
-
* One page of a walk, `run` taking each commit it lists
|
|
289
|
-
* page, within the call's limits, and lists after its
|
|
290
|
-
* input's digest and that commit.
|
|
324
|
+
* One page of a walk, `run` taking each commit it lists that the input's `LogFilter` keeps: the
|
|
325
|
+
* walk runs again from the start each page, within the call's limits, and lists after its
|
|
326
|
+
* cursor's commit, so a cursor holds the input's digest and that commit.
|
|
291
327
|
*/
|
|
292
328
|
const paged = /* @__PURE__ */ Effect.fnUntraced(function* (read, input, digest, run, call, roots) {
|
|
293
329
|
const limits = yield* limitsOf(input.limits);
|
|
294
330
|
const limit = yield* limitOf(input.page);
|
|
295
331
|
const after = yield* afterOf(input.page?.after, digest);
|
|
296
332
|
const items = [];
|
|
333
|
+
const keeps = keeperOf(input);
|
|
297
334
|
let found = after === void 0;
|
|
298
335
|
let more = false;
|
|
299
336
|
const take = (commit) => {
|
|
337
|
+
if (!keeps(commit)) return true;
|
|
300
338
|
if (!found) {
|
|
301
339
|
found = commit.oid === after;
|
|
302
340
|
return true;
|
package/dist/index.d.mts
CHANGED
|
@@ -20,7 +20,7 @@ import { authorize_d_exports } from "./contracts/authorize.mjs";
|
|
|
20
20
|
import "./queue/namespace.mjs";
|
|
21
21
|
import "./lfs/namespace.mjs";
|
|
22
22
|
import { QueueInternals, mergeQueue } from "./queue/host.mjs";
|
|
23
|
-
import { CommitCalls, CommitCreateInput, CommitDiffInput, Compare, CompareInput, ComparisonFile, LineCounts, LogInput, RefPublication, Revision, commits_d_exports } from "./contracts/commits.mjs";
|
|
23
|
+
import { CommitCalls, CommitCreateInput, CommitDiffInput, Compare, CompareInput, ComparisonFile, LineCounts, LogInput, RefPublication, Revision, commits_d_exports, logEmailsMost } from "./contracts/commits.mjs";
|
|
24
24
|
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";
|
|
25
25
|
import { BeforeAfter, CandidateClosed, CandidateClosedFields, CandidateOpened, CandidateReported, EntryAdded, EntryFailed, EntryMerged, EntryRemoved, EntryRetried, EventEnvelope, EventFeature, FeedItem, FenceReason, FencedPack, GitEvent, HoldEvent, HoldEventFields, IndexRefusal, QueueEvent, QueueRestarted, RefPush, RefUpdated, RepoCreated, RepoDeletedEvent, RepoEnvelope, RepoEvent, RepoIndexRefused, RepoJobFailed, RepoMaintained, RepoPruneRefused, RepoRenamed, RepoVisibilityChanged, RepoWorkFailed, TokenEvent, TokenEventFields, TopicAdded, TopicEnvelope, TopicEvent, TopicFailed, TopicMerged, TopicOpened, TopicRemoved, TopicReported, TopicWorkFailed, events_d_exports } from "./contracts/events.mjs";
|
|
26
26
|
import { File, FileCalls, FileDiff, FileReadInput, FilesDiffInput, FilesListInput, FilesRead, files_d_exports } from "./contracts/files.mjs";
|
|
@@ -36,7 +36,7 @@ import { BypassOperation, FilesAllowOperation, ForkOperation, MeOperation, Opera
|
|
|
36
36
|
import { client_d_exports } from "./client/client.mjs";
|
|
37
37
|
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";
|
|
38
38
|
import { RepoStreamEvent } from "./rest/wire.mjs";
|
|
39
|
-
import { Ref, RefCalls, RefCount, RefCountInput, RefEdit, RefInput, RefListInput, RefProtection, RefSource, RefUpdate, RefUpdateKind, RefsUpdateInput, RefsUpdated, refs_d_exports } from "./contracts/refs.mjs";
|
|
39
|
+
import { Ref, RefCalls, RefCount, RefCountInput, RefEdit, RefInput, RefListInput, RefProtection, RefSource, RefUpdate, RefUpdateKind, RefsUpdateInput, RefsUpdated, maxSeenRefs, refs_d_exports } from "./contracts/refs.mjs";
|
|
40
40
|
import { BasicCredential, BearerCredential, ClientCredential, ClientCredentials, CredentialInput, RemoteCalls, RemoteOptions, TransportFailure, TransportRetry, WithoutActor, WithoutSignal } from "./contracts/remote.mjs";
|
|
41
41
|
import { PinnedRepo, RepoCalls, RepoCatalogueEntry, RepoCreateInput, RepoDeleted, RepoGetInput, RepoIndexHold, RepoInfo, RepoInfoStats, RepoInput, RepoListInput, RepoListOrder, RepoRecord, RepoRenameInput, RepoStats, RepoUpdateInput, RepoWork, repos_d_exports } from "./contracts/repos.mjs";
|
|
42
42
|
import { PeelInput, Peeled, TagCalls, TagCreateInput, peelMost, peelTagsMost, tags_d_exports } from "./contracts/tags.mjs";
|
|
@@ -87,4 +87,4 @@ import { PushHookInput } from "./contracts/git-hooks.mjs";
|
|
|
87
87
|
import { public_d_exports as public_d_exports$5 } from "./signin/public.mjs";
|
|
88
88
|
import "./signin/namespace.mjs";
|
|
89
89
|
import { jobStates } from "@ref0/infra";
|
|
90
|
-
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_namespace_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 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 EventEnvelope, type EventFeature, event_streams_d_exports as EventStreams, events_d_exports as Events, ExistingContext, ExistingReason, type FailureResult, type FeedItem, type FenceReason, type FencedPack, type FetchAdjustment, type FetchAnswer, type FetchReadInput, type FetchReadTarget, 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, client_d_exports as GitClient, type GitClientCalls, type GitClientOptions, type GitError, GitErrorBody, type GitErrorCode, type GitErrorContexts, type GitErrorFields, type GitErrorInput, type GitErrorTagged, type GitEvent, git_events_d_exports as GitEvents, public_d_exports as GitHooks, type GitNeeds, type GitObject, type GitObjects, type GitScope, type GitServer, type GitServerOptions, type GitStore, type GitStoreAddInput, type GitStoreCommitInput, type GitStoreReadInput, type Grant, type GrantAgainInput, type GrantAgainRequest, type GrantInput, type GrantReachInput, type GrantResolver, type GrantScope, 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 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$1 as Lfs, type LfsCalls, type LfsFeature, type LfsGetInput, type LfsObject, type LfsOptions, type LfsPointers, type LfsPointersBuilder, type LineCounts, type LinkedObjects, type Listed, type ListedInput, type ListenInput, type Localize, type LogInput, type MaintainInput, type Me, type MeOperation, type MergeAnswer, type MergeBaseInput, type MergeBases, type MergeCalls, type MergeCreateInput, type MergeInput, type MergeLabels, type MergeMethod, type MergePlan, public_d_exports$2 as MergeQueue, type MergeQueueCalls, type MergeQueueLayerOptions, type MergeQueueOptions, type MergeTree, public_d_exports$3 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, PreconditionContext, PreconditionReason, type PrefixTarget, type Prepare, type PrepareInput, type PreviousQueueSchedule, public_d_exports$4 as PrivateRefs, 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 QueueInternals, 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 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 RepoGetInput, type RepoIndexHold, type RepoIndexRefused, type RepoInfo, type RepoInfoStats, type RepoInput, type RepoJobFailed, type RepoListInput, type RepoListOperation, type RepoListOrder, type RepoMaintained, type RepoName, type RepoOperation, type RepoPruneRefused, type RepoRecord, repo_records_d_exports as RepoRecords, type RepoRenameInput, type RepoRenamed, type RepoStats, type RepoStreamEvent, type RepoUpdateInput, type RepoVisibilityChanged, type RepoWork, type RepoWorkFailed, type Report, type ReportDetails, type ReportOptions, type ReportResult, type Reported, repos_d_exports as Repos, ResourceContext, ResourceReason, layer_d_exports as Rest, client_d_exports$1 as RestClient, type RestClientCalls, type RestEvents, type RestTokenCalls, type RestartResult, type Restarted, type Result, type Retried, type RetryResult, type Revision, type RowsMoved, type RuleOperation, rules_d_exports as Rules, saved_callers_public_d_exports as SavedCallers, type SavedHandlerOptions, type ScheduleOption, type ServerCalls, type ServerSetup, type ShareInput, public_d_exports$5 as SignIn, 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_public_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, public_d_exports$6 as Topics, type TopicsFactory, 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, type WithoutSignal, work_d_exports as Work, type WorkCalls, type WorkItem, type WorkListInput, type WorkOperation, type WorkWriteInput, type WriteInput, accept, allotmentWithin, branchRef, createGitServer, gitError, gitPathOf, grantScopes, httpStatus, isGitError, isInternalId, isRefusalReason, jobStates, lfs, lfsPointerOid, lfsPointers, loose, looseLimits, maxActorIdLength, maxLfsPointerBytes, maxRefNameLength, mergeQueue, objectsReadMost, packs, packsMemory, peelMost, peelTagsMost, reject, shortTarget, tokenScopes, tokenStates, topics };
|
|
90
|
+
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_namespace_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 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 EventEnvelope, type EventFeature, event_streams_d_exports as EventStreams, events_d_exports as Events, ExistingContext, ExistingReason, type FailureResult, type FeedItem, type FenceReason, type FencedPack, type FetchAdjustment, type FetchAnswer, type FetchReadInput, type FetchReadTarget, 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, client_d_exports as GitClient, type GitClientCalls, type GitClientOptions, type GitError, GitErrorBody, type GitErrorCode, type GitErrorContexts, type GitErrorFields, type GitErrorInput, type GitErrorTagged, type GitEvent, git_events_d_exports as GitEvents, public_d_exports as GitHooks, type GitNeeds, type GitObject, type GitObjects, type GitScope, type GitServer, type GitServerOptions, type GitStore, type GitStoreAddInput, type GitStoreCommitInput, type GitStoreReadInput, type Grant, type GrantAgainInput, type GrantAgainRequest, type GrantInput, type GrantReachInput, type GrantResolver, type GrantScope, 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 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$1 as Lfs, type LfsCalls, type LfsFeature, type LfsGetInput, type LfsObject, type LfsOptions, type LfsPointers, type LfsPointersBuilder, type LineCounts, type LinkedObjects, type Listed, type ListedInput, type ListenInput, type Localize, type LogInput, type MaintainInput, type Me, type MeOperation, type MergeAnswer, type MergeBaseInput, type MergeBases, type MergeCalls, type MergeCreateInput, type MergeInput, type MergeLabels, type MergeMethod, type MergePlan, public_d_exports$2 as MergeQueue, type MergeQueueCalls, type MergeQueueLayerOptions, type MergeQueueOptions, type MergeTree, public_d_exports$3 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, PreconditionContext, PreconditionReason, type PrefixTarget, type Prepare, type PrepareInput, type PreviousQueueSchedule, public_d_exports$4 as PrivateRefs, 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 QueueInternals, 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 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 RepoGetInput, type RepoIndexHold, type RepoIndexRefused, type RepoInfo, type RepoInfoStats, type RepoInput, type RepoJobFailed, type RepoListInput, type RepoListOperation, type RepoListOrder, type RepoMaintained, type RepoName, type RepoOperation, type RepoPruneRefused, type RepoRecord, repo_records_d_exports as RepoRecords, type RepoRenameInput, type RepoRenamed, type RepoStats, type RepoStreamEvent, type RepoUpdateInput, type RepoVisibilityChanged, type RepoWork, type RepoWorkFailed, type Report, type ReportDetails, type ReportOptions, type ReportResult, type Reported, repos_d_exports as Repos, ResourceContext, ResourceReason, layer_d_exports as Rest, client_d_exports$1 as RestClient, type RestClientCalls, type RestEvents, type RestTokenCalls, type RestartResult, type Restarted, type Result, type Retried, type RetryResult, type Revision, type RowsMoved, type RuleOperation, rules_d_exports as Rules, saved_callers_public_d_exports as SavedCallers, type SavedHandlerOptions, type ScheduleOption, type ServerCalls, type ServerSetup, type ShareInput, public_d_exports$5 as SignIn, 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_public_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, public_d_exports$6 as Topics, type TopicsFactory, 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, type WithoutSignal, work_d_exports as Work, type WorkCalls, type WorkItem, type WorkListInput, type WorkOperation, type WorkWriteInput, type WriteInput, accept, allotmentWithin, branchRef, createGitServer, gitError, gitPathOf, grantScopes, httpStatus, isGitError, isInternalId, isRefusalReason, jobStates, lfs, lfsPointerOid, lfsPointers, logEmailsMost, loose, looseLimits, maxActorIdLength, maxLfsPointerBytes, maxRefNameLength, maxSeenRefs, mergeQueue, objectsReadMost, packs, packsMemory, peelMost, peelTagsMost, reject, shortTarget, tokenScopes, tokenStates, topics };
|
package/dist/index.mjs
CHANGED
|
@@ -3,12 +3,12 @@ import { client_exports as client_exports$1 } from "./rest/client.mjs";
|
|
|
3
3
|
import { grantScopes, tokenScopes, tokenStates } from "./contracts/tokens.mjs";
|
|
4
4
|
import { authorize_exports } from "./contracts/authorize.mjs";
|
|
5
5
|
import { blobs_exports } from "./contracts/blobs.mjs";
|
|
6
|
-
import { commits_exports } from "./contracts/commits.mjs";
|
|
6
|
+
import { commits_exports, logEmailsMost } from "./contracts/commits.mjs";
|
|
7
7
|
import { events_exports } from "./contracts/events.mjs";
|
|
8
8
|
import { files_exports } from "./contracts/files.mjs";
|
|
9
9
|
import { forks_exports } from "./contracts/forks.mjs";
|
|
10
10
|
import { git_events_exports } from "./contracts/git-events.mjs";
|
|
11
|
-
import { refs_exports } from "./contracts/refs.mjs";
|
|
11
|
+
import { maxSeenRefs, refs_exports } from "./contracts/refs.mjs";
|
|
12
12
|
import { repo_records_exports } from "./contracts/repo-records.mjs";
|
|
13
13
|
import { repos_exports } from "./contracts/repos.mjs";
|
|
14
14
|
import { peelMost, peelTagsMost, tags_exports } from "./contracts/tags.mjs";
|
|
@@ -46,4 +46,4 @@ import { tokens_public_exports } from "./auth/tokens-public.mjs";
|
|
|
46
46
|
import { public_exports } from "./core/hooks/public.mjs";
|
|
47
47
|
import { public_exports as public_exports$5 } from "./signin/public.mjs";
|
|
48
48
|
import { jobStates } from "@ref0/infra";
|
|
49
|
-
export { auth_namespace_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, client_exports as GitClient, GitErrorBody, git_events_exports as GitEvents, public_exports as GitHooks, HostErrorContext, InternalRepoId, InvalidInputContext, InvalidInputReason, public_exports$1 as Lfs, public_exports$2 as MergeQueue, public_exports$3 as Merges, MissingContext, MissingReason, NotAllowedContext, NotAllowedReason, objects_namespace_exports as Objects, policy_exports as Policy, PreconditionContext, PreconditionReason, public_exports$4 as PrivateRefs, PushUploadPart, PushUploadStarted, refs_exports as Refs, repo_records_exports as RepoRecords, repos_exports as Repos, ResourceContext, ResourceReason, layer_exports as Rest, client_exports$1 as RestClient, rules_exports as Rules, saved_callers_public_exports as SavedCallers, public_exports$5 as SignIn, tags_exports as Tags, tokens_public_exports as Tokens, public_exports$6 as Topics, TreeFilter, trees_exports as Trees, UnavailableContext, UnavailableReason, Verdict, work_exports as Work, accept, allotmentWithin, branchRef, createGitServer, gitError, gitPathOf, grantScopes, httpStatus, isGitError, isInternalId, isRefusalReason, jobStates, lfs, lfsPointerOid, lfsPointers, loose, looseLimits, maxActorIdLength, maxLfsPointerBytes, maxRefNameLength, mergeQueue, objectsReadMost, packs, packsMemory, peelMost, peelTagsMost, reject, shortTarget, tokenScopes, tokenStates, topics };
|
|
49
|
+
export { auth_namespace_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, client_exports as GitClient, GitErrorBody, git_events_exports as GitEvents, public_exports as GitHooks, HostErrorContext, InternalRepoId, InvalidInputContext, InvalidInputReason, public_exports$1 as Lfs, public_exports$2 as MergeQueue, public_exports$3 as Merges, MissingContext, MissingReason, NotAllowedContext, NotAllowedReason, objects_namespace_exports as Objects, policy_exports as Policy, PreconditionContext, PreconditionReason, public_exports$4 as PrivateRefs, PushUploadPart, PushUploadStarted, refs_exports as Refs, repo_records_exports as RepoRecords, repos_exports as Repos, ResourceContext, ResourceReason, layer_exports as Rest, client_exports$1 as RestClient, rules_exports as Rules, saved_callers_public_exports as SavedCallers, public_exports$5 as SignIn, tags_exports as Tags, tokens_public_exports as Tokens, public_exports$6 as Topics, TreeFilter, trees_exports as Trees, UnavailableContext, UnavailableReason, Verdict, work_exports as Work, accept, allotmentWithin, branchRef, createGitServer, gitError, gitPathOf, grantScopes, httpStatus, isGitError, isInternalId, isRefusalReason, jobStates, lfs, lfsPointerOid, lfsPointers, logEmailsMost, loose, looseLimits, maxActorIdLength, maxLfsPointerBytes, maxRefNameLength, maxSeenRefs, mergeQueue, objectsReadMost, packs, packsMemory, peelMost, peelTagsMost, reject, shortTarget, tokenScopes, tokenStates, topics };
|
package/dist/lfs/upload-most.mjs
CHANGED
|
@@ -15,7 +15,7 @@ const cpuShare = .8;
|
|
|
15
15
|
*/
|
|
16
16
|
const uploadPieceBytes = 1024 ** 2;
|
|
17
17
|
/** The bytes `cpuMs` of CPU hashes and stores, at `uploadMsPerMiB` within `cpuShare` of it. */
|
|
18
|
-
const cpuBytes = (cpuMs) => Math.floor(cpuShare * cpuMs /
|
|
18
|
+
const cpuBytes = (cpuMs) => Math.floor(cpuShare * cpuMs / 22 * 1024 ** 2);
|
|
19
19
|
/** The largest upload `caps` let finish: `largestObject` where neither binds below it. */
|
|
20
20
|
const uploadMostOf = (caps) => {
|
|
21
21
|
const bounds = [{
|