@fedify/fedify 1.8.1-pr.334.1193 → 1.8.1-pr.340.1214
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-CeBMq8qR.js → actor-0406z0yr.js} +1 -1
- package/dist/{actor-BxYrc06V.js → actor-BaC4dvrg.js} +179 -179
- package/dist/{actor-B4TBtqRP.d.ts → actor-CWNAGvnO.d.ts} +2 -2
- package/dist/{authdocloader-D64rqKxU.js → authdocloader-CEsK8iV_.js} +3 -3
- package/dist/{authdocloader-mGQvrIQ2.js → authdocloader-CtMSv_Pw.js} +3 -3
- package/dist/{builder-BMWyrhEH.js → builder-BMJsk4Fm.js} +74 -4
- package/dist/{client-BQ4AQGKo.d.ts → client-B0IOer6B.d.ts} +1 -1
- package/dist/{client-CTC5x_Sz.js → client-BKDCmXzu.js} +1 -1
- package/dist/compat/mod.d.ts +11 -11
- package/dist/compat/mod.js +1 -1
- package/dist/compat/transformers.test.js +16 -16
- package/dist/{context-B6mUZhs_.d.ts → context-BNA3vzcr.d.ts} +273 -60
- package/dist/{docloader-BeCtcTOJ.d.ts → docloader-CLolPVL_.d.ts} +1 -1
- package/dist/{docloader-BU0Mbf3M.js → docloader-DWk5FlEW.js} +1 -1
- package/dist/{esm-LMB9p-G5.js → esm-CXrO8Uio.js} +1 -1
- package/dist/federation/builder.test.js +25 -6
- package/dist/federation/collection.test.js +3 -3
- package/dist/federation/handler.test.js +327 -17
- package/dist/federation/inbox.test.js +4 -4
- package/dist/federation/keycache.test.js +4 -4
- package/dist/federation/kv.test.js +3 -3
- package/dist/federation/middleware.test.js +49 -18
- package/dist/federation/mod.d.ts +11 -11
- package/dist/federation/mod.js +11 -11
- package/dist/federation/mq.test.js +3 -3
- package/dist/federation/retry.test.js +3 -3
- package/dist/federation/router.test.js +3 -3
- package/dist/federation/send.test.js +10 -10
- package/dist/{http-D3g0NXG1.js → http-CO1FrcSi.js} +2 -2
- package/dist/{http-D1uoUH4N.d.ts → http-COez3YdK.d.ts} +4 -4
- package/dist/{http-CYR3mIVn.js → http-DhcY_6sW.js} +3 -3
- package/dist/{inbox-CKssCQNk.js → inbox-BU_xB7k0.js} +1 -1
- package/dist/{key-BBZcKCrH.js → key-B09hs4s0.js} +3 -3
- package/dist/{key-CmOXs0Mq.js → key-BdLJwUgz.js} +3 -3
- package/dist/{key-YOEsvep6.js → key-CnJoBmuO.js} +3 -3
- package/dist/{key-CuNvhgVd.js → key-DOtg5R6v.js} +4 -4
- package/dist/{keycache-DGObidvq.js → keycache-lSDCpE3z.js} +1 -1
- package/dist/{keys-CPhbsrsX.js → keys-DAWEhOVZ.js} +1 -1
- package/dist/{kv-DDdb1hMa.d.ts → kv-BqOK6zss.d.ts} +1 -1
- package/dist/{ld-D8ugSU-x.js → ld-wWks9TWo.js} +2 -2
- package/dist/{lookup-rBByGTyy.js → lookup-B7MyB44I.js} +1 -1
- package/dist/{lookup-B0_qPExk.js → lookup-Cph3FzCE.js} +1 -1
- package/dist/{lookup-J_m4YZg0.d.ts → lookup-tSXYzgYs.d.ts} +1 -1
- package/dist/middleware-B3Vppi4s.js +26 -0
- package/dist/{middleware-u2WBeCjB.js → middleware-B93u9XJg.js} +552 -17
- package/dist/middleware-B_dKx4Hf.js +17 -0
- package/dist/{middleware-B_To0NZ3.js → middleware-BrIs_Xfo.js} +616 -11
- package/dist/{mod-BCl7t-Ka.d.ts → mod-Bf-mThHd.d.ts} +4 -4
- package/dist/{mod-BFwgZ7_K.d.ts → mod-C2jQirfr.d.ts} +2 -2
- package/dist/{mod-D9qE4iHP.d.ts → mod-CxD6XXBN.d.ts} +5 -5
- package/dist/{mod-0L5jhGYM.d.ts → mod-UTC30uNC.d.ts} +2 -2
- package/dist/mod.d.ts +14 -14
- package/dist/mod.js +11 -11
- package/dist/nodeinfo/client.test.js +5 -5
- package/dist/nodeinfo/handler.test.js +16 -16
- package/dist/nodeinfo/mod.d.ts +3 -3
- package/dist/nodeinfo/mod.js +2 -2
- package/dist/nodeinfo/semver.test.js +3 -3
- package/dist/nodeinfo/types.test.js +3 -3
- package/dist/{owner-CEv_PfyK.d.ts → owner-BlxMNrL4.d.ts} +3 -3
- package/dist/{owner-D1TBvEbO.js → owner-D5LGiRcJ.js} +2 -2
- package/dist/{proof-CUsFh6B-.js → proof-B2bSQ9mB.js} +4 -4
- package/dist/{proof-CyWfFsKS.js → proof-DMbQihAa.js} +3 -3
- package/dist/runtime/authdocloader.test.js +9 -9
- package/dist/runtime/docloader.test.js +4 -4
- package/dist/runtime/key.test.js +5 -5
- package/dist/runtime/langstr.test.js +3 -3
- package/dist/runtime/mod.d.ts +5 -5
- package/dist/runtime/mod.js +6 -6
- package/dist/runtime/multibase/multibase.test.js +3 -3
- package/dist/runtime/url.test.js +3 -3
- package/dist/{send-CrjrTnXW.js → send-CHfFIhLs.js} +2 -2
- package/dist/sig/http.test.js +8 -8
- package/dist/sig/key.test.js +6 -6
- package/dist/sig/ld.test.js +7 -7
- package/dist/sig/mod.d.ts +7 -7
- package/dist/sig/mod.js +6 -6
- package/dist/sig/owner.test.js +7 -7
- package/dist/sig/proof.test.js +7 -7
- package/dist/testing/docloader.test.js +3 -3
- package/dist/testing/mod.d.ts +260 -48
- package/dist/testing/mod.js +3 -3
- package/dist/{testing-CROcCUCq.js → testing-B1f6X3bJ.js} +4 -3
- package/dist/{transformers-ghwJuzGY.js → transformers-DJRB0yFF.js} +3 -3
- package/dist/{type-DGlR8Urb.js → type-DDS4cl1h.js} +179 -179
- package/dist/{types-DZdBK266.js → types-DqEgOZ7x.js} +1 -1
- package/dist/vocab/actor.test.js +5 -5
- package/dist/vocab/lookup.test.js +4 -4
- package/dist/vocab/mod.d.ts +5 -5
- package/dist/vocab/mod.js +4 -4
- package/dist/vocab/type.test.js +3 -3
- package/dist/vocab/vocab.test.js +4 -4
- package/dist/{vocab-BLQ-_oLb.js → vocab-4bE35CsS.js} +3 -3
- package/dist/{vocab-By6mpzr-.d.ts → vocab-Cyrb7_co.d.ts} +1 -1
- package/dist/webfinger/handler.test.js +16 -16
- package/dist/webfinger/lookup.test.js +4 -4
- package/dist/webfinger/mod.d.ts +3 -3
- package/dist/webfinger/mod.js +2 -2
- package/dist/x/cfworkers.d.ts +1 -1
- package/dist/x/cfworkers.test.js +3 -3
- package/dist/x/hono.d.ts +14 -14
- package/dist/x/hono.js +2 -2
- package/dist/x/sveltekit.d.ts +11 -11
- package/dist/x/sveltekit.js +1 -1
- package/package.json +1 -1
- package/dist/middleware-DbDzHrt7.js +0 -17
- package/dist/middleware-JUbAKlS5.js +0 -26
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { GetUserAgentOptions } from "./docloader-
|
|
4
|
-
import { Application, Group, Organization, Person, Service } from "./vocab-
|
|
3
|
+
import { GetUserAgentOptions } from "./docloader-CLolPVL_.js";
|
|
4
|
+
import { Application, Group, Organization, Person, Service } from "./vocab-Cyrb7_co.js";
|
|
5
5
|
import { TracerProvider } from "@opentelemetry/api";
|
|
6
6
|
|
|
7
7
|
//#region vocab/actor.d.ts
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { UrlError, createRequest, getRemoteDocument, logRequest, validatePublicUrl } from "./type-
|
|
7
|
-
import { validateCryptoKey } from "./key-
|
|
8
|
-
import { doubleKnock } from "./http-
|
|
6
|
+
import { UrlError, createRequest, getRemoteDocument, logRequest, validatePublicUrl } from "./type-DDS4cl1h.js";
|
|
7
|
+
import { validateCryptoKey } from "./key-CnJoBmuO.js";
|
|
8
|
+
import { doubleKnock } from "./http-CO1FrcSi.js";
|
|
9
9
|
import { getLogger } from "@logtape/logtape";
|
|
10
10
|
|
|
11
11
|
//#region runtime/authdocloader.ts
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import { UrlError, createRequest, getRemoteDocument, logRequest, validatePublicUrl } from "./docloader-
|
|
6
|
-
import { validateCryptoKey } from "./key-
|
|
7
|
-
import { doubleKnock } from "./http-
|
|
5
|
+
import { UrlError, createRequest, getRemoteDocument, logRequest, validatePublicUrl } from "./docloader-DWk5FlEW.js";
|
|
6
|
+
import { validateCryptoKey } from "./key-B09hs4s0.js";
|
|
7
|
+
import { doubleKnock } from "./http-DhcY_6sW.js";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
|
|
10
10
|
//#region runtime/authdocloader.ts
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { deno_default, getTypeId } from "./type-
|
|
7
|
-
import { Router, RouterError } from "./lookup-
|
|
8
|
-
import { InboxListenerSet } from "./inbox-
|
|
6
|
+
import { deno_default, getTypeId } from "./type-DDS4cl1h.js";
|
|
7
|
+
import { Router, RouterError } from "./lookup-Cph3FzCE.js";
|
|
8
|
+
import { InboxListenerSet } from "./inbox-BU_xB7k0.js";
|
|
9
9
|
import { getLogger } from "@logtape/logtape";
|
|
10
10
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
11
11
|
|
|
@@ -27,13 +27,21 @@ var FederationBuilderImpl = class {
|
|
|
27
27
|
inboxListeners;
|
|
28
28
|
inboxErrorHandler;
|
|
29
29
|
sharedInboxKeyDispatcher;
|
|
30
|
+
collectionTypeIds;
|
|
31
|
+
collectionCallbacks;
|
|
32
|
+
/**
|
|
33
|
+
* Symbol registry for unique identification of unnamed symbols.
|
|
34
|
+
*/
|
|
35
|
+
#symbolRegistry = /* @__PURE__ */ new Map();
|
|
30
36
|
constructor() {
|
|
31
37
|
this.router = new Router();
|
|
32
38
|
this.objectCallbacks = {};
|
|
33
39
|
this.objectTypeIds = {};
|
|
40
|
+
this.collectionCallbacks = {};
|
|
41
|
+
this.collectionTypeIds = {};
|
|
34
42
|
}
|
|
35
43
|
async build(options) {
|
|
36
|
-
const { FederationImpl } = await import("./middleware-
|
|
44
|
+
const { FederationImpl } = await import("./middleware-B3Vppi4s.js");
|
|
37
45
|
const f = new FederationImpl(options);
|
|
38
46
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
|
39
47
|
f.router = this.router.clone();
|
|
@@ -477,6 +485,68 @@ var FederationBuilderImpl = class {
|
|
|
477
485
|
};
|
|
478
486
|
return setters;
|
|
479
487
|
}
|
|
488
|
+
setCollectionDispatcher(name, ...args) {
|
|
489
|
+
return this.#setCustomCollectionDispatcher(name, "collection", ...args);
|
|
490
|
+
}
|
|
491
|
+
setOrderedCollectionDispatcher(name, ...args) {
|
|
492
|
+
return this.#setCustomCollectionDispatcher(name, "orderedCollection", ...args);
|
|
493
|
+
}
|
|
494
|
+
#setCustomCollectionDispatcher(name, collectionType, itemType, path, dispatcher) {
|
|
495
|
+
const strName = String(name);
|
|
496
|
+
const routeName = `${collectionType}:${this.#uniqueCollectionId(name)}`;
|
|
497
|
+
if (this.router.has(routeName)) throw new RouterError(`Collection dispatcher for ${strName} already set.`);
|
|
498
|
+
if (this.collectionCallbacks[name] != null) throw new RouterError(`Collection dispatcher for ${strName} already set.`);
|
|
499
|
+
const variables = this.router.add(path, routeName);
|
|
500
|
+
if (variables.size < 1) throw new RouterError("Path for collection dispatcher must have at least one variable.");
|
|
501
|
+
const callbacks = { dispatcher };
|
|
502
|
+
this.collectionCallbacks[name] = callbacks;
|
|
503
|
+
this.collectionTypeIds[name] = itemType;
|
|
504
|
+
const setters = {
|
|
505
|
+
setCounter(counter) {
|
|
506
|
+
callbacks.counter = counter;
|
|
507
|
+
return setters;
|
|
508
|
+
},
|
|
509
|
+
setFirstCursor(cursor) {
|
|
510
|
+
callbacks.firstCursor = cursor;
|
|
511
|
+
return setters;
|
|
512
|
+
},
|
|
513
|
+
setLastCursor(cursor) {
|
|
514
|
+
callbacks.lastCursor = cursor;
|
|
515
|
+
return setters;
|
|
516
|
+
},
|
|
517
|
+
authorize(predicate) {
|
|
518
|
+
callbacks.authorizePredicate = predicate;
|
|
519
|
+
return setters;
|
|
520
|
+
}
|
|
521
|
+
};
|
|
522
|
+
return setters;
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Get the URL path for a custom collection.
|
|
526
|
+
* If the collection is not registered, returns null.
|
|
527
|
+
* @template TParam The parameter names of the requested URL.
|
|
528
|
+
* @param {string | symbol} name The name of the custom collection.
|
|
529
|
+
* @param {TParam} values The values to fill in the URL parameters.
|
|
530
|
+
* @returns {string | null} The URL path for the custom collection, or null if not registered.
|
|
531
|
+
*/
|
|
532
|
+
getCollectionPath(name, values) {
|
|
533
|
+
if (!(name in this.collectionCallbacks)) return null;
|
|
534
|
+
const routeName = this.#uniqueCollectionId(name);
|
|
535
|
+
const path = this.router.build(`collection:${routeName}`, values) ?? this.router.build(`orderedCollection:${routeName}`, values);
|
|
536
|
+
return path;
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* Converts a name (string or symbol) to a unique string identifier.
|
|
540
|
+
* For symbols, generates and caches a UUID if not already present.
|
|
541
|
+
* For strings, returns the string as-is.
|
|
542
|
+
* @param name The name to convert to a unique identifier
|
|
543
|
+
* @returns A unique string identifier
|
|
544
|
+
*/
|
|
545
|
+
#uniqueCollectionId(name) {
|
|
546
|
+
if (typeof name === "string") return name;
|
|
547
|
+
if (!this.#symbolRegistry.has(name)) this.#symbolRegistry.set(name, crypto.randomUUID());
|
|
548
|
+
return this.#symbolRegistry.get(name);
|
|
549
|
+
}
|
|
480
550
|
};
|
|
481
551
|
/**
|
|
482
552
|
* Creates a new {@link FederationBuilder} instance.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { GetUserAgentOptions } from "./docloader-
|
|
3
|
+
import { GetUserAgentOptions } from "./docloader-CLolPVL_.js";
|
|
4
4
|
|
|
5
5
|
//#region nodeinfo/semver.d.ts
|
|
6
6
|
/**
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { getUserAgent } from "./type-
|
|
6
|
+
import { getUserAgent } from "./type-DDS4cl1h.js";
|
|
7
7
|
import { parseSemVer } from "./semver-DCqorrj5.js";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
|
package/dist/compat/mod.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import "../kv-
|
|
4
|
-
import "../docloader-
|
|
5
|
-
import "../client-
|
|
6
|
-
import "../vocab-
|
|
7
|
-
import "../actor-
|
|
8
|
-
import "../http-
|
|
9
|
-
import "../owner-
|
|
10
|
-
import "../mod-
|
|
11
|
-
import "../lookup-
|
|
12
|
-
import { ActivityTransformer } from "../context-
|
|
3
|
+
import "../kv-BqOK6zss.js";
|
|
4
|
+
import "../docloader-CLolPVL_.js";
|
|
5
|
+
import "../client-B0IOer6B.js";
|
|
6
|
+
import "../vocab-Cyrb7_co.js";
|
|
7
|
+
import "../actor-CWNAGvnO.js";
|
|
8
|
+
import "../http-COez3YdK.js";
|
|
9
|
+
import "../owner-BlxMNrL4.js";
|
|
10
|
+
import "../mod-C2jQirfr.js";
|
|
11
|
+
import "../lookup-tSXYzgYs.js";
|
|
12
|
+
import { ActivityTransformer } from "../context-BNA3vzcr.js";
|
|
13
13
|
import "../mq-DYKDDJmp.js";
|
|
14
|
-
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-
|
|
14
|
+
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-CxD6XXBN.js";
|
|
15
15
|
export { ActivityTransformer, actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
|
package/dist/compat/mod.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../transformers-
|
|
5
|
+
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../transformers-DJRB0yFF.js";
|
|
6
6
|
import "../compat-Bb5myD13.js";
|
|
7
7
|
|
|
8
8
|
export { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
|
|
@@ -3,30 +3,30 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Follow, Person } from "../type-
|
|
6
|
+
import { Follow, Person } from "../type-DDS4cl1h.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-C5gKCm6A.js";
|
|
8
8
|
import { assert } from "../assert-DwEa6glZ.js";
|
|
9
9
|
import { assertInstanceOf } from "../assert_instance_of-C9QtN-X9.js";
|
|
10
10
|
import { MemoryKvStore } from "../kv-D7Yt6pnB.js";
|
|
11
|
-
import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-
|
|
11
|
+
import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-B93u9XJg.js";
|
|
12
12
|
import "../semver-DCqorrj5.js";
|
|
13
|
-
import "../client-
|
|
14
|
-
import "../lookup-
|
|
13
|
+
import "../client-BKDCmXzu.js";
|
|
14
|
+
import "../lookup-Cph3FzCE.js";
|
|
15
15
|
import "../types-n7HI7VFr.js";
|
|
16
|
-
import "../actor-
|
|
17
|
-
import "../key-
|
|
18
|
-
import "../http-
|
|
19
|
-
import "../authdocloader-
|
|
20
|
-
import "../ld-
|
|
21
|
-
import "../owner-
|
|
22
|
-
import "../proof-
|
|
23
|
-
import "../inbox-
|
|
24
|
-
import "../builder-
|
|
16
|
+
import "../actor-0406z0yr.js";
|
|
17
|
+
import "../key-CnJoBmuO.js";
|
|
18
|
+
import "../http-CO1FrcSi.js";
|
|
19
|
+
import "../authdocloader-CEsK8iV_.js";
|
|
20
|
+
import "../ld-wWks9TWo.js";
|
|
21
|
+
import "../owner-D5LGiRcJ.js";
|
|
22
|
+
import "../proof-DMbQihAa.js";
|
|
23
|
+
import "../inbox-BU_xB7k0.js";
|
|
24
|
+
import "../builder-BMJsk4Fm.js";
|
|
25
25
|
import "../collection-D5V3UzU3.js";
|
|
26
|
-
import "../keycache-
|
|
26
|
+
import "../keycache-lSDCpE3z.js";
|
|
27
27
|
import "../retry-BnpVRGFC.js";
|
|
28
|
-
import "../send-
|
|
29
|
-
import { test } from "../testing-
|
|
28
|
+
import "../send-CHfFIhLs.js";
|
|
29
|
+
import { test } from "../testing-B1f6X3bJ.js";
|
|
30
30
|
|
|
31
31
|
//#region compat/transformers.test.ts
|
|
32
32
|
const federation = new FederationImpl({ kv: new MemoryKvStore() });
|