@fedify/fedify 2.1.0-dev.543 → 2.1.0-dev.592

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 (100) hide show
  1. package/dist/accept-D7sAxyNa.js +143 -0
  2. package/dist/{assert_rejects-Ce45JcFg.js → assert_rejects-0h7I2Esa.js} +1 -1
  3. package/dist/{builder-BBucr-Bp.js → builder-B24i8eYp.js} +4 -4
  4. package/dist/{client-Dg7OfUDA.js → client-CoCIaTNO.js} +1 -1
  5. package/dist/compat/mod.d.cts +3 -3
  6. package/dist/compat/mod.d.ts +3 -3
  7. package/dist/compat/transformers.test.js +19 -18
  8. package/dist/{context-CZ5llAss.js → context-Aqenou7c.js} +1 -1
  9. package/dist/{context-DL0cPpPV.d.cts → context-BcqA-0BL.d.cts} +52 -2
  10. package/dist/{context--RwChtri.d.ts → context-DyJjQQ_H.d.ts} +52 -2
  11. package/dist/{deno-9yc0TPBI.js → deno-OR506Yti.js} +1 -2
  12. package/dist/{docloader-6Wrqp6SE.js → docloader-BG_pP2fW.js} +3 -3
  13. package/dist/{esm-DGl7uK1r.js → esm-nLm00z9V.js} +27 -1
  14. package/dist/federation/builder.test.js +8 -8
  15. package/dist/federation/collection.test.js +6 -6
  16. package/dist/federation/handler.test.js +808 -28
  17. package/dist/federation/idempotency.test.js +24 -23
  18. package/dist/federation/inbox.test.js +4 -4
  19. package/dist/federation/keycache.test.js +2 -2
  20. package/dist/federation/kv.test.js +5 -5
  21. package/dist/federation/middleware.test.js +25 -24
  22. package/dist/federation/mod.cjs +4 -4
  23. package/dist/federation/mod.d.cts +4 -4
  24. package/dist/federation/mod.d.ts +4 -4
  25. package/dist/federation/mod.js +4 -4
  26. package/dist/federation/mq.test.js +5 -5
  27. package/dist/federation/negotiation.test.js +6 -6
  28. package/dist/federation/retry.test.js +3 -3
  29. package/dist/federation/router.test.js +5 -5
  30. package/dist/federation/send.test.js +13 -12
  31. package/dist/federation/webfinger.test.js +24 -23
  32. package/dist/{http-CpvoK0Y7.js → http-BUCxbGks.js} +145 -50
  33. package/dist/{http-DsqqmkXi.d.cts → http-BudnHZE2.d.cts} +229 -1
  34. package/dist/{http-C_9L2wFv.cjs → http-CaXARmaJ.cjs} +307 -50
  35. package/dist/{http-BbfOqHGG.d.ts → http-Dax_FIBo.d.ts} +229 -1
  36. package/dist/{http-DxwzIU0F.js → http-DePHjWKP.js} +278 -51
  37. package/dist/{inbox-DMq3a5bc.js → inbox-D_LU1opv.js} +2 -2
  38. package/dist/{key-DFG6tJgw.js → key-Cx3Tx_In.js} +2 -2
  39. package/dist/{kv-cache-B__dHl7g.js → kv-cache-Bw2F2ABq.js} +1 -1
  40. package/dist/{kv-cache-BHoLc85Z.cjs → kv-cache-CYTDBChd.cjs} +1 -1
  41. package/dist/{kv-cache-CRRUsyJ9.js → kv-cache-DizRqYX4.js} +1 -1
  42. package/dist/{ld-DVnRS9IK.js → ld-CLMJw_iX.js} +4 -4
  43. package/dist/{middleware-D6peKsn1.js → middleware--uATyG9i.js} +95 -18
  44. package/dist/{middleware-CAk-LkSS.js → middleware-4fo4pEtA.js} +4 -4
  45. package/dist/{middleware-pUJBhWSu.cjs → middleware-9YDezkYJ.cjs} +94 -17
  46. package/dist/middleware-C2PqSUaA.js +27 -0
  47. package/dist/middleware-DNY45l5T.cjs +12 -0
  48. package/dist/{middleware-FZ0T8vIp.js → middleware-DzICTgdC.js} +115 -36
  49. package/dist/{mod-DE8MYisy.d.cts → mod-B7QkWzrL.d.cts} +1 -1
  50. package/dist/{mod-DKG0ovjR.d.cts → mod-Bx9jcLB8.d.cts} +1 -1
  51. package/dist/{mod-CFBU2OT3.d.cts → mod-Coe7KEgX.d.cts} +1 -1
  52. package/dist/{mod-BugwI0JN.d.ts → mod-Cs2dYEwI.d.ts} +1 -1
  53. package/dist/{mod-DcfFNgYf.d.ts → mod-D6MdymW7.d.ts} +1 -1
  54. package/dist/{mod-CvxylbuV.d.ts → mod-D6dOd--H.d.ts} +1 -1
  55. package/dist/{mod-Z7lIaCfo.d.ts → mod-SMHOMNpZ.d.ts} +1 -1
  56. package/dist/{mod-Dp0kK0hO.d.cts → mod-em2Il1eD.d.cts} +1 -1
  57. package/dist/mod.cjs +12 -4
  58. package/dist/mod.d.cts +8 -8
  59. package/dist/mod.d.ts +8 -8
  60. package/dist/mod.js +9 -5
  61. package/dist/nodeinfo/client.test.js +7 -7
  62. package/dist/nodeinfo/handler.test.js +24 -23
  63. package/dist/nodeinfo/types.test.js +5 -5
  64. package/dist/otel/exporter.test.js +6 -6
  65. package/dist/{owner-MCqkZ1KE.js → owner-D5J299vd.js} +1 -1
  66. package/dist/{proof-D2B3jvnF.js → proof-BBLHhWMC.js} +3 -3
  67. package/dist/{proof-BF_LZjDb.cjs → proof-BVl5IgbN.cjs} +3 -3
  68. package/dist/{proof-ooYMfVCa.js → proof-CiCp_mCG.js} +2 -2
  69. package/dist/{send-DtP5YkuY.js → send-2b0Fn9cn.js} +2 -2
  70. package/dist/sig/accept.test.d.ts +3 -0
  71. package/dist/sig/accept.test.js +451 -0
  72. package/dist/sig/http.test.js +454 -29
  73. package/dist/sig/key.test.js +8 -8
  74. package/dist/sig/ld.test.js +7 -7
  75. package/dist/sig/mod.cjs +6 -2
  76. package/dist/sig/mod.d.cts +3 -3
  77. package/dist/sig/mod.d.ts +3 -3
  78. package/dist/sig/mod.js +3 -3
  79. package/dist/sig/owner.test.js +9 -9
  80. package/dist/sig/proof.test.js +9 -9
  81. package/dist/testing/mod.d.ts +1 -1
  82. package/dist/testing/mod.js +2 -2
  83. package/dist/utils/docloader.test.js +12 -11
  84. package/dist/utils/kv-cache.test.js +2 -2
  85. package/dist/utils/mod.cjs +2 -2
  86. package/dist/utils/mod.d.cts +2 -2
  87. package/dist/utils/mod.d.ts +2 -2
  88. package/dist/utils/mod.js +2 -2
  89. package/package.json +6 -7
  90. package/dist/dist-B5f6a8Tt.js +0 -281
  91. package/dist/middleware-D7yrgd0I.cjs +0 -12
  92. package/dist/middleware-GmHZnwkU.js +0 -26
  93. /package/dist/{assert_not_equals-C80BG-_5.js → assert_not_equals-f3m3epl3.js} +0 -0
  94. /package/dist/{assert_throws-BNXdRGWP.js → assert_throws-rjdMBf31.js} +0 -0
  95. /package/dist/{collection-CcnIw1qY.js → collection-CSzG2j1P.js} +0 -0
  96. /package/dist/{keycache-C7k8s1Bk.js → keycache-CpGWAUbj.js} +0 -0
  97. /package/dist/{keys-ZbcByPg9.js → keys-BFve7QQv.js} +0 -0
  98. /package/dist/{negotiation-5NPJL6zp.js → negotiation-BlAuS_nr.js} +0 -0
  99. /package/dist/{retry-D4GJ670a.js → retry-mqLf4b-R.js} +0 -0
  100. /package/dist/{std__assert-DWivtrGR.js → std__assert-X-_kMxKM.js} +0 -0
