@fedify/fedify 1.9.0-dev.1689 → 1.9.0-dev.1704
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/{actor-Dpkqj5Dv.js → actor-B0LpLKRw.js} +187 -187
- package/dist/{actor-DzdLVqkJ.js → actor-CQzdjHs3.js} +1 -1
- package/dist/{actor-CK94m0Yv.cjs → actor-DU96UQUE.cjs} +187 -187
- package/dist/{authdocloader-4iBGWlQw.cjs → authdocloader-BkOerKL-.cjs} +3 -3
- package/dist/{authdocloader-DdSBpn11.js → authdocloader-CzmsYrAn.js} +3 -3
- package/dist/{authdocloader-BVvTFQbi.js → authdocloader-DI67R2Ku.js} +3 -3
- package/dist/{builder-BR--hcb8.js → builder-D2Oyy8AY.js} +8 -8
- package/dist/{client-BoUqciR8.js → client-BWusKCWF.js} +1 -1
- package/dist/compat/mod.d.cts +2 -2
- package/dist/compat/mod.d.ts +2 -2
- package/dist/compat/transformers.test.js +16 -16
- package/dist/{context-CZorAkt8.d.ts → context-C51zGhGC.d.ts} +120 -87
- package/dist/{context-DCh96LcF.d.cts → context-Qnv814-p.d.cts} +120 -87
- package/dist/{docloader-Bui9z8Lb.cjs → docloader-NcFUThCx.cjs} +1 -1
- package/dist/{docloader-DyvW1gbN.js → docloader-isD0ntZv.js} +1 -1
- package/dist/{esm-DMb2eQXG.js → esm-BBVcrjH8.js} +1 -1
- package/dist/federation/builder.test.js +5 -5
- package/dist/federation/collection.test.js +3 -3
- package/dist/federation/handler.test.js +17 -17
- package/dist/federation/idempotency.test.js +17 -17
- package/dist/federation/inbox.test.js +4 -4
- package/dist/federation/keycache.test.js +4 -4
- package/dist/federation/kv.test.js +3 -3
- package/dist/federation/middleware.test.js +18 -18
- package/dist/federation/mod.cjs +10 -10
- package/dist/federation/mod.d.cts +2 -2
- package/dist/federation/mod.d.ts +2 -2
- package/dist/federation/mod.js +10 -10
- package/dist/federation/mq.test.js +3 -3
- package/dist/federation/retry.test.js +3 -3
- package/dist/federation/router.test.js +3 -3
- package/dist/federation/send.test.js +10 -10
- package/dist/{http-C7nvEG1N.js → http-BiKoa3o_.js} +2 -2
- package/dist/{http-BAaVL480.cjs → http-LVXxICJn.cjs} +3 -3
- package/dist/{http-xsj5Fzwl.js → http-MyYS6o7t.js} +3 -3
- package/dist/{inbox-DZNE3Jtq.js → inbox-CzGsgKH-.js} +1 -1
- package/dist/key-BEz2ThE9.cjs +10 -0
- package/dist/{key-DgZIZVqA.js → key-C0SCHEcf.js} +3 -3
- package/dist/{key-C25gGlmV.js → key-C5cRHj8g.js} +2 -2
- package/dist/{key-CbnQpdZy.js → key-CRhmBE03.js} +2 -2
- package/dist/{key-DqqCoLbc.cjs → key-Ci8OyUTB.cjs} +2 -2
- package/dist/{key-DOPWTj2e.js → key-DWPlWnFQ.js} +4 -4
- package/dist/{keycache-CoMI1L_W.js → keycache-rO8ea311.js} +1 -1
- package/dist/{keys-CMahfArj.js → keys-CWdCy_3n.js} +1 -1
- package/dist/{ld-WZpO-MzE.js → ld-BWADNtQr.js} +2 -2
- package/dist/{lookup-WoJkw8wY.js → lookup-BBTRFcU5.js} +1 -1
- package/dist/{lookup-D_w567L8.cjs → lookup-CILOZed9.cjs} +1 -1
- package/dist/{lookup-y6-PEpxS.js → lookup-RINL4MOa.js} +1 -1
- package/dist/{middleware-CjgR6ayA.js → middleware-Bcv0xCjs.js} +35 -36
- package/dist/middleware-Be9qUuwL.cjs +17 -0
- package/dist/{middleware-Cj9WC_iX.js → middleware-BfhSHVoJ.js} +36 -37
- package/dist/middleware-CWlljVpG.js +26 -0
- package/dist/{middleware-CWlrInU2.cjs → middleware-DDyUhxsm.cjs} +36 -37
- package/dist/middleware-Dm7sDAVJ.js +17 -0
- package/dist/{mod-BojaEE1l.d.cts → mod-COTXAYRl.d.cts} +1 -1
- package/dist/{mod-tWXEItkO.d.ts → mod-o-hx_hU8.d.ts} +1 -1
- package/dist/mod.cjs +10 -10
- package/dist/mod.d.cts +3 -3
- package/dist/mod.d.ts +3 -3
- package/dist/mod.js +10 -10
- package/dist/nodeinfo/client.test.js +5 -5
- package/dist/nodeinfo/handler.test.js +16 -16
- package/dist/nodeinfo/mod.cjs +2 -2
- package/dist/nodeinfo/mod.js +2 -2
- package/dist/nodeinfo/semver.test.js +3 -3
- package/dist/nodeinfo/types.test.js +3 -3
- package/dist/{owner-CPBOVM7l.js → owner-QEQV9vx-.js} +2 -2
- package/dist/{proof-CpmDDzvf.js → proof-B_9fbF3f.js} +3 -3
- package/dist/{proof-h0JvKPRP.js → proof-g2_9VhUQ.js} +2 -2
- package/dist/{proof-BLoRsaYR.cjs → proof-v3B5cJ3c.cjs} +3 -3
- package/dist/runtime/authdocloader.test.js +9 -9
- package/dist/runtime/docloader.test.js +4 -4
- package/dist/runtime/key.test.js +5 -5
- package/dist/runtime/langstr.test.js +3 -3
- package/dist/runtime/link.test.js +3 -3
- package/dist/runtime/mod.cjs +6 -6
- package/dist/runtime/mod.js +6 -6
- package/dist/runtime/multibase/multibase.test.js +3 -3
- package/dist/runtime/url.test.js +3 -3
- package/dist/{send-CD-m2vwX.js → send-cTLNXtTp.js} +2 -2
- package/dist/sig/http.test.js +8 -8
- package/dist/sig/key.test.js +6 -6
- package/dist/sig/ld.test.js +7 -7
- package/dist/sig/mod.cjs +6 -6
- package/dist/sig/mod.js +6 -6
- package/dist/sig/owner.test.js +7 -7
- package/dist/sig/proof.test.js +7 -7
- package/dist/testing/docloader.test.js +3 -3
- package/dist/testing/mod.d.ts +119 -86
- package/dist/testing/mod.js +3 -3
- package/dist/{testing-DvTABhvG.js → testing-CNtyBr2m.js} +2 -2
- package/dist/{type-BCazg_Pu.js → type-C5udJemk.js} +186 -186
- package/dist/{types-F8JMlP-f.cjs → types-C9w81XqW.cjs} +1 -1
- package/dist/{types-BsM0mf3R.js → types-DHq9gRM4.js} +1 -1
- package/dist/vocab/actor.test.js +5 -5
- package/dist/vocab/lookup.test.js +4 -4
- package/dist/vocab/mod.cjs +4 -4
- package/dist/vocab/mod.js +4 -4
- package/dist/vocab/type.test.js +3 -3
- package/dist/vocab/vocab.test.js +4 -4
- package/dist/{vocab-C-qxDq1m.cjs → vocab-BoyCE2Rn.cjs} +3 -3
- package/dist/{vocab-DdTdRfBW.js → vocab-DxoBe7PI.js} +3 -3
- package/dist/webfinger/handler.test.js +16 -16
- package/dist/webfinger/lookup.test.js +4 -4
- package/dist/webfinger/mod.cjs +2 -2
- package/dist/webfinger/mod.js +2 -2
- package/dist/x/cfworkers.test.js +3 -3
- package/dist/x/hono.d.cts +1 -1
- package/dist/x/hono.d.ts +1 -1
- package/dist/x/sveltekit.d.cts +1 -1
- package/dist/x/sveltekit.d.ts +1 -1
- package/package.json +1 -1
- package/dist/key-CHU24Npw.cjs +0 -10
- package/dist/middleware-BYEKw_OJ.js +0 -17
- package/dist/middleware-DbxA0Z6o.js +0 -26
- package/dist/middleware-hTlyJu9R.cjs +0 -17
package/dist/testing/mod.d.ts
CHANGED
|
@@ -7503,7 +7503,7 @@ type ObjectAuthorizePredicate<TContextData, TParam extends string> = (context: R
|
|
|
7503
7503
|
* the entire collection without pagination.
|
|
7504
7504
|
* @since 1.8.0
|
|
7505
7505
|
*/
|
|
7506
|
-
type CustomCollectionDispatcher<TItem,
|
|
7506
|
+
type CustomCollectionDispatcher<TItem, TParam extends string, TContext extends Context<TContextData>, TContextData> = (context: TContext, values: Record<TParam, string>, cursor: string | null) => PageItems<TItem> | null | Promise<PageItems<TItem> | null>;
|
|
7507
7507
|
/**
|
|
7508
7508
|
* A callback that counts the number of items in a custom collection.
|
|
7509
7509
|
*
|
|
@@ -7513,7 +7513,7 @@ type CustomCollectionDispatcher<TItem, TParams extends Record<string, string>, T
|
|
|
7513
7513
|
* @param values The parameters of the requested URL.
|
|
7514
7514
|
* @since 1.8.0
|
|
7515
7515
|
*/
|
|
7516
|
-
type CustomCollectionCounter<
|
|
7516
|
+
type CustomCollectionCounter<TParam extends string, TContextData> = (context: RequestContext<TContextData>, values: Record<TParam, string>) => number | bigint | null | Promise<number | bigint | null>;
|
|
7517
7517
|
/**
|
|
7518
7518
|
* A callback that returns a cursor for a custom collection.
|
|
7519
7519
|
*
|
|
@@ -7526,7 +7526,7 @@ type CustomCollectionCounter<TParams extends Record<string, string>, TContextDat
|
|
|
7526
7526
|
* @param values The parameters of the requested URL.
|
|
7527
7527
|
* @since 1.8.0
|
|
7528
7528
|
*/
|
|
7529
|
-
type CustomCollectionCursor<
|
|
7529
|
+
type CustomCollectionCursor<TParam extends string, TContext extends Context<TContextData>, TContextData> = (context: TContext, values: Record<TParam, string>) => string | null | Promise<string | null>;
|
|
7530
7530
|
//#endregion
|
|
7531
7531
|
//#region src/federation/queue.d.ts
|
|
7532
7532
|
interface SenderKeyJwkPair {
|
|
@@ -7647,7 +7647,7 @@ interface Federatable<TContextData> {
|
|
|
7647
7647
|
* @returns An object with methods to set other actor dispatcher callbacks.
|
|
7648
7648
|
* @throws {RouterError} Thrown if the path pattern is invalid.
|
|
7649
7649
|
*/
|
|
7650
|
-
setActorDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: ActorDispatcher<TContextData>): ActorCallbackSetters<TContextData>;
|
|
7650
|
+
setActorDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: ActorDispatcher<TContextData>): ActorCallbackSetters<TContextData>;
|
|
7651
7651
|
/**
|
|
7652
7652
|
* Registers an object dispatcher.
|
|
7653
7653
|
*
|
|
@@ -7711,7 +7711,7 @@ interface Federatable<TContextData> {
|
|
|
7711
7711
|
*/
|
|
7712
7712
|
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: (new (...args: any[]) => TObject) & {
|
|
7713
7713
|
typeId: URL;
|
|
7714
|
-
}, path: `${string}
|
|
7714
|
+
}, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
|
7715
7715
|
/**
|
|
7716
7716
|
* Registers an object dispatcher.
|
|
7717
7717
|
*
|
|
@@ -7727,7 +7727,7 @@ interface Federatable<TContextData> {
|
|
|
7727
7727
|
*/
|
|
7728
7728
|
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: (new (...args: any[]) => TObject) & {
|
|
7729
7729
|
typeId: URL;
|
|
7730
|
-
}, path: `${string}
|
|
7730
|
+
}, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
|
7731
7731
|
/**
|
|
7732
7732
|
* Registers an object dispatcher.
|
|
7733
7733
|
*
|
|
@@ -7743,7 +7743,7 @@ interface Federatable<TContextData> {
|
|
|
7743
7743
|
*/
|
|
7744
7744
|
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: (new (...args: any[]) => TObject) & {
|
|
7745
7745
|
typeId: URL;
|
|
7746
|
-
}, path: `${string}
|
|
7746
|
+
}, path: `${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
|
7747
7747
|
/**
|
|
7748
7748
|
* Registers an inbox dispatcher.
|
|
7749
7749
|
*
|
|
@@ -7755,7 +7755,7 @@ interface Federatable<TContextData> {
|
|
|
7755
7755
|
* @param dispatcher An inbox dispatcher callback to register.
|
|
7756
7756
|
* @throws {@link RouterError} Thrown if the path pattern is invalid.
|
|
7757
7757
|
*/
|
|
7758
|
-
setInboxDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Activity, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
|
7758
|
+
setInboxDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Activity, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
|
7759
7759
|
/**
|
|
7760
7760
|
* Registers an outbox dispatcher.
|
|
7761
7761
|
*
|
|
@@ -7779,7 +7779,7 @@ interface Federatable<TContextData> {
|
|
|
7779
7779
|
* @param dispatcher An outbox dispatcher callback to register.
|
|
7780
7780
|
* @throws {@link RouterError} Thrown if the path pattern is invalid.
|
|
7781
7781
|
*/
|
|
7782
|
-
setOutboxDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Activity, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
|
7782
|
+
setOutboxDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Activity, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
|
7783
7783
|
/**
|
|
7784
7784
|
* Registers a following collection dispatcher.
|
|
7785
7785
|
* @param path The URI path pattern for the following collection. The syntax
|
|
@@ -7791,7 +7791,7 @@ interface Federatable<TContextData> {
|
|
|
7791
7791
|
* callbacks.
|
|
7792
7792
|
* @throws {RouterError} Thrown if the path pattern is invalid.
|
|
7793
7793
|
*/
|
|
7794
|
-
setFollowingDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Actor | URL, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
|
7794
|
+
setFollowingDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Actor | URL, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
|
7795
7795
|
/**
|
|
7796
7796
|
* Registers a followers collection dispatcher.
|
|
7797
7797
|
* @param path The URI path pattern for the followers collection. The syntax
|
|
@@ -7803,7 +7803,7 @@ interface Federatable<TContextData> {
|
|
|
7803
7803
|
* callbacks.
|
|
7804
7804
|
* @throws {@link RouterError} Thrown if the path pattern is invalid.
|
|
7805
7805
|
*/
|
|
7806
|
-
setFollowersDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Recipient, Context<TContextData>, TContextData, URL>): CollectionCallbackSetters<Context<TContextData>, TContextData, URL>;
|
|
7806
|
+
setFollowersDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Recipient, Context<TContextData>, TContextData, URL>): CollectionCallbackSetters<Context<TContextData>, TContextData, URL>;
|
|
7807
7807
|
/**
|
|
7808
7808
|
* Registers a liked collection dispatcher.
|
|
7809
7809
|
* @param path The URI path pattern for the liked collection. The syntax
|
|
@@ -7815,7 +7815,7 @@ interface Federatable<TContextData> {
|
|
|
7815
7815
|
* callbacks.
|
|
7816
7816
|
* @throws {@link RouterError} Thrown if the path pattern is invalid.
|
|
7817
7817
|
*/
|
|
7818
|
-
setLikedDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Object$1 | URL, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
|
7818
|
+
setLikedDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Object$1 | URL, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
|
7819
7819
|
/**
|
|
7820
7820
|
* Registers a featured collection dispatcher.
|
|
7821
7821
|
* @param path The URI path pattern for the featured collection. The syntax
|
|
@@ -7827,7 +7827,7 @@ interface Federatable<TContextData> {
|
|
|
7827
7827
|
* callbacks.
|
|
7828
7828
|
* @throws {@link RouterError} Thrown if the path pattern is invalid.
|
|
7829
7829
|
*/
|
|
7830
|
-
setFeaturedDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Object$1, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
|
7830
|
+
setFeaturedDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Object$1, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
|
7831
7831
|
/**
|
|
7832
7832
|
* Registers a featured tags collection dispatcher.
|
|
7833
7833
|
* @param path The URI path pattern for the featured tags collection.
|
|
@@ -7839,7 +7839,7 @@ interface Federatable<TContextData> {
|
|
|
7839
7839
|
* callbacks.
|
|
7840
7840
|
* @throws {@link RouterError} Thrown if the path pattern is invalid.
|
|
7841
7841
|
*/
|
|
7842
|
-
setFeaturedTagsDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Hashtag, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
|
7842
|
+
setFeaturedTagsDispatcher(path: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, dispatcher: CollectionDispatcher<Hashtag, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
|
7843
7843
|
/**
|
|
7844
7844
|
* Assigns the URL path for the inbox and starts setting inbox listeners.
|
|
7845
7845
|
*
|
|
@@ -7869,7 +7869,7 @@ interface Federatable<TContextData> {
|
|
|
7869
7869
|
* @returns An object to register inbox listeners.
|
|
7870
7870
|
* @throws {RouteError} Thrown if the path pattern is invalid.
|
|
7871
7871
|
*/
|
|
7872
|
-
setInboxListeners(inboxPath: `${string}{identifier}${string}` | `${string}{handle}${string}`, sharedInboxPath?: string): InboxListenerSetters<TContextData>;
|
|
7872
|
+
setInboxListeners(inboxPath: `${string}${Rfc6570Expression<"identifier">}${string}` | `${string}${Rfc6570Expression<"handle">}${string}`, sharedInboxPath?: string): InboxListenerSetters<TContextData>;
|
|
7873
7873
|
/**
|
|
7874
7874
|
* Registers a collection of objects dispatcher.
|
|
7875
7875
|
*
|
|
@@ -7884,7 +7884,43 @@ interface Federatable<TContextData> {
|
|
|
7884
7884
|
* The path must have one or more variables.
|
|
7885
7885
|
* @param dispatcher A collection dispatcher callback to register.
|
|
7886
7886
|
*/
|
|
7887
|
-
setCollectionDispatcher<TObject extends Object$1,
|
|
7887
|
+
setCollectionDispatcher<TObject extends Object$1, TParam extends string>(name: string | symbol, itemType: (new (...args: any[]) => TObject) & {
|
|
7888
|
+
typeId: URL;
|
|
7889
|
+
}, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: CustomCollectionDispatcher<TObject, TParam, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>;
|
|
7890
|
+
/**
|
|
7891
|
+
* Registers a collection of objects dispatcher.
|
|
7892
|
+
*
|
|
7893
|
+
* @template TContextData The context data to pass to the {@link Context}.
|
|
7894
|
+
* @template TObject The type of objects to dispatch.
|
|
7895
|
+
* @template TParam The parameter names of the requested URL.
|
|
7896
|
+
* @param name A unique name for the collection dispatcher.
|
|
7897
|
+
* @param itemType The Activity Vocabulary class of the object to dispatch.
|
|
7898
|
+
* @param path The URI path pattern for the collection dispatcher.
|
|
7899
|
+
* The syntax is based on URI Template
|
|
7900
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
|
|
7901
|
+
* The path must have one or more variables.
|
|
7902
|
+
* @param dispatcher A collection dispatcher callback to register.
|
|
7903
|
+
*/
|
|
7904
|
+
setCollectionDispatcher<TObject extends Object$1, TParam extends string>(name: string | symbol, itemType: (new (...args: any[]) => TObject) & {
|
|
7905
|
+
typeId: URL;
|
|
7906
|
+
}, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: CustomCollectionDispatcher<TObject, TParam, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>;
|
|
7907
|
+
/**
|
|
7908
|
+
* Registers a collection of objects dispatcher.
|
|
7909
|
+
*
|
|
7910
|
+
* @template TContextData The context data to pass to the {@link Context}.
|
|
7911
|
+
* @template TObject The type of objects to dispatch.
|
|
7912
|
+
* @template TParam The parameter names of the requested URL.
|
|
7913
|
+
* @param name A unique name for the collection dispatcher.
|
|
7914
|
+
* @param itemType The Activity Vocabulary class of the object to dispatch.
|
|
7915
|
+
* @param path The URI path pattern for the collection dispatcher.
|
|
7916
|
+
* The syntax is based on URI Template
|
|
7917
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
|
|
7918
|
+
* The path must have one or more variables.
|
|
7919
|
+
* @param dispatcher A collection dispatcher callback to register.
|
|
7920
|
+
*/
|
|
7921
|
+
setCollectionDispatcher<TObject extends Object$1, TParam extends string>(name: string | symbol, itemType: (new (...args: any[]) => TObject) & {
|
|
7922
|
+
typeId: URL;
|
|
7923
|
+
}, path: `${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: CustomCollectionDispatcher<TObject, TParam, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>;
|
|
7888
7924
|
/**
|
|
7889
7925
|
* Registers an ordered collection of objects dispatcher.
|
|
7890
7926
|
*
|
|
@@ -7899,7 +7935,43 @@ interface Federatable<TContextData> {
|
|
|
7899
7935
|
* The path must have one or more variables.
|
|
7900
7936
|
* @param dispatcher A collection dispatcher callback to register.
|
|
7901
7937
|
*/
|
|
7902
|
-
setOrderedCollectionDispatcher<TObject extends Object$1,
|
|
7938
|
+
setOrderedCollectionDispatcher<TObject extends Object$1, TParam extends string>(name: string | symbol, itemType: (new (...args: any[]) => TObject) & {
|
|
7939
|
+
typeId: URL;
|
|
7940
|
+
}, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: CustomCollectionDispatcher<TObject, TParam, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>;
|
|
7941
|
+
/**
|
|
7942
|
+
* Registers an ordered collection of objects dispatcher.
|
|
7943
|
+
*
|
|
7944
|
+
* @template TContextData The context data to pass to the {@link Context}.
|
|
7945
|
+
* @template TObject The type of objects to dispatch.
|
|
7946
|
+
* @template TParam The parameter names of the requested URL.
|
|
7947
|
+
* @param name A unique name for the collection dispatcher.
|
|
7948
|
+
* @param itemType The Activity Vocabulary class of the object to dispatch.
|
|
7949
|
+
* @param path The URI path pattern for the collection dispatcher.
|
|
7950
|
+
* The syntax is based on URI Template
|
|
7951
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
|
|
7952
|
+
* The path must have one or more variables.
|
|
7953
|
+
* @param dispatcher A collection dispatcher callback to register.
|
|
7954
|
+
*/
|
|
7955
|
+
setOrderedCollectionDispatcher<TObject extends Object$1, TParam extends string>(name: string | symbol, itemType: (new (...args: any[]) => TObject) & {
|
|
7956
|
+
typeId: URL;
|
|
7957
|
+
}, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: CustomCollectionDispatcher<TObject, TParam, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>;
|
|
7958
|
+
/**
|
|
7959
|
+
* Registers an ordered collection of objects dispatcher.
|
|
7960
|
+
*
|
|
7961
|
+
* @template TContextData The context data to pass to the {@link Context}.
|
|
7962
|
+
* @template TObject The type of objects to dispatch.
|
|
7963
|
+
* @template TParam The parameter names of the requested URL.
|
|
7964
|
+
* @param name A unique name for the collection dispatcher.
|
|
7965
|
+
* @param itemType The Activity Vocabulary class of the object to dispatch.
|
|
7966
|
+
* @param path The URI path pattern for the collection dispatcher.
|
|
7967
|
+
* The syntax is based on URI Template
|
|
7968
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
|
|
7969
|
+
* The path must have one or more variables.
|
|
7970
|
+
* @param dispatcher A collection dispatcher callback to register.
|
|
7971
|
+
*/
|
|
7972
|
+
setOrderedCollectionDispatcher<TObject extends Object$1, TParam extends string>(name: string | symbol, itemType: (new (...args: any[]) => TObject) & {
|
|
7973
|
+
typeId: URL;
|
|
7974
|
+
}, path: `${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: CustomCollectionDispatcher<TObject, TParam, RequestContext<TContextData>, TContextData>): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>;
|
|
7903
7975
|
}
|
|
7904
7976
|
/**
|
|
7905
7977
|
* An object that registers federation-related business logic and dispatches
|
|
@@ -8198,38 +8270,38 @@ interface FederationFetchOptions<TContextData> {
|
|
|
8198
8270
|
/**
|
|
8199
8271
|
* Additional settings for a custom collection dispatcher.
|
|
8200
8272
|
*
|
|
8201
|
-
* @template
|
|
8273
|
+
* @template TParam The type of the parameters in the URL path.
|
|
8202
8274
|
* @template TContext The type of the context. {@link Context} or
|
|
8203
8275
|
* {@link RequestContext}.
|
|
8204
8276
|
* @template TContextData The context data to pass to the {@link Context}.
|
|
8205
8277
|
* @template TFilter The type of filter for the collection.
|
|
8206
8278
|
*/
|
|
8207
|
-
interface CustomCollectionCallbackSetters<
|
|
8279
|
+
interface CustomCollectionCallbackSetters<TParam extends string, TContext extends Context<TContextData>, TContextData> {
|
|
8208
8280
|
/**
|
|
8209
8281
|
* Sets the counter for the custom collection.
|
|
8210
8282
|
* @param counter A callback that returns the number of items in the custom collection.
|
|
8211
8283
|
* @returns The setters object so that settings can be chained.
|
|
8212
8284
|
*/
|
|
8213
|
-
setCounter(counter: CustomCollectionCounter<
|
|
8285
|
+
setCounter(counter: CustomCollectionCounter<TParam, TContextData>): CustomCollectionCallbackSetters<TParam, TContext, TContextData>;
|
|
8214
8286
|
/**
|
|
8215
8287
|
* Sets the first cursor for the custom collection.
|
|
8216
8288
|
* @param cursor The cursor for the first item in the custom collection.
|
|
8217
8289
|
* @returns The setters object so that settings can be chained.
|
|
8218
8290
|
*/
|
|
8219
|
-
setFirstCursor(cursor: CustomCollectionCursor<
|
|
8291
|
+
setFirstCursor(cursor: CustomCollectionCursor<TParam, TContext, TContextData>): CustomCollectionCallbackSetters<TParam, TContext, TContextData>;
|
|
8220
8292
|
/**
|
|
8221
8293
|
* Sets the last cursor for the custom collection.
|
|
8222
8294
|
* @param cursor The cursor for the last item in the custom collection.
|
|
8223
8295
|
* @returns The setters object so that settings can be chained.
|
|
8224
8296
|
*/
|
|
8225
|
-
setLastCursor(cursor: CustomCollectionCursor<
|
|
8297
|
+
setLastCursor(cursor: CustomCollectionCursor<TParam, TContext, TContextData>): CustomCollectionCallbackSetters<TParam, TContext, TContextData>;
|
|
8226
8298
|
/**
|
|
8227
8299
|
* Specifies the conditions under which requests are authorized.
|
|
8228
8300
|
* @param predicate A callback that returns whether a request is authorized.
|
|
8229
8301
|
* @returns The setters object so that settings can be chained.
|
|
8230
8302
|
* @since 0.7.0
|
|
8231
8303
|
*/
|
|
8232
|
-
authorize(predicate: ObjectAuthorizePredicate<TContextData, string>): CustomCollectionCallbackSetters<
|
|
8304
|
+
authorize(predicate: ObjectAuthorizePredicate<TContextData, string>): CustomCollectionCallbackSetters<TParam, TContext, TContextData>;
|
|
8233
8305
|
}
|
|
8234
8306
|
/**
|
|
8235
8307
|
* Represents an object with a type ID, which is either a constructor or an
|
|
@@ -8241,73 +8313,34 @@ type ConstructorWithTypeId<TObject extends Object$1> = (new (...args: any[]) =>
|
|
|
8241
8313
|
typeId: URL;
|
|
8242
8314
|
};
|
|
8243
8315
|
/**
|
|
8244
|
-
*
|
|
8245
|
-
*
|
|
8246
|
-
* values are their string representations.
|
|
8247
|
-
* @returns A string representing the path with all parameters.
|
|
8248
|
-
* @example
|
|
8249
|
-
* ```ts
|
|
8250
|
-
* type UserPostPath = ParamsKeyPath<{ userId: string; postId: string }>;
|
|
8251
|
-
* let userPostPath: UserPostPath;
|
|
8252
|
-
* // userPostPath = "/posts/{postId}"; // invalid - does not contain `{userId}`
|
|
8253
|
-
* // userPostPath = "/users/{userId}"; // invalid - does not contain `{postId}`
|
|
8254
|
-
* userPostPath = "/users/{userId}/posts/{postId}"; // valid
|
|
8255
|
-
* userPostPath = "/posts/{postId}/users/{userId}"; // valid
|
|
8256
|
-
* ```
|
|
8257
|
-
*/
|
|
8258
|
-
type ParamsKeyPath<Params extends Record<string, string>> = ParamsPath<Extract<keyof Params, string>> & string;
|
|
8259
|
-
/**
|
|
8260
|
-
* Represents a path with multiple parameters.
|
|
8261
|
-
* All permutations of the parameters are included in the union type.
|
|
8262
|
-
* The path must have all parameters in the form of `{paramName}`.
|
|
8263
|
-
* @param Params - A union of parameter names.
|
|
8264
|
-
* @returns A string representing the path with all parameters.
|
|
8265
|
-
* @example
|
|
8266
|
-
* ```ts
|
|
8267
|
-
* type UserPostPath = ParamsPath<"userId" | "postId">;
|
|
8268
|
-
* // = `${string}{userId}${string}` & `${string}{postId}${string}`
|
|
8269
|
-
* // =
|
|
8270
|
-
* // | `${string}{userId}${string}{postId}${string}`
|
|
8271
|
-
* // | `${string}{postId}${string}{userId}${string}`
|
|
8272
|
-
* let userPostPath: UserPostPath;
|
|
8273
|
-
* userPostPath = "/users/posts"; // ❌ invalid
|
|
8274
|
-
* userPostPath = "/users/{userId}"; // ❌ invalid
|
|
8275
|
-
* userPostPath = "/posts/{postId}"; // ❌ invalid
|
|
8276
|
-
* userPostPath = "/users/{userId}/posts/{postId}"; // ✅ valid
|
|
8277
|
-
* userPostPath = "/posts/{postId}/users/{userId}"; // ✅ valid
|
|
8278
|
-
*/
|
|
8279
|
-
type ParamsPath<Params extends string> = UnionToIntersection<ParamPath<Params>>;
|
|
8280
|
-
/**
|
|
8281
|
-
* Represents a path with a single parameter.
|
|
8282
|
-
* The path must have at least one of the parameters in the form of `{paramName}`.
|
|
8283
|
-
* @param Param - The name of the parameter.
|
|
8284
|
-
* @returns A string representing the path with the parameter.
|
|
8285
|
-
* @example
|
|
8286
|
-
* ```ts
|
|
8287
|
-
* type UserPostPath = ParamPath<"userId" | "postId">;
|
|
8288
|
-
* // = `${string}{userId}${string}` | `${string}{postId}${string}`
|
|
8289
|
-
* let userPostPath: UserPostPath;
|
|
8290
|
-
* userPostPath = "/users/posts"; // ❌ invalid
|
|
8291
|
-
* userPostPath = "/users/{userId}"; // ✅ valid
|
|
8292
|
-
* userPostPath = "/posts/{postId}"; // ✅ valid
|
|
8293
|
-
* userPostPath = "/users/{userId}/posts/{postId}"; // ✅ valid
|
|
8294
|
-
* userPostPath = "/posts/{postId}/users/{userId}"; // ✅ valid
|
|
8295
|
-
*/
|
|
8296
|
-
type ParamPath<Param extends string> = `${string}{${Param}}${string}`;
|
|
8297
|
-
/**
|
|
8298
|
-
* Converts union types to intersection types.
|
|
8316
|
+
* Defines a union of all valid RFC 6570 URI Template expressions for a given
|
|
8317
|
+
* parameter name.
|
|
8299
8318
|
*
|
|
8300
|
-
*
|
|
8301
|
-
*
|
|
8319
|
+
* RFC 6570 specifies a syntax for URI templates, allowing for variable
|
|
8320
|
+
* expansion. This type captures all Level 1-4 operator expressions for a
|
|
8321
|
+
* single, named variable.
|
|
8322
|
+
*
|
|
8323
|
+
* The supported expression types are:
|
|
8324
|
+
* - `{Param}`: Simple string expansion
|
|
8325
|
+
* - `+{Param}`: Reserved string expansion
|
|
8326
|
+
* - `#{Param}`: Fragment expansion
|
|
8327
|
+
* - `{.Param}`: Label expansion with a dot-prefix
|
|
8328
|
+
* - `{/Param}`: Path segment expansion
|
|
8329
|
+
* - `{;Param}`: Path-style parameter expansion
|
|
8330
|
+
* - `{?Param}`: Query component expansion
|
|
8331
|
+
* - `{&Param}`: Query continuation expansion
|
|
8332
|
+
*
|
|
8333
|
+
* @template Param The name of the parameter to be used in the expressions.
|
|
8302
8334
|
* @example
|
|
8303
8335
|
* ```ts
|
|
8304
|
-
* type
|
|
8305
|
-
*
|
|
8306
|
-
*
|
|
8307
|
-
*
|
|
8308
|
-
*
|
|
8336
|
+
* type UserIdExpression = Rfc6570Expression<"userId">;
|
|
8337
|
+
*
|
|
8338
|
+
* // The variable `userPath` can be assigned any of the valid expressions.
|
|
8339
|
+
* const userPath: UserIdExpression = "{/userId}";
|
|
8340
|
+
* ```
|
|
8341
|
+
* @see {@link https://tools.ietf.org/html/rfc6570} for the full specification.
|
|
8309
8342
|
*/
|
|
8310
|
-
type
|
|
8343
|
+
type Rfc6570Expression<Param extends string> = `{${Param}}` | `{+${Param}}` | `{#${Param}}` | `{.${Param}}` | `{/${Param}}` | `{;${Param}}` | `{?${Param}}` | `{&${Param}}`;
|
|
8311
8344
|
//#endregion
|
|
8312
8345
|
//#region src/federation/context.d.ts
|
|
8313
8346
|
/**
|
package/dist/testing/mod.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import "../type-
|
|
7
|
-
import "../lookup-
|
|
8
|
-
import { createInboxContext, createRequestContext, test, testDefinitions } from "../testing-
|
|
6
|
+
import "../type-C5udJemk.js";
|
|
7
|
+
import "../lookup-RINL4MOa.js";
|
|
8
|
+
import { createInboxContext, createRequestContext, test, testDefinitions } from "../testing-CNtyBr2m.js";
|
|
9
9
|
|
|
10
10
|
export { createInboxContext, createRequestContext, test, testDefinitions };
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { __require, lookupWebFinger } from "./type-
|
|
7
|
-
import { RouterError, lookupObject, traverseCollection } from "./lookup-
|
|
6
|
+
import { __require, lookupWebFinger } from "./type-C5udJemk.js";
|
|
7
|
+
import { RouterError, lookupObject, traverseCollection } from "./lookup-RINL4MOa.js";
|
|
8
8
|
import { configure, getConsoleSink, getLogger, reset } from "@logtape/logtape";
|
|
9
9
|
import { trace } from "@opentelemetry/api";
|
|
10
10
|
|