@treeviz/familysearch-sdk 2.0.6 → 2.0.8

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,4 +1,4 @@
1
- import { A as AgentAPI, C as ConclusionsAPI, G as GroupsAPI, M as MatchesAPI, a as MergesAPI, N as NotesAPI, P as PedigreesAPI, b as PendingModificationsAPI, c as PersonsAPI, d as PreferencesAPI, R as RelationshipsAPI, S as SearchAPI, e as SourceAttachmentsAPI, f as SourceBoxAPI, g as SourcesAPI, T as TreeChangesAPI, h as TreesManagementAPI, i as addSourcesToCollection, j as allowPersonMerge, k as attachSourceToChildAndParentsRelationship, l as attachSourceToCoupleRelationship, m as attachSourceToPerson, n as canMergePersons, o as createChildAndParentsRelationship, p as createChildAndParentsRelationshipNote, q as createChildAndParentsRelationshipSourceReference, r as createCoupleRelationship, s as createCoupleRelationshipNote, t as createCoupleRelationshipSourceReference, u as createGroup, v as createNotAMatchDeclaration, w as createPerson, x as createPersonMemory, y as createPersonNote, z as createRelationshipGedcomx, B as createSourceDescription, D as createSourceFolder, E as createTree, F as deleteAllNotAMatchDeclarations, H as deleteChildAndParentsRelationship, I as deleteChildAndParentsRelationshipConclusion, J as deleteChildAndParentsRelationshipNote, K as deleteChildAndParentsRelationshipParent, L as deleteChildAndParentsRelationshipSourceReference, O as deleteCoupleRelationship, Q as deleteCoupleRelationshipConclusion, U as deleteCoupleRelationshipNote, V as deleteCoupleRelationshipSourceReference, W as deleteGroup, X as deleteNotAMatchDeclaration, Y as deletePerson, Z as deletePersonConclusion, _ as deletePersonDiscussionReference, $ as deletePersonMemoriesPersonaReference, a0 as deletePersonNotAMatch, a1 as deletePersonNotAMatches, a2 as deletePersonNote, a3 as deletePersonPortrait, a4 as deletePersonSourceReference, a5 as deletePreferredParentRelationship, a6 as deletePreferredSpouseRelationship, a7 as deleteSourceDescription, a8 as deleteTree, a9 as deleteTreePersonReference, aa as deleteUserDefinedCollection, ab as detachSourceFromChildAndParentsRelationship, ac as detachSourceFromCoupleRelationship, ad as detachSourceFromPerson, ae as exportGEDCOM, af as matchPerson, ag as mergePerson, ah as performPersonMatchesByExample, ai as readAgent, aj as readAncestry, ak as readChildAndParentRelationshipNote, al as readChildAndParentsRelationship, am as readChildAndParentsRelationshipChangeHistory, an as readChildAndParentsRelationshipNote, ao as readChildAndParentsRelationshipNotes, ap as readChildAndParentsRelationshipSourceReferences, aq as readChildAndParentsRelationshipSources, ar as readCollectionSourceDescriptions, as as readCoupleRelationship, at as readCoupleRelationshipChangeHistory, au as readCoupleRelationshipNote, av as readCoupleRelationshipNotes, aw as readCoupleRelationshipSourceReferences, ax as readCoupleRelationshipSources, ay as readDescendancy, az as readGroup, aA as readGroups, aB as readNotAMatchDeclarations, aC as readPendingModifications, aD as readPerson, aE as readPersonChangeHistory, aF as readPersonChildren, aG as readPersonDiscussions, aH as readPersonFamilies, aI as readPersonMatches, aJ as readPersonMemories, aK as readPersonMergeAnalysis, aL as readPersonNonMatches, aM as readPersonNotAMatches, aN as readPersonNote, aO as readPersonNotes, aP as readPersonParents, aQ as readPersonPortraits, aR as readPersonSources, aS as readPersonSpouses, aT as readPersonWithDetails, aU as readPreferredParentRelationship, aV as readPreferredSpouseRelationship, aW as readResearchTreePersons, aX as readSourceDescription, aY as readSourceDescriptionChanges, aZ as readSourceDescriptionHead, a_ as readSourceDescriptions, a$ as readSourceFolders, b0 as readTree, b1 as readTreeChanges, b2 as readTreeMatches, b3 as readUserDefinedCollection, b4 as readUserSourceDescriptions, b5 as readUserSourceFolders, b6 as removeSourcesFromCollection, b7 as restoreChange, b8 as restoreChildAndParentsRelationship, b9 as restoreCoupleRelationship, ba as restorePerson, bb as searchPersonByData, bc as searchPersons, bd as setParentOrder, be as setPreferredParentRelationship, bf as setPreferredSpouseRelationship, bg as setSpouseOrder, bh as updateChildAndParentsRelationship, bi as updateChildAndParentsRelationshipNote, bj as updateCoupleRelationship, bk as updateCoupleRelationshipNote, bl as updateGroup, bm as updateMatchResolution, bn as updatePerson, bo as updatePersonNotAMatches, bp as updatePersonNote, bq as updatePersonPortraits, br as updateSourceDescription, bs as updateUserDefinedCollection } from './index-CKi9wd-C.js';
1
+ import { A as AgentAPI, C as ConclusionsAPI, G as GroupsAPI, M as MatchesAPI, a as MergesAPI, N as NotesAPI, P as PedigreesAPI, b as PendingModificationsAPI, c as PersonsAPI, d as PreferencesAPI, R as RelationshipsAPI, S as SearchAPI, e as SourceAttachmentsAPI, f as SourceBoxAPI, g as SourcesAPI, T as TreeChangesAPI, h as TreesManagementAPI, i as addSourcesToCollection, j as allowPersonMerge, k as attachSourceToChildAndParentsRelationship, l as attachSourceToCoupleRelationship, m as attachSourceToPerson, n as canMergePersons, o as createChildAndParentsRelationship, p as createChildAndParentsRelationshipNote, q as createChildAndParentsRelationshipSourceReference, r as createCoupleRelationship, s as createCoupleRelationshipNote, t as createCoupleRelationshipSourceReference, u as createGroup, v as createNotAMatchDeclaration, w as createPerson, x as createPersonMemory, y as createPersonNote, z as createRelationshipGedcomx, B as createSourceDescription, D as createSourceFolder, E as createTree, F as deleteAllNotAMatchDeclarations, H as deleteChildAndParentsRelationship, I as deleteChildAndParentsRelationshipConclusion, J as deleteChildAndParentsRelationshipNote, K as deleteChildAndParentsRelationshipParent, L as deleteChildAndParentsRelationshipSourceReference, O as deleteCoupleRelationship, Q as deleteCoupleRelationshipConclusion, U as deleteCoupleRelationshipNote, V as deleteCoupleRelationshipSourceReference, W as deleteGroup, X as deleteNotAMatchDeclaration, Y as deletePerson, Z as deletePersonConclusion, _ as deletePersonDiscussionReference, $ as deletePersonMemoriesPersonaReference, a0 as deletePersonNotAMatch, a1 as deletePersonNotAMatches, a2 as deletePersonNote, a3 as deletePersonPortrait, a4 as deletePersonSourceReference, a5 as deletePreferredParentRelationship, a6 as deletePreferredSpouseRelationship, a7 as deleteSourceDescription, a8 as deleteTree, a9 as deleteTreePersonReference, aa as deleteUserDefinedCollection, ab as detachSourceFromChildAndParentsRelationship, ac as detachSourceFromCoupleRelationship, ad as detachSourceFromPerson, ae as exportGEDCOM, af as matchPerson, ag as mergePerson, ah as performPersonMatchesByExample, ai as readAgent, aj as readAncestry, ak as readChildAndParentRelationshipNote, al as readChildAndParentsRelationship, am as readChildAndParentsRelationshipChangeHistory, an as readChildAndParentsRelationshipNote, ao as readChildAndParentsRelationshipNotes, ap as readChildAndParentsRelationshipSourceReferences, aq as readChildAndParentsRelationshipSources, ar as readCollectionSourceDescriptions, as as readCoupleRelationship, at as readCoupleRelationshipChangeHistory, au as readCoupleRelationshipNote, av as readCoupleRelationshipNotes, aw as readCoupleRelationshipSourceReferences, ax as readCoupleRelationshipSources, ay as readDescendancy, az as readGroup, aA as readGroups, aB as readNotAMatchDeclarations, aC as readPendingModifications, aD as readPerson, aE as readPersonChangeHistory, aF as readPersonChildren, aG as readPersonDiscussions, aH as readPersonFamilies, aI as readPersonMatches, aJ as readPersonMemories, aK as readPersonMergeAnalysis, aL as readPersonNonMatches, aM as readPersonNotAMatches, aN as readPersonNote, aO as readPersonNotes, aP as readPersonParents, aQ as readPersonPortraits, aR as readPersonSources, aS as readPersonSpouses, aT as readPersonWithDetails, aU as readPreferredParentRelationship, aV as readPreferredSpouseRelationship, aW as readResearchTreePersons, aX as readSourceDescription, aY as readSourceDescriptionChanges, aZ as readSourceDescriptionHead, a_ as readSourceDescriptions, a$ as readSourceFolders, b0 as readTree, b1 as readTreeChanges, b2 as readTreeMatches, b3 as readUserDefinedCollection, b4 as readUserSourceDescriptions, b5 as readUserSourceFolders, b6 as removeSourcesFromCollection, b7 as restoreChange, b8 as restoreChildAndParentsRelationship, b9 as restoreCoupleRelationship, ba as restorePerson, bb as searchPersonByData, bc as searchPersons, bd as setParentOrder, be as setPreferredParentRelationship, bf as setPreferredSpouseRelationship, bg as setSpouseOrder, bh as updateChildAndParentsRelationship, bi as updateChildAndParentsRelationshipNote, bj as updateCoupleRelationship, bk as updateCoupleRelationshipNote, bl as updateGroup, bm as updateMatchResolution, bn as updatePerson, bo as updatePersonNotAMatches, bp as updatePersonNote, bq as updatePersonPortraits, br as updateSourceDescription, bs as updateUserDefinedCollection } from './tree-changes-e0UMhVha.cjs';
2
2
 
