@fedify/fedify 1.7.13 → 1.7.15
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/{actor-CPpvuBKU.d.ts → actor.d.ts} +3 -3
- package/dist/{actor-BVilnhZ3.js → actor.js} +6 -6
- package/dist/{assert-LOEeCUK5.js → assert.js} +2 -2
- package/dist/{assert_equals-B44MxcIj.js → assert_equals.js} +16 -16
- package/dist/{assert_instance_of-XtuFevV_.js → assert_instance_of.js} +2 -2
- package/dist/{assert_is_error-BTlryvT0.js → assert_is_error.js} +2 -2
- package/dist/{assert_not_equals-C685gKx6.js → assert_not_equals.js} +3 -6
- package/dist/{assert_rejects-DWQ4jaf9.js → assert_rejects.js} +3 -3
- package/dist/{assert_throws-YetpVSc-.js → assert_throws.js} +3 -3
- package/dist/{authdocloader-DqCINL6u.js → authdocloader.js} +8 -8
- package/dist/{builder-CKUAOfcL.js → builder.js} +7 -7
- package/dist/{chunk-Cx8LTkjm.js → chunk.js} +22 -15
- package/dist/{client-DvtwXO7t.d.ts → client.d.ts} +2 -2
- package/dist/{client-C5xUY491.js → client.js} +3 -3
- package/dist/{collection-Dfb0TPno.js → collection.js} +2 -3
- package/dist/compat/mod.d.ts +79 -12
- package/dist/compat/mod.js +1 -2
- package/dist/compat/transformers.test.js +34 -38
- package/dist/{context-OBWjptjU.d.ts → context.d.ts} +11 -11
- package/dist/{context-aglzx1Ww.js → context.js} +5 -5
- package/dist/{docloader-Q42SMRIB.d.ts → docloader.d.ts} +2 -2
- package/dist/{docloader-Qfs9nPiy.js → docloader.js} +32 -152
- package/dist/{docloader-09nVWLAZ.js → docloader2.js} +1 -1
- package/dist/{esm-DO9PrujO.js → esm.js} +36 -22
- package/dist/federation/builder.test.js +20 -26
- package/dist/federation/collection.test.js +11 -16
- package/dist/federation/handler.test.js +41 -48
- package/dist/federation/inbox.test.js +11 -11
- package/dist/federation/keycache.test.js +12 -11
- package/dist/federation/kv.test.js +8 -10
- package/dist/federation/middleware.test.js +105 -134
- package/dist/federation/mod.d.ts +4 -13
- package/dist/federation/mod.js +206 -12
- package/dist/federation/mq.test.js +12 -17
- package/dist/federation/retry.test.js +5 -4
- package/dist/federation/router.test.js +9 -10
- package/dist/federation/send.test.js +23 -24
- package/dist/{http-DMTrO3Ye.d.ts → http.d.ts} +3 -3
- package/dist/{http-CjDwMreH.js → http.js} +25 -31
- package/dist/{inbox-ApPO50Ma.js → inbox.js} +5 -5
- package/dist/key.js +16 -0
- package/dist/{key-BPUM0v_S.js → key2.js} +5 -5
- package/dist/{keycache-B7Urghlu.js → keycache.js} +2 -2
- package/dist/{keys-DGJec4-R.js → keys.js} +2 -2
- package/dist/{kv-DRaeSXco.d.ts → kv.d.ts} +1 -1
- package/dist/{kv-BMY6Qf_A.js → kv.js} +1 -1
- package/dist/{langstr-DbWheeIS.js → langstr.js} +1 -1
- package/dist/{ld-DJTavNY3.js → ld.js} +9 -12
- package/dist/{lookup-Bf-K85bV.d.ts → lookup.d.ts} +2 -2
- package/dist/{lookup-CkOdKyYR.js → lookup.js} +4 -4
- package/dist/{lookup-CnkkF4Rf.js → lookup2.js} +6 -6
- package/dist/{middleware-BxHcZC4p.js → middleware.js} +35 -39
- package/dist/middleware2.js +32 -0
- package/dist/mod.d.ts +17 -17
- package/dist/mod.js +17 -17
- package/dist/{mod-CDzlVCUF.d.ts → mod2.d.ts} +3 -3
- package/dist/{mod-CCL2cvnI.d.ts → mod3.d.ts} +4 -4
- package/dist/{mq-DYKDDJmp.d.ts → mq.d.ts} +1 -1
- package/dist/{multibase-CnLHszip.js → multibase.js} +1 -1
- package/dist/nodeinfo/client.test.js +19 -28
- package/dist/nodeinfo/handler.test.js +37 -44
- package/dist/nodeinfo/mod.d.ts +2 -5
- package/dist/nodeinfo/mod.js +2 -3
- package/dist/nodeinfo/semver.test.js +13 -21
- package/dist/nodeinfo/types.test.js +9 -11
- package/dist/{owner-D0cOz8R5.d.ts → owner.d.ts} +4 -4
- package/dist/{owner-qKULzrkx.js → owner.js} +4 -4
- package/dist/{proof-d5P09-xk.js → proof.js} +11 -13
- package/dist/{retry-BiIhZWgD.js → retry.js} +1 -1
- package/dist/{router-D_aVZZUc.js → router.js} +1 -1
- package/dist/runtime/authdocloader.test.js +22 -26
- package/dist/runtime/docloader.test.js +56 -56
- package/dist/runtime/key.test.js +31 -53
- package/dist/runtime/langstr.test.js +8 -10
- package/dist/runtime/mod.d.ts +103 -6
- package/dist/runtime/mod.js +6 -7
- package/dist/runtime/multibase/multibase.test.js +12 -18
- package/dist/runtime/url.test.js +7 -6
- package/dist/{semver-BNrOOAs9.js → semver.js} +7 -17
- package/dist/{send-BnMY3Qxa.js → send.js} +4 -4
- package/dist/sig/http.test.js +104 -168
- package/dist/sig/key.test.js +17 -20
- package/dist/sig/ld.test.js +28 -35
- package/dist/sig/mod.d.ts +3 -7
- package/dist/sig/mod.js +6 -7
- package/dist/sig/owner.test.js +24 -30
- package/dist/sig/proof.test.js +24 -29
- package/dist/{std__assert-o_r9vqm1.js → std__assert.js} +7 -13
- package/dist/testing/docloader.test.js +9 -12
- package/dist/testing/mod.js +2 -1
- package/dist/{testing-DLyvtiiW.js → testing.js} +2 -2
- package/dist/{transformers-ghwJuzGY.js → transformers.js} +1 -1
- package/dist/{type-CFuiGLz9.js → type.js} +1 -1
- package/dist/{types-CJHS5pXl.js → types.js} +2 -2
- package/dist/{url-C2xuoQD1.js → url.js} +1 -1
- package/dist/vocab/actor.test.js +76 -128
- package/dist/vocab/lookup.test.js +19 -23
- package/dist/vocab/mod.d.ts +3 -5
- package/dist/vocab/mod.js +4 -4
- package/dist/vocab/type.test.js +10 -10
- package/dist/vocab/vocab.test.js +90 -109
- package/dist/{vocab-CzEfWQk2.d.ts → vocab.d.ts} +2 -2
- package/dist/{vocab-S7fEn6XO.js → vocab.js} +318 -454
- package/dist/webfinger/handler.test.js +40 -48
- package/dist/webfinger/lookup.test.js +12 -15
- package/dist/webfinger/mod.d.ts +1 -4
- package/dist/webfinger/mod.js +2 -3
- package/dist/x/cfworkers.d.ts +2 -2
- package/dist/x/cfworkers.test.js +7 -9
- package/dist/x/hono.d.ts +2 -11
- package/dist/x/sveltekit.d.ts +2 -11
- package/package.json +1 -1
- package/dist/actor-CsmPeeHG.js +0 -34925
- package/dist/authdocloader-9g6RkEcR.js +0 -53
- package/dist/compat-Bb5myD13.js +0 -4
- package/dist/docloader-CchlnLWb.js +0 -4598
- package/dist/federation-B0aljx0V.js +0 -203
- package/dist/http-CP3h1SLi.js +0 -796
- package/dist/key--l6NVKdl.js +0 -257
- package/dist/key-1Fv7reaM.js +0 -16
- package/dist/key-DD37RpoD.js +0 -10
- package/dist/lookup-CN-LpF5e.js +0 -127
- package/dist/middleware-BQHe0X6Y.js +0 -17
- package/dist/middleware-C3TZ3P-v.js +0 -33
- package/dist/middleware-CEpilAEY.js +0 -3524
- package/dist/mod-1pDWKvUL.d.ts +0 -2
- package/dist/mod-DFncUgcE.d.ts +0 -82
- package/dist/mod-GIh5OYxW.d.ts +0 -2
- package/dist/mod-g0xFzAP9.d.ts +0 -2
- package/dist/mod-qFMzZ3iF.d.ts +0 -104
- package/dist/nodeinfo-CyEbLjHs.js +0 -4
- package/dist/proof-BfeWBNrY.js +0 -582
- package/dist/runtime-BSkOVUWM.js +0 -4
- package/dist/sig-BXJO--F9.js +0 -4
- package/dist/types-BZUzjGS0.js +0 -455
- package/dist/vocab-C_pE4SvE.js +0 -168
- package/dist/webfinger-C3GIyXIg.js +0 -4
- /package/dist/{denokv-CvROlGYX.js → denokv.js} +0 -0
|
@@ -3,26 +3,26 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import { getNodeInfo } from "./client
|
|
8
|
-
import { RouterError } from "./router
|
|
9
|
-
import { nodeInfoToJson } from "./types
|
|
10
|
-
import {
|
|
11
|
-
import { lookupWebFinger } from "./lookup
|
|
12
|
-
import { getTypeId } from "./type
|
|
13
|
-
import {
|
|
14
|
-
import { verifyRequest } from "./http
|
|
15
|
-
import { getAuthenticatedDocumentLoader } from "./authdocloader
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { signObject, verifyObject } from "./proof
|
|
19
|
-
import {
|
|
20
|
-
import { routeActivity } from "./inbox
|
|
21
|
-
import { FederationBuilderImpl } from "./builder
|
|
22
|
-
import { buildCollectionSynchronizationHeader } from "./collection
|
|
23
|
-
import { KvKeyCache } from "./keycache
|
|
24
|
-
import { createExponentialBackoffPolicy } from "./retry
|
|
25
|
-
import {
|
|
6
|
+
import { d as version, i as getDocumentLoader, s as kvCache, u as name } from "./docloader.js";
|
|
7
|
+
import { t as getNodeInfo } from "./client.js";
|
|
8
|
+
import { n as RouterError } from "./router.js";
|
|
9
|
+
import { t as nodeInfoToJson } from "./types.js";
|
|
10
|
+
import { _ as Object$1, b as OrderedCollectionPage, h as Multikey, m as Link, o as CryptographicKey, t as Activity, y as OrderedCollection } from "./vocab.js";
|
|
11
|
+
import { t as lookupWebFinger } from "./lookup.js";
|
|
12
|
+
import { t as getTypeId } from "./type.js";
|
|
13
|
+
import { a as validateCryptoKey, i as importJwk, t as exportJwk } from "./key2.js";
|
|
14
|
+
import { l as verifyRequest } from "./http.js";
|
|
15
|
+
import { t as getAuthenticatedDocumentLoader } from "./authdocloader.js";
|
|
16
|
+
import { a as signJsonLd, i as hasSignature, o as verifyJsonLd, r as detachSignature } from "./ld.js";
|
|
17
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner.js";
|
|
18
|
+
import { n as signObject, r as verifyObject } from "./proof.js";
|
|
19
|
+
import { n as traverseCollection, t as lookupObject } from "./lookup2.js";
|
|
20
|
+
import { n as routeActivity } from "./inbox.js";
|
|
21
|
+
import { t as FederationBuilderImpl } from "./builder.js";
|
|
22
|
+
import { t as buildCollectionSynchronizationHeader } from "./collection.js";
|
|
23
|
+
import { t as KvKeyCache } from "./keycache.js";
|
|
24
|
+
import { t as createExponentialBackoffPolicy } from "./retry.js";
|
|
25
|
+
import { n as sendActivity, t as extractInboxes } from "./send.js";
|
|
26
26
|
import { getLogger, withContext } from "@logtape/logtape";
|
|
27
27
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
|
28
28
|
import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_HEADER, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
|
|
@@ -129,8 +129,7 @@ function getDefaultActivityTransformers() {
|
|
|
129
129
|
*/
|
|
130
130
|
async function handleNodeInfo(_request, { context: context$1, nodeInfoDispatcher }) {
|
|
131
131
|
const promise = nodeInfoDispatcher(context$1);
|
|
132
|
-
const
|
|
133
|
-
const json = nodeInfoToJson(nodeInfo);
|
|
132
|
+
const json = nodeInfoToJson(promise instanceof Promise ? await promise : promise);
|
|
134
133
|
return new Response(JSON.stringify(json), { headers: { "Content-Type": "application/json; profile=\"http://nodeinfo.diaspora.software/ns/schema/2.1#\"" } });
|
|
135
134
|
}
|
|
136
135
|
/**
|
|
@@ -439,10 +438,10 @@ async function handleObject(request, { values, context: context$1, objectDispatc
|
|
|
439
438
|
Vary: "Accept"
|
|
440
439
|
} });
|
|
441
440
|
}
|
|
442
|
-
async function handleCollection(request, { name, identifier, uriGetter, filter, filterPredicate, context: context$1, collectionCallbacks, tracerProvider, onUnauthorized, onNotFound, onNotAcceptable }) {
|
|
443
|
-
const spanName = name.trim().replace(/\s+/g, "_");
|
|
441
|
+
async function handleCollection(request, { name: name$1, identifier, uriGetter, filter, filterPredicate, context: context$1, collectionCallbacks, tracerProvider, onUnauthorized, onNotFound, onNotAcceptable }) {
|
|
442
|
+
const spanName = name$1.trim().replace(/\s+/g, "_");
|
|
444
443
|
tracerProvider = tracerProvider ?? trace.getTracerProvider();
|
|
445
|
-
const tracer = tracerProvider.getTracer(
|
|
444
|
+
const tracer = tracerProvider.getTracer(name, version);
|
|
446
445
|
const cursor = new URL(request.url).searchParams.get("cursor");
|
|
447
446
|
if (collectionCallbacks == null) return await onNotFound(request);
|
|
448
447
|
let collection;
|
|
@@ -482,7 +481,7 @@ async function handleCollection(request, { name, identifier, uriGetter, filter,
|
|
|
482
481
|
collection = new OrderedCollection({
|
|
483
482
|
id: baseUri,
|
|
484
483
|
totalItems: totalItems == null ? null : Number(totalItems),
|
|
485
|
-
items: filterCollectionItems(itemsOrResponse, name, filterPredicate)
|
|
484
|
+
items: filterCollectionItems(itemsOrResponse, name$1, filterPredicate)
|
|
486
485
|
});
|
|
487
486
|
} else {
|
|
488
487
|
const lastCursor = await collectionCallbacks.lastCursor?.(context$1, identifier);
|
|
@@ -503,7 +502,7 @@ async function handleCollection(request, { name, identifier, uriGetter, filter,
|
|
|
503
502
|
} else {
|
|
504
503
|
const uri = new URL(baseUri);
|
|
505
504
|
uri.searchParams.set("cursor", cursor);
|
|
506
|
-
const pageOrResponse = await tracer.startActiveSpan(`activitypub.dispatch_collection_page ${name}`, {
|
|
505
|
+
const pageOrResponse = await tracer.startActiveSpan(`activitypub.dispatch_collection_page ${name$1}`, {
|
|
507
506
|
kind: SpanKind.SERVER,
|
|
508
507
|
attributes: {
|
|
509
508
|
"activitypub.collection.id": uri.href,
|
|
@@ -547,7 +546,7 @@ async function handleCollection(request, { name, identifier, uriGetter, filter,
|
|
|
547
546
|
id: uri,
|
|
548
547
|
prev,
|
|
549
548
|
next,
|
|
550
|
-
items: filterCollectionItems(items, name, filterPredicate),
|
|
549
|
+
items: filterCollectionItems(items, name$1, filterPredicate),
|
|
551
550
|
partOf
|
|
552
551
|
});
|
|
553
552
|
}
|
|
@@ -603,7 +602,7 @@ function filterCollectionItems(items, collectionName, filterPredicate) {
|
|
|
603
602
|
return result;
|
|
604
603
|
}
|
|
605
604
|
async function handleInbox(request, options) {
|
|
606
|
-
return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(
|
|
605
|
+
return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(name, version).startActiveSpan("activitypub.inbox", {
|
|
607
606
|
kind: options.queue == null ? SpanKind.SERVER : SpanKind.PRODUCER,
|
|
608
607
|
attributes: { "activitypub.shared_inbox": options.recipient == null }
|
|
609
608
|
}, async (span) => {
|
|
@@ -1006,7 +1005,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
1006
1005
|
this.router.add("/.well-known/nodeinfo", "nodeInfoJrd");
|
|
1007
1006
|
}
|
|
1008
1007
|
_getTracer() {
|
|
1009
|
-
return this.tracerProvider.getTracer(
|
|
1008
|
+
return this.tracerProvider.getTracer(name, version);
|
|
1010
1009
|
}
|
|
1011
1010
|
async _startQueueInternal(ctxData, signal, queue) {
|
|
1012
1011
|
if (this.inboxQueue == null && this.outboxQueue == null) return;
|
|
@@ -1497,8 +1496,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
1497
1496
|
}
|
|
1498
1497
|
}
|
|
1499
1498
|
fetch(request, options) {
|
|
1500
|
-
|
|
1501
|
-
return withContext({ requestId }, async () => {
|
|
1499
|
+
return withContext({ requestId: getRequestId(request) }, async () => {
|
|
1502
1500
|
const tracer = this._getTracer();
|
|
1503
1501
|
return await tracer.startActiveSpan(request.method, {
|
|
1504
1502
|
kind: SpanKind.SERVER,
|
|
@@ -2100,7 +2098,7 @@ var ContextImpl = class ContextImpl {
|
|
|
2100
2098
|
});
|
|
2101
2099
|
}
|
|
2102
2100
|
sendActivity(sender, recipients, activity, options = {}) {
|
|
2103
|
-
return this.tracerProvider.getTracer(
|
|
2101
|
+
return this.tracerProvider.getTracer(name, version).startActiveSpan(this.federation.outboxQueue == null || options.immediate ? "activitypub.outbox" : "activitypub.fanout", {
|
|
2104
2102
|
kind: this.federation.outboxQueue == null || options.immediate ? SpanKind.CLIENT : SpanKind.PRODUCER,
|
|
2105
2103
|
attributes: {
|
|
2106
2104
|
"activitypub.activity.type": getTypeId(activity).href,
|
|
@@ -2245,7 +2243,7 @@ var ContextImpl = class ContextImpl {
|
|
|
2245
2243
|
}
|
|
2246
2244
|
}
|
|
2247
2245
|
routeActivity(recipient, activity, options = {}) {
|
|
2248
|
-
return (this.tracerProvider ?? this.tracerProvider).getTracer(
|
|
2246
|
+
return (this.tracerProvider ?? this.tracerProvider).getTracer(name, version).startActiveSpan("activitypub.inbox", {
|
|
2249
2247
|
kind: this.federation.inboxQueue == null || options.immediate ? SpanKind.INTERNAL : SpanKind.PRODUCER,
|
|
2250
2248
|
attributes: { "activitypub.activity.type": getTypeId(activity).href }
|
|
2251
2249
|
}, async (span) => {
|
|
@@ -2460,7 +2458,7 @@ var InboxContextImpl = class InboxContextImpl extends ContextImpl {
|
|
|
2460
2458
|
});
|
|
2461
2459
|
}
|
|
2462
2460
|
forwardActivity(forwarder, recipients, options) {
|
|
2463
|
-
return this.tracerProvider.getTracer(
|
|
2461
|
+
return this.tracerProvider.getTracer(name, version).startActiveSpan("activitypub.outbox", {
|
|
2464
2462
|
kind: this.federation.outboxQueue == null || options?.immediate ? SpanKind.CLIENT : SpanKind.PRODUCER,
|
|
2465
2463
|
attributes: { "activitypub.activity.type": this.activityType }
|
|
2466
2464
|
}, async (span) => {
|
|
@@ -2656,10 +2654,8 @@ function unauthorized(_request) {
|
|
|
2656
2654
|
function getRequestId(request) {
|
|
2657
2655
|
const traceId = request.headers.get("X-Request-Id") || request.headers.get("X-Correlation-Id") || request.headers.get("Traceparent")?.split("-")[1];
|
|
2658
2656
|
if (traceId != null) return traceId;
|
|
2659
|
-
|
|
2660
|
-
const random = Math.random().toString(36).slice(2, 8);
|
|
2661
|
-
return `req_${timestamp}${random}`;
|
|
2657
|
+
return `req_${Date.now().toString(36)}${Math.random().toString(36).slice(2, 8)}`;
|
|
2662
2658
|
}
|
|
2663
2659
|
|
|
2664
2660
|
//#endregion
|
|
2665
|
-
export {
|
|
2661
|
+
export { autoIdAssigner as _, createFederation as a, handleCollection as c, respondWithObject as d, respondWithObjectIfAcceptable as f, actorDehydrator as g, handleNodeInfoJrd as h, KvSpecDeterminer as i, handleInbox as l, handleNodeInfo as m, FederationImpl as n, acceptsJsonLd as o, handleWebFinger as p, InboxContextImpl as r, handleActor as s, ContextImpl as t, handleObject as u };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
4
|
+
globalThis.addEventListener = () => {};
|
|
5
|
+
|
|
6
|
+
import "./chunk.js";
|
|
7
|
+
import { a as createFederation, i as KvSpecDeterminer, n as FederationImpl, r as InboxContextImpl, t as ContextImpl } from "./middleware.js";
|
|
8
|
+
import "./docloader.js";
|
|
9
|
+
import "./url.js";
|
|
10
|
+
import "./semver.js";
|
|
11
|
+
import "./client.js";
|
|
12
|
+
import "./router.js";
|
|
13
|
+
import "./types.js";
|
|
14
|
+
import "./multibase.js";
|
|
15
|
+
import "./vocab.js";
|
|
16
|
+
import "./langstr.js";
|
|
17
|
+
import "./lookup.js";
|
|
18
|
+
import "./actor.js";
|
|
19
|
+
import "./key2.js";
|
|
20
|
+
import "./http.js";
|
|
21
|
+
import "./authdocloader.js";
|
|
22
|
+
import "./ld.js";
|
|
23
|
+
import "./owner.js";
|
|
24
|
+
import "./proof.js";
|
|
25
|
+
import "./lookup2.js";
|
|
26
|
+
import "./inbox.js";
|
|
27
|
+
import "./builder.js";
|
|
28
|
+
import "./collection.js";
|
|
29
|
+
import "./keycache.js";
|
|
30
|
+
import "./send.js";
|
|
31
|
+
|
|
32
|
+
export { FederationImpl };
|
package/dist/mod.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { ResourceDescriptor, lookupWebFinger } from "./lookup
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./mod
|
|
15
|
-
import "./mod
|
|
16
|
-
import "./mod
|
|
17
|
-
import { GetAuthenticatedDocumentLoaderOptions, exportMultibaseKey, exportSpki, getAuthenticatedDocumentLoader, importMultibaseKey, importPem, importPkcs1, importSpki } from "./mod
|
|
18
|
-
import {
|
|
19
|
-
import "./mod
|
|
3
|
+
import { i as MemoryKvStore, n as KvStore, r as KvStoreSetOptions, t as KvKey } from "./kv.js";
|
|
4
|
+
import { a as FetchError, c as KvCacheParameters, d as getDocumentLoader, f as getUserAgent, i as DocumentLoaderFactoryOptions, l as RemoteDocument, n as DocumentLoader, o as GetDocumentLoaderOptions, p as kvCache, r as DocumentLoaderFactory, s as GetUserAgentOptions, t as AuthenticatedDocumentLoaderFactory, u as fetchDocumentLoader } from "./docloader.js";
|
|
5
|
+
import { a as InboundService, c as OutboundService, d as Software, f as Usage, g as parseSemVer, h as formatSemVer, i as parseNodeInfo, l as Protocol, m as SemVer, n as ParseNodeInfoOptions, o as JsonValue, p as nodeInfoToJson, r as getNodeInfo, s as NodeInfo, t as GetNodeInfoOptions, u as Services } from "./client.js";
|
|
6
|
+
import { $ as Read, A as Image, B as Multikey, C as Event, D as Group, E as Follow, F as Like, G as OrderedCollectionPage, H as Object$1, I as Link, J as Person, K as Organization, L as Listen, M as Invite, N as Join, O as Hashtag, P as Leave, Q as Question, R as Mention, S as Endpoints, T as Flag, U as Offer, V as Note, W as OrderedCollection, X as Profile, Y as Place, Z as PropertyValue, _ as DidService, a as Application, at as TentativeAccept, b as Emoji, c as Audio, ct as Travel, d as Collection, dt as Video, et as Reject, f as CollectionPage, ft as View, g as Delete, h as DataIntegrityProof, i as Announce, it as Source, j as IntransitiveActivity, k as Ignore, l as Block, lt as Undo, m as CryptographicKey, n as Activity, nt as Remove, o as Arrive, ot as TentativeReject, p as Create, pt as LanguageString, q as Page, r as Add, rt as Service, s as Article, st as Tombstone, t as Accept, tt as Relationship, u as ChatMessage, ut as Update, v as Dislike, w as Export, x as EmojiReact, y as Document, z as Move } from "./vocab.js";
|
|
7
|
+
import { a as Recipient, c as getActorTypeName, i as NormalizeActorHandleOptions, l as isActor, n as ActorTypeName, o as getActorClassByTypeName, r as GetActorHandleOptions, s as getActorHandle, t as Actor, u as normalizeActorHandle } from "./actor.js";
|
|
8
|
+
import { a as signRequest, c as FetchKeyResult, d as fetchKey, f as generateCryptoKeyPair, i as VerifyRequestOptions, l as KeyCache, n as HttpMessageSignaturesSpecDeterminer, o as verifyRequest, p as importJwk, r as SignRequestOptions, s as FetchKeyOptions, t as HttpMessageSignaturesSpec, u as exportJwk } from "./http.js";
|
|
9
|
+
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner.js";
|
|
10
|
+
import { a as lookupObject, i as TraverseCollectionOptions, n as PUBLIC_COLLECTION, o as traverseCollection, r as LookupObjectOptions, t as getTypeId } from "./mod2.js";
|
|
11
|
+
import { i as ResourceDescriptor, n as lookupWebFinger } from "./lookup.js";
|
|
12
|
+
import { $ as SharedInboxKeyDispatcher, A as Message, B as ActorDispatcher, C as FederationOrigin, D as RetryContext, E as CreateExponentialBackoffPolicyOptions, F as RouterRouteResult, G as CollectionCursor, H as ActorKeyPairsDispatcher, I as RespondWithObjectOptions, J as InboxListener, K as CollectionDispatcher, L as respondWithObject, M as Router, N as RouterError, O as RetryPolicy, P as RouterOptions, Q as OutboxErrorHandler, R as respondWithObjectIfAcceptable, S as FederationKvPrefixes, T as createFederation, U as AuthorizePredicate, V as ActorHandleMapper, W as CollectionCounter, X as ObjectAuthorizePredicate, Y as NodeInfoDispatcher, Z as ObjectDispatcher, _ as FederationOptions, a as InboxContext, b as ObjectCallbackSetters, c as RouteActivityOptions, d as ActorCallbackSetters, et as SenderKeyPair, f as CollectionCallbackSetters, g as FederationFetchOptions, h as FederationBuilder, i as GetSignedKeyOptions, it as ActivityTransformer, j as createFederationBuilder, k as createExponentialBackoffPolicy, l as SendActivityOptions, m as Federation, n as Context, nt as buildCollectionSynchronizationHeader, o as ParseUriResult, p as Federatable, q as InboxErrorHandler, r as ForwardActivityOptions, rt as digest, s as RequestContext, t as ActorKeyPair, tt as PageItems, u as SendActivityOptionsForCollection, v as FederationStartQueueOptions, w as FederationQueueOptions, x as CreateFederationOptions, y as InboxListenerSetters, z as ActorAliasMapper } from "./context.js";
|
|
13
|
+
import { a as MessageQueueListenOptions, i as MessageQueueEnqueueOptions, n as InProcessMessageQueueOptions, o as ParallelMessageQueue, r as MessageQueue, t as InProcessMessageQueue } from "./mq.js";
|
|
14
|
+
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.js";
|
|
15
|
+
import "./federation/mod.js";
|
|
16
|
+
import "./nodeinfo/mod.js";
|
|
17
|
+
import { GetAuthenticatedDocumentLoaderOptions, exportMultibaseKey, exportSpki, getAuthenticatedDocumentLoader, importMultibaseKey, importPem, importPkcs1, importSpki } from "./runtime/mod.js";
|
|
18
|
+
import { _ as verifyJsonLd, a as createProof, c as verifyProof, d as VerifyJsonLdOptions, f as VerifySignatureOptions, g as signJsonLd, h as detachSignature, i as VerifyProofOptions, l as CreateSignatureOptions, m as createSignature, n as SignObjectOptions, o as signObject, p as attachSignature, r as VerifyObjectOptions, s as verifyObject, t as CreateProofOptions, u as SignJsonLdOptions, v as verifySignature } from "./mod3.js";
|
|
19
|
+
import "./webfinger/mod.js";
|
|
20
20
|
export { Accept, Activity, ActivityTransformer, Actor, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, ActorTypeName, Add, Announce, Application, Arrive, Article, Audio, AuthenticatedDocumentLoaderFactory, AuthorizePredicate, Block, ChatMessage, Collection, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, CollectionPage, Context, Create, CreateExponentialBackoffPolicyOptions, CreateFederationOptions, CreateProofOptions, CreateSignatureOptions, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, DocumentLoader, DocumentLoaderFactory, DocumentLoaderFactoryOptions, DoesActorOwnKeyOptions, Emoji, EmojiReact, Endpoints, Event, Export, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, FetchError, FetchKeyOptions, FetchKeyResult, Flag, Follow, ForwardActivityOptions, GetActorHandleOptions, GetAuthenticatedDocumentLoaderOptions, GetDocumentLoaderOptions, GetKeyOwnerOptions, GetNodeInfoOptions, GetSignedKeyOptions, GetUserAgentOptions, Group, Hashtag, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, Ignore, Image, InProcessMessageQueue, InProcessMessageQueueOptions, InboundService, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, IntransitiveActivity, Invite, Join, JsonValue, KeyCache, KvCacheParameters, KvKey, KvStore, KvStoreSetOptions, LanguageString, Leave, Like, Link, Listen, LookupObjectOptions, MemoryKvStore, Mention, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, Move, Multikey, NodeInfo, NodeInfoDispatcher, NormalizeActorHandleOptions, Note, Object$1 as Object, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, Offer, OrderedCollection, OrderedCollectionPage, Organization, OutboundService, OutboxErrorHandler, PUBLIC_COLLECTION, Page, PageItems, ParallelMessageQueue, ParseNodeInfoOptions, ParseUriResult, Person, Place, Profile, PropertyValue, Protocol, Question, Read, Recipient, Reject, Relationship, RemoteDocument, Remove, RequestContext, type ResourceDescriptor, RespondWithObjectOptions, RetryContext, RetryPolicy, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SemVer, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, Service, Services, SharedInboxKeyDispatcher, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, Software, Source, TentativeAccept, TentativeReject, Tombstone, Travel, TraverseCollectionOptions, Undo, Update, Usage, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifyRequestOptions, VerifySignatureOptions, Video, View, actorDehydrator, attachSignature, autoIdAssigner, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, createProof, createSignature, detachSignature, digest, doesActorOwnKey, exportJwk, exportMultibaseKey, exportSpki, fetchDocumentLoader, fetchKey, formatSemVer, generateCryptoKeyPair, getActorClassByTypeName, getActorHandle, getActorTypeName, getAuthenticatedDocumentLoader, getDefaultActivityTransformers, getDocumentLoader, getKeyOwner, getNodeInfo, getTypeId, getUserAgent, importJwk, importMultibaseKey, importPem, importPkcs1, importSpki, isActor, kvCache, lookupObject, lookupWebFinger, nodeInfoToJson, normalizeActorHandle, parseNodeInfo, parseSemVer, respondWithObject, respondWithObjectIfAcceptable, signJsonLd, signObject, signRequest, traverseCollection, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
|
package/dist/mod.js
CHANGED
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import "./compat
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { lookupWebFinger } from "./lookup
|
|
11
|
-
import {
|
|
12
|
-
import { signRequest, verifyRequest } from "./http
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import "./nodeinfo
|
|
19
|
-
import "./runtime
|
|
20
|
-
import "./sig
|
|
21
|
-
import "./webfinger
|
|
5
|
+
import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "./transformers.js";
|
|
6
|
+
import "./compat/mod.js";
|
|
7
|
+
import { i as getDocumentLoader, o as getUserAgent, r as fetchDocumentLoader, s as kvCache, t as FetchError } from "./docloader.js";
|
|
8
|
+
import { $ as Person, A as Flag, B as Like, C as Dislike, Ct as importPkcs1, D as Endpoints, E as EmojiReact, F as Image, G as Multikey, H as Listen, I as IntransitiveActivity, J as Offer, K as Note, L as Invite, M as Group, N as Hashtag, O as Event, P as Ignore, Q as Page, R as Join, S as DidService, St as importPem, T as Emoji, Tt as getTypeId, U as Mention, V as Link, W as Move, X as OrderedCollectionPage, Y as OrderedCollection, Z as Organization, _ as CollectionPage, _t as View, a as normalizeActorHandle, at as Reject, b as DataIntegrityProof, bt as exportSpki, c as Add, ct as Service, d as Arrive, dt as TentativeReject, et as Place, f as Article, ft as Tombstone, g as Collection, gt as Video, h as ChatMessage, ht as Update, i as isActor, it as Read, j as Follow, k as Export, l as Announce, lt as Source, m as Block, mt as Undo, n as getActorHandle, nt as PropertyValue, o as Accept, ot as Relationship, p as Audio, pt as Travel, q as Object$1, r as getActorTypeName, rt as Question, s as Activity, st as Remove, t as getActorClassByTypeName, tt as Profile, u as Application, ut as TentativeAccept, v as Create, vt as LanguageString, w as Document, wt as importSpki, x as Delete, xt as importMultibaseKey, y as CryptographicKey, yt as exportMultibaseKey, z as Leave } from "./actor.js";
|
|
9
|
+
import { a as createFederation, c as respondWithObjectIfAcceptable, d as createFederationBuilder, f as Router, l as buildCollectionSynchronizationHeader, o as createExponentialBackoffPolicy, p as RouterError, s as respondWithObject, u as digest } from "./middleware.js";
|
|
10
|
+
import { t as lookupWebFinger } from "./lookup.js";
|
|
11
|
+
import { i as importJwk, n as fetchKey, r as generateCryptoKeyPair, t as exportJwk } from "./key2.js";
|
|
12
|
+
import { n as signRequest, r as verifyRequest } from "./http.js";
|
|
13
|
+
import { a as doesActorOwnKey, c as createSignature, d as signJsonLd, f as verifyJsonLd, i as verifyProof, l as detachSignature, n as signObject, o as getKeyOwner, p as verifySignature, r as verifyObject, s as attachSignature, t as createProof } from "./proof.js";
|
|
14
|
+
import { a as parseSemVer, i as formatSemVer, n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types.js";
|
|
15
|
+
import { t as getAuthenticatedDocumentLoader } from "./authdocloader.js";
|
|
16
|
+
import { n as lookupObject, r as traverseCollection, t as PUBLIC_COLLECTION } from "./vocab.js";
|
|
17
|
+
import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "./federation/mod.js";
|
|
18
|
+
import "./nodeinfo/mod.js";
|
|
19
|
+
import "./runtime/mod.js";
|
|
20
|
+
import "./sig/mod.js";
|
|
21
|
+
import "./webfinger/mod.js";
|
|
22
22
|
|
|
23
23
|
export { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, FetchError, Flag, Follow, Group, Hashtag, Ignore, Image, InProcessMessageQueue, IntransitiveActivity, Invite, Join, LanguageString, Leave, Like, Link, Listen, MemoryKvStore, Mention, Move, Multikey, Note, Object$1 as Object, Offer, OrderedCollection, OrderedCollectionPage, Organization, PUBLIC_COLLECTION, Page, ParallelMessageQueue, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Router, RouterError, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View, actorDehydrator, attachSignature, autoIdAssigner, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, createProof, createSignature, detachSignature, digest, doesActorOwnKey, exportJwk, exportMultibaseKey, exportSpki, fetchDocumentLoader, fetchKey, formatSemVer, generateCryptoKeyPair, getActorClassByTypeName, getActorHandle, getActorTypeName, getAuthenticatedDocumentLoader, getDefaultActivityTransformers, getDocumentLoader, getKeyOwner, getNodeInfo, getTypeId, getUserAgent, importJwk, importMultibaseKey, importPem, importPkcs1, importSpki, isActor, kvCache, lookupObject, lookupWebFinger, nodeInfoToJson, normalizeActorHandle, parseNodeInfo, parseSemVer, respondWithObject, respondWithObjectIfAcceptable, signJsonLd, signObject, signRequest, traverseCollection, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { DocumentLoader, GetUserAgentOptions } from "./docloader
|
|
4
|
-
import {
|
|
3
|
+
import { n as DocumentLoader, s as GetUserAgentOptions } from "./docloader.js";
|
|
4
|
+
import { H as Object$1, I as Link, d as Collection } from "./vocab.js";
|
|
5
5
|
import { TracerProvider } from "@opentelemetry/api";
|
|
6
6
|
|
|
7
7
|
//#region vocab/lookup.d.ts
|
|
@@ -209,4 +209,4 @@ declare function getTypeId(object: Object$1 | Link | null): URL | null;
|
|
|
209
209
|
*/
|
|
210
210
|
declare function getTypeId(object: Object$1 | Link | null | undefined): URL | null | undefined;
|
|
211
211
|
//#endregion
|
|
212
|
-
export {
|
|
212
|
+
export { lookupObject as a, TraverseCollectionOptions as i, PUBLIC_COLLECTION as n, traverseCollection as o, LookupObjectOptions as r, getTypeId as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { DocumentLoader } from "./docloader
|
|
4
|
-
import {
|
|
5
|
-
import { KeyCache } from "./http
|
|
3
|
+
import { n as DocumentLoader } from "./docloader.js";
|
|
4
|
+
import { B as Multikey, H as Object$1, h as DataIntegrityProof, m as CryptographicKey } from "./vocab.js";
|
|
5
|
+
import { l as KeyCache } from "./http.js";
|
|
6
6
|
import { TracerProvider } from "@opentelemetry/api";
|
|
7
7
|
|
|
8
8
|
//#region sig/ld.d.ts
|
|
@@ -265,4 +265,4 @@ declare function verifyObject<T extends Object$1>(cls: (new (...args: any[]) =>
|
|
|
265
265
|
fromJsonLd(jsonLd: unknown, options: VerifyObjectOptions): Promise<T>;
|
|
266
266
|
}, jsonLd: unknown, options?: VerifyObjectOptions): Promise<T | null>;
|
|
267
267
|
//#endregion
|
|
268
|
-
export {
|
|
268
|
+
export { verifyJsonLd as _, createProof as a, verifyProof as c, VerifyJsonLdOptions as d, VerifySignatureOptions as f, signJsonLd as g, detachSignature as h, VerifyProofOptions as i, CreateSignatureOptions as l, createSignature as m, SignObjectOptions as n, signObject as o, attachSignature as p, VerifyObjectOptions as r, verifyObject as s, CreateProofOptions as t, SignJsonLdOptions as u, verifySignature as v };
|
|
@@ -140,4 +140,4 @@ declare class ParallelMessageQueue implements MessageQueue {
|
|
|
140
140
|
listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
|
|
141
141
|
}
|
|
142
142
|
//#endregion
|
|
143
|
-
export {
|
|
143
|
+
export { MessageQueueListenOptions as a, MessageQueueEnqueueOptions as i, InProcessMessageQueueOptions as n, ParallelMessageQueue as o, MessageQueue as r, InProcessMessageQueue as t };
|
|
@@ -3,20 +3,18 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import "../
|
|
8
|
-
import "../
|
|
9
|
-
import "../
|
|
10
|
-
import "../
|
|
11
|
-
import "../
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import "../
|
|
15
|
-
import "../
|
|
16
|
-
import "../
|
|
17
|
-
import "../
|
|
18
|
-
import "../assert_throws-YetpVSc-.js";
|
|
19
|
-
import { esm_default } from "../esm-DO9PrujO.js";
|
|
6
|
+
import "../chunk.js";
|
|
7
|
+
import { t as assertEquals } from "../assert_equals.js";
|
|
8
|
+
import "../docloader.js";
|
|
9
|
+
import "../url.js";
|
|
10
|
+
import "../semver.js";
|
|
11
|
+
import { a as parseProtocol, c as parseUsage, i as parseOutboundService, n as parseInboundService, o as parseServices, r as parseNodeInfo, s as parseSoftware, t as getNodeInfo } from "../client.js";
|
|
12
|
+
import { t as test } from "../testing.js";
|
|
13
|
+
import "../std__assert.js";
|
|
14
|
+
import "../assert_rejects.js";
|
|
15
|
+
import "../assert_is_error.js";
|
|
16
|
+
import "../assert_throws.js";
|
|
17
|
+
import { t as esm_default } from "../esm.js";
|
|
20
18
|
|
|
21
19
|
//#region nodeinfo/client.test.ts
|
|
22
20
|
test("getNodeInfo()", async (t) => {
|
|
@@ -58,32 +56,25 @@ test("getNodeInfo()", async (t) => {
|
|
|
58
56
|
}
|
|
59
57
|
};
|
|
60
58
|
await t.step("indirect", async () => {
|
|
61
|
-
|
|
62
|
-
assertEquals(
|
|
63
|
-
const raw = await getNodeInfo("https://example.com/", { parse: "none" });
|
|
64
|
-
assertEquals(raw, rawExpected);
|
|
59
|
+
assertEquals(await getNodeInfo("https://example.com/"), expected);
|
|
60
|
+
assertEquals(await getNodeInfo("https://example.com/", { parse: "none" }), rawExpected);
|
|
65
61
|
});
|
|
66
62
|
await t.step("direct", async () => {
|
|
67
|
-
|
|
68
|
-
assertEquals(info, expected);
|
|
63
|
+
assertEquals(await getNodeInfo("https://example.com/nodeinfo/2.1", { direct: true }), expected);
|
|
69
64
|
});
|
|
70
65
|
esm_default.removeRoutes();
|
|
71
66
|
esm_default.get("https://example.com/.well-known/nodeinfo", { body: { links: [] } });
|
|
72
67
|
await t.step("indirect: no links", async () => {
|
|
73
|
-
|
|
74
|
-
assertEquals(info, void 0);
|
|
68
|
+
assertEquals(await getNodeInfo("https://example.com/"), void 0);
|
|
75
69
|
});
|
|
76
70
|
esm_default.removeRoutes();
|
|
77
71
|
esm_default.get("https://example.com/.well-known/nodeinfo", { status: 404 });
|
|
78
72
|
await t.step("indirect: 404", async () => {
|
|
79
|
-
|
|
80
|
-
assertEquals(info, void 0);
|
|
73
|
+
assertEquals(await getNodeInfo("https://example.com/"), void 0);
|
|
81
74
|
});
|
|
82
75
|
await t.step("direct: 404", async () => {
|
|
83
|
-
|
|
84
|
-
assertEquals(
|
|
85
|
-
const info2 = await getNodeInfo("https://example.com/404", { direct: true });
|
|
86
|
-
assertEquals(info2, void 0);
|
|
76
|
+
assertEquals(await getNodeInfo("https://example.com/nodeinfo/2.0", { direct: true }), void 0);
|
|
77
|
+
assertEquals(await getNodeInfo("https://example.com/404", { direct: true }), void 0);
|
|
87
78
|
});
|
|
88
79
|
esm_default.hardReset();
|
|
89
80
|
});
|
|
@@ -3,51 +3,46 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import "../
|
|
8
|
-
import "../
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import "../
|
|
12
|
-
import "../
|
|
13
|
-
import
|
|
14
|
-
import "../
|
|
15
|
-
import "../
|
|
16
|
-
import "../
|
|
17
|
-
import "../
|
|
18
|
-
import "../
|
|
19
|
-
import "../
|
|
20
|
-
import "../
|
|
21
|
-
import "../
|
|
22
|
-
import "../
|
|
23
|
-
import "../
|
|
24
|
-
import "../
|
|
25
|
-
import "../
|
|
26
|
-
import "../
|
|
27
|
-
import "../
|
|
28
|
-
import "../
|
|
29
|
-
import "../
|
|
30
|
-
import "../
|
|
31
|
-
import "../
|
|
32
|
-
import "../
|
|
33
|
-
import "../
|
|
34
|
-
import "../
|
|
35
|
-
import "../
|
|
36
|
-
import
|
|
37
|
-
import "../
|
|
38
|
-
import "../
|
|
39
|
-
import "../
|
|
40
|
-
import "../assert_not_equals-C685gKx6.js";
|
|
41
|
-
import "../assert_throws-YetpVSc-.js";
|
|
42
|
-
import "../docloader-09nVWLAZ.js";
|
|
43
|
-
import { createRequestContext } from "../context-aglzx1Ww.js";
|
|
6
|
+
import "../chunk.js";
|
|
7
|
+
import { t as assertEquals } from "../assert_equals.js";
|
|
8
|
+
import { t as MemoryKvStore } from "../kv.js";
|
|
9
|
+
import { a as createFederation, h as handleNodeInfoJrd, m as handleNodeInfo } from "../middleware.js";
|
|
10
|
+
import "../docloader.js";
|
|
11
|
+
import "../url.js";
|
|
12
|
+
import { n as parseSemVer } from "../semver.js";
|
|
13
|
+
import "../client.js";
|
|
14
|
+
import "../router.js";
|
|
15
|
+
import "../types.js";
|
|
16
|
+
import "../multibase.js";
|
|
17
|
+
import "../vocab.js";
|
|
18
|
+
import "../langstr.js";
|
|
19
|
+
import "../lookup.js";
|
|
20
|
+
import "../actor.js";
|
|
21
|
+
import "../key2.js";
|
|
22
|
+
import "../http.js";
|
|
23
|
+
import "../authdocloader.js";
|
|
24
|
+
import "../ld.js";
|
|
25
|
+
import "../owner.js";
|
|
26
|
+
import "../proof.js";
|
|
27
|
+
import "../lookup2.js";
|
|
28
|
+
import "../inbox.js";
|
|
29
|
+
import "../builder.js";
|
|
30
|
+
import "../collection.js";
|
|
31
|
+
import "../keycache.js";
|
|
32
|
+
import "../send.js";
|
|
33
|
+
import { t as test } from "../testing.js";
|
|
34
|
+
import "../std__assert.js";
|
|
35
|
+
import "../assert_rejects.js";
|
|
36
|
+
import "../assert_is_error.js";
|
|
37
|
+
import "../assert_throws.js";
|
|
38
|
+
import "../docloader2.js";
|
|
39
|
+
import { n as createRequestContext } from "../context.js";
|
|
44
40
|
|
|
45
41
|
//#region nodeinfo/handler.test.ts
|
|
46
42
|
test("handleNodeInfo()", async () => {
|
|
47
43
|
const request = new Request("https://example.com/nodeinfo/2.1");
|
|
48
|
-
const federation = createFederation({ kv: new MemoryKvStore() });
|
|
49
44
|
const context = createRequestContext({
|
|
50
|
-
federation,
|
|
45
|
+
federation: createFederation({ kv: new MemoryKvStore() }),
|
|
51
46
|
data: void 0,
|
|
52
47
|
request,
|
|
53
48
|
url: new URL(request.url)
|
|
@@ -74,8 +69,7 @@ test("handleNodeInfo()", async () => {
|
|
|
74
69
|
});
|
|
75
70
|
assertEquals(response.status, 200);
|
|
76
71
|
assertEquals(response.headers.get("Content-Type"), "application/json; profile=\"http://nodeinfo.diaspora.software/ns/schema/2.1#\"");
|
|
77
|
-
|
|
78
|
-
assertEquals(json, {
|
|
72
|
+
assertEquals(await response.json(), {
|
|
79
73
|
"$schema": "http://nodeinfo.diaspora.software/ns/schema/2.1#",
|
|
80
74
|
version: "2.1",
|
|
81
75
|
software: {
|
|
@@ -102,9 +96,8 @@ test("handleNodeInfo()", async () => {
|
|
|
102
96
|
});
|
|
103
97
|
test("handleNodeInfoJrd()", async () => {
|
|
104
98
|
const request = new Request("https://example.com/.well-known/nodeinfo");
|
|
105
|
-
const federation = createFederation({ kv: new MemoryKvStore() });
|
|
106
99
|
let context = createRequestContext({
|
|
107
|
-
federation,
|
|
100
|
+
federation: createFederation({ kv: new MemoryKvStore() }),
|
|
108
101
|
data: void 0,
|
|
109
102
|
request,
|
|
110
103
|
url: new URL(request.url)
|
package/dist/nodeinfo/mod.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import "../
|
|
4
|
-
|
|
5
|
-
import { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, SemVer, Services, Software, Usage, formatSemVer, getNodeInfo, nodeInfoToJson, parseNodeInfo, parseSemVer } from "../client-DvtwXO7t.js";
|
|
6
|
-
import "../mod-1pDWKvUL.js";
|
|
7
|
-
export { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, SemVer, Services, Software, Usage, formatSemVer, getNodeInfo, nodeInfoToJson, parseNodeInfo, parseSemVer };
|
|
3
|
+
import { a as InboundService, c as OutboundService, d as Software, f as Usage, g as parseSemVer, h as formatSemVer, i as parseNodeInfo, l as Protocol, m as SemVer, n as ParseNodeInfoOptions, o as JsonValue, p as nodeInfoToJson, r as getNodeInfo, s as NodeInfo, t as GetNodeInfoOptions, u as Services } from "../client.js";
|
|
4
|
+
export { type GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, type ParseNodeInfoOptions, Protocol, type SemVer, Services, Software, Usage, formatSemVer, getNodeInfo, nodeInfoToJson, parseNodeInfo, parseSemVer };
|
package/dist/nodeinfo/mod.js
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import "../docloader
|
|
6
|
-
import { formatSemVer, getNodeInfo,
|
|
7
|
-
import "../nodeinfo-CyEbLjHs.js";
|
|
5
|
+
import "../docloader.js";
|
|
6
|
+
import { a as parseSemVer, i as formatSemVer, n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "../types.js";
|
|
8
7
|
|
|
9
8
|
export { formatSemVer, getNodeInfo, nodeInfoToJson, parseNodeInfo, parseSemVer };
|