@fedify/fedify 2.4.0-dev.1488 → 2.4.0-dev.1504

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 (109) hide show
  1. package/README.md +3 -4
  2. package/dist/{assert-OguE97r2.mjs → assert-DvVHoIZ0.mjs} +1 -1
  3. package/dist/{assert_instance_of-DBC5X09g.mjs → assert_instance_of-CxoC8bVq.mjs} +1 -1
  4. package/dist/{assert_not_equals-DkVK8oqV.mjs → assert_not_equals-C8vcTTA3.mjs} +1 -1
  5. package/dist/{assert_rejects-DN60FHPX.mjs → assert_rejects-DAdaaIWM.mjs} +2 -2
  6. package/dist/{assert_strict_equals-XEgZAlrj.mjs → assert_strict_equals-BzqyKuYL.mjs} +1 -1
  7. package/dist/{assert_throws-BOkhLGYc.mjs → assert_throws-zN79lgIC.mjs} +1 -1
  8. package/dist/{builder-Dcr6y6XD.mjs → builder-Ck0Fl_a5.mjs} +23 -3
  9. package/dist/codec-CmlPqjNX.mjs +103 -0
  10. package/dist/compat/mod.d.cts +1 -1
  11. package/dist/compat/mod.d.ts +1 -1
  12. package/dist/compat/outgoing-jsonld.test.mjs +3 -3
  13. package/dist/compat/public-audience.test.mjs +3 -3
  14. package/dist/compat/transformers.test.mjs +5 -5
  15. package/dist/{context-DVoTs_wM.mjs → context-BBRTgkrs.mjs} +8 -2
  16. package/dist/{context-BU6jSQdo.d.ts → context-BF5B4ZDk.d.ts} +529 -259
  17. package/dist/{context-BBVLF7lx.d.cts → context-CYF8X0ft.d.cts} +530 -259
  18. package/dist/{deno-BCFGf8NR.mjs → deno-D3gb4X9v.mjs} +1 -1
  19. package/dist/{docloader-DWEwaGqF.mjs → docloader-DUKu0GzG.mjs} +3 -3
  20. package/dist/federation/builder.test.mjs +5 -5
  21. package/dist/federation/circuit-breaker.test.mjs +5 -5
  22. package/dist/federation/collection.test.mjs +3 -3
  23. package/dist/federation/handler.test.mjs +13 -13
  24. package/dist/federation/idempotency.test.mjs +6 -6
  25. package/dist/federation/inbox.test.mjs +3 -3
  26. package/dist/federation/keycache.test.mjs +5 -5
  27. package/dist/federation/kv.test.mjs +3 -3
  28. package/dist/federation/metrics.test.mjs +4 -4
  29. package/dist/federation/middleware.test.mjs +200 -19
  30. package/dist/federation/mod.cjs +3 -259
  31. package/dist/federation/mod.d.cts +4 -4
  32. package/dist/federation/mod.d.ts +4 -4
  33. package/dist/federation/mod.js +1 -257
  34. package/dist/federation/mq.test.mjs +103 -261
  35. package/dist/federation/negotiation.test.mjs +4 -4
  36. package/dist/federation/retry.test.mjs +3 -3
  37. package/dist/federation/router.test.mjs +5 -5
  38. package/dist/federation/send.test.mjs +10 -10
  39. package/dist/federation/tasks/codec.test.d.mts +2 -0
  40. package/dist/federation/tasks/codec.test.mjs +292 -0
  41. package/dist/federation/tasks/enqueue.test.d.mts +2 -0
  42. package/dist/federation/tasks/enqueue.test.mjs +992 -0
  43. package/dist/federation/tasks/tasks.test.d.mts +2 -0
  44. package/dist/federation/tasks/tasks.test.mjs +555 -0
  45. package/dist/federation/temporal.test.mjs +4 -4
  46. package/dist/federation/webfinger.test.mjs +6 -6
  47. package/dist/{http-RriziGDE.mjs → http-BNFQkiEZ.mjs} +4 -4
  48. package/dist/{http-DaVoLyyA.js → http-CrZzUAtV.js} +7 -17
  49. package/dist/{http-DLqxhQg1.cjs → http-D9p2_d2X.cjs} +7 -17
  50. package/dist/{key-Bkg8Zg36.mjs → key-BM_SRwBV.mjs} +8 -18
  51. package/dist/{kv-cache-BR--9V4L.mjs → kv-cache-BE1QIPdL.mjs} +1 -1
  52. package/dist/{kv-cache-DxlFLMiU.js → kv-cache-Ch_Zv5Yq.js} +1 -1
  53. package/dist/{kv-cache-Fw-iwKjy.cjs → kv-cache-Cna211RR.cjs} +1 -1
  54. package/dist/{ld-BjsmbqO7.mjs → ld-ubkf03eb.mjs} +3 -3
  55. package/dist/{metrics-BLoa2pab.mjs → metrics-BXR36qzu.mjs} +1 -1
  56. package/dist/{middleware-V-r1QH5Z.cjs → middleware-DUNeIkXN.cjs} +694 -51
  57. package/dist/{middleware-D3kuDjvb.mjs → middleware-iP9VRMus.mjs} +310 -67
  58. package/dist/{middleware-_9t5HVBi.js → middleware-lB4vtShP.js} +683 -52
  59. package/dist/{middleware-DNR3YBCi.mjs → middleware-pzCP79He.mjs} +1 -1
  60. package/dist/{mod-vPYVoa5n.d.ts → mod-4WGAuR6X.d.ts} +1 -1
  61. package/dist/{mod-C0F6kvgS.d.cts → mod-BHEB3xhE.d.cts} +1 -1
  62. package/dist/mod.cjs +6 -6
  63. package/dist/mod.d.cts +5 -5
  64. package/dist/mod.d.ts +5 -5
  65. package/dist/mod.js +5 -5
  66. package/dist/mq-03vS-C9P.mjs +276 -0
  67. package/dist/{mq-D8uSFzxe.d.cts → mq-B5_hohs7.d.ts} +34 -0
  68. package/dist/{mq-D-nlpY04.d.ts → mq-DXMt_qCY.d.cts} +34 -0
  69. package/dist/nodeinfo/client.test.mjs +3 -3
  70. package/dist/nodeinfo/handler.test.mjs +5 -5
  71. package/dist/nodeinfo/types.test.mjs +4 -4
  72. package/dist/otel/exporter.test.mjs +3 -3
  73. package/dist/{outgoing-jsonld-L_DbOaFe.mjs → outgoing-jsonld-BNL8AC14.mjs} +1 -1
  74. package/dist/{owner-NK2p1ihR.mjs → owner-Bf1KkncT.mjs} +2 -2
  75. package/dist/{proof-D7WVwQzs.js → proof-BMcsi8q_.js} +1 -1
  76. package/dist/{proof-CRXqo703.mjs → proof-Q781Ks5q.mjs} +5 -5
  77. package/dist/{proof-2WI6mMbC.cjs → proof-yeAU1MyT.cjs} +1 -1
  78. package/dist/{send-CTaPzl8L.mjs → send-DFV0S_n9.mjs} +3 -3
  79. package/dist/sig/accept.test.mjs +1 -1
  80. package/dist/sig/http.test.mjs +8 -8
  81. package/dist/sig/key.test.mjs +6 -56
  82. package/dist/sig/ld.test.mjs +7 -7
  83. package/dist/sig/mod.cjs +2 -2
  84. package/dist/sig/mod.js +2 -2
  85. package/dist/sig/owner.test.mjs +6 -6
  86. package/dist/sig/proof.test.mjs +8 -8
  87. package/dist/{std__assert-BBjXFNOb.mjs → std__assert-Dh6uLf_q.mjs} +4 -4
  88. package/dist/{temporal-C8M0Y7v9.mjs → temporal-CyOjsqPj.mjs} +1 -1
  89. package/dist/testing/mod.d.mts +1037 -8
  90. package/dist/testing/mod.mjs +3 -2
  91. package/dist/testing-Dy-WhqpN.mjs +77 -0
  92. package/dist/utils/docloader.test.mjs +6 -6
  93. package/dist/utils/kv-cache.test.mjs +1 -1
  94. package/dist/utils/mod.cjs +1 -1
  95. package/dist/utils/mod.js +1 -1
  96. package/package.json +13 -8
  97. /package/dist/{accept-CPkZzmGN.mjs → accept-CgDcxvjV.mjs} +0 -0
  98. /package/dist/{activity-listener-tztVvlNb.mjs → activity-listener-BeTGV3wc.mjs} +0 -0
  99. /package/dist/{assert_equals-C-ZRDbaf.mjs → assert_equals-PBVKNMJd.mjs} +0 -0
  100. /package/dist/{circuit-breaker-CSWsyoef.mjs → circuit-breaker-hJBB6jwA.mjs} +0 -0
  101. /package/dist/{client-ByXmQhYD.mjs → client-B_A6mfn3.mjs} +0 -0
  102. /package/dist/{collection-Cc3DVAhE.mjs → collection-Dp5ky45w.mjs} +0 -0
  103. /package/dist/{keycache-BeU0LCII.mjs → keycache-CaOR6NYg.mjs} +0 -0
  104. /package/dist/{keys-DGu1NFwu.mjs → keys-CSYsOMFG.mjs} +0 -0
  105. /package/dist/{kv-rV3vodCc.mjs → kv-CIvR3Non.mjs} +0 -0
  106. /package/dist/{negotiation-DDstyBvc.mjs → negotiation-m_L2nyS3.mjs} +0 -0
  107. /package/dist/{public-audience-Cvbr2Gzt.mjs → public-audience-c9zmYKgA.mjs} +0 -0
  108. /package/dist/{retry-CXg_MBI-.mjs → retry-DI4O-zYl.mjs} +0 -0
  109. /package/dist/{types-J53Kw7so.mjs → types-BFowWFTT.mjs} +0 -0
