@fedify/fedify 2.4.0-dev.2093 → 2.4.0-dev.2103

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 (84) hide show
  1. package/dist/{builder-Ld4Y9ymR.mjs → builder-CHht75pX.mjs} +2 -2
  2. package/dist/compat/mod.d.cts +1 -1
  3. package/dist/compat/mod.d.ts +1 -1
  4. package/dist/compat/transformers.test.mjs +1 -1
  5. package/dist/{compound-proof-CTx_lewQ.mjs → compound-proof-DKKH_Nr1.mjs} +2 -2
  6. package/dist/{context-BSywYspi.d.ts → context-CfJE_oQu.d.ts} +78 -13
  7. package/dist/{context-DlZhxdFT.mjs → context-CoNRxGYp.mjs} +2 -1
  8. package/dist/{context-CZjZYXFC.d.cts → context-mDTxTw-S.d.cts} +78 -13
  9. package/dist/{deno-8t8k_6Yv.mjs → deno-CkjiYK_Z.mjs} +1 -1
  10. package/dist/{docloader-DJKcsAiF.mjs → docloader-C1hAJnWc.mjs} +2 -2
  11. package/dist/federation/builder.test.mjs +1 -1
  12. package/dist/federation/compound-fanout.test.mjs +3 -3
  13. package/dist/federation/handler-compound-proof.test.mjs +4 -4
  14. package/dist/federation/handler.test.mjs +6 -6
  15. package/dist/federation/hashlink-media.test.mjs +2 -2
  16. package/dist/federation/idempotency.test.mjs +2 -2
  17. package/dist/federation/metrics.test.mjs +1 -1
  18. package/dist/federation/middleware.test.mjs +8 -8
  19. package/dist/federation/mod.cjs +1 -1
  20. package/dist/federation/mod.d.cts +2 -2
  21. package/dist/federation/mod.d.ts +2 -2
  22. package/dist/federation/mod.js +1 -1
  23. package/dist/federation/outgoing-proof.test.mjs +5 -5
  24. package/dist/federation/portable-actor.test.d.mts +2 -0
  25. package/dist/federation/portable-actor.test.mjs +446 -0
  26. package/dist/federation/portable-gateway-keys.test.mjs +4 -4
  27. package/dist/federation/portable-inbox.test.mjs +396 -10
  28. package/dist/federation/portable.test.mjs +3 -3
  29. package/dist/federation/send.test.mjs +3 -3
  30. package/dist/federation/tasks/enqueue.test.mjs +2 -2
  31. package/dist/federation/tasks/tasks.test.mjs +3 -3
  32. package/dist/federation/temporal.test.mjs +1 -1
  33. package/dist/federation/webfinger.test.mjs +2 -2
  34. package/dist/{federation-aSHO04ob.cjs → federation-C1dL6SiT.cjs} +1267 -1086
  35. package/dist/{http-B2ftY0Ha.mjs → http-BU-8fUrz.mjs} +82 -7
  36. package/dist/{http-DSaSAN7X.cjs → http-Cala2Grs.cjs} +89 -2
  37. package/dist/{http-DyT7DP1Y.js → http-tTlTeFa0.js} +78 -3
  38. package/dist/{key-Dwm4VswT.mjs → key-I8gLBkcf.mjs} +2 -2
  39. package/dist/{kv-cache-BSJAlP4C.cjs → kv-cache-Bl5EBFrU.cjs} +1 -1
  40. package/dist/{kv-cache-DmroAz3M.js → kv-cache-CxQu_cd4.js} +1 -1
  41. package/dist/{kv-cache-D0yYukqk.mjs → kv-cache-DJFoGRWQ.mjs} +1 -1
  42. package/dist/{ld-BYZOoDzZ.mjs → ld-wiJbqJHa.mjs} +3 -3
  43. package/dist/{metrics-B7YwKTFr.mjs → metrics-BCAa5-kE.mjs} +1 -1
  44. package/dist/{middleware-BNeqKSsL.mjs → middleware-6p2dYEVA.mjs} +1 -1
  45. package/dist/{middleware-Blq0882d.js → middleware-B6IVTVL0.js} +1362 -1181
  46. package/dist/{middleware-E_0IH72m.mjs → middleware-FnITXhtz.mjs} +549 -368
  47. package/dist/{mod-JzkaEXsi.d.cts → mod-B3OzOobN.d.cts} +1 -1
  48. package/dist/{mod-B2h2KY0q.d.ts → mod-BYvPz_T0.d.ts} +1 -1
  49. package/dist/mod.cjs +5 -5
  50. package/dist/mod.d.cts +2 -2
  51. package/dist/mod.d.ts +2 -2
  52. package/dist/mod.js +5 -5
  53. package/dist/nodeinfo/handler.test.mjs +2 -2
  54. package/dist/{owner-Cgx2Dc7I.mjs → owner-BJp47LxN.mjs} +3 -3
  55. package/dist/{owner-szIZl4qI.cjs → owner-DCt8W_Cv.cjs} +1 -1
  56. package/dist/{owner-DAGSC5gX.js → owner-j5yrbXS1.js} +1 -1
  57. package/dist/{portable-key-Cn1WJSN1.mjs → portable-key-B5oKE_wZ.mjs} +1 -1
  58. package/dist/{proof-DVXC6nYz.mjs → proof-BE4T5zF6.mjs} +4 -4
  59. package/dist/{send-D-hOvYKy.mjs → send-BFITuKHw.mjs} +3 -3
  60. package/dist/sig/compound-proof-discovery.test.mjs +1 -1
  61. package/dist/sig/compound-proof-producer.test.mjs +1 -1
  62. package/dist/sig/compound-proof-verification.test.mjs +2 -2
  63. package/dist/sig/compound-proof.test.mjs +2 -2
  64. package/dist/sig/http.test.mjs +72 -2
  65. package/dist/sig/key.test.mjs +1 -1
  66. package/dist/sig/ld.test.mjs +2 -2
  67. package/dist/sig/mod.cjs +3 -3
  68. package/dist/sig/mod.js +3 -3
  69. package/dist/sig/owner.test.mjs +1 -1
  70. package/dist/sig/portable-collection.test.mjs +2 -2
  71. package/dist/sig/portable-key.test.mjs +3 -3
  72. package/dist/sig/proof.test.mjs +3 -3
  73. package/dist/{sig-B5Ell7pO.js → sig-CJHdGk9w.js} +2 -2
  74. package/dist/{sig-CXOKN4Br.cjs → sig-CRTRoouH.cjs} +2 -2
  75. package/dist/{temporal-CqpKGEPk.mjs → temporal-CyDDbE4i.mjs} +1 -1
  76. package/dist/testing/kv.test.mjs +1 -1
  77. package/dist/testing/mod.d.mts +78 -13
  78. package/dist/testing/mod.mjs +2 -2
  79. package/dist/{testing-CO_cEvQc.mjs → testing-BWq1dCzx.mjs} +1 -1
  80. package/dist/utils/docloader.test.mjs +2 -2
  81. package/dist/utils/kv-cache.test.mjs +1 -1
  82. package/dist/utils/mod.cjs +1 -1
  83. package/dist/utils/mod.js +1 -1
  84. package/package.json +7 -7
