higherdata 0.2.0 → 0.2.2

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/README.md CHANGED
@@ -8,7 +8,7 @@ node packages/cli/dist/index.js --version
8
8
  node packages/cli/dist/index.js --help
9
9
  ```
10
10
 
11
- The package provides `higherdata` and `hd`. After the first approved npm release,
11
+ The package provides the `higherdata` command. After the first approved npm release,
12
12
  install with `npm install --global higherdata`, or run `npx higherdata --version`.
13
13
  Global flags are `--json`, `--jsonl` and `--api-url <url>`.
14
14
  `--help` and `--version` work without credentials or a config file.
@@ -39,7 +39,7 @@ Exit codes: 0 success, 2 usage or configuration, 3 authentication, 4 limit,
39
39
 
40
40
  ## Interactive app
41
41
 
42
- Run `higherdata` (or `hd`) in a terminal to open the keyboard app. The yellow
42
+ Run `higherdata` in a terminal to open the keyboard app. The yellow
43
43
  wordmark and three bars form in under 1.5 seconds; any key skips it.
44
44
  `--no-banner` opens the menu immediately. Piped output, `--json`, `--jsonl`
45
45
  and `CI` never animate. `NO_COLOR` disables accent colors. Supports 80 columns
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. LinkedIn and id matching include people without email. ",
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,11 +31914,10 @@ var init_package = __esm({
31823
31914
  "package.json"() {
31824
31915
  package_default = {
31825
31916
  name: "higherdata",
31826
- version: "0.2.0",
31917
+ version: "0.2.2",
31827
31918
  type: "module",
31828
31919
  bin: {
31829
- higherdata: "dist/index.js",
31830
- hd: "dist/index.js"
31920
+ higherdata: "dist/index.js"
31831
31921
  },
31832
31922
  files: [
31833
31923
  "dist",
@@ -33693,6 +33783,13 @@ var init_records = __esm({
33693
33783
  }
33694
33784
  });
33695
33785
 
33786
+ // ../../src/lib/lookup/phone.ts
33787
+ var init_phone = __esm({
33788
+ "../../src/lib/lookup/phone.ts"() {
33789
+ "use strict";
33790
+ }
33791
+ });
33792
+
33696
33793
  // ../../node_modules/tldts-core/dist/es6/src/domain.js
33697
33794
  var init_domain = __esm({
33698
33795
  "../../node_modules/tldts-core/dist/es6/src/domain.js"() {
@@ -34460,6 +34557,7 @@ var suppressionKeyTypeSchema;
34460
34557
  var init_normalize = __esm({
34461
34558
  "../../src/lib/suppression/normalize.ts"() {
34462
34559
  "use strict";
34560
+ init_phone();
34463
34561
  init_es62();
34464
34562
  init_zod();
34465
34563
  init_email();
@@ -37858,7 +37956,7 @@ function shownValue(value) {
37858
37956
  return clean(value);
37859
37957
  }
37860
37958
  function rowsOf(result) {
37861
- for (const name of ["items", "candidates", "searches", "lists", "groups", "orphans", "gaps", "records", "connections", "keys", "runs", "proposals"]) {
37959
+ for (const name of ["items", "candidates", "matches", "searches", "lists", "groups", "orphans", "gaps", "records", "connections", "keys", "runs", "proposals"]) {
37862
37960
  if (Array.isArray(result[name]) && result[name].length) return result[name].filter((row) => row && typeof row === "object");
37863
37961
  }
37864
37962
  return [];
@@ -38734,7 +38832,7 @@ var init_app = __esm({
38734
38832
  const result = await this.call(id.startsWith("hdo_") ? "lookup.company" : "lookup.person", { id });
38735
38833
  return { screen: "detail", row: rowsOf(result)[0] ?? result, selected: 0, tab: 0 };
38736
38834
  }
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;
38835
+ 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
38836
  if (next) {
38739
38837
  const result = await this.call(next.name, next.input);
38740
38838
  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 +39256,10 @@ function registerCommands(program2, runtime) {
39158
39256
  emit(await api.tool("search.count", await buildFilters(api, options, "companies")), mode);
39159
39257
  });
39160
39258
  const lookup = program2.command("lookup").description("Look up a company or person");
39259
+ program2.command("find <query...>").description("Find companies, people and lists by name, email, phone, website, LinkedIn or record id").action(async (query, _options, command) => {
39260
+ const { api, mode } = await session(command);
39261
+ emit(await api.tool("lookup.find", { query: query.join(" ") }), mode);
39262
+ });
39161
39263
  excludeList(lookup.command("company <domain>")).action(async (domain2, options, command) => {
39162
39264
  const { api, mode } = await session(command);
39163
39265
  emit(await api.tool("lookup.company", { domain: domain2, ...excluded(options) }), mode);
@@ -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
- if (!/^\+[0-9() .-]+$/.test(input2)) return invalid(keyType);
23490
- const phone = parsePhoneNumber4(input2);
23491
- if (!phone?.isValid()) return invalid(keyType);
23492
- return phone.number;
23498
+ const phone = normalizeLookupPhone(input2);
23499
+ if (!phone) return invalid(keyType);
23500
+ return phone;
23493
23501
  }
23494
23502
  }
23495
23503
  }
package/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "higherdata",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "bin": {
6
- "higherdata": "dist/index.js",
7
- "hd": "dist/index.js"
6
+ "higherdata": "dist/index.js"
8
7
  },
9
8
  "files": [
10
9
  "dist",