@fedify/fedify 2.0.0-dev.1690 → 2.0.0-dev.1736

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/dist/{actor-DuCeRiNh.js → actor-BLq4KEGR.js} +1 -1
  2. package/dist/{actor-Be0ThtXy.cjs → actor-C3oFUgfc.cjs} +921 -1451
  3. package/dist/{actor-T6RyhRgk.d.ts → actor-DqFajh9s.d.ts} +2 -2
  4. package/dist/{actor-ChbPLm6n.js → actor-btAA7QSA.js} +189 -677
  5. package/dist/{actor-D6K058Tb.d.cts → actor-f2NtjyCg.d.cts} +2 -2
  6. package/dist/{assert_rejects-DiIiJbZn.js → assert_rejects-Ce45JcFg.js} +1 -1
  7. package/dist/{assert_is_error-BPGph1Jx.js → assert_throws-BNXdRGWP.js} +31 -1
  8. package/dist/{builder-CYOcDUkj.js → builder-C4gbKvM5.js} +7 -8
  9. package/dist/{client-CegPX0Rn.d.cts → client-94iWEfQa.d.cts} +1 -1
  10. package/dist/{client-bgSdkFa2.d.ts → client-BsGzbnV-.d.ts} +1 -1
  11. package/dist/{client-CnOdwLLN.js → client-pY7-3icS.js} +1 -1
  12. package/dist/compat/mod.d.cts +11 -12
  13. package/dist/compat/mod.d.ts +11 -12
  14. package/dist/compat/transformers.test.js +20 -20
  15. package/dist/{context-C5BsZkDr.d.cts → context-BvYz3eOb.d.cts} +130 -103
  16. package/dist/{context-ByZprN0S.d.ts → context-myrGWbL_.d.ts} +130 -103
  17. package/dist/{authdocloader-Brax1A32.js → docloader-DtYIz2Pb.js} +17 -8
  18. package/dist/{esm-DnIzfEj0.js → esm-CQ9nlHuI.js} +11 -11
  19. package/dist/federation/builder.test.js +8 -10
  20. package/dist/federation/collection.test.js +7 -9
  21. package/dist/federation/handler.test.js +25 -26
  22. package/dist/federation/idempotency.test.js +25 -26
  23. package/dist/federation/inbox.test.js +4 -6
  24. package/dist/federation/keycache.test.js +3 -4
  25. package/dist/federation/kv.test.js +6 -8
  26. package/dist/federation/middleware.test.js +32 -33
  27. package/dist/federation/mod.cjs +9 -11
  28. package/dist/federation/mod.d.cts +12 -13
  29. package/dist/federation/mod.d.ts +12 -13
  30. package/dist/federation/mod.js +9 -11
  31. package/dist/federation/mq.test.js +8 -10
  32. package/dist/federation/negotiation.test.js +7 -9
  33. package/dist/federation/retry.test.js +4 -5
  34. package/dist/federation/router.test.js +6 -8
  35. package/dist/federation/send.test.js +13 -15
  36. package/dist/{http-BNOYnVsU.js → http-B9npZ3Md.js} +2 -2
  37. package/dist/{http-D6Uj2x2y.d.ts → http-BbO0ejuk.d.ts} +2 -2
  38. package/dist/{http-BxbM8sEy.js → http-D7qwMpca.js} +256 -6
  39. package/dist/{http-D-e6AFwR.d.cts → http-M8k5mKc0.d.cts} +2 -2
  40. package/dist/{http-C7vbQwbz.cjs → http-ngJvMHez.cjs} +289 -9
  41. package/dist/{inbox-BRru9pX3.js → inbox-CY8fblhz.js} +1 -1
  42. package/dist/{key-1KXru8Ug.js → key-CgKiloJr.js} +3 -2
  43. package/dist/{keycache-CN61iGVj.js → keycache-B6O-bhMs.js} +1 -1
  44. package/dist/{keys-BPdFKgiy.js → keys-B3O7b5eB.js} +2 -1
  45. package/dist/kv-cache-BrjWZnGU.cjs +133 -0
  46. package/dist/kv-cache-DkW_lqUw.js +121 -0
  47. package/dist/kv-cache-z0lgwFi_.js +93 -0
  48. package/dist/{ld-Dv8DNNAT.js → ld-B7TO6JH2.js} +3 -2
  49. package/dist/lookup-Cc3ZAAis.cjs +273 -0
  50. package/dist/{type-C69ZBu7f.js → lookup-NXjB7xUj.js} +503 -5327
  51. package/dist/lookup-fEH6e7ZX.js +261 -0
  52. package/dist/{middleware-DY9B2lL8.js → middleware-BMPvaTpX.js} +44 -48
  53. package/dist/{middleware-BmoOlgc1.cjs → middleware-C8w5YYxK.cjs} +60 -66
  54. package/dist/middleware-D8ENcqxG.js +26 -0
  55. package/dist/{middleware-Bz_A2jeJ.js → middleware-D_VyRsDx.js} +40 -46
  56. package/dist/middleware-Yk-MuxWc.js +15 -0
  57. package/dist/middleware-glwCut0b.cjs +15 -0
  58. package/dist/{mod-BhUKmBJD.d.ts → mod-B2iOw50L.d.ts} +3 -3
  59. package/dist/mod-BYynOiJG.d.ts +109 -0
  60. package/dist/{mod-DlU8ISoa.d.ts → mod-BlVovdcy.d.ts} +2 -2
  61. package/dist/{mod-CxkWO3Mg.d.cts → mod-BxRCHTz-.d.cts} +2 -2
  62. package/dist/{mod-jQ4OODsl.d.cts → mod-C58MZ7Wx.d.cts} +1 -1
  63. package/dist/{mod-8DMWKtQE.d.cts → mod-DbFNTF7m.d.cts} +2 -2
  64. package/dist/{mod-Djzcw2ry.d.cts → mod-DgdBYYa0.d.cts} +3 -3
  65. package/dist/{mod-DBzN0aCM.d.ts → mod-Ds0mpFZU.d.ts} +1 -1
  66. package/dist/mod-VastcQsk.d.cts +107 -0
  67. package/dist/{mod-D6hQoxC5.d.ts → mod-k0Dk3fGk.d.ts} +2 -2
  68. package/dist/mod.cjs +19 -32
  69. package/dist/mod.d.cts +15 -16
  70. package/dist/mod.d.ts +16 -17
  71. package/dist/mod.js +14 -16
  72. package/dist/nodeinfo/client.test.js +8 -10
  73. package/dist/nodeinfo/handler.test.js +24 -25
  74. package/dist/nodeinfo/mod.cjs +2 -3
  75. package/dist/nodeinfo/mod.d.cts +2 -4
  76. package/dist/nodeinfo/mod.d.ts +2 -4
  77. package/dist/nodeinfo/mod.js +2 -3
  78. package/dist/nodeinfo/types.test.js +7 -9
  79. package/dist/{owner-BN_tO3cY.d.cts → owner-B4HbyP8s.d.cts} +3 -3
  80. package/dist/{owner-e3FYDhsk.js → owner-CSktF-2s.js} +3 -2
  81. package/dist/{owner-hd9lvQcP.d.ts → owner-kQRGVXG1.d.ts} +3 -3
  82. package/dist/{proof-DfgvA3al.js → proof-BT65yR1Q.js} +5 -4
  83. package/dist/{proof-6gFMwMNJ.js → proof-Cs5Mcy_U.js} +2 -2
  84. package/dist/{proof-B-eqv0Ug.cjs → proof-feEDocLH.cjs} +17 -16
  85. package/dist/{send-Tl9NOnmO.js → send-vPZ03xUr.js} +2 -2
  86. package/dist/sig/http.test.js +12 -13
  87. package/dist/sig/key.test.js +9 -11
  88. package/dist/sig/ld.test.js +8 -10
  89. package/dist/sig/mod.cjs +9 -11
  90. package/dist/sig/mod.d.cts +5 -7
  91. package/dist/sig/mod.d.ts +5 -7
  92. package/dist/sig/mod.js +5 -7
  93. package/dist/sig/owner.test.js +10 -12
  94. package/dist/sig/proof.test.js +13 -14
  95. package/dist/testing/docloader.test.js +6 -8
  96. package/dist/testing/mod.d.ts +120 -172
  97. package/dist/testing/mod.js +2 -3
  98. package/dist/{testing-BWNCAbL-.js → testing-u2cUPQLp.js} +1 -2
  99. package/dist/{types-DqxyTxOf.js → types-BtUjyi5y.js} +1 -1
  100. package/dist/{types-zqdWZh4O.cjs → types-CWgzGaqk.cjs} +3 -3
  101. package/dist/{runtime/authdocloader.test.js → utils/docloader.test.js} +14 -15
  102. package/dist/utils/kv-cache.test.js +209 -0
  103. package/dist/utils/mod.cjs +12 -0
  104. package/dist/utils/mod.d.cts +5 -0
  105. package/dist/utils/mod.d.ts +7 -0
  106. package/dist/utils/mod.js +11 -0
  107. package/dist/vocab/actor.test.js +8 -10
  108. package/dist/vocab/lookup.test.js +7 -9
  109. package/dist/vocab/mod.cjs +3 -4
  110. package/dist/vocab/mod.d.cts +3 -5
  111. package/dist/vocab/mod.d.ts +3 -5
  112. package/dist/vocab/mod.js +3 -4
  113. package/dist/vocab/type.test.js +2 -3
  114. package/dist/vocab/vocab.test.js +9 -10
  115. package/dist/{vocab-BI0Ak5lL.d.ts → vocab-BCWe1Ih5.d.ts} +2 -21
  116. package/dist/{vocab-Dw1-yVGg.d.cts → vocab-CeDBzu-f.d.cts} +2 -21
  117. package/dist/{vocab-B39-pFl9.cjs → vocab-NvDV-exu.cjs} +5 -5
  118. package/dist/{vocab-BWoeZsME.js → vocab-wADjlIH4.js} +3 -3
  119. package/dist/webfinger/handler.test.js +24 -25
  120. package/dist/webfinger/lookup.test.js +7 -9
  121. package/dist/webfinger/mod.cjs +2 -3
  122. package/dist/webfinger/mod.d.cts +1 -3
  123. package/dist/webfinger/mod.d.ts +1 -3
  124. package/dist/webfinger/mod.js +2 -3
  125. package/dist/x/cfworkers.d.cts +2 -2
  126. package/dist/x/cfworkers.d.ts +2 -2
  127. package/dist/x/cfworkers.test.js +6 -8
  128. package/dist/x/hono.d.cts +10 -11
  129. package/dist/x/hono.d.ts +10 -11
  130. package/dist/x/sveltekit.d.cts +10 -11
  131. package/dist/x/sveltekit.d.ts +10 -11
  132. package/package.json +15 -14
  133. package/dist/assert_throws-BOO88avQ.js +0 -39
  134. package/dist/authdocloader-CrxhFL8e.js +0 -52
  135. package/dist/authdocloader-OSn_teLV.cjs +0 -58
  136. package/dist/docloader-CCqXeagZ.cjs +0 -4861
  137. package/dist/docloader-CxWcuWqQ.d.ts +0 -221
  138. package/dist/docloader-D-MrRyHl.d.cts +0 -219
  139. package/dist/docloader-XK3y2jn5.js +0 -4795
  140. package/dist/key-B3uag-rz.js +0 -10
  141. package/dist/key-BiBmb1Yy.cjs +0 -10
  142. package/dist/key-DK_nfU4I.js +0 -10
  143. package/dist/key-Z6ceKnZC.cjs +0 -290
  144. package/dist/key-jyNTxCvK.js +0 -260
  145. package/dist/lookup-BPviO8ij.js +0 -131
  146. package/dist/lookup-hnMAAU5r.cjs +0 -137
  147. package/dist/lookup-pV0JOsuV.js +0 -331
  148. package/dist/middleware-CI0-zw4U.js +0 -26
  149. package/dist/middleware-QNK-W-jE.cjs +0 -17
  150. package/dist/middleware-_vjt6FWU.js +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
