@fedify/fedify 1.10.8 → 1.10.10
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-stZ3L5bm.mjs → actor-DZtfiGD5.mjs} +1 -1
- package/dist/{actor-BtdqoffI.js → actor-q2gTvEOg.js} +187 -187
- package/dist/{actor-CHbT9hXW.cjs → actor-yCME0Muf.cjs} +187 -187
- package/dist/{authdocloader-qSZCRtME.cjs → authdocloader-C9ucnURr.cjs} +3 -3
- package/dist/{authdocloader-BjFtWv8Q.js → authdocloader-CjcVKv5l.js} +3 -3
- package/dist/{authdocloader-DiNlCuEL.mjs → authdocloader-Dxs4mL_P.mjs} +3 -3
- package/dist/{builder-C06p3NRV.mjs → builder-DBBCeuJN.mjs} +4 -4
- package/dist/{client-aAP3RFq_.mjs → client-DfSKNItx.mjs} +1 -1
- package/dist/compat/mod.cjs +1 -1
- package/dist/compat/mod.d.cts +1 -1
- package/dist/compat/mod.d.ts +1 -1
- package/dist/compat/transformers.test.mjs +3 -3
- package/dist/{context-BzSr5FCW.d.cts → context-CC4UrGc5.d.cts} +48 -6
- package/dist/{context-CyacVopT.d.ts → context-xfiK4xM5.d.ts} +48 -6
- package/dist/{docloader-Cms83CjK.js → docloader-D8qb26Gj.js} +12 -3
- package/dist/{docloader--HMTXXhM.cjs → docloader-DR98w4wL.cjs} +12 -3
- package/dist/{esm-CfjSLJ-h.mjs → esm-onODA711.mjs} +1 -1
- package/dist/federation/builder.test.mjs +3 -3
- package/dist/federation/collection.test.mjs +1 -1
- package/dist/federation/handler.test.mjs +1362 -46
- package/dist/federation/idempotency.test.mjs +5 -5
- package/dist/federation/inbox.test.mjs +3 -3
- package/dist/federation/keycache.test.mjs +3 -3
- package/dist/federation/kv.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +1586 -82
- package/dist/federation/mod.cjs +2 -2
- package/dist/federation/mod.d.cts +1 -1
- package/dist/federation/mod.d.ts +1 -1
- package/dist/federation/mod.js +1 -1
- package/dist/federation/mq.test.mjs +3 -3
- package/dist/federation/retry.test.mjs +2 -2
- package/dist/federation/router.test.mjs +2 -2
- package/dist/federation/send.test.mjs +8 -8
- package/dist/federation/temporal.test.d.mts +2 -0
- package/dist/federation/temporal.test.mjs +71 -0
- package/dist/{http-CDZB3DBW.js → http-D6Qz3p20.js} +3 -3
- package/dist/{http-BPQ_zPRB.mjs → http-DyCX-dN3.mjs} +2 -2
- package/dist/{http-Bg-OkZtX.cjs → http-mdiWJYia.cjs} +3 -3
- package/dist/{inbox-Cnih7u27.mjs → inbox-BZN50kyQ.mjs} +7 -4
- package/dist/{key-C16D-kud.mjs → key-CSH0Pfat.mjs} +2 -2
- package/dist/{key-DGuUMBsU.cjs → key-DPzMtgeE.cjs} +1 -1
- package/dist/{key-Bbf-ITpM.cjs → key-DRfL8gil.cjs} +2 -2
- package/dist/{key-B0qYOng3.mjs → key-DXUAJBZu.mjs} +1 -1
- package/dist/{key-ASS7oK8n.js → key-TRp8WTUL.js} +2 -2
- package/dist/{keycache-CBPbgb7d.mjs → keycache-DETDxpbh.mjs} +1 -1
- package/dist/{keys-Br4iedk3.mjs → keys-8FIoKqmB.mjs} +1 -1
- package/dist/ld-BaJmhpEa.mjs +548 -0
- package/dist/{lookup-CA5RreoS.cjs → lookup-B7TLaXFf.cjs} +1 -1
- package/dist/{lookup-CpMB-hV5.js → lookup-C6wM-gq1.js} +1 -1
- package/dist/{lookup-CCcDhxO2.mjs → lookup-CX2yfN-X.mjs} +1 -1
- package/dist/{middleware-Bi5LcEMF.mjs → middleware-BJ7otoEC.mjs} +1 -1
- package/dist/{middleware-Crs1EVL7.mjs → middleware-BQ6evC7E.mjs} +320 -87
- package/dist/{middleware-BDTuu7QY.js → middleware-BXc5M6YG.js} +408 -83
- package/dist/{middleware-C90kKt44.cjs → middleware-DpVqFb2x.cjs} +411 -85
- package/dist/{middleware-BPTDstS-.cjs → middleware-cNynSnF6.cjs} +1 -1
- package/dist/mod.cjs +10 -10
- package/dist/mod.d.cts +1 -1
- package/dist/mod.d.ts +1 -1
- package/dist/mod.js +9 -9
- package/dist/nodeinfo/client.test.mjs +3 -3
- package/dist/nodeinfo/handler.test.mjs +2 -2
- package/dist/nodeinfo/mod.cjs +1 -1
- package/dist/nodeinfo/mod.js +1 -1
- package/dist/nodeinfo/semver.test.mjs +1 -1
- package/dist/nodeinfo/types.test.mjs +1 -1
- package/dist/otel/exporter.test.mjs +1 -1
- package/dist/otel/mod.cjs +1 -1
- package/dist/{owner-ncOJW9jU.mjs → owner-CLGVwm9P.mjs} +3 -3
- package/dist/{proof-BYdxNk_7.cjs → proof-BVB37JmB.cjs} +347 -5
- package/dist/{proof-Bd732W1s.mjs → proof-CAOvY-AP.mjs} +2 -2
- package/dist/{proof-JCn_Nftz.js → proof-DxQL08gJ.js} +300 -6
- package/dist/runtime/authdocloader.test.mjs +6 -6
- package/dist/runtime/docloader.test.mjs +4 -4
- package/dist/runtime/key.test.mjs +3 -3
- package/dist/runtime/langstr.test.mjs +2 -2
- package/dist/runtime/link.test.mjs +2 -2
- package/dist/runtime/mod.cjs +3 -3
- package/dist/runtime/mod.js +3 -3
- package/dist/runtime/multibase/multibase.test.mjs +2 -2
- package/dist/runtime/url.test.mjs +5 -2
- package/dist/{send-BUUNtAjI.mjs → send-BFClgq8T.mjs} +2 -2
- package/dist/sig/http.test.mjs +6 -6
- package/dist/sig/key.test.mjs +4 -4
- package/dist/sig/ld.test.mjs +561 -5
- package/dist/sig/mod.cjs +3 -3
- package/dist/sig/mod.js +3 -3
- package/dist/sig/owner.test.mjs +6 -6
- package/dist/sig/proof.test.mjs +4 -4
- package/dist/temporal-lmewfA7Y.mjs +95 -0
- package/dist/testing/docloader.test.mjs +1 -1
- package/dist/testing/mod.d.mts +48 -6
- package/dist/testing/mod.mjs +1 -1
- package/dist/{testing-CvmsaHLW.mjs → testing-B9FmxxlI.mjs} +2 -2
- package/dist/{transformers-Cd6Tdn3M.cjs → transformers-KRl8YJCO.cjs} +1 -1
- package/dist/{types-Dy8sMtkH.js → types-B0aIcMDF.js} +1 -1
- package/dist/{types-BVCtDIwE.cjs → types-DPWiFqle.cjs} +1 -1
- package/dist/vocab/actor.test.mjs +4 -4
- package/dist/vocab/cjs.test.mjs +1 -1
- package/dist/vocab/lookup.test.mjs +5 -5
- package/dist/vocab/mod.cjs +3 -3
- package/dist/vocab/mod.js +3 -3
- package/dist/vocab/type.test.mjs +2 -2
- package/dist/vocab/vocab.test.mjs +3 -3
- package/dist/{vocab-DcYXFzyR.mjs → vocab-DP9A9TjH.mjs} +197 -188
- package/dist/webfinger/handler.test.mjs +3 -3
- package/dist/webfinger/lookup.test.mjs +3 -3
- package/dist/webfinger/mod.cjs +1 -1
- package/dist/webfinger/mod.js +1 -1
- package/dist/x/cfworkers.cjs +1 -1
- package/dist/x/cfworkers.test.mjs +1 -1
- package/dist/x/hono.cjs +1 -1
- package/dist/x/hono.d.cts +1 -1
- package/dist/x/hono.d.ts +1 -1
- package/dist/x/sveltekit.cjs +1 -1
- package/dist/x/sveltekit.d.cts +1 -1
- package/dist/x/sveltekit.d.ts +1 -1
- package/package.json +1 -1
- package/dist/ld-7nQ68-rS.mjs +0 -254
- /package/dist/{denokv-NJPMXyK0.mjs → denokv-B0ZRIDsH.mjs} +0 -0
- /package/dist/{otel-0v4Zy01l.mjs → otel-D00WjYJ1.mjs} +0 -0
- /package/dist/{retry-Ddbq3AcK.mjs → retry-B_E3V_Dx.mjs} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
|
-
const require_middleware = require("./middleware-
|
|
3
|
+
const require_middleware = require("./middleware-DpVqFb2x.cjs");
|
|
4
4
|
exports.FederationImpl = require_middleware.FederationImpl;
|
package/dist/mod.cjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const require_docloader = require("./docloader
|
|
5
|
-
const require_transformers = require("./transformers-
|
|
4
|
+
const require_docloader = require("./docloader-DR98w4wL.cjs");
|
|
5
|
+
const require_transformers = require("./transformers-KRl8YJCO.cjs");
|
|
6
6
|
require("./compat/mod.cjs");
|
|
7
|
-
const require_actor = require("./actor-
|
|
8
|
-
const require_middleware = require("./middleware-
|
|
9
|
-
const require_lookup = require("./lookup-
|
|
10
|
-
const require_key = require("./key-
|
|
11
|
-
const require_http = require("./http-
|
|
12
|
-
const require_proof = require("./proof-
|
|
13
|
-
const require_types = require("./types-
|
|
14
|
-
const require_authdocloader = require("./authdocloader-
|
|
7
|
+
const require_actor = require("./actor-yCME0Muf.cjs");
|
|
8
|
+
const require_middleware = require("./middleware-DpVqFb2x.cjs");
|
|
9
|
+
const require_lookup = require("./lookup-B7TLaXFf.cjs");
|
|
10
|
+
const require_key = require("./key-DRfL8gil.cjs");
|
|
11
|
+
const require_http = require("./http-mdiWJYia.cjs");
|
|
12
|
+
const require_proof = require("./proof-BVB37JmB.cjs");
|
|
13
|
+
const require_types = require("./types-DPWiFqle.cjs");
|
|
14
|
+
const require_authdocloader = require("./authdocloader-C9ucnURr.cjs");
|
|
15
15
|
const require_vocab_mod = require("./vocab/mod.cjs");
|
|
16
16
|
const require_federation_mod = require("./federation/mod.cjs");
|
|
17
17
|
require("./nodeinfo/mod.cjs");
|
package/dist/mod.d.cts
CHANGED
|
@@ -7,7 +7,7 @@ import { a as signRequest, c as FetchKeyResult, d as fetchKey, f as generateCryp
|
|
|
7
7
|
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-0yNTyGMb.cjs";
|
|
8
8
|
import { a as toAcctUrl, c as TraverseCollectionOptions, i as parseFediverseHandle, l as lookupObject, n as FediverseHandle, o as PUBLIC_COLLECTION, r as isFediverseHandle, s as LookupObjectOptions, t as getTypeId, u as traverseCollection } from "./mod-BQ3lrlXU.cjs";
|
|
9
9
|
import { i as ResourceDescriptor, n as lookupWebFinger } from "./mod-CDbqB60V.cjs";
|
|
10
|
-
import { $ as CustomCollectionCursor, A as createFederation, B as RouterRouteResult, C as InboxListenerSetters, D as FederationKvPrefixes, E as CreateFederationOptions, F as Message, G as ActorDispatcher, H as respondWithObject, I as createFederationBuilder, J as AuthorizePredicate, K as ActorHandleMapper, L as Router, M as RetryContext, N as RetryPolicy, O as FederationOrigin, P as createExponentialBackoffPolicy, Q as CustomCollectionCounter, R as RouterError, S as IdempotencyStrategy, T as Rfc6570Expression, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as ActorAliasMapper, X as CollectionCursor, Y as CollectionCounter, Z as CollectionDispatcher, _ as FederationBuilder, a as InboxContext, at as ObjectDispatcher, b as FederationStartQueueOptions, c as RouteActivityOptions, ct as WebFingerLinksDispatcher, d as ActorCallbackSetters, dt as buildCollectionSynchronizationHeader, et as CustomCollectionDispatcher, f as CollectionCallbackSetters, ft as digest, g as Federation, h as Federatable, i as GetSignedKeyOptions, it as ObjectAuthorizePredicate, j as CreateExponentialBackoffPolicyOptions, k as FederationQueueOptions, l as SendActivityOptions, lt as SenderKeyPair, m as CustomCollectionCallbackSetters, n as Context, nt as InboxListener, o as ParseUriResult, ot as OutboxErrorHandler, p as ConstructorWithTypeId, pt as ActivityTransformer, q as ActorKeyPairsDispatcher, r as ForwardActivityOptions, rt as NodeInfoDispatcher, s as RequestContext, st as SharedInboxKeyDispatcher, t as ActorKeyPair, tt as InboxErrorHandler, u as SendActivityOptionsForCollection, ut as PageItems, v as FederationFetchOptions, w as ObjectCallbackSetters, x as IdempotencyKeyCallback, y as FederationOptions, z as RouterOptions } from "./context-
|
|
10
|
+
import { $ as CustomCollectionCursor, A as createFederation, B as RouterRouteResult, C as InboxListenerSetters, D as FederationKvPrefixes, E as CreateFederationOptions, F as Message, G as ActorDispatcher, H as respondWithObject, I as createFederationBuilder, J as AuthorizePredicate, K as ActorHandleMapper, L as Router, M as RetryContext, N as RetryPolicy, O as FederationOrigin, P as createExponentialBackoffPolicy, Q as CustomCollectionCounter, R as RouterError, S as IdempotencyStrategy, T as Rfc6570Expression, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as ActorAliasMapper, X as CollectionCursor, Y as CollectionCounter, Z as CollectionDispatcher, _ as FederationBuilder, a as InboxContext, at as ObjectDispatcher, b as FederationStartQueueOptions, c as RouteActivityOptions, ct as WebFingerLinksDispatcher, d as ActorCallbackSetters, dt as buildCollectionSynchronizationHeader, et as CustomCollectionDispatcher, f as CollectionCallbackSetters, ft as digest, g as Federation, h as Federatable, i as GetSignedKeyOptions, it as ObjectAuthorizePredicate, j as CreateExponentialBackoffPolicyOptions, k as FederationQueueOptions, l as SendActivityOptions, lt as SenderKeyPair, m as CustomCollectionCallbackSetters, n as Context, nt as InboxListener, o as ParseUriResult, ot as OutboxErrorHandler, p as ConstructorWithTypeId, pt as ActivityTransformer, q as ActorKeyPairsDispatcher, r as ForwardActivityOptions, rt as NodeInfoDispatcher, s as RequestContext, st as SharedInboxKeyDispatcher, t as ActorKeyPair, tt as InboxErrorHandler, u as SendActivityOptionsForCollection, ut as PageItems, v as FederationFetchOptions, w as ObjectCallbackSetters, x as IdempotencyKeyCallback, y as FederationOptions, z as RouterOptions } from "./context-CC4UrGc5.cjs";
|
|
11
11
|
import { a as MessageQueueListenOptions, i as MessageQueueEnqueueOptions, n as InProcessMessageQueueOptions, o as ParallelMessageQueue, r as MessageQueue, t as InProcessMessageQueue } from "./mq-CrItclRD.cjs";
|
|
12
12
|
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.cjs";
|
|
13
13
|
import { GetAuthenticatedDocumentLoaderOptions, exportMultibaseKey, exportSpki, getAuthenticatedDocumentLoader, importMultibaseKey, importPem, importPkcs1, importSpki } from "./runtime/mod.cjs";
|
package/dist/mod.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { a as signRequest, c as FetchKeyResult, d as fetchKey, f as generateCryp
|
|
|
9
9
|
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-CPEbNpnZ.js";
|
|
10
10
|
import { a as toAcctUrl, c as TraverseCollectionOptions, i as parseFediverseHandle, l as lookupObject, n as FediverseHandle, o as PUBLIC_COLLECTION, r as isFediverseHandle, s as LookupObjectOptions, t as getTypeId, u as traverseCollection } from "./mod-Lj0W1nnG.js";
|
|
11
11
|
import { i as ResourceDescriptor, n as lookupWebFinger } from "./mod-lHd-Zdd_.js";
|
|
12
|
-
import { $ as CustomCollectionCursor, A as createFederation, B as RouterRouteResult, C as InboxListenerSetters, D as FederationKvPrefixes, E as CreateFederationOptions, F as Message, G as ActorDispatcher, H as respondWithObject, I as createFederationBuilder, J as AuthorizePredicate, K as ActorHandleMapper, L as Router, M as RetryContext, N as RetryPolicy, O as FederationOrigin, P as createExponentialBackoffPolicy, Q as CustomCollectionCounter, R as RouterError, S as IdempotencyStrategy, T as Rfc6570Expression, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as ActorAliasMapper, X as CollectionCursor, Y as CollectionCounter, Z as CollectionDispatcher, _ as FederationBuilder, a as InboxContext, at as ObjectDispatcher, b as FederationStartQueueOptions, c as RouteActivityOptions, ct as WebFingerLinksDispatcher, d as ActorCallbackSetters, dt as buildCollectionSynchronizationHeader, et as CustomCollectionDispatcher, f as CollectionCallbackSetters, ft as digest, g as Federation, h as Federatable, i as GetSignedKeyOptions, it as ObjectAuthorizePredicate, j as CreateExponentialBackoffPolicyOptions, k as FederationQueueOptions, l as SendActivityOptions, lt as SenderKeyPair, m as CustomCollectionCallbackSetters, n as Context, nt as InboxListener, o as ParseUriResult, ot as OutboxErrorHandler, p as ConstructorWithTypeId, pt as ActivityTransformer, q as ActorKeyPairsDispatcher, r as ForwardActivityOptions, rt as NodeInfoDispatcher, s as RequestContext, st as SharedInboxKeyDispatcher, t as ActorKeyPair, tt as InboxErrorHandler, u as SendActivityOptionsForCollection, ut as PageItems, v as FederationFetchOptions, w as ObjectCallbackSetters, x as IdempotencyKeyCallback, y as FederationOptions, z as RouterOptions } from "./context-
|
|
12
|
+
import { $ as CustomCollectionCursor, A as createFederation, B as RouterRouteResult, C as InboxListenerSetters, D as FederationKvPrefixes, E as CreateFederationOptions, F as Message, G as ActorDispatcher, H as respondWithObject, I as createFederationBuilder, J as AuthorizePredicate, K as ActorHandleMapper, L as Router, M as RetryContext, N as RetryPolicy, O as FederationOrigin, P as createExponentialBackoffPolicy, Q as CustomCollectionCounter, R as RouterError, S as IdempotencyStrategy, T as Rfc6570Expression, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as ActorAliasMapper, X as CollectionCursor, Y as CollectionCounter, Z as CollectionDispatcher, _ as FederationBuilder, a as InboxContext, at as ObjectDispatcher, b as FederationStartQueueOptions, c as RouteActivityOptions, ct as WebFingerLinksDispatcher, d as ActorCallbackSetters, dt as buildCollectionSynchronizationHeader, et as CustomCollectionDispatcher, f as CollectionCallbackSetters, ft as digest, g as Federation, h as Federatable, i as GetSignedKeyOptions, it as ObjectAuthorizePredicate, j as CreateExponentialBackoffPolicyOptions, k as FederationQueueOptions, l as SendActivityOptions, lt as SenderKeyPair, m as CustomCollectionCallbackSetters, n as Context, nt as InboxListener, o as ParseUriResult, ot as OutboxErrorHandler, p as ConstructorWithTypeId, pt as ActivityTransformer, q as ActorKeyPairsDispatcher, r as ForwardActivityOptions, rt as NodeInfoDispatcher, s as RequestContext, st as SharedInboxKeyDispatcher, t as ActorKeyPair, tt as InboxErrorHandler, u as SendActivityOptionsForCollection, ut as PageItems, v as FederationFetchOptions, w as ObjectCallbackSetters, x as IdempotencyKeyCallback, y as FederationOptions, z as RouterOptions } from "./context-xfiK4xM5.js";
|
|
13
13
|
import { a as MessageQueueListenOptions, i as MessageQueueEnqueueOptions, n as InProcessMessageQueueOptions, o as ParallelMessageQueue, r as MessageQueue, t as InProcessMessageQueue } from "./mq-D_ZZRdby.js";
|
|
14
14
|
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.js";
|
|
15
15
|
import { GetAuthenticatedDocumentLoaderOptions, exportMultibaseKey, exportSpki, getAuthenticatedDocumentLoader, importMultibaseKey, importPem, importPkcs1, importSpki } from "./runtime/mod.js";
|
package/dist/mod.js
CHANGED
|
@@ -2,15 +2,15 @@ import "@js-temporal/polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "./transformers-BV4OeK9o.js";
|
|
4
4
|
import "./compat/mod.js";
|
|
5
|
-
import { i as getDocumentLoader, o as getUserAgent, r as fetchDocumentLoader, s as kvCache, t as FetchError } from "./docloader-
|
|
6
|
-
import { $ as Person, A as Flag, B as Like, C as Dislike, Ct as importPkcs1, D as Endpoints, E as EmojiReact, F as Image, G as Multikey, H as Listen, I as IntransitiveActivity, J as Offer, K as Note, L as Invite, M as Group, N as Hashtag, O as Event, P as Ignore, Q as Page, R as Join, S as DidService, St as importPem, T as Emoji, Tt as getTypeId, U as Mention, V as Link, W as Move, X as OrderedCollectionPage, Y as OrderedCollection, Z as Organization, _ as CollectionPage, _t as View, a as normalizeActorHandle, at as Reject, b as DataIntegrityProof, bt as exportSpki, c as Add, ct as Service, d as Arrive, dt as TentativeReject, et as Place, f as Article, ft as Tombstone, g as Collection, gt as Video, h as ChatMessage, ht as Update, i as isActor, it as Read, j as Follow, k as Export, l as Announce, lt as Source, m as Block, mt as Undo, n as getActorHandle, nt as PropertyValue, o as Accept, ot as Relationship, p as Audio, pt as Travel, q as Object$1, r as getActorTypeName, rt as Question, s as Activity, st as Remove, t as getActorClassByTypeName, tt as Profile, u as Application, ut as TentativeAccept, v as Create, vt as LanguageString, w as Document, wt as importSpki, x as Delete, xt as importMultibaseKey, y as CryptographicKey, yt as exportMultibaseKey, z as Leave } from "./actor-
|
|
7
|
-
import { a as respondWithObjectIfAcceptable, c as createFederationBuilder, i as respondWithObject, l as Router, o as buildCollectionSynchronizationHeader, r as createExponentialBackoffPolicy, s as digest, t as createFederation, u as RouterError } from "./middleware-
|
|
8
|
-
import { t as lookupWebFinger } from "./lookup-
|
|
9
|
-
import { i as importJwk, n as fetchKey, r as generateCryptoKeyPair, t as exportJwk } from "./key-
|
|
10
|
-
import { n as signRequest, r as verifyRequest } from "./http-
|
|
11
|
-
import { a as doesActorOwnKey,
|
|
12
|
-
import { a as parseSemVer, i as formatSemVer, n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-
|
|
13
|
-
import { t as getAuthenticatedDocumentLoader } from "./authdocloader-
|
|
5
|
+
import { i as getDocumentLoader, o as getUserAgent, r as fetchDocumentLoader, s as kvCache, t as FetchError } from "./docloader-D8qb26Gj.js";
|
|
6
|
+
import { $ as Person, A as Flag, B as Like, C as Dislike, Ct as importPkcs1, D as Endpoints, E as EmojiReact, F as Image, G as Multikey, H as Listen, I as IntransitiveActivity, J as Offer, K as Note, L as Invite, M as Group, N as Hashtag, O as Event, P as Ignore, Q as Page, R as Join, S as DidService, St as importPem, T as Emoji, Tt as getTypeId, U as Mention, V as Link, W as Move, X as OrderedCollectionPage, Y as OrderedCollection, Z as Organization, _ as CollectionPage, _t as View, a as normalizeActorHandle, at as Reject, b as DataIntegrityProof, bt as exportSpki, c as Add, ct as Service, d as Arrive, dt as TentativeReject, et as Place, f as Article, ft as Tombstone, g as Collection, gt as Video, h as ChatMessage, ht as Update, i as isActor, it as Read, j as Follow, k as Export, l as Announce, lt as Source, m as Block, mt as Undo, n as getActorHandle, nt as PropertyValue, o as Accept, ot as Relationship, p as Audio, pt as Travel, q as Object$1, r as getActorTypeName, rt as Question, s as Activity, st as Remove, t as getActorClassByTypeName, tt as Profile, u as Application, ut as TentativeAccept, v as Create, vt as LanguageString, w as Document, wt as importSpki, x as Delete, xt as importMultibaseKey, y as CryptographicKey, yt as exportMultibaseKey, z as Leave } from "./actor-q2gTvEOg.js";
|
|
7
|
+
import { a as respondWithObjectIfAcceptable, c as createFederationBuilder, i as respondWithObject, l as Router, o as buildCollectionSynchronizationHeader, r as createExponentialBackoffPolicy, s as digest, t as createFederation, u as RouterError } from "./middleware-BXc5M6YG.js";
|
|
8
|
+
import { t as lookupWebFinger } from "./lookup-C6wM-gq1.js";
|
|
9
|
+
import { i as importJwk, n as fetchKey, r as generateCryptoKeyPair, t as exportJwk } from "./key-TRp8WTUL.js";
|
|
10
|
+
import { n as signRequest, r as verifyRequest } from "./http-D6Qz3p20.js";
|
|
11
|
+
import { _ as signJsonLd, a as doesActorOwnKey, b as verifySignature, d as createSignature, f as detachSignature, i as verifyProof, l as attachSignature, n as signObject, o as getKeyOwner, r as verifyObject, t as createProof, y as verifyJsonLd } from "./proof-DxQL08gJ.js";
|
|
12
|
+
import { a as parseSemVer, i as formatSemVer, n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-B0aIcMDF.js";
|
|
13
|
+
import { t as getAuthenticatedDocumentLoader } from "./authdocloader-CjcVKv5l.js";
|
|
14
14
|
import { PUBLIC_COLLECTION, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "./vocab/mod.js";
|
|
15
15
|
import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "./federation/mod.js";
|
|
16
16
|
import "./nodeinfo/mod.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as test } from "../testing-
|
|
4
|
+
import { t as test } from "../testing-B9FmxxlI.mjs";
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
6
|
import "../std__assert-2v7gYiZp.mjs";
|
|
7
|
-
import { a as parseProtocol, c as parseUsage, i as parseOutboundService, n as parseInboundService, o as parseServices, r as parseNodeInfo, s as parseSoftware, t as getNodeInfo } from "../client-
|
|
8
|
-
import { t as esm_default } from "../esm-
|
|
7
|
+
import { a as parseProtocol, c as parseUsage, i as parseOutboundService, n as parseInboundService, o as parseServices, r as parseNodeInfo, s as parseSoftware, t as getNodeInfo } from "../client-DfSKNItx.mjs";
|
|
8
|
+
import { t as esm_default } from "../esm-onODA711.mjs";
|
|
9
9
|
//#region src/nodeinfo/client.test.ts
|
|
10
10
|
test("getNodeInfo()", async (t) => {
|
|
11
11
|
esm_default.spyGlobal();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { i as createRequestContext, t as test } from "../testing-
|
|
4
|
+
import { i as createRequestContext, t as test } from "../testing-B9FmxxlI.mjs";
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
6
|
import "../std__assert-2v7gYiZp.mjs";
|
|
7
7
|
import { t as MemoryKvStore } from "../kv-OuT2IU64.mjs";
|
|
8
|
-
import { a as createFederation, g as handleNodeInfoJrd, h as handleNodeInfo } from "../middleware-
|
|
8
|
+
import { a as createFederation, g as handleNodeInfoJrd, h as handleNodeInfo } from "../middleware-BQ6evC7E.mjs";
|
|
9
9
|
import { n as parseSemVer } from "../semver-CgD82xxg.mjs";
|
|
10
10
|
//#region src/nodeinfo/handler.test.ts
|
|
11
11
|
test("handleNodeInfo()", async () => {
|
package/dist/nodeinfo/mod.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const require_types = require("../types-
|
|
4
|
+
const require_types = require("../types-DPWiFqle.cjs");
|
|
5
5
|
exports.formatSemVer = require_types.formatSemVer;
|
|
6
6
|
exports.getNodeInfo = require_types.getNodeInfo;
|
|
7
7
|
exports.nodeInfoToJson = require_types.nodeInfoToJson;
|
package/dist/nodeinfo/mod.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
|
-
import { a as parseSemVer, i as formatSemVer, n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "../types-
|
|
3
|
+
import { a as parseSemVer, i as formatSemVer, n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "../types-B0aIcMDF.js";
|
|
4
4
|
export { formatSemVer, getNodeInfo, nodeInfoToJson, parseNodeInfo, parseSemVer };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as test } from "../testing-
|
|
4
|
+
import { t as test } from "../testing-B9FmxxlI.mjs";
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
6
|
import "../std__assert-2v7gYiZp.mjs";
|
|
7
7
|
import { t as assertThrows } from "../assert_throws-BIL7gChy.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as test } from "../testing-
|
|
4
|
+
import { t as test } from "../testing-B9FmxxlI.mjs";
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
6
|
import "../std__assert-2v7gYiZp.mjs";
|
|
7
7
|
import { t as assertThrows } from "../assert_throws-BIL7gChy.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as test } from "../testing-
|
|
4
|
+
import { t as test } from "../testing-B9FmxxlI.mjs";
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
6
|
import "../std__assert-2v7gYiZp.mjs";
|
|
7
7
|
import { t as assertThrows } from "../assert_throws-BIL7gChy.mjs";
|
package/dist/otel/mod.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
require("../docloader
|
|
4
|
+
require("../docloader-DR98w4wL.cjs");
|
|
5
5
|
let _logtape_logtape = require("@logtape/logtape");
|
|
6
6
|
let _opentelemetry_core = require("@opentelemetry/core");
|
|
7
7
|
//#region src/otel/exporter.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { J as getDocumentLoader, ot as name, s as CryptographicKey, st as version, v as Object$1 } from "./vocab-
|
|
5
|
-
import { i as isActor } from "./actor-
|
|
6
|
-
import "./key-
|
|
4
|
+
import { J as getDocumentLoader, ot as name, s as CryptographicKey, st as version, v as Object$1 } from "./vocab-DP9A9TjH.mjs";
|
|
5
|
+
import { i as isActor } from "./actor-DZtfiGD5.mjs";
|
|
6
|
+
import "./key-CSH0Pfat.mjs";
|
|
7
7
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
8
8
|
//#region src/sig/owner.ts
|
|
9
9
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
|
-
const require_docloader = require("./docloader
|
|
4
|
-
const require_actor = require("./actor-
|
|
5
|
-
const require_key = require("./key-
|
|
3
|
+
const require_docloader = require("./docloader-DR98w4wL.cjs");
|
|
4
|
+
const require_actor = require("./actor-yCME0Muf.cjs");
|
|
5
|
+
const require_key = require("./key-DRfL8gil.cjs");
|
|
6
6
|
let _logtape_logtape = require("@logtape/logtape");
|
|
7
7
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
8
8
|
let jsonld = require("jsonld");
|
|
@@ -17,6 +17,288 @@ const logger$1 = (0, _logtape_logtape.getLogger)([
|
|
|
17
17
|
"sig",
|
|
18
18
|
"ld"
|
|
19
19
|
]);
|
|
20
|
+
const localContext = [
|
|
21
|
+
"https://w3id.org/identity/v1",
|
|
22
|
+
"https://www.w3.org/ns/activitystreams",
|
|
23
|
+
"https://w3id.org/security/v1",
|
|
24
|
+
"https://w3id.org/security/data-integrity/v1"
|
|
25
|
+
];
|
|
26
|
+
const localContextUrls = new Set(localContext);
|
|
27
|
+
const builtInContextLoader = require_docloader.getDocumentLoader();
|
|
28
|
+
const disallowedJsonLdKeywords = new Set([
|
|
29
|
+
"@graph",
|
|
30
|
+
"@included",
|
|
31
|
+
"@reverse"
|
|
32
|
+
]);
|
|
33
|
+
/** @internal */
|
|
34
|
+
var UnsafeJsonLdError = class extends TypeError {
|
|
35
|
+
constructor(keyword) {
|
|
36
|
+
super(`Unsupported JSON-LD keyword: ${keyword}.`);
|
|
37
|
+
this.keyword = keyword;
|
|
38
|
+
this.name = "UnsafeJsonLdError";
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
/** @internal */
|
|
42
|
+
var InvalidContextReferenceError = class extends TypeError {
|
|
43
|
+
constructor(reference) {
|
|
44
|
+
super(`Invalid JSON-LD context reference: ${reference}.`);
|
|
45
|
+
this.reference = reference;
|
|
46
|
+
this.name = "InvalidContextReferenceError";
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
function createLoadingRemoteContextFailedError(reference, cause) {
|
|
50
|
+
const message = cause instanceof Error ? cause.message : String(cause);
|
|
51
|
+
const error = /* @__PURE__ */ new Error(`Dereferencing a URL did not result in a valid JSON-LD context: ${reference}. ${message}`);
|
|
52
|
+
error.name = "jsonld.InvalidUrl";
|
|
53
|
+
error.details = {
|
|
54
|
+
code: "loading remote context failed",
|
|
55
|
+
url: reference
|
|
56
|
+
};
|
|
57
|
+
error.cause = cause;
|
|
58
|
+
return error;
|
|
59
|
+
}
|
|
60
|
+
/** @internal */
|
|
61
|
+
function isClearlyMalformedContextReference(reference) {
|
|
62
|
+
for (const char of reference) {
|
|
63
|
+
const code = char.charCodeAt(0);
|
|
64
|
+
if (code <= 32 || code === 127) return true;
|
|
65
|
+
}
|
|
66
|
+
if (/^[A-Za-z][A-Za-z0-9+.-]*:/.test(reference) && !URL.canParse(reference)) return true;
|
|
67
|
+
for (let i = 0; i < reference.length; i++) {
|
|
68
|
+
if (reference[i] !== "%") continue;
|
|
69
|
+
if (i + 2 >= reference.length || !/[0-9A-Fa-f]/.test(reference[i + 1]) || !/[0-9A-Fa-f]/.test(reference[i + 2])) return true;
|
|
70
|
+
i += 2;
|
|
71
|
+
}
|
|
72
|
+
if (reference.startsWith("./") || reference.startsWith("../") || reference.startsWith("/") || reference.startsWith("//")) {
|
|
73
|
+
for (const char of reference) if ("[]<>\"\\^`{|}".includes(char)) return true;
|
|
74
|
+
}
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
function cloneRemoteDocument(remoteDocument) {
|
|
78
|
+
return structuredClone(remoteDocument);
|
|
79
|
+
}
|
|
80
|
+
function createMemoizedDocumentLoader(documentLoader) {
|
|
81
|
+
const cache = /* @__PURE__ */ new Map();
|
|
82
|
+
return async (url, options) => {
|
|
83
|
+
const cacheKey = URL.canParse(url) ? new URL(url).href : url;
|
|
84
|
+
let remoteDocument = cache.get(cacheKey);
|
|
85
|
+
if (remoteDocument == null) {
|
|
86
|
+
remoteDocument = Promise.resolve(documentLoader(url, options)).then(cloneRemoteDocument);
|
|
87
|
+
remoteDocument.catch(() => {
|
|
88
|
+
if (cache.get(cacheKey) === remoteDocument) cache.delete(cacheKey);
|
|
89
|
+
});
|
|
90
|
+
cache.set(cacheKey, remoteDocument);
|
|
91
|
+
}
|
|
92
|
+
return cloneRemoteDocument(await remoteDocument);
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/** @internal */
|
|
96
|
+
function wrapContextLoaderForJsonLd(contextLoader) {
|
|
97
|
+
const loader = contextLoader ?? builtInContextLoader;
|
|
98
|
+
return async (url, options) => {
|
|
99
|
+
try {
|
|
100
|
+
return await loader(url, options);
|
|
101
|
+
} catch (error) {
|
|
102
|
+
if (!isInvalidUrlTypeError(error)) throw error;
|
|
103
|
+
if (isClearlyMalformedContextReference(url)) throw new InvalidContextReferenceError(url);
|
|
104
|
+
throw createLoadingRemoteContextFailedError(url, error);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/** @internal */
|
|
109
|
+
function getNormalizationContextLoader(contextLoader) {
|
|
110
|
+
const loader = wrapContextLoaderForJsonLd(contextLoader);
|
|
111
|
+
return createMemoizedDocumentLoader(async (url, options) => {
|
|
112
|
+
if (URL.canParse(url)) {
|
|
113
|
+
const normalizedUrl = new URL(url).href;
|
|
114
|
+
if (localContextUrls.has(normalizedUrl)) return await builtInContextLoader(normalizedUrl, options);
|
|
115
|
+
}
|
|
116
|
+
return await loader(url, options);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
/** @internal */
|
|
120
|
+
async function compactJsonLd(jsonLd, contextLoader) {
|
|
121
|
+
const hasLds = typeof jsonLd === "object" && jsonLd != null && "signature" in jsonLd;
|
|
122
|
+
const signature = hasLds ? jsonLd.signature : void 0;
|
|
123
|
+
const normalizationContextLoader = getNormalizationContextLoader(contextLoader);
|
|
124
|
+
const document = hasLds ? detachSignature(jsonLd) : jsonLd;
|
|
125
|
+
await assertNoGraphBeforeCompaction(document, normalizationContextLoader);
|
|
126
|
+
const compacted = await jsonld.default.compact(document, localContext, { documentLoader: normalizationContextLoader });
|
|
127
|
+
if (hasLds && typeof compacted === "object" && compacted != null) compacted.signature = signature;
|
|
128
|
+
assertSafeJsonLd(compacted);
|
|
129
|
+
return compacted;
|
|
130
|
+
}
|
|
131
|
+
function createInvalidRemoteContextError(reference) {
|
|
132
|
+
const error = /* @__PURE__ */ new Error(`Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object. URL: "${reference}".`);
|
|
133
|
+
error.name = "jsonld.InvalidUrl";
|
|
134
|
+
error.details = {
|
|
135
|
+
code: "invalid remote context",
|
|
136
|
+
url: reference
|
|
137
|
+
};
|
|
138
|
+
return error;
|
|
139
|
+
}
|
|
140
|
+
function getRemoteContext(remoteDocument, reference) {
|
|
141
|
+
const { contextUrl, documentUrl } = remoteDocument;
|
|
142
|
+
let { document } = remoteDocument;
|
|
143
|
+
if (typeof document === "string") document = JSON.parse(document);
|
|
144
|
+
if (typeof document !== "object" || document == null || Array.isArray(document)) throw createInvalidRemoteContextError(reference);
|
|
145
|
+
let context = "@context" in document ? document["@context"] : {};
|
|
146
|
+
if (contextUrl != null) context = Array.isArray(context) ? [...context, contextUrl] : [context, contextUrl];
|
|
147
|
+
return {
|
|
148
|
+
context,
|
|
149
|
+
baseUrl: documentUrl ?? reference
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function createGraphAliasContextState() {
|
|
153
|
+
return {
|
|
154
|
+
graphTerms: /* @__PURE__ */ new Set(),
|
|
155
|
+
jsonTerms: /* @__PURE__ */ new Set(),
|
|
156
|
+
propertyContexts: /* @__PURE__ */ new Map(),
|
|
157
|
+
termTargets: /* @__PURE__ */ new Map()
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
function cloneGraphAliasContextState(state) {
|
|
161
|
+
return {
|
|
162
|
+
graphTerms: new Set(state.graphTerms),
|
|
163
|
+
jsonTerms: new Set(state.jsonTerms),
|
|
164
|
+
propertyContexts: new Map(state.propertyContexts),
|
|
165
|
+
termTargets: new Map(state.termTargets)
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
function resolveContextTarget(target, state) {
|
|
169
|
+
if (target === "@graph") return target;
|
|
170
|
+
const mapped = state.termTargets.get(target);
|
|
171
|
+
if (mapped == null) return target;
|
|
172
|
+
return mapped;
|
|
173
|
+
}
|
|
174
|
+
function getDirectContextTarget(definition) {
|
|
175
|
+
if (definition === null) return null;
|
|
176
|
+
if (typeof definition === "string") return definition;
|
|
177
|
+
if (typeof definition === "object" && definition != null && "@id" in definition) {
|
|
178
|
+
const id = definition["@id"];
|
|
179
|
+
if (id === null) return null;
|
|
180
|
+
if (typeof id === "string") return id;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
function isJsonTypedDefinition(definition) {
|
|
184
|
+
return typeof definition === "object" && definition != null && "@type" in definition && definition["@type"] === "@json";
|
|
185
|
+
}
|
|
186
|
+
function resolveLocalContextTarget(target, state, localTargets, seen = /* @__PURE__ */ new Set()) {
|
|
187
|
+
if (target === "@graph") return target;
|
|
188
|
+
if (seen.has(target)) return target;
|
|
189
|
+
seen.add(target);
|
|
190
|
+
if (localTargets.has(target)) {
|
|
191
|
+
const localTarget = localTargets.get(target);
|
|
192
|
+
return localTarget == null ? target : resolveLocalContextTarget(localTarget, state, localTargets, seen);
|
|
193
|
+
}
|
|
194
|
+
return resolveContextTarget(target, state);
|
|
195
|
+
}
|
|
196
|
+
function refreshGraphAliases(state) {
|
|
197
|
+
state.graphTerms.clear();
|
|
198
|
+
for (const [term, target] of state.termTargets) if (target === "@graph") state.graphTerms.add(term);
|
|
199
|
+
}
|
|
200
|
+
function normalizeContextReference(reference, baseUrl) {
|
|
201
|
+
if (baseUrl != null) return new URL(reference, baseUrl).href;
|
|
202
|
+
return URL.canParse(reference) ? new URL(reference).href : reference;
|
|
203
|
+
}
|
|
204
|
+
/** @internal */
|
|
205
|
+
function isInvalidUrlTypeError(error) {
|
|
206
|
+
const code = error.code;
|
|
207
|
+
return error instanceof TypeError && (code === "ERR_INVALID_URL" || /^Invalid URL(?::|$)/.test(error.message) || / cannot be parsed as a URL\.?$/.test(error.message));
|
|
208
|
+
}
|
|
209
|
+
async function applyGraphAliasContext(state, context, documentLoader, remoteContextCache, baseUrl = null, processingContexts = /* @__PURE__ */ new Set()) {
|
|
210
|
+
if (context === null) return createGraphAliasContextState();
|
|
211
|
+
let nextState = cloneGraphAliasContextState(state);
|
|
212
|
+
if (Array.isArray(context)) {
|
|
213
|
+
for (const item of context) nextState = await applyGraphAliasContext(nextState, item, documentLoader, remoteContextCache, baseUrl, processingContexts);
|
|
214
|
+
return nextState;
|
|
215
|
+
}
|
|
216
|
+
if (typeof context === "string") {
|
|
217
|
+
const reference = normalizeContextReference(context, baseUrl);
|
|
218
|
+
const cacheKey = `${baseUrl ?? ""}\n${reference}`;
|
|
219
|
+
if (processingContexts.has(cacheKey)) return nextState;
|
|
220
|
+
processingContexts.add(cacheKey);
|
|
221
|
+
try {
|
|
222
|
+
let remoteContext = remoteContextCache.get(cacheKey);
|
|
223
|
+
if (remoteContext == null) {
|
|
224
|
+
remoteContext = (async () => {
|
|
225
|
+
try {
|
|
226
|
+
return getRemoteContext(await documentLoader(reference), reference);
|
|
227
|
+
} catch (error) {
|
|
228
|
+
if (reference === context && isInvalidUrlTypeError(error) && isClearlyMalformedContextReference(context)) throw new InvalidContextReferenceError(context);
|
|
229
|
+
throw error;
|
|
230
|
+
}
|
|
231
|
+
})();
|
|
232
|
+
remoteContextCache.set(cacheKey, remoteContext);
|
|
233
|
+
}
|
|
234
|
+
const loadedRemoteContext = await remoteContext;
|
|
235
|
+
return await applyGraphAliasContext(nextState, loadedRemoteContext.context, documentLoader, remoteContextCache, loadedRemoteContext.baseUrl, processingContexts);
|
|
236
|
+
} finally {
|
|
237
|
+
processingContexts.delete(cacheKey);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
if (typeof context === "object" && context != null) {
|
|
241
|
+
if ("@import" in context && typeof context["@import"] === "string") nextState = await applyGraphAliasContext(nextState, context["@import"], documentLoader, remoteContextCache, baseUrl, processingContexts);
|
|
242
|
+
const localTargets = /* @__PURE__ */ new Map();
|
|
243
|
+
for (const [term, definition] of globalThis.Object.entries(context)) {
|
|
244
|
+
if (term.startsWith("@")) continue;
|
|
245
|
+
const target = getDirectContextTarget(definition);
|
|
246
|
+
if (target == null) localTargets.set(term, null);
|
|
247
|
+
else if (typeof target === "string") localTargets.set(term, target);
|
|
248
|
+
else localTargets.delete(term);
|
|
249
|
+
}
|
|
250
|
+
for (const [term, definition] of globalThis.Object.entries(context)) {
|
|
251
|
+
if (term.startsWith("@")) continue;
|
|
252
|
+
if (localTargets.has(term)) {
|
|
253
|
+
const directTarget = localTargets.get(term);
|
|
254
|
+
if (directTarget == null) nextState.termTargets.set(term, null);
|
|
255
|
+
else nextState.termTargets.set(term, resolveLocalContextTarget(directTarget, nextState, localTargets));
|
|
256
|
+
} else nextState.termTargets.delete(term);
|
|
257
|
+
if (typeof definition === "object" && definition != null && "@context" in definition) nextState.propertyContexts.set(term, {
|
|
258
|
+
context: definition["@context"],
|
|
259
|
+
baseUrl
|
|
260
|
+
});
|
|
261
|
+
else nextState.propertyContexts.delete(term);
|
|
262
|
+
if (isJsonTypedDefinition(definition)) nextState.jsonTerms.add(term);
|
|
263
|
+
else nextState.jsonTerms.delete(term);
|
|
264
|
+
}
|
|
265
|
+
refreshGraphAliases(nextState);
|
|
266
|
+
}
|
|
267
|
+
return nextState;
|
|
268
|
+
}
|
|
269
|
+
async function assertNoGraphBeforeCompaction(jsonLd, documentLoader, inheritedState = createGraphAliasContextState(), propertyContext, remoteContextCache = /* @__PURE__ */ new Map()) {
|
|
270
|
+
if (Array.isArray(jsonLd)) {
|
|
271
|
+
for (const item of jsonLd) await assertNoGraphBeforeCompaction(item, documentLoader, inheritedState, propertyContext, remoteContextCache);
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
if (typeof jsonLd !== "object" || jsonLd == null) return;
|
|
275
|
+
const jsonLiteralWrapper = isJsonLiteralWrapper(jsonLd);
|
|
276
|
+
let state = inheritedState;
|
|
277
|
+
if (propertyContext !== void 0) state = await applyGraphAliasContext(state, propertyContext.context, documentLoader, remoteContextCache, propertyContext.baseUrl);
|
|
278
|
+
if ("@context" in jsonLd) state = await applyGraphAliasContext(state, jsonLd["@context"], documentLoader, remoteContextCache);
|
|
279
|
+
for (const [key, value] of globalThis.Object.entries(jsonLd)) {
|
|
280
|
+
if (key === "@context") continue;
|
|
281
|
+
if (jsonLiteralWrapper && key === "@value") continue;
|
|
282
|
+
if (key === "@graph" || state.graphTerms.has(key)) throw new UnsafeJsonLdError("@graph");
|
|
283
|
+
if (state.jsonTerms.has(key)) continue;
|
|
284
|
+
await assertNoGraphBeforeCompaction(value, documentLoader, state, state.propertyContexts.get(key), remoteContextCache);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
function isJsonLiteralWrapper(value) {
|
|
288
|
+
return "@value" in value && (value["@type"] === "@json" || value.type === "@json");
|
|
289
|
+
}
|
|
290
|
+
/** @internal */
|
|
291
|
+
function assertSafeJsonLd(jsonLd) {
|
|
292
|
+
if (Array.isArray(jsonLd)) for (const item of jsonLd) assertSafeJsonLd(item);
|
|
293
|
+
else if (typeof jsonLd === "object" && jsonLd != null) {
|
|
294
|
+
const jsonLiteralWrapper = isJsonLiteralWrapper(jsonLd);
|
|
295
|
+
for (const [key, value] of globalThis.Object.entries(jsonLd)) {
|
|
296
|
+
if (disallowedJsonLdKeywords.has(key)) throw new UnsafeJsonLdError(key);
|
|
297
|
+
if (jsonLiteralWrapper && key === "@value") continue;
|
|
298
|
+
assertSafeJsonLd(value);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
20
302
|
/**
|
|
21
303
|
* Attaches a LD signature to the given JSON-LD document.
|
|
22
304
|
* @param jsonLd The JSON-LD document to attach the signature to. It is not
|
|
@@ -210,9 +492,21 @@ async function verifySignature(jsonLd, options = {}) {
|
|
|
210
492
|
* @returns `true` if the document is authentic; `false` otherwise.
|
|
211
493
|
*/
|
|
212
494
|
async function verifyJsonLd(jsonLd, options = {}) {
|
|
495
|
+
return await verifyJsonLdInternal(jsonLd, options, true);
|
|
496
|
+
}
|
|
497
|
+
/** @internal */
|
|
498
|
+
async function verifyCompactJsonLd(jsonLd, options = {}) {
|
|
499
|
+
return await verifyJsonLdInternal(jsonLd, options, false);
|
|
500
|
+
}
|
|
501
|
+
async function verifyJsonLdInternal(jsonLd, options, compact) {
|
|
213
502
|
return await (options.tracerProvider ?? _opentelemetry_api.trace.getTracerProvider()).getTracer(require_docloader.name, require_docloader.version).startActiveSpan("ld_signatures.verify", async (span) => {
|
|
214
503
|
try {
|
|
215
|
-
const
|
|
504
|
+
const verificationOptions = hasSignature(jsonLd) ? {
|
|
505
|
+
...options,
|
|
506
|
+
contextLoader: getNormalizationContextLoader(options.contextLoader)
|
|
507
|
+
} : options;
|
|
508
|
+
const compacted = compact ? hasSignature(jsonLd) ? await compactJsonLd(jsonLd, options.contextLoader) : jsonLd : jsonLd;
|
|
509
|
+
const object = await require_actor.Object.fromJsonLd(compacted, verificationOptions);
|
|
216
510
|
if (object.id != null) span.setAttribute("activitypub.object.id", object.id.href);
|
|
217
511
|
span.setAttribute("activitypub.object.type", require_actor.getTypeId(object).href);
|
|
218
512
|
if (typeof jsonLd === "object" && jsonLd != null && "signature" in jsonLd && typeof jsonLd.signature === "object" && jsonLd.signature != null) {
|
|
@@ -222,7 +516,7 @@ async function verifyJsonLd(jsonLd, options = {}) {
|
|
|
222
516
|
}
|
|
223
517
|
const attributions = new Set(object.attributionIds.map((uri) => uri.href));
|
|
224
518
|
if (object instanceof require_actor.Activity) for (const uri of object.actorIds) attributions.add(uri.href);
|
|
225
|
-
const key = await verifySignature(
|
|
519
|
+
const key = await verifySignature(compacted, verificationOptions);
|
|
226
520
|
if (key == null) return false;
|
|
227
521
|
if (key.ownerId == null) {
|
|
228
522
|
logger$1.debug("Key {keyId} has no owner.", { keyId: key.id?.href });
|
|
@@ -604,12 +898,30 @@ async function verifyObject(cls, jsonLd, options = {}) {
|
|
|
604
898
|
return object;
|
|
605
899
|
}
|
|
606
900
|
//#endregion
|
|
901
|
+
Object.defineProperty(exports, "InvalidContextReferenceError", {
|
|
902
|
+
enumerable: true,
|
|
903
|
+
get: function() {
|
|
904
|
+
return InvalidContextReferenceError;
|
|
905
|
+
}
|
|
906
|
+
});
|
|
907
|
+
Object.defineProperty(exports, "assertSafeJsonLd", {
|
|
908
|
+
enumerable: true,
|
|
909
|
+
get: function() {
|
|
910
|
+
return assertSafeJsonLd;
|
|
911
|
+
}
|
|
912
|
+
});
|
|
607
913
|
Object.defineProperty(exports, "attachSignature", {
|
|
608
914
|
enumerable: true,
|
|
609
915
|
get: function() {
|
|
610
916
|
return attachSignature;
|
|
611
917
|
}
|
|
612
918
|
});
|
|
919
|
+
Object.defineProperty(exports, "compactJsonLd", {
|
|
920
|
+
enumerable: true,
|
|
921
|
+
get: function() {
|
|
922
|
+
return compactJsonLd;
|
|
923
|
+
}
|
|
924
|
+
});
|
|
613
925
|
Object.defineProperty(exports, "createProof", {
|
|
614
926
|
enumerable: true,
|
|
615
927
|
get: function() {
|
|
@@ -640,12 +952,30 @@ Object.defineProperty(exports, "getKeyOwner", {
|
|
|
640
952
|
return getKeyOwner;
|
|
641
953
|
}
|
|
642
954
|
});
|
|
955
|
+
Object.defineProperty(exports, "getNormalizationContextLoader", {
|
|
956
|
+
enumerable: true,
|
|
957
|
+
get: function() {
|
|
958
|
+
return getNormalizationContextLoader;
|
|
959
|
+
}
|
|
960
|
+
});
|
|
643
961
|
Object.defineProperty(exports, "hasSignature", {
|
|
644
962
|
enumerable: true,
|
|
645
963
|
get: function() {
|
|
646
964
|
return hasSignature;
|
|
647
965
|
}
|
|
648
966
|
});
|
|
967
|
+
Object.defineProperty(exports, "isClearlyMalformedContextReference", {
|
|
968
|
+
enumerable: true,
|
|
969
|
+
get: function() {
|
|
970
|
+
return isClearlyMalformedContextReference;
|
|
971
|
+
}
|
|
972
|
+
});
|
|
973
|
+
Object.defineProperty(exports, "isInvalidUrlTypeError", {
|
|
974
|
+
enumerable: true,
|
|
975
|
+
get: function() {
|
|
976
|
+
return isInvalidUrlTypeError;
|
|
977
|
+
}
|
|
978
|
+
});
|
|
649
979
|
Object.defineProperty(exports, "signJsonLd", {
|
|
650
980
|
enumerable: true,
|
|
651
981
|
get: function() {
|
|
@@ -658,6 +988,12 @@ Object.defineProperty(exports, "signObject", {
|
|
|
658
988
|
return signObject;
|
|
659
989
|
}
|
|
660
990
|
});
|
|
991
|
+
Object.defineProperty(exports, "verifyCompactJsonLd", {
|
|
992
|
+
enumerable: true,
|
|
993
|
+
get: function() {
|
|
994
|
+
return verifyCompactJsonLd;
|
|
995
|
+
}
|
|
996
|
+
});
|
|
661
997
|
Object.defineProperty(exports, "verifyJsonLd", {
|
|
662
998
|
enumerable: true,
|
|
663
999
|
get: function() {
|
|
@@ -682,3 +1018,9 @@ Object.defineProperty(exports, "verifySignature", {
|
|
|
682
1018
|
return verifySignature;
|
|
683
1019
|
}
|
|
684
1020
|
});
|
|
1021
|
+
Object.defineProperty(exports, "wrapContextLoaderForJsonLd", {
|
|
1022
|
+
enumerable: true,
|
|
1023
|
+
get: function() {
|
|
1024
|
+
return wrapContextLoaderForJsonLd;
|
|
1025
|
+
}
|
|
1026
|
+
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { U as getTypeId, c as DataIntegrityProof, g as Multikey, ot as name, st as version, t as Activity } from "./vocab-
|
|
5
|
-
import { a as validateCryptoKey, n as fetchKey } from "./key-
|
|
4
|
+
import { U as getTypeId, c as DataIntegrityProof, g as Multikey, ot as name, st as version, t as Activity } from "./vocab-DP9A9TjH.mjs";
|
|
5
|
+
import { a as validateCryptoKey, n as fetchKey } from "./key-CSH0Pfat.mjs";
|
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
|
7
7
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
8
8
|
import { encodeHex } from "byte-encodings/hex";
|