@fedify/fedify 2.0.0-dev.1514 → 2.0.0-dev.1561

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.
Files changed (89) hide show
  1. package/dist/{actor-B9P2qjOp.js → actor-Qc3Ee6k1.js} +187 -187
  2. package/dist/{actor-_5FcZYCJ.js → actor-mhluotIb.js} +1 -1
  3. package/dist/{authdocloader-B85dU2XF.js → authdocloader-CN-tWO4K.js} +3 -3
  4. package/dist/{authdocloader-D1iSfbFg.js → authdocloader-Dp9WS-1G.js} +3 -3
  5. package/dist/{builder-CYzXSls9.js → builder-C8mpxJD3.js} +9 -4
  6. package/dist/{client-CVlb4Ok0.js → client-DI0GS_3p.js} +2 -2
  7. package/dist/compat/mod.d.ts +3 -3
  8. package/dist/compat/transformers.test.js +16 -16
  9. package/dist/{context-3ICnZJKt.d.ts → context-9gCpIkiz.d.ts} +15 -2
  10. package/dist/{docloader-Oh_3p-47.js → docloader-DIjo5mkd.js} +1 -1
  11. package/dist/{esm-D3g5PyTT.js → esm-CtgLSZwm.js} +1 -1
  12. package/dist/federation/builder.test.js +5 -5
  13. package/dist/federation/collection.test.js +3 -3
  14. package/dist/federation/handler.test.js +17 -17
  15. package/dist/federation/inbox.test.js +4 -4
  16. package/dist/federation/keycache.test.js +4 -4
  17. package/dist/federation/kv.test.js +3 -3
  18. package/dist/federation/middleware.test.js +18 -18
  19. package/dist/federation/mod.d.ts +3 -3
  20. package/dist/federation/mod.js +10 -10
  21. package/dist/federation/mq.test.js +3 -3
  22. package/dist/federation/retry.test.js +3 -3
  23. package/dist/federation/router.test.js +3 -3
  24. package/dist/federation/send.test.js +10 -10
  25. package/dist/{http-BfYXy8KN.js → http-B_tXwHIe.js} +3 -3
  26. package/dist/{http-CqQdyMrD.js → http-DTJgsmYR.js} +2 -2
  27. package/dist/{inbox-aK-1EWle.js → inbox-Dx8EjUbq.js} +1 -1
  28. package/dist/{key-DvNnIm-b.js → key-CGjkGPkw.js} +2 -2
  29. package/dist/{key-DO4DsIoa.js → key-CaFAQSic.js} +4 -4
  30. package/dist/{key-CIHj-ji7.js → key-DcnCet42.js} +3 -3
  31. package/dist/{key-dwUEz7hD.js → key-olV6hEgm.js} +2 -2
  32. package/dist/{keycache-BVu6aNEj.js → keycache-CExtp4Yl.js} +1 -1
  33. package/dist/{keys-DzPS0ETq.js → keys-O0-r0NpJ.js} +1 -1
  34. package/dist/{ld-Cnu549gk.js → ld-DR6b11xZ.js} +2 -2
  35. package/dist/{lookup-CUS6_-CL.js → lookup-B8Ld9P9G.js} +1 -1
  36. package/dist/{lookup-CHIhk5sJ.js → lookup-IyAhz9I6.js} +2 -2
  37. package/dist/middleware-Bx6Sgkth.js +26 -0
  38. package/dist/{middleware-DZEp_3SF.js → middleware-CUw3Ys9y.js} +19 -14
  39. package/dist/middleware-DdRB1d4s.js +17 -0
  40. package/dist/{middleware-Bx2AUSYt.js → middleware-GT7W03qw.js} +21 -11
  41. package/dist/{mod-CWxqOAci.d.ts → mod-Bqxcp7eN.d.ts} +1 -1
  42. package/dist/{lookup-3czM5mmU.d.ts → mod-DBzN0aCM.d.ts} +8 -1
  43. package/dist/mod.d.ts +4 -5
  44. package/dist/mod.js +10 -10
  45. package/dist/nodeinfo/client.test.js +5 -5
  46. package/dist/nodeinfo/handler.test.js +16 -16
  47. package/dist/nodeinfo/mod.js +2 -2
  48. package/dist/nodeinfo/semver.test.js +3 -3
  49. package/dist/nodeinfo/types.test.js +3 -3
  50. package/dist/{owner-DLtMHO6X.js → owner-BtFz-dZ-.js} +2 -2
  51. package/dist/{proof-DV0L-54H.js → proof-DKDM7T5F.js} +3 -3
  52. package/dist/{proof-BJikaSMR.js → proof-DsZjVJ0G.js} +2 -2
  53. package/dist/runtime/authdocloader.test.js +9 -9
  54. package/dist/runtime/docloader.test.js +4 -4
  55. package/dist/runtime/key.test.js +5 -5
  56. package/dist/runtime/langstr.test.js +3 -3
  57. package/dist/runtime/mod.js +6 -6
  58. package/dist/runtime/multibase/multibase.test.js +3 -3
  59. package/dist/runtime/url.test.js +3 -3
  60. package/dist/{send-vv5TvgyD.js → send-s0_EjVhZ.js} +2 -2
  61. package/dist/sig/http.test.js +8 -8
  62. package/dist/sig/key.test.js +6 -6
  63. package/dist/sig/ld.test.js +7 -7
  64. package/dist/sig/mod.js +6 -6
  65. package/dist/sig/owner.test.js +7 -7
  66. package/dist/sig/proof.test.js +7 -7
  67. package/dist/testing/docloader.test.js +3 -3
  68. package/dist/testing/mod.d.ts +21 -1
  69. package/dist/testing/mod.js +3 -3
  70. package/dist/{testing-DM_97aHJ.js → testing-DsuOHyiF.js} +2 -2
  71. package/dist/{type-BaPlY7h1.js → type-BMGxK0zE.js} +186 -186
  72. package/dist/{types-0RrqyCDq.js → types-CGB4mJU6.js} +2 -2
  73. package/dist/vocab/actor.test.js +5 -5
  74. package/dist/vocab/lookup.test.js +4 -4
  75. package/dist/vocab/mod.js +4 -4
  76. package/dist/vocab/type.test.js +3 -3
  77. package/dist/vocab/vocab.test.js +117 -81
  78. package/dist/{vocab-FZ-IPYpZ.js → vocab-CXuKLJjd.js} +4 -4
  79. package/dist/webfinger/handler.test.js +44 -16
  80. package/dist/webfinger/lookup.test.js +4 -4
  81. package/dist/webfinger/mod.d.ts +1 -2
  82. package/dist/webfinger/mod.js +2 -2
  83. package/dist/x/cfworkers.test.js +3 -3
  84. package/dist/x/hono.d.ts +2 -2
  85. package/dist/x/sveltekit.d.ts +2 -2
  86. package/package.json +1 -1
  87. package/dist/middleware-26M2bCJx.js +0 -26
  88. package/dist/middleware-CpfIowSV.js +0 -17
  89. package/dist/mod-GIh5OYxW.d.ts +0 -2
