@fedify/fedify 2.0.0-pr.559.6 → 2.0.0

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 (65) hide show
  1. package/README.md +8 -0
  2. package/dist/{builder-DFgILDcG.js → builder-DIwRDV19.js} +12 -57
  3. package/dist/compat/mod.d.cts +2 -2
  4. package/dist/compat/mod.d.ts +2 -2
  5. package/dist/compat/transformers.test.js +11 -11
  6. package/dist/{context-Cf0-LmZC.d.cts → context-BdNW_8a3.d.cts} +19 -46
  7. package/dist/{context-liIe6DFH.d.ts → context-C-GVKcJR.d.ts} +19 -46
  8. package/dist/{deno-Dssbv2qD.js → deno-CJgVX6Dr.js} +1 -4
  9. package/dist/{docloader-DLiT1bFg.js → docloader-BMecQIi-.js} +4 -12
  10. package/dist/federation/builder.test.js +3 -3
  11. package/dist/federation/handler.test.js +45 -45
  12. package/dist/federation/idempotency.test.js +11 -11
  13. package/dist/federation/inbox.test.js +2 -2
  14. package/dist/federation/middleware.test.js +43 -68
  15. package/dist/federation/mod.cjs +4 -4
  16. package/dist/federation/mod.d.cts +3 -3
  17. package/dist/federation/mod.d.ts +3 -3
  18. package/dist/federation/mod.js +4 -4
  19. package/dist/federation/send.test.js +90 -5
  20. package/dist/federation/webfinger.test.js +12 -15
  21. package/dist/{http-CfrdWdLH.js → http-CMTBVAxQ.js} +2 -2
  22. package/dist/{http-BP6_JjsL.cjs → http-CowIBMKY.cjs} +1 -4
  23. package/dist/{http-BaPyHVQ7.js → http-DoLgvgZ3.js} +1 -4
  24. package/dist/{inbox-CW8E414g.js → inbox-BrQMunLn.js} +1 -1
  25. package/dist/{key-DJI5G1Ub.js → key-BQD4Ef_6.js} +1 -1
  26. package/dist/{kv-cache-yGgfNuY5.cjs → kv-cache-174yQHE6.cjs} +1 -3
  27. package/dist/{kv-cache-CuA9rQF1.js → kv-cache-CFlvozMZ.js} +2 -4
  28. package/dist/{ld-Cu0jmueI.js → ld-DNdCEe6l.js} +2 -2
  29. package/dist/{middleware-D227KuaF.js → middleware-BN-t5M_R.js} +157 -210
  30. package/dist/middleware-BYNnNj-3.cjs +12 -0
  31. package/dist/{middleware-RxA4Ghbe.js → middleware-D5JdOwAE.js} +193 -260
  32. package/dist/{middleware-CBWnYv0h.js → middleware-UqzNuf3o.js} +11 -11
  33. package/dist/{middleware-Ddt9Yu31.cjs → middleware-aQr0yVne.cjs} +193 -260
  34. package/dist/{middleware-CjoXj45O.js → middleware-dO1Uzsiv.js} +4 -4
  35. package/dist/{mod-H3ScYaOb.d.cts → mod-5PNty1K9.d.cts} +1 -1
  36. package/dist/{mod-Do_sZWAA.d.cts → mod-BcpEGTWV.d.cts} +1 -1
  37. package/dist/{mod-CvhyLrjX.d.ts → mod-CevNbUol.d.ts} +0 -18
  38. package/dist/{mod-Dquroqiv.d.ts → mod-CtO31FCx.d.ts} +1 -1
  39. package/dist/{mod-B9_l3te3.d.ts → mod-Da9fNDyC.d.ts} +1 -1
  40. package/dist/{mod-DWaA45ef.d.cts → mod-ErTjUJs9.d.cts} +0 -18
  41. package/dist/mod.cjs +4 -4
  42. package/dist/mod.d.cts +6 -6
  43. package/dist/mod.d.ts +6 -6
  44. package/dist/mod.js +4 -4
  45. package/dist/nodeinfo/handler.test.js +11 -11
  46. package/dist/{owner-8nrupc6V.js → owner-DbymvgVI.js} +1 -1
  47. package/dist/{proof-CUhWCefd.js → proof-C85CNL5a.js} +1 -1
  48. package/dist/{proof-BrTneuEN.cjs → proof-DQFAjOse.cjs} +1 -1
  49. package/dist/{proof-RhBPHpn0.js → proof-DVBdddim.js} +2 -2
  50. package/dist/{send-CnI-Brh9.js → send-CkvEc-Tx.js} +35 -4
  51. package/dist/sig/http.test.js +3 -3
  52. package/dist/sig/key.test.js +2 -2
  53. package/dist/sig/ld.test.js +3 -3
  54. package/dist/sig/mod.cjs +2 -2
  55. package/dist/sig/mod.js +2 -2
  56. package/dist/sig/owner.test.js +3 -3
  57. package/dist/sig/proof.test.js +3 -3
  58. package/dist/testing/mod.d.ts +13 -33
  59. package/dist/utils/docloader.test.js +4 -4
  60. package/dist/utils/mod.cjs +2 -2
  61. package/dist/utils/mod.d.cts +1 -1
  62. package/dist/utils/mod.d.ts +1 -1
  63. package/dist/utils/mod.js +2 -2
  64. package/package.json +8 -8
  65. package/dist/middleware-ACS5M4fZ.cjs +0 -12
