@fedify/fedify 2.0.0-dev.1641 → 2.0.0-dev.1726

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 (147) hide show
  1. package/dist/{actor-CP03csrm.cjs → actor-Bn2RCpws.cjs} +7263 -2440
  2. package/dist/{actor-DMgu-ZjT.d.cts → actor-D6K058Tb.d.cts} +1 -1
  3. package/dist/{actor-C22bXuuC.d.ts → actor-T6RyhRgk.d.ts} +1 -1
  4. package/dist/{actor-DVpsNXhn.js → actor-dO7jHa6A.js} +1 -1
  5. package/dist/{actor-DU511yTk.js → actor-menZmmiI.js} +7263 -2440
  6. package/dist/{assert_rejects-7UF4R_Qs.js → assert_rejects-DiIiJbZn.js} +1 -1
  7. package/dist/{assert_throws-53_pKeP3.js → assert_throws-BOO88avQ.js} +1 -1
  8. package/dist/{authdocloader-BnsFSERg.cjs → authdocloader-CEqdZdT7.cjs} +3 -3
  9. package/dist/{authdocloader-DCgMyo82.js → authdocloader-CZsCIRLV.js} +3 -3
  10. package/dist/{authdocloader-BkIZCKQv.js → authdocloader-DevmXsTo.js} +3 -3
  11. package/dist/{builder-E2Icrl_a.js → builder-CGF1vv7G.js} +14 -8
  12. package/dist/{client-BW4V0OJx.js → client-BfzV3u96.js} +1 -1
  13. package/dist/compat/mod.d.cts +7 -7
  14. package/dist/compat/mod.d.ts +7 -7
  15. package/dist/compat/transformers.test.js +18 -17
  16. package/dist/{context-CDSZdQHD.d.ts → context-B1X8-X33.d.ts} +185 -98
  17. package/dist/{context-Dq8aCtMH.d.cts → context-DYCJXr7J.d.cts} +185 -98
  18. package/dist/{docloader-kae6M-GI.cjs → docloader-Buh0Ah9G.cjs} +2 -2
  19. package/dist/{docloader-BtqIh1OE.js → docloader-DOmINJ1U.js} +2 -2
  20. package/dist/{esm-mtx3XJAD.js → esm-BODOj_Oi.js} +1 -1
  21. package/dist/federation/builder.test.js +10 -10
  22. package/dist/federation/collection.test.js +8 -8
  23. package/dist/federation/handler.test.js +26 -145
  24. package/dist/federation/idempotency.test.d.ts +3 -0
  25. package/dist/federation/idempotency.test.js +202 -0
  26. package/dist/federation/inbox.test.js +6 -6
  27. package/dist/federation/keycache.test.js +4 -4
  28. package/dist/federation/kv.test.js +8 -8
  29. package/dist/federation/middleware.test.js +238 -44
  30. package/dist/federation/mod.cjs +10 -10
  31. package/dist/federation/mod.d.cts +7 -7
  32. package/dist/federation/mod.d.ts +7 -7
  33. package/dist/federation/mod.js +10 -10
  34. package/dist/federation/mq.test.js +10 -10
  35. package/dist/federation/negotiation.test.d.ts +3 -0
  36. package/dist/federation/negotiation.test.js +28 -0
  37. package/dist/federation/retry.test.js +5 -5
  38. package/dist/federation/router.test.js +8 -8
  39. package/dist/federation/send.test.js +15 -15
  40. package/dist/fixtures/media.example.com/avatars/test-avatar.jpg.json +6 -0
  41. package/dist/{http-ZhcoaYEa.cjs → http-BmbMWfmh.cjs} +3 -3
  42. package/dist/{http-BS6766zs.d.cts → http-D-e6AFwR.d.cts} +1 -1
  43. package/dist/{http-DqSNLFNY.d.ts → http-D6Uj2x2y.d.ts} +1 -1
  44. package/dist/{http-Cox5GsED.js → http-Danw_xTY.js} +2 -2
  45. package/dist/{http-C7uYFcBo.js → http-gHyCrTrX.js} +3 -3
  46. package/dist/{inbox-BDdRbWNI.js → inbox-Blp5F74G.js} +24 -7
  47. package/dist/{key-CgwCzDC4.js → key-B2cp5-JF.js} +3 -3
  48. package/dist/{key-HqzOCwDc.cjs → key-BR1W25rw.cjs} +2 -2
  49. package/dist/{key-Cc0JlcKe.js → key-BnjofJ4e.js} +2 -2
  50. package/dist/{key-CfiBDu3o.js → key-CIIkeide.js} +2 -2
  51. package/dist/key-DhflzsBJ.cjs +10 -0
  52. package/dist/{key-B9Z5ZuX9.js → key-WES6wszI.js} +4 -4
  53. package/dist/{keycache-CVBjz3xi.js → keycache-Covv8lvK.js} +1 -1
  54. package/dist/{keys-CBKbYaJA.js → keys-DZ1bqhJz.js} +1 -1
  55. package/dist/{ld-CxgmnSO3.js → ld-C7KL1MK2.js} +2 -2
  56. package/dist/{lookup-QHjmy4Og.cjs → lookup-CDOxr8vw.cjs} +1 -1
  57. package/dist/{lookup-NuT9cCSl.js → lookup-D8tCnUj2.js} +1 -1
  58. package/dist/{lookup-CiU3QxQz.js → lookup-VSVPBU3J.js} +21 -12
  59. package/dist/middleware-9KSLASn7.js +17 -0
  60. package/dist/{middleware-LyCG_YVM.cjs → middleware-C60xXvWx.cjs} +99 -108
  61. package/dist/middleware-CH0PNtaj.cjs +17 -0
  62. package/dist/middleware-CrzCnpdt.js +26 -0
  63. package/dist/{middleware-DXidHY4N.js → middleware-DXOZ6_ST.js} +99 -108
  64. package/dist/{middleware-ByPnvMMS.js → middleware-HKKY6sAX.js} +69 -165
  65. package/dist/{mod-Drmz72EK.d.ts → mod-BhUKmBJD.d.ts} +2 -2
  66. package/dist/{mod-TFoH2Ql8.d.ts → mod-CerN_Sza.d.ts} +1 -1
  67. package/dist/{mod-Dc_-mf8s.d.cts → mod-Cj1tHXBR.d.cts} +1 -1
  68. package/dist/{mod-evzlRVZq.d.cts → mod-CxkWO3Mg.d.cts} +19 -1
  69. package/dist/{mod-RI3-KvUI.d.ts → mod-DcKxhFQ8.d.ts} +2 -2
  70. package/dist/{mod-BClfg3ej.d.cts → mod-Djzcw2ry.d.cts} +2 -2
  71. package/dist/{mod-Cxt4Kpf6.d.ts → mod-DlU8ISoa.d.ts} +19 -1
  72. package/dist/{mod-BhMnAkFX.d.cts → mod-twdvV2hR.d.cts} +2 -2
  73. package/dist/mod.cjs +10 -10
  74. package/dist/mod.d.cts +10 -10
  75. package/dist/mod.d.ts +10 -10
  76. package/dist/mod.js +10 -10
  77. package/dist/negotiation-5NPJL6zp.js +71 -0
  78. package/dist/nodeinfo/client.test.js +10 -10
  79. package/dist/nodeinfo/handler.test.js +23 -22
  80. package/dist/nodeinfo/mod.cjs +2 -2
  81. package/dist/nodeinfo/mod.js +2 -2
  82. package/dist/nodeinfo/types.test.js +8 -8
  83. package/dist/{owner-B-7Ptt_m.d.cts → owner-BN_tO3cY.d.cts} +2 -2
  84. package/dist/{owner-Cxob5_PK.js → owner-COcyel6J.js} +2 -2
  85. package/dist/{owner-CQPnQVtf.d.ts → owner-hd9lvQcP.d.ts} +2 -2
  86. package/dist/{proof-2Gcor0_N.cjs → proof-CMJcrQoM.cjs} +3 -3
  87. package/dist/{proof-BiSQNUmQ.js → proof-Cpk853lc.js} +2 -2
  88. package/dist/{proof-DkxwMaWE.js → proof-D6pbnNx2.js} +3 -3
  89. package/dist/runtime/authdocloader.test.js +14 -14
  90. package/dist/runtime/docloader.test.js +9 -9
  91. package/dist/runtime/key.test.js +10 -10
  92. package/dist/runtime/langstr.test.js +8 -8
  93. package/dist/runtime/link.test.js +3 -3
  94. package/dist/runtime/mod.cjs +6 -6
  95. package/dist/runtime/mod.d.cts +3 -3
  96. package/dist/runtime/mod.d.ts +3 -3
  97. package/dist/runtime/mod.js +6 -6
  98. package/dist/runtime/multibase/multibase.test.js +8 -8
  99. package/dist/runtime/url.test.js +5 -5
  100. package/dist/{send-DSEhWIYD.js → send-C7A7_big.js} +2 -2
  101. package/dist/sig/http.test.js +13 -13
  102. package/dist/sig/key.test.js +11 -11
  103. package/dist/sig/ld.test.js +10 -10
  104. package/dist/sig/mod.cjs +6 -6
  105. package/dist/sig/mod.d.cts +5 -5
  106. package/dist/sig/mod.d.ts +5 -5
  107. package/dist/sig/mod.js +6 -6
  108. package/dist/sig/owner.test.js +12 -12
  109. package/dist/sig/proof.test.js +12 -12
  110. package/dist/testing/docloader.test.js +8 -8
  111. package/dist/testing/mod.d.ts +391 -86
  112. package/dist/testing/mod.js +3 -3
  113. package/dist/{testing-ByQmUvf-.js → testing-e8Kpb1uV.js} +2 -2
  114. package/dist/{type-B4NJkfVg.js → type-D_8QzkEn.js} +6944 -2121
  115. package/dist/{types-l2uh_ZhP.js → types-Db4ukgX8.js} +1 -1
  116. package/dist/{types-Bqt2EgP0.cjs → types-LjTL4QMx.cjs} +1 -1
  117. package/dist/vocab/actor.test.js +10 -10
  118. package/dist/vocab/lookup.test.js +259 -9
  119. package/dist/vocab/mod.cjs +4 -4
  120. package/dist/vocab/mod.d.cts +3 -3
  121. package/dist/vocab/mod.d.ts +3 -3
  122. package/dist/vocab/mod.js +4 -4
  123. package/dist/vocab/type.test.js +3 -3
  124. package/dist/vocab/vocab.test.js +402 -13
  125. package/dist/{vocab-SOE1ifCr.d.ts → vocab-BI0Ak5lL.d.ts} +290 -0
  126. package/dist/{vocab-lBFcVxVF.js → vocab-CJHF7Q71.js} +23 -14
  127. package/dist/{vocab-B0-5a8pw.cjs → vocab-DLHpZwOW.cjs} +23 -14
  128. package/dist/{vocab-DJTYMqyU.d.cts → vocab-Dw1-yVGg.d.cts} +290 -0
  129. package/dist/webfinger/handler.test.js +23 -22
  130. package/dist/webfinger/lookup.test.js +9 -9
  131. package/dist/webfinger/mod.cjs +2 -2
  132. package/dist/webfinger/mod.js +2 -2
  133. package/dist/x/cfworkers.test.js +8 -8
  134. package/dist/x/hono.d.cts +6 -6
  135. package/dist/x/hono.d.ts +6 -6
  136. package/dist/x/sveltekit.d.cts +6 -6
  137. package/dist/x/sveltekit.d.ts +6 -6
  138. package/package.json +1 -1
  139. package/dist/key-D-7DPHNl.cjs +0 -10
  140. package/dist/middleware-BHboQ4BE.js +0 -25
  141. package/dist/middleware-Bp3I9z8r.js +0 -17
  142. package/dist/middleware-oYqSU5ky.cjs +0 -17
  143. /package/dist/{assert_is_error-B035L3om.js → assert_is_error-BPGph1Jx.js} +0 -0
  144. /package/dist/{assert_not_equals-C80BG-_5.js → assert_not_equals-f3m3epl3.js} +0 -0
  145. /package/dist/{denokv-jZ0Z2h0M.js → denokv-Bv33Xxea.js} +0 -0
  146. /package/dist/{retry-CfF8Gn4d.js → retry-D4GJ670a.js} +0 -0
  147. /package/dist/{std__assert-DWivtrGR.js → std__assert-X-_kMxKM.js} +0 -0
