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.
@@ -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
- ? { items, page: { start: Number(paging.start ?? start), count: Number(paging.count ?? count), total: paging?.total } }
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
@@ -141,6 +141,9 @@ export interface SearchSalesResult {
141
141
  count: number;
142
142
  total?: number;
143
143
  };
144
+ metadata?: {
145
+ totalDisplayCount?: string;
146
+ };
144
147
  }
145
148
  export interface Company {
146
149
  companyId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linkedin-secret-sauce",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "description": "Private LinkedIn Sales Navigator client with automatic cookie management",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",