@fedify/vocab-runtime
Advanced tools
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
| const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.cjs"); | ||
| let node_process = require("node:process"); | ||
| node_process = require_rolldown_runtime.__toESM(node_process, 1); | ||
| //#region deno.json | ||
| var name = "@fedify/vocab-runtime"; | ||
| var version = "2.4.0-dev.1740+32e9952c"; | ||
| //#endregion | ||
| //#region src/request.ts | ||
| /** | ||
| * Error thrown when fetching a JSON-LD document failed. | ||
| */ | ||
| var FetchError = class extends Error { | ||
| /** | ||
| * The URL that failed to fetch. | ||
| */ | ||
| url; | ||
| /** | ||
| * The HTTP response that failed, if available. | ||
| */ | ||
| response; | ||
| /** | ||
| * Constructs a new `FetchError`. | ||
| * | ||
| * @param url The URL that failed to fetch. | ||
| * @param message Error message. | ||
| * @param response The failed HTTP response, if available. | ||
| */ | ||
| constructor(url, message, response) { | ||
| super(message == null ? url.toString() : `${url}: ${message}`); | ||
| this.name = "FetchError"; | ||
| this.url = typeof url === "string" ? new URL(url) : url; | ||
| this.response = response; | ||
| } | ||
| }; | ||
| /** | ||
| * Creates a request for the given URL. | ||
| * @param url The URL to create the request for. | ||
| * @param options The options for the request. | ||
| * @returns The created request. | ||
| * @internal | ||
| */ | ||
| function createActivityPubRequest(url, options = {}) { | ||
| return new Request(url, { | ||
| headers: { | ||
| Accept: "application/activity+json, application/ld+json", | ||
| "User-Agent": typeof options.userAgent === "string" ? options.userAgent : getUserAgent(options.userAgent) | ||
| }, | ||
| redirect: "manual" | ||
| }); | ||
| } | ||
| /** | ||
| * Gets the user agent string for the given application and URL. | ||
| * @param options The options for making the user agent string. | ||
| * @returns The user agent string. | ||
| * @since 1.3.0 | ||
| */ | ||
| function getUserAgent({ software, url } = {}) { | ||
| const fedify = `Fedify/${version}`; | ||
| const runtime = globalThis.Deno?.version?.deno != null ? `Deno/${Deno.version.deno}` : globalThis.process?.versions?.bun != null ? `Bun/${node_process.default.versions.bun}` : "navigator" in globalThis && navigator.userAgent === "Cloudflare-Workers" ? navigator.userAgent : globalThis.process?.versions?.node != null ? `Node.js/${node_process.default.versions.node}` : null; | ||
| const userAgent = software == null ? [fedify] : [software, fedify]; | ||
| if (runtime != null) userAgent.push(runtime); | ||
| if (url != null) userAgent.push(`+${url.toString()}`); | ||
| return `${userAgent.shift()} (${userAgent.join("; ")})`; | ||
| } | ||
| /** | ||
| * Logs the request. | ||
| * @param request The request to log. | ||
| * @internal | ||
| */ | ||
| function logRequest(logger, request) { | ||
| logger.debug("Fetching document: {method} {url} {headers}", { | ||
| method: request.method, | ||
| url: request.url, | ||
| headers: Object.fromEntries(request.headers.entries()) | ||
| }); | ||
| } | ||
| //#endregion | ||
| Object.defineProperty(exports, "FetchError", { | ||
| enumerable: true, | ||
| get: function() { | ||
| return FetchError; | ||
| } | ||
| }); | ||
| Object.defineProperty(exports, "createActivityPubRequest", { | ||
| enumerable: true, | ||
| get: function() { | ||
| return createActivityPubRequest; | ||
| } | ||
| }); | ||
| Object.defineProperty(exports, "getUserAgent", { | ||
| enumerable: true, | ||
| get: function() { | ||
| return getUserAgent; | ||
| } | ||
| }); | ||
| Object.defineProperty(exports, "logRequest", { | ||
| enumerable: true, | ||
| get: function() { | ||
| return logRequest; | ||
| } | ||
| }); | ||
| Object.defineProperty(exports, "name", { | ||
| enumerable: true, | ||
| get: function() { | ||
| return name; | ||
| } | ||
| }); | ||
| Object.defineProperty(exports, "version", { | ||
| enumerable: true, | ||
| get: function() { | ||
| return version; | ||
| } | ||
| }); |
| import process from "node:process"; | ||
| //#region deno.json | ||
| var name = "@fedify/vocab-runtime"; | ||
| var version = "2.4.0-dev.1740+32e9952c"; | ||
| //#endregion | ||
| //#region src/request.ts | ||
| /** | ||
| * Error thrown when fetching a JSON-LD document failed. | ||
| */ | ||
| var FetchError = class extends Error { | ||
| /** | ||
| * The URL that failed to fetch. | ||
| */ | ||
| url; | ||
| /** | ||
| * The HTTP response that failed, if available. | ||
| */ | ||
| response; | ||
| /** | ||
| * Constructs a new `FetchError`. | ||
| * | ||
| * @param url The URL that failed to fetch. | ||
| * @param message Error message. | ||
| * @param response The failed HTTP response, if available. | ||
| */ | ||
| constructor(url, message, response) { | ||
| super(message == null ? url.toString() : `${url}: ${message}`); | ||
| this.name = "FetchError"; | ||
| this.url = typeof url === "string" ? new URL(url) : url; | ||
| this.response = response; | ||
| } | ||
| }; | ||
| /** | ||
| * Creates a request for the given URL. | ||
| * @param url The URL to create the request for. | ||
| * @param options The options for the request. | ||
| * @returns The created request. | ||
| * @internal | ||
| */ | ||
| function createActivityPubRequest(url, options = {}) { | ||
| return new Request(url, { | ||
| headers: { | ||
| Accept: "application/activity+json, application/ld+json", | ||
| "User-Agent": typeof options.userAgent === "string" ? options.userAgent : getUserAgent(options.userAgent) | ||
| }, | ||
| redirect: "manual" | ||
| }); | ||
| } | ||
| /** | ||
| * Gets the user agent string for the given application and URL. | ||
| * @param options The options for making the user agent string. | ||
| * @returns The user agent string. | ||
| * @since 1.3.0 | ||
| */ | ||
| function getUserAgent({ software, url } = {}) { | ||
| const fedify = `Fedify/${version}`; | ||
| const runtime = globalThis.Deno?.version?.deno != null ? `Deno/${Deno.version.deno}` : globalThis.process?.versions?.bun != null ? `Bun/${process.versions.bun}` : "navigator" in globalThis && navigator.userAgent === "Cloudflare-Workers" ? navigator.userAgent : globalThis.process?.versions?.node != null ? `Node.js/${process.versions.node}` : null; | ||
| const userAgent = software == null ? [fedify] : [software, fedify]; | ||
| if (runtime != null) userAgent.push(runtime); | ||
| if (url != null) userAgent.push(`+${url.toString()}`); | ||
| return `${userAgent.shift()} (${userAgent.join("; ")})`; | ||
| } | ||
| /** | ||
| * Logs the request. | ||
| * @param request The request to log. | ||
| * @internal | ||
| */ | ||
| function logRequest(logger, request) { | ||
| logger.debug("Fetching document: {method} {url} {headers}", { | ||
| method: request.method, | ||
| url: request.url, | ||
| headers: Object.fromEntries(request.headers.entries()) | ||
| }); | ||
| } | ||
| //#endregion | ||
| export { name as a, logRequest as i, createActivityPubRequest as n, version as o, getUserAgent as r, FetchError as t }; |
| { | ||
| "@context": { | ||
| "as": "https://www.w3.org/ns/activitystreams#", | ||
| "xsd": "http://www.w3.org/2001/XMLSchema#", | ||
| "Hashtag": "as:Hashtag", | ||
| "manuallyApprovesFollowers": { | ||
| "@id": "as:manuallyApprovesFollowers", | ||
| "@type": "xsd:boolean" | ||
| }, | ||
| "movedTo": { | ||
| "@id": "as:movedTo", | ||
| "@type": "@id" | ||
| }, | ||
| "sensitive": { | ||
| "@id": "as:sensitive", | ||
| "@type": "xsd:boolean" | ||
| } | ||
| } | ||
| } |
+1
-1
| { | ||
| "name": "@fedify/vocab-runtime", | ||
| "version": "2.4.0-dev.1727+1eadcb04", | ||
| "version": "2.4.0-dev.1740+32e9952c", | ||
| "license": "MIT", | ||
@@ -5,0 +5,0 @@ "exports": { |
@@ -1,2 +0,2 @@ | ||
| require("./docloader-DFqMzdME.cjs"); | ||
| require("./docloader-CS1O52ch.cjs"); | ||
| require("./url-CPfMatUL.cjs"); | ||
@@ -3,0 +3,0 @@ require("./key-8Qg2SbZi.cjs"); |
@@ -1,2 +0,2 @@ | ||
| import "./docloader-BD58nJdO.mjs"; | ||
| import "./docloader-BWBddOkN.mjs"; | ||
| import "./url-Basm1L_c.mjs"; | ||
@@ -3,0 +3,0 @@ import "./key-C7MNhlkO.mjs"; |
| const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.cjs"); | ||
| const require_docloader = require("./docloader-DFqMzdME.cjs"); | ||
| const require_request = require("./request-kH0uXibB.cjs"); | ||
| const require_docloader = require("./docloader-CS1O52ch.cjs"); | ||
| const require_request = require("./request-D1rLeiIi.cjs"); | ||
| const require_url = require("./url-CPfMatUL.cjs"); | ||
@@ -5,0 +5,0 @@ let node_assert = require("node:assert"); |
@@ -1,3 +0,3 @@ | ||
| import { n as getRemoteDocument, r as preloadedContexts, t as getDocumentLoader } from "./docloader-BD58nJdO.mjs"; | ||
| import { t as FetchError } from "./request-9_Y1N3iF.mjs"; | ||
| import { n as getRemoteDocument, r as preloadedContexts, t as getDocumentLoader } from "./docloader-BWBddOkN.mjs"; | ||
| import { t as FetchError } from "./request-DpcxnLEa.mjs"; | ||
| import { t as UrlError } from "./url-Basm1L_c.mjs"; | ||
@@ -4,0 +4,0 @@ import { deepStrictEqual, ok, rejects } from "node:assert"; |
| const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.cjs"); | ||
| const require_request = require("./request-kH0uXibB.cjs"); | ||
| const require_request = require("./request-D1rLeiIi.cjs"); | ||
| let node_assert = require("node:assert"); | ||
@@ -4,0 +4,0 @@ let node_test = require("node:test"); |
@@ -1,2 +0,2 @@ | ||
| import { o as version, r as getUserAgent } from "./request-9_Y1N3iF.mjs"; | ||
| import { o as version, r as getUserAgent } from "./request-DpcxnLEa.mjs"; | ||
| import { deepStrictEqual } from "node:assert"; | ||
@@ -3,0 +3,0 @@ import { test } from "node:test"; |
+1
-1
| { | ||
| "name": "@fedify/vocab-runtime", | ||
| "version": "2.4.0-dev.1727+1eadcb04", | ||
| "version": "2.4.0-dev.1740+32e9952c", | ||
| "homepage": "https://fedify.dev/", | ||
@@ -5,0 +5,0 @@ "repository": { |
+13
-0
@@ -16,2 +16,3 @@ // Preloaded context documents | ||
| import joinmastodon from "./contexts/joinmastodon.json" with { type: "json" }; | ||
| import miscellany from "./contexts/miscellany.json" with { type: "json" }; | ||
| import schemaorg from "./contexts/schemaorg.json" with { type: "json" }; | ||
@@ -63,4 +64,16 @@ import securityDataIntegrityV1 from "./contexts/security-data-integrity-v1.json" with { | ||
| "http://joinmastodon.org/ns": joinmastodon, | ||
| // The SWICG "ActivityPub Miscellaneous Terms" context. Bridgy Fed (via | ||
| // granary) references this URL in the @context of every activity it sends, | ||
| // and other implementations use it as the recommended home for widely | ||
| // deployed extension terms like as:Hashtag and as:sensitive. It is served | ||
| // through purl.archive.org (Internet Archive's PURL service), which suffers | ||
| // recurring outages; while it is unreachable, every activity referencing | ||
| // this URL fails JSON-LD expansion before application handlers run. The | ||
| // document is a deliberately stable, versioned SWICG deliverable, so we | ||
| // ship a built-in copy. | ||
| // See: https://swicg.github.io/miscellany/ | ||
| "https://purl.archive.org/miscellany": miscellany, | ||
| }; | ||
| export default preloadedContexts; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
| import process from "node:process"; | ||
| //#region deno.json | ||
| var name = "@fedify/vocab-runtime"; | ||
| var version = "2.4.0-dev.1727+1eadcb04"; | ||
| //#endregion | ||
| //#region src/request.ts | ||
| /** | ||
| * Error thrown when fetching a JSON-LD document failed. | ||
| */ | ||
| var FetchError = class extends Error { | ||
| /** | ||
| * The URL that failed to fetch. | ||
| */ | ||
| url; | ||
| /** | ||
| * The HTTP response that failed, if available. | ||
| */ | ||
| response; | ||
| /** | ||
| * Constructs a new `FetchError`. | ||
| * | ||
| * @param url The URL that failed to fetch. | ||
| * @param message Error message. | ||
| * @param response The failed HTTP response, if available. | ||
| */ | ||
| constructor(url, message, response) { | ||
| super(message == null ? url.toString() : `${url}: ${message}`); | ||
| this.name = "FetchError"; | ||
| this.url = typeof url === "string" ? new URL(url) : url; | ||
| this.response = response; | ||
| } | ||
| }; | ||
| /** | ||
| * Creates a request for the given URL. | ||
| * @param url The URL to create the request for. | ||
| * @param options The options for the request. | ||
| * @returns The created request. | ||
| * @internal | ||
| */ | ||
| function createActivityPubRequest(url, options = {}) { | ||
| return new Request(url, { | ||
| headers: { | ||
| Accept: "application/activity+json, application/ld+json", | ||
| "User-Agent": typeof options.userAgent === "string" ? options.userAgent : getUserAgent(options.userAgent) | ||
| }, | ||
| redirect: "manual" | ||
| }); | ||
| } | ||
| /** | ||
| * Gets the user agent string for the given application and URL. | ||
| * @param options The options for making the user agent string. | ||
| * @returns The user agent string. | ||
| * @since 1.3.0 | ||
| */ | ||
| function getUserAgent({ software, url } = {}) { | ||
| const fedify = `Fedify/${version}`; | ||
| const runtime = globalThis.Deno?.version?.deno != null ? `Deno/${Deno.version.deno}` : globalThis.process?.versions?.bun != null ? `Bun/${process.versions.bun}` : "navigator" in globalThis && navigator.userAgent === "Cloudflare-Workers" ? navigator.userAgent : globalThis.process?.versions?.node != null ? `Node.js/${process.versions.node}` : null; | ||
| const userAgent = software == null ? [fedify] : [software, fedify]; | ||
| if (runtime != null) userAgent.push(runtime); | ||
| if (url != null) userAgent.push(`+${url.toString()}`); | ||
| return `${userAgent.shift()} (${userAgent.join("; ")})`; | ||
| } | ||
| /** | ||
| * Logs the request. | ||
| * @param request The request to log. | ||
| * @internal | ||
| */ | ||
| function logRequest(logger, request) { | ||
| logger.debug("Fetching document: {method} {url} {headers}", { | ||
| method: request.method, | ||
| url: request.url, | ||
| headers: Object.fromEntries(request.headers.entries()) | ||
| }); | ||
| } | ||
| //#endregion | ||
| export { name as a, logRequest as i, createActivityPubRequest as n, version as o, getUserAgent as r, FetchError as t }; |
| const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.cjs"); | ||
| let node_process = require("node:process"); | ||
| node_process = require_rolldown_runtime.__toESM(node_process, 1); | ||
| //#region deno.json | ||
| var name = "@fedify/vocab-runtime"; | ||
| var version = "2.4.0-dev.1727+1eadcb04"; | ||
| //#endregion | ||
| //#region src/request.ts | ||
| /** | ||
| * Error thrown when fetching a JSON-LD document failed. | ||
| */ | ||
| var FetchError = class extends Error { | ||
| /** | ||
| * The URL that failed to fetch. | ||
| */ | ||
| url; | ||
| /** | ||
| * The HTTP response that failed, if available. | ||
| */ | ||
| response; | ||
| /** | ||
| * Constructs a new `FetchError`. | ||
| * | ||
| * @param url The URL that failed to fetch. | ||
| * @param message Error message. | ||
| * @param response The failed HTTP response, if available. | ||
| */ | ||
| constructor(url, message, response) { | ||
| super(message == null ? url.toString() : `${url}: ${message}`); | ||
| this.name = "FetchError"; | ||
| this.url = typeof url === "string" ? new URL(url) : url; | ||
| this.response = response; | ||
| } | ||
| }; | ||
| /** | ||
| * Creates a request for the given URL. | ||
| * @param url The URL to create the request for. | ||
| * @param options The options for the request. | ||
| * @returns The created request. | ||
| * @internal | ||
| */ | ||
| function createActivityPubRequest(url, options = {}) { | ||
| return new Request(url, { | ||
| headers: { | ||
| Accept: "application/activity+json, application/ld+json", | ||
| "User-Agent": typeof options.userAgent === "string" ? options.userAgent : getUserAgent(options.userAgent) | ||
| }, | ||
| redirect: "manual" | ||
| }); | ||
| } | ||
| /** | ||
| * Gets the user agent string for the given application and URL. | ||
| * @param options The options for making the user agent string. | ||
| * @returns The user agent string. | ||
| * @since 1.3.0 | ||
| */ | ||
| function getUserAgent({ software, url } = {}) { | ||
| const fedify = `Fedify/${version}`; | ||
| const runtime = globalThis.Deno?.version?.deno != null ? `Deno/${Deno.version.deno}` : globalThis.process?.versions?.bun != null ? `Bun/${node_process.default.versions.bun}` : "navigator" in globalThis && navigator.userAgent === "Cloudflare-Workers" ? navigator.userAgent : globalThis.process?.versions?.node != null ? `Node.js/${node_process.default.versions.node}` : null; | ||
| const userAgent = software == null ? [fedify] : [software, fedify]; | ||
| if (runtime != null) userAgent.push(runtime); | ||
| if (url != null) userAgent.push(`+${url.toString()}`); | ||
| return `${userAgent.shift()} (${userAgent.join("; ")})`; | ||
| } | ||
| /** | ||
| * Logs the request. | ||
| * @param request The request to log. | ||
| * @internal | ||
| */ | ||
| function logRequest(logger, request) { | ||
| logger.debug("Fetching document: {method} {url} {headers}", { | ||
| method: request.method, | ||
| url: request.url, | ||
| headers: Object.fromEntries(request.headers.entries()) | ||
| }); | ||
| } | ||
| //#endregion | ||
| Object.defineProperty(exports, "FetchError", { | ||
| enumerable: true, | ||
| get: function() { | ||
| return FetchError; | ||
| } | ||
| }); | ||
| Object.defineProperty(exports, "createActivityPubRequest", { | ||
| enumerable: true, | ||
| get: function() { | ||
| return createActivityPubRequest; | ||
| } | ||
| }); | ||
| Object.defineProperty(exports, "getUserAgent", { | ||
| enumerable: true, | ||
| get: function() { | ||
| return getUserAgent; | ||
| } | ||
| }); | ||
| Object.defineProperty(exports, "logRequest", { | ||
| enumerable: true, | ||
| get: function() { | ||
| return logRequest; | ||
| } | ||
| }); | ||
| Object.defineProperty(exports, "name", { | ||
| enumerable: true, | ||
| get: function() { | ||
| return name; | ||
| } | ||
| }); | ||
| Object.defineProperty(exports, "version", { | ||
| enumerable: true, | ||
| get: function() { | ||
| return version; | ||
| } | ||
| }); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
1863391
0.16%143
0.7%50010
0.2%