@treeviz/familysearch-sdk 1.0.10
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/LICENSE +21 -0
- package/README.md +227 -0
- package/dist/auth/index.cjs +313 -0
- package/dist/auth/index.cjs.map +1 -0
- package/dist/auth/index.d.cts +124 -0
- package/dist/auth/index.d.ts +124 -0
- package/dist/auth/index.js +293 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/client-DIpYSHtx.d.ts +162 -0
- package/dist/client-ohjqX4t5.d.cts +162 -0
- package/dist/index-D6H-lvis.d.cts +484 -0
- package/dist/index-D6H-lvis.d.ts +484 -0
- package/dist/index.cjs +1689 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +1653 -0
- package/dist/index.js.map +1 -0
- package/dist/places/index.cjs +94 -0
- package/dist/places/index.cjs.map +1 -0
- package/dist/places/index.d.cts +69 -0
- package/dist/places/index.d.ts +69 -0
- package/dist/places/index.js +89 -0
- package/dist/places/index.js.map +1 -0
- package/dist/tree/index.cjs +191 -0
- package/dist/tree/index.cjs.map +1 -0
- package/dist/tree/index.d.cts +47 -0
- package/dist/tree/index.d.ts +47 -0
- package/dist/tree/index.js +186 -0
- package/dist/tree/index.js.map +1 -0
- package/dist/utils/index.cjs +663 -0
- package/dist/utils/index.cjs.map +1 -0
- package/dist/utils/index.d.cts +46 -0
- package/dist/utils/index.d.ts +46 -0
- package/dist/utils/index.js +660 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { a as FamilySearchSDKConfig, F as FamilySearchEnvironment, E as EnvironmentConfig, b as FamilySearchApiResponse, d as FamilySearchUser, e as FamilySearchPerson, i as PersonWithRelationships, j as PersonNotesResponse, w as PersonMemoriesResponse, h as RelationshipDetails, p as PedigreeData, x as PersonSearchResponse, k as FamilySearchPlace } from './index-D6H-lvis.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* FamilySearch SDK Client
|
|
5
|
+
*
|
|
6
|
+
* A modern, TypeScript-first SDK for FamilySearch API v3
|
|
7
|
+
*
|
|
8
|
+
* Features:
|
|
9
|
+
* - Full TypeScript support with comprehensive type definitions
|
|
10
|
+
* - OAuth v3 compatible
|
|
11
|
+
* - Promise-based API
|
|
12
|
+
* - Environment support (production, beta, integration)
|
|
13
|
+
* - Configurable logging
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
declare const ENVIRONMENT_CONFIGS: Record<FamilySearchEnvironment, EnvironmentConfig>;
|
|
17
|
+
/**
|
|
18
|
+
* FamilySearch SDK Client
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const sdk = new FamilySearchSDK({
|
|
23
|
+
* environment: 'production',
|
|
24
|
+
* accessToken: 'your-oauth-token'
|
|
25
|
+
* });
|
|
26
|
+
*
|
|
27
|
+
* const user = await sdk.getCurrentUser();
|
|
28
|
+
* console.log(user?.displayName);
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
declare class FamilySearchSDK {
|
|
32
|
+
private environment;
|
|
33
|
+
private accessToken;
|
|
34
|
+
private appKey;
|
|
35
|
+
private logger;
|
|
36
|
+
constructor(config?: FamilySearchSDKConfig);
|
|
37
|
+
/**
|
|
38
|
+
* Get the current environment
|
|
39
|
+
*/
|
|
40
|
+
getEnvironment(): FamilySearchEnvironment;
|
|
41
|
+
/**
|
|
42
|
+
* Set OAuth access token
|
|
43
|
+
*/
|
|
44
|
+
setAccessToken(token: string): void;
|
|
45
|
+
/**
|
|
46
|
+
* Get current access token
|
|
47
|
+
*/
|
|
48
|
+
getAccessToken(): string | null;
|
|
49
|
+
/**
|
|
50
|
+
* Clear access token
|
|
51
|
+
*/
|
|
52
|
+
clearAccessToken(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Check if SDK has a valid access token
|
|
55
|
+
*/
|
|
56
|
+
hasAccessToken(): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Get environment configuration
|
|
59
|
+
*/
|
|
60
|
+
getConfig(): EnvironmentConfig;
|
|
61
|
+
/**
|
|
62
|
+
* Make authenticated API request
|
|
63
|
+
*/
|
|
64
|
+
private request;
|
|
65
|
+
/**
|
|
66
|
+
* GET request
|
|
67
|
+
*/
|
|
68
|
+
get<T>(url: string, options?: RequestInit): Promise<FamilySearchApiResponse<T>>;
|
|
69
|
+
/**
|
|
70
|
+
* POST request
|
|
71
|
+
*/
|
|
72
|
+
post<T>(url: string, body?: unknown, options?: RequestInit): Promise<FamilySearchApiResponse<T>>;
|
|
73
|
+
/**
|
|
74
|
+
* PUT request
|
|
75
|
+
*/
|
|
76
|
+
put<T>(url: string, body?: unknown, options?: RequestInit): Promise<FamilySearchApiResponse<T>>;
|
|
77
|
+
/**
|
|
78
|
+
* DELETE request
|
|
79
|
+
*/
|
|
80
|
+
delete<T>(url: string, options?: RequestInit): Promise<FamilySearchApiResponse<T>>;
|
|
81
|
+
/**
|
|
82
|
+
* Get current authenticated user
|
|
83
|
+
*/
|
|
84
|
+
getCurrentUser(): Promise<FamilySearchUser | null>;
|
|
85
|
+
/**
|
|
86
|
+
* Get person by ID
|
|
87
|
+
*/
|
|
88
|
+
getPerson(personId: string): Promise<FamilySearchPerson | null>;
|
|
89
|
+
/**
|
|
90
|
+
* Get person with full details including sources
|
|
91
|
+
*/
|
|
92
|
+
getPersonWithDetails(personId: string): Promise<PersonWithRelationships | null>;
|
|
93
|
+
/**
|
|
94
|
+
* Get notes for a person
|
|
95
|
+
*/
|
|
96
|
+
getPersonNotes(personId: string): Promise<PersonNotesResponse | null>;
|
|
97
|
+
/**
|
|
98
|
+
* Get memories for a person
|
|
99
|
+
*/
|
|
100
|
+
getPersonMemories(personId: string): Promise<PersonMemoriesResponse | null>;
|
|
101
|
+
/**
|
|
102
|
+
* Get couple relationship details
|
|
103
|
+
*/
|
|
104
|
+
getCoupleRelationship(relationshipId: string): Promise<RelationshipDetails | null>;
|
|
105
|
+
/**
|
|
106
|
+
* Get child-and-parents relationship details
|
|
107
|
+
*/
|
|
108
|
+
getChildAndParentsRelationship(relationshipId: string): Promise<RelationshipDetails | null>;
|
|
109
|
+
/**
|
|
110
|
+
* Get ancestry for a person
|
|
111
|
+
*/
|
|
112
|
+
getAncestry(personId: string, generations?: number): Promise<FamilySearchApiResponse<PedigreeData>>;
|
|
113
|
+
/**
|
|
114
|
+
* Get descendancy for a person
|
|
115
|
+
*/
|
|
116
|
+
getDescendancy(personId: string, generations?: number): Promise<FamilySearchApiResponse<PedigreeData>>;
|
|
117
|
+
/**
|
|
118
|
+
* Search for persons
|
|
119
|
+
*/
|
|
120
|
+
searchPersons(query: Record<string, string>, options?: {
|
|
121
|
+
start?: number;
|
|
122
|
+
count?: number;
|
|
123
|
+
}): Promise<FamilySearchApiResponse<PersonSearchResponse>>;
|
|
124
|
+
/**
|
|
125
|
+
* Search for places
|
|
126
|
+
*/
|
|
127
|
+
searchPlaces(name: string, options?: {
|
|
128
|
+
parentId?: string;
|
|
129
|
+
typeId?: string;
|
|
130
|
+
date?: string;
|
|
131
|
+
start?: number;
|
|
132
|
+
count?: number;
|
|
133
|
+
}): Promise<{
|
|
134
|
+
places: FamilySearchPlace[];
|
|
135
|
+
} | null>;
|
|
136
|
+
/**
|
|
137
|
+
* Get place by ID
|
|
138
|
+
*/
|
|
139
|
+
getPlace(placeId: string): Promise<FamilySearchPlace | null>;
|
|
140
|
+
/**
|
|
141
|
+
* Get GEDCOM export for a person and their ancestors
|
|
142
|
+
*/
|
|
143
|
+
exportGEDCOM(personId: string): Promise<string | null>;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Initialize the global SDK instance
|
|
147
|
+
*/
|
|
148
|
+
declare function initFamilySearchSDK(config?: FamilySearchSDKConfig): FamilySearchSDK;
|
|
149
|
+
/**
|
|
150
|
+
* Get the global SDK instance
|
|
151
|
+
*/
|
|
152
|
+
declare function getFamilySearchSDK(): FamilySearchSDK;
|
|
153
|
+
/**
|
|
154
|
+
* Create a new SDK instance (for testing or multiple environments)
|
|
155
|
+
*/
|
|
156
|
+
declare function createFamilySearchSDK(config?: FamilySearchSDKConfig): FamilySearchSDK;
|
|
157
|
+
/**
|
|
158
|
+
* Reset the global SDK instance (mainly for testing)
|
|
159
|
+
*/
|
|
160
|
+
declare function resetFamilySearchSDK(): void;
|
|
161
|
+
|
|
162
|
+
export { ENVIRONMENT_CONFIGS as E, FamilySearchSDK as F, createFamilySearchSDK as c, getFamilySearchSDK as g, initFamilySearchSDK as i, resetFamilySearchSDK as r };
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { a as FamilySearchSDKConfig, F as FamilySearchEnvironment, E as EnvironmentConfig, b as FamilySearchApiResponse, d as FamilySearchUser, e as FamilySearchPerson, i as PersonWithRelationships, j as PersonNotesResponse, w as PersonMemoriesResponse, h as RelationshipDetails, p as PedigreeData, x as PersonSearchResponse, k as FamilySearchPlace } from './index-D6H-lvis.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* FamilySearch SDK Client
|
|
5
|
+
*
|
|
6
|
+
* A modern, TypeScript-first SDK for FamilySearch API v3
|
|
7
|
+
*
|
|
8
|
+
* Features:
|
|
9
|
+
* - Full TypeScript support with comprehensive type definitions
|
|
10
|
+
* - OAuth v3 compatible
|
|
11
|
+
* - Promise-based API
|
|
12
|
+
* - Environment support (production, beta, integration)
|
|
13
|
+
* - Configurable logging
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
declare const ENVIRONMENT_CONFIGS: Record<FamilySearchEnvironment, EnvironmentConfig>;
|
|
17
|
+
/**
|
|
18
|
+
* FamilySearch SDK Client
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const sdk = new FamilySearchSDK({
|
|
23
|
+
* environment: 'production',
|
|
24
|
+
* accessToken: 'your-oauth-token'
|
|
25
|
+
* });
|
|
26
|
+
*
|
|
27
|
+
* const user = await sdk.getCurrentUser();
|
|
28
|
+
* console.log(user?.displayName);
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
declare class FamilySearchSDK {
|
|
32
|
+
private environment;
|
|
33
|
+
private accessToken;
|
|
34
|
+
private appKey;
|
|
35
|
+
private logger;
|
|
36
|
+
constructor(config?: FamilySearchSDKConfig);
|
|
37
|
+
/**
|
|
38
|
+
* Get the current environment
|
|
39
|
+
*/
|
|
40
|
+
getEnvironment(): FamilySearchEnvironment;
|
|
41
|
+
/**
|
|
42
|
+
* Set OAuth access token
|
|
43
|
+
*/
|
|
44
|
+
setAccessToken(token: string): void;
|
|
45
|
+
/**
|
|
46
|
+
* Get current access token
|
|
47
|
+
*/
|
|
48
|
+
getAccessToken(): string | null;
|
|
49
|
+
/**
|
|
50
|
+
* Clear access token
|
|
51
|
+
*/
|
|
52
|
+
clearAccessToken(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Check if SDK has a valid access token
|
|
55
|
+
*/
|
|
56
|
+
hasAccessToken(): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Get environment configuration
|
|
59
|
+
*/
|
|
60
|
+
getConfig(): EnvironmentConfig;
|
|
61
|
+
/**
|
|
62
|
+
* Make authenticated API request
|
|
63
|
+
*/
|
|
64
|
+
private request;
|
|
65
|
+
/**
|
|
66
|
+
* GET request
|
|
67
|
+
*/
|
|
68
|
+
get<T>(url: string, options?: RequestInit): Promise<FamilySearchApiResponse<T>>;
|
|
69
|
+
/**
|
|
70
|
+
* POST request
|
|
71
|
+
*/
|
|
72
|
+
post<T>(url: string, body?: unknown, options?: RequestInit): Promise<FamilySearchApiResponse<T>>;
|
|
73
|
+
/**
|
|
74
|
+
* PUT request
|
|
75
|
+
*/
|
|
76
|
+
put<T>(url: string, body?: unknown, options?: RequestInit): Promise<FamilySearchApiResponse<T>>;
|
|
77
|
+
/**
|
|
78
|
+
* DELETE request
|
|
79
|
+
*/
|
|
80
|
+
delete<T>(url: string, options?: RequestInit): Promise<FamilySearchApiResponse<T>>;
|
|
81
|
+
/**
|
|
82
|
+
* Get current authenticated user
|
|
83
|
+
*/
|
|
84
|
+
getCurrentUser(): Promise<FamilySearchUser | null>;
|
|
85
|
+
/**
|
|
86
|
+
* Get person by ID
|
|
87
|
+
*/
|
|
88
|
+
getPerson(personId: string): Promise<FamilySearchPerson | null>;
|
|
89
|
+
/**
|
|
90
|
+
* Get person with full details including sources
|
|
91
|
+
*/
|
|
92
|
+
getPersonWithDetails(personId: string): Promise<PersonWithRelationships | null>;
|
|
93
|
+
/**
|
|
94
|
+
* Get notes for a person
|
|
95
|
+
*/
|
|
96
|
+
getPersonNotes(personId: string): Promise<PersonNotesResponse | null>;
|
|
97
|
+
/**
|
|
98
|
+
* Get memories for a person
|
|
99
|
+
*/
|
|
100
|
+
getPersonMemories(personId: string): Promise<PersonMemoriesResponse | null>;
|
|
101
|
+
/**
|
|
102
|
+
* Get couple relationship details
|
|
103
|
+
*/
|
|
104
|
+
getCoupleRelationship(relationshipId: string): Promise<RelationshipDetails | null>;
|
|
105
|
+
/**
|
|
106
|
+
* Get child-and-parents relationship details
|
|
107
|
+
*/
|
|
108
|
+
getChildAndParentsRelationship(relationshipId: string): Promise<RelationshipDetails | null>;
|
|
109
|
+
/**
|
|
110
|
+
* Get ancestry for a person
|
|
111
|
+
*/
|
|
112
|
+
getAncestry(personId: string, generations?: number): Promise<FamilySearchApiResponse<PedigreeData>>;
|
|
113
|
+
/**
|
|
114
|
+
* Get descendancy for a person
|
|
115
|
+
*/
|
|
116
|
+
getDescendancy(personId: string, generations?: number): Promise<FamilySearchApiResponse<PedigreeData>>;
|
|
117
|
+
/**
|
|
118
|
+
* Search for persons
|
|
119
|
+
*/
|
|
120
|
+
searchPersons(query: Record<string, string>, options?: {
|
|
121
|
+
start?: number;
|
|
122
|
+
count?: number;
|
|
123
|
+
}): Promise<FamilySearchApiResponse<PersonSearchResponse>>;
|
|
124
|
+
/**
|
|
125
|
+
* Search for places
|
|
126
|
+
*/
|
|
127
|
+
searchPlaces(name: string, options?: {
|
|
128
|
+
parentId?: string;
|
|
129
|
+
typeId?: string;
|
|
130
|
+
date?: string;
|
|
131
|
+
start?: number;
|
|
132
|
+
count?: number;
|
|
133
|
+
}): Promise<{
|
|
134
|
+
places: FamilySearchPlace[];
|
|
135
|
+
} | null>;
|
|
136
|
+
/**
|
|
137
|
+
* Get place by ID
|
|
138
|
+
*/
|
|
139
|
+
getPlace(placeId: string): Promise<FamilySearchPlace | null>;
|
|
140
|
+
/**
|
|
141
|
+
* Get GEDCOM export for a person and their ancestors
|
|
142
|
+
*/
|
|
143
|
+
exportGEDCOM(personId: string): Promise<string | null>;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Initialize the global SDK instance
|
|
147
|
+
*/
|
|
148
|
+
declare function initFamilySearchSDK(config?: FamilySearchSDKConfig): FamilySearchSDK;
|
|
149
|
+
/**
|
|
150
|
+
* Get the global SDK instance
|
|
151
|
+
*/
|
|
152
|
+
declare function getFamilySearchSDK(): FamilySearchSDK;
|
|
153
|
+
/**
|
|
154
|
+
* Create a new SDK instance (for testing or multiple environments)
|
|
155
|
+
*/
|
|
156
|
+
declare function createFamilySearchSDK(config?: FamilySearchSDKConfig): FamilySearchSDK;
|
|
157
|
+
/**
|
|
158
|
+
* Reset the global SDK instance (mainly for testing)
|
|
159
|
+
*/
|
|
160
|
+
declare function resetFamilySearchSDK(): void;
|
|
161
|
+
|
|
162
|
+
export { ENVIRONMENT_CONFIGS as E, FamilySearchSDK as F, createFamilySearchSDK as c, getFamilySearchSDK as g, initFamilySearchSDK as i, resetFamilySearchSDK as r };
|