@fedify/fedify 2.0.0-dev.109 → 2.0.0-dev.138

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 (202) hide show
  1. package/dist/{actor-Cm25mX8I.js → actor-DDU1l9V1.js} +185 -185
  2. package/dist/{actor-BZTYJWzP.js → actor-cC-nQq0c.js} +4 -1
  3. package/dist/{actor-ZEAP42Ry.cjs → actor-hJ02QOQP.cjs} +185 -185
  4. package/dist/{assert-MZs1qjMx.js → assert-Dp5_aoAs.js} +1 -1
  5. package/dist/{assert_instance_of-DHz7EHNU.js → assert_instance_of-D1m8F7x0.js} +1 -1
  6. package/dist/{assert_not_equals-C80BG-_5.js → assert_not_equals-B2R_8p36.js} +1 -1
  7. package/dist/{assert_rejects-Ce45JcFg.js → assert_rejects-BoKYY0g1.js} +2 -2
  8. package/dist/{assert_throws-BNXdRGWP.js → assert_throws-DjkXin1a.js} +1 -1
  9. package/dist/{builder-CWMz7B2F.js → builder-BIqsybhC.js} +5 -3
  10. package/dist/chunk-HsBuZ-b2.js +41 -0
  11. package/dist/{client-pY7-3icS.js → client-CD87uCL_.js} +1 -1
  12. package/dist/compat/transformers.test.js +29 -24
  13. package/dist/context-DcqqDGjU.js +109 -0
  14. package/dist/deno-WFvU-GBZ.js +131 -0
  15. package/dist/{testing-DcJ3qTSi.js → dist-lStjlyET.js} +73 -113
  16. package/dist/{docloader-BeSgUTFj.js → docloader-c34HWM33.js} +3 -3
  17. package/dist/{esm-bEFTDE2Q.js → esm-B52TuumP.js} +1 -1
  18. package/dist/federation/builder.test.js +15 -12
  19. package/dist/federation/collection.test.js +9 -10
  20. package/dist/federation/handler.test.js +35 -30
  21. package/dist/federation/idempotency.test.js +34 -29
  22. package/dist/federation/inbox.test.js +7 -5
  23. package/dist/federation/keycache.test.js +7 -7
  24. package/dist/federation/kv.test.js +9 -10
  25. package/dist/federation/middleware.test.js +38 -33
  26. package/dist/federation/mod.cjs +7 -7
  27. package/dist/federation/mod.js +7 -7
  28. package/dist/federation/mq.test.js +12 -13
  29. package/dist/federation/negotiation.test.js +9 -10
  30. package/dist/federation/retry.test.js +4 -5
  31. package/dist/federation/router.test.js +9 -9
  32. package/dist/federation/send.test.js +19 -17
  33. package/dist/{http-B8aQ8cUK.js → http-D3YqyH4e.js} +2 -2
  34. package/dist/{http-Dy7ENa6t.cjs → http-DW0Oa2Sc.cjs} +2 -2
  35. package/dist/{http-BF8Z1B-J.js → http-nYhdVvvV.js} +3 -2
  36. package/dist/{inbox-CReikedp.js → inbox-Bj-D27uQ.js} +3 -1
  37. package/dist/{key-C85if3Ia.js → key-D_MTpyuI.js} +4 -3
  38. package/dist/{keycache-BjRr5pe2.js → keycache-IAA7OipY.js} +1 -1
  39. package/dist/{keys-do4GUlRT.js → keys-B9yvxo8e.js} +1 -1
  40. package/dist/{kv-cache-D7LFlByV.js → kv-cache-C6NrTtII.js} +1 -1
  41. package/dist/{kv-cache-B4Y86MKl.js → kv-cache-D__gMqI_.js} +1 -1
  42. package/dist/{kv-cache-qW5Mv9rV.cjs → kv-cache-DlK7_SIS.cjs} +1 -1
  43. package/dist/{ld-0Wpf83DM.js → ld-Cz6UUM8J.js} +5 -3
  44. package/dist/lookup-B1Cz7ZHm.js +133 -0
  45. package/dist/{lookup-Br9_ufLS.cjs → lookup-BKhUoMgK.cjs} +7 -5
  46. package/dist/lookup-CX1C-E00.js +230 -0
  47. package/dist/{lookup-Cj543vD4.js → lookup-iOzlite7.js} +7 -5
  48. package/dist/{middleware-Bq8dxPN6.js → middleware-B1u0Giyh.js} +23 -18
  49. package/dist/{middleware-CDzg72dQ.cjs → middleware-B48zVD4g.cjs} +7 -7
  50. package/dist/middleware-BNtVjgXE.cjs +15 -0
  51. package/dist/middleware-ChPWHJ4f.js +31 -0
  52. package/dist/middleware-EsCHZ3I-.js +15 -0
  53. package/dist/{middleware-hM1Z5nWM.js → middleware-fkTXzOSq.js} +7 -7
  54. package/dist/mod.cjs +7 -7
  55. package/dist/mod.js +7 -7
  56. package/dist/nodeinfo/client.test.js +10 -11
  57. package/dist/nodeinfo/handler.test.js +34 -28
  58. package/dist/nodeinfo/types.test.js +9 -10
  59. package/dist/otel/exporter.test.js +10 -11
  60. package/dist/{owner-B2ziOXAb.js → owner-DPvwf79I.js} +3 -2
  61. package/dist/{proof-CN_ohUto.js → proof-Br_G2CdI.js} +4 -2
  62. package/dist/{proof-CXrz_moF.js → proof-Dd2e9KvN.js} +3 -3
  63. package/dist/{proof-CWQ0o-yI.cjs → proof-af3imB6y.cjs} +3 -3
  64. package/dist/router-CVRQXlZi.js +118 -0
  65. package/dist/{send-Bt_ukOqY.js → send-DUIFWg1r.js} +2 -2
  66. package/dist/sig/http.test.js +17 -14
  67. package/dist/sig/key.test.js +15 -12
  68. package/dist/sig/ld.test.js +13 -10
  69. package/dist/sig/mod.cjs +4 -4
  70. package/dist/sig/mod.js +4 -4
  71. package/dist/sig/owner.test.js +17 -14
  72. package/dist/sig/proof.test.js +16 -13
  73. package/dist/{std__assert-DWivtrGR.js → std__assert-Cm-MfI66.js} +1 -1
  74. package/dist/testing/mod.d.ts +2 -7
  75. package/dist/testing/mod.js +9 -3
  76. package/dist/type-BSNcIxTd.js +14 -0
  77. package/dist/utils/docloader.test.js +18 -15
  78. package/dist/utils/kv-cache.test.js +2 -3
  79. package/dist/utils/mod.cjs +4 -4
  80. package/dist/utils/mod.js +4 -4
  81. package/dist/vocab/actor.test.js +15 -11
  82. package/dist/vocab/lookup.test.js +14 -11
  83. package/dist/vocab/mod.cjs +3 -3
  84. package/dist/vocab/mod.js +3 -3
  85. package/dist/vocab/type.test.js +4 -3
  86. package/dist/vocab/vocab.test.js +13 -12
  87. package/dist/{lookup-D6_9czrD.js → vocab-BWcYGmN3.js} +188 -800
  88. package/dist/{vocab-DZvBYZFH.js → vocab-BhJUQe8S.js} +2 -2
  89. package/dist/{vocab-aeFsUPtk.cjs → vocab-Brsvh5Yv.cjs} +2 -2
  90. package/dist/webfinger/handler.test.js +34 -28
  91. package/dist/webfinger/lookup.test.js +11 -10
  92. package/dist/webfinger/mod.cjs +1 -1
  93. package/dist/webfinger/mod.js +1 -1
  94. package/package.json +6 -5
  95. package/dist/fixtures/activitypub.academy/users/brauca_darradiul.json +0 -83
  96. package/dist/fixtures/example.com/announce.json +0 -6
  97. package/dist/fixtures/example.com/collection.json +0 -19
  98. package/dist/fixtures/example.com/create.json +0 -6
  99. package/dist/fixtures/example.com/cross-origin-actor.json +0 -6
  100. package/dist/fixtures/example.com/hong-gildong.json +0 -11
  101. package/dist/fixtures/example.com/invite.json +0 -7
  102. package/dist/fixtures/example.com/key.json +0 -7
  103. package/dist/fixtures/example.com/key2.json +0 -6
  104. package/dist/fixtures/example.com/object.json +0 -6
  105. package/dist/fixtures/example.com/orderedcollectionpage.json +0 -24
  106. package/dist/fixtures/example.com/paged/a.json +0 -13
  107. package/dist/fixtures/example.com/paged/b.json +0 -16
  108. package/dist/fixtures/example.com/paged-collection.json +0 -6
  109. package/dist/fixtures/example.com/person.json +0 -22
  110. package/dist/fixtures/example.com/person2.json +0 -40
  111. package/dist/fixtures/example.com/test.json +0 -5
  112. package/dist/fixtures/example.com/users/handle.json +0 -16
  113. package/dist/fixtures/example.com/wrong-type.json +0 -3
  114. package/dist/fixtures/media.example.com/avatars/test-avatar.jpg.json +0 -6
  115. package/dist/fixtures/oeee.cafe/ap/users/3609fd4e-d51d-4db8-9f04-4189815864dd.json +0 -24
  116. package/dist/fixtures/remote.domain/users/bob.json +0 -20
  117. package/dist/fixtures/server.example/users/alice.json +0 -20
  118. package/dist/fixtures/w3id.org/identity/v1.json +0 -152
  119. package/dist/fixtures/w3id.org/security/data-integrity/v1.json +0 -74
  120. package/dist/fixtures/w3id.org/security/multikey/v1.json +0 -35
  121. package/dist/fixtures/w3id.org/security/v1.json +0 -50
  122. package/dist/fixtures/wizard.casa/users/hongminhee.json +0 -69
  123. package/dist/fixtures/www.w3.org/ns/activitystreams.json +0 -379
  124. package/dist/fixtures/www.w3.org/ns/did/v1.json +0 -58
  125. package/dist/middleware-BPmn8w0u.cjs +0 -15
  126. package/dist/middleware-BXodt-Uj.js +0 -26
  127. package/dist/middleware-DvA6x8_h.js +0 -15
  128. package/dist/otel-Bfe_BgOV.js +0 -63
  129. package/dist/src/vocab/accept.yaml +0 -15
  130. package/dist/src/vocab/activity.yaml +0 -98
  131. package/dist/src/vocab/add.yaml +0 -16
  132. package/dist/src/vocab/announce.yaml +0 -30
  133. package/dist/src/vocab/application.yaml +0 -324
  134. package/dist/src/vocab/arrive.yaml +0 -15
  135. package/dist/src/vocab/article.yaml +0 -46
  136. package/dist/src/vocab/audio.yaml +0 -11
  137. package/dist/src/vocab/block.yaml +0 -16
  138. package/dist/src/vocab/chatmessage.yaml +0 -50
  139. package/dist/src/vocab/collection.yaml +0 -154
  140. package/dist/src/vocab/collectionpage.yaml +0 -55
  141. package/dist/src/vocab/create.yaml +0 -28
  142. package/dist/src/vocab/dataintegrityproof.yaml +0 -56
  143. package/dist/src/vocab/delete.yaml +0 -27
  144. package/dist/src/vocab/didservice.yaml +0 -22
  145. package/dist/src/vocab/dislike.yaml +0 -14
  146. package/dist/src/vocab/document.yaml +0 -31
  147. package/dist/src/vocab/emoji.yaml +0 -12
  148. package/dist/src/vocab/emojireact.yaml +0 -17
  149. package/dist/src/vocab/endpoints.yaml +0 -85
  150. package/dist/src/vocab/event.yaml +0 -11
  151. package/dist/src/vocab/export.yaml +0 -9
  152. package/dist/src/vocab/flag.yaml +0 -15
  153. package/dist/src/vocab/follow.yaml +0 -19
  154. package/dist/src/vocab/group.yaml +0 -324
  155. package/dist/src/vocab/hashtag.yaml +0 -14
  156. package/dist/src/vocab/ignore.yaml +0 -14
  157. package/dist/src/vocab/image.yaml +0 -9
  158. package/dist/src/vocab/intransitiveactivity.yaml +0 -15
  159. package/dist/src/vocab/invite.yaml +0 -14
  160. package/dist/src/vocab/join.yaml +0 -14
  161. package/dist/src/vocab/key.yaml +0 -28
  162. package/dist/src/vocab/leave.yaml +0 -14
  163. package/dist/src/vocab/like.yaml +0 -16
  164. package/dist/src/vocab/link.yaml +0 -101
  165. package/dist/src/vocab/listen.yaml +0 -12
  166. package/dist/src/vocab/mention.yaml +0 -9
  167. package/dist/src/vocab/move.yaml +0 -15
  168. package/dist/src/vocab/multikey.yaml +0 -36
  169. package/dist/src/vocab/note.yaml +0 -48
  170. package/dist/src/vocab/object.yaml +0 -404
  171. package/dist/src/vocab/offer.yaml +0 -15
  172. package/dist/src/vocab/orderedcollection.yaml +0 -39
  173. package/dist/src/vocab/orderedcollectionpage.yaml +0 -50
  174. package/dist/src/vocab/organization.yaml +0 -324
  175. package/dist/src/vocab/page.yaml +0 -11
  176. package/dist/src/vocab/person.yaml +0 -324
  177. package/dist/src/vocab/place.yaml +0 -75
  178. package/dist/src/vocab/profile.yaml +0 -26
  179. package/dist/src/vocab/propertyvalue.yaml +0 -32
  180. package/dist/src/vocab/question.yaml +0 -103
  181. package/dist/src/vocab/read.yaml +0 -13
  182. package/dist/src/vocab/reject.yaml +0 -14
  183. package/dist/src/vocab/relationship.yaml +0 -52
  184. package/dist/src/vocab/remove.yaml +0 -14
  185. package/dist/src/vocab/service.yaml +0 -324
  186. package/dist/src/vocab/source.yaml +0 -26
  187. package/dist/src/vocab/tentativeaccept.yaml +0 -14
  188. package/dist/src/vocab/tentativereject.yaml +0 -14
  189. package/dist/src/vocab/tombstone.yaml +0 -24
  190. package/dist/src/vocab/travel.yaml +0 -16
  191. package/dist/src/vocab/undo.yaml +0 -26
  192. package/dist/src/vocab/update.yaml +0 -58
  193. package/dist/src/vocab/video.yaml +0 -11
  194. package/dist/src/vocab/view.yaml +0 -13
  195. package/dist/testing/docloader.test.d.ts +0 -3
  196. package/dist/testing/docloader.test.js +0 -22
  197. /package/dist/{assert_equals-DSbWqCm3.js → assert_equals-Gbplq4lg.js} +0 -0
  198. /package/dist/{collection-BzWsN9pB.js → collection-CrkRM5Ep.js} +0 -0
  199. /package/dist/{kv-QzKcOQgP.js → kv-DaWUKuhD.js} +0 -0
  200. /package/dist/{negotiation-C4nFufNk.js → negotiation-B4NJHk1f.js} +0 -0
  201. /package/dist/{retry-CfF8Gn4d.js → retry-Bz5pP75o.js} +0 -0
  202. /package/dist/{types-C2XVl6gj.js → types-D2jhK2VG.js} +0 -0
