@fedify/relay 2.3.11-dev.2296 → 2.3.11

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,7 +1,7 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as exportSpki, r as getDocumentLoader, t as isRelayFollowerData } from "./types-KnxcShQP.js";
4
+ import { n as exportSpki, r as getDocumentLoader, t as isRelayFollowerData } from "./types-BDF04Dfz.js";
5
5
  import { MemoryKvStore, signRequest } from "@fedify/fedify";
6
6
  import { createRelay } from "@fedify/relay";
7
7
  import { Accept, Announce, Create, Delete, Follow, Move, Note, Person, Undo, Update } from "@fedify/vocab";
@@ -1,7 +1,7 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as exportSpki, r as getDocumentLoader, t as isRelayFollowerData } from "./types-KnxcShQP.js";
4
+ import { n as exportSpki, r as getDocumentLoader, t as isRelayFollowerData } from "./types-BDF04Dfz.js";
5
5
  import { MemoryKvStore, signRequest } from "@fedify/fedify";
6
6
  import { createRelay } from "@fedify/relay";
7
7
  import { Create, Delete, Follow, Move, Note, Person, Undo, Update } from "@fedify/vocab";
@@ -25738,6 +25738,44 @@ const preloadedContexts = {
25738
25738
  "@type": "@id"
25739
25739
  }
25740
25740
  } },
