@fedify/fedify 2.2.0-dev.610 → 2.2.0-dev.622

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 (208) hide show
  1. package/README.md +2 -5
  2. package/dist/{accept-D7sAxyNa.js → accept-Dd__NiUL.mjs} +10 -8
  3. package/dist/{assert-MZs1qjMx.js → assert-ddO5KLpe.mjs} +5 -9
  4. package/dist/{assert_equals-DSbWqCm3.js → assert_equals-Ew3jOFa3.mjs} +55 -69
  5. package/dist/{assert_instance_of-DHz7EHNU.js → assert_instance_of-C4Ri6VuN.mjs} +5 -9
  6. package/dist/{assert_not_equals-f3m3epl3.js → assert_not_equals--wG9hV7u.mjs} +6 -13
  7. package/dist/{assert_rejects-0h7I2Esa.js → assert_rejects-B-qJtC9Z.mjs} +6 -11
  8. package/dist/{assert_throws-rjdMBf31.js → assert_throws-4NwKEy2q.mjs} +5 -10
  9. package/dist/{builder-Bkqx5fo0.js → builder-DcSpny3g.mjs} +32 -41
  10. package/dist/{chunk-CGaQZ11T.cjs → chunk-DDcVe30Y.cjs} +23 -24
  11. package/dist/{chunk-DJNbSFdH.js → chunk-nlSIicah.js} +8 -8
  12. package/dist/{client-BxMZiQaD.d.ts → client-AtlibPOU.d.ts} +1 -1
  13. package/dist/{client-CoCIaTNO.js → client-DEpOVgY1.mjs} +9 -13
  14. package/dist/{client-C97KOq3x.d.cts → client-z-8dc-e1.d.cts} +1 -1
  15. package/dist/{collection-CSzG2j1P.js → collection-BD6-SZ6O.mjs} +7 -12
  16. package/dist/compat/mod.cjs +5 -8
  17. package/dist/compat/mod.d.cts +78 -6
  18. package/dist/compat/mod.d.ts +78 -6
  19. package/dist/compat/mod.js +4 -8
  20. package/dist/compat/transformers.test.mjs +62 -0
  21. package/dist/{context-DyJjQQ_H.d.ts → context-BOiMZBu5.d.ts} +9 -18
  22. package/dist/{context-BcqA-0BL.d.cts → context-BhZVy7RB.d.cts} +9 -18
  23. package/dist/{context-Aqenou7c.js → context-Juj6bdHC.mjs} +7 -11
  24. package/dist/deno-D682wzlW.mjs +8 -0
  25. package/dist/{docloader-ORTT1bPi.js → docloader-CCWf4tNV.mjs} +8 -14
  26. package/dist/{esm-nLm00z9V.js → esm-DVILvP5e.mjs} +50 -89
  27. package/dist/federation/builder.test.d.mts +2 -0
  28. package/dist/federation/{builder.test.js → builder.test.mjs} +21 -44
  29. package/dist/federation/collection.test.d.mts +2 -0
  30. package/dist/federation/collection.test.mjs +21 -0
  31. package/dist/federation/handler.test.d.mts +2 -0
  32. package/dist/federation/{handler.test.js → handler.test.mjs} +69 -131
  33. package/dist/federation/idempotency.test.d.mts +2 -0
  34. package/dist/federation/{idempotency.test.js → idempotency.test.mjs} +31 -63
  35. package/dist/federation/inbox.test.d.mts +2 -0
  36. package/dist/federation/{inbox.test.js → inbox.test.mjs} +8 -12
  37. package/dist/federation/keycache.test.d.mts +2 -0
  38. package/dist/federation/{keycache.test.js → keycache.test.mjs} +13 -19
  39. package/dist/federation/kv.test.d.mts +2 -0
  40. package/dist/federation/{kv.test.js → kv.test.mjs} +11 -22
  41. package/dist/federation/middleware.test.d.mts +2 -0
  42. package/dist/federation/{middleware.test.js → middleware.test.mjs} +173 -262
  43. package/dist/federation/mod.cjs +327 -16
  44. package/dist/federation/mod.d.cts +3 -6
  45. package/dist/federation/mod.d.ts +3 -6
  46. package/dist/federation/mod.js +322 -13
  47. package/dist/federation/mq.test.d.mts +2 -0
  48. package/dist/federation/{mq.test.js → mq.test.mjs} +21 -35
  49. package/dist/federation/negotiation.test.d.mts +2 -0
  50. package/dist/federation/{negotiation.test.js → negotiation.test.mjs} +9 -16
  51. package/dist/federation/retry.test.d.mts +2 -0
  52. package/dist/federation/{retry.test.js → retry.test.mjs} +8 -11
  53. package/dist/federation/router.test.d.mts +2 -0
  54. package/dist/federation/{router.test.js → router.test.mjs} +11 -16
  55. package/dist/federation/send.test.d.mts +2 -0
  56. package/dist/federation/{send.test.js → send.test.mjs} +22 -30
  57. package/dist/federation/webfinger.test.d.mts +2 -0
  58. package/dist/federation/{webfinger.test.js → webfinger.test.mjs} +22 -56
  59. package/dist/{http-BDf1pBmE.cjs → http-BQccxQlj.cjs} +177 -302
  60. package/dist/{http-By9CCocC.js → http-CNsnyqrO.mjs} +23 -43
  61. package/dist/{http-BudnHZE2.d.cts → http-CrGuipxe.d.cts} +1 -6
  62. package/dist/{http-DLQMXj_1.js → http-DhwEMhtv.js} +53 -184
  63. package/dist/{http-Dax_FIBo.d.ts → http-aQzN9Ayi.d.ts} +1 -6
  64. package/dist/{inbox-CTJeEur6.js → inbox-DegXbbbS.mjs} +18 -26
  65. package/dist/{key-OaS_196P.js → key-vL60OvqM.mjs} +29 -37
  66. package/dist/{keycache-CpGWAUbj.js → keycache-CCSwkQcY.mjs} +5 -10
  67. package/dist/{keys-BFve7QQv.js → keys-BAK-tUlf.mjs} +5 -9
  68. package/dist/{kv-BL4nlICN.d.cts → kv-CbLNp3zQ.d.cts} +1 -1
  69. package/dist/{kv-DXEUEP6z.d.ts → kv-GFYnFoOl.d.ts} +1 -1
  70. package/dist/{kv-cache-Bw2F2ABq.js → kv-cache-B01V7s3h.mjs} +4 -8
  71. package/dist/{kv-cache-COnBmjEC.js → kv-cache-CTj3iCix.js} +6 -13
  72. package/dist/{kv-cache-DG491NbS.cjs → kv-cache-DxdXJNbj.cjs} +27 -34
  73. package/dist/{kv-QzKcOQgP.js → kv-tL2TOE9X.mjs} +6 -10
  74. package/dist/{ld-5udwE1JY.js → ld-C3CO00YY.mjs} +17 -31
  75. package/dist/{middleware-3FSu2a2W.js → middleware-BmsVSOeS.js} +335 -382
  76. package/dist/middleware-C7shNcsp.cjs +4 -0
  77. package/dist/{middleware-CFuio6Y_.cjs → middleware-Cx0Ny6_7.cjs} +532 -587
  78. package/dist/middleware-DqVGYk56.mjs +5 -0
  79. package/dist/{middleware-DRWIaDqh.js → middleware-Du-vh7I_.mjs} +282 -317
  80. package/dist/{mod-em2Il1eD.d.cts → mod-Bp_CzKd4.d.cts} +2 -2
  81. package/dist/{mod-DCbh1JQ5.d.ts → mod-CLgIXe9w.d.ts} +3 -3
  82. package/dist/{mod-jfnweK2w.d.cts → mod-CMEbIaNh.d.cts} +3 -3
  83. package/dist/{mod-D6MdymW7.d.ts → mod-DKOAow7a.d.ts} +2 -2
  84. package/dist/{mod-Coe7KEgX.d.cts → mod-DoJBjjnO.d.cts} +2 -2
  85. package/dist/{mod-D6dOd--H.d.ts → mod-DvxszxXC.d.ts} +2 -2
  86. package/dist/mod.cjs +29 -74
  87. package/dist/mod.d.cts +11 -14
  88. package/dist/mod.d.ts +11 -15
  89. package/dist/mod.js +17 -71
  90. package/dist/{negotiation-BlAuS_nr.js → negotiation-DnsfFF8I.mjs} +7 -11
  91. package/dist/nodeinfo/client.test.d.mts +2 -0
  92. package/dist/nodeinfo/{client.test.js → client.test.mjs} +22 -40
  93. package/dist/nodeinfo/handler.test.d.mts +2 -0
  94. package/dist/nodeinfo/{handler.test.js → handler.test.mjs} +13 -43
  95. package/dist/nodeinfo/mod.cjs +5 -8
  96. package/dist/nodeinfo/mod.d.cts +2 -3
  97. package/dist/nodeinfo/mod.d.ts +2 -3
  98. package/dist/nodeinfo/mod.js +4 -8
  99. package/dist/nodeinfo/types.test.d.mts +2 -0
  100. package/dist/nodeinfo/{types.test.js → types.test.mjs} +9 -16
  101. package/dist/otel/exporter.test.d.mts +2 -0
  102. package/dist/otel/{exporter.test.js → exporter.test.mjs} +124 -178
  103. package/dist/otel/mod.cjs +15 -20
  104. package/dist/otel/mod.d.cts +2 -2
  105. package/dist/otel/mod.d.ts +2 -2
  106. package/dist/otel/mod.js +8 -14
  107. package/dist/{owner-gd0Q9FuU.d.ts → owner-74ARJ5TL.d.ts} +1 -1
  108. package/dist/{owner-1AbPBOOZ.d.cts → owner-CptqhsOy.d.cts} +1 -1
  109. package/dist/{owner-DuRG_QYg.js → owner-DF320w6K.mjs} +11 -16
  110. package/dist/{proof-DG0_Hm4d.js → proof-BCWk5oas.js} +32 -58
  111. package/dist/{proof-DFffIwhK.js → proof-IyDwwmzL.mjs} +21 -33
  112. package/dist/{proof-WJjJMjvC.cjs → proof-WhNxSv_N.cjs} +133 -157
  113. package/dist/{retry-mqLf4b-R.js → retry-B_E3V_Dx.mjs} +4 -7
  114. package/dist/{router-D9eI0s4b.js → router-CrMLXoOr.mjs} +4 -8
  115. package/dist/runtime/mod.cjs +11 -13
  116. package/dist/runtime/mod.d.cts +6 -2
  117. package/dist/runtime/mod.d.ts +0 -1
  118. package/dist/runtime/mod.js +4 -7
  119. package/dist/{send-CJAMZwWu.js → send-CJQubr5t.mjs} +8 -13
  120. package/dist/sig/accept.test.d.mts +2 -0
  121. package/dist/sig/{accept.test.js → accept.test.mjs} +35 -70
  122. package/dist/sig/http.test.d.mts +2 -0
  123. package/dist/sig/{http.test.js → http.test.mjs} +166 -280
  124. package/dist/sig/key.test.d.mts +2 -0
  125. package/dist/sig/{key.test.js → key.test.mjs} +11 -18
  126. package/dist/sig/ld.test.d.mts +2 -0
  127. package/dist/sig/{ld.test.js → ld.test.mjs} +22 -35
  128. package/dist/sig/mod.cjs +6 -9
  129. package/dist/sig/mod.d.cts +3 -3
  130. package/dist/sig/mod.d.ts +3 -3
  131. package/dist/sig/mod.js +5 -9
  132. package/dist/sig/owner.test.d.mts +2 -0
  133. package/dist/sig/{owner.test.js → owner.test.mjs} +19 -34
  134. package/dist/sig/proof.test.d.mts +2 -0
  135. package/dist/sig/{proof.test.js → proof.test.mjs} +16 -27
  136. package/dist/{std__assert-X-_kMxKM.js → std__assert-Duiq_YC9.mjs} +12 -24
  137. package/dist/testing/{mod.d.ts → mod.d.mts} +26 -90
  138. package/dist/testing/mod.mjs +6 -0
  139. package/dist/{transformers-3g8GZwkZ.cjs → transformers-NeAONrAq.cjs} +20 -25
  140. package/dist/{transformers-C3FLHUd6.js → transformers-ve6e2xcg.js} +3 -7
  141. package/dist/{types-CPz01LGH.js → types-DCP0WLdt.mjs} +4 -7
  142. package/dist/{types-Cd_hszr_.cjs → types-KC4QAoxe.cjs} +29 -34
  143. package/dist/{types-C93Ob9cU.js → types-hvL8ElAs.js} +8 -13
  144. package/dist/utils/docloader.test.d.mts +2 -0
  145. package/dist/utils/{docloader.test.js → docloader.test.mjs} +14 -25
  146. package/dist/utils/kv-cache.test.d.mts +2 -0
  147. package/dist/utils/{kv-cache.test.js → kv-cache.test.mjs} +25 -40
  148. package/dist/utils/mod.cjs +5 -9
  149. package/dist/utils/mod.d.cts +1 -3
  150. package/dist/utils/mod.d.ts +1 -3
  151. package/dist/utils/mod.js +4 -9
  152. package/dist/vocab/cjs.test.d.mts +2 -0
  153. package/dist/vocab/cjs.test.mjs +14 -0
  154. package/dist/vocab/mod.cjs +10 -12
  155. package/dist/vocab/mod.js +3 -5
  156. package/package.json +8 -8
  157. package/dist/compat/transformers.test.d.ts +0 -3
  158. package/dist/compat/transformers.test.js +0 -88
  159. package/dist/compat-Bb4NuTUO.js +0 -4
  160. package/dist/compat-DmDDELst.cjs +0 -4
  161. package/dist/deno-CMcbjYDs.js +0 -121
  162. package/dist/federation/builder.test.d.ts +0 -3
  163. package/dist/federation/collection.test.d.ts +0 -3
  164. package/dist/federation/collection.test.js +0 -32
  165. package/dist/federation/handler.test.d.ts +0 -3
  166. package/dist/federation/idempotency.test.d.ts +0 -3
  167. package/dist/federation/inbox.test.d.ts +0 -3
  168. package/dist/federation/keycache.test.d.ts +0 -3
  169. package/dist/federation/kv.test.d.ts +0 -3
  170. package/dist/federation/middleware.test.d.ts +0 -3
  171. package/dist/federation/mq.test.d.ts +0 -3
  172. package/dist/federation/negotiation.test.d.ts +0 -3
  173. package/dist/federation/retry.test.d.ts +0 -3
  174. package/dist/federation/router.test.d.ts +0 -3
  175. package/dist/federation/send.test.d.ts +0 -3
  176. package/dist/federation/webfinger.test.d.ts +0 -3
  177. package/dist/federation-Bp3HI26G.cjs +0 -350
  178. package/dist/federation-DaMfqRm4.js +0 -332
  179. package/dist/middleware-BzcyJjau.js +0 -12
  180. package/dist/middleware-HlNnBIDX.js +0 -27
  181. package/dist/middleware-i-8IYJwY.cjs +0 -12
  182. package/dist/mod-B7QkWzrL.d.cts +0 -80
  183. package/dist/mod-Bh8mqlYw.d.cts +0 -9
  184. package/dist/mod-D6HodEq7.d.ts +0 -7
  185. package/dist/mod-SMHOMNpZ.d.ts +0 -82
  186. package/dist/mod-gq_Xfdz8.d.cts +0 -1
  187. package/dist/nodeinfo/client.test.d.ts +0 -3
  188. package/dist/nodeinfo/handler.test.d.ts +0 -3
  189. package/dist/nodeinfo/types.test.d.ts +0 -3
  190. package/dist/nodeinfo-DoESQxq5.js +0 -4
  191. package/dist/nodeinfo-DuMYTpbZ.cjs +0 -4
  192. package/dist/otel/exporter.test.d.ts +0 -3
  193. package/dist/runtime-c2Njxsry.cjs +0 -17
  194. package/dist/runtime-poamPCMb.js +0 -13
  195. package/dist/sig/accept.test.d.ts +0 -3
  196. package/dist/sig/http.test.d.ts +0 -3
  197. package/dist/sig/key.test.d.ts +0 -3
  198. package/dist/sig/ld.test.d.ts +0 -3
  199. package/dist/sig/owner.test.d.ts +0 -3
  200. package/dist/sig/proof.test.d.ts +0 -3
  201. package/dist/sig-BNhspNOf.js +0 -4
  202. package/dist/sig-vX39WyWI.cjs +0 -4
  203. package/dist/testing/mod.js +0 -10
  204. package/dist/utils/docloader.test.d.ts +0 -3
  205. package/dist/utils/kv-cache.test.d.ts +0 -3
  206. package/dist/utils-BQ9KqEK9.cjs +0 -4
  207. package/dist/utils-Dn5OPdSW.js +0 -4
  208. /package/dist/{mod-AGjRfPjT.d.ts → compat/transformers.test.d.mts} +0 -0
