@fedify/fedify 2.0.0-pr.433.1601 → 2.0.0-pr.434.1659
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-BODH8--e.cjs +37786 -0
- package/dist/{actor-BYk33gpL.js → actor-DJS2ne1f.js} +200 -200
- package/dist/actor-DMgu-ZjT.d.cts +128 -0
- package/dist/{actor-DhgsJz-4.js → actor-WgMDAZc5.js} +1 -1
- package/dist/{assert_rejects-7UF4R_Qs.js → assert_rejects-DiIiJbZn.js} +1 -1
- package/dist/{assert_throws-53_pKeP3.js → assert_throws-BOO88avQ.js} +1 -1
- package/dist/authdocloader-C8Eqv2Kg.cjs +58 -0
- package/dist/{authdocloader-Bnyhgo9N.js → authdocloader-FA-VNPvw.js} +3 -3
- package/dist/{authdocloader-Dcu0wNV2.js → authdocloader-SW1oQJ7q.js} +6 -6
- package/dist/{builder-QxLyGSq9.js → builder-Cp2PpvmH.js} +4 -4
- package/dist/chunk-DqRYRqnO.cjs +34 -0
- package/dist/client-CegPX0Rn.d.cts +222 -0
- package/dist/{client-apb-XuqD.js → client-D_BQdihX.js} +2 -7
- package/dist/compat/mod.cjs +10 -0
- package/dist/compat/mod.d.cts +13 -0
- package/dist/compat/mod.d.ts +2 -2
- package/dist/compat/mod.js +5 -5
- package/dist/compat/transformers.test.js +18 -17
- package/dist/compat-DmDDELst.cjs +4 -0
- package/dist/compat-nxUqe4Z-.js +4 -0
- package/dist/{context-CDSZdQHD.d.ts → context-CQsAT7xk.d.ts} +0 -1
- package/dist/context-tVOQ76fi.d.cts +2254 -0
- package/dist/docloader-D-MrRyHl.d.cts +219 -0
- package/dist/{docloader-C5a95do5.js → docloader-DrPHprgh.js} +188 -8
- package/dist/docloader-dZO9fPIT.cjs +4861 -0
- package/dist/{esm-Bgz4xida.js → esm-CjcCcZ6s.js} +1 -1
- package/dist/federation/builder.test.js +10 -10
- package/dist/federation/collection.test.js +8 -8
- package/dist/federation/handler.test.js +26 -145
- package/dist/federation/inbox.test.js +6 -6
- package/dist/federation/keycache.test.js +4 -4
- package/dist/federation/kv.test.js +9 -8
- package/dist/federation/middleware.test.js +255 -38
- package/dist/federation/mod.cjs +29 -0
- package/dist/federation/mod.d.cts +13 -0
- package/dist/federation/mod.d.ts +1 -1
- package/dist/federation/mod.js +15 -15
- package/dist/federation/mq.test.js +10 -10
- package/dist/federation/negotiation.test.d.ts +3 -0
- package/dist/federation/negotiation.test.js +28 -0
- package/dist/federation/retry.test.js +5 -5
- package/dist/federation/router.test.js +8 -8
- package/dist/federation/send.test.js +15 -15
- package/dist/{federation-CMX7WzeL.js → federation-D1U8YY9t.js} +3 -3
- package/dist/federation-H2_En3j5.cjs +244 -0
- package/dist/{http-DNI66-5x.js → http-BPkuNd26.js} +2 -2
- package/dist/http-BS6766zs.d.cts +253 -0
- package/dist/{http-JY6wHpzI.js → http-BgQ07Ja_.js} +6 -6
- package/dist/http-CZJRJ0Pv.cjs +826 -0
- package/dist/{inbox-DQ8L0DJL.js → inbox-CCB1CbWJ.js} +1 -1
- package/dist/{key-5IrrMBg5.js → key-B_P3wH2F.js} +5 -5
- package/dist/{key-Be6l1ofa.js → key-BstbqwrH.js} +3 -3
- package/dist/{key-BPlyixfT.js → key-C0k2A_bI.js} +2 -2
- package/dist/key-C8TOf6mh.cjs +290 -0
- package/dist/key-CtA7xiw_.js +10 -0
- package/dist/key-hknDPZ-z.cjs +10 -0
- package/dist/{keycache-C4ahXsL4.js → keycache-DvDW8JPA.js} +1 -1
- package/dist/{keys-DJSYNKDA.js → keys-DzXrG_sX.js} +1 -1
- package/dist/kv-63Cil1MD.d.cts +81 -0
- package/dist/{ld-CWJxBIBV.js → ld-BcKcM_o9.js} +2 -2
- package/dist/{lookup-BnXYO054.js → lookup-C3BC8XO-.js} +4 -4
- package/dist/lookup-C3BGNQTz.cjs +137 -0
- package/dist/{lookup-C7LsgCJN.js → lookup-DbTBDJcT.js} +1 -1
- package/dist/{middleware-exe_8YIh.js → middleware-B3crRaK-.js} +50 -81
- package/dist/middleware-BWXHJSkY.cjs +17 -0
- package/dist/middleware-C4A4GTtX.cjs +4204 -0
- package/dist/middleware-CGlIdSyy.js +17 -0
- package/dist/middleware-CUWXMbGt.js +26 -0
- package/dist/{middleware-DfHez8_s.js → middleware-CXRqw8n4.js} +49 -144
- package/dist/{mod-RI3-KvUI.d.ts → mod-B26zRlH1.d.ts} +1 -1
- package/dist/mod-BClfg3ej.d.cts +266 -0
- package/dist/mod-C2tOeRkN.d.cts +1 -0
- package/dist/mod-DBQAI4v9.d.cts +80 -0
- package/dist/mod-Dc_-mf8s.d.cts +102 -0
- package/dist/mod-FZd39qVq.d.cts +1 -0
- package/dist/mod-evzlRVZq.d.cts +289 -0
- package/dist/mod-jQ4OODsl.d.cts +113 -0
- package/dist/mod.cjs +150 -0
- package/dist/mod.d.cts +17 -0
- package/dist/mod.d.ts +2 -2
- package/dist/mod.js +20 -20
- package/dist/mq-B7R1Q-M5.d.cts +140 -0
- package/dist/negotiation-5NPJL6zp.js +71 -0
- package/dist/nodeinfo/client.test.js +10 -10
- package/dist/nodeinfo/handler.test.js +23 -22
- package/dist/nodeinfo/mod.cjs +11 -0
- package/dist/nodeinfo/mod.d.cts +5 -0
- package/dist/nodeinfo/mod.js +6 -6
- package/dist/nodeinfo/types.test.js +8 -8
- package/dist/nodeinfo-Co9lJrWl.cjs +4 -0
- package/dist/nodeinfo-DfycQ8Wf.js +4 -0
- package/dist/owner-B-7Ptt_m.d.cts +67 -0
- package/dist/{owner-CM_3htrf.js → owner-BcEciLTD.js} +2 -2
- package/dist/{proof-WqatqDcH.js → proof-DAEfR6xA.js} +6 -6
- package/dist/proof-ZBmKo2zb.cjs +673 -0
- package/dist/{proof-B13S28BP.js → proof-vGquXXR6.js} +2 -2
- package/dist/runtime/authdocloader.test.js +14 -14
- package/dist/runtime/docloader.test.js +9 -9
- package/dist/runtime/key.test.js +10 -10
- package/dist/runtime/langstr.test.js +8 -8
- package/dist/runtime/link.test.d.ts +3 -0
- package/dist/runtime/link.test.js +61 -0
- package/dist/runtime/mod.cjs +25 -0
- package/dist/runtime/mod.d.cts +6 -0
- package/dist/runtime/mod.js +10 -10
- package/dist/runtime/multibase/multibase.test.js +8 -8
- package/dist/runtime/url.test.js +5 -5
- package/dist/runtime-C58AJWSv.cjs +4 -0
- package/dist/runtime-DPYEDf-o.js +4 -0
- package/dist/{send-BcaNFUhd.js → send-svmMjAUr.js} +2 -2
- package/dist/sig/http.test.js +13 -13
- package/dist/sig/key.test.js +11 -11
- package/dist/sig/ld.test.js +10 -10
- package/dist/sig/mod.cjs +30 -0
- package/dist/sig/mod.d.cts +8 -0
- package/dist/sig/mod.js +10 -10
- package/dist/sig/owner.test.js +12 -12
- package/dist/sig/proof.test.js +12 -12
- package/dist/sig-ByHXzqUi.cjs +4 -0
- package/dist/sig-Cj3tk-ig.js +4 -0
- package/dist/testing/docloader.test.js +8 -8
- package/dist/testing/mod.js +3 -3
- package/dist/{testing-CakwOL23.js → testing-y9ueu9Aj.js} +2 -2
- package/dist/{transformers-Dna8Fg7k.js → transformers-BFT6d7J5.js} +3 -3
- package/dist/transformers-CoBS-oFG.cjs +116 -0
- package/dist/{type-BKY_LVaq.js → type-9o78PXlX.js} +381 -201
- package/dist/{types-zVT9nODh.js → types-DTCqX5HE.js} +5 -10
- package/dist/types-K5btoOl6.cjs +315 -0
- package/dist/vocab/actor.test.js +10 -10
- package/dist/vocab/lookup.test.js +9 -9
- package/dist/vocab/mod.cjs +87 -0
- package/dist/vocab/mod.d.cts +6 -0
- package/dist/vocab/mod.js +7 -7
- package/dist/vocab/type.test.js +3 -3
- package/dist/vocab/vocab.test.js +45 -10
- package/dist/vocab-CJ0jQMQV.cjs +282 -0
- package/dist/{vocab-ClXayeh5.js → vocab-C_Pm3NG3.js} +6 -6
- package/dist/vocab-DJTYMqyU.d.cts +14632 -0
- package/dist/webfinger/handler.test.js +23 -22
- package/dist/webfinger/lookup.test.js +9 -9
- package/dist/webfinger/mod.cjs +9 -0
- package/dist/webfinger/mod.d.cts +4 -0
- package/dist/webfinger/mod.js +6 -6
- package/dist/webfinger-BjOEdFPs.cjs +4 -0
- package/dist/webfinger-De_bU0iE.js +4 -0
- package/dist/x/cfworkers.cjs +100 -0
- package/dist/x/cfworkers.d.cts +59 -0
- package/dist/x/cfworkers.js +3 -3
- package/dist/x/cfworkers.test.js +8 -8
- package/dist/x/hono.cjs +61 -0
- package/dist/x/hono.d.cts +54 -0
- package/dist/x/hono.d.ts +1 -1
- package/dist/x/hono.js +3 -3
- package/dist/x/sveltekit.cjs +69 -0
- package/dist/x/sveltekit.d.cts +46 -0
- package/dist/x/sveltekit.d.ts +1 -1
- package/dist/x/sveltekit.js +3 -3
- package/package.json +68 -13
- package/dist/compat-Bb5myD13.js +0 -4
- package/dist/key-BLStGL0R.js +0 -10
- package/dist/middleware-D2diREI8.js +0 -17
- package/dist/middleware-D5PCuUVh.js +0 -25
- package/dist/nodeinfo-CyEbLjHs.js +0 -4
- package/dist/runtime-BSkOVUWM.js +0 -4
- package/dist/sig-BXJO--F9.js +0 -4
- package/dist/webfinger-C3GIyXIg.js +0 -4
- /package/dist/{assert_is_error-B035L3om.js → assert_is_error-BPGph1Jx.js} +0 -0
- /package/dist/{assert_not_equals-C80BG-_5.js → assert_not_equals-f3m3epl3.js} +0 -0
- /package/dist/{denokv-jZ0Z2h0M.js → denokv-Bv33Xxea.js} +0 -0
- /package/dist/{retry-CfF8Gn4d.js → retry-D4GJ670a.js} +0 -0
- /package/dist/{std__assert-DWivtrGR.js → std__assert-X-_kMxKM.js} +0 -0
@@ -3,8 +3,8 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { __require, lookupWebFinger } from "./type-
|
7
|
-
import { RouterError, lookupObject, traverseCollection } from "./lookup-
|
6
|
+
import { __require, lookupWebFinger } from "./type-9o78PXlX.js";
|
7
|
+
import { RouterError, lookupObject, traverseCollection } from "./lookup-DbTBDJcT.js";
|
8
8
|
import { configure, getConsoleSink, getLogger, reset } from "@logtape/logtape";
|
9
9
|
import { trace } from "@opentelemetry/api";
|
10
10
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
4
|
+
|
5
5
|
import { getLogger } from "@logtape/logtape";
|
6
6
|
|
7
7
|
//#region src/compat/transformers.ts
|
@@ -0,0 +1,116 @@
|
|
1
|
+
|
2
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
3
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
4
|
+
|
5
|
+
const require_chunk = require('./chunk-DqRYRqnO.cjs');
|
6
|
+
const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
7
|
+
|
8
|
+
//#region src/compat/transformers.ts
|
9
|
+
const logger = (0, __logtape_logtape.getLogger)([
|
10
|
+
"fedify",
|
11
|
+
"compat",
|
12
|
+
"transformers"
|
13
|
+
]);
|
14
|
+
/**
|
15
|
+
* An activity transformer that assigns a new random ID to an activity if it
|
16
|
+
* does not already have one. This is useful for ensuring that activities
|
17
|
+
* have an ID before they are sent to other servers.
|
18
|
+
*
|
19
|
+
* The generated ID is an origin URI with a fragment which contains an activity
|
20
|
+
* type name with a random UUID:
|
21
|
+
*
|
22
|
+
* ```
|
23
|
+
* https://example.com/#Follow/12345678-1234-5678-1234-567812345678
|
24
|
+
* ```
|
25
|
+
*
|
26
|
+
* @template TContextData The type of the context data.
|
27
|
+
* @param activity The activity to assign an ID to.
|
28
|
+
* @param context The context of the activity.
|
29
|
+
* @return The activity with an ID assigned.
|
30
|
+
* @since 1.4.0
|
31
|
+
*/
|
32
|
+
function autoIdAssigner(activity, context) {
|
33
|
+
if (activity.id != null) return activity;
|
34
|
+
const id = new URL(`/#${activity.constructor.name}/${crypto.randomUUID()}`, context.origin);
|
35
|
+
logger.warn("As the activity to send does not have an id, a new id {id} has been generated for it. However, it is recommended to explicitly set the id for the activity.", { id: id.href });
|
36
|
+
return activity.clone({ id });
|
37
|
+
}
|
38
|
+
/**
|
39
|
+
* An activity transformer that dehydrates the actor property of an activity
|
40
|
+
* so that it only contains the actor's URI. For example, suppose we have an
|
41
|
+
* activity like this:
|
42
|
+
*
|
43
|
+
* ```typescript
|
44
|
+
* import { Follow, Person } from "@fedify/fedify/vocab";
|
45
|
+
* const input = new Follow({
|
46
|
+
* id: new URL("http://example.com/activities/1"),
|
47
|
+
* actor: new Person({
|
48
|
+
* id: new URL("http://example.com/actors/1"),
|
49
|
+
* name: "Alice",
|
50
|
+
* preferredUsername: "alice",
|
51
|
+
* }),
|
52
|
+
* object: new Person({
|
53
|
+
* id: new URL("http://example.com/actors/2"),
|
54
|
+
* name: "Bob",
|
55
|
+
* preferredUsername: "bob",
|
56
|
+
* }),
|
57
|
+
* });
|
58
|
+
* ```
|
59
|
+
*
|
60
|
+
* The result of applying this transformer would be:
|
61
|
+
*
|
62
|
+
* ```typescript
|
63
|
+
* import { Follow, Person } from "@fedify/fedify/vocab";
|
64
|
+
* const output = new Follow({
|
65
|
+
* id: new URL("http://example.com/activities/1"),
|
66
|
+
* actor: new URL("http://example.com/actors/1"),
|
67
|
+
* object: new Person({
|
68
|
+
* id: new URL("http://example.com/actors/2"),
|
69
|
+
* name: "Bob",
|
70
|
+
* preferredUsername: "bob",
|
71
|
+
* }),
|
72
|
+
* });
|
73
|
+
* ```
|
74
|
+
*
|
75
|
+
* As some ActivityPub implementations like Threads fail to deal with inlined
|
76
|
+
* actor objects, this transformer can be used to work around this issue.
|
77
|
+
* @template TContextData The type of the context data.
|
78
|
+
* @param activity The activity to dehydrate the actor property of.
|
79
|
+
* @param context The context of the activity.
|
80
|
+
* @returns The dehydrated activity.
|
81
|
+
* @since 1.4.0
|
82
|
+
*/
|
83
|
+
function actorDehydrator(activity, _context) {
|
84
|
+
if (activity.actorIds.length < 1) return activity;
|
85
|
+
return activity.clone({ actors: activity.actorIds });
|
86
|
+
}
|
87
|
+
/**
|
88
|
+
* Gets the default activity transformers that are applied to all outgoing
|
89
|
+
* activities.
|
90
|
+
* @template TContextData The type of the context data.
|
91
|
+
* @returns The default activity transformers.
|
92
|
+
* @since 1.4.0
|
93
|
+
*/
|
94
|
+
function getDefaultActivityTransformers() {
|
95
|
+
return [autoIdAssigner, actorDehydrator];
|
96
|
+
}
|
97
|
+
|
98
|
+
//#endregion
|
99
|
+
Object.defineProperty(exports, 'actorDehydrator', {
|
100
|
+
enumerable: true,
|
101
|
+
get: function () {
|
102
|
+
return actorDehydrator;
|
103
|
+
}
|
104
|
+
});
|
105
|
+
Object.defineProperty(exports, 'autoIdAssigner', {
|
106
|
+
enumerable: true,
|
107
|
+
get: function () {
|
108
|
+
return autoIdAssigner;
|
109
|
+
}
|
110
|
+
});
|
111
|
+
Object.defineProperty(exports, 'getDefaultActivityTransformers', {
|
112
|
+
enumerable: true,
|
113
|
+
get: function () {
|
114
|
+
return getDefaultActivityTransformers;
|
115
|
+
}
|
116
|
+
});
|