@fedify/fedify 1.7.13 → 1.7.15
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/{actor-CPpvuBKU.d.ts → actor.d.ts} +3 -3
- package/dist/{actor-BVilnhZ3.js → actor.js} +6 -6
- package/dist/{assert-LOEeCUK5.js → assert.js} +2 -2
- package/dist/{assert_equals-B44MxcIj.js → assert_equals.js} +16 -16
- package/dist/{assert_instance_of-XtuFevV_.js → assert_instance_of.js} +2 -2
- package/dist/{assert_is_error-BTlryvT0.js → assert_is_error.js} +2 -2
- package/dist/{assert_not_equals-C685gKx6.js → assert_not_equals.js} +3 -6
- package/dist/{assert_rejects-DWQ4jaf9.js → assert_rejects.js} +3 -3
- package/dist/{assert_throws-YetpVSc-.js → assert_throws.js} +3 -3
- package/dist/{authdocloader-DqCINL6u.js → authdocloader.js} +8 -8
- package/dist/{builder-CKUAOfcL.js → builder.js} +7 -7
- package/dist/{chunk-Cx8LTkjm.js → chunk.js} +22 -15
- package/dist/{client-DvtwXO7t.d.ts → client.d.ts} +2 -2
- package/dist/{client-C5xUY491.js → client.js} +3 -3
- package/dist/{collection-Dfb0TPno.js → collection.js} +2 -3
- package/dist/compat/mod.d.ts +79 -12
- package/dist/compat/mod.js +1 -2
- package/dist/compat/transformers.test.js +34 -38
- package/dist/{context-OBWjptjU.d.ts → context.d.ts} +11 -11
- package/dist/{context-aglzx1Ww.js → context.js} +5 -5
- package/dist/{docloader-Q42SMRIB.d.ts → docloader.d.ts} +2 -2
- package/dist/{docloader-Qfs9nPiy.js → docloader.js} +32 -152
- package/dist/{docloader-09nVWLAZ.js → docloader2.js} +1 -1
- package/dist/{esm-DO9PrujO.js → esm.js} +36 -22
- package/dist/federation/builder.test.js +20 -26
- package/dist/federation/collection.test.js +11 -16
- package/dist/federation/handler.test.js +41 -48
- package/dist/federation/inbox.test.js +11 -11
- package/dist/federation/keycache.test.js +12 -11
- package/dist/federation/kv.test.js +8 -10
- package/dist/federation/middleware.test.js +105 -134
- package/dist/federation/mod.d.ts +4 -13
- package/dist/federation/mod.js +206 -12
- package/dist/federation/mq.test.js +12 -17
- package/dist/federation/retry.test.js +5 -4
- package/dist/federation/router.test.js +9 -10
- package/dist/federation/send.test.js +23 -24
- package/dist/{http-DMTrO3Ye.d.ts → http.d.ts} +3 -3
- package/dist/{http-CjDwMreH.js → http.js} +25 -31
- package/dist/{inbox-ApPO50Ma.js → inbox.js} +5 -5
- package/dist/key.js +16 -0
- package/dist/{key-BPUM0v_S.js → key2.js} +5 -5
- package/dist/{keycache-B7Urghlu.js → keycache.js} +2 -2
- package/dist/{keys-DGJec4-R.js → keys.js} +2 -2
- package/dist/{kv-DRaeSXco.d.ts → kv.d.ts} +1 -1
- package/dist/{kv-BMY6Qf_A.js → kv.js} +1 -1
- package/dist/{langstr-DbWheeIS.js → langstr.js} +1 -1
- package/dist/{ld-DJTavNY3.js → ld.js} +9 -12
- package/dist/{lookup-Bf-K85bV.d.ts → lookup.d.ts} +2 -2
- package/dist/{lookup-CkOdKyYR.js → lookup.js} +4 -4
- package/dist/{lookup-CnkkF4Rf.js → lookup2.js} +6 -6
- package/dist/{middleware-BxHcZC4p.js → middleware.js} +35 -39
- package/dist/middleware2.js +32 -0
- package/dist/mod.d.ts +17 -17
- package/dist/mod.js +17 -17
- package/dist/{mod-CDzlVCUF.d.ts → mod2.d.ts} +3 -3
- package/dist/{mod-CCL2cvnI.d.ts → mod3.d.ts} +4 -4
- package/dist/{mq-DYKDDJmp.d.ts → mq.d.ts} +1 -1
- package/dist/{multibase-CnLHszip.js → multibase.js} +1 -1
- package/dist/nodeinfo/client.test.js +19 -28
- package/dist/nodeinfo/handler.test.js +37 -44
- package/dist/nodeinfo/mod.d.ts +2 -5
- package/dist/nodeinfo/mod.js +2 -3
- package/dist/nodeinfo/semver.test.js +13 -21
- package/dist/nodeinfo/types.test.js +9 -11
- package/dist/{owner-D0cOz8R5.d.ts → owner.d.ts} +4 -4
- package/dist/{owner-qKULzrkx.js → owner.js} +4 -4
- package/dist/{proof-d5P09-xk.js → proof.js} +11 -13
- package/dist/{retry-BiIhZWgD.js → retry.js} +1 -1
- package/dist/{router-D_aVZZUc.js → router.js} +1 -1
- package/dist/runtime/authdocloader.test.js +22 -26
- package/dist/runtime/docloader.test.js +56 -56
- package/dist/runtime/key.test.js +31 -53
- package/dist/runtime/langstr.test.js +8 -10
- package/dist/runtime/mod.d.ts +103 -6
- package/dist/runtime/mod.js +6 -7
- package/dist/runtime/multibase/multibase.test.js +12 -18
- package/dist/runtime/url.test.js +7 -6
- package/dist/{semver-BNrOOAs9.js → semver.js} +7 -17
- package/dist/{send-BnMY3Qxa.js → send.js} +4 -4
- package/dist/sig/http.test.js +104 -168
- package/dist/sig/key.test.js +17 -20
- package/dist/sig/ld.test.js +28 -35
- package/dist/sig/mod.d.ts +3 -7
- package/dist/sig/mod.js +6 -7
- package/dist/sig/owner.test.js +24 -30
- package/dist/sig/proof.test.js +24 -29
- package/dist/{std__assert-o_r9vqm1.js → std__assert.js} +7 -13
- package/dist/testing/docloader.test.js +9 -12
- package/dist/testing/mod.js +2 -1
- package/dist/{testing-DLyvtiiW.js → testing.js} +2 -2
- package/dist/{transformers-ghwJuzGY.js → transformers.js} +1 -1
- package/dist/{type-CFuiGLz9.js → type.js} +1 -1
- package/dist/{types-CJHS5pXl.js → types.js} +2 -2
- package/dist/{url-C2xuoQD1.js → url.js} +1 -1
- package/dist/vocab/actor.test.js +76 -128
- package/dist/vocab/lookup.test.js +19 -23
- package/dist/vocab/mod.d.ts +3 -5
- package/dist/vocab/mod.js +4 -4
- package/dist/vocab/type.test.js +10 -10
- package/dist/vocab/vocab.test.js +90 -109
- package/dist/{vocab-CzEfWQk2.d.ts → vocab.d.ts} +2 -2
- package/dist/{vocab-S7fEn6XO.js → vocab.js} +318 -454
- package/dist/webfinger/handler.test.js +40 -48
- package/dist/webfinger/lookup.test.js +12 -15
- package/dist/webfinger/mod.d.ts +1 -4
- package/dist/webfinger/mod.js +2 -3
- package/dist/x/cfworkers.d.ts +2 -2
- package/dist/x/cfworkers.test.js +7 -9
- package/dist/x/hono.d.ts +2 -11
- package/dist/x/sveltekit.d.ts +2 -11
- package/package.json +1 -1
- package/dist/actor-CsmPeeHG.js +0 -34925
- package/dist/authdocloader-9g6RkEcR.js +0 -53
- package/dist/compat-Bb5myD13.js +0 -4
- package/dist/docloader-CchlnLWb.js +0 -4598
- package/dist/federation-B0aljx0V.js +0 -203
- package/dist/http-CP3h1SLi.js +0 -796
- package/dist/key--l6NVKdl.js +0 -257
- package/dist/key-1Fv7reaM.js +0 -16
- package/dist/key-DD37RpoD.js +0 -10
- package/dist/lookup-CN-LpF5e.js +0 -127
- package/dist/middleware-BQHe0X6Y.js +0 -17
- package/dist/middleware-C3TZ3P-v.js +0 -33
- package/dist/middleware-CEpilAEY.js +0 -3524
- package/dist/mod-1pDWKvUL.d.ts +0 -2
- package/dist/mod-DFncUgcE.d.ts +0 -82
- package/dist/mod-GIh5OYxW.d.ts +0 -2
- package/dist/mod-g0xFzAP9.d.ts +0 -2
- package/dist/mod-qFMzZ3iF.d.ts +0 -104
- package/dist/nodeinfo-CyEbLjHs.js +0 -4
- package/dist/proof-BfeWBNrY.js +0 -582
- package/dist/runtime-BSkOVUWM.js +0 -4
- package/dist/sig-BXJO--F9.js +0 -4
- package/dist/types-BZUzjGS0.js +0 -455
- package/dist/vocab-C_pE4SvE.js +0 -168
- package/dist/webfinger-C3GIyXIg.js +0 -4
- /package/dist/{denokv-CvROlGYX.js → denokv.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { GetUserAgentOptions } from "./docloader
|
|
4
|
-
import {
|
|
3
|
+
import { s as GetUserAgentOptions } from "./docloader.js";
|
|
4
|
+
import { D as Group, J as Person, K as Organization, a as Application, rt as Service } from "./vocab.js";
|
|
5
5
|
import { TracerProvider } from "@opentelemetry/api";
|
|
6
6
|
|
|
7
7
|
//#region vocab/actor.d.ts
|
|
@@ -127,4 +127,4 @@ interface Recipient {
|
|
|
127
127
|
} | null;
|
|
128
128
|
}
|
|
129
129
|
//#endregion
|
|
130
|
-
export {
|
|
130
|
+
export { Recipient as a, getActorTypeName as c, NormalizeActorHandleOptions as i, isActor as l, ActorTypeName as n, getActorClassByTypeName as o, GetActorHandleOptions as r, getActorHandle as s, Actor as t, normalizeActorHandle as u };
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { lookupWebFinger } from "./lookup
|
|
9
|
-
import { getTypeId } from "./type
|
|
6
|
+
import { d as version, u as name } from "./docloader.js";
|
|
7
|
+
import { S as Person, T as Service, r as Application, u as Group, x as Organization } from "./vocab.js";
|
|
8
|
+
import { t as lookupWebFinger } from "./lookup.js";
|
|
9
|
+
import { t as getTypeId } from "./type.js";
|
|
10
10
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
11
11
|
import { domainToASCII, domainToUnicode } from "node:url";
|
|
12
12
|
|
|
@@ -72,7 +72,7 @@ function getActorClassByTypeName(typeName) {
|
|
|
72
72
|
* @since 0.4.0
|
|
73
73
|
*/
|
|
74
74
|
async function getActorHandle(actor, options = {}) {
|
|
75
|
-
return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(
|
|
75
|
+
return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(name, version).startActiveSpan("activitypub.get_actor_handle", async (span) => {
|
|
76
76
|
if (isActor(actor)) {
|
|
77
77
|
if (actor.id != null) span.setAttribute("activitypub.actor.id", actor.id.href);
|
|
78
78
|
span.setAttribute("activitypub.actor.type", getTypeId(actor).href);
|
|
@@ -143,4 +143,4 @@ function normalizeActorHandle(handle, options = {}) {
|
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
//#endregion
|
|
146
|
-
export {
|
|
146
|
+
export { normalizeActorHandle as a, isActor as i, getActorHandle as n, getActorTypeName as r, getActorClassByTypeName as t };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { AssertionError } from "./assert_equals
|
|
6
|
+
import { u as AssertionError } from "./assert_equals.js";
|
|
7
7
|
|
|
8
8
|
//#region node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert.js
|
|
9
9
|
/**
|
|
@@ -24,4 +24,4 @@ import { AssertionError } from "./assert_equals-B44MxcIj.js";
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
//#endregion
|
|
27
|
-
export { assert };
|
|
27
|
+
export { assert as t };
|
|
@@ -105,7 +105,7 @@ function constructorsEqual(a, b) {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
//#endregion
|
|
108
|
-
//#region node_modules/.pnpm/@jsr+std__internal@1.0.
|
|
108
|
+
//#region node_modules/.pnpm/@jsr+std__internal@1.0.12/node_modules/@jsr/std__internal/assertion_state.js
|
|
109
109
|
/**
|
|
110
110
|
* Check the test suite internal state
|
|
111
111
|
*
|
|
@@ -284,7 +284,7 @@ function constructorsEqual(a, b) {
|
|
|
284
284
|
const assertionState = new AssertionState();
|
|
285
285
|
|
|
286
286
|
//#endregion
|
|
287
|
-
//#region node_modules/.pnpm/@jsr+std__internal@1.0.
|
|
287
|
+
//#region node_modules/.pnpm/@jsr+std__internal@1.0.12/node_modules/@jsr/std__internal/styles.js
|
|
288
288
|
const { Deno } = globalThis;
|
|
289
289
|
const enabled = !(typeof Deno?.noColor === "boolean" ? Deno.noColor : false);
|
|
290
290
|
function code(open, close) {
|
|
@@ -450,7 +450,7 @@ const ANSI_PATTERN = new RegExp(["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-z
|
|
|
450
450
|
}
|
|
451
451
|
|
|
452
452
|
//#endregion
|
|
453
|
-
//#region node_modules/.pnpm/@jsr+std__internal@1.0.
|
|
453
|
+
//#region node_modules/.pnpm/@jsr+std__internal@1.0.12/node_modules/@jsr/std__internal/build_message.js
|
|
454
454
|
/**
|
|
455
455
|
* Colors the output of assertion diffs.
|
|
456
456
|
*
|
|
@@ -473,6 +473,7 @@ const ANSI_PATTERN = new RegExp(["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-z
|
|
|
473
473
|
switch (diffType) {
|
|
474
474
|
case "added": return (s) => background ? bgGreen(white(s)) : green(bold(s));
|
|
475
475
|
case "removed": return (s) => background ? bgRed(white(s)) : red(bold(s));
|
|
476
|
+
case "truncation": return gray;
|
|
476
477
|
default: return white;
|
|
477
478
|
}
|
|
478
479
|
}
|
|
@@ -504,6 +505,7 @@ const ANSI_PATTERN = new RegExp(["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-z
|
|
|
504
505
|
*
|
|
505
506
|
* @param diffResult The diff result array.
|
|
506
507
|
* @param options Optional parameters for customizing the message.
|
|
508
|
+
* @param truncateDiff Function to truncate the diff (default is no truncation).
|
|
507
509
|
*
|
|
508
510
|
* @returns An array of strings representing the built message.
|
|
509
511
|
*
|
|
@@ -511,9 +513,7 @@ const ANSI_PATTERN = new RegExp(["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-z
|
|
|
511
513
|
* ```ts no-assert
|
|
512
514
|
* import { diffStr, buildMessage } from "@std/internal";
|
|
513
515
|
*
|
|
514
|
-
*
|
|
515
|
-
*
|
|
516
|
-
* console.log(buildMessage(diffResult));
|
|
516
|
+
* diffStr("Hello, world!", "Hello, world");
|
|
517
517
|
* // [
|
|
518
518
|
* // "",
|
|
519
519
|
* // "",
|
|
@@ -525,7 +525,8 @@ const ANSI_PATTERN = new RegExp(["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-z
|
|
|
525
525
|
* // "",
|
|
526
526
|
* // ]
|
|
527
527
|
* ```
|
|
528
|
-
*/ function buildMessage(diffResult, options = {}) {
|
|
528
|
+
*/ function buildMessage(diffResult, options = {}, truncateDiff) {
|
|
529
|
+
if (truncateDiff != null) diffResult = truncateDiff(diffResult, options.stringDiff ?? false);
|
|
529
530
|
const { stringDiff = false } = options;
|
|
530
531
|
const messages = [
|
|
531
532
|
"",
|
|
@@ -536,7 +537,7 @@ const ANSI_PATTERN = new RegExp(["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-z
|
|
|
536
537
|
];
|
|
537
538
|
const diffMessages = diffResult.map((result) => {
|
|
538
539
|
const color = createColor(result.type);
|
|
539
|
-
const line = result.details?.map((detail) => detail.type !== "common" ? createColor(detail.type, true)(detail.value) : detail.value).join("") ?? result.value;
|
|
540
|
+
const line = result.type === "added" || result.type === "removed" ? result.details?.map((detail) => detail.type !== "common" ? createColor(detail.type, true)(detail.value) : detail.value).join("") ?? result.value : result.value;
|
|
540
541
|
return color(`${createSign(result.type)}${line}`);
|
|
541
542
|
});
|
|
542
543
|
messages.push(...stringDiff ? [diffMessages.join("")] : diffMessages, "");
|
|
@@ -544,7 +545,7 @@ const ANSI_PATTERN = new RegExp(["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-z
|
|
|
544
545
|
}
|
|
545
546
|
|
|
546
547
|
//#endregion
|
|
547
|
-
//#region node_modules/.pnpm/@jsr+std__internal@1.0.
|
|
548
|
+
//#region node_modules/.pnpm/@jsr+std__internal@1.0.12/node_modules/@jsr/std__internal/diff.js
|
|
548
549
|
const REMOVED = 1;
|
|
549
550
|
const COMMON = 2;
|
|
550
551
|
const ADDED = 3;
|
|
@@ -813,7 +814,7 @@ const ADDED = 3;
|
|
|
813
814
|
}
|
|
814
815
|
|
|
815
816
|
//#endregion
|
|
816
|
-
//#region node_modules/.pnpm/@jsr+std__internal@1.0.
|
|
817
|
+
//#region node_modules/.pnpm/@jsr+std__internal@1.0.12/node_modules/@jsr/std__internal/diff_str.js
|
|
817
818
|
/**
|
|
818
819
|
* Unescape invisible characters.
|
|
819
820
|
*
|
|
@@ -954,7 +955,7 @@ const NON_WHITESPACE_REGEXP = /\S/;
|
|
|
954
955
|
}
|
|
955
956
|
|
|
956
957
|
//#endregion
|
|
957
|
-
//#region node_modules/.pnpm/@jsr+std__internal@1.0.
|
|
958
|
+
//#region node_modules/.pnpm/@jsr+std__internal@1.0.12/node_modules/@jsr/std__internal/format.js
|
|
958
959
|
/** An inspect function conforming to the shape of `Deno.inspect` and `node:util`'s `inspect` */
|
|
959
960
|
/**
|
|
960
961
|
* Converts the input into a string. Objects, Sets and Maps are sorted so as to
|
|
@@ -1004,7 +1005,7 @@ function basicInspect(v) {
|
|
|
1004
1005
|
}
|
|
1005
1006
|
|
|
1006
1007
|
//#endregion
|
|
1007
|
-
//#region node_modules/.pnpm/@jsr+std__internal@1.0.
|
|
1008
|
+
//#region node_modules/.pnpm/@jsr+std__internal@1.0.12/node_modules/@jsr/std__internal/_os.js
|
|
1008
1009
|
function checkWindows() {
|
|
1009
1010
|
const global = globalThis;
|
|
1010
1011
|
const os = global.Deno?.build?.os;
|
|
@@ -1012,7 +1013,7 @@ function checkWindows() {
|
|
|
1012
1013
|
}
|
|
1013
1014
|
|
|
1014
1015
|
//#endregion
|
|
1015
|
-
//#region node_modules/.pnpm/@jsr+std__internal@1.0.
|
|
1016
|
+
//#region node_modules/.pnpm/@jsr+std__internal@1.0.12/node_modules/@jsr/std__internal/os.js
|
|
1016
1017
|
/** Whether the current platform is Windows */ const isWindows = checkWindows();
|
|
1017
1018
|
|
|
1018
1019
|
//#endregion
|
|
@@ -1045,11 +1046,10 @@ function checkWindows() {
|
|
|
1045
1046
|
const actualString = format(actual);
|
|
1046
1047
|
const expectedString = format(expected);
|
|
1047
1048
|
const stringDiff = typeof actual === "string" && typeof expected === "string";
|
|
1048
|
-
const
|
|
1049
|
-
const diffMsg = buildMessage(diffResult, { stringDiff }).join("\n");
|
|
1049
|
+
const diffMsg = buildMessage(stringDiff ? diffStr(actual, expected) : diff(actualString.split("\n"), expectedString.split("\n")), { stringDiff }).join("\n");
|
|
1050
1050
|
message = `${message}\n${diffMsg}`;
|
|
1051
1051
|
throw new AssertionError(message);
|
|
1052
1052
|
}
|
|
1053
1053
|
|
|
1054
1054
|
//#endregion
|
|
1055
|
-
export {
|
|
1055
|
+
export { diff as a, stripAnsiCode as c, diffStr as i, equal as l, isWindows as n, buildMessage as o, format as r, red as s, assertEquals as t, AssertionError as u };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { AssertionError } from "./assert_equals
|
|
6
|
+
import { u as AssertionError } from "./assert_equals.js";
|
|
7
7
|
|
|
8
8
|
//#region node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_instance_of.js
|
|
9
9
|
/**
|
|
@@ -38,4 +38,4 @@ import { AssertionError } from "./assert_equals-B44MxcIj.js";
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
//#endregion
|
|
41
|
-
export { assertInstanceOf };
|
|
41
|
+
export { assertInstanceOf as t };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { c as stripAnsiCode, u as AssertionError } from "./assert_equals.js";
|
|
7
7
|
|
|
8
8
|
//#region node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_is_error.js
|
|
9
9
|
/**
|
|
@@ -45,4 +45,4 @@ import { AssertionError, stripAnsiCode } from "./assert_equals-B44MxcIj.js";
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
//#endregion
|
|
48
|
-
export { assertIsError };
|
|
48
|
+
export { assertIsError as t };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { l as equal, u as AssertionError } from "./assert_equals.js";
|
|
7
7
|
|
|
8
8
|
//#region node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_not_equals.js
|
|
9
9
|
/**
|
|
@@ -26,11 +26,8 @@ import { AssertionError, equal } from "./assert_equals-B44MxcIj.js";
|
|
|
26
26
|
* @param msg The optional message to display if the assertion fails.
|
|
27
27
|
*/ function assertNotEquals(actual, expected, msg) {
|
|
28
28
|
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}`);
|
|
29
|
+
throw new AssertionError(`Expected actual: ${String(actual)} not to be: ${String(expected)}${msg ? `: ${msg}` : "."}`);
|
|
33
30
|
}
|
|
34
31
|
|
|
35
32
|
//#endregion
|
|
36
|
-
export { assertNotEquals };
|
|
33
|
+
export { assertNotEquals as t };
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { AssertionError } from "./assert_equals
|
|
7
|
-
import { assertIsError } from "./assert_is_error
|
|
6
|
+
import { u as AssertionError } from "./assert_equals.js";
|
|
7
|
+
import { t as assertIsError } from "./assert_is_error.js";
|
|
8
8
|
|
|
9
9
|
//#region node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_false.js
|
|
10
10
|
/**
|
|
@@ -59,4 +59,4 @@ async function assertRejects(fn, errorClassOrMsg, msgIncludesOrMsg, msg) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
//#endregion
|
|
62
|
-
export { assertFalse, assertRejects };
|
|
62
|
+
export { assertFalse as n, assertRejects as t };
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { AssertionError } from "./assert_equals
|
|
7
|
-
import { assertIsError } from "./assert_is_error
|
|
6
|
+
import { u as AssertionError } from "./assert_equals.js";
|
|
7
|
+
import { t as assertIsError } from "./assert_is_error.js";
|
|
8
8
|
|
|
9
9
|
//#region node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_throws.js
|
|
10
10
|
function assertThrows(fn, errorClassOrMsg, msgIncludesOrMsg, msg) {
|
|
@@ -36,4 +36,4 @@ function assertThrows(fn, errorClassOrMsg, msgIncludesOrMsg, msg) {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
//#endregion
|
|
39
|
-
export { assertThrows };
|
|
39
|
+
export { assertThrows as t };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
|
+
globalThis.addEventListener = () => {};
|
|
4
5
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { a as getRemoteDocument, c as logRequest, n as createRequest } from "./docloader.js";
|
|
7
|
+
import { a as validatePublicUrl, t as UrlError } from "./url.js";
|
|
8
|
+
import { a as validateCryptoKey } from "./key2.js";
|
|
9
|
+
import { n as doubleKnock } from "./http.js";
|
|
8
10
|
import { getLogger } from "@logtape/logtape";
|
|
9
11
|
|
|
10
12
|
//#region runtime/authdocloader.ts
|
|
@@ -36,16 +38,14 @@ function getAuthenticatedDocumentLoader(identity, { allowPrivateAddress, userAge
|
|
|
36
38
|
});
|
|
37
39
|
throw error;
|
|
38
40
|
}
|
|
39
|
-
|
|
40
|
-
const response = await doubleKnock(originalRequest, identity, {
|
|
41
|
+
return getRemoteDocument(url, await doubleKnock(createRequest(url, { userAgent }), identity, {
|
|
41
42
|
specDeterminer,
|
|
42
43
|
log: logRequest,
|
|
43
44
|
tracerProvider
|
|
44
|
-
});
|
|
45
|
-
return getRemoteDocument(url, response, load);
|
|
45
|
+
}), load);
|
|
46
46
|
}
|
|
47
47
|
return load;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
//#endregion
|
|
51
|
-
export { getAuthenticatedDocumentLoader };
|
|
51
|
+
export { getAuthenticatedDocumentLoader as t };
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { getTypeId } from "./type
|
|
9
|
-
import { InboxListenerSet } from "./inbox
|
|
6
|
+
import { d as version, u as name } from "./docloader.js";
|
|
7
|
+
import { n as RouterError, t as Router } from "./router.js";
|
|
8
|
+
import { t as getTypeId } from "./type.js";
|
|
9
|
+
import { t as InboxListenerSet } from "./inbox.js";
|
|
10
10
|
import { getLogger } from "@logtape/logtape";
|
|
11
11
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
12
12
|
|
|
@@ -34,7 +34,7 @@ var FederationBuilderImpl = class {
|
|
|
34
34
|
this.objectTypeIds = {};
|
|
35
35
|
}
|
|
36
36
|
async build(options) {
|
|
37
|
-
const { FederationImpl } = await import("./
|
|
37
|
+
const { FederationImpl } = await import("./middleware2.js");
|
|
38
38
|
const f = new FederationImpl(options);
|
|
39
39
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
|
40
40
|
f.router = this.router.clone();
|
|
@@ -58,7 +58,7 @@ var FederationBuilderImpl = class {
|
|
|
58
58
|
return f;
|
|
59
59
|
}
|
|
60
60
|
_getTracer() {
|
|
61
|
-
return trace.getTracer(
|
|
61
|
+
return trace.getTracer(name, version);
|
|
62
62
|
}
|
|
63
63
|
setActorDispatcher(path, dispatcher) {
|
|
64
64
|
if (this.router.has("actor")) throw new RouterError("Actor dispatcher already set.");
|
|
@@ -486,4 +486,4 @@ function createFederationBuilder() {
|
|
|
486
486
|
}
|
|
487
487
|
|
|
488
488
|
//#endregion
|
|
489
|
-
export {
|
|
489
|
+
export { createFederationBuilder as n, FederationBuilderImpl as t };
|
|
@@ -12,24 +12,31 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
12
12
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
13
|
var __getProtoOf = Object.getPrototypeOf;
|
|
14
14
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
var __export = (all) => {
|
|
15
|
+
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
16
|
+
var __export = (all, symbols) => {
|
|
19
17
|
let target = {};
|
|
20
|
-
for (var name in all)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
for (var name in all) {
|
|
19
|
+
__defProp(target, name, {
|
|
20
|
+
get: all[name],
|
|
21
|
+
enumerable: true
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
if (symbols) {
|
|
25
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
26
|
+
}
|
|
24
27
|
return target;
|
|
25
28
|
};
|
|
26
29
|
var __copyProps = (to, from, except, desc) => {
|
|
27
|
-
if (from && typeof from === "object" || typeof from === "function")
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
31
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
32
|
+
key = keys[i];
|
|
33
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
34
|
+
__defProp(to, key, {
|
|
35
|
+
get: ((k) => from[k]).bind(null, key),
|
|
36
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
33
40
|
}
|
|
34
41
|
return to;
|
|
35
42
|
};
|
|
@@ -40,4 +47,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
40
47
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
41
48
|
|
|
42
49
|
//#endregion
|
|
43
|
-
export {
|
|
50
|
+
export { __toESM as i, __export as n, __require as r, __commonJSMin as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { GetUserAgentOptions } from "./docloader
|
|
3
|
+
import { s as GetUserAgentOptions } from "./docloader.js";
|
|
4
4
|
|
|
5
5
|
//#region nodeinfo/semver.d.ts
|
|
6
6
|
/**
|
|
@@ -293,4 +293,4 @@ interface ParseNodeInfoOptions {
|
|
|
293
293
|
*/
|
|
294
294
|
declare function parseNodeInfo(data: unknown, options?: ParseNodeInfoOptions): NodeInfo | null;
|
|
295
295
|
//#endregion
|
|
296
|
-
export {
|
|
296
|
+
export { InboundService as a, OutboundService as c, Software as d, Usage as f, parseSemVer as g, formatSemVer as h, parseNodeInfo as i, Protocol as l, SemVer as m, ParseNodeInfoOptions as n, JsonValue as o, nodeInfoToJson as p, getNodeInfo as r, NodeInfo as s, GetNodeInfoOptions as t, Services as u };
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { getUserAgent } from "./docloader
|
|
7
|
-
import { parseSemVer } from "./semver
|
|
6
|
+
import { o as getUserAgent } from "./docloader.js";
|
|
7
|
+
import { n as parseSemVer } from "./semver.js";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
|
|
10
10
|
//#region nodeinfo/client.ts
|
|
@@ -270,4 +270,4 @@ function parseUsage(data, options = {}) {
|
|
|
270
270
|
}
|
|
271
271
|
|
|
272
272
|
//#endregion
|
|
273
|
-
export {
|
|
273
|
+
export { parseProtocol as a, parseUsage as c, parseOutboundService as i, parseInboundService as n, parseServices as o, parseNodeInfo as r, parseSoftware as s, getNodeInfo as t };
|
|
@@ -41,9 +41,8 @@ async function buildCollectionSynchronizationHeader(collectionId, actorIds) {
|
|
|
41
41
|
const baseUrl = new URL(anyActorId);
|
|
42
42
|
const url = new URL(collectionId);
|
|
43
43
|
url.searchParams.set("base-url", `${baseUrl.origin}/`);
|
|
44
|
-
|
|
45
|
-
return `collectionId="${collectionId}", url="${url}", digest="${hash}"`;
|
|
44
|
+
return `collectionId="${collectionId}", url="${url}", digest="${encodeHex(await digest(actorIds))}"`;
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
//#endregion
|
|
49
|
-
export {
|
|
48
|
+
export { digest as n, buildCollectionSynchronizationHeader as t };
|
package/dist/compat/mod.d.ts
CHANGED
|
@@ -1,15 +1,82 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import "../
|
|
4
|
-
import "../
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
import { n as Activity } from "../vocab.js";
|
|
4
|
+
import { it as ActivityTransformer, n as Context } from "../context.js";
|
|
5
|
+
|
|
6
|
+
//#region compat/transformers.d.ts
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* An activity transformer that assigns a new random ID to an activity if it
|
|
10
|
+
* does not already have one. This is useful for ensuring that activities
|
|
11
|
+
* have an ID before they are sent to other servers.
|
|
12
|
+
*
|
|
13
|
+
* The generated ID is an origin URI with a fragment which contains an activity
|
|
14
|
+
* type name with a random UUID:
|
|
15
|
+
*
|
|
16
|
+
* ```
|
|
17
|
+
* https://example.com/#Follow/12345678-1234-5678-1234-567812345678
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @typeParam TContextData The type of the context data.
|
|
21
|
+
* @param activity The activity to assign an ID to.
|
|
22
|
+
* @param context The context of the activity.
|
|
23
|
+
* @return The activity with an ID assigned.
|
|
24
|
+
* @since 1.4.0
|
|
25
|
+
*/
|
|
26
|
+
declare function autoIdAssigner<TContextData>(activity: Activity, context: Context<TContextData>): Activity;
|
|
27
|
+
/**
|
|
28
|
+
* An activity transformer that dehydrates the actor property of an activity
|
|
29
|
+
* so that it only contains the actor's URI. For example, suppose we have an
|
|
30
|
+
* activity like this:
|
|
31
|
+
*
|
|
32
|
+
* ```typescript
|
|
33
|
+
* import { Follow, Person } from "@fedify/fedify/vocab";
|
|
34
|
+
* const input = new Follow({
|
|
35
|
+
* id: new URL("http://example.com/activities/1"),
|
|
36
|
+
* actor: new Person({
|
|
37
|
+
* id: new URL("http://example.com/actors/1"),
|
|
38
|
+
* name: "Alice",
|
|
39
|
+
* preferredUsername: "alice",
|
|
40
|
+
* }),
|
|
41
|
+
* object: new Person({
|
|
42
|
+
* id: new URL("http://example.com/actors/2"),
|
|
43
|
+
* name: "Bob",
|
|
44
|
+
* preferredUsername: "bob",
|
|
45
|
+
* }),
|
|
46
|
+
* });
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* The result of applying this transformer would be:
|
|
50
|
+
*
|
|
51
|
+
* ```typescript
|
|
52
|
+
* import { Follow, Person } from "@fedify/fedify/vocab";
|
|
53
|
+
* const output = new Follow({
|
|
54
|
+
* id: new URL("http://example.com/activities/1"),
|
|
55
|
+
* actor: new URL("http://example.com/actors/1"),
|
|
56
|
+
* object: new Person({
|
|
57
|
+
* id: new URL("http://example.com/actors/2"),
|
|
58
|
+
* name: "Bob",
|
|
59
|
+
* preferredUsername: "bob",
|
|
60
|
+
* }),
|
|
61
|
+
* });
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* As some ActivityPub implementations like Threads fail to deal with inlined
|
|
65
|
+
* actor objects, this transformer can be used to work around this issue.
|
|
66
|
+
* @typeParam TContextData The type of the context data.
|
|
67
|
+
* @param activity The activity to dehydrate the actor property of.
|
|
68
|
+
* @param context The context of the activity.
|
|
69
|
+
* @returns The dehydrated activity.
|
|
70
|
+
* @since 1.4.0
|
|
71
|
+
*/
|
|
72
|
+
declare function actorDehydrator<TContextData>(activity: Activity, _context: Context<TContextData>): Activity;
|
|
73
|
+
/**
|
|
74
|
+
* Gets the default activity transformers that are applied to all outgoing
|
|
75
|
+
* activities.
|
|
76
|
+
* @typeParam TContextData The type of the context data.
|
|
77
|
+
* @returns The default activity transformers.
|
|
78
|
+
* @since 1.4.0
|
|
79
|
+
*/
|
|
80
|
+
declare function getDefaultActivityTransformers<TContextData>(): readonly ActivityTransformer<TContextData>[];
|
|
81
|
+
//#endregion
|
|
15
82
|
export { ActivityTransformer, actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
|
package/dist/compat/mod.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import "../compat-Bb5myD13.js";
|
|
5
|
+
import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "../transformers.js";
|
|
7
6
|
|
|
8
7
|
export { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
|