@@ -1,14 +1,11 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
- globalThis.addEventListener = () => {};
5
-
6
- import { RouterError } from "./router-D9eI0s4b.js";
1
+ import "@js-temporal/polyfill";
2
+ import "urlpattern-polyfill";
3
+ globalThis.addEventListener = () => {};
4
+ import { n as RouterError } from "./router-CrMLXoOr.mjs";
7
5
  import { mockDocumentLoader } from "@fedify/fixture";
8
6
  import { lookupObject, traverseCollection } from "@fedify/vocab";
9
7
  import { lookupWebFinger } from "@fedify/webfinger";
10
8
  import { trace } from "@opentelemetry/api";
11
-
12
9
  //#region src/testing/context.ts
13
10
  function createContext(values) {
14
11
  const { federation, url = new URL("http://example.com/"), canonicalOrigin, data, documentLoader, contextLoader, tracerProvider, clone, getNodeInfoUri, getActorUri, getObjectUri, getCollectionUri, getOutboxUri, getInboxUri, getFollowingUri, getFollowersUri, getLikedUri, getFeaturedUri, getFeaturedTagsUri, parseUri, getActorKeyPairs, getDocumentLoader, lookupObject: lookupObject$1, traverseCollection: traverseCollection$1, lookupNodeInfo, lookupWebFinger: lookupWebFinger$1, sendActivity, routeActivity } = values;
@@ -25,9 +22,9 @@ function createContext(values) {
25
22
  documentLoader: documentLoader ?? mockDocumentLoader,
26
23
  contextLoader: contextLoader ?? mockDocumentLoader,
27
24
  tracerProvider: tracerProvider ?? trace.getTracerProvider(),
28
- clone: clone ?? ((data$1) => createContext({
25
+ clone: clone ?? ((data) => createContext({
29
26
  ...values,
30
- data: data$1
27
+ data
31
28
  })),
32
29
  getNodeInfoUri: getNodeInfoUri ?? throwRouterError,
33
30
  getActorUri: getActorUri ?? throwRouterError,
@@ -104,6 +101,5 @@ function createInboxContext(args) {
104
101
  })
105
102
  };
106
103
  }
107
-
108
104
  //#endregion
109
- export { createInboxContext, createRequestContext };
105
+ export { createRequestContext as n, createInboxContext as t };
@@ -0,0 +1,8 @@
1
+ import "@js-temporal/polyfill";
2
+ import "urlpattern-polyfill";
3
+ globalThis.addEventListener = () => {};
4
+ //#region deno.json
5
+ var name = "@fedify/fedify";
6
+ var version = "2.2.0-dev.622+e54cb037";
7
+ //#endregion
8
+ export { version as n, name as t };
@@ -1,14 +1,11 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
- globalThis.addEventListener = () => {};
5
-
6
- import { validateCryptoKey } from "./key-OaS_196P.js";
7
- import { doubleKnock } from "./http-By9CCocC.js";
1
+ import "@js-temporal/polyfill";
2
+ import "urlpattern-polyfill";
3
+ globalThis.addEventListener = () => {};
4
+ import { o as validateCryptoKey } from "./key-vL60OvqM.mjs";
5
+ import { n as doubleKnock } from "./http-CNsnyqrO.mjs";
8
6
  import { curry } from "es-toolkit";
9
7
  import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, validatePublicUrl } from "@fedify/vocab-runtime";
10
8
  import { getLogger } from "@logtape/logtape";
11
-
12
9
  //#region src/utils/docloader.ts
13
10
  const logger = getLogger([
14
11
  "fedify",
@@ -38,18 +35,15 @@ function getAuthenticatedDocumentLoader(identity, { allowPrivateAddress, maxRedi
38
35
  });
39
36
  throw error;
40
37
  }
41
- const originalRequest = createActivityPubRequest(url, { userAgent });
42
- const response = await doubleKnock(originalRequest, identity, {
38
+ return getRemoteDocument(url, await doubleKnock(createActivityPubRequest(url, { userAgent }), identity, {
43
39
  maxRedirection,
44
40
  specDeterminer,
45
41
  log: curry(logRequest)(logger),
46
42
  tracerProvider,
47
43
  signal: options?.signal
48
- });
49
- return getRemoteDocument(url, response, load);
44
+ }), load);
50
45
  }
51
46
  return load;
52
47
  }
