@fedify/fedify 2.3.0-dev.1212 → 2.3.0-dev.1213
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/{builder-DdbtvTFp.mjs → builder-Bj-7Sl7u.mjs} +9 -2
- package/dist/compat/mod.d.cts +1 -1
- package/dist/compat/mod.d.ts +1 -1
- package/dist/compat/outgoing-jsonld.test.mjs +1 -1
- package/dist/compat/public-audience.test.mjs +1 -1
- package/dist/compat/transformers.test.mjs +2 -2
- package/dist/{context-DMHK7jqX.d.cts → context-BBVLF7lx.d.cts} +41 -2
- package/dist/{context-K9cg8oGx.d.ts → context-BU6jSQdo.d.ts} +42 -2
- package/dist/{deno-DTaoLXHr.mjs → deno-BUzynMVz.mjs} +1 -1
- package/dist/{docloader-CdNiXmNg.mjs → docloader-jQPthO4U.mjs} +2 -2
- package/dist/{esm-BQRw925N.mjs → esm-vrlUxr60.mjs} +23 -1
- package/dist/federation/builder.test.mjs +21 -2
- package/dist/federation/circuit-breaker.test.mjs +1 -1
- package/dist/federation/handler.test.mjs +6 -6
- package/dist/federation/idempotency.test.mjs +4 -4
- package/dist/federation/keycache.test.mjs +1 -1
- package/dist/federation/kv.test.mjs +1 -1
- package/dist/federation/metrics.test.mjs +147 -1
- package/dist/federation/middleware.test.mjs +446 -18
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.d.cts +3 -3
- package/dist/federation/mod.d.ts +3 -3
- package/dist/federation/mod.js +1 -1
- package/dist/federation/send.test.mjs +8 -4426
- package/dist/federation/temporal.test.mjs +1 -1
- package/dist/federation/webfinger.test.mjs +2 -2
- package/dist/{http-Czeyq7if.cjs → http-B1zlPuh3.cjs} +79 -2
- package/dist/{http-BEG9kx13.js → http-B_WbYMnB.js} +74 -3
- package/dist/{http-ByCfCX5K.mjs → http-CDaMGwCP.mjs} +4 -4
- package/dist/{key-Bhsx9PrC.mjs → key-DdP4HxTK.mjs} +2 -2
- package/dist/{kv-cache-qRBN2G2Z.cjs → kv-cache-CPIfTWt5.cjs} +1 -1
- package/dist/{kv-cache-D9U1AnXH.js → kv-cache-CXo8QM4m.js} +1 -1
- package/dist/{kv-cache-D4jzgeYW.mjs → kv-cache-DSjv5Aeh.mjs} +1 -1
- package/dist/{ld-CHtLb_Uh.mjs → ld-CuOEh5aB.mjs} +3 -3
- package/dist/{metrics-uwSF8DLC.mjs → metrics-B5vvJYMV.mjs} +74 -3
- package/dist/{middleware-BmSzD5U9.mjs → middleware-Cq9S8A5O.mjs} +328 -24
- package/dist/{middleware-CyiBzIwY.mjs → middleware-DPE-IRlD.mjs} +1 -1
- package/dist/{middleware-DrKDd2JT.js → middleware-Dft_sYeS.js} +352 -41
- package/dist/{middleware-CRORNnSU.cjs → middleware-DlqW4IRW.cjs} +351 -40
- package/dist/{mod-YLnSsEHY.d.cts → mod-C0F6kvgS.d.cts} +1 -1
- package/dist/{mod-CfOFqS0w.d.ts → mod-vPYVoa5n.d.ts} +1 -1
- package/dist/mod.cjs +4 -4
- package/dist/mod.d.cts +4 -4
- package/dist/mod.d.ts +4 -4
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/client.test.mjs +2 -2
- package/dist/nodeinfo/handler.test.mjs +2 -2
- package/dist/nodeinfo/types.test.mjs +1 -1
- package/dist/otel/exporter.test.mjs +1 -1
- package/dist/{outgoing-jsonld-BgFLCJQ_.mjs → outgoing-jsonld-L_DbOaFe.mjs} +1 -1
- package/dist/{owner-B0Zrhs0w.mjs → owner--n8rmG51.mjs} +2 -2
- package/dist/{proof-frzCtYji.cjs → proof-BKpJ_p_d.cjs} +1 -1
- package/dist/{proof-CZhAX94C.js → proof-BsvB1vGI.js} +1 -1
- package/dist/{proof-DbJFxpzD.mjs → proof-dhtwaP4z.mjs} +5 -5
- package/dist/{send-kst2L0Df.mjs → send-CTQ30Wbe.mjs} +3 -3
- package/dist/sig/accept.test.mjs +1 -1
- package/dist/sig/http.test.mjs +4 -4
- package/dist/sig/key.test.mjs +2 -2
- package/dist/sig/ld.test.mjs +3 -3
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +2 -2
- package/dist/sig/proof.test.mjs +3 -3
- package/dist/{temporal-CcGypkzd.mjs → temporal-gfUaZjGU.mjs} +1 -1
- package/dist/testing/mod.d.mts +1 -0
- package/dist/utils/docloader.test.mjs +4 -4
- package/dist/utils/kv-cache.test.mjs +1 -1
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +7 -7
- package/dist/chunk-DNRtMIoB.mjs +0 -29
- package/dist/execAsync-Dmet7-28.mjs +0 -13
- package/dist/getMachineId-bsd-Bn0le7-J.mjs +0 -29
- package/dist/getMachineId-darwin-CVjKuDgj.mjs +0 -26
- package/dist/getMachineId-linux-DbG4BXa-.mjs +0 -22
- package/dist/getMachineId-unsupported-lC8T9hPE.mjs +0 -17
- package/dist/getMachineId-win-c5zxTSS1.mjs +0 -28
- /package/dist/{accept-CceiKpCy.mjs → accept-CPkZzmGN.mjs} +0 -0
- /package/dist/{client-B_A6mfn3.mjs → client-ByXmQhYD.mjs} +0 -0
- /package/dist/{keys-C3kae-6B.mjs → keys-DGu1NFwu.mjs} +0 -0
- /package/dist/{kv-x2IvBUyq.mjs → kv-rV3vodCc.mjs} +0 -0
- /package/dist/{public-audience-N3pyOx2p.mjs → public-audience-Cvbr2Gzt.mjs} +0 -0
- /package/dist/{types-BFowWFTT.mjs → types-J53Kw7so.mjs} +0 -0
|
@@ -2,10 +2,10 @@ const { Temporal } = require("@js-temporal/polyfill");
|
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
const require_chunk = require("./chunk-DDcVe30Y.cjs");
|
|
4
4
|
const require_transformers = require("./transformers-NeAONrAq.cjs");
|
|
5
|
-
const require_http = require("./http-
|
|
6
|
-
const require_proof = require("./proof-
|
|
5
|
+
const require_http = require("./http-B1zlPuh3.cjs");
|
|
6
|
+
const require_proof = require("./proof-BKpJ_p_d.cjs");
|
|
7
7
|
const require_types = require("./types-KC4QAoxe.cjs");
|
|
8
|
-
const require_kv_cache = require("./kv-cache-
|
|
8
|
+
const require_kv_cache = require("./kv-cache-CPIfTWt5.cjs");
|
|
9
9
|
let _logtape_logtape = require("@logtape/logtape");
|
|
10
10
|
let _fedify_uri_template = require("@fedify/uri-template");
|
|
11
11
|
let _fedify_vocab = require("@fedify/vocab");
|
|
@@ -17,6 +17,7 @@ let _opentelemetry_semantic_conventions = require("@opentelemetry/semantic-conve
|
|
|
17
17
|
let _fedify_vocab_runtime_jsonld = require("@fedify/vocab-runtime/jsonld");
|
|
18
18
|
_fedify_vocab_runtime_jsonld = require_chunk.__toESM(_fedify_vocab_runtime_jsonld, 1);
|
|
19
19
|
let _fedify_webfinger = require("@fedify/webfinger");
|
|
20
|
+
let _opentelemetry_sdk_metrics = require("@opentelemetry/sdk-metrics");
|
|
20
21
|
let node_url = require("node:url");
|
|
21
22
|
//#region src/federation/activity-listener.ts
|
|
22
23
|
var ActivityListenerSet = class {
|
|
@@ -118,6 +119,13 @@ var FederationBuilderImpl = class {
|
|
|
118
119
|
this.collectionCallbacks = {};
|
|
119
120
|
this.collectionTypeIds = {};
|
|
120
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* Builds the federation object.
|
|
124
|
+
* @param options Parameters for initializing the federation object.
|
|
125
|
+
* @returns The federation object.
|
|
126
|
+
* @throws {TypeError} If benchmark mode and `meterProvider` are both
|
|
127
|
+
* specified.
|
|
128
|
+
*/
|
|
121
129
|
async build(options) {
|
|
122
130
|
const { FederationImpl } = await Promise.resolve().then(() => middleware_exports);
|
|
123
131
|
const f = new FederationImpl(options);
|
|
@@ -3073,36 +3081,6 @@ function handleNodeInfoJrd(_request, context) {
|
|
|
3073
3081
|
return Promise.resolve(response);
|
|
3074
3082
|
}
|
|
3075
3083
|
//#endregion
|
|
3076
|
-
//#region src/federation/retry.ts
|
|
3077
|
-
/**
|
|
3078
|
-
* Creates an exponential backoff retry policy. The delay between retries
|
|
3079
|
-
* starts at the `initialDelay` and is multiplied by the `factor` for each
|
|
3080
|
-
* subsequent retry, up to the `maxDelay`. The policy will give up after
|
|
3081
|
-
* `maxAttempts` attempts. The actual delay is randomized to avoid
|
|
3082
|
-
* synchronization (jitter).
|
|
3083
|
-
* @param options The options for the policy.
|
|
3084
|
-
* @returns The retry policy.
|
|
3085
|
-
* @since 0.12.0
|
|
3086
|
-
*/
|
|
3087
|
-
function createExponentialBackoffPolicy(options = {}) {
|
|
3088
|
-
const initialDelay = Temporal.Duration.from(options.initialDelay ?? { seconds: 1 });
|
|
3089
|
-
const maxDelay = Temporal.Duration.from(options.maxDelay ?? { hours: 12 });
|
|
3090
|
-
const maxAttempts = options.maxAttempts ?? 10;
|
|
3091
|
-
const factor = options.factor ?? 2;
|
|
3092
|
-
const jitter = options.jitter ?? true;
|
|
3093
|
-
return ({ attempts }) => {
|
|
3094
|
-
if (attempts >= maxAttempts) return null;
|
|
3095
|
-
let milliseconds = initialDelay.total("millisecond");
|
|
3096
|
-
milliseconds *= factor ** attempts;
|
|
3097
|
-
if (jitter) {
|
|
3098
|
-
milliseconds *= 1 + Math.random();
|
|
3099
|
-
milliseconds = Math.round(milliseconds);
|
|
3100
|
-
}
|
|
3101
|
-
const delay = Temporal.Duration.from({ milliseconds });
|
|
3102
|
-
return Temporal.Duration.compare(delay, maxDelay) > 0 ? maxDelay : delay;
|
|
3103
|
-
};
|
|
3104
|
-
}
|
|
3105
|
-
//#endregion
|
|
3106
3084
|
//#region src/federation/send.ts
|
|
3107
3085
|
/**
|
|
3108
3086
|
* Extracts the inbox URLs from recipients.
|
|
@@ -3332,6 +3310,231 @@ var SendActivityError = class extends Error {
|
|
|
3332
3310
|
}
|
|
3333
3311
|
};
|
|
3334
3312
|
//#endregion
|
|
3313
|
+
//#region src/federation/bench.ts
|
|
3314
|
+
/**
|
|
3315
|
+
* Metric reader owned by `benchmarkMode`.
|
|
3316
|
+
* @since 2.3.0
|
|
3317
|
+
*/
|
|
3318
|
+
var BenchmarkMetricReader = class extends _opentelemetry_sdk_metrics.MetricReader {
|
|
3319
|
+
onShutdown() {
|
|
3320
|
+
return Promise.resolve();
|
|
3321
|
+
}
|
|
3322
|
+
onForceFlush() {
|
|
3323
|
+
return Promise.resolve();
|
|
3324
|
+
}
|
|
3325
|
+
};
|
|
3326
|
+
/**
|
|
3327
|
+
* Creates the in-process OpenTelemetry meter provider used by benchmark mode.
|
|
3328
|
+
* @returns The meter provider and the metric reader attached to it.
|
|
3329
|
+
* @since 2.3.0
|
|
3330
|
+
*/
|
|
3331
|
+
function createBenchmarkMeterProvider() {
|
|
3332
|
+
const reader = new BenchmarkMetricReader();
|
|
3333
|
+
return {
|
|
3334
|
+
meterProvider: new _opentelemetry_sdk_metrics.MeterProvider({ readers: [reader] }),
|
|
3335
|
+
reader
|
|
3336
|
+
};
|
|
3337
|
+
}
|
|
3338
|
+
/**
|
|
3339
|
+
* Collects and serializes benchmark-mode metrics from a benchmark reader.
|
|
3340
|
+
* @param reader The benchmark metric reader to collect from.
|
|
3341
|
+
* @returns A server metric snapshot with any collection errors stringified.
|
|
3342
|
+
* @since 2.3.0
|
|
3343
|
+
*/
|
|
3344
|
+
async function collectBenchmarkMetrics(reader) {
|
|
3345
|
+
const result = await reader.collect();
|
|
3346
|
+
return {
|
|
3347
|
+
version: 1,
|
|
3348
|
+
source: "server",
|
|
3349
|
+
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3350
|
+
scopeMetrics: serializeScopeMetrics(result.resourceMetrics),
|
|
3351
|
+
errors: result.errors.map((error) => String(error))
|
|
3352
|
+
};
|
|
3353
|
+
}
|
|
3354
|
+
/**
|
|
3355
|
+
* Handles `GET /.well-known/fedify/bench/stats`.
|
|
3356
|
+
* @param request The HTTP request to handle.
|
|
3357
|
+
* @param reader The benchmark metric reader to collect from.
|
|
3358
|
+
* @returns A JSON metric snapshot response, or `405 Method Not Allowed`.
|
|
3359
|
+
* @since 2.3.0
|
|
3360
|
+
*/
|
|
3361
|
+
async function handleBenchmarkStats(request, reader) {
|
|
3362
|
+
if (request.method !== "GET") return new Response("Method not allowed", {
|
|
3363
|
+
status: 405,
|
|
3364
|
+
headers: { "Allow": "GET" }
|
|
3365
|
+
});
|
|
3366
|
+
return jsonResponse(await collectBenchmarkMetrics(reader));
|
|
3367
|
+
}
|
|
3368
|
+
/**
|
|
3369
|
+
* Handles `POST /.well-known/fedify/bench/trigger`.
|
|
3370
|
+
*
|
|
3371
|
+
* The handler validates a benchmark trigger request, checks recipients against
|
|
3372
|
+
* server-controlled trigger options, and calls `Context.sendActivity()` to use
|
|
3373
|
+
* the target's normal outbox path.
|
|
3374
|
+
* @param request The HTTP request to handle.
|
|
3375
|
+
* @param context The Fedify context used to resolve actors and send activity.
|
|
3376
|
+
* @param options Server-controlled benchmark trigger delivery options.
|
|
3377
|
+
* @returns A JSON response describing the sent activity, or a validation error.
|
|
3378
|
+
* @since 2.3.0
|
|
3379
|
+
*/
|
|
3380
|
+
async function handleBenchmarkTrigger(request, context, options = {}) {
|
|
3381
|
+
if (request.method !== "POST") return new Response("Method not allowed", {
|
|
3382
|
+
status: 405,
|
|
3383
|
+
headers: { "Allow": "POST" }
|
|
3384
|
+
});
|
|
3385
|
+
let json;
|
|
3386
|
+
try {
|
|
3387
|
+
json = await request.json();
|
|
3388
|
+
} catch {
|
|
3389
|
+
return jsonResponse({ error: "Invalid JSON request body." }, 400);
|
|
3390
|
+
}
|
|
3391
|
+
try {
|
|
3392
|
+
const body = asRecord(json, "request body");
|
|
3393
|
+
const sender = parseSender(body.sender);
|
|
3394
|
+
const recipients = await parseRecipients(body.recipients, context);
|
|
3395
|
+
const activity = await parseActivity(body.activity, context);
|
|
3396
|
+
if (activity.id == null) throw new BenchmarkTriggerError("activity must have an id.");
|
|
3397
|
+
const activityId = activity.id.href;
|
|
3398
|
+
const inboxes = extractInboxes({ recipients });
|
|
3399
|
+
const inboxUrls = Object.keys(inboxes);
|
|
3400
|
+
if (inboxUrls.length < 1) throw new BenchmarkTriggerError("No valid recipient inboxes found. The recipients list must not be empty.");
|
|
3401
|
+
const unsafeInboxes = options.allowUnsafeRecipients ? [] : inboxUrls.filter((inbox) => !options.sinks?.has(inbox));
|
|
3402
|
+
if (unsafeInboxes.length > 0) return jsonResponse({
|
|
3403
|
+
error: "unsafe_recipient",
|
|
3404
|
+
unsafeInboxes
|
|
3405
|
+
}, 403);
|
|
3406
|
+
await context.sendActivity(sender, recipients, activity);
|
|
3407
|
+
return jsonResponse({
|
|
3408
|
+
version: 1,
|
|
3409
|
+
activityId,
|
|
3410
|
+
queueCorrelationId: activityId,
|
|
3411
|
+
recipientCount: recipients.length,
|
|
3412
|
+
inboxCount: inboxUrls.length
|
|
3413
|
+
}, 202);
|
|
3414
|
+
} catch (error) {
|
|
3415
|
+
if (error instanceof BenchmarkTriggerError) return jsonResponse({ error: error.message }, error.status);
|
|
3416
|
+
throw error;
|
|
3417
|
+
}
|
|
3418
|
+
}
|
|
3419
|
+
var BenchmarkTriggerError = class extends Error {
|
|
3420
|
+
status;
|
|
3421
|
+
constructor(message, status = 400) {
|
|
3422
|
+
super(message);
|
|
3423
|
+
this.status = status;
|
|
3424
|
+
}
|
|
3425
|
+
};
|
|
3426
|
+
function parseSender(value) {
|
|
3427
|
+
const sender = asRecord(value, "sender");
|
|
3428
|
+
if (typeof sender.identifier === "string") return { identifier: sender.identifier };
|
|
3429
|
+
if (typeof sender.username === "string") return { username: sender.username };
|
|
3430
|
+
throw new BenchmarkTriggerError("sender must be { identifier } or { username }.");
|
|
3431
|
+
}
|
|
3432
|
+
async function parseRecipients(value, context) {
|
|
3433
|
+
if (!Array.isArray(value)) throw new BenchmarkTriggerError("recipients must be an array.");
|
|
3434
|
+
return await Promise.all(value.map(async (item) => {
|
|
3435
|
+
let object;
|
|
3436
|
+
try {
|
|
3437
|
+
object = await _fedify_vocab.Object.fromJsonLd(item, {
|
|
3438
|
+
documentLoader: context.documentLoader,
|
|
3439
|
+
contextLoader: context.contextLoader
|
|
3440
|
+
});
|
|
3441
|
+
} catch (error) {
|
|
3442
|
+
throw new BenchmarkTriggerError(`Invalid ActivityPub recipient: ${error}`);
|
|
3443
|
+
}
|
|
3444
|
+
if (!isRecipient(object)) throw new BenchmarkTriggerError("each recipient must be an ActivityPub actor.");
|
|
3445
|
+
const recipient = object;
|
|
3446
|
+
if (recipient.id == null || recipient.inboxId == null) throw new BenchmarkTriggerError("each recipient must have id and inbox properties.");
|
|
3447
|
+
return recipient;
|
|
3448
|
+
}));
|
|
3449
|
+
}
|
|
3450
|
+
function isRecipient(value) {
|
|
3451
|
+
return value != null && typeof value === "object" && "id" in value && "inboxId" in value;
|
|
3452
|
+
}
|
|
3453
|
+
async function parseActivity(value, context) {
|
|
3454
|
+
try {
|
|
3455
|
+
return await _fedify_vocab.Activity.fromJsonLd(value, {
|
|
3456
|
+
documentLoader: context.documentLoader,
|
|
3457
|
+
contextLoader: context.contextLoader
|
|
3458
|
+
});
|
|
3459
|
+
} catch (error) {
|
|
3460
|
+
throw new BenchmarkTriggerError(`Invalid ActivityPub activity: ${error}`);
|
|
3461
|
+
}
|
|
3462
|
+
}
|
|
3463
|
+
function asRecord(value, name) {
|
|
3464
|
+
if (value == null || typeof value !== "object" || Array.isArray(value)) throw new BenchmarkTriggerError(`${name} must be an object.`);
|
|
3465
|
+
return value;
|
|
3466
|
+
}
|
|
3467
|
+
function jsonResponse(body, status = 200) {
|
|
3468
|
+
return new Response(JSON.stringify(body), {
|
|
3469
|
+
status,
|
|
3470
|
+
headers: { "Content-Type": "application/json" }
|
|
3471
|
+
});
|
|
3472
|
+
}
|
|
3473
|
+
function serializeScopeMetrics(resourceMetrics) {
|
|
3474
|
+
return resourceMetrics.scopeMetrics.map(serializeScope);
|
|
3475
|
+
}
|
|
3476
|
+
function serializeScope(scopeMetrics) {
|
|
3477
|
+
return {
|
|
3478
|
+
scope: {
|
|
3479
|
+
name: scopeMetrics.scope.name,
|
|
3480
|
+
version: scopeMetrics.scope.version
|
|
3481
|
+
},
|
|
3482
|
+
metrics: scopeMetrics.metrics.map(serializeMetric)
|
|
3483
|
+
};
|
|
3484
|
+
}
|
|
3485
|
+
function serializeMetric(metric) {
|
|
3486
|
+
return {
|
|
3487
|
+
name: metric.descriptor.name,
|
|
3488
|
+
description: metric.descriptor.description,
|
|
3489
|
+
unit: metric.descriptor.unit,
|
|
3490
|
+
dataPointType: serializeDataPointType(metric.dataPointType),
|
|
3491
|
+
dataPoints: metric.dataPoints.map((point) => ({
|
|
3492
|
+
attributes: { ...point.attributes },
|
|
3493
|
+
startTime: point.startTime,
|
|
3494
|
+
endTime: point.endTime,
|
|
3495
|
+
value: point.value
|
|
3496
|
+
}))
|
|
3497
|
+
};
|
|
3498
|
+
}
|
|
3499
|
+
function serializeDataPointType(dataPointType) {
|
|
3500
|
+
switch (dataPointType) {
|
|
3501
|
+
case _opentelemetry_sdk_metrics.DataPointType.HISTOGRAM: return "histogram";
|
|
3502
|
+
case _opentelemetry_sdk_metrics.DataPointType.EXPONENTIAL_HISTOGRAM: return "exponential_histogram";
|
|
3503
|
+
case _opentelemetry_sdk_metrics.DataPointType.GAUGE: return "gauge";
|
|
3504
|
+
case _opentelemetry_sdk_metrics.DataPointType.SUM: return "sum";
|
|
3505
|
+
}
|
|
3506
|
+
}
|
|
3507
|
+
//#endregion
|
|
3508
|
+
//#region src/federation/retry.ts
|
|
3509
|
+
/**
|
|
3510
|
+
* Creates an exponential backoff retry policy. The delay between retries
|
|
3511
|
+
* starts at the `initialDelay` and is multiplied by the `factor` for each
|
|
3512
|
+
* subsequent retry, up to the `maxDelay`. The policy will give up after
|
|
3513
|
+
* `maxAttempts` attempts. The actual delay is randomized to avoid
|
|
3514
|
+
* synchronization (jitter).
|
|
3515
|
+
* @param options The options for the policy.
|
|
3516
|
+
* @returns The retry policy.
|
|
3517
|
+
* @since 0.12.0
|
|
3518
|
+
*/
|
|
3519
|
+
function createExponentialBackoffPolicy(options = {}) {
|
|
3520
|
+
const initialDelay = Temporal.Duration.from(options.initialDelay ?? { seconds: 1 });
|
|
3521
|
+
const maxDelay = Temporal.Duration.from(options.maxDelay ?? { hours: 12 });
|
|
3522
|
+
const maxAttempts = options.maxAttempts ?? 10;
|
|
3523
|
+
const factor = options.factor ?? 2;
|
|
3524
|
+
const jitter = options.jitter ?? true;
|
|
3525
|
+
return ({ attempts }) => {
|
|
3526
|
+
if (attempts >= maxAttempts) return null;
|
|
3527
|
+
let milliseconds = initialDelay.total("millisecond");
|
|
3528
|
+
milliseconds *= factor ** attempts;
|
|
3529
|
+
if (jitter) {
|
|
3530
|
+
milliseconds *= 1 + Math.random();
|
|
3531
|
+
milliseconds = Math.round(milliseconds);
|
|
3532
|
+
}
|
|
3533
|
+
const delay = Temporal.Duration.from({ milliseconds });
|
|
3534
|
+
return Temporal.Duration.compare(delay, maxDelay) > 0 ? maxDelay : delay;
|
|
3535
|
+
};
|
|
3536
|
+
}
|
|
3537
|
+
//#endregion
|
|
3335
3538
|
//#region src/federation/webfinger.ts
|
|
3336
3539
|
const logger = (0, _logtape_logtape.getLogger)([
|
|
3337
3540
|
"fedify",
|
|
@@ -3528,6 +3731,7 @@ var middleware_exports = /* @__PURE__ */ require_chunk.__exportAll({
|
|
|
3528
3731
|
createFederation: () => createFederation
|
|
3529
3732
|
});
|
|
3530
3733
|
const circuitBreakerCasWarningKvStores = /* @__PURE__ */ new WeakSet();
|
|
3734
|
+
let nextQueueDepthGaugeSourceId = 0;
|
|
3531
3735
|
const retryAfterHttpDate = /* @__PURE__ */ new RegExp("^(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), \\d{2} (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \\d{4} \\d{2}:\\d{2}:\\d{2} GMT|(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), \\d{2}-(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-\\d{2} \\d{2}:\\d{2}:\\d{2} GMT|(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (?: \\d|\\d{2}) \\d{2}:\\d{2}:\\d{2} \\d{4})$");
|
|
3532
3736
|
function parseRetryAfter(headers, now = Temporal.Now.instant()) {
|
|
3533
3737
|
const value = headers.get("Retry-After");
|
|
@@ -3556,6 +3760,54 @@ function parseRetryAfterDuration(durationLike) {
|
|
|
3556
3760
|
function clampNegativeDelay(delay) {
|
|
3557
3761
|
return delay.sign < 0 ? Temporal.Duration.from({ seconds: 0 }) : delay;
|
|
3558
3762
|
}
|
|
3763
|
+
function getBenchmarkRelaxations(allowPrivateAddress, signatureTimeWindow) {
|
|
3764
|
+
const relaxations = [];
|
|
3765
|
+
if (allowPrivateAddress) relaxations.push({
|
|
3766
|
+
protection: "private_address_checks",
|
|
3767
|
+
effect: "disabled",
|
|
3768
|
+
effectiveValue: true
|
|
3769
|
+
});
|
|
3770
|
+
if (signatureTimeWindow === false) relaxations.push({
|
|
3771
|
+
protection: "http_signature_time_window",
|
|
3772
|
+
effect: "disabled",
|
|
3773
|
+
effectiveValue: false,
|
|
3774
|
+
secureDefaultSeconds: 3600
|
|
3775
|
+
});
|
|
3776
|
+
else try {
|
|
3777
|
+
const seconds = Temporal.Duration.from(signatureTimeWindow).total({ unit: "seconds" });
|
|
3778
|
+
if (seconds !== 3600) relaxations.push({
|
|
3779
|
+
protection: "http_signature_time_window",
|
|
3780
|
+
effect: "changed",
|
|
3781
|
+
effectiveSeconds: seconds,
|
|
3782
|
+
secureDefaultSeconds: 3600
|
|
3783
|
+
});
|
|
3784
|
+
} catch {}
|
|
3785
|
+
return relaxations;
|
|
3786
|
+
}
|
|
3787
|
+
function formatBenchmarkRelaxations(relaxations) {
|
|
3788
|
+
if (relaxations.length < 1) return "no benchmark-only protections relaxed";
|
|
3789
|
+
return relaxations.map((relaxation) => {
|
|
3790
|
+
switch (relaxation.protection) {
|
|
3791
|
+
case "private_address_checks": return "private address checks disabled (allowPrivateAddress=true)";
|
|
3792
|
+
case "http_signature_time_window":
|
|
3793
|
+
if (relaxation.effect === "disabled") return `HTTP Signature time window disabled (signatureTimeWindow=false)`;
|
|
3794
|
+
return `HTTP Signature time window set to ${relaxation.effectiveSeconds}s (secure default: ${relaxation.secureDefaultSeconds}s)`;
|
|
3795
|
+
}
|
|
3796
|
+
}).join("; ");
|
|
3797
|
+
}
|
|
3798
|
+
function getBenchmarkTriggerOptions(benchmarkOptions) {
|
|
3799
|
+
const sinks = benchmarkOptions.triggerSinks?.map((sink) => {
|
|
3800
|
+
try {
|
|
3801
|
+
return new URL(sink).href;
|
|
3802
|
+
} catch {
|
|
3803
|
+
throw new TypeError("benchmarkMode.triggerSinks must contain only URLs.");
|
|
3804
|
+
}
|
|
3805
|
+
});
|
|
3806
|
+
return {
|
|
3807
|
+
sinks: sinks == null ? void 0 : new Set(sinks),
|
|
3808
|
+
allowUnsafeRecipients: benchmarkOptions.allowUnsafeTriggerRecipients === true
|
|
3809
|
+
};
|
|
3810
|
+
}
|
|
3559
3811
|
function maxDelay(first, second) {
|
|
3560
3812
|
return Temporal.Duration.compare(first, second) >= 0 ? first : second;
|
|
3561
3813
|
}
|
|
@@ -3592,8 +3844,10 @@ function isPermanentInboxParseError(error) {
|
|
|
3592
3844
|
}
|
|
3593
3845
|
/**
|
|
3594
3846
|
* Create a new {@link Federation} instance.
|
|
3595
|
-
* @param
|
|
3847
|
+
* @param options Parameters for initializing the instance.
|
|
3596
3848
|
* @returns A new {@link Federation} instance.
|
|
3849
|
+
* @throws {TypeError} If benchmark mode and `meterProvider` are both
|
|
3850
|
+
* specified.
|
|
3597
3851
|
* @since 0.10.0
|
|
3598
3852
|
*/
|
|
3599
3853
|
function createFederation(options) {
|
|
@@ -3627,8 +3881,31 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
3627
3881
|
_meterProvider;
|
|
3628
3882
|
firstKnock;
|
|
3629
3883
|
inboxChallengePolicy;
|
|
3884
|
+
benchmarkMode;
|
|
3885
|
+
benchmarkMetricReader;
|
|
3886
|
+
benchmarkTriggerOptions;
|
|
3887
|
+
#queueDepthGaugeSourceId = `fedify-${(++nextQueueDepthGaugeSourceId).toString(36)}`;
|
|
3888
|
+
#queueDepthGaugeEntries = [];
|
|
3889
|
+
#queueDepthGaugeMeterProvider;
|
|
3630
3890
|
constructor(options) {
|
|
3631
3891
|
super();
|
|
3892
|
+
const benchmarkMode = options.benchmarkMode != null && options.benchmarkMode !== false;
|
|
3893
|
+
const benchmarkOptions = typeof options.benchmarkMode === "object" ? options.benchmarkMode : {};
|
|
3894
|
+
const hasCustomLoaderFactory = options.documentLoaderFactory != null || options.contextLoaderFactory != null;
|
|
3895
|
+
const allowPrivateAddress = options.allowPrivateAddress ?? (benchmarkMode && !hasCustomLoaderFactory ? true : false);
|
|
3896
|
+
const signatureTimeWindow = options.signatureTimeWindow ?? (benchmarkMode ? false : { hours: 1 });
|
|
3897
|
+
if (benchmarkMode && options.meterProvider != null) throw new TypeError("benchmarkMode requires Fedify to own the meterProvider; OpenTelemetry metric readers cannot be added after a MeterProvider is constructed.");
|
|
3898
|
+
if (benchmarkMode) {
|
|
3899
|
+
const relaxations = getBenchmarkRelaxations(allowPrivateAddress, signatureTimeWindow);
|
|
3900
|
+
const relaxationSummary = formatBenchmarkRelaxations(relaxations);
|
|
3901
|
+
(0, _logtape_logtape.getLogger)([
|
|
3902
|
+
"fedify",
|
|
3903
|
+
"federation",
|
|
3904
|
+
"benchmark"
|
|
3905
|
+
]).warn(`Fedify benchmarkMode is enabled; ${relaxationSummary}. Benchmark endpoints are active and must not be used in production.`, { relaxations });
|
|
3906
|
+
}
|
|
3907
|
+
this.benchmarkMode = benchmarkMode;
|
|
3908
|
+
this.benchmarkTriggerOptions = benchmarkMode ? getBenchmarkTriggerOptions(benchmarkOptions) : {};
|
|
3632
3909
|
this.kv = options.kv;
|
|
3633
3910
|
this.kvPrefixes = {
|
|
3634
3911
|
activityIdempotence: ["_fedify", "activityIdempotence"],
|
|
@@ -3696,13 +3973,13 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
3696
3973
|
}
|
|
3697
3974
|
this.router.trailingSlashInsensitive = options.trailingSlashInsensitive ?? false;
|
|
3698
3975
|
this._initializeRouter();
|
|
3699
|
-
if (options.allowPrivateAddress || options.userAgent != null) {
|
|
3976
|
+
if (options.allowPrivateAddress === true || options.userAgent != null) {
|
|
3700
3977
|
if (options.documentLoaderFactory != null) throw new TypeError("Cannot set documentLoaderFactory with allowPrivateAddress or userAgent options.");
|
|
3701
3978
|
if (options.contextLoaderFactory != null) throw new TypeError("Cannot set contextLoaderFactory with allowPrivateAddress or userAgent options.");
|
|
3702
3979
|
if (options.authenticatedDocumentLoaderFactory != null) throw new TypeError("Cannot set authenticatedDocumentLoaderFactory with allowPrivateAddress or userAgent options.");
|
|
3703
3980
|
}
|
|
3704
|
-
const {
|
|
3705
|
-
this.allowPrivateAddress = allowPrivateAddress
|
|
3981
|
+
const { userAgent } = options;
|
|
3982
|
+
this.allowPrivateAddress = allowPrivateAddress;
|
|
3706
3983
|
const userDocumentLoaderFactory = options.documentLoaderFactory;
|
|
3707
3984
|
const userContextLoaderFactory = options.contextLoaderFactory;
|
|
3708
3985
|
const userAuthFactory = options.authenticatedDocumentLoaderFactory;
|
|
@@ -3750,25 +4027,55 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
3750
4027
|
this.userAgent = userAgent;
|
|
3751
4028
|
this.onOutboxError = options.onOutboxError;
|
|
3752
4029
|
this.permanentFailureStatusCodes = options.permanentFailureStatusCodes ?? [404, 410];
|
|
3753
|
-
this.signatureTimeWindow =
|
|
4030
|
+
this.signatureTimeWindow = signatureTimeWindow;
|
|
3754
4031
|
this.skipSignatureVerification = options.skipSignatureVerification ?? false;
|
|
3755
4032
|
this.inboxChallengePolicy = options.inboxChallengePolicy;
|
|
3756
4033
|
this.outboxRetryPolicy = options.outboxRetryPolicy ?? createExponentialBackoffPolicy();
|
|
3757
4034
|
this.inboxRetryPolicy = options.inboxRetryPolicy ?? createExponentialBackoffPolicy();
|
|
3758
4035
|
this.activityTransformers = options.activityTransformers ?? require_transformers.getDefaultActivityTransformers();
|
|
3759
4036
|
this._tracerProvider = options.tracerProvider;
|
|
3760
|
-
|
|
4037
|
+
if (benchmarkMode) {
|
|
4038
|
+
const benchmarkMetrics = createBenchmarkMeterProvider();
|
|
4039
|
+
this._meterProvider = benchmarkMetrics.meterProvider;
|
|
4040
|
+
this.benchmarkMetricReader = benchmarkMetrics.reader;
|
|
4041
|
+
} else this._meterProvider = options.meterProvider;
|
|
4042
|
+
this.#queueDepthGaugeEntries = [
|
|
4043
|
+
{
|
|
4044
|
+
role: "inbox",
|
|
4045
|
+
queue: this.inboxQueue
|
|
4046
|
+
},
|
|
4047
|
+
{
|
|
4048
|
+
role: "outbox",
|
|
4049
|
+
queue: this.outboxQueue
|
|
4050
|
+
},
|
|
4051
|
+
{
|
|
4052
|
+
role: "fanout",
|
|
4053
|
+
queue: this.fanoutQueue
|
|
4054
|
+
}
|
|
4055
|
+
];
|
|
4056
|
+
this.#registerQueueDepthGauge(this._meterProvider ?? _opentelemetry_api.metrics.getMeterProvider());
|
|
3761
4057
|
this.firstKnock = options.firstKnock;
|
|
3762
4058
|
}
|
|
3763
4059
|
get tracerProvider() {
|
|
3764
4060
|
return this._tracerProvider ?? _opentelemetry_api.trace.getTracerProvider();
|
|
3765
4061
|
}
|
|
3766
4062
|
get meterProvider() {
|
|
3767
|
-
|
|
4063
|
+
const meterProvider = this._meterProvider ?? _opentelemetry_api.metrics.getMeterProvider();
|
|
4064
|
+
this.#registerQueueDepthGauge(meterProvider);
|
|
4065
|
+
return meterProvider;
|
|
4066
|
+
}
|
|
4067
|
+
#registerQueueDepthGauge(meterProvider) {
|
|
4068
|
+
if (meterProvider === this.#queueDepthGaugeMeterProvider) return;
|
|
4069
|
+
require_http.registerQueueDepthGauge(meterProvider, this.#queueDepthGaugeEntries, { sourceId: this.#queueDepthGaugeSourceId });
|
|
4070
|
+
this.#queueDepthGaugeMeterProvider = meterProvider;
|
|
3768
4071
|
}
|
|
3769
4072
|
_initializeRouter() {
|
|
3770
4073
|
this.router.add("/.well-known/webfinger", "webfinger");
|
|
3771
4074
|
this.router.add("/.well-known/nodeinfo", "nodeInfoJrd");
|
|
4075
|
+
if (this.benchmarkMode) {
|
|
4076
|
+
this.router.add("/.well-known/fedify/bench/stats", "benchmarkStats");
|
|
4077
|
+
this.router.add("/.well-known/fedify/bench/trigger", "benchmarkTrigger");
|
|
4078
|
+
}
|
|
3772
4079
|
}
|
|
3773
4080
|
_getTracer() {
|
|
3774
4081
|
return this.tracerProvider.getTracer(require_http.name, require_http.version);
|
|
@@ -4780,6 +5087,8 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
4780
5087
|
context,
|
|
4781
5088
|
nodeInfoDispatcher: this.nodeInfoDispatcher
|
|
4782
5089
|
});
|
|
5090
|
+
case "benchmarkStats": return await handleBenchmarkStats(request, this.benchmarkMetricReader);
|
|
5091
|
+
case "benchmarkTrigger": return await handleBenchmarkTrigger(request, context, this.benchmarkTriggerOptions);
|
|
4783
5092
|
}
|
|
4784
5093
|
if (request.method !== "POST" && !acceptsJsonLd(request)) {
|
|
4785
5094
|
metricState.endpoint = "not_acceptable";
|
|
@@ -5019,6 +5328,8 @@ function getEndpointCategory(routeName) {
|
|
|
5019
5328
|
case "liked": return "liked";
|
|
5020
5329
|
case "featured": return "featured";
|
|
5021
5330
|
case "featuredTags": return "featured_tags";
|
|
5331
|
+
case "benchmarkStats":
|
|
5332
|
+
case "benchmarkTrigger": return "benchmark";
|
|
5022
5333
|
default: return "not_found";
|
|
5023
5334
|
}
|
|
5024
5335
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { G as
|
|
2
|
+
import { G as ActorDispatcher, K as ActorHandleMapper, W as ActorAliasMapper, l as RequestContext, pt as WebFingerLinksDispatcher } from "./context-BBVLF7lx.cjs";
|
|
3
3
|
import { MeterProvider, Span, Tracer } from "@opentelemetry/api";
|
|
4
4
|
import { RouterError, RouterOptions, RouterRouteResult } from "@fedify/uri-template";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { G as
|
|
2
|
+
import { G as ActorDispatcher, K as ActorHandleMapper, W as ActorAliasMapper, l as RequestContext, pt as WebFingerLinksDispatcher } from "./context-BU6jSQdo.js";
|
|
3
3
|
import { RouterError, RouterOptions, RouterRouteResult } from "@fedify/uri-template";
|
|
4
4
|
import { MeterProvider, Span, Tracer } from "@opentelemetry/api";
|
|
5
5
|
|
package/dist/mod.cjs
CHANGED
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
4
4
|
require("./chunk-DDcVe30Y.cjs");
|
|
5
5
|
const require_transformers = require("./transformers-NeAONrAq.cjs");
|
|
6
6
|
require("./compat/mod.cjs");
|
|
7
|
-
const require_http = require("./http-
|
|
8
|
-
const require_middleware = require("./middleware-
|
|
9
|
-
const require_proof = require("./proof-
|
|
7
|
+
const require_http = require("./http-B1zlPuh3.cjs");
|
|
8
|
+
const require_middleware = require("./middleware-DlqW4IRW.cjs");
|
|
9
|
+
const require_proof = require("./proof-BKpJ_p_d.cjs");
|
|
10
10
|
const require_types = require("./types-KC4QAoxe.cjs");
|
|
11
|
-
const require_kv_cache = require("./kv-cache-
|
|
11
|
+
const require_kv_cache = require("./kv-cache-CPIfTWt5.cjs");
|
|
12
12
|
const require_federation_mod = require("./federation/mod.cjs");
|
|
13
13
|
require("./nodeinfo/mod.cjs");
|
|
14
14
|
require("./runtime/mod.cjs");
|
package/dist/mod.d.cts
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import { a as InboundService, c as OutboundService, d as Software, f as Usage, i as parseNodeInfo, l as Protocol, n as ParseNodeInfoOptions, o as JsonValue, p as nodeInfoToJson, r as getNodeInfo, s as NodeInfo, t as GetNodeInfoOptions, u as Services } from "./client-CAM_bQXx.cjs";
|
|
3
3
|
import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "./http-VyDTd4G3.cjs";
|
|
4
4
|
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-DEvZuyOE.cjs";
|
|
5
|
-
import { $ as
|
|
5
|
+
import { $ as CustomCollectionCursor, A as Rfc6570Expression, At as parseCircuitBreakerKvState, B as createFederationBuilder, C as FederationStartQueueOptions, Ct as CircuitBreakerFailurePolicy, D as InboxListenerSetters, Dt as CircuitBreakerStateChange, E as InboxChallengePolicy, Et as CircuitBreakerState, F as CreateExponentialBackoffPolicyOptions, G as ActorDispatcher, H as respondWithObject, I as RetryContext, J as AuthorizePredicate, K as ActorHandleMapper, L as RetryPolicy, M as FederationOrigin, N as FederationQueueOptions, O as ObjectCallbackSetters, Ot as NormalizedCircuitBreakerOptions, P as createFederation, Q as CustomCollectionCounter, R as createExponentialBackoffPolicy, S as FederationOptions, St as CircuitBreakerCreateOptions, T as IdempotencyStrategy, Tt as CircuitBreakerOptions, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as ActorAliasMapper, X as CollectionCursor, Y as CollectionCounter, Z as CollectionDispatcher, _ as Federatable, _t as buildCollectionSynchronizationHeader, a as GetSignedKeyOptions, at as ObjectDispatcher, b as FederationBuilder, bt as CircuitBreakerActivityDrop, c as ParseUriResult, ct as OutboxListenerErrorHandler, d as SendActivityOptions, dt as UnverifiedActivityHandler, et as CustomCollectionDispatcher, f as SendActivityOptionsForCollection, ft as UnverifiedActivityReason, g as CustomCollectionCallbackSetters, gt as PageItems, h as ConstructorWithTypeId, ht as SenderKeyPair, i as GetActorOptions, it as ObjectAuthorizePredicate, j as FederationKvPrefixes, jt as ActivityTransformer, k as OutboxListenerSetters, kt as normalizeCircuitBreakerOptions, l as RequestContext, lt as OutboxPermanentFailureHandler, m as CollectionCallbackSetters, mt as SendActivityError, n as Context, nt as InboxListener, o as InboxContext, ot as OutboxErrorHandler, p as ActorCallbackSetters, pt as WebFingerLinksDispatcher, q as ActorKeyPairsDispatcher, r as ForwardActivityOptions, rt as NodeInfoDispatcher, s as OutboxContext, st as OutboxListener, t as ActorKeyPair, tt as InboxErrorHandler, u as RouteActivityOptions, ut as SharedInboxKeyDispatcher, v as Federation, vt as digest, w as IdempotencyKeyCallback, wt as CircuitBreakerKvState, x as FederationFetchOptions, xt as CircuitBreakerBeforeSendDecision, y as FederationBenchmarkOptions, yt as CircuitBreaker, z as Message } from "./context-BBVLF7lx.cjs";
|
|
6
6
|
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-gJ8LYbxX.cjs";
|
|
7
7
|
import { a as MessageQueueEnqueueOptions, i as MessageQueueDepth, n as InProcessMessageQueueOptions, o as MessageQueueListenOptions, r as MessageQueue, s as ParallelMessageQueue, t as InProcessMessageQueue } from "./mq-D8uSFzxe.cjs";
|
|
8
8
|
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.cjs";
|
|
9
|
-
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-
|
|
9
|
+
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-C0F6kvgS.cjs";
|
|
10
10
|
import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "./mod-B0hW12_O.cjs";
|
|
11
11
|
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-yvIXFAEi.cjs";
|
|
12
12
|
export * from "@fedify/vocab-runtime";
|
|
13
13
|
|
|
14
14
|
//#region src/mod.d.ts
|
|
15
15
|
declare namespace mod_d_exports {
|
|
16
|
-
export { AcceptSignatureMember, AcceptSignatureParameters, ActivityTransformer, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CircuitBreaker, CircuitBreakerActivityDrop, CircuitBreakerBeforeSendDecision, CircuitBreakerCreateOptions, CircuitBreakerFailurePolicy, CircuitBreakerKvState, CircuitBreakerOptions, CircuitBreakerState, CircuitBreakerStateChange, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CreateProofOptions, CreateSignatureOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, DoesActorOwnKeyOptions, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, ForwardActivityOptions, FulfillAcceptSignatureResult, GetActorOptions, GetKeyOwnerOptions, GetNodeInfoOptions, GetSignedKeyOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboundService, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, JsonValue, KeyCache, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfo, NodeInfoDispatcher, NormalizedCircuitBreakerOptions, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboundService, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseNodeInfoOptions, ParseUriResult, Protocol, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, Rfc9421SignRequestOptions, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, Services, SharedInboxKeyDispatcher, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, Software, UnverifiedActivityHandler, UnverifiedActivityReason, Usage, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifyRequestDetailedResult, VerifyRequestFailureReason, VerifyRequestOptions, VerifySignatureOptions, WebFingerHandlerParameters, WebFingerLinksDispatcher, actorDehydrator, attachSignature, autoIdAssigner, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, createProof, createSignature, detachSignature, digest, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getAuthenticatedDocumentLoader, getDefaultActivityTransformers, getKeyOwner, getNodeInfo, handleWebFinger, hasProofLike, hasSignatureLike, importJwk, kvCache, nodeInfoToJson, normalizeCircuitBreakerOptions, parseAcceptSignature, parseCircuitBreakerKvState, parseNodeInfo, respondWithObject, respondWithObjectIfAcceptable, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
|
|
16
|
+
export { AcceptSignatureMember, AcceptSignatureParameters, ActivityTransformer, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CircuitBreaker, CircuitBreakerActivityDrop, CircuitBreakerBeforeSendDecision, CircuitBreakerCreateOptions, CircuitBreakerFailurePolicy, CircuitBreakerKvState, CircuitBreakerOptions, CircuitBreakerState, CircuitBreakerStateChange, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CreateProofOptions, CreateSignatureOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, DoesActorOwnKeyOptions, Federatable, Federation, FederationBenchmarkOptions, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, ForwardActivityOptions, FulfillAcceptSignatureResult, GetActorOptions, GetKeyOwnerOptions, GetNodeInfoOptions, GetSignedKeyOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboundService, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, JsonValue, KeyCache, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfo, NodeInfoDispatcher, NormalizedCircuitBreakerOptions, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboundService, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseNodeInfoOptions, ParseUriResult, Protocol, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, Rfc9421SignRequestOptions, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, Services, SharedInboxKeyDispatcher, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, Software, UnverifiedActivityHandler, UnverifiedActivityReason, Usage, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifyRequestDetailedResult, VerifyRequestFailureReason, VerifyRequestOptions, VerifySignatureOptions, WebFingerHandlerParameters, WebFingerLinksDispatcher, actorDehydrator, attachSignature, autoIdAssigner, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, createProof, createSignature, detachSignature, digest, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getAuthenticatedDocumentLoader, getDefaultActivityTransformers, getKeyOwner, getNodeInfo, handleWebFinger, hasProofLike, hasSignatureLike, importJwk, kvCache, nodeInfoToJson, normalizeCircuitBreakerOptions, parseAcceptSignature, parseCircuitBreakerKvState, parseNodeInfo, respondWithObject, respondWithObjectIfAcceptable, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
|
|
17
17
|
}
|
|
18
18
|
//#endregion
|
|
19
|
-
export { AcceptSignatureMember, AcceptSignatureParameters, ActivityTransformer, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CircuitBreaker, CircuitBreakerActivityDrop, CircuitBreakerBeforeSendDecision, CircuitBreakerCreateOptions, CircuitBreakerFailurePolicy, CircuitBreakerKvState, CircuitBreakerOptions, CircuitBreakerState, CircuitBreakerStateChange, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CreateProofOptions, CreateSignatureOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, DoesActorOwnKeyOptions, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, ForwardActivityOptions, FulfillAcceptSignatureResult, GetActorOptions, GetKeyOwnerOptions, GetNodeInfoOptions, GetSignedKeyOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboundService, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, JsonValue, KeyCache, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfo, NodeInfoDispatcher, NormalizedCircuitBreakerOptions, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboundService, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseNodeInfoOptions, ParseUriResult, Protocol, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, Rfc9421SignRequestOptions, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, Services, SharedInboxKeyDispatcher, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, Software, UnverifiedActivityHandler, UnverifiedActivityReason, Usage, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifyRequestDetailedResult, VerifyRequestFailureReason, VerifyRequestOptions, VerifySignatureOptions, WebFingerHandlerParameters, WebFingerLinksDispatcher, actorDehydrator, attachSignature, autoIdAssigner, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, createProof, createSignature, detachSignature, digest, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getAuthenticatedDocumentLoader, getDefaultActivityTransformers, getKeyOwner, getNodeInfo, handleWebFinger, hasProofLike, hasSignatureLike, importJwk, kvCache, nodeInfoToJson, normalizeCircuitBreakerOptions, parseAcceptSignature, parseCircuitBreakerKvState, parseNodeInfo, respondWithObject, respondWithObjectIfAcceptable, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
|
|
19
|
+
export { AcceptSignatureMember, AcceptSignatureParameters, ActivityTransformer, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CircuitBreaker, CircuitBreakerActivityDrop, CircuitBreakerBeforeSendDecision, CircuitBreakerCreateOptions, CircuitBreakerFailurePolicy, CircuitBreakerKvState, CircuitBreakerOptions, CircuitBreakerState, CircuitBreakerStateChange, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CreateProofOptions, CreateSignatureOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, DoesActorOwnKeyOptions, Federatable, Federation, FederationBenchmarkOptions, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, ForwardActivityOptions, FulfillAcceptSignatureResult, GetActorOptions, GetKeyOwnerOptions, GetNodeInfoOptions, GetSignedKeyOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboundService, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, JsonValue, KeyCache, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfo, NodeInfoDispatcher, NormalizedCircuitBreakerOptions, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboundService, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseNodeInfoOptions, ParseUriResult, Protocol, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, Rfc9421SignRequestOptions, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, Services, SharedInboxKeyDispatcher, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, Software, UnverifiedActivityHandler, UnverifiedActivityReason, Usage, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifyRequestDetailedResult, VerifyRequestFailureReason, VerifyRequestOptions, VerifySignatureOptions, WebFingerHandlerParameters, WebFingerLinksDispatcher, actorDehydrator, attachSignature, autoIdAssigner, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, createProof, createSignature, detachSignature, digest, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getAuthenticatedDocumentLoader, getDefaultActivityTransformers, getKeyOwner, getNodeInfo, handleWebFinger, hasProofLike, hasSignatureLike, importJwk, kvCache, nodeInfoToJson, normalizeCircuitBreakerOptions, parseAcceptSignature, parseCircuitBreakerKvState, parseNodeInfo, respondWithObject, respondWithObjectIfAcceptable, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
|