@entergreat/unipile-wrapper 1.0.3 → 1.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@entergreat/unipile-wrapper",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -85,7 +85,35 @@ export default class LinkedinService {
85
85
 
86
86
  const url = `${
87
87
  this.unipileUrl
88
- }/linkedin/search?account_id=${accountId}&keywords=${keywords}&type=${type.toUpperCase()}&limit=${limit}`;
88
+ }/linkedin/search/parameters?account_id=${accountId}&keywords=${keywords}&type=${type.toUpperCase()}&limit=${limit}`;
89
+
90
+ return await get(url, this.headers);
91
+ } catch (error) {
92
+ throw error;
93
+ }
94
+ }
95
+
96
+ // retrieve LinkedIn profile
97
+ async retrieveProfile({
98
+ accountId,
99
+ profileId,
100
+ linkedinSections = [],
101
+ notify = false,
102
+ }) {
103
+ try {
104
+ if (!accountId) {
105
+ throw "account_id must be provided";
106
+ }
107
+
108
+ if (!profileId) {
109
+ throw "profile_id must be provided";
110
+ }
111
+
112
+ let url = `${this.unipileUrl}/users/${profileId}?account_id=${accountId}&notify=${notify}`;
113
+
114
+ for (const linkedinSection of linkedinSections) {
115
+ url += `&linkedin_sections=${linkedinSection}`;
116
+ }
89
117
 
90
118
  return await get(url, this.headers);
91
119
  } catch (error) {