Repository navigation
Expand file tree
/
Copy pathpeople.ts
More file actions
443 lines (338 loc) · 9.14 KB
/
Copy pathpeople.ts
File metadata and controls
443 lines (338 loc) · 9.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../core/resource';
import { APIPromise } from '../core/api-promise';
import { RequestOptions } from '../internal/request-options';
export class People extends APIResource {
/**
* Find a person from identity clues and return their profile with a match score.
* Requires a paid plan; free or disposable email addresses return 422.
*
* @example
* ```ts
* const response = await client.people.enrich({
* company: {
* name: 'Analytical Engines',
* domain: 'analyticalengines.example',
* },
* name: { first: 'Ada', last: 'Lovelace' },
* social_urls: [
* 'https://www.linkedin.com/in/ada-lovelace/',
* ],
* });
* ```
*/
enrich(body: PersonEnrichParams, options?: RequestOptions): APIPromise<PersonEnrichResponse> {
return this._client.post('/people/enrich', { body, ...options });
}
}
export interface PersonEnrichResponse {
/**
* The highest-scoring person candidate.
*/
match:
| PersonEnrichResponse.PersonEnrichmentCandidateMatch
| PersonEnrichResponse.PersonEnrichmentNotFoundMatch;
/**
* Unique ID of this request, also in `X-Request-Id`. Include it when contacting
* support.
*/
request_id: string;
/**
* Credits this request used and your remaining balance.
*/
key_metadata?: PersonEnrichResponse.KeyMetadata;
/**
* True when the timeout ended processing and this response contains the usable
* data completed so far. Unfinished fields are omitted.
*/
partial?: boolean;
}
export namespace PersonEnrichResponse {
/**
* The highest-scoring person candidate.
*/
export interface PersonEnrichmentCandidateMatch {
person: PersonEnrichmentCandidateMatch.Person;
score: number;
status: 'candidate';
}
export namespace PersonEnrichmentCandidateMatch {
export interface Person {
/**
* Whether the person's current role is known. `present` — current_role is
* populated. `none` — the work history explicitly shows every role has ended.
* `unknown` — our data sources could not confirm either way; treat a missing
* current_role as unverified rather than vacant.
*/
current_role_status: 'present' | 'none' | 'unknown';
education: Array<Person.Education>;
experience: Array<Person.Experience>;
skills: Array<string>;
social_urls: Array<string>;
website_urls: Array<string>;
avatar_url?: string;
bio?: string;
/**
* When we last refreshed this profile from our data sources (ISO 8601).
*/
checked_at?: string;
current_role?: Person.CurrentRole;
email?: string;
/**
* When the underlying profile data last changed in our data sources (ISO 8601).
* Omitted when unknown.
*/
last_updated?: string;
location?: Person.Location;
name?: Person.Name;
}
export namespace Person {
export interface Education {
institution: Education.Institution;
degree?: string;
description?: string;
end_date?: Education.EndDate;
field_of_study?: string;
start_date?: Education.StartDate;
}
export namespace Education {
export interface Institution {
name: string;
domain?: string;
}
export interface EndDate {
year: number;
day?: number;
month?: number;
}
export interface StartDate {
year: number;
day?: number;
month?: number;
}
}
export interface Experience {
organization: Experience.Organization;
title: string;
description?: string;
end_date?: Experience.EndDate;
is_current?: boolean;
location?: string;
start_date?: Experience.StartDate;
}
export namespace Experience {
export interface Organization {
name: string;
domain?: string;
}
export interface EndDate {
year: number;
day?: number;
month?: number;
}
export interface StartDate {
year: number;
day?: number;
month?: number;
}
}
export interface CurrentRole {
organization: CurrentRole.Organization;
title: string;
description?: string;
end_date?: CurrentRole.EndDate;
is_current?: boolean;
location?: string;
start_date?: CurrentRole.StartDate;
}
export namespace CurrentRole {
export interface Organization {
name: string;
domain?: string;
}
export interface EndDate {
year: number;
day?: number;
month?: number;
}
export interface StartDate {
year: number;
day?: number;
month?: number;
}
}
export interface Location {
city?: string;
country?: string;
country_code?: string;
display?: string;
region?: string;
}
export interface Name {
first?: string;
full?: string;
last?: string;
}
}
}
/**
* No usable person candidate was found.
*/
export interface PersonEnrichmentNotFoundMatch {
person: null;
score: null;
status: 'not_found';
}
/**
* Credits this request used and your remaining balance.
*/
export interface KeyMetadata {
/**
* Credits charged for this request.
*/
credits_consumed: number;
/**
* Credits remaining for your organization.
*/
credits_remaining: number;
}
}
export interface PersonEnrichParams {
/**
* Company context to help identify the person. Provide a name or domain.
*/
company?: PersonEnrichParams.Company;
/**
* Education history to help distinguish people with similar names.
*/
education?: Array<PersonEnrichParams.Education>;
/**
* Email address of the person to find.
*/
email?: string;
/**
* Location context to help identify the person. Provide a city, region, or
* country.
*/
location?: PersonEnrichParams.Location;
/**
* Person name. Without an email or person-profile URL, provide both first and last
* name plus company, education, or location.
*/
name?: PersonEnrichParams.Name;
/**
* Public profile URLs for the person. A person-profile URL can identify the person
* without a name.
*/
social_urls?: Array<string>;
/**
* Labels for filtering usage in the dashboard.
*/
tags?: Array<string>;
/**
* Request deadline and what to return when it passes.
*/
timeoutOpts?: PersonEnrichParams.TimeoutOpts;
/**
* `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless
* your organization has ZDR.
*/
zdr?: 'enabled' | 'disabled';
}
export namespace PersonEnrichParams {
/**
* Company context to help identify the person. Provide a name or domain.
*/
export interface Company {
/**
* Website domain of a company associated with the person.
*/
domain?: string;
/**
* Name of a company associated with the person.
*/
name?: string;
}
export interface Education {
/**
* Degree or qualification earned.
*/
degree?: string;
/**
* Subject or major studied.
*/
field_of_study?: string;
/**
* Four-digit graduation year.
*/
graduation_year?: number;
/**
* School or university, identified by name or domain.
*/
institution?: Education.Institution;
}
export namespace Education {
/**
* School or university, identified by name or domain.
*/
export interface Institution {
/**
* Website domain of the school or university.
*/
domain?: string;
/**
* Name of the school or university.
*/
name?: string;
}
}
/**
* Location context to help identify the person. Provide a city, region, or
* country.
*/
export interface Location {
/**
* City associated with the person.
*/
city?: string;
/**
* Country associated with the person.
*/
country?: string;
/**
* State, province, or region associated with the person.
*/
region?: string;
}
/**
* Person name. Without an email or person-profile URL, provide both first and last
* name plus company, education, or location.
*/
export interface Name {
/**
* First or given name.
*/
first?: string;
/**
* Last or family name.
*/
last?: string;
}
/**
* Request deadline and what to return when it passes.
*/
export interface TimeoutOpts {
/**
* Deadline in milliseconds.
*/
milliseconds: number;
/**
* "fail" returns 408 at the deadline. "return-partial" returns available results;
* inspect the response’s partial flag.
*/
behavior?: 'fail' | 'return-partial';
}
}
export declare namespace People {
export { type PersonEnrichResponse as PersonEnrichResponse, type PersonEnrichParams as PersonEnrichParams };
}