@fedify/fedify 2.0.0-pr.467.1877 → 2.0.0-pr.469.1873

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 (120) hide show
  1. package/dist/{actor-DMbX2bPf.js → actor-Bo3uuvwH.js} +185 -185
  2. package/dist/{actor-DslgGxD8.js → actor-DhFfLv7K.js} +1 -1
  3. package/dist/{actor-BrMdE_1G.cjs → actor-DoaVs0vL.cjs} +185 -185
  4. package/dist/{builder-DvuChHyB.js → builder-DFaO3_4-.js} +3 -3
  5. package/dist/compat/mod.d.cts +3 -2
  6. package/dist/compat/mod.d.ts +3 -2
  7. package/dist/compat/transformers.test.js +14 -14
  8. package/dist/{context-V-XS2_6O.d.ts → context-DG0huGW-.d.ts} +3 -140
  9. package/dist/{context-PxGADCsD.d.cts → context-DJ8aSy2Q.d.cts} +3 -140
  10. package/dist/denokv-CCssOzMJ.js +57 -0
  11. package/dist/{docloader-CQCA5QKZ.js → docloader-B1AZ1LMA.js} +2 -2
  12. package/dist/{esm-DVill8zU.js → esm-CbckHird.js} +1 -1
  13. package/dist/federation/builder.test.js +4 -4
  14. package/dist/federation/collection.test.js +2 -2
  15. package/dist/federation/handler.test.js +15 -15
  16. package/dist/federation/idempotency.test.js +15 -15
  17. package/dist/federation/inbox.test.js +3 -3
  18. package/dist/federation/keycache.test.js +3 -3
  19. package/dist/federation/kv.test.js +2 -2
  20. package/dist/federation/middleware.test.js +16 -16
  21. package/dist/federation/mod.cjs +7 -7
  22. package/dist/federation/mod.d.cts +3 -2
  23. package/dist/federation/mod.d.ts +3 -2
  24. package/dist/federation/mod.js +7 -7
  25. package/dist/federation/mq.test.js +4 -6
  26. package/dist/federation/negotiation.test.js +2 -2
  27. package/dist/federation/retry.test.js +2 -2
  28. package/dist/federation/router.test.js +2 -2
  29. package/dist/federation/send.test.js +9 -9
  30. package/dist/{http-GjJOLe0t.cjs → http-D27ZccIJ.cjs} +2 -2
  31. package/dist/{http-pBJCYh50.js → http-D8SvAGVC.js} +2 -2
  32. package/dist/{http-W1mkXyFw.js → http-nnaaa9xj.js} +2 -2
  33. package/dist/{inbox-Bk4PjO2V.js → inbox-C5M1_a0k.js} +1 -1
  34. package/dist/{key-BlPc80ei.js → key-bc3A8THw.js} +2 -2
  35. package/dist/{keycache-qku87Evf.js → keycache-CpTjHRpy.js} +1 -1
  36. package/dist/{keys-CXQWhBgw.js → keys-D6W2Pnoh.js} +1 -1
  37. package/dist/{kv-cache-BGGmyOF-.js → kv-cache-B_RVzls5.js} +1 -1
  38. package/dist/{kv-cache-BGfFfQma.cjs → kv-cache-CZcZLaEo.cjs} +1 -1
  39. package/dist/{ld-CQj76XXM.js → ld-D5Vg307g.js} +2 -2
  40. package/dist/{lookup-CUj1Ayf2.js → lookup-BBrk-_5k.js} +191 -186
  41. package/dist/{lookup-ZLHmgBj5.js → lookup-BXY5QJif.js} +7 -2
  42. package/dist/{lookup-BahLrzT6.cjs → lookup-DO7ZeFb2.cjs} +7 -2
  43. package/dist/middleware-BU2XnCCI.js +15 -0
  44. package/dist/{middleware-4BJL-9x8.js → middleware-CU0RJROn.js} +11 -11
  45. package/dist/middleware-D4qQ6MLq.cjs +15 -0
  46. package/dist/middleware-DEu9Xuza.js +26 -0
  47. package/dist/{middleware-CCBsGJcn.cjs → middleware-Dy7xPuu-.cjs} +7 -7
  48. package/dist/{middleware-DXsuKk_U.js → middleware-RgDZByG7.js} +7 -7
  49. package/dist/{mod-Cdo6SYlJ.d.ts → mod-BoHnwOCs.d.ts} +1 -1
  50. package/dist/{mod-BoRKfJPE.d.cts → mod-DJcZDvjA.d.cts} +1 -1
  51. package/dist/mod.cjs +7 -7
  52. package/dist/mod.d.cts +6 -5
  53. package/dist/mod.d.ts +6 -5
  54. package/dist/mod.js +7 -7
  55. package/dist/mq-CUKlBw08.d.ts +143 -0
  56. package/dist/mq-DcJPkXD5.d.cts +140 -0
  57. package/dist/nodeinfo/client.test.js +3 -3
  58. package/dist/nodeinfo/handler.test.js +14 -14
  59. package/dist/nodeinfo/mod.d.cts +1 -1
  60. package/dist/nodeinfo/mod.d.ts +1 -1
  61. package/dist/nodeinfo/types.test.js +2 -2
  62. package/dist/{owner-Buqg_Myf.js → owner-DSDpCSms.js} +2 -2
  63. package/dist/{proof-DJjdTnEN.js → proof-4L3D-iT4.js} +3 -3
  64. package/dist/{proof-AxiARBr_.js → proof-Bvu8zaM1.js} +2 -2
  65. package/dist/{proof-DizHNX8y.cjs → proof-C1-VSUNW.cjs} +3 -3
  66. package/dist/{send-B9ByF5wN.js → send-Cr3PSs0N.js} +2 -2
  67. package/dist/sig/http.test.js +7 -7
  68. package/dist/sig/key.test.js +5 -5
  69. package/dist/sig/ld.test.js +6 -6
  70. package/dist/sig/mod.cjs +4 -4
  71. package/dist/sig/mod.d.cts +1 -1
  72. package/dist/sig/mod.d.ts +1 -1
  73. package/dist/sig/mod.js +4 -4
  74. package/dist/sig/owner.test.js +6 -6
  75. package/dist/sig/proof.test.js +6 -6
  76. package/dist/testing/docloader.test.js +2 -2
  77. package/dist/testing/mod.js +2 -2
  78. package/dist/{testing-vN3EpiIw.js → testing-Bw9AfLxQ.js} +1 -1
  79. package/dist/utils/docloader.test.js +8 -8
  80. package/dist/utils/kv-cache.test.js +2 -2
  81. package/dist/utils/mod.cjs +4 -4
  82. package/dist/utils/mod.d.cts +1 -1
  83. package/dist/utils/mod.d.ts +1 -1
  84. package/dist/utils/mod.js +4 -4
  85. package/dist/vocab/actor.test.js +4 -4
  86. package/dist/vocab/lookup.test.js +3 -3
  87. package/dist/vocab/mod.cjs +3 -3
  88. package/dist/vocab/mod.js +3 -3
  89. package/dist/vocab/type.test.js +2 -2
  90. package/dist/vocab/vocab.test.js +3 -3
  91. package/dist/{vocab-CdguqeJf.js → vocab-B74bq08l.js} +2 -2
  92. package/dist/{vocab-DEaLWwSP.cjs → vocab-HJLl6-1F.cjs} +2 -2
  93. package/dist/webfinger/handler.test.js +14 -14
  94. package/dist/webfinger/lookup.test.js +3 -3
  95. package/dist/webfinger/mod.cjs +1 -1
  96. package/dist/webfinger/mod.js +1 -1
  97. package/dist/x/cfworkers.cjs +100 -0
  98. package/dist/x/cfworkers.d.cts +59 -0
  99. package/dist/x/cfworkers.d.ts +61 -0
  100. package/dist/x/cfworkers.js +98 -0
  101. package/dist/x/cfworkers.test.d.ts +3 -0
  102. package/dist/x/cfworkers.test.js +177 -0
  103. package/dist/x/hono.cjs +61 -0
  104. package/dist/x/hono.d.cts +53 -0
  105. package/dist/x/hono.d.ts +55 -0
  106. package/dist/x/hono.js +60 -0
  107. package/dist/x/sveltekit.cjs +69 -0
  108. package/dist/x/sveltekit.d.cts +45 -0
  109. package/dist/x/sveltekit.d.ts +47 -0
  110. package/dist/x/sveltekit.js +68 -0
  111. package/package.json +34 -3
  112. package/dist/middleware-BLZsPbCt.js +0 -15
  113. package/dist/middleware-D8qnhAFG.cjs +0 -15
  114. package/dist/middleware-Dw-pChHQ.js +0 -26
  115. /package/dist/{mod-DMpuiKXi.d.cts → mod-0noXw66R.d.cts} +0 -0
  116. /package/dist/{mod-D5Z2tISD.d.ts → mod-B2iOw50L.d.ts} +0 -0
  117. /package/dist/{mod-aAE2wOWV.d.ts → mod-B9M-8jm2.d.ts} +0 -0
  118. /package/dist/{mod-CcDPcLJW.d.cts → mod-C2tOeRkN.d.cts} +0 -0
  119. /package/dist/{mod-DgxG-byT.d.cts → mod-DgdBYYa0.d.cts} +0 -0
  120. /package/dist/{mod-bjzj5QIb.d.ts → mod-xIj-IT58.d.ts} +0 -0
