@fedify/fedify 2.0.0-pr.412.1559 → 2.0.0-pr.412.1794

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 (204) hide show
  1. package/README.md +3 -0
  2. package/dist/{actor-Cc6B76eG.js → actor-BXHc5r-q.js} +1 -1
  3. package/dist/actor-Ba9Z1eNJ.cjs +42079 -0
  4. package/dist/{actor-C22bXuuC.d.ts → actor-DqFajh9s.d.ts} +2 -2
  5. package/dist/{actor-CTAuCsWy.js → actor-DzhunPC_.js} +7058 -2722
  6. package/dist/actor-f2NtjyCg.d.cts +128 -0
  7. package/dist/{assert_rejects-DiIiJbZn.js → assert_rejects-Ce45JcFg.js} +1 -1
  8. package/dist/{assert_is_error-BPGph1Jx.js → assert_throws-BNXdRGWP.js} +31 -1
  9. package/dist/{builder-BOEBObR8.js → builder-u7usRsT3.js} +13 -8
  10. package/dist/chunk-DqRYRqnO.cjs +34 -0
  11. package/dist/client-94iWEfQa.d.cts +222 -0
  12. package/dist/{client-DF8anIB5.d.ts → client-BsGzbnV-.d.ts} +3 -75
  13. package/dist/{client-De-z2UnN.js → client-pY7-3icS.js} +3 -22
  14. package/dist/compat/mod.cjs +10 -0
  15. package/dist/compat/mod.d.cts +12 -0
  16. package/dist/compat/mod.d.ts +11 -12
  17. package/dist/compat/mod.js +5 -5
  18. package/dist/compat/transformers.test.js +20 -20
  19. package/dist/compat-DmDDELst.cjs +4 -0
  20. package/dist/compat-nxUqe4Z-.js +4 -0
  21. package/dist/{context-9gCpIkiz.d.ts → context-DG0huGW-.d.ts} +184 -127
  22. package/dist/context-DJ8aSy2Q.d.cts +2312 -0
  23. package/dist/{authdocloader-CLgDGafZ.js → docloader-CrbAy9Oc.js} +17 -8
  24. package/dist/{esm-CHdxdkuH.js → esm-C-Qa1zEM.js} +11 -11
  25. package/dist/federation/builder.test.js +9 -12
  26. package/dist/federation/collection.test.js +7 -9
  27. package/dist/federation/handler.test.js +27 -148
  28. package/dist/federation/idempotency.test.js +201 -0
  29. package/dist/federation/inbox.test.js +4 -6
  30. package/dist/federation/keycache.test.js +3 -4
  31. package/dist/federation/kv.test.js +7 -8
  32. package/dist/federation/middleware.test.js +242 -64
  33. package/dist/federation/mod.cjs +27 -0
  34. package/dist/federation/mod.d.cts +12 -0
  35. package/dist/federation/mod.d.ts +12 -13
  36. package/dist/federation/mod.js +13 -15
  37. package/dist/federation/mq.test.js +8 -10
  38. package/dist/federation/negotiation.test.js +26 -0
  39. package/dist/federation/retry.test.js +4 -5
  40. package/dist/federation/router.test.js +6 -8
  41. package/dist/federation/send.test.js +13 -15
  42. package/dist/federation-CRpdnOMS.cjs +244 -0
  43. package/dist/{federation-CMX7WzeL.js → federation-jcR8-ZxP.js} +3 -3
  44. package/dist/fixtures/media.example.com/avatars/test-avatar.jpg.json +6 -0
  45. package/dist/{http-DqSNLFNY.d.ts → http-BbO0ejuk.d.ts} +2 -2
  46. package/dist/{http-l0TEupZK.js → http-CUVx-vzb.js} +260 -10
  47. package/dist/{http-CcdM1brU.js → http-D2kIm9la.js} +3 -3
  48. package/dist/http-Dofes42e.cjs +1106 -0
  49. package/dist/http-M8k5mKc0.d.cts +253 -0
  50. package/dist/{inbox-B6DZbGNf.js → inbox-HjG5peXY.js} +24 -7
  51. package/dist/{key-CzLv1phF.js → key-CxdLUFS6.js} +3 -2
  52. package/dist/{keycache-B8HdZJSt.js → keycache-bU7COwsh.js} +1 -1
  53. package/dist/{keys-zZwiKkfx.js → keys-DMHs8XNn.js} +2 -1
  54. package/dist/kv-Bxr0Q87_.d.cts +81 -0
  55. package/dist/kv-cache-CGXcDejL.js +122 -0
  56. package/dist/kv-cache-DN9pfMBe.js +94 -0
  57. package/dist/kv-cache-Dkvbn6rg.cjs +134 -0
  58. package/dist/{ld-CBcQdZ6N.js → ld-CIhvSCCr.js} +5 -4
  59. package/dist/lookup-CHkCVZTU.js +260 -0
  60. package/dist/lookup-CfFkONZD.cjs +272 -0
  61. package/dist/{type-SK-d7Tbw.js → lookup-DQRtjvb1.js} +7266 -7087
  62. package/dist/middleware-Bot7EEwV.js +26 -0
  63. package/dist/middleware-CFJgmUMW.cjs +15 -0
  64. package/dist/{middleware-BRgu1IH8.js → middleware-CJlj5Olw.js} +86 -181
  65. package/dist/middleware-CjHl2NHA.js +15 -0
  66. package/dist/middleware-D74TgW2E.cjs +4225 -0
  67. package/dist/{middleware-CxEkcFW0.js → middleware-DMk2Mdn9.js} +117 -127
  68. package/dist/mod-0noXw66R.d.cts +107 -0
  69. package/dist/mod-B-hUPT2N.d.cts +1 -0
  70. package/dist/{mod-Drmz72EK.d.ts → mod-B2iOw50L.d.ts} +3 -3
  71. package/dist/mod-B9M-8jm2.d.ts +109 -0
  72. package/dist/{mod-Cxt4Kpf6.d.ts → mod-BlVovdcy.d.ts} +20 -2
  73. package/dist/{mod-Bqxcp7eN.d.ts → mod-BoHnwOCs.d.ts} +2 -2
  74. package/dist/mod-BxRCHTz-.d.cts +307 -0
  75. package/dist/mod-C2tOeRkN.d.cts +1 -0
  76. package/dist/mod-C58MZ7Wx.d.cts +113 -0
  77. package/dist/mod-DJcZDvjA.d.cts +80 -0
  78. package/dist/mod-DgdBYYa0.d.cts +266 -0
  79. package/dist/{mod-DBzN0aCM.d.ts → mod-Ds0mpFZU.d.ts} +1 -1
  80. package/dist/mod.cjs +137 -0
  81. package/dist/mod.d.cts +16 -0
  82. package/dist/mod.d.ts +16 -17
  83. package/dist/mod.js +19 -21
  84. package/dist/mq-DcJPkXD5.d.cts +140 -0
  85. package/dist/negotiation-C4nFufNk.js +71 -0
  86. package/dist/nodeinfo/client.test.js +30 -111
  87. package/dist/nodeinfo/handler.test.js +25 -26
  88. package/dist/nodeinfo/mod.cjs +10 -0
  89. package/dist/nodeinfo/mod.d.cts +3 -0
  90. package/dist/nodeinfo/mod.d.ts +3 -5
  91. package/dist/nodeinfo/mod.js +6 -7
  92. package/dist/nodeinfo/types.test.js +8 -15
  93. package/dist/nodeinfo-BnthBobC.js +4 -0
  94. package/dist/nodeinfo-CdN0rEnZ.cjs +4 -0
  95. package/dist/owner-B4HbyP8s.d.cts +67 -0
  96. package/dist/{owner-VEIjmR8r.js → owner-Dvh7mBvr.js} +3 -2
  97. package/dist/{owner-CQPnQVtf.d.ts → owner-kQRGVXG1.d.ts} +3 -3
  98. package/dist/proof-D0uThUvD.cjs +674 -0
  99. package/dist/{proof-DoSQAGkE.js → proof-Dgy35fzc.js} +3 -3
  100. package/dist/{proof-tgUlT8hw.js → proof-fqzaMJ4g.js} +11 -10
  101. package/dist/{send-BzS7w-QF.js → send-Drp20VO9.js} +2 -2
  102. package/dist/sig/http.test.js +13 -14
  103. package/dist/sig/key.test.js +9 -11
  104. package/dist/sig/ld.test.js +8 -10
  105. package/dist/sig/mod.cjs +28 -0
  106. package/dist/sig/mod.d.cts +6 -0
  107. package/dist/sig/mod.d.ts +5 -7
  108. package/dist/sig/mod.js +8 -10
  109. package/dist/sig/owner.test.js +10 -12
  110. package/dist/sig/proof.test.js +13 -14
  111. package/dist/sig-C34-oHBl.js +4 -0
  112. package/dist/sig-YYj5tCnr.cjs +4 -0
  113. package/dist/testing/docloader.test.js +6 -8
  114. package/dist/testing/mod.d.ts +387 -224
  115. package/dist/testing/mod.js +2 -3
  116. package/dist/{testing-Z2omCvKy.js → testing-g4UC4liW.js} +1 -2
  117. package/dist/{transformers-Dna8Fg7k.js → transformers-BFT6d7J5.js} +3 -3
  118. package/dist/transformers-CoBS-oFG.cjs +116 -0
  119. package/dist/{types-DgPvoUWN.js → types-BtUjyi5y.js} +8 -169
  120. package/dist/{types-BIgY6c-l.js → types-C2XVl6gj.js} +1 -3
  121. package/dist/types-CWgzGaqk.cjs +315 -0
  122. package/dist/{runtime/authdocloader.test.js → utils/docloader.test.js} +14 -15
  123. package/dist/utils/kv-cache.test.js +209 -0
  124. package/dist/utils/mod.cjs +12 -0
  125. package/dist/utils/mod.d.cts +5 -0
  126. package/dist/utils/mod.d.ts +7 -0
  127. package/dist/utils/mod.js +11 -0
  128. package/dist/utils-D-Va7aXC.js +4 -0
  129. package/dist/utils-DyRU1gdZ.cjs +4 -0
  130. package/dist/vocab/actor.test.js +8 -10
  131. package/dist/vocab/lookup.test.js +257 -9
  132. package/dist/vocab/mod.cjs +86 -0
  133. package/dist/vocab/mod.d.cts +4 -0
  134. package/dist/vocab/mod.d.ts +3 -5
  135. package/dist/vocab/mod.js +6 -7
  136. package/dist/vocab/type.test.js +2 -3
  137. package/dist/vocab/vocab.test.js +438 -15
  138. package/dist/{vocab-SOE1ifCr.d.ts → vocab-BCWe1Ih5.d.ts} +292 -21
  139. package/dist/{vocab-CvD6Vbml.js → vocab-BnR3nIU9.js} +26 -17
  140. package/dist/vocab-CeDBzu-f.d.cts +14903 -0
  141. package/dist/{lookup-Bn_HEC_d.js → vocab-DFaWWYDn.cjs} +108 -139
  142. package/dist/webfinger/handler.test.js +24 -25
  143. package/dist/webfinger/lookup.test.js +7 -9
  144. package/dist/webfinger/mod.cjs +8 -0
  145. package/dist/webfinger/mod.d.cts +2 -0
  146. package/dist/webfinger/mod.d.ts +1 -3
  147. package/dist/webfinger/mod.js +5 -6
  148. package/dist/webfinger-C72Y8lrh.js +4 -0
  149. package/dist/webfinger-vAtLmxOF.cjs +4 -0
  150. package/dist/x/cfworkers.cjs +100 -0
  151. package/dist/x/cfworkers.d.cts +59 -0
  152. package/dist/x/cfworkers.d.ts +2 -2
  153. package/dist/x/cfworkers.js +3 -3
  154. package/dist/x/cfworkers.test.js +6 -8
  155. package/dist/x/hono.cjs +61 -0
  156. package/dist/x/hono.d.cts +53 -0
  157. package/dist/x/hono.d.ts +10 -11
  158. package/dist/x/hono.js +3 -3
  159. package/dist/x/sveltekit.cjs +69 -0
  160. package/dist/x/sveltekit.d.cts +45 -0
  161. package/dist/x/sveltekit.d.ts +10 -11
  162. package/dist/x/sveltekit.js +3 -3
  163. package/package.json +79 -23
  164. package/dist/assert_throws-BOO88avQ.js +0 -39
  165. package/dist/authdocloader-BFVqUbyo.js +0 -52
  166. package/dist/compat-Bb5myD13.js +0 -4
  167. package/dist/docloader-CxWcuWqQ.d.ts +0 -221
  168. package/dist/docloader-DEhniCVa.js +0 -4615
  169. package/dist/key-CUZQgVlf.js +0 -10
  170. package/dist/key-Deb0_wWL.js +0 -10
  171. package/dist/key-DxA6xRtZ.js +0 -260
  172. package/dist/lookup-dtdr2ftf.js +0 -131
  173. package/dist/middleware-BE_geSiJ.js +0 -17
  174. package/dist/middleware-BnU6hzVp.js +0 -26
  175. package/dist/mod-TFoH2Ql8.d.ts +0 -104
  176. package/dist/nodeinfo/semver.test.js +0 -143
  177. package/dist/nodeinfo-CyEbLjHs.js +0 -4
  178. package/dist/runtime/docloader.test.js +0 -522
  179. package/dist/runtime/key.test.js +0 -103
  180. package/dist/runtime/langstr.test.d.ts +0 -3
  181. package/dist/runtime/langstr.test.js +0 -39
  182. package/dist/runtime/mod.d.ts +0 -8
  183. package/dist/runtime/mod.js +0 -13
  184. package/dist/runtime/multibase/multibase.test.d.ts +0 -3
  185. package/dist/runtime/multibase/multibase.test.js +0 -358
  186. package/dist/runtime/url.test.d.ts +0 -3
  187. package/dist/runtime/url.test.js +0 -45
  188. package/dist/runtime-BSkOVUWM.js +0 -4
  189. package/dist/semver-dArNLkR9.js +0 -149
  190. package/dist/sig-BXJO--F9.js +0 -4
  191. package/dist/webfinger-C3GIyXIg.js +0 -4
  192. /package/dist/{assert_not_equals-f3m3epl3.js → assert_not_equals-C80BG-_5.js} +0 -0
  193. /package/dist/{collection-CSzG2j1P.js → collection-BzWsN9pB.js} +0 -0
  194. /package/dist/{denokv-Bv33Xxea.js → denokv-CCssOzMJ.js} +0 -0
  195. /package/dist/{nodeinfo/semver.test.d.ts → federation/idempotency.test.d.ts} +0 -0
  196. /package/dist/{runtime/authdocloader.test.d.ts → federation/negotiation.test.d.ts} +0 -0
  197. /package/dist/{kv-C7sopW2E.d.ts → kv-BKNZ-Tb-.d.ts} +0 -0
  198. /package/dist/{mod-1pDWKvUL.d.ts → mod-CVgZgliM.d.ts} +0 -0
  199. /package/dist/{mod-g0xFzAP9.d.ts → mod-xIj-IT58.d.ts} +0 -0
  200. /package/dist/{mq-CRGm1e_F.d.ts → mq-CUKlBw08.d.ts} +0 -0
  201. /package/dist/{retry-D4GJ670a.js → retry-CfF8Gn4d.js} +0 -0
  202. /package/dist/{std__assert-X-_kMxKM.js → std__assert-DWivtrGR.js} +0 -0
  203. /package/dist/{runtime → utils}/docloader.test.d.ts +0 -0
  204. /package/dist/{runtime/key.test.d.ts → utils/kv-cache.test.d.ts} +0 -0
