diff --git a/CHANGES.md b/CHANGES.md index bc411e117..85babb291 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -341,6 +341,30 @@ To be released. [#489]: https://github.com/fedify-dev/fedify/issues/489 +### @fedify/vocab-runtime + + - Added `PropertyPreprocessor`, `PropertyPreprocessorContext`, and `Json` + types for normalizing wire-level JSON-LD property values before the + generated range decoder runs. [[#792]] + +[#792]: https://github.com/fedify-dev/fedify/issues/792 + +### @fedify/vocab + + - Explicit ActivityStreams `Link` objects in `icon` and `image` properties + are now normalized to `Image` during decoding via the new exported + `normalizeLinkToImage()` preprocessor. The public `Image`-oriented + TypeScript API is unchanged. [[#790], [#792]] + +[#790]: https://github.com/fedify-dev/fedify/issues/790 + +### @fedify/vocab-tools + + - Property schemas now support a `preprocessors` field that lists + module/function pairs. Generated decoders dynamically import and run + these preprocessors for each expanded JSON-LD property value before + falling back to the normal range decoder. [[#792]] + Version 2.2.5 ------------- diff --git a/packages/vocab-runtime/src/mod.ts b/packages/vocab-runtime/src/mod.ts index 1a6bda9e7..9e7967c9e 100644 --- a/packages/vocab-runtime/src/mod.ts +++ b/packages/vocab-runtime/src/mod.ts @@ -44,6 +44,11 @@ export { type GetUserAgentOptions, logRequest, } from "./request.ts"; +export { + type Json, + type PropertyPreprocessor, + type PropertyPreprocessorContext, +} from "./preprocessor.ts"; export { expandIPv6Address, isValidPublicIPv4Address, diff --git a/packages/vocab-runtime/src/preprocessor.ts b/packages/vocab-runtime/src/preprocessor.ts new file mode 100644 index 000000000..1151ee31d --- /dev/null +++ b/packages/vocab-runtime/src/preprocessor.ts @@ -0,0 +1,43 @@ +import type { DocumentLoader } from "./docloader.ts"; +import type { TracerProvider } from "@opentelemetry/api"; + +/** + * JSON value shape passed to property preprocessors. + * @since 2.3.0 + */ +export type Json = + | string + | number + | boolean + | null + | readonly Json[] + | { readonly [key: string]: Json }; + +/** + * Runtime context provided to property preprocessors. + * @since 2.3.0 + */ +export interface PropertyPreprocessorContext { + /** Loader for remote JSON-LD documents. */ + documentLoader?: DocumentLoader; + /** Loader for remote JSON-LD contexts. */ + contextLoader?: DocumentLoader; + /** OpenTelemetry tracer provider for instrumentation. */ + tracerProvider?: TracerProvider; + /** Base URL for resolving relative references. */ + baseUrl?: URL; +} + +/** + * Function signature for schema-configured property preprocessors. + * + * Receives an expanded JSON-LD property value and returns a vocabulary + * object when the value is handled, `undefined` when the value should + * fall through to the normal range decoder, or an `Error` when the value + * is recognized but cannot be converted. + * @since 2.3.0 + */ +export type PropertyPreprocessor = ( + value: Json, + context: PropertyPreprocessorContext, +) => T | undefined | Error | Promise; diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index e258d526d..732917289 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -1,7 +1,7 @@ export const snapshot = {}; snapshot[`generateClasses() 1`] = ` -"// deno-lint-ignore-file ban-unused-ignore no-unused-vars prefer-const verbatim-module-syntax +"// deno-lint-ignore-file ban-unused-ignore no-explicit-any no-unused-vars prefer-const verbatim-module-syntax import jsonld from \\"@fedify/vocab-runtime/jsonld\\"; import { getLogger } from \\"@logtape/logtape\\"; import { type Span, SpanStatusCode, type TracerProvider, trace } @@ -28,6 +28,8 @@ import { } from \\"@fedify/vocab-runtime/temporal\\"; +import * as _ppM0 from \\"./preprocessors.ts\\"; + /** Describes an object of any kind. The Object type serves as the base type for * most of the other kinds of objects defined in the Activity Vocabulary, * including other Core types such as {@link Activity}, @@ -2334,7 +2336,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"attachment\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#attachment_fromJsonLd(obj, options); + v = await this.#attachment_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -2588,7 +2594,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"attributedTo\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#attribution_fromJsonLd(doc, options); + v = await this.#attribution_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -2684,7 +2694,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"attributedTo\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#attribution_fromJsonLd(obj, options); + v = await this.#attribution_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -2901,7 +2915,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"audience\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#audience_fromJsonLd(doc, options); + v = await this.#audience_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -2996,7 +3014,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"audience\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#audience_fromJsonLd(obj, options); + v = await this.#audience_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -3257,7 +3279,11 @@ get contents(): ((string | LanguageString))[] { \\"context\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#context_fromJsonLd(obj, options); + v = await this.#context_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -3525,7 +3551,11 @@ get names(): ((string | LanguageString))[] { \\"generator\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#generator_fromJsonLd(obj, options); + v = await this.#generator_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -3663,6 +3693,25 @@ get names(): ((string | LanguageString))[] { this._tracerProvider ?? trace.getTracerProvider(); const baseUrl = options.baseUrl; + const _expanded = await jsonld.expand(jsonLd, { + documentLoader: contextLoader, + keepFreeFloatingNodes: true, + }); + for (const _pp_obj of _expanded) { + + { + const _result = await _ppM0[\\"normalizeLinkToImage\\"](_pp_obj, { + documentLoader, + contextLoader, + tracerProvider, + baseUrl, + }); + if (_result instanceof Error) throw _result; + if (_result !== undefined) return _result as Image; + } + + } + try { return await Image.fromJsonLd( jsonLd, @@ -3743,7 +3792,11 @@ get names(): ((string | LanguageString))[] { \\"icon\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#icon_fromJsonLd(doc, options); + v = await this.#icon_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -3839,7 +3892,11 @@ get names(): ((string | LanguageString))[] { \\"icon\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#icon_fromJsonLd(obj, options); + v = await this.#icon_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -3977,6 +4034,25 @@ get names(): ((string | LanguageString))[] { this._tracerProvider ?? trace.getTracerProvider(); const baseUrl = options.baseUrl; + const _expanded = await jsonld.expand(jsonLd, { + documentLoader: contextLoader, + keepFreeFloatingNodes: true, + }); + for (const _pp_obj of _expanded) { + + { + const _result = await _ppM0[\\"normalizeLinkToImage\\"](_pp_obj, { + documentLoader, + contextLoader, + tracerProvider, + baseUrl, + }); + if (_result instanceof Error) throw _result; + if (_result !== undefined) return _result as Image; + } + + } + try { return await Image.fromJsonLd( jsonLd, @@ -4057,7 +4133,11 @@ get names(): ((string | LanguageString))[] { \\"image\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#image_fromJsonLd(doc, options); + v = await this.#image_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -4153,7 +4233,11 @@ get names(): ((string | LanguageString))[] { \\"image\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#image_fromJsonLd(obj, options); + v = await this.#image_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -4379,7 +4463,11 @@ get names(): ((string | LanguageString))[] { \\"inReplyTo\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#replyTarget_fromJsonLd(doc, options); + v = await this.#replyTarget_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -4474,7 +4562,11 @@ get names(): ((string | LanguageString))[] { \\"inReplyTo\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#replyTarget_fromJsonLd(obj, options); + v = await this.#replyTarget_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -4700,7 +4792,11 @@ get names(): ((string | LanguageString))[] { \\"location\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#location_fromJsonLd(doc, options); + v = await this.#location_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -4795,7 +4891,11 @@ get names(): ((string | LanguageString))[] { \\"location\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#location_fromJsonLd(obj, options); + v = await this.#location_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -5020,7 +5120,11 @@ get names(): ((string | LanguageString))[] { \\"preview\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#preview_fromJsonLd(doc, options); + v = await this.#preview_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -5114,7 +5218,11 @@ get names(): ((string | LanguageString))[] { \\"preview\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#preview_fromJsonLd(obj, options); + v = await this.#preview_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -5344,7 +5452,11 @@ get names(): ((string | LanguageString))[] { \\"replies\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#replies_fromJsonLd(doc, options); + v = await this.#replies_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -5566,7 +5678,11 @@ get names(): ((string | LanguageString))[] { \\"shares\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#shares_fromJsonLd(doc, options); + v = await this.#shares_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -5788,7 +5904,11 @@ get names(): ((string | LanguageString))[] { \\"likes\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#likes_fromJsonLd(doc, options); + v = await this.#likes_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -6004,7 +6124,11 @@ get names(): ((string | LanguageString))[] { \\"emojiReactions\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#emojiReactions_fromJsonLd(doc, options); + v = await this.#emojiReactions_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -6272,7 +6396,11 @@ get summaries(): ((string | LanguageString))[] { \\"tag\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#tag_fromJsonLd(obj, options); + v = await this.#tag_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -6523,7 +6651,11 @@ get urls(): ((URL | Link))[] { \\"to\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#to_fromJsonLd(doc, options); + v = await this.#to_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -6618,7 +6750,11 @@ get urls(): ((URL | Link))[] { \\"to\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#to_fromJsonLd(obj, options); + v = await this.#to_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -6835,7 +6971,11 @@ get urls(): ((URL | Link))[] { \\"bto\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#bto_fromJsonLd(doc, options); + v = await this.#bto_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -6930,7 +7070,11 @@ get urls(): ((URL | Link))[] { \\"bto\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#bto_fromJsonLd(obj, options); + v = await this.#bto_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -7147,7 +7291,11 @@ get urls(): ((URL | Link))[] { \\"cc\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#cc_fromJsonLd(doc, options); + v = await this.#cc_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -7242,7 +7390,11 @@ get urls(): ((URL | Link))[] { \\"cc\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#cc_fromJsonLd(obj, options); + v = await this.#cc_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -7459,7 +7611,11 @@ get urls(): ((URL | Link))[] { \\"bcc\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#bcc_fromJsonLd(doc, options); + v = await this.#bcc_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -7554,7 +7710,11 @@ get urls(): ((URL | Link))[] { \\"bcc\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#bcc_fromJsonLd(obj, options); + v = await this.#bcc_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -7834,7 +7994,11 @@ get urls(): ((URL | Link))[] { \\"proof\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#proof_fromJsonLd(doc, options); + v = await this.#proof_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -7928,7 +8092,11 @@ get urls(): ((URL | Link))[] { \\"proof\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#proof_fromJsonLd(obj, options); + v = await this.#proof_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -8184,7 +8352,11 @@ get urls(): ((URL | Link))[] { \\"likeAuthorization\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#likeAuthorization_fromJsonLd(doc, options); + v = await this.#likeAuthorization_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -8400,7 +8572,11 @@ get urls(): ((URL | Link))[] { \\"replyAuthorization\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#replyAuthorization_fromJsonLd(doc, options); + v = await this.#replyAuthorization_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -8616,7 +8792,11 @@ get urls(): ((URL | Link))[] { \\"announceAuthorization\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#announceAuthorization_fromJsonLd(doc, options); + v = await this.#announceAuthorization_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -10164,9 +10344,14 @@ get urls(): ((URL | Link))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -10465,16 +10650,16 @@ get urls(): ((URL | Link))[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"http://schema.org#PropertyValue\\") ? await PropertyValue.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -10511,23 +10696,23 @@ get urls(): ((URL | Link))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -10562,7 +10747,7 @@ get urls(): ((URL | Link))[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.push(decoded); @@ -10622,12 +10807,12 @@ get urls(): ((URL | Link))[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -10711,12 +10896,12 @@ get urls(): ((URL | Link))[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -10739,6 +10924,28 @@ get urls(): ((URL | Link))[] { ) { if (v == null) continue; + { + let _handled: Image | undefined; + + if (_handled === undefined) { + const _result = await _ppM0[\\"normalizeLinkToImage\\"](v, { + documentLoader: options.documentLoader, + contextLoader: options.contextLoader, + tracerProvider: options.tracerProvider, + baseUrl: _baseUrl, + }); + if (_result instanceof Error) throw _result; + if (_result !== undefined) { + _handled = _result as Image; + } + } + + if (_handled !== undefined) { + _33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.push(_handled); + continue; + } + } + if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { _33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.push( @@ -10751,7 +10958,7 @@ get urls(): ((URL | Link))[] { const decoded = await Image.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.push(decoded); @@ -10772,6 +10979,28 @@ get urls(): ((URL | Link))[] { ) { if (v == null) continue; + { + let _handled: Image | undefined; + + if (_handled === undefined) { + const _result = await _ppM0[\\"normalizeLinkToImage\\"](v, { + documentLoader: options.documentLoader, + contextLoader: options.contextLoader, + tracerProvider: options.tracerProvider, + baseUrl: _baseUrl, + }); + if (_result instanceof Error) throw _result; + if (_result !== undefined) { + _handled = _result as Image; + } + } + + if (_handled !== undefined) { + _3dXrUdkARxwyJLtJcYi1AJ92H41U_image.push(_handled); + continue; + } + } + if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { _3dXrUdkARxwyJLtJcYi1AJ92H41U_image.push( @@ -10784,7 +11013,7 @@ get urls(): ((URL | Link))[] { const decoded = await Image.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3dXrUdkARxwyJLtJcYi1AJ92H41U_image.push(decoded); @@ -10820,12 +11049,12 @@ get urls(): ((URL | Link))[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -10863,12 +11092,12 @@ get urls(): ((URL | Link))[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -10906,12 +11135,12 @@ get urls(): ((URL | Link))[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -10968,7 +11197,7 @@ get urls(): ((URL | Link))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _7UpwM3JWcXhADcscukEehBorf6k_replies.push(decoded); @@ -11001,7 +11230,7 @@ get urls(): ((URL | Link))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3kAfck9PcEYt2L7xug5y99YPbANs_shares.push(decoded); @@ -11034,7 +11263,7 @@ get urls(): ((URL | Link))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.push(decoded); @@ -11067,7 +11296,7 @@ get urls(): ((URL | Link))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.push(decoded); @@ -11149,12 +11378,12 @@ get urls(): ((URL | Link))[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -11213,13 +11442,13 @@ get urls(): ((URL | Link))[] { : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))) : typeof v === \\"object\\" && \\"@type\\" in v + : new URL(v[\\"@id\\"], _baseUrl) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -11254,7 +11483,7 @@ get urls(): ((URL | Link))[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.push(decoded); @@ -11287,7 +11516,7 @@ get urls(): ((URL | Link))[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.push(decoded); @@ -11320,7 +11549,7 @@ get urls(): ((URL | Link))[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.push(decoded); @@ -11353,7 +11582,7 @@ get urls(): ((URL | Link))[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.push(decoded); @@ -11428,7 +11657,7 @@ get urls(): ((URL | Link))[] { const decoded = await Source.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2ZwCFoS787v8y8bXKjMoE6MAbrEB_source.push(decoded); @@ -11461,7 +11690,7 @@ get urls(): ((URL | Link))[] { const decoded = await DataIntegrityProof.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.push(decoded); @@ -11482,7 +11711,7 @@ get urls(): ((URL | Link))[] { const decoded = await InteractionPolicy.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy.push(decoded); @@ -11514,9 +11743,9 @@ get urls(): ((URL | Link))[] { : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))); + : new URL(v[\\"@id\\"], _baseUrl); if (typeof decoded === \\"undefined\\") continue; _23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy.push(decoded); } @@ -11548,7 +11777,7 @@ get urls(): ((URL | Link))[] { const decoded = await LikeAuthorization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.push(decoded); @@ -11581,7 +11810,7 @@ get urls(): ((URL | Link))[] { const decoded = await ReplyAuthorization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.push(decoded); @@ -11614,7 +11843,7 @@ get urls(): ((URL | Link))[] { const decoded = await AnnounceAuthorization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.push(decoded); @@ -12792,9 +13021,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -13229,7 +13463,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"quote\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#quote_fromJsonLd(doc, options); + v = await this.#quote_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -13468,7 +13706,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"quoteAuthorization\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#quoteAuthorization_fromJsonLd(doc, options); + v = await this.#quoteAuthorization_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -13790,9 +14032,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -13841,7 +14088,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push(decoded); @@ -13900,7 +14147,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await QuoteAuthorization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push(decoded); @@ -14846,7 +15093,11 @@ instruments?: (Object | URL)[];} \\"actor\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#actor_fromJsonLd(doc, options); + v = await this.#actor_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -14942,7 +15193,11 @@ instruments?: (Object | URL)[];} \\"actor\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#actor_fromJsonLd(obj, options); + v = await this.#actor_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -15160,7 +15415,11 @@ instruments?: (Object | URL)[];} \\"object\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#object_fromJsonLd(doc, options); + v = await this.#object_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -15256,7 +15515,11 @@ instruments?: (Object | URL)[];} \\"object\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#object_fromJsonLd(obj, options); + v = await this.#object_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -15477,7 +15740,11 @@ instruments?: (Object | URL)[];} \\"target\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#target_fromJsonLd(doc, options); + v = await this.#target_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -15576,7 +15843,11 @@ instruments?: (Object | URL)[];} \\"target\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#target_fromJsonLd(obj, options); + v = await this.#target_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -15794,7 +16065,11 @@ instruments?: (Object | URL)[];} \\"result\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#result_fromJsonLd(doc, options); + v = await this.#result_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -15890,7 +16165,11 @@ instruments?: (Object | URL)[];} \\"result\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#result_fromJsonLd(obj, options); + v = await this.#result_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -16109,7 +16388,11 @@ instruments?: (Object | URL)[];} \\"origin\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#origin_fromJsonLd(doc, options); + v = await this.#origin_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -16206,7 +16489,11 @@ instruments?: (Object | URL)[];} \\"origin\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#origin_fromJsonLd(obj, options); + v = await this.#origin_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -16423,7 +16710,11 @@ instruments?: (Object | URL)[];} \\"instrument\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#instrument_fromJsonLd(doc, options); + v = await this.#instrument_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -16518,7 +16809,11 @@ instruments?: (Object | URL)[];} \\"instrument\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#instrument_fromJsonLd(obj, options); + v = await this.#instrument_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -16799,9 +17094,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -16988,23 +17288,23 @@ instruments?: (Object | URL)[];} typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -17039,7 +17339,7 @@ instruments?: (Object | URL)[];} const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.push(decoded); @@ -17072,7 +17372,7 @@ instruments?: (Object | URL)[];} const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.push(decoded); @@ -17105,7 +17405,7 @@ instruments?: (Object | URL)[];} const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.push(decoded); @@ -17138,7 +17438,7 @@ instruments?: (Object | URL)[];} const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _25zu2s3VxVujgEKqrDycjE284XQR_origin.push(decoded); @@ -17171,7 +17471,7 @@ instruments?: (Object | URL)[];} const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.push(decoded); @@ -17642,9 +17942,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -18145,9 +18450,14 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -18731,9 +19041,14 @@ unit?: string | null;numericalValue?: Decimal | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -19230,7 +19545,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"interactingObject\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#interactingObject_fromJsonLd(doc, options); + v = await this.#interactingObject_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -19445,7 +19764,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"interactionTarget\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#interactionTarget_fromJsonLd(doc, options); + v = await this.#interactionTarget_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -19722,9 +20045,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -19773,7 +20101,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push(decoded); @@ -19806,7 +20134,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push(decoded); @@ -20171,9 +20499,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -20762,9 +21095,14 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -20796,7 +21134,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike.push(decoded); @@ -20817,7 +21155,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply.push(decoded); @@ -20838,7 +21176,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce.push(decoded); @@ -20859,7 +21197,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote.push(decoded); @@ -21510,9 +21848,14 @@ get manualApprovals(): (URL)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -21555,9 +21898,9 @@ get manualApprovals(): (URL)[] { : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))); + : new URL(v[\\"@id\\"], _baseUrl); if (typeof decoded === \\"undefined\\") continue; _2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.push(decoded); } @@ -21588,9 +21931,9 @@ get manualApprovals(): (URL)[] { : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))); + : new URL(v[\\"@id\\"], _baseUrl); if (typeof decoded === \\"undefined\\") continue; _sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval.push(decoded); } @@ -22050,7 +22393,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"interactingObject\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#interactingObject_fromJsonLd(doc, options); + v = await this.#interactingObject_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -22265,7 +22612,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"interactionTarget\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#interactionTarget_fromJsonLd(doc, options); + v = await this.#interactionTarget_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -22542,9 +22893,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -22593,7 +22949,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push(decoded); @@ -22626,7 +22982,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push(decoded); @@ -22990,9 +23346,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -23402,7 +23763,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"interactingObject\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#interactingObject_fromJsonLd(doc, options); + v = await this.#interactingObject_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -23617,7 +23982,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"interactionTarget\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#interactionTarget_fromJsonLd(doc, options); + v = await this.#interactionTarget_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -23894,9 +24263,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -23945,7 +24319,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push(decoded); @@ -23978,7 +24352,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push(decoded); @@ -24342,9 +24716,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -24753,7 +25132,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"interactingObject\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#interactingObject_fromJsonLd(doc, options); + v = await this.#interactingObject_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -24968,7 +25351,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"interactionTarget\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#interactionTarget_fromJsonLd(doc, options); + v = await this.#interactionTarget_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -25245,9 +25632,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -25296,7 +25688,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push(decoded); @@ -25329,7 +25721,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push(decoded); @@ -25693,9 +26085,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -26138,9 +26535,14 @@ get endpoints(): (URL)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -26187,9 +26589,9 @@ get endpoints(): (URL)[] { : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))); + : new URL(v[\\"@id\\"], _baseUrl); if (typeof decoded === \\"undefined\\") continue; _2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.push(decoded); } @@ -26491,9 +26893,14 @@ endpoints?: (URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -27309,9 +27716,14 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -27373,7 +27785,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.push(decoded); @@ -27999,7 +28411,11 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi \\"owner\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#owner_fromJsonLd(doc, options); + v = await this.#owner_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -28274,9 +28690,14 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -28322,23 +28743,23 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -28870,7 +29291,11 @@ controller?: Application | Group | Organization | Person | Service | URL | null; \\"controller\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#controller_fromJsonLd(doc, options); + v = await this.#controller_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -29152,9 +29577,14 @@ controller?: Application | Group | Organization | Person | Service | URL | null; // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -29200,23 +29630,23 @@ controller?: Application | Group | Organization | Person | Service | URL | null; typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -29987,9 +30417,14 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -30050,9 +30485,9 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))); + : new URL(v[\\"@id\\"], _baseUrl); if (typeof decoded === \\"undefined\\") continue; _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.push(decoded); } @@ -30072,7 +30507,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur const decoded = await Measure.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.push(decoded); @@ -30093,7 +30528,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur const decoded = await Measure.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.push(decoded); @@ -30114,7 +30549,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur const decoded = await Measure.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.push(decoded); @@ -30859,9 +31294,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -30916,7 +31356,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Intent.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.push(decoded); @@ -30937,7 +31377,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Intent.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.push(decoded); @@ -31352,9 +31792,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -31692,9 +32137,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -32027,9 +32477,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -33303,7 +33758,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"publicKey\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#publicKey_fromJsonLd(doc, options); + v = await this.#publicKey_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -33396,7 +33855,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"publicKey\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#publicKey_fromJsonLd(obj, options); + v = await this.#publicKey_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -33615,7 +34078,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"assertionMethod\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#assertionMethod_fromJsonLd(doc, options); + v = await this.#assertionMethod_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -33712,7 +34179,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"assertionMethod\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#assertionMethod_fromJsonLd(obj, options); + v = await this.#assertionMethod_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -33968,7 +34439,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"inbox\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#inbox_fromJsonLd(doc, options); + v = await this.#inbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -34201,7 +34676,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"outbox\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#outbox_fromJsonLd(doc, options); + v = await this.#outbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -34420,7 +34899,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"following\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#following_fromJsonLd(doc, options); + v = await this.#following_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -34642,7 +35125,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"followers\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#followers_fromJsonLd(doc, options); + v = await this.#followers_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -34862,7 +35349,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"liked\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#liked_fromJsonLd(doc, options); + v = await this.#liked_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -35080,7 +35571,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"featured\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#featured_fromJsonLd(doc, options); + v = await this.#featured_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -35298,7 +35793,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"featuredTags\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#featuredTags_fromJsonLd(doc, options); + v = await this.#featuredTags_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -35514,7 +36013,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"streams\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#stream_fromJsonLd(obj, options); + v = await this.#stream_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -35840,7 +36343,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"movedTo\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#successor_fromJsonLd(doc, options); + v = await this.#successor_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -36094,7 +36601,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"alsoKnownAs\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#alias_fromJsonLd(doc, options); + v = await this.#alias_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -36191,7 +36702,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"alsoKnownAs\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#alias_fromJsonLd(obj, options); + v = await this.#alias_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -36410,7 +36925,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"service\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#service_fromJsonLd(doc, options); + v = await this.#service_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -36507,7 +37026,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"service\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#service_fromJsonLd(obj, options); + v = await this.#service_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -37540,9 +38063,14 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -37615,7 +38143,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(decoded); @@ -37648,7 +38176,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); @@ -37701,11 +38229,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -37742,11 +38270,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -37781,7 +38309,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(decoded); @@ -37814,7 +38342,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(decoded); @@ -37847,7 +38375,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(decoded); @@ -37880,7 +38408,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(decoded); @@ -37913,7 +38441,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(decoded); @@ -37946,7 +38474,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(decoded); @@ -37967,7 +38495,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.push(decoded); @@ -38074,23 +38602,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -38127,23 +38655,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -38178,7 +38706,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(decoded); @@ -39003,9 +39531,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -39350,9 +39883,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -39782,7 +40320,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"quote\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#quote_fromJsonLd(doc, options); + v = await this.#quote_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -40021,7 +40563,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"quoteAuthorization\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#quoteAuthorization_fromJsonLd(doc, options); + v = await this.#quoteAuthorization_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -40343,9 +40889,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -40394,7 +40945,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push(decoded); @@ -40453,7 +41004,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await QuoteAuthorization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push(decoded); @@ -40984,9 +41535,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -41413,9 +41969,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -41747,9 +42308,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -42087,9 +42653,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -42842,7 +43413,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"current\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#current_fromJsonLd(doc, options); + v = await this.#current_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -43058,7 +43633,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"first\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#first_fromJsonLd(doc, options); + v = await this.#first_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -43274,7 +43853,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"last\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#last_fromJsonLd(doc, options); + v = await this.#last_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -43500,7 +44083,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"items\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#item_fromJsonLd(obj, options); + v = await this.#item_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -43716,7 +44303,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"likesOf\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#likesOf_fromJsonLd(doc, options); + v = await this.#likesOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -43931,7 +44522,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"sharesOf\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#sharesOf_fromJsonLd(doc, options); + v = await this.#sharesOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -44146,7 +44741,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"repliesOf\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#repliesOf_fromJsonLd(doc, options); + v = await this.#repliesOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -44361,7 +44960,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"inboxOf\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#inboxOf_fromJsonLd(doc, options); + v = await this.#inboxOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -44576,7 +45179,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"outboxOf\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#outboxOf_fromJsonLd(doc, options); + v = await this.#outboxOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -44791,7 +45398,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"followersOf\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#followersOf_fromJsonLd(doc, options); + v = await this.#followersOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -45006,7 +45617,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"followingOf\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#followingOf_fromJsonLd(doc, options); + v = await this.#followingOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -45221,7 +45836,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"likedOf\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#likedOf_fromJsonLd(doc, options); + v = await this.#likedOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -45886,9 +46505,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -45967,7 +46591,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3UyUdxnyn6cDn53QKrh4MBiearma_current.push(decoded); @@ -46000,7 +46624,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _J52RqweMe6hhv7RnLJMC8BExTE5_first.push(decoded); @@ -46033,7 +46657,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.push(decoded); @@ -46069,12 +46693,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -46109,7 +46733,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.push(decoded); @@ -46142,7 +46766,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.push(decoded); @@ -46175,7 +46799,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.push(decoded); @@ -46208,7 +46832,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.push(decoded); @@ -46241,7 +46865,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.push(decoded); @@ -46274,7 +46898,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.push(decoded); @@ -46307,7 +46931,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.push(decoded); @@ -46340,7 +46964,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.push(decoded); @@ -47020,7 +47644,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"partOf\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#partOf_fromJsonLd(doc, options); + v = await this.#partOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -47234,7 +47862,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"next\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#next_fromJsonLd(doc, options); + v = await this.#next_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -47449,7 +48081,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"prev\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#prev_fromJsonLd(doc, options); + v = await this.#prev_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -47761,9 +48397,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -47816,7 +48457,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.push(decoded); @@ -47849,7 +48490,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.push(decoded); @@ -47882,7 +48523,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.push(decoded); @@ -48256,9 +48897,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -48590,9 +49236,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -48922,9 +49573,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -49716,9 +50372,14 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -49761,9 +50422,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))); + : new URL(v[\\"@id\\"], _baseUrl); if (typeof decoded === \\"undefined\\") continue; _2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.push(decoded); } @@ -49794,9 +50455,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))); + : new URL(v[\\"@id\\"], _baseUrl); if (typeof decoded === \\"undefined\\") continue; _25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.push(decoded); } @@ -49827,9 +50488,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))); + : new URL(v[\\"@id\\"], _baseUrl); if (typeof decoded === \\"undefined\\") continue; _iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.push(decoded); } @@ -49860,9 +50521,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))); + : new URL(v[\\"@id\\"], _baseUrl); if (typeof decoded === \\"undefined\\") continue; _8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.push(decoded); } @@ -49893,9 +50554,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))); + : new URL(v[\\"@id\\"], _baseUrl); if (typeof decoded === \\"undefined\\") continue; _3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.push(decoded); } @@ -49926,9 +50587,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))); + : new URL(v[\\"@id\\"], _baseUrl); if (typeof decoded === \\"undefined\\") continue; _3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.push(decoded); } @@ -50381,9 +51042,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -50716,9 +51382,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -51052,9 +51723,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -52328,7 +53004,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"publicKey\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#publicKey_fromJsonLd(doc, options); + v = await this.#publicKey_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -52421,7 +53101,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"publicKey\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#publicKey_fromJsonLd(obj, options); + v = await this.#publicKey_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -52640,7 +53324,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"assertionMethod\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#assertionMethod_fromJsonLd(doc, options); + v = await this.#assertionMethod_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -52737,7 +53425,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"assertionMethod\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#assertionMethod_fromJsonLd(obj, options); + v = await this.#assertionMethod_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -52993,7 +53685,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"inbox\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#inbox_fromJsonLd(doc, options); + v = await this.#inbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -53226,7 +53922,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"outbox\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#outbox_fromJsonLd(doc, options); + v = await this.#outbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -53445,7 +54145,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"following\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#following_fromJsonLd(doc, options); + v = await this.#following_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -53667,7 +54371,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"followers\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#followers_fromJsonLd(doc, options); + v = await this.#followers_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -53887,7 +54595,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"liked\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#liked_fromJsonLd(doc, options); + v = await this.#liked_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -54105,7 +54817,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"featured\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#featured_fromJsonLd(doc, options); + v = await this.#featured_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -54323,7 +55039,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"featuredTags\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#featuredTags_fromJsonLd(doc, options); + v = await this.#featuredTags_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -54539,7 +55259,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"streams\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#stream_fromJsonLd(obj, options); + v = await this.#stream_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -54865,7 +55589,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"movedTo\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#successor_fromJsonLd(doc, options); + v = await this.#successor_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -55119,7 +55847,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"alsoKnownAs\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#alias_fromJsonLd(doc, options); + v = await this.#alias_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -55216,7 +55948,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"alsoKnownAs\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#alias_fromJsonLd(obj, options); + v = await this.#alias_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -55435,7 +56171,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"service\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#service_fromJsonLd(doc, options); + v = await this.#service_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -55532,7 +56272,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"service\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#service_fromJsonLd(obj, options); + v = await this.#service_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -56565,9 +57309,14 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -56640,7 +57389,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(decoded); @@ -56673,7 +57422,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); @@ -56726,11 +57475,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -56767,11 +57516,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -56806,7 +57555,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(decoded); @@ -56839,7 +57588,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(decoded); @@ -56872,7 +57621,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(decoded); @@ -56905,7 +57654,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(decoded); @@ -56938,7 +57687,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(decoded); @@ -56971,7 +57720,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(decoded); @@ -56992,7 +57741,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.push(decoded); @@ -57099,23 +57848,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -57152,23 +57901,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -57203,7 +57952,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(decoded); @@ -58540,7 +59289,11 @@ get names(): ((string | LanguageString))[] { \\"preview\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#preview_fromJsonLd(obj, options); + v = await this.#preview_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -58994,9 +59747,14 @@ get names(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -59047,9 +59805,9 @@ get names(): ((string | LanguageString))[] { : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))); + : new URL(v[\\"@id\\"], _baseUrl); if (typeof decoded === \\"undefined\\") continue; _pVjLsybKQdmkjuU7MHjiVmNnuj7_href.push(decoded); } @@ -59198,12 +59956,12 @@ get names(): ((string | LanguageString))[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -59677,9 +60435,14 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -60014,9 +60777,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -60349,9 +61117,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -60687,9 +61460,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -61021,9 +61799,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -61355,9 +62138,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -61689,9 +62477,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -62021,9 +62814,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -62319,9 +63117,14 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -62654,9 +63457,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -63088,7 +63896,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"quote\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#quote_fromJsonLd(doc, options); + v = await this.#quote_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -63327,7 +64139,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"quoteAuthorization\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#quoteAuthorization_fromJsonLd(doc, options); + v = await this.#quoteAuthorization_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -63649,9 +64465,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -63700,7 +64521,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push(decoded); @@ -63759,7 +64580,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await QuoteAuthorization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push(decoded); @@ -64201,7 +65022,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"orderedItems\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#item_fromJsonLd(obj, options); + v = await this.#item_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -64445,9 +65270,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -64499,12 +65329,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -64938,7 +65768,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"orderedItems\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#item_fromJsonLd(obj, options); + v = await this.#item_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -65231,9 +66065,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -65285,12 +66124,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -66610,7 +67449,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"publicKey\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#publicKey_fromJsonLd(doc, options); + v = await this.#publicKey_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -66703,7 +67546,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"publicKey\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#publicKey_fromJsonLd(obj, options); + v = await this.#publicKey_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -66922,7 +67769,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"assertionMethod\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#assertionMethod_fromJsonLd(doc, options); + v = await this.#assertionMethod_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -67019,7 +67870,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"assertionMethod\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#assertionMethod_fromJsonLd(obj, options); + v = await this.#assertionMethod_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -67275,7 +68130,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"inbox\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#inbox_fromJsonLd(doc, options); + v = await this.#inbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -67508,7 +68367,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"outbox\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#outbox_fromJsonLd(doc, options); + v = await this.#outbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -67727,7 +68590,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"following\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#following_fromJsonLd(doc, options); + v = await this.#following_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -67949,7 +68816,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"followers\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#followers_fromJsonLd(doc, options); + v = await this.#followers_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -68169,7 +69040,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"liked\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#liked_fromJsonLd(doc, options); + v = await this.#liked_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -68387,7 +69262,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"featured\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#featured_fromJsonLd(doc, options); + v = await this.#featured_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -68605,7 +69484,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"featuredTags\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#featuredTags_fromJsonLd(doc, options); + v = await this.#featuredTags_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -68821,7 +69704,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"streams\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#stream_fromJsonLd(obj, options); + v = await this.#stream_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -69147,7 +70034,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"movedTo\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#successor_fromJsonLd(doc, options); + v = await this.#successor_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -69401,7 +70292,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"alsoKnownAs\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#alias_fromJsonLd(doc, options); + v = await this.#alias_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -69498,7 +70393,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"alsoKnownAs\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#alias_fromJsonLd(obj, options); + v = await this.#alias_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -69717,7 +70616,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"service\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#service_fromJsonLd(doc, options); + v = await this.#service_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -69814,7 +70717,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"service\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#service_fromJsonLd(obj, options); + v = await this.#service_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -70847,9 +71754,14 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -70922,7 +71834,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(decoded); @@ -70955,7 +71867,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); @@ -71008,11 +71920,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -71049,11 +71961,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -71088,7 +72000,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(decoded); @@ -71121,7 +72033,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(decoded); @@ -71154,7 +72066,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(decoded); @@ -71187,7 +72099,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(decoded); @@ -71220,7 +72132,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(decoded); @@ -71253,7 +72165,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(decoded); @@ -71274,7 +72186,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.push(decoded); @@ -71381,23 +72293,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -71434,23 +72346,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -71485,7 +72397,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(decoded); @@ -72312,9 +73224,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -73588,7 +74505,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"publicKey\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#publicKey_fromJsonLd(doc, options); + v = await this.#publicKey_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -73681,7 +74602,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"publicKey\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#publicKey_fromJsonLd(obj, options); + v = await this.#publicKey_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -73900,7 +74825,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"assertionMethod\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#assertionMethod_fromJsonLd(doc, options); + v = await this.#assertionMethod_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -73997,7 +74926,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"assertionMethod\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#assertionMethod_fromJsonLd(obj, options); + v = await this.#assertionMethod_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -74253,7 +75186,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"inbox\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#inbox_fromJsonLd(doc, options); + v = await this.#inbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -74486,7 +75423,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"outbox\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#outbox_fromJsonLd(doc, options); + v = await this.#outbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -74705,7 +75646,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"following\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#following_fromJsonLd(doc, options); + v = await this.#following_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -74927,7 +75872,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"followers\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#followers_fromJsonLd(doc, options); + v = await this.#followers_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -75147,7 +76096,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"liked\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#liked_fromJsonLd(doc, options); + v = await this.#liked_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -75365,7 +76318,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"featured\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#featured_fromJsonLd(doc, options); + v = await this.#featured_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -75583,7 +76540,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"featuredTags\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#featuredTags_fromJsonLd(doc, options); + v = await this.#featuredTags_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -75799,7 +76760,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"streams\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#stream_fromJsonLd(obj, options); + v = await this.#stream_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -76125,7 +77090,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"movedTo\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#successor_fromJsonLd(doc, options); + v = await this.#successor_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -76379,7 +77348,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"alsoKnownAs\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#alias_fromJsonLd(doc, options); + v = await this.#alias_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -76476,7 +77449,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"alsoKnownAs\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#alias_fromJsonLd(obj, options); + v = await this.#alias_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -76695,7 +77672,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"service\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#service_fromJsonLd(doc, options); + v = await this.#service_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -76792,7 +77773,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"service\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#service_fromJsonLd(obj, options); + v = await this.#service_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -77825,9 +78810,14 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -77900,7 +78890,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(decoded); @@ -77933,7 +78923,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); @@ -77986,11 +78976,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -78027,11 +79017,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -78066,7 +79056,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(decoded); @@ -78099,7 +79089,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(decoded); @@ -78132,7 +79122,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(decoded); @@ -78165,7 +79155,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(decoded); @@ -78198,7 +79188,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(decoded); @@ -78231,7 +79221,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(decoded); @@ -78252,7 +79242,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.push(decoded); @@ -78359,23 +79349,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -78412,23 +79402,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -78463,7 +79453,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(decoded); @@ -79746,9 +80736,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -79890,9 +80885,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))) : undefined + : new URL(v[\\"@id\\"], _baseUrl) : undefined ; if (typeof decoded === \\"undefined\\") continue; _oKrwxU4V8wiKhMW1QEYQibcJh8c_units.push(decoded); @@ -80375,7 +81370,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"describes\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#describes_fromJsonLd(doc, options); + v = await this.#describes_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -80617,9 +81616,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -80668,7 +81672,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.push(decoded); @@ -81261,7 +82265,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti \\"oneOf\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#exclusiveOption_fromJsonLd(obj, options); + v = await this.#exclusiveOption_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -81480,7 +82488,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti \\"anyOf\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#inclusiveOption_fromJsonLd(obj, options); + v = await this.#inclusiveOption_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -81728,7 +82740,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti \\"quote\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#quote_fromJsonLd(doc, options); + v = await this.#quote_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -81967,7 +82983,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti \\"quoteAuthorization\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#quoteAuthorization_fromJsonLd(doc, options); + v = await this.#quoteAuthorization_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -82272,9 +83292,14 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -82323,7 +83348,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.push(decoded); @@ -82356,7 +83381,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.push(decoded); @@ -82438,7 +83463,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push(decoded); @@ -82497,7 +83522,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const decoded = await QuoteAuthorization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push(decoded); @@ -82956,9 +83981,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -83290,9 +84320,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -83850,7 +84885,11 @@ relationships?: (Object | URL)[];} \\"subject\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#subject_fromJsonLd(doc, options); + v = await this.#subject_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -84065,7 +85104,11 @@ relationships?: (Object | URL)[];} \\"object\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#object_fromJsonLd(doc, options); + v = await this.#object_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -84159,7 +85202,11 @@ relationships?: (Object | URL)[];} \\"object\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#object_fromJsonLd(obj, options); + v = await this.#object_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -84377,7 +85424,11 @@ relationships?: (Object | URL)[];} \\"relationship\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#relationship_fromJsonLd(doc, options); + v = await this.#relationship_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -84473,7 +85524,11 @@ relationships?: (Object | URL)[];} \\"relationship\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#relationship_fromJsonLd(obj, options); + v = await this.#relationship_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -84786,9 +85841,14 @@ relationships?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -84837,7 +85897,7 @@ relationships?: (Object | URL)[];} const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.push(decoded); @@ -84870,7 +85930,7 @@ relationships?: (Object | URL)[];} const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.push(decoded); @@ -84903,7 +85963,7 @@ relationships?: (Object | URL)[];} const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.push(decoded); @@ -85291,9 +86351,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -86567,7 +87632,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"publicKey\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#publicKey_fromJsonLd(doc, options); + v = await this.#publicKey_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -86660,7 +87729,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"publicKey\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#publicKey_fromJsonLd(obj, options); + v = await this.#publicKey_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -86879,7 +87952,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"assertionMethod\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#assertionMethod_fromJsonLd(doc, options); + v = await this.#assertionMethod_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -86976,7 +88053,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"assertionMethod\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#assertionMethod_fromJsonLd(obj, options); + v = await this.#assertionMethod_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -87232,7 +88313,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"inbox\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#inbox_fromJsonLd(doc, options); + v = await this.#inbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -87465,7 +88550,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"outbox\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#outbox_fromJsonLd(doc, options); + v = await this.#outbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -87684,7 +88773,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"following\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#following_fromJsonLd(doc, options); + v = await this.#following_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -87906,7 +88999,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"followers\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#followers_fromJsonLd(doc, options); + v = await this.#followers_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -88126,7 +89223,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"liked\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#liked_fromJsonLd(doc, options); + v = await this.#liked_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -88344,7 +89445,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"featured\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#featured_fromJsonLd(doc, options); + v = await this.#featured_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -88562,7 +89667,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"featuredTags\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#featuredTags_fromJsonLd(doc, options); + v = await this.#featuredTags_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -88778,7 +89887,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"streams\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#stream_fromJsonLd(obj, options); + v = await this.#stream_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -89104,7 +90217,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"movedTo\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#successor_fromJsonLd(doc, options); + v = await this.#successor_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -89358,7 +90475,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"alsoKnownAs\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#alias_fromJsonLd(doc, options); + v = await this.#alias_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -89455,7 +90576,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"alsoKnownAs\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#alias_fromJsonLd(obj, options); + v = await this.#alias_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -89674,7 +90799,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"service\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#service_fromJsonLd(doc, options); + v = await this.#service_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -89771,7 +90900,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"service\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#service_fromJsonLd(obj, options); + v = await this.#service_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -90804,9 +91937,14 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -90879,7 +92017,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(decoded); @@ -90912,7 +92050,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); @@ -90965,11 +92103,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -91006,11 +92144,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -91045,7 +92183,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(decoded); @@ -91078,7 +92216,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(decoded); @@ -91111,7 +92249,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(decoded); @@ -91144,7 +92282,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(decoded); @@ -91177,7 +92315,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(decoded); @@ -91210,7 +92348,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(decoded); @@ -91231,7 +92369,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.push(decoded); @@ -91338,23 +92476,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -91391,23 +92529,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -91442,7 +92580,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(decoded); @@ -92478,9 +93616,14 @@ get contents(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -92910,9 +94053,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -93244,9 +94392,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -93794,9 +94947,14 @@ get formerTypes(): (\$EntityType)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -94229,9 +95387,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -94568,9 +95731,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -94905,9 +96073,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -95242,9 +96415,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -95575,9 +96753,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 0dc4db976..c83f6716a 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -1,5 +1,5 @@ exports[`generateClasses() 1`] = ` -"// deno-lint-ignore-file ban-unused-ignore no-unused-vars prefer-const verbatim-module-syntax +"// deno-lint-ignore-file ban-unused-ignore no-explicit-any no-unused-vars prefer-const verbatim-module-syntax import jsonld from \\"@fedify/vocab-runtime/jsonld\\"; import { getLogger } from \\"@logtape/logtape\\"; import { type Span, SpanStatusCode, type TracerProvider, trace } @@ -26,6 +26,8 @@ import { } from \\"@fedify/vocab-runtime/temporal\\"; +import * as _ppM0 from \\"./preprocessors.ts\\"; + /** Describes an object of any kind. The Object type serves as the base type for * most of the other kinds of objects defined in the Activity Vocabulary, * including other Core types such as {@link Activity}, @@ -2332,7 +2334,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"attachment\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#attachment_fromJsonLd(obj, options); + v = await this.#attachment_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -2586,7 +2592,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"attributedTo\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#attribution_fromJsonLd(doc, options); + v = await this.#attribution_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -2682,7 +2692,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"attributedTo\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#attribution_fromJsonLd(obj, options); + v = await this.#attribution_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -2899,7 +2913,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"audience\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#audience_fromJsonLd(doc, options); + v = await this.#audience_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -2994,7 +3012,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"audience\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#audience_fromJsonLd(obj, options); + v = await this.#audience_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -3255,7 +3277,11 @@ get contents(): ((string | LanguageString))[] { \\"context\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#context_fromJsonLd(obj, options); + v = await this.#context_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -3523,7 +3549,11 @@ get names(): ((string | LanguageString))[] { \\"generator\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#generator_fromJsonLd(obj, options); + v = await this.#generator_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -3661,6 +3691,25 @@ get names(): ((string | LanguageString))[] { this._tracerProvider ?? trace.getTracerProvider(); const baseUrl = options.baseUrl; + const _expanded = await jsonld.expand(jsonLd, { + documentLoader: contextLoader, + keepFreeFloatingNodes: true, + }); + for (const _pp_obj of _expanded) { + + { + const _result = await _ppM0[\\"normalizeLinkToImage\\"](_pp_obj, { + documentLoader, + contextLoader, + tracerProvider, + baseUrl, + }); + if (_result instanceof Error) throw _result; + if (_result !== undefined) return _result as Image; + } + + } + try { return await Image.fromJsonLd( jsonLd, @@ -3741,7 +3790,11 @@ get names(): ((string | LanguageString))[] { \\"icon\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#icon_fromJsonLd(doc, options); + v = await this.#icon_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -3837,7 +3890,11 @@ get names(): ((string | LanguageString))[] { \\"icon\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#icon_fromJsonLd(obj, options); + v = await this.#icon_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -3975,6 +4032,25 @@ get names(): ((string | LanguageString))[] { this._tracerProvider ?? trace.getTracerProvider(); const baseUrl = options.baseUrl; + const _expanded = await jsonld.expand(jsonLd, { + documentLoader: contextLoader, + keepFreeFloatingNodes: true, + }); + for (const _pp_obj of _expanded) { + + { + const _result = await _ppM0[\\"normalizeLinkToImage\\"](_pp_obj, { + documentLoader, + contextLoader, + tracerProvider, + baseUrl, + }); + if (_result instanceof Error) throw _result; + if (_result !== undefined) return _result as Image; + } + + } + try { return await Image.fromJsonLd( jsonLd, @@ -4055,7 +4131,11 @@ get names(): ((string | LanguageString))[] { \\"image\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#image_fromJsonLd(doc, options); + v = await this.#image_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -4151,7 +4231,11 @@ get names(): ((string | LanguageString))[] { \\"image\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#image_fromJsonLd(obj, options); + v = await this.#image_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -4377,7 +4461,11 @@ get names(): ((string | LanguageString))[] { \\"inReplyTo\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#replyTarget_fromJsonLd(doc, options); + v = await this.#replyTarget_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -4472,7 +4560,11 @@ get names(): ((string | LanguageString))[] { \\"inReplyTo\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#replyTarget_fromJsonLd(obj, options); + v = await this.#replyTarget_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -4698,7 +4790,11 @@ get names(): ((string | LanguageString))[] { \\"location\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#location_fromJsonLd(doc, options); + v = await this.#location_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -4793,7 +4889,11 @@ get names(): ((string | LanguageString))[] { \\"location\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#location_fromJsonLd(obj, options); + v = await this.#location_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -5018,7 +5118,11 @@ get names(): ((string | LanguageString))[] { \\"preview\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#preview_fromJsonLd(doc, options); + v = await this.#preview_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -5112,7 +5216,11 @@ get names(): ((string | LanguageString))[] { \\"preview\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#preview_fromJsonLd(obj, options); + v = await this.#preview_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -5342,7 +5450,11 @@ get names(): ((string | LanguageString))[] { \\"replies\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#replies_fromJsonLd(doc, options); + v = await this.#replies_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -5564,7 +5676,11 @@ get names(): ((string | LanguageString))[] { \\"shares\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#shares_fromJsonLd(doc, options); + v = await this.#shares_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -5786,7 +5902,11 @@ get names(): ((string | LanguageString))[] { \\"likes\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#likes_fromJsonLd(doc, options); + v = await this.#likes_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -6002,7 +6122,11 @@ get names(): ((string | LanguageString))[] { \\"emojiReactions\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#emojiReactions_fromJsonLd(doc, options); + v = await this.#emojiReactions_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -6270,7 +6394,11 @@ get summaries(): ((string | LanguageString))[] { \\"tag\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#tag_fromJsonLd(obj, options); + v = await this.#tag_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -6521,7 +6649,11 @@ get urls(): ((URL | Link))[] { \\"to\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#to_fromJsonLd(doc, options); + v = await this.#to_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -6616,7 +6748,11 @@ get urls(): ((URL | Link))[] { \\"to\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#to_fromJsonLd(obj, options); + v = await this.#to_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -6833,7 +6969,11 @@ get urls(): ((URL | Link))[] { \\"bto\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#bto_fromJsonLd(doc, options); + v = await this.#bto_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -6928,7 +7068,11 @@ get urls(): ((URL | Link))[] { \\"bto\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#bto_fromJsonLd(obj, options); + v = await this.#bto_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -7145,7 +7289,11 @@ get urls(): ((URL | Link))[] { \\"cc\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#cc_fromJsonLd(doc, options); + v = await this.#cc_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -7240,7 +7388,11 @@ get urls(): ((URL | Link))[] { \\"cc\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#cc_fromJsonLd(obj, options); + v = await this.#cc_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -7457,7 +7609,11 @@ get urls(): ((URL | Link))[] { \\"bcc\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#bcc_fromJsonLd(doc, options); + v = await this.#bcc_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -7552,7 +7708,11 @@ get urls(): ((URL | Link))[] { \\"bcc\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#bcc_fromJsonLd(obj, options); + v = await this.#bcc_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -7832,7 +7992,11 @@ get urls(): ((URL | Link))[] { \\"proof\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#proof_fromJsonLd(doc, options); + v = await this.#proof_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -7926,7 +8090,11 @@ get urls(): ((URL | Link))[] { \\"proof\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#proof_fromJsonLd(obj, options); + v = await this.#proof_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -8182,7 +8350,11 @@ get urls(): ((URL | Link))[] { \\"likeAuthorization\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#likeAuthorization_fromJsonLd(doc, options); + v = await this.#likeAuthorization_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -8398,7 +8570,11 @@ get urls(): ((URL | Link))[] { \\"replyAuthorization\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#replyAuthorization_fromJsonLd(doc, options); + v = await this.#replyAuthorization_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -8614,7 +8790,11 @@ get urls(): ((URL | Link))[] { \\"announceAuthorization\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#announceAuthorization_fromJsonLd(doc, options); + v = await this.#announceAuthorization_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -10162,9 +10342,14 @@ get urls(): ((URL | Link))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -10463,16 +10648,16 @@ get urls(): ((URL | Link))[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"http://schema.org#PropertyValue\\") ? await PropertyValue.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -10509,23 +10694,23 @@ get urls(): ((URL | Link))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -10560,7 +10745,7 @@ get urls(): ((URL | Link))[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.push(decoded); @@ -10620,12 +10805,12 @@ get urls(): ((URL | Link))[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -10709,12 +10894,12 @@ get urls(): ((URL | Link))[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -10737,6 +10922,28 @@ get urls(): ((URL | Link))[] { ) { if (v == null) continue; + { + let _handled: Image | undefined; + + if (_handled === undefined) { + const _result = await _ppM0[\\"normalizeLinkToImage\\"](v, { + documentLoader: options.documentLoader, + contextLoader: options.contextLoader, + tracerProvider: options.tracerProvider, + baseUrl: _baseUrl, + }); + if (_result instanceof Error) throw _result; + if (_result !== undefined) { + _handled = _result as Image; + } + } + + if (_handled !== undefined) { + _33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.push(_handled); + continue; + } + } + if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { _33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.push( @@ -10749,7 +10956,7 @@ get urls(): ((URL | Link))[] { const decoded = await Image.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.push(decoded); @@ -10770,6 +10977,28 @@ get urls(): ((URL | Link))[] { ) { if (v == null) continue; + { + let _handled: Image | undefined; + + if (_handled === undefined) { + const _result = await _ppM0[\\"normalizeLinkToImage\\"](v, { + documentLoader: options.documentLoader, + contextLoader: options.contextLoader, + tracerProvider: options.tracerProvider, + baseUrl: _baseUrl, + }); + if (_result instanceof Error) throw _result; + if (_result !== undefined) { + _handled = _result as Image; + } + } + + if (_handled !== undefined) { + _3dXrUdkARxwyJLtJcYi1AJ92H41U_image.push(_handled); + continue; + } + } + if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { _3dXrUdkARxwyJLtJcYi1AJ92H41U_image.push( @@ -10782,7 +11011,7 @@ get urls(): ((URL | Link))[] { const decoded = await Image.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3dXrUdkARxwyJLtJcYi1AJ92H41U_image.push(decoded); @@ -10818,12 +11047,12 @@ get urls(): ((URL | Link))[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -10861,12 +11090,12 @@ get urls(): ((URL | Link))[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -10904,12 +11133,12 @@ get urls(): ((URL | Link))[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -10966,7 +11195,7 @@ get urls(): ((URL | Link))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _7UpwM3JWcXhADcscukEehBorf6k_replies.push(decoded); @@ -10999,7 +11228,7 @@ get urls(): ((URL | Link))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3kAfck9PcEYt2L7xug5y99YPbANs_shares.push(decoded); @@ -11032,7 +11261,7 @@ get urls(): ((URL | Link))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.push(decoded); @@ -11065,7 +11294,7 @@ get urls(): ((URL | Link))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.push(decoded); @@ -11147,12 +11376,12 @@ get urls(): ((URL | Link))[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -11211,13 +11440,13 @@ get urls(): ((URL | Link))[] { : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))) : typeof v === \\"object\\" && \\"@type\\" in v + : new URL(v[\\"@id\\"], _baseUrl) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -11252,7 +11481,7 @@ get urls(): ((URL | Link))[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.push(decoded); @@ -11285,7 +11514,7 @@ get urls(): ((URL | Link))[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.push(decoded); @@ -11318,7 +11547,7 @@ get urls(): ((URL | Link))[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.push(decoded); @@ -11351,7 +11580,7 @@ get urls(): ((URL | Link))[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.push(decoded); @@ -11426,7 +11655,7 @@ get urls(): ((URL | Link))[] { const decoded = await Source.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2ZwCFoS787v8y8bXKjMoE6MAbrEB_source.push(decoded); @@ -11459,7 +11688,7 @@ get urls(): ((URL | Link))[] { const decoded = await DataIntegrityProof.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.push(decoded); @@ -11480,7 +11709,7 @@ get urls(): ((URL | Link))[] { const decoded = await InteractionPolicy.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy.push(decoded); @@ -11512,9 +11741,9 @@ get urls(): ((URL | Link))[] { : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))); + : new URL(v[\\"@id\\"], _baseUrl); if (typeof decoded === \\"undefined\\") continue; _23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy.push(decoded); } @@ -11546,7 +11775,7 @@ get urls(): ((URL | Link))[] { const decoded = await LikeAuthorization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.push(decoded); @@ -11579,7 +11808,7 @@ get urls(): ((URL | Link))[] { const decoded = await ReplyAuthorization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.push(decoded); @@ -11612,7 +11841,7 @@ get urls(): ((URL | Link))[] { const decoded = await AnnounceAuthorization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.push(decoded); @@ -12790,9 +13019,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -13227,7 +13461,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"quote\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#quote_fromJsonLd(doc, options); + v = await this.#quote_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -13466,7 +13704,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"quoteAuthorization\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#quoteAuthorization_fromJsonLd(doc, options); + v = await this.#quoteAuthorization_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -13788,9 +14030,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -13839,7 +14086,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push(decoded); @@ -13898,7 +14145,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await QuoteAuthorization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push(decoded); @@ -14844,7 +15091,11 @@ instruments?: (Object | URL)[];} \\"actor\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#actor_fromJsonLd(doc, options); + v = await this.#actor_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -14940,7 +15191,11 @@ instruments?: (Object | URL)[];} \\"actor\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#actor_fromJsonLd(obj, options); + v = await this.#actor_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -15158,7 +15413,11 @@ instruments?: (Object | URL)[];} \\"object\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#object_fromJsonLd(doc, options); + v = await this.#object_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -15254,7 +15513,11 @@ instruments?: (Object | URL)[];} \\"object\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#object_fromJsonLd(obj, options); + v = await this.#object_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -15475,7 +15738,11 @@ instruments?: (Object | URL)[];} \\"target\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#target_fromJsonLd(doc, options); + v = await this.#target_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -15574,7 +15841,11 @@ instruments?: (Object | URL)[];} \\"target\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#target_fromJsonLd(obj, options); + v = await this.#target_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -15792,7 +16063,11 @@ instruments?: (Object | URL)[];} \\"result\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#result_fromJsonLd(doc, options); + v = await this.#result_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -15888,7 +16163,11 @@ instruments?: (Object | URL)[];} \\"result\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#result_fromJsonLd(obj, options); + v = await this.#result_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -16107,7 +16386,11 @@ instruments?: (Object | URL)[];} \\"origin\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#origin_fromJsonLd(doc, options); + v = await this.#origin_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -16204,7 +16487,11 @@ instruments?: (Object | URL)[];} \\"origin\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#origin_fromJsonLd(obj, options); + v = await this.#origin_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -16421,7 +16708,11 @@ instruments?: (Object | URL)[];} \\"instrument\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#instrument_fromJsonLd(doc, options); + v = await this.#instrument_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -16516,7 +16807,11 @@ instruments?: (Object | URL)[];} \\"instrument\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#instrument_fromJsonLd(obj, options); + v = await this.#instrument_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -16797,9 +17092,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -16986,23 +17286,23 @@ instruments?: (Object | URL)[];} typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -17037,7 +17337,7 @@ instruments?: (Object | URL)[];} const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.push(decoded); @@ -17070,7 +17370,7 @@ instruments?: (Object | URL)[];} const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.push(decoded); @@ -17103,7 +17403,7 @@ instruments?: (Object | URL)[];} const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.push(decoded); @@ -17136,7 +17436,7 @@ instruments?: (Object | URL)[];} const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _25zu2s3VxVujgEKqrDycjE284XQR_origin.push(decoded); @@ -17169,7 +17469,7 @@ instruments?: (Object | URL)[];} const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.push(decoded); @@ -17640,9 +17940,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -18143,9 +18448,14 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -18729,9 +19039,14 @@ unit?: string | null;numericalValue?: Decimal | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -19228,7 +19543,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"interactingObject\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#interactingObject_fromJsonLd(doc, options); + v = await this.#interactingObject_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -19443,7 +19762,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"interactionTarget\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#interactionTarget_fromJsonLd(doc, options); + v = await this.#interactionTarget_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -19720,9 +20043,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -19771,7 +20099,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push(decoded); @@ -19804,7 +20132,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push(decoded); @@ -20169,9 +20497,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -20760,9 +21093,14 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -20794,7 +21132,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike.push(decoded); @@ -20815,7 +21153,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply.push(decoded); @@ -20836,7 +21174,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce.push(decoded); @@ -20857,7 +21195,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote.push(decoded); @@ -21508,9 +21846,14 @@ get manualApprovals(): (URL)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -21553,9 +21896,9 @@ get manualApprovals(): (URL)[] { : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))); + : new URL(v[\\"@id\\"], _baseUrl); if (typeof decoded === \\"undefined\\") continue; _2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.push(decoded); } @@ -21586,9 +21929,9 @@ get manualApprovals(): (URL)[] { : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))); + : new URL(v[\\"@id\\"], _baseUrl); if (typeof decoded === \\"undefined\\") continue; _sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval.push(decoded); } @@ -22048,7 +22391,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"interactingObject\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#interactingObject_fromJsonLd(doc, options); + v = await this.#interactingObject_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -22263,7 +22610,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"interactionTarget\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#interactionTarget_fromJsonLd(doc, options); + v = await this.#interactionTarget_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -22540,9 +22891,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -22591,7 +22947,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push(decoded); @@ -22624,7 +22980,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push(decoded); @@ -22988,9 +23344,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -23400,7 +23761,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"interactingObject\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#interactingObject_fromJsonLd(doc, options); + v = await this.#interactingObject_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -23615,7 +23980,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"interactionTarget\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#interactionTarget_fromJsonLd(doc, options); + v = await this.#interactionTarget_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -23892,9 +24261,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -23943,7 +24317,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push(decoded); @@ -23976,7 +24350,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push(decoded); @@ -24340,9 +24714,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -24751,7 +25130,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"interactingObject\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#interactingObject_fromJsonLd(doc, options); + v = await this.#interactingObject_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -24966,7 +25349,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"interactionTarget\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#interactionTarget_fromJsonLd(doc, options); + v = await this.#interactionTarget_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -25243,9 +25630,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -25294,7 +25686,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push(decoded); @@ -25327,7 +25719,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push(decoded); @@ -25691,9 +26083,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -26136,9 +26533,14 @@ get endpoints(): (URL)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -26185,9 +26587,9 @@ get endpoints(): (URL)[] { : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))); + : new URL(v[\\"@id\\"], _baseUrl); if (typeof decoded === \\"undefined\\") continue; _2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.push(decoded); } @@ -26489,9 +26891,14 @@ endpoints?: (URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -27307,9 +27714,14 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -27371,7 +27783,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.push(decoded); @@ -27997,7 +28409,11 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi \\"owner\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#owner_fromJsonLd(doc, options); + v = await this.#owner_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -28272,9 +28688,14 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -28320,23 +28741,23 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -28868,7 +29289,11 @@ controller?: Application | Group | Organization | Person | Service | URL | null; \\"controller\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#controller_fromJsonLd(doc, options); + v = await this.#controller_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -29150,9 +29575,14 @@ controller?: Application | Group | Organization | Person | Service | URL | null; // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -29198,23 +29628,23 @@ controller?: Application | Group | Organization | Person | Service | URL | null; typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -29985,9 +30415,14 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -30048,9 +30483,9 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))); + : new URL(v[\\"@id\\"], _baseUrl); if (typeof decoded === \\"undefined\\") continue; _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.push(decoded); } @@ -30070,7 +30505,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur const decoded = await Measure.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.push(decoded); @@ -30091,7 +30526,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur const decoded = await Measure.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.push(decoded); @@ -30112,7 +30547,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur const decoded = await Measure.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.push(decoded); @@ -30857,9 +31292,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -30914,7 +31354,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Intent.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.push(decoded); @@ -30935,7 +31375,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Intent.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.push(decoded); @@ -31350,9 +31790,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -31690,9 +32135,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -32025,9 +32475,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -33301,7 +33756,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"publicKey\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#publicKey_fromJsonLd(doc, options); + v = await this.#publicKey_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -33394,7 +33853,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"publicKey\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#publicKey_fromJsonLd(obj, options); + v = await this.#publicKey_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -33613,7 +34076,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"assertionMethod\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#assertionMethod_fromJsonLd(doc, options); + v = await this.#assertionMethod_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -33710,7 +34177,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"assertionMethod\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#assertionMethod_fromJsonLd(obj, options); + v = await this.#assertionMethod_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -33966,7 +34437,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"inbox\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#inbox_fromJsonLd(doc, options); + v = await this.#inbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -34199,7 +34674,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"outbox\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#outbox_fromJsonLd(doc, options); + v = await this.#outbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -34418,7 +34897,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"following\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#following_fromJsonLd(doc, options); + v = await this.#following_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -34640,7 +35123,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"followers\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#followers_fromJsonLd(doc, options); + v = await this.#followers_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -34860,7 +35347,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"liked\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#liked_fromJsonLd(doc, options); + v = await this.#liked_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -35078,7 +35569,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"featured\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#featured_fromJsonLd(doc, options); + v = await this.#featured_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -35296,7 +35791,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"featuredTags\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#featuredTags_fromJsonLd(doc, options); + v = await this.#featuredTags_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -35512,7 +36011,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"streams\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#stream_fromJsonLd(obj, options); + v = await this.#stream_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -35838,7 +36341,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"movedTo\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#successor_fromJsonLd(doc, options); + v = await this.#successor_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -36092,7 +36599,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"alsoKnownAs\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#alias_fromJsonLd(doc, options); + v = await this.#alias_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -36189,7 +36700,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"alsoKnownAs\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#alias_fromJsonLd(obj, options); + v = await this.#alias_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -36408,7 +36923,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"service\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#service_fromJsonLd(doc, options); + v = await this.#service_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -36505,7 +37024,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"service\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#service_fromJsonLd(obj, options); + v = await this.#service_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -37538,9 +38061,14 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -37613,7 +38141,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(decoded); @@ -37646,7 +38174,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); @@ -37699,11 +38227,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -37740,11 +38268,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -37779,7 +38307,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(decoded); @@ -37812,7 +38340,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(decoded); @@ -37845,7 +38373,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(decoded); @@ -37878,7 +38406,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(decoded); @@ -37911,7 +38439,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(decoded); @@ -37944,7 +38472,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(decoded); @@ -37965,7 +38493,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.push(decoded); @@ -38072,23 +38600,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -38125,23 +38653,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -38176,7 +38704,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(decoded); @@ -39001,9 +39529,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -39348,9 +39881,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -39780,7 +40318,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"quote\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#quote_fromJsonLd(doc, options); + v = await this.#quote_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -40019,7 +40561,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"quoteAuthorization\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#quoteAuthorization_fromJsonLd(doc, options); + v = await this.#quoteAuthorization_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -40341,9 +40887,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -40392,7 +40943,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push(decoded); @@ -40451,7 +41002,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await QuoteAuthorization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push(decoded); @@ -40982,9 +41533,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -41411,9 +41967,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -41745,9 +42306,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -42085,9 +42651,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -42840,7 +43411,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"current\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#current_fromJsonLd(doc, options); + v = await this.#current_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -43056,7 +43631,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"first\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#first_fromJsonLd(doc, options); + v = await this.#first_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -43272,7 +43851,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"last\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#last_fromJsonLd(doc, options); + v = await this.#last_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -43498,7 +44081,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"items\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#item_fromJsonLd(obj, options); + v = await this.#item_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -43714,7 +44301,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"likesOf\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#likesOf_fromJsonLd(doc, options); + v = await this.#likesOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -43929,7 +44520,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"sharesOf\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#sharesOf_fromJsonLd(doc, options); + v = await this.#sharesOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -44144,7 +44739,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"repliesOf\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#repliesOf_fromJsonLd(doc, options); + v = await this.#repliesOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -44359,7 +44958,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"inboxOf\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#inboxOf_fromJsonLd(doc, options); + v = await this.#inboxOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -44574,7 +45177,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"outboxOf\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#outboxOf_fromJsonLd(doc, options); + v = await this.#outboxOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -44789,7 +45396,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"followersOf\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#followersOf_fromJsonLd(doc, options); + v = await this.#followersOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -45004,7 +45615,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"followingOf\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#followingOf_fromJsonLd(doc, options); + v = await this.#followingOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -45219,7 +45834,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"likedOf\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#likedOf_fromJsonLd(doc, options); + v = await this.#likedOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -45884,9 +46503,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -45965,7 +46589,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3UyUdxnyn6cDn53QKrh4MBiearma_current.push(decoded); @@ -45998,7 +46622,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _J52RqweMe6hhv7RnLJMC8BExTE5_first.push(decoded); @@ -46031,7 +46655,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.push(decoded); @@ -46067,12 +46691,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -46107,7 +46731,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.push(decoded); @@ -46140,7 +46764,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.push(decoded); @@ -46173,7 +46797,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.push(decoded); @@ -46206,7 +46830,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.push(decoded); @@ -46239,7 +46863,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.push(decoded); @@ -46272,7 +46896,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.push(decoded); @@ -46305,7 +46929,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.push(decoded); @@ -46338,7 +46962,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.push(decoded); @@ -47018,7 +47642,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"partOf\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#partOf_fromJsonLd(doc, options); + v = await this.#partOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -47232,7 +47860,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"next\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#next_fromJsonLd(doc, options); + v = await this.#next_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -47447,7 +48079,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"prev\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#prev_fromJsonLd(doc, options); + v = await this.#prev_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -47759,9 +48395,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -47814,7 +48455,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.push(decoded); @@ -47847,7 +48488,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.push(decoded); @@ -47880,7 +48521,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.push(decoded); @@ -48254,9 +48895,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -48588,9 +49234,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -48920,9 +49571,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -49714,9 +50370,14 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -49759,9 +50420,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))); + : new URL(v[\\"@id\\"], _baseUrl); if (typeof decoded === \\"undefined\\") continue; _2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.push(decoded); } @@ -49792,9 +50453,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))); + : new URL(v[\\"@id\\"], _baseUrl); if (typeof decoded === \\"undefined\\") continue; _25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.push(decoded); } @@ -49825,9 +50486,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))); + : new URL(v[\\"@id\\"], _baseUrl); if (typeof decoded === \\"undefined\\") continue; _iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.push(decoded); } @@ -49858,9 +50519,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))); + : new URL(v[\\"@id\\"], _baseUrl); if (typeof decoded === \\"undefined\\") continue; _8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.push(decoded); } @@ -49891,9 +50552,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))); + : new URL(v[\\"@id\\"], _baseUrl); if (typeof decoded === \\"undefined\\") continue; _3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.push(decoded); } @@ -49924,9 +50585,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))); + : new URL(v[\\"@id\\"], _baseUrl); if (typeof decoded === \\"undefined\\") continue; _3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.push(decoded); } @@ -50379,9 +51040,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -50714,9 +51380,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -51050,9 +51721,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -52326,7 +53002,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"publicKey\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#publicKey_fromJsonLd(doc, options); + v = await this.#publicKey_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -52419,7 +53099,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"publicKey\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#publicKey_fromJsonLd(obj, options); + v = await this.#publicKey_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -52638,7 +53322,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"assertionMethod\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#assertionMethod_fromJsonLd(doc, options); + v = await this.#assertionMethod_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -52735,7 +53423,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"assertionMethod\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#assertionMethod_fromJsonLd(obj, options); + v = await this.#assertionMethod_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -52991,7 +53683,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"inbox\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#inbox_fromJsonLd(doc, options); + v = await this.#inbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -53224,7 +53920,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"outbox\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#outbox_fromJsonLd(doc, options); + v = await this.#outbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -53443,7 +54143,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"following\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#following_fromJsonLd(doc, options); + v = await this.#following_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -53665,7 +54369,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"followers\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#followers_fromJsonLd(doc, options); + v = await this.#followers_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -53885,7 +54593,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"liked\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#liked_fromJsonLd(doc, options); + v = await this.#liked_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -54103,7 +54815,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"featured\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#featured_fromJsonLd(doc, options); + v = await this.#featured_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -54321,7 +55037,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"featuredTags\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#featuredTags_fromJsonLd(doc, options); + v = await this.#featuredTags_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -54537,7 +55257,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"streams\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#stream_fromJsonLd(obj, options); + v = await this.#stream_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -54863,7 +55587,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"movedTo\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#successor_fromJsonLd(doc, options); + v = await this.#successor_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -55117,7 +55845,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"alsoKnownAs\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#alias_fromJsonLd(doc, options); + v = await this.#alias_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -55214,7 +55946,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"alsoKnownAs\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#alias_fromJsonLd(obj, options); + v = await this.#alias_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -55433,7 +56169,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"service\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#service_fromJsonLd(doc, options); + v = await this.#service_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -55530,7 +56270,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"service\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#service_fromJsonLd(obj, options); + v = await this.#service_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -56563,9 +57307,14 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -56638,7 +57387,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(decoded); @@ -56671,7 +57420,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); @@ -56724,11 +57473,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -56765,11 +57514,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -56804,7 +57553,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(decoded); @@ -56837,7 +57586,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(decoded); @@ -56870,7 +57619,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(decoded); @@ -56903,7 +57652,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(decoded); @@ -56936,7 +57685,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(decoded); @@ -56969,7 +57718,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(decoded); @@ -56990,7 +57739,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.push(decoded); @@ -57097,23 +57846,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -57150,23 +57899,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -57201,7 +57950,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(decoded); @@ -58538,7 +59287,11 @@ get names(): ((string | LanguageString))[] { \\"preview\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#preview_fromJsonLd(obj, options); + v = await this.#preview_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -58992,9 +59745,14 @@ get names(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -59045,9 +59803,9 @@ get names(): ((string | LanguageString))[] { : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))); + : new URL(v[\\"@id\\"], _baseUrl); if (typeof decoded === \\"undefined\\") continue; _pVjLsybKQdmkjuU7MHjiVmNnuj7_href.push(decoded); } @@ -59196,12 +59954,12 @@ get names(): ((string | LanguageString))[] { && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -59675,9 +60433,14 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -60012,9 +60775,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -60347,9 +61115,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -60685,9 +61458,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -61019,9 +61797,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -61353,9 +62136,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -61687,9 +62475,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -62019,9 +62812,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -62317,9 +63115,14 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -62652,9 +63455,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -63086,7 +63894,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"quote\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#quote_fromJsonLd(doc, options); + v = await this.#quote_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -63325,7 +64137,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"quoteAuthorization\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#quoteAuthorization_fromJsonLd(doc, options); + v = await this.#quoteAuthorization_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -63647,9 +64463,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -63698,7 +64519,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push(decoded); @@ -63757,7 +64578,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await QuoteAuthorization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push(decoded); @@ -64199,7 +65020,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"orderedItems\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#item_fromJsonLd(obj, options); + v = await this.#item_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -64443,9 +65268,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -64497,12 +65327,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -64936,7 +65766,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"orderedItems\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#item_fromJsonLd(obj, options); + v = await this.#item_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -65229,9 +66063,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -65283,12 +66122,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some( t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -66608,7 +67447,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"publicKey\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#publicKey_fromJsonLd(doc, options); + v = await this.#publicKey_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -66701,7 +67544,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"publicKey\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#publicKey_fromJsonLd(obj, options); + v = await this.#publicKey_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -66920,7 +67767,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"assertionMethod\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#assertionMethod_fromJsonLd(doc, options); + v = await this.#assertionMethod_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -67017,7 +67868,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"assertionMethod\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#assertionMethod_fromJsonLd(obj, options); + v = await this.#assertionMethod_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -67273,7 +68128,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"inbox\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#inbox_fromJsonLd(doc, options); + v = await this.#inbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -67506,7 +68365,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"outbox\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#outbox_fromJsonLd(doc, options); + v = await this.#outbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -67725,7 +68588,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"following\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#following_fromJsonLd(doc, options); + v = await this.#following_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -67947,7 +68814,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"followers\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#followers_fromJsonLd(doc, options); + v = await this.#followers_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -68167,7 +69038,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"liked\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#liked_fromJsonLd(doc, options); + v = await this.#liked_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -68385,7 +69260,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"featured\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#featured_fromJsonLd(doc, options); + v = await this.#featured_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -68603,7 +69482,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"featuredTags\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#featuredTags_fromJsonLd(doc, options); + v = await this.#featuredTags_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -68819,7 +69702,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"streams\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#stream_fromJsonLd(obj, options); + v = await this.#stream_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -69145,7 +70032,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"movedTo\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#successor_fromJsonLd(doc, options); + v = await this.#successor_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -69399,7 +70290,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"alsoKnownAs\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#alias_fromJsonLd(doc, options); + v = await this.#alias_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -69496,7 +70391,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"alsoKnownAs\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#alias_fromJsonLd(obj, options); + v = await this.#alias_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -69715,7 +70614,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"service\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#service_fromJsonLd(doc, options); + v = await this.#service_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -69812,7 +70715,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"service\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#service_fromJsonLd(obj, options); + v = await this.#service_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -70845,9 +71752,14 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -70920,7 +71832,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(decoded); @@ -70953,7 +71865,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); @@ -71006,11 +71918,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -71047,11 +71959,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -71086,7 +71998,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(decoded); @@ -71119,7 +72031,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(decoded); @@ -71152,7 +72064,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(decoded); @@ -71185,7 +72097,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(decoded); @@ -71218,7 +72130,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(decoded); @@ -71251,7 +72163,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(decoded); @@ -71272,7 +72184,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.push(decoded); @@ -71379,23 +72291,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -71432,23 +72344,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -71483,7 +72395,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(decoded); @@ -72310,9 +73222,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -73586,7 +74503,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"publicKey\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#publicKey_fromJsonLd(doc, options); + v = await this.#publicKey_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -73679,7 +74600,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"publicKey\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#publicKey_fromJsonLd(obj, options); + v = await this.#publicKey_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -73898,7 +74823,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"assertionMethod\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#assertionMethod_fromJsonLd(doc, options); + v = await this.#assertionMethod_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -73995,7 +74924,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"assertionMethod\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#assertionMethod_fromJsonLd(obj, options); + v = await this.#assertionMethod_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -74251,7 +75184,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"inbox\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#inbox_fromJsonLd(doc, options); + v = await this.#inbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -74484,7 +75421,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"outbox\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#outbox_fromJsonLd(doc, options); + v = await this.#outbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -74703,7 +75644,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"following\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#following_fromJsonLd(doc, options); + v = await this.#following_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -74925,7 +75870,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"followers\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#followers_fromJsonLd(doc, options); + v = await this.#followers_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -75145,7 +76094,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"liked\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#liked_fromJsonLd(doc, options); + v = await this.#liked_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -75363,7 +76316,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"featured\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#featured_fromJsonLd(doc, options); + v = await this.#featured_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -75581,7 +76538,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"featuredTags\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#featuredTags_fromJsonLd(doc, options); + v = await this.#featuredTags_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -75797,7 +76758,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"streams\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#stream_fromJsonLd(obj, options); + v = await this.#stream_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -76123,7 +77088,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"movedTo\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#successor_fromJsonLd(doc, options); + v = await this.#successor_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -76377,7 +77346,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"alsoKnownAs\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#alias_fromJsonLd(doc, options); + v = await this.#alias_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -76474,7 +77447,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"alsoKnownAs\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#alias_fromJsonLd(obj, options); + v = await this.#alias_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -76693,7 +77670,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"service\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#service_fromJsonLd(doc, options); + v = await this.#service_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -76790,7 +77771,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"service\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#service_fromJsonLd(obj, options); + v = await this.#service_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -77823,9 +78808,14 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -77898,7 +78888,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(decoded); @@ -77931,7 +78921,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); @@ -77984,11 +78974,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -78025,11 +79015,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -78064,7 +79054,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(decoded); @@ -78097,7 +79087,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(decoded); @@ -78130,7 +79120,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(decoded); @@ -78163,7 +79153,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(decoded); @@ -78196,7 +79186,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(decoded); @@ -78229,7 +79219,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(decoded); @@ -78250,7 +79240,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.push(decoded); @@ -78357,23 +79347,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -78410,23 +79400,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -78461,7 +79451,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(decoded); @@ -79744,9 +80734,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -79888,9 +80883,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu : \\"\\" ) ) - : URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) + : URL.canParse(v[\\"@id\\"]) && _baseUrl ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))) : undefined + : new URL(v[\\"@id\\"], _baseUrl) : undefined ; if (typeof decoded === \\"undefined\\") continue; _oKrwxU4V8wiKhMW1QEYQibcJh8c_units.push(decoded); @@ -80373,7 +81368,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"describes\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#describes_fromJsonLd(doc, options); + v = await this.#describes_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -80615,9 +81614,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -80666,7 +81670,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.push(decoded); @@ -81259,7 +82263,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti \\"oneOf\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#exclusiveOption_fromJsonLd(obj, options); + v = await this.#exclusiveOption_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -81478,7 +82486,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti \\"anyOf\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#inclusiveOption_fromJsonLd(obj, options); + v = await this.#inclusiveOption_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -81726,7 +82738,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti \\"quote\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#quote_fromJsonLd(doc, options); + v = await this.#quote_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -81965,7 +82981,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti \\"quoteAuthorization\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#quoteAuthorization_fromJsonLd(doc, options); + v = await this.#quoteAuthorization_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -82270,9 +83290,14 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -82321,7 +83346,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.push(decoded); @@ -82354,7 +83379,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.push(decoded); @@ -82436,7 +83461,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push(decoded); @@ -82495,7 +83520,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const decoded = await QuoteAuthorization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push(decoded); @@ -82954,9 +83979,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -83288,9 +84318,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -83848,7 +84883,11 @@ relationships?: (Object | URL)[];} \\"subject\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#subject_fromJsonLd(doc, options); + v = await this.#subject_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -84063,7 +85102,11 @@ relationships?: (Object | URL)[];} \\"object\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#object_fromJsonLd(doc, options); + v = await this.#object_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -84157,7 +85200,11 @@ relationships?: (Object | URL)[];} \\"object\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#object_fromJsonLd(obj, options); + v = await this.#object_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -84375,7 +85422,11 @@ relationships?: (Object | URL)[];} \\"relationship\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#relationship_fromJsonLd(doc, options); + v = await this.#relationship_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -84471,7 +85522,11 @@ relationships?: (Object | URL)[];} \\"relationship\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#relationship_fromJsonLd(obj, options); + v = await this.#relationship_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -84784,9 +85839,14 @@ relationships?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -84835,7 +85895,7 @@ relationships?: (Object | URL)[];} const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.push(decoded); @@ -84868,7 +85928,7 @@ relationships?: (Object | URL)[];} const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.push(decoded); @@ -84901,7 +85961,7 @@ relationships?: (Object | URL)[];} const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.push(decoded); @@ -85289,9 +86349,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -86565,7 +87630,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"publicKey\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#publicKey_fromJsonLd(doc, options); + v = await this.#publicKey_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -86658,7 +87727,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"publicKey\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#publicKey_fromJsonLd(obj, options); + v = await this.#publicKey_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -86877,7 +87950,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"assertionMethod\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#assertionMethod_fromJsonLd(doc, options); + v = await this.#assertionMethod_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -86974,7 +88051,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"assertionMethod\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#assertionMethod_fromJsonLd(obj, options); + v = await this.#assertionMethod_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -87230,7 +88311,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"inbox\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#inbox_fromJsonLd(doc, options); + v = await this.#inbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -87463,7 +88548,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"outbox\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#outbox_fromJsonLd(doc, options); + v = await this.#outbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -87682,7 +88771,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"following\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#following_fromJsonLd(doc, options); + v = await this.#following_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -87904,7 +88997,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"followers\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#followers_fromJsonLd(doc, options); + v = await this.#followers_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -88124,7 +89221,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"liked\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#liked_fromJsonLd(doc, options); + v = await this.#liked_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -88342,7 +89443,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"featured\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#featured_fromJsonLd(doc, options); + v = await this.#featured_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -88560,7 +89665,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"featuredTags\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#featuredTags_fromJsonLd(doc, options); + v = await this.#featuredTags_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -88776,7 +89885,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"streams\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#stream_fromJsonLd(obj, options); + v = await this.#stream_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -89102,7 +90215,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"movedTo\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#successor_fromJsonLd(doc, options); + v = await this.#successor_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -89356,7 +90473,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"alsoKnownAs\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#alias_fromJsonLd(doc, options); + v = await this.#alias_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -89453,7 +90574,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"alsoKnownAs\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#alias_fromJsonLd(obj, options); + v = await this.#alias_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -89672,7 +90797,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"service\\"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === \\"object\\" && \\"@context\\" in doc) { - v = await this.#service_fromJsonLd(doc, options); + v = await this.#service_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -89769,7 +90898,11 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"service\\"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === \\"object\\" && \\"@context\\" in obj) { - v = await this.#service_fromJsonLd(obj, options); + v = await this.#service_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -90802,9 +91935,14 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -90877,7 +92015,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(decoded); @@ -90910,7 +92048,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); @@ -90963,11 +92101,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -91004,11 +92142,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -91043,7 +92181,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(decoded); @@ -91076,7 +92214,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(decoded); @@ -91109,7 +92247,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(decoded); @@ -91142,7 +92280,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(decoded); @@ -91175,7 +92313,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(decoded); @@ -91208,7 +92346,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(decoded); @@ -91229,7 +92367,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.push(decoded); @@ -91336,23 +92474,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -91389,23 +92527,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Application\\") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Group\\") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Organization\\") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Person\\") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& v[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Service\\") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === \\"undefined\\") continue; @@ -91440,7 +92578,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === \\"undefined\\") continue; _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(decoded); @@ -92476,9 +93614,14 @@ get contents(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -92908,9 +94051,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -93242,9 +94390,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -93792,9 +94945,14 @@ get formerTypes(): ($EntityType)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -94227,9 +95385,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -94566,9 +95729,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -94903,9 +96071,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -95240,9 +96413,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -95573,9 +96751,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (options.baseUrl == null && values[\\"@id\\"] != null) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + const _resolvedUrl = + values[\\"@id\\"] != null && URL.canParse(values[\\"@id\\"], options.baseUrl) + ? new URL(values[\\"@id\\"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index d728d1625..a9f10d5bf 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -1,7 +1,7 @@ // Bun Snapshot v1, https://bun.sh/docs/test/snapshots exports[`generateClasses() 1`] = ` -"// deno-lint-ignore-file ban-unused-ignore no-unused-vars prefer-const verbatim-module-syntax +"// deno-lint-ignore-file ban-unused-ignore no-explicit-any no-unused-vars prefer-const verbatim-module-syntax import jsonld from "@fedify/vocab-runtime/jsonld"; import { getLogger } from "@logtape/logtape"; import { type Span, SpanStatusCode, type TracerProvider, trace } @@ -28,6 +28,8 @@ import { } from "@fedify/vocab-runtime/temporal"; +import * as _ppM0 from "./preprocessors.ts"; + /** Describes an object of any kind. The Object type serves as the base type for * most of the other kinds of objects defined in the Activity Vocabulary, * including other Core types such as {@link Activity}, @@ -2334,7 +2336,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "attachment"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#attachment_fromJsonLd(obj, options); + v = await this.#attachment_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -2588,7 +2594,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "attributedTo"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#attribution_fromJsonLd(doc, options); + v = await this.#attribution_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -2684,7 +2694,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "attributedTo"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#attribution_fromJsonLd(obj, options); + v = await this.#attribution_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -2901,7 +2915,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "audience"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#audience_fromJsonLd(doc, options); + v = await this.#audience_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -2996,7 +3014,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "audience"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#audience_fromJsonLd(obj, options); + v = await this.#audience_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -3257,7 +3279,11 @@ get contents(): ((string | LanguageString))[] { "context"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#context_fromJsonLd(obj, options); + v = await this.#context_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -3525,7 +3551,11 @@ get names(): ((string | LanguageString))[] { "generator"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#generator_fromJsonLd(obj, options); + v = await this.#generator_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -3663,6 +3693,25 @@ get names(): ((string | LanguageString))[] { this._tracerProvider ?? trace.getTracerProvider(); const baseUrl = options.baseUrl; + const _expanded = await jsonld.expand(jsonLd, { + documentLoader: contextLoader, + keepFreeFloatingNodes: true, + }); + for (const _pp_obj of _expanded) { + + { + const _result = await _ppM0["normalizeLinkToImage"](_pp_obj, { + documentLoader, + contextLoader, + tracerProvider, + baseUrl, + }); + if (_result instanceof Error) throw _result; + if (_result !== undefined) return _result as Image; + } + + } + try { return await Image.fromJsonLd( jsonLd, @@ -3743,7 +3792,11 @@ get names(): ((string | LanguageString))[] { "icon"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#icon_fromJsonLd(doc, options); + v = await this.#icon_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -3839,7 +3892,11 @@ get names(): ((string | LanguageString))[] { "icon"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#icon_fromJsonLd(obj, options); + v = await this.#icon_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -3977,6 +4034,25 @@ get names(): ((string | LanguageString))[] { this._tracerProvider ?? trace.getTracerProvider(); const baseUrl = options.baseUrl; + const _expanded = await jsonld.expand(jsonLd, { + documentLoader: contextLoader, + keepFreeFloatingNodes: true, + }); + for (const _pp_obj of _expanded) { + + { + const _result = await _ppM0["normalizeLinkToImage"](_pp_obj, { + documentLoader, + contextLoader, + tracerProvider, + baseUrl, + }); + if (_result instanceof Error) throw _result; + if (_result !== undefined) return _result as Image; + } + + } + try { return await Image.fromJsonLd( jsonLd, @@ -4057,7 +4133,11 @@ get names(): ((string | LanguageString))[] { "image"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#image_fromJsonLd(doc, options); + v = await this.#image_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -4153,7 +4233,11 @@ get names(): ((string | LanguageString))[] { "image"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#image_fromJsonLd(obj, options); + v = await this.#image_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -4379,7 +4463,11 @@ get names(): ((string | LanguageString))[] { "inReplyTo"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#replyTarget_fromJsonLd(doc, options); + v = await this.#replyTarget_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -4474,7 +4562,11 @@ get names(): ((string | LanguageString))[] { "inReplyTo"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#replyTarget_fromJsonLd(obj, options); + v = await this.#replyTarget_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -4700,7 +4792,11 @@ get names(): ((string | LanguageString))[] { "location"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#location_fromJsonLd(doc, options); + v = await this.#location_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -4795,7 +4891,11 @@ get names(): ((string | LanguageString))[] { "location"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#location_fromJsonLd(obj, options); + v = await this.#location_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -5020,7 +5120,11 @@ get names(): ((string | LanguageString))[] { "preview"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#preview_fromJsonLd(doc, options); + v = await this.#preview_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -5114,7 +5218,11 @@ get names(): ((string | LanguageString))[] { "preview"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#preview_fromJsonLd(obj, options); + v = await this.#preview_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -5344,7 +5452,11 @@ get names(): ((string | LanguageString))[] { "replies"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#replies_fromJsonLd(doc, options); + v = await this.#replies_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -5566,7 +5678,11 @@ get names(): ((string | LanguageString))[] { "shares"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#shares_fromJsonLd(doc, options); + v = await this.#shares_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -5788,7 +5904,11 @@ get names(): ((string | LanguageString))[] { "likes"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#likes_fromJsonLd(doc, options); + v = await this.#likes_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -6004,7 +6124,11 @@ get names(): ((string | LanguageString))[] { "emojiReactions"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#emojiReactions_fromJsonLd(doc, options); + v = await this.#emojiReactions_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -6272,7 +6396,11 @@ get summaries(): ((string | LanguageString))[] { "tag"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#tag_fromJsonLd(obj, options); + v = await this.#tag_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -6523,7 +6651,11 @@ get urls(): ((URL | Link))[] { "to"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#to_fromJsonLd(doc, options); + v = await this.#to_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -6618,7 +6750,11 @@ get urls(): ((URL | Link))[] { "to"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#to_fromJsonLd(obj, options); + v = await this.#to_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -6835,7 +6971,11 @@ get urls(): ((URL | Link))[] { "bto"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#bto_fromJsonLd(doc, options); + v = await this.#bto_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -6930,7 +7070,11 @@ get urls(): ((URL | Link))[] { "bto"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#bto_fromJsonLd(obj, options); + v = await this.#bto_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -7147,7 +7291,11 @@ get urls(): ((URL | Link))[] { "cc"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#cc_fromJsonLd(doc, options); + v = await this.#cc_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -7242,7 +7390,11 @@ get urls(): ((URL | Link))[] { "cc"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#cc_fromJsonLd(obj, options); + v = await this.#cc_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -7459,7 +7611,11 @@ get urls(): ((URL | Link))[] { "bcc"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#bcc_fromJsonLd(doc, options); + v = await this.#bcc_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -7554,7 +7710,11 @@ get urls(): ((URL | Link))[] { "bcc"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#bcc_fromJsonLd(obj, options); + v = await this.#bcc_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -7834,7 +7994,11 @@ get urls(): ((URL | Link))[] { "proof"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#proof_fromJsonLd(doc, options); + v = await this.#proof_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -7928,7 +8092,11 @@ get urls(): ((URL | Link))[] { "proof"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#proof_fromJsonLd(obj, options); + v = await this.#proof_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -8184,7 +8352,11 @@ get urls(): ((URL | Link))[] { "likeAuthorization"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#likeAuthorization_fromJsonLd(doc, options); + v = await this.#likeAuthorization_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -8400,7 +8572,11 @@ get urls(): ((URL | Link))[] { "replyAuthorization"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#replyAuthorization_fromJsonLd(doc, options); + v = await this.#replyAuthorization_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -8616,7 +8792,11 @@ get urls(): ((URL | Link))[] { "announceAuthorization"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#announceAuthorization_fromJsonLd(doc, options); + v = await this.#announceAuthorization_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -10164,9 +10344,14 @@ get urls(): ((URL | Link))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -10465,16 +10650,16 @@ get urls(): ((URL | Link))[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Object","http://joinmastodon.org/ns#Emoji","http://litepub.social/ns#ChatMessage","https://gotosocial.org/ns#AnnounceAuthorization","https://gotosocial.org/ns#LikeApproval","https://gotosocial.org/ns#ReplyAuthorization","https://w3id.org/fep/044f#QuoteAuthorization","https://w3id.org/valueflows/ont/vf#Proposal","https://www.w3.org/ns/activitystreams#Activity","http://litepub.social/ns#EmojiReact","https://gotosocial.org/ns#AnnounceRequest","https://gotosocial.org/ns#LikeRequest","https://gotosocial.org/ns#ReplyRequest","https://w3id.org/fep/044f#QuoteRequest","https://www.w3.org/ns/activitystreams#Accept","https://www.w3.org/ns/activitystreams#TentativeAccept","https://www.w3.org/ns/activitystreams#Add","https://www.w3.org/ns/activitystreams#Announce","https://www.w3.org/ns/activitystreams#Create","https://www.w3.org/ns/activitystreams#Delete","https://www.w3.org/ns/activitystreams#Dislike","https://www.w3.org/ns/activitystreams#Flag","https://www.w3.org/ns/activitystreams#Follow","https://www.w3.org/ns/activitystreams#Ignore","https://www.w3.org/ns/activitystreams#Block","https://www.w3.org/ns/activitystreams#IntransitiveActivity","https://www.w3.org/ns/activitystreams#Arrive","https://www.w3.org/ns/activitystreams#Question","https://www.w3.org/ns/activitystreams#Travel","https://www.w3.org/ns/activitystreams#Join","https://www.w3.org/ns/activitystreams#Leave","https://www.w3.org/ns/activitystreams#Like","https://www.w3.org/ns/activitystreams#Listen","https://www.w3.org/ns/activitystreams#Move","https://www.w3.org/ns/activitystreams#Offer","https://www.w3.org/ns/activitystreams#Invite","https://www.w3.org/ns/activitystreams#Read","https://www.w3.org/ns/activitystreams#Reject","https://www.w3.org/ns/activitystreams#TentativeReject","https://www.w3.org/ns/activitystreams#Remove","https://www.w3.org/ns/activitystreams#Undo","https://www.w3.org/ns/activitystreams#Update","https://www.w3.org/ns/activitystreams#View","https://www.w3.org/ns/activitystreams#Application","https://www.w3.org/ns/activitystreams#Article","https://www.w3.org/ns/activitystreams#Collection","https://www.w3.org/ns/activitystreams#CollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollection","https://www.w3.org/ns/activitystreams#Document","https://www.w3.org/ns/activitystreams#Audio","https://www.w3.org/ns/activitystreams#Image","https://www.w3.org/ns/activitystreams#Page","https://www.w3.org/ns/activitystreams#Video","https://www.w3.org/ns/activitystreams#Event","https://www.w3.org/ns/activitystreams#Group","https://www.w3.org/ns/activitystreams#Note","https://www.w3.org/ns/activitystreams#Organization","https://www.w3.org/ns/activitystreams#Person","https://www.w3.org/ns/activitystreams#Place","https://www.w3.org/ns/activitystreams#Profile","https://www.w3.org/ns/activitystreams#Relationship","https://www.w3.org/ns/activitystreams#Service","https://www.w3.org/ns/activitystreams#Tombstone"].some( t => v["@type"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("http://schema.org#PropertyValue") ? await PropertyValue.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -10511,23 +10696,23 @@ get urls(): ((URL | Link))[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -10562,7 +10747,7 @@ get urls(): ((URL | Link))[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.push(decoded); @@ -10622,12 +10807,12 @@ get urls(): ((URL | Link))[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Object","http://joinmastodon.org/ns#Emoji","http://litepub.social/ns#ChatMessage","https://gotosocial.org/ns#AnnounceAuthorization","https://gotosocial.org/ns#LikeApproval","https://gotosocial.org/ns#ReplyAuthorization","https://w3id.org/fep/044f#QuoteAuthorization","https://w3id.org/valueflows/ont/vf#Proposal","https://www.w3.org/ns/activitystreams#Activity","http://litepub.social/ns#EmojiReact","https://gotosocial.org/ns#AnnounceRequest","https://gotosocial.org/ns#LikeRequest","https://gotosocial.org/ns#ReplyRequest","https://w3id.org/fep/044f#QuoteRequest","https://www.w3.org/ns/activitystreams#Accept","https://www.w3.org/ns/activitystreams#TentativeAccept","https://www.w3.org/ns/activitystreams#Add","https://www.w3.org/ns/activitystreams#Announce","https://www.w3.org/ns/activitystreams#Create","https://www.w3.org/ns/activitystreams#Delete","https://www.w3.org/ns/activitystreams#Dislike","https://www.w3.org/ns/activitystreams#Flag","https://www.w3.org/ns/activitystreams#Follow","https://www.w3.org/ns/activitystreams#Ignore","https://www.w3.org/ns/activitystreams#Block","https://www.w3.org/ns/activitystreams#IntransitiveActivity","https://www.w3.org/ns/activitystreams#Arrive","https://www.w3.org/ns/activitystreams#Question","https://www.w3.org/ns/activitystreams#Travel","https://www.w3.org/ns/activitystreams#Join","https://www.w3.org/ns/activitystreams#Leave","https://www.w3.org/ns/activitystreams#Like","https://www.w3.org/ns/activitystreams#Listen","https://www.w3.org/ns/activitystreams#Move","https://www.w3.org/ns/activitystreams#Offer","https://www.w3.org/ns/activitystreams#Invite","https://www.w3.org/ns/activitystreams#Read","https://www.w3.org/ns/activitystreams#Reject","https://www.w3.org/ns/activitystreams#TentativeReject","https://www.w3.org/ns/activitystreams#Remove","https://www.w3.org/ns/activitystreams#Undo","https://www.w3.org/ns/activitystreams#Update","https://www.w3.org/ns/activitystreams#View","https://www.w3.org/ns/activitystreams#Application","https://www.w3.org/ns/activitystreams#Article","https://www.w3.org/ns/activitystreams#Collection","https://www.w3.org/ns/activitystreams#CollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollection","https://www.w3.org/ns/activitystreams#Document","https://www.w3.org/ns/activitystreams#Audio","https://www.w3.org/ns/activitystreams#Image","https://www.w3.org/ns/activitystreams#Page","https://www.w3.org/ns/activitystreams#Video","https://www.w3.org/ns/activitystreams#Event","https://www.w3.org/ns/activitystreams#Group","https://www.w3.org/ns/activitystreams#Note","https://www.w3.org/ns/activitystreams#Organization","https://www.w3.org/ns/activitystreams#Person","https://www.w3.org/ns/activitystreams#Place","https://www.w3.org/ns/activitystreams#Profile","https://www.w3.org/ns/activitystreams#Relationship","https://www.w3.org/ns/activitystreams#Service","https://www.w3.org/ns/activitystreams#Tombstone"].some( t => v["@type"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -10711,12 +10896,12 @@ get urls(): ((URL | Link))[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Object","http://joinmastodon.org/ns#Emoji","http://litepub.social/ns#ChatMessage","https://gotosocial.org/ns#AnnounceAuthorization","https://gotosocial.org/ns#LikeApproval","https://gotosocial.org/ns#ReplyAuthorization","https://w3id.org/fep/044f#QuoteAuthorization","https://w3id.org/valueflows/ont/vf#Proposal","https://www.w3.org/ns/activitystreams#Activity","http://litepub.social/ns#EmojiReact","https://gotosocial.org/ns#AnnounceRequest","https://gotosocial.org/ns#LikeRequest","https://gotosocial.org/ns#ReplyRequest","https://w3id.org/fep/044f#QuoteRequest","https://www.w3.org/ns/activitystreams#Accept","https://www.w3.org/ns/activitystreams#TentativeAccept","https://www.w3.org/ns/activitystreams#Add","https://www.w3.org/ns/activitystreams#Announce","https://www.w3.org/ns/activitystreams#Create","https://www.w3.org/ns/activitystreams#Delete","https://www.w3.org/ns/activitystreams#Dislike","https://www.w3.org/ns/activitystreams#Flag","https://www.w3.org/ns/activitystreams#Follow","https://www.w3.org/ns/activitystreams#Ignore","https://www.w3.org/ns/activitystreams#Block","https://www.w3.org/ns/activitystreams#IntransitiveActivity","https://www.w3.org/ns/activitystreams#Arrive","https://www.w3.org/ns/activitystreams#Question","https://www.w3.org/ns/activitystreams#Travel","https://www.w3.org/ns/activitystreams#Join","https://www.w3.org/ns/activitystreams#Leave","https://www.w3.org/ns/activitystreams#Like","https://www.w3.org/ns/activitystreams#Listen","https://www.w3.org/ns/activitystreams#Move","https://www.w3.org/ns/activitystreams#Offer","https://www.w3.org/ns/activitystreams#Invite","https://www.w3.org/ns/activitystreams#Read","https://www.w3.org/ns/activitystreams#Reject","https://www.w3.org/ns/activitystreams#TentativeReject","https://www.w3.org/ns/activitystreams#Remove","https://www.w3.org/ns/activitystreams#Undo","https://www.w3.org/ns/activitystreams#Update","https://www.w3.org/ns/activitystreams#View","https://www.w3.org/ns/activitystreams#Application","https://www.w3.org/ns/activitystreams#Article","https://www.w3.org/ns/activitystreams#Collection","https://www.w3.org/ns/activitystreams#CollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollection","https://www.w3.org/ns/activitystreams#Document","https://www.w3.org/ns/activitystreams#Audio","https://www.w3.org/ns/activitystreams#Image","https://www.w3.org/ns/activitystreams#Page","https://www.w3.org/ns/activitystreams#Video","https://www.w3.org/ns/activitystreams#Event","https://www.w3.org/ns/activitystreams#Group","https://www.w3.org/ns/activitystreams#Note","https://www.w3.org/ns/activitystreams#Organization","https://www.w3.org/ns/activitystreams#Person","https://www.w3.org/ns/activitystreams#Place","https://www.w3.org/ns/activitystreams#Profile","https://www.w3.org/ns/activitystreams#Relationship","https://www.w3.org/ns/activitystreams#Service","https://www.w3.org/ns/activitystreams#Tombstone"].some( t => v["@type"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -10739,6 +10924,28 @@ get urls(): ((URL | Link))[] { ) { if (v == null) continue; + { + let _handled: Image | undefined; + + if (_handled === undefined) { + const _result = await _ppM0["normalizeLinkToImage"](v, { + documentLoader: options.documentLoader, + contextLoader: options.contextLoader, + tracerProvider: options.tracerProvider, + baseUrl: _baseUrl, + }); + if (_result instanceof Error) throw _result; + if (_result !== undefined) { + _handled = _result as Image; + } + } + + if (_handled !== undefined) { + _33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.push(_handled); + continue; + } + } + if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { _33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.push( @@ -10751,7 +10958,7 @@ get urls(): ((URL | Link))[] { const decoded = await Image.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.push(decoded); @@ -10772,6 +10979,28 @@ get urls(): ((URL | Link))[] { ) { if (v == null) continue; + { + let _handled: Image | undefined; + + if (_handled === undefined) { + const _result = await _ppM0["normalizeLinkToImage"](v, { + documentLoader: options.documentLoader, + contextLoader: options.contextLoader, + tracerProvider: options.tracerProvider, + baseUrl: _baseUrl, + }); + if (_result instanceof Error) throw _result; + if (_result !== undefined) { + _handled = _result as Image; + } + } + + if (_handled !== undefined) { + _3dXrUdkARxwyJLtJcYi1AJ92H41U_image.push(_handled); + continue; + } + } + if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { _3dXrUdkARxwyJLtJcYi1AJ92H41U_image.push( @@ -10784,7 +11013,7 @@ get urls(): ((URL | Link))[] { const decoded = await Image.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3dXrUdkARxwyJLtJcYi1AJ92H41U_image.push(decoded); @@ -10820,12 +11049,12 @@ get urls(): ((URL | Link))[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Object","http://joinmastodon.org/ns#Emoji","http://litepub.social/ns#ChatMessage","https://gotosocial.org/ns#AnnounceAuthorization","https://gotosocial.org/ns#LikeApproval","https://gotosocial.org/ns#ReplyAuthorization","https://w3id.org/fep/044f#QuoteAuthorization","https://w3id.org/valueflows/ont/vf#Proposal","https://www.w3.org/ns/activitystreams#Activity","http://litepub.social/ns#EmojiReact","https://gotosocial.org/ns#AnnounceRequest","https://gotosocial.org/ns#LikeRequest","https://gotosocial.org/ns#ReplyRequest","https://w3id.org/fep/044f#QuoteRequest","https://www.w3.org/ns/activitystreams#Accept","https://www.w3.org/ns/activitystreams#TentativeAccept","https://www.w3.org/ns/activitystreams#Add","https://www.w3.org/ns/activitystreams#Announce","https://www.w3.org/ns/activitystreams#Create","https://www.w3.org/ns/activitystreams#Delete","https://www.w3.org/ns/activitystreams#Dislike","https://www.w3.org/ns/activitystreams#Flag","https://www.w3.org/ns/activitystreams#Follow","https://www.w3.org/ns/activitystreams#Ignore","https://www.w3.org/ns/activitystreams#Block","https://www.w3.org/ns/activitystreams#IntransitiveActivity","https://www.w3.org/ns/activitystreams#Arrive","https://www.w3.org/ns/activitystreams#Question","https://www.w3.org/ns/activitystreams#Travel","https://www.w3.org/ns/activitystreams#Join","https://www.w3.org/ns/activitystreams#Leave","https://www.w3.org/ns/activitystreams#Like","https://www.w3.org/ns/activitystreams#Listen","https://www.w3.org/ns/activitystreams#Move","https://www.w3.org/ns/activitystreams#Offer","https://www.w3.org/ns/activitystreams#Invite","https://www.w3.org/ns/activitystreams#Read","https://www.w3.org/ns/activitystreams#Reject","https://www.w3.org/ns/activitystreams#TentativeReject","https://www.w3.org/ns/activitystreams#Remove","https://www.w3.org/ns/activitystreams#Undo","https://www.w3.org/ns/activitystreams#Update","https://www.w3.org/ns/activitystreams#View","https://www.w3.org/ns/activitystreams#Application","https://www.w3.org/ns/activitystreams#Article","https://www.w3.org/ns/activitystreams#Collection","https://www.w3.org/ns/activitystreams#CollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollection","https://www.w3.org/ns/activitystreams#Document","https://www.w3.org/ns/activitystreams#Audio","https://www.w3.org/ns/activitystreams#Image","https://www.w3.org/ns/activitystreams#Page","https://www.w3.org/ns/activitystreams#Video","https://www.w3.org/ns/activitystreams#Event","https://www.w3.org/ns/activitystreams#Group","https://www.w3.org/ns/activitystreams#Note","https://www.w3.org/ns/activitystreams#Organization","https://www.w3.org/ns/activitystreams#Person","https://www.w3.org/ns/activitystreams#Place","https://www.w3.org/ns/activitystreams#Profile","https://www.w3.org/ns/activitystreams#Relationship","https://www.w3.org/ns/activitystreams#Service","https://www.w3.org/ns/activitystreams#Tombstone"].some( t => v["@type"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -10863,12 +11092,12 @@ get urls(): ((URL | Link))[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Object","http://joinmastodon.org/ns#Emoji","http://litepub.social/ns#ChatMessage","https://gotosocial.org/ns#AnnounceAuthorization","https://gotosocial.org/ns#LikeApproval","https://gotosocial.org/ns#ReplyAuthorization","https://w3id.org/fep/044f#QuoteAuthorization","https://w3id.org/valueflows/ont/vf#Proposal","https://www.w3.org/ns/activitystreams#Activity","http://litepub.social/ns#EmojiReact","https://gotosocial.org/ns#AnnounceRequest","https://gotosocial.org/ns#LikeRequest","https://gotosocial.org/ns#ReplyRequest","https://w3id.org/fep/044f#QuoteRequest","https://www.w3.org/ns/activitystreams#Accept","https://www.w3.org/ns/activitystreams#TentativeAccept","https://www.w3.org/ns/activitystreams#Add","https://www.w3.org/ns/activitystreams#Announce","https://www.w3.org/ns/activitystreams#Create","https://www.w3.org/ns/activitystreams#Delete","https://www.w3.org/ns/activitystreams#Dislike","https://www.w3.org/ns/activitystreams#Flag","https://www.w3.org/ns/activitystreams#Follow","https://www.w3.org/ns/activitystreams#Ignore","https://www.w3.org/ns/activitystreams#Block","https://www.w3.org/ns/activitystreams#IntransitiveActivity","https://www.w3.org/ns/activitystreams#Arrive","https://www.w3.org/ns/activitystreams#Question","https://www.w3.org/ns/activitystreams#Travel","https://www.w3.org/ns/activitystreams#Join","https://www.w3.org/ns/activitystreams#Leave","https://www.w3.org/ns/activitystreams#Like","https://www.w3.org/ns/activitystreams#Listen","https://www.w3.org/ns/activitystreams#Move","https://www.w3.org/ns/activitystreams#Offer","https://www.w3.org/ns/activitystreams#Invite","https://www.w3.org/ns/activitystreams#Read","https://www.w3.org/ns/activitystreams#Reject","https://www.w3.org/ns/activitystreams#TentativeReject","https://www.w3.org/ns/activitystreams#Remove","https://www.w3.org/ns/activitystreams#Undo","https://www.w3.org/ns/activitystreams#Update","https://www.w3.org/ns/activitystreams#View","https://www.w3.org/ns/activitystreams#Application","https://www.w3.org/ns/activitystreams#Article","https://www.w3.org/ns/activitystreams#Collection","https://www.w3.org/ns/activitystreams#CollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollection","https://www.w3.org/ns/activitystreams#Document","https://www.w3.org/ns/activitystreams#Audio","https://www.w3.org/ns/activitystreams#Image","https://www.w3.org/ns/activitystreams#Page","https://www.w3.org/ns/activitystreams#Video","https://www.w3.org/ns/activitystreams#Event","https://www.w3.org/ns/activitystreams#Group","https://www.w3.org/ns/activitystreams#Note","https://www.w3.org/ns/activitystreams#Organization","https://www.w3.org/ns/activitystreams#Person","https://www.w3.org/ns/activitystreams#Place","https://www.w3.org/ns/activitystreams#Profile","https://www.w3.org/ns/activitystreams#Relationship","https://www.w3.org/ns/activitystreams#Service","https://www.w3.org/ns/activitystreams#Tombstone"].some( t => v["@type"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -10906,12 +11135,12 @@ get urls(): ((URL | Link))[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Object","http://joinmastodon.org/ns#Emoji","http://litepub.social/ns#ChatMessage","https://gotosocial.org/ns#AnnounceAuthorization","https://gotosocial.org/ns#LikeApproval","https://gotosocial.org/ns#ReplyAuthorization","https://w3id.org/fep/044f#QuoteAuthorization","https://w3id.org/valueflows/ont/vf#Proposal","https://www.w3.org/ns/activitystreams#Activity","http://litepub.social/ns#EmojiReact","https://gotosocial.org/ns#AnnounceRequest","https://gotosocial.org/ns#LikeRequest","https://gotosocial.org/ns#ReplyRequest","https://w3id.org/fep/044f#QuoteRequest","https://www.w3.org/ns/activitystreams#Accept","https://www.w3.org/ns/activitystreams#TentativeAccept","https://www.w3.org/ns/activitystreams#Add","https://www.w3.org/ns/activitystreams#Announce","https://www.w3.org/ns/activitystreams#Create","https://www.w3.org/ns/activitystreams#Delete","https://www.w3.org/ns/activitystreams#Dislike","https://www.w3.org/ns/activitystreams#Flag","https://www.w3.org/ns/activitystreams#Follow","https://www.w3.org/ns/activitystreams#Ignore","https://www.w3.org/ns/activitystreams#Block","https://www.w3.org/ns/activitystreams#IntransitiveActivity","https://www.w3.org/ns/activitystreams#Arrive","https://www.w3.org/ns/activitystreams#Question","https://www.w3.org/ns/activitystreams#Travel","https://www.w3.org/ns/activitystreams#Join","https://www.w3.org/ns/activitystreams#Leave","https://www.w3.org/ns/activitystreams#Like","https://www.w3.org/ns/activitystreams#Listen","https://www.w3.org/ns/activitystreams#Move","https://www.w3.org/ns/activitystreams#Offer","https://www.w3.org/ns/activitystreams#Invite","https://www.w3.org/ns/activitystreams#Read","https://www.w3.org/ns/activitystreams#Reject","https://www.w3.org/ns/activitystreams#TentativeReject","https://www.w3.org/ns/activitystreams#Remove","https://www.w3.org/ns/activitystreams#Undo","https://www.w3.org/ns/activitystreams#Update","https://www.w3.org/ns/activitystreams#View","https://www.w3.org/ns/activitystreams#Application","https://www.w3.org/ns/activitystreams#Article","https://www.w3.org/ns/activitystreams#Collection","https://www.w3.org/ns/activitystreams#CollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollection","https://www.w3.org/ns/activitystreams#Document","https://www.w3.org/ns/activitystreams#Audio","https://www.w3.org/ns/activitystreams#Image","https://www.w3.org/ns/activitystreams#Page","https://www.w3.org/ns/activitystreams#Video","https://www.w3.org/ns/activitystreams#Event","https://www.w3.org/ns/activitystreams#Group","https://www.w3.org/ns/activitystreams#Note","https://www.w3.org/ns/activitystreams#Organization","https://www.w3.org/ns/activitystreams#Person","https://www.w3.org/ns/activitystreams#Place","https://www.w3.org/ns/activitystreams#Profile","https://www.w3.org/ns/activitystreams#Relationship","https://www.w3.org/ns/activitystreams#Service","https://www.w3.org/ns/activitystreams#Tombstone"].some( t => v["@type"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -10968,7 +11197,7 @@ get urls(): ((URL | Link))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _7UpwM3JWcXhADcscukEehBorf6k_replies.push(decoded); @@ -11001,7 +11230,7 @@ get urls(): ((URL | Link))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3kAfck9PcEYt2L7xug5y99YPbANs_shares.push(decoded); @@ -11034,7 +11263,7 @@ get urls(): ((URL | Link))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.push(decoded); @@ -11067,7 +11296,7 @@ get urls(): ((URL | Link))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.push(decoded); @@ -11149,12 +11378,12 @@ get urls(): ((URL | Link))[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Object","http://joinmastodon.org/ns#Emoji","http://litepub.social/ns#ChatMessage","https://gotosocial.org/ns#AnnounceAuthorization","https://gotosocial.org/ns#LikeApproval","https://gotosocial.org/ns#ReplyAuthorization","https://w3id.org/fep/044f#QuoteAuthorization","https://w3id.org/valueflows/ont/vf#Proposal","https://www.w3.org/ns/activitystreams#Activity","http://litepub.social/ns#EmojiReact","https://gotosocial.org/ns#AnnounceRequest","https://gotosocial.org/ns#LikeRequest","https://gotosocial.org/ns#ReplyRequest","https://w3id.org/fep/044f#QuoteRequest","https://www.w3.org/ns/activitystreams#Accept","https://www.w3.org/ns/activitystreams#TentativeAccept","https://www.w3.org/ns/activitystreams#Add","https://www.w3.org/ns/activitystreams#Announce","https://www.w3.org/ns/activitystreams#Create","https://www.w3.org/ns/activitystreams#Delete","https://www.w3.org/ns/activitystreams#Dislike","https://www.w3.org/ns/activitystreams#Flag","https://www.w3.org/ns/activitystreams#Follow","https://www.w3.org/ns/activitystreams#Ignore","https://www.w3.org/ns/activitystreams#Block","https://www.w3.org/ns/activitystreams#IntransitiveActivity","https://www.w3.org/ns/activitystreams#Arrive","https://www.w3.org/ns/activitystreams#Question","https://www.w3.org/ns/activitystreams#Travel","https://www.w3.org/ns/activitystreams#Join","https://www.w3.org/ns/activitystreams#Leave","https://www.w3.org/ns/activitystreams#Like","https://www.w3.org/ns/activitystreams#Listen","https://www.w3.org/ns/activitystreams#Move","https://www.w3.org/ns/activitystreams#Offer","https://www.w3.org/ns/activitystreams#Invite","https://www.w3.org/ns/activitystreams#Read","https://www.w3.org/ns/activitystreams#Reject","https://www.w3.org/ns/activitystreams#TentativeReject","https://www.w3.org/ns/activitystreams#Remove","https://www.w3.org/ns/activitystreams#Undo","https://www.w3.org/ns/activitystreams#Update","https://www.w3.org/ns/activitystreams#View","https://www.w3.org/ns/activitystreams#Application","https://www.w3.org/ns/activitystreams#Article","https://www.w3.org/ns/activitystreams#Collection","https://www.w3.org/ns/activitystreams#CollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollection","https://www.w3.org/ns/activitystreams#Document","https://www.w3.org/ns/activitystreams#Audio","https://www.w3.org/ns/activitystreams#Image","https://www.w3.org/ns/activitystreams#Page","https://www.w3.org/ns/activitystreams#Video","https://www.w3.org/ns/activitystreams#Event","https://www.w3.org/ns/activitystreams#Group","https://www.w3.org/ns/activitystreams#Note","https://www.w3.org/ns/activitystreams#Organization","https://www.w3.org/ns/activitystreams#Person","https://www.w3.org/ns/activitystreams#Place","https://www.w3.org/ns/activitystreams#Profile","https://www.w3.org/ns/activitystreams#Relationship","https://www.w3.org/ns/activitystreams#Service","https://www.w3.org/ns/activitystreams#Tombstone"].some( t => v["@type"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -11213,13 +11442,13 @@ get urls(): ((URL | Link))[] { : "" ) ) - : URL.canParse(v["@id"]) && (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) + : URL.canParse(v["@id"]) && _baseUrl ? new URL(v["@id"]) - : new URL(v["@id"], (values["@id"] == null ? options.baseUrl : new URL(values["@id"]))) : typeof v === "object" && "@type" in v + : new URL(v["@id"], _baseUrl) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -11254,7 +11483,7 @@ get urls(): ((URL | Link))[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.push(decoded); @@ -11287,7 +11516,7 @@ get urls(): ((URL | Link))[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.push(decoded); @@ -11320,7 +11549,7 @@ get urls(): ((URL | Link))[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.push(decoded); @@ -11353,7 +11582,7 @@ get urls(): ((URL | Link))[] { const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.push(decoded); @@ -11428,7 +11657,7 @@ get urls(): ((URL | Link))[] { const decoded = await Source.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2ZwCFoS787v8y8bXKjMoE6MAbrEB_source.push(decoded); @@ -11461,7 +11690,7 @@ get urls(): ((URL | Link))[] { const decoded = await DataIntegrityProof.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.push(decoded); @@ -11482,7 +11711,7 @@ get urls(): ((URL | Link))[] { const decoded = await InteractionPolicy.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2MHQfh2N74MMmDLDqYWFo7TxYQK2_interactionPolicy.push(decoded); @@ -11514,9 +11743,9 @@ get urls(): ((URL | Link))[] { : "" ) ) - : URL.canParse(v["@id"]) && (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) + : URL.canParse(v["@id"]) && _baseUrl ? new URL(v["@id"]) - : new URL(v["@id"], (values["@id"] == null ? options.baseUrl : new URL(values["@id"]))); + : new URL(v["@id"], _baseUrl); if (typeof decoded === "undefined") continue; _23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy.push(decoded); } @@ -11548,7 +11777,7 @@ get urls(): ((URL | Link))[] { const decoded = await LikeAuthorization.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.push(decoded); @@ -11581,7 +11810,7 @@ get urls(): ((URL | Link))[] { const decoded = await ReplyAuthorization.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.push(decoded); @@ -11614,7 +11843,7 @@ get urls(): ((URL | Link))[] { const decoded = await AnnounceAuthorization.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.push(decoded); @@ -12792,9 +13021,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -13229,7 +13463,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "quote"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#quote_fromJsonLd(doc, options); + v = await this.#quote_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -13468,7 +13706,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "quoteAuthorization"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#quoteAuthorization_fromJsonLd(doc, options); + v = await this.#quoteAuthorization_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -13790,9 +14032,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -13841,7 +14088,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push(decoded); @@ -13900,7 +14147,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await QuoteAuthorization.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push(decoded); @@ -14846,7 +15093,11 @@ instruments?: (Object | URL)[];} "actor"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#actor_fromJsonLd(doc, options); + v = await this.#actor_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -14942,7 +15193,11 @@ instruments?: (Object | URL)[];} "actor"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#actor_fromJsonLd(obj, options); + v = await this.#actor_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -15160,7 +15415,11 @@ instruments?: (Object | URL)[];} "object"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#object_fromJsonLd(doc, options); + v = await this.#object_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -15256,7 +15515,11 @@ instruments?: (Object | URL)[];} "object"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#object_fromJsonLd(obj, options); + v = await this.#object_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -15477,7 +15740,11 @@ instruments?: (Object | URL)[];} "target"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#target_fromJsonLd(doc, options); + v = await this.#target_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -15576,7 +15843,11 @@ instruments?: (Object | URL)[];} "target"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#target_fromJsonLd(obj, options); + v = await this.#target_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -15794,7 +16065,11 @@ instruments?: (Object | URL)[];} "result"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#result_fromJsonLd(doc, options); + v = await this.#result_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -15890,7 +16165,11 @@ instruments?: (Object | URL)[];} "result"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#result_fromJsonLd(obj, options); + v = await this.#result_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -16109,7 +16388,11 @@ instruments?: (Object | URL)[];} "origin"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#origin_fromJsonLd(doc, options); + v = await this.#origin_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -16206,7 +16489,11 @@ instruments?: (Object | URL)[];} "origin"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#origin_fromJsonLd(obj, options); + v = await this.#origin_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -16423,7 +16710,11 @@ instruments?: (Object | URL)[];} "instrument"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#instrument_fromJsonLd(doc, options); + v = await this.#instrument_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -16518,7 +16809,11 @@ instruments?: (Object | URL)[];} "instrument"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#instrument_fromJsonLd(obj, options); + v = await this.#instrument_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -16799,9 +17094,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -16988,23 +17288,23 @@ instruments?: (Object | URL)[];} typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -17039,7 +17339,7 @@ instruments?: (Object | URL)[];} const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.push(decoded); @@ -17072,7 +17372,7 @@ instruments?: (Object | URL)[];} const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.push(decoded); @@ -17105,7 +17405,7 @@ instruments?: (Object | URL)[];} const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.push(decoded); @@ -17138,7 +17438,7 @@ instruments?: (Object | URL)[];} const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _25zu2s3VxVujgEKqrDycjE284XQR_origin.push(decoded); @@ -17171,7 +17471,7 @@ instruments?: (Object | URL)[];} const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.push(decoded); @@ -17642,9 +17942,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -18145,9 +18450,14 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -18731,9 +19041,14 @@ unit?: string | null;numericalValue?: Decimal | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -19230,7 +19545,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "interactingObject"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#interactingObject_fromJsonLd(doc, options); + v = await this.#interactingObject_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -19445,7 +19764,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "interactionTarget"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#interactionTarget_fromJsonLd(doc, options); + v = await this.#interactionTarget_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -19722,9 +20045,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -19773,7 +20101,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push(decoded); @@ -19806,7 +20134,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push(decoded); @@ -20171,9 +20499,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -20762,9 +21095,14 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -20796,7 +21134,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike.push(decoded); @@ -20817,7 +21155,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2UBgLRi5p3DRGGvWyB227i4Qjhzd_canReply.push(decoded); @@ -20838,7 +21176,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _fu5nmoAj528fBQfnxhY9Daok3Vi_canAnnounce.push(decoded); @@ -20859,7 +21197,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const decoded = await InteractionRule.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _LE3zBTVacTZw2LSyLt4wVUkXeUy_canQuote.push(decoded); @@ -21510,9 +21848,14 @@ get manualApprovals(): (URL)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -21555,9 +21898,9 @@ get manualApprovals(): (URL)[] { : "" ) ) - : URL.canParse(v["@id"]) && (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) + : URL.canParse(v["@id"]) && _baseUrl ? new URL(v["@id"]) - : new URL(v["@id"], (values["@id"] == null ? options.baseUrl : new URL(values["@id"]))); + : new URL(v["@id"], _baseUrl); if (typeof decoded === "undefined") continue; _2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.push(decoded); } @@ -21588,9 +21931,9 @@ get manualApprovals(): (URL)[] { : "" ) ) - : URL.canParse(v["@id"]) && (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) + : URL.canParse(v["@id"]) && _baseUrl ? new URL(v["@id"]) - : new URL(v["@id"], (values["@id"] == null ? options.baseUrl : new URL(values["@id"]))); + : new URL(v["@id"], _baseUrl); if (typeof decoded === "undefined") continue; _sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval.push(decoded); } @@ -22050,7 +22393,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "interactingObject"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#interactingObject_fromJsonLd(doc, options); + v = await this.#interactingObject_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -22265,7 +22612,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "interactionTarget"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#interactionTarget_fromJsonLd(doc, options); + v = await this.#interactionTarget_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -22542,9 +22893,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -22593,7 +22949,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push(decoded); @@ -22626,7 +22982,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push(decoded); @@ -22990,9 +23346,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -23402,7 +23763,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "interactingObject"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#interactingObject_fromJsonLd(doc, options); + v = await this.#interactingObject_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -23617,7 +23982,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "interactionTarget"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#interactionTarget_fromJsonLd(doc, options); + v = await this.#interactionTarget_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -23894,9 +24263,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -23945,7 +24319,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push(decoded); @@ -23978,7 +24352,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push(decoded); @@ -24342,9 +24716,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -24753,7 +25132,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "interactingObject"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#interactingObject_fromJsonLd(doc, options); + v = await this.#interactingObject_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -24968,7 +25351,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "interactionTarget"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#interactionTarget_fromJsonLd(doc, options); + v = await this.#interactionTarget_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -25245,9 +25632,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -25296,7 +25688,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push(decoded); @@ -25329,7 +25721,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push(decoded); @@ -25693,9 +26085,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -26138,9 +26535,14 @@ get endpoints(): (URL)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -26187,9 +26589,9 @@ get endpoints(): (URL)[] { : "" ) ) - : URL.canParse(v["@id"]) && (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) + : URL.canParse(v["@id"]) && _baseUrl ? new URL(v["@id"]) - : new URL(v["@id"], (values["@id"] == null ? options.baseUrl : new URL(values["@id"]))); + : new URL(v["@id"], _baseUrl); if (typeof decoded === "undefined") continue; _2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.push(decoded); } @@ -26491,9 +26893,14 @@ endpoints?: (URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -27309,9 +27716,14 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -27373,7 +27785,7 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.push(decoded); @@ -27999,7 +28411,11 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi "owner"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#owner_fromJsonLd(doc, options); + v = await this.#owner_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -28274,9 +28690,14 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -28322,23 +28743,23 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -28870,7 +29291,11 @@ controller?: Application | Group | Organization | Person | Service | URL | null; "controller"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#controller_fromJsonLd(doc, options); + v = await this.#controller_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -29152,9 +29577,14 @@ controller?: Application | Group | Organization | Person | Service | URL | null; // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -29200,23 +29630,23 @@ controller?: Application | Group | Organization | Person | Service | URL | null; typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -29987,9 +30417,14 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -30050,9 +30485,9 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur : "" ) ) - : URL.canParse(v["@id"]) && (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) + : URL.canParse(v["@id"]) && _baseUrl ? new URL(v["@id"]) - : new URL(v["@id"], (values["@id"] == null ? options.baseUrl : new URL(values["@id"]))); + : new URL(v["@id"], _baseUrl); if (typeof decoded === "undefined") continue; _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.push(decoded); } @@ -30072,7 +30507,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur const decoded = await Measure.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.push(decoded); @@ -30093,7 +30528,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur const decoded = await Measure.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.push(decoded); @@ -30114,7 +30549,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur const decoded = await Measure.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.push(decoded); @@ -30859,9 +31294,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -30916,7 +31356,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Intent.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.push(decoded); @@ -30937,7 +31377,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Intent.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.push(decoded); @@ -31352,9 +31792,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -31692,9 +32137,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -32027,9 +32477,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -33303,7 +33758,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "publicKey"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#publicKey_fromJsonLd(doc, options); + v = await this.#publicKey_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -33396,7 +33855,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "publicKey"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#publicKey_fromJsonLd(obj, options); + v = await this.#publicKey_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -33615,7 +34078,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "assertionMethod"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#assertionMethod_fromJsonLd(doc, options); + v = await this.#assertionMethod_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -33712,7 +34179,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "assertionMethod"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#assertionMethod_fromJsonLd(obj, options); + v = await this.#assertionMethod_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -33968,7 +34439,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "inbox"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#inbox_fromJsonLd(doc, options); + v = await this.#inbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -34201,7 +34676,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "outbox"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#outbox_fromJsonLd(doc, options); + v = await this.#outbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -34420,7 +34899,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "following"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#following_fromJsonLd(doc, options); + v = await this.#following_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -34642,7 +35125,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "followers"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#followers_fromJsonLd(doc, options); + v = await this.#followers_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -34862,7 +35349,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "liked"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#liked_fromJsonLd(doc, options); + v = await this.#liked_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -35080,7 +35571,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "featured"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#featured_fromJsonLd(doc, options); + v = await this.#featured_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -35298,7 +35793,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "featuredTags"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#featuredTags_fromJsonLd(doc, options); + v = await this.#featuredTags_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -35514,7 +36013,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "streams"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#stream_fromJsonLd(obj, options); + v = await this.#stream_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -35840,7 +36343,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "movedTo"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#successor_fromJsonLd(doc, options); + v = await this.#successor_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -36094,7 +36601,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "alsoKnownAs"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#alias_fromJsonLd(doc, options); + v = await this.#alias_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -36191,7 +36702,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "alsoKnownAs"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#alias_fromJsonLd(obj, options); + v = await this.#alias_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -36410,7 +36925,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "service"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#service_fromJsonLd(doc, options); + v = await this.#service_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -36507,7 +37026,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "service"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#service_fromJsonLd(obj, options); + v = await this.#service_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -37540,9 +38063,14 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -37615,7 +38143,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(decoded); @@ -37648,7 +38176,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); @@ -37701,11 +38229,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollection") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -37742,11 +38270,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollection") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -37781,7 +38309,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(decoded); @@ -37814,7 +38342,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(decoded); @@ -37847,7 +38375,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(decoded); @@ -37880,7 +38408,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(decoded); @@ -37913,7 +38441,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(decoded); @@ -37946,7 +38474,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(decoded); @@ -37967,7 +38495,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.push(decoded); @@ -38074,23 +38602,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -38127,23 +38655,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -38178,7 +38706,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(decoded); @@ -39003,9 +39531,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -39350,9 +39883,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -39782,7 +40320,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "quote"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#quote_fromJsonLd(doc, options); + v = await this.#quote_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -40021,7 +40563,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "quoteAuthorization"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#quoteAuthorization_fromJsonLd(doc, options); + v = await this.#quoteAuthorization_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -40343,9 +40889,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -40394,7 +40945,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push(decoded); @@ -40453,7 +41004,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await QuoteAuthorization.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push(decoded); @@ -40984,9 +41535,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -41413,9 +41969,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -41747,9 +42308,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -42087,9 +42653,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -42842,7 +43413,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "current"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#current_fromJsonLd(doc, options); + v = await this.#current_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -43058,7 +43633,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "first"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#first_fromJsonLd(doc, options); + v = await this.#first_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -43274,7 +43853,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "last"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#last_fromJsonLd(doc, options); + v = await this.#last_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -43500,7 +44083,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "items"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#item_fromJsonLd(obj, options); + v = await this.#item_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -43716,7 +44303,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "likesOf"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#likesOf_fromJsonLd(doc, options); + v = await this.#likesOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -43931,7 +44522,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "sharesOf"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#sharesOf_fromJsonLd(doc, options); + v = await this.#sharesOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -44146,7 +44741,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "repliesOf"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#repliesOf_fromJsonLd(doc, options); + v = await this.#repliesOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -44361,7 +44960,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "inboxOf"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#inboxOf_fromJsonLd(doc, options); + v = await this.#inboxOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -44576,7 +45179,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "outboxOf"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#outboxOf_fromJsonLd(doc, options); + v = await this.#outboxOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -44791,7 +45398,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "followersOf"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#followersOf_fromJsonLd(doc, options); + v = await this.#followersOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -45006,7 +45617,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "followingOf"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#followingOf_fromJsonLd(doc, options); + v = await this.#followingOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -45221,7 +45836,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "likedOf"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#likedOf_fromJsonLd(doc, options); + v = await this.#likedOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -45886,9 +46505,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -45967,7 +46591,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3UyUdxnyn6cDn53QKrh4MBiearma_current.push(decoded); @@ -46000,7 +46624,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _J52RqweMe6hhv7RnLJMC8BExTE5_first.push(decoded); @@ -46033,7 +46657,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.push(decoded); @@ -46069,12 +46693,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Object","http://joinmastodon.org/ns#Emoji","http://litepub.social/ns#ChatMessage","https://gotosocial.org/ns#AnnounceAuthorization","https://gotosocial.org/ns#LikeApproval","https://gotosocial.org/ns#ReplyAuthorization","https://w3id.org/fep/044f#QuoteAuthorization","https://w3id.org/valueflows/ont/vf#Proposal","https://www.w3.org/ns/activitystreams#Activity","http://litepub.social/ns#EmojiReact","https://gotosocial.org/ns#AnnounceRequest","https://gotosocial.org/ns#LikeRequest","https://gotosocial.org/ns#ReplyRequest","https://w3id.org/fep/044f#QuoteRequest","https://www.w3.org/ns/activitystreams#Accept","https://www.w3.org/ns/activitystreams#TentativeAccept","https://www.w3.org/ns/activitystreams#Add","https://www.w3.org/ns/activitystreams#Announce","https://www.w3.org/ns/activitystreams#Create","https://www.w3.org/ns/activitystreams#Delete","https://www.w3.org/ns/activitystreams#Dislike","https://www.w3.org/ns/activitystreams#Flag","https://www.w3.org/ns/activitystreams#Follow","https://www.w3.org/ns/activitystreams#Ignore","https://www.w3.org/ns/activitystreams#Block","https://www.w3.org/ns/activitystreams#IntransitiveActivity","https://www.w3.org/ns/activitystreams#Arrive","https://www.w3.org/ns/activitystreams#Question","https://www.w3.org/ns/activitystreams#Travel","https://www.w3.org/ns/activitystreams#Join","https://www.w3.org/ns/activitystreams#Leave","https://www.w3.org/ns/activitystreams#Like","https://www.w3.org/ns/activitystreams#Listen","https://www.w3.org/ns/activitystreams#Move","https://www.w3.org/ns/activitystreams#Offer","https://www.w3.org/ns/activitystreams#Invite","https://www.w3.org/ns/activitystreams#Read","https://www.w3.org/ns/activitystreams#Reject","https://www.w3.org/ns/activitystreams#TentativeReject","https://www.w3.org/ns/activitystreams#Remove","https://www.w3.org/ns/activitystreams#Undo","https://www.w3.org/ns/activitystreams#Update","https://www.w3.org/ns/activitystreams#View","https://www.w3.org/ns/activitystreams#Application","https://www.w3.org/ns/activitystreams#Article","https://www.w3.org/ns/activitystreams#Collection","https://www.w3.org/ns/activitystreams#CollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollection","https://www.w3.org/ns/activitystreams#Document","https://www.w3.org/ns/activitystreams#Audio","https://www.w3.org/ns/activitystreams#Image","https://www.w3.org/ns/activitystreams#Page","https://www.w3.org/ns/activitystreams#Video","https://www.w3.org/ns/activitystreams#Event","https://www.w3.org/ns/activitystreams#Group","https://www.w3.org/ns/activitystreams#Note","https://www.w3.org/ns/activitystreams#Organization","https://www.w3.org/ns/activitystreams#Person","https://www.w3.org/ns/activitystreams#Place","https://www.w3.org/ns/activitystreams#Profile","https://www.w3.org/ns/activitystreams#Relationship","https://www.w3.org/ns/activitystreams#Service","https://www.w3.org/ns/activitystreams#Tombstone"].some( t => v["@type"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -46109,7 +46733,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.push(decoded); @@ -46142,7 +46766,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.push(decoded); @@ -46175,7 +46799,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.push(decoded); @@ -46208,7 +46832,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.push(decoded); @@ -46241,7 +46865,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.push(decoded); @@ -46274,7 +46898,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.push(decoded); @@ -46307,7 +46931,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.push(decoded); @@ -46340,7 +46964,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.push(decoded); @@ -47020,7 +47644,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "partOf"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#partOf_fromJsonLd(doc, options); + v = await this.#partOf_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -47234,7 +47862,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "next"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#next_fromJsonLd(doc, options); + v = await this.#next_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -47449,7 +48081,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "prev"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#prev_fromJsonLd(doc, options); + v = await this.#prev_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -47761,9 +48397,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -47816,7 +48457,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.push(decoded); @@ -47849,7 +48490,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.push(decoded); @@ -47882,7 +48523,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await CollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.push(decoded); @@ -48256,9 +48897,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -48590,9 +49236,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -48922,9 +49573,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -49716,9 +50372,14 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -49761,9 +50422,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : "" ) ) - : URL.canParse(v["@id"]) && (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) + : URL.canParse(v["@id"]) && _baseUrl ? new URL(v["@id"]) - : new URL(v["@id"], (values["@id"] == null ? options.baseUrl : new URL(values["@id"]))); + : new URL(v["@id"], _baseUrl); if (typeof decoded === "undefined") continue; _2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.push(decoded); } @@ -49794,9 +50455,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : "" ) ) - : URL.canParse(v["@id"]) && (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) + : URL.canParse(v["@id"]) && _baseUrl ? new URL(v["@id"]) - : new URL(v["@id"], (values["@id"] == null ? options.baseUrl : new URL(values["@id"]))); + : new URL(v["@id"], _baseUrl); if (typeof decoded === "undefined") continue; _25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.push(decoded); } @@ -49827,9 +50488,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : "" ) ) - : URL.canParse(v["@id"]) && (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) + : URL.canParse(v["@id"]) && _baseUrl ? new URL(v["@id"]) - : new URL(v["@id"], (values["@id"] == null ? options.baseUrl : new URL(values["@id"]))); + : new URL(v["@id"], _baseUrl); if (typeof decoded === "undefined") continue; _iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.push(decoded); } @@ -49860,9 +50521,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : "" ) ) - : URL.canParse(v["@id"]) && (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) + : URL.canParse(v["@id"]) && _baseUrl ? new URL(v["@id"]) - : new URL(v["@id"], (values["@id"] == null ? options.baseUrl : new URL(values["@id"]))); + : new URL(v["@id"], _baseUrl); if (typeof decoded === "undefined") continue; _8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.push(decoded); } @@ -49893,9 +50554,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : "" ) ) - : URL.canParse(v["@id"]) && (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) + : URL.canParse(v["@id"]) && _baseUrl ? new URL(v["@id"]) - : new URL(v["@id"], (values["@id"] == null ? options.baseUrl : new URL(values["@id"]))); + : new URL(v["@id"], _baseUrl); if (typeof decoded === "undefined") continue; _3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.push(decoded); } @@ -49926,9 +50587,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint : "" ) ) - : URL.canParse(v["@id"]) && (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) + : URL.canParse(v["@id"]) && _baseUrl ? new URL(v["@id"]) - : new URL(v["@id"], (values["@id"] == null ? options.baseUrl : new URL(values["@id"]))); + : new URL(v["@id"], _baseUrl); if (typeof decoded === "undefined") continue; _3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.push(decoded); } @@ -50381,9 +51042,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -50716,9 +51382,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -51052,9 +51723,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -52328,7 +53004,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "publicKey"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#publicKey_fromJsonLd(doc, options); + v = await this.#publicKey_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -52421,7 +53101,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "publicKey"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#publicKey_fromJsonLd(obj, options); + v = await this.#publicKey_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -52640,7 +53324,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "assertionMethod"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#assertionMethod_fromJsonLd(doc, options); + v = await this.#assertionMethod_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -52737,7 +53425,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "assertionMethod"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#assertionMethod_fromJsonLd(obj, options); + v = await this.#assertionMethod_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -52993,7 +53685,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "inbox"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#inbox_fromJsonLd(doc, options); + v = await this.#inbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -53226,7 +53922,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "outbox"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#outbox_fromJsonLd(doc, options); + v = await this.#outbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -53445,7 +54145,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "following"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#following_fromJsonLd(doc, options); + v = await this.#following_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -53667,7 +54371,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "followers"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#followers_fromJsonLd(doc, options); + v = await this.#followers_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -53887,7 +54595,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "liked"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#liked_fromJsonLd(doc, options); + v = await this.#liked_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -54105,7 +54817,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "featured"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#featured_fromJsonLd(doc, options); + v = await this.#featured_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -54323,7 +55039,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "featuredTags"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#featuredTags_fromJsonLd(doc, options); + v = await this.#featuredTags_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -54539,7 +55259,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "streams"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#stream_fromJsonLd(obj, options); + v = await this.#stream_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -54865,7 +55589,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "movedTo"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#successor_fromJsonLd(doc, options); + v = await this.#successor_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -55119,7 +55847,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "alsoKnownAs"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#alias_fromJsonLd(doc, options); + v = await this.#alias_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -55216,7 +55948,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "alsoKnownAs"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#alias_fromJsonLd(obj, options); + v = await this.#alias_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -55435,7 +56171,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "service"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#service_fromJsonLd(doc, options); + v = await this.#service_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -55532,7 +56272,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "service"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#service_fromJsonLd(obj, options); + v = await this.#service_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -56565,9 +57309,14 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -56640,7 +57389,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(decoded); @@ -56673,7 +57422,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); @@ -56726,11 +57475,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollection") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -56767,11 +57516,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollection") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -56806,7 +57555,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(decoded); @@ -56839,7 +57588,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(decoded); @@ -56872,7 +57621,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(decoded); @@ -56905,7 +57654,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(decoded); @@ -56938,7 +57687,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(decoded); @@ -56971,7 +57720,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(decoded); @@ -56992,7 +57741,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.push(decoded); @@ -57099,23 +57848,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -57152,23 +57901,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -57203,7 +57952,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(decoded); @@ -58540,7 +59289,11 @@ get names(): ((string | LanguageString))[] { "preview"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#preview_fromJsonLd(obj, options); + v = await this.#preview_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -58994,9 +59747,14 @@ get names(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -59047,9 +59805,9 @@ get names(): ((string | LanguageString))[] { : "" ) ) - : URL.canParse(v["@id"]) && (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) + : URL.canParse(v["@id"]) && _baseUrl ? new URL(v["@id"]) - : new URL(v["@id"], (values["@id"] == null ? options.baseUrl : new URL(values["@id"]))); + : new URL(v["@id"], _baseUrl); if (typeof decoded === "undefined") continue; _pVjLsybKQdmkjuU7MHjiVmNnuj7_href.push(decoded); } @@ -59198,12 +59956,12 @@ get names(): ((string | LanguageString))[] { && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Object","http://joinmastodon.org/ns#Emoji","http://litepub.social/ns#ChatMessage","https://gotosocial.org/ns#AnnounceAuthorization","https://gotosocial.org/ns#LikeApproval","https://gotosocial.org/ns#ReplyAuthorization","https://w3id.org/fep/044f#QuoteAuthorization","https://w3id.org/valueflows/ont/vf#Proposal","https://www.w3.org/ns/activitystreams#Activity","http://litepub.social/ns#EmojiReact","https://gotosocial.org/ns#AnnounceRequest","https://gotosocial.org/ns#LikeRequest","https://gotosocial.org/ns#ReplyRequest","https://w3id.org/fep/044f#QuoteRequest","https://www.w3.org/ns/activitystreams#Accept","https://www.w3.org/ns/activitystreams#TentativeAccept","https://www.w3.org/ns/activitystreams#Add","https://www.w3.org/ns/activitystreams#Announce","https://www.w3.org/ns/activitystreams#Create","https://www.w3.org/ns/activitystreams#Delete","https://www.w3.org/ns/activitystreams#Dislike","https://www.w3.org/ns/activitystreams#Flag","https://www.w3.org/ns/activitystreams#Follow","https://www.w3.org/ns/activitystreams#Ignore","https://www.w3.org/ns/activitystreams#Block","https://www.w3.org/ns/activitystreams#IntransitiveActivity","https://www.w3.org/ns/activitystreams#Arrive","https://www.w3.org/ns/activitystreams#Question","https://www.w3.org/ns/activitystreams#Travel","https://www.w3.org/ns/activitystreams#Join","https://www.w3.org/ns/activitystreams#Leave","https://www.w3.org/ns/activitystreams#Like","https://www.w3.org/ns/activitystreams#Listen","https://www.w3.org/ns/activitystreams#Move","https://www.w3.org/ns/activitystreams#Offer","https://www.w3.org/ns/activitystreams#Invite","https://www.w3.org/ns/activitystreams#Read","https://www.w3.org/ns/activitystreams#Reject","https://www.w3.org/ns/activitystreams#TentativeReject","https://www.w3.org/ns/activitystreams#Remove","https://www.w3.org/ns/activitystreams#Undo","https://www.w3.org/ns/activitystreams#Update","https://www.w3.org/ns/activitystreams#View","https://www.w3.org/ns/activitystreams#Application","https://www.w3.org/ns/activitystreams#Article","https://www.w3.org/ns/activitystreams#Collection","https://www.w3.org/ns/activitystreams#CollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollection","https://www.w3.org/ns/activitystreams#Document","https://www.w3.org/ns/activitystreams#Audio","https://www.w3.org/ns/activitystreams#Image","https://www.w3.org/ns/activitystreams#Page","https://www.w3.org/ns/activitystreams#Video","https://www.w3.org/ns/activitystreams#Event","https://www.w3.org/ns/activitystreams#Group","https://www.w3.org/ns/activitystreams#Note","https://www.w3.org/ns/activitystreams#Organization","https://www.w3.org/ns/activitystreams#Person","https://www.w3.org/ns/activitystreams#Place","https://www.w3.org/ns/activitystreams#Profile","https://www.w3.org/ns/activitystreams#Relationship","https://www.w3.org/ns/activitystreams#Service","https://www.w3.org/ns/activitystreams#Tombstone"].some( t => v["@type"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -59677,9 +60435,14 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -60014,9 +60777,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -60349,9 +61117,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -60687,9 +61460,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -61021,9 +61799,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -61355,9 +62138,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -61689,9 +62477,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -62021,9 +62814,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -62319,9 +63117,14 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -62654,9 +63457,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -63088,7 +63896,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "quote"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#quote_fromJsonLd(doc, options); + v = await this.#quote_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -63327,7 +64139,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "quoteAuthorization"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#quoteAuthorization_fromJsonLd(doc, options); + v = await this.#quoteAuthorization_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -63649,9 +64465,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -63700,7 +64521,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push(decoded); @@ -63759,7 +64580,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await QuoteAuthorization.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push(decoded); @@ -64201,7 +65022,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "orderedItems"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#item_fromJsonLd(obj, options); + v = await this.#item_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -64445,9 +65270,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -64499,12 +65329,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Object","http://joinmastodon.org/ns#Emoji","http://litepub.social/ns#ChatMessage","https://gotosocial.org/ns#AnnounceAuthorization","https://gotosocial.org/ns#LikeApproval","https://gotosocial.org/ns#ReplyAuthorization","https://w3id.org/fep/044f#QuoteAuthorization","https://w3id.org/valueflows/ont/vf#Proposal","https://www.w3.org/ns/activitystreams#Activity","http://litepub.social/ns#EmojiReact","https://gotosocial.org/ns#AnnounceRequest","https://gotosocial.org/ns#LikeRequest","https://gotosocial.org/ns#ReplyRequest","https://w3id.org/fep/044f#QuoteRequest","https://www.w3.org/ns/activitystreams#Accept","https://www.w3.org/ns/activitystreams#TentativeAccept","https://www.w3.org/ns/activitystreams#Add","https://www.w3.org/ns/activitystreams#Announce","https://www.w3.org/ns/activitystreams#Create","https://www.w3.org/ns/activitystreams#Delete","https://www.w3.org/ns/activitystreams#Dislike","https://www.w3.org/ns/activitystreams#Flag","https://www.w3.org/ns/activitystreams#Follow","https://www.w3.org/ns/activitystreams#Ignore","https://www.w3.org/ns/activitystreams#Block","https://www.w3.org/ns/activitystreams#IntransitiveActivity","https://www.w3.org/ns/activitystreams#Arrive","https://www.w3.org/ns/activitystreams#Question","https://www.w3.org/ns/activitystreams#Travel","https://www.w3.org/ns/activitystreams#Join","https://www.w3.org/ns/activitystreams#Leave","https://www.w3.org/ns/activitystreams#Like","https://www.w3.org/ns/activitystreams#Listen","https://www.w3.org/ns/activitystreams#Move","https://www.w3.org/ns/activitystreams#Offer","https://www.w3.org/ns/activitystreams#Invite","https://www.w3.org/ns/activitystreams#Read","https://www.w3.org/ns/activitystreams#Reject","https://www.w3.org/ns/activitystreams#TentativeReject","https://www.w3.org/ns/activitystreams#Remove","https://www.w3.org/ns/activitystreams#Undo","https://www.w3.org/ns/activitystreams#Update","https://www.w3.org/ns/activitystreams#View","https://www.w3.org/ns/activitystreams#Application","https://www.w3.org/ns/activitystreams#Article","https://www.w3.org/ns/activitystreams#Collection","https://www.w3.org/ns/activitystreams#CollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollection","https://www.w3.org/ns/activitystreams#Document","https://www.w3.org/ns/activitystreams#Audio","https://www.w3.org/ns/activitystreams#Image","https://www.w3.org/ns/activitystreams#Page","https://www.w3.org/ns/activitystreams#Video","https://www.w3.org/ns/activitystreams#Event","https://www.w3.org/ns/activitystreams#Group","https://www.w3.org/ns/activitystreams#Note","https://www.w3.org/ns/activitystreams#Organization","https://www.w3.org/ns/activitystreams#Person","https://www.w3.org/ns/activitystreams#Place","https://www.w3.org/ns/activitystreams#Profile","https://www.w3.org/ns/activitystreams#Relationship","https://www.w3.org/ns/activitystreams#Service","https://www.w3.org/ns/activitystreams#Tombstone"].some( t => v["@type"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -64938,7 +65768,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "orderedItems"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#item_fromJsonLd(obj, options); + v = await this.#item_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -65231,9 +66065,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -65285,12 +66124,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Object","http://joinmastodon.org/ns#Emoji","http://litepub.social/ns#ChatMessage","https://gotosocial.org/ns#AnnounceAuthorization","https://gotosocial.org/ns#LikeApproval","https://gotosocial.org/ns#ReplyAuthorization","https://w3id.org/fep/044f#QuoteAuthorization","https://w3id.org/valueflows/ont/vf#Proposal","https://www.w3.org/ns/activitystreams#Activity","http://litepub.social/ns#EmojiReact","https://gotosocial.org/ns#AnnounceRequest","https://gotosocial.org/ns#LikeRequest","https://gotosocial.org/ns#ReplyRequest","https://w3id.org/fep/044f#QuoteRequest","https://www.w3.org/ns/activitystreams#Accept","https://www.w3.org/ns/activitystreams#TentativeAccept","https://www.w3.org/ns/activitystreams#Add","https://www.w3.org/ns/activitystreams#Announce","https://www.w3.org/ns/activitystreams#Create","https://www.w3.org/ns/activitystreams#Delete","https://www.w3.org/ns/activitystreams#Dislike","https://www.w3.org/ns/activitystreams#Flag","https://www.w3.org/ns/activitystreams#Follow","https://www.w3.org/ns/activitystreams#Ignore","https://www.w3.org/ns/activitystreams#Block","https://www.w3.org/ns/activitystreams#IntransitiveActivity","https://www.w3.org/ns/activitystreams#Arrive","https://www.w3.org/ns/activitystreams#Question","https://www.w3.org/ns/activitystreams#Travel","https://www.w3.org/ns/activitystreams#Join","https://www.w3.org/ns/activitystreams#Leave","https://www.w3.org/ns/activitystreams#Like","https://www.w3.org/ns/activitystreams#Listen","https://www.w3.org/ns/activitystreams#Move","https://www.w3.org/ns/activitystreams#Offer","https://www.w3.org/ns/activitystreams#Invite","https://www.w3.org/ns/activitystreams#Read","https://www.w3.org/ns/activitystreams#Reject","https://www.w3.org/ns/activitystreams#TentativeReject","https://www.w3.org/ns/activitystreams#Remove","https://www.w3.org/ns/activitystreams#Undo","https://www.w3.org/ns/activitystreams#Update","https://www.w3.org/ns/activitystreams#View","https://www.w3.org/ns/activitystreams#Application","https://www.w3.org/ns/activitystreams#Article","https://www.w3.org/ns/activitystreams#Collection","https://www.w3.org/ns/activitystreams#CollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollectionPage","https://www.w3.org/ns/activitystreams#OrderedCollection","https://www.w3.org/ns/activitystreams#Document","https://www.w3.org/ns/activitystreams#Audio","https://www.w3.org/ns/activitystreams#Image","https://www.w3.org/ns/activitystreams#Page","https://www.w3.org/ns/activitystreams#Video","https://www.w3.org/ns/activitystreams#Event","https://www.w3.org/ns/activitystreams#Group","https://www.w3.org/ns/activitystreams#Note","https://www.w3.org/ns/activitystreams#Organization","https://www.w3.org/ns/activitystreams#Person","https://www.w3.org/ns/activitystreams#Place","https://www.w3.org/ns/activitystreams#Profile","https://www.w3.org/ns/activitystreams#Relationship","https://www.w3.org/ns/activitystreams#Service","https://www.w3.org/ns/activitystreams#Tombstone"].some( t => v["@type"].includes(t)) ? await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -66610,7 +67449,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "publicKey"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#publicKey_fromJsonLd(doc, options); + v = await this.#publicKey_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -66703,7 +67546,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "publicKey"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#publicKey_fromJsonLd(obj, options); + v = await this.#publicKey_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -66922,7 +67769,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "assertionMethod"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#assertionMethod_fromJsonLd(doc, options); + v = await this.#assertionMethod_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -67019,7 +67870,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "assertionMethod"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#assertionMethod_fromJsonLd(obj, options); + v = await this.#assertionMethod_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -67275,7 +68130,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "inbox"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#inbox_fromJsonLd(doc, options); + v = await this.#inbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -67508,7 +68367,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "outbox"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#outbox_fromJsonLd(doc, options); + v = await this.#outbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -67727,7 +68590,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "following"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#following_fromJsonLd(doc, options); + v = await this.#following_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -67949,7 +68816,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "followers"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#followers_fromJsonLd(doc, options); + v = await this.#followers_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -68169,7 +69040,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "liked"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#liked_fromJsonLd(doc, options); + v = await this.#liked_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -68387,7 +69262,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "featured"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#featured_fromJsonLd(doc, options); + v = await this.#featured_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -68605,7 +69484,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "featuredTags"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#featuredTags_fromJsonLd(doc, options); + v = await this.#featuredTags_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -68821,7 +69704,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "streams"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#stream_fromJsonLd(obj, options); + v = await this.#stream_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -69147,7 +70034,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "movedTo"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#successor_fromJsonLd(doc, options); + v = await this.#successor_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -69401,7 +70292,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "alsoKnownAs"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#alias_fromJsonLd(doc, options); + v = await this.#alias_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -69498,7 +70393,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "alsoKnownAs"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#alias_fromJsonLd(obj, options); + v = await this.#alias_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -69717,7 +70616,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "service"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#service_fromJsonLd(doc, options); + v = await this.#service_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -69814,7 +70717,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "service"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#service_fromJsonLd(obj, options); + v = await this.#service_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -70847,9 +71754,14 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -70922,7 +71834,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(decoded); @@ -70955,7 +71867,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); @@ -71008,11 +71920,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollection") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -71049,11 +71961,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollection") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -71088,7 +72000,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(decoded); @@ -71121,7 +72033,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(decoded); @@ -71154,7 +72066,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(decoded); @@ -71187,7 +72099,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(decoded); @@ -71220,7 +72132,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(decoded); @@ -71253,7 +72165,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(decoded); @@ -71274,7 +72186,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.push(decoded); @@ -71381,23 +72293,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -71434,23 +72346,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -71485,7 +72397,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(decoded); @@ -72312,9 +73224,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -73588,7 +74505,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "publicKey"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#publicKey_fromJsonLd(doc, options); + v = await this.#publicKey_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -73681,7 +74602,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "publicKey"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#publicKey_fromJsonLd(obj, options); + v = await this.#publicKey_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -73900,7 +74825,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "assertionMethod"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#assertionMethod_fromJsonLd(doc, options); + v = await this.#assertionMethod_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -73997,7 +74926,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "assertionMethod"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#assertionMethod_fromJsonLd(obj, options); + v = await this.#assertionMethod_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -74253,7 +75186,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "inbox"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#inbox_fromJsonLd(doc, options); + v = await this.#inbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -74486,7 +75423,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "outbox"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#outbox_fromJsonLd(doc, options); + v = await this.#outbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -74705,7 +75646,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "following"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#following_fromJsonLd(doc, options); + v = await this.#following_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -74927,7 +75872,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "followers"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#followers_fromJsonLd(doc, options); + v = await this.#followers_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -75147,7 +76096,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "liked"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#liked_fromJsonLd(doc, options); + v = await this.#liked_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -75365,7 +76318,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "featured"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#featured_fromJsonLd(doc, options); + v = await this.#featured_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -75583,7 +76540,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "featuredTags"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#featuredTags_fromJsonLd(doc, options); + v = await this.#featuredTags_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -75799,7 +76760,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "streams"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#stream_fromJsonLd(obj, options); + v = await this.#stream_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -76125,7 +77090,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "movedTo"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#successor_fromJsonLd(doc, options); + v = await this.#successor_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -76379,7 +77348,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "alsoKnownAs"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#alias_fromJsonLd(doc, options); + v = await this.#alias_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -76476,7 +77449,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "alsoKnownAs"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#alias_fromJsonLd(obj, options); + v = await this.#alias_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -76695,7 +77672,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "service"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#service_fromJsonLd(doc, options); + v = await this.#service_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -76792,7 +77773,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "service"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#service_fromJsonLd(obj, options); + v = await this.#service_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -77825,9 +78810,14 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -77900,7 +78890,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(decoded); @@ -77933,7 +78923,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); @@ -77986,11 +78976,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollection") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -78027,11 +79017,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollection") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -78066,7 +79056,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(decoded); @@ -78099,7 +79089,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(decoded); @@ -78132,7 +79122,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(decoded); @@ -78165,7 +79155,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(decoded); @@ -78198,7 +79188,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(decoded); @@ -78231,7 +79221,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(decoded); @@ -78252,7 +79242,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.push(decoded); @@ -78359,23 +79349,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -78412,23 +79402,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -78463,7 +79453,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(decoded); @@ -79746,9 +80736,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -79890,9 +80885,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu : "" ) ) - : URL.canParse(v["@id"]) && (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) + : URL.canParse(v["@id"]) && _baseUrl ? new URL(v["@id"]) - : new URL(v["@id"], (values["@id"] == null ? options.baseUrl : new URL(values["@id"]))) : undefined + : new URL(v["@id"], _baseUrl) : undefined ; if (typeof decoded === "undefined") continue; _oKrwxU4V8wiKhMW1QEYQibcJh8c_units.push(decoded); @@ -80375,7 +81370,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "describes"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#describes_fromJsonLd(doc, options); + v = await this.#describes_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -80617,9 +81616,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -80668,7 +81672,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.push(decoded); @@ -81261,7 +82265,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti "oneOf"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#exclusiveOption_fromJsonLd(obj, options); + v = await this.#exclusiveOption_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -81480,7 +82488,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti "anyOf"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#inclusiveOption_fromJsonLd(obj, options); + v = await this.#inclusiveOption_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -81728,7 +82740,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti "quote"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#quote_fromJsonLd(doc, options); + v = await this.#quote_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -81967,7 +82983,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti "quoteAuthorization"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#quoteAuthorization_fromJsonLd(doc, options); + v = await this.#quoteAuthorization_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -82272,9 +83292,14 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -82323,7 +83348,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.push(decoded); @@ -82356,7 +83381,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.push(decoded); @@ -82438,7 +83463,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push(decoded); @@ -82497,7 +83522,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const decoded = await QuoteAuthorization.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push(decoded); @@ -82956,9 +83981,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -83290,9 +84320,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -83850,7 +84885,11 @@ relationships?: (Object | URL)[];} "subject"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#subject_fromJsonLd(doc, options); + v = await this.#subject_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -84065,7 +85104,11 @@ relationships?: (Object | URL)[];} "object"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#object_fromJsonLd(doc, options); + v = await this.#object_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -84159,7 +85202,11 @@ relationships?: (Object | URL)[];} "object"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#object_fromJsonLd(obj, options); + v = await this.#object_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -84377,7 +85424,11 @@ relationships?: (Object | URL)[];} "relationship"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#relationship_fromJsonLd(doc, options); + v = await this.#relationship_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -84473,7 +85524,11 @@ relationships?: (Object | URL)[];} "relationship"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#relationship_fromJsonLd(obj, options); + v = await this.#relationship_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -84786,9 +85841,14 @@ relationships?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -84837,7 +85897,7 @@ relationships?: (Object | URL)[];} const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.push(decoded); @@ -84870,7 +85930,7 @@ relationships?: (Object | URL)[];} const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.push(decoded); @@ -84903,7 +85963,7 @@ relationships?: (Object | URL)[];} const decoded = await Object.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.push(decoded); @@ -85291,9 +86351,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -86567,7 +87632,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "publicKey"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#publicKey_fromJsonLd(doc, options); + v = await this.#publicKey_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -86660,7 +87729,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "publicKey"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#publicKey_fromJsonLd(obj, options); + v = await this.#publicKey_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -86879,7 +87952,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "assertionMethod"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#assertionMethod_fromJsonLd(doc, options); + v = await this.#assertionMethod_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -86976,7 +88053,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "assertionMethod"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#assertionMethod_fromJsonLd(obj, options); + v = await this.#assertionMethod_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -87232,7 +88313,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "inbox"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#inbox_fromJsonLd(doc, options); + v = await this.#inbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -87465,7 +88550,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "outbox"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#outbox_fromJsonLd(doc, options); + v = await this.#outbox_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -87684,7 +88773,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "following"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#following_fromJsonLd(doc, options); + v = await this.#following_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -87906,7 +88999,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "followers"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#followers_fromJsonLd(doc, options); + v = await this.#followers_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -88126,7 +89223,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "liked"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#liked_fromJsonLd(doc, options); + v = await this.#liked_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -88344,7 +89445,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "featured"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#featured_fromJsonLd(doc, options); + v = await this.#featured_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -88562,7 +89667,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "featuredTags"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#featuredTags_fromJsonLd(doc, options); + v = await this.#featuredTags_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -88778,7 +89887,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "streams"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#stream_fromJsonLd(obj, options); + v = await this.#stream_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -89104,7 +90217,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "movedTo"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#successor_fromJsonLd(doc, options); + v = await this.#successor_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -89358,7 +90475,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "alsoKnownAs"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#alias_fromJsonLd(doc, options); + v = await this.#alias_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -89455,7 +90576,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "alsoKnownAs"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#alias_fromJsonLd(obj, options); + v = await this.#alias_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -89674,7 +90799,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "service"]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#service_fromJsonLd(doc, options); + v = await this.#service_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -89771,7 +90900,11 @@ get preferredUsernames(): ((string | LanguageString))[] { "service"]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#service_fromJsonLd(obj, options); + v = await this.#service_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } @@ -90804,9 +91937,14 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -90879,7 +92017,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await CryptographicKey.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(decoded); @@ -90912,7 +92050,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Multikey.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(decoded); @@ -90965,11 +92103,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollection") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -91006,11 +92144,11 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollection") ? await OrderedCollection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#OrderedCollectionPage") ? await OrderedCollectionPage.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -91045,7 +92183,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(decoded); @@ -91078,7 +92216,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(decoded); @@ -91111,7 +92249,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(decoded); @@ -91144,7 +92282,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(decoded); @@ -91177,7 +92315,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(decoded); @@ -91210,7 +92348,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Collection.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(decoded); @@ -91231,7 +92369,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await Endpoints.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _sEoQwUbfk4hEfugzNQ2ZiDcLMkG_endpoints.push(decoded); @@ -91338,23 +92476,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -91391,23 +92529,23 @@ get preferredUsernames(): ((string | LanguageString))[] { typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Application") ? await Application.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Group") ? await Group.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization") ? await Organization.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Person") ? await Person.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& v["@type"].includes("https://www.w3.org/ns/activitystreams#Service") ? await Service.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ) : undefined ; if (typeof decoded === "undefined") continue; @@ -91442,7 +92580,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const decoded = await DidService.fromJsonLd( v, - { ...options, baseUrl: (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) } + { ...options, baseUrl: _baseUrl } ); if (typeof decoded === "undefined") continue; _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(decoded); @@ -92478,9 +93616,14 @@ get contents(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -92910,9 +94053,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -93244,9 +94392,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -93794,9 +94947,14 @@ get formerTypes(): ($EntityType)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -94229,9 +95387,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -94568,9 +95731,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -94905,9 +96073,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -95242,9 +96415,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -95575,9 +96753,14 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index 9ae7e7a00..1bbd74f7f 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -37,6 +37,7 @@ export function sortTopologically(types: Record): string[] { async function* generateClass( typeUri: string, types: Record, + moduleVarNames: ReadonlyMap, ): AsyncIterable { const type = types[typeUri]; yield `/** ${type.description.replaceAll("\n", "\n * ")}\n */\n`; @@ -99,9 +100,13 @@ async function* generateClass( for await (const code of generateFields(typeUri, types)) yield code; for await (const code of generateConstructor(typeUri, types)) yield code; for await (const code of generateCloner(typeUri, types)) yield code; - for await (const code of generateProperties(typeUri, types)) yield code; + for await (const code of generateProperties(typeUri, types, moduleVarNames)) { + yield code; + } for await (const code of generateEncoder(typeUri, types)) yield code; - for await (const code of generateDecoder(typeUri, types)) yield code; + for await (const code of generateDecoder(typeUri, types, moduleVarNames)) { + yield code; + } for await (const code of generateInspector(typeUri, types)) yield code; yield "}\n\n"; for await (const code of generateInspectorPostClass(typeUri, types)) { @@ -184,7 +189,7 @@ export async function* generateClasses( "parseDecimal", "type RemoteDocument", ]; - yield "// deno-lint-ignore-file ban-unused-ignore no-unused-vars prefer-const verbatim-module-syntax\n"; + yield "// deno-lint-ignore-file ban-unused-ignore no-explicit-any no-unused-vars prefer-const verbatim-module-syntax\n"; yield 'import jsonld from "@fedify/vocab-runtime/jsonld";\n'; yield 'import { getLogger } from "@logtape/logtape";\n'; yield `import { type Span, SpanStatusCode, type TracerProvider, trace } @@ -197,9 +202,27 @@ export async function* generateClasses( isTemporalInstant, } from "@fedify/vocab-runtime/temporal";\n`; yield "\n\n"; + const moduleVarNames = new Map(); const sorted = sortTopologically(types); for (const typeUri of sorted) { - for await (const code of generateClass(typeUri, types)) yield code; + for (const property of types[typeUri].properties) { + if (property.preprocessors == null) continue; + for (const pp of property.preprocessors) { + if (!moduleVarNames.has(pp.module)) { + const name = `_ppM${moduleVarNames.size}`; + moduleVarNames.set(pp.module, name); + } + } + } + } + for (const [modulePath, varName] of moduleVarNames) { + yield `import * as ${varName} from ${JSON.stringify(modulePath)};\n`; + } + if (moduleVarNames.size > 0) yield "\n"; + for (const typeUri of sorted) { + for await (const code of generateClass(typeUri, types, moduleVarNames)) { + yield code; + } } for (const code of generateEntityTypeHelpers(sorted, types)) yield code; } diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index 7c0b4d2b6..b1f44b7e6 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -1,6 +1,6 @@ import metadata from "../deno.json" with { type: "json" }; import { generateField, getFieldName } from "./field.ts"; -import type { TypeSchema } from "./schema.ts"; +import type { PropertyPreprocessorSchema, TypeSchema } from "./schema.ts"; import { isNonFunctionalProperty } from "./schema.ts"; import { areAllScalarTypes, @@ -10,9 +10,57 @@ import { getDecoders, getEncoders, getSubtypes, + getTypeNames, isCompactableType, } from "./type.ts"; +function* generatePreprocessorBlock( + property: { preprocessors?: PropertyPreprocessorSchema[] }, + rangeTypeName: string, + variable: string, + baseUrlExpr: string, + moduleVarNames: ReadonlyMap, +): Iterable { + if (property.preprocessors == null || property.preprocessors.length === 0) { + return; + } + yield ` + { + let _handled: ${rangeTypeName} | undefined; + `; + for (const pp of property.preprocessors) { + const varName = moduleVarNames.get(pp.module); + if (varName == null) { + throw new Error( + `Preprocessor module "${pp.module}" is not registered ` + + `in the generated imports. Ensure all preprocessor ` + + `modules used in property schemas are available.`, + ); + } + yield ` + if (_handled === undefined) { + const _result = await ${varName}[${JSON.stringify(pp.function)}](v, { + documentLoader: options.documentLoader, + contextLoader: options.contextLoader, + tracerProvider: options.tracerProvider, + baseUrl: ${baseUrlExpr}, + }); + if (_result instanceof Error) throw _result; + if (_result !== undefined) { + _handled = _result as ${rangeTypeName}; + } + } + `; + } + yield ` + if (_handled !== undefined) { + ${variable}.push(_handled); + continue; + } + } + `; +} + export async function* generateEncoder( typeUri: string, types: Record, @@ -271,6 +319,7 @@ export async function* generateEncoder( export async function* generateDecoder( typeUri: string, types: Record, + moduleVarNames: ReadonlyMap, ): AsyncIterable { const type = types[typeUri]; yield ` @@ -355,9 +404,14 @@ export async function* generateDecoder( // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (options.baseUrl == null && values["@id"] != null) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + const _resolvedUrl = + values["@id"] != null && URL.canParse(values["@id"], options.baseUrl) + ? new URL(values["@id"], options.baseUrl) + : undefined; + if (options.baseUrl == null && _resolvedUrl != null) { + options = { ...options, baseUrl: _resolvedUrl }; } + const _baseUrl = _resolvedUrl ?? options.baseUrl; `; const subtypes = getSubtypes(typeUri, types, true); yield ` @@ -426,6 +480,13 @@ export async function* generateDecoder( ) { if (v == null) continue; `; + yield* generatePreprocessorBlock( + property, + getTypeNames(property.range, types), + variable, + `_baseUrl`, + moduleVarNames, + ); if (!areAllScalarTypes(property.range, types)) { yield ` if (typeof v === "object" && "@id" in v && !("@type" in v) @@ -447,7 +508,7 @@ export async function* generateDecoder( types, "v", "options", - `(values["@id"] == null ? options.baseUrl : new URL(values["@id"]))`, + `_baseUrl`, ) }; if (typeof decoded === "undefined") continue; @@ -461,7 +522,7 @@ export async function* generateDecoder( types, "v", "options", - `(values["@id"] == null ? options.baseUrl : new URL(values["@id"]))`, + `_baseUrl`, ); for (const code of decoders) yield code; yield ` diff --git a/packages/vocab-tools/src/mod.ts b/packages/vocab-tools/src/mod.ts index 5cd50a54e..0cd6bdc1e 100644 --- a/packages/vocab-tools/src/mod.ts +++ b/packages/vocab-tools/src/mod.ts @@ -1,6 +1,7 @@ export { default as generateVocab } from "./generate.ts"; export { loadSchemaFiles, + type PropertyPreprocessorSchema, type PropertySchema, type TypeSchema, } from "./schema.ts"; diff --git a/packages/vocab-tools/src/property.ts b/packages/vocab-tools/src/property.ts index 78c1772c3..96c8f4766 100644 --- a/packages/vocab-tools/src/property.ts +++ b/packages/vocab-tools/src/property.ts @@ -26,6 +26,7 @@ async function* generateProperty( type: TypeSchema, property: PropertySchema, types: Record, + moduleVarNames: ReadonlyMap, ): AsyncIterable { const override = emitOverride(type.uri, types, property); const doc = `\n/** ${property.description.replaceAll("\n", "\n * ")}\n */\n`; @@ -165,6 +166,41 @@ async function* generateProperty( this._tracerProvider ?? trace.getTracerProvider(); const baseUrl = options.baseUrl; `; + if ( + property.preprocessors != null && + property.preprocessors.length > 0 + ) { + yield ` + const _expanded = await jsonld.expand(jsonLd, { + documentLoader: contextLoader, + keepFreeFloatingNodes: true, + }); + for (const _pp_obj of _expanded) { + `; + for (const pp of property.preprocessors) { + const varName = moduleVarNames.get(pp.module); + if (varName == null) continue; + yield ` + { + const _result = await ${varName}[${ + JSON.stringify(pp.function) + }](_pp_obj, { + documentLoader, + contextLoader, + tracerProvider, + baseUrl, + }); + if (_result instanceof Error) throw _result; + if (_result !== undefined) return _result as ${ + getTypeNames(property.range, types) + }; + } + `; + } + yield ` + } + `; + } for (const range of property.range) { if (!(range in types)) continue; const rangeType = types[range]; @@ -251,7 +287,11 @@ async function* generateProperty( ${JSON.stringify(property.compactName)}]; const doc = Array.isArray(prop) ? prop[0] : prop; if (doc != null && typeof doc === "object" && "@context" in doc) { - v = await this.#${property.singularName}_fromJsonLd(doc, options); + v = await this.#${property.singularName}_fromJsonLd(doc, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } `; @@ -350,7 +390,11 @@ async function* generateProperty( ${JSON.stringify(property.compactName)}]; const obj = Array.isArray(prop) ? prop[i] : prop; if (obj != null && typeof obj === "object" && "@context" in obj) { - v = await this.#${property.singularName}_fromJsonLd(obj, options); + v = await this.#${property.singularName}_fromJsonLd(obj, { + ...options, + baseUrl: (options as { baseUrl?: URL }).baseUrl ?? this.id ?? + undefined, + }); } } `; @@ -389,9 +433,10 @@ async function* generateProperty( export async function* generateProperties( typeUri: string, types: Record, + moduleVarNames: ReadonlyMap, ): AsyncIterable { const type = types[typeUri]; for (const property of type.properties) { - yield* generateProperty(type, property, types); + yield* generateProperty(type, property, types, moduleVarNames); } } diff --git a/packages/vocab-tools/src/schema.ts b/packages/vocab-tools/src/schema.ts index 123ec7b60..3f4224f33 100644 --- a/packages/vocab-tools/src/schema.ts +++ b/packages/vocab-tools/src/schema.ts @@ -122,6 +122,33 @@ export interface PropertySchemaBase { */ inherit: true; }; + + /** + * Preprocessors for this property. Each preprocessor receives an expanded + * JSON-LD property value and may return a vocabulary object matching the + * property's declared range, `undefined` when it did not handle the value, + * or an `Error` when it recognized the value but failed while converting it. + * + * {@link module} is resolved from the generated vocabulary source file + * and imported dynamically at decode time. + */ + preprocessors?: PropertyPreprocessorSchema[]; +} + +/** + * A schema for a property preprocessor that normalizes wire-level values + * before the generated range decoder runs. + */ +export interface PropertyPreprocessorSchema { + /** + * Module specifier resolved from the generated vocabulary source file. + */ + module: string; + + /** + * The name of the exported function in the module. + */ + function: string; } export type PropertySchemaTyping = { diff --git a/packages/vocab-tools/src/schema.yaml b/packages/vocab-tools/src/schema.yaml index 4a059512f..20330ddf8 100644 --- a/packages/vocab-tools/src/schema.yaml +++ b/packages/vocab-tools/src/schema.yaml @@ -113,6 +113,33 @@ $defs: Whether the embedded context should be the same as the context of the enclosing document. const: true + preprocessors: + description: >- + Preprocessors for this property. Each preprocessor receives an + expanded JSON-LD property value and may return a vocabulary object + matching the property's declared range, `undefined` when it did not + handle the value, or an `Error` when it recognized the value but + failed while converting it. + + `module` is resolved from the generated vocabulary source file + and imported dynamically at decode time. + type: array + items: + type: object + properties: + module: + description: >- + Module specifier resolved from the generated vocabulary + source file. + type: string + minLength: 1 + function: + description: The name of the exported function in the module. + type: string + pattern: "^[a-zA-Z_$][a-zA-Z0-9_$]*$" + required: + - module + - function required: - singularName - uri diff --git a/packages/vocab/src/object.yaml b/packages/vocab/src/object.yaml index 8b8487372..d9382b9c3 100644 --- a/packages/vocab/src/object.yaml +++ b/packages/vocab/src/object.yaml @@ -137,6 +137,9 @@ properties: (vertical) and should be suitable for presentation at a small size. range: - "https://www.w3.org/ns/activitystreams#Image" + preprocessors: + - module: ./preprocessors.ts + function: normalizeLinkToImage - pluralName: images singularName: image @@ -149,6 +152,9 @@ properties: limitations assumed. range: - "https://www.w3.org/ns/activitystreams#Image" + preprocessors: + - module: ./preprocessors.ts + function: normalizeLinkToImage - pluralName: replyTargets singularName: replyTarget diff --git a/packages/vocab/src/preprocessors.ts b/packages/vocab/src/preprocessors.ts new file mode 100644 index 000000000..9a3e657bb --- /dev/null +++ b/packages/vocab/src/preprocessors.ts @@ -0,0 +1,49 @@ +import type { PropertyPreprocessor } from "@fedify/vocab-runtime"; +import { Image, Link } from "./vocab.ts"; + +/** + * A property preprocessor that normalizes Link values to Image objects. + * + * When an `icon` or `image` property on a vocabulary object contains an + * explicit ActivityStreams `Link` rather than an `Image`, this preprocessor + * converts it into an `Image` by mapping `href` to `url`, copying + * `mediaType`, `name`, `width`, and `height`, and discarding the rest. + * + * If the value is not a Link, or the Link has no `href`, it returns + * `undefined` so the normal range decoder continues. + * @since 2.3.0 + */ +export const normalizeLinkToImage: PropertyPreprocessor = async ( + value, + context, +) => { + if ( + typeof value !== "object" || + value === null || + Array.isArray(value) || + !("@type" in value) || + !Array.isArray(value["@type"]) || + !value["@type"].includes("https://www.w3.org/ns/activitystreams#Link") + ) { + return undefined; + } + + let link: Link; + try { + link = await Link.fromJsonLd(value, context); + } catch (error) { + return error instanceof Error ? error : new Error(String(error)); + } + + if (link.href == null) return undefined; + + return new Image({ + url: link.href, + mediaType: link.mediaType, + names: link.names?.length != null && link.names.length > 0 + ? link.names + : undefined, + width: link.width, + height: link.height, + }); +}; diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index 84284544b..2a4a73dc2 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -1844,6 +1844,146 @@ test("Person.fromJsonLd() with relative URLs and baseUrl", async () => { ); }); +test("Object.fromJsonLd() normalizes Link icon to Image", async () => { + const json = { + "@context": "https://www.w3.org/ns/activitystreams", + "type": "Note", + "content": "Hello", + "icon": { + "type": "Link", + "href": "https://example.com/icon.png", + "mediaType": "image/png", + "name": "Icon", + "width": 64, + "height": 64, + }, + }; + const obj = await Object.fromJsonLd(json, { + documentLoader: mockDocumentLoader, + contextLoader: mockDocumentLoader, + }); + const icon = await obj.getIcon(); + deepStrictEqual( + icon?.url?.href, + "https://example.com/icon.png", + ); + deepStrictEqual(icon?.mediaType, "image/png"); + deepStrictEqual(icon?.names, ["Icon"]); + deepStrictEqual(icon?.width, 64); + deepStrictEqual(icon?.height, 64); +}); + +test("Object.fromJsonLd() normalizes Link image to Image", async () => { + const json = { + "@context": "https://www.w3.org/ns/activitystreams", + "type": "Note", + "content": "Hello", + "image": { + "type": "Link", + "href": "https://example.com/banner.png", + "mediaType": "image/png", + "width": 800, + "height": 200, + }, + }; + const obj = await Object.fromJsonLd(json, { + documentLoader: mockDocumentLoader, + contextLoader: mockDocumentLoader, + }); + const images = []; + for await (const img of obj.getImages()) { + images.push(img); + } + deepStrictEqual(images[0]?.url?.href, "https://example.com/banner.png"); + deepStrictEqual(images[0]?.mediaType, "image/png"); + deepStrictEqual(images[0]?.width, 800); + deepStrictEqual(images[0]?.height, 200); +}); + +test("Object.fromJsonLd() normalizes Link icon with relative URL", async () => { + const json = { + "@context": "https://www.w3.org/ns/activitystreams", + "type": "Note", + "id": "https://example.com/notes/1", + "content": "Hello", + "icon": { + "type": "Link", + "href": "/icons/icon.png", + }, + }; + const obj = await Object.fromJsonLd(json, { + documentLoader: mockDocumentLoader, + contextLoader: mockDocumentLoader, + }); + const icon = await obj.getIcon(); + deepStrictEqual( + icon?.url?.href, + "https://example.com/icons/icon.png", + ); +}); + +test("Object.fromJsonLd() normalizes multiple Link icons", async () => { + const json = { + "@context": "https://www.w3.org/ns/activitystreams", + "type": "Note", + "content": "Hello", + "icon": [ + { "type": "Link", "href": "https://example.com/a.png" }, + { "type": "Image", "url": "https://example.com/b.png" }, + ], + }; + const obj = await Object.fromJsonLd(json, { + documentLoader: mockDocumentLoader, + contextLoader: mockDocumentLoader, + }); + const icons = []; + for await (const i of obj.getIcons()) { + icons.push(i); + } + deepStrictEqual(icons.length, 2); + deepStrictEqual(icons[0]?.url?.href, "https://example.com/a.png"); + deepStrictEqual(icons[1]?.url?.href, "https://example.com/b.png"); +}); + +test("Object.getIcon() normalizes fetched Link document to Image", async () => { + const linkDocUrl = "https://example.com/icons/avatar-link"; + const linkDoc = { + "@context": "https://www.w3.org/ns/activitystreams", + type: "Link", + href: "https://example.com/avatars/user.png", + mediaType: "image/png", + width: 128, + height: 128, + }; + const docLoader = async (url: string) => { + if (url === linkDocUrl) { + return { + document: linkDoc, + documentUrl: url, + contextUrl: null, + }; + } + return await mockDocumentLoader(url); + }; + + const person = new Person({ + id: new URL("https://example.com/ap/actors/test-user"), + icon: new URL(linkDocUrl), + }); + + const icon = await person.getIcon({ + documentLoader: docLoader, + contextLoader: mockDocumentLoader, + }); + deepStrictEqual( + icon?.url?.href, + "https://example.com/avatars/user.png", + ); + deepStrictEqual(icon?.mediaType, "image/png"); + deepStrictEqual(icon?.width, 128); + deepStrictEqual(icon?.height, 128); +}); + test("FEP-fe34: Trust tracking in object construction", async () => { // Test that objects created with embedded objects have trust set const note = new Note({