@fedify/fedify 1.6.12 → 1.6.14
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-tT_B0pDn.d.ts → actor.d.ts} +3 -3
- package/dist/{actor-BxaCJsn8.js → actor.js} +6 -6
- package/dist/{assert-LOEeCUK5.js → assert.js} +2 -2
- package/dist/{assert_equals-B44MxcIj.js → assert_equals.js} +16 -16
- package/dist/{assert_instance_of-XtuFevV_.js → assert_instance_of.js} +2 -2
- package/dist/{assert_is_error-BTlryvT0.js → assert_is_error.js} +2 -2
- package/dist/{assert_not_equals-C685gKx6.js → assert_not_equals.js} +3 -6
- package/dist/{assert_rejects-DWQ4jaf9.js → assert_rejects.js} +3 -3
- package/dist/{assert_throws-YetpVSc-.js → assert_throws.js} +3 -3
- package/dist/{authdocloader-niAJMnCQ.js → authdocloader.js} +8 -8
- package/dist/{builder-DboGa9iv.js → builder.js} +7 -7
- package/dist/{chunk-Cx8LTkjm.js → chunk.js} +22 -15
- package/dist/{client-Cd552pKL.d.ts → client.d.ts} +2 -2
- package/dist/{client-De_5-2EG.js → client.js} +3 -3
- package/dist/{collection-Dfb0TPno.js → collection.js} +2 -3
- package/dist/compat/mod.d.ts +79 -12
- package/dist/compat/mod.js +1 -2
- package/dist/compat/transformers.test.js +34 -38
- package/dist/{context-DRhhOsMk.d.ts → context.d.ts} +10 -10
- package/dist/{context-KOy1fHBn.js → context.js} +5 -5
- package/dist/{docloader-DlUDOVSe.d.ts → docloader.d.ts} +2 -2
- package/dist/{docloader-CPBLJsVK.js → docloader.js} +32 -152
- package/dist/{docloader-09nVWLAZ.js → docloader2.js} +1 -1
- package/dist/{esm-DO9PrujO.js → esm.js} +36 -22
- package/dist/federation/builder.test.js +20 -26
- package/dist/federation/collection.test.js +11 -16
- package/dist/federation/handler.test.js +41 -48
- package/dist/federation/inbox.test.js +11 -11
- package/dist/federation/keycache.test.js +12 -11
- package/dist/federation/kv.test.js +8 -10
- package/dist/federation/middleware.test.js +99 -120
- package/dist/federation/mod.d.ts +4 -13
- package/dist/federation/mod.js +195 -12
- package/dist/federation/mq.test.js +9 -14
- package/dist/federation/retry.test.js +5 -4
- package/dist/federation/router.test.js +9 -10
- package/dist/federation/send.test.js +23 -24
- package/dist/{http-BkUCISGt.d.ts → http.d.ts} +3 -3
- package/dist/{http-B__WhFrv.js → http.js} +19 -27
- package/dist/{inbox-L4MTtAQ4.js → inbox.js} +5 -5
- package/dist/key.js +16 -0
- package/dist/{key-Dlbuqhbr.js → key2.js} +5 -5
- package/dist/{keycache-BEb0DSk7.js → keycache.js} +2 -2
- package/dist/{keys-CqpeF-EG.js → keys.js} +2 -2
- package/dist/{kv-p8sC8PTT.d.ts → kv.d.ts} +1 -1
- package/dist/{kv-DohFOP2C.js → kv.js} +1 -1
- package/dist/{langstr-DbWheeIS.js → langstr.js} +1 -1
- package/dist/{ld-45SsuOmB.js → ld.js} +9 -12
- package/dist/{lookup-vJccIKCS.d.ts → lookup.d.ts} +2 -2
- package/dist/{lookup-HY083HcK.js → lookup.js} +4 -4
- package/dist/{lookup-CWdbkwKD.js → lookup2.js} +6 -6
- package/dist/{middleware-D2HU0DhQ.js → middleware.js} +35 -39
- package/dist/middleware2.js +32 -0
- package/dist/mod.d.ts +17 -17
- package/dist/mod.js +17 -17
- package/dist/{mod-DSPyncxx.d.ts → mod2.d.ts} +3 -3
- package/dist/{mod-j45KmAfR.d.ts → mod3.d.ts} +4 -4
- package/dist/{mq-nceTGCuc.d.ts → mq.d.ts} +1 -1
- package/dist/{multibase-CnLHszip.js → multibase.js} +1 -1
- package/dist/nodeinfo/client.test.js +19 -28
- package/dist/nodeinfo/handler.test.js +37 -44
- package/dist/nodeinfo/mod.d.ts +2 -5
- package/dist/nodeinfo/mod.js +2 -3
- package/dist/nodeinfo/semver.test.js +13 -21
- package/dist/nodeinfo/types.test.js +9 -11
- package/dist/{owner-CbRc94FP.d.ts → owner.d.ts} +4 -4
- package/dist/{owner-BYxqeMiw.js → owner.js} +4 -4
- package/dist/{proof-BjHA4H_1.js → proof.js} +11 -13
- package/dist/{retry-BiIhZWgD.js → retry.js} +1 -1
- package/dist/{router-D_aVZZUc.js → router.js} +1 -1
- package/dist/runtime/authdocloader.test.js +22 -26
- package/dist/runtime/docloader.test.js +50 -46
- package/dist/runtime/key.test.js +31 -53
- package/dist/runtime/langstr.test.js +8 -10
- package/dist/runtime/mod.d.ts +103 -6
- package/dist/runtime/mod.js +6 -7
- package/dist/runtime/multibase/multibase.test.js +12 -18
- package/dist/runtime/url.test.js +7 -6
- package/dist/{semver-BNrOOAs9.js → semver.js} +7 -17
- package/dist/{send-BQA1p7vs.js → send.js} +4 -4
- package/dist/sig/http.test.js +104 -168
- package/dist/sig/key.test.js +17 -20
- package/dist/sig/ld.test.js +28 -35
- package/dist/sig/mod.d.ts +3 -7
- package/dist/sig/mod.js +6 -7
- package/dist/sig/owner.test.js +24 -30
- package/dist/sig/proof.test.js +24 -29
- package/dist/{std__assert-o_r9vqm1.js → std__assert.js} +7 -13
- package/dist/testing/docloader.test.js +9 -12
- package/dist/testing/mod.js +2 -1
- package/dist/{testing-DLyvtiiW.js → testing.js} +2 -2
- package/dist/{transformers-ghwJuzGY.js → transformers.js} +1 -1
- package/dist/{type-CFuiGLz9.js → type.js} +1 -1
- package/dist/{types-CJHS5pXl.js → types.js} +2 -2
- package/dist/{url-C2xuoQD1.js → url.js} +1 -1
- package/dist/vocab/actor.test.js +76 -128
- package/dist/vocab/lookup.test.js +19 -23
- package/dist/vocab/mod.d.ts +3 -5
- package/dist/vocab/mod.js +4 -4
- package/dist/vocab/type.test.js +10 -10
- package/dist/vocab/vocab.test.js +90 -109
- package/dist/{vocab-DSFLLLe6.d.ts → vocab.d.ts} +2 -2
- package/dist/{vocab-DVEzP_bQ.js → vocab.js} +318 -454
- package/dist/webfinger/handler.test.js +40 -48
- package/dist/webfinger/lookup.test.js +12 -15
- package/dist/webfinger/mod.d.ts +1 -4
- package/dist/webfinger/mod.js +2 -3
- package/dist/x/cfworkers.d.ts +2 -2
- package/dist/x/cfworkers.test.js +7 -9
- package/dist/x/hono.d.ts +2 -11
- package/dist/x/sveltekit.d.ts +2 -11
- package/package.json +1 -1
- package/dist/actor-7vCpWIGd.js +0 -34925
- package/dist/authdocloader-CVhMTbv4.js +0 -53
- package/dist/compat-Bb5myD13.js +0 -4
- package/dist/docloader-RFcxdgI8.js +0 -4590
- package/dist/federation-DyRlaC4X.js +0 -192
- package/dist/http-CnSGudcE.js +0 -789
- package/dist/key-BG_CTepE.js +0 -10
- package/dist/key-BQg3A7eo.js +0 -257
- package/dist/key-CeY-eted.js +0 -16
- package/dist/lookup-CdHTw-tQ.js +0 -127
- package/dist/middleware-BP-XbRGC.js +0 -17
- package/dist/middleware-Cg-eSyqX.js +0 -3501
- package/dist/middleware-JoLpCiMC.js +0 -33
- package/dist/mod-1pDWKvUL.d.ts +0 -2
- package/dist/mod-BTHfUeLo.d.ts +0 -104
- package/dist/mod-CgmTOt4z.d.ts +0 -82
- package/dist/mod-GIh5OYxW.d.ts +0 -2
- package/dist/mod-g0xFzAP9.d.ts +0 -2
- package/dist/nodeinfo-CyEbLjHs.js +0 -4
- package/dist/proof-DVYup76O.js +0 -582
- package/dist/runtime-BSkOVUWM.js +0 -4
- package/dist/sig-BXJO--F9.js +0 -4
- package/dist/types-D7_MRRa4.js +0 -455
- package/dist/vocab-aaGb1Tji.js +0 -168
- package/dist/webfinger-C3GIyXIg.js +0 -4
- /package/dist/{denokv-B_GFWjrl.js → denokv.js} +0 -0
|
@@ -3,50 +3,48 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import "../
|
|
12
|
-
import "../
|
|
13
|
-
import "../
|
|
14
|
-
import "../
|
|
15
|
-
import "../
|
|
16
|
-
import "../
|
|
17
|
-
import "../
|
|
18
|
-
import
|
|
19
|
-
import "../
|
|
20
|
-
import "../
|
|
21
|
-
import "../
|
|
22
|
-
import "../actor
|
|
23
|
-
import "../
|
|
24
|
-
import "../http
|
|
25
|
-
import "../authdocloader
|
|
26
|
-
import "../ld
|
|
27
|
-
import "../owner
|
|
28
|
-
import "../proof
|
|
29
|
-
import "../
|
|
30
|
-
import "../inbox
|
|
31
|
-
import "../builder
|
|
32
|
-
import "../collection
|
|
33
|
-
import "../keycache
|
|
34
|
-
import "../
|
|
35
|
-
import "../
|
|
36
|
-
import { test } from "../testing-DLyvtiiW.js";
|
|
6
|
+
import "../chunk.js";
|
|
7
|
+
import { t as assertEquals } from "../assert_equals.js";
|
|
8
|
+
import { t as assert } from "../assert.js";
|
|
9
|
+
import { t as assertInstanceOf } from "../assert_instance_of.js";
|
|
10
|
+
import { t as MemoryKvStore } from "../kv.js";
|
|
11
|
+
import { _ as autoIdAssigner, g as actorDehydrator, n as FederationImpl } from "../middleware.js";
|
|
12
|
+
import "../docloader.js";
|
|
13
|
+
import "../url.js";
|
|
14
|
+
import "../semver.js";
|
|
15
|
+
import "../client.js";
|
|
16
|
+
import "../router.js";
|
|
17
|
+
import "../types.js";
|
|
18
|
+
import "../multibase.js";
|
|
19
|
+
import { S as Person, l as Follow } from "../vocab.js";
|
|
20
|
+
import "../langstr.js";
|
|
21
|
+
import "../lookup.js";
|
|
22
|
+
import "../actor.js";
|
|
23
|
+
import "../key2.js";
|
|
24
|
+
import "../http.js";
|
|
25
|
+
import "../authdocloader.js";
|
|
26
|
+
import "../ld.js";
|
|
27
|
+
import "../owner.js";
|
|
28
|
+
import "../proof.js";
|
|
29
|
+
import "../lookup2.js";
|
|
30
|
+
import "../inbox.js";
|
|
31
|
+
import "../builder.js";
|
|
32
|
+
import "../collection.js";
|
|
33
|
+
import "../keycache.js";
|
|
34
|
+
import "../send.js";
|
|
35
|
+
import { t as test } from "../testing.js";
|
|
37
36
|
|
|
38
37
|
//#region compat/transformers.test.ts
|
|
39
38
|
const context = new FederationImpl({ kv: new MemoryKvStore() }).createContext(new URL("http://example.com/"));
|
|
40
39
|
test("autoIdAssigner", async () => {
|
|
41
|
-
const
|
|
40
|
+
const result = autoIdAssigner(new Follow({
|
|
42
41
|
actor: new URL("http://example.com/actors/1"),
|
|
43
42
|
object: new Person({
|
|
44
43
|
id: new URL("http://example.com/actors/2"),
|
|
45
44
|
name: "Bob",
|
|
46
45
|
preferredUsername: "bob"
|
|
47
46
|
})
|
|
48
|
-
});
|
|
49
|
-
const result = autoIdAssigner(activity, context);
|
|
47
|
+
}), context);
|
|
50
48
|
const { id } = result;
|
|
51
49
|
assertInstanceOf(id, URL);
|
|
52
50
|
assertEquals(id.origin, "http://example.com");
|
|
@@ -64,7 +62,7 @@ test("autoIdAssigner", async () => {
|
|
|
64
62
|
}).toJsonLd());
|
|
65
63
|
});
|
|
66
64
|
test("actorDehydrator()", async () => {
|
|
67
|
-
|
|
65
|
+
assertEquals(await actorDehydrator(new Follow({
|
|
68
66
|
id: new URL("http://example.com/activities/1"),
|
|
69
67
|
actor: new Person({
|
|
70
68
|
id: new URL("http://example.com/actors/1"),
|
|
@@ -76,9 +74,7 @@ test("actorDehydrator()", async () => {
|
|
|
76
74
|
name: "Bob",
|
|
77
75
|
preferredUsername: "bob"
|
|
78
76
|
})
|
|
79
|
-
})
|
|
80
|
-
const result = actorDehydrator(activity, context);
|
|
81
|
-
assertEquals(await result.toJsonLd(), await new Follow({
|
|
77
|
+
}), context).toJsonLd(), await new Follow({
|
|
82
78
|
id: new URL("http://example.com/activities/1"),
|
|
83
79
|
actor: new URL("http://example.com/actors/1"),
|
|
84
80
|
object: new Person({
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { GetKeyOwnerOptions } from "./owner
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { MessageQueue } from "./mq
|
|
3
|
+
import { n as KvStore, t as KvKey } from "./kv.js";
|
|
4
|
+
import { n as DocumentLoader, r as DocumentLoaderFactory, s as GetUserAgentOptions, t as AuthenticatedDocumentLoaderFactory } from "./docloader.js";
|
|
5
|
+
import { o as JsonValue, s as NodeInfo, t as GetNodeInfoOptions } from "./client.js";
|
|
6
|
+
import { B as Multikey, H as Object$1, I as Link, O as Hashtag, d as Collection, m as CryptographicKey, n as Activity } from "./vocab.js";
|
|
7
|
+
import { a as Recipient, t as Actor } from "./actor.js";
|
|
8
|
+
import { n as GetKeyOwnerOptions } from "./owner.js";
|
|
9
|
+
import { i as TraverseCollectionOptions, r as LookupObjectOptions } from "./mod2.js";
|
|
10
|
+
import { i as ResourceDescriptor, t as LookupWebFingerOptions } from "./lookup.js";
|
|
11
|
+
import { r as MessageQueue } from "./mq.js";
|
|
12
12
|
import { Span, TracerProvider } from "@opentelemetry/api";
|
|
13
13
|
|
|
14
14
|
//#region compat/types.d.ts
|
|
@@ -2015,4 +2015,4 @@ interface ActorKeyPair extends CryptoKeyPair {
|
|
|
2015
2015
|
multikey: Multikey;
|
|
2016
2016
|
}
|
|
2017
2017
|
//#endregion
|
|
2018
|
-
export {
|
|
2018
|
+
export { SharedInboxKeyDispatcher as $, Message as A, ActorDispatcher as B, FederationOrigin as C, RetryContext as D, CreateExponentialBackoffPolicyOptions as E, RouterRouteResult as F, CollectionCursor as G, ActorKeyPairsDispatcher as H, RespondWithObjectOptions as I, InboxListener as J, CollectionDispatcher as K, respondWithObject as L, Router as M, RouterError as N, RetryPolicy as O, RouterOptions as P, OutboxErrorHandler as Q, respondWithObjectIfAcceptable as R, FederationKvPrefixes as S, createFederation as T, AuthorizePredicate as U, ActorHandleMapper as V, CollectionCounter as W, ObjectAuthorizePredicate as X, NodeInfoDispatcher as Y, ObjectDispatcher as Z, FederationOptions as _, InboxContext as a, ObjectCallbackSetters as b, RouteActivityOptions as c, ActorCallbackSetters as d, SenderKeyPair as et, CollectionCallbackSetters as f, FederationFetchOptions as g, FederationBuilder as h, GetSignedKeyOptions as i, ActivityTransformer as it, createFederationBuilder as j, createExponentialBackoffPolicy as k, SendActivityOptions as l, Federation as m, Context as n, buildCollectionSynchronizationHeader as nt, ParseUriResult as o, Federatable as p, InboxErrorHandler as q, ForwardActivityOptions as r, digest as rt, RequestContext as s, ActorKeyPair as t, PageItems as tt, SendActivityOptionsForCollection as u, FederationStartQueueOptions as v, FederationQueueOptions as w, CreateFederationOptions as x, InboxListenerSetters as y, ActorAliasMapper as z };
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { RouterError } from "./router
|
|
7
|
-
import { lookupWebFinger } from "./lookup
|
|
8
|
-
import {
|
|
9
|
-
import { mockDocumentLoader } from "./
|
|
6
|
+
import { n as RouterError } from "./router.js";
|
|
7
|
+
import { t as lookupWebFinger } from "./lookup.js";
|
|
8
|
+
import { n as traverseCollection, t as lookupObject } from "./lookup2.js";
|
|
9
|
+
import { t as mockDocumentLoader } from "./docloader2.js";
|
|
10
10
|
import { trace } from "@opentelemetry/api";
|
|
11
11
|
|
|
12
12
|
//#region testing/context.ts
|
|
@@ -105,4 +105,4 @@ function createInboxContext(args) {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
//#endregion
|
|
108
|
-
export {
|
|
108
|
+
export { createRequestContext as n, createInboxContext as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import {
|
|
3
|
+
import { n as KvStore, t as KvKey } from "./kv.js";
|
|
4
4
|
|
|
5
5
|
//#region runtime/docloader.d.ts
|
|
6
6
|
/**
|
|
@@ -205,4 +205,4 @@ declare function getUserAgent({
|
|
|
205
205
|
url
|
|
206
206
|
}?: GetUserAgentOptions): string;
|
|
207
207
|
//#endregion
|
|
208
|
-
export {
|
|
208
|
+
export { FetchError as a, KvCacheParameters as c, getDocumentLoader as d, getUserAgent as f, DocumentLoaderFactoryOptions as i, RemoteDocument as l, DocumentLoader as n, GetDocumentLoaderOptions as o, kvCache as p, DocumentLoaderFactory as r, GetUserAgentOptions as s, AuthenticatedDocumentLoaderFactory as t, fetchDocumentLoader as u };
|
|
@@ -3,143 +3,14 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { a as validatePublicUrl, t as UrlError } from "./url.js";
|
|
7
7
|
import { getLogger } from "@logtape/logtape";
|
|
8
8
|
import { HTTPHeaderLink } from "@hugoalh/http-header-link";
|
|
9
9
|
import process from "node:process";
|
|
10
10
|
|
|
11
11
|
//#region deno.json
|
|
12
12
|
var name = "@fedify/fedify";
|
|
13
|
-
var version = "1.6.
|
|
14
|
-
var license = "MIT";
|
|
15
|
-
var exports = {
|
|
16
|
-
".": "./mod.ts",
|
|
17
|
-
"./compat": "./compat/mod.ts",
|
|
18
|
-
"./federation": "./federation/mod.ts",
|
|
19
|
-
"./nodeinfo": "./nodeinfo/mod.ts",
|
|
20
|
-
"./runtime": "./runtime/mod.ts",
|
|
21
|
-
"./sig": "./sig/mod.ts",
|
|
22
|
-
"./vocab": "./vocab/mod.ts",
|
|
23
|
-
"./webfinger": "./webfinger/mod.ts",
|
|
24
|
-
"./x/cfworkers": "./x/cfworkers.ts",
|
|
25
|
-
"./x/denokv": "./x/denokv.ts",
|
|
26
|
-
"./x/fresh": "./x/fresh.ts",
|
|
27
|
-
"./x/hono": "./x/hono.ts",
|
|
28
|
-
"./x/sveltekit": "./x/sveltekit.ts"
|
|
29
|
-
};
|
|
30
|
-
var imports = {
|
|
31
|
-
"@cfworker/json-schema": "npm:@cfworker/json-schema@^4.1.1",
|
|
32
|
-
"@cloudflare/workers-types": "npm:@cloudflare/workers-types@^4.20250529.0",
|
|
33
|
-
"@es-toolkit/es-toolkit": "jsr:@es-toolkit/es-toolkit@^1.38.0",
|
|
34
|
-
"@hugoalh/http-header-link": "jsr:@hugoalh/http-header-link@^1.0.2",
|
|
35
|
-
"@multiformats/base-x": "npm:@multiformats/base-x@^4.0.1",
|
|
36
|
-
"@opentelemetry/api": "npm:@opentelemetry/api@^1.9.0",
|
|
37
|
-
"@opentelemetry/semantic-conventions": "npm:@opentelemetry/semantic-conventions@^1.27.0",
|
|
38
|
-
"@phensley/language-tag": "npm:@phensley/language-tag@^1.9.0",
|
|
39
|
-
"@std/assert": "jsr:@std/assert@^0.226.0",
|
|
40
|
-
"@std/testing": "jsr:@std/testing@^0.224.0",
|
|
41
|
-
"@std/url": "jsr:@std/url@^0.225.1",
|
|
42
|
-
"@std/yaml": "jsr:@std/yaml@^0.224.3",
|
|
43
|
-
"asn1js": "npm:asn1js@^3.0.5",
|
|
44
|
-
"byte-encodings": "npm:byte-encodings@^1.0.11",
|
|
45
|
-
"fast-check": "npm:fast-check@^3.22.0",
|
|
46
|
-
"fetch-mock": "npm:fetch-mock@^12.5.2",
|
|
47
|
-
"json-canon": "npm:json-canon@^1.0.1",
|
|
48
|
-
"jsonld": "npm:jsonld@^8.3.2",
|
|
49
|
-
"multicodec": "npm:multicodec@^3.2.1",
|
|
50
|
-
"pkijs": "npm:pkijs@^3.2.4",
|
|
51
|
-
"structured-field-values": "npm:structured-field-values@^2.0.4",
|
|
52
|
-
"tsdown": "npm:tsdown@^0.12.2",
|
|
53
|
-
"uri-template-router": "npm:uri-template-router@^0.0.17",
|
|
54
|
-
"url-template": "npm:url-template@^3.1.1"
|
|
55
|
-
};
|
|
56
|
-
var include = ["vocab/vocab.ts"];
|
|
57
|
-
var exclude = [
|
|
58
|
-
".test-report.xml",
|
|
59
|
-
"apidoc/",
|
|
60
|
-
"cfworkers/dist/",
|
|
61
|
-
"cfworkers/fixtures/",
|
|
62
|
-
"cfworkers/imports.ts",
|
|
63
|
-
"cfworkers/README.md",
|
|
64
|
-
"cfworkers/server.ts",
|
|
65
|
-
"cfworkers/server.js",
|
|
66
|
-
"cfworkers/server.js.map",
|
|
67
|
-
"codegen/schema.yaml",
|
|
68
|
-
"dist/",
|
|
69
|
-
"node_modules/",
|
|
70
|
-
"npm/",
|
|
71
|
-
"pnpm-lock.yaml",
|
|
72
|
-
"vocab/*.yaml",
|
|
73
|
-
"!vocab/vocab.ts"
|
|
74
|
-
];
|
|
75
|
-
var tasks = {
|
|
76
|
-
"codegen": "deno run --allow-read --allow-write --check codegen/main.ts vocab/ ../runtime/ > vocab/vocab.ts && deno fmt vocab/vocab.ts && deno cache vocab/vocab.ts && deno check vocab/vocab.ts",
|
|
77
|
-
"check-version": "deno run --allow-read=package.json scripts/check_version.ts && deno run ../cli/scripts/check_version.ts",
|
|
78
|
-
"sync-version": "deno run --allow-read=package.json --allow-write=package.json scripts/sync_version.ts && deno run --allow-read=../cli/deno.json --allow-write=../cli/deno.json ../cli/scripts/sync_version.ts",
|
|
79
|
-
"cache": {
|
|
80
|
-
"command": "deno cache mod.ts",
|
|
81
|
-
"dependencies": ["check-version", "codegen"]
|
|
82
|
-
},
|
|
83
|
-
"check": {
|
|
84
|
-
"command": "deno fmt --check && deno lint && deno check */*.ts",
|
|
85
|
-
"dependencies": ["codegen"]
|
|
86
|
-
},
|
|
87
|
-
"test": {
|
|
88
|
-
"command": "deno test --check --doc --allow-read --allow-write --allow-env --unstable-kv --trace-leaks --parallel",
|
|
89
|
-
"dependencies": ["codegen"]
|
|
90
|
-
},
|
|
91
|
-
"coverage": "deno task test --clean --coverage && deno coverage --html coverage",
|
|
92
|
-
"bench": {
|
|
93
|
-
"command": "deno bench --allow-read --allow-write --allow-net --allow-env --allow-run --unstable-kv",
|
|
94
|
-
"dependencies": ["codegen"]
|
|
95
|
-
},
|
|
96
|
-
"apidoc": {
|
|
97
|
-
"command": "deno doc --html --name=Fedify --output=apidoc/ mod.ts",
|
|
98
|
-
"dependencies": ["codegen"]
|
|
99
|
-
},
|
|
100
|
-
"publish": {
|
|
101
|
-
"command": "deno publish",
|
|
102
|
-
"dependencies": ["check-version", "codegen"]
|
|
103
|
-
},
|
|
104
|
-
"pnpm:install": "pnpm install",
|
|
105
|
-
"pnpm:build": {
|
|
106
|
-
"command": "pnpm exec tsdown",
|
|
107
|
-
"dependencies": ["codegen", "pnpm:install"]
|
|
108
|
-
},
|
|
109
|
-
"npm": {
|
|
110
|
-
"command": "pnpm pack",
|
|
111
|
-
"dependencies": ["sync-version", "pnpm:install"]
|
|
112
|
-
},
|
|
113
|
-
"test:node": {
|
|
114
|
-
"command": "cd dist/ && node --test",
|
|
115
|
-
"dependencies": ["pnpm:build"]
|
|
116
|
-
},
|
|
117
|
-
"test:bun": {
|
|
118
|
-
"command": "cd dist/ && bun test --timeout 60000",
|
|
119
|
-
"dependencies": ["pnpm:build"]
|
|
120
|
-
},
|
|
121
|
-
"test:cfworkers": {
|
|
122
|
-
"command": "pnpm exec wrangler deploy --dry-run --outdir cfworkers && node --import=tsx cfworkers/client.ts",
|
|
123
|
-
"dependencies": ["pnpm:build"]
|
|
124
|
-
},
|
|
125
|
-
"test-all": { "dependencies": [
|
|
126
|
-
"check",
|
|
127
|
-
"test",
|
|
128
|
-
"test:node",
|
|
129
|
-
"test:bun",
|
|
130
|
-
"test:cfworkers"
|
|
131
|
-
] }
|
|
132
|
-
};
|
|
133
|
-
var deno_default = {
|
|
134
|
-
name,
|
|
135
|
-
version,
|
|
136
|
-
license,
|
|
137
|
-
exports,
|
|
138
|
-
imports,
|
|
139
|
-
include,
|
|
140
|
-
exclude,
|
|
141
|
-
tasks
|
|
142
|
-
};
|
|
13
|
+
var version = "1.6.14";
|
|
143
14
|
|
|
144
15
|
//#endregion
|
|
145
16
|
//#region runtime/contexts.ts
|
|
@@ -4361,28 +4232,37 @@ async function getRemoteDocument(url, response, fetch$1) {
|
|
|
4361
4232
|
}
|
|
4362
4233
|
let document;
|
|
4363
4234
|
if (!jsonLd && (contentType === "text/html" || contentType?.startsWith("text/html;") || contentType === "application/xhtml+xml" || contentType?.startsWith("application/xhtml+xml;"))) {
|
|
4364
|
-
const
|
|
4365
|
-
const p2 = /\s+([a-z][a-z:_-]*)=("([^"]*)"|'([^']*)'|([^\s>]+))/gi;
|
|
4235
|
+
const MAX_HTML_SIZE = 1024 * 1024;
|
|
4366
4236
|
const html = await response.text();
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4237
|
+
if (html.length > MAX_HTML_SIZE) {
|
|
4238
|
+
logger.warn("HTML response too large, skipping alternate link discovery: {url}", {
|
|
4239
|
+
url: documentUrl,
|
|
4240
|
+
size: html.length
|
|
4241
|
+
});
|
|
4242
|
+
document = JSON.parse(html);
|
|
4243
|
+
} else {
|
|
4244
|
+
const tagPattern = /<(a|link)\s+([^>]*?)\s*\/?>/gi;
|
|
4245
|
+
const attrPattern = /([a-z][a-z:_-]*)=(?:"([^"]*)"|'([^']*)'|([^\s>]+))/gi;
|
|
4246
|
+
let tagMatch;
|
|
4247
|
+
while ((tagMatch = tagPattern.exec(html)) !== null) {
|
|
4248
|
+
const tagContent = tagMatch[2];
|
|
4249
|
+
let attrMatch;
|
|
4250
|
+
const attribs = {};
|
|
4251
|
+
attrPattern.lastIndex = 0;
|
|
4252
|
+
while ((attrMatch = attrPattern.exec(tagContent)) !== null) {
|
|
4253
|
+
const key = attrMatch[1].toLowerCase();
|
|
4254
|
+
attribs[key] = attrMatch[2] ?? attrMatch[3] ?? attrMatch[4] ?? "";
|
|
4255
|
+
}
|
|
4256
|
+
if (attribs.rel === "alternate" && "type" in attribs && (attribs.type === "application/activity+json" || attribs.type === "application/ld+json" || attribs.type.startsWith("application/ld+json;")) && "href" in attribs && new URL(attribs.href, docUrl).href !== docUrl.href) {
|
|
4257
|
+
logger.debug("Found alternate document: {alternateUrl} from {url}", {
|
|
4258
|
+
alternateUrl: attribs.href,
|
|
4259
|
+
url: documentUrl
|
|
4260
|
+
});
|
|
4261
|
+
return await fetch$1(new URL(attribs.href, docUrl).href);
|
|
4262
|
+
}
|
|
4383
4263
|
}
|
|
4264
|
+
document = JSON.parse(html);
|
|
4384
4265
|
}
|
|
4385
|
-
document = JSON.parse(html);
|
|
4386
4266
|
} else document = await response.json();
|
|
4387
4267
|
logger.debug("Fetched document: {status} {url} {headers}", {
|
|
4388
4268
|
status: response.status,
|
|
@@ -4521,7 +4401,7 @@ function kvCache({ loader, kv, prefix, rules }) {
|
|
|
4521
4401
|
* @since 1.3.0
|
|
4522
4402
|
*/
|
|
4523
4403
|
function getUserAgent({ software, url } = {}) {
|
|
4524
|
-
const fedify = `Fedify/${
|
|
4404
|
+
const fedify = `Fedify/${version}`;
|
|
4525
4405
|
const runtime = globalThis.Deno?.version?.deno != null ? `Deno/${Deno.version.deno}` : globalThis.process?.versions?.bun != null ? `Bun/${process.versions.bun}` : "navigator" in globalThis && navigator.userAgent === "Cloudflare-Workers" ? navigator.userAgent : globalThis.process?.versions?.node != null ? `Node.js/${process.versions.node}` : null;
|
|
4526
4406
|
const userAgent = software == null ? [fedify] : [software, fedify];
|
|
4527
4407
|
if (runtime != null) userAgent.push(runtime);
|
|
@@ -4530,4 +4410,4 @@ function getUserAgent({ software, url } = {}) {
|
|
|
4530
4410
|
}
|
|
4531
4411
|
|
|
4532
4412
|
//#endregion
|
|
4533
|
-
export {
|
|
4413
|
+
export { getRemoteDocument as a, logRequest as c, version as d, getDocumentLoader as i, contexts_default as l, createRequest as n, getUserAgent as o, fetchDocumentLoader as r, kvCache as s, FetchError as t, name as u };
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { i as __toESM, t as __commonJSMin } from "./chunk.js";
|
|
7
7
|
|
|
8
8
|
//#region node_modules/.pnpm/glob-to-regexp@0.4.1/node_modules/glob-to-regexp/index.js
|
|
9
|
-
var require_glob_to_regexp = /* @__PURE__ */
|
|
9
|
+
var require_glob_to_regexp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
10
10
|
module.exports = function(glob$1, opts) {
|
|
11
11
|
if (typeof glob$1 !== "string") throw new TypeError("Expected a string");
|
|
12
12
|
var str = String(glob$1);
|
|
@@ -77,7 +77,7 @@ var require_glob_to_regexp = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/gl
|
|
|
77
77
|
if (!flags || !~flags.indexOf("g")) reStr = "^" + reStr + "$";
|
|
78
78
|
return new RegExp(reStr, flags);
|
|
79
79
|
};
|
|
80
|
-
})
|
|
80
|
+
}));
|
|
81
81
|
|
|
82
82
|
//#endregion
|
|
83
83
|
//#region node_modules/.pnpm/regexparam@3.0.0/node_modules/regexparam/dist/index.mjs
|
|
@@ -112,7 +112,7 @@ function parse(input, loose) {
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
//#endregion
|
|
115
|
-
//#region node_modules/.pnpm/fetch-mock@12.
|
|
115
|
+
//#region node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/TypeDescriptor.js
|
|
116
116
|
const valueTypes = new Set([
|
|
117
117
|
"boolean",
|
|
118
118
|
"number",
|
|
@@ -204,7 +204,7 @@ var TypeDescriptor = class TypeDescriptor {
|
|
|
204
204
|
};
|
|
205
205
|
|
|
206
206
|
//#endregion
|
|
207
|
-
//#region node_modules/.pnpm/fetch-mock@12.
|
|
207
|
+
//#region node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/IsSubsetOf.js
|
|
208
208
|
const allowedTypes = new Set([
|
|
209
209
|
"array",
|
|
210
210
|
"object",
|
|
@@ -358,7 +358,7 @@ function dequal(foo, bar) {
|
|
|
358
358
|
}
|
|
359
359
|
|
|
360
360
|
//#endregion
|
|
361
|
-
//#region node_modules/.pnpm/fetch-mock@12.
|
|
361
|
+
//#region node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/RequestUtils.js
|
|
362
362
|
const absoluteUrlRX = new RegExp("^[a-z]+://|^data:", "i");
|
|
363
363
|
const protocolRelativeUrlRX = new RegExp("^//", "i");
|
|
364
364
|
function hasCredentialsInUrl(url) {
|
|
@@ -421,6 +421,11 @@ async function createCallLogFromRequest(request, options) {
|
|
|
421
421
|
function getPath(url) {
|
|
422
422
|
return (absoluteUrlRX.test(url) ? new URL(url) : new URL(url, "http://dummy")).pathname;
|
|
423
423
|
}
|
|
424
|
+
function getHost(url) {
|
|
425
|
+
if (absoluteUrlRX.test(url)) return new URL(url).host;
|
|
426
|
+
else if ("location" in globalThis) return globalThis.location.host;
|
|
427
|
+
return null;
|
|
428
|
+
}
|
|
424
429
|
function getQuery(url) {
|
|
425
430
|
const u = absoluteUrlRX.test(url) ? new URL(url) : new URL(url, "http://dummy");
|
|
426
431
|
return u.search ? u.search.substr(1) : "";
|
|
@@ -434,7 +439,7 @@ function normalizeHeaders(headers) {
|
|
|
434
439
|
}
|
|
435
440
|
|
|
436
441
|
//#endregion
|
|
437
|
-
//#region node_modules/.pnpm/fetch-mock@12.
|
|
442
|
+
//#region node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/Matchers.js
|
|
438
443
|
var import_glob_to_regexp = /* @__PURE__ */ __toESM(require_glob_to_regexp(), 1);
|
|
439
444
|
const isUrlMatcher = (matcher) => matcher instanceof RegExp || typeof matcher === "string" || typeof matcher === "object" && "href" in matcher;
|
|
440
445
|
const isFunctionMatcher = (matcher) => typeof matcher === "function";
|
|
@@ -465,6 +470,9 @@ const stringMatchers = {
|
|
|
465
470
|
const path = getPath(url);
|
|
466
471
|
return path === targetString || path === dotlessTargetString;
|
|
467
472
|
};
|
|
473
|
+
},
|
|
474
|
+
host: (targetString) => {
|
|
475
|
+
return ({ url }) => targetString === getHost(url);
|
|
468
476
|
}
|
|
469
477
|
};
|
|
470
478
|
const getHeaderMatcher = ({ headers: expectedHeaders }) => {
|
|
@@ -486,8 +494,7 @@ const getMissingHeaderMatcher = ({ missingHeaders: expectedMissingHeaders }) =>
|
|
|
486
494
|
const getMethodMatcher = ({ method: expectedMethod }) => {
|
|
487
495
|
if (!expectedMethod) return;
|
|
488
496
|
return ({ options: { method } = {} }) => {
|
|
489
|
-
|
|
490
|
-
return expectedMethod === actualMethod;
|
|
497
|
+
return expectedMethod === (method ? method.toLowerCase() : "get");
|
|
491
498
|
};
|
|
492
499
|
};
|
|
493
500
|
const getQueryParamsMatcher = ({ query: passedQuery }) => {
|
|
@@ -617,7 +624,7 @@ const builtInMatchers = [
|
|
|
617
624
|
];
|
|
618
625
|
|
|
619
626
|
//#endregion
|
|
620
|
-
//#region node_modules/.pnpm/fetch-mock@12.
|
|
627
|
+
//#region node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/StatusTextMap.js
|
|
621
628
|
const statusTextMap = {
|
|
622
629
|
100: "Continue",
|
|
623
630
|
101: "Switching Protocols",
|
|
@@ -685,7 +692,7 @@ const statusTextMap = {
|
|
|
685
692
|
var StatusTextMap_default = statusTextMap;
|
|
686
693
|
|
|
687
694
|
//#endregion
|
|
688
|
-
//#region node_modules/.pnpm/fetch-mock@12.
|
|
695
|
+
//#region node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/Route.js
|
|
689
696
|
var __classPrivateFieldSet = void 0 && (void 0).__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
690
697
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
691
698
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
@@ -817,7 +824,7 @@ builtInMatchers.forEach(Route.defineMatcher);
|
|
|
817
824
|
var Route_default = Route;
|
|
818
825
|
|
|
819
826
|
//#endregion
|
|
820
|
-
//#region node_modules/.pnpm/fetch-mock@12.
|
|
827
|
+
//#region node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/Router.js
|
|
821
828
|
const responseConfigProps = [
|
|
822
829
|
"body",
|
|
823
830
|
"headers",
|
|
@@ -869,18 +876,23 @@ var Router = class {
|
|
|
869
876
|
throwSpecExceptions(callLog);
|
|
870
877
|
return new Promise(async (resolve, reject) => {
|
|
871
878
|
const { url, options, request, pendingPromises } = callLog;
|
|
879
|
+
let eventListenerAbortController;
|
|
872
880
|
if (callLog.signal) {
|
|
873
881
|
const abort = () => {
|
|
874
882
|
const error = new DOMException("The operation was aborted.", "AbortError");
|
|
875
883
|
const requestBody = request?.body || options?.body;
|
|
876
|
-
if (requestBody instanceof ReadableStream) if (requestBody.locked)
|
|
884
|
+
if (requestBody instanceof ReadableStream) if (requestBody.locked) console.warn("fetch-mock: Locked request body can't be cancelled");
|
|
877
885
|
else requestBody.cancel(error);
|
|
878
|
-
if (callLog?.response?.body) if (callLog.response.body.locked)
|
|
886
|
+
if (callLog?.response?.body) if (callLog.response.body.locked) console.warn("fetch-mock: Locked response body can't be cancelled");
|
|
879
887
|
else callLog.response.body.cancel(error);
|
|
880
888
|
reject(error);
|
|
881
889
|
};
|
|
882
890
|
if (callLog.signal.aborted) abort();
|
|
883
|
-
|
|
891
|
+
eventListenerAbortController = new AbortController();
|
|
892
|
+
callLog.signal.addEventListener("abort", abort, {
|
|
893
|
+
once: true,
|
|
894
|
+
signal: eventListenerAbortController.signal
|
|
895
|
+
});
|
|
884
896
|
}
|
|
885
897
|
if (this.needsToReadBody(request)) options.body = await options.body;
|
|
886
898
|
const route = (this.fallbackRoute ? [...this.routes, this.fallbackRoute] : this.routes).find((route$1) => route$1.matcher(callLog));
|
|
@@ -892,6 +904,8 @@ var Router = class {
|
|
|
892
904
|
resolve(observableResponse);
|
|
893
905
|
} catch (err) {
|
|
894
906
|
reject(err);
|
|
907
|
+
} finally {
|
|
908
|
+
eventListenerAbortController?.abort();
|
|
895
909
|
}
|
|
896
910
|
else reject(/* @__PURE__ */ new Error(`fetch-mock: No response or fallback rule to cover ${options && options.method || "GET"} to ${url}`));
|
|
897
911
|
});
|
|
@@ -989,7 +1003,7 @@ var Router = class {
|
|
|
989
1003
|
};
|
|
990
1004
|
|
|
991
1005
|
//#endregion
|
|
992
|
-
//#region node_modules/.pnpm/fetch-mock@12.
|
|
1006
|
+
//#region node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/CallHistory.js
|
|
993
1007
|
const isName = (filter) => typeof filter === "string" && /^[\da-zA-Z-]+$/.test(filter) && !["matched", "unmatched"].includes(filter);
|
|
994
1008
|
const isMatchedOrUnmatched = (filter) => typeof filter === "boolean" || ["matched", "unmatched"].includes(filter);
|
|
995
1009
|
var CallHistory = class {
|
|
@@ -1019,11 +1033,11 @@ var CallHistory = class {
|
|
|
1019
1033
|
let calls = [...this.callLogs];
|
|
1020
1034
|
if (typeof filter === "undefined" && !options) return calls;
|
|
1021
1035
|
if (isMatchedOrUnmatched(filter)) {
|
|
1022
|
-
if ([true, "matched"].includes(filter)) calls = calls.filter(({ route }) => !route.config.isFallback);
|
|
1023
|
-
else if ([false, "unmatched"].includes(filter)) calls = calls.filter(({ route }) => Boolean(route.config.isFallback));
|
|
1036
|
+
if ([true, "matched"].includes(filter)) calls = calls.filter(({ route }) => !route?.config || !route.config.isFallback);
|
|
1037
|
+
else if ([false, "unmatched"].includes(filter)) calls = calls.filter(({ route }) => Boolean(route?.config && route.config.isFallback));
|
|
1024
1038
|
if (!options) return calls;
|
|
1025
1039
|
} else if (isName(filter)) {
|
|
1026
|
-
calls = calls.filter(({ route
|
|
1040
|
+
calls = calls.filter(({ route }) => route?.config?.name === filter);
|
|
1027
1041
|
if (!options) return calls;
|
|
1028
1042
|
} else if (isUrlMatcher(filter)) options = {
|
|
1029
1043
|
url: filter,
|
|
@@ -1074,7 +1088,7 @@ var CallHistory = class {
|
|
|
1074
1088
|
var CallHistory_default = CallHistory;
|
|
1075
1089
|
|
|
1076
1090
|
//#endregion
|
|
1077
|
-
//#region node_modules/.pnpm/fetch-mock@12.
|
|
1091
|
+
//#region node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/FetchMock.js
|
|
1078
1092
|
const defaultFetchMockConfig = {
|
|
1079
1093
|
includeContentLength: true,
|
|
1080
1094
|
matchPartialBody: false,
|
|
@@ -1207,8 +1221,8 @@ const fetchMock = new FetchMock({ ...defaultFetchMockConfig });
|
|
|
1207
1221
|
var FetchMock_default = fetchMock;
|
|
1208
1222
|
|
|
1209
1223
|
//#endregion
|
|
1210
|
-
//#region node_modules/.pnpm/fetch-mock@12.
|
|
1224
|
+
//#region node_modules/.pnpm/fetch-mock@12.6.0/node_modules/fetch-mock/dist/esm/index.js
|
|
1211
1225
|
var esm_default = FetchMock_default;
|
|
1212
1226
|
|
|
1213
1227
|
//#endregion
|
|
1214
|
-
export { esm_default };
|
|
1228
|
+
export { esm_default as t };
|