linkedin-secret-sauce 0.3.25 → 0.3.27

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.
@@ -289,10 +289,18 @@ async function searchSalesLeads(keywords, options) {
289
289
  // Extract metadata.totalDisplayCount (LinkedIn's display string like "500K+")
290
290
  const metadataVal = rrec && 'metadata' in rrec ? rrec.metadata : undefined;
291
291
  const metadata = (metadataVal && typeof metadataVal === 'object') ? metadataVal : undefined;
292
+ // Calculate hasMore using LinkedIn's total count (primary) or result length (fallback)
293
+ // LinkedIn API always returns paging.total, so we use it for accurate pagination
294
+ const hasMore = paging?.total ? (start + count) < paging.total : items.length === count;
292
295
  const result = options
293
296
  ? {
294
297
  items,
295
- page: { start: Number(paging.start ?? start), count: Number(paging.count ?? count), total: paging?.total },
298
+ page: {
299
+ start: Number(paging.start ?? start),
300
+ count: Number(paging.count ?? count),
301
+ total: paging?.total,
302
+ hasMore
303
+ },
296
304
  metadata: metadata?.totalDisplayCount ? { totalDisplayCount: metadata.totalDisplayCount } : undefined,
297
305
  _meta: { sessionId } // Return sessionId to consumer
298
306
  }
package/dist/types.d.ts CHANGED
@@ -153,6 +153,7 @@ export interface SearchSalesResult {
153
153
  start: number;
154
154
  count: number;
155
155
  total?: number;
156
+ hasMore?: boolean;
156
157
  };
157
158
  metadata?: {
158
159
  totalDisplayCount?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linkedin-secret-sauce",
3
- "version": "0.3.25",
3
+ "version": "0.3.27",
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",
@@ -10,20 +10,6 @@
10
10
  "publishConfig": {
11
11
  "registry": "https://registry.npmjs.org/"
12
12
  },
13
- "scripts": {
14
- "dev:playground": "pnpm -C apps/playground dev",
15
- "search": "node scripts/rg-fast.mjs",
16
- "rg:fast": "node scripts/rg-fast.mjs",
17
- "build": "tsc -p tsconfig.json",
18
- "lint": "eslint \"src/**/*.ts\" --max-warnings=0",
19
- "lint:fix": "eslint \"src/**/*.ts\" --fix",
20
- "dev": "tsc -w -p tsconfig.json",
21
- "test": "vitest run",
22
- "prepublishOnly": "npm run build",
23
- "release:patch": "npm version patch && git push --follow-tags",
24
- "release:minor": "npm version minor && git push --follow-tags",
25
- "release:major": "npm version major && git push --follow-tags"
26
- },
27
13
  "keywords": [
28
14
  "linkedin",
29
15
  "sales-navigator",
@@ -53,5 +39,18 @@
53
39
  "husky": "^9.0.11",
54
40
  "typescript": "^5.9.3",
55
41
  "vitest": "^1.6.0"
42
+ },
43
+ "scripts": {
44
+ "dev:playground": "pnpm -C apps/playground dev",
45
+ "search": "node scripts/rg-fast.mjs",
46
+ "rg:fast": "node scripts/rg-fast.mjs",
47
+ "build": "tsc -p tsconfig.json",
48
+ "lint": "eslint \"src/**/*.ts\" --max-warnings=0",
49
+ "lint:fix": "eslint \"src/**/*.ts\" --fix",
50
+ "dev": "tsc -w -p tsconfig.json",
51
+ "test": "vitest run",
52
+ "release:patch": "npm version patch && git push --follow-tags",
53
+ "release:minor": "npm version minor && git push --follow-tags",
54
+ "release:major": "npm version major && git push --follow-tags"
56
55
  }
57
- }
56
+ }