package/README.md CHANGED
@@ -98,8 +98,10 @@ Here is the list of packages:
98
98
  | ------------------------------------------------- | -------------------------------- | -------------------------------- | ---------------------------------------- |
99
99
  | [@fedify/fedify](/packages/fedify/) | [JSR] | [npm] | The core framework of Fedify |
100
100
  | [@fedify/cli](/packages/cli/) | [JSR][jsr:@fedify/cli] | [npm][npm:@fedify/cli] | CLI toolchain for testing and debugging |
101
+ | [@fedify/create](/packages/create/) | | [npm][npm:@fedify/create] | Create a new Fedify project |
101
102
  | [@fedify/amqp](/packages/amqp/) | [JSR][jsr:@fedify/amqp] | [npm][npm:@fedify/amqp] | AMQP/RabbitMQ driver |
102
103
  | [@fedify/cfworkers](/packages/cfworkers/) | [JSR][jsr:@fedify/cfworkers] | [npm][npm:@fedify/cfworkers] | Cloudflare Workers integration |
104
+ | [@fedify/debugger](/packages/debugger/) | [JSR][jsr:@fedify/debugger] | [npm][npm:@fedify/debugger] | Embedded ActivityPub debug dashboard |
103
105
  | [@fedify/denokv](/packages/denokv/) | [JSR][jsr:@fedify/denokv] | | Deno KV integration |
104
106
  | [@fedify/elysia](/packages/elysia/) | | [npm][npm:@fedify/elysia] | Elysia integration |
105
107
  | [@fedify/express](/packages/express/) | [JSR][jsr:@fedify/express] | [npm][npm:@fedify/express] | Express integration |
@@ -107,6 +109,7 @@ Here is the list of packages:
107
109
  | [@fedify/fresh](/packages/fresh/) | [JSR][jsr:@fedify/fresh] | | Fresh integration |
108
110
  | [@fedify/h3](/packages/h3/) | [JSR][jsr:@fedify/h3] | [npm][npm:@fedify/h3] | H3 integration |
109
111
  | [@fedify/hono](/packages/hono/) | [JSR][jsr:@fedify/hono] | [npm][npm:@fedify/hono] | Hono integration |
112
+ | [@fedify/init](/packages/init/) | [JSR][jsr:@fedify/init] | [npm][npm:@fedify/init] | Project initializer for Fedify |
110
113
  | [@fedify/koa](/packages/koa/) | [JSR][jsr:@fedify/koa] | [npm][npm:@fedify/koa] | Koa integration |
111
114
  | [@fedify/lint](/packages/lint/) | [JSR][jsr:@fedify/lint] | [npm][npm:@fedify/lint] | Linting utilities |
112
115
  | [@fedify/nestjs](/packages/nestjs/) | | [npm][npm:@fedify/nestjs] | NestJS integration |
@@ -124,10 +127,13 @@ Here is the list of packages:
124
127
 
125
128
  [jsr:@fedify/cli]: https://jsr.io/@fedify/cli
126
129
  [npm:@fedify/cli]: https://www.npmjs.com/package/@fedify/cli
130
+ [npm:@fedify/create]: https://www.npmjs.com/package/@fedify/create
127
131
  [jsr:@fedify/amqp]: https://jsr.io/@fedify/amqp
128
132
  [npm:@fedify/amqp]: https://www.npmjs.com/package/@fedify/amqp
129
133
  [jsr:@fedify/cfworkers]: https://jsr.io/@fedify/cfworkers
130
134
  [npm:@fedify/cfworkers]: https://www.npmjs.com/package/@fedify/cfworkers
135
+ [jsr:@fedify/debugger]: https://jsr.io/@fedify/debugger
136
+ [npm:@fedify/debugger]: https://www.npmjs.com/package/@fedify/debugger
131
137
  [jsr:@fedify/denokv]: https://jsr.io/@fedify/denokv