@@ -3,22 +3,23 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, deno_default, getDocumentLoader, getTypeId, kvCache, lookupWebFinger } from "./type-B4NJkfVg.js";
7
- import { getNodeInfo } from "./client-BW4V0OJx.js";
8
- import { RouterError, lookupObject, traverseCollection } from "./lookup-CiU3QxQz.js";
6
+ import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, deno_default, getDocumentLoader, getTypeId, kvCache, lookupWebFinger } from "./type-D_8QzkEn.js";
7
+ import { getNodeInfo } from "./client-BfzV3u96.js";
8
+ import { RouterError, lookupObject, traverseCollection } from "./lookup-VSVPBU3J.js";
9
9
  import { nodeInfoToJson } from "./types-BSuWJsOm.js";
10
- import { exportJwk, importJwk, validateCryptoKey } from "./key-CfiBDu3o.js";
11
- import { verifyRequest } from "./http-Cox5GsED.js";
12
- import { getAuthenticatedDocumentLoader } from "./authdocloader-BkIZCKQv.js";
13
- import { detachSignature, hasSignature, signJsonLd, verifyJsonLd } from "./ld-CxgmnSO3.js";
14
- import { doesActorOwnKey, getKeyOwner } from "./owner-Cxob5_PK.js";
15
- import { signObject, verifyObject } from "./proof-BiSQNUmQ.js";
16
- import { routeActivity } from "./inbox-BDdRbWNI.js";
17
- import { FederationBuilderImpl } from "./builder-E2Icrl_a.js";
10
+ import { exportJwk, importJwk, validateCryptoKey } from "./key-CIIkeide.js";
11
+ import { verifyRequest } from "./http-Danw_xTY.js";
12
+ import { getAuthenticatedDocumentLoader } from "./authdocloader-DevmXsTo.js";
13
+ import { detachSignature, hasSignature, signJsonLd, verifyJsonLd } from "./ld-C7KL1MK2.js";
14
+ import { doesActorOwnKey, getKeyOwner } from "./owner-COcyel6J.js";
15
+ import { signObject, verifyObject } from "./proof-Cpk853lc.js";
16
+ import { routeActivity } from "./inbox-Blp5F74G.js";
17
+ import { FederationBuilderImpl } from "./builder-CGF1vv7G.js";
18
18
  import { buildCollectionSynchronizationHeader } from "./collection-CcnIw1qY.js";
