@fedify/fedify 2.2.0-dev.613 → 2.2.0-dev.622
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/{accept-D7sAxyNa.js → accept-Dd__NiUL.mjs} +10 -8
- package/dist/{assert-MZs1qjMx.js → assert-ddO5KLpe.mjs} +5 -9
- package/dist/{assert_equals-DSbWqCm3.js → assert_equals-Ew3jOFa3.mjs} +55 -69
- package/dist/{assert_instance_of-DHz7EHNU.js → assert_instance_of-C4Ri6VuN.mjs} +5 -9
- package/dist/{assert_not_equals-f3m3epl3.js → assert_not_equals--wG9hV7u.mjs} +6 -13
- package/dist/{assert_rejects-0h7I2Esa.js → assert_rejects-B-qJtC9Z.mjs} +6 -11
- package/dist/{assert_throws-rjdMBf31.js → assert_throws-4NwKEy2q.mjs} +5 -10
- package/dist/{builder-OscY92PK.js → builder-DcSpny3g.mjs} +32 -41
- package/dist/{chunk-CGaQZ11T.cjs → chunk-DDcVe30Y.cjs} +23 -24
- package/dist/{chunk-DJNbSFdH.js → chunk-nlSIicah.js} +8 -8
- package/dist/{client-BxMZiQaD.d.ts → client-AtlibPOU.d.ts} +1 -1
- package/dist/{client-CoCIaTNO.js → client-DEpOVgY1.mjs} +9 -13
- package/dist/{client-C97KOq3x.d.cts → client-z-8dc-e1.d.cts} +1 -1
- package/dist/{collection-CSzG2j1P.js → collection-BD6-SZ6O.mjs} +7 -12
- package/dist/compat/mod.cjs +5 -8
- package/dist/compat/mod.d.cts +78 -6
- package/dist/compat/mod.d.ts +78 -6
- package/dist/compat/mod.js +4 -8
- package/dist/compat/transformers.test.mjs +62 -0
- package/dist/{context-DyJjQQ_H.d.ts → context-BOiMZBu5.d.ts} +9 -18
- package/dist/{context-BcqA-0BL.d.cts → context-BhZVy7RB.d.cts} +9 -18
- package/dist/{context-Aqenou7c.js → context-Juj6bdHC.mjs} +7 -11
- package/dist/deno-D682wzlW.mjs +8 -0
- package/dist/{docloader-JiZmL7BP.js → docloader-CCWf4tNV.mjs} +8 -14
- package/dist/{esm-nLm00z9V.js → esm-DVILvP5e.mjs} +50 -89
- package/dist/federation/builder.test.d.mts +2 -0
- package/dist/federation/{builder.test.js → builder.test.mjs} +21 -44
- package/dist/federation/collection.test.d.mts +2 -0
- package/dist/federation/collection.test.mjs +21 -0
- package/dist/federation/handler.test.d.mts +2 -0
- package/dist/federation/{handler.test.js → handler.test.mjs} +69 -131
- package/dist/federation/idempotency.test.d.mts +2 -0
- package/dist/federation/{idempotency.test.js → idempotency.test.mjs} +31 -63
- package/dist/federation/inbox.test.d.mts +2 -0
- package/dist/federation/{inbox.test.js → inbox.test.mjs} +8 -12
- package/dist/federation/keycache.test.d.mts +2 -0
- package/dist/federation/{keycache.test.js → keycache.test.mjs} +13 -19
- package/dist/federation/kv.test.d.mts +2 -0
- package/dist/federation/{kv.test.js → kv.test.mjs} +11 -22
- package/dist/federation/middleware.test.d.mts +2 -0
- package/dist/federation/{middleware.test.js → middleware.test.mjs} +173 -262
- package/dist/federation/mod.cjs +327 -16
- package/dist/federation/mod.d.cts +3 -6
- package/dist/federation/mod.d.ts +3 -6
- package/dist/federation/mod.js +322 -13
- package/dist/federation/mq.test.d.mts +2 -0
- package/dist/federation/{mq.test.js → mq.test.mjs} +21 -35
- package/dist/federation/negotiation.test.d.mts +2 -0
- package/dist/federation/{negotiation.test.js → negotiation.test.mjs} +9 -16
- package/dist/federation/retry.test.d.mts +2 -0
- package/dist/federation/{retry.test.js → retry.test.mjs} +8 -11
- package/dist/federation/router.test.d.mts +2 -0
- package/dist/federation/{router.test.js → router.test.mjs} +11 -16
- package/dist/federation/send.test.d.mts +2 -0
- package/dist/federation/{send.test.js → send.test.mjs} +22 -30
- package/dist/federation/webfinger.test.d.mts +2 -0
- package/dist/federation/{webfinger.test.js → webfinger.test.mjs} +22 -56
- package/dist/{http-BnsR906R.cjs → http-BQccxQlj.cjs} +177 -302
- package/dist/{http-CKaqhjvP.js → http-CNsnyqrO.mjs} +23 -43
- package/dist/{http-BudnHZE2.d.cts → http-CrGuipxe.d.cts} +1 -6
- package/dist/{http-IFqEftoZ.js → http-DhwEMhtv.js} +53 -184
- package/dist/{http-Dax_FIBo.d.ts → http-aQzN9Ayi.d.ts} +1 -6
- package/dist/{inbox-Bd91CVJP.js → inbox-DegXbbbS.mjs} +18 -26
- package/dist/{key-DFLFXKER.js → key-vL60OvqM.mjs} +29 -37
- package/dist/{keycache-CpGWAUbj.js → keycache-CCSwkQcY.mjs} +5 -10
- package/dist/{keys-BFve7QQv.js → keys-BAK-tUlf.mjs} +5 -9
- package/dist/{kv-BL4nlICN.d.cts → kv-CbLNp3zQ.d.cts} +1 -1
- package/dist/{kv-DXEUEP6z.d.ts → kv-GFYnFoOl.d.ts} +1 -1
- package/dist/{kv-cache-Bw2F2ABq.js → kv-cache-B01V7s3h.mjs} +4 -8
- package/dist/{kv-cache-Drlz6O_Y.js → kv-cache-CTj3iCix.js} +6 -13
- package/dist/{kv-cache-BLXcQvyb.cjs → kv-cache-DxdXJNbj.cjs} +27 -34
- package/dist/{kv-QzKcOQgP.js → kv-tL2TOE9X.mjs} +6 -10
- package/dist/{ld-CGGXZJK0.js → ld-C3CO00YY.mjs} +17 -31
- package/dist/{middleware-DcpBikad.js → middleware-BmsVSOeS.js} +335 -382
- package/dist/middleware-C7shNcsp.cjs +4 -0
- package/dist/{middleware-B51dB75z.cjs → middleware-Cx0Ny6_7.cjs} +532 -587
- package/dist/middleware-DqVGYk56.mjs +5 -0
- package/dist/{middleware-B53r4pdM.js → middleware-Du-vh7I_.mjs} +282 -317
- package/dist/{mod-em2Il1eD.d.cts → mod-Bp_CzKd4.d.cts} +2 -2
- package/dist/{mod-DCbh1JQ5.d.ts → mod-CLgIXe9w.d.ts} +3 -3
- package/dist/{mod-jfnweK2w.d.cts → mod-CMEbIaNh.d.cts} +3 -3
- package/dist/{mod-D6MdymW7.d.ts → mod-DKOAow7a.d.ts} +2 -2
- package/dist/{mod-Coe7KEgX.d.cts → mod-DoJBjjnO.d.cts} +2 -2
- package/dist/{mod-D6dOd--H.d.ts → mod-DvxszxXC.d.ts} +2 -2
- package/dist/mod.cjs +29 -74
- package/dist/mod.d.cts +11 -14
- package/dist/mod.d.ts +11 -15
- package/dist/mod.js +17 -71
- package/dist/{negotiation-BlAuS_nr.js → negotiation-DnsfFF8I.mjs} +7 -11
- package/dist/nodeinfo/client.test.d.mts +2 -0
- package/dist/nodeinfo/{client.test.js → client.test.mjs} +22 -40
- package/dist/nodeinfo/handler.test.d.mts +2 -0
- package/dist/nodeinfo/{handler.test.js → handler.test.mjs} +13 -43
- package/dist/nodeinfo/mod.cjs +5 -8
- package/dist/nodeinfo/mod.d.cts +2 -3
- package/dist/nodeinfo/mod.d.ts +2 -3
- package/dist/nodeinfo/mod.js +4 -8
- package/dist/nodeinfo/types.test.d.mts +2 -0
- package/dist/nodeinfo/{types.test.js → types.test.mjs} +9 -16
- package/dist/otel/exporter.test.d.mts +2 -0
- package/dist/otel/{exporter.test.js → exporter.test.mjs} +124 -178
- package/dist/otel/mod.cjs +15 -20
- package/dist/otel/mod.d.cts +2 -2
- package/dist/otel/mod.d.ts +2 -2
- package/dist/otel/mod.js +8 -14
- package/dist/{owner-gd0Q9FuU.d.ts → owner-74ARJ5TL.d.ts} +1 -1
- package/dist/{owner-1AbPBOOZ.d.cts → owner-CptqhsOy.d.cts} +1 -1
- package/dist/{owner-Cye0yQB_.js → owner-DF320w6K.mjs} +11 -16
- package/dist/{proof-DdGGXVWM.js → proof-BCWk5oas.js} +32 -58
- package/dist/{proof-DV5lC_Bw.js → proof-IyDwwmzL.mjs} +21 -33
- package/dist/{proof-CN5iR1tW.cjs → proof-WhNxSv_N.cjs} +133 -157
- package/dist/{retry-mqLf4b-R.js → retry-B_E3V_Dx.mjs} +4 -7
- package/dist/{router-D9eI0s4b.js → router-CrMLXoOr.mjs} +4 -8
- package/dist/runtime/mod.cjs +11 -13
- package/dist/runtime/mod.d.cts +6 -2
- package/dist/runtime/mod.d.ts +0 -1
- package/dist/runtime/mod.js +4 -7
- package/dist/{send-C2a_3YAF.js → send-CJQubr5t.mjs} +8 -13
- package/dist/sig/accept.test.d.mts +2 -0
- package/dist/sig/{accept.test.js → accept.test.mjs} +35 -70
- package/dist/sig/http.test.d.mts +2 -0
- package/dist/sig/{http.test.js → http.test.mjs} +166 -280
- package/dist/sig/key.test.d.mts +2 -0
- package/dist/sig/{key.test.js → key.test.mjs} +11 -18
- package/dist/sig/ld.test.d.mts +2 -0
- package/dist/sig/{ld.test.js → ld.test.mjs} +22 -35
- package/dist/sig/mod.cjs +6 -9
- package/dist/sig/mod.d.cts +3 -3
- package/dist/sig/mod.d.ts +3 -3
- package/dist/sig/mod.js +5 -9
- package/dist/sig/owner.test.d.mts +2 -0
- package/dist/sig/{owner.test.js → owner.test.mjs} +19 -34
- package/dist/sig/proof.test.d.mts +2 -0
- package/dist/sig/{proof.test.js → proof.test.mjs} +16 -27
- package/dist/{std__assert-X-_kMxKM.js → std__assert-Duiq_YC9.mjs} +12 -24
- package/dist/testing/{mod.d.ts → mod.d.mts} +26 -90
- package/dist/testing/mod.mjs +6 -0
- package/dist/{transformers-3g8GZwkZ.cjs → transformers-NeAONrAq.cjs} +20 -25
- package/dist/{transformers-C3FLHUd6.js → transformers-ve6e2xcg.js} +3 -7
- package/dist/{types-CPz01LGH.js → types-DCP0WLdt.mjs} +4 -7
- package/dist/{types-Cd_hszr_.cjs → types-KC4QAoxe.cjs} +29 -34
- package/dist/{types-C93Ob9cU.js → types-hvL8ElAs.js} +8 -13
- package/dist/utils/docloader.test.d.mts +2 -0
- package/dist/utils/{docloader.test.js → docloader.test.mjs} +14 -25
- package/dist/utils/kv-cache.test.d.mts +2 -0
- package/dist/utils/{kv-cache.test.js → kv-cache.test.mjs} +25 -40
- package/dist/utils/mod.cjs +5 -9
- package/dist/utils/mod.d.cts +1 -3
- package/dist/utils/mod.d.ts +1 -3
- package/dist/utils/mod.js +4 -9
- package/dist/vocab/cjs.test.d.mts +2 -0
- package/dist/vocab/cjs.test.mjs +14 -0
- package/dist/vocab/mod.cjs +10 -12
- package/dist/vocab/mod.js +3 -5
- package/package.json +8 -8
- package/dist/compat/transformers.test.d.ts +0 -3
- package/dist/compat/transformers.test.js +0 -88
- package/dist/compat-Bb4NuTUO.js +0 -4
- package/dist/compat-DmDDELst.cjs +0 -4
- package/dist/deno-CnMqla6T.js +0 -121
- package/dist/federation/builder.test.d.ts +0 -3
- package/dist/federation/collection.test.d.ts +0 -3
- package/dist/federation/collection.test.js +0 -32
- package/dist/federation/handler.test.d.ts +0 -3
- package/dist/federation/idempotency.test.d.ts +0 -3
- package/dist/federation/inbox.test.d.ts +0 -3
- package/dist/federation/keycache.test.d.ts +0 -3
- package/dist/federation/kv.test.d.ts +0 -3
- package/dist/federation/middleware.test.d.ts +0 -3
- package/dist/federation/mq.test.d.ts +0 -3
- package/dist/federation/negotiation.test.d.ts +0 -3
- package/dist/federation/retry.test.d.ts +0 -3
- package/dist/federation/router.test.d.ts +0 -3
- package/dist/federation/send.test.d.ts +0 -3
- package/dist/federation/webfinger.test.d.ts +0 -3
- package/dist/federation-Bp3HI26G.cjs +0 -350
- package/dist/federation-DaMfqRm4.js +0 -332
- package/dist/middleware-B0kNQMO0.js +0 -27
- package/dist/middleware-BYQL9cdV.js +0 -12
- package/dist/middleware-DfNqksSs.cjs +0 -12
- package/dist/mod-B7QkWzrL.d.cts +0 -80
- package/dist/mod-Bh8mqlYw.d.cts +0 -9
- package/dist/mod-D6HodEq7.d.ts +0 -7
- package/dist/mod-SMHOMNpZ.d.ts +0 -82
- package/dist/mod-gq_Xfdz8.d.cts +0 -1
- package/dist/nodeinfo/client.test.d.ts +0 -3
- package/dist/nodeinfo/handler.test.d.ts +0 -3
- package/dist/nodeinfo/types.test.d.ts +0 -3
- package/dist/nodeinfo-DoESQxq5.js +0 -4
- package/dist/nodeinfo-DuMYTpbZ.cjs +0 -4
- package/dist/otel/exporter.test.d.ts +0 -3
- package/dist/runtime-c2Njxsry.cjs +0 -17
- package/dist/runtime-poamPCMb.js +0 -13
- package/dist/sig/accept.test.d.ts +0 -3
- package/dist/sig/http.test.d.ts +0 -3
- package/dist/sig/key.test.d.ts +0 -3
- package/dist/sig/ld.test.d.ts +0 -3
- package/dist/sig/owner.test.d.ts +0 -3
- package/dist/sig/proof.test.d.ts +0 -3
- package/dist/sig-BNhspNOf.js +0 -4
- package/dist/sig-vX39WyWI.cjs +0 -4
- package/dist/testing/mod.js +0 -10
- package/dist/utils/docloader.test.d.ts +0 -3
- package/dist/utils/kv-cache.test.d.ts +0 -3
- package/dist/utils-BQ9KqEK9.cjs +0 -4
- package/dist/utils-Dn5OPdSW.js +0 -4
- /package/dist/{mod-AGjRfPjT.d.ts → compat/transformers.test.d.mts} +0 -0
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
globalThis.addEventListener = () => {};
|
|
5
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
6
4
|
import { getLogger } from "@logtape/logtape";
|
|
7
5
|
import { Item, decodeDict, encodeDict } from "structured-field-values";
|
|
8
|
-
|
|
9
6
|
//#region src/sig/accept.ts
|
|
10
7
|
/**
|
|
8
|
+
* `Accept-Signature` header parsing, serialization, and validation utilities
|
|
9
|
+
* for RFC 9421 §5 challenge-response negotiation.
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
11
14
|
* Parses an `Accept-Signature` header value (RFC 9421 §5.1) into an
|
|
12
15
|
* array of {@link AcceptSignatureMember} objects.
|
|
13
16
|
*
|
|
@@ -138,6 +141,5 @@ function fulfillAcceptSignature(entry, localKeyId, localAlg) {
|
|
|
138
141
|
expires: entry.parameters.expires
|
|
139
142
|
};
|
|
140
143
|
}
|
|
141
|
-
|
|
142
144
|
//#endregion
|
|
143
|
-
export {
|
|
145
|
+
export { validateAcceptSignature as i, fulfillAcceptSignature as n, parseAcceptSignature as r, formatAcceptSignature as t };
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { AssertionError } from "./assert_equals-DSbWqCm3.js";
|
|
7
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { l as AssertionError } from "./assert_equals-Ew3jOFa3.mjs";
|
|
8
5
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert.js
|
|
9
6
|
/**
|
|
10
7
|
* Make an assertion, error will be thrown if `expr` does not have truthy value.
|
|
@@ -22,6 +19,5 @@ import { AssertionError } from "./assert_equals-DSbWqCm3.js";
|
|
|
22
19
|
*/ function assert(expr, msg = "") {
|
|
23
20
|
if (!expr) throw new AssertionError(msg);
|
|
24
21
|
}
|
|
25
|
-
|
|
26
22
|
//#endregion
|
|
27
|
-
export { assert };
|
|
23
|
+
export { assert as t };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
globalThis.addEventListener = () => {};
|
|
5
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
6
4
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assertion_error.js
|
|
7
5
|
/**
|
|
8
6
|
* Error thrown when an assertion fails.
|
|
@@ -29,7 +27,6 @@
|
|
|
29
27
|
this.name = "AssertionError";
|
|
30
28
|
}
|
|
31
29
|
};
|
|
32
|
-
|
|
33
30
|
//#endregion
|
|
34
31
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/equal.js
|
|
35
32
|
function isKeyedCollection(x) {
|
|
@@ -103,7 +100,37 @@ function constructorsEqual(a, b) {
|
|
|
103
100
|
return false;
|
|
104
101
|
}(c, d);
|
|
105
102
|
}
|
|
106
|
-
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region ../../node_modules/.pnpm/@jsr+std__internal@1.0.8/node_modules/@jsr/std__internal/format.js
|
|
105
|
+
/**
|
|
106
|
+
* Converts the input into a string. Objects, Sets and Maps are sorted so as to
|
|
107
|
+
* make tests less flaky.
|
|
108
|
+
*
|
|
109
|
+
* @param v Value to be formatted
|
|
110
|
+
*
|
|
111
|
+
* @returns The formatted string
|
|
112
|
+
*
|
|
113
|
+
* @example Usage
|
|
114
|
+
* ```ts
|
|
115
|
+
* import { format } from "@std/internal/format";
|
|
116
|
+
* import { assertEquals } from "@std/assert";
|
|
117
|
+
*
|
|
118
|
+
* assertEquals(format({ a: 1, b: 2 }), "{\n a: 1,\n b: 2,\n}");
|
|
119
|
+
* assertEquals(format(new Set([1, 2])), "Set(2) {\n 1,\n 2,\n}");
|
|
120
|
+
* assertEquals(format(new Map([[1, 2]])), "Map(1) {\n 1 => 2,\n}");
|
|
121
|
+
* ```
|
|
122
|
+
*/ function format(v) {
|
|
123
|
+
const { Deno } = globalThis;
|
|
124
|
+
return typeof Deno?.inspect === "function" ? Deno.inspect(v, {
|
|
125
|
+
depth: Infinity,
|
|
126
|
+
sorted: true,
|
|
127
|
+
trailingComma: true,
|
|
128
|
+
compact: false,
|
|
129
|
+
iterableLimit: Infinity,
|
|
130
|
+
getters: true,
|
|
131
|
+
strAbbreviateSize: Infinity
|
|
132
|
+
}) : `"${String(v).replace(/(?=["\\])/g, "\\")}"`;
|
|
133
|
+
}
|
|
107
134
|
//#endregion
|
|
108
135
|
//#region ../../node_modules/.pnpm/@jsr+std__internal@1.0.8/node_modules/@jsr/std__internal/assertion_state.js
|
|
109
136
|
/**
|
|
@@ -281,13 +308,11 @@ function constructorsEqual(a, b) {
|
|
|
281
308
|
return this.#state.assertionCount !== void 0 && this.#state.assertionCount !== this.#state.assertionTriggeredCount;
|
|
282
309
|
}
|
|
283
310
|
};
|
|
284
|
-
|
|
285
|
-
|
|
311
|
+
new AssertionState();
|
|
286
312
|
//#endregion
|
|
287
313
|
//#region ../../node_modules/.pnpm/@jsr+std__internal@1.0.8/node_modules/@jsr/std__internal/styles.js
|
|
288
314
|
const { Deno } = globalThis;
|
|
289
|
-
const
|
|
290
|
-
const enabled = !noColor;
|
|
315
|
+
const enabled = !(typeof Deno?.noColor === "boolean" ? Deno.noColor : false);
|
|
291
316
|
function code(open, close) {
|
|
292
317
|
return {
|
|
293
318
|
open: `\x1b[${open.join(";")}m`,
|
|
@@ -295,8 +320,8 @@ function code(open, close) {
|
|
|
295
320
|
regexp: new RegExp(`\\x1b\\[${close}m`, "g")
|
|
296
321
|
};
|
|
297
322
|
}
|
|
298
|
-
function run(str, code
|
|
299
|
-
return enabled ? `${code
|
|
323
|
+
function run(str, code) {
|
|
324
|
+
return enabled ? `${code.open}${str.replace(code.regexp, code.open)}${code.close}` : str;
|
|
300
325
|
}
|
|
301
326
|
/**
|
|
302
327
|
* Sets the style of text to be printed to bold.
|
|
@@ -449,7 +474,6 @@ const ANSI_PATTERN = new RegExp(["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-z
|
|
|
449
474
|
*/ function stripAnsiCode(string) {
|
|
450
475
|
return string.replace(ANSI_PATTERN, "");
|
|
451
476
|
}
|
|
452
|
-
|
|
453
477
|
//#endregion
|
|
454
478
|
//#region ../../node_modules/.pnpm/@jsr+std__internal@1.0.8/node_modules/@jsr/std__internal/build_message.js
|
|
455
479
|
/**
|
|
@@ -543,7 +567,6 @@ const ANSI_PATTERN = new RegExp(["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-z
|
|
|
543
567
|
messages.push(...stringDiff ? [diffMessages.join("")] : diffMessages, "");
|
|
544
568
|
return messages;
|
|
545
569
|
}
|
|
546
|
-
|
|
547
570
|
//#endregion
|
|
548
571
|
//#region ../../node_modules/.pnpm/@jsr+std__internal@1.0.8/node_modules/@jsr/std__internal/diff.js
|
|
549
572
|
const REMOVED = 1;
|
|
@@ -774,20 +797,20 @@ const ADDED = 3;
|
|
|
774
797
|
*/ const routes = new Uint32Array((M * N + length + 1) * 2);
|
|
775
798
|
const diffTypesPtrOffset = routes.length / 2;
|
|
776
799
|
let ptr = 0;
|
|
777
|
-
function snake(k, A
|
|
778
|
-
const M
|
|
779
|
-
const N
|
|
780
|
-
const fp
|
|
781
|
-
ptr = fp
|
|
782
|
-
while (fp
|
|
783
|
-
const prev = fp
|
|
800
|
+
function snake(k, A, B, slide, down) {
|
|
801
|
+
const M = A.length;
|
|
802
|
+
const N = B.length;
|
|
803
|
+
const fp = createFp(k, M, routes, diffTypesPtrOffset, ptr, slide, down);
|
|
804
|
+
ptr = fp.id;
|
|
805
|
+
while (fp.y + k < M && fp.y < N && A[fp.y + k] === B[fp.y]) {
|
|
806
|
+
const prev = fp.id;
|
|
784
807
|
ptr++;
|
|
785
|
-
fp
|
|
786
|
-
fp
|
|
808
|
+
fp.id = ptr;
|
|
809
|
+
fp.y += 1;
|
|
787
810
|
routes[ptr] = prev;
|
|
788
811
|
routes[ptr + diffTypesPtrOffset] = COMMON;
|
|
789
812
|
}
|
|
790
|
-
return fp
|
|
813
|
+
return fp;
|
|
791
814
|
}
|
|
792
815
|
let currentFp = fp[delta + offset];
|
|
793
816
|
assertFp(currentFp);
|
|
@@ -795,12 +818,12 @@ const ADDED = 3;
|
|
|
795
818
|
while (currentFp.y < N) {
|
|
796
819
|
p = p + 1;
|
|
797
820
|
for (let k = -p; k < delta; ++k) {
|
|
798
|
-
const index
|
|
799
|
-
fp[index
|
|
821
|
+
const index = k + offset;
|
|
822
|
+
fp[index] = snake(k, A, B, fp[index - 1], fp[index + 1]);
|
|
800
823
|
}
|
|
801
824
|
for (let k = delta + p; k > delta; --k) {
|
|
802
|
-
const index
|
|
803
|
-
fp[index
|
|
825
|
+
const index = k + offset;
|
|
826
|
+
fp[index] = snake(k, A, B, fp[index - 1], fp[index + 1]);
|
|
804
827
|
}
|
|
805
828
|
const index = delta + offset;
|
|
806
829
|
fp[delta + offset] = snake(delta, A, B, fp[index - 1], fp[index + 1]);
|
|
@@ -812,7 +835,6 @@ const ADDED = 3;
|
|
|
812
835
|
value
|
|
813
836
|
})), ...backTrace(A, B, currentFp, swapped, routes, diffTypesPtrOffset)];
|
|
814
837
|
}
|
|
815
|
-
|
|
816
838
|
//#endregion
|
|
817
839
|
//#region ../../node_modules/.pnpm/@jsr+std__internal@1.0.8/node_modules/@jsr/std__internal/diff_str.js
|
|
818
840
|
/**
|
|
@@ -953,39 +975,6 @@ const NON_WHITESPACE_REGEXP = /\S/;
|
|
|
953
975
|
}
|
|
954
976
|
return diffResult;
|
|
955
977
|
}
|
|
956
|
-
|
|
957
|
-
//#endregion
|
|
958
|
-
//#region ../../node_modules/.pnpm/@jsr+std__internal@1.0.8/node_modules/@jsr/std__internal/format.js
|
|
959
|
-
/**
|
|
960
|
-
* Converts the input into a string. Objects, Sets and Maps are sorted so as to
|
|
961
|
-
* make tests less flaky.
|
|
962
|
-
*
|
|
963
|
-
* @param v Value to be formatted
|
|
964
|
-
*
|
|
965
|
-
* @returns The formatted string
|
|
966
|
-
*
|
|
967
|
-
* @example Usage
|
|
968
|
-
* ```ts
|
|
969
|
-
* import { format } from "@std/internal/format";
|
|
970
|
-
* import { assertEquals } from "@std/assert";
|
|
971
|
-
*
|
|
972
|
-
* assertEquals(format({ a: 1, b: 2 }), "{\n a: 1,\n b: 2,\n}");
|
|
973
|
-
* assertEquals(format(new Set([1, 2])), "Set(2) {\n 1,\n 2,\n}");
|
|
974
|
-
* assertEquals(format(new Map([[1, 2]])), "Map(1) {\n 1 => 2,\n}");
|
|
975
|
-
* ```
|
|
976
|
-
*/ function format(v) {
|
|
977
|
-
const { Deno: Deno$1 } = globalThis;
|
|
978
|
-
return typeof Deno$1?.inspect === "function" ? Deno$1.inspect(v, {
|
|
979
|
-
depth: Infinity,
|
|
980
|
-
sorted: true,
|
|
981
|
-
trailingComma: true,
|
|
982
|
-
compact: false,
|
|
983
|
-
iterableLimit: Infinity,
|
|
984
|
-
getters: true,
|
|
985
|
-
strAbbreviateSize: Infinity
|
|
986
|
-
}) : `"${String(v).replace(/(?=["\\])/g, "\\")}"`;
|
|
987
|
-
}
|
|
988
|
-
|
|
989
978
|
//#endregion
|
|
990
979
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_equals.js
|
|
991
980
|
/**
|
|
@@ -1012,16 +1001,13 @@ const NON_WHITESPACE_REGEXP = /\S/;
|
|
|
1012
1001
|
* @param options The optional object for the assertion.
|
|
1013
1002
|
*/ function assertEquals(actual, expected, msg) {
|
|
1014
1003
|
if (equal(actual, expected)) return;
|
|
1015
|
-
|
|
1016
|
-
let message = `Values are not equal${msgSuffix}`;
|
|
1004
|
+
let message = `Values are not equal${msg ? `: ${msg}` : "."}`;
|
|
1017
1005
|
const actualString = format(actual);
|
|
1018
1006
|
const expectedString = format(expected);
|
|
1019
1007
|
const stringDiff = typeof actual === "string" && typeof expected === "string";
|
|
1020
|
-
const
|
|
1021
|
-
const diffMsg = buildMessage(diffResult, { stringDiff }).join("\n");
|
|
1008
|
+
const diffMsg = buildMessage(stringDiff ? diffStr(actual, expected) : diff(actualString.split("\n"), expectedString.split("\n")), { stringDiff }).join("\n");
|
|
1022
1009
|
message = `${message}\n${diffMsg}`;
|
|
1023
1010
|
throw new AssertionError(message);
|
|
1024
1011
|
}
|
|
1025
|
-
|
|
1026
1012
|
//#endregion
|
|
1027
|
-
export {
|
|
1013
|
+
export { red as a, equal as c, buildMessage as i, AssertionError as l, diffStr as n, stripAnsiCode as o, diff as r, format as s, assertEquals as t };
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { AssertionError } from "./assert_equals-DSbWqCm3.js";
|
|
7
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { l as AssertionError } from "./assert_equals-Ew3jOFa3.mjs";
|
|
8
5
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_instance_of.js
|
|
9
6
|
/**
|
|
10
7
|
* Make an assertion that `obj` is an instance of `type`.
|
|
@@ -36,6 +33,5 @@ import { AssertionError } from "./assert_equals-DSbWqCm3.js";
|
|
|
36
33
|
else msg = `Expected object to be an instance of "${expectedTypeStr}" but was "${actualTypeStr}"${msgSuffix}`;
|
|
37
34
|
throw new AssertionError(msg);
|
|
38
35
|
}
|
|
39
|
-
|
|
40
36
|
//#endregion
|
|
41
|
-
export { assertInstanceOf };
|
|
37
|
+
export { assertInstanceOf as t };
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { AssertionError, equal } from "./assert_equals-DSbWqCm3.js";
|
|
7
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { c as equal, l as AssertionError } from "./assert_equals-Ew3jOFa3.mjs";
|
|
8
5
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_not_equals.js
|
|
9
6
|
/**
|
|
10
7
|
* Make an assertion that `actual` and `expected` are not equal, deeply.
|
|
@@ -26,11 +23,7 @@ import { AssertionError, equal } from "./assert_equals-DSbWqCm3.js";
|
|
|
26
23
|
* @param msg The optional message to display if the assertion fails.
|
|
27
24
|
*/ function assertNotEquals(actual, expected, msg) {
|
|
28
25
|
if (!equal(actual, expected)) return;
|
|
29
|
-
|
|
30
|
-
const expectedString = String(expected);
|
|
31
|
-
const msgSuffix = msg ? `: ${msg}` : ".";
|
|
32
|
-
throw new AssertionError(`Expected actual: ${actualString} not to be: ${expectedString}${msgSuffix}`);
|
|
26
|
+
throw new AssertionError(`Expected actual: ${String(actual)} not to be: ${String(expected)}${msg ? `: ${msg}` : "."}`);
|
|
33
27
|
}
|
|
34
|
-
|
|
35
28
|
//#endregion
|
|
36
|
-
export { assertNotEquals };
|
|
29
|
+
export { assertNotEquals as t };
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { AssertionError } from "./assert_equals-DSbWqCm3.js";
|
|
7
|
-
import { assertIsError } from "./assert_throws-rjdMBf31.js";
|
|
8
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { l as AssertionError } from "./assert_equals-Ew3jOFa3.mjs";
|
|
5
|
+
import { n as assertIsError } from "./assert_throws-4NwKEy2q.mjs";
|
|
9
6
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_false.js
|
|
10
7
|
/**
|
|
11
8
|
* Make an assertion, error will be thrown if `expr` have truthy value.
|
|
@@ -23,7 +20,6 @@ import { assertIsError } from "./assert_throws-rjdMBf31.js";
|
|
|
23
20
|
*/ function assertFalse(expr, msg = "") {
|
|
24
21
|
if (expr) throw new AssertionError(msg);
|
|
25
22
|
}
|
|
26
|
-
|
|
27
23
|
//#endregion
|
|
28
24
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_rejects.js
|
|
29
25
|
async function assertRejects(fn, errorClassOrMsg, msgIncludesOrMsg, msg) {
|
|
@@ -57,6 +53,5 @@ async function assertRejects(fn, errorClassOrMsg, msgIncludesOrMsg, msg) {
|
|
|
57
53
|
if (!doesThrow) throw new AssertionError(`Expected function to reject${msgSuffix}`);
|
|
58
54
|
return err;
|
|
59
55
|
}
|
|
60
|
-
|
|
61
56
|
//#endregion
|
|
62
|
-
export { assertFalse, assertRejects };
|
|
57
|
+
export { assertFalse as n, assertRejects as t };
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { AssertionError, stripAnsiCode } from "./assert_equals-DSbWqCm3.js";
|
|
7
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { l as AssertionError, o as stripAnsiCode } from "./assert_equals-Ew3jOFa3.mjs";
|
|
8
5
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_is_error.js
|
|
9
6
|
/**
|
|
10
7
|
* Make an assertion that `error` is an `Error`.
|
|
@@ -43,7 +40,6 @@ import { AssertionError, stripAnsiCode } from "./assert_equals-DSbWqCm3.js";
|
|
|
43
40
|
throw new AssertionError(msg);
|
|
44
41
|
}
|
|
45
42
|
}
|
|
46
|
-
|
|
47
43
|
//#endregion
|
|
48
44
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_throws.js
|
|
49
45
|
function assertThrows(fn, errorClassOrMsg, msgIncludesOrMsg, msg) {
|
|
@@ -73,6 +69,5 @@ function assertThrows(fn, errorClassOrMsg, msgIncludesOrMsg, msg) {
|
|
|
73
69
|
}
|
|
74
70
|
return err;
|
|
75
71
|
}
|
|
76
|
-
|
|
77
72
|
//#endregion
|
|
78
|
-
export { assertIsError, assertThrows };
|
|
73
|
+
export { assertIsError as n, assertThrows as t };
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import { Router, RouterError } from "./router-D9eI0s4b.js";
|
|
8
|
-
import { InboxListenerSet } from "./inbox-Bd91CVJP.js";
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { n as RouterError, t as Router } from "./router-CrMLXoOr.mjs";
|
|
5
|
+
import { n as version, t as name } from "./deno-D682wzlW.mjs";
|
|
6
|
+
import { t as InboxListenerSet } from "./inbox-DegXbbbS.mjs";
|
|
9
7
|
import { getTypeId } from "@fedify/vocab";
|
|
10
|
-
import { getLogger } from "@logtape/logtape";
|
|
11
8
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
12
|
-
|
|
9
|
+
import { getLogger } from "@logtape/logtape";
|
|
13
10
|
//#region src/federation/builder.ts
|
|
14
11
|
var FederationBuilderImpl = class {
|
|
15
12
|
router;
|
|
@@ -46,7 +43,7 @@ var FederationBuilderImpl = class {
|
|
|
46
43
|
this.collectionTypeIds = {};
|
|
47
44
|
}
|
|
48
45
|
async build(options) {
|
|
49
|
-
const { FederationImpl } = await import("./middleware-
|
|
46
|
+
const { FederationImpl } = await import("./middleware-DqVGYk56.mjs");
|
|
50
47
|
const f = new FederationImpl(options);
|
|
51
48
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
|
52
49
|
f.router = this.router.clone();
|
|
@@ -74,23 +71,23 @@ var FederationBuilderImpl = class {
|
|
|
74
71
|
return f;
|
|
75
72
|
}
|
|
76
73
|
_getTracer() {
|
|
77
|
-
return trace.getTracer(
|
|
74
|
+
return trace.getTracer(name, version);
|
|
78
75
|
}
|
|
79
76
|
setActorDispatcher(path, dispatcher) {
|
|
80
77
|
if (this.router.has("actor")) throw new RouterError("Actor dispatcher already set.");
|
|
81
78
|
const variables = this.router.add(path, "actor");
|
|
82
79
|
if (variables.size !== 1 || !variables.has("identifier")) throw new RouterError("Path for actor dispatcher must have one variable: {identifier}");
|
|
83
|
-
const callbacks = { dispatcher: async (context
|
|
80
|
+
const callbacks = { dispatcher: async (context, identifier) => {
|
|
84
81
|
const actor = await this._getTracer().startActiveSpan("activitypub.dispatch_actor", {
|
|
85
82
|
kind: SpanKind.SERVER,
|
|
86
83
|
attributes: { "fedify.actor.identifier": identifier }
|
|
87
84
|
}, async (span) => {
|
|
88
85
|
try {
|
|
89
|
-
const actor
|
|
90
|
-
span.setAttribute("activitypub.actor.id", (actor
|
|
91
|
-
if (actor
|
|
92
|
-
else span.setAttribute("activitypub.actor.type", getTypeId(actor
|
|
93
|
-
return actor
|
|
86
|
+
const actor = await dispatcher(context, identifier);
|
|
87
|
+
span.setAttribute("activitypub.actor.id", (actor?.id ?? context.getActorUri(identifier)).href);
|
|
88
|
+
if (actor == null) span.setStatus({ code: SpanStatusCode.ERROR });
|
|
89
|
+
else span.setAttribute("activitypub.actor.type", getTypeId(actor).href);
|
|
90
|
+
return actor;
|
|
94
91
|
} catch (error) {
|
|
95
92
|
span.setStatus({
|
|
96
93
|
code: SpanStatusCode.ERROR,
|
|
@@ -108,36 +105,36 @@ var FederationBuilderImpl = class {
|
|
|
108
105
|
"actor"
|
|
109
106
|
]);
|
|
110
107
|
if (actor.id == null) logger.warn("Actor dispatcher returned an actor without an id property. Set the property with Context.getActorUri(identifier).");
|
|
111
|
-
else if (actor.id.href != context
|
|
108
|
+
else if (actor.id.href != context.getActorUri(identifier).href) logger.warn("Actor dispatcher returned an actor with an id property that does not match the actor URI. Set the property with Context.getActorUri(identifier).");
|
|
112
109
|
if (this.followingCallbacks != null && this.followingCallbacks.dispatcher != null) {
|
|
113
110
|
if (actor.followingId == null) logger.warn("You configured a following collection dispatcher, but the actor does not have a following property. Set the property with Context.getFollowingUri(identifier).");
|
|
114
|
-
else if (actor.followingId.href != context
|
|
111
|
+
else if (actor.followingId.href != context.getFollowingUri(identifier).href) logger.warn("You configured a following collection dispatcher, but the actor's following property does not match the following collection URI. Set the property with Context.getFollowingUri(identifier).");
|
|
115
112
|
}
|
|
116
113
|
if (this.followersCallbacks != null && this.followersCallbacks.dispatcher != null) {
|
|
117
114
|
if (actor.followersId == null) logger.warn("You configured a followers collection dispatcher, but the actor does not have a followers property. Set the property with Context.getFollowersUri(identifier).");
|
|
118
|
-
else if (actor.followersId.href != context
|
|
115
|
+
else if (actor.followersId.href != context.getFollowersUri(identifier).href) logger.warn("You configured a followers collection dispatcher, but the actor's followers property does not match the followers collection URI. Set the property with Context.getFollowersUri(identifier).");
|
|
119
116
|
}
|
|
120
117
|
if (this.outboxCallbacks != null && this.outboxCallbacks.dispatcher != null) {
|
|
121
118
|
if (actor?.outboxId == null) logger.warn("You configured an outbox collection dispatcher, but the actor does not have an outbox property. Set the property with Context.getOutboxUri(identifier).");
|
|
122
|
-
else if (actor.outboxId.href != context
|
|
119
|
+
else if (actor.outboxId.href != context.getOutboxUri(identifier).href) logger.warn("You configured an outbox collection dispatcher, but the actor's outbox property does not match the outbox collection URI. Set the property with Context.getOutboxUri(identifier).");
|
|
123
120
|
}
|
|
124
121
|
if (this.likedCallbacks != null && this.likedCallbacks.dispatcher != null) {
|
|
125
122
|
if (actor?.likedId == null) logger.warn("You configured a liked collection dispatcher, but the actor does not have a liked property. Set the property with Context.getLikedUri(identifier).");
|
|
126
|
-
else if (actor.likedId.href != context
|
|
123
|
+
else if (actor.likedId.href != context.getLikedUri(identifier).href) logger.warn("You configured a liked collection dispatcher, but the actor's liked property does not match the liked collection URI. Set the property with Context.getLikedUri(identifier).");
|
|
127
124
|
}
|
|
128
125
|
if (this.featuredCallbacks != null && this.featuredCallbacks.dispatcher != null) {
|
|
129
126
|
if (actor?.featuredId == null) logger.warn("You configured a featured collection dispatcher, but the actor does not have a featured property. Set the property with Context.getFeaturedUri(identifier).");
|
|
130
|
-
else if (actor.featuredId.href != context
|
|
127
|
+
else if (actor.featuredId.href != context.getFeaturedUri(identifier).href) logger.warn("You configured a featured collection dispatcher, but the actor's featured property does not match the featured collection URI. Set the property with Context.getFeaturedUri(identifier).");
|
|
131
128
|
}
|
|
132
129
|
if (this.featuredTagsCallbacks != null && this.featuredTagsCallbacks.dispatcher != null) {
|
|
133
130
|
if (actor?.featuredTagsId == null) logger.warn("You configured a featured tags collection dispatcher, but the actor does not have a featuredTags property. Set the property with Context.getFeaturedTagsUri(identifier).");
|
|
134
|
-
else if (actor.featuredTagsId.href != context
|
|
131
|
+
else if (actor.featuredTagsId.href != context.getFeaturedTagsUri(identifier).href) logger.warn("You configured a featured tags collection dispatcher, but the actor's featuredTags property does not match the featured tags collection URI. Set the property with Context.getFeaturedTagsUri(identifier).");
|
|
135
132
|
}
|
|
136
133
|
if (this.router.has("inbox")) {
|
|
137
134
|
if (actor.inboxId == null) logger.warn("You configured inbox listeners, but the actor does not have an inbox property. Set the property with Context.getInboxUri(identifier).");
|
|
138
|
-
else if (actor.inboxId.href != context
|
|
135
|
+
else if (actor.inboxId.href != context.getInboxUri(identifier).href) logger.warn("You configured inbox listeners, but the actor's inbox property does not match the inbox URI. Set the property with Context.getInboxUri(identifier).");
|
|
139
136
|
if (actor.endpoints == null || actor.endpoints.sharedInbox == null) logger.warn("You configured inbox listeners, but the actor does not have a endpoints.sharedInbox property. Set the property with Context.getInboxUri().");
|
|
140
|
-
else if (actor.endpoints.sharedInbox.href != context
|
|
137
|
+
else if (actor.endpoints.sharedInbox.href != context.getInboxUri().href) logger.warn("You configured inbox listeners, but the actor's endpoints.sharedInbox property does not match the shared inbox URI. Set the property with Context.getInboxUri().");
|
|
141
138
|
}
|
|
142
139
|
if (callbacks.keyPairsDispatcher != null) {
|
|
143
140
|
if (actor.publicKeyId == null) logger.warn("You configured a key pairs dispatcher, but the actor does not have a publicKey property. Set the property with Context.getActorKeyPairs(identifier).");
|
|
@@ -147,7 +144,7 @@ var FederationBuilderImpl = class {
|
|
|
147
144
|
} };
|
|
148
145
|
this.actorCallbacks = callbacks;
|
|
149
146
|
const setters = {
|
|
150
|
-
setKeyPairsDispatcher: (dispatcher
|
|
147
|
+
setKeyPairsDispatcher: (dispatcher) => {
|
|
151
148
|
callbacks.keyPairsDispatcher = (ctx, identifier) => this._getTracer().startActiveSpan("activitypub.dispatch_actor_key_pairs", {
|
|
152
149
|
kind: SpanKind.SERVER,
|
|
153
150
|
attributes: {
|
|
@@ -156,7 +153,7 @@ var FederationBuilderImpl = class {
|
|
|
156
153
|
}
|
|
157
154
|
}, async (span) => {
|
|
158
155
|
try {
|
|
159
|
-
return await dispatcher
|
|
156
|
+
return await dispatcher(ctx, identifier);
|
|
160
157
|
} catch (e) {
|
|
161
158
|
span.setStatus({
|
|
162
159
|
code: SpanStatusCode.ERROR,
|
|
@@ -186,8 +183,7 @@ var FederationBuilderImpl = class {
|
|
|
186
183
|
}
|
|
187
184
|
setNodeInfoDispatcher(path, dispatcher) {
|
|
188
185
|
if (this.router.has("nodeInfo")) throw new RouterError("NodeInfo dispatcher already set.");
|
|
189
|
-
|
|
190
|
-
if (variables.size !== 0) throw new RouterError("Path for NodeInfo dispatcher must have no variables.");
|
|
186
|
+
if (this.router.add(path, "nodeInfo").size !== 0) throw new RouterError("Path for NodeInfo dispatcher must have no variables.");
|
|
191
187
|
this.nodeInfoDispatcher = dispatcher;
|
|
192
188
|
}
|
|
193
189
|
setWebFingerLinksDispatcher(dispatcher) {
|
|
@@ -200,8 +196,7 @@ var FederationBuilderImpl = class {
|
|
|
200
196
|
if (variables.size < 1) throw new RouterError("Path for object dispatcher must have at least one variable.");
|
|
201
197
|
const callbacks = {
|
|
202
198
|
dispatcher: (ctx, values) => {
|
|
203
|
-
|
|
204
|
-
return tracer.startActiveSpan("activitypub.dispatch_object", {
|
|
199
|
+
return this._getTracer().startActiveSpan("activitypub.dispatch_object", {
|
|
205
200
|
kind: SpanKind.SERVER,
|
|
206
201
|
attributes: {
|
|
207
202
|
"fedify.object.type": cls.typeId.href,
|
|
@@ -432,8 +427,7 @@ var FederationBuilderImpl = class {
|
|
|
432
427
|
this.inboxPath = inboxPath;
|
|
433
428
|
}
|
|
434
429
|
if (sharedInboxPath != null) {
|
|
435
|
-
|
|
436
|
-
if (siVars.size !== 0) throw new RouterError("Path for shared inbox must have no variables.");
|
|
430
|
+
if (this.router.add(sharedInboxPath, "sharedInbox").size !== 0) throw new RouterError("Path for shared inbox must have no variables.");
|
|
437
431
|
}
|
|
438
432
|
const listeners = this.inboxListeners = new InboxListenerSet();
|
|
439
433
|
const setters = {
|
|
@@ -471,8 +465,7 @@ var FederationBuilderImpl = class {
|
|
|
471
465
|
const routeName = `${collectionType}:${this.#uniqueCollectionId(name)}`;
|
|
472
466
|
if (this.router.has(routeName)) throw new RouterError(`Collection dispatcher for ${strName} already set.`);
|
|
473
467
|
if (this.collectionCallbacks[name] != null) throw new RouterError(`Collection dispatcher for ${strName} already set.`);
|
|
474
|
-
|
|
475
|
-
if (variables.size < 1) throw new RouterError("Path for collection dispatcher must have at least one variable.");
|
|
468
|
+
if (this.router.add(path, routeName).size < 1) throw new RouterError("Path for collection dispatcher must have at least one variable.");
|
|
476
469
|
const callbacks = { dispatcher };
|
|
477
470
|
this.collectionCallbacks[name] = callbacks;
|
|
478
471
|
this.collectionTypeIds[name] = itemType;
|
|
@@ -507,8 +500,7 @@ var FederationBuilderImpl = class {
|
|
|
507
500
|
getCollectionPath(name, values) {
|
|
508
501
|
if (!(name in this.collectionCallbacks)) return null;
|
|
509
502
|
const routeName = this.#uniqueCollectionId(name);
|
|
510
|
-
|
|
511
|
-
return path;
|
|
503
|
+
return this.router.build(`collection:${routeName}`, values) ?? this.router.build(`orderedCollection:${routeName}`, values);
|
|
512
504
|
}
|
|
513
505
|
setOutboxPermanentFailureHandler(handler) {
|
|
514
506
|
this.outboxPermanentFailureHandler = handler;
|
|
@@ -534,6 +526,5 @@ var FederationBuilderImpl = class {
|
|
|
534
526
|
function createFederationBuilder() {
|
|
535
527
|
return new FederationBuilderImpl();
|
|
536
528
|
}
|
|
537
|
-
|
|
538
529
|
//#endregion
|
|
539
|
-
export {
|
|
530
|
+
export { createFederationBuilder as n, FederationBuilderImpl as t };
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
//#region rolldown:runtime
|
|
1
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
|
+
//#region \0rolldown/runtime.js
|
|
6
4
|
var __create = Object.create;
|
|
7
5
|
var __defProp = Object.defineProperty;
|
|
8
6
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
11
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
-
var
|
|
10
|
+
var __exportAll = (all, no_symbols) => {
|
|
11
|
+
let target = {};
|
|
13
12
|
for (var name in all) __defProp(target, name, {
|
|
14
13
|
get: all[name],
|
|
15
14
|
enumerable: true
|
|
16
15
|
});
|
|
16
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
17
|
+
return target;
|
|
17
18
|
};
|
|
18
19
|
var __copyProps = (to, from, except, desc) => {
|
|
19
20
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
@@ -30,24 +31,22 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
31
|
value: mod,
|
|
31
32
|
enumerable: true
|
|
32
33
|
}) : target, mod));
|
|
33
|
-
|
|
34
34
|
//#endregion
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
Object.defineProperty(exports, "__exportAll", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function() {
|
|
38
|
+
return __exportAll;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
Object.defineProperty(exports, "__reExport", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function() {
|
|
44
|
+
return __reExport;
|
|
45
|
+
}
|
|
41
46
|
});
|
|
42
|
-
Object.defineProperty(exports,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
Object.defineProperty(exports, "__toESM", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
get: function() {
|
|
50
|
+
return __toESM;
|
|
51
|
+
}
|
|
47
52
|
});
|
|
48
|
-
Object.defineProperty(exports, '__toESM', {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function () {
|
|
51
|
-
return __toESM;
|
|
52
|
-
}
|
|
53
|
-
});
|