@fedify/fedify 2.0.0-pr.412.1692 → 2.0.0-pr.412.1794

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.
Files changed (193) hide show
  1. package/README.md +3 -0
  2. package/dist/{actor-D5S46edz.js → actor-BXHc5r-q.js} +1 -1
  3. package/dist/{actor-CrTGiTZd.cjs → actor-Ba9Z1eNJ.cjs} +921 -1451
  4. package/dist/{actor-T6RyhRgk.d.ts → actor-DqFajh9s.d.ts} +2 -2
  5. package/dist/{actor-G2S5sPEA.js → actor-DzhunPC_.js} +189 -677
  6. package/dist/{actor-D6K058Tb.d.cts → actor-f2NtjyCg.d.cts} +2 -2
  7. package/dist/{assert_rejects-DiIiJbZn.js → assert_rejects-Ce45JcFg.js} +1 -1
  8. package/dist/{assert_is_error-BPGph1Jx.js → assert_throws-BNXdRGWP.js} +31 -1
  9. package/dist/{builder-OA47XRft.js → builder-u7usRsT3.js} +7 -8
  10. package/dist/{client-CegPX0Rn.d.cts → client-94iWEfQa.d.cts} +1 -1
  11. package/dist/{client-bgSdkFa2.d.ts → client-BsGzbnV-.d.ts} +1 -1
  12. package/dist/{client-Bmd-i8x8.js → client-pY7-3icS.js} +1 -1
  13. package/dist/compat/mod.d.cts +11 -12
  14. package/dist/compat/mod.d.ts +11 -12
  15. package/dist/compat/transformers.test.js +20 -20
  16. package/dist/{context-ByZprN0S.d.ts → context-DG0huGW-.d.ts} +124 -127
  17. package/dist/{context-C5BsZkDr.d.cts → context-DJ8aSy2Q.d.cts} +124 -127
  18. package/dist/{authdocloader-SjwloJUA.js → docloader-CrbAy9Oc.js} +17 -8
  19. package/dist/{esm-CwHz8Y8t.js → esm-C-Qa1zEM.js} +11 -11
  20. package/dist/federation/builder.test.js +8 -10
  21. package/dist/federation/collection.test.js +7 -9
  22. package/dist/federation/handler.test.js +25 -26
  23. package/dist/federation/idempotency.test.js +25 -26
  24. package/dist/federation/inbox.test.js +4 -6
  25. package/dist/federation/keycache.test.js +3 -4
  26. package/dist/federation/kv.test.js +6 -8
  27. package/dist/federation/middleware.test.js +32 -33
  28. package/dist/federation/mod.cjs +9 -11
  29. package/dist/federation/mod.d.cts +12 -13
  30. package/dist/federation/mod.d.ts +12 -13
  31. package/dist/federation/mod.js +9 -11
  32. package/dist/federation/mq.test.js +8 -10
  33. package/dist/federation/negotiation.test.js +7 -9
  34. package/dist/federation/retry.test.js +4 -5
  35. package/dist/federation/router.test.js +6 -8
  36. package/dist/federation/send.test.js +13 -15
  37. package/dist/{http-D6Uj2x2y.d.ts → http-BbO0ejuk.d.ts} +2 -2
  38. package/dist/{http-C5tC93Hn.js → http-CUVx-vzb.js} +256 -6
  39. package/dist/{http-DGjdMiLc.js → http-D2kIm9la.js} +2 -2
  40. package/dist/{http-BiBofurJ.cjs → http-Dofes42e.cjs} +289 -9
  41. package/dist/{http-D-e6AFwR.d.cts → http-M8k5mKc0.d.cts} +2 -2
  42. package/dist/{inbox-BoDY3z8G.js → inbox-HjG5peXY.js} +1 -1
  43. package/dist/{key-IxRhZpOF.js → key-CxdLUFS6.js} +3 -2
  44. package/dist/{keycache-TEniXNel.js → keycache-bU7COwsh.js} +1 -1
  45. package/dist/{keys-bZxcrZ9Z.js → keys-DMHs8XNn.js} +2 -1
  46. package/dist/kv-cache-CGXcDejL.js +122 -0
  47. package/dist/kv-cache-DN9pfMBe.js +94 -0
  48. package/dist/kv-cache-Dkvbn6rg.cjs +134 -0
  49. package/dist/{ld-DW7A0uIc.js → ld-CIhvSCCr.js} +3 -2
  50. package/dist/{lookup-cVRa2QM-.js → lookup-CHkCVZTU.js} +131 -2
  51. package/dist/lookup-CfFkONZD.cjs +272 -0
  52. package/dist/{type-NEA09tSC.js → lookup-DQRtjvb1.js} +503 -5328
  53. package/dist/middleware-Bot7EEwV.js +26 -0
  54. package/dist/middleware-CFJgmUMW.cjs +15 -0
  55. package/dist/{middleware-Cgr3PtaJ.js → middleware-CJlj5Olw.js} +44 -48
  56. package/dist/middleware-CjHl2NHA.js +15 -0
  57. package/dist/{middleware-TfuVoceY.cjs → middleware-D74TgW2E.cjs} +60 -66
  58. package/dist/{middleware-DvvYAIsd.js → middleware-DMk2Mdn9.js} +40 -46
  59. package/dist/mod-0noXw66R.d.cts +107 -0
  60. package/dist/{mod-BhUKmBJD.d.ts → mod-B2iOw50L.d.ts} +3 -3
  61. package/dist/mod-B9M-8jm2.d.ts +109 -0
  62. package/dist/{mod-DlU8ISoa.d.ts → mod-BlVovdcy.d.ts} +2 -2
  63. package/dist/{mod-D6hQoxC5.d.ts → mod-BoHnwOCs.d.ts} +2 -2
  64. package/dist/{mod-CxkWO3Mg.d.cts → mod-BxRCHTz-.d.cts} +2 -2
  65. package/dist/{mod-jQ4OODsl.d.cts → mod-C58MZ7Wx.d.cts} +1 -1
  66. package/dist/{mod-8DMWKtQE.d.cts → mod-DJcZDvjA.d.cts} +2 -2
  67. package/dist/{mod-Djzcw2ry.d.cts → mod-DgdBYYa0.d.cts} +3 -3
  68. package/dist/{mod-DBzN0aCM.d.ts → mod-Ds0mpFZU.d.ts} +1 -1
  69. package/dist/mod.cjs +19 -32
  70. package/dist/mod.d.cts +15 -16
  71. package/dist/mod.d.ts +16 -17
  72. package/dist/mod.js +14 -16
  73. package/dist/nodeinfo/client.test.js +8 -10
  74. package/dist/nodeinfo/handler.test.js +24 -25
  75. package/dist/nodeinfo/mod.cjs +2 -3
  76. package/dist/nodeinfo/mod.d.cts +2 -4
  77. package/dist/nodeinfo/mod.d.ts +2 -4
  78. package/dist/nodeinfo/mod.js +2 -3
  79. package/dist/nodeinfo/types.test.js +7 -9
  80. package/dist/{owner-BN_tO3cY.d.cts → owner-B4HbyP8s.d.cts} +3 -3
  81. package/dist/{owner-6Vc3UXXE.js → owner-Dvh7mBvr.js} +3 -2
  82. package/dist/{owner-hd9lvQcP.d.ts → owner-kQRGVXG1.d.ts} +3 -3
  83. package/dist/{proof-CRJWXFfT.cjs → proof-D0uThUvD.cjs} +17 -16
  84. package/dist/{proof-C1jhbeNv.js → proof-Dgy35fzc.js} +2 -2
  85. package/dist/{proof-Chi90OXv.js → proof-fqzaMJ4g.js} +5 -4
  86. package/dist/{send-DjATl6i3.js → send-Drp20VO9.js} +2 -2
  87. package/dist/sig/http.test.js +12 -13
  88. package/dist/sig/key.test.js +9 -11
  89. package/dist/sig/ld.test.js +8 -10
  90. package/dist/sig/mod.cjs +9 -11
  91. package/dist/sig/mod.d.cts +5 -7
  92. package/dist/sig/mod.d.ts +5 -7
  93. package/dist/sig/mod.js +5 -7
  94. package/dist/sig/owner.test.js +10 -12
  95. package/dist/sig/proof.test.js +13 -14
  96. package/dist/testing/docloader.test.js +6 -8
  97. package/dist/testing/mod.d.ts +114 -196
  98. package/dist/testing/mod.js +2 -3
  99. package/dist/{testing-BnfPB5T-.js → testing-g4UC4liW.js} +1 -2
  100. package/dist/{types-dLXLjVLf.js → types-BtUjyi5y.js} +1 -1
  101. package/dist/{types-CmmUQisS.cjs → types-CWgzGaqk.cjs} +3 -3
  102. package/dist/{runtime/authdocloader.test.js → utils/docloader.test.js} +14 -15
  103. package/dist/utils/kv-cache.test.js +209 -0
  104. package/dist/utils/mod.cjs +12 -0
  105. package/dist/utils/mod.d.cts +5 -0
  106. package/dist/utils/mod.d.ts +7 -0
  107. package/dist/utils/mod.js +11 -0
  108. package/dist/vocab/actor.test.js +8 -10
  109. package/dist/vocab/lookup.test.js +7 -9
  110. package/dist/vocab/mod.cjs +3 -4
  111. package/dist/vocab/mod.d.cts +3 -5
  112. package/dist/vocab/mod.d.ts +3 -5
  113. package/dist/vocab/mod.js +3 -4
  114. package/dist/vocab/type.test.js +2 -3
  115. package/dist/vocab/vocab.test.js +9 -10
  116. package/dist/{vocab-BI0Ak5lL.d.ts → vocab-BCWe1Ih5.d.ts} +2 -21
  117. package/dist/{vocab-rWbHpc2J.js → vocab-BnR3nIU9.js} +3 -3
  118. package/dist/{vocab-Dw1-yVGg.d.cts → vocab-CeDBzu-f.d.cts} +2 -21
  119. package/dist/{vocab-C5Y-0fGj.cjs → vocab-DFaWWYDn.cjs} +5 -5
  120. package/dist/webfinger/handler.test.js +24 -25
  121. package/dist/webfinger/lookup.test.js +7 -9
  122. package/dist/webfinger/mod.cjs +2 -3
  123. package/dist/webfinger/mod.d.cts +1 -3
  124. package/dist/webfinger/mod.d.ts +1 -3
  125. package/dist/webfinger/mod.js +2 -3
  126. package/dist/x/cfworkers.d.cts +2 -2
  127. package/dist/x/cfworkers.d.ts +2 -2
  128. package/dist/x/cfworkers.test.js +6 -8
  129. package/dist/x/hono.d.cts +10 -11
  130. package/dist/x/hono.d.ts +10 -11
  131. package/dist/x/sveltekit.d.cts +10 -11
  132. package/dist/x/sveltekit.d.ts +10 -11
  133. package/package.json +18 -17
  134. package/dist/assert_throws-BOO88avQ.js +0 -39
  135. package/dist/authdocloader-C5AvdCCi.js +0 -52
  136. package/dist/authdocloader-CQMPmpaO.cjs +0 -58
  137. package/dist/docloader-7Ey7wNHx.cjs +0 -4861
  138. package/dist/docloader-CkweNhUH.js +0 -4795
  139. package/dist/docloader-CxWcuWqQ.d.ts +0 -221
  140. package/dist/docloader-D-MrRyHl.d.cts +0 -219
  141. package/dist/key-CZR7QraT.cjs +0 -290
  142. package/dist/key-Cf8MffVe.cjs +0 -10
  143. package/dist/key-CkxrAIyp.js +0 -260
  144. package/dist/key-Dk0j88Jo.js +0 -10
  145. package/dist/key-Epcl5jpz.js +0 -10
  146. package/dist/lookup-DhQCVVja.js +0 -331
  147. package/dist/lookup-DiV4LFBg.cjs +0 -137
  148. package/dist/middleware-Be1JStOx.js +0 -17
  149. package/dist/middleware-CDOK7WOb.js +0 -26
  150. package/dist/middleware-EjIW2mZB.cjs +0 -17
  151. package/dist/mod-CerN_Sza.d.ts +0 -104
  152. package/dist/mod-Cj1tHXBR.d.cts +0 -102
  153. package/dist/runtime/docloader.test.js +0 -522
  154. package/dist/runtime/key.test.d.ts +0 -3
  155. package/dist/runtime/key.test.js +0 -103
  156. package/dist/runtime/langstr.test.d.ts +0 -3
  157. package/dist/runtime/langstr.test.js +0 -39
  158. package/dist/runtime/link.test.d.ts +0 -3
  159. package/dist/runtime/link.test.js +0 -61
  160. package/dist/runtime/mod.cjs +0 -25
  161. package/dist/runtime/mod.d.cts +0 -6
  162. package/dist/runtime/mod.d.ts +0 -8
  163. package/dist/runtime/mod.js +0 -13
  164. package/dist/runtime/multibase/multibase.test.d.ts +0 -3
  165. package/dist/runtime/multibase/multibase.test.js +0 -358
  166. package/dist/runtime/url.test.d.ts +0 -3
  167. package/dist/runtime/url.test.js +0 -45
  168. /package/dist/{assert_not_equals-f3m3epl3.js → assert_not_equals-C80BG-_5.js} +0 -0
  169. /package/dist/{collection-CcnIw1qY.js → collection-BzWsN9pB.js} +0 -0
  170. /package/dist/{denokv-Bv33Xxea.js → denokv-CCssOzMJ.js} +0 -0
  171. /package/dist/{federation-H2_En3j5.cjs → federation-CRpdnOMS.cjs} +0 -0
  172. /package/dist/{federation-D1U8YY9t.js → federation-jcR8-ZxP.js} +0 -0
  173. /package/dist/{kv-C7sopW2E.d.ts → kv-BKNZ-Tb-.d.ts} +0 -0
  174. /package/dist/{kv-63Cil1MD.d.cts → kv-Bxr0Q87_.d.cts} +0 -0
  175. /package/dist/{mod-FZd39qVq.d.cts → mod-B-hUPT2N.d.cts} +0 -0
  176. /package/dist/{mod-1pDWKvUL.d.ts → mod-CVgZgliM.d.ts} +0 -0
  177. /package/dist/{mod-g0xFzAP9.d.ts → mod-xIj-IT58.d.ts} +0 -0
  178. /package/dist/{mq-CRGm1e_F.d.ts → mq-CUKlBw08.d.ts} +0 -0
  179. /package/dist/{mq-B7R1Q-M5.d.cts → mq-DcJPkXD5.d.cts} +0 -0
  180. /package/dist/{negotiation-5NPJL6zp.js → negotiation-C4nFufNk.js} +0 -0
  181. /package/dist/{nodeinfo-DfycQ8Wf.js → nodeinfo-BnthBobC.js} +0 -0
  182. /package/dist/{nodeinfo-Co9lJrWl.cjs → nodeinfo-CdN0rEnZ.cjs} +0 -0
  183. /package/dist/{retry-D4GJ670a.js → retry-CfF8Gn4d.js} +0 -0
  184. /package/dist/{runtime-DPYEDf-o.js → sig-C34-oHBl.js} +0 -0
  185. /package/dist/{runtime-C58AJWSv.cjs → sig-YYj5tCnr.cjs} +0 -0
  186. /package/dist/{std__assert-X-_kMxKM.js → std__assert-DWivtrGR.js} +0 -0
  187. /package/dist/{types-BSuWJsOm.js → types-C2XVl6gj.js} +0 -0
  188. /package/dist/{runtime → utils}/docloader.test.d.ts +0 -0
  189. /package/dist/{runtime/authdocloader.test.d.ts → utils/kv-cache.test.d.ts} +0 -0
  190. /package/dist/{sig-Cj3tk-ig.js → utils-D-Va7aXC.js} +0 -0
  191. /package/dist/{sig-ByHXzqUi.cjs → utils-DyRU1gdZ.cjs} +0 -0
  192. /package/dist/{webfinger-De_bU0iE.js → webfinger-C72Y8lrh.js} +0 -0
  193. /package/dist/{webfinger-BjOEdFPs.cjs → webfinger-vAtLmxOF.cjs} +0 -0
