@treeviz/gedcom-parser 2.1.17 → 2.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/classes/common.d.ts +19 -1
- package/dist/classes/common.d.ts.map +1 -1
- package/dist/classes/index.js +276 -80
- package/dist/classes/indi.d.ts +3 -2
- package/dist/classes/indi.d.ts.map +1 -1
- package/dist/classes/obje.d.ts +1 -1
- package/dist/classes/obje.d.ts.map +1 -1
- package/dist/cli/index.js +277 -80
- package/dist/constants/index.js +255 -61
- package/dist/factories/index.js +255 -61
- package/dist/index.js +281 -83
- package/dist/kinship-translator/index.js +255 -61
- package/dist/kinship-translator/kinship-translator.en.d.ts.map +1 -1
- package/dist/kinship-translator/kinship-translator.hu.d.ts.map +1 -1
- package/dist/kinship-translator/kinship-translator.ja.d.ts.map +1 -1
- package/dist/kinship-translator/patterns.hu.d.ts +12 -1
- package/dist/kinship-translator/patterns.hu.d.ts.map +1 -1
- package/dist/utils/gedzip.d.ts.map +1 -1
- package/dist/utils/index.js +281 -83
- package/dist/utils/media-utils.d.ts +10 -0
- package/dist/utils/media-utils.d.ts.map +1 -1
- package/dist/utils/multimedia.d.ts +5 -0
- package/dist/utils/multimedia.d.ts.map +1 -1
- package/dist/utils/parser.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/classes/common.d.ts
CHANGED
|
@@ -64,8 +64,10 @@ export declare class Common<T = string, I extends IdType = IdType> implements IC
|
|
|
64
64
|
toGedcom(tag?: MultiTag, level?: number, options?: ConvertOptions): string;
|
|
65
65
|
toGedcomLines(tag?: MultiTag, level?: number, options?: ConvertOptions): string[];
|
|
66
66
|
getHeadRecord(): Common | undefined;
|
|
67
|
-
|
|
67
|
+
private unwrapHeadRecord;
|
|
68
|
+
getOriginalHeadRecord(): Common<string, IdType> | undefined;
|
|
68
69
|
getSourceHeads(): Common<string, IdType>[];
|
|
70
|
+
private sourceHeadField;
|
|
69
71
|
getFromSourceHeads<T = unknown>(path: string): T | undefined;
|
|
70
72
|
private sourStartsWith;
|
|
71
73
|
isGenoPro(): boolean;
|
|
@@ -73,6 +75,22 @@ export declare class Common<T = string, I extends IdType = IdType> implements IC
|
|
|
73
75
|
isGeni(): boolean;
|
|
74
76
|
isAncestry(): boolean;
|
|
75
77
|
isMyHeritage(): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* GEDCOM root for Ancestry media helpers.
|
|
80
|
+
* `this._gedcom` when called on a child record; `this` when called on the file root.
|
|
81
|
+
*
|
|
82
|
+
* Cannot use `instanceof GedCom`: `GedComType` is a type alias (erased at runtime),
|
|
83
|
+
* and importing the `GedCom` class here would cycle (`GedCom extends Common`).
|
|
84
|
+
* The root is the only Common with an `objes()` method.
|
|
85
|
+
*/
|
|
86
|
+
private hostGedcom;
|
|
87
|
+
/** True when the file still has Ancestry tree media (`_ORIG acom`, `_OID`, retrieval URL). */
|
|
88
|
+
hasAncestryOriginMedia(): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Namespace for Ancestry tree photos. Prefer a `namespaces/{id}` FILE URL
|
|
91
|
+
* (TreeViz GEDCOM 7 / GEDZIP export), otherwise 1093 for member-tree media.
|
|
92
|
+
*/
|
|
93
|
+
getAncestryMediaNamespace(): number | undefined;
|
|
76
94
|
/**
|
|
77
95
|
* Get the source type as a string (for prefixing tree IDs and names)
|
|
78
96
|
* Returns the detected source type or undefined if unknown
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/classes/common.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAEhD,OAAO,KAAK,EAAO,MAAM,EAAE,QAAQ,EAAW,OAAO,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/classes/common.ts"],"names":[],"mappings":"AA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AI,QAAQ,MAAM,KAAG,MAAM,IAAI,MAE/C,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,MAAM,EAAE,KAAK,CAAC,kBAqBhD,CAAC"}
|
package/dist/classes/index.js
CHANGED
|
@@ -160,6 +160,30 @@ var mediaIdValue = (obje, path) => {
|
|
|
160
160
|
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
161
161
|
};
|
|
162
162
|
var resolveObjeMediaId = (obje) => mediaIdValue(obje, "RIN") || mediaIdValue(obje, "_CLON._OID") || mediaIdValue(obje, "_MSER._LKID") || mediaIdValue(obje, "_OID") || mediaIdValue(obje, "_LKID");
|
|
163
|
+
var ANCESTRY_TREE_MEDIA_NAMESPACE = 1093;
|
|
164
|
+
var ANCESTRY_NAMESPACE_IN_URL = /\/namespaces\/(\d+)\/media\//i;
|
|
165
|
+
var parseAncestryNamespaceFromUrl = (url) => {
|
|
166
|
+
if (!url) {
|
|
167
|
+
return void 0;
|
|
168
|
+
}
|
|
169
|
+
const match = url.match(ANCESTRY_NAMESPACE_IN_URL);
|
|
170
|
+
const namespace = match?.[1] ? Number(match[1]) : NaN;
|
|
171
|
+
return Number.isFinite(namespace) ? namespace : void 0;
|
|
172
|
+
};
|
|
173
|
+
var isAncestryOriginObje = (obje) => {
|
|
174
|
+
if (!obje) {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
const orig = mediaIdValue(obje, "_ORIG");
|
|
178
|
+
if (orig?.toLowerCase() === "acom") {
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
181
|
+
const file = mediaIdValue(obje, "FILE") ?? "";
|
|
182
|
+
if (parseAncestryNamespaceFromUrl(file)) {
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
return Boolean(resolveObjeMediaId(obje) && !file.trim());
|
|
186
|
+
};
|
|
163
187
|
var ANCESTRY_MEDIA_RETRIEVAL_PREFIX = "https://www.ancestry.com/api/media/retrieval/v2/image";
|
|
164
188
|
var ANCESTRY_MEDIA_QUERY = "client=trees-mediaservice&imageQuality=hq";
|
|
165
189
|
var ancestryMediaPath = (namespace, imgId) => `/namespaces/${namespace}/media/${imgId}?${ANCESTRY_MEDIA_QUERY}`;
|
|
@@ -953,8 +977,25 @@ var Common = class _Common {
|
|
|
953
977
|
getHeadRecord() {
|
|
954
978
|
return get(this, "HEAD") || get(this.getGedcom(), "HEAD");
|
|
955
979
|
}
|
|
980
|
+
unwrapHeadRecord(node) {
|
|
981
|
+
if (!node) {
|
|
982
|
+
return void 0;
|
|
983
|
+
}
|
|
984
|
+
const common = node instanceof List ? node.index(0) : node;
|
|
985
|
+
if (!common || typeof common.get !== "function") {
|
|
986
|
+
return void 0;
|
|
987
|
+
}
|
|
988
|
+
const nested = common.get("HEAD");
|
|
989
|
+
if (nested instanceof List) {
|
|
990
|
+
return nested.index(0) ?? common;
|
|
991
|
+
}
|
|
992
|
+
if (nested instanceof _Common) {
|
|
993
|
+
return nested;
|
|
994
|
+
}
|
|
995
|
+
return common;
|
|
996
|
+
}
|
|
956
997
|
getOriginalHeadRecord() {
|
|
957
|
-
return get(this, ORIG_HEAD_TAG) || get(this.getGedcom(), ORIG_HEAD_TAG) || get(this.getHeadRecord(), ORIG_HEAD_TAG);
|
|
998
|
+
return this.unwrapHeadRecord(get(this, ORIG_HEAD_TAG)) || this.unwrapHeadRecord(get(this.getGedcom(), ORIG_HEAD_TAG)) || this.unwrapHeadRecord(get(this.getHeadRecord(), ORIG_HEAD_TAG));
|
|
958
999
|
}
|
|
959
1000
|
getSourceHeads() {
|
|
960
1001
|
const heads = [this.getOriginalHeadRecord(), this.getHeadRecord()];
|
|
@@ -962,9 +1003,23 @@ var Common = class _Common {
|
|
|
962
1003
|
return Boolean(head && heads.indexOf(head) === index);
|
|
963
1004
|
});
|
|
964
1005
|
}
|
|
1006
|
+
sourceHeadField(head, path) {
|
|
1007
|
+
const normalized = path.endsWith(".value") ? path.slice(0, -".value".length) : path;
|
|
1008
|
+
const node = head.get(normalized);
|
|
1009
|
+
if (!node) {
|
|
1010
|
+
return void 0;
|
|
1011
|
+
}
|
|
1012
|
+
if (node instanceof List) {
|
|
1013
|
+
return node.index(0)?.toValue();
|
|
1014
|
+
}
|
|
1015
|
+
if (typeof node.toValue === "function") {
|
|
1016
|
+
return node.toValue();
|
|
1017
|
+
}
|
|
1018
|
+
return void 0;
|
|
1019
|
+
}
|
|
965
1020
|
getFromSourceHeads(path) {
|
|
966
1021
|
for (const head of this.getSourceHeads()) {
|
|
967
|
-
const value =
|
|
1022
|
+
const value = this.sourceHeadField(head, path);
|
|
968
1023
|
if (value !== void 0 && value !== null && value !== "") {
|
|
969
1024
|
return value;
|
|
970
1025
|
}
|
|
@@ -973,8 +1028,8 @@ var Common = class _Common {
|
|
|
973
1028
|
}
|
|
974
1029
|
sourStartsWith(prefix) {
|
|
975
1030
|
return this.getSourceHeads().some((head) => {
|
|
976
|
-
const sour =
|
|
977
|
-
return
|
|
1031
|
+
const sour = this.sourceHeadField(head, "SOUR");
|
|
1032
|
+
return typeof sour === "string" && sour.toLowerCase().startsWith(prefix);
|
|
978
1033
|
});
|
|
979
1034
|
}
|
|
980
1035
|
isGenoPro() {
|
|
@@ -984,7 +1039,7 @@ var Common = class _Common {
|
|
|
984
1039
|
return this.sourStartsWith("ahnenblatt");
|
|
985
1040
|
}
|
|
986
1041
|
isGeni() {
|
|
987
|
-
return this.sourStartsWith("geni");
|
|
1042
|
+
return this.sourStartsWith("geni.com");
|
|
988
1043
|
}
|
|
989
1044
|
isAncestry() {
|
|
990
1045
|
return this.sourStartsWith("ancestry");
|
|
@@ -992,6 +1047,51 @@ var Common = class _Common {
|
|
|
992
1047
|
isMyHeritage() {
|
|
993
1048
|
return this.sourStartsWith("myheritage");
|
|
994
1049
|
}
|
|
1050
|
+
/**
|
|
1051
|
+
* GEDCOM root for Ancestry media helpers.
|
|
1052
|
+
* `this._gedcom` when called on a child record; `this` when called on the file root.
|
|
1053
|
+
*
|
|
1054
|
+
* Cannot use `instanceof GedCom`: `GedComType` is a type alias (erased at runtime),
|
|
1055
|
+
* and importing the `GedCom` class here would cycle (`GedCom extends Common`).
|
|
1056
|
+
* The root is the only Common with an `objes()` method.
|
|
1057
|
+
*/
|
|
1058
|
+
hostGedcom() {
|
|
1059
|
+
const linked = this.getGedcom();
|
|
1060
|
+
if (linked) {
|
|
1061
|
+
return linked;
|
|
1062
|
+
}
|
|
1063
|
+
if ("objes" in this && typeof this.objes === "function") {
|
|
1064
|
+
return this;
|
|
1065
|
+
}
|
|
1066
|
+
return void 0;
|
|
1067
|
+
}
|
|
1068
|
+
/** True when the file still has Ancestry tree media (`_ORIG acom`, `_OID`, retrieval URL). */
|
|
1069
|
+
hasAncestryOriginMedia() {
|
|
1070
|
+
const objes = this.hostGedcom()?.objes?.();
|
|
1071
|
+
return objes?.values().some((obje) => isAncestryOriginObje(obje)) ?? false;
|
|
1072
|
+
}
|
|
1073
|
+
/**
|
|
1074
|
+
* Namespace for Ancestry tree photos. Prefer a `namespaces/{id}` FILE URL
|
|
1075
|
+
* (TreeViz GEDCOM 7 / GEDZIP export), otherwise 1093 for member-tree media.
|
|
1076
|
+
*/
|
|
1077
|
+
getAncestryMediaNamespace() {
|
|
1078
|
+
const objes = this.hostGedcom()?.objes?.();
|
|
1079
|
+
if (objes) {
|
|
1080
|
+
for (const obje of objes.values()) {
|
|
1081
|
+
const file = obje?.get("FILE")?.toValue();
|
|
1082
|
+
const fromUrl = parseAncestryNamespaceFromUrl(
|
|
1083
|
+
typeof file === "string" ? file : void 0
|
|
1084
|
+
);
|
|
1085
|
+
if (fromUrl) {
|
|
1086
|
+
return fromUrl;
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
if (this.isAncestry() || this.hasAncestryOriginMedia()) {
|
|
1091
|
+
return ANCESTRY_TREE_MEDIA_NAMESPACE;
|
|
1092
|
+
}
|
|
1093
|
+
return void 0;
|
|
1094
|
+
}
|
|
995
1095
|
/**
|
|
996
1096
|
* Get the source type as a string (for prefixing tree IDs and names)
|
|
997
1097
|
* Returns the detected source type or undefined if unknown
|
|
@@ -1008,13 +1108,13 @@ var Common = class _Common {
|
|
|
1008
1108
|
}
|
|
1009
1109
|
isFamilySearch() {
|
|
1010
1110
|
return this.getSourceHeads().some((head) => {
|
|
1011
|
-
const sourName =
|
|
1111
|
+
const sourName = this.sourceHeadField(head, "SOUR.NAME");
|
|
1012
1112
|
return sourName === "FamilySearch API";
|
|
1013
1113
|
});
|
|
1014
1114
|
}
|
|
1015
1115
|
isGNO2GED() {
|
|
1016
1116
|
return this.getSourceHeads().some((head) => {
|
|
1017
|
-
const sour =
|
|
1117
|
+
const sour = this.sourceHeadField(head, "SOUR");
|
|
1018
1118
|
return sour === "GNO2GED";
|
|
1019
1119
|
});
|
|
1020
1120
|
}
|
|
@@ -1059,8 +1159,7 @@ var Common = class _Common {
|
|
|
1059
1159
|
return this.getFromSourceHeads("SOUR._TREE.value") || (get(this, "HEAD.SOUR._TREE.value") || get(this.getGedcom(), "HEAD.SOUR._TREE.value"));
|
|
1060
1160
|
}
|
|
1061
1161
|
getMyHeritageTreeName() {
|
|
1062
|
-
const
|
|
1063
|
-
const treeDetails = get(this, path) || get(this.getGedcom(), path);
|
|
1162
|
+
const treeDetails = this.getFromSourceHeads("FILE.value") || (get(this, "HEAD.FILE.value") || get(this.getGedcom(), "HEAD.FILE.value"));
|
|
1064
1163
|
return treeDetails?.match(
|
|
1065
1164
|
/Exported by MyHeritage.com from (?<tree>.+) in.+$/
|
|
1066
1165
|
)?.groups?.tree;
|
|
@@ -1077,7 +1176,7 @@ var Common = class _Common {
|
|
|
1077
1176
|
if (treeName) {
|
|
1078
1177
|
return treeName;
|
|
1079
1178
|
}
|
|
1080
|
-
const fileName = get(this, "HEAD.FILE.value") || get(this.getGedcom(), "HEAD.FILE.value");
|
|
1179
|
+
const fileName = this.getFromSourceHeads("FILE.value") || get(this, "HEAD.FILE.value") || get(this.getGedcom(), "HEAD.FILE.value");
|
|
1081
1180
|
return fileName || "FamilySearch Import";
|
|
1082
1181
|
}
|
|
1083
1182
|
getAhnenblattTreeId() {
|
|
@@ -1568,11 +1667,28 @@ var KinshipTranslatorBasic = class {
|
|
|
1568
1667
|
// src/kinship-translator/patterns.hu.ts
|
|
1569
1668
|
var parentRelationsHu = {
|
|
1570
1669
|
step: "mostoha",
|
|
1571
|
-
foster: "nevelt",
|
|
1670
|
+
foster: { ancestor: "nevel\u0151", other: "nevelt" },
|
|
1572
1671
|
birth: "v\xE9rszerinti",
|
|
1573
1672
|
biological: "v\xE9rszerinti",
|
|
1574
|
-
adopted: "\xF6r\xF6kbefogadott"
|
|
1673
|
+
adopted: { ancestor: "\xF6r\xF6kbefogad\xF3", other: "\xF6r\xF6kbefogadott" }
|
|
1575
1674
|
};
|
|
1675
|
+
var parentRelationPrefix = (relation, ancestor) => {
|
|
1676
|
+
const label = parentRelationsHu[relation];
|
|
1677
|
+
if (!label) {
|
|
1678
|
+
return;
|
|
1679
|
+
}
|
|
1680
|
+
if (typeof label === "string") {
|
|
1681
|
+
return label;
|
|
1682
|
+
}
|
|
1683
|
+
return ancestor ? label.ancestor : label.other;
|
|
1684
|
+
};
|
|
1685
|
+
var parentRelationModifiers = [
|
|
1686
|
+
...new Set(
|
|
1687
|
+
Object.values(parentRelationsHu).flatMap(
|
|
1688
|
+
(label) => typeof label === "string" ? [label] : [label.ancestor, label.other]
|
|
1689
|
+
)
|
|
1690
|
+
)
|
|
1691
|
+
].join("|");
|
|
1576
1692
|
var nominativus = {
|
|
1577
1693
|
apa: { nominativus: "apa", dativus: "apj\xE1nak", possessivus: "apja" },
|
|
1578
1694
|
anya: { nominativus: "anya", dativus: "anyj\xE1nak", possessivus: "anyja" },
|
|
@@ -1650,15 +1766,9 @@ var casesHu = {
|
|
|
1650
1766
|
var InLawsHu = {
|
|
1651
1767
|
"gyermek feles\xE9ge": "meny",
|
|
1652
1768
|
"gyermek f\xE9rje": "v\u0151",
|
|
1653
|
-
[`(f\xE9rj|feles\xE9g) (?<mod1>(${
|
|
1654
|
-
|
|
1655
|
-
)}) )?
|
|
1656
|
-
[`(f\xE9rj|feles\xE9g) (?<mod1>(${Object.values(parentRelationsHu).join(
|
|
1657
|
-
"|"
|
|
1658
|
-
)}) )?apja`]: "ap\xF3s",
|
|
1659
|
-
[`(f\xE9rj|feles\xE9g) (?<mod1>(${Object.values(parentRelationsHu).join(
|
|
1660
|
-
"|"
|
|
1661
|
-
)}) )?(f\xE9l)?testv\xE9re`]: (indi) => {
|
|
1769
|
+
[`(f\xE9rj|feles\xE9g) (?<mod1>(${parentRelationModifiers}) )?anyja`]: "any\xF3s",
|
|
1770
|
+
[`(f\xE9rj|feles\xE9g) (?<mod1>(${parentRelationModifiers}) )?apja`]: "ap\xF3s",
|
|
1771
|
+
[`(f\xE9rj|feles\xE9g) (?<mod1>(${parentRelationModifiers}) )?(f\xE9l)?testv\xE9re`]: (indi) => {
|
|
1662
1772
|
if (indi?.isMale()) {
|
|
1663
1773
|
return "s\xF3gor";
|
|
1664
1774
|
}
|
|
@@ -1935,7 +2045,12 @@ var KinshipTranslatorHU = class extends KinshipTranslatorBasic {
|
|
|
1935
2045
|
if (!relation || !this.pathN?.relation) {
|
|
1936
2046
|
return relation ?? "";
|
|
1937
2047
|
}
|
|
1938
|
-
|
|
2048
|
+
const isAncestor = (this.pathN.level ?? 0) > 0 && (this.pathN.degree ?? 0) === 0;
|
|
2049
|
+
const prefix = parentRelationPrefix(this.pathN.relation, isAncestor);
|
|
2050
|
+
if (!prefix) {
|
|
2051
|
+
return relation;
|
|
2052
|
+
}
|
|
2053
|
+
return `${prefix} ${relation}`;
|
|
1939
2054
|
}
|
|
1940
2055
|
};
|
|
1941
2056
|
|
|
@@ -2135,6 +2250,10 @@ var KinshipTranslatorEn = class extends KinshipTranslatorBasic {
|
|
|
2135
2250
|
if (!relation || !this.pathN?.relation) {
|
|
2136
2251
|
return relation ?? "";
|
|
2137
2252
|
}
|
|
2253
|
+
if (this.pathN.relation === "adopted") {
|
|
2254
|
+
const isAncestor = (this.pathN.level ?? 0) > 0 && (this.pathN.degree ?? 0) === 0;
|
|
2255
|
+
return `${isAncestor ? "adoptive" : "adopted"} ${relation}`;
|
|
2256
|
+
}
|
|
2138
2257
|
return `${this.pathN.relation} ${relation}`;
|
|
2139
2258
|
}
|
|
2140
2259
|
};
|
|
@@ -3293,6 +3412,39 @@ var lineal = (level, sex, kind) => {
|
|
|
3293
3412
|
}
|
|
3294
3413
|
return `${L - 1}\u4E16\u306E\u5B6B`;
|
|
3295
3414
|
};
|
|
3415
|
+
var adoptedRelation = (relation) => {
|
|
3416
|
+
if (relation === "\u7236") {
|
|
3417
|
+
return "\u990A\u7236";
|
|
3418
|
+
}
|
|
3419
|
+
if (relation === "\u6BCD") {
|
|
3420
|
+
return "\u990A\u6BCD";
|
|
3421
|
+
}
|
|
3422
|
+
if (relation === "\u89AA") {
|
|
3423
|
+
return "\u990A\u89AA";
|
|
3424
|
+
}
|
|
3425
|
+
if (relation === "\u606F\u5B50" || relation === "\u5B50") {
|
|
3426
|
+
return "\u990A\u5B50";
|
|
3427
|
+
}
|
|
3428
|
+
if (relation === "\u5A18") {
|
|
3429
|
+
return "\u990A\u5973";
|
|
3430
|
+
}
|
|
3431
|
+
return `\u990A${relation}`;
|
|
3432
|
+
};
|
|
3433
|
+
var fosterRelation = (relation) => {
|
|
3434
|
+
if (relation === "\u7236") {
|
|
3435
|
+
return "\u91CC\u7236";
|
|
3436
|
+
}
|
|
3437
|
+
if (relation === "\u6BCD") {
|
|
3438
|
+
return "\u91CC\u6BCD";
|
|
3439
|
+
}
|
|
3440
|
+
if (relation === "\u89AA") {
|
|
3441
|
+
return "\u91CC\u89AA";
|
|
3442
|
+
}
|
|
3443
|
+
if (relation === "\u606F\u5B50" || relation === "\u5A18" || relation === "\u5B50") {
|
|
3444
|
+
return "\u91CC\u5B50";
|
|
3445
|
+
}
|
|
3446
|
+
return `\u91CC${relation}`;
|
|
3447
|
+
};
|
|
3296
3448
|
var cousinPlain = (degree) => {
|
|
3297
3449
|
if (degree <= 1) {
|
|
3298
3450
|
return "\u3044\u3068\u3053";
|
|
@@ -3452,10 +3604,10 @@ var KinshipTranslatorJa = class extends KinshipTranslatorBasic {
|
|
|
3452
3604
|
return `\u7D99${relation}`;
|
|
3453
3605
|
}
|
|
3454
3606
|
if (this.pathN.relation === "adopted") {
|
|
3455
|
-
return
|
|
3607
|
+
return adoptedRelation(relation);
|
|
3456
3608
|
}
|
|
3457
3609
|
if (this.pathN.relation === "foster") {
|
|
3458
|
-
return
|
|
3610
|
+
return fosterRelation(relation);
|
|
3459
3611
|
}
|
|
3460
3612
|
return relation;
|
|
3461
3613
|
}
|
|
@@ -5324,6 +5476,44 @@ var resolveLocalMediaUrl = async (path, context) => {
|
|
|
5324
5476
|
};
|
|
5325
5477
|
var implemented = (type, ...args) => {
|
|
5326
5478
|
};
|
|
5479
|
+
|
|
5480
|
+
// src/utils/multimedia.ts
|
|
5481
|
+
var inferMediaForm = (file, fallback = "bin") => {
|
|
5482
|
+
const withoutQuery = file.split("?")[0] || file;
|
|
5483
|
+
const ext = getFileExtension(withoutQuery);
|
|
5484
|
+
if (ext) {
|
|
5485
|
+
return ext.toLowerCase() === "jpeg" ? "jpg" : ext.toLowerCase();
|
|
5486
|
+
}
|
|
5487
|
+
return fallback;
|
|
5488
|
+
};
|
|
5489
|
+
var mergeMediaLists = (...lists) => {
|
|
5490
|
+
const merged = {};
|
|
5491
|
+
for (const list of lists) {
|
|
5492
|
+
if (!list) continue;
|
|
5493
|
+
Object.assign(merged, list);
|
|
5494
|
+
}
|
|
5495
|
+
return merged;
|
|
5496
|
+
};
|
|
5497
|
+
var mergeMediaListsByObjeKey = (...lists) => {
|
|
5498
|
+
const merged = {};
|
|
5499
|
+
const seen = /* @__PURE__ */ new Set();
|
|
5500
|
+
for (const list of lists) {
|
|
5501
|
+
if (!list) {
|
|
5502
|
+
continue;
|
|
5503
|
+
}
|
|
5504
|
+
for (const [id, item] of Object.entries(list)) {
|
|
5505
|
+
const objeKey = item.key ? String(item.key) : "";
|
|
5506
|
+
if (objeKey && seen.has(objeKey)) {
|
|
5507
|
+
continue;
|
|
5508
|
+
}
|
|
5509
|
+
merged[id] = item;
|
|
5510
|
+
if (objeKey) {
|
|
5511
|
+
seen.add(objeKey);
|
|
5512
|
+
}
|
|
5513
|
+
}
|
|
5514
|
+
}
|
|
5515
|
+
return merged;
|
|
5516
|
+
};
|
|
5327
5517
|
var uniqueItemsCache = /* @__PURE__ */ new WeakMap();
|
|
5328
5518
|
var setNestedGroup = (obj, key, value, uniqueCounting = true) => {
|
|
5329
5519
|
const parts = Array.isArray(key) ? key : key.split(/,\s*/);
|
|
@@ -6069,10 +6259,12 @@ var relativesOnLevelCache = relativesCache("relativesOnLevelCache");
|
|
|
6069
6259
|
var relativesOnDegreeCache = relativesCache("relativesOnDegreeCache");
|
|
6070
6260
|
var Indi = class extends Common {
|
|
6071
6261
|
toName() {
|
|
6072
|
-
|
|
6262
|
+
const name = this.get("NAME");
|
|
6263
|
+
const value = name?.index(0)?.toValue() ?? name?.toValue();
|
|
6264
|
+
return typeof value === "string" ? value : void 0;
|
|
6073
6265
|
}
|
|
6074
6266
|
toNaturalName() {
|
|
6075
|
-
return this.
|
|
6267
|
+
return this.toName()?.replaceAll("/", "");
|
|
6076
6268
|
}
|
|
6077
6269
|
toList() {
|
|
6078
6270
|
return new Individuals().concat(
|
|
@@ -6555,7 +6747,10 @@ var Indi = class extends Common {
|
|
|
6555
6747
|
return result;
|
|
6556
6748
|
}
|
|
6557
6749
|
ancestryLink() {
|
|
6558
|
-
|
|
6750
|
+
let www = this.getFromSourceHeads("SOUR.CORP.WWW.value") || this._gedcom?.HEAD?.SOUR?.CORP?.WWW?.value;
|
|
6751
|
+
if (!www || /treeviz/i.test(String(www))) {
|
|
6752
|
+
www = "www.ancestry.com";
|
|
6753
|
+
}
|
|
6559
6754
|
const tree = this.getAncestryTreeId();
|
|
6560
6755
|
if (this.id) {
|
|
6561
6756
|
return `https://${www}/family-tree/person/tree/${tree}/person/${this.id.replace(
|
|
@@ -6567,14 +6762,15 @@ var Indi = class extends Common {
|
|
|
6567
6762
|
async ancestryMedia(namespace) {
|
|
6568
6763
|
const list = {};
|
|
6569
6764
|
const objeList = this.get("OBJE")?.toList().copy();
|
|
6570
|
-
|
|
6765
|
+
this.getFromSourceHeads("SOUR.CORP.WWW.value") || this._gedcom?.HEAD?.SOUR?.CORP?.WWW?.value;
|
|
6571
6766
|
const tree = this.getAncestryTreeId();
|
|
6767
|
+
const usedNamespace = namespace || this.getAncestryMediaNamespace() || ANCESTRY_TREE_MEDIA_NAMESPACE;
|
|
6572
6768
|
if (objeList) {
|
|
6573
6769
|
await Promise.all(
|
|
6574
6770
|
objeList.map(async (objeRef) => {
|
|
6575
6771
|
const key = objeXrefKey(objeRef, 0);
|
|
6576
6772
|
const obje = objeRef?.standardizeMedia(
|
|
6577
|
-
|
|
6773
|
+
usedNamespace,
|
|
6578
6774
|
true,
|
|
6579
6775
|
ancestryMediaFileUrl
|
|
6580
6776
|
);
|
|
@@ -6586,27 +6782,9 @@ var Indi = class extends Common {
|
|
|
6586
6782
|
const type = resolveObjeForm(obje) ?? (url ? getFileExtension(url) : void 0) ?? "raw";
|
|
6587
6783
|
let imgId = media;
|
|
6588
6784
|
const hasEmbeddedOrLocalFile = !!url && (url.startsWith("data:") || url.startsWith("blob:") || !/^https?:\/\//i.test(url));
|
|
6589
|
-
if (!hasEmbeddedOrLocalFile && (!www || !tree || !this.id)) {
|
|
6590
|
-
return;
|
|
6591
|
-
}
|
|
6592
6785
|
if (!this.id) {
|
|
6593
6786
|
return;
|
|
6594
6787
|
}
|
|
6595
|
-
if (!namespace && !url) {
|
|
6596
|
-
try {
|
|
6597
|
-
if (media) {
|
|
6598
|
-
const mediaDetailsResponse = await fetch(
|
|
6599
|
-
`https://www.ancestry.com/api/media/viewer/v2/trees/${tree}/media?id=${media}`
|
|
6600
|
-
);
|
|
6601
|
-
const mediaDetails = await mediaDetailsResponse.json();
|
|
6602
|
-
if (mediaDetails.url) {
|
|
6603
|
-
url = `${mediaDetails.url}&imageQuality=hq`;
|
|
6604
|
-
}
|
|
6605
|
-
}
|
|
6606
|
-
} catch (_e) {
|
|
6607
|
-
}
|
|
6608
|
-
url = url || `https://${www}/mediaui-viewer/tree/${tree}/media/${media}`;
|
|
6609
|
-
}
|
|
6610
6788
|
if (!imgId && hasEmbeddedOrLocalFile && url) {
|
|
6611
6789
|
imgId = typeof media === "string" && media || `local-${String(key).replace(/[@]/g, "")}-${getFileExtension(url) || "bin"}`;
|
|
6612
6790
|
}
|
|
@@ -6631,14 +6809,25 @@ var Indi = class extends Common {
|
|
|
6631
6809
|
}
|
|
6632
6810
|
return list;
|
|
6633
6811
|
}
|
|
6634
|
-
myheritageLink(poolId = 0) {
|
|
6635
|
-
|
|
6812
|
+
myheritageLink(poolId = 0, treeToken) {
|
|
6813
|
+
let www = (this.getFromSourceHeads("SOUR.CORP.value") || this._gedcom?.HEAD?.SOUR?.CORP?.value)?.toLowerCase().replace(/^www\./gi, "");
|
|
6814
|
+
if (!www || /treeviz/i.test(www)) {
|
|
6815
|
+
www = "myheritage.com";
|
|
6816
|
+
}
|
|
6817
|
+
if (!this.id) {
|
|
6818
|
+
return;
|
|
6819
|
+
}
|
|
6820
|
+
const id = Number(this.id.replace(/@|I/g, "")) + poolId;
|
|
6821
|
+
if (!Number.isFinite(id)) {
|
|
6822
|
+
return;
|
|
6823
|
+
}
|
|
6824
|
+
const slug = this.toNaturalName()?.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || String(id);
|
|
6825
|
+
if (treeToken) {
|
|
6826
|
+
return `https://www.${www}/profile-${treeToken}-${id}/${slug}`;
|
|
6827
|
+
}
|
|
6636
6828
|
const site = this.getMyHeritageTreeId();
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
if (normalizedFile && this.id) {
|
|
6640
|
-
const id = Number(this.id.replace(/@|I/g, "")) + poolId;
|
|
6641
|
-
return `https://www.${www}/site-family-tree-${site}/${normalizedFile}#!profile-${id}-info`;
|
|
6829
|
+
if (site) {
|
|
6830
|
+
return `https://www.${www}/person-${id}_${site}_${site}/${slug}`;
|
|
6642
6831
|
}
|
|
6643
6832
|
}
|
|
6644
6833
|
myheritageMedia() {
|
|
@@ -6687,6 +6876,14 @@ var Indi = class extends Common {
|
|
|
6687
6876
|
});
|
|
6688
6877
|
return list;
|
|
6689
6878
|
}
|
|
6879
|
+
geniLink() {
|
|
6880
|
+
if (!this.id) {
|
|
6881
|
+
return;
|
|
6882
|
+
}
|
|
6883
|
+
const id = this.id.replace(/@|I/g, "");
|
|
6884
|
+
const given = this.toNaturalName()?.trim().split(/\s+/)[0] || id;
|
|
6885
|
+
return `https://www.geni.com/people/${given}/${id}`;
|
|
6886
|
+
}
|
|
6690
6887
|
familySearchLink() {
|
|
6691
6888
|
const wwwTags = this.get("WWW")?.toList();
|
|
6692
6889
|
const wwwTag = wwwTags?.find((wwwTag2) => {
|
|
@@ -6855,16 +7052,26 @@ var Indi = class extends Common {
|
|
|
6855
7052
|
return list;
|
|
6856
7053
|
}
|
|
6857
7054
|
async multimedia(namespace) {
|
|
6858
|
-
|
|
6859
|
-
|
|
7055
|
+
const lists = [];
|
|
7056
|
+
const ownObjes = this.get("OBJE")?.toList()?.values() ?? [];
|
|
7057
|
+
const ownAncestryMedia = ownObjes.some(
|
|
7058
|
+
(obje) => !!obje && (isAncestryOriginObje(obje) || isAncestryOriginObje(obje.ref))
|
|
7059
|
+
);
|
|
7060
|
+
if (this.isAncestry() || ownAncestryMedia) {
|
|
7061
|
+
lists.push(
|
|
7062
|
+
await this.ancestryMedia(
|
|
7063
|
+
namespace || this.getAncestryMediaNamespace()
|
|
7064
|
+
)
|
|
7065
|
+
);
|
|
6860
7066
|
}
|
|
6861
7067
|
if (this?.isMyHeritage()) {
|
|
6862
|
-
|
|
7068
|
+
lists.push(this.myheritageMedia());
|
|
6863
7069
|
}
|
|
6864
7070
|
if (this?.isGeni()) {
|
|
6865
|
-
|
|
7071
|
+
lists.push(this.geniMedia());
|
|
6866
7072
|
}
|
|
6867
|
-
|
|
7073
|
+
lists.push(this.universalMedia());
|
|
7074
|
+
return mergeMediaListsByObjeKey(...lists);
|
|
6868
7075
|
}
|
|
6869
7076
|
async getProfilePicture(namespace, onlyPrimary = true) {
|
|
6870
7077
|
if (!this.id) {
|
|
@@ -6957,12 +7164,15 @@ var Indi = class extends Common {
|
|
|
6957
7164
|
);
|
|
6958
7165
|
return void 0;
|
|
6959
7166
|
}
|
|
6960
|
-
link(poolId) {
|
|
7167
|
+
link(poolId, treeToken) {
|
|
6961
7168
|
if (this?.isAncestry()) {
|
|
6962
7169
|
return this.ancestryLink();
|
|
6963
7170
|
}
|
|
6964
7171
|
if (this?.isMyHeritage()) {
|
|
6965
|
-
return this.myheritageLink(poolId);
|
|
7172
|
+
return this.myheritageLink(poolId, treeToken);
|
|
7173
|
+
}
|
|
7174
|
+
if (this?.isGeni()) {
|
|
7175
|
+
return this.geniLink();
|
|
6966
7176
|
}
|
|
6967
7177
|
if (this?.isFamilySearch()) {
|
|
6968
7178
|
return this.familySearchLink();
|
|
@@ -9028,29 +9238,11 @@ var ensureExtensionSchema = (gedcom, extraTags) => {
|
|
|
9028
9238
|
|
|
9029
9239
|
// package.json
|
|
9030
9240
|
var package_default = {
|
|
9031
|
-
version: "2.1.
|
|
9241
|
+
version: "2.1.22"};
|
|
9032
9242
|
|
|
9033
9243
|
// src/utils/get-product-details.ts
|
|
9034
9244
|
var getVersion = () => package_default.version;
|
|
9035
9245
|
|
|
9036
|
-
// src/utils/multimedia.ts
|
|
9037
|
-
var inferMediaForm = (file, fallback = "bin") => {
|
|
9038
|
-
const withoutQuery = file.split("?")[0] || file;
|
|
9039
|
-
const ext = getFileExtension(withoutQuery);
|
|
9040
|
-
if (ext) {
|
|
9041
|
-
return ext.toLowerCase() === "jpeg" ? "jpg" : ext.toLowerCase();
|
|
9042
|
-
}
|
|
9043
|
-
return fallback;
|
|
9044
|
-
};
|
|
9045
|
-
var mergeMediaLists = (...lists) => {
|
|
9046
|
-
const merged = {};
|
|
9047
|
-
for (const list of lists) {
|
|
9048
|
-
if (!list) continue;
|
|
9049
|
-
Object.assign(merged, list);
|
|
9050
|
-
}
|
|
9051
|
-
return merged;
|
|
9052
|
-
};
|
|
9053
|
-
|
|
9054
9246
|
// src/classes/note.ts
|
|
9055
9247
|
var CommonNote = class extends Common {
|
|
9056
9248
|
constructor(gedcom, id, main, parent) {
|
|
@@ -9201,6 +9393,10 @@ var Obje = class extends Common {
|
|
|
9201
9393
|
if (lkidNode && !newObject.get("_LKID")) {
|
|
9202
9394
|
newObject.set("_LKID", lkidNode);
|
|
9203
9395
|
}
|
|
9396
|
+
const origNode = this.get("_ORIG");
|
|
9397
|
+
if (origNode && !newObject.get("_ORIG")) {
|
|
9398
|
+
newObject.set("_ORIG", origNode);
|
|
9399
|
+
}
|
|
9204
9400
|
if (override) {
|
|
9205
9401
|
this.remove("FILE");
|
|
9206
9402
|
this.remove("FORM");
|
package/dist/classes/indi.d.ts
CHANGED
|
@@ -62,8 +62,9 @@ export declare class Indi extends Common<string, IndiKey> implements IIndi {
|
|
|
62
62
|
}>[] | undefined;
|
|
63
63
|
ancestryLink(): string | undefined;
|
|
64
64
|
ancestryMedia(namespace?: string | number): Promise<MediaList>;
|
|
65
|
-
myheritageLink(poolId?: number): string | undefined;
|
|
65
|
+
myheritageLink(poolId?: number, treeToken?: string): string | undefined;
|
|
66
66
|
myheritageMedia(): MediaList | undefined;
|
|
67
|
+
geniLink(): string | undefined;
|
|
67
68
|
familySearchLink(): string | undefined;
|
|
68
69
|
hasFamilySearchMatches(): boolean;
|
|
69
70
|
getFamilySearchMatches(): FamilySearchMatch[];
|
|
@@ -73,7 +74,7 @@ export declare class Indi extends Common<string, IndiKey> implements IIndi {
|
|
|
73
74
|
universalMedia(): MediaList;
|
|
74
75
|
multimedia(namespace?: string | number): Promise<MediaList | undefined>;
|
|
75
76
|
getProfilePicture(namespace?: string | number, onlyPrimary?: boolean): Promise<ProfilePicture | undefined>;
|
|
76
|
-
link(poolId?: number): string | undefined;
|
|
77
|
+
link(poolId?: number, treeToken?: string): string | undefined;
|
|
77
78
|
toFamilies(list?: List): Families;
|
|
78
79
|
getFamilies(type: "FAMC" | "FAMS"): Families;
|
|
79
80
|
getFamiliesBiologicalFirst(type: "FAMC" | "FAMS"): Families;
|