package/dist/sig/mod.js CHANGED
@@ -2,8 +2,8 @@
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
- import { exportJwk, fetchKey, fetchKeyDetailed, generateCryptoKeyPair, importJwk, signRequest, verifyRequest, verifyRequestDetailed } from "../http-DxwzIU0F.js";
6
- import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../proof-ooYMfVCa.js";
5
+ import { exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, importJwk, parseAcceptSignature, signRequest, validateAcceptSignature, verifyRequest, verifyRequestDetailed } from "../http-DePHjWKP.js";
6
+ import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../proof-CiCp_mCG.js";
7
7
  import "../sig-BNhspNOf.js";
8
8
 
9
- export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, generateCryptoKeyPair, getKeyOwner, importJwk, signJsonLd, signObject, signRequest, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
9
+ export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
@@ -3,18 +3,18 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { createTestTracerProvider, mockDocumentLoader, test } from "../dist-B5f6a8Tt.js";
7
6
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
7
  import { assert } from "../assert-MZs1qjMx.js";
9
8
  import "../assert_instance_of-DHz7EHNU.js";
10
- import "../deno-9yc0TPBI.js";
11
- import "../key-DFG6tJgw.js";
12
- import { doesActorOwnKey, getKeyOwner } from "../owner-MCqkZ1KE.js";
13
- import "../std__assert-DWivtrGR.js";
14
- import { assertFalse } from "../assert_rejects-Ce45JcFg.js";
15
- import "../assert_throws-BNXdRGWP.js";
16
- import "../assert_not_equals-C80BG-_5.js";
17
- import { rsaPublicKey1, rsaPublicKey2 } from "../keys-ZbcByPg9.js";
9
+ import "../deno-OR506Yti.js";
10
+ import "../key-Cx3Tx_In.js";
11
+ import { doesActorOwnKey, getKeyOwner } from "../owner-D5J299vd.js";
12
+ import "../std__assert-X-_kMxKM.js";
13
+ import { assertFalse } from "../assert_rejects-0h7I2Esa.js";
14
+ import "../assert_throws-rjdMBf31.js";
15
+ import "../assert_not_equals-f3m3epl3.js";
16
+ import { rsaPublicKey1, rsaPublicKey2 } from "../keys-BFve7QQv.js";
17
+ import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
18
18
  import { Create, CryptographicKey, lookupObject } from "@fedify/vocab";
