linkedin-secret-sauce 0.3.22 → 0.3.23
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/utils/search-encoder.js +14 -3
- package/package.json +1 -1
|
@@ -135,7 +135,7 @@ function buildLeadSearchQuery(keywords, filters) {
|
|
|
135
135
|
// If not URN or numeric, assume it's already a URN (pass through)
|
|
136
136
|
urn = idStr;
|
|
137
137
|
}
|
|
138
|
-
return valObj([`id:${urn}`, 'selectionType:INCLUDED']);
|
|
138
|
+
return valObj([`id:${encodeURIComponent(urn)}`, 'selectionType:INCLUDED']);
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
const curCompanies = encodeCompanies(filters?.company?.current?.include);
|
|
@@ -171,6 +171,17 @@ function buildLeadSearchQuery(keywords, filters) {
|
|
|
171
171
|
if (yr?.years_experience_ids?.length) {
|
|
172
172
|
pushFilter(f, 'YEARS_OF_EXPERIENCE', yr.years_experience_ids.map((id) => valObj([`id:${id}`, 'selectionType:INCLUDED'])));
|
|
173
173
|
}
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
// Build query with minimal format for maximum compatibility
|
|
175
|
+
// LinkedIn rejects spellCorrectionEnabled:true,keywords: with 400 errors
|
|
176
|
+
const parts = [];
|
|
177
|
+
// Only include keywords if non-empty
|
|
178
|
+
if (encodedKw) {
|
|
179
|
+
parts.push(`keywords:${encodedKw}`);
|
|
180
|
+
}
|
|
181
|
+
// Add filters if present
|
|
182
|
+
if (f.length) {
|
|
183
|
+
parts.push(`filters:${list(f)}`);
|
|
184
|
+
}
|
|
185
|
+
// Return minimal format - no spellCorrectionEnabled wrapper
|
|
186
|
+
return parts.length > 0 ? `(${parts.join(',')})` : '()';
|
|
176
187
|
}
|