@@ -3,8 +3,8 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Router, RouterError, deno_default, getTypeId } from "./lookup-CUj1Ayf2.js";
7
- import { InboxListenerSet } from "./inbox-Bk4PjO2V.js";
6
+ import { Router, RouterError, deno_default, getTypeId } from "./lookup-BBrk-_5k.js";
7
+ import { InboxListenerSet } from "./inbox-C5M1_a0k.js";
8
8
  import { getLogger } from "@logtape/logtape";
9
9
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
10
10
 
@@ -42,7 +42,7 @@ var FederationBuilderImpl = class {
42
42
  this.collectionTypeIds = {};
43
43
  }
44
44
  async build(options) {
45
- const { FederationImpl } = await import("./middleware-Dw-pChHQ.js");
45
+ const { FederationImpl } = await import("./middleware-DEu9Xuza.js");
46
46
  const f = new FederationImpl(options);
47
47
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
48
48
  f.router = this.router.clone();
@@ -5,7 +5,8 @@ import "../http-M8k5mKc0.cjs";
5
5
  import "../owner-B4HbyP8s.cjs";
6
6
  import "../mod-BxRCHTz-.cjs";
7
7
  import "../mod-C58MZ7Wx.cjs";
8
- import { ActivityTransformer } from "../context-PxGADCsD.cjs";
8
+ import { ActivityTransformer } from "../context-DJ8aSy2Q.cjs";
9
9
  import "../kv-Bxr0Q87_.cjs";
10
- import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-BoRKfJPE.cjs";
10
+ import "../mq-DcJPkXD5.cjs";
11
+ import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-DJcZDvjA.cjs";
11
12
  export { ActivityTransformer, actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
@@ -7,7 +7,8 @@ import "../http-BbO0ejuk.js";
7
7
  import "../owner-kQRGVXG1.js";
8
8
  import "../mod-BlVovdcy.js";
9
9
  import "../mod-Ds0mpFZU.js";
10
- import { ActivityTransformer } from "../context-V-XS2_6O.js";
10
+ import { ActivityTransformer } from "../context-DG0huGW-.js";
11
11
  import "../kv-BKNZ-Tb-.js";
12
- import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-Cdo6SYlJ.js";
12
+ import "../mq-CUKlBw08.js";
13
+ import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-BoHnwOCs.js";
13
14
  export { ActivityTransformer, actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
@@ -3,30 +3,30 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Follow, Person } from "../lookup-CUj1Ayf2.js";
6
+ import { Follow, Person } from "../lookup-BBrk-_5k.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
10
  import { MemoryKvStore } from "../kv-CRZrzyXm.js";
11
- import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-4BJL-9x8.js";
11
+ import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-CU0RJROn.js";
12
12
  import "../client-pY7-3icS.js";
13
13
  import "../types-C2XVl6gj.js";
14
- import "../actor-DslgGxD8.js";
15
- import "../key-BlPc80ei.js";
16
- import "../http-pBJCYh50.js";
17
- import "../ld-CQj76XXM.js";
18
- import "../owner-Buqg_Myf.js";
19
- import "../proof-AxiARBr_.js";
20
- import "../docloader-CQCA5QKZ.js";
14
+ import "../actor-DhFfLv7K.js";
15
+ import "../key-bc3A8THw.js";
16
+ import "../http-D8SvAGVC.js";
17
+ import "../ld-D5Vg307g.js";
18
+ import "../owner-DSDpCSms.js";
19
+ import "../proof-Bvu8zaM1.js";
20
+ import "../docloader-B1AZ1LMA.js";
21
21
  import "../kv-cache-DN9pfMBe.js";
22
- import "../inbox-Bk4PjO2V.js";
23
- import "../builder-DvuChHyB.js";
22
+ import "../inbox-C5M1_a0k.js";
23
+ import "../builder-DFaO3_4-.js";
24
24
  import "../collection-BzWsN9pB.js";
25
- import "../keycache-qku87Evf.js";
25
+ import "../keycache-CpTjHRpy.js";
26
26
  import "../negotiation-C4nFufNk.js";
27
27
  import "../retry-CfF8Gn4d.js";
28
- import "../send-B9ByF5wN.js";
29
- import { test } from "../testing-vN3EpiIw.js";
28
+ import "../send-Cr3PSs0N.js";
29
+ import { test } from "../testing-Bw9AfLxQ.js";
30
30
 
31
31
  //#region src/compat/transformers.test.ts
32
32
  const federation = new FederationImpl({ kv: new MemoryKvStore() });
@@ -8,6 +8,7 @@ import { GetKeyOwnerOptions } from "./owner-kQRGVXG1.js";
8
8
  import { LookupObjectOptions, TraverseCollectionOptions } from "./mod-BlVovdcy.js";
9
9
  import { Link as Link$1, LookupWebFingerOptions, ResourceDescriptor } from "./mod-Ds0mpFZU.js";
10
10
  import { KvKey, KvStore } from "./kv-BKNZ-Tb-.js";
11
+ import { MessageQueue } from "./mq-CUKlBw08.js";
11
12
  import { Span, TracerProvider } from "@opentelemetry/api";
12
13
  import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, GetUserAgentOptions } from "@fedify/vocab-runtime";
13
14
 
@@ -307,146 +308,8 @@ type CustomCollectionCounter<TParam extends string, TContextData> = (context: Re
307
308
  */
308
309
  type CustomCollectionCursor<TParam extends string, TContext extends Context<TContextData>, TContextData> = (context: TContext, values: Record<TParam, string>) => string | null | Promise<string | null>;
309
310
  //#endregion
310
- //#region src/federation/mq.d.ts
311
- /**
312
- * Additional options for enqueuing a message in a queue.
313
- *
314
- * @since 0.5.0
315
- */
316
- interface MessageQueueEnqueueOptions {
317
- /**
318
- * The delay before the message is enqueued. No delay by default.
319
- *
320
- * It must not be negative.
321
- */
322
- delay?: Temporal.Duration;
323
- }
324
- /**
325
- * Additional options for listening to a message queue.
326
- *
327
- * @since 1.0.0
328
- */
329
- interface MessageQueueListenOptions {
330
- /**
331
- * The signal to abort listening to the message queue.
332
- */
333
- signal?: AbortSignal;
334
- }
335
- /**
336
- * An abstract interface for a message queue.
337
- *
338
- * @since 0.5.0
339
- */
340
- interface MessageQueue {
341
- /**
342
- * Whether the message queue backend provides native retry mechanisms.
343
- * When `true`, Fedify will skip its own retry logic and rely on the backend
344
- * to handle retries. When `false` or omitted, Fedify will handle retries
345
- * using its own retry policies.
346
- *
347
- * @default `false`
348
- * @since 1.7.0
349
- */
350
- readonly nativeRetrial?: boolean;
351
- /**
352
- * Enqueues a message in the queue.
353
- * @param message The message to enqueue.
354
- * @param options Additional options for enqueuing the message.
355
- */
356
- enqueue(message: any, options?: MessageQueueEnqueueOptions): Promise<void>;
357
- /**
358
- * Enqueues multiple messages in the queue. This operation is optional,
359
- * and may not be supported by all implementations. If not supported,
360
- * Fedify will invoke {@link enqueue} for each message.
361
- *
362
- * @param messages The messages to enqueue.
363
- * @param options Additional options for enqueuing the messages.
364
- */
365
- enqueueMany?: (messages: any[], options?: MessageQueueEnqueueOptions) => Promise<void>;
366
- /**
367
- * Listens for messages in the queue.
368
- * @param handler The handler for messages in the queue.
369
- * @param options Additional options for listening to the message queue.
370
- * @returns A promise that resolves when the listening is done. It never
371
- * rejects, and is resolved when the signal is aborted. If no
372
- * signal is provided, it never resolves.
373
- */
374
- listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
375
- }
376
- /**
377
- * Additional options for {@link InProcessMessageQueue}.
378
- * @since 1.0.0
379
- */
380
- interface InProcessMessageQueueOptions {
381
- /**
382
- * The interval to poll for messages in the queue. 5 seconds by default.
383
- * @default `{ seconds: 5 }`
384
- */
385
- pollInterval?: Temporal.Duration | Temporal.DurationLike;
386
- }
387
- /**
388
- * A message queue that processes messages in the same process.
389
- * Do not use this in production as it does neither persist messages nor
390
- * distribute them across multiple processes.
391
- *
392
- * @since 0.5.0
393
- */
394
- declare class InProcessMessageQueue implements MessageQueue {
395
- #private;
396
- /**
397
- * In-process message queue does not provide native retry mechanisms.
398
- * @since 1.7.0
399
- */
400
- readonly nativeRetrial = false;
401
- /**
402
- * Constructs a new {@link InProcessMessageQueue} with the given options.
403
- * @param options Additional options for the in-process message queue.
404
- */
405
- constructor(options?: InProcessMessageQueueOptions);
406
- enqueue(message: any, options?: MessageQueueEnqueueOptions): Promise<void>;
407
- enqueueMany(messages: any[], options?: MessageQueueEnqueueOptions): Promise<void>;
408
- listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
409
- }
410
- /**
411
- * A message queue that processes messages in parallel. It takes another
412
- * {@link MessageQueue}, and processes messages in parallel up to a certain
413
- * number of workers.
414
- *
415
- * Actually, it's rather a decorator than a queue itself.
416
- *
417
- * Note that the workers do not run in truly parallel, in the sense that they
418
- * are not running in separate threads or processes. They are running in the
419
- * same process, but are scheduled to run in parallel. Hence, this is useful
420
- * for I/O-bound tasks, but not for CPU-bound tasks, which is okay for Fedify's
421
- * workloads.
422
- *
423
- * @since 1.0.0
424
- */
425
- declare class ParallelMessageQueue implements MessageQueue {
426
- #private;
427
- readonly queue: MessageQueue;
428
- readonly workers: number;
429
- /**
430
- * Inherits the native retry capability from the wrapped queue.
431
- * @since 1.7.0
432
- */
433
- readonly nativeRetrial?: boolean;
434
- /**
435
- * Constructs a new {@link ParallelMessageQueue} with the given queue and
436
- * number of workers.
437
- * @param queue The message queue to use under the hood. Note that
438
- * {@link ParallelMessageQueue} cannot be nested.
439
- * @param workers The number of workers to process messages in parallel.
440
- * @throws {TypeError} If the given queue is an instance of
441
- * {@link ParallelMessageQueue}.
442
- */
443
- constructor(queue: MessageQueue, workers: number);
444
- enqueue(message: any, options?: MessageQueueEnqueueOptions): Promise<void>;
445
- enqueueMany(messages: any[], options?: MessageQueueEnqueueOptions): Promise<void>;
446
- listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
447
- }
448
- //#endregion
449
311
  //#region src/federation/handler.d.ts
312
+
450
313
  /**
451
314
  * Options for the {@link respondWithObject} and
452
315
  * {@link respondWithObjectIfAcceptable} functions.
@@ -2448,4 +2311,4 @@ interface ActorKeyPair extends CryptoKeyPair {
2448
2311
  multikey: Multikey;
2449
2312
  }
2450
2313
  //#endregion
2451
- export { ActivityTransformer, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CreateFederationOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable };
2314
+ export { ActivityTransformer, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CreateFederationOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, Message, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, PageItems, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable };
@@ -6,6 +6,7 @@ import { GetKeyOwnerOptions } from "./owner-B4HbyP8s.cjs";
6
6
  import { LookupObjectOptions, TraverseCollectionOptions } from "./mod-BxRCHTz-.cjs";
7
7
  import { Link as Link$1, LookupWebFingerOptions, ResourceDescriptor } from "./mod-C58MZ7Wx.cjs";
8
8
  import { KvKey, KvStore } from "./kv-Bxr0Q87_.cjs";
9
+ import { MessageQueue } from "./mq-DcJPkXD5.cjs";
9
10
  import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, GetUserAgentOptions } from "@fedify/vocab-runtime";
10
11
  import { Span, TracerProvider } from "@opentelemetry/api";
11
12
 
@@ -305,146 +306,8 @@ type CustomCollectionCounter<TParam extends string, TContextData> = (context: Re
305
306
  */
306
307
  type CustomCollectionCursor<TParam extends string, TContext extends Context<TContextData>, TContextData> = (context: TContext, values: Record<TParam, string>) => string | null | Promise<string | null>;
307
308
  //#endregion
308
- //#region src/federation/mq.d.ts
309
- /**
310
- * Additional options for enqueuing a message in a queue.
311
- *
312
- * @since 0.5.0
313
- */
314
- interface MessageQueueEnqueueOptions {
315
- /**
316
- * The delay before the message is enqueued. No delay by default.
317
- *
318
- * It must not be negative.
319
- */
320
- delay?: Temporal.Duration;
321
- }
322
- /**
323
- * Additional options for listening to a message queue.
324
- *
325
- * @since 1.0.0
326
- */
327
- interface MessageQueueListenOptions {
328
- /**
329
- * The signal to abort listening to the message queue.
330
- */
331
- signal?: AbortSignal;
332
- }
333
- /**
334
- * An abstract interface for a message queue.
335
- *
336
- * @since 0.5.0
337
- */
338
- interface MessageQueue {
339
- /**
340
- * Whether the message queue backend provides native retry mechanisms.
341
- * When `true`, Fedify will skip its own retry logic and rely on the backend
342
- * to handle retries. When `false` or omitted, Fedify will handle retries
343
- * using its own retry policies.
344
- *
345
- * @default `false`
346
- * @since 1.7.0
347
- */
348
- readonly nativeRetrial?: boolean;
349
- /**
350
- * Enqueues a message in the queue.
351
- * @param message The message to enqueue.
352
- * @param options Additional options for enqueuing the message.
353
- */
354
- enqueue(message: any, options?: MessageQueueEnqueueOptions): Promise<void>;
355
- /**
356
- * Enqueues multiple messages in the queue. This operation is optional,
357
- * and may not be supported by all implementations. If not supported,
358
- * Fedify will invoke {@link enqueue} for each message.
359
- *
360
- * @param messages The messages to enqueue.
361
- * @param options Additional options for enqueuing the messages.
362
- */
363
- enqueueMany?: (messages: any[], options?: MessageQueueEnqueueOptions) => Promise<void>;
364
- /**
365
- * Listens for messages in the queue.
366
- * @param handler The handler for messages in the queue.
367
- * @param options Additional options for listening to the message queue.
368
- * @returns A promise that resolves when the listening is done. It never
369
- * rejects, and is resolved when the signal is aborted. If no
370
- * signal is provided, it never resolves.
371
- */
372
- listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
373
- }
374
- /**
375
- * Additional options for {@link InProcessMessageQueue}.
376
- * @since 1.0.0
377
- */
378
- interface InProcessMessageQueueOptions {
379
- /**
380
- * The interval to poll for messages in the queue. 5 seconds by default.
381
- * @default `{ seconds: 5 }`
382
- */
383
- pollInterval?: Temporal.Duration | Temporal.DurationLike;
384
- }
385
- /**
386
- * A message queue that processes messages in the same process.
387
- * Do not use this in production as it does neither persist messages nor
388
- * distribute them across multiple processes.
389
- *
390
- * @since 0.5.0
391
- */
392
- declare class InProcessMessageQueue implements MessageQueue {
393
- #private;
394
- /**
395
- * In-process message queue does not provide native retry mechanisms.
396
- * @since 1.7.0
397
- */
398
- readonly nativeRetrial = false;
399
- /**
400
- * Constructs a new {@link InProcessMessageQueue} with the given options.
401
- * @param options Additional options for the in-process message queue.
402
- */
403
- constructor(options?: InProcessMessageQueueOptions);
404
- enqueue(message: any, options?: MessageQueueEnqueueOptions): Promise<void>;
405
- enqueueMany(messages: any[], options?: MessageQueueEnqueueOptions): Promise<void>;
406
- listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
407
- }
408
- /**
409
- * A message queue that processes messages in parallel. It takes another
410
- * {@link MessageQueue}, and processes messages in parallel up to a certain
411
- * number of workers.
412
- *
413
- * Actually, it's rather a decorator than a queue itself.
414
- *
415
- * Note that the workers do not run in truly parallel, in the sense that they
416
- * are not running in separate threads or processes. They are running in the
417
- * same process, but are scheduled to run in parallel. Hence, this is useful
418
- * for I/O-bound tasks, but not for CPU-bound tasks, which is okay for Fedify's
419
- * workloads.
420
- *
421
- * @since 1.0.0
422
- */
423
- declare class ParallelMessageQueue implements MessageQueue {
424
- #private;
425
- readonly queue: MessageQueue;
426
- readonly workers: number;
427
- /**
428
- * Inherits the native retry capability from the wrapped queue.
429
- * @since 1.7.0
430
- */
431
- readonly nativeRetrial?: boolean;
432
- /**
433
- * Constructs a new {@link ParallelMessageQueue} with the given queue and
434
- * number of workers.
435
- * @param queue The message queue to use under the hood. Note that
436
- * {@link ParallelMessageQueue} cannot be nested.
437
- * @param workers The number of workers to process messages in parallel.
438
- * @throws {TypeError} If the given queue is an instance of
439
- * {@link ParallelMessageQueue}.
440
- */
441
- constructor(queue: MessageQueue, workers: number);
442
- enqueue(message: any, options?: MessageQueueEnqueueOptions): Promise<void>;
443
- enqueueMany(messages: any[], options?: MessageQueueEnqueueOptions): Promise<void>;
444
- listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
445
- }
446
- //#endregion
447
309
  //#region src/federation/handler.d.ts
310
+
448
311
  /**
449
312
  * Options for the {@link respondWithObject} and
450
313
  * {@link respondWithObjectIfAcceptable} functions.
@@ -2446,4 +2309,4 @@ interface ActorKeyPair extends CryptoKeyPair {
2446
2309
  multikey: Multikey;
2447
2310
  }
2448
2311
  //#endregion
2449
- export { ActivityTransformer, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CreateFederationOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable };
2312
+ export { ActivityTransformer, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CreateFederationOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, Message, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, PageItems, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable };
@@ -0,0 +1,57 @@
1
+
2
+ import { Temporal } from "@js-temporal/polyfill";
3
+ import { URLPattern } from "urlpattern-polyfill";
4
+ globalThis.addEventListener = () => {};
5
+
6
+ import { isEqual } from "es-toolkit";
7
+ import { getLogger } from "@logtape/logtape";
8
+
9
+ //#region src/x/denokv.ts
10
+ /**
11
+ * Represents a message queue adapter that uses Deno KV store.
12
+ *
13
+ * @deprecated This class has been moved to `@fedify/denokv` package.
14
+ * Import `DenoKvMessageQueue` from `@fedify/denokv` instead.
15
+ * This class will be removed in Fedify v2.0.
16
+ */
17
+ var DenoKvMessageQueue = class {
18
+ #kv;
19
+ /**
20
+ * Deno KV queues provide automatic retry with exponential backoff.
21
+ * @since 1.7.0
22
+ */
23
+ nativeRetrial = true;
24
+ /**
25
+ * Constructs a new {@link DenoKvMessageQueue} adapter with the given Deno KV
26
+ * store.
27
+ * @param kv The Deno KV store to use.
28
+ */
29
+ constructor(kv) {
30
+ const logger = getLogger(["fedify", "denokv"]);
31
+ logger.warn("The `@fedify/fedify/x/denokv` module is deprecated; use `DenoKvMessageQueue` from `@fedify/denokv` package instead.");
32
+ this.#kv = kv;
33
+ }
34
+ async enqueue(message, options) {
35
+ await this.#kv.enqueue(message, options?.delay == null ? void 0 : { delay: Math.max(options.delay.total("millisecond"), 0) });
36
+ }
37
+ listen(handler, options = {}) {
38
+ options.signal?.addEventListener("abort", () => {
39
+ try {
40
+ this.#kv.close();
41
+ } catch (e) {
42
+ if (!(e instanceof Deno.errors.BadResource)) throw e;
43
+ }
44
+ }, { once: true });
45
+ return this.#kv.listenQueue(handler);
46
+ }
47
+ [Symbol.dispose]() {
48
+ try {
49
+ this.#kv.close();
50
+ } catch (e) {
51
+ if (!(e instanceof Deno.errors.BadResource)) throw e;
52
+ }
53
+ }
54
+ };
55
+
56
+ //#endregion
57
+ export { DenoKvMessageQueue };
@@ -3,8 +3,8 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { validateCryptoKey } from "./key-BlPc80ei.js";
7
- import { doubleKnock } from "./http-pBJCYh50.js";
6
+ import { validateCryptoKey } from "./key-bc3A8THw.js";
7
+ import { doubleKnock } from "./http-D8SvAGVC.js";
8
8
  import { curry } from "es-toolkit";
9
9
  import { UrlError, createActivityPubRequest, getDocumentLoader, getRemoteDocument, logRequest, validatePublicUrl } from "@fedify/vocab-runtime";
10
10
  import { getLogger } from "@logtape/logtape";
@@ -3,7 +3,7 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { __commonJS, __toESM } from "./lookup-CUj1Ayf2.js";
6
+ import { __commonJS, __toESM } from "./lookup-BBrk-_5k.js";
7
7
 
8
8
  //#region ../../node_modules/.pnpm/glob-to-regexp@0.4.1/node_modules/glob-to-regexp/index.js
9
9
  var require_glob_to_regexp = __commonJS({ "../../node_modules/.pnpm/glob-to-regexp@0.4.1/node_modules/glob-to-regexp/index.js"(exports, module) {
@@ -3,14 +3,14 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Activity, Note, Person } from "../lookup-CUj1Ayf2.js";
6
+ import { Activity, Note, Person } from "../lookup-BBrk-_5k.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 "../inbox-Bk4PjO2V.js";
12
- import { createFederationBuilder } from "../builder-DvuChHyB.js";
13
- import { test } from "../testing-vN3EpiIw.js";
11
+ import "../inbox-C5M1_a0k.js";
12
+ import { createFederationBuilder } from "../builder-DFaO3_4-.js";
13
+ import { test } from "../testing-Bw9AfLxQ.js";
14
14
  import { assertExists } from "../std__assert-DWivtrGR.js";
15
15
  import "../assert_rejects-Ce45JcFg.js";
16
16
  import { assertThrows } from "../assert_throws-BNXdRGWP.js";
@@ -3,12 +3,12 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import "../lookup-CUj1Ayf2.js";
6
+ import "../lookup-BBrk-_5k.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 { buildCollectionSynchronizationHeader, digest } from "../collection-BzWsN9pB.js";
11
- import { test } from "../testing-vN3EpiIw.js";
11
+ import { test } from "../testing-Bw9AfLxQ.js";
12
12
  import "../std__assert-DWivtrGR.js";
13
13
  import "../assert_rejects-Ce45JcFg.js";
14
14
  import "../assert_throws-BNXdRGWP.js";
@@ -3,35 +3,35 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Create, Note, Person } from "../lookup-CUj1Ayf2.js";
6
+ import { Create, Note, Person } from "../lookup-BBrk-_5k.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
10
  import { MemoryKvStore } from "../kv-CRZrzyXm.js";
11
- import { createFederation, handleActor, handleCollection, handleCustomCollection, handleInbox, handleObject, respondWithObject, respondWithObjectIfAcceptable } from "../middleware-4BJL-9x8.js";
11
+ import { createFederation, handleActor, handleCollection, handleCustomCollection, handleInbox, handleObject, respondWithObject, respondWithObjectIfAcceptable } from "../middleware-CU0RJROn.js";
12
12
  import "../client-pY7-3icS.js";
13
13
  import "../types-C2XVl6gj.js";
14
- import "../actor-DslgGxD8.js";
15
- import "../key-BlPc80ei.js";
16
- import { signRequest } from "../http-pBJCYh50.js";
17
- import "../ld-CQj76XXM.js";
18
- import "../owner-Buqg_Myf.js";
19
- import "../proof-AxiARBr_.js";
20
- import "../docloader-CQCA5QKZ.js";
14
+ import "../actor-DhFfLv7K.js";
15
+ import "../key-bc3A8THw.js";
16
+ import { signRequest } from "../http-D8SvAGVC.js";
17
+ import "../ld-D5Vg307g.js";
18
+ import "../owner-DSDpCSms.js";
19
+ import "../proof-Bvu8zaM1.js";
20
+ import "../docloader-B1AZ1LMA.js";
21
21
  import "../kv-cache-DN9pfMBe.js";
22
- import { InboxListenerSet } from "../inbox-Bk4PjO2V.js";
23
- import "../builder-DvuChHyB.js";
22
+ import { InboxListenerSet } from "../inbox-C5M1_a0k.js";
23
+ import "../builder-DFaO3_4-.js";
24
24
  import "../collection-BzWsN9pB.js";
25
- import "../keycache-qku87Evf.js";
25
+ import "../keycache-CpTjHRpy.js";
26
26
  import "../negotiation-C4nFufNk.js";
27
27
  import "../retry-CfF8Gn4d.js";
28
- import "../send-B9ByF5wN.js";
29
- import { createInboxContext, createRequestContext, mockDocumentLoader, test } from "../testing-vN3EpiIw.js";
28
+ import "../send-Cr3PSs0N.js";
29
+ import { createInboxContext, createRequestContext, mockDocumentLoader, test } from "../testing-Bw9AfLxQ.js";
30
30
  import "../std__assert-DWivtrGR.js";
31
31
  import "../assert_rejects-Ce45JcFg.js";
32
32
  import "../assert_throws-BNXdRGWP.js";
33
33
  import "../assert_not_equals-C80BG-_5.js";
34
- import { rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-CXQWhBgw.js";
34
+ import { rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-D6W2Pnoh.js";
35
35
 
36
36
  //#region src/federation/handler.test.ts
37
37
  test("handleActor()", async () => {
@@ -3,35 +3,35 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Create, Follow, Person } from "../lookup-CUj1Ayf2.js";
6
+ import { Create, Follow, Person } from "../lookup-BBrk-_5k.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 } from "../middleware-4BJL-9x8.js";
11
+ import { createFederation } from "../middleware-CU0RJROn.js";
12
12
  import "../client-pY7-3icS.js";
13
13
  import "../types-C2XVl6gj.js";
14
- import "../actor-DslgGxD8.js";
15
- import "../key-BlPc80ei.js";
16
- import "../http-pBJCYh50.js";
17
- import "../ld-CQj76XXM.js";
18
- import "../owner-Buqg_Myf.js";
19
- import { signObject } from "../proof-AxiARBr_.js";
20
- import "../docloader-CQCA5QKZ.js";
14
+ import "../actor-DhFfLv7K.js";
15
+ import "../key-bc3A8THw.js";
16
+ import "../http-D8SvAGVC.js";
17
+ import "../ld-D5Vg307g.js";
18
+ import "../owner-DSDpCSms.js";
19
+ import { signObject } from "../proof-Bvu8zaM1.js";
20
+ import "../docloader-B1AZ1LMA.js";
21
21
  import "../kv-cache-DN9pfMBe.js";
22
- import "../inbox-Bk4PjO2V.js";
23
- import "../builder-DvuChHyB.js";
22
+ import "../inbox-C5M1_a0k.js";
23
+ import "../builder-DFaO3_4-.js";
24
24
  import "../collection-BzWsN9pB.js";
25
- import "../keycache-qku87Evf.js";
25
+ import "../keycache-CpTjHRpy.js";
26
26
  import "../negotiation-C4nFufNk.js";
27
27
  import "../retry-CfF8Gn4d.js";
28
- import "../send-B9ByF5wN.js";
29
- import { mockDocumentLoader, test } from "../testing-vN3EpiIw.js";
28
+ import "../send-Cr3PSs0N.js";
29
+ import { mockDocumentLoader, test } from "../testing-Bw9AfLxQ.js";
30
30
  import "../std__assert-DWivtrGR.js";
31
31
  import "../assert_rejects-Ce45JcFg.js";
32
32
  import "../assert_throws-BNXdRGWP.js";
33
33
  import "../assert_not_equals-C80BG-_5.js";
34
- import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey } from "../keys-CXQWhBgw.js";
34
+ import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey } from "../keys-D6W2Pnoh.js";
35
35
 
36
36
  //#region src/federation/idempotency.test.ts
37
37
  const kv = new MemoryKvStore();
@@ -3,10 +3,10 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Activity, Create, Invite, Offer, Update } from "../lookup-CUj1Ayf2.js";
6
+ import { Activity, Create, Invite, Offer, Update } from "../lookup-BBrk-_5k.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
- import { InboxListenerSet } from "../inbox-Bk4PjO2V.js";
9
- import { test } from "../testing-vN3EpiIw.js";
8
+ import { InboxListenerSet } from "../inbox-C5M1_a0k.js";
9
+ import { test } from "../testing-Bw9AfLxQ.js";
10
10
  import { assertThrows } from "../assert_throws-BNXdRGWP.js";
11
11
 
12
12
  //#region src/federation/inbox.test.ts