@fedify/fedify 1.9.0-pr.407.1544 → 1.9.0-pr.421.1746

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 (176) hide show
  1. package/dist/actor-B2pAR8hn.cjs +42606 -0
  2. package/dist/{actor-BY--uubW.js → actor-BGkVHk1D.js} +6951 -2127
  3. package/dist/{actor-Ch5yFYFG.d.ts → actor-C1Euqngb.d.ts} +1 -1
  4. package/dist/{actor-CeBu8hLy.js → actor-CRMvoMgB.js} +1 -1
  5. package/dist/actor-Ydzhc8dj.d.cts +128 -0
  6. package/dist/{authdocloader-C89pKQKE.js → authdocloader-1wvQznSP.js} +6 -6
  7. package/dist/authdocloader-B6vfY0DQ.cjs +58 -0
  8. package/dist/{authdocloader-jHzDqZo2.js → authdocloader-BaK01biC.js} +3 -3
  9. package/dist/{builder-ClMKBUks.js → builder-BYjzwwU1.js} +14 -8
  10. package/dist/chunk-DqRYRqnO.cjs +34 -0
  11. package/dist/{client-DB3mC1oJ.js → client-CchEe2DS.js} +1 -1
  12. package/dist/client-DjT_tegg.d.cts +294 -0
  13. package/dist/compat/mod.cjs +10 -0
  14. package/dist/compat/mod.d.cts +13 -0
  15. package/dist/compat/mod.d.ts +7 -7
  16. package/dist/compat/mod.js +5 -5
  17. package/dist/compat/transformers.test.js +16 -16
  18. package/dist/compat-DmDDELst.cjs +4 -0
  19. package/dist/compat-nxUqe4Z-.js +4 -0
  20. package/dist/{context-DFruNLny.d.ts → context-CXUibY4L.d.ts} +179 -116
  21. package/dist/context-CwUAkopp.d.cts +2324 -0
  22. package/dist/docloader-BeO6Nvv8.cjs +4862 -0
  23. package/dist/{docloader-BJTPo7_i.js → docloader-Bf4PXDNP.js} +188 -8
  24. package/dist/docloader-D-MrRyHl.d.cts +219 -0
  25. package/dist/{esm-BjUpSZdQ.js → esm-DKBIHBc7.js} +1 -1
  26. package/dist/federation/builder.test.js +5 -5
  27. package/dist/federation/collection.test.js +3 -3
  28. package/dist/federation/handler.test.js +17 -17
  29. package/dist/federation/idempotency.test.d.ts +3 -0
  30. package/dist/federation/idempotency.test.js +202 -0
  31. package/dist/federation/inbox.test.js +4 -4
  32. package/dist/federation/keycache.test.js +4 -4
  33. package/dist/federation/kv.test.js +4 -3
  34. package/dist/federation/middleware.test.js +18 -18
  35. package/dist/federation/mod.cjs +29 -0
  36. package/dist/federation/mod.d.cts +13 -0
  37. package/dist/federation/mod.d.ts +7 -7
  38. package/dist/federation/mod.js +15 -15
  39. package/dist/federation/mq.test.js +3 -3
  40. package/dist/federation/retry.test.js +3 -3
  41. package/dist/federation/router.test.js +3 -3
  42. package/dist/federation/send.test.js +10 -10
  43. package/dist/{federation-CMX7WzeL.js → federation-D1U8YY9t.js} +3 -3
  44. package/dist/federation-H2_En3j5.cjs +244 -0
  45. package/dist/fixtures/media.example.com/avatars/test-avatar.jpg.json +6 -0
  46. package/dist/http-B1_DzfAU.d.cts +253 -0
  47. package/dist/{http-sU0Wj-tv.js → http-BciknU_m.js} +7 -7
  48. package/dist/http-BkgY_K-o.cjs +826 -0
  49. package/dist/{http-3pAI0mqb.js → http-CvT-8K7A.js} +3 -3
  50. package/dist/{http-D8Q4xH0d.d.ts → http-wsGR6KkT.d.ts} +1 -1
  51. package/dist/{inbox-Dg825gXU.js → inbox-DmOmHCt8.js} +29 -7
  52. package/dist/key-BNpAX-yy.cjs +290 -0
  53. package/dist/{key-BWgRsIwz.js → key-Bf8wecsW.js} +3 -3
  54. package/dist/{key-l5QMtRss.js → key-Btn1rSKF.js} +5 -5
  55. package/dist/key-C-s397Qs.cjs +10 -0
  56. package/dist/{key-RzI0hV7H.js → key-CZzHTxwc.js} +2 -2
  57. package/dist/key-DlGLd9iL.js +10 -0
  58. package/dist/{keycache-BGlP5YTm.js → keycache-BRLbFuE4.js} +1 -1
  59. package/dist/{keys-BRbwmdDJ.js → keys-DgqkndRb.js} +1 -1
  60. package/dist/kv-63Cil1MD.d.cts +81 -0
  61. package/dist/{ld-C9E9DPBz.js → ld-v-iyFVSd.js} +4 -4
  62. package/dist/lookup-6OyofAxv.cjs +137 -0
  63. package/dist/{lookup-oZxe6kZr.js → lookup-8ZcpBTR8.js} +21 -12
  64. package/dist/{lookup-CN62_yPh.js → lookup-DxJ0NLYS.js} +4 -4
  65. package/dist/middleware-C7PiPtdo.cjs +4271 -0
  66. package/dist/middleware-CnRFgcDM.cjs +17 -0
  67. package/dist/middleware-CvThFfEG.js +26 -0
  68. package/dist/middleware-DG81e5gf.js +17 -0
  69. package/dist/{middleware-extU7qDB.js → middleware-DRE7WmH1.js} +96 -65
  70. package/dist/{middleware-jQ1GPh2U.js → middleware-LZN4mAnb.js} +57 -54
  71. package/dist/mod-BUbqxBev.d.cts +307 -0
  72. package/dist/{mod-CiXjux2r.d.ts → mod-BcObK1Lz.d.ts} +2 -2
  73. package/dist/mod-C2tOeRkN.d.cts +1 -0
  74. package/dist/{mod-Cy6pkZSn.d.ts → mod-CDObsV1d.d.ts} +19 -1
  75. package/dist/{mod-BAuhKa9d.d.ts → mod-CIbqfZW0.d.ts} +1 -1
  76. package/dist/{mod-B7Pc0I7F.d.ts → mod-DgcYoyZK.d.ts} +2 -2
  77. package/dist/mod-Dt-G9ZOS.d.cts +102 -0
  78. package/dist/mod-FZd39qVq.d.cts +1 -0
  79. package/dist/mod-fjqfsrty.d.cts +266 -0
  80. package/dist/mod-jQ4OODsl.d.cts +113 -0
  81. package/dist/mod-mXx9V0q5.d.cts +80 -0
  82. package/dist/mod.cjs +152 -0
  83. package/dist/mod.d.cts +17 -0
  84. package/dist/mod.d.ts +10 -10
  85. package/dist/mod.js +20 -20
  86. package/dist/mq-B7R1Q-M5.d.cts +140 -0
  87. package/dist/nodeinfo/client.test.js +5 -5
  88. package/dist/nodeinfo/handler.test.js +16 -16
  89. package/dist/nodeinfo/mod.cjs +13 -0
  90. package/dist/nodeinfo/mod.d.cts +5 -0
  91. package/dist/nodeinfo/mod.js +6 -6
  92. package/dist/nodeinfo/semver.test.js +3 -3
  93. package/dist/nodeinfo/types.test.js +3 -3
  94. package/dist/nodeinfo-Co9lJrWl.cjs +4 -0
  95. package/dist/nodeinfo-DfycQ8Wf.js +4 -0
  96. package/dist/owner-6KSEp9eV.d.cts +67 -0
  97. package/dist/{owner-D38zBIMc.d.ts → owner-BbeUDvOu.d.ts} +2 -2
  98. package/dist/{owner-B836JKuZ.js → owner-DiaqwZNX.js} +2 -2
  99. package/dist/{proof-DLwnfKak.js → proof-BJmMlvgv.js} +9 -9
  100. package/dist/{proof-D63mA1Rv.js → proof-BLrU2QqY.js} +3 -3
  101. package/dist/proof-uoL7KsPK.cjs +673 -0
  102. package/dist/runtime/authdocloader.test.js +9 -9
  103. package/dist/runtime/docloader.test.js +4 -4
  104. package/dist/runtime/key.test.js +5 -5
  105. package/dist/runtime/langstr.test.js +3 -3
  106. package/dist/runtime/link.test.d.ts +3 -0
  107. package/dist/runtime/link.test.js +61 -0
  108. package/dist/runtime/mod.cjs +25 -0
  109. package/dist/runtime/mod.d.cts +6 -0
  110. package/dist/runtime/mod.d.ts +3 -3
  111. package/dist/runtime/mod.js +10 -10
  112. package/dist/runtime/multibase/multibase.test.js +3 -3
  113. package/dist/runtime/url.test.js +3 -3
  114. package/dist/runtime-C58AJWSv.cjs +4 -0
  115. package/dist/runtime-DPYEDf-o.js +4 -0
  116. package/dist/{send-CE9GFSCd.js → send-Bh9H1ZtH.js} +2 -2
  117. package/dist/sig/http.test.js +9 -9
  118. package/dist/sig/key.test.js +6 -6
  119. package/dist/sig/ld.test.js +7 -7
  120. package/dist/sig/mod.cjs +30 -0
  121. package/dist/sig/mod.d.cts +8 -0
  122. package/dist/sig/mod.d.ts +5 -5
  123. package/dist/sig/mod.js +10 -10
  124. package/dist/sig/owner.test.js +7 -7
  125. package/dist/sig/proof.test.js +7 -7
  126. package/dist/sig-ByHXzqUi.cjs +4 -0
  127. package/dist/sig-Cj3tk-ig.js +4 -0
  128. package/dist/testing/docloader.test.js +3 -3
  129. package/dist/testing/mod.d.ts +385 -110
  130. package/dist/testing/mod.js +3 -3
  131. package/dist/{testing-B2tgn0a4.js → testing-wv9xgBFV.js} +2 -2
  132. package/dist/{transformers-Dna8Fg7k.js → transformers-BFT6d7J5.js} +3 -3
  133. package/dist/transformers-CoBS-oFG.cjs +116 -0
  134. package/dist/{type-OboVsUha.js → type-JHkkALfe.js} +7261 -2257
  135. package/dist/{types-BLr6AjjI.js → types-D-8qHCG5.js} +4 -4
  136. package/dist/types-SEdRdlKp.cjs +488 -0
  137. package/dist/vocab/actor.test.js +5 -5
  138. package/dist/vocab/lookup.test.js +255 -5
  139. package/dist/vocab/mod.cjs +87 -0
  140. package/dist/vocab/mod.d.cts +6 -0
  141. package/dist/vocab/mod.d.ts +3 -3
  142. package/dist/vocab/mod.js +7 -7
  143. package/dist/vocab/type.test.js +3 -3
  144. package/dist/vocab/vocab.test.js +433 -9
  145. package/dist/vocab-BZ2XJ4IH.cjs +291 -0
  146. package/dist/{vocab-BEEm2I6u.d.ts → vocab-CDHNj5zp.d.ts} +290 -0
  147. package/dist/{vocab-Z7alheNv.js → vocab-Cb3CeS7_.js} +26 -17
  148. package/dist/vocab-Cfs0937i.d.cts +14919 -0
  149. package/dist/webfinger/handler.test.js +16 -16
  150. package/dist/webfinger/lookup.test.js +4 -4
  151. package/dist/webfinger/mod.cjs +9 -0
  152. package/dist/webfinger/mod.d.cts +4 -0
  153. package/dist/webfinger/mod.js +6 -6
  154. package/dist/webfinger-BjOEdFPs.cjs +4 -0
  155. package/dist/webfinger-De_bU0iE.js +4 -0
  156. package/dist/x/cfworkers.cjs +100 -0
  157. package/dist/x/cfworkers.d.cts +59 -0
  158. package/dist/x/cfworkers.js +3 -3
  159. package/dist/x/cfworkers.test.js +3 -3
  160. package/dist/x/hono.cjs +61 -0
  161. package/dist/x/hono.d.cts +54 -0
  162. package/dist/x/hono.d.ts +6 -6
  163. package/dist/x/hono.js +3 -3
  164. package/dist/x/sveltekit.cjs +69 -0
  165. package/dist/x/sveltekit.d.cts +46 -0
  166. package/dist/x/sveltekit.d.ts +6 -6
  167. package/dist/x/sveltekit.js +3 -3
  168. package/package.json +68 -13
  169. package/dist/compat-Bb5myD13.js +0 -4
  170. package/dist/key-_XZAOE9D.js +0 -10
  171. package/dist/middleware-Ccahu3ql.js +0 -26
  172. package/dist/middleware-fO804EqJ.js +0 -17
  173. package/dist/nodeinfo-CyEbLjHs.js +0 -4
  174. package/dist/runtime-BSkOVUWM.js +0 -4
  175. package/dist/sig-BXJO--F9.js +0 -4
  176. package/dist/webfinger-C3GIyXIg.js +0 -4
