@treeviz/gedcom-parser 1.0.19 → 1.0.21
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/index.d.ts +1 -1
- package/dist/classes/index.js +151 -45
- package/dist/cli/index.js +151 -45
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.js +150 -44
- package/dist/factories/index.d.ts +2 -2
- package/dist/factories/index.js +150 -44
- package/dist/{index-BnFjCzJz.d.ts → index-BPEVN_DY.d.ts} +19 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +151 -45
- package/dist/interfaces/index.d.ts +1 -1
- package/dist/kinship-translator/index.d.ts +2 -2
- package/dist/kinship-translator/index.js +150 -44
- package/dist/{place-parser-ChkPI4pQ.d.ts → place-parser-CM0TJFj8.d.ts} +1 -1
- package/dist/place-translator-CRiaOO9v.d.ts +88 -0
- package/dist/structures/index.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/index.d.ts +14 -86
- package/dist/utils/index.js +152 -46
- package/package.json +1 -1
package/dist/constants/index.js
CHANGED
|
@@ -1291,6 +1291,27 @@ var getPlaces = (common, type = ["ALL" /* All */], maxLevel = 1, level = 0, main
|
|
|
1291
1291
|
};
|
|
1292
1292
|
var implemented = (type, ...args) => {
|
|
1293
1293
|
};
|
|
1294
|
+
|
|
1295
|
+
// src/utils/media-utils.ts
|
|
1296
|
+
var getFileExtension = (filename) => {
|
|
1297
|
+
const match = filename.match(/\.([^.]+)$/);
|
|
1298
|
+
return match ? match[1] : "";
|
|
1299
|
+
};
|
|
1300
|
+
var isImageFormat = (format2) => {
|
|
1301
|
+
if (!format2) return false;
|
|
1302
|
+
const imageFormats = [
|
|
1303
|
+
"jpg",
|
|
1304
|
+
"jpeg",
|
|
1305
|
+
"png",
|
|
1306
|
+
"gif",
|
|
1307
|
+
"bmp",
|
|
1308
|
+
"webp",
|
|
1309
|
+
"svg",
|
|
1310
|
+
"tiff",
|
|
1311
|
+
"tif"
|
|
1312
|
+
];
|
|
1313
|
+
return imageFormats.includes(format2.toLowerCase());
|
|
1314
|
+
};
|
|
1294
1315
|
var uniqueItemsCache = /* @__PURE__ */ new WeakMap();
|
|
1295
1316
|
var setNestedGroup = (obj, key, value, uniqueCounting = true) => {
|
|
1296
1317
|
const parts = Array.isArray(key) ? key : key.split(/,\s*/);
|
|
@@ -2501,54 +2522,62 @@ var Indi = class extends Common {
|
|
|
2501
2522
|
}
|
|
2502
2523
|
async ancestryMedia(namespace) {
|
|
2503
2524
|
const list = {};
|
|
2504
|
-
const
|
|
2525
|
+
const objeList = this.get("OBJE")?.toList();
|
|
2505
2526
|
const www = this._gedcom?.HEAD?.SOUR?.CORP?.WWW?.value;
|
|
2506
2527
|
const tree = this.getAncestryTreeId();
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
let url = obje?.get("FILE")?.toValue();
|
|
2517
|
-
const title = obje?.get("TITL")?.toValue() ?? "";
|
|
2518
|
-
const type = obje?.get("FORM")?.toValue() ?? "raw";
|
|
2519
|
-
const imgId = clone || mser;
|
|
2520
|
-
if (!www || !tree || !this.id) {
|
|
2521
|
-
return;
|
|
2522
|
-
}
|
|
2523
|
-
if (!namespace && !url) {
|
|
2524
|
-
try {
|
|
2525
|
-
const mediaDetailsResponse = await fetch(
|
|
2526
|
-
`https://www.ancestry.com/api/media/viewer/v2/trees/${tree}/media?id=${media}`
|
|
2527
|
-
);
|
|
2528
|
-
const mediaDetails = await mediaDetailsResponse.json();
|
|
2529
|
-
if (mediaDetails.url) {
|
|
2530
|
-
url = `${mediaDetails.url}&imageQuality=hq`;
|
|
2528
|
+
if (objeList) {
|
|
2529
|
+
await Promise.all(
|
|
2530
|
+
objeList.map(async (objeRef) => {
|
|
2531
|
+
const key = objeRef?.id;
|
|
2532
|
+
const obje = objeRef?.standardizeMedia(
|
|
2533
|
+
namespace,
|
|
2534
|
+
true,
|
|
2535
|
+
(ns, iId) => {
|
|
2536
|
+
return ns && iId ? `https://mediasvc.ancestry.com/v2/image/namespaces/${ns}/media/${iId}?client=trees-mediaservice&imageQuality=hq` : void 0;
|
|
2531
2537
|
}
|
|
2532
|
-
|
|
2538
|
+
);
|
|
2539
|
+
const isPrimary = obje?.get("_PRIM")?.toValue() === "Y";
|
|
2540
|
+
const media = obje?.RIN?.value;
|
|
2541
|
+
const clone = obje?.get("_CLON._OID")?.toValue();
|
|
2542
|
+
const mser = obje?.get("_MSER._LKID")?.toValue();
|
|
2543
|
+
let url = obje?.get("FILE")?.toValue();
|
|
2544
|
+
const title = obje?.get("TITL")?.toValue() ?? "";
|
|
2545
|
+
const type = obje?.get("FORM")?.toValue() ?? "raw";
|
|
2546
|
+
const imgId = clone || mser;
|
|
2547
|
+
if (!www || !tree || !this.id) {
|
|
2548
|
+
return;
|
|
2533
2549
|
}
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
url
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2550
|
+
if (!namespace && !url) {
|
|
2551
|
+
try {
|
|
2552
|
+
const mediaDetailsResponse = await fetch(
|
|
2553
|
+
`https://www.ancestry.com/api/media/viewer/v2/trees/${tree}/media?id=${media}`
|
|
2554
|
+
);
|
|
2555
|
+
const mediaDetails = await mediaDetailsResponse.json();
|
|
2556
|
+
if (mediaDetails.url) {
|
|
2557
|
+
url = `${mediaDetails.url}&imageQuality=hq`;
|
|
2558
|
+
}
|
|
2559
|
+
} catch (_e) {
|
|
2560
|
+
}
|
|
2561
|
+
url = url || `https://${www}/mediaui-viewer/tree/${tree}/media/${media}`;
|
|
2562
|
+
}
|
|
2563
|
+
if (url && imgId) {
|
|
2564
|
+
const id = `${tree}-${this.id}-${imgId}`;
|
|
2565
|
+
list[id] = {
|
|
2566
|
+
key,
|
|
2567
|
+
isPrimary,
|
|
2568
|
+
id,
|
|
2569
|
+
tree,
|
|
2570
|
+
imgId,
|
|
2571
|
+
person: this.id,
|
|
2572
|
+
title,
|
|
2573
|
+
url,
|
|
2574
|
+
contentType: type,
|
|
2575
|
+
downloadName: `${this.id.replaceAll("@", "")}_${this.toNaturalName().replaceAll(" ", "-") || ""}_${(title || key.replaceAll("@", "").toString()).replaceAll(" ", "-")}`
|
|
2576
|
+
};
|
|
2577
|
+
}
|
|
2578
|
+
})
|
|
2579
|
+
);
|
|
2580
|
+
}
|
|
2552
2581
|
return list;
|
|
2553
2582
|
}
|
|
2554
2583
|
myheritageLink(poolId = 0) {
|
|
@@ -2586,6 +2615,7 @@ var Indi = class extends Common {
|
|
|
2586
2615
|
if (url && imgId) {
|
|
2587
2616
|
const id = `${tree}-${this.id}-${imgId}`;
|
|
2588
2617
|
list[id] = {
|
|
2618
|
+
isPrimary: false,
|
|
2589
2619
|
key,
|
|
2590
2620
|
id,
|
|
2591
2621
|
tree,
|
|
@@ -2695,6 +2725,36 @@ var Indi = class extends Common {
|
|
|
2695
2725
|
}
|
|
2696
2726
|
return void 0;
|
|
2697
2727
|
}
|
|
2728
|
+
async getProfilePicture(namespace) {
|
|
2729
|
+
const mediaList = await this.multimedia(namespace);
|
|
2730
|
+
if (!mediaList) {
|
|
2731
|
+
return void 0;
|
|
2732
|
+
}
|
|
2733
|
+
const mediaArray = Object.values(mediaList);
|
|
2734
|
+
const primaryMedia = mediaArray.find(
|
|
2735
|
+
(media) => media.isPrimary && isImageFormat(media.contentType || getFileExtension(media.url))
|
|
2736
|
+
);
|
|
2737
|
+
if (primaryMedia) {
|
|
2738
|
+
return {
|
|
2739
|
+
file: primaryMedia.url,
|
|
2740
|
+
form: primaryMedia.contentType,
|
|
2741
|
+
title: primaryMedia.title,
|
|
2742
|
+
isPrimary: true
|
|
2743
|
+
};
|
|
2744
|
+
}
|
|
2745
|
+
const secondaryMedia = mediaArray.find(
|
|
2746
|
+
(media) => isImageFormat(media.contentType || getFileExtension(media.url))
|
|
2747
|
+
);
|
|
2748
|
+
if (secondaryMedia) {
|
|
2749
|
+
return {
|
|
2750
|
+
file: secondaryMedia.url,
|
|
2751
|
+
form: secondaryMedia.contentType,
|
|
2752
|
+
title: secondaryMedia.title,
|
|
2753
|
+
isPrimary: false
|
|
2754
|
+
};
|
|
2755
|
+
}
|
|
2756
|
+
return void 0;
|
|
2757
|
+
}
|
|
2698
2758
|
link(poolId) {
|
|
2699
2759
|
if (this?.isAncestry()) {
|
|
2700
2760
|
return this.ancestryLink();
|
|
@@ -2787,6 +2847,52 @@ var Indi = class extends Common {
|
|
|
2787
2847
|
const deathEvent = this.get("DEAT")?.index(0);
|
|
2788
2848
|
return deathEvent?.PLAC?.value;
|
|
2789
2849
|
}
|
|
2850
|
+
/**
|
|
2851
|
+
* Get all marriage places for this individual
|
|
2852
|
+
* @returns Array of marriage place strings (may include undefined for marriages without place)
|
|
2853
|
+
*/
|
|
2854
|
+
getMarriagePlaces() {
|
|
2855
|
+
const marriagePlaces = [];
|
|
2856
|
+
const families = this.getFamilies("FAMS");
|
|
2857
|
+
families.forEach((family) => {
|
|
2858
|
+
const marrEvents = (family?.MARR?.toList().values() ?? []).filter(
|
|
2859
|
+
Boolean
|
|
2860
|
+
);
|
|
2861
|
+
if (marrEvents.length === 0) {
|
|
2862
|
+
marriagePlaces.push(void 0);
|
|
2863
|
+
} else {
|
|
2864
|
+
marrEvents.forEach((marrEvent) => {
|
|
2865
|
+
const marriageEventDetail = marrEvent;
|
|
2866
|
+
const marriagePlace = marriageEventDetail?.PLAC?.value;
|
|
2867
|
+
marriagePlaces.push(marriagePlace);
|
|
2868
|
+
});
|
|
2869
|
+
}
|
|
2870
|
+
});
|
|
2871
|
+
return marriagePlaces;
|
|
2872
|
+
}
|
|
2873
|
+
/**
|
|
2874
|
+
* Get all marriage dates for this individual
|
|
2875
|
+
* @returns Array of marriage date strings (may include undefined for marriages without date)
|
|
2876
|
+
*/
|
|
2877
|
+
getMarriageDates() {
|
|
2878
|
+
const marriageDates = [];
|
|
2879
|
+
const families = this.getFamilies("FAMS");
|
|
2880
|
+
families.forEach((family) => {
|
|
2881
|
+
const marrEvents = (family?.MARR?.toList().values() ?? []).filter(
|
|
2882
|
+
Boolean
|
|
2883
|
+
);
|
|
2884
|
+
if (marrEvents.length === 0) {
|
|
2885
|
+
marriageDates.push(void 0);
|
|
2886
|
+
} else {
|
|
2887
|
+
marrEvents.forEach((marrEvent) => {
|
|
2888
|
+
const marriageEventDetail = marrEvent;
|
|
2889
|
+
const marriageDate = marriageEventDetail?.DATE?.value;
|
|
2890
|
+
marriageDates.push(marriageDate);
|
|
2891
|
+
});
|
|
2892
|
+
}
|
|
2893
|
+
});
|
|
2894
|
+
return marriageDates;
|
|
2895
|
+
}
|
|
2790
2896
|
isDead() {
|
|
2791
2897
|
return this.get("DEAT.DATE")?.toValue() !== void 0 || this.get("DEAT.PLAC")?.toValue() !== void 0;
|
|
2792
2898
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { I as ICacheManager, P as PlaceParts } from '../place-parser-
|
|
1
|
+
import { I as ICacheManager, P as PlaceParts } from '../place-parser-CM0TJFj8.js';
|
|
2
2
|
import { Locale } from 'date-fns';
|
|
3
|
-
import { a1 as IndiType, n as IndiKey, L as Language } from '../index-
|
|
3
|
+
import { a1 as IndiType, n as IndiKey, L as Language } from '../index-BPEVN_DY.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Factory function type for creating cache manager instances.
|
package/dist/factories/index.js
CHANGED
|
@@ -1691,6 +1691,27 @@ var getPlaces = (common, type = ["ALL" /* All */], maxLevel = 1, level = 0, main
|
|
|
1691
1691
|
var implemented = (type, ...args) => {
|
|
1692
1692
|
};
|
|
1693
1693
|
|
|
1694
|
+
// src/utils/media-utils.ts
|
|
1695
|
+
var getFileExtension = (filename) => {
|
|
1696
|
+
const match = filename.match(/\.([^.]+)$/);
|
|
1697
|
+
return match ? match[1] : "";
|
|
1698
|
+
};
|
|
1699
|
+
var isImageFormat = (format2) => {
|
|
1700
|
+
if (!format2) return false;
|
|
1701
|
+
const imageFormats = [
|
|
1702
|
+
"jpg",
|
|
1703
|
+
"jpeg",
|
|
1704
|
+
"png",
|
|
1705
|
+
"gif",
|
|
1706
|
+
"bmp",
|
|
1707
|
+
"webp",
|
|
1708
|
+
"svg",
|
|
1709
|
+
"tiff",
|
|
1710
|
+
"tif"
|
|
1711
|
+
];
|
|
1712
|
+
return imageFormats.includes(format2.toLowerCase());
|
|
1713
|
+
};
|
|
1714
|
+
|
|
1694
1715
|
// src/factories/place-parser-provider.ts
|
|
1695
1716
|
var placeParserProvider;
|
|
1696
1717
|
var setPlaceParserProvider = (parser) => {
|
|
@@ -2928,54 +2949,62 @@ var Indi = class extends Common {
|
|
|
2928
2949
|
}
|
|
2929
2950
|
async ancestryMedia(namespace) {
|
|
2930
2951
|
const list = {};
|
|
2931
|
-
const
|
|
2952
|
+
const objeList = this.get("OBJE")?.toList();
|
|
2932
2953
|
const www = this._gedcom?.HEAD?.SOUR?.CORP?.WWW?.value;
|
|
2933
2954
|
const tree = this.getAncestryTreeId();
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
let url = obje?.get("FILE")?.toValue();
|
|
2944
|
-
const title = obje?.get("TITL")?.toValue() ?? "";
|
|
2945
|
-
const type = obje?.get("FORM")?.toValue() ?? "raw";
|
|
2946
|
-
const imgId = clone || mser;
|
|
2947
|
-
if (!www || !tree || !this.id) {
|
|
2948
|
-
return;
|
|
2949
|
-
}
|
|
2950
|
-
if (!namespace && !url) {
|
|
2951
|
-
try {
|
|
2952
|
-
const mediaDetailsResponse = await fetch(
|
|
2953
|
-
`https://www.ancestry.com/api/media/viewer/v2/trees/${tree}/media?id=${media}`
|
|
2954
|
-
);
|
|
2955
|
-
const mediaDetails = await mediaDetailsResponse.json();
|
|
2956
|
-
if (mediaDetails.url) {
|
|
2957
|
-
url = `${mediaDetails.url}&imageQuality=hq`;
|
|
2955
|
+
if (objeList) {
|
|
2956
|
+
await Promise.all(
|
|
2957
|
+
objeList.map(async (objeRef) => {
|
|
2958
|
+
const key = objeRef?.id;
|
|
2959
|
+
const obje = objeRef?.standardizeMedia(
|
|
2960
|
+
namespace,
|
|
2961
|
+
true,
|
|
2962
|
+
(ns, iId) => {
|
|
2963
|
+
return ns && iId ? `https://mediasvc.ancestry.com/v2/image/namespaces/${ns}/media/${iId}?client=trees-mediaservice&imageQuality=hq` : void 0;
|
|
2958
2964
|
}
|
|
2959
|
-
|
|
2965
|
+
);
|
|
2966
|
+
const isPrimary = obje?.get("_PRIM")?.toValue() === "Y";
|
|
2967
|
+
const media = obje?.RIN?.value;
|
|
2968
|
+
const clone = obje?.get("_CLON._OID")?.toValue();
|
|
2969
|
+
const mser = obje?.get("_MSER._LKID")?.toValue();
|
|
2970
|
+
let url = obje?.get("FILE")?.toValue();
|
|
2971
|
+
const title = obje?.get("TITL")?.toValue() ?? "";
|
|
2972
|
+
const type = obje?.get("FORM")?.toValue() ?? "raw";
|
|
2973
|
+
const imgId = clone || mser;
|
|
2974
|
+
if (!www || !tree || !this.id) {
|
|
2975
|
+
return;
|
|
2960
2976
|
}
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
url
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2977
|
+
if (!namespace && !url) {
|
|
2978
|
+
try {
|
|
2979
|
+
const mediaDetailsResponse = await fetch(
|
|
2980
|
+
`https://www.ancestry.com/api/media/viewer/v2/trees/${tree}/media?id=${media}`
|
|
2981
|
+
);
|
|
2982
|
+
const mediaDetails = await mediaDetailsResponse.json();
|
|
2983
|
+
if (mediaDetails.url) {
|
|
2984
|
+
url = `${mediaDetails.url}&imageQuality=hq`;
|
|
2985
|
+
}
|
|
2986
|
+
} catch (_e) {
|
|
2987
|
+
}
|
|
2988
|
+
url = url || `https://${www}/mediaui-viewer/tree/${tree}/media/${media}`;
|
|
2989
|
+
}
|
|
2990
|
+
if (url && imgId) {
|
|
2991
|
+
const id = `${tree}-${this.id}-${imgId}`;
|
|
2992
|
+
list[id] = {
|
|
2993
|
+
key,
|
|
2994
|
+
isPrimary,
|
|
2995
|
+
id,
|
|
2996
|
+
tree,
|
|
2997
|
+
imgId,
|
|
2998
|
+
person: this.id,
|
|
2999
|
+
title,
|
|
3000
|
+
url,
|
|
3001
|
+
contentType: type,
|
|
3002
|
+
downloadName: `${this.id.replaceAll("@", "")}_${this.toNaturalName().replaceAll(" ", "-") || ""}_${(title || key.replaceAll("@", "").toString()).replaceAll(" ", "-")}`
|
|
3003
|
+
};
|
|
3004
|
+
}
|
|
3005
|
+
})
|
|
3006
|
+
);
|
|
3007
|
+
}
|
|
2979
3008
|
return list;
|
|
2980
3009
|
}
|
|
2981
3010
|
myheritageLink(poolId = 0) {
|
|
@@ -3013,6 +3042,7 @@ var Indi = class extends Common {
|
|
|
3013
3042
|
if (url && imgId) {
|
|
3014
3043
|
const id = `${tree}-${this.id}-${imgId}`;
|
|
3015
3044
|
list[id] = {
|
|
3045
|
+
isPrimary: false,
|
|
3016
3046
|
key,
|
|
3017
3047
|
id,
|
|
3018
3048
|
tree,
|
|
@@ -3122,6 +3152,36 @@ var Indi = class extends Common {
|
|
|
3122
3152
|
}
|
|
3123
3153
|
return void 0;
|
|
3124
3154
|
}
|
|
3155
|
+
async getProfilePicture(namespace) {
|
|
3156
|
+
const mediaList = await this.multimedia(namespace);
|
|
3157
|
+
if (!mediaList) {
|
|
3158
|
+
return void 0;
|
|
3159
|
+
}
|
|
3160
|
+
const mediaArray = Object.values(mediaList);
|
|
3161
|
+
const primaryMedia = mediaArray.find(
|
|
3162
|
+
(media) => media.isPrimary && isImageFormat(media.contentType || getFileExtension(media.url))
|
|
3163
|
+
);
|
|
3164
|
+
if (primaryMedia) {
|
|
3165
|
+
return {
|
|
3166
|
+
file: primaryMedia.url,
|
|
3167
|
+
form: primaryMedia.contentType,
|
|
3168
|
+
title: primaryMedia.title,
|
|
3169
|
+
isPrimary: true
|
|
3170
|
+
};
|
|
3171
|
+
}
|
|
3172
|
+
const secondaryMedia = mediaArray.find(
|
|
3173
|
+
(media) => isImageFormat(media.contentType || getFileExtension(media.url))
|
|
3174
|
+
);
|
|
3175
|
+
if (secondaryMedia) {
|
|
3176
|
+
return {
|
|
3177
|
+
file: secondaryMedia.url,
|
|
3178
|
+
form: secondaryMedia.contentType,
|
|
3179
|
+
title: secondaryMedia.title,
|
|
3180
|
+
isPrimary: false
|
|
3181
|
+
};
|
|
3182
|
+
}
|
|
3183
|
+
return void 0;
|
|
3184
|
+
}
|
|
3125
3185
|
link(poolId) {
|
|
3126
3186
|
if (this?.isAncestry()) {
|
|
3127
3187
|
return this.ancestryLink();
|
|
@@ -3214,6 +3274,52 @@ var Indi = class extends Common {
|
|
|
3214
3274
|
const deathEvent = this.get("DEAT")?.index(0);
|
|
3215
3275
|
return deathEvent?.PLAC?.value;
|
|
3216
3276
|
}
|
|
3277
|
+
/**
|
|
3278
|
+
* Get all marriage places for this individual
|
|
3279
|
+
* @returns Array of marriage place strings (may include undefined for marriages without place)
|
|
3280
|
+
*/
|
|
3281
|
+
getMarriagePlaces() {
|
|
3282
|
+
const marriagePlaces = [];
|
|
3283
|
+
const families = this.getFamilies("FAMS");
|
|
3284
|
+
families.forEach((family) => {
|
|
3285
|
+
const marrEvents = (family?.MARR?.toList().values() ?? []).filter(
|
|
3286
|
+
Boolean
|
|
3287
|
+
);
|
|
3288
|
+
if (marrEvents.length === 0) {
|
|
3289
|
+
marriagePlaces.push(void 0);
|
|
3290
|
+
} else {
|
|
3291
|
+
marrEvents.forEach((marrEvent) => {
|
|
3292
|
+
const marriageEventDetail = marrEvent;
|
|
3293
|
+
const marriagePlace = marriageEventDetail?.PLAC?.value;
|
|
3294
|
+
marriagePlaces.push(marriagePlace);
|
|
3295
|
+
});
|
|
3296
|
+
}
|
|
3297
|
+
});
|
|
3298
|
+
return marriagePlaces;
|
|
3299
|
+
}
|
|
3300
|
+
/**
|
|
3301
|
+
* Get all marriage dates for this individual
|
|
3302
|
+
* @returns Array of marriage date strings (may include undefined for marriages without date)
|
|
3303
|
+
*/
|
|
3304
|
+
getMarriageDates() {
|
|
3305
|
+
const marriageDates = [];
|
|
3306
|
+
const families = this.getFamilies("FAMS");
|
|
3307
|
+
families.forEach((family) => {
|
|
3308
|
+
const marrEvents = (family?.MARR?.toList().values() ?? []).filter(
|
|
3309
|
+
Boolean
|
|
3310
|
+
);
|
|
3311
|
+
if (marrEvents.length === 0) {
|
|
3312
|
+
marriageDates.push(void 0);
|
|
3313
|
+
} else {
|
|
3314
|
+
marrEvents.forEach((marrEvent) => {
|
|
3315
|
+
const marriageEventDetail = marrEvent;
|
|
3316
|
+
const marriageDate = marriageEventDetail?.DATE?.value;
|
|
3317
|
+
marriageDates.push(marriageDate);
|
|
3318
|
+
});
|
|
3319
|
+
}
|
|
3320
|
+
});
|
|
3321
|
+
return marriageDates;
|
|
3322
|
+
}
|
|
3217
3323
|
isDead() {
|
|
3218
3324
|
return this.get("DEAT.DATE")?.toValue() !== void 0 || this.get("DEAT.PLAC")?.toValue() !== void 0;
|
|
3219
3325
|
}
|
|
@@ -511,6 +511,7 @@ type GeneratorKey = `${"2nd" | "3rd" | `${4 | 5 | 6 | 7 | 8 | 9}th`}`;
|
|
|
511
511
|
type GeneratorType = "Cousins" | "GreatGrandParents" | "GreatGrandChildren";
|
|
512
512
|
type GeneratedIndiMethods = Record<`get${GeneratorKey}${GeneratorType}`, () => Individuals>;
|
|
513
513
|
type MediaList = Record<string, {
|
|
514
|
+
isPrimary?: boolean;
|
|
514
515
|
key: string;
|
|
515
516
|
id: string;
|
|
516
517
|
imgId: string;
|
|
@@ -855,6 +856,7 @@ declare class Indi extends Common<string, IndiKey> implements IIndi {
|
|
|
855
856
|
hasFamilySearchSources(): boolean;
|
|
856
857
|
getFamilySearchSources(): FamilySearchSource[];
|
|
857
858
|
multimedia(namespace?: string | number): Promise<MediaList | undefined>;
|
|
859
|
+
getProfilePicture(namespace?: string | number): Promise<ProfilePicture | undefined>;
|
|
858
860
|
link(poolId?: number): string;
|
|
859
861
|
toFamilies(list?: List): Families;
|
|
860
862
|
getFamilies(type: "FAMC" | "FAMS"): Families;
|
|
@@ -863,6 +865,16 @@ declare class Indi extends Common<string, IndiKey> implements IIndi {
|
|
|
863
865
|
getDeathDate(showDays?: boolean, shortNote?: boolean, showNote?: boolean): string;
|
|
864
866
|
getBirthPlace(): string;
|
|
865
867
|
getDeathPlace(): string;
|
|
868
|
+
/**
|
|
869
|
+
* Get all marriage places for this individual
|
|
870
|
+
* @returns Array of marriage place strings (may include undefined for marriages without place)
|
|
871
|
+
*/
|
|
872
|
+
getMarriagePlaces(): Array<string | undefined>;
|
|
873
|
+
/**
|
|
874
|
+
* Get all marriage dates for this individual
|
|
875
|
+
* @returns Array of marriage date strings (may include undefined for marriages without date)
|
|
876
|
+
*/
|
|
877
|
+
getMarriageDates(): Array<string | undefined>;
|
|
866
878
|
isDead(): boolean;
|
|
867
879
|
isEmpty(): boolean;
|
|
868
880
|
isUnknownAncestor(): boolean;
|
|
@@ -1054,6 +1066,12 @@ interface FamilySearchSource {
|
|
|
1054
1066
|
www?: string;
|
|
1055
1067
|
notes?: string[];
|
|
1056
1068
|
}
|
|
1069
|
+
interface ProfilePicture {
|
|
1070
|
+
file: string;
|
|
1071
|
+
form?: string;
|
|
1072
|
+
title?: string;
|
|
1073
|
+
isPrimary: boolean;
|
|
1074
|
+
}
|
|
1057
1075
|
interface TreeMember<T = IndiType> {
|
|
1058
1076
|
id: FamKey | IndiKey;
|
|
1059
1077
|
index: number;
|
|
@@ -1654,4 +1672,4 @@ declare const getValidKey: (tag: string, id: string) => string;
|
|
|
1654
1672
|
declare const isId: (string: string) => string is IdType;
|
|
1655
1673
|
declare const idGetter: <T extends IdType>(id?: T) => T;
|
|
1656
1674
|
|
|
1657
|
-
export { type RepoType as $, type Order as A, type OrderIterator as B, type Cases as C, type Group as D, type GroupMarker as E, type FamKey as F, type GroupDefinition as G, type GroupIterator as H, type IKinshipTranslator as I, type NestedGroup as J, type NameOrder as K, type Language as L, type MultiTag as M, type NonStandard as N, type ObjeKey as O, type PrimitiveRange as P, type PlaceOrder as Q, type Range$1 as R, type SplitResult as S, type TagKey as T, type UnknownKey as U, type LinkedPersons as V, RelationType as W, PartnerType as X, Range as Y, type ProxyOriginal as Z, type SourType as _, isIntersectedRange as a,
|
|
1675
|
+
export { type RepoType as $, type Order as A, type OrderIterator as B, type Cases as C, type Group as D, type GroupMarker as E, type FamKey as F, type GroupDefinition as G, type GroupIterator as H, type IKinshipTranslator as I, type NestedGroup as J, type NameOrder as K, type Language as L, type MultiTag as M, type NonStandard as N, type ObjeKey as O, type PrimitiveRange as P, type PlaceOrder as Q, type Range$1 as R, type SplitResult as S, type TagKey as T, type UnknownKey as U, type LinkedPersons as V, RelationType as W, PartnerType as X, Range as Y, type ProxyOriginal as Z, type SourType as _, isIntersectedRange as a, Sour as a$, type SubmType as a0, type IndiType as a1, type TreeMember as a2, type GenealogyMember as a3, type IndiTree as a4, type IndiGenealogy as a5, type IndiMarker as a6, type MemberSide as a7, type MemberMain as a8, type GenerationSpouseType as a9, createCommonDate as aA, isCommonDate as aB, Fam as aC, createFam as aD, Families as aE, GedCom as aF, createGedCom as aG, isGedcomString as aH, validateGedcomContent as aI, mergeGedcoms as aJ, Indi as aK, type FamilySearchMatch as aL, type FamilySearchSource as aM, type ProfilePicture as aN, createIndi as aO, Individuals as aP, List as aQ, CommonName as aR, createCommonName as aS, CommonNote as aT, createCommonNote as aU, Obje as aV, createObje as aW, Objects as aX, Repo as aY, createRepo as aZ, Repositories as a_, type GenerationIndiType as aa, type IndiGenealogyGenerations as ab, type IndiGenealogyResult as ac, type NonNullIndiGenealogyResult as ad, type PathItem as ae, type Path as af, type ReducedPath as ag, type QueueItem as ah, type Queue as ai, type FamType as aj, type GedComType as ak, type ObjeType as al, Existed as am, CustomTags as an, Common as ao, createProxy as ap, createCommon as aq, isOnlyMainProp as ar, isValidKey as as, getValidKeys as at, getValidTag as au, getListTag as av, getValidKey as aw, isId as ax, idGetter as ay, CommonDate as az, isRangeContained as b, createSour as b0, Sources as b1, Subm as b2, createSubm as b3, Submitters as b4, type ICommon as b5, type IFam as b6, type IFamilies as b7, type IGedcom as b8, type IIndi as b9, type ISourceCitationStructure as bA, type ISourceRepositoryCitationStructure as bB, type ISourceStructure as bC, type Place as bD, PlaceType as bE, getPlaces as bF, type GeneratedIndiMethods as ba, type IIndividuals as bb, type IList as bc, type IObje as bd, type IRepo as be, type ISour as bf, type ISubm as bg, type IAddressStructure as bh, type IAssociationStructure as bi, type IChangeDateStructure as bj, type ICreationDateStructure as bk, type IDateStructure as bl, type IEventDetailStructure as bm, type IFamilyStructure as bn, type IGedComStructure as bo, type IIndividualEventDetailStructure as bp, type IIndividualEventStructure as bq, type IIndividualStructure as br, type ILdsOrdinanceDetailStructure as bs, type ILdsSpouseSealingStructure as bt, type IMarriageDateStructure as bu, type IMultimediaLinkStructure as bv, type INonEventStructure as bw, type INoteStructure as bx, type IPlaceStructure as by, type IRepositoryStructure as bz, splitOverlappingRanges as c, findMatchingRangeForSplitRange as d, extractSplitPoints as e, fromTuple as f, generateSplitRanges as g, extractSeparationYears as h, inRange as i, type CrossCase as j, type CrossCases as k, type Settings as l, type ConvertType as m, type IndiKey as n, type RepoKey as o, parseRangeBounds as p, type SourKey as q, type SubmKey as r, splitRange as s, type IdType as t, type Tag as u, type ListTag as v, type FilterIterator as w, type Filter as x, type RequiredFilter as y, type OrderDefinition as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { ACCEPTED_DATE_FORMATS, ACCEPTED_DATE_FORMATS_REGEX, GedcomTree, commonDateFormatter, create, dateFormatter,
|
|
1
|
+
export { A as ACCEPTED_DATE_FORMATS, a as ACCEPTED_DATE_FORMATS_REGEX, G as GedcomTree, b as commonDateFormatter, c as create, d as dateFormatter, G as default, e as getAllProp, f as getFamilyWith, j as getName, g as getRawSize, h as getVersion, q as hungarianOrdinalize, k as implemented, i as isDevelopment, m as marriageDateFormatter, o as nameFormatter, l as notImplemented, n as noteDateFormatter, p as ordinalize, r as placeTranslator, s as setNestedGroup } from './place-translator-CRiaOO9v.js';
|
|
2
2
|
export { CacheManagerFactory, DateLocaleProvider, I18nProvider, KinshipTranslatorConstructor, PlaceParserFunction, PlaceTranslatorFunction, getCacheManagerFactory, getDateLocale, getI18n, getKinshipTranslatorClass, getPlaceParserProvider, getPlaceTranslatorProvider, i18n, resetCacheManagerFactory, resetDateLocaleProvider, resetI18nProvider, resetKinshipTranslatorClass, resetPlaceParserProvider, resetPlaceTranslatorProvider, setCacheManagerFactory, setDateLocaleProvider, setI18nProvider, setKinshipTranslatorClass, setPlaceParserProvider, setPlaceTranslatorProvider } from './factories/index.js';
|
|
3
|
-
export { C as CacheRelatives, I as ICacheManager, P as PlaceParts, g as getPlaceParts, p as pathCache, a as relativesCache, r as resetRelativesCache } from './place-parser-
|
|
3
|
+
export { C as CacheRelatives, I as ICacheManager, P as PlaceParts, g as getPlaceParts, p as pathCache, a as relativesCache, r as resetRelativesCache } from './place-parser-CM0TJFj8.js';
|
|
4
4
|
export { KinshipTranslator, KinshipTranslatorBasic, KinshipTranslatorDE, KinshipTranslatorEN, KinshipTranslatorES, KinshipTranslatorFR, KinshipTranslatorHU, translators } from './kinship-translator/index.js';
|
|
5
|
-
export { C as Cases, ao as Common, az as CommonDate,
|
|
5
|
+
export { C as Cases, ao as Common, az as CommonDate, aR as CommonName, aT as CommonNote, m as ConvertType, j as CrossCase, k as CrossCases, an as CustomTags, am as Existed, aC as Fam, F as FamKey, aj as FamType, aE as Families, aL as FamilySearchMatch, aM as FamilySearchSource, x as Filter, w as FilterIterator, aF as GedCom, ak as GedComType, a3 as GenealogyMember, ba as GeneratedIndiMethods, aa as GenerationIndiType, a9 as GenerationSpouseType, D as Group, G as GroupDefinition, H as GroupIterator, E as GroupMarker, bh as IAddress, bi as IAssociation, bj as IChangeDate, b5 as ICommon, bk as ICreationDate, bl as IDate, bm as IEventDetail, bm as IEventDetailStructure, b6 as IFam, b7 as IFamilies, bn as IFamily, b8 as IGedCom, bo as IGedcomStructure, b9 as IIndi, br as IIndividual, bq as IIndividualEvent, bp as IIndividualEventDetail, br as IIndividualStructure, bb as IIndividuals, bs as ILdsOrdinanceDetail, bt as ILdsSpouseSealing, bc as IList, bu as IMarriageDate, bv as IMultimediaLink, bw as INonEvent, bx as INote, bd as IObje, by as IPlace, be as IRepo, bz as IRepository, bf as ISour, bC as ISource, bA as ISourceCitation, bB as ISourceRepositoryCitation, bg as ISubm, t as IdType, aK as Indi, a5 as IndiGenealogy, ab as IndiGenealogyGenerations, ac as IndiGenealogyResult, n as IndiKey, a6 as IndiMarker, a4 as IndiTree, a1 as IndiType, aP as Individuals, I as KinshipTranslatorInterface, L as Language, V as LinkedPersons, aQ as List, v as ListTag, a8 as MemberMain, a7 as MemberSide, M as MultiTag, K as NameOrder, J as NestedGroup, ad as NonNullIndiGenealogyResult, N as NonStandard, aV as Obje, O as ObjeKey, al as ObjeType, aX as Objects, A as Order, z as OrderDefinition, B as OrderIterator, X as PartnerType, af as Path, ae as PathItem, bD as Place, Q as PlaceOrder, bE as PlaceType, P as PrimitiveRange, aN as ProfilePicture, Z as ProxyOriginal, ai as Queue, ah as QueueItem, Y as Range, R as RangeType, ag as ReducedPath, W as RelationType, aY as Repo, o as RepoKey, $ as RepoType, a_ as Repositories, y as RequiredFilter, l as Settings, a$ as Sour, q as SourKey, _ as SourType, b1 as Sources, S as SplitResult, b2 as Subm, r as SubmKey, a0 as SubmType, b4 as Submitters, u as Tag, T as TagKey, a2 as TreeMember, U as UnknownKey, aq as createCommon, aA as createCommonDate, aS as createCommonName, aU as createCommonNote, aD as createFam, aG as createGedCom, aO as createIndi, aW as createObje, ap as createProxy, aZ as createRepo, b0 as createSour, b3 as createSubm, h as extractSeparationYears, e as extractSplitPoints, d as findMatchingRangeForSplitRange, f as fromTuple, g as generateSplitRanges, av as getListTag, bF as getPlaces, aw as getValidKey, at as getValidKeys, au as getValidTag, ay as idGetter, i as inRange, aB as isCommonDate, aH as isGedcomString, ax as isId, a as isIntersectedRange, ar as isOnlyMainProp, b as isRangeContained, as as isValidKey, aJ as mergeGedcoms, p as parseRangeBounds, c as splitOverlappingRanges, s as splitRange, aI as validateGedcomContent } from './index-BPEVN_DY.js';
|
|
6
6
|
export { AncestryMedia } from './types/index.js';
|
|
7
7
|
export { ADOPTED, BIOLOGICAL, BIRTH, BIRTH_ASC, BIRTH_DESC, DATE_ASC, DATE_DESC, DEATH_ASC, DEATH_DESC, DEFAULT, EVERY, FEMALE, FOSTER, FRIEND, ID_GETTER_REG, ID_REG, ID_SPLIT_REG, LINE_REG, MALE, MAX_FILE_SIZE_TO_SYNC, OTHER, PARTNER, REF_LINE_REG, SEALING, SINGLE, SPOUSE, STEP, UNKOWN, getBirthAsc, getMarriageAsc, getMarriageAscAndBirth, getMarriageAscAndChildBirth, getNameAsc, getNameAscAndBirth, getNameDesc } from './constants/index.js';
|
|
8
8
|
export { IPersonalName, IPersonalNamePieces } from './structures/index.js';
|