higherdata 0.2.0 → 0.2.1
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/index.js +107 -4
- package/dist/suppression.js +12 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -25483,9 +25483,33 @@ var init_generated = __esm({
|
|
|
25483
25483
|
]
|
|
25484
25484
|
}
|
|
25485
25485
|
},
|
|
25486
|
+
{
|
|
25487
|
+
"name": "lookup.find",
|
|
25488
|
+
"description": "Direct lookup by email, international phone, website, LinkedIn profile, opaque record id or name. Names match companies, people and this space's own lists. Optional person-name company hints use 'at Company' or a trailing domain. Returns at most 20 suppressed-safe matches. Execute only after the user submits a lookup.",
|
|
25489
|
+
"risk": "read",
|
|
25490
|
+
"scopes": [
|
|
25491
|
+
"data:read"
|
|
25492
|
+
],
|
|
25493
|
+
"input": {
|
|
25494
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
25495
|
+
"type": "object",
|
|
25496
|
+
"properties": {
|
|
25497
|
+
"query": {
|
|
25498
|
+
"type": "string",
|
|
25499
|
+
"minLength": 1,
|
|
25500
|
+
"maxLength": 2048,
|
|
25501
|
+
"description": "Name, work email, international phone, website, LinkedIn profile or opaque record id to find."
|
|
25502
|
+
}
|
|
25503
|
+
},
|
|
25504
|
+
"required": [
|
|
25505
|
+
"query"
|
|
25506
|
+
],
|
|
25507
|
+
"additionalProperties": false
|
|
25508
|
+
}
|
|
25509
|
+
},
|
|
25486
25510
|
{
|
|
25487
25511
|
"name": "lookup.person",
|
|
25488
|
-
"description": "Look up a person by exactly one work email, LinkedIn profile URL or opaque hdp_ id.
|
|
25512
|
+
"description": "Look up a person by exactly one work email, international phone, exact or prefix name, LinkedIn profile URL or opaque hdp_ id. Names may be narrowed by company name or domain. Matching includes people without email or a current company. ",
|
|
25489
25513
|
"risk": "read",
|
|
25490
25514
|
"scopes": [
|
|
25491
25515
|
"data:read"
|
|
@@ -25522,6 +25546,73 @@ var init_generated = __esm({
|
|
|
25522
25546
|
],
|
|
25523
25547
|
"additionalProperties": false
|
|
25524
25548
|
},
|
|
25549
|
+
{
|
|
25550
|
+
"type": "object",
|
|
25551
|
+
"properties": {
|
|
25552
|
+
"phone": {
|
|
25553
|
+
"type": "string",
|
|
25554
|
+
"maxLength": 512,
|
|
25555
|
+
"description": "International phone number including its country code."
|
|
25556
|
+
},
|
|
25557
|
+
"candidateLimit": {
|
|
25558
|
+
"default": 5,
|
|
25559
|
+
"description": "Maximum candidates to return.",
|
|
25560
|
+
"type": "integer",
|
|
25561
|
+
"minimum": 1,
|
|
25562
|
+
"maximum": 5
|
|
25563
|
+
},
|
|
25564
|
+
"excludeListId": {
|
|
25565
|
+
"description": "Saved list whose members are left out of the result.",
|
|
25566
|
+
"type": "string",
|
|
25567
|
+
"format": "uuid",
|
|
25568
|
+
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
|
|
25569
|
+
}
|
|
25570
|
+
},
|
|
25571
|
+
"required": [
|
|
25572
|
+
"phone"
|
|
25573
|
+
],
|
|
25574
|
+
"additionalProperties": false
|
|
25575
|
+
},
|
|
25576
|
+
{
|
|
25577
|
+
"type": "object",
|
|
25578
|
+
"properties": {
|
|
25579
|
+
"name": {
|
|
25580
|
+
"type": "string",
|
|
25581
|
+
"minLength": 1,
|
|
25582
|
+
"maxLength": 240,
|
|
25583
|
+
"description": "Exact or prefix person name."
|
|
25584
|
+
},
|
|
25585
|
+
"companyName": {
|
|
25586
|
+
"description": "Company name to narrow the person name match.",
|
|
25587
|
+
"type": "string",
|
|
25588
|
+
"minLength": 1,
|
|
25589
|
+
"maxLength": 240
|
|
25590
|
+
},
|
|
25591
|
+
"companyDomain": {
|
|
25592
|
+
"description": "Company domain to narrow the person name match.",
|
|
25593
|
+
"type": "string",
|
|
25594
|
+
"minLength": 1,
|
|
25595
|
+
"maxLength": 320
|
|
25596
|
+
},
|
|
25597
|
+
"candidateLimit": {
|
|
25598
|
+
"default": 20,
|
|
25599
|
+
"description": "Maximum name candidates, ranked by exact match then priority.",
|
|
25600
|
+
"type": "integer",
|
|
25601
|
+
"minimum": 1,
|
|
25602
|
+
"maximum": 20
|
|
25603
|
+
},
|
|
25604
|
+
"excludeListId": {
|
|
25605
|
+
"description": "Saved list whose members are left out of the result.",
|
|
25606
|
+
"type": "string",
|
|
25607
|
+
"format": "uuid",
|
|
25608
|
+
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
|
|
25609
|
+
}
|
|
25610
|
+
},
|
|
25611
|
+
"required": [
|
|
25612
|
+
"name"
|
|
25613
|
+
],
|
|
25614
|
+
"additionalProperties": false
|
|
25615
|
+
},
|
|
25525
25616
|
{
|
|
25526
25617
|
"type": "object",
|
|
25527
25618
|
"properties": {
|
|
@@ -31823,7 +31914,7 @@ var init_package = __esm({
|
|
|
31823
31914
|
"package.json"() {
|
|
31824
31915
|
package_default = {
|
|
31825
31916
|
name: "higherdata",
|
|
31826
|
-
version: "0.2.
|
|
31917
|
+
version: "0.2.1",
|
|
31827
31918
|
type: "module",
|
|
31828
31919
|
bin: {
|
|
31829
31920
|
higherdata: "dist/index.js",
|
|
@@ -33693,6 +33784,13 @@ var init_records = __esm({
|
|
|
33693
33784
|
}
|
|
33694
33785
|
});
|
|
33695
33786
|
|
|
33787
|
+
// ../../src/lib/lookup/phone.ts
|
|
33788
|
+
var init_phone = __esm({
|
|
33789
|
+
"../../src/lib/lookup/phone.ts"() {
|
|
33790
|
+
"use strict";
|
|
33791
|
+
}
|
|
33792
|
+
});
|
|
33793
|
+
|
|
33696
33794
|
// ../../node_modules/tldts-core/dist/es6/src/domain.js
|
|
33697
33795
|
var init_domain = __esm({
|
|
33698
33796
|
"../../node_modules/tldts-core/dist/es6/src/domain.js"() {
|
|
@@ -34460,6 +34558,7 @@ var suppressionKeyTypeSchema;
|
|
|
34460
34558
|
var init_normalize = __esm({
|
|
34461
34559
|
"../../src/lib/suppression/normalize.ts"() {
|
|
34462
34560
|
"use strict";
|
|
34561
|
+
init_phone();
|
|
34463
34562
|
init_es62();
|
|
34464
34563
|
init_zod();
|
|
34465
34564
|
init_email();
|
|
@@ -37858,7 +37957,7 @@ function shownValue(value) {
|
|
|
37858
37957
|
return clean(value);
|
|
37859
37958
|
}
|
|
37860
37959
|
function rowsOf(result) {
|
|
37861
|
-
for (const name of ["items", "candidates", "searches", "lists", "groups", "orphans", "gaps", "records", "connections", "keys", "runs", "proposals"]) {
|
|
37960
|
+
for (const name of ["items", "candidates", "matches", "searches", "lists", "groups", "orphans", "gaps", "records", "connections", "keys", "runs", "proposals"]) {
|
|
37862
37961
|
if (Array.isArray(result[name]) && result[name].length) return result[name].filter((row) => row && typeof row === "object");
|
|
37863
37962
|
}
|
|
37864
37963
|
return [];
|
|
@@ -38734,7 +38833,7 @@ var init_app = __esm({
|
|
|
38734
38833
|
const result = await this.call(id.startsWith("hdo_") ? "lookup.company" : "lookup.person", { id });
|
|
38735
38834
|
return { screen: "detail", row: rowsOf(result)[0] ?? result, selected: 0, tab: 0 };
|
|
38736
38835
|
}
|
|
38737
|
-
const next = state.tool?.name === "lists.get" && !state.input.id ? { name: "lists.get", input: { id: row.id } } : state.tool?.name === "jobs.list" ? { name: "jobs.get", input: { jobId: row.id } } : state.tool?.name === "changes.list" ? { name: "changes.get", input: { id: row.id } } : state.tool?.name === "crm.search" ? { name: "crm.get", input: { objectType: row.objectType ?? state.input.objectType, id: row.externalId ?? row.id } } : null;
|
|
38836
|
+
const next = state.tool?.name === "lists.get" && !state.input.id || state.tool?.name === "lookup.find" && row.kind === "list" ? { name: "lists.get", input: { id: row.id } } : state.tool?.name === "jobs.list" ? { name: "jobs.get", input: { jobId: row.id } } : state.tool?.name === "changes.list" ? { name: "changes.get", input: { id: row.id } } : state.tool?.name === "crm.search" ? { name: "crm.get", input: { objectType: row.objectType ?? state.input.objectType, id: row.externalId ?? row.id } } : null;
|
|
38738
38837
|
if (next) {
|
|
38739
38838
|
const result = await this.call(next.name, next.input);
|
|
38740
38839
|
return { screen: ["changes.get", "crm.get"].includes(next.name) ? "detail" : "results", tool: toolByName(next.name), input: next.input, result, row: result, selected: 0, tab: 0 };
|
|
@@ -39158,6 +39257,10 @@ function registerCommands(program2, runtime) {
|
|
|
39158
39257
|
emit(await api.tool("search.count", await buildFilters(api, options, "companies")), mode);
|
|
39159
39258
|
});
|
|
39160
39259
|
const lookup = program2.command("lookup").description("Look up a company or person");
|
|
39260
|
+
program2.command("find <query...>").description("Find companies, people and lists by name, email, phone, website, LinkedIn or record id").action(async (query, _options, command) => {
|
|
39261
|
+
const { api, mode } = await session(command);
|
|
39262
|
+
emit(await api.tool("lookup.find", { query: query.join(" ") }), mode);
|
|
39263
|
+
});
|
|
39161
39264
|
excludeList(lookup.command("company <domain>")).action(async (domain2, options, command) => {
|
|
39162
39265
|
const { api, mode } = await session(command);
|
|
39163
39266
|
emit(await api.tool("lookup.company", { domain: domain2, ...excluded(options) }), mode);
|
package/dist/suppression.js
CHANGED
|
@@ -2938,6 +2938,15 @@ function parsePhoneNumber4() {
|
|
|
2938
2938
|
return withMetadataArgument(parsePhoneNumber3, arguments);
|
|
2939
2939
|
}
|
|
2940
2940
|
|
|
2941
|
+
// ../../src/lib/lookup/phone.ts
|
|
2942
|
+
function normalizeLookupPhone(value) {
|
|
2943
|
+
if (typeof value !== "string") return null;
|
|
2944
|
+
const input2 = value.trim();
|
|
2945
|
+
if (!input2 || input2.length > 512 || !/^\+[0-9() .-]+$/.test(input2)) return null;
|
|
2946
|
+
const phone = parsePhoneNumber4(input2);
|
|
2947
|
+
return phone?.isValid() ? phone.number : null;
|
|
2948
|
+
}
|
|
2949
|
+
|
|
2941
2950
|
// ../../node_modules/tldts-core/dist/es6/src/domain.js
|
|
2942
2951
|
function shareSameDomainSuffix(hostname4, vhost) {
|
|
2943
2952
|
if (hostname4.endsWith(vhost)) {
|
|
@@ -23486,10 +23495,9 @@ function normalizeSuppressionKey(keyType, value) {
|
|
|
23486
23495
|
return `https://www.linkedin.com/in/${path[1].toLowerCase()}`;
|
|
23487
23496
|
}
|
|
23488
23497
|
case "phone_e164": {
|
|
23489
|
-
|
|
23490
|
-
|
|
23491
|
-
|
|
23492
|
-
return phone.number;
|
|
23498
|
+
const phone = normalizeLookupPhone(input2);
|
|
23499
|
+
if (!phone) return invalid(keyType);
|
|
23500
|
+
return phone;
|
|
23493
23501
|
}
|
|
23494
23502
|
}
|
|
23495
23503
|
}
|