53
-
54
48
  //#endregion
55
- export { getAuthenticatedDocumentLoader };
49
+ export { getAuthenticatedDocumentLoader as t };
@@ -1,20 +1,15 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
- globalThis.addEventListener = () => {};
5
-
1
+ import "@js-temporal/polyfill";
2
+ import "urlpattern-polyfill";
3
+ globalThis.addEventListener = () => {};
6
4
  import "node:module";
7
-
8
- //#region rolldown:runtime
5
+ //#region \0rolldown/runtime.js
9
6
  var __create = Object.create;
10
7
  var __defProp = Object.defineProperty;
11
8
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
9
  var __getOwnPropNames = Object.getOwnPropertyNames;
13
10
  var __getProtoOf = Object.getPrototypeOf;
14
11
  var __hasOwnProp = Object.prototype.hasOwnProperty;
15
- var __commonJS = (cb, mod) => function() {
16
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
17
- };
12
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
18
13
  var __copyProps = (to, from, except, desc) => {
19
14
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
20
15
  key = keys[i];
@@ -29,13 +24,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
24
  value: mod,
30
25
  enumerable: true
31
26
  }) : target, mod));
32
-
33
27
  //#endregion
34
28
  //#region ../../node_modules/.pnpm/glob-to-regexp@0.4.1/node_modules/glob-to-regexp/index.js
