@fedify/fedify 2.4.0-dev.1422 → 2.4.0-dev.1431
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/{assert-DikXweDx.mjs → assert-OguE97r2.mjs} +1 -1
- package/dist/{assert_instance_of-C4Ri6VuN.mjs → assert_instance_of-DBC5X09g.mjs} +1 -1
- package/dist/{assert_not_equals--wG9hV7u.mjs → assert_not_equals-DkVK8oqV.mjs} +1 -1
- package/dist/{assert_rejects-DQP-q39h.mjs → assert_rejects-DN60FHPX.mjs} +2 -2
- package/dist/{assert_strict_equals-Dmjbg-bA.mjs → assert_strict_equals-XEgZAlrj.mjs} +1 -1
- package/dist/{assert_throws-4NwKEy2q.mjs → assert_throws-BOkhLGYc.mjs} +1 -1
- package/dist/{builder-Gef_ZeDE.mjs → builder-CZR-efLj.mjs} +3 -23
- package/dist/compat/mod.d.cts +1 -1
- package/dist/compat/mod.d.ts +1 -1
- package/dist/compat/outgoing-jsonld.test.mjs +3 -3
- package/dist/compat/public-audience.test.mjs +3 -3
- package/dist/compat/transformers.test.mjs +5 -5
- package/dist/{context-BuGH_Vft.d.cts → context-BBVLF7lx.d.cts} +70 -286
- package/dist/{context-CLtZxCu6.d.ts → context-BU6jSQdo.d.ts} +70 -285
- package/dist/{context-BrIOaBSs.mjs → context-DVoTs_wM.mjs} +1 -7
- package/dist/{deno-BmD7XRaO.mjs → deno-DTMxScEV.mjs} +1 -1
- package/dist/{docloader-B8AJowCx.mjs → docloader-BfWi9rXZ.mjs} +2 -2
- package/dist/federation/builder.test.mjs +5 -5
- package/dist/federation/circuit-breaker.test.mjs +5 -5
- package/dist/federation/collection.test.mjs +3 -3
- package/dist/federation/handler.test.mjs +13 -13
- package/dist/federation/idempotency.test.mjs +6 -6
- package/dist/federation/inbox.test.mjs +3 -3
- package/dist/federation/keycache.test.mjs +5 -5
- package/dist/federation/kv.test.mjs +3 -3
- package/dist/federation/metrics.test.mjs +4 -4
- package/dist/federation/middleware.test.mjs +19 -200
- 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/mq.test.mjs +260 -5
- package/dist/federation/negotiation.test.mjs +4 -4
- package/dist/federation/retry.test.mjs +3 -3
- package/dist/federation/router.test.mjs +5 -5
- package/dist/federation/send.test.mjs +10 -10
- package/dist/federation/temporal.test.mjs +4 -4
- package/dist/federation/webfinger.test.mjs +6 -6
- package/dist/{http-GQoPA_YT.mjs → http-BCpKHsqy.mjs} +4 -4
- package/dist/{http-BCSQJ_gv.cjs → http-CIwbPzeL.cjs} +17 -7
- package/dist/{http-CJ0WNyqA.js → http-D07vE9PZ.js} +17 -7
- package/dist/{key-BLy_TeTg.mjs → key-BjyR4b3H.mjs} +18 -8
- package/dist/{kv-cache-DXwu7BtY.cjs → kv-cache-CXj8cbEx.cjs} +1 -1
- package/dist/{kv-cache-pw-kBdVz.mjs → kv-cache-IEJVfSBn.mjs} +1 -1
- package/dist/{kv-cache-CjEcb9qH.js → kv-cache-LdHRMYlC.js} +1 -1
- package/dist/{ld-CWgxPlZq.mjs → ld-xrOJDs7P.mjs} +3 -3
- package/dist/{metrics-DUKoLd_E.mjs → metrics-BAQhI4a7.mjs} +1 -1
- package/dist/{middleware-BiCk4wGY.cjs → middleware-B1l3sgj_.cjs} +31 -281
- package/dist/{middleware-Dq-HhJHd.mjs → middleware-BQ8dje7a.mjs} +1 -1
- package/dist/{middleware-2Us0G3Iy.js → middleware-BgK5j6TR.js} +31 -281
- package/dist/{middleware-PZaroDUk.mjs → middleware-CvPc_n0b.mjs} +44 -186
- package/dist/{mod-DRokcHeU.d.cts → mod-C0F6kvgS.d.cts} +1 -1
- package/dist/{mod-r-1xOW_C.d.ts → mod-vPYVoa5n.d.ts} +1 -1
- package/dist/mod.cjs +4 -4
- package/dist/mod.d.cts +4 -4
- package/dist/mod.d.ts +4 -4
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/client.test.mjs +3 -3
- package/dist/nodeinfo/handler.test.mjs +5 -5
- package/dist/nodeinfo/types.test.mjs +4 -4
- package/dist/otel/exporter.test.mjs +3 -3
- package/dist/{outgoing-jsonld-BgFLCJQ_.mjs → outgoing-jsonld-L_DbOaFe.mjs} +1 -1
- package/dist/{owner-U0Z8Ex6i.mjs → owner-CHvv4iAW.mjs} +2 -2
- package/dist/{proof-f7K32nz7.js → proof-C9nqy_mp.js} +1 -1
- package/dist/{proof-nb5tfciW.mjs → proof-DOIrkqW_.mjs} +5 -5
- package/dist/{proof-DA3hLGSO.cjs → proof-pmMnJMQe.cjs} +1 -1
- package/dist/{send-CLfW5Fdf.mjs → send-CC8034Mb.mjs} +3 -3
- package/dist/sig/accept.test.mjs +1 -1
- package/dist/sig/http.test.mjs +8 -8
- package/dist/sig/key.test.mjs +56 -6
- package/dist/sig/ld.test.mjs +7 -7
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +6 -6
- package/dist/sig/proof.test.mjs +8 -8
- package/dist/{std__assert-BTEgfoJo.mjs → std__assert-BBjXFNOb.mjs} +4 -4
- package/dist/{temporal-2ry_jdCK.mjs → temporal-CJdpFg8A.mjs} +1 -1
- package/dist/testing/mod.d.mts +7 -378
- package/dist/testing/mod.mjs +2 -3
- package/dist/utils/docloader.test.mjs +6 -6
- 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 -8
- package/dist/codec-Bf-rTqks.mjs +0 -94
- package/dist/federation/tasks/codec.test.d.mts +0 -2
- package/dist/federation/tasks/codec.test.mjs +0 -292
- package/dist/federation/tasks/tasks.test.d.mts +0 -2
- package/dist/federation/tasks/tasks.test.mjs +0 -651
- package/dist/mq-CvJAzRz5.mjs +0 -260
- package/dist/testing-CjYPStvE.mjs +0 -55
- /package/dist/{accept-CceiKpCy.mjs → accept-CPkZzmGN.mjs} +0 -0
- /package/dist/{activity-listener-BeTGV3wc.mjs → activity-listener-tztVvlNb.mjs} +0 -0
- /package/dist/{assert_equals-Ew3jOFa3.mjs → assert_equals-C-ZRDbaf.mjs} +0 -0
- /package/dist/{circuit-breaker-hJBB6jwA.mjs → circuit-breaker-CSWsyoef.mjs} +0 -0
- /package/dist/{client-B_A6mfn3.mjs → client-ByXmQhYD.mjs} +0 -0
- /package/dist/{collection-Dp5ky45w.mjs → collection-Cc3DVAhE.mjs} +0 -0
- /package/dist/{keycache-CaOR6NYg.mjs → keycache-BeU0LCII.mjs} +0 -0
- /package/dist/{keys-C3kae-6B.mjs → keys-DGu1NFwu.mjs} +0 -0
- /package/dist/{kv-x2IvBUyq.mjs → kv-rV3vodCc.mjs} +0 -0
- /package/dist/{negotiation-m_L2nyS3.mjs → negotiation-DDstyBvc.mjs} +0 -0
- /package/dist/{public-audience-N3pyOx2p.mjs → public-audience-Cvbr2Gzt.mjs} +0 -0
- /package/dist/{retry-DI4O-zYl.mjs → retry-CXg_MBI-.mjs} +0 -0
- /package/dist/{types-BFowWFTT.mjs → types-J53Kw7so.mjs} +0 -0
|
@@ -10,7 +10,6 @@ import { MeterProvider, Span, Tracer, TracerProvider } from "@opentelemetry/api"
|
|
|
10
10
|
import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, GetUserAgentOptions } from "@fedify/vocab-runtime";
|
|
11
11
|
import { Link as Link$1, LookupWebFingerOptions, ResourceDescriptor } from "@fedify/webfinger";
|
|
12
12
|
import { MeterProvider as MeterProvider$1, MetricReader } from "@opentelemetry/sdk-metrics";
|
|
13
|
-
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
14
13
|
|
|
15
14
|
//#region src/compat/types.d.ts
|
|
16
15
|
/**
|
|
@@ -611,201 +610,6 @@ declare function respondWithObject(object: Object$1, options?: RespondWithObject
|
|
|
611
610
|
*/
|
|
612
611
|
declare function respondWithObjectIfAcceptable(object: Object$1, request: Request, options?: RespondWithObjectOptions): Promise<Response | null>;
|
|
613
612
|
//#endregion
|
|
614
|
-
//#region src/federation/retry.d.ts
|
|
615
|
-
/**
|
|
616
|
-
* The context passed to a {@link RetryPolicy} callback.
|
|
617
|
-
* @since 0.12.0
|
|
618
|
-
*/
|
|
619
|
-
interface RetryContext {
|
|
620
|
-
/**
|
|
621
|
-
* The elapsed time since the first attempt.
|
|
622
|
-
*/
|
|
623
|
-
readonly elapsedTime: Temporal.Duration;
|
|
624
|
-
/**
|
|
625
|
-
* The number of attempts so far.
|
|
626
|
-
*/
|
|
627
|
-
readonly attempts: number;
|
|
628
|
-
}
|
|
629
|
-
/**
|
|
630
|
-
* A policy that determines the delay before the next retry.
|
|
631
|
-
* @param context The retry context.
|
|
632
|
-
* @returns The delay before the next retry, or `null` to stop retrying.
|
|
633
|
-
* It must not negative.
|
|
634
|
-
* @since 0.12.0
|
|
635
|
-
*/
|
|
636
|
-
type RetryPolicy = (context: RetryContext) => Temporal.Duration | null;
|
|
637
|
-
/**
|
|
638
|
-
* Options for {@link createExponentialBackoffPolicy} function.
|
|
639
|
-
* @since 0.12.0
|
|
640
|
-
*/
|
|
641
|
-
interface CreateExponentialBackoffPolicyOptions {
|
|
642
|
-
/**
|
|
643
|
-
* The initial delay before the first retry. Defaults to 1 second.
|
|
644
|
-
*/
|
|
645
|
-
readonly initialDelay?: Temporal.DurationLike;
|
|
646
|
-
/**
|
|
647
|
-
* The maximum delay between retries. Defaults to 12 hours.
|
|
648
|
-
*/
|
|
649
|
-
readonly maxDelay?: Temporal.DurationLike;
|
|
650
|
-
/**
|
|
651
|
-
* The maximum number of attempts before giving up.
|
|
652
|
-
* Defaults to 10.
|
|
653
|
-
*/
|
|
654
|
-
readonly maxAttempts?: number;
|
|
655
|
-
/**
|
|
656
|
-
* The factor to multiply the previous delay by for each retry.
|
|
657
|
-
* Defaults to 2.
|
|
658
|
-
*/
|
|
659
|
-
readonly factor?: number;
|
|
660
|
-
/**
|
|
661
|
-
* Whether to add jitter to the delay to avoid synchronization.
|
|
662
|
-
* Turned on by default.
|
|
663
|
-
*/
|
|
664
|
-
readonly jitter?: boolean;
|
|
665
|
-
}
|
|
666
|
-
/**
|
|
667
|
-
* Creates an exponential backoff retry policy. The delay between retries
|
|
668
|
-
* starts at the `initialDelay` and is multiplied by the `factor` for each
|
|
669
|
-
* subsequent retry, up to the `maxDelay`. The policy will give up after
|
|
670
|
-
* `maxAttempts` attempts. The actual delay is randomized to avoid
|
|
671
|
-
* synchronization (jitter).
|
|
672
|
-
* @param options The options for the policy.
|
|
673
|
-
* @returns The retry policy.
|
|
674
|
-
* @since 0.12.0
|
|
675
|
-
*/
|
|
676
|
-
declare function createExponentialBackoffPolicy(options?: CreateExponentialBackoffPolicyOptions): RetryPolicy;
|
|
677
|
-
//#endregion
|
|
678
|
-
//#region src/federation/tasks/task.d.ts
|
|
679
|
-
/**
|
|
680
|
-
* A callback that processes a custom background task.
|
|
681
|
-
* @template TContextData The context data to pass to the {@link Context}.
|
|
682
|
-
* @template TData The type of the task payload, inferred from the task's
|
|
683
|
-
* schema.
|
|
684
|
-
* @param ctx The context for the worker processing the task.
|
|
685
|
-
* @param data The decoded and validated task payload.
|
|
686
|
-
* @since 2.x.x
|
|
687
|
-
*/
|
|
688
|
-
type TaskHandler<TContextData, TData> = (ctx: Context<TContextData>, data: TData) => Promise<void> | void;
|
|
689
|
-
/**
|
|
690
|
-
* Options for {@link TaskRegistry.defineTask}.
|
|
691
|
-
* @template TContextData The context data to pass to the {@link Context}.
|
|
692
|
-
* @template TSchema The [Standard Schema](https://standardschema.dev/) that
|
|
693
|
-
* validates the task payload.
|
|
694
|
-
* @since 2.x.x
|
|
695
|
-
*/
|
|
696
|
-
interface TaskDefinitionOptions<TContextData, TSchema extends StandardSchemaV1> {
|
|
697
|
-
/**
|
|
698
|
-
* The [Standard Schema](https://standardschema.dev/) that validates the
|
|
699
|
-
* task payload. The payload type is inferred from this schema.
|
|
700
|
-
*
|
|
701
|
-
* The payload is validated twice: once at enqueue time (fail fast) and
|
|
702
|
-
* once at dequeue time (drift protection against payloads enqueued by an
|
|
703
|
-
* older deployment). Because the same schema runs on both sides, its
|
|
704
|
-
* validation must be idempotent: the validated output must itself be
|
|
705
|
-
* a valid input. Transforming schemas (e.g., Zod's `.transform()`) whose
|
|
706
|
-
* output differs in shape from their input are not supported.
|
|
707
|
-
*/
|
|
708
|
-
readonly schema: TSchema;
|
|
709
|
-
/**
|
|
710
|
-
* The callback that processes the task on a background worker.
|
|
711
|
-
*/
|
|
712
|
-
readonly handler: TaskHandler<TContextData, StandardSchemaV1.InferOutput<TSchema>>;
|
|
713
|
-
/**
|
|
714
|
-
* The retry policy for this task. If omitted, the federation-wide
|
|
715
|
-
* task retry policy is used, which defaults to an exponential backoff
|
|
716
|
-
* policy.
|
|
717
|
-
*/
|
|
718
|
-
readonly retryPolicy?: RetryPolicy;
|
|
719
|
-
/**
|
|
720
|
-
* A callback invoked when the {@link handler} throws an error, before
|
|
721
|
-
* a retry is scheduled.
|
|
722
|
-
* @param ctx The context for the worker processing the task.
|
|
723
|
-
* @param error The error thrown by the handler.
|
|
724
|
-
* @param data The decoded and validated task payload.
|
|
725
|
-
*/
|
|
726
|
-
readonly onError?: (ctx: Context<TContextData>, error: unknown, data: StandardSchemaV1.InferOutput<TSchema>) => Promise<void> | void;
|
|
727
|
-
/**
|
|
728
|
-
* The message queue dedicated to this task. If omitted, the task is
|
|
729
|
-
* routed to the federation-wide task queue, falling back to the outbox
|
|
730
|
-
* queue (unless `taskQueueResolution: "strict"` is configured).
|
|
731
|
-
*/
|
|
732
|
-
readonly queue?: MessageQueue;
|
|
733
|
-
}
|
|
734
|
-
/**
|
|
735
|
-
* Phantom key binding a {@link TaskDefinition} to its federation's context
|
|
736
|
-
* data type. Declared only—no value exists at runtime, and the symbol is
|
|
737
|
-
* not exported, so the marker stays out of user-facing completions.
|
|
738
|
-
*/
|
|
739
|
-
declare const contextDataBrand: unique symbol;
|
|
740
|
-
/**
|
|
741
|
-
* The handle returned by {@link TaskRegistry.defineTask}. It carries the
|
|
742
|
-
* task name and schema so that {@link Context.enqueueTask} can validate the
|
|
743
|
-
* payload and infer its type at every call site.
|
|
744
|
-
* @template TContextData The context data to pass to the {@link Context}.
|
|
745
|
-
* @template TData The type of the task payload, inferred from the task's
|
|
746
|
-
* schema.
|
|
747
|
-
* @since 2.x.x
|
|
748
|
-
*/
|
|
749
|
-
interface TaskDefinition<TContextData, TData> {
|
|
750
|
-
/**
|
|
751
|
-
* The unique name of the task.
|
|
752
|
-
*/
|
|
753
|
-
readonly name: string;
|
|
754
|
-
/**
|
|
755
|
-
* The [Standard Schema](https://standardschema.dev/) that validates the
|
|
756
|
-
* task payload.
|
|
757
|
-
*/
|
|
758
|
-
readonly schema: StandardSchemaV1<unknown, TData>;
|
|
759
|
-
/**
|
|
760
|
-
* @internal Phantom marker binding the handle to its federation.
|
|
761
|
-
*/
|
|
762
|
-
readonly [contextDataBrand]?: TContextData;
|
|
763
|
-
}
|
|
764
|
-
/**
|
|
765
|
-
* Registration of custom background tasks. Both {@link Federation} and
|
|
766
|
-
* {@link FederationBuilder} implement this interface.
|
|
767
|
-
* @template TContextData The context data to pass to the {@link Context}.
|
|
768
|
-
* @since 2.x.x
|
|
769
|
-
*/
|
|
770
|
-
interface TaskRegistry<TContextData> {
|
|
771
|
-
/**
|
|
772
|
-
* Defines a custom background task. The returned handle is passed to
|
|
773
|
-
* {@link Context.enqueueTask} to enqueue the task.
|
|
774
|
-
*
|
|
775
|
-
* @example
|
|
776
|
-
* ``` typescript
|
|
777
|
-
* const sendDigest = federation.defineTask("sendDigest", {
|
|
778
|
-
* schema: digestSchema,
|
|
779
|
-
* handler: async (ctx, data) => {
|
|
780
|
-
* // …process the payload on a background worker…
|
|
781
|
-
* },
|
|
782
|
-
* });
|
|
783
|
-
* ```
|
|
784
|
-
*
|
|
785
|
-
* @param name The unique name of the task.
|
|
786
|
-
* @param options The task definition options. The payload type is
|
|
787
|
-
* inferred from `options.schema`.
|
|
788
|
-
* @returns The handle to pass to {@link Context.enqueueTask}.
|
|
789
|
-
* @throws {TypeError} If a task with the same name is already defined.
|
|
790
|
-
*/
|
|
791
|
-
defineTask<TSchema extends StandardSchemaV1>(name: string, options: TaskDefinitionOptions<TContextData, TSchema>): TaskDefinition<TContextData, StandardSchemaV1.InferOutput<TSchema>>;
|
|
792
|
-
}
|
|
793
|
-
/**
|
|
794
|
-
* Options for {@link Context.enqueueTask} and {@link Context.enqueueTaskMany}.
|
|
795
|
-
* @since 2.x.x
|
|
796
|
-
*/
|
|
797
|
-
interface TaskEnqueueOptions {
|
|
798
|
-
/**
|
|
799
|
-
* The delay before the task is processed. No delay by default.
|
|
800
|
-
*/
|
|
801
|
-
readonly delay?: Temporal.DurationLike;
|
|
802
|
-
/**
|
|
803
|
-
* An optional key that ensures tasks with the same ordering key are
|
|
804
|
-
* processed sequentially (one at a time).
|
|
805
|
-
*/
|
|
806
|
-
readonly orderingKey?: string;
|
|
807
|
-
}
|
|
808
|
-
//#endregion
|
|
809
613
|
//#region src/federation/builder.d.ts
|
|
810
614
|
/**
|
|
811
615
|
* Creates a new {@link FederationBuilder} instance.
|
|
@@ -828,7 +632,7 @@ interface SenderKeyJwkPair {
|
|
|
828
632
|
* type.
|
|
829
633
|
* @since 1.6.0
|
|
830
634
|
*/
|
|
831
|
-
type Message = FanoutMessage | OutboxMessage | InboxMessage
|
|
635
|
+
type Message = FanoutMessage | OutboxMessage | InboxMessage;
|
|
832
636
|
interface FanoutMessage {
|
|
833
637
|
readonly type: "fanout";
|
|
834
638
|
readonly id: ReturnType<typeof crypto.randomUUID>;
|
|
@@ -882,24 +686,6 @@ interface OutboxMessage {
|
|
|
882
686
|
readonly circuitHeldSince?: string;
|
|
883
687
|
readonly traceContext: Readonly<Record<string, string>>;
|
|
884
688
|
}
|
|
885
|
-
/**
|
|
886
|
-
* A message that carries a custom background task. Every field is
|
|
887
|
-
* a string, number, or plain record so that the message survives both
|
|
888
|
-
* JSON serialization and structured clone on every queue backend.
|
|
889
|
-
* @since 2.x.x
|
|
890
|
-
*/
|
|
891
|
-
interface TaskMessage {
|
|
892
|
-
readonly type: "task";
|
|
893
|
-
readonly id: ReturnType<typeof crypto.randomUUID>;
|
|
894
|
-
readonly baseUrl: string;
|
|
895
|
-
readonly taskName: string;
|
|
896
|
-
/** devalue-encoded task data; vocab objects bridged to expanded JSON-LD. */
|
|
897
|
-
readonly data: string;
|
|
898
|
-
readonly started: string;
|
|
899
|
-
readonly attempt: number;
|
|
900
|
-
readonly orderingKey?: string;
|
|
901
|
-
readonly traceContext: Readonly<Record<string, string>>;
|
|
902
|
-
}
|
|
903
689
|
interface InboxMessage {
|
|
904
690
|
readonly type: "inbox";
|
|
905
691
|
readonly id: ReturnType<typeof crypto.randomUUID>;
|
|
@@ -947,6 +733,70 @@ interface InboxMessage {
|
|
|
947
733
|
readonly traceContext: Readonly<Record<string, string>>;
|
|
948
734
|
}
|
|
949
735
|
//#endregion
|
|
736
|
+
//#region src/federation/retry.d.ts
|
|
737
|
+
/**
|
|
738
|
+
* The context passed to a {@link RetryPolicy} callback.
|
|
739
|
+
* @since 0.12.0
|
|
740
|
+
*/
|
|
741
|
+
interface RetryContext {
|
|
742
|
+
/**
|
|
743
|
+
* The elapsed time since the first attempt.
|
|
744
|
+
*/
|
|
745
|
+
readonly elapsedTime: Temporal.Duration;
|
|
746
|
+
/**
|
|
747
|
+
* The number of attempts so far.
|
|
748
|
+
*/
|
|
749
|
+
readonly attempts: number;
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* A policy that determines the delay before the next retry.
|
|
753
|
+
* @param context The retry context.
|
|
754
|
+
* @returns The delay before the next retry, or `null` to stop retrying.
|
|
755
|
+
* It must not negative.
|
|
756
|
+
* @since 0.12.0
|
|
757
|
+
*/
|
|
758
|
+
type RetryPolicy = (context: RetryContext) => Temporal.Duration | null;
|
|
759
|
+
/**
|
|
760
|
+
* Options for {@link createExponentialBackoffPolicy} function.
|
|
761
|
+
* @since 0.12.0
|
|
762
|
+
*/
|
|
763
|
+
interface CreateExponentialBackoffPolicyOptions {
|
|
764
|
+
/**
|
|
765
|
+
* The initial delay before the first retry. Defaults to 1 second.
|
|
766
|
+
*/
|
|
767
|
+
readonly initialDelay?: Temporal.DurationLike;
|
|
768
|
+
/**
|
|
769
|
+
* The maximum delay between retries. Defaults to 12 hours.
|
|
770
|
+
*/
|
|
771
|
+
readonly maxDelay?: Temporal.DurationLike;
|
|
772
|
+
/**
|
|
773
|
+
* The maximum number of attempts before giving up.
|
|
774
|
+
* Defaults to 10.
|
|
775
|
+
*/
|
|
776
|
+
readonly maxAttempts?: number;
|
|
777
|
+
/**
|
|
778
|
+
* The factor to multiply the previous delay by for each retry.
|
|
779
|
+
* Defaults to 2.
|
|
780
|
+
*/
|
|
781
|
+
readonly factor?: number;
|
|
782
|
+
/**
|
|
783
|
+
* Whether to add jitter to the delay to avoid synchronization.
|
|
784
|
+
* Turned on by default.
|
|
785
|
+
*/
|
|
786
|
+
readonly jitter?: boolean;
|
|
787
|
+
}
|
|
788
|
+
/**
|
|
789
|
+
* Creates an exponential backoff retry policy. The delay between retries
|
|
790
|
+
* starts at the `initialDelay` and is multiplied by the `factor` for each
|
|
791
|
+
* subsequent retry, up to the `maxDelay`. The policy will give up after
|
|
792
|
+
* `maxAttempts` attempts. The actual delay is randomized to avoid
|
|
793
|
+
* synchronization (jitter).
|
|
794
|
+
* @param options The options for the policy.
|
|
795
|
+
* @returns The retry policy.
|
|
796
|
+
* @since 0.12.0
|
|
797
|
+
*/
|
|
798
|
+
declare function createExponentialBackoffPolicy(options?: CreateExponentialBackoffPolicyOptions): RetryPolicy;
|
|
799
|
+
//#endregion
|
|
950
800
|
//#region src/federation/middleware.d.ts
|
|
951
801
|
/**
|
|
952
802
|
* Configures the task queues for sending and receiving activities.
|
|
@@ -970,13 +820,6 @@ interface FederationQueueOptions {
|
|
|
970
820
|
* {@link Context.sendActivity} calls.
|
|
971
821
|
*/
|
|
972
822
|
readonly fanout?: MessageQueue;
|
|
973
|
-
/**
|
|
974
|
-
* The message queue for custom background tasks. If not provided,
|
|
975
|
-
* tasks are routed to the outbox queue (unless
|
|
976
|
-
* {@link FederationOptions.taskQueueResolution} is `"strict"`).
|
|
977
|
-
* @since 2.x.x
|
|
978
|
-
*/
|
|
979
|
-
readonly task?: MessageQueue;
|
|
980
823
|
}
|
|
981
824
|
/**
|
|
982
825
|
* Prefixes for namespacing keys in the Deno KV store.
|
|
@@ -1061,18 +904,18 @@ interface FederationStartQueueOptions {
|
|
|
1061
904
|
signal?: AbortSignal;
|
|
1062
905
|
/**
|
|
1063
906
|
* Starts the task worker only for the specified queue. If unspecified,
|
|
1064
|
-
* which is the default, the task worker starts for all
|
|
1065
|
-
* inbox, outbox,
|
|
907
|
+
* which is the default, the task worker starts for all three queues:
|
|
908
|
+
* inbox, outbox, and fanout.
|
|
1066
909
|
* @since 1.3.0
|
|
1067
910
|
*/
|
|
1068
|
-
queue?: "inbox" | "outbox" | "fanout"
|
|
911
|
+
queue?: "inbox" | "outbox" | "fanout";
|
|
1069
912
|
}
|
|
1070
913
|
/**
|
|
1071
914
|
* A common interface between {@link Federation} and {@link FederationBuilder}.
|
|
1072
915
|
* @template TContextData The context data to pass to the {@link Context}.
|
|
1073
916
|
* @since 1.6.0
|
|
1074
917
|
*/
|
|
1075
|
-
interface Federatable<TContextData>
|
|
918
|
+
interface Federatable<TContextData> {
|
|
1076
919
|
/**
|
|
1077
920
|
* Registers a NodeInfo dispatcher.
|
|
1078
921
|
* @param path The URI path pattern for the NodeInfo dispatcher. The syntax
|
|
@@ -1779,26 +1622,6 @@ interface FederationOptions<TContextData> {
|
|
|
1779
1622
|
*/
|
|
1780
1623
|
inboxRetryPolicy?: RetryPolicy;
|
|
1781
1624
|
/**
|
|
1782
|
-
* The retry policy for processing custom background tasks. By default,
|
|
1783
|
-
* this uses an exponential backoff strategy with a maximum of 10 attempts
|
|
1784
|
-
* and a maximum delay of 12 hours. A per-task retry policy
|
|
1785
|
-
* ({@link TaskDefinitionOptions.retryPolicy}) overrides this.
|
|
1786
|
-
* @since 2.x.x
|
|
1787
|
-
*/
|
|
1788
|
-
taskRetryPolicy?: RetryPolicy;
|
|
1789
|
-
/**
|
|
1790
|
-
* How a queue is resolved for a custom background task when neither
|
|
1791
|
-
* a per-task queue ({@link TaskDefinitionOptions.queue}) nor a dedicated
|
|
1792
|
-
* task queue ({@link FederationQueueOptions.task}) is configured.
|
|
1793
|
-
*
|
|
1794
|
-
* - `"fallback"` (the default): the task is routed to the outbox queue.
|
|
1795
|
-
* - `"strict"`: no fallback; enqueuing the task throws instead of
|
|
1796
|
-
* silently sharing the outbox queue.
|
|
1797
|
-
* @default `"fallback"`
|
|
1798
|
-
* @since 2.x.x
|
|
1799
|
-
*/
|
|
1800
|
-
taskQueueResolution?: "fallback" | "strict";
|
|
1801
|
-
/**
|
|
1802
1625
|
* Activity transformers that are applied to outgoing activities. It is
|
|
1803
1626
|
* useful for adjusting outgoing activities to satisfy some ActivityPub
|
|
1804
1627
|
* implementations.
|
|
@@ -2551,44 +2374,6 @@ interface Context<TContextData> {
|
|
|
2551
2374
|
*/
|
|
2552
2375
|
routeActivity(recipient: string | null, activity: Activity, options?: RouteActivityOptions): Promise<boolean>;
|
|
2553
2376
|
/**
|
|
2554
|
-
* Enqueues a custom background task. The payload is validated against
|
|
2555
|
-
* the task's schema, serialized, and processed by the task's handler on
|
|
2556
|
-
* a background worker.
|
|
2557
|
-
*
|
|
2558
|
-
* @example
|
|
2559
|
-
* ``` typescript
|
|
2560
|
-
* await ctx.enqueueTask(sendDigest, { userId: "alice" });
|
|
2561
|
-
* ```
|
|
2562
|
-
*
|
|
2563
|
-
* @template TData The type of the task payload, inferred from the task's
|
|
2564
|
-
* schema.
|
|
2565
|
-
* @param task The handle returned by {@link TaskRegistry.defineTask}.
|
|
2566
|
-
* @param data The task payload. It is validated against the task's
|
|
2567
|
-
* schema before being enqueued.
|
|
2568
|
-
* @param options Options for enqueuing the task.
|
|
2569
|
-
* @throws {TypeError} If the task is not defined on this federation,
|
|
2570
|
-
* if no message queue is configured for tasks, or if
|
|
2571
|
-
* the payload fails schema validation.
|
|
2572
|
-
* @since 2.x.x
|
|
2573
|
-
*/
|
|
2574
|
-
enqueueTask<TData>(task: TaskDefinition<TContextData, TData>, data: TData, options?: TaskEnqueueOptions): Promise<void>;
|
|
2575
|
-
/**
|
|
2576
|
-
* Enqueues multiple payloads for a custom background task at once.
|
|
2577
|
-
* Uses the queue's bulk enqueue operation when available, falling back
|
|
2578
|
-
* to parallel single enqueues.
|
|
2579
|
-
* @template TData The type of the task payload, inferred from the task's
|
|
2580
|
-
* schema.
|
|
2581
|
-
* @param task The handle returned by {@link TaskRegistry.defineTask}.
|
|
2582
|
-
* @param payloads The task payloads. Each is validated against the
|
|
2583
|
-
* task's schema before being enqueued.
|
|
2584
|
-
* @param options Options for enqueuing the tasks.
|
|
2585
|
-
* @throws {TypeError} If the task is not defined on this federation,
|
|
2586
|
-
* if no message queue is configured for tasks, or if
|
|
2587
|
-
* a payload fails schema validation.
|
|
2588
|
-
* @since 2.x.x
|
|
2589
|
-
*/
|
|
2590
|
-
enqueueTaskMany<TData>(task: TaskDefinition<TContextData, TData>, payloads: readonly TData[], options?: TaskEnqueueOptions): Promise<void>;
|
|
2591
|
-
/**
|
|
2592
2377
|
* Builds the URI of a collection of objects with the given name and values.
|
|
2593
2378
|
* @param name The name of the collection, which can be a string or a symbol.
|
|
2594
2379
|
* @param values The values of the URI parameters.
|
|
@@ -3099,4 +2884,4 @@ interface ActorKeyPair extends CryptoKeyPair {
|
|
|
3099
2884
|
readonly multikey: Multikey;
|
|
3100
2885
|
}
|
|
3101
2886
|
//#endregion
|
|
3102
|
-
export {
|
|
2887
|
+
export { CustomCollectionCursor as $, Rfc6570Expression as A, parseCircuitBreakerKvState as At, createFederationBuilder as B, FederationStartQueueOptions as C, CircuitBreakerFailurePolicy as Ct, InboxListenerSetters as D, CircuitBreakerStateChange as Dt, InboxChallengePolicy as E, CircuitBreakerState as Et, CreateExponentialBackoffPolicyOptions as F, ActorDispatcher as G, respondWithObject as H, RetryContext as I, AuthorizePredicate as J, ActorHandleMapper as K, RetryPolicy as L, FederationOrigin as M, FederationQueueOptions as N, ObjectCallbackSetters as O, NormalizedCircuitBreakerOptions as Ot, createFederation as P, CustomCollectionCounter as Q, createExponentialBackoffPolicy as R, FederationOptions as S, CircuitBreakerCreateOptions as St, IdempotencyStrategy as T, CircuitBreakerOptions as Tt, respondWithObjectIfAcceptable as U, RespondWithObjectOptions as V, ActorAliasMapper as W, CollectionCursor as X, CollectionCounter as Y, CollectionDispatcher as Z, Federatable as _, buildCollectionSynchronizationHeader as _t, GetSignedKeyOptions as a, ObjectDispatcher as at, FederationBuilder as b, CircuitBreakerActivityDrop as bt, ParseUriResult as c, OutboxListenerErrorHandler as ct, SendActivityOptions as d, UnverifiedActivityHandler as dt, CustomCollectionDispatcher as et, SendActivityOptionsForCollection as f, UnverifiedActivityReason as ft, CustomCollectionCallbackSetters as g, PageItems as gt, ConstructorWithTypeId as h, SenderKeyPair as ht, GetActorOptions as i, ObjectAuthorizePredicate as it, FederationKvPrefixes as j, ActivityTransformer as jt, OutboxListenerSetters as k, normalizeCircuitBreakerOptions as kt, RequestContext as l, OutboxPermanentFailureHandler as lt, CollectionCallbackSetters as m, SendActivityError as mt, Context as n, InboxListener as nt, InboxContext as o, OutboxErrorHandler as ot, ActorCallbackSetters as p, WebFingerLinksDispatcher as pt, ActorKeyPairsDispatcher as q, ForwardActivityOptions as r, NodeInfoDispatcher as rt, OutboxContext as s, OutboxListener as st, ActorKeyPair as t, InboxErrorHandler as tt, RouteActivityOptions as u, SharedInboxKeyDispatcher as ut, Federation as v, digest as vt, IdempotencyKeyCallback as w, CircuitBreakerKvState as wt, FederationFetchOptions as x, CircuitBreakerBeforeSendDecision as xt, FederationBenchmarkOptions as y, CircuitBreaker as yt, Message as z };
|
|
@@ -66,7 +66,7 @@ const testDefinitions = [];
|
|
|
66
66
|
//#endregion
|
|
67
67
|
//#region src/testing/context.ts
|
|
68
68
|
function createContext(values) {
|
|
69
|
-
const { federation, url = new URL("http://example.com/"), canonicalOrigin, data, documentLoader, contextLoader, meterProvider, tracerProvider, clone, getNodeInfoUri, getActorUri, getObjectUri, getCollectionUri, getOutboxUri, getInboxUri, getFollowingUri, getFollowersUri, getLikedUri, getFeaturedUri, getFeaturedTagsUri, parseUri, getActorKeyPairs, getDocumentLoader, lookupObject: lookupObject$1, traverseCollection: traverseCollection$1, lookupNodeInfo, lookupWebFinger: lookupWebFinger$1, sendActivity, routeActivity
|
|
69
|
+
const { federation, url = new URL("http://example.com/"), canonicalOrigin, data, documentLoader, contextLoader, meterProvider, tracerProvider, clone, getNodeInfoUri, getActorUri, getObjectUri, getCollectionUri, getOutboxUri, getInboxUri, getFollowingUri, getFollowersUri, getLikedUri, getFeaturedUri, getFeaturedTagsUri, parseUri, getActorKeyPairs, getDocumentLoader, lookupObject: lookupObject$1, traverseCollection: traverseCollection$1, lookupNodeInfo, lookupWebFinger: lookupWebFinger$1, sendActivity, routeActivity } = values;
|
|
70
70
|
function throwRouterError() {
|
|
71
71
|
throw new RouterError("Not implemented");
|
|
72
72
|
}
|
|
@@ -126,12 +126,6 @@ function createContext(values) {
|
|
|
126
126
|
}),
|
|
127
127
|
routeActivity: routeActivity ?? ((_params) => {
|
|
128
128
|
throw new Error("Not implemented");
|
|
129
|
-
}),
|
|
130
|
-
enqueueTask: enqueueTask ?? ((_task, _data, _options) => {
|
|
131
|
-
throw new Error("Not implemented");
|
|
132
|
-
}),
|
|
133
|
-
enqueueTaskMany: enqueueTaskMany ?? ((_task, _payloads, _options) => {
|
|
134
|
-
throw new Error("Not implemented");
|
|
135
129
|
})
|
|
136
130
|
};
|
|
137
131
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { o as validateCryptoKey } from "./key-
|
|
5
|
-
import { n as doubleKnock } from "./http-
|
|
4
|
+
import { o as validateCryptoKey } from "./key-BjyR4b3H.mjs";
|
|
5
|
+
import { n as doubleKnock } from "./http-BCpKHsqy.mjs";
|
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
|
7
7
|
import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, validatePublicUrl } from "@fedify/vocab-runtime";
|
|
8
8
|
import { curry } from "es-toolkit";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as assertEquals } from "../assert_equals-
|
|
5
|
-
import { r as assertExists } from "../std__assert-
|
|
6
|
-
import { t as assertThrows } from "../assert_throws-
|
|
7
|
-
import { t as MemoryKvStore } from "../kv-
|
|
8
|
-
import { r as createFederationBuilder } from "../builder-
|
|
4
|
+
import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
|
|
5
|
+
import { r as assertExists } from "../std__assert-BBjXFNOb.mjs";
|
|
6
|
+
import { t as assertThrows } from "../assert_throws-BOkhLGYc.mjs";
|
|
7
|
+
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
8
|
+
import { r as createFederationBuilder } from "../builder-CZR-efLj.mjs";
|
|
9
9
|
import { DisallowedOperatorError, DisallowedVarSpecModifierError, DuplicateRouteVariableError, RouteTemplateOptionsNotMatchedError, RouterError } from "@fedify/uri-template";
|
|
10
10
|
import { Activity, Note, Person } from "@fedify/vocab";
|
|
11
11
|
import { test } from "@fedify/fixture";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as assertEquals } from "../assert_equals-
|
|
5
|
-
import "../std__assert-
|
|
6
|
-
import { t as assertThrows } from "../assert_throws-
|
|
7
|
-
import { t as MemoryKvStore } from "../kv-
|
|
8
|
-
import { n as normalizeCircuitBreakerOptions, r as parseCircuitBreakerKvState, t as CircuitBreaker } from "../circuit-breaker-
|
|
4
|
+
import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
|
|
5
|
+
import "../std__assert-BBjXFNOb.mjs";
|
|
6
|
+
import { t as assertThrows } from "../assert_throws-BOkhLGYc.mjs";
|
|
7
|
+
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
8
|
+
import { n as normalizeCircuitBreakerOptions, r as parseCircuitBreakerKvState, t as CircuitBreaker } from "../circuit-breaker-CSWsyoef.mjs";
|
|
9
9
|
import { test } from "@fedify/fixture";
|
|
10
10
|
//#region src/federation/circuit-breaker.test.ts
|
|
11
11
|
var AlwaysConflictingKvStore = class extends MemoryKvStore {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as assertEquals } from "../assert_equals-
|
|
5
|
-
import "../std__assert-
|
|
6
|
-
import { n as digest, t as buildCollectionSynchronizationHeader } from "../collection-
|
|
4
|
+
import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
|
|
5
|
+
import "../std__assert-BBjXFNOb.mjs";
|
|
6
|
+
import { n as digest, t as buildCollectionSynchronizationHeader } from "../collection-Cc3DVAhE.mjs";
|
|
7
7
|
import { test } from "@fedify/fixture";
|
|
8
8
|
import { decodeHex } from "byte-encodings/hex";
|
|
9
9
|
//#region src/federation/collection.test.ts
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-
|
|
5
|
-
import { t as assertEquals } from "../assert_equals-
|
|
6
|
-
import "../std__assert-
|
|
7
|
-
import { n as assertGreaterOrEqual, t as assertRejects } from "../assert_rejects-
|
|
8
|
-
import { t as assertInstanceOf } from "../assert_instance_of-
|
|
9
|
-
import { t as assert } from "../assert-
|
|
10
|
-
import { r as parseAcceptSignature } from "../accept-
|
|
11
|
-
import { s as signRequest } from "../http-
|
|
12
|
-
import { a as rsaPrivateKey3, c as rsaPublicKey3, s as rsaPublicKey2 } from "../keys-
|
|
13
|
-
import { a as compactJsonLd, p as signJsonLd } from "../ld-
|
|
14
|
-
import { t as MemoryKvStore } from "../kv-
|
|
15
|
-
import { c as handleActor, d as handleInbox, f as handleObject, h as respondWithObjectIfAcceptable, l as handleCollection, m as respondWithObject, o as createFederation, p as handleOutbox, u as handleCustomCollection } from "../middleware-
|
|
16
|
-
import { t as ActivityListenerSet } from "../activity-listener-
|
|
4
|
+
import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-DVoTs_wM.mjs";
|
|
5
|
+
import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
|
|
6
|
+
import "../std__assert-BBjXFNOb.mjs";
|
|
7
|
+
import { n as assertGreaterOrEqual, t as assertRejects } from "../assert_rejects-DN60FHPX.mjs";
|
|
8
|
+
import { t as assertInstanceOf } from "../assert_instance_of-DBC5X09g.mjs";
|
|
9
|
+
import { t as assert } from "../assert-OguE97r2.mjs";
|
|
10
|
+
import { r as parseAcceptSignature } from "../accept-CPkZzmGN.mjs";
|
|
11
|
+
import { s as signRequest } from "../http-BCpKHsqy.mjs";
|
|
12
|
+
import { a as rsaPrivateKey3, c as rsaPublicKey3, s as rsaPublicKey2 } from "../keys-DGu1NFwu.mjs";
|
|
13
|
+
import { a as compactJsonLd, p as signJsonLd } from "../ld-xrOJDs7P.mjs";
|
|
14
|
+
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
15
|
+
import { c as handleActor, d as handleInbox, f as handleObject, h as respondWithObjectIfAcceptable, l as handleCollection, m as respondWithObject, o as createFederation, p as handleOutbox, u as handleCustomCollection } from "../middleware-CvPc_n0b.mjs";
|
|
16
|
+
import { t as ActivityListenerSet } from "../activity-listener-tztVvlNb.mjs";
|
|
17
17
|
import { Activity, Create, Note, Person, Tombstone } from "@fedify/vocab";
|
|
18
18
|
import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
19
19
|
import { FetchError } from "@fedify/vocab-runtime";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as assertEquals } from "../assert_equals-
|
|
5
|
-
import "../std__assert-
|
|
6
|
-
import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-
|
|
7
|
-
import { r as signObject } from "../proof-
|
|
8
|
-
import { t as MemoryKvStore } from "../kv-
|
|
9
|
-
import { o as createFederation } from "../middleware-
|
|
4
|
+
import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
|
|
5
|
+
import "../std__assert-BBjXFNOb.mjs";
|
|
6
|
+
import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-DGu1NFwu.mjs";
|
|
7
|
+
import { r as signObject } from "../proof-DOIrkqW_.mjs";
|
|
8
|
+
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
9
|
+
import { o as createFederation } from "../middleware-CvPc_n0b.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
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as assertEquals } from "../assert_equals-
|
|
5
|
-
import { t as assertThrows } from "../assert_throws-
|
|
6
|
-
import { t as ActivityListenerSet } from "../activity-listener-
|
|
4
|
+
import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
|
|
5
|
+
import { t as assertThrows } from "../assert_throws-BOkhLGYc.mjs";
|
|
6
|
+
import { t as ActivityListenerSet } from "../activity-listener-tztVvlNb.mjs";
|
|
7
7
|
import { Activity, Create, Invite, Offer, Update } from "@fedify/vocab";
|
|
8
8
|
import { test } from "@fedify/fixture";
|
|
9
9
|
//#region src/federation/inbox.test.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as assertEquals } from "../assert_equals-
|
|
5
|
-
import { t as assertInstanceOf } from "../assert_instance_of-
|
|
6
|
-
import { t as assert } from "../assert-
|
|
7
|
-
import { t as MemoryKvStore } from "../kv-
|
|
8
|
-
import { t as KvKeyCache } from "../keycache-
|
|
4
|
+
import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
|
|
5
|
+
import { t as assertInstanceOf } from "../assert_instance_of-DBC5X09g.mjs";
|
|
6
|
+
import { t as assert } from "../assert-OguE97r2.mjs";
|
|
7
|
+
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
8
|
+
import { t as KvKeyCache } from "../keycache-BeU0LCII.mjs";
|
|
9
9
|
import { CryptographicKey, Multikey } from "@fedify/vocab";
|
|
10
10
|
import { test } from "@fedify/fixture";
|
|
11
11
|
//#region src/federation/keycache.test.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as assertEquals } from "../assert_equals-
|
|
5
|
-
import "../std__assert-
|
|
6
|
-
import { t as MemoryKvStore } from "../kv-
|
|
4
|
+
import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
|
|
5
|
+
import "../std__assert-BBjXFNOb.mjs";
|
|
6
|
+
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
7
7
|
import { test } from "@fedify/fixture";
|
|
8
8
|
//#region src/federation/kv.test.ts
|
|
9
9
|
test("MemoryKvStore", async (t) => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as assertEquals } from "../assert_equals-
|
|
5
|
-
import "../std__assert-
|
|
6
|
-
import { t as assertRejects } from "../assert_rejects-
|
|
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-
|
|
4
|
+
import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
|
|
5
|
+
import "../std__assert-BBjXFNOb.mjs";
|
|
6
|
+
import { t as assertRejects } from "../assert_rejects-DN60FHPX.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-BAQhI4a7.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";
|