@fedify/fedify 2.3.0-dev.1079 → 2.3.0-dev.1099

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 (86) hide show
  1. package/dist/{builder-DqT-OPZ8.mjs → builder-BkRRjxzb.mjs} +2 -2
  2. package/dist/{chunk-nlSIicah.js → chunk-CRNNMoPX.js} +2 -2
  3. package/dist/{client-z-8dc-e1.d.cts → client-CAM_bQXx.d.cts} +1 -0
  4. package/dist/{client-AtlibPOU.d.ts → client-CSddvgWN.d.ts} +1 -2
  5. package/dist/compat/mod.d.cts +2 -1
  6. package/dist/compat/mod.d.ts +2 -3
  7. package/dist/compat/mod.js +3 -3
  8. package/dist/compat/transformers.test.mjs +1 -1
  9. package/dist/{context-DrNqYkPw.d.ts → context-C0C_sRha.d.cts} +6 -7
  10. package/dist/{context-BKLGj9QO.d.cts → context-Dqgt8saU.d.ts} +6 -5
  11. package/dist/{deno-BxqkYxIf.mjs → deno-DBabeupC.mjs} +1 -1
  12. package/dist/{docloader-vsZP01ww.mjs → docloader-DA5FzJOR.mjs} +2 -2
  13. package/dist/federation/builder.test.mjs +1 -1
  14. package/dist/federation/handler.test.mjs +84 -2
  15. package/dist/federation/idempotency.test.mjs +2 -2
  16. package/dist/federation/middleware.test.mjs +383 -16
  17. package/dist/federation/mod.cjs +1 -1
  18. package/dist/federation/mod.d.cts +4 -3
  19. package/dist/federation/mod.d.ts +4 -5
  20. package/dist/federation/mod.js +2 -2
  21. package/dist/federation/send.test.mjs +3 -3
  22. package/dist/federation/webfinger.test.mjs +1 -1
  23. package/dist/{http-DM4ZAFCe.mjs → http-5G18W3NP.mjs} +58 -10
  24. package/dist/{http-CrGuipxe.d.cts → http-BDZeS5om.d.ts} +2 -1
  25. package/dist/{http-aQzN9Ayi.d.ts → http-C87EWkO0.d.cts} +2 -3
  26. package/dist/{http-b__OS_rJ.js → http-Dzy5c472.js} +58 -10
  27. package/dist/{http-DQ25_ruv.cjs → http-W2u_KBoQ.cjs} +57 -9
  28. package/dist/{key-BNp_b9oE.mjs → key-D9dUsyow.mjs} +1 -1
  29. package/dist/{kv-CbLNp3zQ.d.cts → kv-D6hNiMTK.d.ts} +1 -0
  30. package/dist/{kv-cache-DzctboPD.cjs → kv-cache-BygrlQ1c.cjs} +2 -2
  31. package/dist/{kv-cache-D5vjOi5y.js → kv-cache-CBSgxEsZ.js} +2 -2
  32. package/dist/{kv-cache-EaVpV2xQ.mjs → kv-cache-CiiNwT6W.mjs} +1 -1
  33. package/dist/{kv-GFYnFoOl.d.ts → kv-gJ8LYbxX.d.cts} +1 -3
  34. package/dist/{ld-L9w529xq.mjs → ld-hbxDLO1k.mjs} +2 -2
  35. package/dist/{middleware-CTdNwf_s.mjs → middleware-BXnhAGF9.mjs} +188 -114
  36. package/dist/{middleware-CMF242Rg.cjs → middleware-Caj827xW.cjs} +305 -107
  37. package/dist/{middleware-CpCSD43m.mjs → middleware-DZQsPMZb.mjs} +1 -1
  38. package/dist/{middleware-DZNHpEbh.js → middleware-vCF_cKAq.js} +309 -111
  39. package/dist/{mod-CLgIXe9w.d.ts → mod-B0rWmfW5.d.cts} +4 -5
  40. package/dist/{mod-CMEbIaNh.d.cts → mod-BhU_H1I_.d.ts} +4 -3
  41. package/dist/{mod-B8Z8mBLk.d.ts → mod-CLPnQPsv.d.cts} +2 -3
  42. package/dist/{mod-Cr3f-ACa.d.cts → mod-DHO9lk3D.d.ts} +3 -2
  43. package/dist/{mod-CR8soWa9.d.ts → mod-DXY9JF28.d.cts} +3 -4
  44. package/dist/{mod-DClCOv0M.d.cts → mod-Dx3-hqyo.d.ts} +2 -1
  45. package/dist/mod.cjs +4 -4
  46. package/dist/mod.d.cts +9 -8
  47. package/dist/mod.d.ts +9 -10
  48. package/dist/mod.js +9 -9
  49. package/dist/nodeinfo/handler.test.mjs +1 -1
  50. package/dist/nodeinfo/mod.d.cts +2 -1
  51. package/dist/nodeinfo/mod.d.ts +2 -3
  52. package/dist/nodeinfo/mod.js +3 -3
  53. package/dist/otel/mod.d.cts +2 -1
  54. package/dist/otel/mod.d.ts +2 -3
  55. package/dist/otel/mod.js +2 -2
  56. package/dist/{owner-CptqhsOy.d.cts → owner-CnngXDNJ.d.ts} +2 -1
  57. package/dist/{owner-74ARJ5TL.d.ts → owner-DEvZuyOE.d.cts} +2 -3
  58. package/dist/{owner-C30LGgMz.mjs → owner-DwJe0BH9.mjs} +2 -2
  59. package/dist/{proof-zrLeLWgt.cjs → proof-CZCaAURh.cjs} +1 -1
  60. package/dist/{proof-CO1qAbN8.js → proof-DMJJZnKd.js} +2 -2
  61. package/dist/{proof-BjToRsXF.mjs → proof-erpV_J_n.mjs} +2 -2
  62. package/dist/runtime/mod.d.cts +1 -0
  63. package/dist/runtime/mod.d.ts +1 -2
  64. package/dist/runtime/mod.js +3 -3
  65. package/dist/{send-DzbMznU6.mjs → send-BOwz4Hw5.mjs} +127 -3
  66. package/dist/sig/http.test.mjs +120 -2
  67. package/dist/sig/key.test.mjs +1 -1
  68. package/dist/sig/ld.test.mjs +2 -2
  69. package/dist/sig/mod.cjs +2 -2
  70. package/dist/sig/mod.d.cts +4 -3
  71. package/dist/sig/mod.d.ts +4 -5
  72. package/dist/sig/mod.js +4 -4
  73. package/dist/sig/owner.test.mjs +1 -1
  74. package/dist/sig/proof.test.mjs +1 -1
  75. package/dist/{transformers-ve6e2xcg.js → transformers-BGMIq1cs.js} +2 -2
  76. package/dist/{types-hvL8ElAs.js → types-CAY3OdLq.js} +2 -2
  77. package/dist/utils/docloader.test.mjs +2 -2
  78. package/dist/utils/kv-cache.test.mjs +1 -1
  79. package/dist/utils/mod.cjs +1 -1
  80. package/dist/utils/mod.d.cts +2 -1
  81. package/dist/utils/mod.d.ts +2 -3
  82. package/dist/utils/mod.js +3 -3
  83. package/dist/vocab/mod.d.cts +1 -0
  84. package/dist/vocab/mod.d.ts +1 -2
  85. package/dist/vocab/mod.js +2 -2
  86. package/package.json +6 -6