@@ -3,17 +3,15 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import "../type-C69ZBu7f.js";
6
+ import "../lookup-NXjB7xUj.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-pV0JOsuV.js";
11
- import { mockDocumentLoader, test } from "../testing-BWNCAbL-.js";
12
- import "../std__assert-X-_kMxKM.js";
13
- import "../assert_rejects-DiIiJbZn.js";
14
- import "../assert_is_error-BPGph1Jx.js";
15
- import "../assert_not_equals-f3m3epl3.js";
16
- import "../assert_throws-BOO88avQ.js";
10
+ import { mockDocumentLoader, test } from "../testing-u2cUPQLp.js";
11
+ import "../std__assert-DWivtrGR.js";
12
+ import "../assert_rejects-Ce45JcFg.js";
13
+ import "../assert_throws-BNXdRGWP.js";
14
+ import "../assert_not_equals-C80BG-_5.js";
17
15
 
18
16
  //#region src/testing/docloader.test.ts
19
17
  test("mockDocumentLoader()", async () => {
@@ -1,75 +1,9 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
+ import { DocumentLoader, GetUserAgentOptions, LanguageString } from "@fedify/vocab-runtime";
4
5
  import { Span, TracerProvider } from "@opentelemetry/api";
5
6
 
6
- //#region src/runtime/docloader.d.ts
7
- /**
8
- * A remote JSON-LD document and its context fetched by
9
- * a {@link DocumentLoader}.
10
- */
11
- interface RemoteDocument {
12
- /**
13
- * The URL of the context document.
14
- */
15
- contextUrl: string | null;
16
- /**
17
- * The fetched JSON-LD document.
18
- */
19
- document: unknown;
20
- /**
21
- * The URL of the fetched document.
22
- */
23
- documentUrl: string;
24
- }
25
- /**
26
- * Options for {@link DocumentLoader}.
27
- * @since 1.8.0
28
- */
29
- interface DocumentLoaderOptions {
30
- /**
31
- * An `AbortSignal` for cancellation.
32
- * @since 1.8.0
33
- */
34
- signal?: AbortSignal;
35
- }
36
- /**
37
- * A JSON-LD document loader that fetches documents from the Web.
38
- * @param url The URL of the document to load.
39
- * @param options The options for the document loader.
40
- * @returns The loaded remote document.
41
- */
42
- type DocumentLoader = (url: string, options?: DocumentLoaderOptions) => Promise<RemoteDocument>;
43
- /**
44
- * A factory function that creates a {@link DocumentLoader} with options.
45
- * @param options The options for the document loader.
46
- * @returns The document loader.
47
- * @since 1.4.0
48
- */
49
-
50
- /**
51
- * Options for making `User-Agent` string.
52
- * @see {@link getUserAgent}
53
- * @since 1.3.0
54
- */
55
- interface GetUserAgentOptions {
56
- /**
57
- * An optional software name and version, e.g., `"Hollo/1.0.0"`.
58
- */
59
- software?: string | null;
60
- /**
61
- * An optional URL to append to the user agent string.
62
- * Usually the URL of the ActivityPub instance.
63
- */
64
- url?: string | URL | null;
65
- }
66
- /**
67
- * Gets the user agent string for the given application and URL.
68
- * @param options The options for making the user agent string.
69
- * @returns The user agent string.
70
- * @since 1.3.0
71
- */
72
- //#endregion
73
7
  //#region src/nodeinfo/types.d.ts
74
8
  /**
75
9
  * The type of the result of parsing JSON.
@@ -248,25 +182,6 @@ interface GetNodeInfoOptions {
248
182
  * @since 1.2.0
249
183
  */
250
184
  //#endregion
251
- //#region src/runtime/langstr.d.ts
252
- /**
253
- * A language-tagged string which corresponds to the `rdf:langString` type.
254
- */
255
- declare class LanguageString extends String {
256
- /**
257
- * The locale of the string.
258
- * @since 2.0.0
259
- */
260
- readonly locale: Intl.Locale;
261
- /**
262
- * Constructs a new `LanguageString`.
263
- * @param value A string value written in the given language.
264
- * @param locale The language of the string. If a string is given, it will
265
- * be parsed as a `Intl.Locale` object.
266
- */
267
- constructor(value: string, language: Intl.Locale | string);
268
- }
269
- //#endregion
270
185
  //#region src/vocab/vocab.d.ts
271
186
  /** Describes an object of any kind. The Object type serves as the base type for
272
187
  * most of the other kinds of objects defined in the Activity Vocabulary,
@@ -7479,7 +7394,7 @@ type ObjectAuthorizePredicate<TContextData, TParam extends string> = (context: R
7479
7394
  * the entire collection without pagination.
7480
7395
  * @since 1.8.0
7481
7396
  */
7482
- 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>;
7397
+ type CustomCollectionDispatcher<TItem, TParam extends string, TContext extends Context<TContextData>, TContextData> = (context: TContext, values: Record<TParam, string>, cursor: string | null) => PageItems<TItem> | null | Promise<PageItems<TItem> | null>;
7483
7398
  /**
7484
7399
  * A callback that counts the number of items in a custom collection.
7485
7400
  *
@@ -7489,7 +7404,7 @@ type CustomCollectionDispatcher<TItem, TParams extends Record<string, string>, T
7489
7404
  * @param values The parameters of the requested URL.
7490
7405
  * @since 1.8.0
7491
7406
  */
7492
- type CustomCollectionCounter<TParams extends Record<string, string>, TContextData> = (context: RequestContext<TContextData>, values: TParams) => number | bigint | null | Promise<number | bigint | null>;
7407
+ type CustomCollectionCounter<TParam extends string, TContextData> = (context: RequestContext<TContextData>, values: Record<TParam, string>) => number | bigint | null | Promise<number | bigint | null>;
7493
7408
  /**
7494
7409
  * A callback that returns a cursor for a custom collection.
7495
7410
  *
@@ -7502,7 +7417,7 @@ type CustomCollectionCounter<TParams extends Record<string, string>, TContextDat
7502
7417
  * @param values The parameters of the requested URL.
7503
7418
  * @since 1.8.0
7504
7419
  */
7505
- type CustomCollectionCursor<TParams extends Record<string, string>, TContext extends Context<TContextData>, TContextData> = (context: TContext, values: TParams) => string | null | Promise<string | null>;
7420
+ type CustomCollectionCursor<TParam extends string, TContext extends Context<TContextData>, TContextData> = (context: TContext, values: Record<TParam, string>) => string | null | Promise<string | null>;
7506
7421
  //#endregion
7507
7422
  //#region src/federation/queue.d.ts
7508
7423
  interface SenderKeyJwkPair {
@@ -7623,7 +7538,7 @@ interface Federatable<TContextData> {
7623
7538
  * @returns An object with methods to set other actor dispatcher callbacks.
7624
7539
  * @throws {RouterError} Thrown if the path pattern is invalid.
7625
7540
  */
7626
- setActorDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: ActorDispatcher<TContextData>): ActorCallbackSetters<TContextData>;
7541
+ setActorDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: ActorDispatcher<TContextData>): ActorCallbackSetters<TContextData>;
7627
7542
  /**
7628
7543
  * Registers an object dispatcher.
7629
7544
  *
@@ -7687,7 +7602,7 @@ interface Federatable<TContextData> {
7687
7602
  */
7688
7603
  setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: (new (...args: any[]) => TObject) & {
7689
7604
  typeId: URL;
7690
- }, path: `${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
7605
+ }, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
7691
7606
  /**
7692
7607
  * Registers an object dispatcher.
7693
7608
  *
@@ -7703,7 +7618,7 @@ interface Federatable<TContextData> {
7703
7618
  */
7704
7619
  setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: (new (...args: any[]) => TObject) & {
7705
7620
  typeId: URL;
7706
- }, path: `${string}{${TParam}}${string}{${TParam}}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
7621
+ }, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
7707
7622
  /**
7708
7623
  * Registers an object dispatcher.
7709
7624
  *
@@ -7719,7 +7634,7 @@ interface Federatable<TContextData> {
7719
7634
  */
7720
7635
  setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: (new (...args: any[]) => TObject) & {
7721
7636
  typeId: URL;
7722
- }, path: `${string}{${TParam}}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
7637
+ }, path: `${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
7723
7638
  /**
7724
7639
  * Registers an inbox dispatcher.
7725
7640
  *
@@ -7731,7 +7646,7 @@ interface Federatable<TContextData> {
7731
7646
  * @param dispatcher An inbox dispatcher callback to register.
7732
7647
  * @throws {@link RouterError} Thrown if the path pattern is invalid.
7733
7648
  */
7734
- setInboxDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Activity, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
7649
+ setInboxDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Activity, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
7735
7650
  /**
7736
7651
  * Registers an outbox dispatcher.
7737
7652
  *
@@ -7755,7 +7670,7 @@ interface Federatable<TContextData> {
7755
7670
  * @param dispatcher An outbox dispatcher callback to register.
7756
7671
  * @throws {@link RouterError} Thrown if the path pattern is invalid.
7757
7672
  */
7758
- setOutboxDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Activity, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
7673
+ setOutboxDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Activity, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
7759
7674
  /**
7760
7675
  * Registers a following collection dispatcher.
7761
7676
  * @param path The URI path pattern for the following collection. The syntax
@@ -7767,7 +7682,7 @@ interface Federatable<TContextData> {
7767
7682
  * callbacks.
7768
7683
  * @throws {RouterError} Thrown if the path pattern is invalid.
7769
7684
  */
7770
- setFollowingDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Actor | URL, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
7685
+ setFollowingDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Actor | URL, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
7771
7686
  /**
7772
7687
  * Registers a followers collection dispatcher.
7773
7688
  * @param path The URI path pattern for the followers collection. The syntax
@@ -7779,7 +7694,7 @@ interface Federatable<TContextData> {
7779
7694
  * callbacks.
7780
7695
  * @throws {@link RouterError} Thrown if the path pattern is invalid.
7781
7696
  */
7782
- setFollowersDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Recipient, Context<TContextData>, TContextData, URL>): CollectionCallbackSetters<Context<TContextData>, TContextData, URL>;
7697
+ setFollowersDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Recipient, Context<TContextData>, TContextData, URL>): CollectionCallbackSetters<Context<TContextData>, TContextData, URL>;
7783
7698
  /**
7784
7699
  * Registers a liked collection dispatcher.
7785
7700
  * @param path The URI path pattern for the liked collection. The syntax
@@ -7791,7 +7706,7 @@ interface Federatable<TContextData> {
7791
7706
  * callbacks.
7792
7707
  * @throws {@link RouterError} Thrown if the path pattern is invalid.
7793
7708
  */
