@fedify/fedify 2.3.0-dev.1110 → 2.3.0-dev.1119

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 (97) hide show
  1. package/dist/{assert_rejects-B-qJtC9Z.mjs → assert_rejects-DQP-q39h.mjs} +27 -2
  2. package/dist/{builder-B-Y6fwSu.mjs → builder-Ond_h57y.mjs} +3 -3
  3. package/dist/compat/mod.d.cts +1 -1
  4. package/dist/compat/mod.d.ts +1 -1
  5. package/dist/compat/outgoing-jsonld.test.mjs +1 -1
  6. package/dist/compat/public-audience.test.mjs +1 -1
  7. package/dist/compat/transformers.test.mjs +2 -2
  8. package/dist/{context-C0C_sRha.d.cts → context-Ch-ZLyTQ.d.cts} +1 -1
  9. package/dist/{context-Dqgt8saU.d.ts → context-cSUMk2da.d.ts} +1 -1
  10. package/dist/{deno-hqC7tKJn.mjs → deno-DVsHS7rA.mjs} +1 -1
  11. package/dist/{docloader-BOEuuXkX.mjs → docloader-WsWfKaE5.mjs} +2 -2
  12. package/dist/federation/builder.test.mjs +3 -3
  13. package/dist/federation/collection.test.mjs +2 -2
  14. package/dist/federation/handler.test.mjs +8 -7
  15. package/dist/federation/idempotency.test.mjs +5 -5
  16. package/dist/federation/inbox.test.mjs +1 -1
  17. package/dist/federation/keycache.test.mjs +1 -1
  18. package/dist/federation/kv.test.mjs +2 -2
  19. package/dist/federation/metrics.test.d.mts +2 -0
  20. package/dist/federation/metrics.test.mjs +107 -0
  21. package/dist/federation/middleware.test.mjs +390 -10
  22. package/dist/federation/mod.cjs +1 -1
  23. package/dist/federation/mod.d.cts +2 -2
  24. package/dist/federation/mod.d.ts +2 -2
  25. package/dist/federation/mod.js +1 -1
  26. package/dist/federation/mq.test.mjs +2 -2
  27. package/dist/federation/negotiation.test.mjs +2 -2
  28. package/dist/federation/router.test.mjs +2 -2
  29. package/dist/federation/send.test.mjs +11 -11
  30. package/dist/federation/webfinger.test.mjs +3 -3
  31. package/dist/{getMachineId-bsd-etIyxDet.mjs → getMachineId-bsd-BY01PL1n.mjs} +1 -1
  32. package/dist/{getMachineId-darwin-D23zTf4g.mjs → getMachineId-darwin-Dr1gkBkp.mjs} +1 -1
  33. package/dist/{getMachineId-win-Dpap6v5i.mjs → getMachineId-win-QEYwcJiy.mjs} +1 -1
  34. package/dist/{http-O8MYWwk8.js → http-CouJSFVK.js} +461 -37
  35. package/dist/{http-DV0il3vk.cjs → http-CubOB9wq.cjs} +513 -35
  36. package/dist/{http-BDZeS5om.d.ts → http-D6LP89UO.d.ts} +7 -1
  37. package/dist/{http-C87EWkO0.d.cts → http-D6aw3j2U.d.cts} +7 -1
  38. package/dist/{http-BLopFpvC.mjs → http-DUV8ysti.mjs} +86 -37
  39. package/dist/{key-DW1EVmtP.mjs → key-BoWaYRHm.mjs} +1 -1
  40. package/dist/{kv-cache-C3NWWiTg.js → kv-cache-DBNpsneh.js} +1 -1
  41. package/dist/{kv-cache-Dya-TWMe.cjs → kv-cache-Dz31ATUT.cjs} +1 -1
  42. package/dist/{ld-BNkk2Yal.mjs → ld-B5K1mSuG.mjs} +60 -9
  43. package/dist/{send-hokVCPu6.mjs → metrics-C4attqv0.mjs} +124 -224
  44. package/dist/{middleware-D6FbOjuK.mjs → middleware-BDKFRjue.mjs} +1 -1
  45. package/dist/{middleware-DUWeXjZR.cjs → middleware-CmsDtIHI.cjs} +75 -309
  46. package/dist/{middleware-CjzI3aYo.js → middleware-Dtjz-hSk.js} +46 -280
  47. package/dist/{middleware-DA2WTBr4.mjs → middleware-t0jC8I99.mjs} +59 -34
  48. package/dist/{mod-DXY9JF28.d.cts → mod-B-Lin9Sy.d.ts} +25 -2
  49. package/dist/{mod-DHO9lk3D.d.ts → mod-BDhgfjP7.d.cts} +25 -2
  50. package/dist/{mod-B0rWmfW5.d.cts → mod-BR_BB0bh.d.cts} +1 -1
  51. package/dist/{mod-Dx3-hqyo.d.ts → mod-C6E8rkcz.d.ts} +1 -1
  52. package/dist/{mod-BhU_H1I_.d.ts → mod-DLrRb0dx.d.ts} +1 -1
  53. package/dist/{mod-CLPnQPsv.d.cts → mod-P9tE2WmM.d.cts} +1 -1
  54. package/dist/mod.cjs +4 -4
  55. package/dist/mod.d.cts +5 -5
  56. package/dist/mod.d.ts +5 -5
  57. package/dist/mod.js +4 -4
  58. package/dist/nodeinfo/client.test.mjs +2 -2
  59. package/dist/nodeinfo/handler.test.mjs +3 -3
  60. package/dist/nodeinfo/types.test.mjs +2 -2
  61. package/dist/otel/exporter.test.mjs +2 -2
  62. package/dist/{outgoing-jsonld-BgFLCJQ_.mjs → outgoing-jsonld-BNL8AC14.mjs} +1 -1
  63. package/dist/{owner-jvJAtR5O.mjs → owner-hDxI0ufu.mjs} +2 -2
  64. package/dist/{proof-BD92WeqV.cjs → proof-BUWfVr6Q.cjs} +78 -11
  65. package/dist/{proof-mfmHH9j0.mjs → proof-DhVuz4bc.mjs} +25 -7
  66. package/dist/{proof-5kT7OUPV.js → proof-n60t8o9P.js} +78 -11
  67. package/dist/send-BPhyR5Oo.mjs +225 -0
  68. package/dist/sig/accept.test.mjs +1 -1
  69. package/dist/sig/http.test.mjs +212 -6
  70. package/dist/sig/key.test.mjs +4 -4
  71. package/dist/sig/ld.test.mjs +138 -5
  72. package/dist/sig/mod.cjs +2 -2
  73. package/dist/sig/mod.d.cts +2 -2
  74. package/dist/sig/mod.d.ts +2 -2
  75. package/dist/sig/mod.js +2 -2
  76. package/dist/sig/owner.test.mjs +4 -4
  77. package/dist/sig/proof.test.mjs +167 -6
  78. package/dist/{std__assert-CRDpx_HF.mjs → std__assert-BTEgfoJo.mjs} +2 -27
  79. package/dist/utils/docloader.test.mjs +5 -5
  80. package/dist/utils/kv-cache.test.mjs +1 -1
  81. package/dist/utils/mod.cjs +1 -1
  82. package/dist/utils/mod.d.cts +1 -1
  83. package/dist/utils/mod.d.ts +1 -1
  84. package/dist/utils/mod.js +1 -1
  85. package/package.json +5 -5
  86. /package/dist/{accept-CceiKpCy.mjs → accept-CgDcxvjV.mjs} +0 -0
  87. /package/dist/{activity-listener-tztVvlNb.mjs → activity-listener-BeTGV3wc.mjs} +0 -0
  88. /package/dist/{client-B_A6mfn3.mjs → client-Bneh_DYR.mjs} +0 -0
  89. /package/dist/{collection-CA3V5zyK.mjs → collection-Cc3DVAhE.mjs} +0 -0
  90. /package/dist/{execAsync-DCBrgFiV.mjs → execAsync-Dxb7rNf3.mjs} +0 -0
  91. /package/dist/{getMachineId-linux-ObI47Hql.mjs → getMachineId-linux-Bbhofx-s.mjs} +0 -0
  92. /package/dist/{getMachineId-unsupported-Ddu-PFeh.mjs → getMachineId-unsupported-dIOte2Ct.mjs} +0 -0
  93. /package/dist/{keys-C3kae-6B.mjs → keys-CSYsOMFG.mjs} +0 -0
  94. /package/dist/{kv-x2IvBUyq.mjs → kv-QHE0oeM3.mjs} +0 -0
  95. /package/dist/{kv-cache-CiiNwT6W.mjs → kv-cache-DihufyAQ.mjs} +0 -0
  96. /package/dist/{public-audience-N3pyOx2p.mjs → public-audience-c9zmYKgA.mjs} +0 -0
  97. /package/dist/{types-BFowWFTT.mjs → types-D09GN0uZ.mjs} +0 -0
