huntr-cli 1.0.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.
Files changed (117) hide show
  1. package/.env.example +7 -0
  2. package/.github/ISSUE_TEMPLATE/bug_report.md +43 -0
  3. package/.github/ISSUE_TEMPLATE/config.yml +8 -0
  4. package/.github/ISSUE_TEMPLATE/feature_request.md +29 -0
  5. package/.github/labels.json +92 -0
  6. package/.github/pull_request_template.md +64 -0
  7. package/.github/workflows/ci.yml +87 -0
  8. package/.github/workflows/labels.yml +27 -0
  9. package/.github/workflows/manual-publish.yml +105 -0
  10. package/.github/workflows/publish.yml +57 -0
  11. package/.github/workflows/release.yml +124 -0
  12. package/.github/workflows/security-audit.yml +44 -0
  13. package/.husky/pre-commit +12 -0
  14. package/.husky/pre-push +27 -0
  15. package/.lintstagedrc.json +3 -0
  16. package/AGENTS.md +449 -0
  17. package/CHANGELOG.md +38 -0
  18. package/CHANGES.md +259 -0
  19. package/LICENSE +15 -0
  20. package/PUBLISHING.md +191 -0
  21. package/README.md +385 -0
  22. package/ROADMAP.md +158 -0
  23. package/SETUP-COMPLETE.md +446 -0
  24. package/WORKFLOW-SUMMARY.md +368 -0
  25. package/completions/_huntr +168 -0
  26. package/completions/huntr.1 +266 -0
  27. package/completions/huntr.bash +91 -0
  28. package/dist/api/client.d.ts +14 -0
  29. package/dist/api/client.d.ts.map +1 -0
  30. package/dist/api/client.js +74 -0
  31. package/dist/api/client.js.map +1 -0
  32. package/dist/api/personal/activities.d.ts +20 -0
  33. package/dist/api/personal/activities.d.ts.map +1 -0
  34. package/dist/api/personal/activities.js +50 -0
  35. package/dist/api/personal/activities.js.map +1 -0
  36. package/dist/api/personal/boards.d.ts +9 -0
  37. package/dist/api/personal/boards.d.ts.map +1 -0
  38. package/dist/api/personal/boards.js +16 -0
  39. package/dist/api/personal/boards.js.map +1 -0
  40. package/dist/api/personal/index.d.ts +17 -0
  41. package/dist/api/personal/index.d.ts.map +1 -0
  42. package/dist/api/personal/index.js +37 -0
  43. package/dist/api/personal/index.js.map +1 -0
  44. package/dist/api/personal/jobs.d.ts +13 -0
  45. package/dist/api/personal/jobs.d.ts.map +1 -0
  46. package/dist/api/personal/jobs.js +31 -0
  47. package/dist/api/personal/jobs.js.map +1 -0
  48. package/dist/api/personal/user.d.ts +8 -0
  49. package/dist/api/personal/user.d.ts.map +1 -0
  50. package/dist/api/personal/user.js +13 -0
  51. package/dist/api/personal/user.js.map +1 -0
  52. package/dist/cli.d.ts +3 -0
  53. package/dist/cli.d.ts.map +1 -0
  54. package/dist/cli.js +501 -0
  55. package/dist/cli.js.map +1 -0
  56. package/dist/commands/capture-session.d.ts +10 -0
  57. package/dist/commands/capture-session.d.ts.map +1 -0
  58. package/dist/commands/capture-session.js +478 -0
  59. package/dist/commands/capture-session.js.map +1 -0
  60. package/dist/config/clerk-session-manager.d.ts +44 -0
  61. package/dist/config/clerk-session-manager.d.ts.map +1 -0
  62. package/dist/config/clerk-session-manager.js +232 -0
  63. package/dist/config/clerk-session-manager.js.map +1 -0
  64. package/dist/config/config-manager.d.ts +15 -0
  65. package/dist/config/config-manager.d.ts.map +1 -0
  66. package/dist/config/config-manager.js +51 -0
  67. package/dist/config/config-manager.js.map +1 -0
  68. package/dist/config/keychain-manager.d.ts +6 -0
  69. package/dist/config/keychain-manager.d.ts.map +1 -0
  70. package/dist/config/keychain-manager.js +37 -0
  71. package/dist/config/keychain-manager.js.map +1 -0
  72. package/dist/config/token-capture.d.ts +11 -0
  73. package/dist/config/token-capture.d.ts.map +1 -0
  74. package/dist/config/token-capture.js +252 -0
  75. package/dist/config/token-capture.js.map +1 -0
  76. package/dist/config/token-manager.d.ts +38 -0
  77. package/dist/config/token-manager.d.ts.map +1 -0
  78. package/dist/config/token-manager.js +153 -0
  79. package/dist/config/token-manager.js.map +1 -0
  80. package/dist/lib/list-options.d.ts +69 -0
  81. package/dist/lib/list-options.d.ts.map +1 -0
  82. package/dist/lib/list-options.js +299 -0
  83. package/dist/lib/list-options.js.map +1 -0
  84. package/dist/types/personal.d.ts +113 -0
  85. package/dist/types/personal.d.ts.map +1 -0
  86. package/dist/types/personal.js +4 -0
  87. package/dist/types/personal.js.map +1 -0
  88. package/docs/AUTOMATIC-PUBLISHING.md +520 -0
  89. package/docs/CHANGELOG-AUTOMATION.md +418 -0
  90. package/docs/CI-CD-SETUP.md +582 -0
  91. package/docs/DEV-SETUP.md +512 -0
  92. package/docs/ENHANCEMENT-PLAN.md +204 -0
  93. package/docs/ENTITY-TYPES.md +462 -0
  94. package/docs/GITHUB-ACTIONS-GUIDE.md +367 -0
  95. package/docs/NPM-PUBLISHING.md +324 -0
  96. package/docs/OUTPUT-EXAMPLES.md +414 -0
  97. package/docs/OUTPUT-FORMATS.md +299 -0
  98. package/docs/TESTING.md +216 -0
  99. package/eslint.config.js +68 -0
  100. package/package.json +64 -0
  101. package/src/api/client.ts +88 -0
  102. package/src/api/personal/activities.ts +66 -0
  103. package/src/api/personal/boards.ts +14 -0
  104. package/src/api/personal/index.ts +25 -0
  105. package/src/api/personal/jobs.ts +33 -0
  106. package/src/api/personal/user.ts +10 -0
  107. package/src/cli.ts +487 -0
  108. package/src/commands/capture-session.ts +582 -0
  109. package/src/config/clerk-session-manager.ts +263 -0
  110. package/src/config/config-manager.ts +56 -0
  111. package/src/config/keychain-manager.ts +30 -0
  112. package/src/config/token-capture.ts +233 -0
  113. package/src/config/token-manager.ts +139 -0
  114. package/src/lib/list-options.ts +370 -0
  115. package/src/types/personal.ts +114 -0
  116. package/tests/example.test.ts +130 -0
  117. package/tsconfig.json +19 -0