@@ -2,7 +2,7 @@ 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-BxqkYxIf.mjs";
5
+ import { n as version, t as name } from "./deno-DBabeupC.mjs";
6
6
  import { t as ActivityListenerSet } from "./activity-listener-tztVvlNb.mjs";
7
7
  import { getLogger } from "@logtape/logtape";
8
8
  import { Tombstone, getTypeId } from "@fedify/vocab";
@@ -59,7 +59,7 @@ var FederationBuilderImpl = class {
59
59
  this.collectionTypeIds = {};
60
60
  }
61
61
  async build(options) {
62
- const { FederationImpl } = await import("./middleware-CpCSD43m.mjs");
62
+ const { FederationImpl } = await import("./middleware-DZQsPMZb.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
- import "@js-temporal/polyfill";
2
- import "urlpattern-polyfill";
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ import { URLPattern } from "urlpattern-polyfill";
3
3
  //#region \0rolldown/runtime.js
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,3 +1,4 @@
1
+ /// <reference lib="esnext.temporal" />
1
2
  import { GetUserAgentOptions } from "@fedify/vocab-runtime";
2
3
 
3
4
  //#region src/nodeinfo/types.d.ts
@@ -1,5 +1,4 @@
1
- import { Temporal } from "@js-temporal/polyfill";
2
- import { URLPattern } from "urlpattern-polyfill";
1
+ /// <reference lib="esnext.temporal" />
3
2
  import { GetUserAgentOptions } from "@fedify/vocab-runtime";
4
3
 
5
4
  //#region src/nodeinfo/types.d.ts
@@ -1,4 +1,5 @@
1
- import { kt as ActivityTransformer, n as Context } from "../context-BKLGj9QO.cjs";
1
+ /// <reference lib="esnext.temporal" />
2
+ import { kt as ActivityTransformer, n as Context } from "../context-C0C_sRha.cjs";
2
3
  import { Activity } from "@fedify/vocab";
3
4
 
4
5
  //#region src/compat/transformers.d.ts
@@ -1,6 +1,5 @@
1
- import { Temporal } from "@js-temporal/polyfill";
2
- import { URLPattern } from "urlpattern-polyfill";
3
- import { kt as ActivityTransformer, n as Context } from "../context-DrNqYkPw.js";
1
+ /// <reference lib="esnext.temporal" />
2
+ import { kt as ActivityTransformer, n as Context } from "../context-Dqgt8saU.js";
4
3
  import { Activity } from "@fedify/vocab";
5
4
 
6
5
  //#region src/compat/transformers.d.ts
@@ -1,4 +1,4 @@
1
- import "@js-temporal/polyfill";
2
- import "urlpattern-polyfill";
3
- import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "../transformers-ve6e2xcg.js";
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ import { URLPattern } from "urlpattern-polyfill";
3
+ import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "../transformers-BGMIq1cs.js";
4
4
  export { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
@@ -5,7 +5,7 @@ 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
7
  import { t as MemoryKvStore } from "../kv-x2IvBUyq.mjs";
8
- import { n as FederationImpl, v as actorDehydrator, y as autoIdAssigner } from "../middleware-CTdNwf_s.mjs";
8
+ import { n as FederationImpl, v as actorDehydrator, y as autoIdAssigner } from "../middleware-BXnhAGF9.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,13 +1,12 @@
1
- import { Temporal } from "@js-temporal/polyfill";
2
- import { URLPattern } from "urlpattern-polyfill";
3
- import { o as JsonValue, s as NodeInfo, t as GetNodeInfoOptions } from "./client-AtlibPOU.js";
4
- import { o as VerifyRequestFailureReason, t as HttpMessageSignaturesSpec } from "./http-aQzN9Ayi.js";
5
- import { n as GetKeyOwnerOptions } from "./owner-74ARJ5TL.js";
6
- import { n as KvStore, t as KvKey } from "./kv-GFYnFoOl.js";
1
+ /// <reference lib="esnext.temporal" />
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";
4
+ import { n as GetKeyOwnerOptions } from "./owner-DEvZuyOE.cjs";
5
+ import { n as KvStore, t as KvKey } from "./kv-gJ8LYbxX.cjs";
7
6
  import { Activity, Actor, Collection, CryptographicKey, Hashtag, Link, LookupObjectOptions, Multikey, Object as Object$1, Recipient, Tombstone, TraverseCollectionOptions } from "@fedify/vocab";
8
- import { MeterProvider, Span, Tracer, TracerProvider } from "@opentelemetry/api";
9
7
  import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, GetUserAgentOptions } from "@fedify/vocab-runtime";
10
8
  import { Link as Link$1, LookupWebFingerOptions, ResourceDescriptor } from "@fedify/webfinger";
9
+ import { MeterProvider, Span, Tracer, TracerProvider } from "@opentelemetry/api";
11
10
 
12
11
  //#region src/compat/types.d.ts
13
12
  /**
@@ -1,11 +1,12 @@
1
- import { o as JsonValue, s as NodeInfo, t as GetNodeInfoOptions } from "./client-z-8dc-e1.cjs";
2
- import { o as VerifyRequestFailureReason, t as HttpMessageSignaturesSpec } from "./http-CrGuipxe.cjs";
3
- import { n as GetKeyOwnerOptions } from "./owner-CptqhsOy.cjs";
4
- import { n as KvStore, t as KvKey } from "./kv-CbLNp3zQ.cjs";
1
+ /// <reference lib="esnext.temporal" />
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";
4
+ import { n as GetKeyOwnerOptions } from "./owner-CnngXDNJ.js";
5
+ import { n as KvStore, t as KvKey } from "./kv-D6hNiMTK.js";
5
6
  import { Activity, Actor, Collection, CryptographicKey, Hashtag, Link, LookupObjectOptions, Multikey, Object as Object$1, Recipient, Tombstone, TraverseCollectionOptions } from "@fedify/vocab";
7
+ import { MeterProvider, Span, Tracer, TracerProvider } from "@opentelemetry/api";
6
8
  import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, GetUserAgentOptions } from "@fedify/vocab-runtime";
7
9
  import { Link as Link$1, LookupWebFingerOptions, ResourceDescriptor } from "@fedify/webfinger";
8
- import { MeterProvider, Span, Tracer, TracerProvider } from "@opentelemetry/api";
9
10
 
10
11
  //#region src/compat/types.d.ts
11
12
  /**
@@ -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.1079+36ac23d1";
6
+ var version = "2.3.0-dev.1099+fafcfa78";
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-BNp_b9oE.mjs";
5
- import { n as doubleKnock } from "./http-DM4ZAFCe.mjs";
4
+ import { o as validateCryptoKey } from "./key-D9dUsyow.mjs";
5
+ import { n as doubleKnock } from "./http-5G18W3NP.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";
@@ -6,7 +6,7 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
6
6
  import { i as assertExists } from "../std__assert-CRDpx_HF.mjs";
7
7
  import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
8
8
  import { t as MemoryKvStore } from "../kv-x2IvBUyq.mjs";
9
- import { r as createFederationBuilder } from "../builder-DqT-OPZ8.mjs";
9
+ import { r as createFederationBuilder } from "../builder-BkRRjxzb.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
@@ -7,10 +7,10 @@ import { r as assertGreaterOrEqual } from "../std__assert-CRDpx_HF.mjs";
7
7
  import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
8
8
  import { t as assert } from "../assert-DikXweDx.mjs";
9
9
  import { r as parseAcceptSignature } from "../accept-CceiKpCy.mjs";
10
- import { s as signRequest } from "../http-DM4ZAFCe.mjs";
10
+ import { s as signRequest } from "../http-5G18W3NP.mjs";
11
11
  import { a as rsaPrivateKey3, c as rsaPublicKey3, s as rsaPublicKey2 } from "../keys-C3kae-6B.mjs";
12
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-CTdNwf_s.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-BXnhAGF9.mjs";
14
14
  import { t as ActivityListenerSet } from "../activity-listener-tztVvlNb.mjs";
15
15
  import { Activity, Create, Note, Person, Tombstone } from "@fedify/vocab";
16
16
  import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
@@ -2001,6 +2001,88 @@ test("handleInbox() records OpenTelemetry span events", async () => {
2001
2001
  assertGreaterOrEqual(durations[0].value, 0);
2002
2002
  assertEquals(durations[0].attributes["activitypub.activity.type"], "https://www.w3.org/ns/activitystreams#Create");
2003
2003
  });
2004
+ test("handleInbox() records fedify.queue.task.enqueued when queued", async () => {
2005
+ const [meterProvider, recorder] = createTestMeterProvider();
2006
+ const kv = new MemoryKvStore();
2007
+ const federation = createFederation({
2008
+ kv,
2009
+ meterProvider
2010
+ });
2011
+ const activity = new Create({
2012
+ id: new URL("https://example.com/activities/queued"),
2013
+ actor: new URL("https://example.com/users/someone"),
2014
+ object: new Note({
2015
+ id: new URL("https://example.com/note-queued"),
2016
+ content: "Queue me up"
2017
+ })
2018
+ });
2019
+ const signed = await signRequest(new Request("https://example.com/users/someone/inbox", {
2020
+ method: "POST",
2021
+ headers: { "Content-Type": "application/activity+json" },
2022
+ body: JSON.stringify(await activity.toJsonLd())
2023
+ }), rsaPrivateKey3, new URL("https://example.com/users/someone#main-key"));
2024
+ const context = createRequestContext({
2025
+ federation,
2026
+ request: signed,
2027
+ url: new URL(signed.url),
2028
+ data: void 0,
2029
+ documentLoader: mockDocumentLoader,
2030
+ contextLoader: mockDocumentLoader,
2031
+ getActorUri(identifier) {
2032
+ return new URL(`https://example.com/users/${identifier}`);
2033
+ }
2034
+ });
2035
+ const actorDispatcher = (ctx, identifier) => {
2036
+ if (identifier !== "someone") return null;
2037
+ return new Person({
2038
+ id: ctx.getActorUri(identifier),
2039
+ name: "Someone",
2040
+ inbox: new URL("https://example.com/users/someone/inbox"),
2041
+ publicKey: rsaPublicKey2
2042
+ });
2043
+ };
2044
+ const queuedMessages = [];
2045
+ assertEquals((await handleInbox(signed, {
2046
+ recipient: "someone",
2047
+ context,
2048
+ inboxContextFactory(_activity) {
2049
+ return createInboxContext({
2050
+ ...context,
2051
+ clone: void 0
2052
+ });
2053
+ },
2054
+ kv,
2055
+ kvPrefixes: {
2056
+ activityIdempotence: ["activityIdempotence"],
2057
+ publicKey: ["publicKey"],
2058
+ acceptSignatureNonce: ["acceptSignatureNonce"]
2059
+ },
2060
+ actorDispatcher,
2061
+ inboxListeners: new ActivityListenerSet(),
2062
+ inboxErrorHandler: void 0,
2063
+ onNotFound: (_request) => new Response("Not found", { status: 404 }),
2064
+ signatureTimeWindow: false,
2065
+ skipSignatureVerification: true,
2066
+ queue: {
2067
+ enqueue(message, _options) {
2068
+ queuedMessages.push(message);
2069
+ return Promise.resolve();
2070
+ },
2071
+ listen(_handler, _options) {
2072
+ return Promise.resolve();
2073
+ }
2074
+ },
2075
+ meterProvider
2076
+ })).status, 202);
2077
+ assertEquals(queuedMessages.length, 1);
2078
+ const enqueued = recorder.getMeasurements("fedify.queue.task.enqueued");
2079
+ assertEquals(enqueued.length, 1);
2080
+ assertEquals(enqueued[0].type, "counter");
2081
+ assertEquals(enqueued[0].attributes["fedify.queue.role"], "inbox");
2082
+ assertEquals(enqueued[0].attributes["fedify.queue.task.attempt"], 0);
2083
+ assertEquals(enqueued[0].attributes["activitypub.activity.type"], "https://www.w3.org/ns/activitystreams#Create");
2084
+ assertEquals(enqueued[0].attributes["fedify.queue.backend"], void 0);
2085
+ });
2004
2086
  test("handleInbox() records unverified HTTP signature details", async () => {
2005
2087
  const [tracerProvider, exporter] = createTestTracerProvider();
2006
2088
  const [meterProvider, recorder] = createTestMeterProvider();
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import "../std__assert-CRDpx_HF.mjs";
6
6
  import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-C3kae-6B.mjs";
7
- import { r as signObject } from "../proof-BjToRsXF.mjs";
7
+ import { r as signObject } from "../proof-erpV_J_n.mjs";
8
8
  import { t as MemoryKvStore } from "../kv-x2IvBUyq.mjs";
9
- import { o as createFederation } from "../middleware-CTdNwf_s.mjs";
9
+ import { o as createFederation } from "../middleware-BXnhAGF9.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