19
- import { KvKeyCache } from "./keycache-CVBjz3xi.js";
20
- import { createExponentialBackoffPolicy } from "./retry-CfF8Gn4d.js";
21
- import { extractInboxes, sendActivity } from "./send-DSEhWIYD.js";
19
+ import { KvKeyCache } from "./keycache-Covv8lvK.js";
20
+ import { acceptsJsonLd } from "./negotiation-5NPJL6zp.js";
21
+ import { createExponentialBackoffPolicy } from "./retry-D4GJ670a.js";
22
+ import { extractInboxes, sendActivity } from "./send-C7A7_big.js";
22
23
  import { getLogger, withContext } from "@logtape/logtape";
23
24
  import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
24
25
  import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_HEADER, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
@@ -297,73 +298,8 @@ async function handleWebFingerInternal(request, { context: context$1, host, acto
297
298
  } });
298
299
  }
299
300
 
300
- //#endregion
301
- //#region src/federation/negotiation.ts
302
- function compareSpecs(a, b) {
303
- return b.q - a.q || (b.s ?? 0) - (a.s ?? 0) || (a.o ?? 0) - (b.o ?? 0) || a.i - b.i || 0;
304
- }
305
- function isQuality(spec) {
306
- return spec.q > 0;
307
- }
308
- const simpleMediaTypeRegExp = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;
309
- function splitKeyValuePair(str) {
310
- const [key, value] = str.split("=");
311
- return [key.toLowerCase(), value];
312
- }
313
- function parseMediaType(str, i) {
314
- const match = simpleMediaTypeRegExp.exec(str);
315
- if (!match) return;
316
- const [, type, subtype, parameters] = match;
317
- if (!type || !subtype) return;
318
- const params = Object.create(null);
319
- let q = 1;
320
- if (parameters) {
321
- const kvps = parameters.split(";").map((p) => p.trim()).map(splitKeyValuePair);
322
- for (const [key, val] of kvps) {
323
- const value = val && val[0] === `"` && val[val.length - 1] === `"` ? val.slice(1, val.length - 1) : val;
324
- if (key === "q" && value) {
325
- q = parseFloat(value);
326
- break;
327
- }
328
- params[key] = value;
329
- }
330
- }
331
- return {
332
- type,
333
- subtype,
334
- params,
335
- i,
336
- o: void 0,
337
- q,
338
- s: void 0
339
- };
340
- }
341
- function parseAccept(accept) {
342
- const accepts = accept.split(",").map((p) => p.trim());
343
- const mediaTypes = [];
344
- for (const [index, accept$1] of accepts.entries()) {
345
- const mediaType = parseMediaType(accept$1.trim(), index);
346
- if (mediaType) mediaTypes.push(mediaType);
347
- }
348
- return mediaTypes;
349
- }
350
- function getFullType(spec) {
351
- return `${spec.type}/${spec.subtype}`;
352
- }
353
- function preferredMediaTypes(accept) {
354
- const accepts = parseAccept(accept === void 0 ? "*/*" : accept ?? "");
355
- return accepts.filter(isQuality).sort(compareSpecs).map(getFullType);
356
- }
357
-
358
301
  //#endregion