@@ -1,7 +1,7 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { l as AssertionError } from "./assert_equals-Ew3jOFa3.mjs";
4
+ import { l as AssertionError, s as format } from "./assert_equals-Ew3jOFa3.mjs";
5
5
  import { n as assertIsError } from "./assert_throws-4NwKEy2q.mjs";
6
6
  //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_false.js
7
7
  /**
@@ -21,6 +21,31 @@ import { n as assertIsError } from "./assert_throws-4NwKEy2q.mjs";
21
21
  if (expr) throw new AssertionError(msg);
22
22
  }
23
23
  //#endregion
24
+ //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_greater_or_equal.js
25
+ /**
26
+ * Make an assertion that `actual` is greater than or equal to `expected`.
27
+ * If not then throw.
28
+ *
29
+ * @example Usage
30
+ * ```ts no-eval
31
+ * import { assertGreaterOrEqual } from "@std/assert/assert-greater-or-equal";
32
+ *
33
+ * assertGreaterOrEqual(2, 1); // Doesn't throw
34
+ * assertGreaterOrEqual(1, 1); // Doesn't throw
35
+ * assertGreaterOrEqual(0, 1); // Throws
36
+ * ```
37
+ *
38
+ * @typeParam T The type of the values to compare.
39
+ * @param actual The actual value to compare.
40
+ * @param expected The expected value to compare.
41
+ * @param msg The optional message to display if the assertion fails.
42
+ */ function assertGreaterOrEqual(actual, expected, msg) {
43
+ if (actual >= expected) return;
44
+ const actualString = format(actual);
45
+ const expectedString = format(expected);
46
+ throw new AssertionError(msg ?? `Expect ${actualString} >= ${expectedString}`);
47
+ }
48
+ //#endregion
24
49
  //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_rejects.js