35
- var require_glob_to_regexp = __commonJS({ "../../node_modules/.pnpm/glob-to-regexp@0.4.1/node_modules/glob-to-regexp/index.js"(exports, module) {
36
- module.exports = function(glob$1, opts) {
37
- if (typeof glob$1 !== "string") throw new TypeError("Expected a string");
38
- var str = String(glob$1);
29
+ var require_glob_to_regexp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30
+ module.exports = function(glob, opts) {
31
+ if (typeof glob !== "string") throw new TypeError("Expected a string");
32
+ var str = String(glob);
39
33
  var reStr = "";
40
34
  var extended = opts ? !!opts.extended : false;
41
35
  var globstar = opts ? !!opts.globstar : false;
@@ -92,13 +86,10 @@ var require_glob_to_regexp = __commonJS({ "../../node_modules/.pnpm/glob-to-rege
92
86
  }
93
87
  var nextChar = str[i + 1];
94
88
  if (!globstar) reStr += ".*";
95
- else {
96
- var isGlobstar = starCount > 1 && (prevChar === "/" || prevChar === void 0) && (nextChar === "/" || nextChar === void 0);
97
- if (isGlobstar) {
98
- reStr += "((?:[^/]*(?:/|$))*)";
99
- i++;
100
- } else reStr += "([^/]*)";
101
- }
89
+ else if (starCount > 1 && (prevChar === "/" || prevChar === void 0) && (nextChar === "/" || nextChar === void 0)) {
90
+ reStr += "((?:[^/]*(?:/|$))*)";
91
+ i++;
92
+ } else reStr += "([^/]*)";
102
93
  break;
103
94
  default: reStr += c;
104
95
  }
@@ -106,8 +97,7 @@ var require_glob_to_regexp = __commonJS({ "../../node_modules/.pnpm/glob-to-rege
106
97
  if (!flags || !~flags.indexOf("g")) reStr = "^" + reStr + "$";
107
98
  return new RegExp(reStr, flags);
108
99
  };
109
- } });
110
-
100
+ }));
111
101
  //#endregion
112
102
  //#region ../../node_modules/.pnpm/regexparam@3.0.0/node_modules/regexparam/dist/index.mjs