359
302
  //#region src/federation/handler.ts
360
- function acceptsJsonLd(request) {
361
- const accept = request.headers.get("Accept");
362
- const types = accept ? preferredMediaTypes(accept) : ["*/*"];
363
- if (types == null) return true;
364
- if (types[0] === "text/html" || types[0] === "application/xhtml+xml") return false;
365
- return types.includes("application/activity+json") || types.includes("application/ld+json") || types.includes("application/json");
366
- }
367
303
  /**
368
304
  * Handles an actor request.
369
305
  * @template TContextData The context data to pass to the context.
@@ -371,7 +307,7 @@ function acceptsJsonLd(request) {
371
307
  * @param parameters The parameters for handling the actor.
372
308
  * @returns A promise that resolves to an HTTP response.
373
309
  */
374
- async function handleActor(request, { identifier, context: context$1, actorDispatcher, authorizePredicate, onNotFound, onNotAcceptable, onUnauthorized }) {
310
+ async function handleActor(request, { identifier, context: context$1, actorDispatcher, authorizePredicate, onNotFound, onUnauthorized }) {
375
311
  const logger$2 = getLogger([
376
312
  "fedify",
377
313
  "federation",
@@ -386,7 +322,6 @@ async function handleActor(request, { identifier, context: context$1, actorDispa
386
322
  logger$2.debug("Actor {identifier} not found.", { identifier });
387
323
  return await onNotFound(request);
388
324
  }
389
- if (!acceptsJsonLd(request)) return await onNotAcceptable(request);
390
325
  if (authorizePredicate != null) {
391
326
  let key = await context$1.getSignedKey();
392
327
  key = key?.clone({}, { $warning: {
@@ -421,11 +356,10 @@ async function handleActor(request, { identifier, context: context$1, actorDispa
421
356
  * @param parameters The parameters for handling the object.
422
357
  * @returns A promise that resolves to an HTTP response.
423
358
  */
424
- async function handleObject(request, { values, context: context$1, objectDispatcher, authorizePredicate, onNotFound, onNotAcceptable, onUnauthorized }) {
359
+ async function handleObject(request, { values, context: context$1, objectDispatcher, authorizePredicate, onNotFound, onUnauthorized }) {
425
360
  if (objectDispatcher == null) return await onNotFound(request);
426
361
  const object = await objectDispatcher(context$1, values);
427
362
  if (object == null) return await onNotFound(request);
428
- if (!acceptsJsonLd(request)) return await onNotAcceptable(request);
429
363
  if (authorizePredicate != null) {
430
364
  let key = await context$1.getSignedKey();
431
365
  key = key?.clone({}, { $warning: {
@@ -463,7 +397,7 @@ async function handleObject(request, { values, context: context$1, objectDispatc
463
397
  * @param parameters The parameters for handling the collection.
464
398
  * @returns A promise that resolves to an HTTP response.
465
399
  */
466
- async function handleCollection(request, { name, identifier, uriGetter, filter, filterPredicate, context: context$1, collectionCallbacks, tracerProvider, onUnauthorized, onNotFound, onNotAcceptable }) {
400
+ async function handleCollection(request, { name, identifier, uriGetter, filter, filterPredicate, context: context$1, collectionCallbacks, tracerProvider, onUnauthorized, onNotFound }) {
467
401
  const spanName = name.trim().replace(/\s+/g, "_");
468
402
  tracerProvider = tracerProvider ?? trace.getTracerProvider();
469
403
  const tracer = tracerProvider.getTracer(deno_default.name, deno_default.version);
@@ -576,7 +510,6 @@ async function handleCollection(request, { name, identifier, uriGetter, filter,
576
510
  partOf
577
511
  });
578
512
  }
579
- if (!acceptsJsonLd(request)) return await onNotAcceptable(request);
580
513
  if (collectionCallbacks.authorizePredicate != null) {
581
514
  let key = await context$1.getSignedKey();
582
515
  key = key?.clone({}, { $warning: {
@@ -671,7 +604,8 @@ async function handleInbox(request, options) {
671
604
  * @param span The OpenTelemetry span for tracing.
672
605
  * @returns A promise that resolves to an HTTP response.
673
606
  */
674
- async function handleInboxInternal(request, { recipient, context: ctx, inboxContextFactory, kv, kvPrefixes, queue, actorDispatcher, inboxListeners, inboxErrorHandler, onNotFound, signatureTimeWindow, skipSignatureVerification, tracerProvider }, span) {
607
+ async function handleInboxInternal(request, parameters, span) {
608
+ const { recipient, context: ctx, inboxContextFactory, kv, kvPrefixes, queue, actorDispatcher, inboxListeners, inboxErrorHandler, onNotFound, signatureTimeWindow, skipSignatureVerification, tracerProvider } = parameters;
675
609
  const logger$2 = getLogger([
676
610
  "fedify",
677
611
  "federation",
@@ -873,7 +807,8 @@ async function handleInboxInternal(request, { recipient, context: ctx, inboxCont
873
807
  kvPrefixes,
874
808
  queue,
875
809
  span,
876
- tracerProvider
810
+ tracerProvider,
811
+ idempotencyStrategy: parameters.idempotencyStrategy
877
812
  });
878
813
  if (routeResult === "alreadyProcessed") return new Response(`Activity <${activity.id}> has already been processed.`, {
879
814
  status: 202,
@@ -903,7 +838,7 @@ async function handleInboxInternal(request, { recipient, context: ctx, inboxCont
903
838
  /**
904
839
  * Handles a custom collection request.
905
840
  * @template TItem The type of items in the collection.
906
- * @template TParams The parameter names of the requested URL.
841
+ * @template TParam The parameter names of the requested URL.
907
842
  * @template TContext The type of the context, extending {@link RequestContext}.
908
843
  * @template TContextData The context data to pass to the `TContext`.
909
844
  * @param request The HTTP request.
@@ -914,7 +849,6 @@ async function handleInboxInternal(request, { recipient, context: ctx, inboxCont
914
849
  const handleCustomCollection = exceptWrapper(_handleCustomCollection);
915
850
  async function _handleCustomCollection(request, { name, values, context: context$1, tracerProvider, collectionCallbacks: callbacks, filterPredicate }) {
916
851
  verifyDefined(callbacks);
917
- verifyJsonLdRequest(request);
918
852
  await authIfNeeded(context$1, values, callbacks);
919
853
  const cursor = new URL(request.url).searchParams.get("cursor");
920
854
  return await new CustomCollectionHandler(name, values, context$1, callbacks, tracerProvider, Collection, CollectionPage, filterPredicate).fetchCollection(cursor).toJsonLd().then(respondAsActivity);
@@ -922,7 +856,7 @@ async function _handleCustomCollection(request, { name, values, context: context
922
856
  /**
923
857
  * Handles an ordered collection request.
924
858
  * @template TItem The type of items in the collection.
925
- * @template TParams The parameter names of the requested URL.
859
+ * @template TParam The parameter names of the requested URL.
926
860
  * @template TContext The type of the context, extending {@link RequestContext}.
927
861
  * @template TContextData The context data to pass to the `TContext`.
928
862
  * @param request The HTTP request.
@@ -933,7 +867,6 @@ async function _handleCustomCollection(request, { name, values, context: context
933
867
  const handleOrderedCollection = exceptWrapper(_handleOrderedCollection);
934
868
  async function _handleOrderedCollection(request, { name, values, context: context$1, tracerProvider, collectionCallbacks: callbacks, filterPredicate }) {
935
869
  verifyDefined(callbacks);
936
- verifyJsonLdRequest(request);
937
870
  await authIfNeeded(context$1, values, callbacks);
938
871
  const cursor = new URL(request.url).searchParams.get("cursor");
939
872
  return await new CustomCollectionHandler(name, values, context$1, callbacks, tracerProvider, OrderedCollection, OrderedCollectionPage, filterPredicate).fetchCollection(cursor).toJsonLd().then(respondAsActivity);
@@ -943,7 +876,7 @@ async function _handleOrderedCollection(request, { name, values, context: contex
943
876
  * The main flow is on `getCollection`, `dispatch`.
944
877
  *
945
878
  * @template TItem The type of items in the collection.
946
- * @template TParams The parameter names of the requested URL.
879
+ * @template TParam The parameter names of the requested URL.
947
880
  * @template TContext The type of the context. {@link Context} or {@link RequestContext}.
948
881
  * @template TContextData The context data to pass to the `TContext`.
949
882
  * @template TCollection The type of the collection, extending {@link Collection}.
@@ -977,14 +910,14 @@ var CustomCollectionHandler = class {
977
910
  #collection = null;
978
911
  /**
979
912
  * Creates a new CustomCollection instance.
980
- * @param {string} name The name of the collection.
981
- * @param {TParams} values The parameter values for the collection.
982
- * @param {TContext} context The request context.
983
- * @param {CustomCollectionCallbacks} callbacks The collection callbacks.
984
- * @param {TracerProvider} tracerProvider The tracer provider for telemetry.
985
- * @param {ConstructorWithTypeId<TCollection>} Collection The Collection constructor.
986
- * @param {ConstructorWithTypeId<TCollectionPage>} CollectionPage The CollectionPage constructor.
987
- * @param {(item: TItem) => boolean} filterPredicate Optional filter predicate for items.
913
+ * @param name The name of the collection.
914
+ * @param values The parameter values for the collection.
915
+ * @param context The request context.
916
+ * @param callbacks The collection callbacks.
917
+ * @param tracerProvider The tracer provider for telemetry.
918
+ * @param Collection The Collection constructor.
919
+ * @param CollectionPage The CollectionPage constructor.
920
+ * @param filterPredicate Optional filter predicate for items.
988
921
  */
989
922
  constructor(name, values, context$1, callbacks, tracerProvider = trace.getTracerProvider(), Collection$1, CollectionPage$1, filterPredicate) {
990
923
  this.name = name;
@@ -1109,7 +1042,7 @@ var CustomCollectionHandler = class {
1109
1042
  /**
1110
1043
  * Creates a function to wrap the dispatcher so tracing can be applied.
1111
1044
  * @param params Parameters including cursor and total items.
1112
- * @returns {(span: Span) => Promise<PageItems<TItem>>} A function that handles the span operation.
1045
+ * @returns A function that handles the span operation.
1113
1046
  */
1114
1047
  spanPages = ({ totalItems = null, cursor = null }) => async (span) => {
1115
1048
  try {
@@ -1130,23 +1063,23 @@ var CustomCollectionHandler = class {
1130
1063
  };
1131
1064
  /**
1132
1065
  * Dispatches the collection request to get items.
1133
- * @param {string | null} cursor The cursor for pagination, or null for the first page.
1134
- * @returns {Promise<PageItems<TItem>>} A promise that resolves to the page items.
1066
+ * @param cursor The cursor for pagination, or null for the first page.
1067
+ * @returns A promise that resolves to the page items.
1135
1068
  */
1136
1069
  async dispatch(cursor = null) {
1137
1070
  return await this.#dispatcher(this.context, this.values, cursor) ?? new ItemsNotFoundError().throw();
1138
1071
  }
1139
1072
  /**
1140
1073
  * Filters the items in the collection.
1141
- * @param {TItem[]} items The items to filter.
1142
- * @returns {(Object | Link | URL)[]} The filtered items.
1074
+ * @param items The items to filter.
1075
+ * @returns The filtered items.
1143
1076
  */
1144
1077
  filterItems(items) {
1145
1078
  return filterCollectionItems(items, this.name, this.filterPredicate);
1146
1079
  }
1147
1080
  /**
1148
1081
  * Appends a cursor to the URL if it exists.
1149
- * @param {string | null | undefined} cursor The cursor to append, or null/undefined.
1082
+ * @param cursor The cursor to append, or null/undefined.
1150
1083
  * @returns The URL with cursor appended, or null if cursor is null/undefined.
1151
1084
  */
1152
1085
  appendToUrl(cursor) {
@@ -1154,8 +1087,7 @@ var CustomCollectionHandler = class {
1154
1087
  }
1155
1088
  /**
1156
1089
  * Gets the stored collection or collection page.
1157
- * @returns {Promise<TCollection | TCollectionPage>} A promise that resolves to
1158
- the collection or collection page.
1090
+ * @returns A promise that resolves to the collection or collection page.
1159
1091
  */
1160
1092
  get collection() {
1161
1093
  if (this.#collection === null) this.#collection = this.getCollection();
@@ -1163,8 +1095,8 @@ var CustomCollectionHandler = class {
1163
1095
  }
1164
1096
  /**
1165
1097
  * Gets the total number of items in the collection.
1166
- * @returns {Promise<number | null>} A promise that
1167
- resolves to the total items count, or null if not available.
1098
+ * @returns A promise that resolves to the total items count,
1099
+ * or null if not available.
1168
1100
  */
1169
1101
  get totalItems() {
1170
1102
  if (this.#totalItems === void 0) this.totalItems = this.callbacks.counter?.(this.context, this.values);
@@ -1180,8 +1112,8 @@ var CustomCollectionHandler = class {
1180
1112
  }
1181
1113
  /**
1182
1114
  * Gets the first cursor for pagination.
1183
- * @returns {Promise<string | null>} A promise that resolves to the first cursor,
1184
- or null if not available.
1115
+ * @returns A promise that resolves to the first cursor,
1116
+ * or null if not available.
1185
1117
  */
1186
1118
  get firstCursor() {
1187
1119
  const cursor = this.callbacks.firstCursor?.(this.context, this.values);
@@ -1211,10 +1143,9 @@ function exceptWrapper(handler) {
1211
1143
  try {
1212
1144
  return await handler(request, handlerParams);
1213
1145
  } catch (error) {
1214
- const { onNotFound, onNotAcceptable, onUnauthorized } = handlerParams;
1146
+ const { onNotFound, onUnauthorized } = handlerParams;
1215
1147
  switch (error?.constructor) {
1216
1148
  case ItemsNotFoundError: return await onNotFound(request);
1217
- case NotAcceptableError: return await onNotAcceptable(request);
1218
1149
  case UnauthorizedError: return await onUnauthorized(request);
1219
1150
  default: throw error;
1220
1151
  }
@@ -1232,15 +1163,6 @@ const verifyDefined = (callbacks) => {
1232
1163
  if (callbacks === void 0) throw new ItemsNotFoundError();
1233
1164
  };
1234
1165
  /**
1235
- * Verifies that a request accepts JSON-LD content type.
1236
- * @param request The HTTP request to verify.
1237
- * @throws {NotAcceptableError} If the request doesn't accept JSON-LD.
1238
- * @since 1.8.0
1239
- */
1240
- const verifyJsonLdRequest = (request) => {
1241
- if (!acceptsJsonLd(request)) throw new NotAcceptableError();
1242
- };
1243
- /**
1244
1166
  * Performs authorization if needed based on the authorization predicate.
1245
1167
  * @template TContextData The context data type.
1246
1168
  * @param {RequestContext<TContextData>} context The request context.
@@ -1324,15 +1246,6 @@ var ItemsNotFoundError = class extends HandlerError {
1324
1246
  }
1325
1247
  };
1326
1248
  /**
1327
- * Error thrown when the request is not acceptable (e.g., wrong content type).
1328
- * @since 1.8.0
1329
- */
1330
- var NotAcceptableError = class extends HandlerError {
1331
- constructor() {
1332
- super("The request is not acceptable.");
1333
- }
1334
- };
1335
- /**
1336
1249
  * Error thrown when access to a collection is unauthorized.
1337
1250
  * @since 1.8.0
1338
1251
  */
@@ -1405,7 +1318,6 @@ var FederationImpl = class extends FederationBuilderImpl {
1405
1318
  firstKnock;
1406
1319
  constructor(options) {
1407
1320
  super();
1408
- const logger$2 = getLogger(["fedify", "federation"]);
1409
1321
  this.kv = options.kv;
1410
1322
  this.kvPrefixes = {
1411
1323
  activityIdempotence: ["_fedify", "activityIdempotence"],
@@ -1453,8 +1365,9 @@ var FederationImpl = class extends FederationBuilderImpl {
1453
1365
  this.router.trailingSlashInsensitive = options.trailingSlashInsensitive ?? false;
1454
1366
  this._initializeRouter();
1455
1367
  if (options.allowPrivateAddress || options.userAgent != null) {
1456
- if (options.contextLoader != null) throw new TypeError("Cannot set contextLoader with allowPrivateAddress or userAgent options.");
1457
- else if (options.authenticatedDocumentLoaderFactory != null) throw new TypeError("Cannot set authenticatedDocumentLoaderFactory with allowPrivateAddress or userAgent options.");
1368
+ if (options.documentLoaderFactory != null) throw new TypeError("Cannot set documentLoaderFactory with allowPrivateAddress or userAgent options.");
1369
+ if (options.contextLoaderFactory != null) throw new TypeError("Cannot set contextLoaderFactory with allowPrivateAddress or userAgent options.");
1370
+ if (options.authenticatedDocumentLoaderFactory != null) throw new TypeError("Cannot set authenticatedDocumentLoaderFactory with allowPrivateAddress or userAgent options.");
1458
1371
  }
1459
1372
  const { allowPrivateAddress, userAgent } = options;
1460
1373
  this.allowPrivateAddress = allowPrivateAddress ?? false;
@@ -1468,11 +1381,7 @@ var FederationImpl = class extends FederationBuilderImpl {
1468
1381
  prefix: this.kvPrefixes.remoteDocument
1469
1382
  });
1470
1383
  });
1471
- if (options.contextLoader != null) {
1472
- if (options.contextLoaderFactory != null) throw new TypeError("Cannot set both contextLoader and contextLoaderFactory options at a time; use contextLoaderFactory only.");
1473
- this.contextLoaderFactory = () => options.contextLoader;
1474
- logger$2.warn("The contextLoader option is deprecated; use contextLoaderFactory option instead.");
1475
- } else this.contextLoaderFactory = options.contextLoaderFactory ?? this.documentLoaderFactory;
1384
+ this.contextLoaderFactory = options.contextLoaderFactory ?? this.documentLoaderFactory;
1476
1385
  this.authenticatedDocumentLoaderFactory = options.authenticatedDocumentLoaderFactory ?? ((identity) => getAuthenticatedDocumentLoader(identity, {
1477
1386
  allowPrivateAddress,
1478
1387
  userAgent,
@@ -2011,6 +1920,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2011
1920
  span,
2012
1921
  tracer
2013
1922
  });
1923
+ if (acceptsJsonLd(request)) response.headers.set("Vary", "Accept");
2014
1924
  } catch (error) {
2015
1925
  span.setStatus({
2016
1926
  code: SpanStatusCode.ERROR,
@@ -2074,6 +1984,9 @@ var FederationImpl = class extends FederationBuilderImpl {
2074
1984
  context: context$1,
2075
1985
  nodeInfoDispatcher: this.nodeInfoDispatcher
2076
1986
  });
1987
+ }
1988
+ if (request.method !== "POST" && !acceptsJsonLd(request)) return await onNotAcceptable(request);
1989
+ switch (routeName) {
2077
1990
  case "actor":
2078
1991
  context$1 = this.#createContext(request, contextData, { invokedFromActorDispatcher: { identifier: route.values.identifier ?? route.values.handle } });
2079
1992
  return await handleActor(request, {
@@ -2082,8 +1995,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2082
1995
  actorDispatcher: this.actorCallbacks?.dispatcher,
2083
1996
  authorizePredicate: this.actorCallbacks?.authorizePredicate,
2084
1997
  onUnauthorized,
2085
- onNotFound,
2086
- onNotAcceptable
1998
+ onNotFound
2087
1999
  });
2088
2000
  case "object": {
2089
2001
  const typeId = route.name.replace(/^object:/, "");
@@ -2099,8 +2011,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2099
2011
  objectDispatcher: callbacks?.dispatcher,
2100
2012
  authorizePredicate: callbacks?.authorizePredicate,
2101
2013
  onUnauthorized,
2102
- onNotFound,
2103
- onNotAcceptable
2014
+ onNotFound
2104
2015
  });
2105
2016
  }
2106
2017
  case "outbox": return await handleCollection(request, {
@@ -2111,8 +2022,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2111
2022
  collectionCallbacks: this.outboxCallbacks,
2112
2023
  tracerProvider: this.tracerProvider,
2113
2024
  onUnauthorized,
2114
- onNotFound,
2115
- onNotAcceptable
2025
+ onNotFound
2116
2026
  });
2117
2027
  case "inbox":
2118
2028
  if (request.method !== "POST") return await handleCollection(request, {
@@ -2123,8 +2033,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2123
2033
  collectionCallbacks: this.inboxCallbacks,
2124
2034
  tracerProvider: this.tracerProvider,
2125
2035
  onUnauthorized,
2126
- onNotFound,
2127
- onNotAcceptable
2036
+ onNotFound
2128
2037
  });
2129
2038
  context$1 = this.#createContext(request, contextData, { documentLoader: await context$1.getDocumentLoader({ identifier: route.values.identifier ?? route.values.handle }) });
2130
2039
  case "sharedInbox":
@@ -2146,7 +2055,8 @@ var FederationImpl = class extends FederationBuilderImpl {
2146
2055
  onNotFound,
2147
2056
  signatureTimeWindow: this.signatureTimeWindow,
2148
2057
  skipSignatureVerification: this.skipSignatureVerification,
2149
- tracerProvider: this.tracerProvider
2058
+ tracerProvider: this.tracerProvider,
2059
+ idempotencyStrategy: this.idempotencyStrategy
2150
2060
  });
2151
2061
  case "following": return await handleCollection(request, {
2152
2062
  name: "following",
@@ -2156,8 +2066,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2156
2066
  collectionCallbacks: this.followingCallbacks,
2157
2067
  tracerProvider: this.tracerProvider,
2158
2068
  onUnauthorized,
2159
- onNotFound,
2160
- onNotAcceptable
2069
+ onNotFound
2161
2070
  });
2162
2071
  case "followers": {
2163
2072
  let baseUrl = url.searchParams.get("base-url");
@@ -2180,8 +2089,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2180
2089
  collectionCallbacks: this.followersCallbacks,
2181
2090
  tracerProvider: this.tracerProvider,
2182
2091
  onUnauthorized,
2183
- onNotFound,
2184
- onNotAcceptable
2092
+ onNotFound
2185
2093
  });
2186
2094
  }
2187
2095
  case "liked": return await handleCollection(request, {
@@ -2192,8 +2100,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2192
2100
  collectionCallbacks: this.likedCallbacks,
2193
2101
  tracerProvider: this.tracerProvider,
2194
2102
  onUnauthorized,
2195
- onNotFound,
2196
- onNotAcceptable
2103
+ onNotFound
2197
2104
  });
2198
2105
  case "featured": return await handleCollection(request, {
2199
2106
  name: "featured",
@@ -2203,8 +2110,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2203
2110
  collectionCallbacks: this.featuredCallbacks,
2204
2111
  tracerProvider: this.tracerProvider,
2205
2112
  onUnauthorized,
2206
- onNotFound,
2207
- onNotAcceptable
2113
+ onNotFound
2208
2114
  });
2209
2115
  case "featuredTags": return await handleCollection(request, {
2210
2116
  name: "featured tags",
@@ -2214,8 +2120,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2214
2120
  collectionCallbacks: this.featuredTagsCallbacks,
2215
2121
  tracerProvider: this.tracerProvider,
2216
2122
  onUnauthorized,
2217
- onNotFound,
2218
- onNotAcceptable
2123
+ onNotFound
2219
2124
  });
2220
2125
  case "collection": {
2221
2126
  const name = route.name.replace(/^collection:/, "");
@@ -2227,8 +2132,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2227
2132
  collectionCallbacks: callbacks,
2228
2133
  tracerProvider: this.tracerProvider,
2229
2134
  onUnauthorized,
2230
- onNotFound,
2231
- onNotAcceptable
2135
+ onNotFound
2232
2136
  });
2233
2137
  }
2234
2138
  case "orderedCollection": {
@@ -2241,8 +2145,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2241
2145
  collectionCallbacks: callbacks,
2242
2146
  tracerProvider: this.tracerProvider,
2243
2147
  onUnauthorized,
2244
- onNotFound,
2245
- onNotAcceptable
2148
+ onNotFound
2246
2149
  });
2247
2150
  }
2248
2151
  default: {
@@ -2896,7 +2799,8 @@ var ContextImpl = class ContextImpl {
2896
2799
  kvPrefixes: this.federation.kvPrefixes,
2897
2800
  queue: this.federation.inboxQueue,
2898
2801
  span,
2899
- tracerProvider: options.tracerProvider ?? this.tracerProvider
2802
+ tracerProvider: options.tracerProvider ?? this.tracerProvider,
2803
+ idempotencyStrategy: this.federation.idempotencyStrategy
2900
2804
  });
2901
2805
  return routeResult === "alreadyProcessed" || routeResult === "enqueued" || routeResult === "unsupportedActivity" || routeResult === "success";
2902
2806
  }
@@ -3210,4 +3114,4 @@ function getRequestId(request) {
3210
3114
  }
3211
3115
 
3212
3116
  //#endregion
3213
- export { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, acceptsJsonLd, actorDehydrator, autoIdAssigner, createFederation, handleActor, handleCollection, handleCustomCollection, handleInbox, handleNodeInfo, handleNodeInfoJrd, handleObject, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
3117
+ export { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, actorDehydrator, autoIdAssigner, createFederation, handleActor, handleCollection, handleCustomCollection, handleInbox, handleNodeInfo, handleNodeInfoJrd, handleObject, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
@@ -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-SOE1ifCr.js";
5
- import { KeyCache } from "./http-DqSNLFNY.js";
4
+ import { CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1 } from "./vocab-BI0Ak5lL.js";
5
+ import { KeyCache } from "./http-D6Uj2x2y.js";
6
6
  import { TracerProvider } from "@opentelemetry/api";
7
7
 
8
8
  //#region src/sig/ld.d.ts
@@ -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-DqSNLFNY.js";
4
+ import { HttpMessageSignaturesSpecDeterminer } from "./http-D6Uj2x2y.js";
5
5
  import { TracerProvider } from "@opentelemetry/api";
6
6
 
7
7
  //#region src/runtime/authdocloader.d.ts
@@ -1,5 +1,5 @@
1
1
  import { DocumentLoader, DocumentLoaderFactoryOptions } from "./docloader-D-MrRyHl.cjs";
2
- import { HttpMessageSignaturesSpecDeterminer } from "./http-BS6766zs.cjs";
2
+ import { HttpMessageSignaturesSpecDeterminer } from "./http-D-e6AFwR.cjs";
3
3
  import { TracerProvider } from "@opentelemetry/api";
4
4
 
5
5
  //#region src/runtime/authdocloader.d.ts
@@ -1,5 +1,5 @@
1
1
  import { DocumentLoader, GetUserAgentOptions } from "./docloader-D-MrRyHl.cjs";
2
- import { Collection, Link, Object as Object$1 } from "./vocab-DJTYMqyU.cjs";
2
+ import { Collection, Link, Object as Object$1 } from "./vocab-Dw1-yVGg.cjs";
3
3
  import { TracerProvider } from "@opentelemetry/api";
4
4
 
5
5
  //#region src/vocab/lookup.d.ts
@@ -18,6 +18,24 @@ interface LookupObjectOptions {
18
18
  * @since 0.8.0
19
19
  */
20
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";
21
39
  /**
22
40
  * The options for making `User-Agent` header.
23
41
  * 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
- import { Activity } from "./vocab-SOE1ifCr.js";
4
- import { ActivityTransformer, Context } from "./context-CDSZdQHD.js";
3
+ import { Activity } from "./vocab-BI0Ak5lL.js";
4
+ import { ActivityTransformer, Context } from "./context-B1X8-X33.js";
5
5
 
6
6
  //#region src/compat/transformers.d.ts
7
7
 
@@ -1,6 +1,6 @@
1
1
  import { DocumentLoader } from "./docloader-D-MrRyHl.cjs";
2
- import { CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1 } from "./vocab-DJTYMqyU.cjs";
3
- import { KeyCache } from "./http-BS6766zs.cjs";
2
+ import { CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1 } from "./vocab-Dw1-yVGg.cjs";
3
+ import { KeyCache } from "./http-D-e6AFwR.cjs";
4
4
  import { TracerProvider } from "@opentelemetry/api";
5
5
 
6
6
  //#region src/sig/ld.d.ts
@@ -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-SOE1ifCr.js";
4
+ import { Collection, Link, Object as Object$1 } from "./vocab-BI0Ak5lL.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,5 +1,5 @@
1
- import { Activity } from "./vocab-DJTYMqyU.cjs";
2
- import { ActivityTransformer, Context } from "./context-Dq8aCtMH.cjs";
1
+ import { Activity } from "./vocab-Dw1-yVGg.cjs";
2
+ import { ActivityTransformer, Context } from "./context-DYCJXr7J.cjs";
3
3
 
4
4
  //#region src/compat/transformers.d.ts
5
5