@@ -0,0 +1,307 @@
1
+ import { DocumentLoader, GetUserAgentOptions } from "./docloader-D-MrRyHl.cjs";
2
+ import { Collection, Link, Object as Object$1 } from "./vocab-Cfs0937i.cjs";
3
+ import { TracerProvider } from "@opentelemetry/api";
4
+
5
+ //#region src/vocab/lookup.d.ts
6
+ /**
7
+ * Options for the {@link lookupObject} function.
8
+ *
9
+ * @since 0.2.0
10
+ */
11
+ interface LookupObjectOptions {
12
+ /**
13
+ * The document loader for loading remote JSON-LD documents.
14
+ */
15
+ documentLoader?: DocumentLoader;
16
+ /**
17
+ * The context loader for loading remote JSON-LD contexts.
18
+ * @since 0.8.0
19
+ */
20
+ contextLoader?: DocumentLoader;
21
+ /**
22
+ * Whether to allow fetching an object with an `@id` having a different
23
+ * origin than the object's URL. This is not recommended, as it may
24
+ * lead to security issues. Only use this option if you know what you
25
+ * are doing.
26
+ *
27
+ * How to handle the case when an object's `@id` has a different origin
28
+ * than the object's URL:
29
+ *
30
+ * - `"ignore"` (default): Do not return the object, and log a warning.
31
+ * - `"throw"`: Throw an error.
32
+ * - `"trust"`: Bypass the check and return the object anyway. This
33
+ * is not recommended, as it may lead to security issues. Only use
34
+ * this option if you know what you are doing.
35
+ *
36
+ * @since 1.9.0
37
+ */
38
+ crossOrigin?: "ignore" | "throw" | "trust";
39
+ /**
40
+ * The options for making `User-Agent` header.
41
+ * If a string is given, it is used as the `User-Agent` header value.
42
+ * If an object is given, it is passed to {@link getUserAgent} to generate
43
+ * the `User-Agent` header value.
44
+ * @since 1.3.0
45
+ */
46
+ userAgent?: GetUserAgentOptions | string;
47
+ /**
48
+ * The OpenTelemetry tracer provider. If omitted, the global tracer provider
49
+ * is used.
50
+ * @since 1.3.0
51
+ */
52
+ tracerProvider?: TracerProvider;
53
+ /**
54
+ * AbortSignal for cancelling the request.
55
+ * @since 1.8.0
56
+ */
57
+ signal?: AbortSignal;
58
+ }
59
+ /**
60
+ * Looks up an ActivityStreams object by its URI (including `acct:` URIs)
61
+ * or a fediverse handle (e.g., `@user@server` or `user@server`).
62
+ *
63
+ * @example
64
+ * ``` typescript
65
+ * // Look up an actor by its fediverse handle:
66
+ * await lookupObject("@hongminhee@fosstodon.org");
67
+ * // returning a `Person` object.
68
+ *
69
+ * // A fediverse handle can omit the leading '@':
70
+ * await lookupObject("hongminhee@fosstodon.org");
71
+ * // returning a `Person` object.
72
+ *
73
+ * // A `acct:` URI can be used as well:
74
+ * await lookupObject("acct:hongminhee@fosstodon.org");
75
+ * // returning a `Person` object.
76
+ *
77
+ * // Look up an object by its URI:
78
+ * await lookupObject("https://todon.eu/@hongminhee/112060633798771581");
79
+ * // returning a `Note` object.
80
+ *
81
+ * // It can be a `URL` object as well:
82
+ * await lookupObject(new URL("https://todon.eu/@hongminhee/112060633798771581"));
83
+ * // returning a `Note` object.
84
+ * ```
85
+ *
86
+ * @param identifier The URI or fediverse handle to look up.
87
+ * @param options Lookup options.
88
+ * @returns The object, or `null` if not found.
89
+ * @since 0.2.0
90
+ */
91
+ declare function lookupObject(identifier: string | URL, options?: LookupObjectOptions): Promise<Object$1 | null>;
92
+ /**
93
+ * Options for the {@link traverseCollection} function.
94
+ * @since 1.1.0
95
+ */
96
+ interface TraverseCollectionOptions {
97
+ /**
98
+ * The document loader for loading remote JSON-LD documents.
99
+ */
100
+ documentLoader?: DocumentLoader;
101
+ /**
102
+ * The context loader for loading remote JSON-LD contexts.
103
+ */
104
+ contextLoader?: DocumentLoader;
105
+ /**
106
+ * Whether to suppress errors when fetching pages. If `true`,
107
+ * errors will be logged but not thrown. Defaults to `false`.
108
+ */
109
+ suppressError?: boolean;
110
+ /**
111
+ * The interval to wait between fetching pages. Zero or negative
112
+ * values will disable the interval. Disabled by default.
113
+ *
114
+ * @default `{ seconds: 0 }`
115
+ */
116
+ interval?: Temporal.Duration | Temporal.DurationLike;
117
+ }
118
+ /**
119
+ * Traverses a collection, yielding each item in the collection.
120
+ * If the collection is paginated, it will fetch the next page
121
+ * automatically.
122
+ *
123
+ * @example
124
+ * ``` typescript
125
+ * const collection = await lookupObject(collectionUrl);
126
+ * if (collection instanceof Collection) {
127
+ * for await (const item of traverseCollection(collection)) {
128
+ * console.log(item.id?.href);
129
+ * }
130
+ * }
131
+ * ```
132
+ *
133
+ * @param collection The collection to traverse.
134
+ * @param options Options for traversing the collection.
135
+ * @returns An async iterable of each item in the collection.
136
+ * @since 1.1.0
137
+ */
138
+ declare function traverseCollection(collection: Collection, options?: TraverseCollectionOptions): AsyncIterable<Object$1 | Link>;
139
+ //#endregion
140
+ //#region src/vocab/constants.d.ts
141
+ /**
142
+ * The special public collection for [public addressing]. *Do not mutate this
143
+ * object.*
144
+ *
145
+ * [public addressing]: https://www.w3.org/TR/activitypub/#public-addressing
146
+ *
147
+ * @since 0.7.0
148
+ */
149
+ declare const PUBLIC_COLLECTION: URL;
150
+ //#endregion
151
+ //#region src/vocab/handle.d.ts
152
+ /**
153
+ * Represents a fediverse handle, which consists of a username and a host.
154
+ * The username can be alphanumeric and may include special characters,
155
+ * while the host is typically a domain name.
156
+ * @since 1.8.0
157
+ */
158
+ interface FediverseHandle {
159
+ /**
160
+ * The username part of the fediverse handle.
161
+ * It can include alphanumeric characters and some special characters.
162
+ */
163
+ readonly username: string;
164
+ /**
165
+ * The host part of the fediverse handle, typically a domain name.
166
+ * It is the part after the `@` symbol in the handle.
167
+ */
168
+ readonly host: string;
169
+ }
170
+ /**
171
+ * Parses a fediverse handle in the format `@user@server` or `user@server`.
172
+ * The `user` part can contain alphanumeric characters and some special
173
+ * characters except `@`. The `server` part is all characters after the `@`
174
+ * symbol in the middle.
175
+ *
176
+ * @example
177
+ * ```typescript
178
+ * const handle = parseFediverseHandle("@username@example.com");
179
+ * console.log(handle?.username); // "username"
180
+ * console.log(handle?.host); // "example.com"
181
+ * ```
182
+ *
183
+ * @param handle - The fediverse handle string to parse.
184
+ * @returns A {@link FediverseHandle} object with `username` and `host`
185
+ * if the input is valid; otherwise `null`.
186
+ * @since 1.8.0
187
+ */
188
+ declare function parseFediverseHandle(handle: string): FediverseHandle | null;
189
+ /**
190
+ * Checks if a string is a valid fediverse handle in the format `@user@server`
191
+ * or `user@server`. The `user` part can contain alphanumeric characters and
192
+ * some special characters except `@`. The `server` part is all characters
193
+ * after the `@` symbol in the middle.
194
+ *
195
+ * @example
196
+ * ```typescript
197
+ * console.log(isFediverseHandle("@username@example.com")); // true
198
+ * console.log(isFediverseHandle("username@example.com")); // true
199
+ * console.log(isFediverseHandle("@username@")); // false
200
+ * ```
201
+ *
202
+ * @param handle - The string to test as a fediverse handle.
203
+ * @returns `true` if the string matches the fediverse handle pattern;
204
+ * otherwise `false`.
205
+ * @since 1.8.0
206
+ */
207
+ declare function isFediverseHandle(handle: string): handle is `${string}@${string}`;
208
+ /**
209
+ * Converts a fediverse handle in the format `@user@server` or `user@server`
210
+ * to an `acct:` URI, which is a URL-like identifier for ActivityPub actors.
211
+ *
212
+ * @example
213
+ * ```typescript
214
+ * const identifier = toAcctUrl("@username@example.com");
215
+ * console.log(identifier?.href); // "acct:username@example.com"
216
+ * ```
217
+ *
218
+ * @param handle - The fediverse handle string to convert.
219
+ * @returns A `URL` object representing the `acct:` URI if conversion succeeds;
220
+ * otherwise `null`.
221
+ * @since 1.8.0
222
+ */
223
+ declare function toAcctUrl(handle: string): URL | null;
224
+ //#endregion
225
+ //#region src/vocab/type.d.ts
226
+ /**
227
+ * Returns the type URI of the given object.
228
+ *
229
+ * @example
230
+ * ``` typescript
231
+ * import { getTypeId, Person } from "@fedify/fedify";
232
+ *
233
+ * const obj = new Person({});
234
+ * console.log(getTypeId(obj));
235
+ * // => new URL("https://www.w3.org/ns/activitystreams#Person")
236
+ * ```
237
+ *
238
+ * @param object The Activity Vocabulary object.
239
+ * @returns The type URI of the object, e.g.,
240
+ * `new URL("https://www.w3.org/ns/activitystreams#Person")`.
241
+ * If the given `object` is `null` or `undefined`, returns `null` or
242
+ * `undefined`, respectively.
243
+ * @since 1.3.0
244
+ */
245
+ declare function getTypeId(object: Object$1 | Link): URL;
246
+ /**
247
+ * Returns the type URI of the given object.
248
+ *
249
+ * @example
250
+ * ``` typescript
251
+ * import { getTypeId, Person } from "@fedify/fedify";
252
+ *
253
+ * const obj = new Person({});
254
+ * console.log(getTypeId(obj));
255
+ * // => new URL("https://www.w3.org/ns/activitystreams#Person")
256
+ * ```
257
+ *
258
+ * @param object The Activity Vocabulary object.
259
+ * @returns The type URI of the object, e.g.,
260
+ * `new URL("https://www.w3.org/ns/activitystreams#Person")`.
261
+ * If the given `object` is `null` or `undefined`, returns `null` or
262
+ * `undefined`, respectively.
263
+ * @since 1.3.0
264
+ */
265
+ declare function getTypeId(object: Object$1 | Link | undefined): URL | undefined;
266
+ /**
267
+ * Returns the type URI of the given object.
268
+ *
269
+ * @example
270
+ * ``` typescript
271
+ * import { getTypeId, Person } from "@fedify/fedify";
272
+ *
273
+ * const obj = new Person({});
274
+ * console.log(getTypeId(obj));
275
+ * // => new URL("https://www.w3.org/ns/activitystreams#Person")
276
+ * ```
277
+ *
278
+ * @param object The Activity Vocabulary object.
279
+ * @returns The type URI of the object, e.g.,
280
+ * `new URL("https://www.w3.org/ns/activitystreams#Person")`.
281
+ * If the given `object` is `null` or `undefined`, returns `null` or
282
+ * `undefined`, respectively.
283
+ * @since 1.3.0
284
+ */
285
+ declare function getTypeId(object: Object$1 | Link | null): URL | null;
286
+ /**
287
+ * Returns the type URI of the given object.
288
+ *
289
+ * @example
290
+ * ``` typescript
291
+ * import { getTypeId, Person } from "@fedify/fedify";
292
+ *
293
+ * const obj = new Person({});
294
+ * console.log(getTypeId(obj));
295
+ * // => new URL("https://www.w3.org/ns/activitystreams#Person")
296
+ * ```
297
+ *
298
+ * @param object The Activity Vocabulary object.
299
+ * @returns The type URI of the object, e.g.,
300
+ * `new URL("https://www.w3.org/ns/activitystreams#Person")`.
301
+ * If the given `object` is `null` or `undefined`, returns `null` or
302
+ * `undefined`, respectively.
303
+ * @since 1.3.0
304
+ */
305
+ declare function getTypeId(object: Object$1 | Link | null | undefined): URL | null | undefined;
306
+ //#endregion
307
+ export { FediverseHandle, LookupObjectOptions, PUBLIC_COLLECTION, TraverseCollectionOptions, getTypeId, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection };
@@ -1,7 +1,7 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { Activity } from "./vocab-BEEm2I6u.js";
4
- import { ActivityTransformer, Context } from "./context-DFruNLny.js";
3
+ import { Activity } from "./vocab-CDHNj5zp.js";
4
+ import { ActivityTransformer, Context } from "./context-CXUibY4L.js";
5
5
 