3
3
  /**
4
4
  * FamilySearch Tree API
@@ -1,4 +1,4 @@
1
- import { A as AgentAPI, C as ConclusionsAPI, G as GroupsAPI, M as MatchesAPI, a as MergesAPI, N as NotesAPI, P as PedigreesAPI, b as PendingModificationsAPI, c as PersonsAPI, d as PreferencesAPI, R as RelationshipsAPI, S as SearchAPI, e as SourceAttachmentsAPI, f as SourceBoxAPI, g as SourcesAPI, T as TreeChangesAPI, h as TreesManagementAPI, i as addSourcesToCollection, j as allowPersonMerge, k as attachSourceToChildAndParentsRelationship, l as attachSourceToCoupleRelationship, m as attachSourceToPerson, n as canMergePersons, o as createChildAndParentsRelationship, p as createChildAndParentsRelationshipNote, q as createChildAndParentsRelationshipSourceReference, r as createCoupleRelationship, s as createCoupleRelationshipNote, t as createCoupleRelationshipSourceReference, u as createGroup, v as createNotAMatchDeclaration, w as createPerson, x as createPersonMemory, y as createPersonNote, z as createRelationshipGedcomx, B as createSourceDescription, D as createSourceFolder, E as createTree, F as deleteAllNotAMatchDeclarations, H as deleteChildAndParentsRelationship, I as deleteChildAndParentsRelationshipConclusion, J as deleteChildAndParentsRelationshipNote, K as deleteChildAndParentsRelationshipParent, L as deleteChildAndParentsRelationshipSourceReference, O as deleteCoupleRelationship, Q as deleteCoupleRelationshipConclusion, U as deleteCoupleRelationshipNote, V as deleteCoupleRelationshipSourceReference, W as deleteGroup, X as deleteNotAMatchDeclaration, Y as deletePerson, Z as deletePersonConclusion, _ as deletePersonDiscussionReference, $ as deletePersonMemoriesPersonaReference, a0 as deletePersonNotAMatch, a1 as deletePersonNotAMatches, a2 as deletePersonNote, a3 as deletePersonPortrait, a4 as deletePersonSourceReference, a5 as deletePreferredParentRelationship, a6 as deletePreferredSpouseRelationship, a7 as deleteSourceDescription, a8 as deleteTree, a9 as deleteTreePersonReference, aa as deleteUserDefinedCollection, ab as detachSourceFromChildAndParentsRelationship, ac as detachSourceFromCoupleRelationship, ad as detachSourceFromPerson, ae as exportGEDCOM, af as matchPerson, ag as mergePerson, ah as performPersonMatchesByExample, ai as readAgent, aj as readAncestry, ak as readChildAndParentRelationshipNote, al as readChildAndParentsRelationship, am as readChildAndParentsRelationshipChangeHistory, an as readChildAndParentsRelationshipNote, ao as readChildAndParentsRelationshipNotes, ap as readChildAndParentsRelationshipSourceReferences, aq as readChildAndParentsRelationshipSources, ar as readCollectionSourceDescriptions, as as readCoupleRelationship, at as readCoupleRelationshipChangeHistory, au as readCoupleRelationshipNote, av as readCoupleRelationshipNotes, aw as readCoupleRelationshipSourceReferences, ax as readCoupleRelationshipSources, ay as readDescendancy, az as readGroup, aA as readGroups, aB as readNotAMatchDeclarations, aC as readPendingModifications, aD as readPerson, aE as readPersonChangeHistory, aF as readPersonChildren, aG as readPersonDiscussions, aH as readPersonFamilies, aI as readPersonMatches, aJ as readPersonMemories, aK as readPersonMergeAnalysis, aL as readPersonNonMatches, aM as readPersonNotAMatches, aN as readPersonNote, aO as readPersonNotes, aP as readPersonParents, aQ as readPersonPortraits, aR as readPersonSources, aS as readPersonSpouses, aT as readPersonWithDetails, aU as readPreferredParentRelationship, aV as readPreferredSpouseRelationship, aW as readResearchTreePersons, aX as readSourceDescription, aY as readSourceDescriptionChanges, aZ as readSourceDescriptionHead, a_ as readSourceDescriptions, a$ as readSourceFolders, b0 as readTree, b1 as readTreeChanges, b2 as readTreeMatches, b3 as readUserDefinedCollection, b4 as readUserSourceDescriptions, b5 as readUserSourceFolders, b6 as removeSourcesFromCollection, b7 as restoreChange, b8 as restoreChildAndParentsRelationship, b9 as restoreCoupleRelationship, ba as restorePerson, bb as searchPersonByData, bc as searchPersons, bd as setParentOrder, be as setPreferredParentRelationship, bf as setPreferredSpouseRelationship, bg as setSpouseOrder, bh as updateChildAndParentsRelationship, bi as updateChildAndParentsRelationshipNote, bj as updateCoupleRelationship, bk as updateCoupleRelationshipNote, bl as updateGroup, bm as updateMatchResolution, bn as updatePerson, bo as updatePersonNotAMatches, bp as updatePersonNote, bq as updatePersonPortraits, br as updateSourceDescription, bs as updateUserDefinedCollection } from './index-CLkFtjZD.cjs';
1
+ import { A as AgentAPI, C as ConclusionsAPI, G as GroupsAPI, M as MatchesAPI, a as MergesAPI, N as NotesAPI, P as PedigreesAPI, b as PendingModificationsAPI, c as PersonsAPI, d as PreferencesAPI, R as RelationshipsAPI, S as SearchAPI, e as SourceAttachmentsAPI, f as SourceBoxAPI, g as SourcesAPI, T as TreeChangesAPI, h as TreesManagementAPI, i as addSourcesToCollection, j as allowPersonMerge, k as attachSourceToChildAndParentsRelationship, l as attachSourceToCoupleRelationship, m as attachSourceToPerson, n as canMergePersons, o as createChildAndParentsRelationship, p as createChildAndParentsRelationshipNote, q as createChildAndParentsRelationshipSourceReference, r as createCoupleRelationship, s as createCoupleRelationshipNote, t as createCoupleRelationshipSourceReference, u as createGroup, v as createNotAMatchDeclaration, w as createPerson, x as createPersonMemory, y as createPersonNote, z as createRelationshipGedcomx, B as createSourceDescription, D as createSourceFolder, E as createTree, F as deleteAllNotAMatchDeclarations, H as deleteChildAndParentsRelationship, I as deleteChildAndParentsRelationshipConclusion, J as deleteChildAndParentsRelationshipNote, K as deleteChildAndParentsRelationshipParent, L as deleteChildAndParentsRelationshipSourceReference, O as deleteCoupleRelationship, Q as deleteCoupleRelationshipConclusion, U as deleteCoupleRelationshipNote, V as deleteCoupleRelationshipSourceReference, W as deleteGroup, X as deleteNotAMatchDeclaration, Y as deletePerson, Z as deletePersonConclusion, _ as deletePersonDiscussionReference, $ as deletePersonMemoriesPersonaReference, a0 as deletePersonNotAMatch, a1 as deletePersonNotAMatches, a2 as deletePersonNote, a3 as deletePersonPortrait, a4 as deletePersonSourceReference, a5 as deletePreferredParentRelationship, a6 as deletePreferredSpouseRelationship, a7 as deleteSourceDescription, a8 as deleteTree, a9 as deleteTreePersonReference, aa as deleteUserDefinedCollection, ab as detachSourceFromChildAndParentsRelationship, ac as detachSourceFromCoupleRelationship, ad as detachSourceFromPerson, ae as exportGEDCOM, af as matchPerson, ag as mergePerson, ah as performPersonMatchesByExample, ai as readAgent, aj as readAncestry, ak as readChildAndParentRelationshipNote, al as readChildAndParentsRelationship, am as readChildAndParentsRelationshipChangeHistory, an as readChildAndParentsRelationshipNote, ao as readChildAndParentsRelationshipNotes, ap as readChildAndParentsRelationshipSourceReferences, aq as readChildAndParentsRelationshipSources, ar as readCollectionSourceDescriptions, as as readCoupleRelationship, at as readCoupleRelationshipChangeHistory, au as readCoupleRelationshipNote, av as readCoupleRelationshipNotes, aw as readCoupleRelationshipSourceReferences, ax as readCoupleRelationshipSources, ay as readDescendancy, az as readGroup, aA as readGroups, aB as readNotAMatchDeclarations, aC as readPendingModifications, aD as readPerson, aE as readPersonChangeHistory, aF as readPersonChildren, aG as readPersonDiscussions, aH as readPersonFamilies, aI as readPersonMatches, aJ as readPersonMemories, aK as readPersonMergeAnalysis, aL as readPersonNonMatches, aM as readPersonNotAMatches, aN as readPersonNote, aO as readPersonNotes, aP as readPersonParents, aQ as readPersonPortraits, aR as readPersonSources, aS as readPersonSpouses, aT as readPersonWithDetails, aU as readPreferredParentRelationship, aV as readPreferredSpouseRelationship, aW as readResearchTreePersons, aX as readSourceDescription, aY as readSourceDescriptionChanges, aZ as readSourceDescriptionHead, a_ as readSourceDescriptions, a$ as readSourceFolders, b0 as readTree, b1 as readTreeChanges, b2 as readTreeMatches, b3 as readUserDefinedCollection, b4 as readUserSourceDescriptions, b5 as readUserSourceFolders, b6 as removeSourcesFromCollection, b7 as restoreChange, b8 as restoreChildAndParentsRelationship, b9 as restoreCoupleRelationship, ba as restorePerson, bb as searchPersonByData, bc as searchPersons, bd as setParentOrder, be as setPreferredParentRelationship, bf as setPreferredSpouseRelationship, bg as setSpouseOrder, bh as updateChildAndParentsRelationship, bi as updateChildAndParentsRelationshipNote, bj as updateCoupleRelationship, bk as updateCoupleRelationshipNote, bl as updateGroup, bm as updateMatchResolution, bn as updatePerson, bo as updatePersonNotAMatches, bp as updatePersonNote, bq as updatePersonPortraits, br as updateSourceDescription, bs as updateUserDefinedCollection } from './tree-changes-CFwJtBcK.js';
2
2
 
3
3
  /**
4
4
  * FamilySearch Tree API
package/dist/index.cjs CHANGED
@@ -1668,6 +1668,10 @@ __export(tree_exports, {
1668
1668
  });
1669
1669
 
1670
1670
  // src/api/tree/persons.ts
1671
+ var PERSON_WRITE_HEADERS = {
1672
+ "Content-Type": "application/x-fs-v1+json",
1673
+ Accept: "application/x-fs-v1+json"
1674
+ };
1671
1675
  async function readPerson(sdk, personId) {
1672
1676
  try {
1673
1677
  const response = await sdk.get(
@@ -1700,7 +1704,7 @@ async function readPersonWithDetails(sdk, personId, options = {}) {
1700
1704
  }
1701
1705
  async function createPerson(sdk, person, reason) {
1702
1706
  try {
1703
- const headers = {};
1707
+ const headers = { ...PERSON_WRITE_HEADERS };
1704
1708
  if (reason) {
1705
1709
  headers["X-Reason"] = reason;
1706
1710
  }
@@ -1717,7 +1721,7 @@ async function createPerson(sdk, person, reason) {
1717
1721
  }
1718
1722
  async function updatePerson(sdk, personId, person, reason) {
1719
1723
  try {
1720
- const headers = {};
1724
+ const headers = { ...PERSON_WRITE_HEADERS };
1721
1725
  if (reason) {
1722
1726
  headers["X-Reason"] = reason;
1723
1727
  }
@@ -6218,7 +6222,7 @@ var FamilySearchSDK = class {
6218
6222
  });
6219
6223
  let data;
6220
6224
  const contentType = response.headers.get("content-type");
6221
- if (contentType && contentType.includes("application/json")) {
6225
+ if (contentType && contentType.includes("json")) {
6222
6226
  try {
6223
6227
  data = await response.json();
6224
6228
  } catch (error) {
@@ -6374,6 +6378,40 @@ function resetFamilySearchSDK() {
6374
6378
  sdkInstance = null;
6375
6379
  }
6376
6380
 
6381
+ // src/places/gazetteer-id.ts
6382
+ var numericPlaceIdFromRef = (ref) => {
6383
+ if (!ref) {
6384
+ return void 0;
6385
+ }
6386
+ if (ref.includes("/places/description/") || ref.includes("ark:/")) {
6387
+ return void 0;
6388
+ }
6389
+ const match = ref.match(/\/places\/(\d+)/);
6390
+ return match?.[1];
6391
+ };
6392
+ var extractGazetteerPlaceId = (place) => {
6393
+ const persistent = place.identifiers?.["http://gedcomx.org/Persistent"]?.[0];
6394
+ const fromPersistent = numericPlaceIdFromRef(persistent);
6395
+ if (fromPersistent) {
6396
+ return fromPersistent;
6397
+ }
6398
+ return numericPlaceIdFromRef(place.place?.description);
6399
+ };
6400
+ var familySearchResearchPlaceUrl = (placeId, baseUrl = "https://www.familysearch.org") => `${baseUrl}/en/research/places/?focusedId=${placeId}`;
6401
+ var pickBestPlaceSearchResult = (results, query) => {
6402
+ if (results.length === 0) {
6403
+ return void 0;
6404
+ }
6405
+ const town = query.split(",")[0]?.trim().toLowerCase();
6406
+ if (!town) {
6407
+ return results[0];
6408
+ }
6409
+ const label = (result) => (result.fullName || result.name || result.title || "").toLowerCase();
6410
+ return results.find(
6411
+ (result) => label(result) === town || label(result).startsWith(`${town},`)
6412
+ ) || results.find((result) => label(result).includes(town)) || results[0];
6413
+ };
6414
+
6377
6415
  // src/utils/gedcom-converter.ts
6378
6416
  function transformFamilySearchUrl(url) {
6379
6417
  if (url.includes("/platform/tree/persons/https://")) {
@@ -6418,6 +6456,64 @@ function transformSourceUrl(url) {
6418
6456
  }
6419
6457
  return `${baseUrl}/${arkId}`;
6420
6458
  }
6459
+ function sanitizeGedcomValue(value) {
6460
+ return value.replace(/[\r\n\t]+/g, " ").trim();
6461
+ }
6462
+ var GEDCOM_MONTHS = [
6463
+ "JAN",
6464
+ "FEB",
6465
+ "MAR",
6466
+ "APR",
6467
+ "MAY",
6468
+ "JUN",
6469
+ "JUL",
6470
+ "AUG",
6471
+ "SEP",
6472
+ "OCT",
6473
+ "NOV",
6474
+ "DEC"
6475
+ ];
6476
+ function formatSimpleFormalDate(value) {
6477
+ const match = value.match(/^([+-])(\d{1,6})(?:-(\d{2}))?(?:-(\d{2}))?/);
6478
+ if (!match) return void 0;
6479
+ const [, sign, yearPart, monthPart, dayPart] = match;
6480
+ if (sign === "-") return void 0;
6481
+ const year = String(parseInt(yearPart, 10));
6482
+ if (!monthPart) return year;
6483
+ const month = GEDCOM_MONTHS[parseInt(monthPart, 10) - 1];
6484
+ if (!month) return void 0;
6485
+ if (!dayPart) return `${month} ${year}`;
6486
+ return `${parseInt(dayPart, 10)} ${month} ${year}`;
6487
+ }
6488
+ function convertFormalDateToGedcom(formal) {
6489
+ if (!formal) return void 0;
6490
+ let value = formal.trim();
6491
+ let approximate = false;
6492
+ if (value.startsWith("A")) {
6493
+ approximate = true;
6494
+ value = value.slice(1);
6495
+ }
6496
+ if (value.includes("/")) {
6497
+ const slashIndex = value.indexOf("/");
6498
+ const start = value.slice(0, slashIndex);
6499
+ const end = value.slice(slashIndex + 1);
6500
+ const startDate = start ? formatSimpleFormalDate(start) : void 0;
6501
+ const endDate = end ? formatSimpleFormalDate(end) : void 0;
6502
+ if (start && !startDate) return void 0;
6503
+ if (end && !endDate) return void 0;
6504
+ if (startDate && endDate) return `BET ${startDate} AND ${endDate}`;
6505
+ if (startDate) return `FROM ${startDate}`;
6506
+ if (endDate) return `TO ${endDate}`;
6507
+ return void 0;
6508
+ }
6509
+ const simple = formatSimpleFormalDate(value);
6510
+ if (!simple) return void 0;
6511
+ return approximate ? `ABT ${simple}` : simple;
6512
+ }
6513
+ function resolveFactDate(date) {
6514
+ if (!date) return void 0;
6515
+ return convertFormalDateToGedcom(date.formal) || date.original;
6516
+ }
6421
6517
  function extractName(person) {
6422
6518
  if (!person) return null;
6423
6519
  if (person.names?.[0]?.nameForms?.[0]) {
@@ -6425,8 +6521,14 @@ function extractName(person) {
6425
6521
  const parts = nameForm.parts || [];
6426
6522
  const given = parts.find((p) => p.type?.includes("Given"))?.value || "";
6427
6523
  const surname = parts.find((p) => p.type?.includes("Surname"))?.value || "";
6428
- if (given || surname) {
6429
- return `${given} /${surname}/`.trim();
6524
+ if (given && surname) {
6525
+ return `${given} /${surname}/`;
6526
+ }
6527
+ if (surname) {
6528
+ return `/${surname}/`;
6529
+ }
6530
+ if (given) {
6531
+ return given;
6430
6532
  }
6431
6533
  if (nameForm.fullText) {
6432
6534
  return nameForm.fullText;
@@ -6456,11 +6558,9 @@ function extractFact(person, factType) {
6456
6558
  const factTypeUrl = `http://gedcomx.org/${factType === "BIRTH" ? "Birth" : "Death"}`;
6457
6559
  const fact = person.facts?.find((f) => f.type === factTypeUrl);
6458
6560
  if (fact) {
6459
- if (fact.date?.formal || fact.date?.original) {
6460
- result.date = (fact.date?.formal || fact.date?.original)?.replace(
6461
- /^(-|\+)/,
6462
- ""
6463
- );
6561
+ const resolvedDate = resolveFactDate(fact.date);
6562
+ if (resolvedDate) {
6563
+ result.date = resolvedDate;
6464
6564
  }
6465
6565
  if (fact.place?.original) {
6466
6566
  result.place = fact.place.original;
@@ -6513,25 +6613,30 @@ function convertFactToGedcom(fact) {
6513
6613
  };
6514
6614
  const gedcomTag = typeMap[fact.type] || "EVEN";
6515
6615
  if (gedcomTag === "OCCU" && fact.value) {
6516
- lines.push(`1 OCCU ${fact.value}`);
6616
+ lines.push(`1 OCCU ${sanitizeGedcomValue(fact.value)}`);
6517
6617
  } else {
6518
6618
  lines.push(`1 ${gedcomTag}`);
6519
6619
  }
6620
+ if (gedcomTag === "EVEN") {
6621
+ const typeName = fact.type.split("/").pop();
6622
+ if (typeName) {
6623
+ lines.push(`2 TYPE ${sanitizeGedcomValue(typeName)}`);
6624
+ }
6625
+ }
6520
6626
  if (fact.links?.conclusion?.href) {
6521
6627
  const webUrl = transformFamilySearchUrl(fact.links.conclusion.href);
6522
6628
  lines.push(`2 WWW ${webUrl}`);
6523
6629
  lines.push(`3 _IS_FS Y`);
6524
6630
  }
6525
- if (fact.date?.formal || fact.date?.original) {
6526
- lines.push(
6527
- `2 DATE ${(fact.date?.formal || fact.date?.original)?.replace(/^(-|\+)/, "")}`
6528
- );
6631
+ const resolvedDate = resolveFactDate(fact.date);
6632
+ if (resolvedDate) {
6633
+ lines.push(`2 DATE ${sanitizeGedcomValue(resolvedDate)}`);
6529
6634
  }
6530
6635
  if (fact.place?.original) {
6531
- lines.push(`2 PLAC ${fact.place.original}`);
6636
+ lines.push(`2 PLAC ${sanitizeGedcomValue(fact.place.original)}`);
6532
6637
  }
6533
6638
  if (fact.value && gedcomTag !== "OCCU") {
6534
- lines.push(`2 NOTE ${fact.value}`);
6639
+ lines.push(`2 NOTE ${sanitizeGedcomValue(fact.value)}`);
6535
6640
  }
6536
6641
  return lines;
6537
6642
  }
@@ -6551,14 +6656,14 @@ function convertToGedcom(pedigreeData, options = {}) {
6551
6656
  lines.push("2 VERS 1.0");
6552
6657
  lines.push("2 NAME FamilySearch API");
6553
6658
  if (treeName) {
6554
- lines.push(`2 _TREE ${treeName}`);
6659
+ lines.push(`2 _TREE ${sanitizeGedcomValue(treeName)}`);
6555
6660
  const randomRIN = Math.floor(Math.random() * 1e8);
6556
6661
  lines.push(`3 RIN ${randomRIN}`);
6557
6662
  }
6558
6663
  lines.push("1 DEST ANY");
6559
6664
  lines.push("1 DATE " + formatDateForGedcom(/* @__PURE__ */ new Date()));