19
19
 
20
20
  //#region src/sig/owner.test.ts
@@ -3,18 +3,18 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { mockDocumentLoader, test } from "../dist-B5f6a8Tt.js";
7
6
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
7
  import "../assert-MZs1qjMx.js";
9
8
  import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
10
- import "../deno-9yc0TPBI.js";
11
- import "../key-DFG6tJgw.js";
12
- import { createProof, signObject, verifyObject, verifyProof } from "../proof-D2B3jvnF.js";
13
- import "../std__assert-DWivtrGR.js";
14
- import { assertRejects } from "../assert_rejects-Ce45JcFg.js";
15
- import "../assert_throws-BNXdRGWP.js";
16
- import "../assert_not_equals-C80BG-_5.js";
17
- import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-ZbcByPg9.js";
9
+ import "../deno-OR506Yti.js";
10
+ import "../key-Cx3Tx_In.js";
11
+ import { createProof, signObject, verifyObject, verifyProof } from "../proof-BBLHhWMC.js";
12
+ import "../std__assert-X-_kMxKM.js";
13
+ import { assertRejects } from "../assert_rejects-0h7I2Esa.js";
14
+ import "../assert_throws-rjdMBf31.js";
15
+ import "../assert_not_equals-f3m3epl3.js";
16
+ import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-BFve7QQv.js";
17
+ import { mockDocumentLoader, test } from "@fedify/fixture";
18
18
  import { Create, DataIntegrityProof, Multikey, Note, Place } from "@fedify/vocab";
