@fedify/fedify 2.0.0-dev.161 → 2.0.0-dev.166
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-CulJ6Oa9.js → builder-Khy2m25E.js} +3 -3
- package/dist/{client-BivSNrEg.d.ts → client-CUTUGgvJ.d.ts} +18 -18
- package/dist/{client-CgMTXmAD.js → client-Dg7OfUDA.js} +27 -22
- package/dist/{client-94iWEfQa.d.cts → client-by-PEGAJ.d.cts} +18 -18
- package/dist/compat/mod.d.cts +4 -4
- package/dist/compat/mod.d.ts +4 -4
- package/dist/compat/transformers.test.js +13 -13
- package/dist/{context-CYZ2i00R.d.ts → context-C7vzWilY.d.ts} +58 -58
- package/dist/{context-D2MrtLch.d.cts → context-CrB9RFy5.d.cts} +58 -58
- package/dist/{deno-DIwNGswC.js → deno-Cif1-iL_.js} +1 -1
- package/dist/{docloader-D2992pGD.js → docloader-CVaWaEcp.js} +2 -2
- package/dist/federation/builder.test.js +3 -3
- package/dist/federation/handler.test.js +13 -13
- package/dist/federation/idempotency.test.js +13 -13
- package/dist/federation/inbox.test.js +2 -2
- package/dist/federation/middleware.test.js +13 -13
- package/dist/federation/mod.cjs +5 -5
- package/dist/federation/mod.d.cts +4 -4
- package/dist/federation/mod.d.ts +4 -4
- package/dist/federation/mod.js +5 -5
- package/dist/federation/send.test.js +5 -5
- package/dist/federation/webfinger.test.js +13 -13
- package/dist/{http-BV9SKFK0.js → http-B99rtXjf.js} +2 -2
- package/dist/{http-3fEbsHa0.js → http-CY-Bbe9s.js} +1 -1
- package/dist/{http-C06iL_Qv.cjs → http-DfyrqzT4.cjs} +1 -1
- package/dist/{inbox-DCV2fS3F.js → inbox-BC3B2xqc.js} +1 -1
- package/dist/{key-Bdc11xlQ.js → key-Bw4eVboO.js} +1 -1
- package/dist/{kv-D8q9fLkA.d.cts → kv-B4vFhIYL.d.cts} +2 -2
- package/dist/{kv-CtOmTRNc.d.ts → kv-CYySNrsn.d.ts} +2 -2
- package/dist/{kv-cache-B4-ASVht.js → kv-cache-BCsLgQXU.js} +1 -1
- package/dist/{kv-cache-CQjPwWHu.cjs → kv-cache-Cerg94jw.cjs} +1 -1
- package/dist/{ld-C7be04RF.js → ld-1OEVoX2N.js} +2 -2
- package/dist/{middleware-C4_a2DNI.js → middleware-7qNi2Qwp.js} +9 -10
- package/dist/{middleware-9RlUwILK.js → middleware-B7mdNwwo.js} +5 -5
- package/dist/{middleware-C3xnTI2Z.js → middleware-CQv0UNYy.js} +16 -17
- package/dist/{middleware-B_mOdzoC.cjs → middleware-CvNusBTn.cjs} +9 -10
- package/dist/middleware-Dem4kH_q.js +26 -0
- package/dist/middleware-TgcMW8QT.cjs +12 -0
- package/dist/{mod-DcPRcifg.d.cts → mod-0p9zUdzg.d.cts} +5 -5
- package/dist/{mod-CS-MS7gZ.d.cts → mod-0qnPv4EC.d.cts} +1 -1
- package/dist/{mod-DqFSzJA0.d.ts → mod-C3SOvTD1.d.ts} +1 -1
- package/dist/{mod-CNNTHyBC.d.cts → mod-D6pS5_xJ.d.cts} +1 -1
- package/dist/{mod-D_cmv2il.d.ts → mod-waqu-BL_.d.ts} +1 -1
- package/dist/{mod-CJgbdSqb.d.ts → mod-xc20HhMD.d.ts} +5 -5
- package/dist/mod.cjs +5 -5
- package/dist/mod.d.cts +6 -6
- package/dist/mod.d.ts +6 -6
- package/dist/mod.js +5 -5
- package/dist/nodeinfo/client.test.js +1 -1
- package/dist/nodeinfo/handler.test.js +13 -13
- package/dist/nodeinfo/mod.cjs +1 -1
- package/dist/nodeinfo/mod.d.cts +1 -1
- package/dist/nodeinfo/mod.d.ts +1 -1
- package/dist/nodeinfo/mod.js +1 -1
- package/dist/nodeinfo/types.test.js +1 -1
- package/dist/otel/exporter.test.js +7 -13
- package/dist/otel/mod.cjs +7 -13
- package/dist/otel/mod.d.cts +22 -22
- package/dist/otel/mod.d.ts +22 -22
- package/dist/otel/mod.js +7 -13
- package/dist/{owner-Bs5Y5twE.js → owner-w_YNARRI.js} +1 -1
- package/dist/{proof-CFwktc0B.js → proof-C8vStykH.js} +2 -2
- package/dist/{proof-CaA7ysDp.cjs → proof-CJZ5gNjq.cjs} +1 -1
- package/dist/{proof-C-751PeN.js → proof-aPT2G2bY.js} +1 -1
- package/dist/{send-C288Vw8b.js → send-C77cZsvd.js} +2 -2
- package/dist/sig/http.test.js +3 -3
- package/dist/sig/key.test.js +2 -2
- package/dist/sig/ld.test.js +3 -3
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.js +3 -3
- package/dist/sig/proof.test.js +3 -3
- package/dist/testing/mod.d.ts +64 -64
- package/dist/{types-hKTi53FO.js → types-8l28uC8o.js} +30 -25
- package/dist/{types-Q-qkJXBV.cjs → types-B6z6CqIz.cjs} +30 -25
- package/dist/{types-BEdCLHqP.js → types-CPz01LGH.js} +3 -3
- package/dist/utils/docloader.test.js +4 -4
- package/dist/utils/mod.cjs +2 -2
- package/dist/utils/mod.d.cts +2 -2
- package/dist/utils/mod.d.ts +2 -2
- package/dist/utils/mod.js +2 -2
- package/package.json +6 -6
- package/dist/middleware-C9iGBAP1.cjs +0 -12
- package/dist/middleware-CYlahvpt.js +0 -26
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { deno_default } from "./deno-
|
|
6
|
+
import { deno_default } from "./deno-Cif1-iL_.js";
|
|
7
7
|
import { Router, RouterError } from "./router-D9eI0s4b.js";
|
|
8
|
-
import { InboxListenerSet } from "./inbox-
|
|
8
|
+
import { InboxListenerSet } from "./inbox-BC3B2xqc.js";
|
|
9
9
|
import { getLogger } from "@logtape/logtape";
|
|
10
10
|
import { getTypeId } from "@fedify/vocab";
|
|
11
11
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -44,7 +44,7 @@ var FederationBuilderImpl = class {
|
|
|
44
44
|
this.collectionTypeIds = {};
|
|
45
45
|
}
|
|
46
46
|
async build(options) {
|
|
47
|
-
const { FederationImpl } = await import("./middleware-
|
|
47
|
+
const { FederationImpl } = await import("./middleware-Dem4kH_q.js");
|
|
48
48
|
const f = new FederationImpl(options);
|
|
49
49
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
|
50
50
|
f.router = this.router.clone();
|
|
@@ -16,29 +16,29 @@ interface NodeInfo {
|
|
|
16
16
|
/**
|
|
17
17
|
* Metadata about server software in use.
|
|
18
18
|
*/
|
|
19
|
-
software: Software;
|
|
19
|
+
readonly software: Software;
|
|
20
20
|
/**
|
|
21
21
|
* The protocols supported on this server. At least one protocol must be
|
|
22
22
|
* supported.
|
|
23
23
|
*/
|
|
24
|
-
protocols: Protocol[];
|
|
24
|
+
readonly protocols: readonly Protocol[];
|
|
25
25
|
/**
|
|
26
26
|
* The third party sites this server can connect to via their application API.
|
|
27
27
|
*/
|
|
28
|
-
services?: Services;
|
|
28
|
+
readonly services?: Services;
|
|
29
29
|
/**
|
|
30
30
|
* Whether this server allows open self-registration. Defaults to `false`.
|
|
31
31
|
*/
|
|
32
|
-
openRegistrations?: boolean;
|
|
32
|
+
readonly openRegistrations?: boolean;
|
|
33
33
|
/**
|
|
34
34
|
* Usage statistics for this server.
|
|
35
35
|
*/
|
|
36
|
-
usage: Usage;
|
|
36
|
+
readonly usage: Usage;
|
|
37
37
|
/**
|
|
38
38
|
* Free form key value pairs for software specific values.
|
|
39
39
|
* Clients should not rely on any specific key present.
|
|
40
40
|
*/
|
|
41
|
-
metadata?: Record<string, JsonValue
|
|
41
|
+
readonly metadata?: Readonly<Record<string, JsonValue>>;
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
44
|
* Metadata about server software in use.
|
|
@@ -48,19 +48,19 @@ interface Software {
|
|
|
48
48
|
* The canonical name of this server software. This must comply with
|
|
49
49
|
* pattern `/^[a-z0-9-]+$/`.
|
|
50
50
|
*/
|
|
51
|
-
name: string;
|
|
51
|
+
readonly name: string;
|
|
52
52
|
/**
|
|
53
53
|
* The version of this server software.
|
|
54
54
|
*/
|
|
55
|
-
version: string;
|
|
55
|
+
readonly version: string;
|
|
56
56
|
/**
|
|
57
57
|
* The URL of the source code repository of this server software.
|
|
58
58
|
*/
|
|
59
|
-
repository?: URL;
|
|
59
|
+
readonly repository?: URL;
|
|
60
60
|
/**
|
|
61
61
|
* The URL of the homepage of this server software.
|
|
62
62
|
*/
|
|
63
|
-
homepage?: URL;
|
|
63
|
+
readonly homepage?: URL;
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
66
|
* The protocols supported on this server.
|
|
@@ -74,12 +74,12 @@ interface Services {
|
|
|
74
74
|
* The third party sites this server can retrieve messages from for combined
|
|
75
75
|
* display with regular traffic.
|
|
76
76
|
*/
|
|
77
|
-
inbound?: InboundService[];
|
|
77
|
+
readonly inbound?: readonly InboundService[];
|
|
78
78
|
/**
|
|
79
79
|
* The third party sites this server can publish messages to on the behalf
|
|
80
80
|
* of a user.
|
|
81
81
|
*/
|
|
82
|
-
outbound?: OutboundService[];
|
|
82
|
+
readonly outbound?: readonly OutboundService[];
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
85
85
|
* The third party sites this server can retrieve messages from for combined
|
|
@@ -98,33 +98,33 @@ interface Usage {
|
|
|
98
98
|
/**
|
|
99
99
|
* Statistics about the users of this server.
|
|
100
100
|
*/
|
|
101
|
-
users: {
|
|
101
|
+
readonly users: {
|
|
102
102
|
/**
|
|
103
103
|
* The total amount of on this server registered users. This number
|
|
104
104
|
* has to be an integer greater than or equal to zero.
|
|
105
105
|
*/
|
|
106
|
-
total?: number;
|
|
106
|
+
readonly total?: number;
|
|
107
107
|
/**
|
|
108
108
|
* The amount of users that signed in at least once in the last 180 days.
|
|
109
109
|
* This number has to be an integer greater than or equal to zero.
|
|
110
110
|
*/
|
|
111
|
-
activeHalfyear?: number;
|
|
111
|
+
readonly activeHalfyear?: number;
|
|
112
112
|
/**
|
|
113
113
|
* The amount of users that signed in at least once in the last 30 days.
|
|
114
114
|
* This number has to be an integer greater than or equal to zero.
|
|
115
115
|
*/
|
|
116
|
-
activeMonth?: number;
|
|
116
|
+
readonly activeMonth?: number;
|
|
117
117
|
};
|
|
118
118
|
/**
|
|
119
119
|
* The amount of posts that were made by users that are registered on this
|
|
120
120
|
* server. This number has to be an integer greater than or equal to zero.
|
|
121
121
|
*/
|
|
122
|
-
localPosts: number;
|
|
122
|
+
readonly localPosts: number;
|
|
123
123
|
/**
|
|
124
124
|
* The amount of comments that were made by users that are registered on this
|
|
125
125
|
* server. This number has to be an integer greater than or equal to zero.
|
|
126
126
|
*/
|
|
127
|
-
localComments: number;
|
|
127
|
+
readonly localComments: number;
|
|
128
128
|
}
|
|
129
129
|
/**
|
|
130
130
|
* Converts a {@link NodeInfo} object to a JSON value.
|
|
@@ -111,15 +111,14 @@ function parseNodeInfo(data, options = {}) {
|
|
|
111
111
|
if (typeof data.metadata === "object" && data.metadata != null) metadata = Object.fromEntries(Object.entries(data.metadata));
|
|
112
112
|
else if (!options.tryBestEffort) return null;
|
|
113
113
|
}
|
|
114
|
-
|
|
114
|
+
return {
|
|
115
115
|
software,
|
|
116
116
|
protocols,
|
|
117
|
-
usage
|
|
117
|
+
usage,
|
|
118
|
+
...services != null && { services },
|
|
119
|
+
...openRegistrations != null && { openRegistrations },
|
|
120
|
+
...metadata != null && { metadata }
|
|
118
121
|
};
|
|
119
|
-
if (services != null) result.services = services;
|
|
120
|
-
if (openRegistrations != null) result.openRegistrations = openRegistrations;
|
|
121
|
-
if (metadata != null) result.metadata = metadata;
|
|
122
|
-
return result;
|
|
123
122
|
}
|
|
124
123
|
function parseSoftware(data, options = {}) {
|
|
125
124
|
if (typeof data !== "object" || data == null) {
|
|
@@ -155,13 +154,12 @@ function parseSoftware(data, options = {}) {
|
|
|
155
154
|
}
|
|
156
155
|
else if (!options.tryBestEffort) return null;
|
|
157
156
|
}
|
|
158
|
-
|
|
157
|
+
return {
|
|
159
158
|
name,
|
|
160
|
-
version
|
|
159
|
+
version,
|
|
160
|
+
...repository != null && { repository },
|
|
161
|
+
...homepage != null && { homepage }
|
|
161
162
|
};
|
|
162
|
-
if (repository != null) result.repository = repository;
|
|
163
|
-
if (homepage != null) result.homepage = homepage;
|
|
164
|
-
return result;
|
|
165
163
|
}
|
|
166
164
|
function parseProtocol(data) {
|
|
167
165
|
if (data === "activitypub" || data === "buddycloud" || data === "dfrn" || data === "diaspora" || data === "libertree" || data === "ostatus" || data === "pumpio" || data === "tent" || data === "xmpp" || data === "zot") return data;
|
|
@@ -184,10 +182,10 @@ function parseServices(data, options = {}) {
|
|
|
184
182
|
outbound = os.filter((o) => o != null);
|
|
185
183
|
if (os.length > outbound.length && !options.tryBestEffort) return null;
|
|
186
184
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
185
|
+
return {
|
|
186
|
+
...inbound != null && { inbound },
|
|
187
|
+
...outbound != null && { outbound }
|
|
188
|
+
};
|
|
191
189
|
}
|
|
192
190
|
function parseInboundService(data) {
|
|
193
191
|
if (data === "atom1.0" || data === "gnusocial" || data === "imap" || data === "pnut" || data === "pop3" || data === "pumpio" || data === "rss2.0" || data === "twitter") return data;
|
|
@@ -199,33 +197,40 @@ function parseOutboundService(data) {
|
|
|
199
197
|
}
|
|
200
198
|
function parseUsage(data, options = {}) {
|
|
201
199
|
if (typeof data !== "object" || data == null) return null;
|
|
202
|
-
|
|
200
|
+
let total;
|
|
201
|
+
let activeHalfyear;
|
|
202
|
+
let activeMonth;
|
|
203
203
|
if ("users" in data && typeof data.users === "object" && data.users != null) {
|
|
204
|
-
if ("total" in data.users) if (typeof data.users.total === "number")
|
|
204
|
+
if ("total" in data.users) if (typeof data.users.total === "number") total = data.users.total;
|
|
205
205
|
else {
|
|
206
206
|
if (!options.tryBestEffort) return null;
|
|
207
207
|
if (typeof data.users.total === "string") {
|
|
208
208
|
const n = parseInt(data.users.total);
|
|
209
|
-
if (!isNaN(n))
|
|
209
|
+
if (!isNaN(n)) total = n;
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
|
-
if ("activeHalfyear" in data.users) if (typeof data.users.activeHalfyear === "number")
|
|
212
|
+
if ("activeHalfyear" in data.users) if (typeof data.users.activeHalfyear === "number") activeHalfyear = data.users.activeHalfyear;
|
|
213
213
|
else {
|
|
214
214
|
if (!options.tryBestEffort) return null;
|
|
215
215
|
if (typeof data.users.activeHalfyear === "string") {
|
|
216
216
|
const n = parseInt(data.users.activeHalfyear);
|
|
217
|
-
if (!isNaN(n))
|
|
217
|
+
if (!isNaN(n)) activeHalfyear = n;
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
if ("activeMonth" in data.users) if (typeof data.users.activeMonth === "number")
|
|
220
|
+
if ("activeMonth" in data.users) if (typeof data.users.activeMonth === "number") activeMonth = data.users.activeMonth;
|
|
221
221
|
else {
|
|
222
222
|
if (!options.tryBestEffort) return null;
|
|
223
223
|
if (typeof data.users.activeMonth === "string") {
|
|
224
224
|
const n = parseInt(data.users.activeMonth);
|
|
225
|
-
if (!isNaN(n))
|
|
225
|
+
if (!isNaN(n)) activeMonth = n;
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
} else if (!options.tryBestEffort) return null;
|
|
229
|
+
const users = {
|
|
230
|
+
...total != null && { total },
|
|
231
|
+
...activeHalfyear != null && { activeHalfyear },
|
|
232
|
+
...activeMonth != null && { activeMonth }
|
|
233
|
+
};
|
|
229
234
|
let localPosts = 0;
|
|
230
235
|
if ("localPosts" in data) if (typeof data.localPosts === "number") localPosts = data.localPosts;
|
|
231
236
|
else {
|
|
@@ -14,29 +14,29 @@ interface NodeInfo {
|
|
|
14
14
|
/**
|
|
15
15
|
* Metadata about server software in use.
|
|
16
16
|
*/
|
|
17
|
-
software: Software;
|
|
17
|
+
readonly software: Software;
|
|
18
18
|
/**
|
|
19
19
|
* The protocols supported on this server. At least one protocol must be
|
|
20
20
|
* supported.
|
|
21
21
|
*/
|
|
22
|
-
protocols: Protocol[];
|
|
22
|
+
readonly protocols: readonly Protocol[];
|
|
23
23
|
/**
|
|
24
24
|
* The third party sites this server can connect to via their application API.
|
|
25
25
|
*/
|
|
26
|
-
services?: Services;
|
|
26
|
+
readonly services?: Services;
|
|
27
27
|
/**
|
|
28
28
|
* Whether this server allows open self-registration. Defaults to `false`.
|
|
29
29
|
*/
|
|
30
|
-
openRegistrations?: boolean;
|
|
30
|
+
readonly openRegistrations?: boolean;
|
|
31
31
|
/**
|
|
32
32
|
* Usage statistics for this server.
|
|
33
33
|
*/
|
|
34
|
-
usage: Usage;
|
|
34
|
+
readonly usage: Usage;
|
|
35
35
|
/**
|
|
36
36
|
* Free form key value pairs for software specific values.
|
|
37
37
|
* Clients should not rely on any specific key present.
|
|
38
38
|
*/
|
|
39
|
-
metadata?: Record<string, JsonValue
|
|
39
|
+
readonly metadata?: Readonly<Record<string, JsonValue>>;
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Metadata about server software in use.
|
|
@@ -46,19 +46,19 @@ interface Software {
|
|
|
46
46
|
* The canonical name of this server software. This must comply with
|
|
47
47
|
* pattern `/^[a-z0-9-]+$/`.
|
|
48
48
|
*/
|
|
49
|
-
name: string;
|
|
49
|
+
readonly name: string;
|
|
50
50
|
/**
|
|
51
51
|
* The version of this server software.
|
|
52
52
|
*/
|
|
53
|
-
version: string;
|
|
53
|
+
readonly version: string;
|
|
54
54
|
/**
|
|
55
55
|
* The URL of the source code repository of this server software.
|
|
56
56
|
*/
|
|
57
|
-
repository?: URL;
|
|
57
|
+
readonly repository?: URL;
|
|
58
58
|
/**
|
|
59
59
|
* The URL of the homepage of this server software.
|
|
60
60
|
*/
|
|
61
|
-
homepage?: URL;
|
|
61
|
+
readonly homepage?: URL;
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
64
|
* The protocols supported on this server.
|
|
@@ -72,12 +72,12 @@ interface Services {
|
|
|
72
72
|
* The third party sites this server can retrieve messages from for combined
|
|
73
73
|
* display with regular traffic.
|
|
74
74
|
*/
|
|
75
|
-
inbound?: InboundService[];
|
|
75
|
+
readonly inbound?: readonly InboundService[];
|
|
76
76
|
/**
|
|
77
77
|
* The third party sites this server can publish messages to on the behalf
|
|
78
78
|
* of a user.
|
|
79
79
|
*/
|
|
80
|
-
outbound?: OutboundService[];
|
|
80
|
+
readonly outbound?: readonly OutboundService[];
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
83
|
* The third party sites this server can retrieve messages from for combined
|
|
@@ -96,33 +96,33 @@ interface Usage {
|
|
|
96
96
|
/**
|
|
97
97
|
* Statistics about the users of this server.
|
|
98
98
|
*/
|
|
99
|
-
users: {
|
|
99
|
+
readonly users: {
|
|
100
100
|
/**
|
|
101
101
|
* The total amount of on this server registered users. This number
|
|
102
102
|
* has to be an integer greater than or equal to zero.
|
|
103
103
|
*/
|
|
104
|
-
total?: number;
|
|
104
|
+
readonly total?: number;
|
|
105
105
|
/**
|
|
106
106
|
* The amount of users that signed in at least once in the last 180 days.
|
|
107
107
|
* This number has to be an integer greater than or equal to zero.
|
|
108
108
|
*/
|
|
109
|
-
activeHalfyear?: number;
|
|
109
|
+
readonly activeHalfyear?: number;
|
|
110
110
|
/**
|
|
111
111
|
* The amount of users that signed in at least once in the last 30 days.
|
|
112
112
|
* This number has to be an integer greater than or equal to zero.
|
|
113
113
|
*/
|
|
114
|
-
activeMonth?: number;
|
|
114
|
+
readonly activeMonth?: number;
|
|
115
115
|
};
|
|
116
116
|
/**
|
|
117
117
|
* The amount of posts that were made by users that are registered on this
|
|
118
118
|
* server. This number has to be an integer greater than or equal to zero.
|
|
119
119
|
*/
|
|
120
|
-
localPosts: number;
|
|
120
|
+
readonly localPosts: number;
|
|
121
121
|
/**
|
|
122
122
|
* The amount of comments that were made by users that are registered on this
|
|
123
123
|
* server. This number has to be an integer greater than or equal to zero.
|
|
124
124
|
*/
|
|
125
|
-
localComments: number;
|
|
125
|
+
readonly localComments: number;
|
|
126
126
|
}
|
|
127
127
|
/**
|
|
128
128
|
* Converts a {@link NodeInfo} object to a JSON value.
|
package/dist/compat/mod.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "../client-
|
|
1
|
+
import "../client-by-PEGAJ.cjs";
|
|
2
2
|
import "../http-ClB3pLcL.cjs";
|
|
3
3
|
import "../owner-C-zfmVAD.cjs";
|
|
4
|
-
import { ActivityTransformer } from "../context-
|
|
5
|
-
import "../kv-
|
|
6
|
-
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-
|
|
4
|
+
import { ActivityTransformer } from "../context-CrB9RFy5.cjs";
|
|
5
|
+
import "../kv-B4vFhIYL.cjs";
|
|
6
|
+
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-D6pS5_xJ.cjs";
|
|
7
7
|
export { ActivityTransformer, actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
|
package/dist/compat/mod.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import "../client-
|
|
3
|
+
import "../client-CUTUGgvJ.js";
|
|
4
4
|
import "../http-DLBDPal9.js";
|
|
5
5
|
import "../owner-BgI8C-VY.js";
|
|
6
|
-
import { ActivityTransformer } from "../context-
|
|
7
|
-
import "../kv-
|
|
8
|
-
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-
|
|
6
|
+
import { ActivityTransformer } from "../context-C7vzWilY.js";
|
|
7
|
+
import "../kv-CYySNrsn.js";
|
|
8
|
+
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-waqu-BL_.js";
|
|
9
9
|
export { ActivityTransformer, actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
|
|
@@ -8,25 +8,25 @@ import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
9
|
import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
|
|
10
10
|
import { MemoryKvStore } from "../kv-QzKcOQgP.js";
|
|
11
|
-
import "../deno-
|
|
12
|
-
import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-
|
|
13
|
-
import "../client-
|
|
11
|
+
import "../deno-Cif1-iL_.js";
|
|
12
|
+
import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-CQv0UNYy.js";
|
|
13
|
+
import "../client-Dg7OfUDA.js";
|
|
14
14
|
import "../router-D9eI0s4b.js";
|
|
15
|
-
import "../types-
|
|
16
|
-
import "../key-
|
|
17
|
-
import "../http-
|
|
18
|
-
import "../ld-
|
|
19
|
-
import "../owner-
|
|
20
|
-
import "../proof-
|
|
21
|
-
import "../docloader-
|
|
15
|
+
import "../types-CPz01LGH.js";
|
|
16
|
+
import "../key-Bw4eVboO.js";
|
|
17
|
+
import "../http-B99rtXjf.js";
|
|
18
|
+
import "../ld-1OEVoX2N.js";
|
|
19
|
+
import "../owner-w_YNARRI.js";
|
|
20
|
+
import "../proof-C8vStykH.js";
|
|
21
|
+
import "../docloader-CVaWaEcp.js";
|
|
22
22
|
import "../kv-cache-BEeqyGER.js";
|
|
23
|
-
import "../inbox-
|
|
24
|
-
import "../builder-
|
|
23
|
+
import "../inbox-BC3B2xqc.js";
|
|
24
|
+
import "../builder-Khy2m25E.js";
|
|
25
25
|
import "../collection-CcnIw1qY.js";
|
|
26
26
|
import "../keycache-DRxpZ5r9.js";
|
|
27
27
|
import "../negotiation-5NPJL6zp.js";
|
|
28
28
|
import "../retry-D4GJ670a.js";
|
|
29
|
-
import "../send-
|
|
29
|
+
import "../send-C77cZsvd.js";
|
|
30
30
|
import { Follow, Person } from "@fedify/vocab";
|
|
31
31
|
|
|
32
32
|
//#region src/compat/transformers.test.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { GetNodeInfoOptions, JsonValue, NodeInfo } from "./client-
|
|
3
|
+
import { GetNodeInfoOptions, JsonValue, NodeInfo } from "./client-CUTUGgvJ.js";
|
|
4
4
|
import { HttpMessageSignaturesSpec } from "./http-DLBDPal9.js";
|
|
5
5
|
import { GetKeyOwnerOptions } from "./owner-BgI8C-VY.js";
|
|
6
|
-
import { KvKey, KvStore } from "./kv-
|
|
6
|
+
import { KvKey, KvStore } from "./kv-CYySNrsn.js";
|
|
7
7
|
import { Activity, Actor, Collection, CryptographicKey, Hashtag, Link, LookupObjectOptions, Multikey, Object as Object$1, Recipient, TraverseCollectionOptions } from "@fedify/vocab";
|
|
8
8
|
import { Span, Tracer, TracerProvider } from "@opentelemetry/api";
|
|
9
9
|
import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, GetUserAgentOptions } from "@fedify/vocab-runtime";
|
|
@@ -21,9 +21,9 @@ type ActivityTransformer<TContextData> = (activity: Activity, context: Context<T
|
|
|
21
21
|
* A page of items.
|
|
22
22
|
*/
|
|
23
23
|
interface PageItems<TItem> {
|
|
24
|
-
prevCursor?: string | null;
|
|
25
|
-
nextCursor?: string | null;
|
|
26
|
-
items: TItem[];
|
|
24
|
+
readonly prevCursor?: string | null;
|
|
25
|
+
readonly nextCursor?: string | null;
|
|
26
|
+
readonly items: readonly TItem[];
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Calculates the [partial follower collection digest][1].
|
|
@@ -53,11 +53,11 @@ interface SenderKeyPair {
|
|
|
53
53
|
/**
|
|
54
54
|
* The actor's private key to sign the request.
|
|
55
55
|
*/
|
|
56
|
-
privateKey: CryptoKey;
|
|
56
|
+
readonly privateKey: CryptoKey;
|
|
57
57
|
/**
|
|
58
58
|
* The public key ID that corresponds to the private key.
|
|
59
59
|
*/
|
|
60
|
-
keyId: URL;
|
|
60
|
+
readonly keyId: URL;
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
63
|
* Parameters for {@link sendActivity}.
|
|
@@ -360,7 +360,7 @@ interface MessageQueue {
|
|
|
360
360
|
* @param messages The messages to enqueue.
|
|
361
361
|
* @param options Additional options for enqueuing the messages.
|
|
362
362
|
*/
|
|
363
|
-
enqueueMany?: (messages: any[], options?: MessageQueueEnqueueOptions) => Promise<void>;
|
|
363
|
+
enqueueMany?: (messages: readonly any[], options?: MessageQueueEnqueueOptions) => Promise<void>;
|
|
364
364
|
/**
|
|
365
365
|
* Listens for messages in the queue.
|
|
366
366
|
* @param handler The handler for messages in the queue.
|
|
@@ -402,7 +402,7 @@ declare class InProcessMessageQueue implements MessageQueue {
|
|
|
402
402
|
*/
|
|
403
403
|
constructor(options?: InProcessMessageQueueOptions);
|
|
404
404
|
enqueue(message: any, options?: MessageQueueEnqueueOptions): Promise<void>;
|
|
405
|
-
enqueueMany(messages: any[], options?: MessageQueueEnqueueOptions): Promise<void>;
|
|
405
|
+
enqueueMany(messages: readonly any[], options?: MessageQueueEnqueueOptions): Promise<void>;
|
|
406
406
|
listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
|
|
407
407
|
}
|
|
408
408
|
/**
|
|
@@ -440,7 +440,7 @@ declare class ParallelMessageQueue implements MessageQueue {
|
|
|
440
440
|
*/
|
|
441
441
|
constructor(queue: MessageQueue, workers: number);
|
|
442
442
|
enqueue(message: any, options?: MessageQueueEnqueueOptions): Promise<void>;
|
|
443
|
-
enqueueMany(messages: any[], options?: MessageQueueEnqueueOptions): Promise<void>;
|
|
443
|
+
enqueueMany(messages: readonly any[], options?: MessageQueueEnqueueOptions): Promise<void>;
|
|
444
444
|
listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
|
|
445
445
|
}
|
|
446
446
|
//#endregion
|
|
@@ -571,8 +571,8 @@ declare function createFederationBuilder<TContextData>(): FederationBuilder<TCon
|
|
|
571
571
|
//#endregion
|
|
572
572
|
//#region src/federation/queue.d.ts
|
|
573
573
|
interface SenderKeyJwkPair {
|
|
574
|
-
keyId: string;
|
|
575
|
-
privateKey: JsonWebKey;
|
|
574
|
+
readonly keyId: string;
|
|
575
|
+
readonly privateKey: JsonWebKey;
|
|
576
576
|
}
|
|
577
577
|
/**
|
|
578
578
|
* A message that represents a task to be processed by the background worker.
|
|
@@ -585,44 +585,44 @@ interface SenderKeyJwkPair {
|
|
|
585
585
|
*/
|
|
586
586
|
type Message = FanoutMessage | OutboxMessage | InboxMessage;
|
|
587
587
|
interface FanoutMessage {
|
|
588
|
-
type: "fanout";
|
|
589
|
-
id: ReturnType<typeof crypto.randomUUID>;
|
|
590
|
-
baseUrl: string;
|
|
591
|
-
keys: SenderKeyJwkPair[];
|
|
592
|
-
inboxes: Record<string, {
|
|
593
|
-
actorIds: string[];
|
|
594
|
-
sharedInbox: boolean;
|
|
595
|
-
}
|
|
596
|
-
activity: unknown;
|
|
597
|
-
activityId?: string;
|
|
598
|
-
activityType: string;
|
|
599
|
-
collectionSync?: string;
|
|
600
|
-
traceContext: Record<string, string
|
|
588
|
+
readonly type: "fanout";
|
|
589
|
+
readonly id: ReturnType<typeof crypto.randomUUID>;
|
|
590
|
+
readonly baseUrl: string;
|
|
591
|
+
readonly keys: readonly SenderKeyJwkPair[];
|
|
592
|
+
readonly inboxes: Readonly<Record<string, {
|
|
593
|
+
readonly actorIds: readonly string[];
|
|
594
|
+
readonly sharedInbox: boolean;
|
|
595
|
+
}>>;
|
|
596
|
+
readonly activity: unknown;
|
|
597
|
+
readonly activityId?: string;
|
|
598
|
+
readonly activityType: string;
|
|
599
|
+
readonly collectionSync?: string;
|
|
600
|
+
readonly traceContext: Readonly<Record<string, string>>;
|
|
601
601
|
}
|
|
602
602
|
interface OutboxMessage {
|
|
603
|
-
type: "outbox";
|
|
604
|
-
id: ReturnType<typeof crypto.randomUUID>;
|
|
605
|
-
baseUrl: string;
|
|
606
|
-
keys: SenderKeyJwkPair[];
|
|
607
|
-
activity: unknown;
|
|
608
|
-
activityId?: string;
|
|
609
|
-
activityType: string;
|
|
610
|
-
inbox: string;
|
|
611
|
-
sharedInbox: boolean;
|
|
612
|
-
started: string;
|
|
613
|
-
attempt: number;
|
|
614
|
-
headers: Record<string, string
|
|
615
|
-
traceContext: Record<string, string
|
|
603
|
+
readonly type: "outbox";
|
|
604
|
+
readonly id: ReturnType<typeof crypto.randomUUID>;
|
|
605
|
+
readonly baseUrl: string;
|
|
606
|
+
readonly keys: readonly SenderKeyJwkPair[];
|
|
607
|
+
readonly activity: unknown;
|
|
608
|
+
readonly activityId?: string;
|
|
609
|
+
readonly activityType: string;
|
|
610
|
+
readonly inbox: string;
|
|
611
|
+
readonly sharedInbox: boolean;
|
|
612
|
+
readonly started: string;
|
|
613
|
+
readonly attempt: number;
|
|
614
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
615
|
+
readonly traceContext: Readonly<Record<string, string>>;
|
|
616
616
|
}
|
|
617
617
|
interface InboxMessage {
|
|
618
|
-
type: "inbox";
|
|
619
|
-
id: ReturnType<typeof crypto.randomUUID>;
|
|
620
|
-
baseUrl: string;
|
|
621
|
-
activity: unknown;
|
|
622
|
-
started: string;
|
|
623
|
-
attempt: number;
|
|
624
|
-
identifier: string | null;
|
|
625
|
-
traceContext: Record<string, string
|
|
618
|
+
readonly type: "inbox";
|
|
619
|
+
readonly id: ReturnType<typeof crypto.randomUUID>;
|
|
620
|
+
readonly baseUrl: string;
|
|
621
|
+
readonly activity: unknown;
|
|
622
|
+
readonly started: string;
|
|
623
|
+
readonly attempt: number;
|
|
624
|
+
readonly identifier: string | null;
|
|
625
|
+
readonly traceContext: Readonly<Record<string, string>>;
|
|
626
626
|
}
|
|
627
627
|
//#endregion
|
|
628
628
|
//#region src/federation/retry.d.ts
|
|
@@ -706,19 +706,19 @@ interface FederationQueueOptions {
|
|
|
706
706
|
* The message queue for incoming activities. If not provided, incoming
|
|
707
707
|
* activities will not be queued and will be processed immediately.
|
|
708
708
|
*/
|
|
709
|
-
inbox?: MessageQueue;
|
|
709
|
+
readonly inbox?: MessageQueue;
|
|
710
710
|
/**
|
|
711
711
|
* The message queue for outgoing activities. If not provided, outgoing
|
|
712
712
|
* activities will not be queued and will be sent immediately.
|
|
713
713
|
*/
|
|
714
|
-
outbox?: MessageQueue;
|
|
714
|
+
readonly outbox?: MessageQueue;
|
|
715
715
|
/**
|
|
716
716
|
* The message queue for fanning out outgoing activities. If not provided,
|
|
717
717
|
* outgoing activities will not be fanned out in the background, but will be
|
|
718
718
|
* fanned out immediately, which causes slow response times on
|
|
719
719
|
* {@link Context.sendActivity} calls.
|
|
720
720
|
*/
|
|
721
|
-
fanout?: MessageQueue;
|
|
721
|
+
readonly fanout?: MessageQueue;
|
|
722
722
|
}
|
|
723
723
|
/**
|
|
724
724
|
* Prefixes for namespacing keys in the Deno KV store.
|
|
@@ -729,18 +729,18 @@ interface FederationKvPrefixes {
|
|
|
729
729
|
* processed or not.
|
|
730
730
|
* @default `["_fedify", "activityIdempotence"]`
|
|
731
731
|
*/
|
|
732
|
-
activityIdempotence: KvKey;
|
|
732
|
+
readonly activityIdempotence: KvKey;
|
|
733
733
|
/**
|
|
734
734
|
* The key prefix used for storing remote JSON-LD documents.
|
|
735
735
|
* @default `["_fedify", "remoteDocument"]`
|
|
736
736
|
*/
|
|
737
|
-
remoteDocument: KvKey;
|
|
737
|
+
readonly remoteDocument: KvKey;
|
|
738
738
|
/**
|
|
739
739
|
* The key prefix used for caching public keys.
|
|
740
740
|
* @default `["_fedify", "publicKey"]`
|
|
741
741
|
* @since 0.12.0
|
|
742
742
|
*/
|
|
743
|
-
publicKey: KvKey;
|
|
743
|
+
readonly publicKey: KvKey;
|
|
744
744
|
/**
|
|
745
745
|
* The key prefix used for caching HTTP Message Signatures specs.
|
|
746
746
|
* The cached spec is used to reduce the number of requests to make signed
|
|
@@ -748,7 +748,7 @@ interface FederationKvPrefixes {
|
|
|
748
748
|
* @default `["_fedify", "httpMessageSignaturesSpec"]`
|
|
749
749
|
* @since 1.6.0
|
|
750
750
|
*/
|
|
751
|
-
httpMessageSignaturesSpec: KvKey;
|
|
751
|
+
readonly httpMessageSignaturesSpec: KvKey;
|
|
752
752
|
}
|
|
753
753
|
/**
|
|
754
754
|
* Options for {@link CreateFederationOptions.origin} when it is not a string.
|
|
@@ -2162,7 +2162,7 @@ interface InboxContext<TContextData> extends Context<TContextData> {
|
|
|
2162
2162
|
* inbox, it is `null`.
|
|
2163
2163
|
* @since 1.2.0
|
|
2164
2164
|
*/
|
|
2165
|
-
recipient: string | null;
|
|
2165
|
+
readonly recipient: string | null;
|
|
2166
2166
|
/**
|
|
2167
2167
|
* Creates a new context with the same properties as this one,
|
|
2168
2168
|
* but with the given data.
|
|
@@ -2352,7 +2352,7 @@ interface SendActivityOptions {
|
|
|
2352
2352
|
*
|
|
2353
2353
|
* @since 0.9.0
|
|
2354
2354
|
*/
|
|
2355
|
-
excludeBaseUris?: URL[];
|
|
2355
|
+
readonly excludeBaseUris?: readonly URL[];
|
|
2356
2356
|
}
|
|
2357
2357
|
/**
|
|
2358
2358
|
* Options for {@link Context.sendActivity} method when sending to a collection.
|
|
@@ -2435,15 +2435,15 @@ interface ActorKeyPair extends CryptoKeyPair {
|
|
|
2435
2435
|
/**
|
|
2436
2436
|
* The URI of the public key, which is used for verifying HTTP Signatures.
|
|
2437
2437
|
*/
|
|
2438
|
-
keyId: URL;
|
|
2438
|
+
readonly keyId: URL;
|
|
2439
2439
|
/**
|
|
2440
2440
|
* A {@link CryptographicKey} instance of the public key.
|
|
2441
2441
|
*/
|
|
2442
|
-
cryptographicKey: CryptographicKey;
|
|
2442
|
+
readonly cryptographicKey: CryptographicKey;
|
|
2443
2443
|
/**
|
|
2444
2444
|
* A {@link Multikey} instance of the public key.
|
|
2445
2445
|
*/
|
|
2446
|
-
multikey: Multikey;
|
|
2446
|
+
readonly multikey: Multikey;
|
|
2447
2447
|
}
|
|
2448
2448
|
//#endregion
|
|
2449
2449
|
export { ActivityTransformer, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CreateFederationOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable };
|