7794
- setLikedDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Object$1 | URL, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
7709
+ setLikedDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Object$1 | URL, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
7795
7710
  /**
7796
7711
  * Registers a featured collection dispatcher.
7797
7712
  * @param path The URI path pattern for the featured collection. The syntax
@@ -7803,7 +7718,7 @@ interface Federatable<TContextData> {
7803
7718
  * callbacks.
7804
7719
  * @throws {@link RouterError} Thrown if the path pattern is invalid.
7805
7720
  */
7806
- setFeaturedDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Object$1, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
7721
+ setFeaturedDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Object$1, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
7807
7722
  /**
7808
7723
  * Registers a featured tags collection dispatcher.
7809
7724
  * @param path The URI path pattern for the featured tags collection.
@@ -7815,7 +7730,7 @@ interface Federatable<TContextData> {
7815
7730
  * callbacks.
7816
7731
  * @throws {@link RouterError} Thrown if the path pattern is invalid.
7817
7732
  */
7818
- setFeaturedTagsDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Hashtag, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
7733
+ setFeaturedTagsDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Hashtag, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
7819
7734
  /**
7820
7735
  * Assigns the URL path for the inbox and starts setting inbox listeners.
7821
7736
  *
@@ -7845,7 +7760,41 @@ interface Federatable<TContextData> {
7845
7760
  * @returns An object to register inbox listeners.
7846
7761
  * @throws {RouteError} Thrown if the path pattern is invalid.
7847
7762
  */