6
6
  //#region src/compat/transformers.d.ts
7
7
 
@@ -0,0 +1 @@
1
+ export { };
@@ -1,7 +1,7 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  import { DocumentLoader, GetUserAgentOptions } from "./docloader-CxWcuWqQ.js";
4
- import { Collection, Link, Object as Object$1 } from "./vocab-BEEm2I6u.js";
4
+ import { Collection, Link, Object as Object$1 } from "./vocab-CDHNj5zp.js";
5
5
  import { TracerProvider } from "@opentelemetry/api";
6
6
 
7
7
  //#region src/vocab/lookup.d.ts
@@ -20,6 +20,24 @@ interface LookupObjectOptions {
20
20
  * @since 0.8.0
21
21
  */
22
22
  contextLoader?: DocumentLoader;
23
+ /**
24
+ * Whether to allow fetching an object with an `@id` having a different
25
+ * origin than the object's URL. This is not recommended, as it may
26
+ * lead to security issues. Only use this option if you know what you
27
+ * are doing.
28
+ *
29
+ * How to handle the case when an object's `@id` has a different origin
30
+ * than the object's URL:
31
+ *
32
+ * - `"ignore"` (default): Do not return the object, and log a warning.
33
+ * - `"throw"`: Throw an error.
34
+ * - `"trust"`: Bypass the check and return the object anyway. This
35
+ * is not recommended, as it may lead to security issues. Only use
36
+ * this option if you know what you are doing.
37
+ *
38
+ * @since 1.9.0
39
+ */
40
+ crossOrigin?: "ignore" | "throw" | "trust";
23
41
  /**
24
42
  * The options for making `User-Agent` header.
25
43
  * If a string is given, it is used as the `User-Agent` header value.
@@ -1,7 +1,7 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  import { DocumentLoader, DocumentLoaderFactoryOptions } from "./docloader-CxWcuWqQ.js";
4
- import { HttpMessageSignaturesSpecDeterminer } from "./http-D8Q4xH0d.js";
4
+ import { HttpMessageSignaturesSpecDeterminer } from "./http-wsGR6KkT.js";
5
5
  import { TracerProvider } from "@opentelemetry/api";
6
6
 
7
7
  //#region src/runtime/authdocloader.d.ts
@@ -1,8 +1,8 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  import { DocumentLoader } from "./docloader-CxWcuWqQ.js";
4
- import { CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1 } from "./vocab-BEEm2I6u.js";
5
- import { KeyCache } from "./http-D8Q4xH0d.js";
4
+ import { CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1 } from "./vocab-CDHNj5zp.js";
5
+ import { KeyCache } from "./http-wsGR6KkT.js";
6
6
  import { TracerProvider } from "@opentelemetry/api";
7
7
 
8
8
  //#region src/sig/ld.d.ts
@@ -0,0 +1,102 @@
1
+ import { DocumentLoader, DocumentLoaderFactoryOptions } from "./docloader-D-MrRyHl.cjs";
2
+ import { HttpMessageSignaturesSpecDeterminer } from "./http-B1_DzfAU.cjs";
3
+ import { TracerProvider } from "@opentelemetry/api";
4
+
5
+ //#region src/runtime/authdocloader.d.ts
6
+ /**
7
+ * Options for {@link getAuthenticatedDocumentLoader}.
8
+ * @see {@link getAuthenticatedDocumentLoader}
9
+ * @since 1.3.0
10
+ */
11
+ interface GetAuthenticatedDocumentLoaderOptions extends DocumentLoaderFactoryOptions {
12
+ /**
13
+ * An optional spec determiner for HTTP Message Signatures.
14
+ * It determines the spec to use for signing requests.
15
+ * It is used for double-knocking
16
+ * (see <https://swicg.github.io/activitypub-http-signature/#how-to-upgrade-supported-versions>).
17
+ * @since 1.6.0
18
+ */
19
+ specDeterminer?: HttpMessageSignaturesSpecDeterminer;
20
+ /**
21
+ * The OpenTelemetry tracer provider. If omitted, the global tracer provider
22
+ * is used.
23
+ * @since 1.6.0
24
+ */
25
+ tracerProvider?: TracerProvider;
26
+ }
27
+ /**
28
+ * Gets an authenticated {@link DocumentLoader} for the given identity.
29
+ * Note that an authenticated document loader intentionally does not cache
30
+ * the fetched documents.
31
+ * @param identity The identity to get the document loader for.
32
+ * The actor's key pair.
33
+ * @param options The options for the document loader.
34
+ * @returns The authenticated document loader.
35
+ * @throws {TypeError} If the key is invalid or unsupported.
36
+ * @since 0.4.0
37
+ */
38
+ declare function getAuthenticatedDocumentLoader(identity: {
39
+ keyId: URL;
40
+ privateKey: CryptoKey;
41
+ }, {
42
+ allowPrivateAddress,
43
+ userAgent,
44
+ specDeterminer,
45
+ tracerProvider
46
+ }?: GetAuthenticatedDocumentLoaderOptions): DocumentLoader;
47
+ //#endregion
48
+ //#region src/runtime/key.d.ts
49
+ /**
50
+ * Imports a PEM-SPKI formatted public key.
51
+ * @param pem The PEM-SPKI formatted public key.
52
+ * @returns The imported public key.
53
+ * @throws {TypeError} If the key is invalid or unsupported.
54
+ * @since 0.5.0
55
+ */
56
+ declare function importSpki(pem: string): Promise<CryptoKey>;
57
+ /**
58
+ * Exports a public key in PEM-SPKI format.
59
+ * @param key The public key to export.
60
+ * @returns The exported public key in PEM-SPKI format.
61
+ * @throws {TypeError} If the key is invalid or unsupported.
62
+ * @since 0.5.0
63
+ */
64
+ declare function exportSpki(key: CryptoKey): Promise<string>;
65
+ /**
66
+ * Imports a PEM-PKCS#1 formatted public key.
67
+ * @param pem The PEM-PKCS#1 formatted public key.
68
+ * @returns The imported public key.
69
+ * @throws {TypeError} If the key is invalid or unsupported.
70
+ * @since 1.5.0
71
+ */
72
+ declare function importPkcs1(pem: string): Promise<CryptoKey>;
73
+ /**
74
+ * Imports a PEM formatted public key (SPKI or PKCS#1).
75
+ * @param pem The PEM formatted public key to import (SPKI or PKCS#1).
76
+ * @returns The imported public key.
77
+ * @throws {TypeError} If the key is invalid or unsupported.
78
+ * @since 1.5.0
79
+ */
80
+ declare function importPem(pem: string): Promise<CryptoKey>;
81
+ /**
82
+ * Imports a [Multibase]-encoded public key.
83
+ *
84
+ * [Multibase]: https://www.w3.org/TR/vc-data-integrity/#multibase-0
85
+ * @param key The Multibase-encoded public key.
86
+ * @returns The imported public key.
87
+ * @throws {TypeError} If the key is invalid or unsupported.
88
+ * @since 0.10.0
89
+ */
90
+ declare function importMultibaseKey(key: string): Promise<CryptoKey>;
91
+ /**
92
+ * Exports a public key in [Multibase] format.
93
+ *
94
+ * [Multibase]: https://www.w3.org/TR/vc-data-integrity/#multibase-0
95
+ * @param key The public key to export.
96
+ * @returns The exported public key in Multibase format.
97
+ * @throws {TypeError} If the key is invalid or unsupported.
98
+ * @since 0.10.0
99
+ */
100
+ declare function exportMultibaseKey(key: CryptoKey): Promise<string>;
101
+ //#endregion
102
+ export { GetAuthenticatedDocumentLoaderOptions, exportMultibaseKey, exportSpki, getAuthenticatedDocumentLoader, importMultibaseKey, importPem, importPkcs1, importSpki };
@@ -0,0 +1 @@
1
+ export { };