@twentyhq/people-data-labs 1.0.0 → 1.0.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.
Files changed (354) hide show
  1. package/manifest.json +11504 -0
  2. package/package.json +1 -1
  3. package/src/front-components/enrich-companies-component-effect.mjs +73 -0
  4. package/src/front-components/enrich-companies-component-effect.mjs.map +7 -0
  5. package/src/front-components/enrich-people-component-effect.mjs +73 -0
  6. package/src/front-components/enrich-people-component-effect.mjs.map +7 -0
  7. package/src/logic-functions/enrich-companies.function.mjs +6134 -0
  8. package/src/logic-functions/enrich-companies.function.mjs.map +7 -0
  9. package/src/logic-functions/enrich-company.function.mjs +6219 -0
  10. package/src/logic-functions/enrich-company.function.mjs.map +7 -0
  11. package/src/logic-functions/enrich-people.function.mjs +6836 -0
  12. package/src/logic-functions/enrich-people.function.mjs.map +7 -0
  13. package/src/logic-functions/enrich-person.function.mjs +6922 -0
  14. package/src/logic-functions/enrich-person.function.mjs.map +7 -0
  15. package/src/logic-functions/post-install.function.mjs +48 -0
  16. package/src/logic-functions/post-install.function.mjs.map +7 -0
  17. package/.claude/settings.local.json +0 -7
  18. package/.nvmrc +0 -1
  19. package/.oxlintrc.json +0 -58
  20. package/.yarnrc.yml +0 -1
  21. package/README.md +0 -16
  22. package/src/__tests__/global-setup.ts +0 -87
  23. package/src/__tests__/people-data-labs.integration-test.ts +0 -25
  24. package/src/application-config.ts +0 -18
  25. package/src/command-menu-items/enrich-companies.ts +0 -14
  26. package/src/command-menu-items/enrich-people.ts +0 -14
  27. package/src/constants/__tests__/select-option-constants.spec.ts +0 -142
  28. package/src/constants/billing-margin-multiplier.ts +0 -1
  29. package/src/constants/company-match-cost-dollars.ts +0 -1
  30. package/src/constants/company-type-options.ts +0 -46
  31. package/src/constants/enrichment-status-options.ts +0 -19
  32. package/src/constants/enrichment-workflow-seeds.ts +0 -27
  33. package/src/constants/funding-stage-options.ts +0 -195
  34. package/src/constants/industry-options.ts +0 -1033
  35. package/src/constants/inferred-salary-options.ts +0 -81
  36. package/src/constants/job-role-options.ts +0 -172
  37. package/src/constants/job-title-class-options.ts +0 -39
  38. package/src/constants/job-title-sub-role-options.ts +0 -746
  39. package/src/constants/location-continent-options.ts +0 -53
  40. package/src/constants/metro-options.ts +0 -2692
  41. package/src/constants/mic-exchange-options.ts +0 -494
  42. package/src/constants/micro-credits-per-dollar.ts +0 -1
  43. package/src/constants/pdl-base-url.ts +0 -1
  44. package/src/constants/person-match-cost-dollars.ts +0 -1
  45. package/src/constants/seniority-options.ts +0 -74
  46. package/src/constants/sex-options.ts +0 -18
  47. package/src/constants/size-options.ts +0 -60
  48. package/src/constants/universal-identifiers.ts +0 -1516
  49. package/src/constants/update-fields-option-values.ts +0 -5
  50. package/src/constants/update-fields-options.ts +0 -7
  51. package/src/fields/company/pdl-affiliated-profiles.field.ts +0 -20
  52. package/src/fields/company/pdl-alternative-domains.field.ts +0 -20
  53. package/src/fields/company/pdl-alternative-names.field.ts +0 -20
  54. package/src/fields/company/pdl-company-type.field.ts +0 -28
  55. package/src/fields/company/pdl-employee-count-by-country.field.ts +0 -21
  56. package/src/fields/company/pdl-employee-count.field.ts +0 -19
  57. package/src/fields/company/pdl-enrichment-status.field.ts +0 -29
  58. package/src/fields/company/pdl-facebook-url.field.ts +0 -19
  59. package/src/fields/company/pdl-founded-year.field.ts +0 -19
  60. package/src/fields/company/pdl-funding-stages.field.ts +0 -28
  61. package/src/fields/company/pdl-headline.field.ts +0 -19
  62. package/src/fields/company/pdl-id.field.ts +0 -19
  63. package/src/fields/company/pdl-industry-detail.field.ts +0 -20
  64. package/src/fields/company/pdl-industry.field.ts +0 -28
  65. package/src/fields/company/pdl-last-enriched-at.field.ts +0 -20
  66. package/src/fields/company/pdl-last-funding-date.field.ts +0 -20
  67. package/src/fields/company/pdl-latest-funding-stage.field.ts +0 -29
  68. package/src/fields/company/pdl-legal-name.field.ts +0 -19
  69. package/src/fields/company/pdl-linkedin-id.field.ts +0 -19
  70. package/src/fields/company/pdl-location-continent.field.ts +0 -29
  71. package/src/fields/company/pdl-location-metro.field.ts +0 -28
  72. package/src/fields/company/pdl-mic-exchange.field.ts +0 -28
  73. package/src/fields/company/pdl-naics.field.ts +0 -19
  74. package/src/fields/company/pdl-number-funding-rounds.field.ts +0 -20
  75. package/src/fields/company/pdl-raw-payload.field.ts +0 -19
  76. package/src/fields/company/pdl-sic.field.ts +0 -19
  77. package/src/fields/company/pdl-size-range.field.ts +0 -28
  78. package/src/fields/company/pdl-summary.field.ts +0 -19
  79. package/src/fields/company/pdl-tags.field.ts +0 -19
  80. package/src/fields/company/pdl-ticker.field.ts +0 -19
  81. package/src/fields/company/pdl-total-funding.field.ts +0 -19
  82. package/src/fields/company/pdl-twitter-url.field.ts +0 -19
  83. package/src/fields/person/pdl-birth-date.field.ts +0 -19
  84. package/src/fields/person/pdl-birth-year.field.ts +0 -19
  85. package/src/fields/person/pdl-certifications.field.ts +0 -19
  86. package/src/fields/person/pdl-education.field.ts +0 -19
  87. package/src/fields/person/pdl-enrichment-status.field.ts +0 -29
  88. package/src/fields/person/pdl-experience.field.ts +0 -19
  89. package/src/fields/person/pdl-facebook-url.field.ts +0 -19
  90. package/src/fields/person/pdl-github-url.field.ts +0 -19
  91. package/src/fields/person/pdl-headline.field.ts +0 -19
  92. package/src/fields/person/pdl-id.field.ts +0 -19
  93. package/src/fields/person/pdl-industry.field.ts +0 -28
  94. package/src/fields/person/pdl-inferred-salary.field.ts +0 -28
  95. package/src/fields/person/pdl-interests.field.ts +0 -19
  96. package/src/fields/person/pdl-job-onet-code.field.ts +0 -19
  97. package/src/fields/person/pdl-job-role.field.ts +0 -28
  98. package/src/fields/person/pdl-job-start-date.field.ts +0 -19
  99. package/src/fields/person/pdl-job-summary.field.ts +0 -19
  100. package/src/fields/person/pdl-job-title-class.field.ts +0 -28
  101. package/src/fields/person/pdl-job-title-sub-role.field.ts +0 -29
  102. package/src/fields/person/pdl-languages.field.ts +0 -19
  103. package/src/fields/person/pdl-last-enriched-at.field.ts +0 -19
  104. package/src/fields/person/pdl-likelihood.field.ts +0 -19
  105. package/src/fields/person/pdl-linkedin-connections.field.ts +0 -20
  106. package/src/fields/person/pdl-linkedin-username.field.ts +0 -20
  107. package/src/fields/person/pdl-location-metro.field.ts +0 -28
  108. package/src/fields/person/pdl-location.field.ts +0 -19
  109. package/src/fields/person/pdl-name-aliases.field.ts +0 -19
  110. package/src/fields/person/pdl-profiles.field.ts +0 -19
  111. package/src/fields/person/pdl-raw-payload.field.ts +0 -19
  112. package/src/fields/person/pdl-seniority.field.ts +0 -28
  113. package/src/fields/person/pdl-sex.field.ts +0 -28
  114. package/src/fields/person/pdl-skills.field.ts +0 -19
  115. package/src/fields/person/pdl-summary.field.ts +0 -19
  116. package/src/fields/person/pdl-twitter-url.field.ts +0 -19
  117. package/src/fields/person/pdl-years-experience.field.ts +0 -21
  118. package/src/front-components/enrich-companies-component-effect.tsx +0 -21
  119. package/src/front-components/enrich-people-component-effect.tsx +0 -21
  120. package/src/front-components/utils/call-enrich-logic-function.utils.ts +0 -21
  121. package/src/logic-functions/__mocks__/company-node.mock.ts +0 -11
  122. package/src/logic-functions/__mocks__/create-core-api-client-mock.ts +0 -35
  123. package/src/logic-functions/__mocks__/pdl-company-data.mock.ts +0 -27
  124. package/src/logic-functions/__mocks__/pdl-person-data.mock.ts +0 -23
  125. package/src/logic-functions/__mocks__/person-node.mock.ts +0 -12
  126. package/src/logic-functions/enrich-companies.function.ts +0 -76
  127. package/src/logic-functions/enrich-company.function.ts +0 -73
  128. package/src/logic-functions/enrich-people.function.ts +0 -76
  129. package/src/logic-functions/enrich-person.function.ts +0 -73
  130. package/src/logic-functions/errors/__tests__/pdl-config-error.spec.ts +0 -16
  131. package/src/logic-functions/errors/__tests__/pdl-invalid-input-error.spec.ts +0 -16
  132. package/src/logic-functions/errors/__tests__/pdl-operation-error.spec.ts +0 -16
  133. package/src/logic-functions/errors/__tests__/pdl-record-not-found-error.spec.ts +0 -21
  134. package/src/logic-functions/errors/pdl-config-error.ts +0 -8
  135. package/src/logic-functions/errors/pdl-error-code.ts +0 -8
  136. package/src/logic-functions/errors/pdl-error.ts +0 -12
  137. package/src/logic-functions/errors/pdl-invalid-input-error.ts +0 -8
  138. package/src/logic-functions/errors/pdl-operation-error.ts +0 -8
  139. package/src/logic-functions/errors/pdl-record-not-found-error.ts +0 -22
  140. package/src/logic-functions/handlers/__tests__/enrich-companies.spec.ts +0 -159
  141. package/src/logic-functions/handlers/__tests__/enrich-company.spec.ts +0 -147
  142. package/src/logic-functions/handlers/__tests__/enrich-people.spec.ts +0 -313
  143. package/src/logic-functions/handlers/__tests__/enrich-person.spec.ts +0 -198
  144. package/src/logic-functions/handlers/__tests__/post-install.spec.ts +0 -153
  145. package/src/logic-functions/handlers/company-enrichment-adapter.ts +0 -42
  146. package/src/logic-functions/handlers/company-single-enrichment-adapter.ts +0 -15
  147. package/src/logic-functions/handlers/enrich-companies.ts +0 -15
  148. package/src/logic-functions/handlers/enrich-company.ts +0 -19
  149. package/src/logic-functions/handlers/enrich-people.ts +0 -15
  150. package/src/logic-functions/handlers/enrich-person.ts +0 -19
  151. package/src/logic-functions/handlers/person-enrichment-adapter.ts +0 -29
  152. package/src/logic-functions/handlers/person-single-enrichment-adapter.ts +0 -15
  153. package/src/logic-functions/handlers/post-install.ts +0 -69
  154. package/src/logic-functions/post-install.function.ts +0 -17
  155. package/src/logic-functions/utils/__tests__/aggregate-bulk-enrich-result.spec.ts +0 -52
  156. package/src/logic-functions/utils/__tests__/build-address.spec.ts +0 -30
  157. package/src/logic-functions/utils/__tests__/build-allowed-values.spec.ts +0 -16
  158. package/src/logic-functions/utils/__tests__/build-bulk-records-trigger.spec.ts +0 -26
  159. package/src/logic-functions/utils/__tests__/build-company-create-data.spec.ts +0 -37
  160. package/src/logic-functions/utils/__tests__/build-company-match-keys.spec.ts +0 -35
  161. package/src/logic-functions/utils/__tests__/build-company-matched-data.spec.ts +0 -56
  162. package/src/logic-functions/utils/__tests__/build-currency-from-usd.spec.ts +0 -17
  163. package/src/logic-functions/utils/__tests__/build-emails.spec.ts +0 -23
  164. package/src/logic-functions/utils/__tests__/build-error-result.spec.ts +0 -16
  165. package/src/logic-functions/utils/__tests__/build-full-name.spec.ts +0 -64
  166. package/src/logic-functions/utils/__tests__/build-links.spec.ts +0 -25
  167. package/src/logic-functions/utils/__tests__/build-logic-function-step.spec.ts +0 -33
  168. package/src/logic-functions/utils/__tests__/build-matched-result.spec.ts +0 -33
  169. package/src/logic-functions/utils/__tests__/build-not-found-result.spec.ts +0 -15
  170. package/src/logic-functions/utils/__tests__/build-person-matched-data.spec.ts +0 -117
  171. package/src/logic-functions/utils/__tests__/build-person-name-param.spec.ts +0 -17
  172. package/src/logic-functions/utils/__tests__/build-phones.spec.ts +0 -32
  173. package/src/logic-functions/utils/__tests__/build-skipped-result.spec.ts +0 -17
  174. package/src/logic-functions/utils/__tests__/capitalize-name.spec.ts +0 -26
  175. package/src/logic-functions/utils/__tests__/capitalize-name.test.ts +0 -17
  176. package/src/logic-functions/utils/__tests__/charge-matched-enrichments.spec.ts +0 -56
  177. package/src/logic-functions/utils/__tests__/chunk.spec.ts +0 -25
  178. package/src/logic-functions/utils/__tests__/enrich-companies.spec.ts +0 -26
  179. package/src/logic-functions/utils/__tests__/enrich-company.spec.ts +0 -54
  180. package/src/logic-functions/utils/__tests__/enrich-people.spec.ts +0 -32
  181. package/src/logic-functions/utils/__tests__/enrich-person.spec.ts +0 -62
  182. package/src/logic-functions/utils/__tests__/extract-company-match-params.spec.ts +0 -86
  183. package/src/logic-functions/utils/__tests__/extract-pdl-error-message.spec.ts +0 -17
  184. package/src/logic-functions/utils/__tests__/extract-person-match-params.spec.ts +0 -75
  185. package/src/logic-functions/utils/__tests__/extract-record-ids.spec.ts +0 -32
  186. package/src/logic-functions/utils/__tests__/find-company-id-by-filter.spec.ts +0 -42
  187. package/src/logic-functions/utils/__tests__/find-company-id.spec.ts +0 -118
  188. package/src/logic-functions/utils/__tests__/find-existing-workflow-id.spec.ts +0 -26
  189. package/src/logic-functions/utils/__tests__/find-or-create-current-company.spec.ts +0 -203
  190. package/src/logic-functions/utils/__tests__/get-pdl-api-key.spec.ts +0 -38
  191. package/src/logic-functions/utils/__tests__/is-empty-address.spec.ts +0 -20
  192. package/src/logic-functions/utils/__tests__/is-empty-emails.spec.ts +0 -14
  193. package/src/logic-functions/utils/__tests__/is-empty-full-name.spec.ts +0 -14
  194. package/src/logic-functions/utils/__tests__/is-empty-links.spec.ts +0 -14
  195. package/src/logic-functions/utils/__tests__/is-empty-phones.spec.ts +0 -14
  196. package/src/logic-functions/utils/__tests__/is-empty-text.spec.ts +0 -15
  197. package/src/logic-functions/utils/__tests__/map-company.spec.ts +0 -48
  198. package/src/logic-functions/utils/__tests__/map-person.spec.ts +0 -81
  199. package/src/logic-functions/utils/__tests__/normalize-domain.spec.ts +0 -19
  200. package/src/logic-functions/utils/__tests__/normalize-linkedin-url.spec.ts +0 -22
  201. package/src/logic-functions/utils/__tests__/now-iso.spec.ts +0 -9
  202. package/src/logic-functions/utils/__tests__/parse-geo.spec.ts +0 -21
  203. package/src/logic-functions/utils/__tests__/parse-partial-date.spec.ts +0 -29
  204. package/src/logic-functions/utils/__tests__/parse-pdl-item.spec.ts +0 -88
  205. package/src/logic-functions/utils/__tests__/pick-multi-select.spec.ts +0 -28
  206. package/src/logic-functions/utils/__tests__/pick-select.spec.ts +0 -38
  207. package/src/logic-functions/utils/__tests__/pick-writable-standard.spec.ts +0 -37
  208. package/src/logic-functions/utils/__tests__/post-pdl-enrich.spec.ts +0 -192
  209. package/src/logic-functions/utils/__tests__/post-pdl-single-enrich.spec.ts +0 -172
  210. package/src/logic-functions/utils/__tests__/read-companies.spec.ts +0 -39
  211. package/src/logic-functions/utils/__tests__/read-people.spec.ts +0 -40
  212. package/src/logic-functions/utils/__tests__/resolve-logic-function-id.spec.ts +0 -25
  213. package/src/logic-functions/utils/__tests__/resolve-update-fields-mode.spec.ts +0 -34
  214. package/src/logic-functions/utils/__tests__/run-batch-enrichment.spec.ts +0 -524
  215. package/src/logic-functions/utils/__tests__/salary-transform.spec.ts +0 -15
  216. package/src/logic-functions/utils/__tests__/seed-enrichment-workflow.spec.ts +0 -136
  217. package/src/logic-functions/utils/__tests__/size-transform.spec.ts +0 -18
  218. package/src/logic-functions/utils/__tests__/to-json-array.spec.ts +0 -16
  219. package/src/logic-functions/utils/__tests__/to-json-object.spec.ts +0 -18
  220. package/src/logic-functions/utils/__tests__/to-number.spec.ts +0 -17
  221. package/src/logic-functions/utils/__tests__/to-string-array.spec.ts +0 -17
  222. package/src/logic-functions/utils/__tests__/to-text.spec.ts +0 -20
  223. package/src/logic-functions/utils/__tests__/update-companies-status.spec.ts +0 -32
  224. package/src/logic-functions/utils/__tests__/update-company-record.spec.ts +0 -25
  225. package/src/logic-functions/utils/__tests__/update-people-status.spec.ts +0 -32
  226. package/src/logic-functions/utils/__tests__/update-person-record.spec.ts +0 -25
  227. package/src/logic-functions/utils/aggregate-bulk-enrich-result.ts +0 -21
  228. package/src/logic-functions/utils/build-address.ts +0 -40
  229. package/src/logic-functions/utils/build-allowed-values.ts +0 -5
  230. package/src/logic-functions/utils/build-bulk-records-trigger.ts +0 -25
  231. package/src/logic-functions/utils/build-company-create-data.ts +0 -35
  232. package/src/logic-functions/utils/build-company-match-keys.ts +0 -16
  233. package/src/logic-functions/utils/build-company-matched-data.ts +0 -56
  234. package/src/logic-functions/utils/build-currency-from-usd.ts +0 -16
  235. package/src/logic-functions/utils/build-emails.ts +0 -34
  236. package/src/logic-functions/utils/build-error-result.ts +0 -18
  237. package/src/logic-functions/utils/build-full-name.ts +0 -38
  238. package/src/logic-functions/utils/build-links.ts +0 -23
  239. package/src/logic-functions/utils/build-logic-function-step.ts +0 -30
  240. package/src/logic-functions/utils/build-matched-result.ts +0 -21
  241. package/src/logic-functions/utils/build-not-found-result.ts +0 -9
  242. package/src/logic-functions/utils/build-person-matched-data.ts +0 -78
  243. package/src/logic-functions/utils/build-person-name-param.ts +0 -19
  244. package/src/logic-functions/utils/build-phones.ts +0 -40
  245. package/src/logic-functions/utils/build-skipped-result.ts +0 -15
  246. package/src/logic-functions/utils/capitalize-name.ts +0 -8
  247. package/src/logic-functions/utils/charge-matched-enrichments.ts +0 -29
  248. package/src/logic-functions/utils/chunk.ts +0 -18
  249. package/src/logic-functions/utils/enrich-chunk.ts +0 -361
  250. package/src/logic-functions/utils/enrich-companies.ts +0 -21
  251. package/src/logic-functions/utils/enrich-company.ts +0 -23
  252. package/src/logic-functions/utils/enrich-people.ts +0 -22
  253. package/src/logic-functions/utils/enrich-person.ts +0 -24
  254. package/src/logic-functions/utils/extract-company-match-params.ts +0 -52
  255. package/src/logic-functions/utils/extract-pdl-error-message.ts +0 -47
  256. package/src/logic-functions/utils/extract-person-match-params.ts +0 -59
  257. package/src/logic-functions/utils/extract-record-ids.ts +0 -18
  258. package/src/logic-functions/utils/find-company-id-by-filter.ts +0 -28
  259. package/src/logic-functions/utils/find-company-id.ts +0 -59
  260. package/src/logic-functions/utils/find-existing-workflow-id.ts +0 -18
  261. package/src/logic-functions/utils/find-or-create-current-company.ts +0 -108
  262. package/src/logic-functions/utils/get-pdl-api-key.ts +0 -15
  263. package/src/logic-functions/utils/internal-field-names.ts +0 -6
  264. package/src/logic-functions/utils/is-empty-address.ts +0 -20
  265. package/src/logic-functions/utils/is-empty-emails.ts +0 -13
  266. package/src/logic-functions/utils/is-empty-full-name.ts +0 -13
  267. package/src/logic-functions/utils/is-empty-links.ts +0 -13
  268. package/src/logic-functions/utils/is-empty-phones.ts +0 -13
  269. package/src/logic-functions/utils/is-empty-text.ts +0 -4
  270. package/src/logic-functions/utils/map-company.ts +0 -115
  271. package/src/logic-functions/utils/map-person.ts +0 -136
  272. package/src/logic-functions/utils/normalize-domain.ts +0 -22
  273. package/src/logic-functions/utils/normalize-linkedin-url.ts +0 -23
  274. package/src/logic-functions/utils/now-iso.ts +0 -1
  275. package/src/logic-functions/utils/parse-geo.ts +0 -33
  276. package/src/logic-functions/utils/parse-partial-date.ts +0 -33
  277. package/src/logic-functions/utils/parse-pdl-item.ts +0 -82
  278. package/src/logic-functions/utils/pick-multi-select.ts +0 -32
  279. package/src/logic-functions/utils/pick-select.ts +0 -30
  280. package/src/logic-functions/utils/pick-writable-standard.ts +0 -27
  281. package/src/logic-functions/utils/post-pdl-enrich.ts +0 -89
  282. package/src/logic-functions/utils/post-pdl-single-enrich.ts +0 -59
  283. package/src/logic-functions/utils/read-companies.ts +0 -53
  284. package/src/logic-functions/utils/read-people.ts +0 -48
  285. package/src/logic-functions/utils/resolve-logic-function-id.ts +0 -11
  286. package/src/logic-functions/utils/resolve-min-likelihood.ts +0 -12
  287. package/src/logic-functions/utils/resolve-update-fields-mode.ts +0 -16
  288. package/src/logic-functions/utils/run-batch-enrichment.ts +0 -50
  289. package/src/logic-functions/utils/run-single-enrichment.ts +0 -44
  290. package/src/logic-functions/utils/salary-transform.ts +0 -18
  291. package/src/logic-functions/utils/seed-enrichment-workflow.ts +0 -131
  292. package/src/logic-functions/utils/size-transform.ts +0 -15
  293. package/src/logic-functions/utils/to-bulk-enrich-input.ts +0 -14
  294. package/src/logic-functions/utils/to-json-array.ts +0 -4
  295. package/src/logic-functions/utils/to-json-object.ts +0 -22
  296. package/src/logic-functions/utils/to-number.ts +0 -4
  297. package/src/logic-functions/utils/to-string-array.ts +0 -28
  298. package/src/logic-functions/utils/to-text.ts +0 -11
  299. package/src/logic-functions/utils/update-companies-status.ts +0 -18
  300. package/src/logic-functions/utils/update-company-record.ts +0 -15
  301. package/src/logic-functions/utils/update-people-status.ts +0 -18
  302. package/src/logic-functions/utils/update-person-record.ts +0 -15
  303. package/src/roles/default-function.role.ts +0 -41
  304. package/src/types/address-parts.ts +0 -9
  305. package/src/types/address-value.ts +0 -10
  306. package/src/types/batch-enrichment-adapter.ts +0 -43
  307. package/src/types/bulk-enrich-input.ts +0 -9
  308. package/src/types/bulk-enrich-result.ts +0 -11
  309. package/src/types/company-id-by-match-key-cache.ts +0 -1
  310. package/src/types/company-match-keys.ts +0 -6
  311. package/src/types/company-node.ts +0 -16
  312. package/src/types/currency-value.ts +0 -4
  313. package/src/types/emails-value.ts +0 -4
  314. package/src/types/enrich-result.ts +0 -11
  315. package/src/types/enrich-status.ts +0 -1
  316. package/src/types/enrichment-workflow-seed.ts +0 -9
  317. package/src/types/full-name-value.ts +0 -4
  318. package/src/types/links-value.ts +0 -5
  319. package/src/types/mapped-record.ts +0 -4
  320. package/src/types/pdl-company-data.ts +0 -50
  321. package/src/types/pdl-company-enrich-params.ts +0 -7
  322. package/src/types/pdl-enrich-result.ts +0 -4
  323. package/src/types/pdl-person-data.ts +0 -65
  324. package/src/types/pdl-person-enrich-params.ts +0 -8
  325. package/src/types/person-node.ts +0 -11
  326. package/src/types/phones-value.ts +0 -12
  327. package/src/types/post-install-result.ts +0 -5
  328. package/src/types/seed-enrichment-workflow-result.ts +0 -7
  329. package/src/types/select-option-meta.ts +0 -9
  330. package/src/types/single-enrich-input.ts +0 -7
  331. package/src/types/tag-color.ts +0 -26
  332. package/src/types/update-fields-option.ts +0 -4
  333. package/src/types/workflow-bulk-records-trigger.ts +0 -15
  334. package/src/types/workflow-logic-function-step.ts +0 -18
  335. package/src/utils/__tests__/build-select-options.spec.ts +0 -20
  336. package/src/utils/__tests__/is-defined.spec.ts +0 -16
  337. package/src/utils/__tests__/is-unique-violation-error.spec.ts +0 -71
  338. package/src/utils/__tests__/normalize-enum-value.spec.ts +0 -28
  339. package/src/utils/__tests__/prune-undefined.spec.ts +0 -22
  340. package/src/utils/__tests__/strip-separators.spec.ts +0 -13
  341. package/src/utils/__tests__/to-error-message.spec.ts +0 -13
  342. package/src/utils/build-select-options.ts +0 -16
  343. package/src/utils/is-defined.ts +0 -5
  344. package/src/utils/is-unique-violation-error.ts +0 -74
  345. package/src/utils/normalize-enum-value.ts +0 -15
  346. package/src/utils/prune-undefined.ts +0 -15
  347. package/src/utils/strip-separators.ts +0 -4
  348. package/src/utils/to-error-message.ts +0 -2
  349. package/src/views/enriched-companies.view.ts +0 -69
  350. package/src/views/enriched-people.view.ts +0 -74
  351. package/tsconfig.json +0 -42
  352. package/tsconfig.spec.json +0 -9
  353. package/vitest.config.ts +0 -31
  354. package/vitest.unit.config.ts +0 -14
