@fedify/fedify 2.4.0-dev.1490 → 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.
- package/README.md +3 -4
- package/dist/{assert-OguE97r2.mjs → assert-DvVHoIZ0.mjs} +1 -1
- package/dist/{assert_instance_of-DBC5X09g.mjs → assert_instance_of-CxoC8bVq.mjs} +1 -1
- package/dist/{assert_not_equals-DkVK8oqV.mjs → assert_not_equals-C8vcTTA3.mjs} +1 -1
- package/dist/{assert_rejects-DN60FHPX.mjs → assert_rejects-DAdaaIWM.mjs} +2 -2
- package/dist/{assert_strict_equals-XEgZAlrj.mjs → assert_strict_equals-BzqyKuYL.mjs} +1 -1
- package/dist/{assert_throws-BOkhLGYc.mjs → assert_throws-zN79lgIC.mjs} +1 -1
- package/dist/{builder-CwwQRArg.mjs → builder-Ck0Fl_a5.mjs} +23 -3
- package/dist/codec-CmlPqjNX.mjs +103 -0
- package/dist/compat/mod.d.cts +1 -1
- package/dist/compat/mod.d.ts +1 -1
- package/dist/compat/outgoing-jsonld.test.mjs +3 -3
- package/dist/compat/public-audience.test.mjs +3 -3
- package/dist/compat/transformers.test.mjs +5 -5
- package/dist/{context-DVoTs_wM.mjs → context-BBRTgkrs.mjs} +8 -2
- package/dist/{context-BU6jSQdo.d.ts → context-BF5B4ZDk.d.ts} +529 -259
- package/dist/{context-BBVLF7lx.d.cts → context-CYF8X0ft.d.cts} +530 -259
- package/dist/{deno-Yohf1ISx.mjs → deno-D3gb4X9v.mjs} +1 -1
- package/dist/{docloader-B6DFWEOx.mjs → docloader-DUKu0GzG.mjs} +3 -3
- package/dist/federation/builder.test.mjs +5 -5
- package/dist/federation/circuit-breaker.test.mjs +5 -5
- package/dist/federation/collection.test.mjs +3 -3
- package/dist/federation/handler.test.mjs +13 -13
- package/dist/federation/idempotency.test.mjs +6 -6
- package/dist/federation/inbox.test.mjs +3 -3
- package/dist/federation/keycache.test.mjs +5 -5
- package/dist/federation/kv.test.mjs +3 -3
- package/dist/federation/metrics.test.mjs +4 -4
- package/dist/federation/middleware.test.mjs +200 -19
- package/dist/federation/mod.cjs +3 -259
- package/dist/federation/mod.d.cts +4 -4
- package/dist/federation/mod.d.ts +4 -4
- package/dist/federation/mod.js +1 -257
- package/dist/federation/mq.test.mjs +103 -261
- package/dist/federation/negotiation.test.mjs +4 -4
- package/dist/federation/retry.test.mjs +3 -3
- package/dist/federation/router.test.mjs +5 -5
- package/dist/federation/send.test.mjs +10 -10
- package/dist/federation/tasks/codec.test.d.mts +2 -0
- package/dist/federation/tasks/codec.test.mjs +292 -0
- package/dist/federation/tasks/enqueue.test.d.mts +2 -0
- package/dist/federation/tasks/enqueue.test.mjs +992 -0
- package/dist/federation/tasks/tasks.test.d.mts +2 -0
- package/dist/federation/tasks/tasks.test.mjs +555 -0
- package/dist/federation/temporal.test.mjs +4 -4
- package/dist/federation/webfinger.test.mjs +6 -6
- package/dist/{http-BeDlAH97.mjs → http-BNFQkiEZ.mjs} +4 -4
- package/dist/{http-BqSm-f2G.js → http-CrZzUAtV.js} +7 -17
- package/dist/{http-C3eJp_Ha.cjs → http-D9p2_d2X.cjs} +7 -17
- package/dist/{key-DNBTcjuV.mjs → key-BM_SRwBV.mjs} +8 -18
- package/dist/{kv-cache-b2HaCLC-.mjs → kv-cache-BE1QIPdL.mjs} +1 -1
- package/dist/{kv-cache-Crq8nvSV.js → kv-cache-Ch_Zv5Yq.js} +1 -1
- package/dist/{kv-cache-CGJMNSs-.cjs → kv-cache-Cna211RR.cjs} +1 -1
- package/dist/{ld-CQlFhsU6.mjs → ld-ubkf03eb.mjs} +3 -3
- package/dist/{metrics-B6RKtTLt.mjs → metrics-BXR36qzu.mjs} +1 -1
- package/dist/{middleware-CBM9vGYg.cjs → middleware-DUNeIkXN.cjs} +694 -51
- package/dist/{middleware-CsxoclmN.mjs → middleware-iP9VRMus.mjs} +310 -67
- package/dist/{middleware-B3vFLcCh.js → middleware-lB4vtShP.js} +683 -52
- package/dist/{middleware-CQygcRYE.mjs → middleware-pzCP79He.mjs} +1 -1
- package/dist/{mod-vPYVoa5n.d.ts → mod-4WGAuR6X.d.ts} +1 -1
- package/dist/{mod-C0F6kvgS.d.cts → mod-BHEB3xhE.d.cts} +1 -1
- package/dist/mod.cjs +6 -6
- package/dist/mod.d.cts +5 -5
- package/dist/mod.d.ts +5 -5
- package/dist/mod.js +5 -5
- package/dist/mq-03vS-C9P.mjs +276 -0
- package/dist/{mq-D8uSFzxe.d.cts → mq-B5_hohs7.d.ts} +34 -0
- package/dist/{mq-D-nlpY04.d.ts → mq-DXMt_qCY.d.cts} +34 -0
- package/dist/nodeinfo/client.test.mjs +3 -3
- package/dist/nodeinfo/handler.test.mjs +5 -5
- package/dist/nodeinfo/types.test.mjs +4 -4
- package/dist/otel/exporter.test.mjs +3 -3
- package/dist/{outgoing-jsonld-L_DbOaFe.mjs → outgoing-jsonld-BNL8AC14.mjs} +1 -1
- package/dist/{owner-B1FnbZ1w.mjs → owner-Bf1KkncT.mjs} +2 -2
- package/dist/{proof-BhNTn0HE.js → proof-BMcsi8q_.js} +1 -1
- package/dist/{proof-BUuvq0ia.mjs → proof-Q781Ks5q.mjs} +5 -5
- package/dist/{proof-ChmZL5rY.cjs → proof-yeAU1MyT.cjs} +1 -1
- package/dist/{send-Dq-Ofquk.mjs → send-DFV0S_n9.mjs} +3 -3
- package/dist/sig/accept.test.mjs +1 -1
- package/dist/sig/http.test.mjs +8 -8
- package/dist/sig/key.test.mjs +6 -56
- package/dist/sig/ld.test.mjs +7 -7
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +6 -6
- package/dist/sig/proof.test.mjs +8 -8
- package/dist/{std__assert-BBjXFNOb.mjs → std__assert-Dh6uLf_q.mjs} +4 -4
- package/dist/{temporal-C-vrfOld.mjs → temporal-CyOjsqPj.mjs} +1 -1
- package/dist/testing/mod.d.mts +1037 -8
- package/dist/testing/mod.mjs +3 -2
- package/dist/testing-Dy-WhqpN.mjs +77 -0
- package/dist/utils/docloader.test.mjs +6 -6
- package/dist/utils/kv-cache.test.mjs +1 -1
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +12 -7
- /package/dist/{accept-CPkZzmGN.mjs → accept-CgDcxvjV.mjs} +0 -0
- /package/dist/{activity-listener-tztVvlNb.mjs → activity-listener-BeTGV3wc.mjs} +0 -0
- /package/dist/{assert_equals-C-ZRDbaf.mjs → assert_equals-PBVKNMJd.mjs} +0 -0
- /package/dist/{circuit-breaker-CSWsyoef.mjs → circuit-breaker-hJBB6jwA.mjs} +0 -0
- /package/dist/{client-ByXmQhYD.mjs → client-B_A6mfn3.mjs} +0 -0
- /package/dist/{collection-Cc3DVAhE.mjs → collection-Dp5ky45w.mjs} +0 -0
- /package/dist/{keycache-BeU0LCII.mjs → keycache-CaOR6NYg.mjs} +0 -0
- /package/dist/{keys-DGu1NFwu.mjs → keys-CSYsOMFG.mjs} +0 -0
- /package/dist/{kv-rV3vodCc.mjs → kv-CIvR3Non.mjs} +0 -0
- /package/dist/{negotiation-DDstyBvc.mjs → negotiation-m_L2nyS3.mjs} +0 -0
- /package/dist/{public-audience-Cvbr2Gzt.mjs → public-audience-c9zmYKgA.mjs} +0 -0
- /package/dist/{retry-CXg_MBI-.mjs → retry-DI4O-zYl.mjs} +0 -0
- /package/dist/{types-J53Kw7so.mjs → types-BFowWFTT.mjs} +0 -0
package/dist/testing/mod.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import {
|
|
5
|
-
|
|
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-
|
|
6
|
-
import "../std__assert-
|
|
7
|
-
import { t as assertRejects } from "../assert_rejects-
|
|
8
|
-
import { l as verifyRequest } from "../http-
|
|
9
|
-
import { i as rsaPrivateKey2 } from "../keys-
|
|
10
|
-
import { t as getAuthenticatedDocumentLoader } from "../docloader-
|
|
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-
|
|
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";
|
package/dist/utils/mod.cjs
CHANGED
|
@@ -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-
|
|
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-
|
|
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.
|
|
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":
|
|
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/uri-template": "2.4.0-dev.
|
|
153
|
-
"@fedify/vocab": "2.4.0-dev.
|
|
154
|
-
"@fedify/
|
|
155
|
-
"@fedify/
|
|
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",
|
|
@@ -165,7 +170,7 @@
|
|
|
165
170
|
"typescript": "^6.0.0",
|
|
166
171
|
"wrangler": "^4.17.0",
|
|
167
172
|
"@fedify/fixture": "2.0.0",
|
|
168
|
-
"@fedify/vocab-tools": "^2.4.0-dev.
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|