7848
- setInboxListeners(inboxPath: `${string}{identifier}${string}` | `${string}{handle}${string}`, sharedInboxPath?: string): InboxListenerSetters<TContextData>;
7763
+ setInboxListeners(inboxPath: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, sharedInboxPath?: string): InboxListenerSetters<TContextData>;
7764
+ /**
7765
+ * Registers a collection of objects dispatcher.
7766
+ *
7767
+ * @template TContextData The context data to pass to the {@link Context}.
7768
+ * @template TObject The type of objects to dispatch.
7769
+ * @template TParam The parameter names of the requested URL.
7770
+ * @param name A unique name for the collection dispatcher.
7771
+ * @param itemType The Activity Vocabulary class of the object to dispatch.
7772
+ * @param path The URI path pattern for the collection dispatcher.
7773
+ * The syntax is based on URI Template
7774
+ * ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
7775
+ * The path must have one or more variables.
7776
+ * @param dispatcher A collection dispatcher callback to register.
7777
+ */
7778
+ setCollectionDispatcher<TObject extends Object$1, TParam extends string>(name: string | symbol, itemType: (new (...args: any[]) => TObject) & {
7779
+ typeId: URL;
7780
+ }, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: CustomCollectionDispatcher<TObject, TParam, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>;
7781
+ /**
7782
+ * Registers a collection of objects dispatcher.
7783
+ *
7784
+ * @template TContextData The context data to pass to the {@link Context}.
7785
+ * @template TObject The type of objects to dispatch.
7786
+ * @template TParam The parameter names of the requested URL.
7787
+ * @param name A unique name for the collection dispatcher.
7788
+ * @param itemType The Activity Vocabulary class of the object to dispatch.
7789
+ * @param path The URI path pattern for the collection dispatcher.
7790
+ * The syntax is based on URI Template
7791
+ * ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
7792
+ * The path must have one or more variables.
7793
+ * @param dispatcher A collection dispatcher callback to register.
7794
+ */
7795
+ setCollectionDispatcher<TObject extends Object$1, TParam extends string>(name: string | symbol, itemType: (new (...args: any[]) => TObject) & {
7796
+ typeId: URL;
7797
+ }, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: CustomCollectionDispatcher<TObject, TParam, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>;
7849
7798
  /**
7850
7799
  * Registers a collection of objects dispatcher.
7851
7800
  *
@@ -7860,7 +7809,9 @@ interface Federatable<TContextData> {
7860
7809
  * The path must have one or more variables.
7861
7810
  * @param dispatcher A collection dispatcher callback to register.
7862
7811
  */
7863
- 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>;
7812
+ setCollectionDispatcher<TObject extends Object$1, TParam extends string>(name: string | symbol, itemType: (new (...args: any[]) => TObject) & {
7813
+ typeId: URL;
7814
+ }, path: `${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: CustomCollectionDispatcher<TObject, TParam, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>;
7864
7815
  /**
7865
7816
  * Registers an ordered collection of objects dispatcher.
7866
7817
  *
@@ -7875,7 +7826,43 @@ interface Federatable<TContextData> {
7875
7826
  * The path must have one or more variables.
7876
7827
  * @param dispatcher A collection dispatcher callback to register.
7877
7828
  */
7878
- 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>;
7829
+ setOrderedCollectionDispatcher<TObject extends Object$1, TParam extends string>(name: string | symbol, itemType: (new (...args: any[]) => TObject) & {
7830
+ typeId: URL;
7831
+ }, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: CustomCollectionDispatcher<TObject, TParam, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>;
7832
+ /**
7833
+ * Registers an ordered collection of objects dispatcher.
7834
+ *
7835
+ * @template TContextData The context data to pass to the {@link Context}.
7836
+ * @template TObject The type of objects to dispatch.
7837
+ * @template TParam The parameter names of the requested URL.
7838
+ * @param name A unique name for the collection dispatcher.
7839
+ * @param itemType The Activity Vocabulary class of the object to dispatch.
7840
+ * @param path The URI path pattern for the collection dispatcher.
7841
+ * The syntax is based on URI Template
7842
+ * ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
7843
+ * The path must have one or more variables.
7844
+ * @param dispatcher A collection dispatcher callback to register.
7845
+ */
7846
+ setOrderedCollectionDispatcher<TObject extends Object$1, TParam extends string>(name: string | symbol, itemType: (new (...args: any[]) => TObject) & {
7847
+ typeId: URL;
7848
+ }, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: CustomCollectionDispatcher<TObject, TParam, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>;
7849
+ /**
7850
+ * Registers an ordered collection of objects dispatcher.
7851
+ *
7852
+ * @template TContextData The context data to pass to the {@link Context}.
7853
+ * @template TObject The type of objects to dispatch.
7854
+ * @template TParam The parameter names of the requested URL.
7855
+ * @param name A unique name for the collection dispatcher.
7856
+ * @param itemType The Activity Vocabulary class of the object to dispatch.
7857
+ * @param path The URI path pattern for the collection dispatcher.
7858
+ * The syntax is based on URI Template
7859
+ * ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
7860
+ * The path must have one or more variables.
7861
+ * @param dispatcher A collection dispatcher callback to register.
7862
+ */
7863
+ setOrderedCollectionDispatcher<TObject extends Object$1, TParam extends string>(name: string | symbol, itemType: (new (...args: any[]) => TObject) & {
7864
+ typeId: URL;
7865
+ }, path: `${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: CustomCollectionDispatcher<TObject, TParam, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>;
7879
7866
  }
7880
7867
  /**
7881
7868
  * An object that registers federation-related business logic and dispatches
@@ -8174,38 +8161,38 @@ interface FederationFetchOptions<TContextData> {
8174
8161
  /**
8175
8162
  * Additional settings for a custom collection dispatcher.
8176
8163
  *
8177
- * @template TParams The type of the parameters in the URL path.
8164
+ * @template TParam The type of the parameters in the URL path.
8178
8165
  * @template TContext The type of the context. {@link Context} or
8179
8166
  * {@link RequestContext}.
8180
8167
  * @template TContextData The context data to pass to the {@link Context}.
8181
8168
  * @template TFilter The type of filter for the collection.
8182
8169
  */
8183
- interface CustomCollectionCallbackSetters<TParams extends Record<string, string>, TContext extends Context<TContextData>, TContextData> {
8170
+ interface CustomCollectionCallbackSetters<TParam extends string, TContext extends Context<TContextData>, TContextData> {
8184
8171
  /**
8185
8172
  * Sets the counter for the custom collection.
8186
8173
  * @param counter A callback that returns the number of items in the custom collection.
8187
8174
  * @returns The setters object so that settings can be chained.
8188
8175
  */
8189
- setCounter(counter: CustomCollectionCounter<TParams, TContextData>): CustomCollectionCallbackSetters<TParams, TContext, TContextData>;
8176
+ setCounter(counter: CustomCollectionCounter<TParam, TContextData>): CustomCollectionCallbackSetters<TParam, TContext, TContextData>;
8190
8177
  /**
8191
8178
  * Sets the first cursor for the custom collection.
8192
8179
  * @param cursor The cursor for the first item in the custom collection.
8193
8180
  * @returns The setters object so that settings can be chained.
8194
8181
  */
8195
- setFirstCursor(cursor: CustomCollectionCursor<TParams, TContext, TContextData>): CustomCollectionCallbackSetters<TParams, TContext, TContextData>;
8182
+ setFirstCursor(cursor: CustomCollectionCursor<TParam, TContext, TContextData>): CustomCollectionCallbackSetters<TParam, TContext, TContextData>;
8196
8183
  /**
8197
8184
  * Sets the last cursor for the custom collection.
8198
8185
  * @param cursor The cursor for the last item in the custom collection.
8199
8186
  * @returns The setters object so that settings can be chained.
8200
8187
  */
8201
- setLastCursor(cursor: CustomCollectionCursor<TParams, TContext, TContextData>): CustomCollectionCallbackSetters<TParams, TContext, TContextData>;
8188
+ setLastCursor(cursor: CustomCollectionCursor<TParam, TContext, TContextData>): CustomCollectionCallbackSetters<TParam, TContext, TContextData>;
8202
8189
  /**
8203
8190
  * Specifies the conditions under which requests are authorized.
8204
8191
  * @param predicate A callback that returns whether a request is authorized.
8205
8192
  * @returns The setters object so that settings can be chained.
8206
8193
  * @since 0.7.0
8207
8194
  */
8208
- authorize(predicate: ObjectAuthorizePredicate<TContextData, string>): CustomCollectionCallbackSetters<TParams, TContext, TContextData>;
8195
+ authorize(predicate: ObjectAuthorizePredicate<TContextData, string>): CustomCollectionCallbackSetters<TParam, TContext, TContextData>;
8209
8196
  }
8210
8197
  /**
8211
8198
  * Represents an object with a type ID, which is either a constructor or an
@@ -8217,73 +8204,34 @@ type ConstructorWithTypeId<TObject extends Object$1> = (new (...args: any[]) =>
8217
8204
  typeId: URL;
8218
8205
  };
8219
8206
  /**
8220
- * Represents a path from the key of parameter objects.
8221
- * @param Params - A record of parameters where keys are parameter names and
8222
- * values are their string representations.
8223
- * @returns A string representing the path with all parameters.
8224
- * @example
8225
- * ```ts
8226
- * type UserPostPath = ParamsKeyPath<{ userId: string; postId: string }>;
8227
- * let userPostPath: UserPostPath;
8228
- * // userPostPath = "/posts/{postId}"; // invalid - does not contain `{userId}`
8229
- * // userPostPath = "/users/{userId}"; // invalid - does not contain `{postId}`
8230
- * userPostPath = "/users/{userId}/posts/{postId}"; // valid
8231
- * userPostPath = "/posts/{postId}/users/{userId}"; // valid
8232
- * ```
8233
- */
8234
- type ParamsKeyPath<Params extends Record<string, string>> = ParamsPath<Extract<keyof Params, string>> & string;
8235
- /**
8236
- * Represents a path with multiple parameters.
8237
- * All permutations of the parameters are included in the union type.
8238
- * The path must have all parameters in the form of `{paramName}`.
8239
- * @param Params - A union of parameter names.
8240
- * @returns A string representing the path with all parameters.
8241
- * @example
8242
- * ```ts
8243
- * type UserPostPath = ParamsPath<"userId" | "postId">;
8244
- * // = `${string}{userId}${string}` & `${string}{postId}${string}`
8245
- * // =
8246
- * // | `${string}{userId}${string}{postId}${string}`
8247
- * // | `${string}{postId}${string}{userId}${string}`
8248
- * let userPostPath: UserPostPath;
8249
- * userPostPath = "/users/posts"; // ❌ invalid
8250
- * userPostPath = "/users/{userId}"; // ❌ invalid
8251
- * userPostPath = "/posts/{postId}"; // ❌ invalid
8252
- * userPostPath = "/users/{userId}/posts/{postId}"; // ✅ valid
8253
- * userPostPath = "/posts/{postId}/users/{userId}"; // ✅ valid
8254
- */
8255
- type ParamsPath<Params extends string> = UnionToIntersection<ParamPath<Params>>;
8256
- /**
8257
- * Represents a path with a single parameter.
8258
- * The path must have at least one of the parameters in the form of `{paramName}`.
8259
- * @param Param - The name of the parameter.
8260
- * @returns A string representing the path with the parameter.
8261
- * @example
8262
- * ```ts
8263
- * type UserPostPath = ParamPath<"userId" | "postId">;
8264
- * // = `${string}{userId}${string}` | `${string}{postId}${string}`
8265
- * let userPostPath: UserPostPath;
8266
- * userPostPath = "/users/posts"; // ❌ invalid
8267
- * userPostPath = "/users/{userId}"; // ✅ valid
8268
- * userPostPath = "/posts/{postId}"; // ✅ valid
8269
- * userPostPath = "/users/{userId}/posts/{postId}"; // ✅ valid
8270
- * userPostPath = "/posts/{postId}/users/{userId}"; // ✅ valid
8271
- */
8272
- type ParamPath<Param extends string> = `${string}{${Param}}${string}`;
8273
- /**
8274
- * Converts union types to intersection types.
8207
+ * Defines a union of all valid RFC 6570 URI Template expressions for a given
8208
+ * parameter name.
8209
+ *
8210
+ * RFC 6570 specifies a syntax for URI templates, allowing for variable
8211
+ * expansion. This type captures all Level 1-4 operator expressions for a
8212
+ * single, named variable.
8275
8213
  *
8276
- * @template U - The union type to convert.
8277
- * @returns The intersection type of the union.
8214
+ * The supported expression types are:
8215
+ * - `{Param}`: Simple string expansion
8216
+ * - `+{Param}`: Reserved string expansion
8217
+ * - `#{Param}`: Fragment expansion
8218
+ * - `{.Param}`: Label expansion with a dot-prefix
8219
+ * - `{/Param}`: Path segment expansion
8220
+ * - `{;Param}`: Path-style parameter expansion
8221
+ * - `{?Param}`: Query component expansion
8222
+ * - `{&Param}`: Query continuation expansion
8223
+ *
8224
+ * @template Param The name of the parameter to be used in the expressions.
8278
8225
  * @example
8279
8226
  * ```ts
8280
- * type A = { a: string };
8281
- * type B = { b: number };
8282
- * type AorB = A | B;
8283
- * type AandB = UnionToIntersection<AorB>;
8284
- * // AandB = { a: string; b: number }
8227
+ * type UserIdExpression = Rfc6570Expression<"userId">;
8228
+ *
8229
+ * // The variable `userPath` can be assigned any of the valid expressions.
8230
+ * const userPath: UserIdExpression = "{/userId}";
8231
+ * ```
8232
+ * @see {@link https://tools.ietf.org/html/rfc6570} for the full specification.
8285
8233
  */
8286
- type UnionToIntersection<U> = (U extends unknown ? (x: U) => void : never) extends ((x: infer I) => void) ? I : never;
8234
+ type Rfc6570Expression<Param extends string> = `{${Param}}` | `{+${Param}}` | `{#${Param}}` | `{.${Param}}` | `{/${Param}}` | `{;${Param}}` | `{?${Param}}` | `{&${Param}}`;
8287
8235
  //#endregion
8288
8236
  //#region src/federation/context.d.ts
8289
8237
  /**
@@ -3,8 +3,7 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import "../type-C69ZBu7f.js";
7
- import "../lookup-pV0JOsuV.js";
8
- import { createInboxContext, createRequestContext, test, testDefinitions } from "../testing-BWNCAbL-.js";
6
+ import "../lookup-NXjB7xUj.js";
7
+ import { createInboxContext, createRequestContext, test, testDefinitions } from "../testing-u2cUPQLp.js";
9
8
 
10
9
  export { createInboxContext, createRequestContext, test, testDefinitions };
@@ -3,8 +3,7 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { __require, lookupWebFinger } from "./type-C69ZBu7f.js";
7
- import { RouterError, lookupObject, traverseCollection } from "./lookup-pV0JOsuV.js";
6
+ import { RouterError, __require, lookupObject, lookupWebFinger, traverseCollection } from "./lookup-NXjB7xUj.js";
8
7
  import { configure, getConsoleSink, getLogger, reset } from "@logtape/logtape";
9
8
  import { trace } from "@opentelemetry/api";
10
9
 
@@ -2,8 +2,8 @@
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
- import { getUserAgent } from "./docloader-XK3y2jn5.js";
6
5
  import { getLogger } from "@logtape/logtape";
6
+ import { getUserAgent } from "@fedify/vocab-runtime";
7
7
 
8
8
  //#region src/nodeinfo/client.ts
9
9
  const logger = getLogger([
@@ -3,8 +3,8 @@
3
3
  const { URLPattern } = require("urlpattern-polyfill");
4
4
 
5
5
  const require_chunk = require('./chunk-DqRYRqnO.cjs');
6
- const require_docloader = require('./docloader-CCqXeagZ.cjs');
7
6
  const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
7
+ const __fedify_vocab_runtime = require_chunk.__toESM(require("@fedify/vocab-runtime"));
8
8
 
9
9
  //#region src/nodeinfo/client.ts
10
10
  const logger = (0, __logtape_logtape.getLogger)([
@@ -19,7 +19,7 @@ async function getNodeInfo(url, options = {}) {
19
19
  const wellKnownUrl = new URL("/.well-known/nodeinfo", url);
20
20
  const wellKnownResponse = await fetch(wellKnownUrl, { headers: {
21
21
  Accept: "application/json",
22
- "User-Agent": typeof options.userAgent === "string" ? options.userAgent : require_docloader.getUserAgent(options.userAgent)
22
+ "User-Agent": typeof options.userAgent === "string" ? options.userAgent : (0, __fedify_vocab_runtime.getUserAgent)(options.userAgent)
23
23
  } });
24
24
  if (!wellKnownResponse.ok) {
25
25
  logger.error("Failed to fetch {url}: {status} {statusText}", {
@@ -42,7 +42,7 @@ async function getNodeInfo(url, options = {}) {
42
42
  }
43
43
  const response = await fetch(nodeInfoUrl, { headers: {
44
44
  Accept: "application/json",
45
- "User-Agent": typeof options.userAgent === "string" ? options.userAgent : require_docloader.getUserAgent(options.userAgent)
45
+ "User-Agent": typeof options.userAgent === "string" ? options.userAgent : (0, __fedify_vocab_runtime.getUserAgent)(options.userAgent)
46
46
  } });
47
47
  if (!response.ok) {
48
48
  logger.error("Failed to fetch NodeInfo document from {url}: {status} {statusText}", {
@@ -3,25 +3,24 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { UrlError } from "../type-C69ZBu7f.js";
6
+ import "../lookup-NXjB7xUj.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-pV0JOsuV.js";
11
- import "../actor-DuCeRiNh.js";
12
- import "../key-1KXru8Ug.js";
13
- import { verifyRequest } from "../http-BNOYnVsU.js";
14
- import { getAuthenticatedDocumentLoader } from "../authdocloader-Brax1A32.js";
15
- import { mockDocumentLoader, test } from "../testing-BWNCAbL-.js";
16
- import "../std__assert-X-_kMxKM.js";
17
- import { assertRejects } from "../assert_rejects-DiIiJbZn.js";
18
- import "../assert_is_error-BPGph1Jx.js";
19
- import "../assert_not_equals-f3m3epl3.js";
20
- import "../assert_throws-BOO88avQ.js";
21
- import { rsaPrivateKey2 } from "../keys-BPdFKgiy.js";
22
- import { esm_default } from "../esm-DnIzfEj0.js";
10
+ import "../actor-BLq4KEGR.js";
11
+ import "../key-CgKiloJr.js";
12
+ import { verifyRequest } from "../http-B9npZ3Md.js";
13
+ import { getAuthenticatedDocumentLoader } from "../docloader-DtYIz2Pb.js";
14
+ import { mockDocumentLoader, test } from "../testing-u2cUPQLp.js";
15
+ import "../std__assert-DWivtrGR.js";
16
+ import { assertRejects } from "../assert_rejects-Ce45JcFg.js";
17
+ import "../assert_throws-BNXdRGWP.js";
18
+ import "../assert_not_equals-C80BG-_5.js";
19
+ import { rsaPrivateKey2 } from "../keys-B3O7b5eB.js";
20
+ import { esm_default } from "../esm-CQ9nlHuI.js";
21
+ import { UrlError } from "@fedify/vocab-runtime";
23
22
 
24
- //#region src/runtime/authdocloader.test.ts
23
+ //#region src/utils/docloader.test.ts
25
24
  test("getAuthenticatedDocumentLoader()", async (t) => {
26
25
  esm_default.spyGlobal();
27
26
  esm_default.get("begin:https://example.com/object", async (cl) => {