@@ -1,5 +1,6 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { i as testDefinitions, n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-DVoTs_wM.mjs";
5
- export { createInboxContext, createOutboxContext, createRequestContext, testDefinitions };
4
+ import { a as testDefinitions, n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-BBRTgkrs.mjs";
5
+ import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, r as envelopeSchema, t as MockQueue } from "../testing-Dy-WhqpN.mjs";
6
+ export { MockQueue, baseOptions, createInboxContext, createOutboxContext, createRequestContext, envelopeSchema, makeSchema, numberSchema, stringSchema, testDefinitions };
@@ -0,0 +1,77 @@
1
+ import "@js-temporal/polyfill";
2
+ import "urlpattern-polyfill";
3
+ globalThis.addEventListener = () => {};
4
+ import { i as mockDocumentLoader } from "./context-BBRTgkrs.mjs";
5
+ import { t as MemoryKvStore } from "./kv-CIvR3Non.mjs";
6
+ import { Note } from "@fedify/vocab";
7
+ //#region src/testing/tasks.ts
8
+ /**
9
+ * Test-only utilities shared by the task suites: the schema factory and stock
10
+ * schemas, the base federation options, and the recording {@link MockQueue}.
11
+ *
12
+ * These helpers live beside the suites that use them rather than in a shared
13
+ * package because {@link MockQueue} needs the package-internal
14
+ * {@link TaskMessage} type, and *deno.json*'s `publish.exclude` keeps this
15
+ * module out of the published sources.
16
+ *
17
+ * @module
18
+ */
19
+ /** Federation options (sans `queue`) shared by the task suites. */
20
+ const baseOptions = {
21
+ kv: new MemoryKvStore(),
22
+ documentLoaderFactory: () => mockDocumentLoader,
23
+ contextLoaderFactory: () => mockDocumentLoader,
24
+ manuallyStartQueue: true
25
+ };
26
+ /**
27
+ * Builds a minimal [Standard Schema](https://standardschema.dev/) from a type
28
+ * guard, for use as a task payload schema in tests.
29
+ */
30
+ const makeSchema = (check) => ({ "~standard": {
31
+ version: 1,
32
+ vendor: "fedify-test",
33
+ validate: (value) => check(value) ? { value } : { issues: [{ message: "Invalid task data." }] }
34
+ } });
35
+ const stringSchema = makeSchema((d) => typeof d === "string");
36
+ const numberSchema = makeSchema((d) => typeof d === "number");
37
+ const envelopeSchema = makeSchema((data) => typeof data === "object" && data != null && data.note instanceof Note && typeof data.title === "string");
38
+ /**
39
+ * An in-memory {@link MessageQueue} that records task enqueues for assertions
40
+ * instead of delivering anything. Its {@link listen} resolves only when the
41
+ * abort signal fires.
42
+ */
43
+ var MockQueue = class {
44
+ nativeRetrial;
45
+ nativeDeduplication;
46
+ enqueued = [];
47
+ enqueuedMany = [];
48
+ listenCount = 0;
49
+ enqueueMany;
50
+ constructor(options = {}) {
51
+ this.nativeRetrial = options.nativeRetrial ?? false;
52
+ this.nativeDeduplication = options.nativeDeduplication ?? false;
53
+ if (options.supportsEnqueueMany) this.enqueueMany = (messages, opts) => {
54
+ this.enqueuedMany.push({
55
+ messages,
56
+ options: opts
57
+ });
58
+ return Promise.resolve();
59
+ };
60
+ }
61
+ enqueue(message, options) {
62
+ this.enqueued.push({
63
+ message,
64
+ options
65
+ });
66
+ return Promise.resolve();
67
+ }
68
+ listen(_handler, options) {
69
+ this.listenCount++;
70
+ if (options?.signal?.aborted) return Promise.resolve();
71
+ return new Promise((resolve) => {
72
+ options?.signal?.addEventListener("abort", () => resolve(), { once: true });
73
+ });
74
+ }
75
+ };
76
+ //#endregion
77
+ export { numberSchema as a, makeSchema as i, baseOptions as n, stringSchema as o, envelopeSchema as r, MockQueue as t };
@@ -2,12 +2,12 @@ import { Temporal } from "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as esm_default } from "../esm-vrlUxr60.mjs";
5
- import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
6
- import "../std__assert-BBjXFNOb.mjs";
7
- import { t as assertRejects } from "../assert_rejects-DN60FHPX.mjs";
8
- import { l as verifyRequest } from "../http-RriziGDE.mjs";
9
- import { i as rsaPrivateKey2 } from "../keys-DGu1NFwu.mjs";
10
- import { t as getAuthenticatedDocumentLoader } from "../docloader-DWEwaGqF.mjs";
5
+ import { t as assertEquals } from "../assert_equals-PBVKNMJd.mjs";
6
+ import "../std__assert-Dh6uLf_q.mjs";
7
+ import { t as assertRejects } from "../assert_rejects-DAdaaIWM.mjs";
8
+ import { l as verifyRequest } from "../http-BNFQkiEZ.mjs";
9
+ import { i as rsaPrivateKey2 } from "../keys-CSYsOMFG.mjs";
10
+ import { t as getAuthenticatedDocumentLoader } from "../docloader-DUKu0GzG.mjs";
11
11
  import { mockDocumentLoader, test } from "@fedify/fixture";
12
12
  import { UrlError } from "@fedify/vocab-runtime";
13
13
  //#region src/utils/docloader.test.ts
@@ -1,7 +1,7 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as kvCache, t as MockKvStore } from "../kv-cache-BR--9V4L.mjs";
4
+ import { n as kvCache, t as MockKvStore } from "../kv-cache-BE1QIPdL.mjs";
5
5
  import { deepStrictEqual, throws } from "node:assert";