19
19
  import { decodeMultibase, importMultibaseKey } from "@fedify/vocab-runtime";
20
20
  import { decodeHex, encodeHex } from "byte-encodings/hex";
@@ -1,11 +1,11 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
+ import { testDefinitions } from "@fedify/fixture";
4
5
  import { Activity, Actor, Collection, CryptographicKey, Hashtag, Link, LookupObjectOptions, Multikey, Object as Object$1, Recipient, TraverseCollectionOptions } from "@fedify/vocab";
5
6
  import { DocumentLoader, GetUserAgentOptions } from "@fedify/vocab-runtime";
6
7
  import { Link as Link$1, LookupWebFingerOptions, ResourceDescriptor } from "@fedify/webfinger";
7
8
  import { TracerProvider } from "@opentelemetry/api";
8
- import { testDefinitions } from "@fedify/fixture";
9
9
 
10
10
  //#region src/nodeinfo/types.d.ts
11
11
  /**
@@ -3,8 +3,8 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { testDefinitions } from "../dist-B5f6a8Tt.js";
7
6
  import "../router-D9eI0s4b.js";
8
- import { createInboxContext, createRequestContext } from "../context-CZ5llAss.js";
7
+ import { createInboxContext, createRequestContext } from "../context-Aqenou7c.js";
8
+ import { testDefinitions } from "@fedify/fixture";
9
9
 
10
10
  export { createInboxContext, createRequestContext, testDefinitions };
@@ -3,20 +3,21 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { mockDocumentLoader, test } from "../dist-B5f6a8Tt.js";
6
+ import { esm_default } from "../esm-nLm00z9V.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 "../deno-9yc0TPBI.js";
11
- import "../key-DFG6tJgw.js";
12
- import { verifyRequest } from "../http-CpvoK0Y7.js";
13
- import { getAuthenticatedDocumentLoader } from "../docloader-6Wrqp6SE.js";
14
- import "../std__assert-DWivtrGR.js";
15
- import { assertRejects } from "../assert_rejects-Ce45JcFg.js";
16
- import "../assert_throws-BNXdRGWP.js";
17
- import "../assert_not_equals-C80BG-_5.js";
18
- import { rsaPrivateKey2 } from "../keys-ZbcByPg9.js";
19
- import { esm_default } from "../esm-DGl7uK1r.js";
10
+ import "../deno-OR506Yti.js";
11
+ import "../accept-D7sAxyNa.js";
12
+ import "../key-Cx3Tx_In.js";
13
+ import { verifyRequest } from "../http-BUCxbGks.js";
14
+ import { getAuthenticatedDocumentLoader } from "../docloader-BG_pP2fW.js";
15
+ import "../std__assert-X-_kMxKM.js";
16
+ import { assertRejects } from "../assert_rejects-0h7I2Esa.js";
17
+ import "../assert_throws-rjdMBf31.js";
18
+ import "../assert_not_equals-f3m3epl3.js";
19
+ import { rsaPrivateKey2 } from "../keys-BFve7QQv.js";
20
+ import { mockDocumentLoader, test } from "@fedify/fixture";
20
21
  import { UrlError } from "@fedify/vocab-runtime";
21
22
 
22
23
  //#region src/utils/docloader.test.ts
@@ -3,8 +3,8 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { mockDocumentLoader, test } from "../dist-B5f6a8Tt.js";
7
- import { MockKvStore, kvCache } from "../kv-cache-B__dHl7g.js";
6
+ import { MockKvStore, kvCache } from "../kv-cache-Bw2F2ABq.js";
7
+ import { mockDocumentLoader, test } from "@fedify/fixture";
8
8
  import { preloadedContexts } from "@fedify/vocab-runtime";
9
9
  import { deepStrictEqual, throws } from "node:assert";
10
10
 
@@ -2,8 +2,8 @@
2
2
  const { Temporal } = require("@js-temporal/polyfill");
3
3
  const { URLPattern } = require("urlpattern-polyfill");
4
4
 
5
- require('../http-C_9L2wFv.cjs');
6
- const require_kv_cache = require('../kv-cache-BHoLc85Z.cjs');
5
+ require('../http-CaXARmaJ.cjs');
6
+ const require_kv_cache = require('../kv-cache-CYTDBChd.cjs');
7
7
  require('../utils-BQ9KqEK9.cjs');
8
8
 
9
9
  exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
@@ -1,4 +1,4 @@
1
- import "../http-DsqqmkXi.cjs";
1
+ import "../http-BudnHZE2.cjs";
2
2
  import "../kv-BL4nlICN.cjs";
3
- import { getAuthenticatedDocumentLoader, kvCache } from "../mod-DKG0ovjR.cjs";
3
+ import { getAuthenticatedDocumentLoader, kvCache } from "../mod-Bx9jcLB8.cjs";
4
4
  export { getAuthenticatedDocumentLoader, kvCache };
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import "../http-BbfOqHGG.js";
3
+ import "../http-Dax_FIBo.js";
4
4
  import "../kv-DXEUEP6z.js";
5
- import { getAuthenticatedDocumentLoader, kvCache } from "../mod-BugwI0JN.js";
5
+ import { getAuthenticatedDocumentLoader, kvCache } from "../mod-Cs2dYEwI.js";
6
6
  export { getAuthenticatedDocumentLoader, kvCache };
package/dist/utils/mod.js CHANGED
@@ -2,8 +2,8 @@
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
- import "../http-DxwzIU0F.js";
6
- import { getAuthenticatedDocumentLoader, kvCache } from "../kv-cache-CRRUsyJ9.js";
5
+ import "../http-DePHjWKP.js";
6
+ import { getAuthenticatedDocumentLoader, kvCache } from "../kv-cache-DizRqYX4.js";
7
7
  import "../utils-Dn5OPdSW.js";
8
8
 
9
9
  export { getAuthenticatedDocumentLoader, kvCache };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "2.1.0-dev.543+e09fd1b4",
3
+ "version": "2.1.0-dev.592+6c1f6e6f",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -140,14 +140,13 @@
140
140
  "es-toolkit": "1.43.0",
141
141
  "json-canon": "^1.0.1",
142
142
  "jsonld": "^9.0.0",
143
- "multicodec": "^3.2.1",
144
143
  "structured-field-values": "^2.0.4",
145
144
  "uri-template-router": "^1.0.0",
146
145
  "url-template": "^3.1.1",
147
146
  "urlpattern-polyfill": "^10.1.0",
148
- "@fedify/vocab": "2.1.0-dev.543+e09fd1b4",
149
- "@fedify/vocab-runtime": "2.1.0-dev.543+e09fd1b4",
150
- "@fedify/webfinger": "2.1.0-dev.543+e09fd1b4"
147
+ "@fedify/vocab": "2.1.0-dev.592+6c1f6e6f",
148
+ "@fedify/webfinger": "2.1.0-dev.592+6c1f6e6f",
149
+ "@fedify/vocab-runtime": "2.1.0-dev.592+6c1f6e6f"
151
150
  },
152
151
  "devDependencies": {
153
152
  "@std/assert": "npm:@jsr/std__assert@^0.226.0",
@@ -159,8 +158,8 @@
159
158
  "tsx": "^4.19.4",
160
159
  "typescript": "^5.9.3",
161
160
  "wrangler": "^4.17.0",
162
- "@fedify/vocab-tools": "^2.1.0-dev.543+e09fd1b4",
163
- "@fedify/fixture": "2.0.0"
161
+ "@fedify/fixture": "2.0.0",
162
+ "@fedify/vocab-tools": "^2.1.0-dev.592+6c1f6e6f"
164
163
  },
165
164
  "scripts": {
166
165
  "build:self": "tsdown",
@@ -1,281 +0,0 @@
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
- import { configure, getConsoleSink, getLogger, reset } from "@logtape/logtape";
8
- import { BasicTracerProvider, SimpleSpanProcessor } from "@opentelemetry/sdk-trace-base";
9
- import { ExportResultCode } from "@opentelemetry/core";
10
-
11
- //#region rolldown:runtime
12
- var __create = Object.create;
13
- var __defProp = Object.defineProperty;
14
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
15
- var __getOwnPropNames = Object.getOwnPropertyNames;
16
- var __getProtoOf = Object.getPrototypeOf;
17
- var __hasOwnProp = Object.prototype.hasOwnProperty;
18
- var __commonJS = (cb, mod) => function() {
19
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
20
- };
21
- var __copyProps = (to, from, except, desc) => {
22
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
23
- key = keys[i];
24
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
25
- get: ((k) => from[k]).bind(null, key),
26
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
27
- });
28
- }
29
- return to;
30
- };
31
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
32
- value: mod,
33
- enumerable: true
34
- }) : target, mod));
35
- var __require$1 = /* @__PURE__ */ createRequire(import.meta.url);
36
-
37
- //#endregion
38
- //#region ../fixture/dist/mod.js
39
- var __require = /* @__PURE__ */ ((x) => typeof __require$1 !== "undefined" ? __require$1 : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof __require$1 !== "undefined" ? __require$1 : a)[b] }) : x)(function(x) {
40
- if (typeof __require$1 !== "undefined") return __require$1.apply(this, arguments);
41
- throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function.");
42
- });
43
- const logger = getLogger(["fixture", "docloader"]);
44
- /**
45
- * A mock of the document loader. This does not make any actual HTTP requests
46
- * towards the remote server, but looks up the local fixture files instead.
47
- *
48
- * For instance, `mockDocumentLoader("http://example.com/foo/bar")` will look up
49
- * the file `testing/fixtures/http/example.com/foo/bar` (no suffix) and return
50
- * its content as the response.
51
- */
52
- async function mockDocumentLoader(resource, _options) {
53
- const url = new URL(resource);
54
- if ("navigator" in globalThis && navigator.userAgent === "Cloudflare-Workers") {
55
- const testUrl = new URL(url);
56
- testUrl.hostname += ".test";
57
- const resp = await fetch(testUrl);
58
- if (resp.ok) {
59
- const document$1 = await resp.json();
60
- logger.debug("Successfully fetched fixture {resource}: {status} {statusText}\n{body}", {
61
- resource,
62
- status: resp.status,
63
- statusText: resp.statusText,
64
- body: document$1
65
- });
66
- return {
67
- contextUrl: null,
68
- document: document$1,
69
- documentUrl: resource
70
- };
71
- }
72
- const error = await resp.text();
73
- logger.error("Failed to fetch fixture {resource}: {error}", {
74
- resource,
75
- error
76
- });
77
- throw new Error(error);
78
- }
79
- const pkg = "Deno" in globalThis ? "." : "@fedify/fixture";
80
- const fixturePath = `${pkg}/fixtures/${url.host}${url.pathname}.json`;
81
- let document;
82
- try {
83
- document = (await import(fixturePath, { with: { type: "json" } })).default;
84
- } catch (error) {
85
- logger.error("Failed to read fixture file {path}: {error}", {
86
- path: fixturePath,
87
- error
88
- });
89
- throw error;
90
- }
91
- return {
92
- contextUrl: null,
93
- document,
94
- documentUrl: resource
95
- };
96
- }
97
- /**
98
- * A test spy for OpenTelemetry spans that captures all spans and events.
99
- */
100
- var TestSpanExporter = class {
101
- spans = [];
102
- export(spans, resultCallback) {
103
- this.spans.push(...spans);
104
- resultCallback({ code: ExportResultCode.SUCCESS });
105
- }
106
- async forceFlush() {}
107
- shutdown() {
108
- this.spans = [];
109
- return Promise.resolve();
110
- }
111
- /**
112
- * Gets all spans with the given name.
113
- */
114
- getSpans(name) {
115
- return this.spans.filter((span) => span.name === name);
116
- }
117
- /**
118
- * Gets the first span with the given name.
119
- */
120
- getSpan(name) {
121
- return this.spans.find((span) => span.name === name);
122
- }
123
- /**
124
- * Gets all events from spans with the given name.
125
- */
126
- getEvents(spanName, eventName) {
127
- const spans = this.getSpans(spanName);
128
- const events = spans.flatMap((span) => span.events);
129
- if (eventName) return events.filter((event) => event.name === eventName);
130
- return events;
131
- }
132
- /**
133
- * Clears all captured spans.
134
- */
135
- clear() {
136
- this.spans = [];
137
- }
138
- };
139
- /**
140
- * Creates a test tracer provider with a test exporter.
141
- * @returns A tuple of [tracerProvider, testExporter]
142
- */
143
- function createTestTracerProvider() {
144
- const exporter = new TestSpanExporter();
145
- const provider = new BasicTracerProvider({ spanProcessors: [new SimpleSpanProcessor(exporter)] });
146
- return [provider, exporter];
147
- }
148
- const testDefinitions = [];
149
- function test(name, options, fn) {
150
- const def = typeof name === "string" ? typeof options === "function" ? {
151
- name,
152
- fn: options
153
- } : {
154
- name,
155
- ...options,
156
- fn
157
- } : name;
158
- testDefinitions.push(def);
159
- if ("Deno" in globalThis) {
160
- const func = def.fn;
161
- Deno.test({
162
- ...def,
163
- async fn(t) {
164
- const records = [];
165
- await configure({
166
- sinks: {
167
- buffer(record) {
168
- if (record.category.length > 1 && record.category[0] === "logtape" && record.category[1] === "meta") return;
169
- records.push(record);
170
- },
171
- console: getConsoleSink()
172
- },
173
- filters: {},
174
- loggers: [{
175
- category: [],
176
- sinks: [Deno.env.get("LOG") === "always" ? "console" : "buffer"]
177
- }]
178
- });
179
- try {
180
- await func(t);
181
- } catch (e) {
182
- const consoleSink = getConsoleSink();
183
- for (const record of records) consoleSink(record);
184
- throw e;
185
- } finally {
186
- await reset();
187
- }
188
- }
189
- });
190
- } else if ("Bun" in globalThis) {
191
- let failed = void 0;
192
- async function step(defOrNameOrFn, fn$2) {
193
- let def$1;
194
- if (typeof defOrNameOrFn === "string") def$1 = {
195
- name: defOrNameOrFn,
196
- fn: fn$2
197
- };
198
- else if (typeof defOrNameOrFn === "function") def$1 = {
199
- name: defOrNameOrFn.name,
200
- fn: defOrNameOrFn
201
- };
202
- else def$1 = defOrNameOrFn;
203
- if (def$1.ignore) return true;
204
- try {
205
- await def$1.fn({
206
- name: def$1.name,
207
- origin: "",
208
- step
209
- });
210
- } catch (e) {
211
- failed ??= e;
212
- return false;
213
- }
214
- return true;
215
- }
216
- const ctx = {
217
- name: def.name,
218
- origin: "",
219
- step
220
- };
221
- async function fn$1() {
222
- await def.fn(ctx);
223
- if (failed) throw failed;
224
- }
225
- const bunTest = Bun.jest(caller()).test;
226
- if (def.ignore) bunTest.skip(def.name, fn$1);
227
- else if (def.only) bunTest.only(def.name, fn$1);
228
- else bunTest(def.name, fn$1);
229
- } else try {
230
- const { test: nodeTest } = __require("node:test");
231
- nodeTest(def.name, {
232
- only: def.only,
233
- skip: def.ignore
234
- }, async (t) => {
235
- await def.fn(intoDenoTestContext(def.name, t));
236
- });
237
- } catch {}
238
- }
239
- function intoDenoTestContext(name, ctx) {
240
- async function step(defOrNameOrFn, fn) {
241
- let def;
242
- if (typeof defOrNameOrFn === "string") def = {
243
- name: defOrNameOrFn,
244
- fn
245
- };
246
- else if (typeof defOrNameOrFn === "function") def = {
247
- name: defOrNameOrFn.name,
248
- fn: defOrNameOrFn
249
- };
250
- else def = defOrNameOrFn;
251
- let failed = false;
252
- await ctx.test(def.name, async (ctx2) => {
253
- try {
254
- await def.fn(intoDenoTestContext(def.name, ctx2));
255
- } catch (e) {
256
- failed = true;
257
- throw e;
258
- }
259
- });
260
- return failed;
261
- }
262
- const denoCtx = {
263
- name,
264
- origin: ctx.filePath ?? "",
265
- step
266
- };
267
- return denoCtx;
268
- }
269
- /** Retrieve caller test file. */
270
- function caller() {
271
- const Trace = Error;
272
- const _ = Trace.prepareStackTrace;
273
- Trace.prepareStackTrace = (_$1, stack$1) => stack$1;
274
- const { stack } = /* @__PURE__ */ new Error();
275
- Trace.prepareStackTrace = _;
276
- const caller$1 = stack[2];
277
- return caller$1.getFileName().replaceAll("\\", "/");
278
- }
279
-
280
- //#endregion
281
- export { __commonJS, __toESM, createTestTracerProvider, mockDocumentLoader, test, testDefinitions };
@@ -1,12 +0,0 @@
1
-
2
- const { Temporal } = require("@js-temporal/polyfill");
3
- const { URLPattern } = require("urlpattern-polyfill");
4
-
5
- require('./transformers-3g8GZwkZ.cjs');
6
- require('./http-C_9L2wFv.cjs');
7
- const require_middleware = require('./middleware-pUJBhWSu.cjs');
8
- require('./proof-BF_LZjDb.cjs');
9
- require('./types-Cd_hszr_.cjs');
10
- require('./kv-cache-BHoLc85Z.cjs');
11
-
12
- exports.FederationImpl = require_middleware.FederationImpl;
@@ -1,26 +0,0 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
- globalThis.addEventListener = () => {};
5
-
6
- import "./deno-9yc0TPBI.js";
7
- import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-FZ0T8vIp.js";
8
- import "./client-Dg7OfUDA.js";
9
- import "./router-D9eI0s4b.js";
10
- import "./types-CPz01LGH.js";
11
- import "./key-DFG6tJgw.js";
12
- import "./http-CpvoK0Y7.js";
13
- import "./ld-DVnRS9IK.js";
14
- import "./owner-MCqkZ1KE.js";
15
- import "./proof-D2B3jvnF.js";
16
- import "./docloader-6Wrqp6SE.js";
17
- import "./kv-cache-B__dHl7g.js";
18
- import "./inbox-DMq3a5bc.js";
19
- import "./builder-BBucr-Bp.js";
20
- import "./collection-CcnIw1qY.js";
21
- import "./keycache-C7k8s1Bk.js";
22
- import "./negotiation-5NPJL6zp.js";
23
- import "./retry-D4GJ670a.js";
24
- import "./send-DtP5YkuY.js";
25
-
26
- export { FederationImpl };
File without changes
File without changes