linkedin-secret-sauce 0.3.8 → 0.3.9
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/linkedin-api.js +8 -1
- package/dist/types.d.ts +3 -0
- package/package.json +1 -1
package/dist/linkedin-api.js
CHANGED
|
@@ -204,8 +204,15 @@ async function searchSalesLeads(keywords, options) {
|
|
|
204
204
|
const pagingVal = rrec && 'paging' in rrec ? rrec.paging : undefined;
|
|
205
205
|
const p = (pagingVal && typeof pagingVal === 'object') ? pagingVal : undefined;
|
|
206
206
|
const paging = p ?? { start, count };
|
|
207
|
+
// Extract metadata.totalDisplayCount (LinkedIn's display string like "500K+")
|
|
208
|
+
const metadataVal = rrec && 'metadata' in rrec ? rrec.metadata : undefined;
|
|
209
|
+
const metadata = (metadataVal && typeof metadataVal === 'object') ? metadataVal : undefined;
|
|
207
210
|
const result = options
|
|
208
|
-
? {
|
|
211
|
+
? {
|
|
212
|
+
items,
|
|
213
|
+
page: { start: Number(paging.start ?? start), count: Number(paging.count ?? count), total: paging?.total },
|
|
214
|
+
metadata: metadata?.totalDisplayCount ? { totalDisplayCount: metadata.totalDisplayCount } : undefined
|
|
215
|
+
}
|
|
209
216
|
: items; // backward-compat: old tests expect an array when no options passed
|
|
210
217
|
searchCache.set(cacheKey, { data: result, ts: Date.now() });
|
|
211
218
|
(0, metrics_1.incrementMetric)('searchCacheMisses');
|
package/dist/types.d.ts
CHANGED