@@ -2,7 +2,7 @@
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
- import { getUserAgent } from "./docloader-Oh_3p-47.js";
5
+ import { getUserAgent } from "./docloader-DIjo5mkd.js";
6
6
  import { getLogger } from "@logtape/logtape";
7
7
 
8
8
  //#region src/nodeinfo/semver.ts
@@ -173,7 +173,7 @@ async function getNodeInfo(url, options = {}) {
173
173
  }
174
174
  const wellKnownRd = await wellKnownResponse.json();
175
175
  const link = wellKnownRd?.links?.find((link$1) => link$1 != null && "rel" in link$1 && (link$1.rel === "http://nodeinfo.diaspora.software/ns/schema/2.0" || link$1.rel === "http://nodeinfo.diaspora.software/ns/schema/2.1") && "href" in link$1 && link$1.href != null);
176
- if (link == null) {
176
+ if (link == null || link.href == null) {
177
177
  logger.error("Failed to find a NodeInfo document link from {url}: {resourceDescriptor}", {
178
178
  url: wellKnownUrl.href,
179
179
  resourceDescriptor: wellKnownRd
@@ -3,19 +3,19 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Application, Group, Organization, Person, Service, __export } from "../type-BaPlY7h1.js";
6
+ import { Application, Group, Organization, Person, Service, __export } from "../type-BMGxK0zE.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import { assert } from "../assert-MZs1qjMx.js";
9
9
  import "../assert_instance_of-DHz7EHNU.js";
10
- import "../lookup-CHIhk5sJ.js";
11
- import { getActorClassByTypeName, getActorHandle, getActorTypeName, isActor, normalizeActorHandle } from "../actor-_5FcZYCJ.js";
12
- import { test } from "../testing-DM_97aHJ.js";
10
+ import "../lookup-IyAhz9I6.js";
11
+ import { getActorClassByTypeName, getActorHandle, getActorTypeName, isActor, normalizeActorHandle } from "../actor-mhluotIb.js";
12
+ import { test } from "../testing-DsuOHyiF.js";
13
13
  import { assertStrictEquals } from "../std__assert-X-_kMxKM.js";
14
14
  import { assertFalse, assertRejects } from "../assert_rejects-DiIiJbZn.js";
15
15
  import "../assert_is_error-BPGph1Jx.js";
16
16
  import "../assert_not_equals-f3m3epl3.js";
17
17
  import { assertThrows } from "../assert_throws-BOO88avQ.js";
18
- import { esm_default } from "../esm-D3g5PyTT.js";
18
+ import { esm_default } from "../esm-CtgLSZwm.js";
19
19
 
20
20
  //#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/precondition/PreconditionFailure.js
21
21
  var PreconditionFailure = class PreconditionFailure extends Error {
@@ -3,18 +3,18 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Collection, Note, Object as Object$1, Person } from "../type-BaPlY7h1.js";
6
+ import { Collection, Note, Object as Object$1, Person } from "../type-BMGxK0zE.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import "../assert-MZs1qjMx.js";
9
9
  import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
10
- import { lookupObject, traverseCollection } from "../lookup-CHIhk5sJ.js";
11
- import { mockDocumentLoader, test } from "../testing-DM_97aHJ.js";
10
+ import { lookupObject, traverseCollection } from "../lookup-IyAhz9I6.js";
11
+ import { mockDocumentLoader, test } from "../testing-DsuOHyiF.js";
12
12
  import "../std__assert-X-_kMxKM.js";
13
13
  import "../assert_rejects-DiIiJbZn.js";
14
14
  import "../assert_is_error-BPGph1Jx.js";
15
15
  import "../assert_not_equals-f3m3epl3.js";
16
16
  import "../assert_throws-BOO88avQ.js";
17
- import { esm_default } from "../esm-D3g5PyTT.js";
17
+ import { esm_default } from "../esm-CtgLSZwm.js";
18
18
 
19
19
  //#region src/vocab/lookup.test.ts
20
20
  test("lookupObject()", {
package/dist/vocab/mod.js CHANGED
@@ -2,9 +2,9 @@
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
- import "../docloader-Oh_3p-47.js";
6
- import { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object as Object$1, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, isActor, normalizeActorHandle } from "../actor-B9P2qjOp.js";
7
- import "../lookup-CUS6_-CL.js";
8
- import { PUBLIC_COLLECTION, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../vocab-FZ-IPYpZ.js";
5
+ import "../docloader-DIjo5mkd.js";
6
+ import { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object as Object$1, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, isActor, normalizeActorHandle } from "../actor-Qc3Ee6k1.js";
7
+ import "../lookup-B8Ld9P9G.js";
8
+ import { PUBLIC_COLLECTION, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../vocab-CXuKLJjd.js";
9
9
 
10
10
  export { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object$1 as Object, Offer, OrderedCollection, OrderedCollectionPage, Organization, PUBLIC_COLLECTION, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, isActor, isFediverseHandle, lookupObject, normalizeActorHandle, parseFediverseHandle, toAcctUrl, traverseCollection };
@@ -3,10 +3,10 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Person, getTypeId } from "../type-BaPlY7h1.js";
6
+ import { Person, getTypeId } from "../type-BMGxK0zE.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
- import "../lookup-CHIhk5sJ.js";
9
- import { test } from "../testing-DM_97aHJ.js";
8
+ import "../lookup-IyAhz9I6.js";
9
+ import { test } from "../testing-DsuOHyiF.js";
10
10
 
11
11
  //#region src/vocab/type.test.ts
12
12
  test("getTypeId()", () => {
@@ -3,25 +3,110 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Activity, Announce, Collection, Create, CryptographicKey, Follow, Hashtag, LanguageString, Note, Object as Object$1, OrderedCollectionPage, Person, Place, Question, Source, decode, vocab_exports } from "../type-BaPlY7h1.js";
6
+ import { Activity, Announce, Collection, Create, CryptographicKey, Follow, Hashtag, LanguageString, Note, Object as Object$1, OrderedCollectionPage, Person, Place, Question, Source, decode, vocab_exports } from "../type-BMGxK0zE.js";
7
7
  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
- import "../lookup-CHIhk5sJ.js";
11
- import { mockDocumentLoader, test } from "../testing-DM_97aHJ.js";
10
+ import "../lookup-IyAhz9I6.js";
11
+ import { mockDocumentLoader, test } from "../testing-DsuOHyiF.js";
12
12
  import "../std__assert-X-_kMxKM.js";
13
13
  import { assertFalse, assertRejects } from "../assert_rejects-DiIiJbZn.js";
14
14
  import "../assert_is_error-BPGph1Jx.js";
15
15
  import { assertNotEquals } from "../assert_not_equals-f3m3epl3.js";
16
16
  import { assertThrows } from "../assert_throws-BOO88avQ.js";
17
- import { ed25519PublicKey, rsaPublicKey1 } from "../keys-DzPS0ETq.js";
17
+ import { ed25519PublicKey, rsaPublicKey1 } from "../keys-O0-r0NpJ.js";
18
18
  import { pascalCase } from "es-toolkit";
19
19
  import { Validator } from "@cfworker/json-schema";
20
20
  import { readFile, readdir } from "node:fs/promises";
21
21
  import { join } from "node:path";
22
22
 
23
- //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/_os.js
24
- const isWindows = globalThis.Deno?.build.os === "windows" || globalThis.navigator?.platform?.startsWith("Win") || globalThis.process?.platform?.startsWith("win") || false;
23
+ //#region ../../node_modules/.pnpm/@jsr+std__internal@1.0.10/node_modules/@jsr/std__internal/_os.js
24
+ function checkWindows() {
25
+ const global = globalThis;
26
+ const os = global.Deno?.build?.os;
27
+ return typeof os === "string" ? os === "windows" : global.navigator?.platform?.startsWith("Win") ?? global.process?.platform?.startsWith("win") ?? false;
28
+ }
29
+
30
+ //#endregion
31
+ //#region ../../node_modules/.pnpm/@jsr+std__internal@1.0.10/node_modules/@jsr/std__internal/os.js
32
+ /** Whether the current platform is Windows */ const isWindows = checkWindows();
33
+
34
+ //#endregion
35
+ //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.2/node_modules/@jsr/std__path/_common/from_file_url.js
36
+ function assertArg$3(url) {
37
+ url = url instanceof URL ? url : new URL(url);
38
+ if (url.protocol !== "file:") throw new TypeError(`URL must be a file URL: received "${url.protocol}"`);
39
+ return url;
40
+ }
41
+
42
+ //#endregion
43
+ //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.2/node_modules/@jsr/std__path/posix/from_file_url.js
44
+ /**
45
+ * Converts a file URL to a path string.
46
+ *
47
+ * @example Usage
48
+ * ```ts
49
+ * import { fromFileUrl } from "@std/path/posix/from-file-url";
50
+ * import { assertEquals } from "@std/assert";
51
+ *
52
+ * assertEquals(fromFileUrl(new URL("file:///home/foo")), "/home/foo");
53
+ * ```
54
+ *
55
+ * @param url The file URL to convert.
56
+ * @returns The path string.
57
+ */ function fromFileUrl$2(url) {
58
+ url = assertArg$3(url);
59
+ return decodeURIComponent(url.pathname.replace(/%(?![0-9A-Fa-f]{2})/g, "%25"));
60
+ }
61
+
62
+ //#endregion
63
+ //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.2/node_modules/@jsr/std__path/windows/from_file_url.js
64
+ /**
65
+ * Converts a file URL to a path string.
66
+ *
67
+ * @example Usage
68
+ * ```ts
69
+ * import { fromFileUrl } from "@std/path/windows/from-file-url";
70
+ * import { assertEquals } from "@std/assert";
71
+ *
72
+ * assertEquals(fromFileUrl("file:///home/foo"), "\\home\\foo");
73
+ * assertEquals(fromFileUrl("file:///C:/Users/foo"), "C:\\Users\\foo");
74
+ * assertEquals(fromFileUrl("file://localhost/home/foo"), "\\home\\foo");
75
+ * ```
76
+ *
77
+ * @param url The file URL to convert.
78
+ * @returns The path string.
79
+ */ function fromFileUrl$3(url) {
80
+ url = assertArg$3(url);
81
+ let path = decodeURIComponent(url.pathname.replace(/\//g, "\\").replace(/%(?![0-9A-Fa-f]{2})/g, "%25")).replace(/^\\*([A-Za-z]:)(\\|$)/, "$1\\");
82
+ if (url.hostname !== "") path = `\\\\${url.hostname}${path}`;
83
+ return path;
84
+ }
85
+
86
+ //#endregion
87
+ //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.2/node_modules/@jsr/std__path/from_file_url.js
88
+ /**
89
+ * Converts a file URL to a path string.
90
+ *
91
+ * @example Usage
92
+ * ```ts
93
+ * import { fromFileUrl } from "@std/path/from-file-url";
94
+ * import { assertEquals } from "@std/assert";
95
+ *
96
+ * if (Deno.build.os === "windows") {
97
+ * assertEquals(fromFileUrl("file:///home/foo"), "\\home\\foo");
98
+ * assertEquals(fromFileUrl("file:///C:/Users/foo"), "C:\\Users\\foo");
99
+ * assertEquals(fromFileUrl("file://localhost/home/foo"), "\\home\\foo");
100
+ * } else {
101
+ * assertEquals(fromFileUrl("file:///home/foo"), "/home/foo");
102
+ * }
103
+ * ```
104
+ *
105
+ * @param url The file URL to convert to a path.
106
+ * @returns The path string.
107
+ */ function fromFileUrl(url) {
108
+ return isWindows ? fromFileUrl$3(url) : fromFileUrl$2(url);
109
+ }
25
110
 
26
111
  //#endregion
27
112
  //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/_common/assert_path.js
@@ -79,27 +164,15 @@ function isPosixPathSeparator(code) {
79
164
  }
80
165
 
81
166
  //#endregion
82
- //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/windows/from_file_url.js
167
+ //#region ../../node_modules/.pnpm/@jsr+std__url@1.0.0-rc.3/node_modules/@jsr/std__url/_strip.js
83
168
  /**
84
- * Converts a file URL to a path string.
85
- *
86
- * @example Usage
87
- * ```ts
88
- * import { fromFileUrl } from "@std/path/windows/from-file-url";
89
- * import { assertEquals } from "@std/assert";
90
- *
91
- * assertEquals(fromFileUrl("file:///home/foo"), "\\home\\foo");
92
- * assertEquals(fromFileUrl("file:///C:/Users/foo"), "C:\\Users\\foo");
93
- * assertEquals(fromFileUrl("file://localhost/home/foo"), "\\home\\foo");
94
- * ```
169
+ * Strips any hash (eg. `#header`) or search parameters (eg. `?foo=bar`) from the provided URL.
95
170
  *
96
- * @param url The file URL to convert.
97
- * @returns The path string.
98
- */ function fromFileUrl$2(url) {
99
- url = assertArg$2(url);
100
- let path = decodeURIComponent(url.pathname.replace(/\//g, "\\").replace(/%(?![0-9A-Fa-f]{2})/g, "%25")).replace(/^\\*([A-Za-z]:)(\\|$)/, "$1\\");
101
- if (url.hostname !== "") path = `\\\\${url.hostname}${path}`;
102
- return path;
171
+ * (Mutates the original url provided)
172
+ * @param url to be stripped.
173
+ */ function strip(url) {
174
+ url.hash = "";
175
+ url.search = "";
103
176
  }
104
177
 
105
178
  //#endregion
@@ -154,28 +227,33 @@ function assertArg$1(path) {
154
227
  }
155
228
 
156
229
  //#endregion
157
- //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/from_file_url.js
230
+ //#region ../../node_modules/.pnpm/@jsr+std__url@1.0.0-rc.3/node_modules/@jsr/std__url/dirname.js
158
231
  /**
159
- * Converts a file URL to a path string.
232
+ * Returns the directory path URL of a URL or URL string.
233
+ *
234
+ * The directory path is the portion of a URL up to but excluding the final path
235
+ * segment. URL queries and hashes are ignored.
236
+ *
237
+ * @param url URL to extract the directory from.
238
+ * @returns The directory path URL of the URL.
160
239
  *
161
240
  * @example Usage
162
241
  * ```ts
163
- * import { fromFileUrl } from "@std/path/from-file-url";
242
+ * import { dirname } from "@std/url/dirname";
164
243
  * import { assertEquals } from "@std/assert";
165
244
  *
166
- * if (Deno.build.os === "windows") {
167
- * assertEquals(fromFileUrl("file:///home/foo"), "\\home\\foo");
168
- * assertEquals(fromFileUrl("file:///C:/Users/foo"), "C:\\Users\\foo");
169
- * assertEquals(fromFileUrl("file://localhost/home/foo"), "\\home\\foo");
170
- * } else {
171
- * assertEquals(fromFileUrl("file:///home/foo"), "/home/foo");
172
- * }
245
+ * assertEquals(dirname("https://deno.land/std/path/mod.ts"), new URL("https://deno.land/std/path"));
246
+ * assertEquals(dirname(new URL("https://deno.land/std/path/mod.ts")), new URL("https://deno.land/std/path"));
173
247
  * ```
174
248
  *
175
- * @param url The file URL to convert to a path.
176
- * @returns The path string.
177
- */ function fromFileUrl(url) {
178
- return isWindows ? fromFileUrl$2(url) : fromFileUrl$1(url);
249
+ * @deprecated Use
250
+ * {@linkcode https://jsr.io/@std/path/doc/posix/~/dirname | @std/path/posix/dirname}
251
+ * instead (examples included). `@std/url` will be removed in the future.
252
+ */ function dirname$1(url) {
253
+ url = new URL(url);
254
+ strip(url);
255
+ url.pathname = dirname(url.pathname);
256
+ return url;
179
257
  }
180
258
 
181
259
  //#endregion
@@ -325,48 +403,6 @@ function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
325
403
  return joined === "" ? "." : normalize(joined);
326
404
  }
327
405
 
328
- //#endregion
329
- //#region ../../node_modules/.pnpm/@jsr+std__url@1.0.0-rc.3/node_modules/@jsr/std__url/_strip.js
330
- /**
331
- * Strips any hash (eg. `#header`) or search parameters (eg. `?foo=bar`) from the provided URL.
332
- *
333
- * (Mutates the original url provided)
334
- * @param url to be stripped.
335
- */ function strip(url) {
336
- url.hash = "";
337
- url.search = "";
338
- }
339
-
340
- //#endregion
341
- //#region ../../node_modules/.pnpm/@jsr+std__url@1.0.0-rc.3/node_modules/@jsr/std__url/dirname.js
342
- /**
343
- * Returns the directory path URL of a URL or URL string.
344
- *
345
- * The directory path is the portion of a URL up to but excluding the final path
346
- * segment. URL queries and hashes are ignored.
347
- *
348
- * @param url URL to extract the directory from.
349
- * @returns The directory path URL of the URL.
350
- *
351
- * @example Usage
352
- * ```ts
353
- * import { dirname } from "@std/url/dirname";
354
- * import { assertEquals } from "@std/assert";
355
- *
356
- * assertEquals(dirname("https://deno.land/std/path/mod.ts"), new URL("https://deno.land/std/path"));
357
- * assertEquals(dirname(new URL("https://deno.land/std/path/mod.ts")), new URL("https://deno.land/std/path"));
358
- * ```
359
- *
360
- * @deprecated Use
361
- * {@linkcode https://jsr.io/@std/path/doc/posix/~/dirname | @std/path/posix/dirname}
362
- * instead (examples included). `@std/url` will be removed in the future.
363
- */ function dirname$1(url) {
364
- url = new URL(url);
365
- strip(url);
366
- url.pathname = dirname(url.pathname);
367
- return url;
368
- }
369
-
370
406
  //#endregion
371
407
  //#region ../../node_modules/.pnpm/@jsr+std__url@1.0.0-rc.3/node_modules/@jsr/std__url/join.js
372
408
  /**
@@ -2,9 +2,9 @@
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
- import { deno_default, getDocumentLoader } from "./docloader-Oh_3p-47.js";
6
- import { Object as Object$1, getTypeId } from "./actor-B9P2qjOp.js";
7
- import { lookupWebFinger } from "./lookup-CUS6_-CL.js";
5
+ import { deno_default, getDocumentLoader } from "./docloader-DIjo5mkd.js";
6
+ import { Object as Object$1, getTypeId } from "./actor-Qc3Ee6k1.js";
7
+ import { lookupWebFinger } from "./lookup-B8Ld9P9G.js";
8
8
  import { getLogger } from "@logtape/logtape";
9
9
  import { SpanStatusCode, trace } from "@opentelemetry/api";
10
10
  import { delay } from "es-toolkit";
@@ -168,7 +168,7 @@ async function lookupObjectInternal(identifier, options = {}) {
168
168
  });
169
169
  if (jrd?.links == null) return null;
170
170
  for (const l of jrd.links) {
171
- if (l.type !== "application/activity+json" && !l.type?.match(/application\/ld\+json;\s*profile="https:\/\/www.w3.org\/ns\/activitystreams"/) || l.rel !== "self") continue;
171
+ if (l.type !== "application/activity+json" && !l.type?.match(/application\/ld\+json;\s*profile="https:\/\/www.w3.org\/ns\/activitystreams"/) || l.rel !== "self" || l.href == null) continue;
172
172
  try {
173
173
  const remoteDoc = await documentLoader(l.href, { signal: options.signal });
174
174
  document = remoteDoc.document;
@@ -3,30 +3,30 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Image, Link, Person } from "../type-BaPlY7h1.js";
6
+ import { Image, Link, Person } from "../type-BMGxK0zE.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import "../assert-MZs1qjMx.js";
9
9
  import "../assert_instance_of-DHz7EHNU.js";
10
10
  import { MemoryKvStore } from "../kv-CRZrzyXm.js";
11
- import { createFederation, handleWebFinger } from "../middleware-DZEp_3SF.js";
11
+ import { createFederation, handleWebFinger } from "../middleware-CUw3Ys9y.js";
12
12
  import "../semver-dArNLkR9.js";
13
- import "../client-CVlb4Ok0.js";
14
- import "../lookup-CHIhk5sJ.js";
13
+ import "../client-DI0GS_3p.js";
14
+ import "../lookup-IyAhz9I6.js";
15
15
  import "../types-BIgY6c-l.js";
16
- import "../actor-_5FcZYCJ.js";
17
- import "../key-dwUEz7hD.js";
18
- import "../http-CqQdyMrD.js";
19
- import "../authdocloader-B85dU2XF.js";
20
- import "../ld-Cnu549gk.js";
21
- import "../owner-DLtMHO6X.js";
22
- import "../proof-BJikaSMR.js";
23
- import "../inbox-aK-1EWle.js";
24
- import "../builder-CYzXSls9.js";
16
+ import "../actor-mhluotIb.js";
17
+ import "../key-olV6hEgm.js";
18
+ import "../http-DTJgsmYR.js";
19
+ import "../authdocloader-CN-tWO4K.js";
20
+ import "../ld-DR6b11xZ.js";
21
+ import "../owner-BtFz-dZ-.js";
22
+ import "../proof-DsZjVJ0G.js";
23
+ import "../inbox-Dx8EjUbq.js";
24
+ import "../builder-C8mpxJD3.js";
25
25
  import "../collection-CSzG2j1P.js";
26
- import "../keycache-BVu6aNEj.js";
26
+ import "../keycache-CExtp4Yl.js";
27
27
  import "../retry-D4GJ670a.js";
28
- import "../send-vv5TvgyD.js";
29
- import { createRequestContext, test } from "../testing-DM_97aHJ.js";
28
+ import "../send-s0_EjVhZ.js";
29
+ import { createRequestContext, test } from "../testing-DsuOHyiF.js";
30
30
  import "../std__assert-X-_kMxKM.js";
31
31
  import "../assert_rejects-DiIiJbZn.js";
32
32
  import "../assert_is_error-BPGph1Jx.js";
@@ -505,6 +505,34 @@ test("handleWebFinger()", async (t) => {
505
505
  assertEquals(response.headers.get("Access-Control-Allow-Origin"), "*");
506
506
  assertEquals(await response.json(), expectedForHostnameWithPort);
507
507
  });
508
+ await t.step("webFingerLinksDispatcher", async () => {
509
+ const webFingerLinksDispatcher = (_ctx) => {
510
+ return [{
511
+ rel: "http://ostatus.org/schema/1.0/subscribe",
512
+ template: "https://example.com/follow?acct={uri}"
513
+ }];
514
+ };
515
+ const u = new URL(url);
516
+ u.searchParams.set("resource", "acct:someone@example.com");
517
+ const context = createContext(u);
518
+ const request = context.request;
519
+ const response = await handleWebFinger(request, {
520
+ context,
521
+ actorDispatcher,
522
+ webFingerLinksDispatcher,
523
+ onNotFound
524
+ });
525
+ assertEquals(response.status, 200);
526
+ const result = await response.json();
527
+ const expectedWithCustomLinks = {
528
+ ...expected,
529
+ links: [...expected.links, {
530
+ rel: "http://ostatus.org/schema/1.0/subscribe",
531
+ template: "https://example.com/follow?acct={uri}"
532
+ }]
533
+ };
534
+ assertEquals(result, expectedWithCustomLinks);
535
+ });
508
536
  });
509
537
 
510
538
  //#endregion
@@ -3,18 +3,18 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { lookupWebFinger } from "../type-BaPlY7h1.js";
6
+ import { lookupWebFinger } from "../type-BMGxK0zE.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import "../assert-MZs1qjMx.js";
9
9
  import "../assert_instance_of-DHz7EHNU.js";
10
- import "../lookup-CHIhk5sJ.js";
11
- import { test } from "../testing-DM_97aHJ.js";
10
+ import "../lookup-IyAhz9I6.js";
11
+ import { test } from "../testing-DsuOHyiF.js";
12
12
  import "../std__assert-X-_kMxKM.js";
13
13
  import "../assert_rejects-DiIiJbZn.js";
14
14
  import "../assert_is_error-BPGph1Jx.js";
15
15
  import "../assert_not_equals-f3m3epl3.js";
16
16
  import "../assert_throws-BOO88avQ.js";
17
- import { esm_default } from "../esm-D3g5PyTT.js";
17
+ import { esm_default } from "../esm-CtgLSZwm.js";
18
18
  import { withTimeout } from "es-toolkit";
19
19
 
20
20
  //#region src/webfinger/lookup.test.ts
@@ -2,6 +2,5 @@ import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  import "../kv-C7sopW2E.js";
4
4
  import "../docloader-CxWcuWqQ.js";
5
- import { Link, LookupWebFingerOptions, ResourceDescriptor, lookupWebFinger } from "../lookup-3czM5mmU.js";
6
- import "../mod-GIh5OYxW.js";
5
+ import { Link, LookupWebFingerOptions, ResourceDescriptor, lookupWebFinger } from "../mod-DBzN0aCM.js";
7
6
  export { Link, LookupWebFingerOptions, ResourceDescriptor, lookupWebFinger };
@@ -2,8 +2,8 @@
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
- import "../docloader-Oh_3p-47.js";
6
- import { lookupWebFinger } from "../lookup-CUS6_-CL.js";
5
+ import "../docloader-DIjo5mkd.js";
6
+ import { lookupWebFinger } from "../lookup-B8Ld9P9G.js";
7
7
  import "../webfinger-C3GIyXIg.js";
8
8
 
9
9
  export { lookupWebFinger };
@@ -3,12 +3,12 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import "../type-BaPlY7h1.js";
6
+ import "../type-BMGxK0zE.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import "../assert-MZs1qjMx.js";
9
9
  import "../assert_instance_of-DHz7EHNU.js";
10
- import "../lookup-CHIhk5sJ.js";
11
- import { test } from "../testing-DM_97aHJ.js";
10
+ import "../lookup-IyAhz9I6.js";
11
+ import { test } from "../testing-DsuOHyiF.js";
12
12
  import "../std__assert-X-_kMxKM.js";
13
13
  import "../assert_rejects-DiIiJbZn.js";
14
14
  import "../assert_is_error-BPGph1Jx.js";
package/dist/x/hono.d.ts CHANGED
@@ -8,8 +8,8 @@ import "../actor-C22bXuuC.js";
8
8
  import "../http-DqSNLFNY.js";
9
9
  import "../owner-CQPnQVtf.js";
10
10
  import "../mod-Cxt4Kpf6.js";
11
- import "../lookup-3czM5mmU.js";
12
- import { Federation } from "../context-3ICnZJKt.js";
11
+ import "../mod-DBzN0aCM.js";
12
+ import { Federation } from "../context-9gCpIkiz.js";
13
13
  import "../mq-CRGm1e_F.js";
14
14
 
15
15
  //#region src/x/hono.d.ts
@@ -8,8 +8,8 @@ import "../actor-C22bXuuC.js";
8
8
  import "../http-DqSNLFNY.js";
9
9
  import "../owner-CQPnQVtf.js";
10
10
  import "../mod-Cxt4Kpf6.js";
11
- import "../lookup-3czM5mmU.js";
12
- import { Federation } from "../context-3ICnZJKt.js";
11
+ import "../mod-DBzN0aCM.js";
12
+ import { Federation } from "../context-9gCpIkiz.js";
13
13
  import "../mq-CRGm1e_F.js";
14
14
 
15
15
  //#region src/x/sveltekit.d.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "2.0.0-dev.1514+0af04001",
3
+ "version": "2.0.0-dev.1561+4bb27050",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -1,26 +0,0 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
- globalThis.addEventListener = () => {};
5
-
6
- import "./type-BaPlY7h1.js";
7
- import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-DZEp_3SF.js";
8
- import "./semver-dArNLkR9.js";
9
- import "./client-CVlb4Ok0.js";
10
- import "./lookup-CHIhk5sJ.js";
11
- import "./types-BIgY6c-l.js";
12
- import "./actor-_5FcZYCJ.js";
13
- import "./key-dwUEz7hD.js";
14
- import "./http-CqQdyMrD.js";
15
- import "./authdocloader-B85dU2XF.js";
16
- import "./ld-Cnu549gk.js";
17
- import "./owner-DLtMHO6X.js";
18
- import "./proof-BJikaSMR.js";
19
- import "./inbox-aK-1EWle.js";
20
- import "./builder-CYzXSls9.js";
21
- import "./collection-CSzG2j1P.js";
22
- import "./keycache-BVu6aNEj.js";
23
- import "./retry-D4GJ670a.js";
24
- import "./send-vv5TvgyD.js";
25
-
26
- export { FederationImpl };
@@ -1,17 +0,0 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
-
5
- import "./transformers-Dna8Fg7k.js";
6
- import "./docloader-Oh_3p-47.js";
7
- import "./actor-B9P2qjOp.js";
8
- import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-Bx2AUSYt.js";
9
- import "./lookup-CUS6_-CL.js";
10
- import "./key-DvNnIm-b.js";
11
- import "./http-BfYXy8KN.js";
12
- import "./proof-DV0L-54H.js";
13
- import "./types-0RrqyCDq.js";
14
- import "./authdocloader-D1iSfbFg.js";
15
- import "./vocab-FZ-IPYpZ.js";
16
-
17
- export { FederationImpl };
@@ -1,2 +0,0 @@
1
- import { Temporal } from "@js-temporal/polyfill";
2
- import { URLPattern } from "urlpattern-polyfill";