6560
6665
  lines.push("1 SUBM @SUBM1@");
6561
- lines.push("1 FILE " + treeName);
6666
+ lines.push("1 FILE " + sanitizeGedcomValue(treeName));
6562
6667
  lines.push("1 GEDC");
6563
6668
  lines.push("2 VERS 5.5");
6564
6669
  lines.push("2 FORM LINEAGE-LINKED");
@@ -6580,20 +6685,22 @@ function convertToGedcom(pedigreeData, options = {}) {
6580
6685
  const sourceId = `@S${sourceCounter++}@`;
6581
6686
  lines.push(`0 ${sourceId} SOUR`);
6582
6687
  const title = source.titles?.[0]?.value || "FamilySearch Source";
6583
- lines.push(`1 TITL ${title}`);
6688
+ lines.push(`1 TITL ${sanitizeGedcomValue(title)}`);
6584
6689
  if (source.citations?.[0]?.value) {
6585
- lines.push(`1 TEXT ${source.citations[0].value}`);
6690
+ lines.push(`1 TEXT ${sanitizeGedcomValue(source.citations[0].value)}`);
6586
6691
  }
6587
6692
  if (source.about) {
6588
6693
  const webUrl = transformSourceUrl(source.about);
6589
6694
  lines.push(`1 WWW ${webUrl}`);
6590
6695
  }
6591
6696
  if (source.resourceType) {
6592
- lines.push(`1 NOTE Resource Type: ${source.resourceType}`);
6697
+ lines.push(
6698
+ `1 NOTE Resource Type: ${sanitizeGedcomValue(source.resourceType)}`
6699
+ );
6593
6700
  }
6594
6701
  });