@@ -1,13 +1,13 @@
1
- import { KvKey, KvStore } from "./kv-63Cil1MD.cjs";
2
- import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, GetUserAgentOptions } from "./docloader-D-MrRyHl.cjs";
3
- import { GetNodeInfoOptions, JsonValue, NodeInfo } from "./client-CegPX0Rn.cjs";
4
- import { Activity, Collection, CryptographicKey, Hashtag, Link, Multikey, Object as Object$1 } from "./vocab-Dw1-yVGg.cjs";
5
- import { Actor, Recipient } from "./actor-D6K058Tb.cjs";
6
- import { HttpMessageSignaturesSpec } from "./http-D-e6AFwR.cjs";
7
- import { GetKeyOwnerOptions } from "./owner-BN_tO3cY.cjs";
8
- import { LookupObjectOptions, TraverseCollectionOptions } from "./mod-CxkWO3Mg.cjs";
9
- import { Link as Link$1, LookupWebFingerOptions, ResourceDescriptor } from "./mod-jQ4OODsl.cjs";
10
- import { MessageQueue } from "./mq-B7R1Q-M5.cjs";
1
+ import { GetNodeInfoOptions, JsonValue, NodeInfo } from "./client-94iWEfQa.cjs";
2
+ import { Activity, Collection, CryptographicKey, Hashtag, Link, Multikey, Object as Object$1 } from "./vocab-CeDBzu-f.cjs";
3
+ import { Actor, Recipient } from "./actor-f2NtjyCg.cjs";
4
+ import { HttpMessageSignaturesSpec } from "./http-M8k5mKc0.cjs";
5
+ import { GetKeyOwnerOptions } from "./owner-B4HbyP8s.cjs";
6
+ import { LookupObjectOptions, TraverseCollectionOptions } from "./mod-BxRCHTz-.cjs";
7
+ import { Link as Link$1, LookupWebFingerOptions, ResourceDescriptor } from "./mod-C58MZ7Wx.cjs";
8
+ import { KvKey, KvStore } from "./kv-Bxr0Q87_.cjs";
9
+ import { MessageQueue } from "./mq-DcJPkXD5.cjs";
10
+ import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, GetUserAgentOptions } from "@fedify/vocab-runtime";
11
11
  import { Span, TracerProvider } from "@opentelemetry/api";
