@fedify/fedify 1.6.1-dev.826 → 1.6.1-dev.829
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/compat/transformers.d.ts +1 -1
- package/dist/deno.js +1 -1
- package/dist/federation/callback.d.ts +1 -1
- package/dist/federation/context.d.ts +6 -0
- package/dist/federation/federation.d.ts +1 -1
- package/dist/federation/handler.test.js +11 -0
- package/dist/federation/middleware.test.js +1 -0
- package/dist/federation/mod.d.ts +5 -5
- package/dist/mod.d.ts +7 -7
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_common/dirname.js +1 -1
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_common/from_file_url.js +1 -1
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_common/normalize.js +1 -1
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/posix/_util.js +1 -1
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/posix/dirname.js +2 -2
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/posix/from_file_url.js +1 -1
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/posix/normalize.js +2 -2
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/windows/_util.js +1 -1
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/windows/dirname.js +2 -2
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/windows/from_file_url.js +1 -1
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/windows/normalize.js +1 -1
- package/dist/nodeinfo/handler.test.js +6 -0
- package/dist/testing/context.js +2 -1
- package/dist/vocab/vocab.js +176 -176
- package/dist/webfinger/handler.test.js +4 -0
- package/package.json +1 -1
@@ -1,8 +1,8 @@
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
3
3
|
import { Activity$1 as Activity } from "../vocab/vocab.js";
|
4
|
-
import { Context } from "../federation/context.js";
|
5
4
|
import { ActivityTransformer } from "./types.js";
|
5
|
+
import { Context } from "../federation/context.js";
|
6
6
|
|
7
7
|
//#region compat/transformers.d.ts
|
8
8
|
/**
|
package/dist/deno.js
CHANGED
@@ -3,9 +3,9 @@ import { URLPattern } from "urlpattern-polyfill";
|
|
3
3
|
import { NodeInfo } from "../nodeinfo/types.js";
|
4
4
|
import { Activity$1 as Activity, CryptographicKey$1 as CryptographicKey, Object$1 } from "../vocab/vocab.js";
|
5
5
|
import { Actor } from "../vocab/actor.js";
|
6
|
+
import { PageItems } from "./collection.js";
|
6
7
|
import { SenderKeyPair } from "./send.js";
|
7
8
|
import { Context, InboxContext, RequestContext } from "./context.js";
|
8
|
-
import { PageItems } from "./collection.js";
|
9
9
|
|
10
10
|
//#region federation/callback.d.ts
|
11
11
|
/**
|
@@ -10,6 +10,7 @@ import { LookupObjectOptions, TraverseCollectionOptions } from "../vocab/lookup.
|
|
10
10
|
import { ResourceDescriptor } from "../webfinger/jrd.js";
|
11
11
|
import { LookupWebFingerOptions } from "../webfinger/lookup.js";
|
12
12
|
import { SenderKeyPair } from "./send.js";
|
13
|
+
import { Federation } from "./federation.js";
|
13
14
|
import { TracerProvider } from "@opentelemetry/api";
|
14
15
|
|
15
16
|
//#region federation/context.d.ts
|
@@ -65,6 +66,11 @@ interface Context<TContextData> {
|
|
65
66
|
* The context loader for loading remote JSON-LD contexts.
|
66
67
|
*/
|
67
68
|
readonly contextLoader: DocumentLoader;
|
69
|
+
/**
|
70
|
+
* The federation object that this context belongs to.
|
71
|
+
* @since 1.6.0
|
72
|
+
*/
|
73
|
+
readonly federation: Federation<TContextData>;
|
68
74
|
/**
|
69
75
|
* Builds the URI of the NodeInfo document.
|
70
76
|
* @returns The NodeInfo URI.
|
@@ -4,12 +4,12 @@ import { KvStore } from "./kv.js";
|
|
4
4
|
import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, GetUserAgentOptions } from "../runtime/docloader.js";
|
5
5
|
import { Activity$1 as Activity, Hashtag$1 as Hashtag, Object$1 } from "../vocab/vocab.js";
|
6
6
|
import { Actor, Recipient } from "../vocab/actor.js";
|
7
|
-
import { Context, RequestContext } from "./context.js";
|
8
7
|
import { ActivityTransformer } from "../compat/types.js";
|
9
8
|
import { ActorAliasMapper, ActorDispatcher, ActorHandleMapper, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCounter, CollectionCursor, CollectionDispatcher, InboxErrorHandler, InboxListener, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectDispatcher, OutboxErrorHandler, SharedInboxKeyDispatcher } from "./callback.js";
|
10
9
|
import { MessageQueue } from "./mq.js";
|
11
10
|
import { RetryPolicy } from "./retry.js";
|
12
11
|
import { FederationKvPrefixes, FederationOrigin, FederationQueueOptions } from "./middleware.js";
|
12
|
+
import { Context, RequestContext } from "./context.js";
|
13
13
|
import { TracerProvider } from "@opentelemetry/api";
|
14
14
|
|
15
15
|
//#region federation/federation.d.ts
|
@@ -6,6 +6,7 @@ import { Create, Note, Person } from "../vocab/vocab.js";
|
|
6
6
|
import { signRequest } from "../sig/http.js";
|
7
7
|
import { acceptsJsonLd, handleActor, handleCollection, handleInbox, handleObject, respondWithObject, respondWithObjectIfAcceptable } from "./handler.js";
|
8
8
|
import { MemoryKvStore } from "./kv.js";
|
9
|
+
import { createFederation } from "./middleware.js";
|
9
10
|
import { assert } from "../node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert.js";
|
10
11
|
import { assertEquals } from "../node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_equals.js";
|
11
12
|
import { test } from "../testing/mod.js";
|
@@ -23,7 +24,9 @@ test("acceptsJsonLd()", () => {
|
|
23
24
|
assertFalse(acceptsJsonLd(new Request("https://example.com/", { headers: { Accept: "application/ld+json; q=0.4, application/xhtml+xml; q=0.9" } })));
|
24
25
|
});
|
25
26
|
test("handleActor()", async () => {
|
27
|
+
const federation = createFederation({ kv: new MemoryKvStore() });
|
26
28
|
let context = createRequestContext({
|
29
|
+
federation,
|
27
30
|
data: void 0,
|
28
31
|
url: new URL("https://example.com/"),
|
29
32
|
getActorUri(identifier) {
|
@@ -247,7 +250,9 @@ test("handleActor()", async () => {
|
|
247
250
|
assertEquals(onUnauthorizedCalled, null);
|
248
251
|
});
|
249
252
|
test("handleObject()", async () => {
|
253
|
+
const federation = createFederation({ kv: new MemoryKvStore() });
|
250
254
|
let context = createRequestContext({
|
255
|
+
federation,
|
251
256
|
data: void 0,
|
252
257
|
url: new URL("https://example.com/"),
|
253
258
|
getObjectUri(_cls, values) {
|
@@ -480,7 +485,9 @@ test("handleObject()", async () => {
|
|
480
485
|
assertEquals(onUnauthorizedCalled, null);
|
481
486
|
});
|
482
487
|
test("handleCollection()", async () => {
|
488
|
+
const federation = createFederation({ kv: new MemoryKvStore() });
|
483
489
|
let context = createRequestContext({
|
490
|
+
federation,
|
484
491
|
data: void 0,
|
485
492
|
url: new URL("https://example.com/"),
|
486
493
|
getActorUri(identifier) {
|
@@ -946,7 +953,9 @@ test("handleInbox()", async () => {
|
|
946
953
|
method: "POST",
|
947
954
|
body: JSON.stringify(await activity.toJsonLd())
|
948
955
|
});
|
956
|
+
const federation = createFederation({ kv: new MemoryKvStore() });
|
949
957
|
const unsignedContext = createRequestContext({
|
958
|
+
federation,
|
950
959
|
request: unsignedRequest,
|
951
960
|
url: new URL(unsignedRequest.url),
|
952
961
|
data: void 0
|
@@ -1023,6 +1032,7 @@ test("handleInbox()", async () => {
|
|
1023
1032
|
onNotFoundCalled = null;
|
1024
1033
|
const signedRequest = await signRequest(unsignedRequest.clone(), rsaPrivateKey3, rsaPublicKey3.id);
|
1025
1034
|
const signedContext = createRequestContext({
|
1035
|
+
federation,
|
1026
1036
|
request: signedRequest,
|
1027
1037
|
url: new URL(signedRequest.url),
|
1028
1038
|
data: void 0,
|
@@ -1094,6 +1104,7 @@ test("handleInbox()", async () => {
|
|
1094
1104
|
});
|
1095
1105
|
const signedInvalidRequest = await signRequest(invalidRequest, rsaPrivateKey3, rsaPublicKey3.id);
|
1096
1106
|
const signedInvalidContext = createRequestContext({
|
1107
|
+
federation,
|
1097
1108
|
request: signedInvalidRequest,
|
1098
1109
|
url: new URL(signedInvalidRequest.url),
|
1099
1110
|
data: void 0,
|
@@ -171,6 +171,7 @@ test("Federation.createContext()", async (t) => {
|
|
171
171
|
assertEquals(ctx.hostname, "example.com");
|
172
172
|
assertStrictEquals(ctx.documentLoader, documentLoader);
|
173
173
|
assertStrictEquals(ctx.contextLoader, mockDocumentLoader);
|
174
|
+
assertStrictEquals(ctx.federation, federation);
|
174
175
|
assertThrows(() => ctx.getNodeInfoUri(), RouterError);
|
175
176
|
assertThrows(() => ctx.getActorUri("handle"), RouterError);
|
176
177
|
assertThrows(() => ctx.getObjectUri(Note, {
|
package/dist/federation/mod.d.ts
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
3
3
|
import { KvKey, KvStore, KvStoreSetOptions, MemoryKvStore$1 as MemoryKvStore } from "./kv.js";
|
4
|
-
import { SenderKeyPair } from "./send.js";
|
5
|
-
import { ActorKeyPair, Context, ForwardActivityOptions, GetSignedKeyOptions, InboxContext, ParseUriResult, RequestContext, RouteActivityOptions, SendActivityOptions, SendActivityOptionsForCollection } from "./context.js";
|
6
4
|
import { PageItems, buildCollectionSynchronizationHeader$1 as buildCollectionSynchronizationHeader, digest$1 as digest } from "./collection.js";
|
5
|
+
import { SenderKeyPair } from "./send.js";
|
7
6
|
import { ActorAliasMapper, ActorDispatcher, ActorHandleMapper, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCounter, CollectionCursor, CollectionDispatcher, InboxErrorHandler, InboxListener, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectDispatcher, OutboxErrorHandler, SharedInboxKeyDispatcher } from "./callback.js";
|
8
7
|
import { InProcessMessageQueue$1 as InProcessMessageQueue, InProcessMessageQueueOptions, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, ParallelMessageQueue$1 as ParallelMessageQueue } from "./mq.js";
|
9
|
-
import { CreateExponentialBackoffPolicyOptions, RetryContext, RetryPolicy, createExponentialBackoffPolicy$1 as createExponentialBackoffPolicy } from "./retry.js";
|
10
|
-
import { CreateFederationOptions, FederationKvPrefixes, FederationOrigin, FederationQueueOptions, createFederation$1 as createFederation } from "./middleware.js";
|
11
|
-
import { ActorCallbackSetters, CollectionCallbackSetters, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationOptions, FederationStartQueueOptions, InboxListenerSetters, ObjectCallbackSetters } from "./federation.js";
|
12
8
|
import { RespondWithObjectOptions, respondWithObject$1 as respondWithObject, respondWithObjectIfAcceptable$1 as respondWithObjectIfAcceptable } from "./handler.js";
|
13
9
|
import { Router$1 as Router, RouterError$1 as RouterError, RouterOptions, RouterRouteResult } from "./router.js";
|
14
10
|
import { createFederationBuilder$1 as createFederationBuilder } from "./builder.js";
|
11
|
+
import { CreateExponentialBackoffPolicyOptions, RetryContext, RetryPolicy, createExponentialBackoffPolicy$1 as createExponentialBackoffPolicy } from "./retry.js";
|
12
|
+
import { CreateFederationOptions, FederationKvPrefixes, FederationOrigin, FederationQueueOptions, createFederation$1 as createFederation } from "./middleware.js";
|
13
|
+
import { ActorCallbackSetters, CollectionCallbackSetters, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationOptions, FederationStartQueueOptions, InboxListenerSetters, ObjectCallbackSetters } from "./federation.js";
|
14
|
+
import { ActorKeyPair, Context, ForwardActivityOptions, GetSignedKeyOptions, InboxContext, ParseUriResult, RequestContext, RouteActivityOptions, SendActivityOptions, SendActivityOptionsForCollection } from "./context.js";
|
15
15
|
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, Context, CreateExponentialBackoffPolicyOptions, CreateFederationOptions, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, InProcessMessageQueue, InProcessMessageQueueOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreSetOptions, MemoryKvStore, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable };
|
package/dist/mod.d.ts
CHANGED
@@ -13,22 +13,22 @@ import { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey$1 as doesAc
|
|
13
13
|
import { LookupObjectOptions, TraverseCollectionOptions, lookupObject$1 as lookupObject, traverseCollection$1 as traverseCollection } from "./vocab/lookup.js";
|
14
14
|
import { ResourceDescriptor } from "./webfinger/jrd.js";
|
15
15
|
import { lookupWebFinger$1 as lookupWebFinger } from "./webfinger/lookup.js";
|
16
|
-
import { HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, SignRequestOptions, VerifyRequestOptions, signRequest$1 as signRequest, verifyRequest$1 as verifyRequest } from "./sig/http.js";
|
17
|
-
import { SenderKeyPair } from "./federation/send.js";
|
18
|
-
import { ActorKeyPair, Context, ForwardActivityOptions, GetSignedKeyOptions, InboxContext, ParseUriResult, RequestContext, RouteActivityOptions, SendActivityOptions, SendActivityOptionsForCollection } from "./federation/context.js";
|
19
16
|
import { ActivityTransformer } from "./compat/types.js";
|
20
|
-
import { actorDehydrator$1 as actorDehydrator, autoIdAssigner$1 as autoIdAssigner, getDefaultActivityTransformers$1 as getDefaultActivityTransformers } from "./compat/transformers.js";
|
21
17
|
import { PUBLIC_COLLECTION$1 as PUBLIC_COLLECTION } from "./vocab/constants.js";
|
22
18
|
import { getTypeId$1 as getTypeId } from "./vocab/type.js";
|
23
19
|
import { PageItems, buildCollectionSynchronizationHeader$1 as buildCollectionSynchronizationHeader, digest$1 as digest } from "./federation/collection.js";
|
20
|
+
import { HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, SignRequestOptions, VerifyRequestOptions, signRequest$1 as signRequest, verifyRequest$1 as verifyRequest } from "./sig/http.js";
|
21
|
+
import { SenderKeyPair } from "./federation/send.js";
|
24
22
|
import { ActorAliasMapper, ActorDispatcher, ActorHandleMapper, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCounter, CollectionCursor, CollectionDispatcher, InboxErrorHandler, InboxListener, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectDispatcher, OutboxErrorHandler, SharedInboxKeyDispatcher } from "./federation/callback.js";
|
25
23
|
import { InProcessMessageQueue$1 as InProcessMessageQueue, InProcessMessageQueueOptions, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, ParallelMessageQueue$1 as ParallelMessageQueue } from "./federation/mq.js";
|
26
|
-
import { CreateExponentialBackoffPolicyOptions, RetryContext, RetryPolicy, createExponentialBackoffPolicy$1 as createExponentialBackoffPolicy } from "./federation/retry.js";
|
27
|
-
import { CreateFederationOptions, FederationKvPrefixes, FederationOrigin, FederationQueueOptions, createFederation$1 as createFederation } from "./federation/middleware.js";
|
28
|
-
import { ActorCallbackSetters, CollectionCallbackSetters, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationOptions, FederationStartQueueOptions, InboxListenerSetters, ObjectCallbackSetters } from "./federation/federation.js";
|
29
24
|
import { RespondWithObjectOptions, respondWithObject$1 as respondWithObject, respondWithObjectIfAcceptable$1 as respondWithObjectIfAcceptable } from "./federation/handler.js";
|
30
25
|
import { Router$1 as Router, RouterError$1 as RouterError, RouterOptions, RouterRouteResult } from "./federation/router.js";
|
31
26
|
import { createFederationBuilder$1 as createFederationBuilder } from "./federation/builder.js";
|
27
|
+
import { CreateExponentialBackoffPolicyOptions, RetryContext, RetryPolicy, createExponentialBackoffPolicy$1 as createExponentialBackoffPolicy } from "./federation/retry.js";
|
28
|
+
import { CreateFederationOptions, FederationKvPrefixes, FederationOrigin, FederationQueueOptions, createFederation$1 as createFederation } from "./federation/middleware.js";
|
29
|
+
import { ActorCallbackSetters, CollectionCallbackSetters, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationOptions, FederationStartQueueOptions, InboxListenerSetters, ObjectCallbackSetters } from "./federation/federation.js";
|
30
|
+
import { ActorKeyPair, Context, ForwardActivityOptions, GetSignedKeyOptions, InboxContext, ParseUriResult, RequestContext, RouteActivityOptions, SendActivityOptions, SendActivityOptionsForCollection } from "./federation/context.js";
|
31
|
+
import { actorDehydrator$1 as actorDehydrator, autoIdAssigner$1 as autoIdAssigner, getDefaultActivityTransformers$1 as getDefaultActivityTransformers } from "./compat/transformers.js";
|
32
32
|
import { GetAuthenticatedDocumentLoaderOptions, getAuthenticatedDocumentLoader$1 as getAuthenticatedDocumentLoader } from "./runtime/authdocloader.js";
|
33
33
|
import { exportMultibaseKey$1 as exportMultibaseKey, exportSpki$1 as exportSpki, importMultibaseKey$1 as importMultibaseKey, importPem$1 as importPem, importPkcs1$1 as importPkcs1, importSpki$1 as importSpki } from "./runtime/key.js";
|
34
34
|
import { CreateSignatureOptions, SignJsonLdOptions, VerifyJsonLdOptions, VerifySignatureOptions, attachSignature$1 as attachSignature, createSignature$1 as createSignature, detachSignature$1 as detachSignature, signJsonLd$1 as signJsonLd, verifyJsonLd$1 as verifyJsonLd, verifySignature$1 as verifySignature } from "./sig/ld.js";
|
package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/posix/dirname.js
CHANGED
@@ -3,8 +3,8 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
5
|
import { stripTrailingSeparators } from "../_common/strip_trailing_separators.js";
|
6
|
-
import { isPosixPathSeparator
|
7
|
-
import { assertArg
|
6
|
+
import { isPosixPathSeparator } from "./_util.js";
|
7
|
+
import { assertArg } from "../_common/dirname.js";
|
8
8
|
|
9
9
|
//#region node_modules/.pnpm/@jsr+std__path@1.0.9/node_modules/@jsr/std__path/posix/dirname.js
|
10
10
|
/**
|
@@ -2,7 +2,7 @@
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
|
-
import { assertArg$
|
5
|
+
import { assertArg$1 as assertArg } from "../_common/from_file_url.js";
|
6
6
|
|
7
7
|
//#region node_modules/.pnpm/@jsr+std__path@1.0.9/node_modules/@jsr/std__path/posix/from_file_url.js
|
8
8
|
/**
|
package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/posix/normalize.js
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
|
-
import { isPosixPathSeparator
|
6
|
-
import { assertArg } from "../_common/normalize.js";
|
5
|
+
import { isPosixPathSeparator } from "./_util.js";
|
6
|
+
import { assertArg$2 as assertArg } from "../_common/normalize.js";
|
7
7
|
import { normalizeString } from "../_common/normalize_string.js";
|
8
8
|
|
9
9
|
//#region node_modules/.pnpm/@jsr+std__path@1.0.9/node_modules/@jsr/std__path/posix/normalize.js
|
package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/windows/dirname.js
CHANGED
@@ -4,8 +4,8 @@
|
|
4
4
|
|
5
5
|
import { stripTrailingSeparators } from "../_common/strip_trailing_separators.js";
|
6
6
|
import { CHAR_COLON } from "../_common/constants.js";
|
7
|
-
import { isPathSeparator, isPosixPathSeparator, isWindowsDeviceRoot } from "./_util.js";
|
8
|
-
import { assertArg
|
7
|
+
import { isPathSeparator, isPosixPathSeparator$1 as isPosixPathSeparator, isWindowsDeviceRoot } from "./_util.js";
|
8
|
+
import { assertArg } from "../_common/dirname.js";
|
9
9
|
|
10
10
|
//#region node_modules/.pnpm/@jsr+std__path@1.0.9/node_modules/@jsr/std__path/windows/dirname.js
|
11
11
|
/**
|
@@ -2,7 +2,7 @@
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
|
-
import { assertArg$
|
5
|
+
import { assertArg$1 as assertArg } from "../_common/from_file_url.js";
|
6
6
|
|
7
7
|
//#region node_modules/.pnpm/@jsr+std__path@1.0.9/node_modules/@jsr/std__path/windows/from_file_url.js
|
8
8
|
/**
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
import { CHAR_COLON } from "../_common/constants.js";
|
6
6
|
import { isPathSeparator, isWindowsDeviceRoot } from "./_util.js";
|
7
|
-
import { assertArg } from "../_common/normalize.js";
|
7
|
+
import { assertArg$2 as assertArg } from "../_common/normalize.js";
|
8
8
|
import { normalizeString } from "../_common/normalize_string.js";
|
9
9
|
|
10
10
|
//#region node_modules/.pnpm/@jsr+std__path@1.0.9/node_modules/@jsr/std__path/windows/normalize.js
|
@@ -2,8 +2,10 @@
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
|
+
import { MemoryKvStore } from "../federation/kv.js";
|
5
6
|
import { parseSemVer } from "./semver.js";
|
6
7
|
import { handleNodeInfo, handleNodeInfoJrd } from "./handler.js";
|
8
|
+
import { createFederation } from "../federation/middleware.js";
|
7
9
|
import { assertEquals } from "../node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_equals.js";
|
8
10
|
import { test } from "../testing/mod.js";
|
9
11
|
import { createRequestContext } from "../testing/context.js";
|
@@ -11,7 +13,9 @@ import { createRequestContext } from "../testing/context.js";
|
|
11
13
|
//#region nodeinfo/handler.test.ts
|
12
14
|
test("handleNodeInfo()", async () => {
|
13
15
|
const request = new Request("https://example.com/nodeinfo/2.1");
|
16
|
+
const federation = createFederation({ kv: new MemoryKvStore() });
|
14
17
|
const context = createRequestContext({
|
18
|
+
federation,
|
15
19
|
data: void 0,
|
16
20
|
request,
|
17
21
|
url: new URL(request.url)
|
@@ -66,7 +70,9 @@ test("handleNodeInfo()", async () => {
|
|
66
70
|
});
|
67
71
|
test("handleNodeInfoJrd()", async () => {
|
68
72
|
const request = new Request("https://example.com/.well-known/nodeinfo");
|
73
|
+
const federation = createFederation({ kv: new MemoryKvStore() });
|
69
74
|
let context = createRequestContext({
|
75
|
+
federation,
|
70
76
|
data: void 0,
|
71
77
|
request,
|
72
78
|
url: new URL(request.url)
|
package/dist/testing/context.js
CHANGED
@@ -9,12 +9,13 @@ import { mockDocumentLoader } from "./docloader.js";
|
|
9
9
|
import { trace } from "@opentelemetry/api";
|
10
10
|
|
11
11
|
//#region testing/context.ts
|
12
|
-
function createContext({ url, canonicalOrigin, data, documentLoader, contextLoader, tracerProvider, getNodeInfoUri, getActorUri, getObjectUri, getOutboxUri, getInboxUri, getFollowingUri, getFollowersUri, getLikedUri, getFeaturedUri, getFeaturedTagsUri, parseUri, getActorKeyPairs, getDocumentLoader, lookupObject: lookupObject$1, traverseCollection: traverseCollection$1, lookupNodeInfo, lookupWebFinger: lookupWebFinger$1, sendActivity, routeActivity }) {
|
12
|
+
function createContext({ federation, url, canonicalOrigin, data, documentLoader, contextLoader, tracerProvider, getNodeInfoUri, getActorUri, getObjectUri, getOutboxUri, getInboxUri, getFollowingUri, getFollowersUri, getLikedUri, getFeaturedUri, getFeaturedTagsUri, parseUri, getActorKeyPairs, getDocumentLoader, lookupObject: lookupObject$1, traverseCollection: traverseCollection$1, lookupNodeInfo, lookupWebFinger: lookupWebFinger$1, sendActivity, routeActivity }) {
|
13
13
|
function throwRouteError() {
|
14
14
|
throw new RouterError("Not implemented");
|
15
15
|
}
|
16
16
|
url ??= new URL("http://example.com/");
|
17
17
|
return {
|
18
|
+
federation,
|
18
19
|
data,
|
19
20
|
origin: url.origin,
|
20
21
|
canonicalOrigin: canonicalOrigin ?? url.origin,
|