@fedify/fedify 2.4.0-dev.1881 → 2.4.0-dev.1890
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/dist/{builder-5fuOq20e.mjs → builder-BnmSdOnI.mjs} +2 -2
- package/dist/{codec-peqOdBaE.mjs → codec-C6rTrpIp.mjs} +26 -3
- package/dist/compat/transformers.test.mjs +1 -1
- package/dist/{context-Dt36KFEJ.mjs → context-CbS35fLr.mjs} +2 -60
- package/dist/{deno--os6x8xr.mjs → deno-DRdfpFZq.mjs} +1 -1
- package/dist/dist-BQvArojP.mjs +188 -0
- package/dist/{docloader-CvFxfQuF.mjs → docloader-CzVxPVAF.mjs} +2 -2
- package/dist/federation/builder.test.mjs +1 -1
- package/dist/federation/handler.test.mjs +4 -4
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/metrics.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +9 -9
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.js +1 -1
- package/dist/federation/send.test.mjs +3 -3
- package/dist/federation/tasks/codec.test.mjs +1 -1
- package/dist/federation/tasks/enqueue.test.mjs +2 -2
- package/dist/federation/tasks/tasks.test.mjs +4 -4
- package/dist/federation/temporal.test.mjs +1 -1
- package/dist/federation/webfinger.test.mjs +2 -2
- package/dist/{federation-BJOTDQut.cjs → federation-_7qLFT2i.cjs} +99 -76
- package/dist/{http-BpAW8jTQ.cjs → http-BWzXKlhd.cjs} +1 -1
- package/dist/{http-Dz0Z-6xu.js → http-C32iqKS-.js} +1 -1
- package/dist/{http-DnrWDuU5.mjs → http-CLi1208s.mjs} +3 -3
- package/dist/{key-Bgtfl2M_.mjs → key-DauglCmL.mjs} +2 -2
- package/dist/{kv-cache-DGAWgk8Y.mjs → kv-cache-B7bYpdkg.mjs} +1 -1
- package/dist/{kv-cache-B_SLuy19.cjs → kv-cache-BKwJLP1E.cjs} +1 -1
- package/dist/{kv-cache-BkAI6gNw.js → kv-cache-Djz6tpep.js} +1 -1
- package/dist/{ld-DeYOcSft.mjs → ld-C1LVivv5.mjs} +3 -3
- package/dist/{metrics-CBYbeDaO.mjs → metrics-CIRevdM1.mjs} +1 -1
- package/dist/{middleware-DCtJ8EwC.mjs → middleware-CZkLnuR-.mjs} +1 -1
- package/dist/{middleware-ChsBNezF.mjs → middleware-LSJ8lKdH.mjs} +13 -13
- package/dist/{middleware-DnFpjPz7.js → middleware-bhJRkmux.js} +28 -5
- package/dist/mod.cjs +4 -4
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/handler.test.mjs +2 -2
- package/dist/{owner-DXN--VPl.mjs → owner-Cq2XnhH0.mjs} +2 -2
- package/dist/{proof-4SSJ2EAZ.js → proof-CFvowk0J.js} +1 -1
- package/dist/{proof-0gTlNlB2.mjs → proof-DE77t-0I.mjs} +4 -4
- package/dist/{proof-CvJ1aar0.cjs → proof-d0M6n154.cjs} +1 -1
- package/dist/{send-DBfVSKXE.mjs → send-WgXSEnsL.mjs} +3 -3
- package/dist/sig/http.test.mjs +2 -2
- package/dist/sig/key.test.mjs +1 -1
- package/dist/sig/ld.test.mjs +2 -2
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +1 -1
- package/dist/sig/proof.test.mjs +1 -1
- package/dist/{temporal-BK-FNcey.mjs → temporal-DKWMN_-H.mjs} +1 -1
- package/dist/testing/context.test.d.mts +2 -0
- package/dist/testing/context.test.mjs +19 -0
- package/dist/testing/mod.d.mts +27 -1
- package/dist/testing/mod.mjs +3 -2
- package/dist/{testing-BX0Nicyq.mjs → testing-D13ymFKy.mjs} +2 -1
- package/dist/utils/docloader.test.mjs +2 -2
- 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 +7 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno
|
|
4
|
+
import { n as version, t as name } from "./deno-DRdfpFZq.mjs";
|
|
5
5
|
import { t as ActivityListenerSet } from "./activity-listener-C-BSbKI7.mjs";
|
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
|
7
7
|
import { Router, RouterError, assertPath } from "@fedify/uri-template";
|
|
@@ -85,7 +85,7 @@ var FederationBuilderImpl = class {
|
|
|
85
85
|
* specified.
|
|
86
86
|
*/
|
|
87
87
|
async build(options) {
|
|
88
|
-
const { FederationImpl } = await import("./middleware-
|
|
88
|
+
const { FederationImpl } = await import("./middleware-CZkLnuR-.mjs");
|
|
89
89
|
const f = new FederationImpl(options);
|
|
90
90
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
|
91
91
|
f.router = this.router.clone();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "temporal-polyfill";
|
|
1
|
+
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { Link, Object as Object$1 } from "@fedify/vocab";
|
|
@@ -16,8 +16,14 @@ var TaskCodec = class TaskCodec {
|
|
|
16
16
|
this.options = options;
|
|
17
17
|
}
|
|
18
18
|
/** Serializes `data`, encoding any vocabulary object as its JSON-LD. */
|
|
19
|
-
serialize = (data) => stringifyAsync(data, {
|
|
20
|
-
|
|
19
|
+
serialize = (data) => stringifyAsync(data, {
|
|
20
|
+
Vocab: this.#stringifyVocab,
|
|
21
|
+
FedifyTemporal: stringifyTemporal
|
|
22
|
+
});
|
|
23
|
+
deserialize = async (raw) => await this.#revive(/* @__PURE__ */ new Map())(parse(raw, {
|
|
24
|
+
Vocab: VocabHolder.from,
|
|
25
|
+
FedifyTemporal: parseTemporal
|
|
26
|
+
}));
|
|
21
27
|
/** Validates `data` against `schema`, then serializes it. */
|
|
22
28
|
encode = async (schema, data) => this.serialize(await TaskCodec.validate(schema, data));
|
|
23
29
|
/** Deserializes `raw`, then validates the result against `schema`. */
|
|
@@ -83,6 +89,23 @@ var TaskCodec = class TaskCodec {
|
|
|
83
89
|
];
|
|
84
90
|
};
|
|
85
91
|
const isVocab = (value) => value instanceof Object$1 || value instanceof Link;
|
|
92
|
+
const temporalTypeNames = [
|
|
93
|
+
"Duration",
|
|
94
|
+
"Instant",
|
|
95
|
+
"PlainDate",
|
|
96
|
+
"PlainTime",
|
|
97
|
+
"PlainDateTime",
|
|
98
|
+
"PlainMonthDay",
|
|
99
|
+
"PlainYearMonth",
|
|
100
|
+
"ZonedDateTime"
|
|
101
|
+
];
|
|
102
|
+
function stringifyTemporal(value) {
|
|
103
|
+
for (const name of temporalTypeNames) if (value instanceof Temporal[name]) return [name, value.toString()];
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
function parseTemporal([name, value]) {
|
|
107
|
+
return Temporal[name].from(value);
|
|
108
|
+
}
|
|
86
109
|
const isPlainObject = (value) => value === null || typeof value !== "object" ? false : isObjectPrototype(globalThis.Object.getPrototypeOf(value));
|
|
87
110
|
const isObjectPrototype = (proto) => proto === null || proto === globalThis.Object.prototype;
|
|
88
111
|
const isInstanceOf = (cls) => (v) => v instanceof cls;
|
|
@@ -5,7 +5,7 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-CBlRfA-_.mjs";
|
|
6
6
|
import { t as assertInstanceOf } from "../assert_instance_of-g3WcyYNR.mjs";
|
|
7
7
|
import { t as assert } from "../assert-CebeUf0C.mjs";
|
|
8
|
-
import { b as autoIdAssigner, n as FederationImpl, y as actorDehydrator } from "../middleware-
|
|
8
|
+
import { b as autoIdAssigner, n as FederationImpl, y as actorDehydrator } from "../middleware-LSJ8lKdH.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,69 +1,11 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import {
|
|
5
|
-
import "@opentelemetry/sdk-trace-base";
|
|
6
|
-
import "@opentelemetry/core";
|
|
4
|
+
import { t as mockDocumentLoader } from "./dist-BQvArojP.mjs";
|
|
7
5
|
import { RouterError } from "@fedify/uri-template";
|
|
8
6
|
import { lookupObject, traverseCollection } from "@fedify/vocab";
|
|
9
7
|
import { lookupWebFinger } from "@fedify/webfinger";
|
|
10
8
|
import { metrics, trace } from "@opentelemetry/api";
|
|
11
|
-
//#region ../fixture/dist/mod.js
|
|
12
|
-
const logger = getLogger(["fixture", "docloader"]);
|
|
13
|
-
/**
|
|
14
|
-
* A mock of the document loader. This does not make any actual HTTP requests
|
|
15
|
-
* towards the remote server, but looks up the local fixture files instead.
|
|
16
|
-
*
|
|
17
|
-
* For instance, `mockDocumentLoader("http://example.com/foo/bar")` will look up
|
|
18
|
-
* the file `testing/fixtures/http/example.com/foo/bar` (no suffix) and return
|
|
19
|
-
* its content as the response.
|
|
20
|
-
*/
|
|
21
|
-
async function mockDocumentLoader(resource, _options) {
|
|
22
|
-
const url = new URL(resource);
|
|
23
|
-
if ("navigator" in globalThis && navigator.userAgent === "Cloudflare-Workers") {
|
|
24
|
-
const testUrl = new URL(url);
|
|
25
|
-
testUrl.hostname += ".test";
|
|
26
|
-
const resp = await fetch(testUrl);
|
|
27
|
-
if (resp.ok) {
|
|
28
|
-
const document = await resp.json();
|
|
29
|
-
logger.debug("Successfully fetched fixture {resource}: {status} {statusText}\n{body}", {
|
|
30
|
-
resource,
|
|
31
|
-
status: resp.status,
|
|
32
|
-
statusText: resp.statusText,
|
|
33
|
-
body: document
|
|
34
|
-
});
|
|
35
|
-
return {
|
|
36
|
-
contextUrl: null,
|
|
37
|
-
document,
|
|
38
|
-
documentUrl: resource
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
const error = await resp.text();
|
|
42
|
-
logger.error("Failed to fetch fixture {resource}: {error}", {
|
|
43
|
-
resource,
|
|
44
|
-
error
|
|
45
|
-
});
|
|
46
|
-
throw new Error(error);
|
|
47
|
-
}
|
|
48
|
-
const fixturePath = `${"Deno" in globalThis ? "." : "@fedify/fixture"}/fixtures/${url.host}${url.pathname}.json`;
|
|
49
|
-
let document;
|
|
50
|
-
try {
|
|
51
|
-
document = (await import(fixturePath, { with: { type: "json" } })).default;
|
|
52
|
-
} catch (error) {
|
|
53
|
-
logger.error("Failed to read fixture file {path}: {error}", {
|
|
54
|
-
path: fixturePath,
|
|
55
|
-
error
|
|
56
|
-
});
|
|
57
|
-
throw error;
|
|
58
|
-
}
|
|
59
|
-
return {
|
|
60
|
-
contextUrl: null,
|
|
61
|
-
document,
|
|
62
|
-
documentUrl: resource
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
const testDefinitions = [];
|
|
66
|
-
//#endregion
|
|
67
9
|
//#region src/testing/context.ts
|
|
68
10
|
function createContext(values) {
|
|
69
11
|
const { federation, url = new URL("http://example.com/"), canonicalOrigin, data, documentLoader, contextLoader, meterProvider, tracerProvider, clone, getNodeInfoUri, getActorUri, getObjectUri, getCollectionUri, getOutboxUri, getMediaUploaderUri, getInboxUri, getFollowingUri, getFollowersUri, getLikedUri, getFeaturedUri, getFeaturedTagsUri, parseUri, getActorKeyPairs, getDocumentLoader, lookupObject: lookupObject$1, traverseCollection: traverseCollection$1, lookupNodeInfo, lookupWebFinger: lookupWebFinger$1, sendActivity, routeActivity, enqueueTask, enqueueTaskMany } = values;
|
|
@@ -183,4 +125,4 @@ function createOutboxContext(args) {
|
|
|
183
125
|
};
|
|
184
126
|
}
|
|
185
127
|
//#endregion
|
|
186
|
-
export {
|
|
128
|
+
export { createOutboxContext as n, createRequestContext as r, createInboxContext as t };
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import "temporal-polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { createRequire } from "node:module";
|
|
5
|
+
import { configure, getConsoleSink, getLogger, reset } from "@logtape/logtape";
|
|
6
|
+
import "@opentelemetry/sdk-trace-base";
|
|
7
|
+
import "@opentelemetry/core";
|
|
8
|
+
//#region ../fixture/dist/mod.js
|
|
9
|
+
const logger = getLogger(["fixture", "docloader"]);
|
|
10
|
+
/**
|
|
11
|
+
* A mock of the document loader. This does not make any actual HTTP requests
|
|
12
|
+
* towards the remote server, but looks up the local fixture files instead.
|
|
13
|
+
*
|
|
14
|
+
* For instance, `mockDocumentLoader("http://example.com/foo/bar")` will look up
|
|
15
|
+
* the file `testing/fixtures/http/example.com/foo/bar` (no suffix) and return
|
|
16
|
+
* its content as the response.
|
|
17
|
+
*/
|
|
18
|
+
async function mockDocumentLoader(resource, _options) {
|
|
19
|
+
const url = new URL(resource);
|
|
20
|
+
if ("navigator" in globalThis && navigator.userAgent === "Cloudflare-Workers") {
|
|
21
|
+
const testUrl = new URL(url);
|
|
22
|
+
testUrl.hostname += ".test";
|
|
23
|
+
const resp = await fetch(testUrl);
|
|
24
|
+
if (resp.ok) {
|
|
25
|
+
const document = await resp.json();
|
|
26
|
+
logger.debug("Successfully fetched fixture {resource}: {status} {statusText}\n{body}", {
|
|
27
|
+
resource,
|
|
28
|
+
status: resp.status,
|
|
29
|
+
statusText: resp.statusText,
|
|
30
|
+
body: document
|
|
31
|
+
});
|
|
32
|
+
return {
|
|
33
|
+
contextUrl: null,
|
|
34
|
+
document,
|
|
35
|
+
documentUrl: resource
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
const error = await resp.text();
|
|
39
|
+
logger.error("Failed to fetch fixture {resource}: {error}", {
|
|
40
|
+
resource,
|
|
41
|
+
error
|
|
42
|
+
});
|
|
43
|
+
throw new Error(error);
|
|
44
|
+
}
|
|
45
|
+
const fixturePath = `${"Deno" in globalThis ? "." : "@fedify/fixture"}/fixtures/${url.host}${url.pathname}.json`;
|
|
46
|
+
let document;
|
|
47
|
+
try {
|
|
48
|
+
document = (await import(fixturePath, { with: { type: "json" } })).default;
|
|
49
|
+
} catch (error) {
|
|
50
|
+
logger.error("Failed to read fixture file {path}: {error}", {
|
|
51
|
+
path: fixturePath,
|
|
52
|
+
error
|
|
53
|
+
});
|
|
54
|
+
throw error;
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
contextUrl: null,
|
|
58
|
+
document,
|
|
59
|
+
documentUrl: resource
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
const testDefinitions = [];
|
|
63
|
+
function test(name, options, fn) {
|
|
64
|
+
const def = typeof name === "string" ? typeof options === "function" ? {
|
|
65
|
+
name,
|
|
66
|
+
fn: options
|
|
67
|
+
} : {
|
|
68
|
+
name,
|
|
69
|
+
...options,
|
|
70
|
+
fn
|
|
71
|
+
} : name;
|
|
72
|
+
testDefinitions.push(def);
|
|
73
|
+
if ("Deno" in globalThis) {
|
|
74
|
+
const func = def.fn;
|
|
75
|
+
Deno.test({
|
|
76
|
+
...def,
|
|
77
|
+
async fn(t) {
|
|
78
|
+
const records = [];
|
|
79
|
+
await configure({
|
|
80
|
+
sinks: {
|
|
81
|
+
buffer(record) {
|
|
82
|
+
if (record.category.length > 1 && record.category[0] === "logtape" && record.category[1] === "meta") return;
|
|
83
|
+
records.push(record);
|
|
84
|
+
},
|
|
85
|
+
console: getConsoleSink()
|
|
86
|
+
},
|
|
87
|
+
filters: {},
|
|
88
|
+
loggers: [{
|
|
89
|
+
category: [],
|
|
90
|
+
sinks: [Deno.env.get("LOG") === "always" ? "console" : "buffer"]
|
|
91
|
+
}]
|
|
92
|
+
});
|
|
93
|
+
try {
|
|
94
|
+
await func(t);
|
|
95
|
+
} catch (e) {
|
|
96
|
+
const consoleSink = getConsoleSink();
|
|
97
|
+
for (const record of records) consoleSink(record);
|
|
98
|
+
throw e;
|
|
99
|
+
} finally {
|
|
100
|
+
await reset();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
} else if ("Bun" in globalThis) {
|
|
105
|
+
let failed = void 0;
|
|
106
|
+
async function step(defOrNameOrFn, fn) {
|
|
107
|
+
let def;
|
|
108
|
+
if (typeof defOrNameOrFn === "string") def = {
|
|
109
|
+
name: defOrNameOrFn,
|
|
110
|
+
fn
|
|
111
|
+
};
|
|
112
|
+
else if (typeof defOrNameOrFn === "function") def = {
|
|
113
|
+
name: defOrNameOrFn.name,
|
|
114
|
+
fn: defOrNameOrFn
|
|
115
|
+
};
|
|
116
|
+
else def = defOrNameOrFn;
|
|
117
|
+
if (def.ignore) return false;
|
|
118
|
+
try {
|
|
119
|
+
await def.fn({
|
|
120
|
+
name: def.name,
|
|
121
|
+
origin: "",
|
|
122
|
+
step
|
|
123
|
+
});
|
|
124
|
+
} catch (e) {
|
|
125
|
+
failed ??= e;
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
const ctx = {
|
|
131
|
+
name: def.name,
|
|
132
|
+
origin: "",
|
|
133
|
+
step
|
|
134
|
+
};
|
|
135
|
+
async function fn() {
|
|
136
|
+
await def.fn(ctx);
|
|
137
|
+
if (failed) throw failed;
|
|
138
|
+
}
|
|
139
|
+
const bunTest = Bun.jest(caller()).test;
|
|
140
|
+
if (def.ignore) bunTest.skip(def.name, fn);
|
|
141
|
+
else bunTest(def.name, fn);
|
|
142
|
+
} else if (typeof process !== "undefined" && process.release?.name === "node" && !("navigator" in globalThis && navigator.userAgent === "Cloudflare-Workers")) {
|
|
143
|
+
const { test: nodeTest } = createRequire(process.cwd() + "/")("node:test");
|
|
144
|
+
nodeTest(def.name, { skip: def.ignore }, async (t) => {
|
|
145
|
+
await def.fn(intoTestContext(def.name, t));
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
function intoTestContext(name, ctx) {
|
|
150
|
+
async function step(defOrNameOrFn, fn) {
|
|
151
|
+
let def;
|
|
152
|
+
if (typeof defOrNameOrFn === "string") def = {
|
|
153
|
+
name: defOrNameOrFn,
|
|
154
|
+
fn
|
|
155
|
+
};
|
|
156
|
+
else if (typeof defOrNameOrFn === "function") def = {
|
|
157
|
+
name: defOrNameOrFn.name,
|
|
158
|
+
fn: defOrNameOrFn
|
|
159
|
+
};
|
|
160
|
+
else def = defOrNameOrFn;
|
|
161
|
+
let failed = false;
|
|
162
|
+
await ctx.test(def.name, { skip: def.ignore }, async (ctx2) => {
|
|
163
|
+
try {
|
|
164
|
+
await def.fn(intoTestContext(def.name, ctx2));
|
|
165
|
+
} catch (e) {
|
|
166
|
+
failed = true;
|
|
167
|
+
throw e;
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
return !def.ignore && !failed;
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
name,
|
|
174
|
+
origin: ctx.filePath ?? "",
|
|
175
|
+
step
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
/** Retrieve caller test file. */
|
|
179
|
+
function caller() {
|
|
180
|
+
const Trace = Error;
|
|
181
|
+
const _ = Trace.prepareStackTrace;
|
|
182
|
+
Trace.prepareStackTrace = (_, stack) => stack;
|
|
183
|
+
const { stack } = /* @__PURE__ */ new Error();
|
|
184
|
+
Trace.prepareStackTrace = _;
|
|
185
|
+
return stack[2].getFileName().replaceAll("\\", "/");
|
|
186
|
+
}
|
|
187
|
+
//#endregion
|
|
188
|
+
export { test as n, testDefinitions as r, mockDocumentLoader as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { o as validateCryptoKey } from "./key-
|
|
5
|
-
import { n as doubleKnock } from "./http-
|
|
4
|
+
import { o as validateCryptoKey } from "./key-DauglCmL.mjs";
|
|
5
|
+
import { n as doubleKnock } from "./http-CLi1208s.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-CBlRfA-_.mjs";
|
|
|
6
6
|
import { t as assertExists } from "../assert_exists-DtzkXC47.mjs";
|
|
7
7
|
import { t as assertThrows } from "../assert_throws-BJ5wuvR2.mjs";
|
|
8
8
|
import "../std__assert-CxFT0MNt.mjs";
|
|
9
|
-
import { r as createFederationBuilder } from "../builder-
|
|
9
|
+
import { r as createFederationBuilder } from "../builder-BnmSdOnI.mjs";
|
|
10
10
|
import { DisallowedOperatorError, DisallowedVarSpecModifierError, DuplicateRouteVariableError, RouteTemplateOptionsNotMatchedError, RouterError } from "@fedify/uri-template";
|
|
11
11
|
import { Activity, Note, Person } from "@fedify/vocab";
|
|
12
12
|
import { test } from "@fedify/fixture";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-
|
|
4
|
+
import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-CbS35fLr.mjs";
|
|
5
5
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
6
6
|
import { t as assertEquals } from "../assert_equals-CBlRfA-_.mjs";
|
|
7
7
|
import { t as assertGreaterOrEqual } from "../assert_greater_or_equal-BApOTh1h.mjs";
|
|
@@ -10,10 +10,10 @@ import "../std__assert-CxFT0MNt.mjs";
|
|
|
10
10
|
import { t as assertRejects } from "../assert_rejects-wFbSPn1O.mjs";
|
|
11
11
|
import { t as assert } from "../assert-CebeUf0C.mjs";
|
|
12
12
|
import { r as parseAcceptSignature } from "../accept-CPVqki78.mjs";
|
|
13
|
-
import { s as signRequest } from "../http-
|
|
13
|
+
import { s as signRequest } from "../http-CLi1208s.mjs";
|
|
14
14
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
15
|
-
import { a as compactJsonLd, p as signJsonLd } from "../ld-
|
|
16
|
-
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-
|
|
15
|
+
import { a as compactJsonLd, p as signJsonLd } from "../ld-C1LVivv5.mjs";
|
|
16
|
+
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-LSJ8lKdH.mjs";
|
|
17
17
|
import { t as ActivityListenerSet } from "../activity-listener-C-BSbKI7.mjs";
|
|
18
18
|
import { Activity, Create, Note, Person, Tombstone } from "@fedify/vocab";
|
|
19
19
|
import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
@@ -5,8 +5,8 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-CBlRfA-_.mjs";
|
|
6
6
|
import "../std__assert-CxFT0MNt.mjs";
|
|
7
7
|
import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
8
|
-
import { r as signObject } from "../proof-
|
|
9
|
-
import { o as createFederation } from "../middleware-
|
|
8
|
+
import { r as signObject } from "../proof-DE77t-0I.mjs";
|
|
9
|
+
import { o as createFederation } from "../middleware-LSJ8lKdH.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
|
|
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-CBlRfA-_.mjs";
|
|
5
5
|
import "../std__assert-CxFT0MNt.mjs";
|
|
6
6
|
import { t as assertRejects } from "../assert_rejects-wFbSPn1O.mjs";
|
|
7
|
-
import { _ as recordKeyLookup, a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, m as recordDocumentFetch, p as recordDocumentCache, r as getFederationMetrics, t as classifyFetchError, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "../metrics-
|
|
7
|
+
import { _ as recordKeyLookup, a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, m as recordDocumentFetch, p as recordDocumentCache, r as getFederationMetrics, t as classifyFetchError, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "../metrics-CIRevdM1.mjs";
|
|
8
8
|
import { createTestMeterProvider, test } from "@fedify/fixture";
|
|
9
9
|
import { FetchError } from "@fedify/vocab-runtime";
|
|
10
10
|
import { DataPointType, MeterProvider, MetricReader } from "@opentelemetry/sdk-metrics";
|
|
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as esm_default } from "../esm-BHXXx4Wx.mjs";
|
|
5
5
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
6
|
-
import { a as numberSchema, r as envelopeSchema, t as MockQueue } from "../testing-
|
|
6
|
+
import { a as numberSchema, r as envelopeSchema, t as MockQueue } from "../testing-D13ymFKy.mjs";
|
|
7
7
|
import { t as assertEquals } from "../assert_equals-CBlRfA-_.mjs";
|
|
8
8
|
import { t as assertExists } from "../assert_exists-DtzkXC47.mjs";
|
|
9
9
|
import { t as assertFalse } from "../assert_false-3pLLLsO4.mjs";
|
|
@@ -14,16 +14,16 @@ import "../std__assert-CxFT0MNt.mjs";
|
|
|
14
14
|
import { t as assertRejects } from "../assert_rejects-wFbSPn1O.mjs";
|
|
15
15
|
import { t as assertStrictEquals } from "../assert_strict_equals-Bpjl4Psw.mjs";
|
|
16
16
|
import { t as assert } from "../assert-CebeUf0C.mjs";
|
|
17
|
-
import { g as recordInboxActivity } from "../metrics-
|
|
18
|
-
import { l as verifyRequest, s as signRequest } from "../http-
|
|
17
|
+
import { g as recordInboxActivity } from "../metrics-CIRevdM1.mjs";
|
|
18
|
+
import { l as verifyRequest, s as signRequest } from "../http-CLi1208s.mjs";
|
|
19
19
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
20
|
-
import { t as getAuthenticatedDocumentLoader } from "../docloader-
|
|
21
|
-
import { a as compactJsonLd, h as verifyJsonLd, p as signJsonLd, s as detachSignature } from "../ld-
|
|
22
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
23
|
-
import { i as verifyObject, r as signObject } from "../proof-
|
|
24
|
-
import { g as handleBenchmarkTrigger, i as KvSpecDeterminer, n as FederationImpl, o as createFederation, r as InboxContextImpl, t as ContextImpl } from "../middleware-
|
|
20
|
+
import { t as getAuthenticatedDocumentLoader } from "../docloader-CzVxPVAF.mjs";
|
|
21
|
+
import { a as compactJsonLd, h as verifyJsonLd, p as signJsonLd, s as detachSignature } from "../ld-C1LVivv5.mjs";
|
|
22
|
+
import { t as doesActorOwnKey } from "../owner-Cq2XnhH0.mjs";
|
|
23
|
+
import { i as verifyObject, r as signObject } from "../proof-DE77t-0I.mjs";
|
|
24
|
+
import { g as handleBenchmarkTrigger, i as KvSpecDeterminer, n as FederationImpl, o as createFederation, r as InboxContextImpl, t as ContextImpl } from "../middleware-LSJ8lKdH.mjs";
|
|
25
25
|
import { t as CircuitBreaker } from "../circuit-breaker-C5NqoLBJ.mjs";
|
|
26
|
-
import { t as TaskCodec } from "../codec-
|
|
26
|
+
import { t as TaskCodec } from "../codec-C6rTrpIp.mjs";
|
|
27
27
|
import { t as markCircuitBreakerLegacySweepDone } from "../circuit-breaker-test-utils-DW6YC_Pe.mjs";
|
|
28
28
|
import { configure, reset } from "@logtape/logtape";
|
|
29
29
|
import { RouterError } from "@fedify/uri-template";
|
package/dist/federation/mod.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_federation = require("../federation-
|
|
3
|
+
const require_federation = require("../federation-_7qLFT2i.cjs");
|
|
4
4
|
exports.CircuitBreaker = require_federation.CircuitBreaker;
|
|
5
5
|
exports.InProcessMessageQueue = require_federation.InProcessMessageQueue;
|
|
6
6
|
exports.MemoryKvStore = require_federation.MemoryKvStore;
|
package/dist/federation/mod.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { a as respondWithObject, c as digest, d as parseCircuitBreakerKvState, f as createFederationBuilder, i as SendActivityError, l as CircuitBreaker, n as handleWebFinger, o as respondWithObjectIfAcceptable, r as createExponentialBackoffPolicy, s as buildCollectionSynchronizationHeader, t as createFederation, u as normalizeCircuitBreakerOptions } from "../middleware-
|
|
3
|
+
import { a as respondWithObject, c as digest, d as parseCircuitBreakerKvState, f as createFederationBuilder, i as SendActivityError, l as CircuitBreaker, n as handleWebFinger, o as respondWithObjectIfAcceptable, r as createExponentialBackoffPolicy, s as buildCollectionSynchronizationHeader, t as createFederation, u as normalizeCircuitBreakerOptions } from "../middleware-bhJRkmux.js";
|
|
4
4
|
import { getLogger } from "@logtape/logtape";
|
|
5
5
|
import { Router as Router$1, RouterError as RouterError$1, assertPath, isPath } from "@fedify/uri-template";
|
|
6
6
|
import { isEqual } from "es-toolkit";
|
|
@@ -10,10 +10,10 @@ import { t as assertNotEquals } from "../assert_not_equals-BN7yDMWe.mjs";
|
|
|
10
10
|
import "../std__assert-CxFT0MNt.mjs";
|
|
11
11
|
import { t as assertRejects } from "../assert_rejects-wFbSPn1O.mjs";
|
|
12
12
|
import { t as assert } from "../assert-CebeUf0C.mjs";
|
|
13
|
-
import { l as verifyRequest } from "../http-
|
|
13
|
+
import { l as verifyRequest } from "../http-CLi1208s.mjs";
|
|
14
14
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
15
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
16
|
-
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-
|
|
15
|
+
import { t as doesActorOwnKey } from "../owner-Cq2XnhH0.mjs";
|
|
16
|
+
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-WgXSEnsL.mjs";
|
|
17
17
|
import { Activity, Application, Endpoints, Group, Person, Service } from "@fedify/vocab";
|
|
18
18
|
import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
19
19
|
import { FetchError } from "@fedify/vocab-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as TaskCodec } from "../../codec-
|
|
4
|
+
import { t as TaskCodec } from "../../codec-C6rTrpIp.mjs";
|
|
5
5
|
import { Create, Link, Note, Person } from "@fedify/vocab";
|
|
6
6
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
7
7
|
import { deepStrictEqual, ok, rejects, strictEqual } from "node:assert/strict";
|
|
@@ -2,8 +2,8 @@ import { Temporal } from "temporal-polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as MemoryKvStore } from "../../kv-DCHkaJ9-.mjs";
|
|
5
|
-
import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, t as MockQueue } from "../../testing-
|
|
6
|
-
import { o as createFederation } from "../../middleware-
|
|
5
|
+
import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, t as MockQueue } from "../../testing-D13ymFKy.mjs";
|
|
6
|
+
import { o as createFederation } from "../../middleware-LSJ8lKdH.mjs";
|
|
7
7
|
import { n as ParallelMessageQueue } from "../../mq-Dm1Wmtm-.mjs";
|
|
8
8
|
import { configure, reset } from "@logtape/logtape";
|
|
9
9
|
import { delay } from "es-toolkit";
|
|
@@ -2,10 +2,10 @@ import { Temporal } from "temporal-polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as MemoryKvStore } from "../../kv-DCHkaJ9-.mjs";
|
|
5
|
-
import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, t as MockQueue } from "../../testing-
|
|
6
|
-
import { o as createFederation } from "../../middleware-
|
|
7
|
-
import { r as createFederationBuilder } from "../../builder-
|
|
8
|
-
import { t as TaskCodec } from "../../codec-
|
|
5
|
+
import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, t as MockQueue } from "../../testing-D13ymFKy.mjs";
|
|
6
|
+
import { o as createFederation } from "../../middleware-LSJ8lKdH.mjs";
|
|
7
|
+
import { r as createFederationBuilder } from "../../builder-BnmSdOnI.mjs";
|
|
8
|
+
import { t as TaskCodec } from "../../codec-C6rTrpIp.mjs";
|
|
9
9
|
import { t as InProcessMessageQueue } from "../../mq-Dm1Wmtm-.mjs";
|
|
10
10
|
import { W3CTraceContextPropagator } from "@opentelemetry/core";
|
|
11
11
|
import { Note } from "@fedify/vocab";
|
|
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as assertFalse } from "../assert_false-3pLLLsO4.mjs";
|
|
5
5
|
import "../std__assert-CxFT0MNt.mjs";
|
|
6
6
|
import { t as assert } from "../assert-CebeUf0C.mjs";
|
|
7
|
-
import { t as hasMalformedKnownTemporalLiteral } from "../temporal-
|
|
7
|
+
import { t as hasMalformedKnownTemporalLiteral } from "../temporal-DKWMN_-H.mjs";
|
|
8
8
|
import { test } from "@fedify/fixture";
|
|
9
9
|
//#region src/federation/temporal.test.ts
|
|
10
10
|
test("hasMalformedKnownTemporalLiteral() detects expanded proof timestamps", async () => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { r as createRequestContext } from "../context-
|
|
4
|
+
import { r as createRequestContext } from "../context-CbS35fLr.mjs";
|
|
5
5
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
6
6
|
import { t as assertEquals } from "../assert_equals-CBlRfA-_.mjs";
|
|
7
7
|
import { t as assertNotEquals } from "../assert_not_equals-BN7yDMWe.mjs";
|
|
8
8
|
import "../std__assert-CxFT0MNt.mjs";
|
|
9
|
-
import { o as createFederation, s as handleWebFinger } from "../middleware-
|
|
9
|
+
import { o as createFederation, s as handleWebFinger } from "../middleware-LSJ8lKdH.mjs";
|
|
10
10
|
import { Image, Link, Person, Tombstone } from "@fedify/vocab";
|
|
11
11
|
import { createTestMeterProvider, test } from "@fedify/fixture";
|
|
12
12
|
//#region src/federation/webfinger.test.ts
|