12
12
 
13
13
  //#region src/compat/types.d.ts
@@ -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, TParams extends Record<string, string>, TContext extends Context<TContextData>, TContextData> = (context: TContext, values: TParams, cursor: string | null) => PageItems<TItem> | null | Promise<PageItems<TItem> | null>;
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<TParams extends Record<string, string>, TContextData> = (context: RequestContext<TContextData>, values: TParams) => number | bigint | null | Promise<number | bigint | null>;
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<TParams extends Record<string, string>, TContext extends Context<TContextData>, TContextData> = (context: TContext, values: TParams) => string | null | Promise<string | null>;
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: (new (...args: any[]) => TObject) & {
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: (new (...args: any[]) => TObject) & {
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: (new (...args: any[]) => TObject) & {
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: (new (...args: any[]) => TObject) & {
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: (new (...args: any[]) => TObject) & {
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: (new (...args: any[]) => TObject) & {
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,37 @@ 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, TParams extends Record<string, string>>(name: string | symbol, itemType: ConstructorWithTypeId<TObject>, path: ParamsKeyPath<TParams>, dispatcher: CustomCollectionDispatcher<TObject, TParams, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParams, RequestContext<TContextData>, TContextData>;
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>;
943
961
  /**
944
962
  * Registers an ordered collection of objects dispatcher.
945
963
  *
@@ -954,7 +972,37 @@ interface Federatable<TContextData> {
954
972
  * The path must have one or more variables.
955
973
  * @param dispatcher A collection dispatcher callback to register.
956
974
  */
957
- setOrderedCollectionDispatcher<TObject extends Object$1, TParams extends Record<string, string>>(name: string | symbol, itemType: ConstructorWithTypeId<TObject>, path: ParamsKeyPath<TParams>, dispatcher: CustomCollectionDispatcher<TObject, TParams, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParams, RequestContext<TContextData>, TContextData>;
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>;
991
+ /**
992
+ * Registers an ordered collection of objects dispatcher.
993
+ *
994
+ * @template TContextData The context data to pass to the {@link Context}.
995
+ * @template TObject The type of objects to dispatch.
996
+ * @template TParam The parameter names of the requested URL.
997
+ * @param name A unique name for the collection dispatcher.
998
+ * @param itemType The Activity Vocabulary class of the object to dispatch.
999
+ * @param path The URI path pattern for the collection dispatcher.
1000
+ * The syntax is based on URI Template
1001
+ * ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
1002
+ * The path must have one or more variables.
1003
+ * @param dispatcher A collection dispatcher callback to register.
1004
+ */
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
@@ -1090,12 +1138,6 @@ interface FederationOptions<TContextData> {
1090
1138
  * @since 1.4.0
1091
1139
  */
1092
1140
  contextLoaderFactory?: DocumentLoaderFactory;
1093
- /**
1094
- * A custom JSON-LD context loader. By default, this uses the same loader
1095
- * as the document loader.
1096
- * @deprecated Use {@link contextLoaderFactory} instead.
1097
- */
1098
- contextLoader?: DocumentLoader;
1099
1141
  /**
1100
1142
  * A factory function that creates an authenticated document loader for a
1101
1143
  * given identity. This is used for fetching documents that require
@@ -1432,38 +1474,38 @@ interface FederationFetchOptions<TContextData> {
1432
1474
  /**
1433
1475
  * Additional settings for a custom collection dispatcher.
1434
1476
  *
1435
- * @template TParams The type of the parameters in the URL path.
1477
+ * @template TParam The type of the parameters in the URL path.
1436
1478
  * @template TContext The type of the context. {@link Context} or
1437
1479
  * {@link RequestContext}.
1438
1480
  * @template TContextData The context data to pass to the {@link Context}.
1439
1481
  * @template TFilter The type of filter for the collection.
1440
1482
  */
1441
- interface CustomCollectionCallbackSetters<TParams extends Record<string, string>, TContext extends Context<TContextData>, TContextData> {
1483
+ interface CustomCollectionCallbackSetters<TParam extends string, TContext extends Context<TContextData>, TContextData> {
1442
1484
  /**
1443
1485
  * Sets the counter for the custom collection.
1444
1486
  * @param counter A callback that returns the number of items in the custom collection.
1445
1487
  * @returns The setters object so that settings can be chained.
1446
1488
  */
1447
- setCounter(counter: CustomCollectionCounter<TParams, TContextData>): CustomCollectionCallbackSetters<TParams, TContext, TContextData>;
1489
+ setCounter(counter: CustomCollectionCounter<TParam, TContextData>): CustomCollectionCallbackSetters<TParam, TContext, TContextData>;
1448
1490
  /**
1449
1491
  * Sets the first cursor for the custom collection.
1450
1492
  * @param cursor The cursor for the first item in the custom collection.
1451
1493
  * @returns The setters object so that settings can be chained.
1452
1494
  */
1453
- setFirstCursor(cursor: CustomCollectionCursor<TParams, TContext, TContextData>): CustomCollectionCallbackSetters<TParams, TContext, TContextData>;
1495
+ setFirstCursor(cursor: CustomCollectionCursor<TParam, TContext, TContextData>): CustomCollectionCallbackSetters<TParam, TContext, TContextData>;
1454
1496
  /**
1455
1497
  * Sets the last cursor for the custom collection.
1456
1498
  * @param cursor The cursor for the last item in the custom collection.
1457
1499
  * @returns The setters object so that settings can be chained.
1458
1500
  */
1459
- setLastCursor(cursor: CustomCollectionCursor<TParams, TContext, TContextData>): CustomCollectionCallbackSetters<TParams, TContext, TContextData>;
1501
+ setLastCursor(cursor: CustomCollectionCursor<TParam, TContext, TContextData>): CustomCollectionCallbackSetters<TParam, TContext, TContextData>;
1460
1502
  /**
1461
1503
  * Specifies the conditions under which requests are authorized.
1462
1504
  * @param predicate A callback that returns whether a request is authorized.
1463
1505
  * @returns The setters object so that settings can be chained.
1464
1506
  * @since 0.7.0
1465
1507
  */
1466
- authorize(predicate: ObjectAuthorizePredicate<TContextData, string>): CustomCollectionCallbackSetters<TParams, TContext, TContextData>;
1508
+ authorize(predicate: ObjectAuthorizePredicate<TContextData, string>): CustomCollectionCallbackSetters<TParam, TContext, TContextData>;
1467
1509
  }
1468
1510
  /**
1469
1511
  * Represents an object with a type ID, which is either a constructor or an
@@ -1475,73 +1517,34 @@ type ConstructorWithTypeId<TObject extends Object$1> = (new (...args: any[]) =>
1475
1517
  typeId: URL;
1476
1518
  };
1477
1519
  /**
1478
- * Represents a path from the key of parameter objects.
1479
- * @param Params - A record of parameters where keys are parameter names and
1480
- * values are their string representations.
1481
- * @returns A string representing the path with all parameters.
1482
- * @example
1483
- * ```ts
1484
- * type UserPostPath = ParamsKeyPath<{ userId: string; postId: string }>;
1485
- * let userPostPath: UserPostPath;
1486
- * // userPostPath = "/posts/{postId}"; // invalid - does not contain `{userId}`
1487
- * // userPostPath = "/users/{userId}"; // invalid - does not contain `{postId}`
1488
- * userPostPath = "/users/{userId}/posts/{postId}"; // valid
1489
- * userPostPath = "/posts/{postId}/users/{userId}"; // valid
1490
- * ```
1491
- */
1492
- type ParamsKeyPath<Params extends Record<string, string>> = ParamsPath<Extract<keyof Params, string>> & string;
1493
- /**
1494
- * Represents a path with multiple parameters.
1495
- * All permutations of the parameters are included in the union type.
1496
- * The path must have all parameters in the form of `{paramName}`.
1497
- * @param Params - A union of parameter names.
1498
- * @returns A string representing the path with all parameters.
1499
- * @example
1500
- * ```ts
1501
- * type UserPostPath = ParamsPath<"userId" | "postId">;
1502
- * // = `${string}{userId}${string}` & `${string}{postId}${string}`
1503
- * // =
1504
- * // | `${string}{userId}${string}{postId}${string}`
1505
- * // | `${string}{postId}${string}{userId}${string}`
1506
- * let userPostPath: UserPostPath;
1507
- * userPostPath = "/users/posts"; // ❌ invalid
1508
- * userPostPath = "/users/{userId}"; // ❌ invalid
1509
- * userPostPath = "/posts/{postId}"; // ❌ invalid
1510
- * userPostPath = "/users/{userId}/posts/{postId}"; // ✅ valid
1511
- * userPostPath = "/posts/{postId}/users/{userId}"; // ✅ valid
1512
- */
1513
- type ParamsPath<Params extends string> = UnionToIntersection<ParamPath<Params>>;
1514
- /**
1515
- * Represents a path with a single parameter.
1516
- * The path must have at least one of the parameters in the form of `{paramName}`.
1517
- * @param Param - The name of the parameter.
1518
- * @returns A string representing the path with the parameter.
1519
- * @example
1520
- * ```ts
1521
- * type UserPostPath = ParamPath<"userId" | "postId">;
1522
- * // = `${string}{userId}${string}` | `${string}{postId}${string}`
1523
- * let userPostPath: UserPostPath;
1524
- * userPostPath = "/users/posts"; // ❌ invalid
1525
- * userPostPath = "/users/{userId}"; // ✅ valid
1526
- * userPostPath = "/posts/{postId}"; // ✅ valid
1527
- * userPostPath = "/users/{userId}/posts/{postId}"; // ✅ valid
1528
- * userPostPath = "/posts/{postId}/users/{userId}"; // ✅ valid
1529
- */
1530
- type ParamPath<Param extends string> = `${string}{${Param}}${string}`;
1531
- /**
1532
- * Converts union types to intersection types.
1520
+ * Defines a union of all valid RFC 6570 URI Template expressions for a given
1521
+ * parameter name.
1522
+ *
1523
+ * RFC 6570 specifies a syntax for URI templates, allowing for variable
1524
+ * expansion. This type captures all Level 1-4 operator expressions for a
1525
+ * single, named variable.
1533
1526
  *
1534
- * @template U - The union type to convert.
1535
- * @returns The intersection type of the union.
1527
+ * The supported expression types are:
1528
+ * - `{Param}`: Simple string expansion
1529
+ * - `+{Param}`: Reserved string expansion
1530
+ * - `#{Param}`: Fragment expansion
1531
+ * - `{.Param}`: Label expansion with a dot-prefix
1532
+ * - `{/Param}`: Path segment expansion
1533
+ * - `{;Param}`: Path-style parameter expansion
1534
+ * - `{?Param}`: Query component expansion
1535
+ * - `{&Param}`: Query continuation expansion
1536
+ *
1537
+ * @template Param The name of the parameter to be used in the expressions.
1536
1538
  * @example
1537
1539
  * ```ts
1538
- * type A = { a: string };
1539
- * type B = { b: number };
1540
- * type AorB = A | B;
1541
- * type AandB = UnionToIntersection<AorB>;
1542
- * // AandB = { a: string; b: number }
1540
+ * type UserIdExpression = Rfc6570Expression<"userId">;
1541
+ *
1542
+ * // The variable `userPath` can be assigned any of the valid expressions.
1543
+ * const userPath: UserIdExpression = "{/userId}";
1544
+ * ```
1545
+ * @see {@link https://tools.ietf.org/html/rfc6570} for the full specification.
1543
1546
  */
1544
- type UnionToIntersection<U> = (U extends unknown ? (x: U) => void : never) extends ((x: infer I) => void) ? I : never;
1547
+ type Rfc6570Expression<Param extends string> = `{${Param}}` | `{+${Param}}` | `{#${Param}}` | `{.${Param}}` | `{/${Param}}` | `{;${Param}}` | `{?${Param}}` | `{&${Param}}`;
1545
1548
  //#endregion
1546
1549
  //#region src/federation/context.d.ts
1547
1550
  /**
@@ -1630,9 +1633,7 @@ interface Context<TContextData> {
1630
1633
  * @throws {TypeError} If values are invalid.
1631
1634
  * @since 0.7.0
1632
1635
  */
1633
- getObjectUri<TObject extends Object$1>(cls: (new (...args: any[]) => TObject) & {
1634
- typeId: URL;
1635
- }, values: Record<string, string>): URL;
1636
+ getObjectUri<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>): URL;
1636
1637
  /**
1637
1638
  * Builds the URI of an actor's outbox with the given identifier.
1638
1639
  * @param identifier The actor's identifier.
@@ -1946,9 +1947,7 @@ interface RequestContext<TContextData> extends Context<TContextData> {
1946
1947
  * @throws {TypeError} If values are invalid.
1947
1948
  * @since 0.7.0
1948
1949
  */
1949
- getObject<TObject extends Object$1>(cls: (new (...args: any[]) => TObject) & {
1950
- typeId: URL;
1951
- }, values: Record<string, string>): Promise<TObject | null>;
1950
+ getObject<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>): Promise<TObject | null>;
1952
1951
  /**
1953
1952
  * Gets the public key of the sender, if any exists and it is verified.
1954
1953
  * Otherwise, `null` is returned.
@@ -2092,9 +2091,7 @@ type ParseUriResult =
2092
2091
  * The case of an object URI.
2093
2092
  */ | {
2094
2093
  readonly type: "object";
2095
- readonly class: (new (...args: any[]) => Object$1) & {
2096
- typeId: URL;
2097
- };
2094
+ readonly class: ConstructorWithTypeId<Object$1>;
2098
2095
  readonly typeId: URL;
2099
2096
  readonly values: Record<string, string>;
2100
2097
  }
@@ -2312,4 +2309,4 @@ interface ActorKeyPair extends CryptoKeyPair {
2312
2309
  multikey: Multikey;
2313
2310
  }
2314
2311
  //#endregion
2315
- 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, ParamsKeyPath, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable };
2312
+ 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 };
@@ -3,15 +3,16 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { UrlError, createRequest, getRemoteDocument, logRequest, validatePublicUrl } from "./type-NEA09tSC.js";
7
- import { validateCryptoKey } from "./key-IxRhZpOF.js";
8
- import { doubleKnock } from "./http-DGjdMiLc.js";
6
+ import { validateCryptoKey } from "./key-CxdLUFS6.js";
7
+ import { doubleKnock } from "./http-D2kIm9la.js";
8
+ import { curry } from "es-toolkit";
9
+ import { UrlError, createActivityPubRequest, getDocumentLoader, getRemoteDocument, logRequest, validatePublicUrl } from "@fedify/vocab-runtime";
9
10
  import { getLogger } from "@logtape/logtape";
10
11
 
11
- //#region src/runtime/authdocloader.ts
12
+ //#region src/utils/docloader.ts
12
13
  const logger = getLogger([
13
14
  "fedify",
14
- "runtime",
15
+ "utils",
15
16
  "docloader"
16
17
  ]);
17
18
  /**
@@ -37,10 +38,10 @@ function getAuthenticatedDocumentLoader(identity, { allowPrivateAddress, userAge
37
38
  });
38
39
  throw error;
39
40
  }
40
- const originalRequest = createRequest(url, { userAgent });
41
+ const originalRequest = createActivityPubRequest(url, { userAgent });
41
42
  const response = await doubleKnock(originalRequest, identity, {
42
43
  specDeterminer,
43
- log: logRequest,
44
+ log: curry(logRequest)(logger),
44
45
  tracerProvider,
45
46
  signal: options?.signal
46
47
  });
@@ -48,6 +49,14 @@ function getAuthenticatedDocumentLoader(identity, { allowPrivateAddress, userAge
48
49
  }
49
50
  return load;
50
51
  }
52
+ const _fetchDocumentLoader = getDocumentLoader();
53
+ const _fetchDocumentLoader_allowPrivateAddress = getDocumentLoader({ allowPrivateAddress: true });
54
+ function fetchDocumentLoader(url, arg = false) {
55
+ const allowPrivateAddress = typeof arg === "boolean" ? arg : false;
56
+ logger.warn("fetchDocumentLoader() function is deprecated. Use getDocumentLoader() function instead.");
57
+ const loader = allowPrivateAddress ? _fetchDocumentLoader_allowPrivateAddress : _fetchDocumentLoader;
58
+ return loader(url);
59
+ }
51
60
 
52
61
  //#endregion
53
- export { getAuthenticatedDocumentLoader };
62
+ export { fetchDocumentLoader, getAuthenticatedDocumentLoader };
@@ -3,7 +3,7 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { __commonJS, __toESM } from "./type-NEA09tSC.js";
6
+ import { __commonJS, __toESM } from "./lookup-DQRtjvb1.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) {
@@ -115,7 +115,7 @@ function parse(input, loose) {
115
115
  }
116
116
 
117
117
  //#endregion
118
- //#region ../../node_modules/.pnpm/fetch-mock@12.5.3/node_modules/fetch-mock/dist/esm/TypeDescriptor.js
118
+ //#region ../../node_modules/.pnpm/fetch-mock@12.5.4/node_modules/fetch-mock/dist/esm/TypeDescriptor.js
119
119
  const valueTypes = new Set([
120
120
  "boolean",
121
121
  "number",
@@ -207,7 +207,7 @@ var TypeDescriptor = class TypeDescriptor {
207
207
  };
208
208
 
209
209
  //#endregion
210
- //#region ../../node_modules/.pnpm/fetch-mock@12.5.3/node_modules/fetch-mock/dist/esm/IsSubsetOf.js
210
+ //#region ../../node_modules/.pnpm/fetch-mock@12.5.4/node_modules/fetch-mock/dist/esm/IsSubsetOf.js
211
211
  const allowedTypes = new Set([
212
212
  "array",
213
213
  "object",
@@ -366,7 +366,7 @@ function dequal(foo, bar) {
366
366
  }
367
367
 
368
368
  //#endregion
369
- //#region ../../node_modules/.pnpm/fetch-mock@12.5.3/node_modules/fetch-mock/dist/esm/RequestUtils.js
369
+ //#region ../../node_modules/.pnpm/fetch-mock@12.5.4/node_modules/fetch-mock/dist/esm/RequestUtils.js
370
370
  const absoluteUrlRX = new RegExp("^[a-z]+://|^data:", "i");
371
371
  const protocolRelativeUrlRX = new RegExp("^//", "i");
372
372
  function hasCredentialsInUrl(url) {
@@ -444,7 +444,7 @@ function normalizeHeaders(headers) {
444
444
  }
445
445
 
446
446
  //#endregion
447
- //#region ../../node_modules/.pnpm/fetch-mock@12.5.3/node_modules/fetch-mock/dist/esm/Matchers.js
447
+ //#region ../../node_modules/.pnpm/fetch-mock@12.5.4/node_modules/fetch-mock/dist/esm/Matchers.js
448
448
  var import_glob_to_regexp = __toESM(require_glob_to_regexp(), 1);
449
449
  const isUrlMatcher = (matcher) => matcher instanceof RegExp || typeof matcher === "string" || typeof matcher === "object" && "href" in matcher;
450
450
  const isFunctionMatcher = (matcher) => typeof matcher === "function";
@@ -627,7 +627,7 @@ const builtInMatchers = [
627
627
  ];
628
628
 
629
629
  //#endregion
630
- //#region ../../node_modules/.pnpm/fetch-mock@12.5.3/node_modules/fetch-mock/dist/esm/StatusTextMap.js
630
+ //#region ../../node_modules/.pnpm/fetch-mock@12.5.4/node_modules/fetch-mock/dist/esm/StatusTextMap.js
631
631
  const statusTextMap = {
632
632
  100: "Continue",
633
633
  101: "Switching Protocols",
@@ -695,7 +695,7 @@ const statusTextMap = {
695
695
  var StatusTextMap_default = statusTextMap;
696
696
 
697
697
  //#endregion
698
- //#region ../../node_modules/.pnpm/fetch-mock@12.5.3/node_modules/fetch-mock/dist/esm/Route.js
698
+ //#region ../../node_modules/.pnpm/fetch-mock@12.5.4/node_modules/fetch-mock/dist/esm/Route.js
699
699
  var __classPrivateFieldSet = void 0 && (void 0).__classPrivateFieldSet || function(receiver, state, value, kind, f) {
700
700
  if (kind === "m") throw new TypeError("Private method is not writable");
701
701
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
@@ -829,7 +829,7 @@ builtInMatchers.forEach(Route.defineMatcher);
829
829
  var Route_default = Route;
830
830
 
831
831
  //#endregion
832
- //#region ../../node_modules/.pnpm/fetch-mock@12.5.3/node_modules/fetch-mock/dist/esm/Router.js
832
+ //#region ../../node_modules/.pnpm/fetch-mock@12.5.4/node_modules/fetch-mock/dist/esm/Router.js
833
833
  const responseConfigProps = [
834
834
  "body",
835
835
  "headers",
@@ -1002,7 +1002,7 @@ var Router = class {
1002
1002
  };
1003
1003
 
1004
1004
  //#endregion
1005
- //#region ../../node_modules/.pnpm/fetch-mock@12.5.3/node_modules/fetch-mock/dist/esm/CallHistory.js
1005
+ //#region ../../node_modules/.pnpm/fetch-mock@12.5.4/node_modules/fetch-mock/dist/esm/CallHistory.js
1006
1006
  const isName = (filter) => typeof filter === "string" && /^[\da-zA-Z-]+$/.test(filter) && !["matched", "unmatched"].includes(filter);
1007
1007
  const isMatchedOrUnmatched = (filter) => typeof filter === "boolean" || ["matched", "unmatched"].includes(filter);
1008
1008
  var CallHistory = class {
@@ -1087,7 +1087,7 @@ var CallHistory = class {
1087
1087
  var CallHistory_default = CallHistory;
1088
1088
 
1089
1089
  //#endregion
1090
- //#region ../../node_modules/.pnpm/fetch-mock@12.5.3/node_modules/fetch-mock/dist/esm/FetchMock.js
1090
+ //#region ../../node_modules/.pnpm/fetch-mock@12.5.4/node_modules/fetch-mock/dist/esm/FetchMock.js
1091
1091
  const defaultFetchMockConfig = {
1092
1092
  includeContentLength: true,
1093
1093
  matchPartialBody: false,
@@ -1220,7 +1220,7 @@ const fetchMock = new FetchMock({ ...defaultFetchMockConfig });
1220
1220
  var FetchMock_default = fetchMock;
1221
1221
 
1222
1222
  //#endregion
1223
- //#region ../../node_modules/.pnpm/fetch-mock@12.5.3/node_modules/fetch-mock/dist/esm/index.js
1223
+ //#region ../../node_modules/.pnpm/fetch-mock@12.5.4/node_modules/fetch-mock/dist/esm/index.js
1224
1224
  var esm_default = FetchMock_default;
1225
1225
 
1226
1226
  //#endregion