@entergreat/unipile-wrapper 2.1.1 → 2.1.4
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/services/companyService.d.ts +5 -1
- package/dist/services/companyService.d.ts.map +1 -1
- package/dist/services/companyService.js +16 -0
- package/dist/services/companyService.js.map +1 -1
- package/dist/services/profileService.d.ts +5 -1
- package/dist/services/profileService.d.ts.map +1 -1
- package/dist/services/profileService.js +25 -3
- package/dist/services/profileService.js.map +1 -1
- package/dist/types/company.d.ts +26 -0
- package/dist/types/company.d.ts.map +1 -1
- package/dist/types/profile.d.ts +24 -0
- package/dist/types/profile.d.ts.map +1 -1
- package/dist/utils/urlBuilder.d.ts +1 -0
- package/dist/utils/urlBuilder.d.ts.map +1 -1
- package/dist/utils/urlBuilder.js +10 -3
- package/dist/utils/urlBuilder.js.map +1 -1
- package/package.json +1 -1
- package/src/services/companyService.ts +30 -1
- package/src/services/profileService.ts +38 -3
- package/src/types/company.ts +29 -1
- package/src/types/profile.ts +20 -1
- package/src/utils/urlBuilder.ts +11 -3
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { HttpClient } from "../client/index.js";
|
|
2
2
|
import { BaseService } from "./baseService.js";
|
|
3
|
-
import { RetrieveCompanyRequest, CompanyResponse } from "../types/index.js";
|
|
3
|
+
import { RetrieveCompanyRequest, SearchCompanyRequest, CompanyResponse, CompanySearchResponse } from "../types/index.js";
|
|
4
4
|
export declare class CompanyService extends BaseService {
|
|
5
5
|
constructor(client: HttpClient, defaultAccountId?: string);
|
|
6
6
|
/**
|
|
7
7
|
* Retrieve LinkedIn company information by ID or URL
|
|
8
8
|
*/
|
|
9
9
|
retrieve({ accountId, companyId, companyUrl, }: RetrieveCompanyRequest): Promise<CompanyResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* Search for companies by name/keywords
|
|
12
|
+
*/
|
|
13
|
+
search({ accountId, keywords, limit, }: SearchCompanyRequest): Promise<CompanySearchResponse>;
|
|
10
14
|
}
|
|
11
15
|
//# sourceMappingURL=companyService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companyService.d.ts","sourceRoot":"","sources":["../../src/services/companyService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,
|
|
1
|
+
{"version":3,"file":"companyService.d.ts","sourceRoot":"","sources":["../../src/services/companyService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAG3B,qBAAa,cAAe,SAAQ,WAAW;gBACjC,MAAM,EAAE,UAAU,EAAE,gBAAgB,CAAC,EAAE,MAAM;IAIzD;;OAEG;IACG,QAAQ,CAAC,EACb,SAAS,EACT,SAAS,EACT,UAAU,GACX,EAAE,sBAAsB,GAAG,OAAO,CAAC,eAAe,CAAC;IAoBpD;;OAEG;IACG,MAAM,CAAC,EACX,SAAS,EACT,QAAQ,EACR,KAAS,GACV,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAgBzD"}
|
|
@@ -22,5 +22,21 @@ export class CompanyService extends BaseService {
|
|
|
22
22
|
});
|
|
23
23
|
return this.client.get(url);
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Search for companies by name/keywords
|
|
27
|
+
*/
|
|
28
|
+
async search({ accountId, keywords, limit = 5, }) {
|
|
29
|
+
const resolvedAccountId = this.resolveAccountId(accountId);
|
|
30
|
+
if (!keywords) {
|
|
31
|
+
throw new Error("keywords is required for company search");
|
|
32
|
+
}
|
|
33
|
+
const url = this.buildUrl("/linkedin/search/parameters", {
|
|
34
|
+
account_id: resolvedAccountId,
|
|
35
|
+
keywords,
|
|
36
|
+
type: "COMPANY",
|
|
37
|
+
limit,
|
|
38
|
+
});
|
|
39
|
+
return this.client.get(url);
|
|
40
|
+
}
|
|
25
41
|
}
|
|
26
42
|
//# sourceMappingURL=companyService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companyService.js","sourceRoot":"","sources":["../../src/services/companyService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"companyService.js","sourceRoot":"","sources":["../../src/services/companyService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAO/C,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAEpF,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC7C,YAAY,MAAkB,EAAE,gBAAyB;QACvD,KAAK,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAQ,CAAC,EACb,SAAS,EACT,SAAS,EACT,UAAU,GACa;QACvB,MAAM,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAC3D,sBAAsB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QAE9C,IAAI,EAAE,GAAG,SAAS,CAAC;QACnB,IAAI,CAAC,EAAE,IAAI,UAAU,EAAE,CAAC;YACtB,EAAE,GAAG,uBAAuB,CAAC,UAAU,CAAC,IAAI,SAAS,CAAC;QACxD,CAAC;QAED,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC3D,CAAC;QAED,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,EAAE,EAAE;YACnD,UAAU,EAAE,iBAAiB;SAC9B,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAkB,GAAG,CAAC,CAAC;IAC/C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,EACX,SAAS,EACT,QAAQ,EACR,KAAK,GAAG,CAAC,GACY;QACrB,MAAM,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAE3D,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;QAC7D,CAAC;QAED,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,6BAA6B,EAAE;YACvD,UAAU,EAAE,iBAAiB;YAC7B,QAAQ;YACR,IAAI,EAAE,SAAS;YACf,KAAK;SACN,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAwB,GAAG,CAAC,CAAC;IACrD,CAAC;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpClient } from "../client/index.js";
|
|
2
2
|
import { BaseService } from "./baseService.js";
|
|
3
|
-
import { RetrieveProfileRequest, EditProfileRequest, AddExperienceRequest, ProfileResponse } from "../types/index.js";
|
|
3
|
+
import { RetrieveProfileRequest, EditProfileRequest, AddExperienceRequest, EditExperienceRequest, ProfileResponse } from "../types/index.js";
|
|
4
4
|
export declare class ProfileService extends BaseService {
|
|
5
5
|
constructor(client: HttpClient, defaultAccountId?: string);
|
|
6
6
|
/**
|
|
@@ -15,6 +15,10 @@ export declare class ProfileService extends BaseService {
|
|
|
15
15
|
* Add a work experience position to the profile
|
|
16
16
|
*/
|
|
17
17
|
addExperience({ accountId, experience, }: AddExperienceRequest): Promise<ProfileResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* Edit an existing work experience position
|
|
20
|
+
*/
|
|
21
|
+
editExperience({ accountId, experienceId, experience, }: EditExperienceRequest): Promise<ProfileResponse>;
|
|
18
22
|
private buildExperienceFormData;
|
|
19
23
|
}
|
|
20
24
|
//# sourceMappingURL=profileService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profileService.d.ts","sourceRoot":"","sources":["../../src/services/profileService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAQ3B,qBAAa,cAAe,SAAQ,WAAW;gBACjC,MAAM,EAAE,UAAU,EAAE,gBAAgB,CAAC,EAAE,MAAM;IAIzD;;OAEG;IACG,QAAQ,CAAC,EACb,SAAS,EACT,SAAS,EACT,gBAAqB,EACrB,MAAc,GACf,EAAE,sBAAsB,GAAG,OAAO,CAAC,eAAe,CAAC;IAgBpD;;OAEG;IACG,IAAI,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC;IAapF;;OAEG;IACG,aAAa,CAAC,EAClB,SAAS,EACT,UAAU,GACX,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC;IAalD,OAAO,CAAC,uBAAuB;
|
|
1
|
+
{"version":3,"file":"profileService.d.ts","sourceRoot":"","sources":["../../src/services/profileService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAQ3B,qBAAa,cAAe,SAAQ,WAAW;gBACjC,MAAM,EAAE,UAAU,EAAE,gBAAgB,CAAC,EAAE,MAAM;IAIzD;;OAEG;IACG,QAAQ,CAAC,EACb,SAAS,EACT,SAAS,EACT,gBAAqB,EACrB,MAAc,GACf,EAAE,sBAAsB,GAAG,OAAO,CAAC,eAAe,CAAC;IAgBpD;;OAEG;IACG,IAAI,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC;IAapF;;OAEG;IACG,aAAa,CAAC,EAClB,SAAS,EACT,UAAU,GACX,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC;IAalD;;OAEG;IACG,cAAc,CAAC,EACnB,SAAS,EACT,YAAY,EACZ,UAAU,GACX,EAAE,qBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC;IAgBnD,OAAO,CAAC,uBAAuB;CAwEhC"}
|
|
@@ -44,12 +44,34 @@ export class ProfileService extends BaseService {
|
|
|
44
44
|
const formData = this.buildExperienceFormData(resolvedAccountId, experience);
|
|
45
45
|
return this.client.patchFormData(url, formData);
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Edit an existing work experience position
|
|
49
|
+
*/
|
|
50
|
+
async editExperience({ accountId, experienceId, experience, }) {
|
|
51
|
+
const resolvedAccountId = this.resolveAccountId(accountId);
|
|
52
|
+
if (!experienceId) {
|
|
53
|
+
throw new Error("experienceId is required");
|
|
54
|
+
}
|
|
55
|
+
const url = this.buildUrl("/users/me/edit", {
|
|
56
|
+
account_id: resolvedAccountId,
|
|
57
|
+
});
|
|
58
|
+
const formData = this.buildExperienceFormData(resolvedAccountId, experience, experienceId);
|
|
59
|
+
return this.client.patchFormData(url, formData);
|
|
60
|
+
}
|
|
61
|
+
buildExperienceFormData(accountId, experience, experienceId) {
|
|
48
62
|
const formData = new FormData();
|
|
49
63
|
formData.append("type", "LINKEDIN");
|
|
50
64
|
formData.append("account_id", accountId);
|
|
51
|
-
|
|
52
|
-
|
|
65
|
+
// If editing, include the experience ID
|
|
66
|
+
if (experienceId) {
|
|
67
|
+
formData.append("experience[id]", experienceId);
|
|
68
|
+
}
|
|
69
|
+
if (experience.role) {
|
|
70
|
+
formData.append("experience[role]", experience.role);
|
|
71
|
+
}
|
|
72
|
+
if (experience.company) {
|
|
73
|
+
formData.append("experience[company]", experience.company);
|
|
74
|
+
}
|
|
53
75
|
if (experience.company_id) {
|
|
54
76
|
formData.append("company_id", experience.company_id);
|
|
55
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profileService.js","sourceRoot":"","sources":["../../src/services/profileService.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"profileService.js","sourceRoot":"","sources":["../../src/services/profileService.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAQ/C,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC7C,YAAY,MAAkB,EAAE,gBAAyB;QACvD,KAAK,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAQ,CAAC,EACb,SAAS,EACT,SAAS,EACT,gBAAgB,GAAG,EAAE,EACrB,MAAM,GAAG,KAAK,GACS;QACvB,MAAM,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAC3D,iBAAiB,CAAC,SAAS,CAAC,CAAC;QAE7B,IAAI,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,SAAS,EAAE,EAAE;YAC7C,UAAU,EAAE,iBAAiB;YAC7B,MAAM;SACP,CAAC,CAAC;QAEH,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAChC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.ts
CHANGED
|
@@ -3,9 +3,35 @@ export interface RetrieveCompanyRequest extends AccountIdParam {
|
|
|
3
3
|
companyId?: string;
|
|
4
4
|
companyUrl?: string;
|
|
5
5
|
}
|
|
6
|
+
export interface SearchCompanyRequest extends AccountIdParam {
|
|
7
|
+
keywords: string;
|
|
8
|
+
limit?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface CompanySearchResult {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
linkedin_url?: string;
|
|
14
|
+
logo_url?: string;
|
|
15
|
+
industry?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface CompanySearchResponse {
|
|
18
|
+
object: string;
|
|
19
|
+
items: CompanySearchResult[];
|
|
20
|
+
}
|
|
6
21
|
export interface CompanyResponse {
|
|
7
22
|
object: string;
|
|
8
23
|
id: string;
|
|
9
24
|
name?: string;
|
|
25
|
+
industry?: string;
|
|
26
|
+
company_size?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
linkedin_url?: string;
|
|
29
|
+
website?: string;
|
|
30
|
+
locations?: Array<{
|
|
31
|
+
id?: string;
|
|
32
|
+
city?: string;
|
|
33
|
+
country?: string;
|
|
34
|
+
name?: string;
|
|
35
|
+
}>;
|
|
10
36
|
}
|
|
11
37
|
//# sourceMappingURL=company.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"company.d.ts","sourceRoot":"","sources":["../../src/types/company.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"company.d.ts","sourceRoot":"","sources":["../../src/types/company.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,mBAAmB,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,KAAK,CAAC;QAChB,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC,CAAC;CACJ"}
|
package/dist/types/profile.d.ts
CHANGED
|
@@ -37,10 +37,34 @@ export interface ExperienceData {
|
|
|
37
37
|
export interface AddExperienceRequest extends AccountIdParam {
|
|
38
38
|
experience: ExperienceData;
|
|
39
39
|
}
|
|
40
|
+
export interface EditExperienceRequest extends AccountIdParam {
|
|
41
|
+
experienceId: string;
|
|
42
|
+
experience: Partial<ExperienceData>;
|
|
43
|
+
}
|
|
40
44
|
export interface ProfileResponse {
|
|
41
45
|
object: string;
|
|
42
46
|
id: string;
|
|
43
47
|
name?: string;
|
|
44
48
|
headline?: string;
|
|
49
|
+
occupation?: string;
|
|
50
|
+
about?: string;
|
|
51
|
+
work_experience?: WorkExperience[];
|
|
52
|
+
work_experience_total_count?: number;
|
|
53
|
+
public_identifier?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface WorkExperience {
|
|
56
|
+
id?: string;
|
|
57
|
+
title?: string;
|
|
58
|
+
company_name?: string;
|
|
59
|
+
company_id?: string;
|
|
60
|
+
description?: string;
|
|
61
|
+
start_date?: {
|
|
62
|
+
month?: number;
|
|
63
|
+
year?: number;
|
|
64
|
+
};
|
|
65
|
+
end_date?: {
|
|
66
|
+
month?: number;
|
|
67
|
+
year?: number;
|
|
68
|
+
};
|
|
45
69
|
}
|
|
46
70
|
//# sourceMappingURL=profile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/types/profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAC5D,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE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AAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;IACnC,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/C,QAAQ,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9C"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
type QueryParams = Record<string, string | number | boolean | undefined>;
|
|
2
2
|
/**
|
|
3
3
|
* Builds a URL with query parameters, filtering out undefined values
|
|
4
|
+
* Properly joins baseUrl path with the given path
|
|
4
5
|
*/
|
|
5
6
|
export declare function buildUrl(baseUrl: string, path: string, params?: QueryParams): string;
|
|
6
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlBuilder.d.ts","sourceRoot":"","sources":["../../src/utils/urlBuilder.ts"],"names":[],"mappings":"AAAA,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;AAEzE
|
|
1
|
+
{"version":3,"file":"urlBuilder.d.ts","sourceRoot":"","sources":["../../src/utils/urlBuilder.ts"],"names":[],"mappings":"AAAA,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;AAEzE;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,WAAgB,GAAG,MAAM,CAiBxF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAQpF"}
|
package/dist/utils/urlBuilder.js
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Builds a URL with query parameters, filtering out undefined values
|
|
3
|
+
* Properly joins baseUrl path with the given path
|
|
3
4
|
*/
|
|
4
5
|
export function buildUrl(baseUrl, path, params = {}) {
|
|
5
|
-
|
|
6
|
+
// Parse the base URL to get its components
|
|
7
|
+
const base = new URL(baseUrl);
|
|
8
|
+
// Join the base path with the new path (remove leading slash from path if base has trailing content)
|
|
9
|
+
const basePath = base.pathname.endsWith('/') ? base.pathname.slice(0, -1) : base.pathname;
|
|
10
|
+
const newPath = path.startsWith('/') ? path : `/${path}`;
|
|
11
|
+
base.pathname = basePath + newPath;
|
|
12
|
+
// Add query parameters
|
|
6
13
|
for (const [key, value] of Object.entries(params)) {
|
|
7
14
|
if (value !== undefined && value !== "") {
|
|
8
|
-
|
|
15
|
+
base.searchParams.append(key, String(value));
|
|
9
16
|
}
|
|
10
17
|
}
|
|
11
|
-
return
|
|
18
|
+
return base.toString();
|
|
12
19
|
}
|
|
13
20
|
/**
|
|
14
21
|
* Appends array values as repeated query parameters
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlBuilder.js","sourceRoot":"","s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AC3B,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;AAC3B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { HttpClient } from "../client/index.js";
|
|
2
2
|
import { BaseService } from "./baseService.js";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
RetrieveCompanyRequest,
|
|
5
|
+
SearchCompanyRequest,
|
|
6
|
+
CompanyResponse,
|
|
7
|
+
CompanySearchResponse,
|
|
8
|
+
} from "../types/index.js";
|
|
4
9
|
import { validateCompanyIdOrUrl, extractCompanyIdFromUrl } from "../utils/index.js";
|
|
5
10
|
|
|
6
11
|
export class CompanyService extends BaseService {
|
|
@@ -34,4 +39,28 @@ export class CompanyService extends BaseService {
|
|
|
34
39
|
|
|
35
40
|
return this.client.get<CompanyResponse>(url);
|
|
36
41
|
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Search for companies by name/keywords
|
|
45
|
+
*/
|
|
46
|
+
async search({
|
|
47
|
+
accountId,
|
|
48
|
+
keywords,
|
|
49
|
+
limit = 5,
|
|
50
|
+
}: SearchCompanyRequest): Promise<CompanySearchResponse> {
|
|
51
|
+
const resolvedAccountId = this.resolveAccountId(accountId);
|
|
52
|
+
|
|
53
|
+
if (!keywords) {
|
|
54
|
+
throw new Error("keywords is required for company search");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const url = this.buildUrl("/linkedin/search/parameters", {
|
|
58
|
+
account_id: resolvedAccountId,
|
|
59
|
+
keywords,
|
|
60
|
+
type: "COMPANY",
|
|
61
|
+
limit,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
return this.client.get<CompanySearchResponse>(url);
|
|
65
|
+
}
|
|
37
66
|
}
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
RetrieveProfileRequest,
|
|
6
6
|
EditProfileRequest,
|
|
7
7
|
AddExperienceRequest,
|
|
8
|
+
EditExperienceRequest,
|
|
8
9
|
ProfileResponse,
|
|
9
10
|
} from "../types/index.js";
|
|
10
11
|
import {
|
|
@@ -78,16 +79,50 @@ export class ProfileService extends BaseService {
|
|
|
78
79
|
return this.client.patchFormData<ProfileResponse>(url, formData);
|
|
79
80
|
}
|
|
80
81
|
|
|
82
|
+
/**
|
|
83
|
+
* Edit an existing work experience position
|
|
84
|
+
*/
|
|
85
|
+
async editExperience({
|
|
86
|
+
accountId,
|
|
87
|
+
experienceId,
|
|
88
|
+
experience,
|
|
89
|
+
}: EditExperienceRequest): Promise<ProfileResponse> {
|
|
90
|
+
const resolvedAccountId = this.resolveAccountId(accountId);
|
|
91
|
+
|
|
92
|
+
if (!experienceId) {
|
|
93
|
+
throw new Error("experienceId is required");
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const url = this.buildUrl("/users/me/edit", {
|
|
97
|
+
account_id: resolvedAccountId,
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
const formData = this.buildExperienceFormData(resolvedAccountId, experience, experienceId);
|
|
101
|
+
|
|
102
|
+
return this.client.patchFormData<ProfileResponse>(url, formData);
|
|
103
|
+
}
|
|
104
|
+
|
|
81
105
|
private buildExperienceFormData(
|
|
82
106
|
accountId: string,
|
|
83
|
-
experience: AddExperienceRequest["experience"]
|
|
107
|
+
experience: AddExperienceRequest["experience"] | EditExperienceRequest["experience"],
|
|
108
|
+
experienceId?: string
|
|
84
109
|
): FormData {
|
|
85
110
|
const formData = new FormData();
|
|
86
111
|
|
|
87
112
|
formData.append("type", "LINKEDIN");
|
|
88
113
|
formData.append("account_id", accountId);
|
|
89
|
-
|
|
90
|
-
|
|
114
|
+
|
|
115
|
+
// If editing, include the experience ID
|
|
116
|
+
if (experienceId) {
|
|
117
|
+
formData.append("experience[id]", experienceId);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (experience.role) {
|
|
121
|
+
formData.append("experience[role]", experience.role);
|
|
122
|
+
}
|
|
123
|
+
if (experience.company) {
|
|
124
|
+
formData.append("experience[company]", experience.company);
|
|
125
|
+
}
|
|
91
126
|
|
|
92
127
|
if (experience.company_id) {
|
|
93
128
|
formData.append("company_id", experience.company_id);
|
package/src/types/company.ts
CHANGED
|
@@ -5,9 +5,37 @@ export interface RetrieveCompanyRequest extends AccountIdParam {
|
|
|
5
5
|
companyUrl?: string;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
export interface SearchCompanyRequest extends AccountIdParam {
|
|
9
|
+
keywords: string;
|
|
10
|
+
limit?: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface CompanySearchResult {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
linkedin_url?: string;
|
|
17
|
+
logo_url?: string;
|
|
18
|
+
industry?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface CompanySearchResponse {
|
|
22
|
+
object: string;
|
|
23
|
+
items: CompanySearchResult[];
|
|
24
|
+
}
|
|
25
|
+
|
|
8
26
|
export interface CompanyResponse {
|
|
9
27
|
object: string;
|
|
10
28
|
id: string;
|
|
11
29
|
name?: string;
|
|
12
|
-
|
|
30
|
+
industry?: string;
|
|
31
|
+
company_size?: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
linkedin_url?: string;
|
|
34
|
+
website?: string;
|
|
35
|
+
locations?: Array<{
|
|
36
|
+
id?: string;
|
|
37
|
+
city?: string;
|
|
38
|
+
country?: string;
|
|
39
|
+
name?: string;
|
|
40
|
+
}>;
|
|
13
41
|
}
|
package/src/types/profile.ts
CHANGED
|
@@ -41,10 +41,29 @@ export interface AddExperienceRequest extends AccountIdParam {
|
|
|
41
41
|
experience: ExperienceData;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
export interface EditExperienceRequest extends AccountIdParam {
|
|
45
|
+
experienceId: string;
|
|
46
|
+
experience: Partial<ExperienceData>;
|
|
47
|
+
}
|
|
48
|
+
|
|
44
49
|
export interface ProfileResponse {
|
|
45
50
|
object: string;
|
|
46
51
|
id: string;
|
|
47
52
|
name?: string;
|
|
48
53
|
headline?: string;
|
|
49
|
-
|
|
54
|
+
occupation?: string;
|
|
55
|
+
about?: string;
|
|
56
|
+
work_experience?: WorkExperience[];
|
|
57
|
+
work_experience_total_count?: number;
|
|
58
|
+
public_identifier?: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface WorkExperience {
|
|
62
|
+
id?: string;
|
|
63
|
+
title?: string;
|
|
64
|
+
company_name?: string;
|
|
65
|
+
company_id?: string;
|
|
66
|
+
description?: string;
|
|
67
|
+
start_date?: { month?: number; year?: number };
|
|
68
|
+
end_date?: { month?: number; year?: number };
|
|
50
69
|
}
|
package/src/utils/urlBuilder.ts
CHANGED
|
@@ -2,17 +2,25 @@ type QueryParams = Record<string, string | number | boolean | undefined>;
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Builds a URL with query parameters, filtering out undefined values
|
|
5
|
+
* Properly joins baseUrl path with the given path
|
|
5
6
|
*/
|
|
6
7
|
export function buildUrl(baseUrl: string, path: string, params: QueryParams = {}): string {
|
|
7
|
-
|
|
8
|
+
// Parse the base URL to get its components
|
|
9
|
+
const base = new URL(baseUrl);
|
|
8
10
|
|
|
11
|
+
// Join the base path with the new path (remove leading slash from path if base has trailing content)
|
|
12
|
+
const basePath = base.pathname.endsWith('/') ? base.pathname.slice(0, -1) : base.pathname;
|
|
13
|
+
const newPath = path.startsWith('/') ? path : `/${path}`;
|
|
14
|
+
base.pathname = basePath + newPath;
|
|
15
|
+
|
|
16
|
+
// Add query parameters
|
|
9
17
|
for (const [key, value] of Object.entries(params)) {
|
|
10
18
|
if (value !== undefined && value !== "") {
|
|
11
|
-
|
|
19
|
+
base.searchParams.append(key, String(value));
|
|
12
20
|
}
|
|
13
21
|
}
|
|
14
22
|
|
|
15
|
-
return
|
|
23
|
+
return base.toString();
|
|
16
24
|
}
|
|
17
25
|
|
|
18
26
|
/**
|