6
6
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
7
7
  import { preloadedContexts } from "@fedify/vocab-runtime";
@@ -1,6 +1,6 @@
1
1
  const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const require_kv_cache = require("../kv-cache-Fw-iwKjy.cjs");
4
+ const require_kv_cache = require("../kv-cache-Cna211RR.cjs");
5
5
  exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
6
6
  exports.kvCache = require_kv_cache.kvCache;
package/dist/utils/mod.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-DxlFLMiU.js";
3
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-Ch_Zv5Yq.js";
4
4
  export { getAuthenticatedDocumentLoader, kvCache };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "2.4.0-dev.1488+a9fe1094",
3
+ "version": "2.4.0-dev.1504+756217cc",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -21,7 +21,10 @@
21
21
  "bugs": {
22
22
  "url": "https://github.com/fedify-dev/fedify/issues"
23
23
  },
24
- "funding": "https://opencollective.com/fedify",
24
+ "funding": [
25
+ "https://opencollective.com/fedify",
26
+ "https://github.com/sponsors/dahlia"
27
+ ],
25
28
  "engines": {
26
29
  "deno": ">=2.0.0",
27
30
  "node": ">=22.0.0",
@@ -143,16 +146,18 @@
143
146
  "@opentelemetry/sdk-metrics": "2.7.1",
144
147
  "@opentelemetry/sdk-trace-base": "^2.7.1",
145
148
  "@opentelemetry/semantic-conventions": "^1.40.0",
149
+ "@standard-schema/spec": "^1.1.0",
146
150
  "byte-encodings": "^1.0.11",
151
+ "devalue": "^5.8.1",
147
152
  "es-toolkit": "1.46.1",
148
153
  "json-canon": "^1.0.1",
149
154
  "jsonld": "^9.0.0",
150
155
  "structured-field-values": "^2.0.4",
151
156
  "urlpattern-polyfill": "^10.1.0",
152
- "@fedify/webfinger": "2.4.0-dev.1488+a9fe1094",
153
- "@fedify/vocab-runtime": "2.4.0-dev.1488+a9fe1094",
154
- "@fedify/uri-template": "2.4.0-dev.1488+a9fe1094",
155
- "@fedify/vocab": "2.4.0-dev.1488+a9fe1094"
157
+ "@fedify/uri-template": "2.4.0-dev.1504+756217cc",
158
+ "@fedify/vocab": "2.4.0-dev.1504+756217cc",
159
+ "@fedify/webfinger": "2.4.0-dev.1504+756217cc",
160
+ "@fedify/vocab-runtime": "2.4.0-dev.1504+756217cc"
156
161
  },
157
162
  "devDependencies": {
158
163
  "@std/assert": "npm:@jsr/std__assert@^0.226.0",
@@ -164,8 +169,8 @@
164
169
  "tsx": "^4.21.0",
165
170
  "typescript": "^6.0.0",
166
171
  "wrangler": "^4.17.0",
167
- "@fedify/vocab-tools": "^2.4.0-dev.1488+a9fe1094",
168
- "@fedify/fixture": "2.0.0"
172
+ "@fedify/fixture": "2.0.0",
173
+ "@fedify/vocab-tools": "^2.4.0-dev.1504+756217cc"
169
174
  },
170
175
  "scripts": {
171
176
  "build:self": "tsdown",
File without changes
File without changes
File without changes
File without changes