@@ -2035,8 +2035,11 @@ interface PortableInboxForwardingOptions {
2035
2035
  /**
2036
2036
  * How long a delivery waits for forwarding requests made immediately, i.e.,
2037
2037
  * when no outbox queue is configured, before Fedify responds to it.
2038
- * Requests still running afterwards continue in the background. It does
2039
- * not apply when forwarding is queued. It cannot have calendar units,
2038
+ * Requests still running afterwards continue in the background. It also
2039
+ * bounds verifying the HTTP Signature that identifies the gateway which
2040
+ * forwarded the delivery, with or without an outbox queue; if the
2041
+ * verification does not finish in time, the activity is forwarded to that
2042
+ * gateway as well. It cannot have calendar units,
2040
2043
  * i.e., weeks, months, or years, and cannot be longer than
2041
2044
  * 2,147,483,647 milliseconds (about 24.8 days), the longest delay timers
2042
2045
  * support.
@@ -2890,6 +2893,37 @@ interface Context<TContextData> {
2890
2893
  * @throws {RouterError} If no actor dispatcher is available.
2891
2894
  */
2892
2895
  getActorUri(identifier: string): URL;
2896
+ /**
2897
+ * Builds the [FEP-ef61] portable ID of an actor with the given identifier
2898
+ * under the given DID authority.
2899
+ *
2900
+ * The path is the same as the one {@link Context.getActorUri} builds, but
2901
+ * the result is an `ap+ef61:` URI whose authority is the DID, e.g.,
2902
+ * `ap+ef61://did:key:z6Mk.../users/alice`. Such an actor can be served
2903
+ * through the FEP-ef61 gateway endpoint,
2904
+ * `/.well-known/apgateway/did:key:z6Mk.../users/alice`, by the same actor
2905
+ * dispatcher.
2906
+ *
2907
+ * The returned `URL` keeps the DID authority percent-encoded, because
2908
+ * the `URL` class cannot represent the canonical form. Use `formatIri()`
2909
+ * from `@fedify/vocab-runtime` to get the canonical string, e.g.,
2910
+ * `ap+ef61://did:key:z6Mk.../users/alice`.
2911
+ *
2912
+ * [FEP-ef61]: https://w3id.org/fep/ef61
2913
+ *
2914
+ * @param identifier The actor's identifier.
2915
+ * @param authority The DID that controls the actor, e.g.,
2916
+ * `did:key:z6Mk...`. It must be a bare DID, without
2917
+ * a path, query, or fragment. A `did:key` DID must be
2918
+ * encoded in base58-btc, as FEP-ef61 requires; see
2919
+ * `exportDidKey()` from `@fedify/vocab-runtime`.
2920
+ * @returns The actor's portable ID.
2921
+ * @throws {RouterError} If no actor dispatcher is available.
2922
+ * @throws {TypeError} If the authority is not a DID, or it is a `did:key`
2923
+ * DID that is not encoded in base58-btc.
2924
+ * @since 2.4.0
2925
+ */
2926
+ getPortableActorUri(identifier: string, authority: string): URL;
2893
2927
  /**
2894
2928
  * Builds the URI of an object with the given class and values.
2895
2929
  * @param cls The class of the object.
@@ -2925,7 +2959,9 @@ interface Context<TContextData> {
2925
2959
  * a path, query, or fragment.
2926
2960
  * @returns The object's portable ID.
2927
2961
  * @throws {RouterError} If no object dispatcher is available for the class.
2928
- * @throws {TypeError} If values are invalid or the authority is not a DID.
2962
+ * @throws {TypeError} If values are invalid, or the authority is not a DID
2963
+ * or is a `did:key` DID that is not encoded in
2964
+ * base58-btc.
2929
2965
  * @since 2.4.0
2930
2966
  */
2931
2967
  getPortableObjectUri<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>, authority: string): URL;