132
138
  [npm:@fedify/elysia]: https://www.npmjs.com/package/@fedify/elysia
133
139
  [jsr:@fedify/express]: https://jsr.io/@fedify/express
@@ -139,6 +145,8 @@ Here is the list of packages:
139
145
  [npm:@fedify/h3]: https://www.npmjs.com/package/@fedify/h3
140
146
  [jsr:@fedify/hono]: https://jsr.io/@fedify/hono
141
147
  [npm:@fedify/hono]: https://www.npmjs.com/package/@fedify/hono
148
+ [jsr:@fedify/init]: https://jsr.io/@fedify/init
149
+ [npm:@fedify/init]: https://www.npmjs.com/package/@fedify/init
142
150
  [jsr:@fedify/koa]: https://jsr.io/@fedify/koa
143
151
  [npm:@fedify/koa]: https://www.npmjs.com/package/@fedify/koa
144
152
  [jsr:@fedify/lint]: https://jsr.io/@fedify/lint
@@ -3,9 +3,9 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { deno_default } from "./deno-Dssbv2qD.js";
6
+ import { deno_default } from "./deno-CJgVX6Dr.js";
7
7
  import { Router, RouterError } from "./router-D9eI0s4b.js";
8
- import { InboxListenerSet } from "./inbox-CW8E414g.js";
8
+ import { InboxListenerSet } from "./inbox-BrQMunLn.js";
9
9
  import { getLogger } from "@logtape/logtape";
10
10
  import { getTypeId } from "@fedify/vocab";
11
11
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
@@ -45,7 +45,7 @@ var FederationBuilderImpl = class {
45
45
  this.collectionTypeIds = {};
46
46
  }