25741
+ "https://w3id.org/fep/6757": { "@context": {
25742
+ "license": {
25743
+ "@id": "http://purl.org/dc/terms/license",
25744
+ "@type": "@id"
25745
+ },
25746
+ "preferredLicense": {
25747
+ "@id": "https://w3id.org/fep/6757#preferredLicense",
25748
+ "@type": "@id"
25749
+ }
25750
+ } },
25751
+ "https://w3id.org/fep/22cd": { "@context": {
25752
+ "fep-22cd": "https://w3id.org/fep/22cd#",
25753
+ "schema": "https://schema.org/",
25754
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
25755
+ "translations": {
25756
+ "@id": "fep-22cd:translations",
25757
+ "@container": "@set"
25758
+ },
25759
+ "Translation": "fep-22cd:Translation",
25760
+ "sourceUpdated": {
25761
+ "@id": "fep-22cd:sourceUpdated",
25762
+ "@type": "xsd:dateTime"
25763
+ },
25764
+ "translator": {
25765
+ "@id": "schema:translator",
25766
+ "@type": "@id",
25767
+ "@container": "@set"
25768
+ },
25769
+ "inLanguage": "schema:inLanguage",
25770
+ "translationOfWork": {
25771
+ "@id": "schema:translationOfWork",
25772
+ "@type": "@id"
25773
+ },
25774
+ "isBasedOn": {
25775
+ "@id": "schema:isBasedOn",
25776
+ "@type": "@id"
25777
+ }
25778
+ } },
25741
25779
  "https://join-lemmy.org/context.json": { "@context": ["https://w3id.org/security/v1", {
25742
25780
  "as": "https://www.w3.org/ns/activitystreams#",
25743
25781
  "lemmy": "https://join-lemmy.org/ns#",
@@ -25789,7 +25827,7 @@ const preloadedContexts = {
25789
25827
  "suspended": "toot:suspended",
25790
25828
  "attributionDomains": {
25791
25829
  "@id": "toot:attributionDomains",
25792
- "@type": "@id"
25830
+ "@container": "@set"
25793
25831
  }
25794
25832
  } },
25795
25833
  "https://purl.archive.org/miscellany": { "@context": {
@@ -25805,7 +25843,7 @@ const preloadedContexts = {
25805
25843
  } }
25806
25844
  };
25807
25845
  var name = "@fedify/vocab-runtime";
25808
- var version = "2.3.11-dev.2296+29f4a6de";
25846
+ var version = "2.3.11";
25809
25847
  /**
25810
25848
  * Error thrown when fetching a JSON-LD document failed.
25811
25849
  */
@@ -26443,6 +26481,8 @@ async function getRemoteDocument(url, response, fetch) {
26443
26481
  * - <https://w3id.org/security/multikey/v1>
26444
26482
  * - <https://w3id.org/fep/ef61>
26445
26483
  * - <https://w3id.org/fep/7aa9>
26484
+ * - <https://w3id.org/fep/6757>
26485
+ * - <https://w3id.org/fep/22cd>
26446
26486
  * - <https://purl.archive.org/socialweb/webfinger>
26447
26487
  * - <http://schema.org/>
26448
26488
  * @param options Options for the document loader.
@@ -26793,6 +26833,48 @@ async function exportSpki(key) {
26793
26833
  pem = (pem.match(/.{1,64}/g) || []).join("\n");
26794
26834
  return `-----BEGIN PUBLIC KEY-----\n${pem}\n-----END PUBLIC KEY-----\n`;
26795
26835
  }
26836
+ const EXTLANG_PAIRS = new Set(Object.entries({
26837
+ ar: "aao abh abv acm acq acw acx acy adf aeb aec afb ajp apc apd arb arq ars ary arz auz avl ayh ayl ayn ayp bbz pga shu ssh",
26838
+ kok: "gom knn",
26839
+ lv: "ltg lvs",
26840
+ ms: "bjn btj bve bvu coa dup hji jak jax kvb kvr kxd lce lcf liw max meo mfa mfb min mqg msi mui orn ors pel pse tmw urk vkk vkt xmm zlm zmi zsm",
26841
+ sgn: "ads aed aen afg ajs ase asf asp asq asw bfi bfk bog bqn bqy bvl bzs cds csc csd cse csf csg csl csn csq csr csx doq dse dsl dsz dyl ecs ehs esl esn eso eth fcs fse fsl fss gds gse gsg gsm gss gus hab haf hds hks hos hps hsh hsl icl iks ils inl ins ise isg isr jcs jhs jks jls jos jsl jus kgi kvk lbs lgs lls lsb lsc lsg lsl lsn lso lsp lst lsv lsw lsy lws mdl mfs mre msd msr mzc mzg mzy nbs ncs nsi nsl nsp nsr nzs okl pgz pks prl prz psc psd psg psl pso psp psr pys rib rms rnb rsi rsl rsm rsn sdl sfb sfs sgg sgx slf sls sqk sqs sqx ssp ssr svk swl syy szs tse tsm tsq tss tsy tza ugn ugy ukl uks vgt vsi vsl vsv wbs xki xml xms yds ygs yhs ysl ysm zhk zib zsl",
26842
+ sw: "swc swh",
26843
+ uz: "uzn uzs",
26844
+ zh: "cdo cjy cmn cnp cpx csp czh czo gan hak hnm hsn luh lzh mnp nan sjc wuu yue"
26845
+ }).flatMap(([prefix, extlangs]) => extlangs.split(" ").map((extlang) => `${prefix}-${extlang}`)));
26846
+ const PREFIX_PATTERN = /^[A-Za-z]{2,3}$/;
26847
+ const EXTLANG_PATTERN = /^[A-Za-z]{3}$/;
26848
+ /**
26849
+ * Normalizes a BCP 47 language tag that has an extended language subtag
26850
+ * (extlang), such as `zh-yue`, into its canonical form, such as `yue`, as
26851
+ * described in [RFC 5646, Section 4.5][1]. `Intl.Locale` rejects extlang
26852
+ * tags, so tags should be normalized before being passed to it.
26853
+ *
26854
+ * Only registered extlangs that follow their registered prefix are removed;
26855
+ * any other tag is returned unchanged, so the result still needs to be
26856
+ * validated, e.g., by `Intl.Locale`.
26857
+ *
26858
+ * NOTE: This function is marked as internal in the 2.0.x–2.4.x patch
26859
+ * releases. When merging it into the *main* branch, remove the `@internal`
26860
+ * tag, formalize it as a public API (`@since 2.5.0`), and add it to
26861
+ * the changelog fragment.
26862
+ *
26863
+ * [1]: https://www.rfc-editor.org/rfc/rfc5646.html#section-4.5
26864
+ *
26865
+ * @param tag The BCP 47 language tag to normalize.
26866
+ * @returns The normalized language tag.
26867
+ * @internal
26868
+ */
26869
+ function normalizeLanguageTag(tag) {
26870
+ const subtags = tag.split("-");
26871
+ if (subtags.length < 2) return tag;
26872
+ const [prefix, extlang, ...rest] = subtags;
26873
+ if (!PREFIX_PATTERN.test(prefix) || !EXTLANG_PATTERN.test(extlang)) return tag;
26874
+ const language = extlang.toLowerCase();
26875
+ if (!EXTLANG_PAIRS.has(`${prefix.toLowerCase()}-${language}`)) return tag;
26876
+ return [language, ...rest].join("-");
26877
+ }
26796
26878
  /**
26797
26879
  * A language-tagged string which corresponds to the `rdf:langString` type.
26798
26880
  */
@@ -26806,11 +26888,13 @@ var LanguageString = class extends String {
26806
26888
  * Constructs a new `LanguageString`.
26807
26889
  * @param value A string value written in the given language.
26808
26890
  * @param language The language of the string. If a string is given, it will
26809
- * be parsed as a `Intl.Locale` object.
26891
+ * be parsed as a `Intl.Locale` object. Extended language
26892
+ * subtags are normalized first, e.g., `zh-yue` is parsed as
26893
+ * `yue`.
26810
26894
  */
26811
26895
  constructor(value, language) {
26812
26896
  super(value);
26813
- this.locale = typeof language === "string" ? new Intl.Locale(language) : language;
26897
+ this.locale = typeof language === "string" ? new Intl.Locale(normalizeLanguageTag(language)) : language;
26814
26898
  }
26815
26899
  };
26816
26900
  LanguageString.prototype[Symbol.for("Deno.customInspect")] = function(inspect, options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/relay",
3
- "version": "2.3.11-dev.2296+29f4a6de",
3
+ "version": "2.3.11",
4
4
  "description": "ActivityPub relay support for Fedify",
5
5
  "keywords": [
6
6
  "Fedify",
@@ -50,14 +50,14 @@
50
50
  "dependencies": {
51
51
  "@js-temporal/polyfill": "^0.5.1",
52
52
  "@logtape/logtape": "^2.2.0",
53
- "@fedify/fedify": "^2.3.11-dev.2296+29f4a6de",
54
- "@fedify/vocab": "2.3.11-dev.2296+29f4a6de"
53
+ "@fedify/fedify": "^2.3.11",
54
+ "@fedify/vocab": "2.3.11"
55
55
  },
56
56
  "devDependencies": {
57
57
  "tsdown": "^0.22.0",
58
58
  "typescript": "^6.0.0",
59
59
  "urlpattern-polyfill": "^10.1.0",
60
- "@fedify/vocab-runtime": "^2.3.11-dev.2296+29f4a6de"
60
+ "@fedify/vocab-runtime": "^2.3.11"
61
61
  },
62
62
  "scripts": {
63
63
  "build:self": "tsdown",