linkedin-secret-sauce 0.3.4 → 0.3.6

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/README.md CHANGED
@@ -1,228 +1,228 @@
1
- # LinkedIn Secret Sauce Client
2
-
3
- Private, server-side LinkedIn Sales Navigator client. It manages cookies/accounts, retries, caching, and parsing so your app calls a small, typed API.
4
-
5
- For a step‑by‑step integration guide you can copy/paste into other apps, see `docs/INTEGRATION.md`.
6
-
7
- Advanced lead search
8
- - Strongly‑typed filters: see `docs/SALES_SEARCH.md` (seniority, titles with id or text, functions, industries, languages, regions, company headcount/type, years buckets, current company).
9
- - Relationship filters are intentionally not used (results are customer‑agnostic).
10
- - Past company is not emitted — only CURRENT_COMPANY is supported.
11
- - Power users: pass a full `rawQuery` string to `searchSalesLeads` if you already have the Sales Navigator `query=(...)` payload.
12
-
13
- - Node: >= 18 (uses global `fetch`)
14
- - Build: `pnpm build`
15
- - Test: `pnpm test`
16
-
17
- ## Install
18
-
19
- ```bash
20
- # pnpm (recommended)
21
- pnpm add linkedin-secret-sauce
22
-
23
- # npm
24
- npm install linkedin-secret-sauce
25
- ```
26
-
27
- ## Quick Start
28
-
29
- ```ts
30
- import {
31
- initializeLinkedInClient,
32
- getProfileByVanity,
33
- getProfileByUrn,
34
- searchSalesLeads,
35
- resolveCompanyUniversalName,
36
- getCompanyById,
37
- getCompanyByUrl,
38
- typeahead,
39
- getSalesNavigatorProfileDetails,
40
- type LinkedInProfile,
41
- type SearchSalesResult,
42
- type Company,
43
- type TypeaheadResult,
44
- type SalesNavigatorProfile,
45
- } from 'linkedin-secret-sauce';
46
-
47
- initializeLinkedInClient({
48
- cosiallApiUrl: process.env.COSIALL_API_URL!,
49
- cosiallApiKey: process.env.COSIALL_API_KEY!,
50
- proxyString: process.env.LINKEDIN_PROXY_STRING, // optional
51
- logLevel: (process.env.LOG_LEVEL as any) || 'info',
52
- });
53
-
54
- const prof: LinkedInProfile = await getProfileByVanity('john-doe');
55
- const prof2 = await getProfileByUrn('urn:li:fsd_profile:ACwAAAbCdEf'); // URN or bare key
56
-
57
- // Search with paging; on HTTP 400, decoration -14 falls back to -17
58
- const leads: SearchSalesResult = await searchSalesLeads('cto fintech', { start: 50, count: 10 });
59
-
60
- // Companies
61
- const { companyId } = await resolveCompanyUniversalName('microsoft');
62
- const company: Company = await getCompanyById(companyId!);
63
- const sameCompany = await getCompanyByUrl('https://www.linkedin.com/company/microsoft/');
64
-
65
- // Typeahead (facet suggestions)
66
- const ta: TypeaheadResult = await typeahead({ type: 'BING_GEO', query: 'new', start: 0, count: 10 });
67
-
68
- // Sales Navigator profile details
69
- const sales: SalesNavigatorProfile = await getSalesNavigatorProfileDetails('urn:li:fs_salesProfile:ACwAAA...');
70
- ```
71
-
72
- ## Environment & Config
73
-
74
- Required
75
- - `COSIALL_API_URL` – base URL of your Cosiall service (e.g., https://cosiall.example)
76
- - `COSIALL_API_KEY` – API key for the Cosiall endpoint
77
-
78
- Optional
79
- - `LINKEDIN_PROXY_STRING` – `host:port` or `host:port:user:pass`
80
- - `LOG_LEVEL` – `debug` | `info` | `warn` | `error` (default `info`)
81
-
82
- Config defaults (override in code as needed)
83
- - `profileCacheTtl`: 900_000 ms (15m)
84
- - `searchCacheTtl`: 180_000 ms (3m)
85
- - `companyCacheTtl`: 600_000 ms (10m)
86
- - `typeaheadCacheTtl`: 3_600_000 ms (1h)
87
- - `cookieRefreshInterval`: 900_000 ms (15m)
88
- - `cookieFreshnessWindow`: 86_400_000 ms (24h)
89
- - `maxRetries`: 2 (5xx retry on same account)
90
- - `retryDelayMs`: 700 ms
91
- - `accountCooldownMs`: 5_000 ms
92
- - `maxFailuresBeforeCooldown`: 3
93
- - `maxRequestHistory`: 500
94
-
95
- ## Public API (overview)
96
-
97
- - Profiles
98
- - `getProfileByVanity(vanity)` – cached 15m, in‑flight de‑dupe per key.
99
- - `getProfileByUrn(keyOrUrn)` – accepts `ACwAA...` or URNs; normalizes to key.
100
- - `getProfilesBatch(vanities, concurrency)` – returns array aligned to inputs; `null` for failures.
101
-
102
- - Search
103
- - `searchSalesLeads(keywords, { start, count, decorationId })` – when options are provided returns `{ items, page }`; on HTTP 400 with `-14` decoration automatically retries with `-17`.
104
-
105
- - Companies
106
- - `resolveCompanyUniversalName(universalName)` → `{ companyId? }` (404 → NOT_FOUND)
107
- - `getCompanyById(companyId)` → `Company` (10m cache)
108
- - `getCompanyByUrl(url)` – parses numeric id or slug, then fetches
109
-
110
- - Typeahead
111
- - `typeahead({ type, query, start, count })` → `TypeaheadResult` (1h cache)
112
-
113
- - Sales Navigator profile
114
- - `getSalesNavigatorProfileDetails(idOrUrn)` → `SalesNavigatorProfile` (404 → NOT_FOUND)
115
-
116
- ## Errors
117
-
118
- All errors are `LinkedInClientError` with fields `{ code, status?, accountId? }`.
119
-
120
- Error codes (non‑exhaustive)
121
- - `NOT_INITIALIZED`, `NO_ACCOUNTS`, `NO_VALID_ACCOUNTS`
122
- - `MISSING_CSRF`, `REQUEST_FAILED`, `ALL_ACCOUNTS_FAILED`, `PARSE_ERROR`
123
- - `INVALID_INPUT`, `NOT_FOUND`, `AUTH_ERROR`, `RATE_LIMITED`
124
-
125
- ## Caching, Metrics, Proxy
126
-
127
- - Per‑process in‑memory caches with TTLs listed above. Expired entries are evicted on access.
128
- - In‑flight de‑dupe for `getProfileByVanity`.
129
- - HTTP client rotates accounts on 401/403/429 and retries 5xx on same account (`maxRetries`).
130
- - Metrics snapshot: `import { getSnapshot }` for counters (requests, retries, cache hits, etc.).
131
- - Request history: `import { getRequestHistory, clearRequestHistory }` for a bounded in‑memory log.
132
- - Proxy: set `proxyString` in config (formats `host:port` or `host:port:user:pass`).
133
-
134
- ### Request History and Metrics (example)
135
-
136
- ```ts
137
- import { getRequestHistory, clearRequestHistory, getSnapshot } from 'linkedin-secret-sauce';
138
-
139
- clearRequestHistory();
140
- // ... make some API calls ...
141
- console.log(getRequestHistory()[0]);
142
- // {
143
- // timestamp: 1730000000000,
144
- // operation: 'getProfileByVanity',
145
- // selector: 'https://www.linkedin.com/voyager/api/...profiles?q=memberIdentity&memberIdentity=john-doe',
146
- // status: 200,
147
- // durationMs: 123,
148
- // accountId: 'acc1'
149
- // }
150
-
151
- console.log(getSnapshot());
152
- // {
153
- // profileFetches: 12,
154
- // profileCacheHits: 34,
155
- // inflightDedupeHits: 2,
156
- // searchCacheHits: 5,
157
- // typeaheadCacheHits: 3,
158
- // companyCacheHits: 4,
159
- // httpRetries: 3,
160
- // httpSuccess: 21,
161
- // httpFailures: 2,
162
- // companyFetches: 4,
163
- // typeaheadRequests: 5,
164
- // requestHistorySize: 42,
165
- // authErrors: 1,
166
- // ...
167
- // }
168
- ```
169
-
170
- ### Accounts Summary
171
-
172
- ```ts
173
- import { getAccountsSummary } from 'linkedin-secret-sauce';
174
-
175
- const accounts = getAccountsSummary();
176
- // [
177
- // {
178
- // accountId: 'acc1',
179
- // healthy: false,
180
- // failures: 1,
181
- // cooldownUntil: 1730005000000,
182
- // cooldownRemainingMs: 4200,
183
- // expiresAt: 1730010000, // epoch seconds (if provided by Cosiall)
184
- // lastUsedAt: 1730004000123
185
- // },
186
- // {
187
- // accountId: 'acc2',
188
- // healthy: true,
189
- // failures: 0,
190
- // cooldownUntil: 0,
191
- // cooldownRemainingMs: 0,
192
- // expiresAt: 1730010000,
193
- // lastUsedAt: 1730003999000
194
- // }
195
- // ]
196
- ```
197
-
198
- ## Testing
199
-
200
- ```bash
201
- pnpm test
202
- pnpm exec tsc -p tsconfig.json --noEmit
203
- ```
204
-
205
- ## Manual Publish (npm)
206
-
207
- - Pre-checks:
208
- - Working tree is clean; tests pass; `pnpm build` produced `dist/`.
209
- - `publishConfig.registry` points to `https://registry.npmjs.org/` (already set).
210
- - No repo `.npmrc` that overrides registry to GitHub Packages.
211
-
212
- - Steps (local):
213
- 1) `npm login` (once per machine; ensure correct org/user)
214
- 2) `npm whoami` (sanity check)
215
- 3) Bump version: `npm version patch|minor|major`
216
- 4) Publish: `npm publish`
217
- 5) Push tags: `git push --follow-tags`
218
-
219
- Notes:
220
- - If your npm account enforces 2FA for publish, you’ll be prompted for an OTP.
221
- - For scoped packages that should be public, add `--access public` (not needed here because the package name is unscoped).
222
- - The “Publish your first package” button on GitHub targets GitHub Packages (`npm publish --registry=https://npm.pkg.github.com/`), not npmjs.com.
223
-
224
-
1
+ # LinkedIn Secret Sauce Client
2
+
3
+ Private, server-side LinkedIn Sales Navigator client. It manages cookies/accounts, retries, caching, and parsing so your app calls a small, typed API.
4
+
5
+ For a step‑by‑step integration guide you can copy/paste into other apps, see `docs/INTEGRATION.md`.
6
+
7
+ Advanced lead search
8
+ - Strongly‑typed filters: see `docs/SALES_SEARCH.md` (seniority, titles with id or text, functions, industries, languages, regions, company headcount/type, years buckets, current company).
9
+ - Relationship filters are intentionally not used (results are customer‑agnostic).
10
+ - Past company is not emitted — only CURRENT_COMPANY is supported.
11
+ - Power users: pass a full `rawQuery` string to `searchSalesLeads` if you already have the Sales Navigator `query=(...)` payload.
12
+
13
+ - Node: >= 18 (uses global `fetch`)
14
+ - Build: `pnpm build`
15
+ - Test: `pnpm test`
16
+
17
+ ## Install
18
+
19
+ ```bash
20
+ # pnpm (recommended)
21
+ pnpm add linkedin-secret-sauce
22
+
23
+ # npm
24
+ npm install linkedin-secret-sauce
25
+ ```
26
+
27
+ ## Quick Start
28
+
29
+ ```ts
30
+ import {
31
+ initializeLinkedInClient,
32
+ getProfileByVanity,
33
+ getProfileByUrn,
34
+ searchSalesLeads,
35
+ resolveCompanyUniversalName,
36
+ getCompanyById,
37
+ getCompanyByUrl,
38
+ typeahead,
39
+ getSalesNavigatorProfileDetails,
40
+ type LinkedInProfile,
41
+ type SearchSalesResult,
42
+ type Company,
43
+ type TypeaheadResult,
44
+ type SalesNavigatorProfile,
45
+ } from 'linkedin-secret-sauce';
46
+
47
+ initializeLinkedInClient({
48
+ cosiallApiUrl: process.env.COSIALL_API_URL!,
49
+ cosiallApiKey: process.env.COSIALL_API_KEY!,
50
+ proxyString: process.env.LINKEDIN_PROXY_STRING, // optional
51
+ logLevel: (process.env.LOG_LEVEL as any) || 'info',
52
+ });
53
+
54
+ const prof: LinkedInProfile = await getProfileByVanity('john-doe');
55
+ const prof2 = await getProfileByUrn('urn:li:fsd_profile:ACwAAAbCdEf'); // URN or bare key
56
+
57
+ // Search with paging; uses LeadSearchResult-14 for complete profile data (positions, badges, etc.)
58
+ const leads: SearchSalesResult = await searchSalesLeads('cto fintech', { start: 50, count: 10 });
59
+
60
+ // Companies
61
+ const { companyId } = await resolveCompanyUniversalName('microsoft');
62
+ const company: Company = await getCompanyById(companyId!);
63
+ const sameCompany = await getCompanyByUrl('https://www.linkedin.com/company/microsoft/');
64
+
65
+ // Typeahead (facet suggestions)
66
+ const ta: TypeaheadResult = await typeahead({ type: 'BING_GEO', query: 'new', start: 0, count: 10 });
67
+
68
+ // Sales Navigator profile details
69
+ const sales: SalesNavigatorProfile = await getSalesNavigatorProfileDetails('urn:li:fs_salesProfile:ACwAAA...');
70
+ ```
71
+
72
+ ## Environment & Config
73
+
74
+ Required
75
+ - `COSIALL_API_URL` – base URL of your Cosiall service (e.g., https://cosiall.example)
76
+ - `COSIALL_API_KEY` – API key for the Cosiall endpoint
77
+
78
+ Optional
79
+ - `LINKEDIN_PROXY_STRING` – `host:port` or `host:port:user:pass`
80
+ - `LOG_LEVEL` – `debug` | `info` | `warn` | `error` (default `info`)
81
+
82
+ Config defaults (override in code as needed)
83
+ - `profileCacheTtl`: 900_000 ms (15m)
84
+ - `searchCacheTtl`: 180_000 ms (3m)
85
+ - `companyCacheTtl`: 600_000 ms (10m)
86
+ - `typeaheadCacheTtl`: 3_600_000 ms (1h)
87
+ - `cookieRefreshInterval`: 900_000 ms (15m)
88
+ - `cookieFreshnessWindow`: 86_400_000 ms (24h)
89
+ - `maxRetries`: 2 (5xx retry on same account)
90
+ - `retryDelayMs`: 700 ms
91
+ - `accountCooldownMs`: 5_000 ms
92
+ - `maxFailuresBeforeCooldown`: 3
93
+ - `maxRequestHistory`: 500
94
+
95
+ ## Public API (overview)
96
+
97
+ - Profiles
98
+ - `getProfileByVanity(vanity)` – cached 15m, in‑flight de‑dupe per key.
99
+ - `getProfileByUrn(keyOrUrn)` – accepts `ACwAA...` or URNs; normalizes to key.
100
+ - `getProfilesBatch(vanities, concurrency)` – returns array aligned to inputs; `null` for failures.
101
+
102
+ - Search
103
+ - `searchSalesLeads(keywords, { start, count, decorationId })` – when options are provided returns `{ items, page }`; uses LeadSearchResult-14 by default for complete profile data.
104
+
105
+ - Companies
106
+ - `resolveCompanyUniversalName(universalName)` → `{ companyId? }` (404 → NOT_FOUND)
107
+ - `getCompanyById(companyId)` → `Company` (10m cache)
108
+ - `getCompanyByUrl(url)` – parses numeric id or slug, then fetches
109
+
110
+ - Typeahead
111
+ - `typeahead({ type, query, start, count })` → `TypeaheadResult` (1h cache)
112
+
113
+ - Sales Navigator profile
114
+ - `getSalesNavigatorProfileDetails(idOrUrn)` → `SalesNavigatorProfile` (404 → NOT_FOUND)
115
+
116
+ ## Errors
117
+
118
+ All errors are `LinkedInClientError` with fields `{ code, status?, accountId? }`.
119
+
120
+ Error codes (non‑exhaustive)
121
+ - `NOT_INITIALIZED`, `NO_ACCOUNTS`, `NO_VALID_ACCOUNTS`
122
+ - `MISSING_CSRF`, `REQUEST_FAILED`, `ALL_ACCOUNTS_FAILED`, `PARSE_ERROR`
123
+ - `INVALID_INPUT`, `NOT_FOUND`, `AUTH_ERROR`, `RATE_LIMITED`
124
+
125
+ ## Caching, Metrics, Proxy
126
+
127
+ - Per‑process in‑memory caches with TTLs listed above. Expired entries are evicted on access.
128
+ - In‑flight de‑dupe for `getProfileByVanity`.
129
+ - HTTP client rotates accounts on 401/403/429 and retries 5xx on same account (`maxRetries`).
130
+ - Metrics snapshot: `import { getSnapshot }` for counters (requests, retries, cache hits, etc.).
131
+ - Request history: `import { getRequestHistory, clearRequestHistory }` for a bounded in‑memory log.
132
+ - Proxy: set `proxyString` in config (formats `host:port` or `host:port:user:pass`).
133
+
134
+ ### Request History and Metrics (example)
135
+
136
+ ```ts
137
+ import { getRequestHistory, clearRequestHistory, getSnapshot } from 'linkedin-secret-sauce';
138
+
139
+ clearRequestHistory();
140
+ // ... make some API calls ...
141
+ console.log(getRequestHistory()[0]);
142
+ // {
143
+ // timestamp: 1730000000000,
144
+ // operation: 'getProfileByVanity',
145
+ // selector: 'https://www.linkedin.com/voyager/api/...profiles?q=memberIdentity&memberIdentity=john-doe',
146
+ // status: 200,
147
+ // durationMs: 123,
148
+ // accountId: 'acc1'
149
+ // }
150
+
151
+ console.log(getSnapshot());
152
+ // {
153
+ // profileFetches: 12,
154
+ // profileCacheHits: 34,
155
+ // inflightDedupeHits: 2,
156
+ // searchCacheHits: 5,
157
+ // typeaheadCacheHits: 3,
158
+ // companyCacheHits: 4,
159
+ // httpRetries: 3,
160
+ // httpSuccess: 21,
161
+ // httpFailures: 2,
162
+ // companyFetches: 4,
163
+ // typeaheadRequests: 5,
164
+ // requestHistorySize: 42,
165
+ // authErrors: 1,
166
+ // ...
167
+ // }
168
+ ```
169
+
170
+ ### Accounts Summary
171
+
172
+ ```ts
173
+ import { getAccountsSummary } from 'linkedin-secret-sauce';
174
+
175
+ const accounts = getAccountsSummary();
176
+ // [
177
+ // {
178
+ // accountId: 'acc1',
179
+ // healthy: false,
180
+ // failures: 1,
181
+ // cooldownUntil: 1730005000000,
182
+ // cooldownRemainingMs: 4200,
183
+ // expiresAt: 1730010000, // epoch seconds (if provided by Cosiall)
184
+ // lastUsedAt: 1730004000123
185
+ // },
186
+ // {
187
+ // accountId: 'acc2',
188
+ // healthy: true,
189
+ // failures: 0,
190
+ // cooldownUntil: 0,
191
+ // cooldownRemainingMs: 0,
192
+ // expiresAt: 1730010000,
193
+ // lastUsedAt: 1730003999000
194
+ // }
195
+ // ]
196
+ ```
197
+
198
+ ## Testing
199
+
200
+ ```bash
201
+ pnpm test
202
+ pnpm exec tsc -p tsconfig.json --noEmit
203
+ ```
204
+
205
+ ## Manual Publish (npm)
206
+
207
+ - Pre-checks:
208
+ - Working tree is clean; tests pass; `pnpm build` produced `dist/`.
209
+ - `publishConfig.registry` points to `https://registry.npmjs.org/` (already set).
210
+ - No repo `.npmrc` that overrides registry to GitHub Packages.
211
+
212
+ - Steps (local):
213
+ 1) `npm login` (once per machine; ensure correct org/user)
214
+ 2) `npm whoami` (sanity check)
215
+ 3) Bump version: `npm version patch|minor|major`
216
+ 4) Publish: `npm publish`
217
+ 5) Push tags: `git push --follow-tags`
218
+
219
+ Notes:
220
+ - If your npm account enforces 2FA for publish, you’ll be prompted for an OTP.
221
+ - For scoped packages that should be public, add `--access public` (not needed here because the package name is unscoped).
222
+ - The “Publish your first package” button on GitHub targets GitHub Packages (`npm publish --registry=https://npm.pkg.github.com/`), not npmjs.com.
223
+
224
+
225
225
  ## Playground (React + Vite)\n\nDev-only UI to exercise the library safely via a local server.\n\n- Start both server and client: \n - pnpm dev:playground\n- Or separately: \n - pnpm -C apps/playground run server (http://localhost:5175)\n - pnpm -C apps/playground run client (http://localhost:5173)\n\nThe server initializes the library and exposes endpoints for profiles, companies, typeahead, sales search, and sales profile.\nMetrics and request history are exposed at /api/metrics and /api/history.\n\nBy default the server uses a dev stub for cookies at /api/flexiq/linkedin-cookies/all.\nTo use your Cosiall backend, set env vars: COSIALL_API_URL and COSIALL_API_KEY and remove the stub in pps/playground/server/index.ts.\n