25
50
  async function assertRejects(fn, errorClassOrMsg, msgIncludesOrMsg, msg) {
26
51
  let ErrorClass = void 0;
@@ -54,4 +79,4 @@ async function assertRejects(fn, errorClassOrMsg, msgIncludesOrMsg, msg) {
54
79
  return err;
55
80
  }
56
81
  //#endregion
57
- export { assertFalse as n, assertRejects as t };
82
+ export { assertGreaterOrEqual as n, assertFalse as r, assertRejects as t };
@@ -2,8 +2,8 @@ import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { n as RouterError, t as Router } from "./router-BT_F5748.mjs";
5
- import { n as version, t as name } from "./deno-hqC7tKJn.mjs";
6
- import { t as ActivityListenerSet } from "./activity-listener-tztVvlNb.mjs";
5
+ import { n as version, t as name } from "./deno-DVsHS7rA.mjs";
6
+ import { t as ActivityListenerSet } from "./activity-listener-BeTGV3wc.mjs";
7
7
  import { getLogger } from "@logtape/logtape";
8
8
  import { Tombstone, getTypeId } from "@fedify/vocab";
9
9
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
@@ -59,7 +59,7 @@ var FederationBuilderImpl = class {
59
59
  this.collectionTypeIds = {};
60
60
  }
61
61
  async build(options) {
62
- const { FederationImpl } = await import("./middleware-D6FbOjuK.mjs");
62
+ const { FederationImpl } = await import("./middleware-BDKFRjue.mjs");
63
63
  const f = new FederationImpl(options);
64
64
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
65
65
  f.router = this.router.clone();
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { kt as ActivityTransformer, n as Context } from "../context-C0C_sRha.cjs";
2
+ import { kt as ActivityTransformer, n as Context } from "../context-Ch-ZLyTQ.cjs";
3
3
  import { Activity } from "@fedify/vocab";
4
4
 
5
5
  //#region src/compat/transformers.d.ts
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { kt as ActivityTransformer, n as Context } from "../context-Dqgt8saU.js";
2
+ import { kt as ActivityTransformer, n as Context } from "../context-cSUMk2da.js";
3
3
  import { Activity } from "@fedify/vocab";
4
4
 
5
5
  //#region src/compat/transformers.d.ts
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import { t as assertStrictEquals } from "../assert_strict_equals-Dmjbg-bA.mjs";
6
- import { n as normalizeAttachmentArrays, r as normalizeOutgoingActivityJsonLd, t as isPreloadedContextAttachmentSafe } from "../outgoing-jsonld-BgFLCJQ_.mjs";
6
+ import { n as normalizeAttachmentArrays, r as normalizeOutgoingActivityJsonLd, t as isPreloadedContextAttachmentSafe } from "../outgoing-jsonld-BNL8AC14.mjs";
7
7
  import { Create, Document, Note, PUBLIC_COLLECTION } from "@fedify/vocab";
8
8
  import { mockDocumentLoader, test } from "@fedify/fixture";
9
9
  //#region src/compat/outgoing-jsonld.test.ts
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import { t as assertNotEquals } from "../assert_not_equals--wG9hV7u.mjs";
6
- import { t as normalizePublicAudience } from "../public-audience-N3pyOx2p.mjs";
6
+ import { t as normalizePublicAudience } from "../public-audience-c9zmYKgA.mjs";
7
7
  import { Create, Note, PUBLIC_COLLECTION } from "@fedify/vocab";
8
8
  import { test } from "@fedify/fixture";
9
9
  import { getDocumentLoader, preloadedContexts } from "@fedify/vocab-runtime";
@@ -4,8 +4,8 @@ globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
6
6
  import { t as assert } from "../assert-DikXweDx.mjs";
7
- import { t as MemoryKvStore } from "../kv-x2IvBUyq.mjs";
8
- import { n as FederationImpl, v as actorDehydrator, y as autoIdAssigner } from "../middleware-DA2WTBr4.mjs";
7
+ import { t as MemoryKvStore } from "../kv-QHE0oeM3.mjs";
8
+ import { n as FederationImpl, v as actorDehydrator, y as autoIdAssigner } from "../middleware-t0jC8I99.mjs";
9
9
  import { Follow, Person } from "@fedify/vocab";
10
10
  import { test } from "@fedify/fixture";
11
11
  //#region src/compat/transformers.test.ts
@@ -1,6 +1,6 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { o as JsonValue, s as NodeInfo, t as GetNodeInfoOptions } from "./client-CAM_bQXx.cjs";
3
- import { o as VerifyRequestFailureReason, t as HttpMessageSignaturesSpec } from "./http-C87EWkO0.cjs";
3
+ import { o as VerifyRequestFailureReason, t as HttpMessageSignaturesSpec } from "./http-D6aw3j2U.cjs";
4
4
  import { n as GetKeyOwnerOptions } from "./owner-DEvZuyOE.cjs";
5
5
  import { n as KvStore, t as KvKey } from "./kv-gJ8LYbxX.cjs";
6
6
  import { Activity, Actor, Collection, CryptographicKey, Hashtag, Link, LookupObjectOptions, Multikey, Object as Object$1, Recipient, Tombstone, TraverseCollectionOptions } from "@fedify/vocab";
@@ -1,6 +1,6 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { o as JsonValue, s as NodeInfo, t as GetNodeInfoOptions } from "./client-CSddvgWN.js";
3
- import { o as VerifyRequestFailureReason, t as HttpMessageSignaturesSpec } from "./http-BDZeS5om.js";
3
+ import { o as VerifyRequestFailureReason, t as HttpMessageSignaturesSpec } from "./http-D6LP89UO.js";
4
4
  import { n as GetKeyOwnerOptions } from "./owner-CnngXDNJ.js";
5
5
  import { n as KvStore, t as KvKey } from "./kv-D6hNiMTK.js";
6
6
  import { Activity, Actor, Collection, CryptographicKey, Hashtag, Link, LookupObjectOptions, Multikey, Object as Object$1, Recipient, Tombstone, TraverseCollectionOptions } from "@fedify/vocab";
@@ -3,6 +3,6 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  //#region deno.json
5
5
  var name = "@fedify/fedify";
6
- var version = "2.3.0-dev.1110+3ba84466";
6
+ var version = "2.3.0-dev.1119+6cc02662";
7
7
  //#endregion
8
8
  export { version as n, name as t };
@@ -1,8 +1,8 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { o as validateCryptoKey } from "./key-DW1EVmtP.mjs";
5
- import { n as doubleKnock } from "./http-BLopFpvC.mjs";
4
+ import { o as validateCryptoKey } from "./key-BoWaYRHm.mjs";
5
+ import { n as doubleKnock } from "./http-DUV8ysti.mjs";
6
6
  import { getLogger } from "@logtape/logtape";
7
7
  import { curry } from "es-toolkit";
8
8
  import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, validatePublicUrl } from "@fedify/vocab-runtime";
@@ -3,10 +3,10 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { n as RouterError } from "../router-BT_F5748.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
6
- import { i as assertExists } from "../std__assert-CRDpx_HF.mjs";
6
+ import { r as assertExists } from "../std__assert-BTEgfoJo.mjs";
7
7
  import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
8
- import { t as MemoryKvStore } from "../kv-x2IvBUyq.mjs";
9
- import { r as createFederationBuilder } from "../builder-B-Y6fwSu.mjs";
8
+ import { t as MemoryKvStore } from "../kv-QHE0oeM3.mjs";
9
+ import { r as createFederationBuilder } from "../builder-Ond_h57y.mjs";
10
10
  import { Activity, Note, Person } from "@fedify/vocab";
11
11
  import { test } from "@fedify/fixture";
12
12
  //#region src/federation/builder.test.ts
@@ -2,8 +2,8 @@ import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
- import "../std__assert-CRDpx_HF.mjs";
6
- import { n as digest, t as buildCollectionSynchronizationHeader } from "../collection-CA3V5zyK.mjs";
5
+ import "../std__assert-BTEgfoJo.mjs";
6
+ import { n as digest, t as buildCollectionSynchronizationHeader } from "../collection-Cc3DVAhE.mjs";
7
7
  import { test } from "@fedify/fixture";
8
8
  import { decodeHex } from "byte-encodings/hex";
9
9
  //#region src/federation/collection.test.ts
@@ -3,15 +3,16 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-BAE7AKLA.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
6
- import { r as assertGreaterOrEqual } from "../std__assert-CRDpx_HF.mjs";
6
+ import "../std__assert-BTEgfoJo.mjs";
7
+ import { n as assertGreaterOrEqual } from "../assert_rejects-DQP-q39h.mjs";
7
8
  import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
8
9
  import { t as assert } from "../assert-DikXweDx.mjs";
9
- import { r as parseAcceptSignature } from "../accept-CceiKpCy.mjs";
10
- import { s as signRequest } from "../http-BLopFpvC.mjs";
11
- import { a as rsaPrivateKey3, c as rsaPublicKey3, s as rsaPublicKey2 } from "../keys-C3kae-6B.mjs";
12
- import { t as MemoryKvStore } from "../kv-x2IvBUyq.mjs";
13
- import { c as handleActor, d as handleInbox, f as handleObject, h as respondWithObjectIfAcceptable, l as handleCollection, m as respondWithObject, o as createFederation, p as handleOutbox, u as handleCustomCollection } from "../middleware-DA2WTBr4.mjs";
14
- import { t as ActivityListenerSet } from "../activity-listener-tztVvlNb.mjs";
10
+ import { r as parseAcceptSignature } from "../accept-CgDcxvjV.mjs";
11
+ import { s as signRequest } from "../http-DUV8ysti.mjs";
12
+ import { a as rsaPrivateKey3, c as rsaPublicKey3, s as rsaPublicKey2 } from "../keys-CSYsOMFG.mjs";
13
+ import { t as MemoryKvStore } from "../kv-QHE0oeM3.mjs";
14
+ import { c as handleActor, d as handleInbox, f as handleObject, h as respondWithObjectIfAcceptable, l as handleCollection, m as respondWithObject, o as createFederation, p as handleOutbox, u as handleCustomCollection } from "../middleware-t0jC8I99.mjs";
15
+ import { t as ActivityListenerSet } from "../activity-listener-BeTGV3wc.mjs";
15
16
  import { Activity, Create, Note, Person, Tombstone } from "@fedify/vocab";
16
17
  import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
17
18
  import { FetchError } from "@fedify/vocab-runtime";
@@ -2,11 +2,11 @@ import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
- import "../std__assert-CRDpx_HF.mjs";
6
- import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-C3kae-6B.mjs";
7
- import { r as signObject } from "../proof-mfmHH9j0.mjs";
8
- import { t as MemoryKvStore } from "../kv-x2IvBUyq.mjs";
9
- import { o as createFederation } from "../middleware-DA2WTBr4.mjs";
5
+ import "../std__assert-BTEgfoJo.mjs";
6
+ import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-CSYsOMFG.mjs";
7
+ import { r as signObject } from "../proof-DhVuz4bc.mjs";
8
+ import { t as MemoryKvStore } from "../kv-QHE0oeM3.mjs";
9
+ import { o as createFederation } from "../middleware-t0jC8I99.mjs";
10
10
  import { Create, Follow, Person } from "@fedify/vocab";
11
11
  import { mockDocumentLoader, test } from "@fedify/fixture";
12
12
  //#region src/federation/idempotency.test.ts
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
6
- import { t as ActivityListenerSet } from "../activity-listener-tztVvlNb.mjs";
6
+ import { t as ActivityListenerSet } from "../activity-listener-BeTGV3wc.mjs";
7
7
  import { Activity, Create, Invite, Offer, Update } from "@fedify/vocab";
8
8
  import { test } from "@fedify/fixture";
9
9
  //#region src/federation/inbox.test.ts
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
6
6
  import { t as assert } from "../assert-DikXweDx.mjs";
7
- import { t as MemoryKvStore } from "../kv-x2IvBUyq.mjs";
7
+ import { t as MemoryKvStore } from "../kv-QHE0oeM3.mjs";
8
8
  import { t as KvKeyCache } from "../keycache-BeU0LCII.mjs";
9
9
  import { CryptographicKey, Multikey } from "@fedify/vocab";
10
10
  import { test } from "@fedify/fixture";
@@ -2,8 +2,8 @@ import { Temporal } from "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
- import "../std__assert-CRDpx_HF.mjs";
6
- import { t as MemoryKvStore } from "../kv-x2IvBUyq.mjs";
5
+ import "../std__assert-BTEgfoJo.mjs";
6
+ import { t as MemoryKvStore } from "../kv-QHE0oeM3.mjs";
7
7
  import { test } from "@fedify/fixture";
8
8
  //#region src/federation/kv.test.ts
9
9
  test("MemoryKvStore", async (t) => {
@@ -0,0 +1,2 @@
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ import { URLPattern } from "urlpattern-polyfill";
@@ -0,0 +1,107 @@
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-BTEgfoJo.mjs";
6
+ import { c as recordOutboxActivity, l as recordOutboxEnqueue, o as recordFanoutRecipients, s as recordInboxActivity } from "../metrics-C4attqv0.mjs";
7
+ import { createTestMeterProvider, test } from "@fedify/fixture";
8
+ //#region src/federation/metrics.test.ts
9
+ const noopQueue = {
10
+ enqueue() {
11
+ return Promise.resolve();
12
+ },
13
+ listen() {
14
+ return Promise.resolve();
15
+ }
16
+ };
17
+ test("recordFanoutRecipients() records the recipient count with activity type", () => {
18
+ const [meterProvider, recorder] = createTestMeterProvider();
19
+ recordFanoutRecipients(meterProvider, 7, "https://www.w3.org/ns/activitystreams#Create");
20
+ const measurements = recorder.getMeasurements("activitypub.fanout.recipients");
21
+ assertEquals(measurements.length, 1);
22
+ assertEquals(measurements[0].type, "histogram");
23
+ assertEquals(measurements[0].value, 7);
24
+ assertEquals(measurements[0].attributes["activitypub.activity.type"], "https://www.w3.org/ns/activitystreams#Create");
25
+ });
26
+ test("recordFanoutRecipients() omits activity type when unknown", () => {
27
+ const [meterProvider, recorder] = createTestMeterProvider();
28
+ recordFanoutRecipients(meterProvider, 0);
29
+ const measurements = recorder.getMeasurements("activitypub.fanout.recipients");
30
+ assertEquals(measurements.length, 1);
31
+ assertEquals(measurements[0].value, 0);
32
+ assertEquals("activitypub.activity.type" in measurements[0].attributes, false);
33
+ });
34
+ test("recordInboxActivity() records counter with result and activity type", () => {
35
+ const [meterProvider, recorder] = createTestMeterProvider();
36
+ for (const result of [
37
+ "queued",
38
+ "processed",
39
+ "retried",
40
+ "rejected",
41
+ "abandoned"
42
+ ]) recordInboxActivity(meterProvider, result, "https://www.w3.org/ns/activitystreams#Follow");
43
+ const measurements = recorder.getMeasurements("activitypub.inbox.activity");
44
+ assertEquals(measurements.length, 5);
45
+ for (const m of measurements) {
46
+ assertEquals(m.type, "counter");
47
+ assertEquals(m.value, 1);
48
+ assertEquals(m.attributes["activitypub.activity.type"], "https://www.w3.org/ns/activitystreams#Follow");
49
+ }
50
+ assertEquals(measurements.map((m) => m.attributes["activitypub.processing.result"]), [
51
+ "queued",
52
+ "processed",
53
+ "retried",
54
+ "rejected",
55
+ "abandoned"
56
+ ]);
57
+ });
58
+ test("recordInboxActivity() omits activity type when unknown", () => {
59
+ const [meterProvider, recorder] = createTestMeterProvider();
60
+ recordInboxActivity(meterProvider, "rejected");
61
+ const measurements = recorder.getMeasurements("activitypub.inbox.activity");
62
+ assertEquals(measurements.length, 1);
63
+ assertEquals(measurements[0].attributes["activitypub.processing.result"], "rejected");
64
+ assertEquals("activitypub.activity.type" in measurements[0].attributes, false);
65
+ });
66
+ test("recordOutboxEnqueue() also records activitypub.outbox.activity{queued} on initial enqueue", () => {
67
+ const [meterProvider, recorder] = createTestMeterProvider();
68
+ recordOutboxEnqueue(meterProvider, noopQueue, {
69
+ activityType: "https://www.w3.org/ns/activitystreams#Create",
70
+ attempt: 0
71
+ });
72
+ const queued = recorder.getMeasurements("activitypub.outbox.activity");
73
+ assertEquals(queued.length, 1);
74
+ assertEquals(queued[0].type, "counter");
75
+ assertEquals(queued[0].attributes["activitypub.processing.result"], "queued");
76
+ assertEquals(queued[0].attributes["activitypub.activity.type"], "https://www.w3.org/ns/activitystreams#Create");
77
+ });
78
+ test("recordOutboxEnqueue() does not record outbox.activity{queued} on retry enqueues", () => {
79
+ const [meterProvider, recorder] = createTestMeterProvider();
80
+ recordOutboxEnqueue(meterProvider, noopQueue, {
81
+ activityType: "https://www.w3.org/ns/activitystreams#Create",
82
+ attempt: 1
83
+ });
84
+ assertEquals(recorder.getMeasurements("activitypub.outbox.activity").length, 0);
85
+ });
86
+ test("recordOutboxActivity() records counter with result and activity type", () => {
87
+ const [meterProvider, recorder] = createTestMeterProvider();
88
+ for (const result of [
89
+ "queued",
90
+ "retried",
91
+ "abandoned"
92
+ ]) recordOutboxActivity(meterProvider, result, "https://www.w3.org/ns/activitystreams#Announce");
93
+ const measurements = recorder.getMeasurements("activitypub.outbox.activity");
94
+ assertEquals(measurements.length, 3);
95
+ for (const m of measurements) {
96
+ assertEquals(m.type, "counter");
97
+ assertEquals(m.value, 1);
98
+ assertEquals(m.attributes["activitypub.activity.type"], "https://www.w3.org/ns/activitystreams#Announce");
99
+ }
100
+ assertEquals(measurements.map((m) => m.attributes["activitypub.processing.result"]), [
101
+ "queued",
102
+ "retried",
103
+ "abandoned"
104
+ ]);
105
+ });
106
+ //#endregion
107
+ export {};