@@ -2954,7 +2990,8 @@ interface Context<TContextData> {
2954
2990
  * a path, query, or fragment.
2955
2991
  * @returns The inbox's portable ID.
2956
2992
  * @throws {RouterError} If no inbox path is registered.
2957
- * @throws {TypeError} If the authority is not a DID.
2993
+ * @throws {TypeError} If the authority is not a DID, or it is a `did:key`
2994
+ * DID that is not encoded in base58-btc.
2958
2995
  * @since 2.4.0
2959
2996
  */
2960
2997
  getPortableInboxUri(identifier: string, authority: string): URL;
@@ -3335,12 +3372,13 @@ interface RequestContext<TContextData> extends Context<TContextData> {
3335
3372
  /**
3336
3373
  * Information about the [FEP-ef61] portable object requested through
3337
3374
  * the gateway endpoint, e.g.,
3338
- * `GET /.well-known/apgateway/did:key:z6Mk.../notes/123`. It is
3339
- * `undefined` for ordinary requests.
3375
+ * `GET /.well-known/apgateway/did:key:z6Mk.../notes/123`, which is served
3376
+ * by an object dispatcher or the actor dispatcher. It is `undefined` for
3377
+ * ordinary requests.
3340
3378
  *
3341
3379
  * The authority comes from the request path, so it is not evidence that
3342
- * this server hosts objects for the DID. An object dispatcher has to check
3343
- * that by itself.
3380
+ * this server hosts objects for the DID. An object dispatcher or the actor
3381
+ * dispatcher has to check that by itself.
3344
3382
  *
3345
3383
  * It describes the incoming request, so it stays the same in contexts
3346
3384
  * derived from this one, e.g., by {@link RequestContext.getObject}.
@@ -3349,6 +3387,31 @@ interface RequestContext<TContextData> extends Context<TContextData> {
3349
3387
  * @since 2.4.0
3350
3388
  */
3351
3389
  readonly portableRequest?: PortableRequest;
3390
+ /**
3391
+ * Builds the [FEP-ef61] portable ID of an actor with the given identifier.
3392
+ * It works the same as {@link Context.getPortableActorUri}, except that
3393
+ * the authority can be omitted while handling a portable gateway request.
3394
+ * In that case, the DID in {@link RequestContext.portableRequest} is used.
3395
+ *
3396
+ * The DID in the request comes from the request path, so the default is
3397
+ * only a convenience for building IDs; it is not evidence that this server
3398
+ * hosts the actor for the DID.
3399
+ *
3400
+ * [FEP-ef61]: https://w3id.org/fep/ef61
3401
+ *
3402
+ * @param identifier The actor's identifier.
3403
+ * @param authority The DID that controls the actor, e.g.,
3404
+ * `did:key:z6Mk...`. It must be a bare DID, without
3405
+ * a path, query, or fragment. Defaults to the DID of
3406
+ * the requested portable object.
3407
+ * @returns The actor's portable ID.
3408
+ * @throws {RouterError} If no actor dispatcher is available.
3409
+ * @throws {TypeError} If the authority is not a DID, it is a `did:key` DID
3410
+ * that is not encoded in base58-btc, or the authority
3411
+ * is omitted outside a portable gateway request.
3412
+ * @since 2.4.0
3413
+ */
3414
+ getPortableActorUri(identifier: string, authority?: string): URL;
3352
3415
  /**
3353
3416
  * Builds the [FEP-ef61] portable ID of an object with the given class and
3354
3417
  * values. It works the same as {@link Context.getPortableObjectUri}, except
@@ -3366,9 +3429,10 @@ interface RequestContext<TContextData> extends Context<TContextData> {
3366
3429
  * the requested portable object.
3367
3430
  * @returns The object's portable ID.
3368
3431
  * @throws {RouterError} If no object dispatcher is available for the class.
3369
- * @throws {TypeError} If values are invalid, the authority is not a DID, or
3370
- * the authority is omitted outside a portable gateway
3371
- * request.
3432
+ * @throws {TypeError} If values are invalid, the authority is not a DID,
3433
+ * it is a `did:key` DID that is not encoded in
3434
+ * base58-btc, or the authority is omitted outside
3435
+ * a portable gateway request.
3372
3436
  * @since 2.4.0
3373
3437
  */
3374
3438
  getPortableObjectUri<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>, authority?: string): URL;
@@ -3390,8 +3454,9 @@ interface RequestContext<TContextData> extends Context<TContextData> {
3390
3454
  * the requested portable object, if any.
3391
3455
  * @returns The inbox's portable ID.
3392
3456
  * @throws {RouterError} If no inbox path is registered.
3393
- * @throws {TypeError} If the authority is not a DID, or the authority is
3394
- * omitted outside a portable gateway request.
3457
+ * @throws {TypeError} If the authority is not a DID, it is a `did:key` DID
3458
+ * that is not encoded in base58-btc, or the authority
3459
+ * is omitted outside a portable gateway request.
3395
3460
  * @since 2.4.0
3396
3461
  */
3397
3462
  getPortableInboxUri(identifier: string, authority?: string): URL;
@@ -2,8 +2,8 @@ import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { r as testDefinitions } from "../dist-BQvArojP.mjs";
5
- import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-DlZhxdFT.mjs";
5
+ import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-CoNRxGYp.mjs";
6
6
  import { t as ManualClockKvStore } from "../kv-DBRWVx3Q.mjs";
7
7
  import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, r as envelopeSchema, t as MockQueue } from "../tasks-dbCShlCb.mjs";
8
- import "../testing-CO_cEvQc.mjs";
8
+ import "../testing-BWq1dCzx.mjs";
9
9
  export { ManualClockKvStore, MockQueue, baseOptions, createInboxContext, createOutboxContext, createRequestContext, envelopeSchema, makeSchema, numberSchema, stringSchema, testDefinitions };
@@ -2,7 +2,7 @@ import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import "./dist-BQvArojP.mjs";
5
- import "./context-DlZhxdFT.mjs";
5
+ import "./context-CoNRxGYp.mjs";
6
6
  import "./kv-DBRWVx3Q.mjs";
7
7
  import "./tasks-dbCShlCb.mjs";
8
8
  export {};
@@ -5,9 +5,9 @@ import { t as esm_default } from "../esm-BHXXx4Wx.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
6
6
  import "../std__assert-DvMDRPes.mjs";
7
7
  import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
8
- import { l as verifyRequest } from "../http-B2ftY0Ha.mjs";
8
+ import { d as verifyRequest } from "../http-BU-8fUrz.mjs";
9
9
  import { i as rsaPrivateKey2 } from "../keys-DIJNHW-Y.mjs";
10
- import { t as getAuthenticatedDocumentLoader } from "../docloader-DJKcsAiF.mjs";
10
+ import { t as getAuthenticatedDocumentLoader } from "../docloader-C1hAJnWc.mjs";
11
11
  import { mockDocumentLoader, test } from "@fedify/fixture";
12
12
  import { FetchError, UrlError } from "@fedify/vocab-runtime";
13
13
  //#region src/utils/docloader.test.ts
@@ -1,7 +1,7 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as kvCache, t as MockKvStore } from "../kv-cache-D0yYukqk.mjs";
4
+ import { n as kvCache, t as MockKvStore } from "../kv-cache-DJFoGRWQ.mjs";
5
5
  import { deepStrictEqual, throws } from "node:assert";