226
- ## Playground (local UI)
227
-
228
- See `docs/PLAYGROUND.md` for usage, ports, and tips.
226
+ ## Playground (local UI)
227
+
228
+ See `docs/PLAYGROUND.md` for usage, ports, and tips.
@@ -0,0 +1,388 @@
1
+ /**
2
+ * Static filter constants for LinkedIn Sales Navigator
3
+ * These provide instant default options without requiring API calls
4
+ */
5
+ export declare const SENIORITY_OPTIONS: readonly [{
6
+ readonly id: "1";
7
+ readonly text: "Unpaid";
8
+ }, {
9
+ readonly id: "2";
10
+ readonly text: "Training";
11
+ }, {
12
+ readonly id: "3";
13
+ readonly text: "Entry level";
14
+ }, {
15
+ readonly id: "4";
16
+ readonly text: "Senior";
17
+ }, {
18
+ readonly id: "5";
19
+ readonly text: "Manager";
20
+ }, {
21
+ readonly id: "6";
22
+ readonly text: "Director";
23
+ }, {
24
+ readonly id: "7";
25
+ readonly text: "VP";
26
+ }, {
27
+ readonly id: "8";
28
+ readonly text: "CXO";
29
+ }, {
30
+ readonly id: "9";
31
+ readonly text: "Partner";
32
+ }, {
33
+ readonly id: "10";
34
+ readonly text: "Owner";
35
+ }];
36
+ export declare const YEARS_OPTIONS: readonly [{
37
+ readonly id: "1";
38
+ readonly text: "< 1 year";
39
+ }, {
40
+ readonly id: "2";
41
+ readonly text: "1-2 years";
42
+ }, {
43
+ readonly id: "3";
44
+ readonly text: "3-5 years";
45
+ }, {
46
+ readonly id: "4";
47
+ readonly text: "6-10 years";
48
+ }, {
49
+ readonly id: "5";
50
+ readonly text: "10+ years";
51
+ }];
52
+ export declare const FUNCTION_OPTIONS: readonly [{
53
+ readonly id: "1";
54
+ readonly text: "Accounting";
55
+ }, {
56
+ readonly id: "2";
57
+ readonly text: "Administrative";
58
+ }, {
59
+ readonly id: "3";
60
+ readonly text: "Arts and Design";
61
+ }, {
62
+ readonly id: "4";
63
+ readonly text: "Business Development";
64
+ }, {
65
+ readonly id: "5";
66
+ readonly text: "Community and Social Services";
67
+ }, {
68
+ readonly id: "6";
69
+ readonly text: "Consulting";
70
+ }, {
71
+ readonly id: "7";
72
+ readonly text: "Education";
73
+ }, {
74
+ readonly id: "8";
75
+ readonly text: "Engineering";
76
+ }, {
77
+ readonly id: "9";
78
+ readonly text: "Entrepreneurship";
79
+ }, {
80
+ readonly id: "10";
81
+ readonly text: "Finance";
82
+ }, {
83
+ readonly id: "11";
84
+ readonly text: "Healthcare Services";
85
+ }, {
86
+ readonly id: "12";
87
+ readonly text: "Human Resources";
88
+ }, {
89
+ readonly id: "13";
90
+ readonly text: "Information Technology";
91
+ }, {
92
+ readonly id: "14";
93
+ readonly text: "Legal";
94
+ }, {
95
+ readonly id: "15";
96
+ readonly text: "Marketing";
97
+ }, {
98
+ readonly id: "16";
99
+ readonly text: "Media and Communication";
100
+ }, {
101
+ readonly id: "17";
102
+ readonly text: "Military and Protective Services";
103
+ }, {
104
+ readonly id: "18";
105
+ readonly text: "Operations";
106
+ }, {
107
+ readonly id: "19";
108
+ readonly text: "Product Management";
109
+ }, {
110
+ readonly id: "20";
111
+ readonly text: "Program and Project Management";
112
+ }, {
113
+ readonly id: "21";
114
+ readonly text: "Purchasing";
115
+ }, {
116
+ readonly id: "22";
117
+ readonly text: "Quality Assurance";
118
+ }, {
119
+ readonly id: "23";
120
+ readonly text: "Real Estate";
121
+ }, {
122
+ readonly id: "24";
123
+ readonly text: "Research";
124
+ }, {
125
+ readonly id: "25";
126
+ readonly text: "Sales";
127
+ }, {
128
+ readonly id: "26";
129
+ readonly text: "Support";
130
+ }];
131
+ export declare const REGION_OPTIONS: readonly [{
132
+ readonly id: "102890883";
133
+ readonly text: "Oceania";
134
+ }, {
135
+ readonly id: "100506914";
136
+ readonly text: "EMEA";
137
+ }, {
138
+ readonly id: "105015875";
139
+ readonly text: "DACH";
140
+ }, {
141
+ readonly id: "102221843";
142
+ readonly text: "North America";
143
+ }, {
144
+ readonly id: "104738515";
145
+ readonly text: "South America";
146
+ }, {
147
+ readonly id: "90009706";
148
+ readonly text: "Southeast Asia";
149
+ }, {
150
+ readonly id: "102393603";
151
+ readonly text: "Asia-Pacific";
152
+ }, {
153
+ readonly id: "90000084";
154
+ readonly text: "Europe";
155
+ }, {
156
+ readonly id: "106155005";
157
+ readonly text: "Middle East";
158
+ }, {
159
+ readonly id: "103883259";
160
+ readonly text: "Latin America";
161
+ }, {
162
+ readonly id: "91000002";
163
+ readonly text: "Africa";
164
+ }, {
165
+ readonly id: "102095887";
166
+ readonly text: "Caribbean";
167
+ }, {
168
+ readonly id: "90009790";
169
+ readonly text: "Central Asia";
170
+ }];
171
+ export declare const LANGUAGE_OPTIONS: readonly [{
172
+ readonly id: "ar";
173
+ readonly text: "Arabic";
174
+ }, {
175
+ readonly id: "zh";
176
+ readonly text: "Chinese";
177
+ }, {
178
+ readonly id: "cs";
179
+ readonly text: "Czech";
180
+ }, {
181
+ readonly id: "da";
182
+ readonly text: "Danish";
183
+ }, {
184
+ readonly id: "nl";
185
+ readonly text: "Dutch";
186
+ }, {
187
+ readonly id: "en";
188
+ readonly text: "English";
189
+ }, {
190
+ readonly id: "fr";
191
+ readonly text: "French";
192
+ }, {
193
+ readonly id: "de";
194
+ readonly text: "German";
195
+ }, {
196
+ readonly id: "in";
197
+ readonly text: "Indonesian";
198
+ }, {
199
+ readonly id: "it";
200
+ readonly text: "Italian";
201
+ }, {
202
+ readonly id: "ja";
203
+ readonly text: "Japanese";
204
+ }, {
205
+ readonly id: "ko";
206
+ readonly text: "Korean";
207
+ }, {
208
+ readonly id: "ms";
209
+ readonly text: "Malay";
210
+ }, {
211
+ readonly id: "no";
212
+ readonly text: "Norwegian";
213
+ }, {
214
+ readonly id: "pl";
215
+ readonly text: "Polish";
216
+ }, {
217
+ readonly id: "pt";
218
+ readonly text: "Portuguese";
219
+ }, {
220
+ readonly id: "ro";
221
+ readonly text: "Romanian";
222
+ }, {
223
+ readonly id: "ru";
224
+ readonly text: "Russian";
225
+ }, {
226
+ readonly id: "es";
227
+ readonly text: "Spanish";
228
+ }, {
229
+ readonly id: "sv";
230
+ readonly text: "Swedish";
231
+ }, {
232
+ readonly id: "tl";
233
+ readonly text: "Tagalog";
234
+ }, {
235
+ readonly id: "tr";
236
+ readonly text: "Turkish";
237
+ }];
238
+ export declare const INDUSTRY_OPTIONS: readonly [{
239
+ readonly id: "3";
240
+ readonly text: "Accounting";
241
+ }, {
242
+ readonly id: "47";
243
+ readonly text: "Airlines/Aviation";
244
+ }, {
245
+ readonly id: "94";
246
+ readonly text: "Alternative Dispute Resolution";
247
+ }, {
248
+ readonly id: "120";
249
+ readonly text: "Alternative Medicine";
250
+ }, {
251
+ readonly id: "125";
252
+ readonly text: "Animation";
253
+ }, {
254
+ readonly id: "127";
255
+ readonly text: "Apparel & Fashion";
256
+ }, {
257
+ readonly id: "19";
258
+ readonly text: "Architecture & Planning";
259
+ }, {
260
+ readonly id: "50";
261
+ readonly text: "Arts and Crafts";
262
+ }, {
263
+ readonly id: "111";
264
+ readonly text: "Automotive";
265
+ }, {
266
+ readonly id: "12";
267
+ readonly text: "Aviation & Aerospace";
268
+ }, {
269
+ readonly id: "36";
270
+ readonly text: "Banking";
271
+ }, {
272
+ readonly id: "49";
273
+ readonly text: "Biotechnology";
274
+ }, {
275
+ readonly id: "138";
276
+ readonly text: "Broadcast Media";
277
+ }, {
278
+ readonly id: "129";
279
+ readonly text: "Building Materials";
280
+ }, {
281
+ readonly id: "54";
282
+ readonly text: "Business Supplies and Equipment";
283
+ }, {
284
+ readonly id: "59";
285
+ readonly text: "Chemicals";
286
+ }, {
287
+ readonly id: "90";
288
+ readonly text: "Civic & Social Organization";
289
+ }, {
290
+ readonly id: "51";
291
+ readonly text: "Civil Engineering";
292
+ }, {
293
+ readonly id: "128";
294
+ readonly text: "Commercial Real Estate";
295
+ }, {
296
+ readonly id: "118";
297
+ readonly text: "Computer & Network Security";
298
+ }, {
299
+ readonly id: "109";
300
+ readonly text: "Computer Games";
301
+ }, {
302
+ readonly id: "3";
303
+ readonly text: "Computer Hardware";
304
+ }, {
305
+ readonly id: "5";
306
+ readonly text: "Computer Networking";
307
+ }, {
308
+ readonly id: "4";
309
+ readonly text: "Computer Software";
310
+ }, {
311
+ readonly id: "48";
312
+ readonly text: "Construction";
313
+ }, {
314
+ readonly id: "24";
315
+ readonly text: "Consumer Electronics";
316
+ }, {
317
+ readonly id: "25";
318
+ readonly text: "Consumer Goods";
319
+ }, {
320
+ readonly id: "91";
321
+ readonly text: "Consumer Services";
322
+ }, {
323
+ readonly id: "18";
324
+ readonly text: "Cosmetics";
325
+ }, {
326
+ readonly id: "65";
327
+ readonly text: "Dairy";
328
+ }, {
329
+ readonly id: "1";
330
+ readonly text: "Defense & Space";
331
+ }, {
332
+ readonly id: "99";
333
+ readonly text: "Design";
334
+ }, {
335
+ readonly id: "69";
336
+ readonly text: "Education Management";
337
+ }, {
338
+ readonly id: "132";
339
+ readonly text: "E-Learning";
340
+ }, {
341
+ readonly id: "112";
342
+ readonly text: "Electrical/Electronic Manufacturing";
343
+ }, {
344
+ readonly id: "28";
345
+ readonly text: "Entertainment";
346
+ }, {
347
+ readonly id: "86";
348
+ readonly text: "Environmental Services";
349
+ }, {
350
+ readonly id: "110";
351
+ readonly text: "Events Services";
352
+ }, {
353
+ readonly id: "76";
354
+ readonly text: "Executive Office";
355
+ }, {
356
+ readonly id: "122";
357
+ readonly text: "Facilities Services";
358
+ }, {
359
+ readonly id: "63";
360
+ readonly text: "Farming";
361
+ }, {
362
+ readonly id: "43";
363
+ readonly text: "Financial Services";
364
+ }, {
365
+ readonly id: "38";
366
+ readonly text: "Fine Art";
367
+ }, {
368
+ readonly id: "66";
369
+ readonly text: "Fishery";
370
+ }, {
371
+ readonly id: "34";
372
+ readonly text: "Food & Beverages";
373
+ }, {
374
+ readonly id: "23";
375
+ readonly text: "Food Production";
376
+ }, {
377
+ readonly id: "101";
378
+ readonly text: "Fund-Raising";
379
+ }, {
380
+ readonly id: "26";
381
+ readonly text: "Furniture";
382
+ }, {
383
+ readonly id: "29";
384
+ readonly text: "Gambling & Casinos";
385
+ }, {
386
+ readonly id: "145";
387
+ readonly text: "Glass, Ceramics & Concrete";
388
+ }];
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+ /**
3
+ * Static filter constants for LinkedIn Sales Navigator
4
+ * These provide instant default options without requiring API calls
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.INDUSTRY_OPTIONS = exports.LANGUAGE_OPTIONS = exports.REGION_OPTIONS = exports.FUNCTION_OPTIONS = exports.YEARS_OPTIONS = exports.SENIORITY_OPTIONS = void 0;
8
+ // Seniority Levels - LinkedIn fixed levels
9
+ exports.SENIORITY_OPTIONS = [
10
+ { id: "1", text: "Unpaid" },
11
+ { id: "2", text: "Training" },
12
+ { id: "3", text: "Entry level" },
13
+ { id: "4", text: "Senior" },
14
+ { id: "5", text: "Manager" },
15
+ { id: "6", text: "Director" },
16
+ { id: "7", text: "VP" },
17
+ { id: "8", text: "CXO" },
18
+ { id: "9", text: "Partner" },
19
+ { id: "10", text: "Owner" },
20
+ ];
21
+ // Years filters - LinkedIn fixed ranges
22
+ exports.YEARS_OPTIONS = [
23
+ { id: "1", text: "< 1 year" },
24
+ { id: "2", text: "1-2 years" },
25
+ { id: "3", text: "3-5 years" },
26
+ { id: "4", text: "6-10 years" },
27
+ { id: "5", text: "10+ years" },
28
+ ];
29
+ // Role Functions - top 26 most common functions
30
+ exports.FUNCTION_OPTIONS = [
31
+ { id: "1", text: "Accounting" },
32
+ { id: "2", text: "Administrative" },
33
+ { id: "3", text: "Arts and Design" },
34
+ { id: "4", text: "Business Development" },
35
+ { id: "5", text: "Community and Social Services" },
36
+ { id: "6", text: "Consulting" },
37
+ { id: "7", text: "Education" },
38
+ { id: "8", text: "Engineering" },
39
+ { id: "9", text: "Entrepreneurship" },
40
+ { id: "10", text: "Finance" },
41
+ { id: "11", text: "Healthcare Services" },
42
+ { id: "12", text: "Human Resources" },
43
+ { id: "13", text: "Information Technology" },
44
+ { id: "14", text: "Legal" },
45
+ { id: "15", text: "Marketing" },
46
+ { id: "16", text: "Media and Communication" },
47
+ { id: "17", text: "Military and Protective Services" },
48
+ { id: "18", text: "Operations" },
49
+ { id: "19", text: "Product Management" },
50
+ { id: "20", text: "Program and Project Management" },
51
+ { id: "21", text: "Purchasing" },
52
+ { id: "22", text: "Quality Assurance" },
53
+ { id: "23", text: "Real Estate" },
54
+ { id: "24", text: "Research" },
55
+ { id: "25", text: "Sales" },
56
+ { id: "26", text: "Support" },
57
+ ];
58
+ // Geographic Regions - 13 major regions
59
+ exports.REGION_OPTIONS = [
60
+ { id: "102890883", text: "Oceania" },
61
+ { id: "100506914", text: "EMEA" },
62
+ { id: "105015875", text: "DACH" },
63
+ { id: "102221843", text: "North America" },
64
+ { id: "104738515", text: "South America" },
65
+ { id: "90009706", text: "Southeast Asia" },
66
+ { id: "102393603", text: "Asia-Pacific" },
67
+ { id: "90000084", text: "Europe" },
68
+ { id: "106155005", text: "Middle East" },
69
+ { id: "103883259", text: "Latin America" },
70
+ { id: "91000002", text: "Africa" },
71
+ { id: "102095887", text: "Caribbean" },
72
+ { id: "90009790", text: "Central Asia" },
73
+ ];
74
+ // Profile Languages - 22 most common languages
75
+ exports.LANGUAGE_OPTIONS = [
76
+ { id: "ar", text: "Arabic" },
77
+ { id: "zh", text: "Chinese" },
78
+ { id: "cs", text: "Czech" },
79
+ { id: "da", text: "Danish" },
80
+ { id: "nl", text: "Dutch" },
81
+ { id: "en", text: "English" },
82
+ { id: "fr", text: "French" },
83
+ { id: "de", text: "German" },
84
+ { id: "in", text: "Indonesian" },
85
+ { id: "it", text: "Italian" },
86
+ { id: "ja", text: "Japanese" },
87
+ { id: "ko", text: "Korean" },
88
+ { id: "ms", text: "Malay" },
89
+ { id: "no", text: "Norwegian" },
90
+ { id: "pl", text: "Polish" },
91
+ { id: "pt", text: "Portuguese" },
92
+ { id: "ro", text: "Romanian" },
93
+ { id: "ru", text: "Russian" },
94
+ { id: "es", text: "Spanish" },
95
+ { id: "sv", text: "Swedish" },
96
+ { id: "tl", text: "Tagalog" },
97
+ { id: "tr", text: "Turkish" },
98
+ ];
99
+ // Industries - top 50 most common industries from 400+ available
100
+ exports.INDUSTRY_OPTIONS = [
101
+ { id: "3", text: "Accounting" },
102
+ { id: "47", text: "Airlines/Aviation" },
103
+ { id: "94", text: "Alternative Dispute Resolution" },
104
+ { id: "120", text: "Alternative Medicine" },
105
+ { id: "125", text: "Animation" },
106
+ { id: "127", text: "Apparel & Fashion" },
107
+ { id: "19", text: "Architecture & Planning" },
108
+ { id: "50", text: "Arts and Crafts" },
109
+ { id: "111", text: "Automotive" },
110
+ { id: "12", text: "Aviation & Aerospace" },
111
+ { id: "36", text: "Banking" },
112
+ { id: "49", text: "Biotechnology" },
113
+ { id: "138", text: "Broadcast Media" },
114
+ { id: "129", text: "Building Materials" },
115
+ { id: "54", text: "Business Supplies and Equipment" },
116
+ { id: "59", text: "Chemicals" },
117
+ { id: "90", text: "Civic & Social Organization" },
118
+ { id: "51", text: "Civil Engineering" },
119
+ { id: "128", text: "Commercial Real Estate" },
120
+ { id: "118", text: "Computer & Network Security" },
121
+ { id: "109", text: "Computer Games" },
122
+ { id: "3", text: "Computer Hardware" },
123
+ { id: "5", text: "Computer Networking" },
124
+ { id: "4", text: "Computer Software" },
125
+ { id: "48", text: "Construction" },
126
+ { id: "24", text: "Consumer Electronics" },
127
+ { id: "25", text: "Consumer Goods" },
128
+ { id: "91", text: "Consumer Services" },
129
+ { id: "18", text: "Cosmetics" },
130
+ { id: "65", text: "Dairy" },
131
+ { id: "1", text: "Defense & Space" },
132
+ { id: "99", text: "Design" },
133
+ { id: "69", text: "Education Management" },
134
+ { id: "132", text: "E-Learning" },
135
+ { id: "112", text: "Electrical/Electronic Manufacturing" },
136
+ { id: "28", text: "Entertainment" },
137
+ { id: "86", text: "Environmental Services" },
138
+ { id: "110", text: "Events Services" },
139
+ { id: "76", text: "Executive Office" },
140
+ { id: "122", text: "Facilities Services" },
141
+ { id: "63", text: "Farming" },
142
+ { id: "43", text: "Financial Services" },
143
+ { id: "38", text: "Fine Art" },
144
+ { id: "66", text: "Fishery" },
145
+ { id: "34", text: "Food & Beverages" },
146
+ { id: "23", text: "Food Production" },
147
+ { id: "101", text: "Fund-Raising" },
148
+ { id: "26", text: "Furniture" },
149
+ { id: "29", text: "Gambling & Casinos" },
150
+ { id: "145", text: "Glass, Ceramics & Concrete" },
151
+ ];
package/dist/index.d.ts CHANGED
@@ -11,3 +11,4 @@ export type { LinkedInTenure, LinkedInPosition, LinkedInSpotlightBadge, SalesLea
11
11
  export * from './utils/metrics';
12
12
  export { getRequestHistory, clearRequestHistory } from './utils/request-history';
13
13
  export type { RequestHistoryEntry } from './utils/request-history';
14
+ export * from './constants';
package/dist/index.js CHANGED
@@ -32,3 +32,4 @@ __exportStar(require("./utils/metrics"), exports);
32
32
  var request_history_1 = require("./utils/request-history");
33
33
  Object.defineProperty(exports, "getRequestHistory", { enumerable: true, get: function () { return request_history_1.getRequestHistory; } });
34
34
  Object.defineProperty(exports, "clearRequestHistory", { enumerable: true, get: function () { return request_history_1.clearRequestHistory; } });
35
+ __exportStar(require("./constants"), exports);
@@ -21,69 +21,7 @@ export declare function typeahead(options: {
21
21
  start?: number;
22
22
  count?: number;
23
23
  }): Promise<TypeaheadResult>;
24
- export declare const YEARS_AT_COMPANY_OPTIONS: readonly [{
25
- readonly id: 1;
26
- readonly text: "Less than 1 year";
27
- readonly displayValue: "< 1 year";
28
- }, {
29
- readonly id: 2;
30
- readonly text: "1 to 2 years";
31
- readonly displayValue: "1-2 years";
32
- }, {
33
- readonly id: 3;
34
- readonly text: "3 to 5 years";
35
- readonly displayValue: "3-5 years";
36
- }, {
37
- readonly id: 4;
38
- readonly text: "6 to 10 years";
39
- readonly displayValue: "6-10 years";
40
- }, {
41
- readonly id: 5;
42
- readonly text: "More than 10 years";
43
- readonly displayValue: "10+ years";
44
- }];
45
- export declare const YEARS_IN_POSITION_OPTIONS: readonly [{
46
- readonly id: 1;
47
- readonly text: "Less than 1 year";
48
- readonly displayValue: "< 1 year";
49
- }, {
50
- readonly id: 2;
51
- readonly text: "1 to 2 years";
52
- readonly displayValue: "1-2 years";
53
- }, {
54
- readonly id: 3;
55
- readonly text: "3 to 5 years";
56
- readonly displayValue: "3-5 years";
57
- }, {
58
- readonly id: 4;
59
- readonly text: "6 to 10 years";
60
- readonly displayValue: "6-10 years";
61
- }, {
62
- readonly id: 5;
63
- readonly text: "More than 10 years";
64
- readonly displayValue: "10+ years";
65
- }];
66
- export declare const YEARS_OF_EXPERIENCE_OPTIONS: readonly [{
67
- readonly id: 1;
68
- readonly text: "Less than 1 year";
69
- readonly displayValue: "< 1 year";
70
- }, {
71
- readonly id: 2;
72
- readonly text: "1 to 2 years";
73
- readonly displayValue: "1-2 years";
74
- }, {
75
- readonly id: 3;
76
- readonly text: "3 to 5 years";
77
- readonly displayValue: "3-5 years";
78
- }, {
79
- readonly id: 4;
80
- readonly text: "6 to 10 years";
81
- readonly displayValue: "6-10 years";
82
- }, {
83
- readonly id: 5;
84
- readonly text: "More than 10 years";
85
- readonly displayValue: "10+ years";
86
- }];
24
+ export { YEARS_OPTIONS as YEARS_AT_COMPANY_OPTIONS, YEARS_OPTIONS as YEARS_IN_POSITION_OPTIONS, YEARS_OPTIONS as YEARS_OF_EXPERIENCE_OPTIONS, SENIORITY_OPTIONS, FUNCTION_OPTIONS, REGION_OPTIONS, LANGUAGE_OPTIONS, INDUSTRY_OPTIONS, } from './constants';
87
25
  /**
88
26
  * Returns static years at company options (no API call needed)
89
27
  */
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.YEARS_OF_EXPERIENCE_OPTIONS = exports.YEARS_IN_POSITION_OPTIONS = exports.YEARS_AT_COMPANY_OPTIONS = void 0;
3
+ exports.INDUSTRY_OPTIONS = exports.LANGUAGE_OPTIONS = exports.REGION_OPTIONS = exports.FUNCTION_OPTIONS = exports.SENIORITY_OPTIONS = exports.YEARS_OF_EXPERIENCE_OPTIONS = exports.YEARS_IN_POSITION_OPTIONS = exports.YEARS_AT_COMPANY_OPTIONS = void 0;
4
4
  exports.getProfileByVanity = getProfileByVanity;
