@fedify/fedify 2.0.0-pr.445.1694 → 2.0.0-pr.449.1725
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-DoMcqXsW.js → actor-C0gLJq8I.js} +187 -187
- package/dist/{actor-CwZ2m5rG.cjs → actor-CsRJa7wV.cjs} +187 -187
- package/dist/{actor-D8gCwLzv.js → actor-VrXd7EdX.js} +1 -1
- package/dist/{authdocloader-Cv_qEn1G.js → authdocloader-6F9IP-VO.js} +3 -3
- package/dist/{authdocloader-bsmVF6eO.cjs → authdocloader-BkuVo8LL.cjs} +3 -3
- package/dist/{authdocloader-DYTNpaMA.js → authdocloader-C8LXxsmU.js} +3 -3
- package/dist/{builder-1_skw-d2.js → builder-JjsppXTK.js} +8 -8
- package/dist/{client-D5CBsPrc.js → client-BS-GE3XI.js} +1 -1
- package/dist/compat/mod.d.cts +2 -2
- package/dist/compat/mod.d.ts +2 -2
- package/dist/compat/transformers.test.js +16 -16
- package/dist/{context-DBKpNBnc.d.ts → context-B1X8-X33.d.ts} +120 -87
- package/dist/{context-DiqjMRef.d.cts → context-DYCJXr7J.d.cts} +120 -87
- package/dist/{docloader-Czl3xV10.js → docloader-AMdJU291.js} +1 -1
- package/dist/{docloader-CYnQRIXv.cjs → docloader-BdF5STdg.cjs} +1 -1
- package/dist/{esm-Dl5T1RNE.js → esm-CvUgdJZ_.js} +1 -1
- package/dist/federation/builder.test.js +5 -5
- package/dist/federation/collection.test.js +3 -3
- package/dist/federation/handler.test.js +17 -17
- package/dist/federation/idempotency.test.js +17 -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 +18 -18
- package/dist/federation/mod.cjs +10 -10
- package/dist/federation/mod.d.cts +2 -2
- package/dist/federation/mod.d.ts +2 -2
- package/dist/federation/mod.js +10 -10
- package/dist/federation/mq.test.js +3 -3
- package/dist/federation/negotiation.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-C_Qc2neP.js → http-DVQEn98K.js} +3 -3
- package/dist/{http-CAusBl_3.cjs → http-D_BI5KHC.cjs} +3 -3
- package/dist/{http-CuS-d4U0.js → http-DbyMqL2X.js} +2 -2
- package/dist/{inbox-IETv_Qez.js → inbox-DQlf_-Dz.js} +1 -1
- package/dist/{key-C_ruQbbl.js → key-BBzfhQGE.js} +4 -4
- package/dist/key-BMz_uAnc.cjs +10 -0
- package/dist/{key-DnqhSgAv.js → key-BSJX6n9o.js} +2 -2
- package/dist/{key-DuXv64tg.cjs → key-D-RgWfcf.cjs} +2 -2
- package/dist/{key-BNJQQm3h.js → key-DFefr8X2.js} +2 -2
- package/dist/{key-DpFjiItf.js → key-DW2DrPGl.js} +3 -3
- package/dist/{keycache-CSBkusP8.js → keycache-CcIfdj0m.js} +1 -1
- package/dist/{keys-D3_MDK7n.js → keys-DnSaJmvD.js} +1 -1
- package/dist/{ld-Isot0tiW.js → ld-CAJ6Q2od.js} +2 -2
- package/dist/{lookup-D6dro5Au.cjs → lookup-B2Bsau2g.cjs} +1 -1
- package/dist/{lookup-Dhm78GlK.js → lookup-BGCuyJRy.js} +1 -1
- package/dist/{lookup-CbtuFbtg.js → lookup-C3pnuyiD.js} +1 -1
- package/dist/{middleware-BuHr2fzh.js → middleware-1oxZY_0z.js} +36 -37
- package/dist/middleware-B8WWe8Q2.js +26 -0
- package/dist/{middleware-DQYscW90.js → middleware-BDqkoMAQ.js} +35 -36
- package/dist/{middleware-Dgmdgrvb.cjs → middleware-D0XMPoN8.cjs} +36 -37
- package/dist/middleware-DipQbJmB.js +17 -0
- package/dist/middleware-mLaQeD_Z.cjs +17 -0
- package/dist/{mod-D_y2y32N.d.ts → mod-DcKxhFQ8.d.ts} +1 -1
- package/dist/{mod-Bpb5QLaZ.d.cts → mod-twdvV2hR.d.cts} +1 -1
- package/dist/mod.cjs +10 -10
- package/dist/mod.d.cts +3 -3
- package/dist/mod.d.ts +3 -3
- package/dist/mod.js +10 -10
- package/dist/nodeinfo/client.test.js +5 -5
- package/dist/nodeinfo/handler.test.js +16 -16
- package/dist/nodeinfo/mod.cjs +2 -2
- package/dist/nodeinfo/mod.js +2 -2
- package/dist/nodeinfo/types.test.js +3 -3
- package/dist/{owner-ChSL4aJ7.js → owner-CaIfLBwg.js} +2 -2
- package/dist/{proof-ONNmhInb.cjs → proof-AhyVJcNZ.cjs} +3 -3
- package/dist/{proof-x3IBewan.js → proof-BQwXHakc.js} +2 -2
- package/dist/{proof-BiSCuwyA.js → proof-CKXppjee.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/link.test.js +3 -3
- package/dist/runtime/mod.cjs +6 -6
- 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-D5fjmUEj.js → send-DQd3R1Oc.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.cjs +6 -6
- 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 +119 -86
- package/dist/testing/mod.js +3 -3
- package/dist/{testing-tWr1VQxx.js → testing-BljKU-GG.js} +2 -2
- package/dist/{type-DaUr3Il7.js → type-COb6KNlm.js} +186 -186
- package/dist/{types-DQuSDtDg.js → types-CEn4wB51.js} +1 -1
- package/dist/{types-D2Nyz0tR.cjs → types-DI0yutHB.cjs} +1 -1
- package/dist/vocab/actor.test.js +5 -5
- package/dist/vocab/lookup.test.js +4 -4
- package/dist/vocab/mod.cjs +4 -4
- 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-w--qk7HF.js → vocab-CkWH9P5l.js} +3 -3
- package/dist/{vocab-Dd4VMrr0.cjs → vocab-NZXL5Pr-.cjs} +3 -3
- package/dist/webfinger/handler.test.js +16 -16
- package/dist/webfinger/lookup.test.js +4 -4
- package/dist/webfinger/mod.cjs +2 -2
- package/dist/webfinger/mod.js +2 -2
- package/dist/x/cfworkers.test.js +3 -3
- package/dist/x/hono.d.cts +1 -1
- package/dist/x/hono.d.ts +1 -1
- package/dist/x/sveltekit.d.cts +1 -1
- package/dist/x/sveltekit.d.ts +1 -1
- package/package.json +1 -1
- package/dist/key-DIMJMxf4.cjs +0 -10
- package/dist/middleware-BpR6186a.js +0 -26
- package/dist/middleware-DDMxdtWM.cjs +0 -17
- package/dist/middleware-T-knSMwl.js +0 -17
package/dist/sig/proof.test.js
CHANGED
@@ -3,21 +3,21 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { Create, DataIntegrityProof, Multikey, Note, Place, decode, importMultibaseKey } from "../type-
|
6
|
+
import { Create, DataIntegrityProof, Multikey, Note, Place, decode, importMultibaseKey } from "../type-COb6KNlm.js";
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
8
8
|
import "../assert-MZs1qjMx.js";
|
9
9
|
import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
|
10
|
-
import "../lookup-
|
11
|
-
import "../actor-
|
12
|
-
import "../key-
|
13
|
-
import { createProof, signObject, verifyObject, verifyProof } from "../proof-
|
14
|
-
import { mockDocumentLoader, test } from "../testing-
|
10
|
+
import "../lookup-C3pnuyiD.js";
|
11
|
+
import "../actor-VrXd7EdX.js";
|
12
|
+
import "../key-BSJX6n9o.js";
|
13
|
+
import { createProof, signObject, verifyObject, verifyProof } from "../proof-BQwXHakc.js";
|
14
|
+
import { mockDocumentLoader, test } from "../testing-BljKU-GG.js";
|
15
15
|
import "../std__assert-X-_kMxKM.js";
|
16
16
|
import { assertRejects } from "../assert_rejects-DiIiJbZn.js";
|
17
17
|
import "../assert_is_error-BPGph1Jx.js";
|
18
18
|
import "../assert_not_equals-f3m3epl3.js";
|
19
19
|
import "../assert_throws-BOO88avQ.js";
|
20
|
-
import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-
|
20
|
+
import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-DnSaJmvD.js";
|
21
21
|
import { decodeHex, encodeHex } from "byte-encodings/hex";
|
22
22
|
|
23
23
|
//#region src/sig/proof.test.ts
|
@@ -3,12 +3,12 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import "../type-
|
6
|
+
import "../type-COb6KNlm.js";
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
8
8
|
import "../assert-MZs1qjMx.js";
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
10
|
-
import "../lookup-
|
11
|
-
import { mockDocumentLoader, test } from "../testing-
|
10
|
+
import "../lookup-C3pnuyiD.js";
|
11
|
+
import { mockDocumentLoader, test } from "../testing-BljKU-GG.js";
|
12
12
|
import "../std__assert-X-_kMxKM.js";
|
13
13
|
import "../assert_rejects-DiIiJbZn.js";
|
14
14
|
import "../assert_is_error-BPGph1Jx.js";
|
package/dist/testing/mod.d.ts
CHANGED
@@ -7479,7 +7479,7 @@ type ObjectAuthorizePredicate<TContextData, TParam extends string> = (context: R
|
|
7479
7479
|
* the entire collection without pagination.
|
7480
7480
|
* @since 1.8.0
|
7481
7481
|
*/
|
7482
|
-
type CustomCollectionDispatcher<TItem,
|
7482
|
+
type CustomCollectionDispatcher<TItem, TParam extends string, TContext extends Context<TContextData>, TContextData> = (context: TContext, values: Record<TParam, string>, cursor: string | null) => PageItems<TItem> | null | Promise<PageItems<TItem> | null>;
|
7483
7483
|
/**
|
7484
7484
|
* A callback that counts the number of items in a custom collection.
|
7485
7485
|
*
|
@@ -7489,7 +7489,7 @@ type CustomCollectionDispatcher<TItem, TParams extends Record<string, string>, T
|
|
7489
7489
|
* @param values The parameters of the requested URL.
|
7490
7490
|
* @since 1.8.0
|
7491
7491
|
*/
|
7492
|
-
type CustomCollectionCounter<
|
7492
|
+
type CustomCollectionCounter<TParam extends string, TContextData> = (context: RequestContext<TContextData>, values: Record<TParam, string>) => number | bigint | null | Promise<number | bigint | null>;
|
7493
7493
|
/**
|
7494
7494
|
* A callback that returns a cursor for a custom collection.
|
7495
7495
|
*
|
@@ -7502,7 +7502,7 @@ type CustomCollectionCounter<TParams extends Record<string, string>, TContextDat
|
|
7502
7502
|
* @param values The parameters of the requested URL.
|
7503
7503
|
* @since 1.8.0
|
7504
7504
|
*/
|
7505
|
-
type CustomCollectionCursor<
|
7505
|
+
type CustomCollectionCursor<TParam extends string, TContext extends Context<TContextData>, TContextData> = (context: TContext, values: Record<TParam, string>) => string | null | Promise<string | null>;
|
7506
7506
|
//#endregion
|
7507
7507
|
//#region src/federation/queue.d.ts
|
7508
7508
|
interface SenderKeyJwkPair {
|
@@ -7623,7 +7623,7 @@ interface Federatable<TContextData> {
|
|
7623
7623
|
* @returns An object with methods to set other actor dispatcher callbacks.
|
7624
7624
|
* @throws {RouterError} Thrown if the path pattern is invalid.
|
7625
7625
|
*/
|
7626
|
-
setActorDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: ActorDispatcher<TContextData>): ActorCallbackSetters<TContextData>;
|
7626
|
+
setActorDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: ActorDispatcher<TContextData>): ActorCallbackSetters<TContextData>;
|
7627
7627
|
/**
|
7628
7628
|
* Registers an object dispatcher.
|
7629
7629
|
*
|
@@ -7687,7 +7687,7 @@ interface Federatable<TContextData> {
|
|
7687
7687
|
*/
|
7688
7688
|
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: (new (...args: any[]) => TObject) & {
|
7689
7689
|
typeId: URL;
|
7690
|
-
}, path: `${string}
|
7690
|
+
}, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
7691
7691
|
/**
|
7692
7692
|
* Registers an object dispatcher.
|
7693
7693
|
*
|
@@ -7703,7 +7703,7 @@ interface Federatable<TContextData> {
|
|
7703
7703
|
*/
|
7704
7704
|
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: (new (...args: any[]) => TObject) & {
|
7705
7705
|
typeId: URL;
|
7706
|
-
}, path: `${string}
|
7706
|
+
}, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
7707
7707
|
/**
|
7708
7708
|
* Registers an object dispatcher.
|
7709
7709
|
*
|
@@ -7719,7 +7719,7 @@ interface Federatable<TContextData> {
|
|
7719
7719
|
*/
|
7720
7720
|
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: (new (...args: any[]) => TObject) & {
|
7721
7721
|
typeId: URL;
|
7722
|
-
}, path: `${string}
|
7722
|
+
}, path: `${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
7723
7723
|
/**
|
7724
7724
|
* Registers an inbox dispatcher.
|
7725
7725
|
*
|
@@ -7731,7 +7731,7 @@ interface Federatable<TContextData> {
|
|
7731
7731
|
* @param dispatcher An inbox dispatcher callback to register.
|
7732
7732
|
* @throws {@link RouterError} Thrown if the path pattern is invalid.
|
7733
7733
|
*/
|
7734
|
-
setInboxDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Activity, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
7734
|
+
setInboxDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Activity, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
7735
7735
|
/**
|
7736
7736
|
* Registers an outbox dispatcher.
|
7737
7737
|
*
|
@@ -7755,7 +7755,7 @@ interface Federatable<TContextData> {
|
|
7755
7755
|
* @param dispatcher An outbox dispatcher callback to register.
|
7756
7756
|
* @throws {@link RouterError} Thrown if the path pattern is invalid.
|
7757
7757
|
*/
|
7758
|
-
setOutboxDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Activity, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
7758
|
+
setOutboxDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Activity, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
7759
7759
|
/**
|
7760
7760
|
* Registers a following collection dispatcher.
|
7761
7761
|
* @param path The URI path pattern for the following collection. The syntax
|
@@ -7767,7 +7767,7 @@ interface Federatable<TContextData> {
|
|
7767
7767
|
* callbacks.
|
7768
7768
|
* @throws {RouterError} Thrown if the path pattern is invalid.
|
7769
7769
|
*/
|
7770
|
-
setFollowingDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Actor | URL, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
7770
|
+
setFollowingDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Actor | URL, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
7771
7771
|
/**
|
7772
7772
|
* Registers a followers collection dispatcher.
|
7773
7773
|
* @param path The URI path pattern for the followers collection. The syntax
|
@@ -7779,7 +7779,7 @@ interface Federatable<TContextData> {
|
|
7779
7779
|
* callbacks.
|
7780
7780
|
* @throws {@link RouterError} Thrown if the path pattern is invalid.
|
7781
7781
|
*/
|
7782
|
-
setFollowersDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Recipient, Context<TContextData>, TContextData, URL>): CollectionCallbackSetters<Context<TContextData>, TContextData, URL>;
|
7782
|
+
setFollowersDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Recipient, Context<TContextData>, TContextData, URL>): CollectionCallbackSetters<Context<TContextData>, TContextData, URL>;
|
7783
7783
|
/**
|
7784
7784
|
* Registers a liked collection dispatcher.
|
7785
7785
|
* @param path The URI path pattern for the liked collection. The syntax
|
@@ -7791,7 +7791,7 @@ interface Federatable<TContextData> {
|
|
7791
7791
|
* callbacks.
|
7792
7792
|
* @throws {@link RouterError} Thrown if the path pattern is invalid.
|
7793
7793
|
*/
|
7794
|
-
setLikedDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Object$1 | URL, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
7794
|
+
setLikedDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Object$1 | URL, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
7795
7795
|
/**
|
7796
7796
|
* Registers a featured collection dispatcher.
|
7797
7797
|
* @param path The URI path pattern for the featured collection. The syntax
|
@@ -7803,7 +7803,7 @@ interface Federatable<TContextData> {
|
|
7803
7803
|
* callbacks.
|
7804
7804
|
* @throws {@link RouterError} Thrown if the path pattern is invalid.
|
7805
7805
|
*/
|
7806
|
-
setFeaturedDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Object$1, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
7806
|
+
setFeaturedDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Object$1, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
7807
7807
|
/**
|
7808
7808
|
* Registers a featured tags collection dispatcher.
|
7809
7809
|
* @param path The URI path pattern for the featured tags collection.
|
@@ -7815,7 +7815,7 @@ interface Federatable<TContextData> {
|
|
7815
7815
|
* callbacks.
|
7816
7816
|
* @throws {@link RouterError} Thrown if the path pattern is invalid.
|
7817
7817
|
*/
|
7818
|
-
setFeaturedTagsDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Hashtag, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
7818
|
+
setFeaturedTagsDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Hashtag, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
7819
7819
|
/**
|
7820
7820
|
* Assigns the URL path for the inbox and starts setting inbox listeners.
|
7821
7821
|
*
|
@@ -7845,7 +7845,7 @@ interface Federatable<TContextData> {
|
|
7845
7845
|
* @returns An object to register inbox listeners.
|
7846
7846
|
* @throws {RouteError} Thrown if the path pattern is invalid.
|
7847
7847
|
*/
|
7848
|
-
setInboxListeners(inboxPath: `${string}{identifier}${string}` | `${string}{handle}${string}`, sharedInboxPath?: string): InboxListenerSetters<TContextData>;
|
7848
|
+
setInboxListeners(inboxPath: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, sharedInboxPath?: string): InboxListenerSetters<TContextData>;
|
7849
7849
|
/**
|
7850
7850
|
* Registers a collection of objects dispatcher.
|
7851
7851
|
*
|
@@ -7860,7 +7860,43 @@ interface Federatable<TContextData> {
|
|
7860
7860
|
* The path must have one or more variables.
|
7861
7861
|
* @param dispatcher A collection dispatcher callback to register.
|
7862
7862
|
*/
|
7863
|
-
setCollectionDispatcher<TObject extends Object$1,
|
7863
|
+
setCollectionDispatcher<TObject extends Object$1, TParam extends string>(name: string | symbol, itemType: (new (...args: any[]) => TObject) & {
|
7864
|
+
typeId: URL;
|
7865
|
+
}, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: CustomCollectionDispatcher<TObject, TParam, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>;
|
7866
|
+
/**
|
7867
|
+
* Registers a collection of objects dispatcher.
|
7868
|
+
*
|
7869
|
+
* @template TContextData The context data to pass to the {@link Context}.
|
7870
|
+
* @template TObject The type of objects to dispatch.
|
7871
|
+
* @template TParam The parameter names of the requested URL.
|
7872
|
+
* @param name A unique name for the collection dispatcher.
|
7873
|
+
* @param itemType The Activity Vocabulary class of the object to dispatch.
|
7874
|
+
* @param path The URI path pattern for the collection dispatcher.
|
7875
|
+
* The syntax is based on URI Template
|
7876
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
|
7877
|
+
* The path must have one or more variables.
|
7878
|
+
* @param dispatcher A collection dispatcher callback to register.
|
7879
|
+
*/
|
7880
|
+
setCollectionDispatcher<TObject extends Object$1, TParam extends string>(name: string | symbol, itemType: (new (...args: any[]) => TObject) & {
|
7881
|
+
typeId: URL;
|
7882
|
+
}, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: CustomCollectionDispatcher<TObject, TParam, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>;
|
7883
|
+
/**
|
7884
|
+
* Registers a collection of objects dispatcher.
|
7885
|
+
*
|
7886
|
+
* @template TContextData The context data to pass to the {@link Context}.
|
7887
|
+
* @template TObject The type of objects to dispatch.
|
7888
|
+
* @template TParam The parameter names of the requested URL.
|
7889
|
+
* @param name A unique name for the collection dispatcher.
|
7890
|
+
* @param itemType The Activity Vocabulary class of the object to dispatch.
|
7891
|
+
* @param path The URI path pattern for the collection dispatcher.
|
7892
|
+
* The syntax is based on URI Template
|
7893
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
|
7894
|
+
* The path must have one or more variables.
|
7895
|
+
* @param dispatcher A collection dispatcher callback to register.
|
7896
|
+
*/
|
7897
|
+
setCollectionDispatcher<TObject extends Object$1, TParam extends string>(name: string | symbol, itemType: (new (...args: any[]) => TObject) & {
|
7898
|
+
typeId: URL;
|
7899
|
+
}, path: `${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: CustomCollectionDispatcher<TObject, TParam, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>;
|
7864
7900
|
/**
|
7865
7901
|
* Registers an ordered collection of objects dispatcher.
|
7866
7902
|
*
|
@@ -7875,7 +7911,43 @@ interface Federatable<TContextData> {
|
|
7875
7911
|
* The path must have one or more variables.
|
7876
7912
|
* @param dispatcher A collection dispatcher callback to register.
|
7877
7913
|
*/
|
7878
|
-
setOrderedCollectionDispatcher<TObject extends Object$1,
|
7914
|
+
setOrderedCollectionDispatcher<TObject extends Object$1, TParam extends string>(name: string | symbol, itemType: (new (...args: any[]) => TObject) & {
|
7915
|
+
typeId: URL;
|
7916
|
+
}, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: CustomCollectionDispatcher<TObject, TParam, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>;
|
7917
|
+
/**
|
7918
|
+
* Registers an ordered collection of objects dispatcher.
|
7919
|
+
*
|
7920
|
+
* @template TContextData The context data to pass to the {@link Context}.
|
7921
|
+
* @template TObject The type of objects to dispatch.
|
7922
|
+
* @template TParam The parameter names of the requested URL.
|
7923
|
+
* @param name A unique name for the collection dispatcher.
|
7924
|
+
* @param itemType The Activity Vocabulary class of the object to dispatch.
|
7925
|
+
* @param path The URI path pattern for the collection dispatcher.
|
7926
|
+
* The syntax is based on URI Template
|
7927
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
|
7928
|
+
* The path must have one or more variables.
|
7929
|
+
* @param dispatcher A collection dispatcher callback to register.
|
7930
|
+
*/
|
7931
|
+
setOrderedCollectionDispatcher<TObject extends Object$1, TParam extends string>(name: string | symbol, itemType: (new (...args: any[]) => TObject) & {
|
7932
|
+
typeId: URL;
|
7933
|
+
}, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: CustomCollectionDispatcher<TObject, TParam, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>;
|
7934
|
+
/**
|
7935
|
+
* Registers an ordered collection of objects dispatcher.
|
7936
|
+
*
|
7937
|
+
* @template TContextData The context data to pass to the {@link Context}.
|
7938
|
+
* @template TObject The type of objects to dispatch.
|
7939
|
+
* @template TParam The parameter names of the requested URL.
|
7940
|
+
* @param name A unique name for the collection dispatcher.
|
7941
|
+
* @param itemType The Activity Vocabulary class of the object to dispatch.
|
7942
|
+
* @param path The URI path pattern for the collection dispatcher.
|
7943
|
+
* The syntax is based on URI Template
|
7944
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
|
7945
|
+
* The path must have one or more variables.
|
7946
|
+
* @param dispatcher A collection dispatcher callback to register.
|
7947
|
+
*/
|
7948
|
+
setOrderedCollectionDispatcher<TObject extends Object$1, TParam extends string>(name: string | symbol, itemType: (new (...args: any[]) => TObject) & {
|
7949
|
+
typeId: URL;
|
7950
|
+
}, path: `${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: CustomCollectionDispatcher<TObject, TParam, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>;
|
7879
7951
|
}
|
7880
7952
|
/**
|
7881
7953
|
* An object that registers federation-related business logic and dispatches
|
@@ -8174,38 +8246,38 @@ interface FederationFetchOptions<TContextData> {
|
|
8174
8246
|
/**
|
8175
8247
|
* Additional settings for a custom collection dispatcher.
|
8176
8248
|
*
|
8177
|
-
* @template
|
8249
|
+
* @template TParam The type of the parameters in the URL path.
|
8178
8250
|
* @template TContext The type of the context. {@link Context} or
|
8179
8251
|
* {@link RequestContext}.
|
8180
8252
|
* @template TContextData The context data to pass to the {@link Context}.
|
8181
8253
|
* @template TFilter The type of filter for the collection.
|
8182
8254
|
*/
|
8183
|
-
interface CustomCollectionCallbackSetters<
|
8255
|
+
interface CustomCollectionCallbackSetters<TParam extends string, TContext extends Context<TContextData>, TContextData> {
|
8184
8256
|
/**
|
8185
8257
|
* Sets the counter for the custom collection.
|
8186
8258
|
* @param counter A callback that returns the number of items in the custom collection.
|
8187
8259
|
* @returns The setters object so that settings can be chained.
|
8188
8260
|
*/
|
8189
|
-
setCounter(counter: CustomCollectionCounter<
|
8261
|
+
setCounter(counter: CustomCollectionCounter<TParam, TContextData>): CustomCollectionCallbackSetters<TParam, TContext, TContextData>;
|
8190
8262
|
/**
|
8191
8263
|
* Sets the first cursor for the custom collection.
|
8192
8264
|
* @param cursor The cursor for the first item in the custom collection.
|
8193
8265
|
* @returns The setters object so that settings can be chained.
|
8194
8266
|
*/
|
8195
|
-
setFirstCursor(cursor: CustomCollectionCursor<
|
8267
|
+
setFirstCursor(cursor: CustomCollectionCursor<TParam, TContext, TContextData>): CustomCollectionCallbackSetters<TParam, TContext, TContextData>;
|
8196
8268
|
/**
|
8197
8269
|
* Sets the last cursor for the custom collection.
|
8198
8270
|
* @param cursor The cursor for the last item in the custom collection.
|
8199
8271
|
* @returns The setters object so that settings can be chained.
|
8200
8272
|
*/
|
8201
|
-
setLastCursor(cursor: CustomCollectionCursor<
|
8273
|
+
setLastCursor(cursor: CustomCollectionCursor<TParam, TContext, TContextData>): CustomCollectionCallbackSetters<TParam, TContext, TContextData>;
|
8202
8274
|
/**
|
8203
8275
|
* Specifies the conditions under which requests are authorized.
|
8204
8276
|
* @param predicate A callback that returns whether a request is authorized.
|
8205
8277
|
* @returns The setters object so that settings can be chained.
|
8206
8278
|
* @since 0.7.0
|
8207
8279
|
*/
|
8208
|
-
authorize(predicate: ObjectAuthorizePredicate<TContextData, string>): CustomCollectionCallbackSetters<
|
8280
|
+
authorize(predicate: ObjectAuthorizePredicate<TContextData, string>): CustomCollectionCallbackSetters<TParam, TContext, TContextData>;
|
8209
8281
|
}
|
8210
8282
|
/**
|
8211
8283
|
* Represents an object with a type ID, which is either a constructor or an
|
@@ -8217,73 +8289,34 @@ type ConstructorWithTypeId<TObject extends Object$1> = (new (...args: any[]) =>
|
|
8217
8289
|
typeId: URL;
|
8218
8290
|
};
|
8219
8291
|
/**
|
8220
|
-
*
|
8221
|
-
*
|
8222
|
-
* values are their string representations.
|
8223
|
-
* @returns A string representing the path with all parameters.
|
8224
|
-
* @example
|
8225
|
-
* ```ts
|
8226
|
-
* type UserPostPath = ParamsKeyPath<{ userId: string; postId: string }>;
|
8227
|
-
* let userPostPath: UserPostPath;
|
8228
|
-
* // userPostPath = "/posts/{postId}"; // invalid - does not contain `{userId}`
|
8229
|
-
* // userPostPath = "/users/{userId}"; // invalid - does not contain `{postId}`
|
8230
|
-
* userPostPath = "/users/{userId}/posts/{postId}"; // valid
|
8231
|
-
* userPostPath = "/posts/{postId}/users/{userId}"; // valid
|
8232
|
-
* ```
|
8233
|
-
*/
|
8234
|
-
type ParamsKeyPath<Params extends Record<string, string>> = ParamsPath<Extract<keyof Params, string>> & string;
|
8235
|
-
/**
|
8236
|
-
* Represents a path with multiple parameters.
|
8237
|
-
* All permutations of the parameters are included in the union type.
|
8238
|
-
* The path must have all parameters in the form of `{paramName}`.
|
8239
|
-
* @param Params - A union of parameter names.
|
8240
|
-
* @returns A string representing the path with all parameters.
|
8241
|
-
* @example
|
8242
|
-
* ```ts
|
8243
|
-
* type UserPostPath = ParamsPath<"userId" | "postId">;
|
8244
|
-
* // = `${string}{userId}${string}` & `${string}{postId}${string}`
|
8245
|
-
* // =
|
8246
|
-
* // | `${string}{userId}${string}{postId}${string}`
|
8247
|
-
* // | `${string}{postId}${string}{userId}${string}`
|
8248
|
-
* let userPostPath: UserPostPath;
|
8249
|
-
* userPostPath = "/users/posts"; // ❌ invalid
|
8250
|
-
* userPostPath = "/users/{userId}"; // ❌ invalid
|
8251
|
-
* userPostPath = "/posts/{postId}"; // ❌ invalid
|
8252
|
-
* userPostPath = "/users/{userId}/posts/{postId}"; // ✅ valid
|
8253
|
-
* userPostPath = "/posts/{postId}/users/{userId}"; // ✅ valid
|
8254
|
-
*/
|
8255
|
-
type ParamsPath<Params extends string> = UnionToIntersection<ParamPath<Params>>;
|
8256
|
-
/**
|
8257
|
-
* Represents a path with a single parameter.
|
8258
|
-
* The path must have at least one of the parameters in the form of `{paramName}`.
|
8259
|
-
* @param Param - The name of the parameter.
|
8260
|
-
* @returns A string representing the path with the parameter.
|
8261
|
-
* @example
|
8262
|
-
* ```ts
|
8263
|
-
* type UserPostPath = ParamPath<"userId" | "postId">;
|
8264
|
-
* // = `${string}{userId}${string}` | `${string}{postId}${string}`
|
8265
|
-
* let userPostPath: UserPostPath;
|
8266
|
-
* userPostPath = "/users/posts"; // ❌ invalid
|
8267
|
-
* userPostPath = "/users/{userId}"; // ✅ valid
|
8268
|
-
* userPostPath = "/posts/{postId}"; // ✅ valid
|
8269
|
-
* userPostPath = "/users/{userId}/posts/{postId}"; // ✅ valid
|
8270
|
-
* userPostPath = "/posts/{postId}/users/{userId}"; // ✅ valid
|
8271
|
-
*/
|
8272
|
-
type ParamPath<Param extends string> = `${string}{${Param}}${string}`;
|
8273
|
-
/**
|
8274
|
-
* Converts union types to intersection types.
|
8292
|
+
* Defines a union of all valid RFC 6570 URI Template expressions for a given
|
8293
|
+
* parameter name.
|
8275
8294
|
*
|
8276
|
-
*
|
8277
|
-
*
|
8295
|
+
* RFC 6570 specifies a syntax for URI templates, allowing for variable
|
8296
|
+
* expansion. This type captures all Level 1-4 operator expressions for a
|
8297
|
+
* single, named variable.
|
8298
|
+
*
|
8299
|
+
* The supported expression types are:
|
8300
|
+
* - `{Param}`: Simple string expansion
|
8301
|
+
* - `+{Param}`: Reserved string expansion
|
8302
|
+
* - `#{Param}`: Fragment expansion
|
8303
|
+
* - `{.Param}`: Label expansion with a dot-prefix
|
8304
|
+
* - `{/Param}`: Path segment expansion
|
8305
|
+
* - `{;Param}`: Path-style parameter expansion
|
8306
|
+
* - `{?Param}`: Query component expansion
|
8307
|
+
* - `{&Param}`: Query continuation expansion
|
8308
|
+
*
|
8309
|
+
* @template Param The name of the parameter to be used in the expressions.
|
8278
8310
|
* @example
|
8279
8311
|
* ```ts
|
8280
|
-
* type
|
8281
|
-
*
|
8282
|
-
*
|
8283
|
-
*
|
8284
|
-
*
|
8312
|
+
* type UserIdExpression = Rfc6570Expression<"userId">;
|
8313
|
+
*
|
8314
|
+
* // The variable `userPath` can be assigned any of the valid expressions.
|
8315
|
+
* const userPath: UserIdExpression = "{/userId}";
|
8316
|
+
* ```
|
8317
|
+
* @see {@link https://tools.ietf.org/html/rfc6570} for the full specification.
|
8285
8318
|
*/
|
8286
|
-
type
|
8319
|
+
type Rfc6570Expression<Param extends string> = `{${Param}}` | `{+${Param}}` | `{#${Param}}` | `{.${Param}}` | `{/${Param}}` | `{;${Param}}` | `{?${Param}}` | `{&${Param}}`;
|
8287
8320
|
//#endregion
|
8288
8321
|
//#region src/federation/context.d.ts
|
8289
8322
|
/**
|
package/dist/testing/mod.js
CHANGED
@@ -3,8 +3,8 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import "../type-
|
7
|
-
import "../lookup-
|
8
|
-
import { createInboxContext, createRequestContext, test, testDefinitions } from "../testing-
|
6
|
+
import "../type-COb6KNlm.js";
|
7
|
+
import "../lookup-C3pnuyiD.js";
|
8
|
+
import { createInboxContext, createRequestContext, test, testDefinitions } from "../testing-BljKU-GG.js";
|
9
9
|
|
10
10
|
export { createInboxContext, createRequestContext, test, testDefinitions };
|
@@ -3,8 +3,8 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { __require, lookupWebFinger } from "./type-
|
7
|
-
import { RouterError, lookupObject, traverseCollection } from "./lookup-
|
6
|
+
import { __require, lookupWebFinger } from "./type-COb6KNlm.js";
|
7
|
+
import { RouterError, lookupObject, traverseCollection } from "./lookup-C3pnuyiD.js";
|
8
8
|
import { configure, getConsoleSink, getLogger, reset } from "@logtape/logtape";
|
9
9
|
import { trace } from "@opentelemetry/api";
|
10
10
|
|