6
6
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
7
7
  import { preloadedContexts } from "@fedify/vocab-runtime";
@@ -1,5 +1,5 @@
1
1
  const { URLPattern } = require("urlpattern-polyfill");
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const require_kv_cache = require("../kv-cache-BSJAlP4C.cjs");
3
+ const require_kv_cache = require("../kv-cache-Bl5EBFrU.cjs");
4
4
  exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
5
5
  exports.kvCache = require_kv_cache.kvCache;
package/dist/utils/mod.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-DmroAz3M.js";
3
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-CxQu_cd4.js";
4
4
  export { getAuthenticatedDocumentLoader, kvCache };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "2.4.0-dev.2093+e9706a54",
3
+ "version": "2.4.0-dev.2103+3be829c0",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -151,10 +151,10 @@
151
151
  "structured-field-values": "^2.0.4",
152
152
  "temporal-polyfill": "^1.0.1",
153
153
  "urlpattern-polyfill": "^10.1.0",
154
- "@fedify/uri-template": "2.4.0-dev.2093+e9706a54",
155
- "@fedify/vocab": "2.4.0-dev.2093+e9706a54",
156
- "@fedify/webfinger": "2.4.0-dev.2093+e9706a54",
157
- "@fedify/vocab-runtime": "2.4.0-dev.2093+e9706a54"
154
+ "@fedify/uri-template": "2.4.0-dev.2103+3be829c0",
155
+ "@fedify/vocab-runtime": "2.4.0-dev.2103+3be829c0",
156
+ "@fedify/webfinger": "2.4.0-dev.2103+3be829c0",
157
+ "@fedify/vocab": "2.4.0-dev.2103+3be829c0"
158
158
  },
159
159
  "devDependencies": {
160
160
  "@std/assert": "npm:@jsr/std__assert@^0.226.0",
@@ -166,8 +166,8 @@
166
166
  "tsx": "^4.21.0",
167
167
  "typescript": "^6.0.0",
168
168
  "wrangler": "^4.17.0",
169
- "@fedify/fixture": "2.0.0",
170
- "@fedify/vocab-tools": "^2.4.0-dev.2093+e9706a54"
169
+ "@fedify/vocab-tools": "^2.4.0-dev.2103+3be829c0",
170
+ "@fedify/fixture": "2.0.0"
171
171
  },
172
172
  "scripts": {
173
173
  "build:self": "tsdown",