@@ -1,4 +0,0 @@
1
- export type FullNameValue = {
2
- firstName: string;
3
- lastName: string;
4
- };
@@ -1,5 +0,0 @@
1
- export type LinksValue = {
2
- primaryLinkUrl: string;
3
- primaryLinkLabel: string;
4
- secondaryLinks: null;
5
- };
@@ -1,4 +0,0 @@
1
- export type MappedRecord = {
2
- standard: Record<string, unknown>;
3
- pdl: Record<string, unknown>;
4
- };
@@ -1,50 +0,0 @@
1
- export type PdlCompanyData = {
2
- id?: string | null;
3
- name?: string | null;
4
- display_name?: string | null;
5
- legal_name?: string | null;
6
- alternative_names?: string[] | null;
7
- alternative_domains?: string[] | null;
8
-
9
- website?: string | null;
10
- linkedin_url?: string | null;
11
- linkedin_id?: string | null;
12
- facebook_url?: string | null;
13
- twitter_url?: string | null;
14
- profiles?: string[] | null;
15
-
16
- industry?: string | null;
17
- industry_v2?: string | null;
18
- naics?: unknown[] | null;
19
- sic?: unknown[] | null;
20
- tags?: string[] | null;
21
- type?: string | null;
22
- ticker?: string | null;
23
- mic_exchange?: string | null;
24
-
25
- size?: string | null;
26
- employee_count?: number | null;
27
- employee_count_by_country?: Record<string, unknown> | null;
28
- founded?: number | null;
29
-
30
- summary?: string | null;
31
- headline?: string | null;
32
-
33
- total_funding_raised?: number | null;
34
- latest_funding_stage?: string | null;
35
- funding_stages?: string[] | null;
36
- last_funding_date?: string | null;
37
- number_funding_rounds?: number | null;
38
-
39
- location?: {
40
- street_address?: string | null;
41
- address_line_2?: string | null;
42
- locality?: string | null;
43
- region?: string | null;
44
- postal_code?: string | null;
45
- country?: string | null;
46
- continent?: string | null;
47
- metro?: string | null;
48
- geo?: string | null;
49
- } | null;
50
- };
@@ -1,7 +0,0 @@
1
- export type PdlCompanyEnrichParams = {
2
- pdlId?: string;
3
- website?: string;
4
- profile?: string;
5
- name?: string;
6
- minLikelihood?: number;
7
- };
@@ -1,4 +0,0 @@
1
- export type PdlEnrichResult<TData> =
2
- | { outcome: 'matched'; httpStatus: number; likelihood?: number; data: TData }
3
- | { outcome: 'not_found'; httpStatus: number }
4
- | { outcome: 'error'; httpStatus: number; message: string };
@@ -1,65 +0,0 @@
1
- export type PdlPersonData = {
2
- id?: string | null;
3
- full_name?: string | null;
4
- first_name?: string | null;
5
- last_name?: string | null;
6
- name_aliases?: string[] | null;
7
-
8
- work_email?: string | null;
9
- personal_emails?: string[] | null;
10
- emails?: ({ address?: string | null } | string)[] | null;
11
- recommended_personal_email?: string | null;
12
-
13
- mobile_phone?: string | null;
14
- phone_numbers?: string[] | null;
15
-
16
- job_title?: string | null;
17
- job_title_role?: string | null;
18
- job_title_sub_role?: string | null;
19
- job_title_class?: string | null;
20
- job_title_levels?: string[] | null;
21
- job_onet_code?: string | null;
22
- job_summary?: string | null;
23
- job_start_date?: string | null;
24
- inferred_years_experience?: number | null;
25
- inferred_salary?: string | null;
26
- industry?: string | null;
27
-
28
- job_company_id?: string | null;
29
- job_company_name?: string | null;
30
- job_company_website?: string | null;
31
- job_company_linkedin_url?: string | null;
32
- job_company_industry?: string | null;
33
- job_company_size?: string | null;
34
-
35
- linkedin_url?: string | null;
36
- linkedin_username?: string | null;
37
- linkedin_connections?: number | null;
38
- facebook_url?: string | null;
39
- twitter_url?: string | null;
40
- github_url?: string | null;
41
-
42
- headline?: string | null;
43
- summary?: string | null;
44
- skills?: string[] | null;
45
- interests?: string[] | null;
46
- experience?: unknown[] | null;
47
- education?: unknown[] | null;
48
- certifications?: unknown[] | null;
49
- profiles?: unknown[] | null;
50
- languages?: unknown[] | null;
51
-
52
- sex?: string | null;
53
- birth_year?: number | null;
54
- birth_date?: string | null;
55
-
56
- location_name?: string | null;
57
- location_street_address?: string | null;
58
- location_address_line_2?: string | null;
59
- location_locality?: string | null;
60
- location_region?: string | null;
61
- location_postal_code?: string | null;
62
- location_country?: string | null;
63
- location_metro?: string | null;
64
- location_geo?: string | null;
65
- };
@@ -1,8 +0,0 @@
1
- export type PdlPersonEnrichParams = {
2
- pdlId?: string;
3
- profile?: string;
4
- email?: string;
5
- name?: string;
6
- company?: string;
7
- minLikelihood?: number;
8
- };
@@ -1,11 +0,0 @@
1
- export type PersonNode = {
2
- id: string;
3
- name?: { firstName?: string | null; lastName?: string | null } | null;
4
- emails?: { primaryEmail?: string | null } | null;
5
- phones?: { primaryPhoneNumber?: string | null } | null;
6
- jobTitle?: string | null;
7
- linkedinLink?: { primaryLinkUrl?: string | null } | null;
8
- company?: { id?: string | null; name?: string | null } | null;
9
- pdlId?: string | null;
10
- pdlLastEnrichedAt?: string | null;
11
- };
@@ -1,12 +0,0 @@
1
- export type AdditionalPhone = {
2
- number: string;
3
- countryCode: string;
4
- callingCode: string;
5
- };
6
-
7
- export type PhonesValue = {
8
- primaryPhoneNumber: string;
9
- primaryPhoneCountryCode: string;
10
- primaryPhoneCallingCode: string;
11
- additionalPhones: AdditionalPhone[] | null;
12
- };
@@ -1,5 +0,0 @@
1
- import { type SeedEnrichmentWorkflowResult } from 'src/types/seed-enrichment-workflow-result';
2
-
3
- export type PostInstallResult = {
4
- seededWorkflows: SeedEnrichmentWorkflowResult[];
5
- };
@@ -1,7 +0,0 @@
1
- export type SeedEnrichmentWorkflowResult = {
2
- objectNameSingular: string;
3
- workflowName: string;
4
- status: 'created' | 'skipped' | 'failed';
5
- workflowId?: string;
6
- error?: string;
7
- };
@@ -1,9 +0,0 @@
1
- import { type TagColor } from 'src/types/tag-color';
2
-
3
- export type SelectOptionMeta = {
4
- key: string;
5
- value: string;
6
- label: string;
7
- color: TagColor;
8
- position: number;
9
- };
@@ -1,7 +0,0 @@
1
- import { type UpdateFieldsOption } from 'src/types/update-fields-option';
2
-
3
- export type SingleEnrichInput = {
4
- recordId?: string;
5
- updateFields?: UpdateFieldsOption;
6
- minLikelihood?: number;
7
- };
@@ -1,26 +0,0 @@
1
- export type TagColor =
2
- | 'red'
3
- | 'ruby'
4
- | 'crimson'
5
- | 'tomato'
6
- | 'orange'
7
- | 'amber'
8
- | 'yellow'
9
- | 'lime'
10
- | 'grass'
11
- | 'green'
12
- | 'jade'
13
- | 'mint'
14
- | 'turquoise'
15
- | 'cyan'
16
- | 'sky'
17
- | 'blue'
18
- | 'iris'
19
- | 'violet'
20
- | 'purple'
21
- | 'plum'
22
- | 'pink'
23
- | 'bronze'
24
- | 'gold'
25
- | 'brown'
26
- | 'gray';
@@ -1,4 +0,0 @@
1
- export type UpdateFieldsOption =
2
- | 'Yes and overwrite'
3
- | "Yes and don't overwrite"
4
- | 'No';
@@ -1,15 +0,0 @@
1
- export type WorkflowBulkRecordsTrigger = {
2
- name: string;
3
- type: 'MANUAL';
4
- settings: {
5
- objectType: string;
6
- availability: {
7
- type: 'BULK_RECORDS';
8
- objectNameSingular: string;
9
- };
10
- outputSchema: Record<string, never>;
11
- icon: string;
12
- isPinned: boolean;
13
- };
14
- nextStepIds: string[];
15
- };
@@ -1,18 +0,0 @@
1
- export type WorkflowLogicFunctionStep = {
2
- id: string;
3
- name: string;
4
- type: 'LOGIC_FUNCTION';
5
- valid: boolean;
6
- settings: {
7
- input: {
8
- logicFunctionId: string;
9
- logicFunctionInput: Record<string, unknown>;
10
- };
11
- outputSchema: Record<string, never>;
12
- errorHandlingOptions: {
13
- retryOnFailure: { value: boolean };
14
- continueOnFailure: { value: boolean };
15
- };
16
- };
17
- nextStepIds: string[];
18
- };
@@ -1,20 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
-
3
- import { buildSelectOptions } from 'src/utils/build-select-options';
4
-
5
- describe('buildSelectOptions', () => {
6
- it('attaches the universalIdentifier to each option by key', () => {
7
- const options = buildSelectOptions({
8
- meta: [
9
- { key: 'a', value: 'A', label: 'Option A', color: 'blue', position: 0 },
10
- { key: 'b', value: 'B', label: 'Option B', color: 'red', position: 1 },
11
- ],
12
- ids: { a: 'id-a', b: 'id-b' },
13
- });
14
-
15
- expect(options).toEqual([
16
- { id: 'id-a', value: 'A', label: 'Option A', color: 'blue', position: 0 },
17
- { id: 'id-b', value: 'B', label: 'Option B', color: 'red', position: 1 },
18
- ]);
19
- });
20
- });
@@ -1,16 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
-
3
- import { isDefined } from 'src/utils/is-defined';
4
-
5
- describe('isDefined', () => {
6
- it('is true for defined values, including falsy ones', () => {
7
- expect(isDefined(0)).toBe(true);
8
- expect(isDefined('')).toBe(true);
9
- expect(isDefined(false)).toBe(true);
10
- });
11
-
12
- it('is false for null and undefined', () => {
13
- expect(isDefined(null)).toBe(false);
14
- expect(isDefined(undefined)).toBe(false);
15
- });
16
- });
@@ -1,71 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
-
3
- import { isUniqueViolationError } from 'src/utils/is-unique-violation-error';
4
-
5
- describe('isUniqueViolationError', () => {
6
- it('detects common unique-violation phrasings (case-insensitive)', () => {
7
- expect(
8
- isUniqueViolationError(
9
- new Error('duplicate key value violates unique constraint'),
10
- ),
11
- ).toBe(true);
12
- expect(isUniqueViolationError(new Error('Record already exists'))).toBe(
13
- true,
14
- );
15
- expect(isUniqueViolationError({ message: 'Uniqueness violated' })).toBe(
16
- true,
17
- );
18
- expect(isUniqueViolationError('VIOLATES UNIQUE index')).toBe(true);
19
- });
20
-
21
- it('returns false for unrelated errors and non-error values', () => {
22
- expect(isUniqueViolationError(new Error('network down'))).toBe(false);
23
- expect(isUniqueViolationError(null)).toBe(false);
24
- expect(isUniqueViolationError(undefined)).toBe(false);
25
- expect(isUniqueViolationError(42)).toBe(false);
26
- });
27
-
28
- it("detects Twenty's user-friendly duplicate phrasing in graphQLErrors", () => {
29
- expect(
30
- isUniqueViolationError({
31
- message: 'Response not successful',
32
- graphQLErrors: [
33
- {
34
- message: 'A duplicate entry was detected',
35
- extensions: {
36
- code: 'BAD_USER_INPUT',
37
- userFriendlyMessage:
38
- 'This domain name value is already in use. Please check your data.',
39
- },
40
- },
41
- ],
42
- }),
43
- ).toBe(true);
44
- });
45
-
46
- it('detects the structured DUPLICATE_ENTRY_DETECTED extensions code', () => {
47
- expect(
48
- isUniqueViolationError({
49
- message: 'whatever',
50
- extensions: { code: 'DUPLICATE_ENTRY_DETECTED' },
51
- }),
52
- ).toBe(true);
53
- });
54
-
55
- it('does not throw on a circular error object', () => {
56
- const circular: Record<string, unknown> = { message: 'boom' };
57
- circular.self = circular;
58
-
59
- expect(() => isUniqueViolationError(circular)).not.toThrow();
60
- expect(isUniqueViolationError(circular)).toBe(false);
61
- });
62
-
63
- it('finds the duplicate signal even on a circular error object', () => {
64
- const circular: Record<string, unknown> = {
65
- message: 'duplicate key value',
66
- };
67
- circular.self = circular;
68
-
69
- expect(isUniqueViolationError(circular)).toBe(true);
70
- });
71
- });
@@ -1,28 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
-
3
- import { normalizeEnumValue } from 'src/utils/normalize-enum-value';
4
-
5
- describe('normalizeEnumValue', () => {
6
- it('uppercases a simple value', () => {
7
- expect(normalizeEnumValue('engineering')).toBe('ENGINEERING');
8
- });
9
-
10
- it('collapses spaces into a single underscore', () => {
11
- expect(normalizeEnumValue('computer software')).toBe('COMPUTER_SOFTWARE');
12
- });
13
-
14
- it('collapses punctuation runs into a single underscore', () => {
15
- expect(normalizeEnumValue('airlines/aviation')).toBe('AIRLINES_AVIATION');
16
- expect(normalizeEnumValue('san francisco, california')).toBe(
17
- 'SAN_FRANCISCO_CALIFORNIA',
18
- );
19
- });
20
-
21
- it('strips diacritics', () => {
22
- expect(normalizeEnumValue('Montréal')).toBe('MONTREAL');
23
- });
24
-
25
- it('prefixes a leading digit with an underscore', () => {
26
- expect(normalizeEnumValue('3m')).toBe('_3M');
27
- });
28
- });
@@ -1,22 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
-
3
- import { pruneUndefined } from 'src/utils/prune-undefined';
4
-
5
- describe('pruneUndefined', () => {
6
- it('removes keys whose value is undefined', () => {
7
- expect(pruneUndefined({ a: 1, b: undefined, c: 3 })).toEqual({ a: 1, c: 3 });
8
- });
9
-
10
- it('keeps falsy values that are not undefined', () => {
11
- expect(pruneUndefined({ a: 0, b: '', c: null, d: false })).toEqual({
12
- a: 0,
13
- b: '',
14
- c: null,
15
- d: false,
16
- });
17
- });
18
-
19
- it('returns an empty object when every value is undefined', () => {
20
- expect(pruneUndefined({ a: undefined, b: undefined })).toEqual({});
21
- });
22
- });
@@ -1,13 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
-
3
- import { stripSeparators } from 'src/utils/strip-separators';
4
-
5
- describe('stripSeparators', () => {
6
- it('removes spaces and commas', () => {
7
- expect(stripSeparators('45,000 - 55,000')).toBe('45000-55000');
8
- });
9
-
10
- it('leaves a value without separators unchanged', () => {
11
- expect(stripSeparators('1-10')).toBe('1-10');
12
- });
13
- });
@@ -1,13 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
-
3
- import { toErrorMessage } from 'src/utils/to-error-message';
4
-
5
- describe('toErrorMessage', () => {
6
- it('returns the message of an Error', () => {
7
- expect(toErrorMessage(new Error('boom'))).toBe('boom');
8
- });
9
-
10
- it('stringifies a non-Error value', () => {
11
- expect(toErrorMessage('oops')).toBe('oops');
12
- });
13
- });
@@ -1,16 +0,0 @@
1
- import { type SelectOptionMeta } from 'src/types/select-option-meta';
2
-
3
- export const buildSelectOptions = ({
4
- meta,
5
- ids,
6
- }: {
7
- meta: readonly SelectOptionMeta[];
8
- ids: Record<string, string>;
9
- }) =>
10
- meta.map(({ key, value, label, color, position }) => ({
11
- id: ids[key],
12
- value,
13
- label,
14
- color,
15
- position,
16
- }));
@@ -1,5 +0,0 @@
1
- import { isNull, isUndefined } from '@sniptt/guards';
2
-
3
- export const isDefined = <T>(
4
- value: T | null | undefined,
5
- ): value is NonNullable<T> => !isUndefined(value) && !isNull(value);
@@ -1,74 +0,0 @@
1
- import { isObject } from '@sniptt/guards';
2
-
3
- import { isDefined } from 'src/utils/is-defined';
4
-
5
- const DUPLICATE_VIOLATION_PHRASES = [
6
- 'duplicate',
7
- 'unique constraint',
8
- 'uniqueness',
9
- 'already exists',
10
- 'is already in use',
11
- 'violates unique',
12
- 'duplicate_entry_detected',
13
- ];
14
-
15
- const MAX_ERROR_TRAVERSAL_DEPTH = 4;
16
-
17
- const stringifyWithoutThrowingOnCycles = (value: unknown): string => {
18
- try {
19
- return JSON.stringify(value) ?? '';
20
- } catch {
21
- return '';
22
- }
23
- };
24
-
25
- const collectErrorText = (error: unknown, depth = 0): string => {
26
- if (!isDefined(error) || depth > MAX_ERROR_TRAVERSAL_DEPTH) {
27
- return '';
28
- }
29
- if (typeof error === 'string') {
30
- return error;
31
- }
32
- if (typeof error !== 'object') {
33
- return String(error);
34
- }
35
-
36
- const errorObject = error as Record<string, unknown>;
37
- const textFragments: string[] = [];
38
-
39
- if (typeof errorObject.message === 'string') {
40
- textFragments.push(errorObject.message);
41
- }
42
-
43
- if (Array.isArray(errorObject.graphQLErrors)) {
44
- for (const graphQLError of errorObject.graphQLErrors) {
45
- textFragments.push(collectErrorText(graphQLError, depth + 1));
46
- }
47
- }
48
-
49
- if (isObject(errorObject.extensions)) {
50
- const extensions = errorObject.extensions as Record<string, unknown>;
51
- if (typeof extensions.code === 'string') {
52
- textFragments.push(extensions.code);
53
- }
54
- if (typeof extensions.userFriendlyMessage === 'string') {
55
- textFragments.push(extensions.userFriendlyMessage);
56
- }
57
- }
58
-
59
- if (isDefined(errorObject.cause)) {
60
- textFragments.push(collectErrorText(errorObject.cause, depth + 1));
61
- }
62
-
63
- textFragments.push(stringifyWithoutThrowingOnCycles(error));
64
-
65
- return textFragments.join(' ');
66
- };
67
-
68
- export const isUniqueViolationError = (error: unknown): boolean => {
69
- const lowerCaseErrorText = collectErrorText(error).toLowerCase();
70
-
71
- return DUPLICATE_VIOLATION_PHRASES.some((phrase) =>
72
- lowerCaseErrorText.includes(phrase),
73
- );
74
- };
@@ -1,15 +0,0 @@
1
- const DIACRITICS_REGEX = new RegExp('[\\u0300-\\u036f]', 'g');
2
- const NON_ALPHANUMERIC_RUN_REGEX = /[^A-Z0-9]+/g;
3
- const LEADING_OR_TRAILING_UNDERSCORE_REGEX = /^_+|_+$/g;
4
- const LEADING_DIGIT_REGEX = /^(\d)/;
5
-
6
- export const normalizeEnumValue = (rawEnumValue: string): string => {
7
- const withoutDiacritics = rawEnumValue
8
- .normalize('NFKD')
9
- .replace(DIACRITICS_REGEX, '');
10
- const upperCased = withoutDiacritics.toUpperCase();
11
- const underscored = upperCased.replace(NON_ALPHANUMERIC_RUN_REGEX, '_');
12
- const trimmed = underscored.replace(LEADING_OR_TRAILING_UNDERSCORE_REGEX, '');
13
-
14
- return trimmed.replace(LEADING_DIGIT_REGEX, '_$1');
15
- };
@@ -1,15 +0,0 @@
1
- import { isUndefined } from '@sniptt/guards';
2
-
3
- export const pruneUndefined = <TValue>(
4
- record: Record<string, TValue | undefined>,
5
- ): Record<string, TValue> => {
6
- const prunedRecord: Record<string, TValue> = {};
7
-
8
- for (const [key, value] of Object.entries(record)) {
9
- if (!isUndefined(value)) {
10
- prunedRecord[key] = value;
11
- }
12
- }
13
-
14
- return prunedRecord;
15
- };
@@ -1,4 +0,0 @@
1
- const WHITESPACE_AND_COMMA_REGEX = /[\s,]/g;
2
-
3
- export const stripSeparators = (rawValue: string): string =>
4
- rawValue.replace(WHITESPACE_AND_COMMA_REGEX, '');
@@ -1,2 +0,0 @@
1
- export const toErrorMessage = (error: unknown): string =>
2
- error instanceof Error ? error.message : String(error);