@fedify/fedify 2.4.0-dev.2099 → 2.4.0-dev.2108
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.
- package/dist/{builder-Bno54o_-.mjs → builder-BRlYEsrV.mjs} +28 -4
- package/dist/compat/mod.d.cts +1 -1
- package/dist/compat/mod.d.ts +1 -1
- package/dist/compat/transformers.test.mjs +1 -1
- package/dist/{compound-proof-X3SxXVbc.mjs → compound-proof-CHGINiJg.mjs} +2 -2
- package/dist/{context-MORIQJIh.d.ts → context-B4F4kGJq.d.ts} +165 -21
- package/dist/{context-DlZhxdFT.mjs → context-CoNRxGYp.mjs} +2 -1
- package/dist/{context-C43spTGI.d.cts → context-Cqx9M_zO.d.cts} +165 -21
- package/dist/{deno-dxdvl2XZ.mjs → deno-CC4RKEEp.mjs} +1 -1
- package/dist/{docloader-eBxQDsk9.mjs → docloader-D3_m98fe.mjs} +2 -2
- package/dist/federation/builder.test.mjs +1 -1
- package/dist/federation/compound-fanout.test.mjs +3 -3
- package/dist/federation/handler-compound-proof.test.mjs +4 -4
- package/dist/federation/handler.test.mjs +119 -6
- package/dist/federation/hashlink-media.test.mjs +2 -2
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/metrics.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +185 -8
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.d.cts +3 -3
- package/dist/federation/mod.d.ts +3 -3
- package/dist/federation/mod.js +1 -1
- package/dist/federation/outgoing-proof.test.mjs +5 -5
- package/dist/federation/portable-actor.test.d.mts +2 -0
- package/dist/federation/portable-actor.test.mjs +446 -0
- package/dist/federation/portable-gateway-keys.test.mjs +4 -4
- package/dist/federation/portable-inbox.test.mjs +25 -4
- package/dist/federation/portable.test.mjs +31 -4
- package/dist/federation/send.test.mjs +3 -3
- package/dist/federation/tasks/enqueue.test.mjs +2 -2
- package/dist/federation/tasks/tasks.test.mjs +3 -3
- package/dist/federation/temporal.test.mjs +1 -1
- package/dist/federation/webfinger.test.mjs +2 -2
- package/dist/{federation-C4Ef3JKa.cjs → federation-dqo6ZzgT.cjs} +115 -23
- package/dist/{http-C8cZTE3Y.cjs → http-B7wEqv49.cjs} +1 -1
- package/dist/{http-DsgawTd8.mjs → http-CHEYA5fH.mjs} +4 -4
- package/dist/{http-D-rbr_Sy.js → http-CaUBCHYJ.js} +1 -1
- package/dist/{key-DYfmjnmp.mjs → key-B8u1vdvF.mjs} +2 -2
- package/dist/{kv-cache-Dvd-Q-E2.cjs → kv-cache-0pYMPrkL.cjs} +1 -1
- package/dist/{kv-cache-EvOgrFsS.mjs → kv-cache-CTdvf_Iq.mjs} +1 -1
- package/dist/{kv-cache-DIxwMeNi.js → kv-cache-ibncHN1D.js} +1 -1
- package/dist/{ld-B00wWHzc.mjs → ld-BTMJHEGV.mjs} +3 -3
- package/dist/{metrics-BP3vdBpb.mjs → metrics-CF1TEvdS.mjs} +1 -1
- package/dist/{middleware-Br1_d-Ga.mjs → middleware-B-rZ7oE-.mjs} +91 -23
- package/dist/{middleware-CeBVBa61.mjs → middleware-DCMTJT3_.mjs} +1 -1
- package/dist/{middleware-CcXMe400.js → middleware-Dl-Y_ZlC.js} +107 -15
- package/dist/{mod-BL5BQHCq.d.ts → mod-4s_XgF17.d.ts} +1 -1
- package/dist/{mod-DMI4DbOo.d.cts → mod-BuFmStNT.d.cts} +1 -1
- package/dist/mod.cjs +5 -5
- package/dist/mod.d.cts +4 -4
- package/dist/mod.d.ts +4 -4
- package/dist/mod.js +5 -5
- package/dist/nodeinfo/handler.test.mjs +2 -2
- package/dist/{owner-DSzH7wro.cjs → owner-CGnHPl4k.cjs} +1 -1
- package/dist/{owner-BJPDRDRq.mjs → owner-CY--JSqO.mjs} +3 -3
- package/dist/{owner-U12fDpQW.js → owner-M8dOKEl6.js} +1 -1
- package/dist/{portable-key-D0mWbV9G.mjs → portable-key-C0-ghkgM.mjs} +1 -1
- package/dist/{proof-ChjBwnep.mjs → proof-DDw0i9b1.mjs} +4 -4
- package/dist/{send-yFX0E-ye.mjs → send-CU3sHGPt.mjs} +3 -3
- package/dist/sig/compound-proof-discovery.test.mjs +1 -1
- package/dist/sig/compound-proof-producer.test.mjs +1 -1
- package/dist/sig/compound-proof-verification.test.mjs +2 -2
- package/dist/sig/compound-proof.test.mjs +2 -2
- package/dist/sig/http.test.mjs +2 -2
- package/dist/sig/key.test.mjs +1 -1
- package/dist/sig/ld.test.mjs +2 -2
- package/dist/sig/mod.cjs +3 -3
- package/dist/sig/mod.js +3 -3
- package/dist/sig/owner.test.mjs +1 -1
- package/dist/sig/portable-collection.test.mjs +2 -2
- package/dist/sig/portable-key.test.mjs +3 -3
- package/dist/sig/proof.test.mjs +3 -3
- package/dist/{sig-B689Nj7y.cjs → sig-C2CORtvg.cjs} +2 -2
- package/dist/{sig-C85KqAcx.js → sig-fycq7sOr.js} +2 -2
- package/dist/{temporal-Dl9x-Qw4.mjs → temporal-NHiSpGcW.mjs} +1 -1
- package/dist/testing/kv.test.mjs +1 -1
- package/dist/testing/mod.d.mts +164 -20
- package/dist/testing/mod.mjs +2 -2
- package/dist/{testing-CO_cEvQc.mjs → testing-BWq1dCzx.mjs} +1 -1
- package/dist/utils/docloader.test.mjs +2 -2
- package/dist/utils/kv-cache.test.mjs +1 -1
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +6 -6
|
@@ -180,14 +180,18 @@ type ActorAliasMapper<TContextData> = (context: RequestContext<TContextData>, re
|
|
|
180
180
|
username: string;
|
|
181
181
|
} | null>;
|
|
182
182
|
/**
|
|
183
|
-
* A callback that dispatches an object.
|
|
183
|
+
* A callback that dispatches an object or a {@link Tombstone}.
|
|
184
|
+
*
|
|
185
|
+
* Return a {@link Tombstone} if the object has been deleted; Fedify then
|
|
186
|
+
* responds with `410 Gone` and the serialized tombstone. Return `null` if
|
|
187
|
+
* the object is not found.
|
|
184
188
|
*
|
|
185
189
|
* @template TContextData The context data to pass to the {@link Context}.
|
|
186
190
|
* @template TObject The type of object to dispatch.
|
|
187
191
|
* @template TParam The parameter names of the requested URL.
|
|
188
192
|
* @since 0.7.0
|
|
189
193
|
*/
|
|
190
|
-
type ObjectDispatcher<TContextData, TObject extends Object$1, TParam extends string> = (context: RequestContext<TContextData>, values: Record<TParam, string>) => TObject | null | Promise<TObject | null>;
|
|
194
|
+
type ObjectDispatcher<TContextData, TObject extends Object$1, TParam extends string> = (context: RequestContext<TContextData>, values: Record<TParam, string>) => TObject | Tombstone | null | Promise<TObject | Tombstone | null>;
|
|
191
195
|
/**
|
|
192
196
|
* A callback that dispatches a collection.
|
|
193
197
|
*
|
|
@@ -1538,7 +1542,9 @@ interface Federatable<TContextData> extends TaskRegistry<TContextData> {
|
|
|
1538
1542
|
* based on URI Template
|
|
1539
1543
|
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
|
|
1540
1544
|
* must have one or more variables.
|
|
1541
|
-
* @param dispatcher An object dispatcher callback to register.
|
|
1545
|
+
* @param dispatcher An object dispatcher callback to register. It may
|
|
1546
|
+
* return an object, a `Tombstone` if the object has been
|
|
1547
|
+
* deleted, or `null` if the object is not found.
|
|
1542
1548
|
*/
|
|
1543
1549
|
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: ConstructorWithTypeId<TObject>, path: `${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
|
1544
1550
|
/**
|
|
@@ -1552,7 +1558,9 @@ interface Federatable<TContextData> extends TaskRegistry<TContextData> {
|
|
|
1552
1558
|
* based on URI Template
|
|
1553
1559
|
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
|
|
1554
1560
|
* must have one or more variables.
|
|
1555
|
-
* @param dispatcher An object dispatcher callback to register.
|
|
1561
|
+
* @param dispatcher An object dispatcher callback to register. It may
|
|
1562
|
+
* return an object, a `Tombstone` if the object has been
|
|
1563
|
+
* deleted, or `null` if the object is not found.
|
|
1556
1564
|
*/
|
|
1557
1565
|
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: ConstructorWithTypeId<TObject>, path: `${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
|
1558
1566
|
/**
|
|
@@ -1566,7 +1574,9 @@ interface Federatable<TContextData> extends TaskRegistry<TContextData> {
|
|
|
1566
1574
|
* based on URI Template
|
|
1567
1575
|
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
|
|
1568
1576
|
* must have one or more variables.
|
|
1569
|
-
* @param dispatcher An object dispatcher callback to register.
|
|
1577
|
+
* @param dispatcher An object dispatcher callback to register. It may
|
|
1578
|
+
* return an object, a `Tombstone` if the object has been
|
|
1579
|
+
* deleted, or `null` if the object is not found.
|
|
1570
1580
|
*/
|
|
1571
1581
|
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: ConstructorWithTypeId<TObject>, path: `${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
|
1572
1582
|
/**
|
|
@@ -1580,7 +1590,9 @@ interface Federatable<TContextData> extends TaskRegistry<TContextData> {
|
|
|
1580
1590
|
* based on URI Template
|
|
1581
1591
|
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
|
|
1582
1592
|
* must have one or more variables.
|
|
1583
|
-
* @param dispatcher An object dispatcher callback to register.
|
|
1593
|
+
* @param dispatcher An object dispatcher callback to register. It may
|
|
1594
|
+
* return an object, a `Tombstone` if the object has been
|
|
1595
|
+
* deleted, or `null` if the object is not found.
|
|
1584
1596
|
*/
|
|
1585
1597
|
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: ConstructorWithTypeId<TObject>, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
|
1586
1598
|
/**
|
|
@@ -1594,7 +1606,9 @@ interface Federatable<TContextData> extends TaskRegistry<TContextData> {
|
|
|
1594
1606
|
* based on URI Template
|
|
1595
1607
|
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
|
|
1596
1608
|
* must have one or more variables.
|
|
1597
|
-
* @param dispatcher An object dispatcher callback to register.
|
|
1609
|
+
* @param dispatcher An object dispatcher callback to register. It may
|
|
1610
|
+
* return an object, a `Tombstone` if the object has been
|
|
1611
|
+
* deleted, or `null` if the object is not found.
|
|
1598
1612
|
*/
|
|
1599
1613
|
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: ConstructorWithTypeId<TObject>, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
|
1600
1614
|
/**
|
|
@@ -1608,7 +1622,9 @@ interface Federatable<TContextData> extends TaskRegistry<TContextData> {
|
|
|
1608
1622
|
* based on URI Template
|
|
1609
1623
|
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
|
|
1610
1624
|
* must have one or more variables.
|
|
1611
|
-
* @param dispatcher An object dispatcher callback to register.
|
|
1625
|
+
* @param dispatcher An object dispatcher callback to register. It may
|
|
1626
|
+
* return an object, a `Tombstone` if the object has been
|
|
1627
|
+
* deleted, or `null` if the object is not found.
|
|
1612
1628
|
*/
|
|
1613
1629
|
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: ConstructorWithTypeId<TObject>, path: `${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
|
1614
1630
|
/**
|
|
@@ -2925,6 +2941,37 @@ interface Context<TContextData> {
|
|
|
2925
2941
|
*/
|
|
2926
2942
|
getActorUri(identifier: string): URL;
|
|
2927
2943
|
/**
|
|
2944
|
+
* Builds the [FEP-ef61] portable ID of an actor with the given identifier
|
|
2945
|
+
* under the given DID authority.
|
|
2946
|
+
*
|
|
2947
|
+
* The path is the same as the one {@link Context.getActorUri} builds, but
|
|
2948
|
+
* the result is an `ap+ef61:` URI whose authority is the DID, e.g.,
|
|
2949
|
+
* `ap+ef61://did:key:z6Mk.../users/alice`. Such an actor can be served
|
|
2950
|
+
* through the FEP-ef61 gateway endpoint,
|
|
2951
|
+
* `/.well-known/apgateway/did:key:z6Mk.../users/alice`, by the same actor
|
|
2952
|
+
* dispatcher.
|
|
2953
|
+
*
|
|
2954
|
+
* The returned `URL` keeps the DID authority percent-encoded, because
|
|
2955
|
+
* the `URL` class cannot represent the canonical form. Use `formatIri()`
|
|
2956
|
+
* from `@fedify/vocab-runtime` to get the canonical string, e.g.,
|
|
2957
|
+
* `ap+ef61://did:key:z6Mk.../users/alice`.
|
|
2958
|
+
*
|
|
2959
|
+
* [FEP-ef61]: https://w3id.org/fep/ef61
|
|
2960
|
+
*
|
|
2961
|
+
* @param identifier The actor's identifier.
|
|
2962
|
+
* @param authority The DID that controls the actor, e.g.,
|
|
2963
|
+
* `did:key:z6Mk...`. It must be a bare DID, without
|
|
2964
|
+
* a path, query, or fragment. A `did:key` DID must be
|
|
2965
|
+
* encoded in base58-btc, as FEP-ef61 requires; see
|
|
2966
|
+
* `exportDidKey()` from `@fedify/vocab-runtime`.
|
|
2967
|
+
* @returns The actor's portable ID.
|
|
2968
|
+
* @throws {RouterError} If no actor dispatcher is available.
|
|
2969
|
+
* @throws {TypeError} If the authority is not a DID, or it is a `did:key`
|
|
2970
|
+
* DID that is not encoded in base58-btc.
|
|
2971
|
+
* @since 2.4.0
|
|
2972
|
+
*/
|
|
2973
|
+
getPortableActorUri(identifier: string, authority: string): URL;
|
|
2974
|
+
/**
|
|
2928
2975
|
* Builds the URI of an object with the given class and values.
|
|
2929
2976
|
* @param cls The class of the object.
|
|
2930
2977
|
* @param values The values to pass to the object dispatcher.
|
|
@@ -2959,7 +3006,9 @@ interface Context<TContextData> {
|
|
|
2959
3006
|
* a path, query, or fragment.
|
|
2960
3007
|
* @returns The object's portable ID.
|
|
2961
3008
|
* @throws {RouterError} If no object dispatcher is available for the class.
|
|
2962
|
-
* @throws {TypeError} If values are invalid or the authority is not a DID
|
|
3009
|
+
* @throws {TypeError} If values are invalid, or the authority is not a DID
|
|
3010
|
+
* or is a `did:key` DID that is not encoded in
|
|
3011
|
+
* base58-btc.
|
|
2963
3012
|
* @since 2.4.0
|
|
2964
3013
|
*/
|
|
2965
3014
|
getPortableObjectUri<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>, authority: string): URL;
|
|
@@ -2988,7 +3037,8 @@ interface Context<TContextData> {
|
|
|
2988
3037
|
* a path, query, or fragment.
|
|
2989
3038
|
* @returns The inbox's portable ID.
|
|
2990
3039
|
* @throws {RouterError} If no inbox path is registered.
|
|
2991
|
-
* @throws {TypeError} If the authority is not a DID
|
|
3040
|
+
* @throws {TypeError} If the authority is not a DID, or it is a `did:key`
|
|
3041
|
+
* DID that is not encoded in base58-btc.
|
|
2992
3042
|
* @since 2.4.0
|
|
2993
3043
|
*/
|
|
2994
3044
|
getPortableInboxUri(identifier: string, authority: string): URL;
|
|
@@ -3355,6 +3405,23 @@ interface GetActorOptions {
|
|
|
3355
3405
|
readonly tombstone?: "suppress" | "passthrough";
|
|
3356
3406
|
}
|
|
3357
3407
|
/**
|
|
3408
|
+
* Options for {@link RequestContext.getObject}.
|
|
3409
|
+
* @since 2.4.0
|
|
3410
|
+
*/
|
|
3411
|
+
interface GetObjectOptions {
|
|
3412
|
+
/**
|
|
3413
|
+
* Controls how tombstoned objects are returned.
|
|
3414
|
+
*
|
|
3415
|
+
* By default, or if set to `"suppress"`, a {@link Tombstone} is returned as
|
|
3416
|
+
* `null`, unless it is an instance of the requested class, e.g., when
|
|
3417
|
+
* the requested class is `Object` or `Tombstone` itself. In that case,
|
|
3418
|
+
* the tombstone is returned as is, as it is an object of the requested
|
|
3419
|
+
* class. Set this to `"passthrough"` to always receive a {@link Tombstone}
|
|
3420
|
+
* result instead of `null`.
|
|
3421
|
+
*/
|
|
3422
|
+
readonly tombstone?: "suppress" | "passthrough";
|
|
3423
|
+
}
|
|
3424
|
+
/**
|
|
3358
3425
|
* A context for a request.
|
|
3359
3426
|
*/
|
|
3360
3427
|
interface RequestContext<TContextData> extends Context<TContextData> {
|
|
@@ -3369,12 +3436,13 @@ interface RequestContext<TContextData> extends Context<TContextData> {
|
|
|
3369
3436
|
/**
|
|
3370
3437
|
* Information about the [FEP-ef61] portable object requested through
|
|
3371
3438
|
* the gateway endpoint, e.g.,
|
|
3372
|
-
* `GET /.well-known/apgateway/did:key:z6Mk.../notes/123
|
|
3373
|
-
* `undefined` for
|
|
3439
|
+
* `GET /.well-known/apgateway/did:key:z6Mk.../notes/123`, which is served
|
|
3440
|
+
* by an object dispatcher or the actor dispatcher. It is `undefined` for
|
|
3441
|
+
* ordinary requests.
|
|
3374
3442
|
*
|
|
3375
3443
|
* The authority comes from the request path, so it is not evidence that
|
|
3376
|
-
* this server hosts objects for the DID. An object dispatcher
|
|
3377
|
-
* that by itself.
|
|
3444
|
+
* this server hosts objects for the DID. An object dispatcher or the actor
|
|
3445
|
+
* dispatcher has to check that by itself.
|
|
3378
3446
|
*
|
|
3379
3447
|
* It describes the incoming request, so it stays the same in contexts
|
|
3380
3448
|
* derived from this one, e.g., by {@link RequestContext.getObject}.
|
|
@@ -3384,6 +3452,31 @@ interface RequestContext<TContextData> extends Context<TContextData> {
|
|
|
3384
3452
|
*/
|
|
3385
3453
|
readonly portableRequest?: PortableRequest;
|
|
3386
3454
|
/**
|
|
3455
|
+
* Builds the [FEP-ef61] portable ID of an actor with the given identifier.
|
|
3456
|
+
* It works the same as {@link Context.getPortableActorUri}, except that
|
|
3457
|
+
* the authority can be omitted while handling a portable gateway request.
|
|
3458
|
+
* In that case, the DID in {@link RequestContext.portableRequest} is used.
|
|
3459
|
+
*
|
|
3460
|
+
* The DID in the request comes from the request path, so the default is
|
|
3461
|
+
* only a convenience for building IDs; it is not evidence that this server
|
|
3462
|
+
* hosts the actor for the DID.
|
|
3463
|
+
*
|
|
3464
|
+
* [FEP-ef61]: https://w3id.org/fep/ef61
|
|
3465
|
+
*
|
|
3466
|
+
* @param identifier The actor's identifier.
|
|
3467
|
+
* @param authority The DID that controls the actor, e.g.,
|
|
3468
|
+
* `did:key:z6Mk...`. It must be a bare DID, without
|
|
3469
|
+
* a path, query, or fragment. Defaults to the DID of
|
|
3470
|
+
* the requested portable object.
|
|
3471
|
+
* @returns The actor's portable ID.
|
|
3472
|
+
* @throws {RouterError} If no actor dispatcher is available.
|
|
3473
|
+
* @throws {TypeError} If the authority is not a DID, it is a `did:key` DID
|
|
3474
|
+
* that is not encoded in base58-btc, or the authority
|
|
3475
|
+
* is omitted outside a portable gateway request.
|
|
3476
|
+
* @since 2.4.0
|
|
3477
|
+
*/
|
|
3478
|
+
getPortableActorUri(identifier: string, authority?: string): URL;
|
|
3479
|
+
/**
|
|
3387
3480
|
* Builds the [FEP-ef61] portable ID of an object with the given class and
|
|
3388
3481
|
* values. It works the same as {@link Context.getPortableObjectUri}, except
|
|
3389
3482
|
* that the authority can be omitted while handling a portable gateway
|
|
@@ -3400,9 +3493,10 @@ interface RequestContext<TContextData> extends Context<TContextData> {
|
|
|
3400
3493
|
* the requested portable object.
|
|
3401
3494
|
* @returns The object's portable ID.
|
|
3402
3495
|
* @throws {RouterError} If no object dispatcher is available for the class.
|
|
3403
|
-
* @throws {TypeError} If values are invalid, the authority is not a DID,
|
|
3404
|
-
*
|
|
3405
|
-
*
|
|
3496
|
+
* @throws {TypeError} If values are invalid, the authority is not a DID,
|
|
3497
|
+
* it is a `did:key` DID that is not encoded in
|
|
3498
|
+
* base58-btc, or the authority is omitted outside
|
|
3499
|
+
* a portable gateway request.
|
|
3406
3500
|
* @since 2.4.0
|
|
3407
3501
|
*/
|
|
3408
3502
|
getPortableObjectUri<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>, authority?: string): URL;
|
|
@@ -3424,8 +3518,9 @@ interface RequestContext<TContextData> extends Context<TContextData> {
|
|
|
3424
3518
|
* the requested portable object, if any.
|
|
3425
3519
|
* @returns The inbox's portable ID.
|
|
3426
3520
|
* @throws {RouterError} If no inbox path is registered.
|
|
3427
|
-
* @throws {TypeError} If the authority is not a DID,
|
|
3428
|
-
*
|
|
3521
|
+
* @throws {TypeError} If the authority is not a DID, it is a `did:key` DID
|
|
3522
|
+
* that is not encoded in base58-btc, or the authority
|
|
3523
|
+
* is omitted outside a portable gateway request.
|
|
3429
3524
|
* @since 2.4.0
|
|
3430
3525
|
*/
|
|
3431
3526
|
getPortableInboxUri(identifier: string, authority?: string): URL;
|
|
@@ -3491,13 +3586,62 @@ interface RequestContext<TContextData> extends Context<TContextData> {
|
|
|
3491
3586
|
* @param cls The class to instantiate.
|
|
3492
3587
|
* @param values The values to pass to the object dispatcher.
|
|
3493
3588
|
* @returns The object of the given class with the given values, or `null`
|
|
3494
|
-
* if the object is not found.
|
|
3589
|
+
* if the object is not found. Tombstoned objects are suppressed
|
|
3590
|
+
* unless the tombstone is an instance of `cls`.
|
|
3495
3591
|
* @throws {Error} If no object dispatcher is available for the class.
|
|
3496
3592
|
* @throws {TypeError} If values are invalid.
|
|
3497
3593
|
* @since 0.7.0
|
|
3498
3594
|
*/
|
|
3499
3595
|
getObject<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>): Promise<TObject | null>;
|
|
3500
3596
|
/**
|
|
3597
|
+
* Gets an object of the given class, or a {@link Tombstone}, with the given
|
|
3598
|
+
* values.
|
|
3599
|
+
* @param cls The class to instantiate.
|
|
3600
|
+
* @param values The values to pass to the object dispatcher.
|
|
3601
|
+
* @param options Options for getting the object. Set `options.tombstone`
|
|
3602
|
+
* to `"passthrough"` to receive tombstoned objects instead
|
|
3603
|
+
* of `null`.
|
|
3604
|
+
* @returns The object of the given class with the given values,
|
|
3605
|
+
* a tombstone, or `null` if the object is not found.
|
|
3606
|
+
* @throws {Error} If no object dispatcher is available for the class.
|
|
3607
|
+
* @throws {TypeError} If values are invalid.
|
|
3608
|
+
* @since 2.4.0
|
|
3609
|
+
*/
|
|
3610
|
+
getObject<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>, options: GetObjectOptions & {
|
|
3611
|
+
readonly tombstone: "passthrough";
|
|
3612
|
+
}): Promise<TObject | Tombstone | null>;
|
|
3613
|
+
/**
|
|
3614
|
+
* Gets an object of the given class with the given values.
|
|
3615
|
+
* @param cls The class to instantiate.
|
|
3616
|
+
* @param values The values to pass to the object dispatcher.
|
|
3617
|
+
* @param options Options for getting the object.
|
|
3618
|
+
* @returns The object of the given class with the given values, or `null`
|
|
3619
|
+
* if the object is not found. Tombstoned objects are suppressed
|
|
3620
|
+
* unless `options.tombstone` is `"passthrough"` or the tombstone
|
|
3621
|
+
* is an instance of `cls`.
|
|
3622
|
+
* @throws {Error} If no object dispatcher is available for the class.
|
|
3623
|
+
* @throws {TypeError} If values are invalid.
|
|
3624
|
+
* @since 2.4.0
|
|
3625
|
+
*/
|
|
3626
|
+
getObject<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>, options: GetObjectOptions & {
|
|
3627
|
+
readonly tombstone?: "suppress" | undefined;
|
|
3628
|
+
}): Promise<TObject | null>;
|
|
3629
|
+
/**
|
|
3630
|
+
* Gets an object of the given class, or a {@link Tombstone}, with the given
|
|
3631
|
+
* values.
|
|
3632
|
+
* @param cls The class to instantiate.
|
|
3633
|
+
* @param values The values to pass to the object dispatcher.
|
|
3634
|
+
* @param options Options for getting the object.
|
|
3635
|
+
* @returns The object of the given class with the given values,
|
|
3636
|
+
* a tombstone, or `null` if the object is not found. This broad
|
|
3637
|
+
* overload is used when the caller passes an options value whose
|
|
3638
|
+
* `tombstone` mode is not known statically.
|
|
3639
|
+
* @throws {Error} If no object dispatcher is available for the class.
|
|
3640
|
+
* @throws {TypeError} If values are invalid.
|
|
3641
|
+
* @since 2.4.0
|
|
3642
|
+
*/
|
|
3643
|
+
getObject<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>, options: GetObjectOptions): Promise<TObject | Tombstone | null>;
|
|
3644
|
+
/**
|
|
3501
3645
|
* Gets the public key of the sender, if any exists and it is verified.
|
|
3502
3646
|
* Otherwise, `null` is returned.
|
|
3503
3647
|
*
|
|
@@ -3904,4 +4048,4 @@ interface ActorKeyPair extends CryptoKeyPair {
|
|
|
3904
4048
|
readonly multikey: Multikey;
|
|
3905
4049
|
}
|
|
3906
4050
|
//#endregion
|
|
3907
|
-
export {
|
|
4051
|
+
export { InProcessMessageQueue as $, MediaUploaderSetters as A, HashlinkMediaRequest as At, createFederationBuilder as B, OutboxPermanentFailureHandler as Bt, FederationFetchOptions as C, CollectionCounter as Ct, IdempotencyStrategy as D, CustomCollectionCursor as Dt, IdempotencyKeyCallback as E, CustomCollectionCounter as Et, FederationKvPrefixes as F, ObjectAuthorizePredicate as Ft, TaskRegistry as G, WebFingerLinksDispatcher as Gt, TaskDefinitionOptions as H, SharedInboxKeyDispatcher as Ht, FederationOrigin as I, ObjectDispatcher as It, RetryPolicy as J, PageItems as Jt, CreateExponentialBackoffPolicyOptions as K, SendActivityError as Kt, FederationQueueOptions as L, OutboxErrorHandler as Lt, OutboxListenerSetters as M, InboxListener as Mt, PortableInboxForwardingOptions as N, MediaUploaderCallback as Nt, InboxChallengePolicy as O, CustomCollectionDispatcher as Ot, Rfc6570Expression as P, NodeInfoDispatcher as Pt, respondWithObjectIfAcceptable as Q, createFederation as R, OutboxListener as Rt, FederationBuilder as S, AuthorizePredicate as St, FederationStartQueueOptions as T, CollectionDispatcher as Tt, TaskEnqueueOptions as U, UnverifiedActivityHandler as Ut, TaskDefinition as V, PortableActorIdMapper as Vt, TaskHandler as W, UnverifiedActivityReason as Wt, RespondWithObjectOptions as X, digest as Xt, createExponentialBackoffPolicy as Y, buildCollectionSynchronizationHeader as Yt, respondWithObject as Z, ActivityTransformer as Zt, ConstructorWithTypeId as _, parseCircuitBreakerKvState as _t, GetObjectOptions as a, ParallelMessageQueue as at, Federation as b, ActorHandleMapper as bt, OutboxContext as c, CircuitBreakerBeforeSendDecision as ct, RequestContext as d, CircuitBreakerKvState as dt, InProcessMessageQueueOptions as et, RouteActivityOptions as f, CircuitBreakerOptions as ft, CollectionCallbackSetters as g, normalizeCircuitBreakerOptions as gt, ActorCallbackSetters as h, NormalizedCircuitBreakerOptions as ht, GetActorOptions as i, MessageQueueListenOptions as it, ObjectCallbackSetters as j, InboxErrorHandler as jt, InboxListenerSetters as k, HashlinkMediaDispatcher as kt, ParseUriResult as l, CircuitBreakerCreateOptions as lt, SendActivityOptionsForCollection as m, CircuitBreakerStateChange as mt, Context as n, MessageQueueDepth as nt, GetSignedKeyOptions as o, CircuitBreaker as ot, SendActivityOptions as p, CircuitBreakerState as pt, RetryContext as q, SenderKeyPair as qt, ForwardActivityOptions as r, MessageQueueEnqueueOptions as rt, InboxContext as s, CircuitBreakerActivityDrop as st, ActorKeyPair as t, MessageQueue as tt, PortableRequest as u, CircuitBreakerFailurePolicy as ut, CustomCollectionCallbackSetters as v, ActorAliasMapper as vt, FederationOptions as w, CollectionCursor as wt, FederationBenchmarkOptions as x, ActorKeyPairsDispatcher as xt, Federatable as y, ActorDispatcher as yt, Message as z, OutboxListenerErrorHandler as zt };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { s as validateCryptoKey } from "./key-
|
|
5
|
-
import { n as doubleKnock } from "./http-
|
|
4
|
+
import { s as validateCryptoKey } from "./key-B8u1vdvF.mjs";
|
|
5
|
+
import { n as doubleKnock } from "./http-CHEYA5fH.mjs";
|
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
|
7
7
|
import { curry } from "es-toolkit";
|
|
8
8
|
import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, validatePublicUrl } from "@fedify/vocab-runtime";
|
|
@@ -6,7 +6,7 @@ import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
|
6
6
|
import { t as assertExists } from "../assert_exists-cffSpJ7X.mjs";
|
|
7
7
|
import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
|
|
8
8
|
import "../std__assert-DvMDRPes.mjs";
|
|
9
|
-
import { r as createFederationBuilder } from "../builder-
|
|
9
|
+
import { r as createFederationBuilder } from "../builder-BRlYEsrV.mjs";
|
|
10
10
|
import { DisallowedOperatorError, DisallowedVarSpecModifierError, DuplicateRouteVariableError, RouteTemplateOptionsNotMatchedError, RouterError } from "@fedify/uri-template";
|
|
11
11
|
import { Activity, Note, Person } from "@fedify/vocab";
|
|
12
12
|
import { test } from "@fedify/fixture";
|
|
@@ -6,11 +6,11 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
|
6
6
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
7
7
|
import "../std__assert-DvMDRPes.mjs";
|
|
8
8
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
9
|
-
import { t as exportJwk } from "../key-
|
|
9
|
+
import { t as exportJwk } from "../key-B8u1vdvF.mjs";
|
|
10
10
|
import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-4IJqPYos.mjs";
|
|
11
|
-
import { i as signObject, u as verifyProof } from "../proof-
|
|
11
|
+
import { i as signObject, u as verifyProof } from "../proof-DDw0i9b1.mjs";
|
|
12
12
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
13
|
-
import { n as FederationImpl } from "../middleware-
|
|
13
|
+
import { n as FederationImpl } from "../middleware-B-rZ7oE-.mjs";
|
|
14
14
|
import { Create, DataIntegrityProof, Note } from "@fedify/vocab";
|
|
15
15
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
16
16
|
import { exportDidKey, parseIri } from "@fedify/vocab-runtime";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { r as createRequestContext, t as createInboxContext } from "../context-
|
|
4
|
+
import { r as createRequestContext, t as createInboxContext } from "../context-CoNRxGYp.mjs";
|
|
5
5
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
6
6
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
7
7
|
import "../std__assert-DvMDRPes.mjs";
|
|
8
|
-
import { a as compactJsonLd, m as verifyCompactJsonLd, p as signJsonLd } from "../ld-
|
|
9
|
-
import { l as signRequest } from "../http-
|
|
8
|
+
import { a as compactJsonLd, m as verifyCompactJsonLd, p as signJsonLd } from "../ld-BTMJHEGV.mjs";
|
|
9
|
+
import { l as signRequest } from "../http-CHEYA5fH.mjs";
|
|
10
10
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, n as ed25519PrivateKey, r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
|
|
11
|
-
import { f as handleInbox, o as createFederation } from "../middleware-
|
|
11
|
+
import { f as handleInbox, o as createFederation } from "../middleware-B-rZ7oE-.mjs";
|
|
12
12
|
import { t as ActivityListenerSet } from "../activity-listener-C-BSbKI7.mjs";
|
|
13
13
|
import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
|
|
14
14
|
import { Create } from "@fedify/vocab";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-
|
|
4
|
+
import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-CoNRxGYp.mjs";
|
|
5
5
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
6
6
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
7
7
|
import { t as assertGreaterOrEqual } from "../assert_greater_or_equal-BlafOF4-.mjs";
|
|
@@ -10,12 +10,12 @@ import "../std__assert-DvMDRPes.mjs";
|
|
|
10
10
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
11
11
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
12
12
|
import { r as parseAcceptSignature } from "../accept-CPVqki78.mjs";
|
|
13
|
-
import { a as generateCryptoKeyPair } from "../key-
|
|
14
|
-
import { a as compactJsonLd, p as signJsonLd } from "../ld-
|
|
15
|
-
import { i as signObject } from "../proof-
|
|
16
|
-
import { l as signRequest } from "../http-
|
|
13
|
+
import { a as generateCryptoKeyPair } from "../key-B8u1vdvF.mjs";
|
|
14
|
+
import { a as compactJsonLd, p as signJsonLd } from "../ld-BTMJHEGV.mjs";
|
|
15
|
+
import { i as signObject } from "../proof-DDw0i9b1.mjs";
|
|
16
|
+
import { l as signRequest } from "../http-CHEYA5fH.mjs";
|
|
17
17
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
18
|
-
import { d as handleCustomCollection, f as handleInbox, g as respondWithObjectIfAcceptable, h as respondWithObject, l as handleActor, m as handleOutbox, o as createFederation, p as handleObject, u as handleCollection } from "../middleware-
|
|
18
|
+
import { d as handleCustomCollection, f as handleInbox, g as respondWithObjectIfAcceptable, h as respondWithObject, l as handleActor, m as handleOutbox, o as createFederation, p as handleObject, u as handleCollection } from "../middleware-B-rZ7oE-.mjs";
|
|
19
19
|
import { t as ActivityListenerSet } from "../activity-listener-C-BSbKI7.mjs";
|
|
20
20
|
import { Activity, Create, CryptographicKey, Multikey, Note, Person, Tombstone } from "@fedify/vocab";
|
|
21
21
|
import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
@@ -500,6 +500,119 @@ test("handleObject()", async () => {
|
|
|
500
500
|
assertEquals(onNotFoundCalled, null);
|
|
501
501
|
assertEquals(onUnauthorizedCalled, null);
|
|
502
502
|
});
|
|
503
|
+
test("handleObject() with a tombstone", async () => {
|
|
504
|
+
const federation = createFederation({ kv: new MemoryKvStore() });
|
|
505
|
+
const url = new URL("https://example.com/users/someone/notes/123");
|
|
506
|
+
let context = createRequestContext({
|
|
507
|
+
federation,
|
|
508
|
+
data: void 0,
|
|
509
|
+
url,
|
|
510
|
+
request: new Request(url, { headers: { Accept: "application/activity+json" } })
|
|
511
|
+
});
|
|
512
|
+
const objectDispatcher = (_ctx, values) => {
|
|
513
|
+
if (values.id !== "123") return null;
|
|
514
|
+
return new Tombstone({
|
|
515
|
+
id: new URL(`https://example.com/users/${values.identifier}/notes/${values.id}`),
|
|
516
|
+
formerType: Note,
|
|
517
|
+
deleted: Temporal.Instant.from("2024-01-15T00:00:00Z")
|
|
518
|
+
});
|
|
519
|
+
};
|
|
520
|
+
let onNotFoundCalled = null;
|
|
521
|
+
const onNotFound = (request) => {
|
|
522
|
+
onNotFoundCalled = request;
|
|
523
|
+
return new Response("Not found", { status: 404 });
|
|
524
|
+
};
|
|
525
|
+
let onUnauthorizedCalled = null;
|
|
526
|
+
const onUnauthorized = (request) => {
|
|
527
|
+
onUnauthorizedCalled = request;
|
|
528
|
+
return new Response("Unauthorized", { status: 401 });
|
|
529
|
+
};
|
|
530
|
+
let response = await handleObject(context.request, {
|
|
531
|
+
context,
|
|
532
|
+
values: {
|
|
533
|
+
identifier: "someone",
|
|
534
|
+
id: "123"
|
|
535
|
+
},
|
|
536
|
+
objectDispatcher,
|
|
537
|
+
onNotFound,
|
|
538
|
+
onUnauthorized
|
|
539
|
+
});
|
|
540
|
+
assertEquals(response.status, 410);
|
|
541
|
+
assertEquals(response.headers.get("Content-Type"), "application/activity+json");
|
|
542
|
+
assertEquals(response.headers.get("Vary"), "Accept");
|
|
543
|
+
const body = await response.json();
|
|
544
|
+
assertEquals(body.id, "https://example.com/users/someone/notes/123");
|
|
545
|
+
assertEquals(body.type, "Tombstone");
|
|
546
|
+
assertEquals(body.formerType, "as:Note");
|
|
547
|
+
assertEquals(body.deleted, "2024-01-15T00:00:00Z");
|
|
548
|
+
assertEquals(onNotFoundCalled, null);
|
|
549
|
+
assertEquals(onUnauthorizedCalled, null);
|
|
550
|
+
response = await handleObject(context.request, {
|
|
551
|
+
context,
|
|
552
|
+
values: {
|
|
553
|
+
identifier: "someone",
|
|
554
|
+
id: "456"
|
|
555
|
+
},
|
|
556
|
+
objectDispatcher,
|
|
557
|
+
onNotFound,
|
|
558
|
+
onUnauthorized
|
|
559
|
+
});
|
|
560
|
+
assertEquals(response.status, 404);
|
|
561
|
+
assertEquals(onNotFoundCalled, context.request);
|
|
562
|
+
assertEquals(onUnauthorizedCalled, null);
|
|
563
|
+
onNotFoundCalled = null;
|
|
564
|
+
let authorized = false;
|
|
565
|
+
const authorizePredicate = () => authorized;
|
|
566
|
+
response = await handleObject(context.request, {
|
|
567
|
+
context,
|
|
568
|
+
values: {
|
|
569
|
+
identifier: "someone",
|
|
570
|
+
id: "123"
|
|
571
|
+
},
|
|
572
|
+
objectDispatcher,
|
|
573
|
+
authorizePredicate,
|
|
574
|
+
onNotFound,
|
|
575
|
+
onUnauthorized
|
|
576
|
+
});
|
|
577
|
+
assertEquals(response.status, 401);
|
|
578
|
+
assertEquals(onNotFoundCalled, null);
|
|
579
|
+
assertEquals(onUnauthorizedCalled, context.request);
|
|
580
|
+
onUnauthorizedCalled = null;
|
|
581
|
+
authorized = true;
|
|
582
|
+
response = await handleObject(context.request, {
|
|
583
|
+
context,
|
|
584
|
+
values: {
|
|
585
|
+
identifier: "someone",
|
|
586
|
+
id: "123"
|
|
587
|
+
},
|
|
588
|
+
objectDispatcher,
|
|
589
|
+
authorizePredicate,
|
|
590
|
+
onNotFound,
|
|
591
|
+
onUnauthorized
|
|
592
|
+
});
|
|
593
|
+
assertEquals(response.status, 410);
|
|
594
|
+
assertEquals(onUnauthorizedCalled, null);
|
|
595
|
+
context = createRequestContext({
|
|
596
|
+
...context,
|
|
597
|
+
request: new Request(url, {
|
|
598
|
+
method: "HEAD",
|
|
599
|
+
headers: { Accept: "application/activity+json" }
|
|
600
|
+
})
|
|
601
|
+
});
|
|
602
|
+
response = await handleObject(context.request, {
|
|
603
|
+
context,
|
|
604
|
+
values: {
|
|
605
|
+
identifier: "someone",
|
|
606
|
+
id: "123"
|
|
607
|
+
},
|
|
608
|
+
objectDispatcher,
|
|
609
|
+
onNotFound,
|
|
610
|
+
onUnauthorized
|
|
611
|
+
});
|
|
612
|
+
assertEquals(response.status, 410);
|
|
613
|
+
assertEquals(response.headers.get("Content-Type"), "application/activity+json");
|
|
614
|
+
assertEquals(response.body, null);
|
|
615
|
+
});
|
|
503
616
|
test("handleCollection()", async () => {
|
|
504
617
|
let context = createRequestContext({
|
|
505
618
|
federation: createFederation({ kv: new MemoryKvStore() }),
|
|
@@ -10,8 +10,8 @@ import "../std__assert-DvMDRPes.mjs";
|
|
|
10
10
|
import { t as assertStrictEquals } from "../assert_strict_equals-CYvBmkpC.mjs";
|
|
11
11
|
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
12
12
|
import { r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
|
|
13
|
-
import { o as createFederation, x as parseHashlinkGatewayRequest } from "../middleware-
|
|
14
|
-
import { r as createFederationBuilder } from "../builder-
|
|
13
|
+
import { o as createFederation, x as parseHashlinkGatewayRequest } from "../middleware-B-rZ7oE-.mjs";
|
|
14
|
+
import { r as createFederationBuilder } from "../builder-BRlYEsrV.mjs";
|
|
15
15
|
import { n as RouterError } from "../router-u5O5KCQr.mjs";
|
|
16
16
|
import { Note } from "@fedify/vocab";
|
|
17
17
|
import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
6
6
|
import "../std__assert-DvMDRPes.mjs";
|
|
7
|
-
import { i as signObject } from "../proof-
|
|
7
|
+
import { i as signObject } from "../proof-DDw0i9b1.mjs";
|
|
8
8
|
import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
9
|
-
import { o as createFederation } from "../middleware-
|
|
9
|
+
import { o as createFederation } from "../middleware-B-rZ7oE-.mjs";
|
|
10
10
|
import { Create, Follow, Person } from "@fedify/vocab";
|
|
11
11
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
12
12
|
//#region src/federation/idempotency.test.ts
|
|
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
5
5
|
import "../std__assert-DvMDRPes.mjs";
|
|
6
6
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
7
|
-
import { _ as recordKeyLookup, a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, m as recordDocumentFetch, p as recordDocumentCache, r as getFederationMetrics, t as classifyFetchError, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "../metrics-
|
|
7
|
+
import { _ as recordKeyLookup, a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, m as recordDocumentFetch, p as recordDocumentCache, r as getFederationMetrics, t as classifyFetchError, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "../metrics-CF1TEvdS.mjs";
|
|
8
8
|
import { createTestMeterProvider, test } from "@fedify/fixture";
|
|
9
9
|
import { FetchError } from "@fedify/vocab-runtime";
|
|
10
10
|
import { DataPointType, MeterProvider, MetricReader } from "@opentelemetry/sdk-metrics";
|