@@ -0,0 +1,462 @@
1
+ # Entity Types Reference
2
+
3
+ This document shows the complete structure of each entity type returned by huntr-cli.
4
+
5
+ ## Quick Reference
6
+
7
+ ### Board Entity
8
+
9
+ ```typescript
10
+ {
11
+ id: "68bf9e33f871e5004a5eb58e",
12
+ _id: "507f1f77bcf86cd799439011",
13
+ name: "My Job Search",
14
+ createdAt: "2024-01-15T10:30:00Z",
15
+ updatedAt: "2024-02-20T15:45:00Z",
16
+ lists: [
17
+ { id: "list_1", _id: "...", name: "Active Leads", order: 1 },
18
+ { id: "list_2", _id: "...", name: "Interviewing", order: 2 }
19
+ ]
20
+ }
21
+ ```
22
+
23
+ ### Job Entity
24
+
25
+ ```typescript
26
+ {
27
+ _id: "507f1f77bcf86cd799439011",
28
+ id: "job_001",
29
+ title: "Senior Engineer at TechCorp",
30
+ url: "https://techs.jobs/engineer",
31
+ rootDomain: "techs.jobs",
32
+ htmlDescription: "HTML job description...",
33
+ _company: "company_id_ref",
34
+ _list: "list_id_ref",
35
+ _board: "board_id_ref",
36
+ _activities: ["action_1", "action_2"],
37
+ _notes: ["note_1"],
38
+ salary: {
39
+ min: 120000,
40
+ max: 150000,
41
+ currency: "USD"
42
+ },
43
+ location: {
44
+ address: "San Francisco, CA",
45
+ name: "San Francisco",
46
+ lat: "37.7749",
47
+ lng: "-122.4194"
48
+ },
49
+ createdAt: "2024-01-20T14:15:00Z",
50
+ updatedAt: "2024-02-15T10:00:00Z",
51
+ lastMovedAt: "2024-02-18T09:30:00Z"
52
+ }
53
+ ```
54
+
55
+ ### Activity (Action) Entity
56
+
57
+ ```typescript
58
+ {
59
+ _id: "507f1f77bcf86cd799439011",
60
+ id: "action_001",
61
+ actionType: "JOB_MOVED",
62
+ date: "2024-02-20T15:00:00Z",
63
+ createdAt: "2024-02-20T15:00:00Z",
64
+ updatedAt: "2024-02-20T15:05:00Z",
65
+ data: {
66
+ _job: "job_001",
67
+ _company: "company_1",
68
+ _board: "board_1",
69
+ _fromList: "list_1",
70
+ _toList: "list_2",
71
+ job: {
72
+ _id: "507f...",
73
+ id: "job_001",
74
+ title: "Senior Engineer at TechCorp"
75
+ },
76
+ company: {
77
+ _id: "507f...",
78
+ id: "company_1",
79
+ name: "TechCorp",
80
+ color: "#FF0000"
81
+ },
82
+ fromList: {
83
+ _id: "507f...",
84
+ id: "list_1",
85
+ name: "Active Leads"
86
+ },
87
+ toList: {
88
+ _id: "507f...",
89
+ id: "list_2",
90
+ name: "Interviewing"
91
+ },
92
+ note: null,
93
+ activity: null,
94
+ activityCategory: null,
95
+ contact: null
96
+ }
97
+ }
98
+ ```
99
+
100
+ ### User Profile Entity
101
+
102
+ ```typescript
103
+ {
104
+ id: "user_123",
105
+ _id: "507f1f77bcf86cd799439011",
106
+ email: "john@example.com",
107
+ givenName: "John",
108
+ familyName: "Doe",
109
+ firstName: "John",
110
+ lastName: "Doe",
111
+ createdAt: "2024-01-15T10:30:00Z"
112
+ }
113
+ ```
114
+
115
+ ---
116
+
117
+ ## Detailed Field Descriptions
118
+
119
+ ### Board
120
+
121
+ | Field | Type | Description |
122
+ |-------|------|-------------|
123
+ | `id` | string | Unique board identifier (MongoDB ObjectId as string) |
124
+ | `_id` | string | Alternative ID format |
125
+ | `name` | string | Board name (e.g., "My Job Search") |
126
+ | `createdAt` | ISO 8601 | Creation timestamp |
127
+ | `updatedAt` | ISO 8601 | Last update timestamp |
128
+ | `lists` | Array<BoardList> | Lists (columns) on the board |
129
+
130
+ ### BoardList
131
+
132
+ | Field | Type | Description |
133
+ |-------|------|-------------|
134
+ | `id` | string | Unique list identifier |
135
+ | `_id` | string | Alternative ID format |
136
+ | `name` | string | List name (e.g., "Active Leads", "Interviewing") |
137
+ | `order` | number? | Position order on board |
138
+
139
+ ### Job
140
+
141
+ | Field | Type | Description |
142
+ |-------|------|-------------|
143
+ | `id` | string | Unique job identifier |
144
+ | `_id` | string | Alternative ID format |
145
+ | `title` | string | Job title |
146
+ | `url` | string? | Job posting URL |
147
+ | `rootDomain` | string? | Domain of job posting (e.g., "linkedin.com") |
148
+ | `htmlDescription` | string? | Full HTML job description |
149
+ | `_company` | string | Company ID (reference) |
150
+ | `_list` | string? | Current list ID (reference) |
151
+ | `_board` | string | Board ID (reference) |
152
+ | `_activities` | string[] | Activity IDs (references) |
153
+ | `_notes` | string[] | Note IDs (references) |
154
+ | `salary` | Salary? | Salary information |
155
+ | `location` | Location? | Job location |
156
+ | `createdAt` | ISO 8601 | When job was added |
157
+ | `updatedAt` | ISO 8601 | Last update |
158
+ | `lastMovedAt` | ISO 8601? | When job was last moved between lists |
159
+
160
+ ### Salary
161
+
162
+ | Field | Type | Description |
163
+ |-------|------|-------------|
164
+ | `min` | number? | Minimum salary |
165
+ | `max` | number? | Maximum salary |
166
+ | `currency` | string? | Currency (e.g., "USD", "EUR") |
167
+
168
+ ### Location
169
+
170
+ | Field | Type | Description |
171
+ |-------|------|-------------|
172
+ | `address` | string? | Full address |
173
+ | `name` | string? | Location name (e.g., "San Francisco") |
174
+ | `lat` | string? | Latitude as string |
175
+ | `lng` | string? | Longitude as string |
176
+ | `url` | string? | Location info URL |
177
+
178
+ ### Activity (Action)
179
+
180
+ | Field | Type | Description |
181
+ |-------|------|-------------|
182
+ | `id` | string | Unique activity identifier |
183
+ | `_id` | string | Alternative ID format |
184
+ | `actionType` | string | Type of action (see Action Types below) |
185
+ | `date` | ISO 8601 | When activity occurred |
186
+ | `createdAt` | ISO 8601 | Creation timestamp |
187
+ | `updatedAt` | ISO 8601? | Last update timestamp |
188
+ | `data` | ActionData | Activity-specific data |
189
+
190
+ ### ActionData
191
+
192
+ | Field | Type | Description |
193
+ |-------|------|-------------|
194
+ | `_job` | string? | Job ID (reference) |
195
+ | `_company` | string? | Company ID (reference) |
196
+ | `_board` | string? | Board ID (reference) |
197
+ | `_fromList` | string? | Source list ID |
198
+ | `_toList` | string? | Destination list ID |
199
+ | `job` | JobRef? | Denormalized job info |
200
+ | `company` | CompanyRef? | Denormalized company info |
201
+ | `fromList` | ListRef? | Denormalized source list info |
202
+ | `toList` | ListRef? | Denormalized destination list info |
203
+ | `note` | Note? | Associated note |
204
+ | `activity` | any? | Nested activity |
205
+ | `activityCategory` | any? | Activity category |
206
+ | `contact` | any? | Contact info |
207
+
208
+ ### User Profile
209
+
210
+ | Field | Type | Description |
211
+ |-------|------|-------------|
212
+ | `id` | string | Unique user identifier |
213
+ | `_id` | string? | Alternative ID format |
214
+ | `email` | string | User email address |
215
+ | `givenName` | string? | First name (from profile) |
216
+ | `familyName` | string? | Last name (from profile) |
217
+ | `firstName` | string? | First name (legacy field) |
218
+ | `lastName` | string? | Last name (legacy field) |
219
+ | `createdAt` | ISO 8601 | Account creation date |
220
+
221
+ ---
222
+
223
+ ## Action Types
224
+
225
+ Common activity action types:
226
+
227
+ | Action Type | Description | Has Data |
228
+ |-------------|-------------|----------|
229
+ | `JOB_MOVED` | Job moved between lists | `fromList`, `toList`, `job`, `company` |
230
+ | `NOTE_CREATED` | Note added to job | `note`, `job` |
231
+ | `JOB_APPLICATION` | Application submitted | `job`, `company` |
232
+ | `INTERVIEW_SCHEDULED` | Interview scheduled | `job`, `activity` |
233
+ | `INTERVIEW_COMPLETED` | Interview completed | `job`, `activity` |
234
+ | `OFFER_RECEIVED` | Job offer received | `job`, `company` |
235
+ | `JOB_REJECTED` | Rejected or declined | `job`, `company` |
236
+ | `CONTACT_MADE` | Contact added/updated | `contact`, `company` |
237
+
238
+ ---
239
+
240
+ ## Get Entity Types Command
241
+
242
+ View the types for each entity:
243
+
244
+ ```bash
245
+ # View Board type
246
+ huntr boards get <board-id> --json | jq 'keys'
247
+ # Output: ["id", "_id", "name", "createdAt", "updatedAt", "lists"]
248
+
249
+ # View Job type
250
+ huntr jobs get <board-id> <job-id> --json | jq 'keys'
251
+ # Output: ["_id", "id", "title", "url", "rootDomain", "htmlDescription", ...]
252
+
253
+ # View Activity type
254
+ huntr activities list <board-id> --format json | jq '.[0] | keys'
255
+ # Output: ["Date", "Type", "Company", "Job", "Status"]
256
+
257
+ # View User type
258
+ huntr me --json | jq 'keys'
259
+ # Output: ["id", "_id", "email", "givenName", "familyName", ...]
260
+ ```
261
+
262
+ ---
263
+
264
+ ## JSON Schema Examples
265
+
266
+ ### Complete Board with Jobs
267
+
268
+ ```json
269
+ {
270
+ "id": "68bf9e33f871e5004a5eb58e",
271
+ "_id": "507f1f77bcf86cd799439011",
272
+ "name": "My Job Search",
273
+ "createdAt": "2024-01-15T10:30:00Z",
274
+ "updatedAt": "2024-02-20T15:45:00Z",
275
+ "lists": [
276
+ {
277
+ "id": "list_1",
278
+ "_id": "507f1f77bcf86cd799439012",
279
+ "name": "Active Leads",
280
+ "order": 1
281
+ },
282
+ {
283
+ "id": "list_2",
284
+ "_id": "507f1f77bcf86cd799439013",
285
+ "name": "Interviewing",
286
+ "order": 2
287
+ },
288
+ {
289
+ "id": "list_3",
290
+ "_id": "507f1f77bcf86cd799439014",
291
+ "name": "Offers",
292
+ "order": 3
293
+ }
294
+ ]
295
+ }
296
+ ```
297
+
298
+ ### Complete Job Entry
299
+
300
+ ```json
301
+ {
302
+ "_id": "507f1f77bcf86cd799439011",
303
+ "id": "job_001",
304
+ "title": "Senior Software Engineer",
305
+ "url": "https://example.com/jobs/engineer",
306
+ "rootDomain": "example.com",
307
+ "htmlDescription": "<p>We're looking for...</p>",
308
+ "_company": "company_1",
309
+ "_list": "list_2",
310
+ "_board": "68bf9e33f871e5004a5eb58e",
311
+ "_activities": ["action_1", "action_2", "action_3"],
312
+ "_notes": ["note_1"],
313
+ "salary": {
314
+ "min": 120000,
315
+ "max": 150000,
316
+ "currency": "USD"
317
+ },
318
+ "location": {
319
+ "address": "San Francisco, CA",
320
+ "name": "San Francisco",
321
+ "lat": "37.7749",
322
+ "lng": "-122.4194"
323
+ },
324
+ "createdAt": "2024-01-20T14:15:00Z",
325
+ "updatedAt": "2024-02-15T10:00:00Z",
326
+ "lastMovedAt": "2024-02-18T09:30:00Z"
327
+ }
328
+ ```
329
+
330
+ ### Complete Activity Entry
331
+
332
+ ```json
333
+ {
334
+ "_id": "507f1f77bcf86cd799439011",
335
+ "id": "action_001",
336
+ "actionType": "JOB_MOVED",
337
+ "date": "2024-02-20T15:00:00Z",
338
+ "createdAt": "2024-02-20T15:00:00Z",
339
+ "updatedAt": "2024-02-20T15:05:00Z",
340
+ "data": {
341
+ "_job": "job_001",
342
+ "_company": "company_1",
343
+ "_board": "68bf9e33f871e5004a5eb58e",
344
+ "_fromList": "list_1",
345
+ "_toList": "list_2",
346
+ "job": {
347
+ "_id": "507f1f77bcf86cd799439011",
348
+ "id": "job_001",
349
+ "title": "Senior Engineer at TechCorp"
350
+ },
351
+ "company": {
352
+ "_id": "507f1f77bcf86cd799439012",
353
+ "id": "company_1",
354
+ "name": "TechCorp",
355
+ "color": "#FF0000"
356
+ },
357
+ "fromList": {
358
+ "_id": "507f1f77bcf86cd799439013",
359
+ "id": "list_1",
360
+ "name": "Active Leads"
361
+ },
362
+ "toList": {
363
+ "_id": "507f1f77bcf86cd799439014",
364
+ "id": "list_2",
365
+ "name": "Interviewing"
366
+ },
367
+ "note": null,
368
+ "activity": null,
369
+ "activityCategory": null,
370
+ "contact": null
371
+ }
372
+ }
373
+ ```
374
+
375
+ ---
376
+
377
+ ## Usage Examples
378
+
379
+ ### Get All Field Names for Board
380
+
381
+ ```bash
382
+ huntr boards get <board-id> --json | jq 'to_entries | map(.key) | sort'
383
+ ```
384
+
385
+ ### Get Specific Fields
386
+
387
+ ```bash
388
+ # Get just ID and name
389
+ huntr boards list --json | jq '.[] | {id, name}'
390
+
391
+ # Get job titles
392
+ huntr jobs list <board-id> --json | jq '.[].title'
393
+
394
+ # Get all company names from activities
395
+ huntr activities list <board-id> --json | jq '.[] | select(.company != null) | .company' | sort | uniq
396
+ ```
397
+
398
+ ### Type Checking in Code
399
+
400
+ ```typescript
401
+ import { Board, PersonalJob, PersonalAction, UserProfile } from './types/personal';
402
+
403
+ const board: Board = {
404
+ id: '...',
405
+ _id: '...',
406
+ name: 'My Job Search',
407
+ createdAt: new Date().toISOString(),
408
+ lists: []
409
+ };
410
+ ```
411
+
412
+ ---
413
+
414
+ ## Type Documentation
415
+
416
+ Full TypeScript interface definitions are in:
417
+ - `src/types/personal.ts` — Personal API types
418
+ - `src/lib/list-options.ts` — Output format types
419
+ - `src/config/token-manager.ts` — Auth types
420
+
421
+ To view in code:
422
+
423
+ ```bash
424
+ cat src/types/personal.ts
425
+ ```
426
+
427
+ ---
428
+
429
+ ## Notes
430
+
431
+ - **`_id` vs `id`:** Both are provided for compatibility; use `id` in most cases
432
+ - **Null fields:** Marked with `?` (optional); may not exist on all entities
433
+ - **References:** Fields starting with `_` are IDs that reference other entities
434
+ - **Dates:** All ISO 8601 format (UTC timezone)
435
+ - **Denormalization:** `data` field in activities includes full nested objects for convenience
436
+
437
+ ---
438
+
439
+ ## Querying with jq
440
+
441
+ Common jq queries for entity types:
442
+
443
+ ```bash
444
+ # Get all field names
445
+ huntr boards get <id> --json | jq 'keys'
446
+
447
+ # Get nested object fields
448
+ huntr jobs get <board-id> <job-id> --json | jq '.location | keys'
449
+
450
+ # Filter by field
451
+ huntr activities list <board-id> --json | jq '.[] | select(.type == "JOB_MOVED")'
452
+
453
+ # Extract nested data
454
+ huntr activities list <board-id> --json | jq '.[] | {date: .date, company: .company, job: .job}'
455
+ ```
456
+
457
+ ---
458
+
459
+ ## See Also
460
+
461
+ - [Output Formats](./OUTPUT-FORMATS.md) — How fields are displayed in different formats
462
+ - [Output Examples](./OUTPUT-EXAMPLES.md) — Practical usage examples