113
103
  /**
@@ -139,7 +129,6 @@ function parse(input, loose) {
139
129
  pattern: new RegExp("^" + pattern + (loose ? "(?=$|/)" : "/?$"), "i")
140
130
  };
141
131
  }
142
-
143
132
  //#endregion
144
133
  //#region ../../node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/TypeDescriptor.js
145
134
  const valueTypes = new Set([
@@ -231,7 +220,6 @@ var TypeDescriptor = class TypeDescriptor {
231
220
  return TypeDescriptor.of(value) === "undefined";
232
221
  }
233
222
  };
234
-
235
223
  //#endregion
236
224
  //#region ../../node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/IsSubsetOf.js
237
225
  const allowedTypes = new Set([
@@ -258,7 +246,7 @@ const isSubsetOf = function(subset, superset, visited = []) {
258
246
  switch (subsetItemType) {
259
247
  case "array":
260
248
  case "object":
261
- case "function": {
249
+ case "function":
262
250
  if (visited.includes(subsetItem)) continue;
263
251
  visited.push(subsetItem);
264
252
  isItemInSuperset = superset.some((supersetItem) => {
@@ -269,7 +257,6 @@ const isSubsetOf = function(subset, superset, visited = []) {
269
257
  }
270
258
  });
271
259
  break;
272
- }
273
260
  default: isItemInSuperset = superset.includes(subsetItem);
274
261
  }
275
262
  if (!isItemInSuperset) return false;
@@ -281,21 +268,18 @@ const isSubsetOf = function(subset, superset, visited = []) {
281
268
  if (Object.keys(subset).length > Object.keys(superset).length) return false;
282
269
  for (const [subsetKey, subsetValue] of Object.entries(subset)) {
283
270
  const supersetValue = superset[subsetKey];
284
- const subsetValueType = TypeDescriptor.of(subsetValue);
285
- switch (subsetValueType) {
271
+ switch (TypeDescriptor.of(subsetValue)) {
286
272
  case "array":
287
273
  case "object":
288
- case "function": {
274
+ case "function":
289
275
  if (visited.includes(subsetValue)) continue;
290
276
  visited.push(subsetValue);
291
277
  try {
292
- const isInSuperset = isSubsetOf(subsetValue, supersetValue, visited);
293
- if (!isInSuperset) return false;
278
+ if (!isSubsetOf(subsetValue, supersetValue, visited)) return false;
294
279
  } catch {
295
280
  return false;
296
281
  }
297
282
  break;
298
- }
299
283
  default: if (subsetValue !== supersetValue) return false;
300
284
  }
301
285
  }
@@ -318,8 +302,7 @@ isSubsetOf.structural = function(subset, superset, visited = []) {
318
302
  if (visited.includes(subsetValue)) continue;
319
303
  visited.push(subsetValue);
320
304
  try {
321
- const isInSuperset = isSubsetOf.structural(subsetValue, supersetValue, visited);
322
- if (!isInSuperset) return false;
305
+ if (!isSubsetOf.structural(subsetValue, supersetValue, visited)) return false;
323
306
  } catch {
324
307
  return false;
325
308
  }
@@ -327,7 +310,6 @@ isSubsetOf.structural = function(subset, superset, visited = []) {
327
310
  }
328
311
  return true;
329
312
  };
330
-
331
313
  //#endregion
332
314
  //#region ../../node_modules/.pnpm/dequal@2.0.3/node_modules/dequal/dist/index.mjs
333
315
  var has = Object.prototype.hasOwnProperty;
@@ -390,11 +372,10 @@ function dequal(foo, bar) {
390
372
  }
391
373
  return foo !== foo && bar !== bar;
392
374
  }
393
-
394
375
  //#endregion
395
376
  //#region ../../node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/RequestUtils.js
396
- const absoluteUrlRX = new RegExp("^[a-z]+://|^data:", "i");
397
- const protocolRelativeUrlRX = new RegExp("^//", "i");
377
+ const absoluteUrlRX = /* @__PURE__ */ new RegExp("^[a-z]+://|^data:", "i");
378
+ const protocolRelativeUrlRX = /* @__PURE__ */ new RegExp("^//", "i");
398
379
  function hasCredentialsInUrl(url) {
399
380
  const urlObject = new URL(url, !absoluteUrlRX.test(url) ? "http://dummy" : void 0);
400
381
  return Boolean(urlObject.username || urlObject.password);
@@ -442,7 +423,7 @@ async function createCallLogFromRequest(request, options) {
442
423
  } catch {}
443
424
  if (request.headers) derivedOptions.headers = normalizeHeaders(request.headers);
444
425
  const url = normalizeUrl(request.url, true);
445
- const callLog = {
426
+ return {
446
427
  args: [request, options],
447
428
  url,
448
429
  queryParams: new URLSearchParams(getQuery(url)),
@@ -451,11 +432,9 @@ async function createCallLogFromRequest(request, options) {
451
432
  signal: options && options.signal || request.signal,
452
433
  pendingPromises
453
434
  };
454
- return callLog;
455
435
  }
456
436
  function getPath(url) {
457
- const u = absoluteUrlRX.test(url) ? new URL(url) : new URL(url, "http://dummy");
458
- return u.pathname;
437
+ return (absoluteUrlRX.test(url) ? new URL(url) : new URL(url, "http://dummy")).pathname;
459
438
  }
460
439
  function getHost(url) {
461
440
  if (absoluteUrlRX.test(url)) return new URL(url).host;
@@ -473,10 +452,9 @@ function normalizeHeaders(headers) {
473
452
  else entries = Object.entries(headers);
474
453
  return Object.fromEntries(entries.map(([key, val]) => [key.toLowerCase(), String(val).valueOf()]));
475
454
  }
476
-
477
455
  //#endregion
478
456
  //#region ../../node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/Matchers.js
479
- var import_glob_to_regexp = __toESM(require_glob_to_regexp(), 1);
457
+ var import_glob_to_regexp = /* @__PURE__ */ __toESM(require_glob_to_regexp(), 1);
480
458
  const isUrlMatcher = (matcher) => matcher instanceof RegExp || typeof matcher === "string" || typeof matcher === "object" && "href" in matcher;
481
459
  const isFunctionMatcher = (matcher) => typeof matcher === "function";
482
460
  const stringMatchers = {
@@ -530,8 +508,7 @@ const getMissingHeaderMatcher = ({ missingHeaders: expectedMissingHeaders }) =>
530
508
  const getMethodMatcher = ({ method: expectedMethod }) => {
531
509
  if (!expectedMethod) return;
532
510
  return ({ options: { method } = {} }) => {
533
- const actualMethod = method ? method.toLowerCase() : "get";
534
- return expectedMethod === actualMethod;
511
+ return expectedMethod === (method ? method.toLowerCase() : "get");
535
512
  };
536
513
  };
537
514
  const getQueryParamsMatcher = ({ query: passedQuery }) => {
@@ -610,7 +587,7 @@ const getUrlMatcher = (route) => {
610
587
  }
611
588
  if (typeof matcherUrl === "string") {
612
589
  for (const shorthand in stringMatchers) if (matcherUrl.indexOf(`${shorthand}:`) === 0) {
613
- const urlFragment = matcherUrl.replace(/* @__PURE__ */ new RegExp(`^${shorthand}:`), "");
590
+ const urlFragment = matcherUrl.replace(new RegExp(`^${shorthand}:`), "");
614
591
  return stringMatchers[shorthand](urlFragment);
615
592
  }
616
593
  return getFullUrlMatcher(route, matcherUrl, query);
@@ -621,7 +598,7 @@ const getUrlMatcher = (route) => {
621
598
  else if (key in stringMatchers) return stringMatchers[key](pattern);
622
599
  else throw new Error(`unrecognised url matching pattern: ${key}`);
623
600
  });
624
- return (route$1) => matchers.every((matcher) => matcher(route$1));
601
+ return (route) => matchers.every((matcher) => matcher(route));
625
602
  }
626
603
  };
627
604
  const builtInMatchers = [
@@ -659,7 +636,6 @@ const builtInMatchers = [
659
636
  matcher: getFunctionMatcher
660
637
  }
661
638
  ];
662
-
663
639
  //#endregion
664
640
  //#region ../../node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/StatusTextMap.js
665
641
  const statusTextMap = {
@@ -726,17 +702,15 @@ const statusTextMap = {
726
702
  510: "Not Extended",
727
703
  511: "Network Authentication Required"
728
704
  };
729
- var StatusTextMap_default = statusTextMap;
730
-
731
705
  //#endregion
732
706
  //#region ../../node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/Route.js
733
- var __classPrivateFieldSet = void 0 && (void 0).__classPrivateFieldSet || function(receiver, state, value, kind, f) {
707
+ var __classPrivateFieldSet = function(receiver, state, value, kind, f) {
734
708
  if (kind === "m") throw new TypeError("Private method is not writable");
735
709
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
736
710
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
737
711
  return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
738
712
  };
739
- var __classPrivateFieldGet = void 0 && (void 0).__classPrivateFieldGet || function(receiver, state, kind, f) {
713
+ var __classPrivateFieldGet = function(receiver, state, kind, f) {
740
714
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
741
715
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
742
716
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -797,14 +771,13 @@ var Route = class {
797
771
  constructResponseOptions(responseInput) {
798
772
  const options = responseInput.options || {};
799
773
  options.status = sanitizeStatus(responseInput.status);
800
- options.statusText = StatusTextMap_default[options.status];
774
+ options.statusText = statusTextMap[options.status];
801
775
  options.headers = new this.config.Headers(responseInput.headers);
802
776
  return options;
803
777
  }
804
778
  constructResponseBody(responseInput, responseOptions) {
805
779
  let body = responseInput.body;
806
- const bodyIsBodyInit = isBodyInit(body);
807
- if (!bodyIsBodyInit) if (typeof body === "undefined") body = null;
780
+ if (!isBodyInit(body)) if (typeof body === "undefined") body = null;
808
781
  else if (typeof body === "object") {
809
782
  body = JSON.stringify(body);
810
783
  if (!responseOptions.headers.has("Content-Type")) responseOptions.headers.set("Content-Type", "application/json");
@@ -823,26 +796,25 @@ var Route = class {
823
796
  _a.registeredMatchers.push(matcher);
824
797
  }
825
798
  };
826
- _a = Route, _Route_responseSubscriptions = /* @__PURE__ */ new WeakMap(), _Route_instances = /* @__PURE__ */ new WeakSet(), _Route_validate = function _Route_validate$1() {
799
+ _a = Route, _Route_responseSubscriptions = /* @__PURE__ */ new WeakMap(), _Route_instances = /* @__PURE__ */ new WeakSet(), _Route_validate = function _Route_validate() {
827
800
  if (["matched", "unmatched"].includes(this.config.name)) throw new Error(`fetch-mock: Routes cannot use the reserved name \`${this.config.name}\``);
828
801
  if (!("response" in this.config)) throw new Error("fetch-mock: Each route must define a response");
829
802
  if (!_a.registeredMatchers.some(({ name }) => name in this.config)) throw new Error("fetch-mock: Each route must specify some criteria for matching calls to fetch. To match all calls use '*'");
830
- }, _Route_sanitize = function _Route_sanitize$1() {
803
+ }, _Route_sanitize = function _Route_sanitize() {
831
804
  if (this.config.method) this.config.method = this.config.method.toLowerCase();
832
- }, _Route_generateMatcher = function _Route_generateMatcher$1() {
805
+ }, _Route_generateMatcher = function _Route_generateMatcher() {
833
806
  const activeMatchers = _a.registeredMatchers.filter(({ name }) => name in this.config).map(({ matcher, usesBody }) => ({
834
807
  matcher: matcher(this.config),
835
808
  usesBody
836
809
  }));
837
810
  this.config.usesBody = activeMatchers.some(({ usesBody }) => usesBody);
838
811
  this.matcher = (normalizedRequest) => activeMatchers.every(({ matcher }) => matcher(normalizedRequest));
839
- }, _Route_limit = function _Route_limit$1() {
812
+ }, _Route_limit = function _Route_limit() {
840
813
  if (!this.config.repeat) return;
841
814
  const originalMatcher = this.matcher;
842
815
  let timesLeft = this.config.repeat;
843
816
  this.matcher = (callLog) => {
844
- const match = timesLeft && originalMatcher(callLog);
845
- if (match) {
817
+ if (timesLeft && originalMatcher(callLog)) {
846
818
  timesLeft--;
847
819
  return true;
848
820
  }
@@ -850,7 +822,7 @@ _a = Route, _Route_responseSubscriptions = /* @__PURE__ */ new WeakMap(), _Route
850
822
  this.reset = () => {
851
823
  timesLeft = this.config.repeat;
852
824
  };
853
- }, _Route_delayResponse = function _Route_delayResponse$1() {
825
+ }, _Route_delayResponse = function _Route_delayResponse() {
854
826
  if (this.config.delay) {
855
827
  const { response } = this.config;
856
828
  this.config.response = () => {
@@ -860,8 +832,6 @@ _a = Route, _Route_responseSubscriptions = /* @__PURE__ */ new WeakMap(), _Route
860
832
  };
861
833
  Route.registeredMatchers = [];
862
834
  builtInMatchers.forEach(Route.defineMatcher);
863
- var Route_default = Route;
864
-
865
835
  //#endregion
866
836
  //#region ../../node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/Router.js
867
837
  const responseConfigProps = [
@@ -934,8 +904,7 @@ var Router = class {
934
904
  });
935
905
  }
936
906
  if (this.needsToReadBody(request)) options.body = await options.body;
937
- const routesToTry = this.fallbackRoute ? [...this.routes, this.fallbackRoute] : this.routes;
938
- const route = routesToTry.find((route$1) => route$1.matcher(callLog));
907
+ const route = (this.fallbackRoute ? [...this.routes, this.fallbackRoute] : this.routes).find((route) => route.matcher(callLog));
939
908
  if (route) try {
940
909
  callLog.route = route;
941
910
  const { response, responseOptions, responseInput } = await this.generateResponse(callLog);
@@ -990,7 +959,7 @@ var Router = class {
990
959
  else Object.assign(config, matcher);
991
960
  if (typeof response !== "undefined") config.response = response;
992
961
  if (nameOrOptions) Object.assign(config, typeof nameOrOptions === "string" ? nameToOptions(nameOrOptions) : nameOrOptions);
993
- const route = new Route_default({
962
+ const route = new Route({
994
963
  ...this.config,
995
964
  ...config
996
965
  });
@@ -1009,7 +978,7 @@ var Router = class {
1009
978
  }
1010
979
  setFallback(response) {
1011
980
  if (this.fallbackRoute) console.warn("calling fetchMock.catch() twice - are you sure you want to overwrite the previous fallback response");
1012
- this.fallbackRoute = new Route_default({
981
+ this.fallbackRoute = new Route({
1013
982
  matcherFunction: () => true,
1014
983
  response: response || "ok",
1015
984
  ...this.config
@@ -1041,7 +1010,6 @@ var Router = class {
1041
1010
  route.init(newConfig);
1042
1011
  }
1043
1012
  };
1044
-
1045
1013
  //#endregion
1046
1014
  //#region ../../node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/CallHistory.js
1047
1015
  const isName = (filter) => typeof filter === "string" && /^[\da-zA-Z-]+$/.test(filter) && !["matched", "unmatched"].includes(filter);
@@ -1087,12 +1055,12 @@ var CallHistory = class {
1087
1055
  ...filter,
1088
1056
  ...options || {}
1089
1057
  };
1090
- const { matcher } = new Route_default({
1058
+ const { matcher } = new Route({
1091
1059
  response: "ok",
1092
1060
  ...options
1093
1061
  });
1094
- calls = calls.filter(({ url, options: options$1 }) => {
1095
- return matcher(createCallLogFromUrlAndOptions(url, options$1));
1062
+ calls = calls.filter(({ url, options }) => {
1063
+ return matcher(createCallLogFromUrlAndOptions(url, options));
1096
1064
  });
1097
1065
  return calls;
1098
1066
  }
@@ -1125,8 +1093,6 @@ var CallHistory = class {
1125
1093
  }).every((isDone) => isDone);
1126
1094
  }
1127
1095
  };
1128
- var CallHistory_default = CallHistory;
1129
-
1130
1096
  //#endregion
1131
1097
  //#region ../../node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/FetchMock.js
1132
1098
  const defaultFetchMockConfig = {
@@ -1148,7 +1114,9 @@ const defineGreedyShorthand = (shorthandOptions) => {
1148
1114
  return this.route("*", response, Object.assign(options || {}, shorthandOptions));
1149
1115
  };
1150
1116
  };
1151
- var FetchMock = class FetchMock {
1117
+ //#endregion
1118
+ //#region ../../node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/index.js
1119
+ var esm_default = new class FetchMock {
1152
1120
  constructor(config, router) {
1153
1121
  this.sticky = defineShorthand({ sticky: true });
1154
1122
  this.once = defineShorthand({ repeat: 1 });
@@ -1189,7 +1157,7 @@ var FetchMock = class FetchMock {
1189
1157
  routes: router ? [...router.routes] : [],
1190
1158
  fallbackRoute: router ? router.fallbackRoute : null
1191
1159
  });
1192
- this.callHistory = new CallHistory_default(this.config, this.router);
1160
+ this.callHistory = new CallHistory(this.config, this.router);
1193
1161
  this.fetchHandler = this.fetchHandler.bind(this);
1194
1162
  Object.assign(this.fetchHandler, { fetchMock: this });
1195
1163
  }
@@ -1214,7 +1182,7 @@ var FetchMock = class FetchMock {
1214
1182
  return this;
1215
1183
  }
1216
1184
  defineMatcher(matcher) {
1217
- Route_default.defineMatcher(matcher);
1185
+ Route.defineMatcher(matcher);
1218
1186
  }
1219
1187
  removeRoutes(options) {
1220
1188
  this.router.removeRoutes(options);
@@ -1256,13 +1224,6 @@ var FetchMock = class FetchMock {
1256
1224
  this.mockGlobal();
1257
1225
  return this.spy();
1258
1226
  }
1259
- };
1260
- const fetchMock = new FetchMock({ ...defaultFetchMockConfig });
1261
- var FetchMock_default = fetchMock;
1262
-
1263
- //#endregion
1264
- //#region ../../node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/index.js
1265
- var esm_default = FetchMock_default;
1266
-
1227
+ }({ ...defaultFetchMockConfig });
1267
1228
  //#endregion
1268
- export { esm_default };
1229
+ export { esm_default as t };
@@ -0,0 +1,2 @@
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ import { URLPattern } from "urlpattern-polyfill";
@@ -1,23 +1,13 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
- globalThis.addEventListener = () => {};
5
-
6
- import { assertEquals } from "../assert_equals-DSbWqCm3.js";
7
- import "../assert-MZs1qjMx.js";
8
- import "../assert_instance_of-DHz7EHNU.js";
9
- import { MemoryKvStore } from "../kv-QzKcOQgP.js";
10
- import "../deno-CMcbjYDs.js";
11
- import "../router-D9eI0s4b.js";
12
- import "../inbox-CTJeEur6.js";
13
- import { createFederationBuilder } from "../builder-Bkqx5fo0.js";
14
- import { assertExists } from "../std__assert-X-_kMxKM.js";
15
- import "../assert_rejects-0h7I2Esa.js";
16
- import { assertThrows } from "../assert_throws-rjdMBf31.js";
17
- import "../assert_not_equals-f3m3epl3.js";
1
+ import "@js-temporal/polyfill";
2
+ import "urlpattern-polyfill";
3
+ globalThis.addEventListener = () => {};
4
+ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
+ import { a as assertExists } from "../std__assert-Duiq_YC9.mjs";
6
+ import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
7
+ import { t as MemoryKvStore } from "../kv-tL2TOE9X.mjs";
8
+ import { n as createFederationBuilder } from "../builder-DcSpny3g.mjs";
18
9
  import { test } from "@fedify/fixture";
19
10
  import { Activity, Note, Person } from "@fedify/vocab";
20
-
21
11
  //#region src/federation/builder.test.ts
22
12
  test("FederationBuilder", async (t) => {
23
13
  await t.step("should build a Federation object with registered components", async () => {
@@ -28,8 +18,7 @@ test("FederationBuilder", async (t) => {
28
18
  };
29
19
  builder.setActorDispatcher("/users/{identifier}", actorDispatcher);
30
20
  const inboxListener = (_ctx, _activity) => {};
31
- const listeners = builder.setInboxListeners("/users/{identifier}/inbox");
32
- listeners.on(Activity, inboxListener);
21
+ builder.setInboxListeners("/users/{identifier}/inbox").on(Activity, inboxListener);
33
22
  const objectDispatcher = (_ctx, _values) => {
34
23
  return null;
35
24
  };
@@ -69,8 +58,7 @@ test("FederationBuilder", async (t) => {
69
58
  assertExists(inboxListeners);
70
59
  assertExists(impl.objectCallbacks[Note.typeId.href]);
71
60
  assertExists(impl.nodeInfoDispatcher);
72
- const notePaths = impl.router.build(`object:${Note.typeId.href}`, { id: "123" });
73
- assertEquals(notePaths, "/notes/123");
61
+ assertEquals(impl.router.build(`object:${Note.typeId.href}`, { id: "123" }), "/notes/123");
74
62
  assertEquals(impl.router.build("actor", { identifier: "user1" }), "/users/user1");
75
63
  assertEquals(impl.router.build("inbox", { identifier: "user1" }), "/users/user1/inbox");
76
64
  await builder.build({ kv });
@@ -80,8 +68,7 @@ test("FederationBuilder", async (t) => {
80
68
  const kv = new MemoryKvStore();
81
69
  const federation = await builder.build({ kv });
82
70
  assertExists(federation);
83
- const impl = federation;
84
- assertEquals(impl.kv, kv);
71
+ assertEquals(federation.kv, kv);
85
72
  });
86
73
  await t.step("should pass build options correctly", async () => {
87
74
  const builder = createFederationBuilder();
@@ -106,33 +93,26 @@ test("FederationBuilder", async (t) => {
106
93
  const kv = new MemoryKvStore();
107
94
  const federationDefault = await builder.build({ kv });
108
95
  assertExists(federationDefault);
109
- const implDefault = federationDefault;
110
- assertEquals(implDefault.firstKnock, void 0);
96
+ assertEquals(federationDefault.firstKnock, void 0);
111
97
  const federationCustom = await builder.build({
112
98
  kv,
113
99
  firstKnock: "draft-cavage-http-signatures-12"
114
100
  });
115
101
  assertExists(federationCustom);
116
- const implCustom = federationCustom;
117
- assertEquals(implCustom.firstKnock, "draft-cavage-http-signatures-12");
102
+ assertEquals(federationCustom.firstKnock, "draft-cavage-http-signatures-12");
118
103
  const federationRfc = await builder.build({
119
104
  kv,
120
105
  firstKnock: "rfc9421"
121
106
  });
122
107
  assertExists(federationRfc);
123
- const implRfc = federationRfc;
124
- assertEquals(implRfc.firstKnock, "rfc9421");
108
+ assertEquals(federationRfc.firstKnock, "rfc9421");
125
109
  });
126
110
  await t.step("should copy unverified activity handler into built federation", async () => {
127
111
  const builder = createFederationBuilder();
128
112
  const kv = new MemoryKvStore();
129
- const handler = (_ctx, _activity, _reason) => {
130
- return;
131
- };
113
+ const handler = (_ctx, _activity, _reason) => {};
132
114
  builder.setInboxListeners("/users/{identifier}/inbox").onUnverifiedActivity(handler);
133
- const federation = await builder.build({ kv });
134
- const impl = federation;
135
- assertEquals(impl.unverifiedActivityHandler, handler);
115
+ assertEquals((await builder.build({ kv })).unverifiedActivityHandler, handler);
136
116
  });
137
117
  await t.step("should register multiple object dispatchers and verify them", async () => {
138
118
  const builder = createFederationBuilder();
@@ -145,14 +125,11 @@ test("FederationBuilder", async (t) => {
145
125
  };
146
126
  builder.setObjectDispatcher(Note, "/notes/{id}", noteDispatcher);
147
127
  builder.setObjectDispatcher(Person, "/people/{id}", personDispatcher);
148
- const federation = await builder.build({ kv });
149
- const impl = federation;
128
+ const impl = await builder.build({ kv });
150
129
  assertExists(impl.objectCallbacks[Note.typeId.href]);
151
130
  assertExists(impl.objectCallbacks[Person.typeId.href]);
152
- const notePath = impl.router.build(`object:${Note.typeId.href}`, { id: "123" });
153
- assertEquals(notePath, "/notes/123");
154
- const personPath = impl.router.build(`object:${Person.typeId.href}`, { id: "456" });
155
- assertEquals(personPath, "/people/456");
131
+ assertEquals(impl.router.build(`object:${Note.typeId.href}`, { id: "123" }), "/notes/123");
132
+ assertEquals(impl.router.build(`object:${Person.typeId.href}`, { id: "456" }), "/people/456");
156
133
  const noteRoute = impl.router.route("/notes/789");
157
134
  assertEquals(noteRoute?.name, `object:${Note.typeId.href}`);
158
135
  assertEquals(noteRoute?.values.id, "789");
@@ -180,5 +157,5 @@ test("FederationBuilder", async (t) => {
180
157
  builder.setCollectionDispatcher(strId, Note, "/string-id/{id}", dispatcher);
181
158
  });
182
159
  });
183
-
184
- //#endregion
160
+ //#endregion
161
+ export {};
@@ -0,0 +1,2 @@
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ import { URLPattern } from "urlpattern-polyfill";
@@ -0,0 +1,21 @@
1
+ import "@js-temporal/polyfill";
2
+ import "urlpattern-polyfill";
3
+ globalThis.addEventListener = () => {};
4
+ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
+ import "../std__assert-Duiq_YC9.mjs";
6
+ import { n as digest, t as buildCollectionSynchronizationHeader } from "../collection-BD6-SZ6O.mjs";
7
+ import { test } from "@fedify/fixture";
8
+ import { decodeHex } from "byte-encodings/hex";
9
+ //#region src/federation/collection.test.ts
10
+ test("digest()", async () => {
11
+ assertEquals(await digest([
12
+ new URL("https://testing.example.org/users/1"),
13
+ new URL("https://testing.example.org/users/2"),
14
+ new URL("https://testing.example.org/users/2")
15
+ ]), decodeHex("c33f48cd341ef046a206b8a72ec97af65079f9a3a9b90eef79c5920dce45c61f"));
16
+ });
17
+ test("buildCollectionSynchronizationHeader()", async () => {
18
+ assertEquals(await buildCollectionSynchronizationHeader("https://testing.example.org/users/1/followers", ["https://testing.example.org/users/2", "https://testing.example.org/users/1"]), "collectionId=\"https://testing.example.org/users/1/followers\", url=\"https://testing.example.org/users/1/followers?base-url=https%3A%2F%2Ftesting.example.org%2F\", digest=\"c33f48cd341ef046a206b8a72ec97af65079f9a3a9b90eef79c5920dce45c61f\"");
19
+ });
20
+ //#endregion
21
+ export {};