@@ -1,221 +0,0 @@
1
- import { Temporal } from "@js-temporal/polyfill";
2
- import { URLPattern } from "urlpattern-polyfill";
3
- import { KvKey, KvStore } from "./kv-C7sopW2E.js";
4
-
5
- //#region src/runtime/docloader.d.ts
6
- /**
7
- * A remote JSON-LD document and its context fetched by
8
- * a {@link DocumentLoader}.
9
- */
10
- interface RemoteDocument {
11
- /**
12
- * The URL of the context document.
13
- */
14
- contextUrl: string | null;
15
- /**
16
- * The fetched JSON-LD document.
17
- */
18
- document: unknown;
19
- /**
20
- * The URL of the fetched document.
21
- */
22
- documentUrl: string;
23
- }
24
- /**
25
- * Options for {@link DocumentLoader}.
26
- * @since 1.8.0
27
- */
28
- interface DocumentLoaderOptions {
29
- /**
30
- * An `AbortSignal` for cancellation.
31
- * @since 1.8.0
32
- */
33
- signal?: AbortSignal;
34
- }
35
- /**
36
- * A JSON-LD document loader that fetches documents from the Web.
37
- * @param url The URL of the document to load.
38
- * @param options The options for the document loader.
39
- * @returns The loaded remote document.
40
- */
41
- type DocumentLoader = (url: string, options?: DocumentLoaderOptions) => Promise<RemoteDocument>;
42
- /**
43
- * A factory function that creates a {@link DocumentLoader} with options.
44
- * @param options The options for the document loader.
45
- * @returns The document loader.
46
- * @since 1.4.0
47
- */
48
- type DocumentLoaderFactory = (options?: DocumentLoaderFactoryOptions) => DocumentLoader;
49
- /**
50
- * Options for {@link DocumentLoaderFactory}.
51
- * @see {@link DocumentLoaderFactory}
52
- * @see {@link AuthenticatedDocumentLoaderFactory}
53
- * @since 1.4.0
54
- */
55
- interface DocumentLoaderFactoryOptions {
56
- /**
57
- * Whether to allow fetching private network addresses.
58
- * Turned off by default.
59
- * @default `false``
60
- */
61
- allowPrivateAddress?: boolean;
62
- /**
63
- * Options for making `User-Agent` string.
64
- * If a string is given, it is used as the `User-Agent` header value.
65
- * If an object is given, it is passed to {@link getUserAgent} function.
66
- */
67
- userAgent?: GetUserAgentOptions | string;
68
- }
69
- /**
70
- * A factory function that creates an authenticated {@link DocumentLoader} for
71
- * a given identity. This is used for fetching documents that require
72
- * authentication.
73
- * @param identity The identity to create the document loader for.
74
- * The actor's key pair.
75
- * @param options The options for the document loader.
76
- * @returns The authenticated document loader.
77
- * @since 0.4.0
78
- */
79
- type AuthenticatedDocumentLoaderFactory = (identity: {
80
- keyId: URL;
81
- privateKey: CryptoKey;
82
- }, options?: DocumentLoaderFactoryOptions) => DocumentLoader;
83
- /**
84
- * Error thrown when fetching a JSON-LD document failed.
85
- */
86
- declare class FetchError extends Error {
87
- /**
88
- * The URL that failed to fetch.
89
- */
90
- url: URL;
91
- /**
92
- * Constructs a new `FetchError`.
93
- *
94
- * @param url The URL that failed to fetch.
95
- * @param message Error message.
96
- */
97
- constructor(url: URL | string, message?: string);
98
- }
99
- /**
100
- * Options for creating a request.
101
- * @internal
102
- */
103
-
104
- /**
105
- * Options for {@link getDocumentLoader}.
106
- * @since 1.3.0
107
- */
108
- interface GetDocumentLoaderOptions extends DocumentLoaderFactoryOptions {
109
- /**
110
- * Whether to preload the frequently used contexts.
111
- */
112
- skipPreloadedContexts?: boolean;
113
- }
114
- /**
115
- * Creates a JSON-LD document loader that utilizes the browser's `fetch` API.
116
- *
117
- * The created loader preloads the below frequently used contexts by default
118
- * (unless `options.ignorePreloadedContexts` is set to `true`):
119
- *
120
- * - <https://www.w3.org/ns/activitystreams>
121
- * - <https://w3id.org/security/v1>
122
- * - <https://w3id.org/security/data-integrity/v1>
123
- * - <https://www.w3.org/ns/did/v1>
124
- * - <https://w3id.org/security/multikey/v1>
125
- * - <https://purl.archive.org/socialweb/webfinger>
126
- * - <http://schema.org/>
127
- * @param options Options for the document loader.
128
- * @returns The document loader.
129
- * @since 1.3.0
130
- */
131
- declare function getDocumentLoader({
132
- allowPrivateAddress,
133
- skipPreloadedContexts,
134
- userAgent
135
- }?: GetDocumentLoaderOptions): DocumentLoader;
136
- /**
137
- * A JSON-LD document loader that utilizes the browser's `fetch` API.
138
- *
139
- * This loader preloads the below frequently used contexts:
140
- *
141
- * - <https://www.w3.org/ns/activitystreams>
142
- * - <https://w3id.org/security/v1>
143
- * - <https://w3id.org/security/data-integrity/v1>
144
- * - <https://www.w3.org/ns/did/v1>
145
- * - <https://w3id.org/security/multikey/v1>
146
- * - <https://purl.archive.org/socialweb/webfinger>
147
- * - <http://schema.org/>
148
- * @param url The URL of the document to load.
149
- * @param allowPrivateAddress Whether to allow fetching private network
150
- * addresses. Turned off by default.
151
- * @returns The remote document.
152
- * @deprecated Use {@link getDocumentLoader} instead.
153
- */
154
- declare function fetchDocumentLoader(url: string, allowPrivateAddress?: boolean): Promise<RemoteDocument>;
155
- declare function fetchDocumentLoader(url: string, options?: DocumentLoaderOptions): Promise<RemoteDocument>;
156
- /**
157
- * The parameters for {@link kvCache} function.
158
- */
159
- interface KvCacheParameters {
160
- /**
161
- * The document loader to decorate with a cache.
162
- */
163
- loader: DocumentLoader;
164
- /**
165
- * The key–value store to use for backing the cache.
166
- */
167
- kv: KvStore;
168
- /**
169
- * The key prefix to use for namespacing the cache.
170
- * `["_fedify", "remoteDocument"]` by default.
171
- */
172
- prefix?: KvKey;
173
- /**
174
- * The per-URL cache rules in the array of `[urlPattern, duration]` pairs
175
- * where `urlPattern` is either a string, a {@link URL}, or
176
- * a {@link URLPattern} and `duration` is a {@link Temporal.Duration}.
177
- * The `duration` is allowed to be at most 30 days.
178
- *
179
- * By default, 5 minutes for all URLs.
180
- */
181
- rules?: [string | URL | URLPattern, Temporal.Duration][];
182
- }
183
- /**
184
- * Decorates a {@link DocumentLoader} with a cache backed by a {@link Deno.Kv}.
185
- * @param parameters The parameters for the cache.
186
- * @returns The decorated document loader which is cache-enabled.
187
- */
188
- declare function kvCache({
189
- loader,
190
- kv,
191
- prefix,
192
- rules
193
- }: KvCacheParameters): DocumentLoader;
194
- /**
195
- * Options for making `User-Agent` string.
196
- * @see {@link getUserAgent}
197
- * @since 1.3.0
198
- */
199
- interface GetUserAgentOptions {
200
- /**
201
- * An optional software name and version, e.g., `"Hollo/1.0.0"`.
202
- */
203
- software?: string | null;
204
- /**
205
- * An optional URL to append to the user agent string.
206
- * Usually the URL of the ActivityPub instance.
207
- */
208
- url?: string | URL | null;
209
- }
210
- /**
211
- * Gets the user agent string for the given application and URL.
212
- * @param options The options for making the user agent string.
213
- * @returns The user agent string.
214
- * @since 1.3.0
215
- */
216
- declare function getUserAgent({
217
- software,
218
- url
219
- }?: GetUserAgentOptions): string;
220
- //#endregion
221
- export { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, DocumentLoaderFactoryOptions, FetchError, GetDocumentLoaderOptions, GetUserAgentOptions, KvCacheParameters, RemoteDocument, fetchDocumentLoader, getDocumentLoader, getUserAgent, kvCache };