6595
6702
  const fsSourMap = /* @__PURE__ */ new Map();
6596
- let fsSourCounter = 1;
6703
+ let fsSourCounter = sourceCounter;
6597
6704
  pedigreeData.persons.forEach((person) => {
6598
6705
  if (person.sources?.persons?.[0]?.sources) {
6599
6706
  const sourceDescMap = /* @__PURE__ */ new Map();
@@ -6643,20 +6750,22 @@ function convertToGedcom(pedigreeData, options = {}) {
6643
6750
  lines.push(`1 _IS_FS Y`);
6644
6751
  lines.push(`1 _FS_ID ${id}`);
6645
6752
  if (source.titles?.[0]?.value) {
6646
- lines.push(`1 TITL ${source.titles[0].value}`);
6753
+ lines.push(`1 TITL ${sanitizeGedcomValue(source.titles[0].value)}`);
6647
6754
  }
6648
6755
  if (source.citations?.[0]?.value) {
6649
- lines.push(`1 TEXT ${source.citations[0].value}`);
6756
+ lines.push(`1 TEXT ${sanitizeGedcomValue(source.citations[0].value)}`);
6650
6757
  }
6651
6758
  if (source.about) {
6652
6759
  const webUrl = transformSourceUrl(source.about);
6653
6760
  lines.push(`1 WWW ${webUrl}`);
6654
6761
  }
6655
6762
  if (source.resourceType) {
6656
- lines.push(`1 NOTE Resource Type: ${source.resourceType}`);
6763
+ lines.push(
6764
+ `1 NOTE Resource Type: ${sanitizeGedcomValue(source.resourceType)}`
6765
+ );
6657
6766
  }
6658
6767
  notes.forEach((note) => {
6659
- lines.push(`1 NOTE ${note}`);
6768
+ lines.push(`1 NOTE ${sanitizeGedcomValue(note)}`);
6660
6769
  });
6661
6770
  });
6662
6771
  const fsMatchMap = /* @__PURE__ */ new Map();
@@ -6676,7 +6785,7 @@ function convertToGedcom(pedigreeData, options = {}) {
6676
6785
  lines.push(`1 _IS_FS Y`);
6677
6786
  lines.push(`1 _FS_ID ${id}`);
6678
6787
  if (entry.title) {
6679
- lines.push(`1 TITL ${entry.title}`);
6788
+ lines.push(`1 TITL ${sanitizeGedcomValue(entry.title)}`);
6680
6789
  }
6681
6790
  if (entry.content?.score !== void 0) {
6682
6791
  lines.push(`1 SCORE ${entry.content.score}`);
@@ -6697,7 +6806,7 @@ function convertToGedcom(pedigreeData, options = {}) {
6697
6806
  }
6698
6807
  if (matchInfo.status) {
6699
6808
  const statusName = matchInfo.status.includes("/") ? matchInfo.status.split("/").pop() : matchInfo.status;
6700
- lines.push(`1 NOTE Status: ${statusName}`);
6809
+ lines.push(`1 NOTE Status: ${sanitizeGedcomValue(statusName || "")}`);
6701
6810
  }
6702
6811
  }
6703
6812
  lines.push(`1 TYPE ${collectionType}`);
@@ -6709,42 +6818,52 @@ function convertToGedcom(pedigreeData, options = {}) {
6709
6818
  if (entry.content?.gedcomx?.persons && entry.content.gedcomx.persons.length > 0) {
6710
6819
  const matchedPerson = entry.content.gedcomx.persons[0];
6711
6820
  if (matchedPerson.display?.name) {
6712
- lines.push(`1 TEXT ${matchedPerson.display.name}`);
6821
+ lines.push(`1 TEXT ${sanitizeGedcomValue(matchedPerson.display.name)}`);
6713
6822
  }
6714
6823
  if (matchedPerson.display?.lifespan) {
6715
6824
  lines.push(
6716
- `1 NOTE Lifespan: ${matchedPerson.display.lifespan}`
6825
+ `1 NOTE Lifespan: ${sanitizeGedcomValue(matchedPerson.display.lifespan)}`
6717
6826
  );
6718
6827
  }
6719
6828
  if (matchedPerson.display?.birthDate || matchedPerson.display?.birthPlace) {
6720
- const birthInfo = [
6721
- matchedPerson.display.birthDate,
6722
- matchedPerson.display.birthPlace
6723
- ].filter(Boolean).join(", ");
6829
+ const birthInfo = sanitizeGedcomValue(
6830
+ [
6831
+ matchedPerson.display.birthDate,
6832
+ matchedPerson.display.birthPlace
6833
+ ].filter(Boolean).join(", ")
6834
+ );
6724
6835
  if (birthInfo) {
6725
6836
  lines.push(`1 NOTE Birth: ${birthInfo}`);
6726
6837
  }
6727
6838
  }
6728
6839
  if (matchedPerson.display?.deathDate || matchedPerson.display?.deathPlace) {
6729
- const deathInfo = [
6730
- matchedPerson.display.deathDate,
6731
- matchedPerson.display.deathPlace
6732
- ].filter(Boolean).join(", ");
6840
+ const deathInfo = sanitizeGedcomValue(
6841
+ [
6842
+ matchedPerson.display.deathDate,
6843
+ matchedPerson.display.deathPlace
6844
+ ].filter(Boolean).join(", ")
6845
+ );
6733
6846
  if (deathInfo) {
6734
6847
  lines.push(`1 NOTE Death: ${deathInfo}`);
6735
6848
  }
6736
6849
  }
6737
6850
  if (matchedPerson.display?.gender) {
6738
- lines.push(`1 NOTE Gender: ${matchedPerson.display.gender}`);
6851
+ lines.push(
6852
+ `1 NOTE Gender: ${sanitizeGedcomValue(matchedPerson.display.gender)}`
6853
+ );
6739
6854
  }
6740
6855
  }
6741
6856
  if (entry.content?.sourceDescription) {
6742
6857
  const sourceDesc = entry.content.sourceDescription;
6743
6858
  if (sourceDesc.citations?.[0]?.value) {
6744
- lines.push(`1 NOTE Citation: ${sourceDesc.citations[0].value}`);
6859
+ lines.push(
6860
+ `1 NOTE Citation: ${sanitizeGedcomValue(sourceDesc.citations[0].value)}`
6861
+ );
6745
6862
  }
6746
6863
  if (sourceDesc.resourceType) {
6747
- lines.push(`1 NOTE Resource Type: ${sourceDesc.resourceType}`);
6864
+ lines.push(
6865
+ `1 NOTE Resource Type: ${sanitizeGedcomValue(sourceDesc.resourceType)}`
6866
+ );
6748
6867
  }
6749
6868
  if (sourceDesc.about) {
6750
6869
  const webUrl = transformSourceUrl(sourceDesc.about);
@@ -6987,7 +7106,7 @@ function convertToGedcom(pedigreeData, options = {}) {
6987
7106
  const personData = person.fullDetails?.persons?.[0] || person;
6988
7107
  const name = extractName(personData);
6989
7108
  if (name) {
6990
- lines.push(`1 NAME ${name}`);
7109
+ lines.push(`1 NAME ${sanitizeGedcomValue(name)}`);
6991
7110
  }
6992
7111
  const gender = extractGender(personData);
6993
7112
  if (gender) {
@@ -6997,20 +7116,20 @@ function convertToGedcom(pedigreeData, options = {}) {
6997
7116
  if (birth) {
6998
7117
  lines.push("1 BIRT");
6999
7118
  if (birth.date) {
7000
- lines.push(`2 DATE ${birth.date}`);
7119
+ lines.push(`2 DATE ${sanitizeGedcomValue(birth.date)}`);
7001
7120
  }
7002
7121
  if (birth.place) {
7003
- lines.push(`2 PLAC ${birth.place}`);
7122
+ lines.push(`2 PLAC ${sanitizeGedcomValue(birth.place)}`);
7004
7123
  }
7005
7124
  }
7006
7125
  const death = extractFact(personData, "DEATH");
7007
7126
  if (death) {
7008
7127
  lines.push("1 DEAT");
7009
7128
  if (death.date) {
7010
- lines.push(`2 DATE ${death.date}`);
7129
+ lines.push(`2 DATE ${sanitizeGedcomValue(death.date)}`);
7011
7130
  }
7012
7131
  if (death.place) {
7013
- lines.push(`2 PLAC ${death.place}`);
7132
+ lines.push(`2 PLAC ${sanitizeGedcomValue(death.place)}`);
7014
7133
  }
7015
7134
  }
7016
7135
  personData.facts?.forEach((fact) => {
@@ -7022,8 +7141,7 @@ function convertToGedcom(pedigreeData, options = {}) {
7022
7141
  if (includeNotes && person.notes?.persons?.[0]?.notes) {
7023
7142
  person.notes.persons[0].notes.forEach((note) => {
7024
7143
  if (note.text) {
7025
- const noteText = note.text.replace(/\n/g, " ");
7026
- lines.push(`1 NOTE ${noteText}`);
7144
+ lines.push(`1 NOTE ${sanitizeGedcomValue(note.text)}`);
7027
7145
  }
7028
7146
  });
7029
7147
  }
@@ -7041,7 +7159,7 @@ function convertToGedcom(pedigreeData, options = {}) {
7041
7159
  sourceRef.qualifiers.forEach((qualifier) => {
7042
7160
  if (qualifier.name && qualifier.value) {
7043
7161
  lines.push(
7044
- `2 NOTE ${qualifier.name}: ${qualifier.value}`
7162
+ `2 NOTE ${sanitizeGedcomValue(`${qualifier.name}: ${qualifier.value}`)}`
7045
7163
  );
7046
7164
  }
7047
7165
  });
@@ -7195,31 +7313,36 @@ function addMarriageFacts(lines, relationships, person1, person2) {
7195
7313
  return [a, b].sort().join("-") === relKey;
7196
7314
  });
7197
7315
  if (!rel) return;
7316
+ const isMarriageEvent = (type) => !!type && (type.includes("Marriage") || type.includes("Divorce"));
7198
7317
  const marriageFacts = [];
7199
7318
  if (rel.facts && Array.isArray(rel.facts)) {
7200
7319
  rel.facts.forEach((f) => {
7201
- if (f.type?.includes("Marriage")) {
7320
+ if (isMarriageEvent(f.type)) {
7202
7321
  marriageFacts.push(f);
7203
7322
  }
7204
7323
  });
7205
7324
  }
7206
7325
  if (rel.details?.facts && Array.isArray(rel.details.facts)) {
7207
7326
  marriageFacts.push(
7208
- ...rel.details.facts.filter((f) => f.type?.includes("Marriage"))
7327
+ ...rel.details.facts.filter((f) => isMarriageEvent(f.type))
7209
7328
  );
7210
7329
  }
7211
7330
  if (rel.details?.persons && Array.isArray(rel.details.persons)) {
7212
7331
  rel.details.persons.forEach((p) => {
7213
7332
  if (p.facts && Array.isArray(p.facts)) {
7214
7333
  p.facts.forEach((f) => {
7215
- if (f.type?.includes("Marriage")) {
7334
+ if (isMarriageEvent(f.type)) {
7216
7335
  marriageFacts.push(f);
7217
7336
  }
7218
7337
  });
7219
7338
  }
7220
7339
  });
7221
7340
  }
7341
+ const seenFacts = /* @__PURE__ */ new Set();
7222
7342
  marriageFacts.forEach((mf) => {
7343
+ const key = `${mf.type}|${resolveFactDate(mf.date) || ""}|${mf.place?.original || ""}`;
7344
+ if (seenFacts.has(key)) return;
7345
+ seenFacts.add(key);
7223
7346
  const factLines = convertFactToGedcom(mf);
7224
7347
  factLines.forEach((line) => lines.push(line));
7225
7348
  });
@@ -7256,6 +7379,8 @@ exports.createErrorFromResponse = createErrorFromResponse;
7256
7379
  exports.createFamilySearchSDK = createFamilySearchSDK;
7257
7380
  exports.createNetworkError = createNetworkError;
7258
7381
  exports.exchangeCodeForToken = exchangeCodeForToken;
7382
+ exports.extractGazetteerPlaceId = extractGazetteerPlaceId;
7383
+ exports.familySearchResearchPlaceUrl = familySearchResearchPlaceUrl;
7259
7384
  exports.fetchMultiplePersons = fetchMultiplePersons;
7260
7385
  exports.fetchPedigree = fetchPedigree;
7261
7386
  exports.generateOAuthState = generateOAuthState;
@@ -7267,8 +7392,10 @@ exports.getTokenStorageKey = getTokenStorageKey;
7267
7392
  exports.getUserInfo = getUserInfo;
7268
7393
  exports.initFamilySearchSDK = initFamilySearchSDK;
7269
7394
  exports.isRetryableError = isRetryableError;
7395
+ exports.numericPlaceIdFromRef = numericPlaceIdFromRef;
7270
7396
  exports.openOAuthPopup = openOAuthPopup;
7271
7397
  exports.parseCallbackParams = parseCallbackParams;
7398
+ exports.pickBestPlaceSearchResult = pickBestPlaceSearchResult;
7272
7399
  exports.readCurrentUser = readCurrentUser2;
7273
7400
  exports.readPlaceAttributes = readPlaceAttributes;
7274
7401
  exports.readPlaceChildren = readPlaceChildren;
package/dist/index.d.cts CHANGED
@@ -1,10 +1,11 @@
1
- import { bt as GenealogyOtherAPI, bu as GenealogyPersonsAPI, bv as GenealogyRelationshipsAPI, bw as GenealogySourcesAPI, bx as TreesAPI, by as createGenealogyPerson, bz as createGenealogySourceDescription, bA as createGenealogyTree, bB as deleteGenealogyConclusion, bC as deleteGenealogyPerson, bD as deleteGenealogyRelationship, bE as deleteGenealogySourceDescription, bF as deleteGenealogyTree, bG as readGenealogyBulkMatch, bH as readGenealogyNote, bI as readGenealogyPerson, bJ as readGenealogyPersonMatches, bK as readGenealogyPersons, bL as readGenealogySourceDescription, bM as readGenealogyTree, bN as readGenealogyTrees, bO as restoreGenealogyPerson, bP as updateGenealogyPerson, bQ as updateGenealogyRelationship, bR as updateGenealogySourceDescription, bS as updateGenealogyTree, bT as DatesAPI, bU as NamesAPI, bV as PlaceSearchQuery, bW as PlacesAPI, bX as VocabulariesAPI, bY as checkPlaceIsChild, bZ as getNameScript, b_ as normalizeDate, b$ as readPlaceAttributes, c0 as readPlaceChildren, c1 as readPlaceDescription, c2 as readPlaceDescriptionWithRelated, c3 as readPlaceDescriptions, c4 as readPlaceDescriptionsGroup, c5 as readPlaceDetails, c6 as readPlaceType, c7 as readPlaceTypeGroup, c8 as readPlaceTypeGroups, c9 as readPlaceTypes, ca as readVocabularies, cb as readVocabularyConcept, cc as readVocabularyConcepts, cd as searchParentPlaces, ce as searchPlaces, cf as segmentAName } from './index-CLkFtjZD.cjs';
2
- export { cg as DateStandardizationResponse, ch as ENVIRONMENT_CONFIGS, ci as FamilySearchPlace, cj as FamilySearchSDK, ck as FamilySearchUser, cl as MemoriesAPI, cm as MemoryArtifact, cn as MemoryComment, co as MemoryPersona, cp as MemoryPersonaResponse, cq as MemoryPersonasResponse, cr as MemoryWithCommentsResponse, cs as NameScriptResponse, ct as NameSegment, cu as NameSegmentsResponse, cv as PedigreeAPI, cw as PersonMemoriesResponse, cx as PlaceDescription, cy as PlaceDetailsResponse, cz as PlaceSearchResponse, cA as PlaceSearchResult, cB as StandardizedDate, cC as UserAPI, cD as UserMemoriesResponse, cE as VocabAPI, cF as VocabulariesResponse, cG as VocabularyConceptDetail, cH as VocabularyConceptResponse, cI as VocabularyConceptsResponse, cJ as VocabularyMetadata, cK as createFamilySearchSDK, cL as fetchMultiplePersons, cM as fetchPedigree, cN as getFamilySearchSDK, cO as initFamilySearchSDK, cP as readCurrentUser, cQ as resetFamilySearchSDK } from './index-CLkFtjZD.cjs';
1
+ import { bt as GenealogyOtherAPI, bu as GenealogyPersonsAPI, bv as GenealogyRelationshipsAPI, bw as GenealogySourcesAPI, bx as TreesAPI, by as createGenealogyPerson, bz as createGenealogySourceDescription, bA as createGenealogyTree, bB as deleteGenealogyConclusion, bC as deleteGenealogyPerson, bD as deleteGenealogyRelationship, bE as deleteGenealogySourceDescription, bF as deleteGenealogyTree, bG as readGenealogyBulkMatch, bH as readGenealogyNote, bI as readGenealogyPerson, bJ as readGenealogyPersonMatches, bK as readGenealogyPersons, bL as readGenealogySourceDescription, bM as readGenealogyTree, bN as readGenealogyTrees, bO as restoreGenealogyPerson, bP as updateGenealogyPerson, bQ as updateGenealogyRelationship, bR as updateGenealogySourceDescription, bS as updateGenealogyTree, bT as DatesAPI, bU as NamesAPI, bV as PlaceSearchQuery, bW as PlacesAPI, bX as VocabulariesAPI, bY as checkPlaceIsChild, bZ as getNameScript, b_ as normalizeDate, b$ as readPlaceAttributes, c0 as readPlaceChildren, c1 as readPlaceDescription, c2 as readPlaceDescriptionWithRelated, c3 as readPlaceDescriptions, c4 as readPlaceDescriptionsGroup, c5 as readPlaceDetails, c6 as readPlaceType, c7 as readPlaceTypeGroup, c8 as readPlaceTypeGroups, c9 as readPlaceTypes, ca as readVocabularies, cb as readVocabularyConcept, cc as readVocabularyConcepts, cd as searchParentPlaces, ce as searchPlaces, cf as segmentAName } from './tree-changes-e0UMhVha.cjs';
2
+ export { cg as DateStandardizationResponse, ch as ENVIRONMENT_CONFIGS, ci as FamilySearchPlace, cj as FamilySearchSDK, ck as FamilySearchUser, cl as MemoriesAPI, cm as MemoryArtifact, cn as MemoryComment, co as MemoryPersona, cp as MemoryPersonaResponse, cq as MemoryPersonasResponse, cr as MemoryWithCommentsResponse, cs as NameScriptResponse, ct as NameSegment, cu as NameSegmentsResponse, cv as PedigreeAPI, cw as PersonMemoriesResponse, cx as PlaceDescription, cy as PlaceDetailsResponse, cz as PlaceSearchResponse, cA as PlaceSearchResult, cB as StandardizedDate, cC as UserAPI, cD as UserMemoriesResponse, cE as VocabAPI, cF as VocabulariesResponse, cG as VocabularyConceptDetail, cH as VocabularyConceptResponse, cI as VocabularyConceptsResponse, cJ as VocabularyMetadata, cK as createFamilySearchSDK, cL as fetchMultiplePersons, cM as fetchPedigree, cN as getFamilySearchSDK, cO as initFamilySearchSDK, cP as readCurrentUser, cQ as resetFamilySearchSDK } from './tree-changes-e0UMhVha.cjs';
3
3
  import { F as FamilySearchApiResponse } from './index-0PpnEPuZ.cjs';
4
4
  export { E as EnvironmentConfig, a as FamilySearchApiError, b as FamilySearchEnvironment, c as FamilySearchSDKConfig, O as OAUTH_ENDPOINTS, d as OAUTH_STORAGE_KEYS, e as OAuthAPI, f as OAuthConfig, g as OAuthEndpoints, h as OAuthStateValidation, i as OAuthTokenResponse, P as ProgressCallback, R as RateLimiterConfig, S as SDKLogger, j as buildAuthorizationUrl, k as clearAllTokens, l as clearStoredTokens, m as exchangeCodeForToken, n as generateOAuthState, o as getOAuthEndpoints, p as getStoredAccessToken, q as getStoredRefreshToken, r as getTokenStorageKey, s as getUserInfo, t as openOAuthPopup, u as parseCallbackParams, v as refreshAccessToken, w as storeOAuthState, x as storeTokens, y as validateAccessToken, z as validateOAuthState } from './index-0PpnEPuZ.cjs';
5
5
  export { A as AttachSourceInput, a as AttachSourceResponse, C as ChangeEntry, b as ChildAndParentsRelationship, c as CreateChildAndParentsRelationshipInput, d as CreateCoupleRelationshipInput, e as CreatePersonResponse, f as CreateRelationshipResponse, D as DeletePersonResponse, g as Discussion, h as DiscussionComment, E as EnhancedPedigreeData, i as EnhancedPerson, F as FamilySearchPerson, M as MatchesResponse, N as NameForm, j as Note, k as NoteInput, l as NoteResponse, P as PedigreeData, m as PedigreeResponse, n as PersonChangeHistoryResponse, o as PersonData, p as PersonDiscussionsResponse, q as PersonDisplay, r as PersonFact, s as PersonInput, t as PersonMatchInput, u as PersonMatchOptions, v as PersonMergeAnalysis, w as PersonMergeInput, x as PersonMergeResponse, y as PersonNotesResponse, z as PersonPortrait, B as PersonPortraitsResponse, G as PersonSearchResponse, H as PersonSearchResult, I as PersonSourcesResponse, J as PersonWithRelationships, R as Relationship, K as RelationshipDetails, S as SourceDescription, L as SourceDescriptionDetail, O as SourceDescriptionResponse, Q as SourceDescriptionsResponse, T as SourceReference, U as TreePersonMatchEntry, V as TreePersonMatchesOptions, W as TreePersonMatchesResponse, X as UpdatePersonResponse, Y as UpdateRelationshipResponse } from './tree-D7X-beAQ.cjs';
6
+ export { FamilySearchPlacePayload, extractGazetteerPlaceId, familySearchResearchPlaceUrl, numericPlaceIdFromRef, pickBestPlaceSearchResult } from './places/index.cjs';
6
7
  export { GedcomConversionOptions, convertFamilySearchToGedcom, convertToGedcom, transformFamilySearchUrl } from './utils/index.cjs';
7
- export { i as TreeAPI } from './index-BMAcJBZJ.cjs';
8
+ export { i as TreeAPI } from './index-BfeojAOm.cjs';
8
9
 
9
10
  /**
10
11
  * FamilySearch Genealogies API
package/dist/index.d.ts CHANGED
@@ -1,10 +1,11 @@
1
- import { bt as GenealogyOtherAPI, bu as GenealogyPersonsAPI, bv as GenealogyRelationshipsAPI, bw as GenealogySourcesAPI, bx as TreesAPI, by as createGenealogyPerson, bz as createGenealogySourceDescription, bA as createGenealogyTree, bB as deleteGenealogyConclusion, bC as deleteGenealogyPerson, bD as deleteGenealogyRelationship, bE as deleteGenealogySourceDescription, bF as deleteGenealogyTree, bG as readGenealogyBulkMatch, bH as readGenealogyNote, bI as readGenealogyPerson, bJ as readGenealogyPersonMatches, bK as readGenealogyPersons, bL as readGenealogySourceDescription, bM as readGenealogyTree, bN as readGenealogyTrees, bO as restoreGenealogyPerson, bP as updateGenealogyPerson, bQ as updateGenealogyRelationship, bR as updateGenealogySourceDescription, bS as updateGenealogyTree, bT as DatesAPI, bU as NamesAPI, bV as PlaceSearchQuery, bW as PlacesAPI, bX as VocabulariesAPI, bY as checkPlaceIsChild, bZ as getNameScript, b_ as normalizeDate, b$ as readPlaceAttributes, c0 as readPlaceChildren, c1 as readPlaceDescription, c2 as readPlaceDescriptionWithRelated, c3 as readPlaceDescriptions, c4 as readPlaceDescriptionsGroup, c5 as readPlaceDetails, c6 as readPlaceType, c7 as readPlaceTypeGroup, c8 as readPlaceTypeGroups, c9 as readPlaceTypes, ca as readVocabularies, cb as readVocabularyConcept, cc as readVocabularyConcepts, cd as searchParentPlaces, ce as searchPlaces, cf as segmentAName } from './index-CKi9wd-C.js';
2
- export { cg as DateStandardizationResponse, ch as ENVIRONMENT_CONFIGS, ci as FamilySearchPlace, cj as FamilySearchSDK, ck as FamilySearchUser, cl as MemoriesAPI, cm as MemoryArtifact, cn as MemoryComment, co as MemoryPersona, cp as MemoryPersonaResponse, cq as MemoryPersonasResponse, cr as MemoryWithCommentsResponse, cs as NameScriptResponse, ct as NameSegment, cu as NameSegmentsResponse, cv as PedigreeAPI, cw as PersonMemoriesResponse, cx as PlaceDescription, cy as PlaceDetailsResponse, cz as PlaceSearchResponse, cA as PlaceSearchResult, cB as StandardizedDate, cC as UserAPI, cD as UserMemoriesResponse, cE as VocabAPI, cF as VocabulariesResponse, cG as VocabularyConceptDetail, cH as VocabularyConceptResponse, cI as VocabularyConceptsResponse, cJ as VocabularyMetadata, cK as createFamilySearchSDK, cL as fetchMultiplePersons, cM as fetchPedigree, cN as getFamilySearchSDK, cO as initFamilySearchSDK, cP as readCurrentUser, cQ as resetFamilySearchSDK } from './index-CKi9wd-C.js';
1
+ import { bt as GenealogyOtherAPI, bu as GenealogyPersonsAPI, bv as GenealogyRelationshipsAPI, bw as GenealogySourcesAPI, bx as TreesAPI, by as createGenealogyPerson, bz as createGenealogySourceDescription, bA as createGenealogyTree, bB as deleteGenealogyConclusion, bC as deleteGenealogyPerson, bD as deleteGenealogyRelationship, bE as deleteGenealogySourceDescription, bF as deleteGenealogyTree, bG as readGenealogyBulkMatch, bH as readGenealogyNote, bI as readGenealogyPerson, bJ as readGenealogyPersonMatches, bK as readGenealogyPersons, bL as readGenealogySourceDescription, bM as readGenealogyTree, bN as readGenealogyTrees, bO as restoreGenealogyPerson, bP as updateGenealogyPerson, bQ as updateGenealogyRelationship, bR as updateGenealogySourceDescription, bS as updateGenealogyTree, bT as DatesAPI, bU as NamesAPI, bV as PlaceSearchQuery, bW as PlacesAPI, bX as VocabulariesAPI, bY as checkPlaceIsChild, bZ as getNameScript, b_ as normalizeDate, b$ as readPlaceAttributes, c0 as readPlaceChildren, c1 as readPlaceDescription, c2 as readPlaceDescriptionWithRelated, c3 as readPlaceDescriptions, c4 as readPlaceDescriptionsGroup, c5 as readPlaceDetails, c6 as readPlaceType, c7 as readPlaceTypeGroup, c8 as readPlaceTypeGroups, c9 as readPlaceTypes, ca as readVocabularies, cb as readVocabularyConcept, cc as readVocabularyConcepts, cd as searchParentPlaces, ce as searchPlaces, cf as segmentAName } from './tree-changes-CFwJtBcK.js';
2
+ export { cg as DateStandardizationResponse, ch as ENVIRONMENT_CONFIGS, ci as FamilySearchPlace, cj as FamilySearchSDK, ck as FamilySearchUser, cl as MemoriesAPI, cm as MemoryArtifact, cn as MemoryComment, co as MemoryPersona, cp as MemoryPersonaResponse, cq as MemoryPersonasResponse, cr as MemoryWithCommentsResponse, cs as NameScriptResponse, ct as NameSegment, cu as NameSegmentsResponse, cv as PedigreeAPI, cw as PersonMemoriesResponse, cx as PlaceDescription, cy as PlaceDetailsResponse, cz as PlaceSearchResponse, cA as PlaceSearchResult, cB as StandardizedDate, cC as UserAPI, cD as UserMemoriesResponse, cE as VocabAPI, cF as VocabulariesResponse, cG as VocabularyConceptDetail, cH as VocabularyConceptResponse, cI as VocabularyConceptsResponse, cJ as VocabularyMetadata, cK as createFamilySearchSDK, cL as fetchMultiplePersons, cM as fetchPedigree, cN as getFamilySearchSDK, cO as initFamilySearchSDK, cP as readCurrentUser, cQ as resetFamilySearchSDK } from './tree-changes-CFwJtBcK.js';
3
3
  import { F as FamilySearchApiResponse } from './index-0PpnEPuZ.js';
4
4
  export { E as EnvironmentConfig, a as FamilySearchApiError, b as FamilySearchEnvironment, c as FamilySearchSDKConfig, O as OAUTH_ENDPOINTS, d as OAUTH_STORAGE_KEYS, e as OAuthAPI, f as OAuthConfig, g as OAuthEndpoints, h as OAuthStateValidation, i as OAuthTokenResponse, P as ProgressCallback, R as RateLimiterConfig, S as SDKLogger, j as buildAuthorizationUrl, k as clearAllTokens, l as clearStoredTokens, m as exchangeCodeForToken, n as generateOAuthState, o as getOAuthEndpoints, p as getStoredAccessToken, q as getStoredRefreshToken, r as getTokenStorageKey, s as getUserInfo, t as openOAuthPopup, u as parseCallbackParams, v as refreshAccessToken, w as storeOAuthState, x as storeTokens, y as validateAccessToken, z as validateOAuthState } from './index-0PpnEPuZ.js';
5
5
  export { A as AttachSourceInput, a as AttachSourceResponse, C as ChangeEntry, b as ChildAndParentsRelationship, c as CreateChildAndParentsRelationshipInput, d as CreateCoupleRelationshipInput, e as CreatePersonResponse, f as CreateRelationshipResponse, D as DeletePersonResponse, g as Discussion, h as DiscussionComment, E as EnhancedPedigreeData, i as EnhancedPerson, F as FamilySearchPerson, M as MatchesResponse, N as NameForm, j as Note, k as NoteInput, l as NoteResponse, P as PedigreeData, m as PedigreeResponse, n as PersonChangeHistoryResponse, o as PersonData, p as PersonDiscussionsResponse, q as PersonDisplay, r as PersonFact, s as PersonInput, t as PersonMatchInput, u as PersonMatchOptions, v as PersonMergeAnalysis, w as PersonMergeInput, x as PersonMergeResponse, y as PersonNotesResponse, z as PersonPortrait, B as PersonPortraitsResponse, G as PersonSearchResponse, H as PersonSearchResult, I as PersonSourcesResponse, J as PersonWithRelationships, R as Relationship, K as RelationshipDetails, S as SourceDescription, L as SourceDescriptionDetail, O as SourceDescriptionResponse, Q as SourceDescriptionsResponse, T as SourceReference, U as TreePersonMatchEntry, V as TreePersonMatchesOptions, W as TreePersonMatchesResponse, X as UpdatePersonResponse, Y as UpdateRelationshipResponse } from './tree-D7X-beAQ.js';
6
+ export { FamilySearchPlacePayload, extractGazetteerPlaceId, familySearchResearchPlaceUrl, numericPlaceIdFromRef, pickBestPlaceSearchResult } from './places/index.js';
6
7
  export { GedcomConversionOptions, convertFamilySearchToGedcom, convertToGedcom, transformFamilySearchUrl } from './utils/index.js';
7
- export { i as TreeAPI } from './index-CcZ9bR5K.js';
8
+ export { i as TreeAPI } from './index-CgIsZu6a.js';
8
9
 
9
10
  /**
10
11
  * FamilySearch Genealogies API