47
47
  async build(options) {
48
- const { FederationImpl } = await import("./middleware-CBWnYv0h.js");
48
+ const { FederationImpl } = await import("./middleware-UqzNuf3o.js");
49
49
  const f = new FederationImpl(options);
50
50
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
51
51
  f.router = this.router.clone();
@@ -77,12 +77,7 @@ var FederationBuilderImpl = class {
77
77
  setActorDispatcher(path, dispatcher) {
78
78
  if (this.router.has("actor")) throw new RouterError("Actor dispatcher already set.");
79
79
  const variables = this.router.add(path, "actor");
80
- if (variables.size !== 1 || !(variables.has("identifier") || variables.has("handle"))) throw new RouterError("Path for actor dispatcher must have one variable: {identifier}");
81
- if (variables.has("handle")) getLogger([
82
- "fedify",
83
- "federation",
84
- "actor"
85
- ]).warn("The {{handle}} variable in the actor dispatcher path is deprecated. Use {{identifier}} instead.");
80
+ if (variables.size !== 1 || !variables.has("identifier")) throw new RouterError("Path for actor dispatcher must have one variable: {identifier}");
86
81
  const callbacks = { dispatcher: async (context$1, identifier) => {
87
82
  const actor = await this._getTracer().startActiveSpan("activitypub.dispatch_actor", {
88
83
  kind: SpanKind.SERVER,
@@ -244,12 +239,7 @@ var FederationBuilderImpl = class {
244
239
  if (this.inboxPath !== path) throw new RouterError("Inbox dispatcher path must match inbox listener path.");
245
240
  } else {
246
241
  const variables = this.router.add(path, "inbox");
247
- if (variables.size !== 1 || !(variables.has("identifier") || variables.has("handle"))) throw new RouterError("Path for inbox dispatcher must have one variable: {identifier}");
248
- if (variables.has("handle")) getLogger([
249
- "fedify",
250
- "federation",
251
- "inbox"
252
- ]).warn("The {{handle}} variable in the inbox dispatcher path is deprecated. Use {{identifier}} instead.");
242
+ if (variables.size !== 1 || !variables.has("identifier")) throw new RouterError("Path for inbox dispatcher must have one variable: {identifier}");
253
243
  this.inboxPath = path;
254
244
  }
255
245
  const callbacks = { dispatcher };
@@ -277,12 +267,7 @@ var FederationBuilderImpl = class {
277
267
  setOutboxDispatcher(path, dispatcher) {
278
268
  if (this.router.has("outbox")) throw new RouterError("Outbox dispatcher already set.");
279
269
  const variables = this.router.add(path, "outbox");
280
- if (variables.size !== 1 || !(variables.has("identifier") || variables.has("handle"))) throw new RouterError("Path for outbox dispatcher must have one variable: {identifier}");
281
- if (variables.has("handle")) getLogger([
282
- "fedify",
283
- "federation",
284
- "outbox"
285
- ]).warn("The {{handle}} variable in the outbox dispatcher path is deprecated. Use {{identifier}} instead.");
270
+ if (variables.size !== 1 || !variables.has("identifier")) throw new RouterError("Path for outbox dispatcher must have one variable: {identifier}");
286
271
  const callbacks = { dispatcher };
287
272
  this.outboxCallbacks = callbacks;
288
273
  const setters = {
@@ -308,12 +293,7 @@ var FederationBuilderImpl = class {
308
293
  setFollowingDispatcher(path, dispatcher) {
309
294
  if (this.router.has("following")) throw new RouterError("Following collection dispatcher already set.");
310
295
  const variables = this.router.add(path, "following");
311
- if (variables.size !== 1 || !(variables.has("identifier") || variables.has("handle"))) throw new RouterError("Path for following collection dispatcher must have one variable: {identifier}");
312
- if (variables.has("handle")) getLogger([
313
- "fedify",
314
- "federation",
315
- "collection"
316
- ]).warn("The {{handle}} variable in the following collection dispatcher path is deprecated. Use {{identifier}} instead.");
296
+ if (variables.size !== 1 || !variables.has("identifier")) throw new RouterError("Path for following collection dispatcher must have one variable: {identifier}");
317
297
  const callbacks = { dispatcher };
318
298
  this.followingCallbacks = callbacks;
319
299
  const setters = {
@@ -339,12 +319,7 @@ var FederationBuilderImpl = class {
339
319
  setFollowersDispatcher(path, dispatcher) {
340
320
  if (this.router.has("followers")) throw new RouterError("Followers collection dispatcher already set.");
341
321
  const variables = this.router.add(path, "followers");
342
- if (variables.size !== 1 || !(variables.has("identifier") || variables.has("handle"))) throw new RouterError("Path for followers collection dispatcher must have one variable: {identifier}");
343
- if (variables.has("handle")) getLogger([
344
- "fedify",
345
- "federation",
346
- "collection"
347
- ]).warn("The {{handle}} variable in the followers collection dispatcher path is deprecated. Use {{identifier}} instead.");
322
+ if (variables.size !== 1 || !variables.has("identifier")) throw new RouterError("Path for followers collection dispatcher must have one variable: {identifier}");
348
323
  const callbacks = { dispatcher };
349
324
  this.followersCallbacks = callbacks;
350
325
  const setters = {
@@ -370,12 +345,7 @@ var FederationBuilderImpl = class {
370
345
  setLikedDispatcher(path, dispatcher) {
371
346
  if (this.router.has("liked")) throw new RouterError("Liked collection dispatcher already set.");
372
347
  const variables = this.router.add(path, "liked");
373
- if (variables.size !== 1 || !(variables.has("identifier") || variables.has("handle"))) throw new RouterError("Path for liked collection dispatcher must have one variable: {identifier}");
374
- if (variables.has("handle")) getLogger([
375
- "fedify",
376
- "federation",
377
- "collection"
378
- ]).warn("The {{handle}} variable in the liked collection dispatcher path is deprecated. Use {{identifier}} instead.");
348
+ if (variables.size !== 1 || !variables.has("identifier")) throw new RouterError("Path for liked collection dispatcher must have one variable: {identifier}");
379
349
  const callbacks = { dispatcher };
380
350
  this.likedCallbacks = callbacks;
381
351
  const setters = {
@@ -401,12 +371,7 @@ var FederationBuilderImpl = class {
401
371
  setFeaturedDispatcher(path, dispatcher) {
402
372
  if (this.router.has("featured")) throw new RouterError("Featured collection dispatcher already set.");
403
373
  const variables = this.router.add(path, "featured");
404
- if (variables.size !== 1 || !(variables.has("identifier") || variables.has("handle"))) throw new RouterError("Path for featured collection dispatcher must have one variable: {identifier}");
405
- if (variables.has("handle")) getLogger([
406
- "fedify",
407
- "federation",
408
- "collection"
409
- ]).warn("The {{handle}} variable in the featured collection dispatcher path is deprecated. Use {{identifier}} instead.");
374
+ if (variables.size !== 1 || !variables.has("identifier")) throw new RouterError("Path for featured collection dispatcher must have one variable: {identifier}");
410
375
  const callbacks = { dispatcher };
411
376
  this.featuredCallbacks = callbacks;
412
377
  const setters = {
@@ -432,12 +397,7 @@ var FederationBuilderImpl = class {
432
397
  setFeaturedTagsDispatcher(path, dispatcher) {
433
398
  if (this.router.has("featuredTags")) throw new RouterError("Featured tags collection dispatcher already set.");
434
399
  const variables = this.router.add(path, "featuredTags");
435
- if (variables.size !== 1 || !(variables.has("identifier") || variables.has("handle"))) throw new RouterError("Path for featured tags collection dispatcher must have one variable: {identifier}");
436
- if (variables.has("handle")) getLogger([
437
- "fedify",
438
- "federation",
439
- "collection"
440
- ]).warn("The {{handle}} variable in the featured tags collection dispatcher path is deprecated. Use {{identifier}} instead.");
400
+ if (variables.size !== 1 || !variables.has("identifier")) throw new RouterError("Path for featured tags collection dispatcher must have one variable: {identifier}");
441
401
  const callbacks = { dispatcher };
442
402
  this.featuredTagsCallbacks = callbacks;
443
403
  const setters = {
@@ -466,13 +426,8 @@ var FederationBuilderImpl = class {
466
426
  if (this.inboxPath !== inboxPath) throw new RouterError("Inbox listener path must match inbox dispatcher path.");
467
427
  } else {
468
428
  const variables = this.router.add(inboxPath, "inbox");
469
- if (variables.size !== 1 || !(variables.has("identifier") || variables.has("handle"))) throw new RouterError("Path for inbox must have one variable: {identifier}");
429
+ if (variables.size !== 1 || !variables.has("identifier")) throw new RouterError("Path for inbox must have one variable: {identifier}");
470
430
  this.inboxPath = inboxPath;
471
- if (variables.has("handle")) getLogger([
472
- "fedify",
473
- "federation",
474
- "inbox"
475
- ]).warn("The {{handle}} variable in the inbox path is deprecated. Use {{identifier}} instead.");
476
431
  }
477
432
  if (sharedInboxPath != null) {
478
433
  const siVars = this.router.add(sharedInboxPath, "sharedInbox");
@@ -1,7 +1,7 @@
1
1
  import "../client-CwkOPN13.cjs";
2
2
  import "../http-CCEu-x1_.cjs";
3
3
  import "../owner-9yZ5Ibsb.cjs";
4
- import { ActivityTransformer } from "../context-Cf0-LmZC.cjs";
4
+ import { ActivityTransformer } from "../context-BdNW_8a3.cjs";
5
5
  import "../kv-g9jFc34-.cjs";
6
- import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-H3ScYaOb.cjs";
6
+ import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-5PNty1K9.cjs";
7
7
  export { ActivityTransformer, actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
@@ -3,7 +3,7 @@ import { URLPattern } from "urlpattern-polyfill";
3
3
  import "../client-a7NwzhA2.js";
4
4
  import "../http-CODSJcKx.js";
5
5
  import "../owner-DQYAbVmX.js";
6
- import { ActivityTransformer } from "../context-liIe6DFH.js";
6
+ import { ActivityTransformer } from "../context-C-GVKcJR.js";
7
7
  import "../kv-jg_8SMc1.js";
8
- import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-B9_l3te3.js";
8
+ import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-Da9fNDyC.js";
9
9
  export { ActivityTransformer, actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
@@ -8,25 +8,25 @@ 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-QzKcOQgP.js";
11
- import "../deno-Dssbv2qD.js";
12
- import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-D227KuaF.js";
11
+ import "../deno-CJgVX6Dr.js";
12
+ import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-BN-t5M_R.js";
13
13
  import "../client-Dg7OfUDA.js";
14
14
  import "../router-D9eI0s4b.js";
15
15
  import "../types-CPz01LGH.js";
16
- import "../key-DJI5G1Ub.js";
17
- import "../http-CfrdWdLH.js";
18
- import "../ld-Cu0jmueI.js";
19
- import "../owner-8nrupc6V.js";
20
- import "../proof-RhBPHpn0.js";
21
- import "../docloader-DLiT1bFg.js";
16
+ import "../key-BQD4Ef_6.js";
17
+ import "../http-CMTBVAxQ.js";
18
+ import "../ld-DNdCEe6l.js";
19
+ import "../owner-DbymvgVI.js";
20
+ import "../proof-DVBdddim.js";
21
+ import "../docloader-BMecQIi-.js";
22
22
  import "../kv-cache-B__dHl7g.js";
23
- import "../inbox-CW8E414g.js";
24
- import "../builder-DFgILDcG.js";
23
+ import "../inbox-BrQMunLn.js";
24
+ import "../builder-DIwRDV19.js";
25
25
  import "../collection-CcnIw1qY.js";
26
26
  import "../keycache-DRxpZ5r9.js";
27
27
  import "../negotiation-5NPJL6zp.js";
28
28
  import "../retry-D4GJ670a.js";
29
- import "../send-CnI-Brh9.js";
29
+ import "../send-CkvEc-Tx.js";
30
30
  import { Follow, Person } from "@fedify/vocab";
31
31
 
32
32
  //#region src/compat/transformers.test.ts
@@ -77,7 +77,10 @@ declare class SendActivityError extends Error {
77
77
  */
78
78
  readonly statusCode: number;
79
79
  /**
80
- * The response body from the inbox, if any.
80
+ * The response body from the inbox, if any. Note that this may be
81
+ * truncated to a maximum of 1 KiB to prevent excessive memory consumption
82
+ * when remote servers return large error pages (e.g., Cloudflare error pages).
83
+ * If truncated, the string will end with `"… (truncated)"`.
81
84
  */
82
85
  readonly responseBody: string;
83
86
  /**
@@ -233,14 +236,10 @@ type SharedInboxKeyDispatcher<TContextData> = (context: Context<TContextData>) =
233
236
  identifier: string;
234
237
  } | {
235
238
  username: string;
236
- } | {
237
- handle: string;
238
239
  } | null | Promise<SenderKeyPair | {
239
240
  identifier: string;
240
241
  } | {
241
242
  username: string;
242
- } | {
243
- handle: string;
244
243
  } | null>;
245
244
  /**
246
245
  * A callback that handles errors during outbox processing.
@@ -781,13 +780,6 @@ interface CreateExponentialBackoffPolicyOptions {
781
780
  declare function createExponentialBackoffPolicy(options?: CreateExponentialBackoffPolicyOptions): RetryPolicy;
782
781
  //#endregion
783
782
  //#region src/federation/middleware.d.ts
784
- /**
785
- * Options for {@link createFederation} function.
786
- * @template TContextData The type of the context data.
787
- * @since 0.10.0
788
- * @deprecated Use {@link FederationOptions} instead.
789
- */
790
- interface CreateFederationOptions<TContextData> extends FederationOptions<TContextData> {}
791
783
  /**
792
784
  * Configures the task queues for sending and receiving activities.
793
785
  * @since 1.3.0
@@ -842,7 +834,7 @@ interface FederationKvPrefixes {
842
834
  readonly httpMessageSignaturesSpec: KvKey;
843
835
  }
844
836
  /**
845
- * Options for {@link CreateFederationOptions.origin} when it is not a string.
837
+ * Options for {@link FederationOptions.origin} when it is not a string.
846
838
  * @since 1.5.0
847
839
  */
848
840
  interface FederationOrigin {
@@ -865,7 +857,7 @@ interface FederationOrigin {
865
857
  * @returns A new {@link Federation} instance.
866
858
  * @since 0.10.0
867
859
  */
868
- declare function createFederation<TContextData>(options: CreateFederationOptions<TContextData>): Federation<TContextData>;
860
+ declare function createFederation<TContextData>(options: FederationOptions<TContextData>): Federation<TContextData>;
869
861
  //#endregion
870
862
  //#region src/federation/federation.d.ts
871
863
  /**
@@ -930,7 +922,7 @@ interface Federatable<TContextData> {
930
922
  * @returns An object with methods to set other actor dispatcher callbacks.
931
923
  * @throws {RouterError} Thrown if the path pattern is invalid.
932
924
  */
933
- setActorDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: ActorDispatcher<TContextData>): ActorCallbackSetters<TContextData>;
925
+ setActorDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}`, dispatcher: ActorDispatcher<TContextData>): ActorCallbackSetters<TContextData>;
934
926
  /**
935
927
  * Registers an object dispatcher.
936
928
  *
@@ -1026,7 +1018,7 @@ interface Federatable<TContextData> {
1026
1018
  * @param dispatcher An inbox dispatcher callback to register.
1027
1019
  * @throws {@link RouterError} Thrown if the path pattern is invalid.
1028
1020
  */
1029
- setInboxDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Activity, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
1021
+ setInboxDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}`, dispatcher: CollectionDispatcher<Activity, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
1030
1022
  /**
1031
1023
  * Registers an outbox dispatcher.
1032
1024
  *
@@ -1050,7 +1042,7 @@ interface Federatable<TContextData> {
1050
1042
  * @param dispatcher An outbox dispatcher callback to register.
1051
1043
  * @throws {@link RouterError} Thrown if the path pattern is invalid.
1052
1044
  */
1053
- setOutboxDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Activity, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
1045
+ setOutboxDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}`, dispatcher: CollectionDispatcher<Activity, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
1054
1046
  /**
1055
1047
  * Registers a following collection dispatcher.
1056
1048
  * @param path The URI path pattern for the following collection. The syntax
@@ -1062,7 +1054,7 @@ interface Federatable<TContextData> {
1062
1054
  * callbacks.
1063
1055
  * @throws {RouterError} Thrown if the path pattern is invalid.
1064
1056
  */
1065
- setFollowingDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Actor | URL, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
1057
+ setFollowingDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}`, dispatcher: CollectionDispatcher<Actor | URL, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
1066
1058
  /**
1067
1059
  * Registers a followers collection dispatcher.
1068
1060
  * @param path The URI path pattern for the followers collection. The syntax
@@ -1074,7 +1066,7 @@ interface Federatable<TContextData> {
1074
1066
  * callbacks.
1075
1067
  * @throws {@link RouterError} Thrown if the path pattern is invalid.
1076
1068
  */
1077
- setFollowersDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Recipient, Context<TContextData>, TContextData, URL>): CollectionCallbackSetters<Context<TContextData>, TContextData, URL>;
1069
+ setFollowersDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}`, dispatcher: CollectionDispatcher<Recipient, Context<TContextData>, TContextData, URL>): CollectionCallbackSetters<Context<TContextData>, TContextData, URL>;
1078
1070
  /**
1079
1071
  * Registers a liked collection dispatcher.
1080
1072
  * @param path The URI path pattern for the liked collection. The syntax
@@ -1086,7 +1078,7 @@ interface Federatable<TContextData> {
1086
1078
  * callbacks.
1087
1079
  * @throws {@link RouterError} Thrown if the path pattern is invalid.
1088
1080
  */
1089
- setLikedDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Object$1 | URL, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
1081
+ setLikedDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}`, dispatcher: CollectionDispatcher<Object$1 | URL, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
1090
1082
  /**
1091
1083
  * Registers a featured collection dispatcher.
1092
1084
  * @param path The URI path pattern for the featured collection. The syntax
@@ -1098,7 +1090,7 @@ interface Federatable<TContextData> {
1098
1090
  * callbacks.
1099
1091
  * @throws {@link RouterError} Thrown if the path pattern is invalid.
1100
1092
  */
1101
- setFeaturedDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Object$1, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
1093
+ setFeaturedDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}`, dispatcher: CollectionDispatcher<Object$1, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
1102
1094
  /**
1103
1095
  * Registers a featured tags collection dispatcher.
1104
1096
  * @param path The URI path pattern for the featured tags collection.
@@ -1110,7 +1102,7 @@ interface Federatable<TContextData> {
1110
1102
  * callbacks.
1111
1103
  * @throws {@link RouterError} Thrown if the path pattern is invalid.
1112
1104
  */
1113
- setFeaturedTagsDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Hashtag, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
1105
+ setFeaturedTagsDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}`, dispatcher: CollectionDispatcher<Hashtag, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
1114
1106
  /**
1115
1107
  * Assigns the URL path for the inbox and starts setting inbox listeners.
1116
1108
  *
@@ -1140,7 +1132,7 @@ interface Federatable<TContextData> {
1140
1132
  * @returns An object to register inbox listeners.
1141
1133
  * @throws {RouterError} Thrown if the path pattern is invalid.
1142
1134
  */
1143
- setInboxListeners(inboxPath: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, sharedInboxPath?: string): InboxListenerSetters<TContextData>;
1135
+ setInboxListeners(inboxPath: `${string}${Rfc6570Expression<"identifier">}${string}`, sharedInboxPath?: string): InboxListenerSetters<TContextData>;
1144
1136
  /**
1145
1137
  * Registers a collection of objects dispatcher.
1146
1138
  *
@@ -1391,9 +1383,9 @@ interface FederationOptions<TContextData> {
1391
1383
  /**
1392
1384
  * Whether to allow fetching private network addresses in the document loader.
1393
1385
  *
1394
- * If turned on, {@link CreateFederationOptions.documentLoader},
1395
- * {@link CreateFederationOptions.contextLoader}, and
1396
- * {@link CreateFederationOptions.authenticatedDocumentLoaderFactory}
1386
+ * If turned on, {@link FederationOptions.documentLoader},
1387
+ * {@link FederationOptions.contextLoader}, and
1388
+ * {@link FederationOptions.authenticatedDocumentLoaderFactory}
1397
1389
  * cannot be configured.
1398
1390
  *
1399
1391
  * Mostly useful for testing purposes. *Do not use in production.*
@@ -1980,8 +1972,6 @@ interface Context<TContextData> {
1980
1972
  identifier: string;
1981
1973
  } | {
1982
1974
  username: string;
1983
- } | {
1984
- handle: string;
1985
1975
  }): Promise<DocumentLoader>;
1986
1976
  /**
1987
1977
  * Gets an authenticated {@link DocumentLoader} for the given identity.
@@ -2112,8 +2102,6 @@ interface Context<TContextData> {
2112
2102
  identifier: string;
2113
2103
  } | {
2114
2104
  username: string;
2115
- } | {
2116
- handle: string;
2117
2105
  }, recipients: Recipient | Recipient[], activity: Activity, options?: SendActivityOptions): Promise<void>;
2118
2106
  /**
2119
2107
  * Sends an activity to the inboxes of the sender's followers.
@@ -2128,8 +2116,6 @@ interface Context<TContextData> {
2128
2116
  identifier: string;
2129
2117
  } | {
2130
2118
  username: string;
2131
- } | {
2132
- handle: string;
2133
2119
  }, recipients: "followers", activity: Activity, options?: SendActivityOptionsForCollection): Promise<void>;
2134
2120
  /**
2135
2121
  * Manually routes an activity to the appropriate inbox listener.
@@ -2307,8 +2293,6 @@ interface InboxContext<TContextData> extends Context<TContextData> {
2307
2293
  identifier: string;
2308
2294
  } | {
2309
2295
  username: string;
2310
- } | {
2311
- handle: string;
2312
2296
  }, recipients: Recipient | Recipient[], options?: ForwardActivityOptions): Promise<void>;
2313
2297
  /**
2314
2298
  * Forwards a received activity to the recipients' inboxes. The forwarded
@@ -2326,8 +2310,6 @@ interface InboxContext<TContextData> extends Context<TContextData> {
2326
2310
  identifier: string;
2327
2311
  } | {
2328
2312
  username: string;
2329
- } | {
2330
- handle: string;
2331
2313
  }, recipients: "followers", options?: ForwardActivityOptions): Promise<void>;
2332
2314
  }
2333
2315
  /**
@@ -2340,7 +2322,6 @@ type ParseUriResult =
2340
2322
  {
2341
2323
  readonly type: "actor";
2342
2324
  readonly identifier: string;
2343
- readonly handle: string;
2344
2325
  }
2345
2326
  /**
2346
2327
  * The case of an object URI.
@@ -2355,35 +2336,30 @@ type ParseUriResult =
2355
2336
  */ | {
2356
2337
  readonly type: "inbox";
2357
2338
  readonly identifier: undefined;
2358
- readonly handle: undefined;
2359
2339
  }
2360
2340
  /**
2361
2341
  * The case of an personal inbox URI.
2362
2342
  */ | {
2363
2343
  readonly type: "inbox";
2364
2344
  readonly identifier: string;
2365
- readonly handle: string;
2366
2345
  }
2367
2346
  /**
2368
2347
  * The case of an outbox collection URI.
2369
2348
  */ | {
2370
2349
  readonly type: "outbox";
2371
2350
  readonly identifier: string;
2372
- readonly handle: string;
2373
2351
  }
2374
2352
  /**
2375
2353
  * The case of a following collection URI.
2376
2354
  */ | {
2377
2355
  readonly type: "following";
2378
2356
  readonly identifier: string;
2379
- readonly handle: string;
2380
2357
  }
2381
2358
  /**
2382
2359
  * The case of a followers collection URI.
2383
2360
  */ | {
2384
2361
  readonly type: "followers";
2385
2362
  readonly identifier: string;
2386
- readonly handle: string;
2387
2363
  }
2388
2364
  /**
2389
2365
  * The case of a liked collection URI.
@@ -2391,7 +2367,6 @@ type ParseUriResult =
2391
2367
  */ | {
2392
2368
  readonly type: "liked";
2393
2369
  readonly identifier: string;
2394
- readonly handle: string;
2395
2370
  }
2396
2371
  /**
2397
2372
  * The case of a featured collection URI.
@@ -2399,7 +2374,6 @@ type ParseUriResult =
2399
2374
  */ | {
2400
2375
  readonly type: "featured";
2401
2376
  readonly identifier: string;
2402
- readonly handle: string;
2403
2377
  }
2404
2378
  /**
2405
2379
  * The case of a featured tags collection URI.
@@ -2407,7 +2381,6 @@ type ParseUriResult =
2407
2381
  */ | {
2408
2382
  readonly type: "featuredTags";
2409
2383
  readonly identifier: string;
2410
- readonly handle: string;
2411
2384
  }
2412
2385
  /**
2413
2386
  * The case of a custom collection URI.
@@ -2578,4 +2551,4 @@ interface ActorKeyPair extends CryptoKeyPair {
2578
2551
  readonly multikey: Multikey;
2579
2552
  }
2580
2553
  //#endregion
2581
- 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, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable };
2554
+ export { ActivityTransformer, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, 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, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable };