@ref0/git 0.2.0 → 0.3.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/auth/authorize.d.mts +1 -1
- package/dist/auth/fences.d.mts +1 -1
- package/dist/auth/host-function.mjs +2 -2
- package/dist/auth/identify.d.mts +1 -1
- package/dist/auth/tokens.d.mts +1 -1
- package/dist/client/client.mjs +2 -3
- package/dist/client/local.mjs +13 -3
- package/dist/contracts/calls-spent.mjs +3 -2
- package/dist/contracts/client.d.mts +2 -2
- package/dist/contracts/handlers.d.mts +2 -1
- package/dist/contracts/objects.d.mts +2 -2
- package/dist/contracts/promises.d.mts +13 -38
- package/dist/contracts/promises.mjs +13 -0
- package/dist/contracts/queue.d.mts +2 -1
- package/dist/contracts/result.d.mts +7 -0
- package/dist/contracts/server.d.mts +67 -40
- package/dist/contracts/sync.d.mts +1 -1
- package/dist/contracts/topics.d.mts +7 -1
- package/dist/core/access.d.mts +1 -1
- package/dist/core/call-names.d.mts +1 -0
- package/dist/core/call-names.mjs +93 -0
- package/dist/core/events/deliver.mjs +14 -7
- package/dist/core/events/stream.d.mts +1 -1
- package/dist/core/events/stream.mjs +8 -1
- package/dist/core/hooks/post-receive.mjs +15 -7
- package/dist/core/promise.mjs +28 -10
- package/dist/core/push.mjs +2 -1
- package/dist/core/seam.d.mts +2 -0
- package/dist/core/seam.mjs +19 -6
- package/dist/extend.d.mts +2 -1
- package/dist/extend.mjs +3 -1
- package/dist/index.d.mts +2 -2
- package/dist/lfs/objects.mjs +1 -1
- package/dist/lfs/rows.mjs +1 -1
- package/dist/queue/advance.mjs +2 -1
- package/dist/queue/host.d.mts +1 -1
- package/dist/queue/host.mjs +1 -1
- package/dist/queue/schedule.mjs +1 -1
- package/dist/rest/blobs.d.mts +15 -15
- package/dist/rest/client.mjs +2 -2
- package/dist/rest/commits.d.mts +91 -91
- package/dist/rest/errors.d.mts +2 -2
- package/dist/rest/errors.mjs +2 -2
- package/dist/rest/files.d.mts +81 -81
- package/dist/rest/handler.d.mts +1 -0
- package/dist/rest/handler.mjs +39 -16
- package/dist/rest/handlers.mjs +6 -6
- package/dist/rest/repos.d.mts +38 -38
- package/dist/rest/tags.d.mts +41 -41
- package/dist/rest/tokens.d.mts +145 -145
- package/dist/rest/work.d.mts +43 -43
- package/dist/server/extension.d.mts +6 -3
- package/dist/server/extension.mjs +39 -31
- package/dist/server/lifecycle.d.mts +3 -0
- package/dist/server/lifecycle.mjs +89 -0
- package/dist/server/routes.d.mts +7 -4
- package/dist/server/routes.mjs +12 -19
- package/dist/server/server.d.mts +8 -2
- package/dist/server/server.mjs +280 -104
- package/dist/signin/context.d.mts +1 -1
- package/dist/signin/grants.d.mts +1 -1
- package/dist/storage/bits.mjs +41 -0
- package/dist/storage/calls.d.mts +1 -1
- package/dist/storage/calls.mjs +2 -2
- package/dist/storage/fetch.d.mts +3 -1
- package/dist/storage/fetch.mjs +230 -24
- package/dist/storage/index-bitmaps.d.mts +1 -1
- package/dist/storage/index-build.d.mts +1 -1
- package/dist/storage/index-build.mjs +27 -13
- package/dist/storage/index-fetch.d.mts +1 -0
- package/dist/storage/index-fetch.mjs +103 -182
- package/dist/storage/index-graph.d.mts +1 -1
- package/dist/storage/loose.mjs +3 -2
- package/dist/storage/pack-order.d.mts +1 -1
- package/dist/storage/pack-order.mjs +3 -1
- package/dist/storage/pack-ranges.d.mts +1 -1
- package/dist/storage/pack-reads.d.mts +1 -1
- package/dist/storage/pack-reads.mjs +17 -0
- package/dist/storage/pack-receive.d.mts +2 -2
- package/dist/storage/pack-receive.mjs +1 -1
- package/dist/storage/packs.d.mts +2 -2
- package/dist/storage/packs.mjs +10 -7
- package/dist/storage/push-uploads.mjs +2 -1
- package/dist/storage/ready.d.mts +2 -2
- package/dist/storage/receive-links.mjs +1 -1
- package/dist/storage/repack.d.mts +2 -2
- package/dist/storage/rows.d.mts +2 -1
- package/dist/storage/rows.mjs +1 -1
- package/dist/storage/send-list.d.mts +8 -0
- package/dist/storage/send-list.mjs +319 -0
- package/dist/storage/shallow.d.mts +1 -2
- package/dist/storage/unpack.mjs +5 -3
- package/dist/storage/walk.d.mts +2 -1
- package/dist/storage/walk.mjs +14 -8
- package/dist/store/catalogue.d.mts +1 -1
- package/dist/store/closed.d.mts +21 -0
- package/dist/store/closed.mjs +34 -0
- package/dist/store/crossing.mjs +9 -6
- package/dist/store/cursor-seal.mjs +4 -1
- package/dist/store/errors.mjs +13 -7
- package/dist/store/outbox.mjs +4 -2
- package/dist/store/promises.d.mts +5 -0
- package/dist/store/promises.mjs +258 -0
- package/dist/sync/bound.mjs +9 -4
- package/dist/sync/jobs.d.mts +3 -3
- package/dist/sync/jobs.mjs +28 -25
- package/dist/sync/tries.mjs +2 -2
- package/dist/topics/advance.mjs +2 -1
- package/dist/topics/calls.mjs +3 -3
- package/dist/topics/host.d.mts +1 -1
- package/dist/topics/host.mjs +1 -1
- package/dist/topics/topic.mjs +22 -7
- package/package.json +2 -2
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { millis } from "../../contracts/promises.mjs";
|
|
1
2
|
import { decodeRecord } from "../../store/catalogue.mjs";
|
|
2
3
|
import { settleName } from "../../store/settle.mjs";
|
|
3
4
|
import { decodeRow, fail, gitError, storeCall } from "../../store/errors.mjs";
|
|
4
5
|
import { runJobTry } from "../../store/crossing.mjs";
|
|
5
6
|
import { FailedTry, appendEvents, cursorId, decodeEvents, decodeOutbox, eventBytes, eventId, eventLimits, failedKey, headKey, outboxCollections, outboxReads, repoEnvelope } from "../../store/outbox.mjs";
|
|
6
7
|
import { newChangeId, repoScope, scopeRepo, selfKey } from "../../store/scopes.mjs";
|
|
7
|
-
import { defineJob, isInfraError
|
|
8
|
+
import { defineJob, isInfraError } from "@ref0/infra";
|
|
8
9
|
import * as Effect from "effect/Effect";
|
|
9
10
|
import * as Schema from "effect/Schema";
|
|
10
11
|
import * as Predicate from "effect/Predicate";
|
|
@@ -434,6 +435,15 @@ const skipFailed = Effect.fnUntraced(function* (store, jobs, scope) {
|
|
|
434
435
|
/** The longest a host's `events.timeout` may be: a Git job's longest try (Q188). */
|
|
435
436
|
const longestDelivery = 78e4;
|
|
436
437
|
/**
|
|
438
|
+
* Throws for an `events.timeout` past a Git job's longest try, as `createGitServer` checks its
|
|
439
|
+
* options before its runtime is built.
|
|
440
|
+
*/
|
|
441
|
+
const checkDeliveryTimeout = ({ timeout }) => {
|
|
442
|
+
if (timeout === void 0 || millis(timeout) <= longestDelivery) return;
|
|
443
|
+
const message = `events.timeout is at most '13 minutes', the longest a Git job may run, not '${String(timeout)}'`;
|
|
444
|
+
throw new Error(message, { cause: gitError("INVALID_ARGUMENT", message) });
|
|
445
|
+
};
|
|
446
|
+
/**
|
|
437
447
|
* `git.deliver`, over the host's `events`: tried again as the host's `retry` says, or for three
|
|
438
448
|
* days at most an hour apart. Its last failure writes `repo.work.failed`, which waits behind it.
|
|
439
449
|
*/
|
|
@@ -454,15 +464,12 @@ const deliverJob = (parts) => {
|
|
|
454
464
|
onFailure: workFailed(parts.store, log, parts.now, (job) => failedTry(sending, job))
|
|
455
465
|
};
|
|
456
466
|
const { timeout } = parts.delivery;
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
throw new Error(message, { cause: gitError("INVALID_ARGUMENT", message) });
|
|
460
|
-
}
|
|
461
|
-
if (timeout !== void 0) options.timeout = timeout;
|
|
467
|
+
checkDeliveryTimeout(parts.delivery);
|
|
468
|
+
if (timeout !== void 0) options.timeout = millis(timeout);
|
|
462
469
|
const definition = defineJob(options);
|
|
463
470
|
return {
|
|
464
471
|
definition,
|
|
465
472
|
log
|
|
466
473
|
};
|
|
467
474
|
};
|
|
468
|
-
export { defaultDeliverRetry, deliverHandler, deliverJob, deliverJobKey, deliverJobName, drainCeiling, eventDelivery, isDeliverJob, keptFor, notFailed, skipFailed, workFailed };
|
|
475
|
+
export { checkDeliveryTimeout, defaultDeliverRetry, deliverHandler, deliverJob, deliverJobKey, deliverJobName, drainCeiling, eventDelivery, isDeliverJob, keptFor, notFailed, skipFailed, workFailed };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import "../../contracts/promises.mjs";
|
|
1
2
|
import "../../contracts/actors.mjs";
|
|
2
3
|
import { GitEvent } from "../../contracts/events.mjs";
|
|
3
4
|
import "../access.mjs";
|
|
4
|
-
import "../../contracts/promises.mjs";
|
|
5
5
|
import "effect/Effect";
|
|
6
6
|
/**
|
|
7
7
|
* What a repo's event stream gives, one at a time: a batch of events in `seq` order, a heartbeat
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { readToken, tokenState } from "../../auth/token-rows.mjs";
|
|
2
|
+
import { closedError } from "../../store/closed.mjs";
|
|
2
3
|
import { fail, storeCall } from "../../store/errors.mjs";
|
|
3
4
|
import { decodeEvents, decodeOutbox, eventId, headKey, outboxCollections } from "../../store/outbox.mjs";
|
|
4
5
|
import { readRecord } from "../../store/repo-record.mjs";
|
|
@@ -111,7 +112,7 @@ const seenEvents = (events, sight) => sight.whole ? events : events.filter((even
|
|
|
111
112
|
*/
|
|
112
113
|
const openFeed = Effect.fnUntraced(function* (parts, caller, repo, after) {
|
|
113
114
|
yield* parts.guard;
|
|
114
|
-
if (parts.core.events === void 0) return yield* fail("FAILED_PRECONDITION", "This server keeps no events", {
|
|
115
|
+
if (parts.core.events === void 0) return yield* fail("FAILED_PRECONDITION", "This server keeps no events", { hostHint: "Its host passes createGitServer `events` to keep them" });
|
|
115
116
|
const { internalId } = yield* openRepo(parts.core, caller, {
|
|
116
117
|
kind: "read",
|
|
117
118
|
repo
|
|
@@ -132,9 +133,12 @@ const feedStream = (parts, caller, internalId, after) => {
|
|
|
132
133
|
let holdUntil;
|
|
133
134
|
let beatAt = clock.now() + heartbeatMs;
|
|
134
135
|
const end = () => {
|
|
136
|
+
parts.closing.removeEventListener("abort", end);
|
|
135
137
|
ending.abort();
|
|
136
138
|
reader?.cancel().catch(() => void 0);
|
|
137
139
|
};
|
|
140
|
+
if (parts.closing.aborted) end();
|
|
141
|
+
else parts.closing.addEventListener("abort", end, { once: true });
|
|
138
142
|
/** Runs a step of the stream, which its end interrupts: a refusal rejects with its `GitError`. */
|
|
139
143
|
const run = (effect) => runIn(effect, uncounted("an event stream: #725 counts it"), ending.signal);
|
|
140
144
|
/**
|
|
@@ -231,8 +235,10 @@ const feedStream = (parts, caller, internalId, after) => {
|
|
|
231
235
|
/** Sends one item, or closes the stream. */
|
|
232
236
|
const step = async (controller) => {
|
|
233
237
|
for (;;) {
|
|
238
|
+
if (parts.closing.aborted) throw closedError();
|
|
234
239
|
if (ending.signal.aborted) return;
|
|
235
240
|
const woke = await wait();
|
|
241
|
+
if (parts.closing.aborted) throw closedError();
|
|
236
242
|
if (woke === "slept" && clock.now() >= beatAt) {
|
|
237
243
|
await run(recheck(parts, caller, internalId));
|
|
238
244
|
beatAt = clock.now() + heartbeatMs;
|
|
@@ -280,6 +286,7 @@ const feedStream = (parts, caller, internalId, after) => {
|
|
|
280
286
|
await step(controller);
|
|
281
287
|
} catch (cause) {
|
|
282
288
|
end();
|
|
289
|
+
if (parts.closing.aborted) throw closedError();
|
|
283
290
|
if (!isExpired(cause)) throw cause;
|
|
284
291
|
gap(controller);
|
|
285
292
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { millis } from "../../contracts/promises.mjs";
|
|
1
2
|
import { decodeRow, gitError, storeCall } from "../../store/errors.mjs";
|
|
2
3
|
import { runJobTry } from "../../store/crossing.mjs";
|
|
3
4
|
import { cursorId } from "../../store/outbox.mjs";
|
|
4
5
|
import { versionId } from "../../store/records.mjs";
|
|
5
6
|
import { collections, newChangeId } from "../../store/scopes.mjs";
|
|
6
|
-
import { defineJob
|
|
7
|
+
import { defineJob } from "@ref0/infra";
|
|
7
8
|
import * as Effect from "effect/Effect";
|
|
8
9
|
import * as Schema from "effect/Schema";
|
|
9
10
|
import * as Predicate from "effect/Predicate";
|
|
@@ -175,22 +176,29 @@ const postReceiveHandler = (handler) => async (job, context) => {
|
|
|
175
176
|
/** The host's `postReceive`, as one shape. */
|
|
176
177
|
const postReceiveOptions = (hook) => Predicate.isFunction(hook) ? { handler: hook } : hook;
|
|
177
178
|
/**
|
|
179
|
+
* Throws for a `hooks.postReceive` timeout past a Git job's longest try, as `createGitServer`
|
|
180
|
+
* checks its options before its runtime is built.
|
|
181
|
+
*/
|
|
182
|
+
const checkPostReceiveTimeout = (hook) => {
|
|
183
|
+
const { timeout } = postReceiveOptions(hook);
|
|
184
|
+
if (timeout === void 0 || millis(timeout) <= longestPostReceive) return;
|
|
185
|
+
const message = `hooks.postReceive.timeout is at most '13 minutes', the longest a Git job may run, not '${String(timeout)}'`;
|
|
186
|
+
throw new Error(message, { cause: gitError("INVALID_ARGUMENT", message) });
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
178
189
|
* `git.post-receive`, over the host's `hooks.postReceive`: tried again as its `retry` says, or for
|
|
179
190
|
* three days at most an hour apart. A timeout past 13 minutes, a Git job's longest try, throws.
|
|
180
191
|
*/
|
|
181
192
|
const postReceiveJob = (hook, onFailure) => {
|
|
182
193
|
const { handler, retry, timeout } = postReceiveOptions(hook);
|
|
183
|
-
|
|
184
|
-
const message = `hooks.postReceive.timeout is at most '13 minutes', the longest a Git job may run, not '${String(timeout)}'`;
|
|
185
|
-
throw new Error(message, { cause: gitError("INVALID_ARGUMENT", message) });
|
|
186
|
-
}
|
|
194
|
+
checkPostReceiveTimeout(hook);
|
|
187
195
|
const options = {
|
|
188
196
|
name: postReceiveJobName,
|
|
189
197
|
schema: Schema.toStandardSchemaV1(PostReceiveData),
|
|
190
198
|
retry: retry ?? defaultPostReceiveRetry,
|
|
191
199
|
handler: postReceiveHandler(handler)
|
|
192
200
|
};
|
|
193
|
-
if (timeout !== void 0) options.timeout = timeout;
|
|
201
|
+
if (timeout !== void 0) options.timeout = millis(timeout);
|
|
194
202
|
if (onFailure !== void 0) options.onFailure = onFailure;
|
|
195
203
|
const definition = defineJob(options);
|
|
196
204
|
return {
|
|
@@ -201,4 +209,4 @@ const postReceiveJob = (hook, onFailure) => {
|
|
|
201
209
|
})
|
|
202
210
|
};
|
|
203
211
|
};
|
|
204
|
-
export { SavedPush, defaultPostReceiveRetry, postReceiveHandler, postReceiveJob, postReceiveJobKey, postReceiveJobName, savedPushRow };
|
|
212
|
+
export { SavedPush, checkPostReceiveTimeout, defaultPostReceiveRetry, postReceiveHandler, postReceiveJob, postReceiveJobKey, postReceiveJobName, savedPushRow };
|
package/dist/core/promise.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { handedScope } from "../store/call-count.mjs";
|
|
2
2
|
import { answerSpent } from "../store/errors.mjs";
|
|
3
|
-
import
|
|
3
|
+
import "effect/Effect";
|
|
4
4
|
import * as Schema from "effect/Schema";
|
|
5
5
|
// src/core/promise.ts
|
|
6
6
|
const hasSignal = Schema.is(Schema.Struct({ signal: Schema.instanceOf(AbortSignal) }));
|
|
@@ -19,16 +19,17 @@ const aroundCalls = (calls, around) => {
|
|
|
19
19
|
});
|
|
20
20
|
return Object.fromEntries(entries);
|
|
21
21
|
};
|
|
22
|
+
/** No door at all: the client's, which has no server to close. */
|
|
23
|
+
const noDoor = (effect) => effect;
|
|
22
24
|
/**
|
|
23
|
-
* `effect` run
|
|
24
|
-
* refusal, never a defect. The
|
|
25
|
-
* it
|
|
26
|
-
*
|
|
27
|
-
* reads among them (Q830).
|
|
25
|
+
* `effect` run `through` the server's door: an edge a host calls, where a spent call bound is
|
|
26
|
+
* answered as its refusal, never a defect. The door refuses once the server is closed and stops
|
|
27
|
+
* the run as it closes, as `promiseCalls`' `run` does; the client, with no server, passes `noDoor`. Every Effect face's call goes through it,
|
|
28
|
+
* the twins `ExtendedGit` gives beside its Promise reads among them (Q830).
|
|
28
29
|
*/
|
|
29
|
-
const guardedCall = (
|
|
30
|
-
/** `calls`, each a seam's call that `guardedCall` runs
|
|
31
|
-
const guardedCalls = (calls,
|
|
30
|
+
const guardedCall = (through) => (effect) => through(answerSpent(effect));
|
|
31
|
+
/** `calls`, each a seam's call that `guardedCall` runs `through` the server's door. */
|
|
32
|
+
const guardedCalls = (calls, through) => aroundCalls(calls, guardedCall(through));
|
|
32
33
|
/**
|
|
33
34
|
* The Promise surface over `calls`, each call its Effect twin run by `run` with the input's
|
|
34
35
|
* `signal`, in the scope Git's own caller handed on in it, so its calls count at the doors into
|
|
@@ -43,4 +44,21 @@ const promiseCalls = (calls, run) => {
|
|
|
43
44
|
});
|
|
44
45
|
return Object.fromEntries(entries);
|
|
45
46
|
};
|
|
46
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Each group `names` holds, each call in it answering `call` with the group's name, its own and its
|
|
49
|
+
* arguments: a server's calls, made before its runtime is built.
|
|
50
|
+
*/
|
|
51
|
+
const lazyGroups = (names, call) => {
|
|
52
|
+
const groups = Object.entries(names).map(([group, calls = []]) => {
|
|
53
|
+
const made = calls.map((name) => [name, (...args) => call(group, name, args)]);
|
|
54
|
+
return [group, Object.fromEntries(made)];
|
|
55
|
+
});
|
|
56
|
+
return Object.fromEntries(groups);
|
|
57
|
+
};
|
|
58
|
+
/** The call `name` of `calls`' group `group`, which `lazyGroups` names. */
|
|
59
|
+
const callOf = (calls, group, name) => {
|
|
60
|
+
const found = calls[group]?.[name];
|
|
61
|
+
if (!isCall(found)) throw new TypeError(`The server has no call ${group}.${name}`);
|
|
62
|
+
return found;
|
|
63
|
+
};
|
|
64
|
+
export { aroundCalls, callOf, guardedCall, guardedCalls, lazyGroups, noDoor, promiseCalls, signalOf };
|
package/dist/core/push.mjs
CHANGED
|
@@ -635,7 +635,8 @@ const commitTooLarge = (received, body) => (error) => {
|
|
|
635
635
|
})) return error;
|
|
636
636
|
return gitError("RESOURCE_EXHAUSTED", `push's objects don't fit one commit: ${error.message}`, {
|
|
637
637
|
cause: error,
|
|
638
|
-
hint: "
|
|
638
|
+
hint: "Push fewer objects at a time",
|
|
639
|
+
hostHint: "Use packs() storage, which keeps a push's objects in the bucket",
|
|
639
640
|
context: { reason: "too-large" }
|
|
640
641
|
});
|
|
641
642
|
};
|
package/dist/core/seam.d.mts
CHANGED
|
@@ -6,7 +6,9 @@ import "../contracts/server.mjs";
|
|
|
6
6
|
import "../contracts/services.mjs";
|
|
7
7
|
import { TokenId } from "../contracts/tokens.mjs";
|
|
8
8
|
import "../auth/identify.mjs";
|
|
9
|
+
import "../store/promises.mjs";
|
|
9
10
|
import "./access.mjs";
|
|
11
|
+
import "./call-names.mjs";
|
|
10
12
|
import { FeedItem } from "./events/stream.mjs";
|
|
11
13
|
import * as Effect from "effect/Effect";
|
|
12
14
|
/** A revoke over HTTP names only the token: `authorize` is asked about what the token covers. */
|
package/dist/core/seam.mjs
CHANGED
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
import { redirectOf, resolveRepo } from "../store/catalogue.mjs";
|
|
2
2
|
import { readableRedirect } from "./access.mjs";
|
|
3
|
+
import { callOf, lazyGroups } from "./promise.mjs";
|
|
3
4
|
import { revokeCheck } from "./tokens.mjs";
|
|
4
5
|
import * as Effect from "effect/Effect";
|
|
5
6
|
// src/core/seam.ts
|
|
6
|
-
const
|
|
7
|
+
const seamByServer = /* @__PURE__ */ new WeakMap();
|
|
7
8
|
/** Called once, by `createGitServer`, for the server it returns. */
|
|
8
|
-
const attachParts = (server,
|
|
9
|
-
|
|
9
|
+
const attachParts = (server, seam) => {
|
|
10
|
+
seamByServer.set(server, seam);
|
|
11
|
+
};
|
|
12
|
+
/** The seam of a server `createGitServer` made; `undefined` for any other. */
|
|
13
|
+
const seamOf = (server) => seamByServer.get(server);
|
|
14
|
+
/** `seam`'s parts but its core, each waiting for the build: a route's, made before it. */
|
|
15
|
+
const lazyParts = (seam) => {
|
|
16
|
+
const { parts } = seam;
|
|
17
|
+
return {
|
|
18
|
+
basePath: seam.basePath,
|
|
19
|
+
callsFor: (caller) => lazyGroups(seam.names, (group, name, args) => Effect.flatMap(parts, (built) => callOf(built.callsFor(caller), group, name)(...args))),
|
|
20
|
+
identify: (request) => Effect.flatMap(parts, (built) => built.identify(request)),
|
|
21
|
+
authorize: (input) => Effect.flatMap(parts, (built) => built.authorize(input)),
|
|
22
|
+
renamedTo: (caller, repo) => Effect.flatMap(parts, (built) => built.renamedTo(caller, repo)),
|
|
23
|
+
listen: (caller, repo, after) => Effect.flatMap(parts, (built) => built.listen(caller, repo, after))
|
|
24
|
+
};
|
|
10
25
|
};
|
|
11
|
-
/** The parts of a server `createGitServer` made; `undefined` for any other. */
|
|
12
|
-
const partsOf = (server) => partsByServer.get(server);
|
|
13
26
|
/**
|
|
14
27
|
* `authorize` for a route: a repo's operation with the repo's access, or a revoke against the
|
|
15
28
|
* token's own coverage. A repo that isn't there is asked without access, and a caller it lets
|
|
@@ -38,4 +51,4 @@ const seamAuthorizer = (core) => (input) => {
|
|
|
38
51
|
};
|
|
39
52
|
/** Where `repo` went, for a route's redirect: only to a caller that may read it there. */
|
|
40
53
|
const renamedTo = (core) => (caller, repo) => Effect.flatMap(redirectOf(core.store, repo), (to) => to === void 0 ? Effect.succeed(void 0) : readableRedirect(core, caller, to));
|
|
41
|
-
export { attachParts,
|
|
54
|
+
export { attachParts, lazyParts, renamedTo, seamAuthorizer, seamOf };
|
package/dist/extend.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { extendGit } from "./server/extension.mjs";
|
|
2
|
+
import { isServerClosed } from "./store/closed.mjs";
|
|
2
3
|
import { ExtendedGit, GitExtension } from "./contracts/server.mjs";
|
|
3
|
-
export { type ExtendedGit, type GitExtension, extendGit };
|
|
4
|
+
export { type ExtendedGit, type GitExtension, extendGit, isServerClosed };
|
package/dist/extend.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -38,9 +38,9 @@ import { defineFetchRule, definePushRule } from "./core/rules/define.mjs";
|
|
|
38
38
|
import { refs } from "./core/rules/protect.mjs";
|
|
39
39
|
import { FetchAdjustment, FetchRule, FetchRuleInput, FileRuleOptions, GitHooks, GitRules, PostReceive, PostReceiveInput, PreReceive, ProtectOptions, PushContext, PushFacts, PushHookInput, PushRule, PushRuleInput, RefPatterns, RefRules, RuleOperation } from "./contracts/rules.mjs";
|
|
40
40
|
import { BeginPushUpload, FinishPushUpload, PushOptions, PushUploadOptions, PushUploadPart, PushUploadStarted } from "./contracts/push-uploads.mjs";
|
|
41
|
-
import { ExtendedGit, GitAdapter, GitExtension, GitServer, GitServerOptions, HostFunctionFailure, Refusal, Resolve, ResolveInput, ServerCalls, ServerSetup
|
|
41
|
+
import { BoundAdapter, ExtendedGit, GitAdapter, GitExtension, GitNeeds, GitServer, GitServerOptions, HostFunctionFailure, ProvidedBy, Refusal, Resolve, ResolveInput, ServerCalls, ServerSetup } from "./contracts/server.mjs";
|
|
42
42
|
import { ApprovalBase, ApprovalDecision, ApprovalPageContext, ApprovalPageInput, ApprovalPrompt, ApprovedGrant, ConfirmApprovalPage, DeniedGrant, DeviceApproval, DeviceCodePage, DeviceCodeRequest, DeviceCodeResponse, DeviceExchange, GitSignInOptions, OAuthClient, OAuthError, OAuthTokenResponse, WebApproval, WebAuthorize, WebExchange } from "./contracts/signin.mjs";
|
|
43
43
|
import { GitStore, GitStoreAddInput, GitStoreCommitInput, GitStoreReadInput, Listed, ListedInput, Pack } from "./contracts/store.mjs";
|
|
44
44
|
import { CreatedToken, PrefixTarget, TokenCalls, TokenCoverage, TokenCreateInput, TokenFields, TokenId, TokenInfo, TokenListInput, TokenRecord, TokenScope, TokenState, TokenTarget, TokensFeature, TrustedWriteInput, VerifiedToken } from "./contracts/tokens.mjs";
|
|
45
45
|
import { WorkCalls, WorkItem, WorkListInput, WorkRun, WorkWriteInput } from "./contracts/work.mjs";
|
|
46
|
-
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, type AuthInput, type AuthorizeAnswer, type AuthorizeInput, type Awaitable, type BasicCredential, type BatchOptions, type BearerCredential, type BeforeAfter, type BeginPushUpload, type Bisect, type Blob, type BlobCalls, type BlobCreateInput, type BlobLimit, type BlobNone, 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, type Compare, type CompareInput, type ComparisonFile, type ConfirmApprovalPage, type ContextValue, type CreatedObject, type CreatedToken, type CredentialInput, type Credentials, type CredentialsBasic, type CredentialsBearer, 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, type ErrorContext, type EventDelivery, type EventEnvelope, type EventFeature, type EventsHandler, type EventsInput, type ExistingContext, type ExtendedGit, type FailureResult, type FetchAdjustment, type FetchAnswer, type FetchRequest, type FetchRule, type FetchRuleInput, type File, type FileCalls, type FileDiff, type FileReadInput, type FileRuleOptions, type FilesAllowOperation, type FilesDiffInput, type FilesListInput, type FilesRead, type Filter, type FinishPushUpload, type ForkCalls, type ForkCreateInput, type ForkFetched, type ForkGetInput, type ForkHolder, type ForkListInput, type ForkOperation, type GitAdapter, type GitAuth, type GitAuthorize, type GitClient, type GitClientOptions, type GitEngine, type GitError, type GitErrorCode, type GitErrorContexts, type GitErrorFields, type GitEvent, type GitExtension, type GitHooks, type GitObject, type GitObjects, type GitRules, type GitScope, type GitServer, type GitServerOptions, type GitServices, 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 HiddenSpan, type Hold, type HoldEvent, type HoldEventFields, type HoldFields, type HoldId, type HoldResult, type HoldsResult, type HostErrorContext, type HostFunctionFailure, type HostFunctionName, type IndexCalls, type IndexReachInput, type IndexReached, type IndexStatus, type IndexTip, type IndexTry, type IndexTryInput, type InternalRepoId, type InvalidInputContext, type JoinInput, type Judged, type LanesInput, type LfsCalls, type LfsGetInput, type LfsObject, type LfsPointers, type LfsPointersBuilder, type LineCounts, type LinkedObjects, type Listed, type ListedInput, type Localize, type LogInput, type MaintainInput, type MergeAnswer, type MergeBaseInput, type MergeBases, type MergeCalls, type MergeCreateInput, type MergeInput, type MergeLabels, type MergeMethod, type MergePlan, type MergeQueue, type MergeQueueCalls, type MergeQueueOptions, type MergeTree, type MetaValue, type MissingContext, type NamedActor, type NotAllowedContext, 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, type ObjectsChange, type ObjectsFactory, type ObjectsFetchInput, type ObjectsOpenInput, type ObjectsRead, type ObjectsReadInput, type ObjectsStep, type Oid, type Operation, type OperationKind, type Option, type Pack, type PacksOptions, type PagedInput, type PathObject, type PeelInput, type Peeled, type PostReceive, type PostReceiveInput, type PreReceive, type PreconditionContext, type PrefixTarget, type Prepare, type PrepareInput, type PreviousQueueSchedule, type ProtectOptions, type PushContext, type PushFacts, type PushHookInput, type PushOperation, type PushOptions, type PushRule, type PushRuleInput, type PushUploadOptions, type PushUploadPart, type PushUploadStarted, type PushedCommit, type PushedCommitsInput, type Quarantine, type QueueAddInput, type QueueAddOperation, type QueueCandidateOperation, type QueueEntryOperation, type QueueEvent, type QueueFactory, type QueueFailureCounts, type QueueListInput, type QueueListResult, type QueueMeta, type QueueRecent, type QueueReleaseOperation, type QueueRestarted, type QueueSelection, 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 RefRules, type RefSight, type RefSource, type RefUpdate, type RefUpdateKind, type RefUpdated, type RefsPrivateOperation, type RefsUpdateInput, type RefsUpdated, type Refusal, 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 RepoId, type RepoInfo, type RepoInput, type RepoListInput, type RepoListOperation, type RepoListOrder, type RepoMaintained, type RepoOperation, type RepoRecord, type RepoRenameInput, type RepoRenamed, type RepoStats, type RepoUpdateInput, type RepoVisibilityChanged, type RepoWork, type RepoWorkFailed, type Report, type ReportDetails, type ReportOptions, type ReportResult, type Reported, type Resolve, type ResolveInput, type ResourceContext, type RestartResult, type Restarted, type Result, type Retried, type RetryResult, type Revision, type RuleOperation, type SavedHandlerOptions, type ScheduleOption, type SelectQueue, type ServerCalls, type ServerSetup, type ShareInput, type Signature, type Success, type Tag, type TagCalls, type TagCreateInput, type TagFields, 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, 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 Topics, type TopicsFactory, type TopicsOptions, type TransportFailure, type TransportRetry, type TreeCalls, type TreeChange, type TreeChanges, type TreeCreateInput, type TreeDiffInput, type TreeEdit, type TreeEntry, type TreeFilter, type TreeInput, type TreeMergeInput, type TrustedWriteInput, type UnpackOptions, type Verdict, type VerifiedToken, type WalkInput, type WebApproval, type WebAuthorize, type WebExchange, type WholeObject, type
|
|
46
|
+
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, type AuthInput, type AuthorizeAnswer, type AuthorizeInput, type Awaitable, type BasicCredential, type BatchOptions, type BearerCredential, type BeforeAfter, type BeginPushUpload, type Bisect, type Blob, type BlobCalls, type BlobCreateInput, type BlobLimit, type BlobNone, 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, type Compare, type CompareInput, type ComparisonFile, type ConfirmApprovalPage, type ContextValue, type CreatedObject, type CreatedToken, type CredentialInput, type Credentials, type CredentialsBasic, type CredentialsBearer, 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, type ErrorContext, type EventDelivery, type EventEnvelope, type EventFeature, type EventsHandler, type EventsInput, type ExistingContext, type ExtendedGit, type FailureResult, type FetchAdjustment, type FetchAnswer, type FetchRequest, type FetchRule, type FetchRuleInput, type File, type FileCalls, type FileDiff, type FileReadInput, type FileRuleOptions, type FilesAllowOperation, type FilesDiffInput, type FilesListInput, type FilesRead, type Filter, type FinishPushUpload, type ForkCalls, type ForkCreateInput, type ForkFetched, type ForkGetInput, type ForkHolder, type ForkListInput, type ForkOperation, type GitAdapter, type GitAuth, type GitAuthorize, type GitClient, type GitClientOptions, type GitEngine, type GitError, type GitErrorCode, type GitErrorContexts, type GitErrorFields, type GitEvent, type GitExtension, type GitHooks, type GitNeeds, type GitObject, type GitObjects, type GitRules, type GitScope, type GitServer, type GitServerOptions, type GitServices, 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 HiddenSpan, type Hold, type HoldEvent, type HoldEventFields, type HoldFields, type HoldId, type HoldResult, type HoldsResult, type HostErrorContext, type HostFunctionFailure, type HostFunctionName, type IndexCalls, type IndexReachInput, type IndexReached, type IndexStatus, type IndexTip, type IndexTry, type IndexTryInput, type InternalRepoId, type InvalidInputContext, type JoinInput, type Judged, type LanesInput, type LfsCalls, type LfsGetInput, type LfsObject, type LfsPointers, type LfsPointersBuilder, type LineCounts, type LinkedObjects, type Listed, type ListedInput, type Localize, type LogInput, type MaintainInput, type MergeAnswer, type MergeBaseInput, type MergeBases, type MergeCalls, type MergeCreateInput, type MergeInput, type MergeLabels, type MergeMethod, type MergePlan, type MergeQueue, type MergeQueueCalls, type MergeQueueOptions, type MergeTree, type MetaValue, type MissingContext, type NamedActor, type NotAllowedContext, 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, type ObjectsChange, type ObjectsFactory, type ObjectsFetchInput, type ObjectsOpenInput, type ObjectsRead, type ObjectsReadInput, type ObjectsStep, type Oid, type Operation, type OperationKind, type Option, type Pack, type PacksOptions, type PagedInput, type PathObject, type PeelInput, type Peeled, type PostReceive, type PostReceiveInput, type PreReceive, type PreconditionContext, 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, type PushUploadPart, type PushUploadStarted, type PushedCommit, type PushedCommitsInput, type Quarantine, type QueueAddInput, type QueueAddOperation, type QueueCandidateOperation, type QueueEntryOperation, type QueueEvent, type QueueFactory, type QueueFailureCounts, type QueueListInput, type QueueListResult, type QueueMeta, type QueueRecent, type QueueReleaseOperation, type QueueRestarted, type QueueSelection, 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 RefRules, type RefSight, type RefSource, type RefUpdate, type RefUpdateKind, type RefUpdated, type RefsPrivateOperation, type RefsUpdateInput, type RefsUpdated, type Refusal, 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 RepoId, type RepoInfo, type RepoInput, type RepoListInput, type RepoListOperation, type RepoListOrder, type RepoMaintained, type RepoOperation, type RepoRecord, type RepoRenameInput, type RepoRenamed, type RepoStats, type RepoUpdateInput, type RepoVisibilityChanged, type RepoWork, type RepoWorkFailed, type Report, type ReportDetails, type ReportOptions, type ReportResult, type Reported, type Resolve, type ResolveInput, type ResourceContext, type RestartResult, type Restarted, type Result, type Retried, type RetryResult, type Revision, type RuleOperation, type SavedHandlerOptions, type ScheduleOption, type SelectQueue, type ServerCalls, type ServerSetup, type ShareInput, type Signature, type Success, type Tag, type TagCalls, type TagCreateInput, type TagFields, 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, 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 Topics, type TopicsFactory, type TopicsOptions, type TransportFailure, type TransportRetry, type TreeCalls, type TreeChange, type TreeChanges, type TreeCreateInput, type TreeDiffInput, type TreeEdit, type TreeEntry, type TreeFilter, type TreeInput, type TreeMergeInput, type TrustedWriteInput, type UnpackOptions, type Verdict, type VerifiedToken, type WalkInput, type WebApproval, type WebAuthorize, type WebExchange, type WholeObject, type WithoutActor, type WorkCalls, type WorkItem, type WorkListInput, type WorkOperation, type WorkRun, type WorkWriteInput, type WriteInput, accept, allotmentWithin, branchRef, createGitClient, createGitServer, defineFetchRule, definePushRule, gitPathOf, httpStatus, lfsPointerOid, lfsPointers, loose, looseLimits, maxLfsPointerBytes, mergeQueue, objectsReadMost, packs, paginate, peelMost, peelTagsMost, refs, reject, shortTarget, topics };
|
package/dist/lfs/objects.mjs
CHANGED
|
@@ -15,7 +15,7 @@ import * as DateTime from "effect/DateTime";
|
|
|
15
15
|
/** A bucket's own LFS signing: links to read, and uploads it checks against their SHA-256. */
|
|
16
16
|
const signingOf = (bucket) => isSigned(bucket) ? bucket : void 0;
|
|
17
17
|
/** A bucket made with signing, as `r2()` given S3 credentials makes one, has all three. */
|
|
18
|
-
const isSigned = (bucket) => "
|
|
18
|
+
const isSigned = (bucket) => "url" in bucket && "putUrl" in bucket && "head" in bucket;
|
|
19
19
|
/**
|
|
20
20
|
* Each object's rows, read with the repo's record and the fence's rows at one version, the fence
|
|
21
21
|
* checked; `also`'s rows after them. A repo deleted since it opened is `NOT_FOUND`.
|
package/dist/lfs/rows.mjs
CHANGED
package/dist/queue/advance.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { millis } from "../contracts/promises.mjs";
|
|
1
2
|
import { hostCall } from "../auth/host-function.mjs";
|
|
2
3
|
import { retriedCodes } from "../core/push.mjs";
|
|
3
4
|
import { mergedTree } from "../core/objects/commit-writes.mjs";
|
|
@@ -26,7 +27,7 @@ import { blameGroup, failEntries, groupsOf, openSearched, passGroup, reportDetai
|
|
|
26
27
|
import { QueuePlan, entryNotes, loadTarget, openHolds, orderOf } from "./state.mjs";
|
|
27
28
|
import { AdvanceData, CandidateData, advanceName, buildName, buildRow, timeoutName, timeoutRow } from "../store/queue-jobs.mjs";
|
|
28
29
|
import { addTargetHold, advanceAfter, closeAll, closeCandidate, endEntry, entryOf, isOpen, movedOutside, releaseHold, removeEntry, stackOf, workHolds } from "./steps.mjs";
|
|
29
|
-
import { defineJob
|
|
30
|
+
import { defineJob } from "@ref0/infra";
|
|
30
31
|
import * as Effect from "effect/Effect";
|
|
31
32
|
import * as Schema from "effect/Schema";
|
|
32
33
|
import * as Predicate from "effect/Predicate";
|
package/dist/queue/host.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import "../contracts/promises.mjs";
|
|
1
2
|
import "../contracts/actors.mjs";
|
|
2
3
|
import "../contracts/grants.mjs";
|
|
3
4
|
import { MergeQueueOptions, QueueFactory } from "../contracts/queue.mjs";
|
|
4
5
|
import "../contracts/services.mjs";
|
|
5
6
|
import "../core/access.mjs";
|
|
6
|
-
import { Duration } from "@ref0/infra";
|
|
7
7
|
import "effect/Effect";
|
|
8
8
|
/**
|
|
9
9
|
* The queue a server runs: `git.queue`, its jobs and its events, and `git push -o queue`. A
|
package/dist/queue/host.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { millis } from "../contracts/promises.mjs";
|
|
1
2
|
import { gitError } from "../store/errors.mjs";
|
|
2
3
|
import { queueLimits } from "./limits.mjs";
|
|
3
4
|
import "./schedule.mjs";
|
|
4
|
-
import { millis } from "@ref0/infra";
|
|
5
5
|
import * as Effect from "effect/Effect";
|
|
6
6
|
import * as Predicate from "effect/Predicate";
|
|
7
7
|
// src/queue/host.ts
|
package/dist/queue/schedule.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { millis } from "../contracts/promises.mjs";
|
|
1
2
|
import { hostCall } from "../auth/host-function.mjs";
|
|
2
3
|
import { queueLimits } from "./limits.mjs";
|
|
3
4
|
import { lanesNamed } from "./lanes.mjs";
|
|
4
5
|
import { entryNotes, orderOf } from "./state.mjs";
|
|
5
6
|
import { candidateOf, entryOf } from "./steps.mjs";
|
|
6
|
-
import { millis } from "@ref0/infra";
|
|
7
7
|
import * as Effect from "effect/Effect";
|
|
8
8
|
import * as Predicate from "effect/Predicate";
|
|
9
9
|
// src/queue/schedule.ts
|
package/dist/rest/blobs.d.mts
CHANGED
|
@@ -2,13 +2,18 @@ import { JsonHttpError } from "./errors.mjs";
|
|
|
2
2
|
import { GitCallerMiddleware, GitRestServices } from "./caller.mjs";
|
|
3
3
|
import * as Schema from "effect/Schema";
|
|
4
4
|
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/http-api";
|
|
5
|
-
declare const BlobsApiGroup_base: HttpApiGroup.HttpApiGroup<"blobs", HttpApiEndpoint.HttpApiEndpoint<"
|
|
5
|
+
declare const BlobsApiGroup_base: HttpApiGroup.HttpApiGroup<"blobs", HttpApiEndpoint.HttpApiEndpoint<"get", "GET", "/repos/:repo/-/blobs/:oid", Schema.toCodecStringTree<Schema.Struct<{
|
|
6
6
|
repo: Schema.String;
|
|
7
|
+
oid: Schema.String;
|
|
7
8
|
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
objects: Schema.optionalKey<Schema.Int>;
|
|
10
|
+
bytes: Schema.optionalKey<Schema.Int>;
|
|
11
|
+
entries: Schema.optionalKey<Schema.Int>;
|
|
12
|
+
milliseconds: Schema.optionalKey<Schema.Int>;
|
|
13
|
+
}>>, never, never, HttpApiSchema.WithHeaders<HttpApiSchema.StreamUint8Array, Schema.toCodecStringTree<Schema.Struct<{
|
|
14
|
+
etag: Schema.String;
|
|
15
|
+
'content-length': Schema.NumberFromString;
|
|
16
|
+
}>>>, Schema.toCodecJson<HttpApiSchema.encodeToWithHeaders<Schema.Codec<JsonHttpError, unknown, never, never>, Schema.Codec<JsonHttpError, unknown, never, never>, {
|
|
12
17
|
"ref0-code": Schema.String;
|
|
13
18
|
}> | HttpApiSchema.encodeToWithHeaders<Schema.Struct<{
|
|
14
19
|
code: Schema.Literal<"UNAUTHENTICATED">;
|
|
@@ -23,18 +28,13 @@ declare const BlobsApiGroup_base: HttpApiGroup.HttpApiGroup<"blobs", HttpApiEndp
|
|
|
23
28
|
}>, {
|
|
24
29
|
"ref0-code": Schema.String;
|
|
25
30
|
'www-authenticate': Schema.String;
|
|
26
|
-
}>>, GitCallerMiddleware, GitRestServices> | HttpApiEndpoint.HttpApiEndpoint<"
|
|
31
|
+
}>>, GitCallerMiddleware, GitRestServices> | HttpApiEndpoint.HttpApiEndpoint<"create", "POST", "/repos/:repo/-/blobs", Schema.toCodecStringTree<Schema.Struct<{
|
|
27
32
|
repo: Schema.String;
|
|
28
|
-
oid: Schema.String;
|
|
29
33
|
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}>>, never, never, HttpApiSchema.WithHeaders<HttpApiSchema.StreamUint8Array, Schema.toCodecStringTree<Schema.Struct<{
|
|
35
|
-
etag: Schema.String;
|
|
36
|
-
'content-length': Schema.NumberFromString;
|
|
37
|
-
}>>>, Schema.toCodecJson<HttpApiSchema.encodeToWithHeaders<Schema.Codec<JsonHttpError, unknown, never, never>, Schema.Codec<JsonHttpError, unknown, never, never>, {
|
|
34
|
+
key: Schema.optionalKey<Schema.String>;
|
|
35
|
+
}>>, HttpApiSchema.StreamUint8Array, never, Schema.toCodecJson<Schema.Struct<{
|
|
36
|
+
readonly oid: Schema.String;
|
|
37
|
+
}>>, Schema.toCodecJson<HttpApiSchema.encodeToWithHeaders<Schema.Codec<JsonHttpError, unknown, never, never>, Schema.Codec<JsonHttpError, unknown, never, never>, {
|
|
38
38
|
"ref0-code": Schema.String;
|
|
39
39
|
}> | HttpApiSchema.encodeToWithHeaders<Schema.Struct<{
|
|
40
40
|
code: Schema.Literal<"UNAUTHENTICATED">;
|
package/dist/rest/client.mjs
CHANGED
|
@@ -9,11 +9,11 @@ import { readableUrl } from "./paths.mjs";
|
|
|
9
9
|
import * as Effect from "effect/Effect";
|
|
10
10
|
import * as Schema from "effect/Schema";
|
|
11
11
|
import * as Option from "effect/Option";
|
|
12
|
+
import * as Predicate from "effect/Predicate";
|
|
12
13
|
import * as Cause from "effect/Cause";
|
|
13
14
|
import * as Exit from "effect/Exit";
|
|
14
|
-
import * as Predicate from "effect/Predicate";
|
|
15
|
-
import { HttpApiClient } from "effect/http-api";
|
|
16
15
|
import * as Stream from "effect/Stream";
|
|
16
|
+
import { HttpApiClient } from "effect/http-api";
|
|
17
17
|
import * as FetchHttpClient from "effect/http/FetchHttpClient";
|
|
18
18
|
import * as HttpClient from "effect/http/HttpClient";
|
|
19
19
|
import * as HttpClientError from "effect/http/HttpClientError";
|