@fedify/fedify 1.9.0-pr.443.1681 → 1.9.0-pr.455.1742
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-sT_gcgkl.d.ts → actor-C1Euqngb.d.ts} +1 -1
- package/dist/{actor-CX1PqLef.js → actor-CL8lYYUx.js} +1 -1
- package/dist/{actor-D6yXbYgY.js → actor-CYnaKz6k.js} +6169 -2946
- package/dist/{actor-CpDvMeh9.cjs → actor-D_0j9hMV.cjs} +6169 -2946
- package/dist/{actor-D8GmZX63.d.cts → actor-Ydzhc8dj.d.cts} +1 -1
- package/dist/{authdocloader-B02Yhk89.cjs → authdocloader-AGT1bvSf.cjs} +3 -3
- package/dist/{authdocloader-_-SNQ37B.js → authdocloader-BlVoSqyh.js} +3 -3
- package/dist/{authdocloader-CtHAAz1D.js → authdocloader-CRuH00Tu.js} +3 -3
- package/dist/{builder-C5KrSbKS.js → builder-CqMKWEN0.js} +14 -8
- package/dist/{client-DbRgEC98.js → client-BM12q1DJ.js} +1 -1
- package/dist/compat/mod.d.cts +7 -7
- package/dist/compat/mod.d.ts +7 -7
- package/dist/compat/transformers.test.js +16 -16
- package/dist/{context-Cp-kboln.d.ts → context-CXUibY4L.d.ts} +179 -116
- package/dist/{context-BkqGJwLI.d.cts → context-CwUAkopp.d.cts} +179 -116
- package/dist/{docloader-DHrLpvDa.js → docloader-BggS4E4F.js} +1 -1
- package/dist/{docloader-B_lWIYhZ.cjs → docloader-CLtA3Ji8.cjs} +1 -1
- package/dist/{esm-oDAmb3t0.js → esm-B3jpomik.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.d.ts +3 -0
- package/dist/federation/idempotency.test.js +202 -0
- 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 +7 -7
- package/dist/federation/mod.d.ts +7 -7
- package/dist/federation/mod.js +10 -10
- 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/fixtures/media.example.com/avatars/test-avatar.jpg.json +6 -0
- package/dist/{http-BQ0XHmus.cjs → http-2m_h3SPQ.cjs} +3 -3
- package/dist/{http-B9UPBFJz.d.cts → http-B1_DzfAU.d.cts} +1 -1
- package/dist/{http-4lxNFaXA.js → http-D53H7oqD.js} +3 -3
- package/dist/{http-ABY5j3YT.js → http-DNkYeLxx.js} +2 -2
- package/dist/{http-BGqh2jzk.d.ts → http-wsGR6KkT.d.ts} +1 -1
- package/dist/{inbox-D34aGNh3.js → inbox-FbqGLKha.js} +29 -7
- package/dist/{key-DCCZ0IQz.js → key-B42BY6RL.js} +2 -2
- package/dist/{key-B8fuptOf.js → key-BVNVEpXg.js} +2 -2
- package/dist/key-CYO3d3Bc.cjs +10 -0
- package/dist/{key-CUhjb7ia.cjs → key-CZzEU9nv.cjs} +2 -2
- package/dist/{key-BvUiwgvU.js → key-Dj6-orIK.js} +3 -3
- package/dist/{key-D5_cYZv8.js → key-NaBDH7FK.js} +4 -4
- package/dist/{keycache-DPgak-bY.js → keycache-BLtGOP6f.js} +1 -1
- package/dist/{keys-R-SfK3nQ.js → keys-BO3n2h_L.js} +1 -1
- package/dist/{ld-Dng9Ri0Z.js → ld-CMWQXDty.js} +2 -2
- package/dist/{lookup-CgzIxSqk.js → lookup-B5jlZrQb.js} +21 -12
- package/dist/{lookup-Bm9ZRBwj.cjs → lookup-BsOmKssB.cjs} +1 -1
- package/dist/{lookup-4DHxuyI4.js → lookup-C-jJgyrW.js} +1 -1
- package/dist/middleware-BV1L9XDk.cjs +17 -0
- package/dist/{middleware-774Oifc4.js → middleware-CNAH05Vn.js} +78 -47
- package/dist/middleware-Cr46LoSG.js +26 -0
- package/dist/middleware-DAFFQX5e.js +17 -0
- package/dist/{middleware-CpT5VG6o.cjs → middleware-DOd67qPG.cjs} +78 -47
- package/dist/{middleware-B7DkslM_.js → middleware-lg47b3mK.js} +43 -40
- package/dist/{mod-DxjZ8kbs.d.cts → mod-BUbqxBev.d.cts} +19 -1
- package/dist/{mod-OfRtcQo1.d.ts → mod-BcObK1Lz.d.ts} +2 -2
- package/dist/{mod-CnEwcmyF.d.ts → mod-CDObsV1d.d.ts} +19 -1
- package/dist/{mod-TsyIDkKn.d.ts → mod-CIbqfZW0.d.ts} +1 -1
- package/dist/{mod-Cuem8g-I.d.ts → mod-DgcYoyZK.d.ts} +2 -2
- package/dist/{mod-bscaBAIo.d.cts → mod-Dt-G9ZOS.d.cts} +1 -1
- package/dist/{mod-BihGJmMM.d.cts → mod-fjqfsrty.d.cts} +2 -2
- package/dist/{mod-Ds5wiXHw.d.cts → mod-mXx9V0q5.d.cts} +2 -2
- package/dist/mod.cjs +10 -10
- package/dist/mod.d.cts +10 -10
- package/dist/mod.d.ts +10 -10
- 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/semver.test.js +3 -3
- package/dist/nodeinfo/types.test.js +3 -3
- package/dist/{owner-BYxDl2qi.d.cts → owner-6KSEp9eV.d.cts} +2 -2
- package/dist/{owner-DOUl7e-t.d.ts → owner-BbeUDvOu.d.ts} +2 -2
- package/dist/{owner-BnmJOCds.js → owner-Ch2ApIpq.js} +2 -2
- package/dist/{proof-QLd9LtLS.cjs → proof-BtqGVz24.cjs} +3 -3
- package/dist/{proof-4d4UTrId.js → proof-Cge6SysA.js} +3 -3
- package/dist/{proof-DRGe3kWw.js → proof-DaD7vIAi.js} +2 -2
- 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.d.cts +3 -3
- package/dist/runtime/mod.d.ts +3 -3
- 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-VTF45d0K.js → send-DE79ptpc.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.d.cts +5 -5
- package/dist/sig/mod.d.ts +5 -5
- 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 +341 -379
- package/dist/testing/mod.js +3 -3
- package/dist/{testing-DtlapwX9.js → testing-Bh2wmeXp.js} +2 -2
- package/dist/{type-BK1maiHl.js → type-Du-WE8NC.js} +6297 -3074
- package/dist/{types-B11Jr68m.cjs → types-B1n1v8Fa.cjs} +1 -1
- package/dist/{types-ChXkDqkb.js → types-ChEbJU3f.js} +1 -1
- package/dist/vocab/actor.test.js +5 -5
- package/dist/vocab/lookup.test.js +255 -5
- package/dist/vocab/mod.cjs +4 -4
- package/dist/vocab/mod.d.cts +3 -3
- package/dist/vocab/mod.d.ts +3 -3
- package/dist/vocab/mod.js +4 -4
- package/dist/vocab/type.test.js +3 -3
- package/dist/vocab/vocab.test.js +395 -8
- package/dist/{vocab-BW6SWH9P.d.ts → vocab-CDHNj5zp.d.ts} +158 -497
- package/dist/{vocab-qpRpljdS.d.cts → vocab-Cfs0937i.d.cts} +158 -497
- package/dist/{vocab-C2kef9JD.cjs → vocab-DY3aCxLN.cjs} +23 -14
- package/dist/{vocab-B7TUfvy2.js → vocab-Q8XBm9oV.js} +23 -14
- 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 +6 -6
- package/dist/x/hono.d.ts +6 -6
- package/dist/x/sveltekit.d.cts +6 -6
- package/dist/x/sveltekit.d.ts +6 -6
- package/package.json +1 -1
- package/dist/key-DtzwU8SC.cjs +0 -10
- package/dist/middleware-CunKD_hx.js +0 -17
- package/dist/middleware-DpW8xh9z.cjs +0 -17
- package/dist/middleware-umMExV_X.js +0 -26
@@ -1,11 +1,11 @@
|
|
1
1
|
import { KvKey, KvStore } from "./kv-63Cil1MD.cjs";
|
2
2
|
import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, GetUserAgentOptions } from "./docloader-D-MrRyHl.cjs";
|
3
3
|
import { GetNodeInfoOptions, JsonValue, NodeInfo } from "./client-DjT_tegg.cjs";
|
4
|
-
import { Activity, Collection, CryptographicKey, Hashtag, Link, Multikey, Object as Object$1 } from "./vocab-
|
5
|
-
import { Actor, Recipient } from "./actor-
|
6
|
-
import { HttpMessageSignaturesSpec } from "./http-
|
7
|
-
import { GetKeyOwnerOptions } from "./owner-
|
8
|
-
import { LookupObjectOptions, TraverseCollectionOptions } from "./mod-
|
4
|
+
import { Activity, Collection, CryptographicKey, Hashtag, Link, Multikey, Object as Object$1 } from "./vocab-Cfs0937i.cjs";
|
5
|
+
import { Actor, Recipient } from "./actor-Ydzhc8dj.cjs";
|
6
|
+
import { HttpMessageSignaturesSpec } from "./http-B1_DzfAU.cjs";
|
7
|
+
import { GetKeyOwnerOptions } from "./owner-6KSEp9eV.cjs";
|
8
|
+
import { LookupObjectOptions, TraverseCollectionOptions } from "./mod-BUbqxBev.cjs";
|
9
9
|
import { Link as Link$1, LookupWebFingerOptions, ResourceDescriptor } from "./mod-jQ4OODsl.cjs";
|
10
10
|
import { MessageQueue } from "./mq-B7R1Q-M5.cjs";
|
11
11
|
import { Span, TracerProvider } from "@opentelemetry/api";
|
@@ -281,7 +281,7 @@ type ObjectAuthorizePredicate<TContextData, TParam extends string> = (context: R
|
|
281
281
|
* the entire collection without pagination.
|
282
282
|
* @since 1.8.0
|
283
283
|
*/
|
284
|
-
type CustomCollectionDispatcher<TItem,
|
284
|
+
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>;
|
285
285
|
/**
|
286
286
|
* A callback that counts the number of items in a custom collection.
|
287
287
|
*
|
@@ -291,7 +291,7 @@ type CustomCollectionDispatcher<TItem, TParams extends Record<string, string>, T
|
|
291
291
|
* @param values The parameters of the requested URL.
|
292
292
|
* @since 1.8.0
|
293
293
|
*/
|
294
|
-
type CustomCollectionCounter<
|
294
|
+
type CustomCollectionCounter<TParam extends string, TContextData> = (context: RequestContext<TContextData>, values: Record<TParam, string>) => number | bigint | null | Promise<number | bigint | null>;
|
295
295
|
/**
|
296
296
|
* A callback that returns a cursor for a custom collection.
|
297
297
|
*
|
@@ -304,7 +304,7 @@ type CustomCollectionCounter<TParams extends Record<string, string>, TContextDat
|
|
304
304
|
* @param values The parameters of the requested URL.
|
305
305
|
* @since 1.8.0
|
306
306
|
*/
|
307
|
-
type CustomCollectionCursor<
|
307
|
+
type CustomCollectionCursor<TParam extends string, TContext extends Context<TContextData>, TContextData> = (context: TContext, values: Record<TParam, string>) => string | null | Promise<string | null>;
|
308
308
|
//#endregion
|
309
309
|
//#region src/federation/handler.d.ts
|
310
310
|
|
@@ -702,7 +702,7 @@ interface Federatable<TContextData> {
|
|
702
702
|
* @returns An object with methods to set other actor dispatcher callbacks.
|
703
703
|
* @throws {RouterError} Thrown if the path pattern is invalid.
|
704
704
|
*/
|
705
|
-
setActorDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: ActorDispatcher<TContextData>): ActorCallbackSetters<TContextData>;
|
705
|
+
setActorDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: ActorDispatcher<TContextData>): ActorCallbackSetters<TContextData>;
|
706
706
|
/**
|
707
707
|
* Registers an object dispatcher.
|
708
708
|
*
|
@@ -716,9 +716,7 @@ interface Federatable<TContextData> {
|
|
716
716
|
* must have one or more variables.
|
717
717
|
* @param dispatcher An object dispatcher callback to register.
|
718
718
|
*/
|
719
|
-
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls:
|
720
|
-
typeId: URL;
|
721
|
-
}, path: `${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
719
|
+
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: ConstructorWithTypeId<TObject>, path: `${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
722
720
|
/**
|
723
721
|
* Registers an object dispatcher.
|
724
722
|
*
|
@@ -732,9 +730,7 @@ interface Federatable<TContextData> {
|
|
732
730
|
* must have one or more variables.
|
733
731
|
* @param dispatcher An object dispatcher callback to register.
|
734
732
|
*/
|
735
|
-
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls:
|
736
|
-
typeId: URL;
|
737
|
-
}, path: `${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
733
|
+
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: ConstructorWithTypeId<TObject>, path: `${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
738
734
|
/**
|
739
735
|
* Registers an object dispatcher.
|
740
736
|
*
|
@@ -748,9 +744,7 @@ interface Federatable<TContextData> {
|
|
748
744
|
* must have one or more variables.
|
749
745
|
* @param dispatcher An object dispatcher callback to register.
|
750
746
|
*/
|
751
|
-
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls:
|
752
|
-
typeId: URL;
|
753
|
-
}, path: `${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
747
|
+
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: ConstructorWithTypeId<TObject>, path: `${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
754
748
|
/**
|
755
749
|
* Registers an object dispatcher.
|
756
750
|
*
|
@@ -764,9 +758,7 @@ interface Federatable<TContextData> {
|
|
764
758
|
* must have one or more variables.
|
765
759
|
* @param dispatcher An object dispatcher callback to register.
|
766
760
|
*/
|
767
|
-
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls:
|
768
|
-
typeId: URL;
|
769
|
-
}, path: `${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
761
|
+
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: ConstructorWithTypeId<TObject>, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
770
762
|
/**
|
771
763
|
* Registers an object dispatcher.
|
772
764
|
*
|
@@ -780,9 +772,7 @@ interface Federatable<TContextData> {
|
|
780
772
|
* must have one or more variables.
|
781
773
|
* @param dispatcher An object dispatcher callback to register.
|
782
774
|
*/
|
783
|
-
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls:
|
784
|
-
typeId: URL;
|
785
|
-
}, path: `${string}{${TParam}}${string}{${TParam}}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
775
|
+
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: ConstructorWithTypeId<TObject>, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
786
776
|
/**
|
787
777
|
* Registers an object dispatcher.
|
788
778
|
*
|
@@ -796,9 +786,7 @@ interface Federatable<TContextData> {
|
|
796
786
|
* must have one or more variables.
|
797
787
|
* @param dispatcher An object dispatcher callback to register.
|
798
788
|
*/
|
799
|
-
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls:
|
800
|
-
typeId: URL;
|
801
|
-
}, path: `${string}{${TParam}}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
789
|
+
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: ConstructorWithTypeId<TObject>, path: `${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
802
790
|
/**
|
803
791
|
* Registers an inbox dispatcher.
|
804
792
|
*
|
@@ -810,7 +798,7 @@ interface Federatable<TContextData> {
|
|
810
798
|
* @param dispatcher An inbox dispatcher callback to register.
|
811
799
|
* @throws {@link RouterError} Thrown if the path pattern is invalid.
|
812
800
|
*/
|
813
|
-
setInboxDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Activity, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
801
|
+
setInboxDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Activity, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
814
802
|
/**
|
815
803
|
* Registers an outbox dispatcher.
|
816
804
|
*
|
@@ -834,7 +822,7 @@ interface Federatable<TContextData> {
|
|
834
822
|
* @param dispatcher An outbox dispatcher callback to register.
|
835
823
|
* @throws {@link RouterError} Thrown if the path pattern is invalid.
|
836
824
|
*/
|
837
|
-
setOutboxDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Activity, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
825
|
+
setOutboxDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Activity, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
838
826
|
/**
|
839
827
|
* Registers a following collection dispatcher.
|
840
828
|
* @param path The URI path pattern for the following collection. The syntax
|
@@ -846,7 +834,7 @@ interface Federatable<TContextData> {
|
|
846
834
|
* callbacks.
|
847
835
|
* @throws {RouterError} Thrown if the path pattern is invalid.
|
848
836
|
*/
|
849
|
-
setFollowingDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Actor | URL, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
837
|
+
setFollowingDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Actor | URL, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
850
838
|
/**
|
851
839
|
* Registers a followers collection dispatcher.
|
852
840
|
* @param path The URI path pattern for the followers collection. The syntax
|
@@ -858,7 +846,7 @@ interface Federatable<TContextData> {
|
|
858
846
|
* callbacks.
|
859
847
|
* @throws {@link RouterError} Thrown if the path pattern is invalid.
|
860
848
|
*/
|
861
|
-
setFollowersDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Recipient, Context<TContextData>, TContextData, URL>): CollectionCallbackSetters<Context<TContextData>, TContextData, URL>;
|
849
|
+
setFollowersDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Recipient, Context<TContextData>, TContextData, URL>): CollectionCallbackSetters<Context<TContextData>, TContextData, URL>;
|
862
850
|
/**
|
863
851
|
* Registers a liked collection dispatcher.
|
864
852
|
* @param path The URI path pattern for the liked collection. The syntax
|
@@ -870,7 +858,7 @@ interface Federatable<TContextData> {
|
|
870
858
|
* callbacks.
|
871
859
|
* @throws {@link RouterError} Thrown if the path pattern is invalid.
|
872
860
|
*/
|
873
|
-
setLikedDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Object$1 | URL, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
861
|
+
setLikedDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Object$1 | URL, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
874
862
|
/**
|
875
863
|
* Registers a featured collection dispatcher.
|
876
864
|
* @param path The URI path pattern for the featured collection. The syntax
|
@@ -882,7 +870,7 @@ interface Federatable<TContextData> {
|
|
882
870
|
* callbacks.
|
883
871
|
* @throws {@link RouterError} Thrown if the path pattern is invalid.
|
884
872
|
*/
|
885
|
-
setFeaturedDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Object$1, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
873
|
+
setFeaturedDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Object$1, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
886
874
|
/**
|
887
875
|
* Registers a featured tags collection dispatcher.
|
888
876
|
* @param path The URI path pattern for the featured tags collection.
|
@@ -894,7 +882,7 @@ interface Federatable<TContextData> {
|
|
894
882
|
* callbacks.
|
895
883
|
* @throws {@link RouterError} Thrown if the path pattern is invalid.
|
896
884
|
*/
|
897
|
-
setFeaturedTagsDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Hashtag, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
885
|
+
setFeaturedTagsDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Hashtag, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
898
886
|
/**
|
899
887
|
* Assigns the URL path for the inbox and starts setting inbox listeners.
|
900
888
|
*
|
@@ -924,7 +912,7 @@ interface Federatable<TContextData> {
|
|
924
912
|
* @returns An object to register inbox listeners.
|
925
913
|
* @throws {RouteError} Thrown if the path pattern is invalid.
|
926
914
|
*/
|
927
|
-
setInboxListeners(inboxPath: `${string}{identifier}${string}` | `${string}{handle}${string}`, sharedInboxPath?: string): InboxListenerSetters<TContextData>;
|
915
|
+
setInboxListeners(inboxPath: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, sharedInboxPath?: string): InboxListenerSetters<TContextData>;
|
928
916
|
/**
|
929
917
|
* Registers a collection of objects dispatcher.
|
930
918
|
*
|
@@ -939,7 +927,67 @@ interface Federatable<TContextData> {
|
|
939
927
|
* The path must have one or more variables.
|
940
928
|
* @param dispatcher A collection dispatcher callback to register.
|
941
929
|
*/
|
942
|
-
setCollectionDispatcher<TObject extends Object$1,
|
930
|
+
setCollectionDispatcher<TObject extends Object$1, TParam extends string>(name: string | symbol, itemType: ConstructorWithTypeId<TObject>, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: CustomCollectionDispatcher<TObject, TParam, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>;
|
931
|
+
/**
|
932
|
+
* Registers a collection of objects dispatcher.
|
933
|
+
*
|
934
|
+
* @template TContextData The context data to pass to the {@link Context}.
|
935
|
+
* @template TObject The type of objects to dispatch.
|
936
|
+
* @template TParam The parameter names of the requested URL.
|
937
|
+
* @param name A unique name for the collection dispatcher.
|
938
|
+
* @param itemType The Activity Vocabulary class of the object to dispatch.
|
939
|
+
* @param path The URI path pattern for the collection dispatcher.
|
940
|
+
* The syntax is based on URI Template
|
941
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
|
942
|
+
* The path must have one or more variables.
|
943
|
+
* @param dispatcher A collection dispatcher callback to register.
|
944
|
+
*/
|
945
|
+
setCollectionDispatcher<TObject extends Object$1, TParam extends string>(name: string | symbol, itemType: ConstructorWithTypeId<TObject>, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: CustomCollectionDispatcher<TObject, TParam, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>;
|
946
|
+
/**
|
947
|
+
* Registers a collection of objects dispatcher.
|
948
|
+
*
|
949
|
+
* @template TContextData The context data to pass to the {@link Context}.
|
950
|
+
* @template TObject The type of objects to dispatch.
|
951
|
+
* @template TParam The parameter names of the requested URL.
|
952
|
+
* @param name A unique name for the collection dispatcher.
|
953
|
+
* @param itemType The Activity Vocabulary class of the object to dispatch.
|
954
|
+
* @param path The URI path pattern for the collection dispatcher.
|
955
|
+
* The syntax is based on URI Template
|
956
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
|
957
|
+
* The path must have one or more variables.
|
958
|
+
* @param dispatcher A collection dispatcher callback to register.
|
959
|
+
*/
|
960
|
+
setCollectionDispatcher<TObject extends Object$1, TParam extends string>(name: string | symbol, itemType: ConstructorWithTypeId<TObject>, path: `${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: CustomCollectionDispatcher<TObject, TParam, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>;
|
961
|
+
/**
|
962
|
+
* Registers an ordered collection of objects dispatcher.
|
963
|
+
*
|
964
|
+
* @template TContextData The context data to pass to the {@link Context}.
|
965
|
+
* @template TObject The type of objects to dispatch.
|
966
|
+
* @template TParam The parameter names of the requested URL.
|
967
|
+
* @param name A unique name for the collection dispatcher.
|
968
|
+
* @param itemType The Activity Vocabulary class of the object to dispatch.
|
969
|
+
* @param path The URI path pattern for the collection dispatcher.
|
970
|
+
* The syntax is based on URI Template
|
971
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
|
972
|
+
* The path must have one or more variables.
|
973
|
+
* @param dispatcher A collection dispatcher callback to register.
|
974
|
+
*/
|
975
|
+
setOrderedCollectionDispatcher<TObject extends Object$1, TParam extends string>(name: string | symbol, itemType: ConstructorWithTypeId<TObject>, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: CustomCollectionDispatcher<TObject, TParam, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>;
|
976
|
+
/**
|
977
|
+
* Registers an ordered collection of objects dispatcher.
|
978
|
+
*
|
979
|
+
* @template TContextData The context data to pass to the {@link Context}.
|
980
|
+
* @template TObject The type of objects to dispatch.
|
981
|
+
* @template TParam The parameter names of the requested URL.
|
982
|
+
* @param name A unique name for the collection dispatcher.
|
983
|
+
* @param itemType The Activity Vocabulary class of the object to dispatch.
|
984
|
+
* @param path The URI path pattern for the collection dispatcher.
|
985
|
+
* The syntax is based on URI Template
|
986
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
|
987
|
+
* The path must have one or more variables.
|
988
|
+
* @param dispatcher A collection dispatcher callback to register.
|
989
|
+
*/
|
990
|
+
setOrderedCollectionDispatcher<TObject extends Object$1, TParam extends string>(name: string | symbol, itemType: ConstructorWithTypeId<TObject>, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: CustomCollectionDispatcher<TObject, TParam, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>;
|
943
991
|
/**
|
944
992
|
* Registers an ordered collection of objects dispatcher.
|
945
993
|
*
|
@@ -954,7 +1002,7 @@ interface Federatable<TContextData> {
|
|
954
1002
|
* The path must have one or more variables.
|
955
1003
|
* @param dispatcher A collection dispatcher callback to register.
|
956
1004
|
*/
|
957
|
-
setOrderedCollectionDispatcher<TObject extends Object$1,
|
1005
|
+
setOrderedCollectionDispatcher<TObject extends Object$1, TParam extends string>(name: string | symbol, itemType: ConstructorWithTypeId<TObject>, path: `${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: CustomCollectionDispatcher<TObject, TParam, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>;
|
958
1006
|
}
|
959
1007
|
/**
|
960
1008
|
* An object that registers federation-related business logic and dispatches
|
@@ -1310,6 +1358,36 @@ interface CollectionCallbackSetters<TContext extends Context<TContextData>, TCon
|
|
1310
1358
|
*/
|
1311
1359
|
authorize(predicate: AuthorizePredicate<TContextData>): CollectionCallbackSetters<TContext, TContextData, TFilter>;
|
1312
1360
|
}
|
1361
|
+
/**
|
1362
|
+
* The strategy for handling activity idempotency in inbox processing.
|
1363
|
+
*
|
1364
|
+
* - `"global"`: Activities are deduplicated globally across all inboxes and
|
1365
|
+
* origins. The same activity ID will be processed only once, regardless
|
1366
|
+
* of which inbox receives it or which server sent it.
|
1367
|
+
*
|
1368
|
+
* - `"per-origin"`: Activities are deduplicated per receiving server's origin.
|
1369
|
+
* The same activity ID will be processed only once on each receiving server,
|
1370
|
+
* but can be processed separately on different receiving servers. This was
|
1371
|
+
* the default behavior in Fedify 1.x versions.
|
1372
|
+
*
|
1373
|
+
* - `"per-inbox"`: Activities are deduplicated per inbox. The same activity
|
1374
|
+
* ID can be processed once per inbox, allowing the same activity to be
|
1375
|
+
* delivered to multiple inboxes independently. This follows standard
|
1376
|
+
* ActivityPub behavior and will be the default in Fedify 2.0.
|
1377
|
+
*
|
1378
|
+
* @since 1.9.0
|
1379
|
+
*/
|
1380
|
+
type IdempotencyStrategy = "global" | "per-origin" | "per-inbox";
|
1381
|
+
/**
|
1382
|
+
* A callback to generate a custom idempotency key for an activity.
|
1383
|
+
* Returns the cache key to use, or null to skip idempotency checking.
|
1384
|
+
* @template TContextData The context data to pass to the {@link InboxContext}.
|
1385
|
+
* @param ctx The inbox context.
|
1386
|
+
* @param activity The activity being processed.
|
1387
|
+
* @returns The idempotency key to use for caching, or null to skip caching.
|
1388
|
+
* @since 1.9.0
|
1389
|
+
*/
|
1390
|
+
type IdempotencyKeyCallback<TContextData> = (ctx: InboxContext<TContextData>, activity: Activity) => string | null | Promise<string | null>;
|
1313
1391
|
/**
|
1314
1392
|
* Registry for inbox listeners for different activity types.
|
1315
1393
|
*/
|
@@ -1340,6 +1418,36 @@ interface InboxListenerSetters<TContextData> {
|
|
1340
1418
|
* @since 0.11.0
|
1341
1419
|
*/
|
1342
1420
|
setSharedKeyDispatcher(dispatcher: SharedInboxKeyDispatcher<TContextData>): InboxListenerSetters<TContextData>;
|
1421
|
+
/**
|
1422
|
+
* Configures the strategy for handling activity idempotency in inbox processing.
|
1423
|
+
*
|
1424
|
+
* @example
|
1425
|
+
* Use per-inbox strategy (standard ActivityPub behavior):
|
1426
|
+
* ```
|
1427
|
+
* federation
|
1428
|
+
* .setInboxListeners("/users/{identifier}/inbox", "/inbox")
|
1429
|
+
* .withIdempotency("per-inbox");
|
1430
|
+
* ```
|
1431
|
+
*
|
1432
|
+
* Use custom strategy:
|
1433
|
+
* ```
|
1434
|
+
* federation
|
1435
|
+
* .setInboxListeners("/users/{identifier}/inbox", "/inbox")
|
1436
|
+
* .withIdempotency((ctx, activity) => {
|
1437
|
+
* // Return null to skip idempotency
|
1438
|
+
* return `${ctx.origin}:${activity.id?.href}:${ctx.recipient}`;
|
1439
|
+
* });
|
1440
|
+
* ```
|
1441
|
+
*
|
1442
|
+
* @param strategy The idempotency strategy to use. Can be:
|
1443
|
+
* - `"global"`: Activities are deduplicated across all inboxes and origins
|
1444
|
+
* - `"per-origin"`: Activities are deduplicated per inbox origin
|
1445
|
+
* - `"per-inbox"`: Activities are deduplicated per inbox
|
1446
|
+
* - A custom callback function that returns the cache key to use
|
1447
|
+
* @returns The setters object so that settings can be chained.
|
1448
|
+
* @since 1.9.0
|
1449
|
+
*/
|
1450
|
+
withIdempotency(strategy: IdempotencyStrategy | IdempotencyKeyCallback<TContextData>): InboxListenerSetters<TContextData>;
|
1343
1451
|
}
|
1344
1452
|
/**
|
1345
1453
|
* Parameters of {@link Federation.fetch} method.
|
@@ -1378,38 +1486,38 @@ interface FederationFetchOptions<TContextData> {
|
|
1378
1486
|
/**
|
1379
1487
|
* Additional settings for a custom collection dispatcher.
|
1380
1488
|
*
|
1381
|
-
* @template
|
1489
|
+
* @template TParam The type of the parameters in the URL path.
|
1382
1490
|
* @template TContext The type of the context. {@link Context} or
|
1383
1491
|
* {@link RequestContext}.
|
1384
1492
|
* @template TContextData The context data to pass to the {@link Context}.
|
1385
1493
|
* @template TFilter The type of filter for the collection.
|
1386
1494
|
*/
|
1387
|
-
interface CustomCollectionCallbackSetters<
|
1495
|
+
interface CustomCollectionCallbackSetters<TParam extends string, TContext extends Context<TContextData>, TContextData> {
|
1388
1496
|
/**
|
1389
1497
|
* Sets the counter for the custom collection.
|
1390
1498
|
* @param counter A callback that returns the number of items in the custom collection.
|
1391
1499
|
* @returns The setters object so that settings can be chained.
|
1392
1500
|
*/
|
1393
|
-
setCounter(counter: CustomCollectionCounter<
|
1501
|
+
setCounter(counter: CustomCollectionCounter<TParam, TContextData>): CustomCollectionCallbackSetters<TParam, TContext, TContextData>;
|
1394
1502
|
/**
|
1395
1503
|
* Sets the first cursor for the custom collection.
|
1396
1504
|
* @param cursor The cursor for the first item in the custom collection.
|
1397
1505
|
* @returns The setters object so that settings can be chained.
|
1398
1506
|
*/
|
1399
|
-
setFirstCursor(cursor: CustomCollectionCursor<
|
1507
|
+
setFirstCursor(cursor: CustomCollectionCursor<TParam, TContext, TContextData>): CustomCollectionCallbackSetters<TParam, TContext, TContextData>;
|
1400
1508
|
/**
|
1401
1509
|
* Sets the last cursor for the custom collection.
|
1402
1510
|
* @param cursor The cursor for the last item in the custom collection.
|
1403
1511
|
* @returns The setters object so that settings can be chained.
|
1404
1512
|
*/
|
1405
|
-
setLastCursor(cursor: CustomCollectionCursor<
|
1513
|
+
setLastCursor(cursor: CustomCollectionCursor<TParam, TContext, TContextData>): CustomCollectionCallbackSetters<TParam, TContext, TContextData>;
|
1406
1514
|
/**
|
1407
1515
|
* Specifies the conditions under which requests are authorized.
|
1408
1516
|
* @param predicate A callback that returns whether a request is authorized.
|
1409
1517
|
* @returns The setters object so that settings can be chained.
|
1410
1518
|
* @since 0.7.0
|
1411
1519
|
*/
|
1412
|
-
authorize(predicate: ObjectAuthorizePredicate<TContextData, string>): CustomCollectionCallbackSetters<
|
1520
|
+
authorize(predicate: ObjectAuthorizePredicate<TContextData, string>): CustomCollectionCallbackSetters<TParam, TContext, TContextData>;
|
1413
1521
|
}
|
1414
1522
|
/**
|
1415
1523
|
* Represents an object with a type ID, which is either a constructor or an
|
@@ -1421,73 +1529,34 @@ type ConstructorWithTypeId<TObject extends Object$1> = (new (...args: any[]) =>
|
|
1421
1529
|
typeId: URL;
|
1422
1530
|
};
|
1423
1531
|
/**
|
1424
|
-
*
|
1425
|
-
*
|
1426
|
-
* values are their string representations.
|
1427
|
-
* @returns A string representing the path with all parameters.
|
1428
|
-
* @example
|
1429
|
-
* ```ts
|
1430
|
-
* type UserPostPath = ParamsKeyPath<{ userId: string; postId: string }>;
|
1431
|
-
* let userPostPath: UserPostPath;
|
1432
|
-
* // userPostPath = "/posts/{postId}"; // invalid - does not contain `{userId}`
|
1433
|
-
* // userPostPath = "/users/{userId}"; // invalid - does not contain `{postId}`
|
1434
|
-
* userPostPath = "/users/{userId}/posts/{postId}"; // valid
|
1435
|
-
* userPostPath = "/posts/{postId}/users/{userId}"; // valid
|
1436
|
-
* ```
|
1437
|
-
*/
|
1438
|
-
type ParamsKeyPath<Params extends Record<string, string>> = ParamsPath<Extract<keyof Params, string>> & string;
|
1439
|
-
/**
|
1440
|
-
* Represents a path with multiple parameters.
|
1441
|
-
* All permutations of the parameters are included in the union type.
|
1442
|
-
* The path must have all parameters in the form of `{paramName}`.
|
1443
|
-
* @param Params - A union of parameter names.
|
1444
|
-
* @returns A string representing the path with all parameters.
|
1445
|
-
* @example
|
1446
|
-
* ```ts
|
1447
|
-
* type UserPostPath = ParamsPath<"userId" | "postId">;
|
1448
|
-
* // = `${string}{userId}${string}` & `${string}{postId}${string}`
|
1449
|
-
* // =
|
1450
|
-
* // | `${string}{userId}${string}{postId}${string}`
|
1451
|
-
* // | `${string}{postId}${string}{userId}${string}`
|
1452
|
-
* let userPostPath: UserPostPath;
|
1453
|
-
* userPostPath = "/users/posts"; // ❌ invalid
|
1454
|
-
* userPostPath = "/users/{userId}"; // ❌ invalid
|
1455
|
-
* userPostPath = "/posts/{postId}"; // ❌ invalid
|
1456
|
-
* userPostPath = "/users/{userId}/posts/{postId}"; // ✅ valid
|
1457
|
-
* userPostPath = "/posts/{postId}/users/{userId}"; // ✅ valid
|
1458
|
-
*/
|
1459
|
-
type ParamsPath<Params extends string> = UnionToIntersection<ParamPath<Params>>;
|
1460
|
-
/**
|
1461
|
-
* Represents a path with a single parameter.
|
1462
|
-
* The path must have at least one of the parameters in the form of `{paramName}`.
|
1463
|
-
* @param Param - The name of the parameter.
|
1464
|
-
* @returns A string representing the path with the parameter.
|
1465
|
-
* @example
|
1466
|
-
* ```ts
|
1467
|
-
* type UserPostPath = ParamPath<"userId" | "postId">;
|
1468
|
-
* // = `${string}{userId}${string}` | `${string}{postId}${string}`
|
1469
|
-
* let userPostPath: UserPostPath;
|
1470
|
-
* userPostPath = "/users/posts"; // ❌ invalid
|
1471
|
-
* userPostPath = "/users/{userId}"; // ✅ valid
|
1472
|
-
* userPostPath = "/posts/{postId}"; // ✅ valid
|
1473
|
-
* userPostPath = "/users/{userId}/posts/{postId}"; // ✅ valid
|
1474
|
-
* userPostPath = "/posts/{postId}/users/{userId}"; // ✅ valid
|
1475
|
-
*/
|
1476
|
-
type ParamPath<Param extends string> = `${string}{${Param}}${string}`;
|
1477
|
-
/**
|
1478
|
-
* Converts union types to intersection types.
|
1532
|
+
* Defines a union of all valid RFC 6570 URI Template expressions for a given
|
1533
|
+
* parameter name.
|
1479
1534
|
*
|
1480
|
-
*
|
1481
|
-
*
|
1535
|
+
* RFC 6570 specifies a syntax for URI templates, allowing for variable
|
1536
|
+
* expansion. This type captures all Level 1-4 operator expressions for a
|
1537
|
+
* single, named variable.
|
1538
|
+
*
|
1539
|
+
* The supported expression types are:
|
1540
|
+
* - `{Param}`: Simple string expansion
|
1541
|
+
* - `+{Param}`: Reserved string expansion
|
1542
|
+
* - `#{Param}`: Fragment expansion
|
1543
|
+
* - `{.Param}`: Label expansion with a dot-prefix
|
1544
|
+
* - `{/Param}`: Path segment expansion
|
1545
|
+
* - `{;Param}`: Path-style parameter expansion
|
1546
|
+
* - `{?Param}`: Query component expansion
|
1547
|
+
* - `{&Param}`: Query continuation expansion
|
1548
|
+
*
|
1549
|
+
* @template Param The name of the parameter to be used in the expressions.
|
1482
1550
|
* @example
|
1483
1551
|
* ```ts
|
1484
|
-
* type
|
1485
|
-
*
|
1486
|
-
*
|
1487
|
-
*
|
1488
|
-
*
|
1552
|
+
* type UserIdExpression = Rfc6570Expression<"userId">;
|
1553
|
+
*
|
1554
|
+
* // The variable `userPath` can be assigned any of the valid expressions.
|
1555
|
+
* const userPath: UserIdExpression = "{/userId}";
|
1556
|
+
* ```
|
1557
|
+
* @see {@link https://tools.ietf.org/html/rfc6570} for the full specification.
|
1489
1558
|
*/
|
1490
|
-
type
|
1559
|
+
type Rfc6570Expression<Param extends string> = `{${Param}}` | `{+${Param}}` | `{#${Param}}` | `{.${Param}}` | `{/${Param}}` | `{;${Param}}` | `{?${Param}}` | `{&${Param}}`;
|
1491
1560
|
//#endregion
|
1492
1561
|
//#region src/federation/context.d.ts
|
1493
1562
|
/**
|
@@ -1576,9 +1645,7 @@ interface Context<TContextData> {
|
|
1576
1645
|
* @throws {TypeError} If values are invalid.
|
1577
1646
|
* @since 0.7.0
|
1578
1647
|
*/
|
1579
|
-
getObjectUri<TObject extends Object$1>(cls:
|
1580
|
-
typeId: URL;
|
1581
|
-
}, values: Record<string, string>): URL;
|
1648
|
+
getObjectUri<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>): URL;
|
1582
1649
|
/**
|
1583
1650
|
* Builds the URI of an actor's outbox with the given identifier.
|
1584
1651
|
* @param identifier The actor's identifier.
|
@@ -1892,9 +1959,7 @@ interface RequestContext<TContextData> extends Context<TContextData> {
|
|
1892
1959
|
* @throws {TypeError} If values are invalid.
|
1893
1960
|
* @since 0.7.0
|
1894
1961
|
*/
|
1895
|
-
getObject<TObject extends Object$1>(cls:
|
1896
|
-
typeId: URL;
|
1897
|
-
}, values: Record<string, string>): Promise<TObject | null>;
|
1962
|
+
getObject<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>): Promise<TObject | null>;
|
1898
1963
|
/**
|
1899
1964
|
* Gets the public key of the sender, if any exists and it is verified.
|
1900
1965
|
* Otherwise, `null` is returned.
|
@@ -2038,9 +2103,7 @@ type ParseUriResult =
|
|
2038
2103
|
* The case of an object URI.
|
2039
2104
|
*/ | {
|
2040
2105
|
readonly type: "object";
|
2041
|
-
readonly class:
|
2042
|
-
typeId: URL;
|
2043
|
-
};
|
2106
|
+
readonly class: ConstructorWithTypeId<Object$1>;
|
2044
2107
|
readonly typeId: URL;
|
2045
2108
|
readonly values: Record<string, string>;
|
2046
2109
|
}
|
@@ -2258,4 +2321,4 @@ interface ActorKeyPair extends CryptoKeyPair {
|
|
2258
2321
|
multikey: Multikey;
|
2259
2322
|
}
|
2260
2323
|
//#endregion
|
2261
|
-
export { ActivityTransformer, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CreateFederationOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, Message, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, PageItems,
|
2324
|
+
export { ActivityTransformer, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CreateFederationOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, Message, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, PageItems, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable };
|
@@ -10,7 +10,7 @@ const node_net = require_chunk.__toESM(require("node:net"));
|
|
10
10
|
|
11
11
|
//#region deno.json
|
12
12
|
var name = "@fedify/fedify";
|
13
|
-
var version = "1.9.0-pr.
|
13
|
+
var version = "1.9.0-pr.455.1742+fb29545a";
|
14
14
|
var license = "MIT";
|
15
15
|
var exports$1 = {
|
16
16
|
".": "./src/mod.ts",
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { __commonJS, __toESM } from "./type-
|
6
|
+
import { __commonJS, __toESM } from "./type-Du-WE8NC.js";
|
7
7
|
|
8
8
|
//#region ../../node_modules/.pnpm/glob-to-regexp@0.4.1/node_modules/glob-to-regexp/index.js
|
9
9
|
var require_glob_to_regexp = __commonJS({ "../../node_modules/.pnpm/glob-to-regexp@0.4.1/node_modules/glob-to-regexp/index.js"(exports, module) {
|
@@ -3,16 +3,16 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { Activity, Note, Person } from "../type-
|
6
|
+
import { Activity, Note, Person } from "../type-Du-WE8NC.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
10
|
import { MemoryKvStore } from "../kv-CRZrzyXm.js";
|
11
11
|
import { parseSemVer } from "../semver-dArNLkR9.js";
|
12
|
-
import "../lookup-
|
13
|
-
import "../inbox-
|
14
|
-
import { createFederationBuilder } from "../builder-
|
15
|
-
import { test } from "../testing-
|
12
|
+
import "../lookup-B5jlZrQb.js";
|
13
|
+
import "../inbox-FbqGLKha.js";
|
14
|
+
import { createFederationBuilder } from "../builder-CqMKWEN0.js";
|
15
|
+
import { test } from "../testing-Bh2wmeXp.js";
|
16
16
|
import { assertExists } from "../std__assert-X-_kMxKM.js";
|
17
17
|
import "../assert_rejects-DiIiJbZn.js";
|
18
18
|
import "../assert_is_error-BPGph1Jx.js";
|
@@ -3,13 +3,13 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import "../type-
|
6
|
+
import "../type-Du-WE8NC.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-
|
10
|
+
import "../lookup-B5jlZrQb.js";
|
11
11
|
import { buildCollectionSynchronizationHeader, digest } from "../collection-CSzG2j1P.js";
|
12
|
-
import { test } from "../testing-
|
12
|
+
import { test } from "../testing-Bh2wmeXp.js";
|
13
13
|
import "../std__assert-X-_kMxKM.js";
|
14
14
|
import "../assert_rejects-DiIiJbZn.js";
|
15
15
|
import "../assert_is_error-BPGph1Jx.js";
|