@fedify/fedify 2.4.0-dev.1490 → 2.4.0-dev.1508
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 +7 -5
- 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-DlWCek6Z.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-nexucTAX.mjs} +1 -1
- package/dist/{docloader-B6DFWEOx.mjs → docloader-DAdEN549.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-C3eJp_Ha.cjs → http-BCj9dlA_.cjs} +1 -1
- package/dist/{http-BqSm-f2G.js → http-Dv3147TL.js} +1 -1
- package/dist/{http-BeDlAH97.mjs → http-inQqS3yx.mjs} +4 -4
- package/dist/{key-DNBTcjuV.mjs → key-CGrr6-I2.mjs} +2 -2
- package/dist/{kv-cache-Crq8nvSV.js → kv-cache-C2oTEXyb.js} +1 -1
- package/dist/{kv-cache-b2HaCLC-.mjs → kv-cache-C3qkFkbt.mjs} +1 -1
- package/dist/{kv-cache-CGJMNSs-.cjs → kv-cache-c8X6svwE.cjs} +1 -1
- package/dist/{ld-CQlFhsU6.mjs → ld-fnWaNT8y.mjs} +3 -3
- package/dist/{metrics-B6RKtTLt.mjs → metrics-C5hMINAa.mjs} +1 -1
- package/dist/{middleware-CQygcRYE.mjs → middleware-CQlq6ykI.mjs} +1 -1
- package/dist/{middleware-CBM9vGYg.cjs → middleware-DeVzbg1I.cjs} +690 -30
- package/dist/{middleware-CsxoclmN.mjs → middleware-Dl2nyVgB.mjs} +306 -46
- package/dist/{middleware-B3vFLcCh.js → middleware-vQ_ZpgcX.js} +679 -31
- 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-Bq2eZyO_.mjs} +2 -2
- package/dist/{proof-ChmZL5rY.cjs → proof-Buz7I8wj.cjs} +1 -1
- package/dist/{proof-BhNTn0HE.js → proof-CTG9azxN.js} +1 -1
- package/dist/{proof-BUuvq0ia.mjs → proof-DZCjcFCd.mjs} +5 -5
- package/dist/{send-Dq-Ofquk.mjs → send-B253S5gN.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 -6
- 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-d6TshGjq.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 +9 -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-inQqS3yx.mjs";
|
|
9
|
+
import { i as rsaPrivateKey2 } from "../keys-CSYsOMFG.mjs";
|
|
10
|
+
import { t as getAuthenticatedDocumentLoader } from "../docloader-DAdEN549.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-C3qkFkbt.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-c8X6svwE.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-C2oTEXyb.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.1508+68519bf4",
|
|
4
4
|
"description": "An ActivityPub server framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ActivityPub",
|
|
@@ -143,16 +143,18 @@
|
|
|
143
143
|
"@opentelemetry/sdk-metrics": "2.7.1",
|
|
144
144
|
"@opentelemetry/sdk-trace-base": "^2.7.1",
|
|
145
145
|
"@opentelemetry/semantic-conventions": "^1.40.0",
|
|
146
|
+
"@standard-schema/spec": "^1.1.0",
|
|
146
147
|
"byte-encodings": "^1.0.11",
|
|
148
|
+
"devalue": "^5.8.1",
|
|
147
149
|
"es-toolkit": "1.46.1",
|
|
148
150
|
"json-canon": "^1.0.1",
|
|
149
151
|
"jsonld": "^9.0.0",
|
|
150
152
|
"structured-field-values": "^2.0.4",
|
|
151
153
|
"urlpattern-polyfill": "^10.1.0",
|
|
152
|
-
"@fedify/uri-template": "2.4.0-dev.
|
|
153
|
-
"@fedify/vocab": "2.4.0-dev.
|
|
154
|
-
"@fedify/vocab-runtime": "2.4.0-dev.
|
|
155
|
-
"@fedify/webfinger": "2.4.0-dev.
|
|
154
|
+
"@fedify/uri-template": "2.4.0-dev.1508+68519bf4",
|
|
155
|
+
"@fedify/vocab": "2.4.0-dev.1508+68519bf4",
|
|
156
|
+
"@fedify/vocab-runtime": "2.4.0-dev.1508+68519bf4",
|
|
157
|
+
"@fedify/webfinger": "2.4.0-dev.1508+68519bf4"
|
|
156
158
|
},
|
|
157
159
|
"devDependencies": {
|
|
158
160
|
"@std/assert": "npm:@jsr/std__assert@^0.226.0",
|
|
@@ -164,8 +166,8 @@
|
|
|
164
166
|
"tsx": "^4.21.0",
|
|
165
167
|
"typescript": "^6.0.0",
|
|
166
168
|
"wrangler": "^4.17.0",
|
|
167
|
-
"@fedify/
|
|
168
|
-
"@fedify/
|
|
169
|
+
"@fedify/vocab-tools": "^2.4.0-dev.1508+68519bf4",
|
|
170
|
+
"@fedify/fixture": "2.0.0"
|
|
169
171
|
},
|
|
170
172
|
"scripts": {
|
|
171
173
|
"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
|