5
5
  exports.getProfileByUrn = getProfileByUrn;
6
6
  exports.searchSalesLeads = searchSalesLeads;
@@ -22,6 +22,7 @@ const company_parser_1 = require("./parsers/company-parser");
22
22
  const metrics_1 = require("./utils/metrics");
23
23
  const logger_1 = require("./utils/logger");
24
24
  const errors_1 = require("./utils/errors");
25
+ const constants_1 = require("./constants");
25
26
  const LINKEDIN_API_BASE = 'https://www.linkedin.com/voyager/api';
26
27
  const SALES_NAV_BASE = 'https://www.linkedin.com/sales-api';
27
28
  // In-memory caches (per-process)
@@ -345,7 +346,35 @@ async function typeahead(options) {
345
346
  const type = String(options?.type || '').trim();
346
347
  const start = Number.isFinite(options?.start) ? Number(options.start) : 0;
347
348
  const count = Number.isFinite(options?.count) ? Number(options.count) : 10;
348
- const query = (options?.query ?? '').toString();
349
+ const query = (options?.query ?? '').toString().trim();
350
+ // Return static defaults when no query provided for supported types
351
+ if (!query) {
352
+ let staticOptions;
353
+ switch (type) {
354
+ case 'FUNCTION':
355
+ staticOptions = constants_1.FUNCTION_OPTIONS;
356
+ break;
357
+ case 'BING_GEO':
358
+ staticOptions = constants_1.REGION_OPTIONS;
359
+ break;
360
+ case 'PROFILE_LANGUAGE':
361
+ staticOptions = constants_1.LANGUAGE_OPTIONS;
362
+ break;
363
+ case 'INDUSTRY':
364
+ staticOptions = constants_1.INDUSTRY_OPTIONS;
365
+ break;
366
+ case 'SENIORITY_LEVEL':
367
+ staticOptions = constants_1.SENIORITY_OPTIONS;
368
+ break;
369
+ }
370
+ if (staticOptions) {
371
+ return {
372
+ items: staticOptions.map(opt => ({ id: String(opt.id), text: opt.text })),
373
+ page: { start: 0, count: staticOptions.length, total: staticOptions.length }
374
+ };
375
+ }
376
+ }
377
+ // Make API call to LinkedIn for search queries or unsupported types
349
378
  const cacheKey = JSON.stringify({ type, query, start, count });
350
379
  const cached = getCached(typeaheadCache, cacheKey, cfg.typeaheadCacheTtl);
351
380
  if (cached) {
@@ -386,37 +415,26 @@ async function typeahead(options) {
386
415
  // ---------------------------------------------------------------------------
387
416
  // Static Filters (Years) - LinkedIn has fixed ranges, no need for API calls
388
417
  // ---------------------------------------------------------------------------
389
- exports.YEARS_AT_COMPANY_OPTIONS = [
390
- { id: 1, text: "Less than 1 year", displayValue: "< 1 year" },
391
- { id: 2, text: "1 to 2 years", displayValue: "1-2 years" },
392
- { id: 3, text: "3 to 5 years", displayValue: "3-5 years" },
393
- { id: 4, text: "6 to 10 years", displayValue: "6-10 years" },
394
- { id: 5, text: "More than 10 years", displayValue: "10+ years" },
395
- ];
396
- exports.YEARS_IN_POSITION_OPTIONS = [
397
- { id: 1, text: "Less than 1 year", displayValue: "< 1 year" },
398
- { id: 2, text: "1 to 2 years", displayValue: "1-2 years" },
399
- { id: 3, text: "3 to 5 years", displayValue: "3-5 years" },
400
- { id: 4, text: "6 to 10 years", displayValue: "6-10 years" },
401
- { id: 5, text: "More than 10 years", displayValue: "10+ years" },
402
- ];
403
- exports.YEARS_OF_EXPERIENCE_OPTIONS = [
404
- { id: 1, text: "Less than 1 year", displayValue: "< 1 year" },
405
- { id: 2, text: "1 to 2 years", displayValue: "1-2 years" },
406
- { id: 3, text: "3 to 5 years", displayValue: "3-5 years" },
407
- { id: 4, text: "6 to 10 years", displayValue: "6-10 years" },
408
- { id: 5, text: "More than 10 years", displayValue: "10+ years" },
409
- ];
418
+ // Re-export constants from centralized location
419
+ var constants_2 = require("./constants");
420
+ Object.defineProperty(exports, "YEARS_AT_COMPANY_OPTIONS", { enumerable: true, get: function () { return constants_2.YEARS_OPTIONS; } });
421
+ Object.defineProperty(exports, "YEARS_IN_POSITION_OPTIONS", { enumerable: true, get: function () { return constants_2.YEARS_OPTIONS; } });
422
+ Object.defineProperty(exports, "YEARS_OF_EXPERIENCE_OPTIONS", { enumerable: true, get: function () { return constants_2.YEARS_OPTIONS; } });
423
+ Object.defineProperty(exports, "SENIORITY_OPTIONS", { enumerable: true, get: function () { return constants_2.SENIORITY_OPTIONS; } });
424
+ Object.defineProperty(exports, "FUNCTION_OPTIONS", { enumerable: true, get: function () { return constants_2.FUNCTION_OPTIONS; } });
425
+ Object.defineProperty(exports, "REGION_OPTIONS", { enumerable: true, get: function () { return constants_2.REGION_OPTIONS; } });
426
+ Object.defineProperty(exports, "LANGUAGE_OPTIONS", { enumerable: true, get: function () { return constants_2.LANGUAGE_OPTIONS; } });
427
+ Object.defineProperty(exports, "INDUSTRY_OPTIONS", { enumerable: true, get: function () { return constants_2.INDUSTRY_OPTIONS; } });
410
428
  /**
411
429
  * Returns static years at company options (no API call needed)
412
430
  */
413
431
  async function getYearsAtCompanyOptions() {
414
432
  return {
415
- items: exports.YEARS_AT_COMPANY_OPTIONS.map(opt => ({ id: String(opt.id), text: opt.displayValue })),
433
+ items: constants_1.YEARS_OPTIONS.map(opt => ({ id: opt.id, text: opt.text })),
416
434
  page: {
417
435
  start: 0,
418
- count: exports.YEARS_AT_COMPANY_OPTIONS.length,
419
- total: exports.YEARS_AT_COMPANY_OPTIONS.length
436
+ count: constants_1.YEARS_OPTIONS.length,
437
+ total: constants_1.YEARS_OPTIONS.length
420
438
  }
421
439
  };
422
440
  }
@@ -425,11 +443,11 @@ async function getYearsAtCompanyOptions() {
425
443
  */
426
444
  async function getYearsInPositionOptions() {
427
445
  return {
428
- items: exports.YEARS_IN_POSITION_OPTIONS.map(opt => ({ id: String(opt.id), text: opt.displayValue })),
446
+ items: constants_1.YEARS_OPTIONS.map(opt => ({ id: opt.id, text: opt.text })),
429
447
  page: {
430
448
  start: 0,
431
- count: exports.YEARS_IN_POSITION_OPTIONS.length,
432
- total: exports.YEARS_IN_POSITION_OPTIONS.length
449
+ count: constants_1.YEARS_OPTIONS.length,
450
+ total: constants_1.YEARS_OPTIONS.length
433
451
  }
434
452
  };
435
453
  }
@@ -438,11 +456,11 @@ async function getYearsInPositionOptions() {
438
456
  */
439
457
  async function getYearsOfExperienceOptions() {
440
458
  return {
441
- items: exports.YEARS_OF_EXPERIENCE_OPTIONS.map(opt => ({ id: String(opt.id), text: opt.displayValue })),
459
+ items: constants_1.YEARS_OPTIONS.map(opt => ({ id: opt.id, text: opt.text })),
442
460
  page: {
443
461
  start: 0,
444
- count: exports.YEARS_OF_EXPERIENCE_OPTIONS.length,
445
- total: exports.YEARS_OF_EXPERIENCE_OPTIONS.length
462
+ count: constants_1.YEARS_OPTIONS.length,
463
+ total: constants_1.YEARS_OPTIONS.length
446
464
  }
447
465
  };
448
466
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linkedin-secret-sauce",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
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",