@@ -3,7 +3,7 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { AssertionError } from "./assert_equals-DSbWqCm3.js";
6
+ import { AssertionError } from "./assert_equals-Gbplq4lg.js";
7
7
 
8
8
  //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert.js
9
9
  /**
@@ -3,7 +3,7 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { AssertionError } from "./assert_equals-DSbWqCm3.js";
6
+ import { AssertionError } from "./assert_equals-Gbplq4lg.js";
7
7
 
8
8
  //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_instance_of.js
9
9
  /**
@@ -3,7 +3,7 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { AssertionError, equal } from "./assert_equals-DSbWqCm3.js";
6
+ import { AssertionError, equal } from "./assert_equals-Gbplq4lg.js";
7
7
 
8
8
  //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_not_equals.js
9
9
  /**
@@ -3,8 +3,8 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { AssertionError } from "./assert_equals-DSbWqCm3.js";
7
- import { assertIsError } from "./assert_throws-BNXdRGWP.js";
6
+ import { AssertionError } from "./assert_equals-Gbplq4lg.js";
7
+ import { assertIsError } from "./assert_throws-DjkXin1a.js";
8
8
 
9
9
  //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_false.js
10
10
  /**
@@ -3,7 +3,7 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { AssertionError, stripAnsiCode } from "./assert_equals-DSbWqCm3.js";
6
+ import { AssertionError, stripAnsiCode } from "./assert_equals-Gbplq4lg.js";
7
7
 
8
8
  //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_is_error.js
9
9
  /**
@@ -3,8 +3,10 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Router, RouterError, deno_default, getTypeId } from "./lookup-D6_9czrD.js";
7
- import { InboxListenerSet } from "./inbox-CReikedp.js";
6
+ import { deno_default } from "./deno-WFvU-GBZ.js";
7
+ import { Router, RouterError } from "./router-CVRQXlZi.js";
8
+ import { getTypeId } from "./type-BSNcIxTd.js";
9
+ import { InboxListenerSet } from "./inbox-Bj-D27uQ.js";
8
10
  import { getLogger } from "@logtape/logtape";
9
11
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
10
12
 
@@ -42,7 +44,7 @@ var FederationBuilderImpl = class {
42
44
  this.collectionTypeIds = {};
43
45
  }
44
46
  async build(options) {
45
- const { FederationImpl } = await import("./middleware-BXodt-Uj.js");
47
+ const { FederationImpl } = await import("./middleware-ChPWHJ4f.js");
46
48
  const f = new FederationImpl(options);
47
49
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
48
50
  f.router = this.router.clone();
@@ -0,0 +1,41 @@
1
+
2
+ import { Temporal } from "@js-temporal/polyfill";
3
+ import { URLPattern } from "urlpattern-polyfill";
4
+ globalThis.addEventListener = () => {};
5
+
6
+ import { createRequire } from "node:module";
7
+
8
+ //#region rolldown:runtime
9
+ var __create = Object.create;
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __getProtoOf = Object.getPrototypeOf;
14
+ 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
+ };
18
+ var __export = (target, all) => {
19
+ for (var name in all) __defProp(target, name, {
20
+ get: all[name],
21
+ enumerable: true
22
+ });
23
+ };
24
+ var __copyProps = (to, from, except, desc) => {
25
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
26
+ key = keys[i];
27
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
28
+ get: ((k) => from[k]).bind(null, key),
29
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
30
+ });
31
+ }
32
+ return to;
33
+ };
34
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
35
+ value: mod,
36
+ enumerable: true
37
+ }) : target, mod));
38
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
39
+
40
+ //#endregion
41
+ export { __commonJS, __export, __require, __toESM };
@@ -3,8 +3,8 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { getUserAgent } from "@fedify/vocab-runtime";
7
6
  import { getLogger } from "@logtape/logtape";
7
+ import { getUserAgent } from "@fedify/vocab-runtime";
8
8
 
9
9
  //#region src/nodeinfo/client.ts
10
10
  const logger = getLogger([
@@ -3,30 +3,35 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Follow, Person } from "../lookup-D6_9czrD.js";
7
- import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
- import { assert } from "../assert-MZs1qjMx.js";
9
- import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
10
- import { MemoryKvStore } from "../kv-QzKcOQgP.js";
11
- import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-Bq8dxPN6.js";
12
- import "../client-pY7-3icS.js";
13
- import "../types-C2XVl6gj.js";
14
- import "../actor-BZTYJWzP.js";
15
- import "../key-C85if3Ia.js";
16
- import "../http-BF8Z1B-J.js";
17
- import "../ld-0Wpf83DM.js";
18
- import "../owner-B2ziOXAb.js";
19
- import "../proof-CN_ohUto.js";
20
- import "../docloader-BeSgUTFj.js";
21
- import "../kv-cache-D7LFlByV.js";
22
- import "../inbox-CReikedp.js";
23
- import "../builder-CWMz7B2F.js";
24
- import "../collection-BzWsN9pB.js";
25
- import "../keycache-BjRr5pe2.js";
26
- import "../negotiation-C4nFufNk.js";
27
- import "../retry-CfF8Gn4d.js";
28
- import "../send-Bt_ukOqY.js";
29
- import { test } from "../testing-DcJ3qTSi.js";
6
+ import { test } from "../dist-lStjlyET.js";
7
+ import { assertEquals } from "../assert_equals-Gbplq4lg.js";
8
+ import { assert } from "../assert-Dp5_aoAs.js";
9
+ import { assertInstanceOf } from "../assert_instance_of-D1m8F7x0.js";
10
+ import { MemoryKvStore } from "../kv-DaWUKuhD.js";
11
+ import "../deno-WFvU-GBZ.js";
12
+ import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-B1u0Giyh.js";
13
+ import "../client-CD87uCL_.js";
14
+ import "../router-CVRQXlZi.js";
15
+ import "../types-D2jhK2VG.js";
16
+ import { Follow, Person } from "../vocab-BWcYGmN3.js";
17
+ import "../lookup-B1Cz7ZHm.js";
18
+ import "../type-BSNcIxTd.js";
19
+ import "../actor-cC-nQq0c.js";
20
+ import "../key-D_MTpyuI.js";
21
+ import "../http-nYhdVvvV.js";
22
+ import "../ld-Cz6UUM8J.js";
23
+ import "../owner-DPvwf79I.js";
24
+ import "../proof-Br_G2CdI.js";
25
+ import "../docloader-c34HWM33.js";
26
+ import "../kv-cache-C6NrTtII.js";
27
+ import "../lookup-CX1C-E00.js";
28
+ import "../inbox-Bj-D27uQ.js";
29
+ import "../builder-BIqsybhC.js";
30
+ import "../collection-CrkRM5Ep.js";
31
+ import "../keycache-IAA7OipY.js";
32
+ import "../negotiation-B4NJHk1f.js";
33
+ import "../retry-Bz5pP75o.js";
34
+ import "../send-DUIFWg1r.js";
30
35
 
31
36
  //#region src/compat/transformers.test.ts
32
37
  const federation = new FederationImpl({ kv: new MemoryKvStore() });
@@ -0,0 +1,109 @@
1
+
2
+ import { Temporal } from "@js-temporal/polyfill";
3
+ import { URLPattern } from "urlpattern-polyfill";
4
+ globalThis.addEventListener = () => {};
5
+
6
+ import { mockDocumentLoader } from "./dist-lStjlyET.js";
7
+ import { RouterError } from "./router-CVRQXlZi.js";
8
+ import { lookupWebFinger } from "./lookup-B1Cz7ZHm.js";
9
+ import { lookupObject, traverseCollection } from "./lookup-CX1C-E00.js";
10
+ import { trace } from "@opentelemetry/api";
11
+
12
+ //#region src/testing/context.ts
13
+ function createContext(values) {
14
+ 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;
15
+ function throwRouteError() {
16
+ throw new RouterError("Not implemented");
17
+ }
18
+ return {
19
+ federation,
20
+ data,
21
+ origin: url.origin,
22
+ canonicalOrigin: canonicalOrigin ?? url.origin,
23
+ host: url.host,
24
+ hostname: url.hostname,
25
+ documentLoader: documentLoader ?? mockDocumentLoader,
26
+ contextLoader: contextLoader ?? mockDocumentLoader,
27
+ tracerProvider: tracerProvider ?? trace.getTracerProvider(),
28
+ clone: clone ?? ((data$1) => createContext({
29
+ ...values,
30
+ data: data$1
31
+ })),
32
+ getNodeInfoUri: getNodeInfoUri ?? throwRouteError,
33
+ getActorUri: getActorUri ?? throwRouteError,
34
+ getObjectUri: getObjectUri ?? throwRouteError,
35
+ getCollectionUri: getCollectionUri ?? throwRouteError,
36
+ getOutboxUri: getOutboxUri ?? throwRouteError,
37
+ getInboxUri: getInboxUri ?? throwRouteError,
38
+ getFollowingUri: getFollowingUri ?? throwRouteError,
39
+ getFollowersUri: getFollowersUri ?? throwRouteError,
40
+ getLikedUri: getLikedUri ?? throwRouteError,
41
+ getFeaturedUri: getFeaturedUri ?? throwRouteError,
42
+ getFeaturedTagsUri: getFeaturedTagsUri ?? throwRouteError,
43
+ parseUri: parseUri ?? ((_uri) => {
44
+ throw new Error("Not implemented");
45
+ }),
46
+ getDocumentLoader: getDocumentLoader ?? ((_params) => {
47
+ throw new Error("Not implemented");
48
+ }),
49
+ getActorKeyPairs: getActorKeyPairs ?? ((_handle) => Promise.resolve([])),
50
+ lookupObject: lookupObject$1 ?? ((uri, options = {}) => {
51
+ return lookupObject(uri, {
52
+ documentLoader: options.documentLoader ?? documentLoader ?? mockDocumentLoader,
53
+ contextLoader: options.contextLoader ?? contextLoader ?? mockDocumentLoader
54
+ });
55
+ }),
56
+ traverseCollection: traverseCollection$1 ?? ((collection, options = {}) => {
57
+ return traverseCollection(collection, {
58
+ documentLoader: options.documentLoader ?? documentLoader ?? mockDocumentLoader,
59
+ contextLoader: options.contextLoader ?? contextLoader ?? mockDocumentLoader
60
+ });
61
+ }),
62
+ lookupNodeInfo: lookupNodeInfo ?? ((_params) => {
63
+ throw new Error("Not implemented");
64
+ }),
65
+ lookupWebFinger: lookupWebFinger$1 ?? ((resource, options = {}) => {
66
+ return lookupWebFinger(resource, options);
67
+ }),
68
+ sendActivity: sendActivity ?? ((_params) => {
69
+ throw new Error("Not implemented");
70
+ }),
71
+ routeActivity: routeActivity ?? ((_params) => {
72
+ throw new Error("Not implemented");
73
+ })
74
+ };
75
+ }
76
+ function createRequestContext(args) {
77
+ return {
78
+ ...createContext(args),
79
+ clone: args.clone ?? ((data) => createRequestContext({
80
+ ...args,
81
+ data
82
+ })),
83
+ request: args.request ?? new Request(args.url),
84
+ url: args.url,
85
+ getActor: args.getActor ?? (() => Promise.resolve(null)),
86
+ getObject: args.getObject ?? (() => Promise.resolve(null)),
87
+ getSignedKey: args.getSignedKey ?? (() => Promise.resolve(null)),
88
+ getSignedKeyOwner: args.getSignedKeyOwner ?? (() => Promise.resolve(null)),
89
+ sendActivity: args.sendActivity ?? ((_params) => {
90
+ throw new Error("Not implemented");
91
+ })
92
+ };
93
+ }
94
+ function createInboxContext(args) {
95
+ return {
96
+ ...createContext(args),
97
+ clone: args.clone ?? ((data) => createInboxContext({
98
+ ...args,
99
+ data
100
+ })),
101
+ recipient: args.recipient ?? null,
102
+ forwardActivity: args.forwardActivity ?? ((_params) => {
103
+ throw new Error("Not implemented");
104
+ })
105
+ };
106
+ }
107
+
108
+ //#endregion
109
+ export { createInboxContext, createRequestContext };
@@ -0,0 +1,131 @@
1
+
2
+ import { Temporal } from "@js-temporal/polyfill";
3
+ import { URLPattern } from "urlpattern-polyfill";
4
+ globalThis.addEventListener = () => {};
5
+
6
+ //#region deno.json
7
+ var name = "@fedify/fedify";
8
+ var version = "2.0.0-dev.138+b557f137";
9
+ var license = "MIT";
10
+ var exports = {
11
+ ".": "./src/mod.ts",
12
+ "./compat": "./src/compat/mod.ts",
13
+ "./federation": "./src/federation/mod.ts",
14
+ "./nodeinfo": "./src/nodeinfo/mod.ts",
15
+ "./otel": "./src/otel/mod.ts",
16
+ "./sig": "./src/sig/mod.ts",
17
+ "./vocab": "./src/vocab/mod.ts",
18
+ "./utils": "./src/utils/mod.ts",
19
+ "./webfinger": "./src/webfinger/mod.ts"
20
+ };
21
+ var imports = {
22
+ "@multiformats/base-x": "npm:@multiformats/base-x@^4.0.1",
23
+ "@opentelemetry/core": "npm:@opentelemetry/core@^2.0.0",
24
+ "@opentelemetry/sdk-trace-base": "npm:@opentelemetry/sdk-trace-base@^2.0.0",
25
+ "@opentelemetry/semantic-conventions": "npm:@opentelemetry/semantic-conventions@^1.27.0",
26
+ "@std/assert": "jsr:@std/assert@^0.226.0",
27
+ "@std/url": "jsr:@std/url@^0.225.1",
28
+ "asn1js": "npm:asn1js@^3.0.7",
29
+ "fast-check": "npm:fast-check@^3.22.0",
30
+ "fetch-mock": "npm:fetch-mock@^12.5.2",
31
+ "json-canon": "npm:json-canon@^1.0.1",
32
+ "jsonld": "npm:jsonld@^9.0.0",
33
+ "multicodec": "npm:multicodec@^3.2.1",
34
+ "pkijs": "npm:pkijs@^3.3.3",
35
+ "structured-field-values": "npm:structured-field-values@^2.0.4",
36
+ "uri-template-router": "npm:uri-template-router@^1.0.0",
37
+ "url-template": "npm:url-template@^3.1.1"
38
+ };
39
+ var include = ["src/vocab/vocab.ts"];
40
+ var exclude = [
41
+ ".test-report.xml",
42
+ "apidoc/",
43
+ "dist/",
44
+ "node_modules/",
45
+ "npm/",
46
+ "pnpm-lock.yaml",
47
+ "src/cfworkers/dist/",
48
+ "src/cfworkers/fixtures/",
49
+ "src/cfworkers/imports.ts",
50
+ "src/cfworkers/README.md",
51
+ "src/cfworkers/server.ts",
52
+ "src/cfworkers/server.js",
53
+ "src/cfworkers/server.js.map",
54
+ "src/vocab/*.yaml",
55
+ "!src/vocab/vocab.ts"
56
+ ];
57
+ var publish = { "exclude": ["**/*.test.ts", "src/testing/"] };
58
+ var tasks = {
59
+ "codegen": "deno run --allow-read --allow-write --allow-env --check scripts/codegen.ts && deno fmt src/vocab/vocab.ts && deno cache src/vocab/vocab.ts && deno check src/vocab/vocab.ts",
60
+ "cache": {
61
+ "command": "deno cache src/mod.ts",
62
+ "dependencies": ["codegen"]
63
+ },
64
+ "check": {
65
+ "command": "deno fmt --check && deno lint && deno check src/**/*.ts",
66
+ "dependencies": ["codegen"]
67
+ },
68
+ "test": {
69
+ "command": "deno test --check --doc --allow-read --allow-write --allow-env --unstable-kv --trace-leaks --parallel",
70
+ "dependencies": ["codegen"]
71
+ },
72
+ "coverage": "deno task test --clean --coverage && deno coverage --html coverage",
73
+ "bench": {
74
+ "command": "deno bench --allow-read --allow-write --allow-net --allow-env --allow-run --unstable-kv",
75
+ "dependencies": ["codegen"]
76
+ },
77
+ "apidoc": {
78
+ "command": "deno doc --html --name=Fedify --output=apidoc/ src/mod.ts",
79
+ "dependencies": ["codegen"]
80
+ },
81
+ "publish": {
82
+ "command": "deno publish",
83
+ "dependencies": ["codegen"]
84
+ },
85
+ "pnpm:install": "pnpm install --silent",
86
+ "pnpm:build": {
87
+ "command": "pnpm exec tsdown",
88
+ "dependencies": [
89
+ "codegen",
90
+ "pnpm:install",
91
+ "pnpm:build-vocab",
92
+ "pnpm:build-fixture"
93
+ ]
94
+ },
95
+ "pnpm:build-vocab-runtime": { "command": "cd ../vocab-runtime && pnpm build" },
96
+ "pnpm:build-vocab-tools": { "command": "cd ../vocab-tools && pnpm build" },
97
+ "pnpm:build-vocab": { "dependencies": ["pnpm:build-vocab-runtime", "pnpm:build-vocab-tools"] },
98
+ "test:node": {
99
+ "command": "cd dist/ && node --test",
100
+ "dependencies": ["pnpm:build"]
101
+ },
102
+ "test:bun": {
103
+ "command": "cd dist/ && bun test --timeout 60000",
104
+ "dependencies": ["pnpm:build"]
105
+ },
106
+ "test:cfworkers": {
107
+ "command": "pnpm exec wrangler deploy --dry-run --outdir src/cfworkers && node --import=tsx src/cfworkers/client.ts",
108
+ "dependencies": ["pnpm:build"]
109
+ },
110
+ "test-all": { "dependencies": [
111
+ "check",
112
+ "test",
113
+ "test:node",
114
+ "test:bun",
115
+ "test:cfworkers"
116
+ ] }
117
+ };
118
+ var deno_default = {
119
+ name,
120
+ version,
121
+ license,
122
+ exports,
123
+ imports,
124
+ include,
125
+ exclude,
126
+ publish,
127
+ tasks
128
+ };
129
+
130
+ //#endregion
131
+ export { deno_default };
@@ -3,16 +3,20 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { RouterError, __require, lookupObject, lookupWebFinger, traverseCollection } from "./lookup-D6_9czrD.js";
6
+ import { __require } from "./chunk-HsBuZ-b2.js";
7
+ import "@js-temporal/polyfill";
8
+ import "urlpattern-polyfill";
7
9
  import { configure, getConsoleSink, getLogger, reset } from "@logtape/logtape";
