@fedify/vocab 2.3.7 → 2.3.9-dev.2048

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import "@js-temporal/polyfill";
2
2
  globalThis.addEventListener = () => {};
3
- import { B as __commonJSMin, E as Person, H as __toESM, P as Service, T as Organization, a as Application, m as Group } from "./vocab-DPf32Ky-.mjs";
3
+ import { B as __commonJSMin, E as Person, H as __toESM, P as Service, T as Organization, a as Application, m as Group } from "./vocab-BhXsxjRa.mjs";
4
4
  import { t as getTypeId } from "./type-Cf-vxmre.mjs";
5
5
  import { lookupWebFinger } from "@fedify/webfinger";
6
6
  import { SpanStatusCode, trace } from "@opentelemetry/api";
@@ -1206,7 +1206,7 @@ var esm_default = new class FetchMock {
1206
1206
  //#endregion
1207
1207
  //#region deno.json
1208
1208
  var name = "@fedify/vocab";
1209
- var version = "2.3.7";
1209
+ var version = "2.3.9-dev.2048+c88fcc8c";
1210
1210
  //#endregion
1211
1211
  //#region src/actor.ts
1212
1212
  const ACTOR_DISCOVERY_HISTOGRAM_BUCKETS = [
@@ -1,7 +1,7 @@
1
1
  import "@js-temporal/polyfill";
2
2
  globalThis.addEventListener = () => {};
3
- import { E as Person, P as Service, T as Organization, V as __exportAll, a as Application, m as Group } from "./vocab-DPf32Ky-.mjs";
4
- import { a as normalizeActorHandle, c as esm_default, i as isActor, n as getActorHandle, r as getActorTypeName, t as getActorClassByTypeName } from "./actor-CkefVvbl.mjs";
3
+ import { E as Person, P as Service, T as Organization, V as __exportAll, a as Application, m as Group } from "./vocab-BhXsxjRa.mjs";
4
+ import { a as normalizeActorHandle, c as esm_default, i as isActor, n as getActorHandle, r as getActorTypeName, t as getActorClassByTypeName } from "./actor-CGTlJCWj.mjs";
5
5
  import { createTestMeterProvider, test } from "@fedify/fixture";
6
6
  import { deepStrictEqual, ok, rejects, strictEqual, throws } from "node:assert/strict";
7
7
  //#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/precondition/PreconditionFailure.js
@@ -5643,50 +5643,50 @@ test({
5643
5643
  },
5644
5644
  async fn(t) {
5645
5645
  esm_default.spyGlobal();
5646
- esm_default.get("begin:https://foo.example.com/.well-known/webfinger?", {
5647
- body: { subject: "acct:johndoe@foo.example.com" },
5646
+ esm_default.get("begin:https://1.1.1.1/.well-known/webfinger?", {
5647
+ body: { subject: "acct:johndoe@1.1.1.1" },
5648
5648
  headers: { "Content-Type": "application/jrd+json" }
5649
5649
  });
5650
- const actorId = new URL("https://foo.example.com/@john");
5650
+ const actorId = new URL("https://1.1.1.1/@john");
5651
5651
  const actor = new Person({
5652
5652
  id: actorId,
5653
5653
  preferredUsername: "john"
5654
5654
  });
5655
5655
  await t.step("WebFinger subject", async () => {
5656
- deepStrictEqual(await getActorHandle(actor), "@johndoe@foo.example.com");
5657
- deepStrictEqual(await getActorHandle(actor, { trimLeadingAt: true }), "johndoe@foo.example.com");
5658
- deepStrictEqual(await getActorHandle(actorId), "@johndoe@foo.example.com");
5659
- deepStrictEqual(await getActorHandle(actorId, { trimLeadingAt: true }), "johndoe@foo.example.com");
5656
+ deepStrictEqual(await getActorHandle(actor), "@johndoe@1.1.1.1");
5657
+ deepStrictEqual(await getActorHandle(actor, { trimLeadingAt: true }), "johndoe@1.1.1.1");
5658
+ deepStrictEqual(await getActorHandle(actorId), "@johndoe@1.1.1.1");
5659
+ deepStrictEqual(await getActorHandle(actorId, { trimLeadingAt: true }), "johndoe@1.1.1.1");
5660
5660
  });
5661
5661
  esm_default.removeRoutes();
5662
- esm_default.get("begin:https://foo.example.com/.well-known/webfinger?", {
5662
+ esm_default.get("begin:https://1.1.1.1/.well-known/webfinger?", {
5663
5663
  body: {
5664
- subject: "https://foo.example.com/@john",
5665
- aliases: ["acct:john@bar.example.com", "acct:johndoe@foo.example.com"]
5664
+ subject: "https://1.1.1.1/@john",
5665
+ aliases: ["acct:john@8.8.8.8", "acct:johndoe@1.1.1.1"]
5666
5666
  },
5667
5667
  headers: { "Content-Type": "application/jrd+json" }
5668
5668
  });
5669
5669
  await t.step("WebFinger aliases", async () => {
5670
- deepStrictEqual(await getActorHandle(actor), "@johndoe@foo.example.com");
5671
- deepStrictEqual(await getActorHandle(actor, { trimLeadingAt: true }), "johndoe@foo.example.com");
5672
- deepStrictEqual(await getActorHandle(actorId), "@johndoe@foo.example.com");
5673
- deepStrictEqual(await getActorHandle(actorId, { trimLeadingAt: true }), "johndoe@foo.example.com");
5670
+ deepStrictEqual(await getActorHandle(actor), "@johndoe@1.1.1.1");
5671
+ deepStrictEqual(await getActorHandle(actor, { trimLeadingAt: true }), "johndoe@1.1.1.1");
5672
+ deepStrictEqual(await getActorHandle(actorId), "@johndoe@1.1.1.1");
5673
+ deepStrictEqual(await getActorHandle(actorId, { trimLeadingAt: true }), "johndoe@1.1.1.1");
5674
5674
  });
5675
- esm_default.get("begin:https://bar.example.com/.well-known/webfinger?", {
5675
+ esm_default.get("begin:https://8.8.8.8/.well-known/webfinger?", {
5676
5676
  body: {
5677
- subject: "acct:john@bar.example.com",
5678
- aliases: ["https://foo.example.com/@john"]
5677
+ subject: "acct:john@8.8.8.8",
5678
+ aliases: ["https://1.1.1.1/@john"]
5679
5679
  },
5680
5680
  headers: { "Content-Type": "application/jrd+json" }
5681
5681
  });
5682
5682
  await t.step("cross-origin WebFinger resources", async () => {
5683
- deepStrictEqual(await getActorHandle(actor), "@john@bar.example.com");
5683
+ deepStrictEqual(await getActorHandle(actor), "@john@8.8.8.8");
5684
5684
  });
5685
5685
  esm_default.removeRoutes();
5686
- esm_default.get("begin:https://foo.example.com/.well-known/webfinger?", { status: 404 });
5686
+ esm_default.get("begin:https://1.1.1.1/.well-known/webfinger?", { status: 404 });
5687
5687
  await t.step("no WebFinger", async () => {
5688
- deepStrictEqual(await getActorHandle(actor), "@john@foo.example.com");
5689
- rejects(() => getActorHandle(actorId), TypeError);
5688
+ deepStrictEqual(await getActorHandle(actor), "@john@1.1.1.1");
5689
+ await rejects(() => getActorHandle(actorId), TypeError);
5690
5690
  });
5691
5691
  esm_default.hardReset();
5692
5692
  }
@@ -5697,25 +5697,25 @@ test("getActorHandle() records activitypub.actor.discovery counter", { permissio
5697
5697
  } }, async (t) => {
5698
5698
  esm_default.spyGlobal();
5699
5699
  try {
5700
- const actorId = new URL("https://foo.example.com/@john");
5700
+ const actorId = new URL("https://1.1.1.1/@john");
5701
5701
  const actor = new Person({
5702
5702
  id: actorId,
5703
5703
  preferredUsername: "john"
5704
5704
  });
5705
5705
  await t.step("records result=resolved on a successful lookup", async () => {
5706
5706
  esm_default.removeRoutes();
5707
- esm_default.get("begin:https://foo.example.com/.well-known/webfinger?", {
5708
- body: { subject: "acct:johndoe@foo.example.com" },
5707
+ esm_default.get("begin:https://1.1.1.1/.well-known/webfinger?", {
5708
+ body: { subject: "acct:johndoe@1.1.1.1" },
5709
5709
  headers: { "Content-Type": "application/jrd+json" }
5710
5710
  });
5711
5711
  const [meterProvider, recorder] = createTestMeterProvider();
5712
- deepStrictEqual(await getActorHandle(actor, { meterProvider }), "@johndoe@foo.example.com");
5712
+ deepStrictEqual(await getActorHandle(actor, { meterProvider }), "@johndoe@1.1.1.1");
5713
5713
  const counters = recorder.getMeasurements("activitypub.actor.discovery");
5714
5714
  deepStrictEqual(counters.length, 1);
5715
5715
  deepStrictEqual(counters[0].type, "counter");
5716
5716
  deepStrictEqual(counters[0].value, 1);
5717
5717
  deepStrictEqual(counters[0].attributes["activitypub.actor.discovery.result"], "resolved");
5718
- deepStrictEqual(counters[0].attributes["activitypub.remote.host"], "foo.example.com");
5718
+ deepStrictEqual(counters[0].attributes["activitypub.remote.host"], "1.1.1.1");
5719
5719
  const durations = recorder.getMeasurements("activitypub.actor.discovery.duration");
5720
5720
  deepStrictEqual(durations.length, 1);
5721
5721
  deepStrictEqual(durations[0].type, "histogram");
@@ -5724,40 +5724,40 @@ test("getActorHandle() records activitypub.actor.discovery counter", { permissio
5724
5724
  });
5725
5725
  await t.step("records result=resolved when WebFinger is missing but preferredUsername fallback succeeds", async () => {
5726
5726
  esm_default.removeRoutes();
5727
- esm_default.get("begin:https://foo.example.com/.well-known/webfinger?", { status: 404 });
5727
+ esm_default.get("begin:https://1.1.1.1/.well-known/webfinger?", { status: 404 });
5728
5728
  const [meterProvider, recorder] = createTestMeterProvider();
5729
- deepStrictEqual(await getActorHandle(actor, { meterProvider }), "@john@foo.example.com");
5729
+ deepStrictEqual(await getActorHandle(actor, { meterProvider }), "@john@1.1.1.1");
5730
5730
  const counter = recorder.getMeasurement("activitypub.actor.discovery");
5731
5731
  ok(counter != null);
5732
5732
  deepStrictEqual(counter.attributes["activitypub.actor.discovery.result"], "resolved");
5733
5733
  });
5734
5734
  await t.step("records result=not_found when neither WebFinger nor preferredUsername yields a handle", async () => {
5735
5735
  esm_default.removeRoutes();
5736
- esm_default.get("begin:https://foo.example.com/.well-known/webfinger?", { status: 404 });
5736
+ esm_default.get("begin:https://1.1.1.1/.well-known/webfinger?", { status: 404 });
5737
5737
  const [meterProvider, recorder] = createTestMeterProvider();
5738
5738
  await rejects(() => getActorHandle(actorId, { meterProvider }), TypeError);
5739
5739
  const counter = recorder.getMeasurement("activitypub.actor.discovery");
5740
5740
  ok(counter != null);
5741
5741
  deepStrictEqual(counter.attributes["activitypub.actor.discovery.result"], "not_found");
5742
- deepStrictEqual(counter.attributes["activitypub.remote.host"], "foo.example.com");
5742
+ deepStrictEqual(counter.attributes["activitypub.remote.host"], "1.1.1.1");
5743
5743
  const duration = recorder.getMeasurement("activitypub.actor.discovery.duration");
5744
5744
  ok(duration != null);
5745
5745
  deepStrictEqual(duration.attributes["activitypub.actor.discovery.result"], "not_found");
5746
5746
  });
5747
5747
  await t.step("records non-default ports for actor IDs", async () => {
5748
5748
  esm_default.removeRoutes();
5749
- esm_default.get("begin:https://foo.example.com:8443/.well-known/webfinger?", { status: 404 });
5749
+ esm_default.get("begin:https://1.1.1.1:8443/.well-known/webfinger?", { status: 404 });
5750
5750
  const [meterProvider, recorder] = createTestMeterProvider();
5751
- await rejects(() => getActorHandle(new URL("https://foo.example.com:8443/@john"), { meterProvider }), TypeError);
5751
+ await rejects(() => getActorHandle(new URL("https://1.1.1.1:8443/@john"), { meterProvider }), TypeError);
5752
5752
  const counter = recorder.getMeasurement("activitypub.actor.discovery");
5753
5753
  ok(counter != null);
5754
- deepStrictEqual(counter.attributes["activitypub.remote.host"], "foo.example.com:8443");
5754
+ deepStrictEqual(counter.attributes["activitypub.remote.host"], "1.1.1.1:8443");
5755
5755
  });
5756
5756
  await t.step("records result=error when a malformed WebFinger alias throws TypeError", async () => {
5757
5757
  esm_default.removeRoutes();
5758
- esm_default.get("begin:https://foo.example.com/.well-known/webfinger?", {
5758
+ esm_default.get("begin:https://1.1.1.1/.well-known/webfinger?", {
5759
5759
  body: {
5760
- subject: "https://foo.example.com/@john",
5760
+ subject: "https://1.1.1.1/@john",
5761
5761
  aliases: ["acct:john@["]
5762
5762
  },
5763
5763
  headers: { "Content-Type": "application/jrd+json" }
@@ -5770,8 +5770,8 @@ test("getActorHandle() records activitypub.actor.discovery counter", { permissio
5770
5770
  });
5771
5771
  await t.step("propagates meterProvider into the nested webfinger.lookup", async () => {
5772
5772
  esm_default.removeRoutes();
5773
- esm_default.get("begin:https://foo.example.com/.well-known/webfinger?", {
5774
- body: { subject: "acct:johndoe@foo.example.com" },
5773
+ esm_default.get("begin:https://1.1.1.1/.well-known/webfinger?", {
5774
+ body: { subject: "acct:johndoe@1.1.1.1" },
5775
5775
  headers: { "Content-Type": "application/jrd+json" }
5776
5776
  });
5777
5777
  const [meterProvider, recorder] = createTestMeterProvider();
@@ -5782,8 +5782,8 @@ test("getActorHandle() records activitypub.actor.discovery counter", { permissio
5782
5782
  });
5783
5783
  await t.step("omits measurements when no meterProvider is provided", async () => {
5784
5784
  esm_default.removeRoutes();
5785
- esm_default.get("begin:https://foo.example.com/.well-known/webfinger?", {
5786
- body: { subject: "acct:johndoe@foo.example.com" },
5785
+ esm_default.get("begin:https://1.1.1.1/.well-known/webfinger?", {
5786
+ body: { subject: "acct:johndoe@1.1.1.1" },
5787
5787
  headers: { "Content-Type": "application/jrd+json" }
5788
5788
  });
5789
5789
  const [_unused, recorder] = createTestMeterProvider();
@@ -1,7 +1,7 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  globalThis.addEventListener = () => {};
3
- import { E as Person, S as Object$1, o as Collection, x as Note } from "./vocab-DPf32Ky-.mjs";
4
- import { c as esm_default, i as isActor, o as name, s as version } from "./actor-CkefVvbl.mjs";
3
+ import { E as Person, S as Object$1, o as Collection, x as Note } from "./vocab-BhXsxjRa.mjs";
4
+ import { c as esm_default, i as isActor, o as name, s as version } from "./actor-CGTlJCWj.mjs";
5
5
  import { t as getTypeId } from "./type-Cf-vxmre.mjs";
6
6
  import { t as assertInstanceOf } from "./utils-CE8Dk5hm.mjs";
7
7
  import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
@@ -1,6 +1,6 @@
1
1
  import "@js-temporal/polyfill";
2
2
  globalThis.addEventListener = () => {};
3
- import { E as Person, L as getEntityTypeById, R as isEntityType, y as Link } from "./vocab-DPf32Ky-.mjs";
3
+ import { E as Person, L as getEntityTypeById, R as isEntityType, y as Link } from "./vocab-BhXsxjRa.mjs";
4
4
  import { t as getTypeId } from "./type-Cf-vxmre.mjs";
5
5
  import { test } from "@fedify/fixture";
6
6
  import { deepStrictEqual } from "node:assert/strict";