peopledatalabs / peopledatalabs-js Goto Github PK
View Code? Open in Web Editor NEWA universal JS client with TypeScript support for the People Data Labs API
Home Page: https://docs.peopledatalabs.com/docs/javascript-sdk
License: MIT License
A universal JS client with TypeScript support for the People Data Labs API
Home Page: https://docs.peopledatalabs.com/docs/javascript-sdk
License: MIT License
Describe the bug
With TypeScript + moduleResolution:NodeNext, you get import errors like this:
node_modules/peopledatalabs/dist/index.d.ts:2:58 - error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.
import { AutoCompleteParams, AutoCompleteResponse } from './types/autocomplete-types';
To Reproduce
Steps to reproduce the behavior:
Import anything from peopledatalabs in a TypeScript project using moduleResolution: NodeNext
Expected behavior
Imports without error
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Using https://arethetypeswrong.github.io/?p=peopledatalabs%406.2.0 as a guide, you can get a sense of issues that need to be fixed for proper TypeScript + ESM + NodeNext support. The resolution errors called out are likely due to the missing .js extensions. Once you fix those, it's then just about getting the package.json correct. See bpmn-io/min-dash#29 for a similar fix (had a similar set of issues + similar initial package.json layout).
Describe the bug
When trying to use the SDK with TypeScript, I expect that types of response will be inferred, but this not actually happens, nor the inner types (like PersonEnrichmentResponse
for example) can't be imported because they are not exported from index.d.ts
To Reproduce
Try to use a type from the library that is not directly under the PDLJS
class declaration.
Expected behavior
I can import types and types are inferred in the correct way.
Screenshots
1: this is the right type:
2: but it doesn't go to the internal type:
3: nor it can be imported:
4.0.3
19.3.0
Additional context
Add any other context about the problem here.
Is your feature request related to a problem? Please describe.
It doesn't look like we can pass titlecase: true when using the bulk person retrieve function. It looks like the api supports this could it be added as a param?
Describe the solution you'd like
Have titlecase as a param we can use in the bulk person retrieve function.
Describe alternatives you've considered
If theres a good work around we're open.
Additional context
We are using search preview in our front end and then use bulk retrieve calls with the pdl ids from the initial search. We have titlecase: true on the search params then end up returning lowercase everything with the retrieve function. We're enterprise customers as well.
Describe the bug
Upgrading to 3.1.3, from 3.1.2 breaks the app.
The error surfaces at runtime, and I'm unsure on whether it's coming from the server-side (next.js pages/api) or the module, or some mismatch of module format compatibility. I can only see on the console the following message, without traces:
error - ReferenceError: self is not defined
To Reproduce
Not easy, the module is used in a complex Next.js application. It's imported as follows:
import PDLJS from 'peopledatalabs';
...
private PDLJSClient = new PDLJS({ 'apiKey': ... });
Expected behavior
The application shall run; instead a red error message about missing 'self' shows up.
Screenshots
Update: attached code that causes the 'self'.. issue.
Additional context
Update:
Seems to be something related to migrating from CJS modules (3.1.2) to UMD (3.1.3).
In particular the following line in main.umd.js
seems to cause the problem:
(e || self).peopledatalabs
Hi
Im using "typescript": "4.5.2"
with "peopledatalabs": "^3.1.8"
, I cant really build my code because of the following error:
------
> [build 21/21] RUN node ./node_modules/@nestjs/cli/bin/nest build people-data-labs:
#29 14.98 apps/people-data-labs/src/people-data-labs.service.ts:17:24 - error TS2307: Cannot find module 'peopledatalabs' or its corresponding type declarations.
#29 14.98
#29 14.98 17 import * as PDLJS from 'peopledatalabs';
#29 14.98 ~~~~~~~~~~~~~~~~
#29 14.98 apps/people-data-labs/src/people-data-labs.service.ts:18:38 - error TS2307: Cannot find module 'peopledatalabs/src/types/search-types' or its corresponding type declarations.
#29 14.98
#29 14.98 18 import { PersonSearchResponse } from 'peopledatalabs/src/types/search-types';
#29 14.98 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#29 14.98 apps/people-data-labs/src/people-data-labs.service.ts:19:32 - error TS2307: Cannot find module 'peopledatalabs/src/types/common-types' or its corresponding type declarations.
#29 14.98
#29 14.98 19 import { PersonResponse } from 'peopledatalabs/src/types/common-types';
#29 14.98 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#29 14.98
#29 14.98 Found 3 error(s).
#29 14.98
------
import { PDLJS } from 'peopledatalabs';
has the same error.
import { PersonSearchResponse } from 'peopledatalabs'
has the same error.
Thanks
Describe the bug
There are a couple of properties on the PersonResponse
type (and sub-types) defined as strings that the API seems to return as different types. Specifically job_company_founded
(is a Number from the API data I've seen), PersonExperienceResponse company.founded
should also be a number, and is_primary
should be a boolean value.
To Reproduce
Steps to reproduce the behavior:
curl "https://api.peopledatalabs.com/v5/person/enrich?api_key=${API_KEY}&pretty=True&profile=linkedin.com/in/seanthorne"
Then take the data part of the output and declare a var in TypeScript:
export const fullPdlResponse: PersonResponse = {
...
}
Notice the type errors for the properties above.
Expected behavior
The output from the API should match the type definition.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.