8
- import { trace } from "@opentelemetry/api";
10
+ import { BasicTracerProvider, SimpleSpanProcessor } from "@opentelemetry/sdk-trace-base";
11
+ import { ExportResultCode } from "@opentelemetry/core";
9
12
 
10
- //#region src/testing/docloader.ts
11
- const logger = getLogger([
12
- "fedify",
13
- "testing",
14
- "docloader"
15
- ]);
13
+ //#region ../fixture/dist/test-Bu5zBens.js
14
+ globalThis.addEventListener = () => {};
15
+ var __require$1 = /* @__PURE__ */ ((x) => typeof __require !== "undefined" ? __require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof __require !== "undefined" ? __require : a)[b] }) : x)(function(x) {
16
+ if (typeof __require !== "undefined") return __require.apply(this, arguments);
17
+ throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function.");
18
+ });
19
+ const logger = getLogger(["fixture", "docloader"]);
16
20
  /**
17
21
  * A mock of the document loader. This does not make any actual HTTP requests
18
22
  * towards the remote server, but looks up the local fixture files instead.
@@ -48,13 +52,14 @@ async function mockDocumentLoader(resource, _options) {
48
52
  });
49
53
  throw new Error(error);
50
54
  }
51
- const path = `./fixtures/${url.host}${url.pathname}.json`;
55
+ const pkg = "Deno" in globalThis ? "." : "@fedify/fixture";
56
+ const fixturePath = `${pkg}/fixtures/${url.host}${url.pathname}.json`;
52
57
  let document;
53
58
  try {
54
- document = (await import(path, { with: { type: "json" } })).default;
59
+ document = (await import(fixturePath, { with: { type: "json" } })).default;
55
60
  } catch (error) {
56
61
  logger.error("Failed to read fixture file {path}: {error}", {
57
- path,
62
+ path: fixturePath,
58
63
  error
59
64
  });
60
65
  throw error;
@@ -65,106 +70,6 @@ async function mockDocumentLoader(resource, _options) {
65
70
  documentUrl: resource
66
71
  };
67
72
  }
68
-
69
- //#endregion
70
- //#region src/testing/context.ts
71
- function createContext(values) {
72
- 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;
73
- function throwRouteError() {
74
- throw new RouterError("Not implemented");
75
- }
76
- return {
77
- federation,
78
- data,
79
- origin: url.origin,
80
- canonicalOrigin: canonicalOrigin ?? url.origin,
81
- host: url.host,
82
- hostname: url.hostname,
83
- documentLoader: documentLoader ?? mockDocumentLoader,
84
- contextLoader: contextLoader ?? mockDocumentLoader,
85
- tracerProvider: tracerProvider ?? trace.getTracerProvider(),
86
- clone: clone ?? ((data$1) => createContext({
87
- ...values,
88
- data: data$1
89
- })),
90
- getNodeInfoUri: getNodeInfoUri ?? throwRouteError,
91
- getActorUri: getActorUri ?? throwRouteError,
92
- getObjectUri: getObjectUri ?? throwRouteError,
93
- getCollectionUri: getCollectionUri ?? throwRouteError,
94
- getOutboxUri: getOutboxUri ?? throwRouteError,
95
- getInboxUri: getInboxUri ?? throwRouteError,
96
- getFollowingUri: getFollowingUri ?? throwRouteError,
97
- getFollowersUri: getFollowersUri ?? throwRouteError,
98
- getLikedUri: getLikedUri ?? throwRouteError,
99
- getFeaturedUri: getFeaturedUri ?? throwRouteError,
100
- getFeaturedTagsUri: getFeaturedTagsUri ?? throwRouteError,
101
- parseUri: parseUri ?? ((_uri) => {
102
- throw new Error("Not implemented");
103
- }),
104
- getDocumentLoader: getDocumentLoader ?? ((_params) => {
105
- throw new Error("Not implemented");
106
- }),
107
- getActorKeyPairs: getActorKeyPairs ?? ((_handle) => Promise.resolve([])),
108
- lookupObject: lookupObject$1 ?? ((uri, options = {}) => {
109
- return lookupObject(uri, {
110
- documentLoader: options.documentLoader ?? documentLoader ?? mockDocumentLoader,
111
- contextLoader: options.contextLoader ?? contextLoader ?? mockDocumentLoader
112
- });
113
- }),
114
- traverseCollection: traverseCollection$1 ?? ((collection, options = {}) => {
115
- return traverseCollection(collection, {
116
- documentLoader: options.documentLoader ?? documentLoader ?? mockDocumentLoader,
117
- contextLoader: options.contextLoader ?? contextLoader ?? mockDocumentLoader
118
- });
119
- }),
120
- lookupNodeInfo: lookupNodeInfo ?? ((_params) => {
121
- throw new Error("Not implemented");
122
- }),
123
- lookupWebFinger: lookupWebFinger$1 ?? ((resource, options = {}) => {
124
- return lookupWebFinger(resource, options);
125
- }),
126
- sendActivity: sendActivity ?? ((_params) => {
127
- throw new Error("Not implemented");
128
- }),
129
- routeActivity: routeActivity ?? ((_params) => {
130
- throw new Error("Not implemented");
131
- })
132
- };
133
- }
134
- function createRequestContext(args) {
135
- return {
136
- ...createContext(args),
137
- clone: args.clone ?? ((data) => createRequestContext({
138
- ...args,
139
- data
140
- })),
141
- request: args.request ?? new Request(args.url),
142
- url: args.url,
143
- getActor: args.getActor ?? (() => Promise.resolve(null)),
144
- getObject: args.getObject ?? (() => Promise.resolve(null)),
145
- getSignedKey: args.getSignedKey ?? (() => Promise.resolve(null)),
146
- getSignedKeyOwner: args.getSignedKeyOwner ?? (() => Promise.resolve(null)),
147
- sendActivity: args.sendActivity ?? ((_params) => {
148
- throw new Error("Not implemented");
149
- })
150
- };
151
- }
152
- function createInboxContext(args) {
153
- return {
154
- ...createContext(args),
155
- clone: args.clone ?? ((data) => createInboxContext({
156
- ...args,
157
- data
158
- })),
159
- recipient: args.recipient ?? null,
160
- forwardActivity: args.forwardActivity ?? ((_params) => {
161
- throw new Error("Not implemented");
162
- })
163
- };
164
- }
165
-
166
- //#endregion
167
- //#region src/testing/mod.ts
168
73
  const testDefinitions = [];
169
74
  function test(name, options, fn) {
170
75
  const def = typeof name === "string" ? typeof options === "function" ? {
@@ -247,7 +152,7 @@ function test(name, options, fn) {
247
152
  else if (def.only) bunTest.only(def.name, fn$1);
248
153
  else bunTest(def.name, fn$1);
249
154
  } else try {
250
- const { test: nodeTest } = __require("node:test");
155
+ const { test: nodeTest } = __require$1("node:test");
251
156
  nodeTest(def.name, {
252
157
  only: def.only,
253
158
  skip: def.ignore
@@ -298,4 +203,59 @@ function caller() {
298
203
  }
299
204
 
300
205
  //#endregion
301
- export { createInboxContext, createRequestContext, mockDocumentLoader, test, testDefinitions };
206
+ //#region ../fixture/dist/mod.js
207
+ globalThis.addEventListener = () => {};
208
+ /**
209
+ * A test spy for OpenTelemetry spans that captures all spans and events.
210
+ */
211
+ var TestSpanExporter = class {
212
+ spans = [];
213
+ export(spans, resultCallback) {
214
+ this.spans.push(...spans);
215
+ resultCallback({ code: ExportResultCode.SUCCESS });
216
+ }
217
+ async forceFlush() {}
218
+ shutdown() {
219
+ this.spans = [];
220
+ return Promise.resolve();
221
+ }
222
+ /**
223
+ * Gets all spans with the given name.
224
+ */
225
+ getSpans(name) {
226
+ return this.spans.filter((span) => span.name === name);
227
+ }
228
+ /**
229
+ * Gets the first span with the given name.
230
+ */
231
+ getSpan(name) {
232
+ return this.spans.find((span) => span.name === name);
233
+ }
234
+ /**
235
+ * Gets all events from spans with the given name.
236
+ */
237
+ getEvents(spanName, eventName) {
238
+ const spans = this.getSpans(spanName);
239
+ const events = spans.flatMap((span) => span.events);
240
+ if (eventName) return events.filter((event) => event.name === eventName);
241
+ return events;
242
+ }
243
+ /**
244
+ * Clears all captured spans.
245
+ */
246
+ clear() {
247
+ this.spans = [];
248
+ }
249
+ };
250
+ /**
251
+ * Creates a test tracer provider with a test exporter.
252
+ * @returns A tuple of [tracerProvider, testExporter]
253
+ */
254
+ function createTestTracerProvider() {
255
+ const exporter = new TestSpanExporter();
256
+ const provider = new BasicTracerProvider({ spanProcessors: [new SimpleSpanProcessor(exporter)] });
257
+ return [provider, exporter];
258
+ }
259
+
260
+ //#endregion
261
+ export { TestSpanExporter, createTestTracerProvider, mockDocumentLoader, test, testDefinitions };
@@ -3,11 +3,11 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { validateCryptoKey } from "./key-C85if3Ia.js";
7
- import { doubleKnock } from "./http-BF8Z1B-J.js";
6
+ import { validateCryptoKey } from "./key-D_MTpyuI.js";
7
+ import { doubleKnock } from "./http-nYhdVvvV.js";
8
+ import { getLogger } from "@logtape/logtape";
8
9
  import { curry } from "es-toolkit";
9
10
  import { UrlError, createActivityPubRequest, getDocumentLoader, getRemoteDocument, logRequest, validatePublicUrl } from "@fedify/vocab-runtime";
10
- import { getLogger } from "@logtape/logtape";
11
11
 
12
12
  //#region src/utils/docloader.ts
13
13
  const logger = getLogger([