@lhremote/core 0.8.0 → 0.9.0
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/cdp/app-discovery.d.ts +57 -0
- package/dist/cdp/app-discovery.d.ts.map +1 -1
- package/dist/cdp/app-discovery.js +90 -7
- package/dist/cdp/app-discovery.js.map +1 -1
- package/dist/cdp/app-discovery.test.js +180 -9
- package/dist/cdp/app-discovery.test.js.map +1 -1
- package/dist/cdp/client.d.ts +8 -1
- package/dist/cdp/client.d.ts.map +1 -1
- package/dist/cdp/client.js +8 -1
- package/dist/cdp/client.js.map +1 -1
- package/dist/cdp/discovery.d.ts.map +1 -1
- package/dist/cdp/discovery.js +5 -1
- package/dist/cdp/discovery.js.map +1 -1
- package/dist/cdp/discovery.test.js +7 -0
- package/dist/cdp/discovery.test.js.map +1 -1
- package/dist/cdp/index.d.ts +1 -1
- package/dist/cdp/index.d.ts.map +1 -1
- package/dist/cdp/index.js +1 -1
- package/dist/cdp/index.js.map +1 -1
- package/dist/cdp/instance-discovery.d.ts.map +1 -1
- package/dist/cdp/instance-discovery.js +25 -10
- package/dist/cdp/instance-discovery.js.map +1 -1
- package/dist/cdp/instance-discovery.test.js +17 -0
- package/dist/cdp/instance-discovery.test.js.map +1 -1
- package/dist/cdp/testing/launch-chromium.d.ts +1 -1
- package/dist/cdp/testing/launch-chromium.js +2 -2
- package/dist/db/client.d.ts.map +1 -1
- package/dist/db/client.js +3 -0
- package/dist/db/client.js.map +1 -1
- package/dist/db/repositories/collection-list.integration.test.js +6 -4
- package/dist/db/repositories/collection-list.integration.test.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/linkedin/dom-automation-retry.test.d.ts +2 -0
- package/dist/linkedin/dom-automation-retry.test.d.ts.map +1 -0
- package/dist/linkedin/dom-automation-retry.test.js +51 -0
- package/dist/linkedin/dom-automation-retry.test.js.map +1 -0
- package/dist/linkedin/dom-automation.d.ts +160 -3
- package/dist/linkedin/dom-automation.d.ts.map +1 -1
- package/dist/linkedin/dom-automation.js +489 -14
- package/dist/linkedin/dom-automation.js.map +1 -1
- package/dist/linkedin/humanized-mouse.d.ts +69 -0
- package/dist/linkedin/humanized-mouse.d.ts.map +1 -0
- package/dist/linkedin/humanized-mouse.js +109 -0
- package/dist/linkedin/humanized-mouse.js.map +1 -0
- package/dist/linkedin/index.d.ts +2 -1
- package/dist/linkedin/index.d.ts.map +1 -1
- package/dist/linkedin/index.js +2 -1
- package/dist/linkedin/index.js.map +1 -1
- package/dist/operations/add-people-to-collection.d.ts +1 -1
- package/dist/operations/add-people-to-collection.d.ts.map +1 -1
- package/dist/operations/add-people-to-collection.js +3 -6
- package/dist/operations/add-people-to-collection.js.map +1 -1
- package/dist/operations/build-linkedin-url.test.d.ts +2 -0
- package/dist/operations/build-linkedin-url.test.d.ts.map +1 -0
- package/dist/operations/build-linkedin-url.test.js +158 -0
- package/dist/operations/build-linkedin-url.test.js.map +1 -0
- package/dist/operations/campaign-add-action.d.ts +1 -1
- package/dist/operations/campaign-add-action.d.ts.map +1 -1
- package/dist/operations/campaign-add-action.js +3 -6
- package/dist/operations/campaign-add-action.js.map +1 -1
- package/dist/operations/campaign-create.d.ts +1 -1
- package/dist/operations/campaign-create.d.ts.map +1 -1
- package/dist/operations/campaign-create.js +3 -6
- package/dist/operations/campaign-create.js.map +1 -1
- package/dist/operations/campaign-delete.d.ts +1 -1
- package/dist/operations/campaign-delete.d.ts.map +1 -1
- package/dist/operations/campaign-delete.js +3 -6
- package/dist/operations/campaign-delete.js.map +1 -1
- package/dist/operations/campaign-erase.d.ts +1 -1
- package/dist/operations/campaign-erase.d.ts.map +1 -1
- package/dist/operations/campaign-erase.js +3 -6
- package/dist/operations/campaign-erase.js.map +1 -1
- package/dist/operations/campaign-exclude-add.d.ts +1 -1
- package/dist/operations/campaign-exclude-add.d.ts.map +1 -1
- package/dist/operations/campaign-exclude-add.js +3 -6
- package/dist/operations/campaign-exclude-add.js.map +1 -1
- package/dist/operations/campaign-exclude-list.d.ts +1 -1
- package/dist/operations/campaign-exclude-list.d.ts.map +1 -1
- package/dist/operations/campaign-exclude-list.js +3 -6
- package/dist/operations/campaign-exclude-list.js.map +1 -1
- package/dist/operations/campaign-exclude-remove.d.ts +1 -1
- package/dist/operations/campaign-exclude-remove.d.ts.map +1 -1
- package/dist/operations/campaign-exclude-remove.js +3 -6
- package/dist/operations/campaign-exclude-remove.js.map +1 -1
- package/dist/operations/campaign-export.d.ts +1 -1
- package/dist/operations/campaign-export.d.ts.map +1 -1
- package/dist/operations/campaign-export.js +3 -6
- package/dist/operations/campaign-export.js.map +1 -1
- package/dist/operations/campaign-get.d.ts +1 -1
- package/dist/operations/campaign-get.d.ts.map +1 -1
- package/dist/operations/campaign-get.js +3 -6
- package/dist/operations/campaign-get.js.map +1 -1
- package/dist/operations/campaign-list-people.d.ts +1 -1
- package/dist/operations/campaign-list-people.d.ts.map +1 -1
- package/dist/operations/campaign-list-people.js +3 -6
- package/dist/operations/campaign-list-people.js.map +1 -1
- package/dist/operations/campaign-list.d.ts +1 -1
- package/dist/operations/campaign-list.d.ts.map +1 -1
- package/dist/operations/campaign-list.js +3 -6
- package/dist/operations/campaign-list.js.map +1 -1
- package/dist/operations/campaign-move-next.d.ts +1 -1
- package/dist/operations/campaign-move-next.d.ts.map +1 -1
- package/dist/operations/campaign-move-next.js +3 -6
- package/dist/operations/campaign-move-next.js.map +1 -1
- package/dist/operations/campaign-remove-action.d.ts +1 -1
- package/dist/operations/campaign-remove-action.d.ts.map +1 -1
- package/dist/operations/campaign-remove-action.js +3 -6
- package/dist/operations/campaign-remove-action.js.map +1 -1
- package/dist/operations/campaign-remove-people.d.ts +1 -1
- package/dist/operations/campaign-remove-people.d.ts.map +1 -1
- package/dist/operations/campaign-remove-people.js +3 -6
- package/dist/operations/campaign-remove-people.js.map +1 -1
- package/dist/operations/campaign-reorder-actions.d.ts +1 -1
- package/dist/operations/campaign-reorder-actions.d.ts.map +1 -1
- package/dist/operations/campaign-reorder-actions.js +3 -6
- package/dist/operations/campaign-reorder-actions.js.map +1 -1
- package/dist/operations/campaign-retry.d.ts +1 -1
- package/dist/operations/campaign-retry.d.ts.map +1 -1
- package/dist/operations/campaign-retry.js +3 -6
- package/dist/operations/campaign-retry.js.map +1 -1
- package/dist/operations/campaign-start.d.ts +1 -1
- package/dist/operations/campaign-start.d.ts.map +1 -1
- package/dist/operations/campaign-start.js +3 -6
- package/dist/operations/campaign-start.js.map +1 -1
- package/dist/operations/campaign-statistics.d.ts +1 -1
- package/dist/operations/campaign-statistics.d.ts.map +1 -1
- package/dist/operations/campaign-statistics.js +3 -6
- package/dist/operations/campaign-statistics.js.map +1 -1
- package/dist/operations/campaign-status.d.ts +1 -1
- package/dist/operations/campaign-status.d.ts.map +1 -1
- package/dist/operations/campaign-status.js +3 -6
- package/dist/operations/campaign-status.js.map +1 -1
- package/dist/operations/campaign-stop.d.ts +1 -1
- package/dist/operations/campaign-stop.d.ts.map +1 -1
- package/dist/operations/campaign-stop.js +3 -6
- package/dist/operations/campaign-stop.js.map +1 -1
- package/dist/operations/campaign-update-action.d.ts +1 -1
- package/dist/operations/campaign-update-action.d.ts.map +1 -1
- package/dist/operations/campaign-update-action.js +3 -6
- package/dist/operations/campaign-update-action.js.map +1 -1
- package/dist/operations/campaign-update.d.ts +1 -1
- package/dist/operations/campaign-update.d.ts.map +1 -1
- package/dist/operations/campaign-update.js +3 -6
- package/dist/operations/campaign-update.js.map +1 -1
- package/dist/operations/check-replies.d.ts +3 -1
- package/dist/operations/check-replies.d.ts.map +1 -1
- package/dist/operations/check-replies.js +132 -17
- package/dist/operations/check-replies.js.map +1 -1
- package/dist/operations/check-replies.test.js +177 -17
- package/dist/operations/check-replies.test.js.map +1 -1
- package/dist/operations/collect-people.d.ts +1 -1
- package/dist/operations/collect-people.d.ts.map +1 -1
- package/dist/operations/collect-people.js +3 -6
- package/dist/operations/collect-people.js.map +1 -1
- package/dist/operations/comment-on-post.d.ts +4 -1
- package/dist/operations/comment-on-post.d.ts.map +1 -1
- package/dist/operations/comment-on-post.js +15 -19
- package/dist/operations/comment-on-post.js.map +1 -1
- package/dist/operations/comment-on-post.test.js +8 -6
- package/dist/operations/comment-on-post.test.js.map +1 -1
- package/dist/operations/create-collection.d.ts +1 -1
- package/dist/operations/create-collection.d.ts.map +1 -1
- package/dist/operations/create-collection.js +3 -6
- package/dist/operations/create-collection.js.map +1 -1
- package/dist/operations/delete-collection.d.ts +1 -1
- package/dist/operations/delete-collection.d.ts.map +1 -1
- package/dist/operations/delete-collection.js +3 -6
- package/dist/operations/delete-collection.js.map +1 -1
- package/dist/operations/dismiss-errors.d.ts +7 -4
- package/dist/operations/dismiss-errors.d.ts.map +1 -1
- package/dist/operations/dismiss-errors.js +52 -33
- package/dist/operations/dismiss-errors.js.map +1 -1
- package/dist/operations/dismiss-errors.test.js +53 -6
- package/dist/operations/dismiss-errors.test.js.map +1 -1
- package/dist/operations/endorse-skills.test.d.ts +2 -0
- package/dist/operations/endorse-skills.test.d.ts.map +1 -0
- package/dist/operations/endorse-skills.test.js +70 -0
- package/dist/operations/endorse-skills.test.js.map +1 -0
- package/dist/operations/enrich-profile.test.d.ts +2 -0
- package/dist/operations/enrich-profile.test.d.ts.map +1 -0
- package/dist/operations/enrich-profile.test.js +73 -0
- package/dist/operations/enrich-profile.test.js.map +1 -0
- package/dist/operations/ephemeral-action.d.ts +1 -1
- package/dist/operations/ephemeral-action.d.ts.map +1 -1
- package/dist/operations/ephemeral-action.js +3 -6
- package/dist/operations/ephemeral-action.js.map +1 -1
- package/dist/operations/ephemeral-action.test.d.ts +2 -0
- package/dist/operations/ephemeral-action.test.d.ts.map +1 -0
- package/dist/operations/ephemeral-action.test.js +140 -0
- package/dist/operations/ephemeral-action.test.js.map +1 -0
- package/dist/operations/follow-person.test.d.ts +2 -0
- package/dist/operations/follow-person.test.d.ts.map +1 -0
- package/dist/operations/follow-person.test.js +57 -0
- package/dist/operations/follow-person.test.js.map +1 -0
- package/dist/operations/get-action-budget.d.ts +1 -1
- package/dist/operations/get-action-budget.d.ts.map +1 -1
- package/dist/operations/get-action-budget.js +3 -6
- package/dist/operations/get-action-budget.js.map +1 -1
- package/dist/operations/get-errors.d.ts +5 -1
- package/dist/operations/get-errors.d.ts.map +1 -1
- package/dist/operations/get-errors.js +55 -33
- package/dist/operations/get-errors.js.map +1 -1
- package/dist/operations/get-errors.test.js +54 -55
- package/dist/operations/get-errors.test.js.map +1 -1
- package/dist/operations/get-feed.d.ts +83 -4
- package/dist/operations/get-feed.d.ts.map +1 -1
- package/dist/operations/get-feed.js +400 -153
- package/dist/operations/get-feed.js.map +1 -1
- package/dist/operations/get-feed.test.js +416 -190
- package/dist/operations/get-feed.test.js.map +1 -1
- package/dist/operations/get-post-engagers.d.ts +6 -3
- package/dist/operations/get-post-engagers.d.ts.map +1 -1
- package/dist/operations/get-post-engagers.js +278 -78
- package/dist/operations/get-post-engagers.js.map +1 -1
- package/dist/operations/get-post-engagers.test.js +292 -14
- package/dist/operations/get-post-engagers.test.js.map +1 -1
- package/dist/operations/get-post-stats.d.ts +8 -3
- package/dist/operations/get-post-stats.d.ts.map +1 -1
- package/dist/operations/get-post-stats.js +101 -37
- package/dist/operations/get-post-stats.js.map +1 -1
- package/dist/operations/get-post-stats.test.js +137 -2
- package/dist/operations/get-post-stats.test.js.map +1 -1
- package/dist/operations/get-post.d.ts +9 -150
- package/dist/operations/get-post.d.ts.map +1 -1
- package/dist/operations/get-post.js +356 -210
- package/dist/operations/get-post.js.map +1 -1
- package/dist/operations/get-post.test.js +210 -387
- package/dist/operations/get-post.test.js.map +1 -1
- package/dist/operations/get-profile-activity.d.ts +13 -92
- package/dist/operations/get-profile-activity.d.ts.map +1 -1
- package/dist/operations/get-profile-activity.js +305 -105
- package/dist/operations/get-profile-activity.js.map +1 -1
- package/dist/operations/get-profile-activity.test.js +277 -158
- package/dist/operations/get-profile-activity.test.js.map +1 -1
- package/dist/operations/get-throttle-status.d.ts +1 -1
- package/dist/operations/get-throttle-status.d.ts.map +1 -1
- package/dist/operations/get-throttle-status.js +4 -10
- package/dist/operations/get-throttle-status.js.map +1 -1
- package/dist/operations/import-people-from-collection.d.ts +1 -1
- package/dist/operations/import-people-from-collection.d.ts.map +1 -1
- package/dist/operations/import-people-from-collection.js +3 -6
- package/dist/operations/import-people-from-collection.js.map +1 -1
- package/dist/operations/import-people-from-urls.d.ts +1 -1
- package/dist/operations/import-people-from-urls.d.ts.map +1 -1
- package/dist/operations/import-people-from-urls.js +3 -6
- package/dist/operations/import-people-from-urls.js.map +1 -1
- package/dist/operations/index.d.ts +2 -2
- package/dist/operations/index.d.ts.map +1 -1
- package/dist/operations/index.js +2 -1
- package/dist/operations/index.js.map +1 -1
- package/dist/operations/like-person-posts.test.d.ts +2 -0
- package/dist/operations/like-person-posts.test.d.ts.map +1 -0
- package/dist/operations/like-person-posts.test.js +103 -0
- package/dist/operations/like-person-posts.test.js.map +1 -0
- package/dist/operations/list-collections.d.ts +1 -1
- package/dist/operations/list-collections.d.ts.map +1 -1
- package/dist/operations/list-collections.js +3 -6
- package/dist/operations/list-collections.js.map +1 -1
- package/dist/operations/message-person.test.d.ts +2 -0
- package/dist/operations/message-person.test.d.ts.map +1 -0
- package/dist/operations/message-person.test.js +108 -0
- package/dist/operations/message-person.test.js.map +1 -0
- package/dist/operations/navigate-away.d.ts +14 -0
- package/dist/operations/navigate-away.d.ts.map +1 -0
- package/dist/operations/navigate-away.js +24 -0
- package/dist/operations/navigate-away.js.map +1 -0
- package/dist/operations/navigate-away.test.d.ts +2 -0
- package/dist/operations/navigate-away.test.d.ts.map +1 -0
- package/dist/operations/navigate-away.test.js +51 -0
- package/dist/operations/navigate-away.test.js.map +1 -0
- package/dist/operations/query-messages.d.ts +1 -1
- package/dist/operations/query-messages.d.ts.map +1 -1
- package/dist/operations/query-messages.js +3 -6
- package/dist/operations/query-messages.js.map +1 -1
- package/dist/operations/react-to-post.d.ts +3 -0
- package/dist/operations/react-to-post.d.ts.map +1 -1
- package/dist/operations/react-to-post.js +13 -15
- package/dist/operations/react-to-post.js.map +1 -1
- package/dist/operations/react-to-post.test.js +8 -5
- package/dist/operations/react-to-post.test.js.map +1 -1
- package/dist/operations/remove-connection.test.d.ts +2 -0
- package/dist/operations/remove-connection.test.d.ts.map +1 -0
- package/dist/operations/remove-connection.test.js +45 -0
- package/dist/operations/remove-connection.test.js.map +1 -0
- package/dist/operations/remove-people-from-collection.d.ts +1 -1
- package/dist/operations/remove-people-from-collection.d.ts.map +1 -1
- package/dist/operations/remove-people-from-collection.js +3 -6
- package/dist/operations/remove-people-from-collection.js.map +1 -1
- package/dist/operations/resolve-linkedin-entity.d.ts.map +1 -1
- package/dist/operations/resolve-linkedin-entity.js +2 -2
- package/dist/operations/resolve-linkedin-entity.js.map +1 -1
- package/dist/operations/resolve-linkedin-entity.test.d.ts +2 -0
- package/dist/operations/resolve-linkedin-entity.test.d.ts.map +1 -0
- package/dist/operations/resolve-linkedin-entity.test.js +343 -0
- package/dist/operations/resolve-linkedin-entity.test.js.map +1 -0
- package/dist/operations/scrape-messaging-history.d.ts +2 -1
- package/dist/operations/scrape-messaging-history.d.ts.map +1 -1
- package/dist/operations/scrape-messaging-history.js +121 -18
- package/dist/operations/scrape-messaging-history.js.map +1 -1
- package/dist/operations/scrape-messaging-history.test.js +134 -12
- package/dist/operations/scrape-messaging-history.test.js.map +1 -1
- package/dist/operations/search-posts.d.ts +20 -112
- package/dist/operations/search-posts.d.ts.map +1 -1
- package/dist/operations/search-posts.js +369 -170
- package/dist/operations/search-posts.js.map +1 -1
- package/dist/operations/search-posts.test.js +273 -234
- package/dist/operations/search-posts.test.js.map +1 -1
- package/dist/operations/send-inmail.test.d.ts +2 -0
- package/dist/operations/send-inmail.test.d.ts.map +1 -0
- package/dist/operations/send-inmail.test.js +108 -0
- package/dist/operations/send-inmail.test.js.map +1 -0
- package/dist/operations/send-invite.test.d.ts +2 -0
- package/dist/operations/send-invite.test.d.ts.map +1 -0
- package/dist/operations/send-invite.test.js +59 -0
- package/dist/operations/send-invite.test.js.map +1 -0
- package/dist/operations/types.d.ts +24 -1
- package/dist/operations/types.d.ts.map +1 -1
- package/dist/operations/types.js +13 -1
- package/dist/operations/types.js.map +1 -1
- package/dist/operations/visit-profile.d.ts +1 -1
- package/dist/operations/visit-profile.d.ts.map +1 -1
- package/dist/operations/visit-profile.js +3 -6
- package/dist/operations/visit-profile.js.map +1 -1
- package/dist/services/account-resolution.d.ts +9 -4
- package/dist/services/account-resolution.d.ts.map +1 -1
- package/dist/services/account-resolution.js +60 -5
- package/dist/services/account-resolution.js.map +1 -1
- package/dist/services/app.d.ts +6 -2
- package/dist/services/app.d.ts.map +1 -1
- package/dist/services/app.js +18 -6
- package/dist/services/app.js.map +1 -1
- package/dist/services/app.test.js +41 -7
- package/dist/services/app.test.js.map +1 -1
- package/dist/services/campaign.d.ts +34 -2
- package/dist/services/campaign.d.ts.map +1 -1
- package/dist/services/campaign.js +108 -1
- package/dist/services/campaign.js.map +1 -1
- package/dist/services/errors.d.ts +2 -1
- package/dist/services/errors.d.ts.map +1 -1
- package/dist/services/errors.js +6 -3
- package/dist/services/errors.js.map +1 -1
- package/dist/services/index.d.ts +0 -1
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +0 -1
- package/dist/services/index.js.map +1 -1
- package/dist/services/instance-context.d.ts +5 -1
- package/dist/services/instance-context.d.ts.map +1 -1
- package/dist/services/instance-context.js +87 -28
- package/dist/services/instance-context.js.map +1 -1
- package/dist/services/instance-context.test.js +5 -1
- package/dist/services/instance-context.test.js.map +1 -1
- package/dist/services/instance-lifecycle.d.ts.map +1 -1
- package/dist/services/instance-lifecycle.js +32 -1
- package/dist/services/instance-lifecycle.js.map +1 -1
- package/dist/services/instance-lifecycle.test.js +52 -1
- package/dist/services/instance-lifecycle.test.js.map +1 -1
- package/dist/services/instance.d.ts +19 -7
- package/dist/services/instance.d.ts.map +1 -1
- package/dist/services/instance.js +56 -17
- package/dist/services/instance.js.map +1 -1
- package/dist/services/instance.test.js +65 -0
- package/dist/services/instance.test.js.map +1 -1
- package/dist/services/launcher.d.ts +47 -3
- package/dist/services/launcher.d.ts.map +1 -1
- package/dist/services/launcher.js +205 -33
- package/dist/services/launcher.js.map +1 -1
- package/dist/services/launcher.test.js +133 -6
- package/dist/services/launcher.test.js.map +1 -1
- package/dist/services/status.d.ts +6 -2
- package/dist/services/status.d.ts.map +1 -1
- package/dist/services/status.js +67 -34
- package/dist/services/status.js.map +1 -1
- package/dist/services/status.test.js +9 -2
- package/dist/services/status.test.js.map +1 -1
- package/dist/testing/e2e-helpers.d.ts +23 -1
- package/dist/testing/e2e-helpers.d.ts.map +1 -1
- package/dist/testing/e2e-helpers.js +110 -5
- package/dist/testing/e2e-helpers.js.map +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/types/account.d.ts +1 -1
- package/dist/types/feed.d.ts +1 -3
- package/dist/types/feed.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/cdp-port.d.ts.map +1 -1
- package/dist/utils/cdp-port.js +3 -1
- package/dist/utils/cdp-port.js.map +1 -1
- package/dist/utils/cdp-port.test.js +1 -1
- package/dist/utils/cdp-port.test.js.map +1 -1
- package/dist/utils/delay.d.ts +79 -0
- package/dist/utils/delay.d.ts.map +1 -1
- package/dist/utils/delay.js +118 -0
- package/dist/utils/delay.js.map +1 -1
- package/dist/utils/delay.test.js +111 -1
- package/dist/utils/delay.test.js.map +1 -1
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +2 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/session-pacer.d.ts +27 -0
- package/dist/utils/session-pacer.d.ts.map +1 -0
- package/dist/utils/session-pacer.js +55 -0
- package/dist/utils/session-pacer.js.map +1 -0
- package/dist/utils/session-pacer.test.d.ts +2 -0
- package/dist/utils/session-pacer.test.d.ts.map +1 -0
- package/dist/utils/session-pacer.test.js +111 -0
- package/dist/utils/session-pacer.test.js.map +1 -0
- package/package.json +1 -1
- package/dist/linkedin/__tests__/selectors.integration.test.d.ts +0 -2
- package/dist/linkedin/__tests__/selectors.integration.test.d.ts.map +0 -1
- package/dist/linkedin/__tests__/selectors.integration.test.js +0 -258
- package/dist/linkedin/__tests__/selectors.integration.test.js.map +0 -1
- package/dist/types/search-posts.d.ts +0 -22
- package/dist/types/search-posts.d.ts.map +0 -1
- package/dist/types/search-posts.js +0 -4
- package/dist/types/search-posts.js.map +0 -1
- package/dist/voyager/index.d.ts +0 -2
- package/dist/voyager/index.d.ts.map +0 -1
- package/dist/voyager/index.js +0 -4
- package/dist/voyager/index.js.map +0 -1
- package/dist/voyager/interceptor.d.ts +0 -100
- package/dist/voyager/interceptor.d.ts.map +0 -1
- package/dist/voyager/interceptor.integration.test.d.ts +0 -2
- package/dist/voyager/interceptor.integration.test.d.ts.map +0 -1
- package/dist/voyager/interceptor.integration.test.js +0 -89
- package/dist/voyager/interceptor.integration.test.js.map +0 -1
- package/dist/voyager/interceptor.js +0 -235
- package/dist/voyager/interceptor.js.map +0 -1
- package/dist/voyager/interceptor.test.d.ts +0 -2
- package/dist/voyager/interceptor.test.d.ts.map +0 -1
- package/dist/voyager/interceptor.test.js +0 -372
- package/dist/voyager/interceptor.test.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ActionBudget } from "../types/index.js";
|
|
2
|
-
import type
|
|
2
|
+
import { type ConnectionOptions } from "./types.js";
|
|
3
3
|
export type GetActionBudgetInput = ConnectionOptions;
|
|
4
4
|
export type GetActionBudgetOutput = ActionBudget;
|
|
5
5
|
export declare function getActionBudget(input: GetActionBudgetInput): Promise<GetActionBudgetOutput>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-action-budget.d.ts","sourceRoot":"","sources":["../../src/operations/get-action-budget.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"get-action-budget.d.ts","sourceRoot":"","sources":["../../src/operations/get-action-budget.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD,OAAO,EAAmB,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAErE,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;AAErD,MAAM,MAAM,qBAAqB,GAAG,YAAY,CAAC;AAEjD,wBAAsB,eAAe,CACnC,KAAK,EAAE,oBAAoB,GAC1B,OAAO,CAAC,qBAAqB,CAAC,CAahC"}
|
|
@@ -3,13 +3,10 @@
|
|
|
3
3
|
import { resolveAccount } from "../services/account-resolution.js";
|
|
4
4
|
import { withDatabase } from "../services/instance-context.js";
|
|
5
5
|
import { ActionBudgetRepository } from "../db/index.js";
|
|
6
|
-
import {
|
|
6
|
+
import { buildCdpOptions } from "./types.js";
|
|
7
7
|
export async function getActionBudget(input) {
|
|
8
|
-
const cdpPort = input.cdpPort
|
|
9
|
-
const accountId = await resolveAccount(cdpPort,
|
|
10
|
-
...(input.cdpHost !== undefined && { host: input.cdpHost }),
|
|
11
|
-
...(input.allowRemote !== undefined && { allowRemote: input.allowRemote }),
|
|
12
|
-
});
|
|
8
|
+
const cdpPort = input.cdpPort;
|
|
9
|
+
const accountId = await resolveAccount(cdpPort, buildCdpOptions(input));
|
|
13
10
|
return withDatabase(accountId, ({ db }) => {
|
|
14
11
|
const repo = new ActionBudgetRepository(db);
|
|
15
12
|
const entries = repo.getActionBudget();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-action-budget.js","sourceRoot":"","sources":["../../src/operations/get-action-budget.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAGpC,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"get-action-budget.js","sourceRoot":"","sources":["../../src/operations/get-action-budget.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAGpC,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,eAAe,EAA0B,MAAM,YAAY,CAAC;AAMrE,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,KAA2B;IAE3B,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IAE9B,MAAM,SAAS,GAAG,MAAM,cAAc,CAAC,OAAO,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;IAExE,OAAO,YAAY,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;QACxC,MAAM,IAAI,GAAG,IAAI,sBAAsB,CAAC,EAAE,CAAC,CAAC;QAC5C,MAAM,OAAO,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QACvC,OAAO;YACL,OAAO;YACP,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SAC/B,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InstancePopup, UIHealthStatus } from "../types/index.js";
|
|
2
|
-
import type
|
|
2
|
+
import { type ConnectionOptions } from "./types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Input for the get-errors operation.
|
|
5
5
|
*/
|
|
@@ -19,6 +19,10 @@ export interface GetErrorsOutput extends UIHealthStatus {
|
|
|
19
19
|
* aggregated UI health status including active instance issues,
|
|
20
20
|
* popup overlay state, and instance UI popups.
|
|
21
21
|
*
|
|
22
|
+
* When the launcher is not available (e.g. connecting directly to an
|
|
23
|
+
* instance), launcher health is reported as healthy and only instance
|
|
24
|
+
* popups are checked.
|
|
25
|
+
*
|
|
22
26
|
* Instance popups are detected on a best-effort basis: if the instance
|
|
23
27
|
* is not running or the UI target is unavailable, the operation still
|
|
24
28
|
* succeeds and returns an empty `instancePopups` array.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-errors.d.ts","sourceRoot":"","sources":["../../src/operations/get-errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-errors.d.ts","sourceRoot":"","sources":["../../src/operations/get-errors.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKvE,OAAO,EAAmB,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,cAAc;IACrD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,4EAA4E;IAC5E,QAAQ,CAAC,cAAc,EAAE,SAAS,aAAa,EAAE,CAAC;CACnD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,SAAS,CAC7B,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,eAAe,CAAC,CAmD1B"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
2
|
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
-
import {
|
|
3
|
+
import { discoverInstancePort, resolveInstancePort } from "../cdp/index.js";
|
|
4
4
|
import { resolveAccount } from "../services/account-resolution.js";
|
|
5
5
|
import { InstanceService } from "../services/instance.js";
|
|
6
6
|
import { LauncherService } from "../services/launcher.js";
|
|
7
|
-
import {
|
|
7
|
+
import { isLoopbackAddress } from "../utils/loopback.js";
|
|
8
|
+
import { buildCdpOptions } from "./types.js";
|
|
8
9
|
/**
|
|
9
10
|
* Query the current error/dialog/popup state of a LinkedHelper instance.
|
|
10
11
|
*
|
|
@@ -12,56 +13,77 @@ import { DEFAULT_CDP_PORT } from "../constants.js";
|
|
|
12
13
|
* aggregated UI health status including active instance issues,
|
|
13
14
|
* popup overlay state, and instance UI popups.
|
|
14
15
|
*
|
|
16
|
+
* When the launcher is not available (e.g. connecting directly to an
|
|
17
|
+
* instance), launcher health is reported as healthy and only instance
|
|
18
|
+
* popups are checked.
|
|
19
|
+
*
|
|
15
20
|
* Instance popups are detected on a best-effort basis: if the instance
|
|
16
21
|
* is not running or the UI target is unavailable, the operation still
|
|
17
22
|
* succeeds and returns an empty `instancePopups` array.
|
|
18
23
|
*/
|
|
19
24
|
export async function getErrors(input) {
|
|
20
|
-
const cdpPort = input.cdpPort
|
|
21
|
-
const cdpOptions =
|
|
22
|
-
...(input.cdpHost !== undefined && { host: input.cdpHost }),
|
|
23
|
-
...(input.allowRemote !== undefined && { allowRemote: input.allowRemote }),
|
|
24
|
-
};
|
|
25
|
+
const cdpPort = await resolveInstancePort(input.cdpPort, input.cdpHost);
|
|
26
|
+
const cdpOptions = buildCdpOptions(input);
|
|
25
27
|
const accountId = await resolveAccount(cdpPort, cdpOptions);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
// Launcher health check (best-effort — returns default healthy
|
|
29
|
+
// status when connected directly to an instance)
|
|
30
|
+
let health = {
|
|
31
|
+
issues: [],
|
|
32
|
+
popup: null,
|
|
33
|
+
instancePopups: [],
|
|
34
|
+
healthy: true,
|
|
35
|
+
};
|
|
36
|
+
let connectedToLauncher = false;
|
|
28
37
|
try {
|
|
29
|
-
|
|
30
|
-
|
|
38
|
+
const launcher = new LauncherService(cdpPort, cdpOptions);
|
|
39
|
+
try {
|
|
40
|
+
await launcher.connect();
|
|
41
|
+
connectedToLauncher = true;
|
|
42
|
+
health = await launcher.checkUIHealth(accountId);
|
|
43
|
+
}
|
|
44
|
+
finally {
|
|
45
|
+
launcher.disconnect();
|
|
46
|
+
}
|
|
31
47
|
}
|
|
32
|
-
|
|
33
|
-
|
|
48
|
+
catch {
|
|
49
|
+
// Launcher not available — proceed with instance-only health info
|
|
50
|
+
}
|
|
51
|
+
// Best-effort: detect instance UI popups if the UI target is available.
|
|
52
|
+
// When connected to a launcher, discover the instance's dynamic CDP port
|
|
53
|
+
// first — the launcher port does not host instance UI targets.
|
|
54
|
+
// Discovery only works locally (process inspection), so skip for remote hosts.
|
|
55
|
+
const isLocal = input.cdpHost === undefined || isLoopbackAddress(input.cdpHost);
|
|
56
|
+
let instancePopups = [];
|
|
57
|
+
if (connectedToLauncher && isLocal) {
|
|
58
|
+
const instancePort = await discoverInstancePort(cdpPort).catch(() => null);
|
|
59
|
+
if (instancePort !== null) {
|
|
60
|
+
instancePopups = await detectInstancePopups(instancePort, cdpOptions);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else if (!connectedToLauncher) {
|
|
64
|
+
// Direct instance connection — cdpPort IS the instance port
|
|
65
|
+
instancePopups = await detectInstancePopups(cdpPort, cdpOptions);
|
|
34
66
|
}
|
|
35
|
-
// Best-effort: detect instance UI popups if the instance is running.
|
|
36
|
-
const instancePopups = await detectInstancePopups(cdpPort, input.cdpHost, cdpOptions);
|
|
37
67
|
const healthy = health.healthy && instancePopups.length === 0;
|
|
38
68
|
return { accountId, ...health, healthy, instancePopups };
|
|
39
69
|
}
|
|
40
70
|
/**
|
|
41
|
-
* Attempt to detect instance UI popups via
|
|
71
|
+
* Attempt to detect instance UI popups via {@link InstanceService.connectUiOnly}.
|
|
42
72
|
*
|
|
43
|
-
* Returns an empty array when the
|
|
44
|
-
*
|
|
73
|
+
* Returns an empty array when the UI target is unavailable or the
|
|
74
|
+
* connection fails for any reason.
|
|
45
75
|
*/
|
|
46
|
-
async function detectInstancePopups(cdpPort,
|
|
76
|
+
async function detectInstancePopups(cdpPort, cdpOptions) {
|
|
77
|
+
const instance = new InstanceService(cdpPort, cdpOptions);
|
|
47
78
|
try {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const hasUI = targets.some((t) => t.type === "page" && t.url.includes("index.html"));
|
|
51
|
-
if (!hasLinkedIn || !hasUI) {
|
|
52
|
-
return [];
|
|
53
|
-
}
|
|
54
|
-
const instance = new InstanceService(cdpPort, cdpOptions);
|
|
55
|
-
try {
|
|
56
|
-
await instance.connect();
|
|
57
|
-
return await instance.getInstancePopups();
|
|
58
|
-
}
|
|
59
|
-
finally {
|
|
60
|
-
instance.disconnect();
|
|
61
|
-
}
|
|
79
|
+
await instance.connectUiOnly();
|
|
80
|
+
return await instance.getInstancePopups();
|
|
62
81
|
}
|
|
63
82
|
catch {
|
|
64
83
|
return [];
|
|
65
84
|
}
|
|
85
|
+
finally {
|
|
86
|
+
instance.disconnect();
|
|
87
|
+
}
|
|
66
88
|
}
|
|
67
89
|
//# sourceMappingURL=get-errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-errors.js","sourceRoot":"","sources":["../../src/operations/get-errors.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;
|
|
1
|
+
{"version":3,"file":"get-errors.js","sourceRoot":"","sources":["../../src/operations/get-errors.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE5E,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAA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,KAAK,CAC5D,GAAG,EAAE,CAAC,IAAI,CACX,CAAC;QACF,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;YAC1B,cAAc,GAAG,MAAM,oBAAoB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;SAAM,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAChC,4DAA4D;QAC5D,cAAc,GAAG,MAAM,oBAAoB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACnE,CAAC;IAED,MAAM,OAAO,GACX,MAAM,CAAC,OAAO,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,CAAC;IAEhD,OAAO,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;AAC3D,CAAC;AAED;;;;;GAKG;AACH,KAAK,UAAU,oBAAoB,CACjC,OAAe,EACf,UAAoD;IAEpD,MAAM,QAAQ,GAAG,IAAI,eAAe,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAC1D,IAAI,CAAC;QACH,MAAM,QAAQ,CAAC,aAAa,EAAE,CAAC;QAC/B,OAAO,MAAM,QAAQ,CAAC,iBAAiB,EAAE,CAAC;IAC5C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;YAAS,CAAC;QACT,QAAQ,CAAC,UAAU,EAAE,CAAC;IACxB,CAAC;AACH,CAAC"}
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
2
|
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
3
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
4
|
+
vi.mock("../cdp/index.js", async (importOriginal) => {
|
|
5
|
+
const original = await importOriginal();
|
|
6
|
+
return {
|
|
7
|
+
...original,
|
|
8
|
+
discoverInstancePort: vi.fn().mockResolvedValue(null),
|
|
9
|
+
};
|
|
10
|
+
});
|
|
4
11
|
vi.mock("../services/account-resolution.js", () => ({
|
|
5
12
|
resolveAccount: vi.fn(),
|
|
6
13
|
}));
|
|
7
14
|
vi.mock("../services/launcher.js", () => ({
|
|
8
15
|
LauncherService: vi.fn(),
|
|
9
16
|
}));
|
|
10
|
-
vi.mock("../cdp/index.js", () => ({
|
|
11
|
-
discoverTargets: vi.fn(),
|
|
12
|
-
}));
|
|
13
17
|
vi.mock("../services/instance.js", () => ({
|
|
14
18
|
InstanceService: vi.fn(),
|
|
15
19
|
}));
|
|
16
|
-
import {
|
|
20
|
+
import { discoverInstancePort } from "../cdp/index.js";
|
|
17
21
|
import { resolveAccount } from "../services/account-resolution.js";
|
|
18
22
|
import { InstanceService } from "../services/instance.js";
|
|
19
23
|
import { LauncherService } from "../services/launcher.js";
|
|
@@ -21,12 +25,27 @@ import { getErrors } from "./get-errors.js";
|
|
|
21
25
|
describe("getErrors", () => {
|
|
22
26
|
beforeEach(() => {
|
|
23
27
|
vi.clearAllMocks();
|
|
24
|
-
// Default:
|
|
25
|
-
|
|
28
|
+
// Default: connectUiOnly rejects (instance not running)
|
|
29
|
+
mockInstance({ connectFails: true });
|
|
26
30
|
});
|
|
27
31
|
afterEach(() => {
|
|
28
32
|
vi.restoreAllMocks();
|
|
29
33
|
});
|
|
34
|
+
function mockInstance(opts) {
|
|
35
|
+
const mock = {
|
|
36
|
+
connectUiOnly: opts.connectFails
|
|
37
|
+
? vi.fn().mockRejectedValue(new Error("UI target not found"))
|
|
38
|
+
: vi.fn().mockResolvedValue(undefined),
|
|
39
|
+
disconnect: vi.fn(),
|
|
40
|
+
getInstancePopups: opts.getPopupsFails
|
|
41
|
+
? vi.fn().mockRejectedValue(new Error("DOM error"))
|
|
42
|
+
: vi.fn().mockResolvedValue(opts.popups ?? []),
|
|
43
|
+
};
|
|
44
|
+
vi.mocked(InstanceService).mockImplementation(function () {
|
|
45
|
+
return mock;
|
|
46
|
+
});
|
|
47
|
+
return mock;
|
|
48
|
+
}
|
|
30
49
|
function mockLauncher(health) {
|
|
31
50
|
const mock = {
|
|
32
51
|
connect: vi.fn().mockResolvedValue(undefined),
|
|
@@ -99,7 +118,7 @@ describe("getErrors", () => {
|
|
|
99
118
|
allowRemote: true,
|
|
100
119
|
});
|
|
101
120
|
});
|
|
102
|
-
it("disconnects launcher
|
|
121
|
+
it("disconnects launcher and returns healthy status when launcher throws", async () => {
|
|
103
122
|
vi.mocked(resolveAccount).mockResolvedValue(1);
|
|
104
123
|
const mock = {
|
|
105
124
|
connect: vi.fn().mockResolvedValue(undefined),
|
|
@@ -109,8 +128,11 @@ describe("getErrors", () => {
|
|
|
109
128
|
vi.mocked(LauncherService).mockImplementation(function () {
|
|
110
129
|
return mock;
|
|
111
130
|
});
|
|
112
|
-
await
|
|
131
|
+
const result = await getErrors({ cdpPort: 9222 });
|
|
113
132
|
expect(mock.disconnect).toHaveBeenCalledOnce();
|
|
133
|
+
expect(result.healthy).toBe(true);
|
|
134
|
+
expect(result.issues).toEqual([]);
|
|
135
|
+
expect(result.instancePopups).toEqual([]);
|
|
114
136
|
});
|
|
115
137
|
it("propagates resolveAccount errors", async () => {
|
|
116
138
|
vi.mocked(resolveAccount).mockRejectedValue(new Error("connection refused"));
|
|
@@ -118,84 +140,61 @@ describe("getErrors", () => {
|
|
|
118
140
|
});
|
|
119
141
|
it("includes instance popups when instance is running", async () => {
|
|
120
142
|
vi.mocked(resolveAccount).mockResolvedValue(1);
|
|
143
|
+
vi.mocked(discoverInstancePort).mockResolvedValue(9223);
|
|
121
144
|
mockLauncher({ healthy: true, issues: [], popup: null, instancePopups: [] });
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
{ id: "t2", type: "page", title: "LH", url: "file:///index.html", description: "", devtoolsFrontendUrl: "", webSocketDebuggerUrl: "" },
|
|
125
|
-
]);
|
|
126
|
-
const mockInstance = {
|
|
127
|
-
connect: vi.fn().mockResolvedValue(undefined),
|
|
128
|
-
disconnect: vi.fn(),
|
|
129
|
-
getInstancePopups: vi.fn().mockResolvedValue([
|
|
145
|
+
mockInstance({
|
|
146
|
+
popups: [
|
|
130
147
|
{ title: "Failed to initialize UI", description: "AsyncHandlerError", closable: true },
|
|
131
|
-
]
|
|
132
|
-
};
|
|
133
|
-
vi.mocked(InstanceService).mockImplementation(function () {
|
|
134
|
-
return mockInstance;
|
|
148
|
+
],
|
|
135
149
|
});
|
|
136
150
|
const result = await getErrors({ cdpPort: 9222 });
|
|
151
|
+
expect(discoverInstancePort).toHaveBeenCalledWith(9222);
|
|
152
|
+
expect(InstanceService).toHaveBeenCalledWith(9223, expect.anything());
|
|
137
153
|
expect(result.instancePopups).toHaveLength(1);
|
|
138
154
|
expect(result.instancePopups[0]?.title).toBe("Failed to initialize UI");
|
|
139
155
|
expect(result.healthy).toBe(false);
|
|
140
156
|
});
|
|
141
157
|
it("marks unhealthy when instance popups are present even if launcher is healthy", async () => {
|
|
142
158
|
vi.mocked(resolveAccount).mockResolvedValue(1);
|
|
159
|
+
vi.mocked(discoverInstancePort).mockResolvedValue(9223);
|
|
143
160
|
mockLauncher({ healthy: true, issues: [], popup: null, instancePopups: [] });
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
{ id: "t2", type: "page", title: "LH", url: "file:///index.html", description: "", devtoolsFrontendUrl: "", webSocketDebuggerUrl: "" },
|
|
147
|
-
]);
|
|
148
|
-
const mockInstance = {
|
|
149
|
-
connect: vi.fn().mockResolvedValue(undefined),
|
|
150
|
-
disconnect: vi.fn(),
|
|
151
|
-
getInstancePopups: vi.fn().mockResolvedValue([
|
|
152
|
-
{ title: "Error popup", closable: false },
|
|
153
|
-
]),
|
|
154
|
-
};
|
|
155
|
-
vi.mocked(InstanceService).mockImplementation(function () {
|
|
156
|
-
return mockInstance;
|
|
161
|
+
mockInstance({
|
|
162
|
+
popups: [{ title: "Error popup", closable: false }],
|
|
157
163
|
});
|
|
158
164
|
const result = await getErrors({ cdpPort: 9222 });
|
|
159
165
|
expect(result.healthy).toBe(false);
|
|
160
166
|
expect(result.instancePopups).toHaveLength(1);
|
|
161
167
|
});
|
|
162
|
-
it("returns empty instancePopups when
|
|
168
|
+
it("returns empty instancePopups when UI target is absent", async () => {
|
|
163
169
|
vi.mocked(resolveAccount).mockResolvedValue(1);
|
|
164
170
|
mockLauncher({ healthy: true, issues: [], popup: null, instancePopups: [] });
|
|
165
|
-
//
|
|
166
|
-
vi.mocked(discoverTargets).mockResolvedValue([
|
|
167
|
-
{ id: "t1", type: "page", title: "Launcher", url: "file:///launcher.html", description: "", devtoolsFrontendUrl: "", webSocketDebuggerUrl: "" },
|
|
168
|
-
]);
|
|
171
|
+
// Default beforeEach already sets connectFails: true
|
|
169
172
|
const result = await getErrors({ cdpPort: 9222 });
|
|
170
173
|
expect(result.instancePopups).toEqual([]);
|
|
171
174
|
expect(result.healthy).toBe(true);
|
|
172
175
|
});
|
|
173
|
-
it("
|
|
176
|
+
it("disconnects instance service even when getInstancePopups fails", async () => {
|
|
174
177
|
vi.mocked(resolveAccount).mockResolvedValue(1);
|
|
178
|
+
vi.mocked(discoverInstancePort).mockResolvedValue(9223);
|
|
175
179
|
mockLauncher({ healthy: true, issues: [], popup: null, instancePopups: [] });
|
|
176
|
-
|
|
180
|
+
const inst = mockInstance({ getPopupsFails: true });
|
|
177
181
|
const result = await getErrors({ cdpPort: 9222 });
|
|
178
182
|
expect(result.instancePopups).toEqual([]);
|
|
179
|
-
expect(
|
|
183
|
+
expect(inst.disconnect).toHaveBeenCalledOnce();
|
|
180
184
|
});
|
|
181
|
-
it("
|
|
185
|
+
it("detects popups when LinkedIn webview is absent (UI-only start)", async () => {
|
|
182
186
|
vi.mocked(resolveAccount).mockResolvedValue(1);
|
|
187
|
+
vi.mocked(discoverInstancePort).mockResolvedValue(9223);
|
|
183
188
|
mockLauncher({ healthy: true, issues: [], popup: null, instancePopups: [] });
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
const mockInstance = {
|
|
189
|
-
connect: vi.fn().mockResolvedValue(undefined),
|
|
190
|
-
disconnect: vi.fn(),
|
|
191
|
-
getInstancePopups: vi.fn().mockRejectedValue(new Error("DOM error")),
|
|
192
|
-
};
|
|
193
|
-
vi.mocked(InstanceService).mockImplementation(function () {
|
|
194
|
-
return mockInstance;
|
|
189
|
+
mockInstance({
|
|
190
|
+
popups: [
|
|
191
|
+
{ title: "Session expired", closable: true },
|
|
192
|
+
],
|
|
195
193
|
});
|
|
196
194
|
const result = await getErrors({ cdpPort: 9222 });
|
|
197
|
-
expect(result.instancePopups).
|
|
198
|
-
expect(
|
|
195
|
+
expect(result.instancePopups).toHaveLength(1);
|
|
196
|
+
expect(result.instancePopups[0]?.title).toBe("Session expired");
|
|
197
|
+
expect(result.healthy).toBe(false);
|
|
199
198
|
});
|
|
200
199
|
});
|
|
201
200
|
//# sourceMappingURL=get-errors.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-errors.test.js","sourceRoot":"","sources":["../../src/operations/get-errors.test.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAEzE,EAAE,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"get-errors.test.js","sourceRoot":"","sources":["../../src/operations/get-errors.test.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAEzE,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE;IAClD,MAAM,QAAQ,GAAG,MAAM,cAAc,EAAoC,CAAC;IAC1E,OAAO;QACL,GAAG,QAAQ;QACX,oBAAoB,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB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CAAC,CAAC;QAC9C,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAChE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { FeedPost } from "../types/feed.js";
|
|
2
|
+
import { CDPClient } from "../cdp/client.js";
|
|
3
|
+
import type { HumanizedMouse } from "../linkedin/humanized-mouse.js";
|
|
4
|
+
import { delay as utilsDelay } from "../utils/delay.js";
|
|
2
5
|
import type { ConnectionOptions } from "./types.js";
|
|
3
6
|
/**
|
|
4
7
|
* Input for the get-feed operation.
|
|
@@ -8,6 +11,8 @@ export interface GetFeedInput extends ConnectionOptions {
|
|
|
8
11
|
readonly count?: number | undefined;
|
|
9
12
|
/** Cursor token from a previous get-feed call for the next page. */
|
|
10
13
|
readonly cursor?: string | undefined;
|
|
14
|
+
/** Optional humanized mouse for natural cursor movement and scrolling. */
|
|
15
|
+
readonly mouse?: HumanizedMouse | null | undefined;
|
|
11
16
|
}
|
|
12
17
|
/**
|
|
13
18
|
* Output from the get-feed operation.
|
|
@@ -18,13 +23,87 @@ export interface GetFeedOutput {
|
|
|
18
23
|
/** Cursor token for retrieving the next page, or null if no more pages. */
|
|
19
24
|
readonly nextCursor: string | null;
|
|
20
25
|
}
|
|
26
|
+
/** @internal Exported for reuse by search-posts. */
|
|
27
|
+
export interface RawDomPost {
|
|
28
|
+
url: string | null;
|
|
29
|
+
authorName: string | null;
|
|
30
|
+
authorHeadline: string | null;
|
|
31
|
+
authorProfileUrl: string | null;
|
|
32
|
+
text: string | null;
|
|
33
|
+
mediaType: string | null;
|
|
34
|
+
reactionCount: number;
|
|
35
|
+
commentCount: number;
|
|
36
|
+
shareCount: number;
|
|
37
|
+
timestamp: string | null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* JavaScript source evaluated inside the LinkedIn page context via
|
|
41
|
+
* `Runtime.evaluate`. Returns an array of {@link RawDomPost} objects
|
|
42
|
+
* (without URNs — those are extracted separately via the three-dot menu).
|
|
43
|
+
*
|
|
44
|
+
* ## Discovery strategy (2026-03 onwards)
|
|
45
|
+
*
|
|
46
|
+
* LinkedIn's SSR feed uses `div[data-testid="mainFeed"]` as the feed
|
|
47
|
+
* list (`role="list"`) and `div[role="listitem"]` for each post.
|
|
48
|
+
* CSS class names are obfuscated hashes (CSS Modules), so the script
|
|
49
|
+
* relies on semantic attributes and structural heuristics.
|
|
50
|
+
*
|
|
51
|
+
* Post URNs are NOT available in the DOM. They are extracted in a
|
|
52
|
+
* separate phase by opening each post's three-dot menu, clicking
|
|
53
|
+
* "Copy link to post", and deriving the URN from the captured URL.
|
|
54
|
+
*/
|
|
55
|
+
declare const SCRAPE_FEED_POSTS_SCRIPT = "(() => {\n const posts = [];\n\n // --- Step 1: Find the feed list via data-testid ---\n const feedList = document.querySelector('[data-testid=\"mainFeed\"]');\n if (!feedList) return posts;\n\n // --- Step 2: Iterate listitem children ---\n const items = feedList.querySelectorAll('div[role=\"listitem\"]');\n for (const wrapper of items) {\n // The listitem wraps the actual post content in nested divs.\n // Some listitems may be zero-height (virtualized/hidden) or\n // non-post items (composer, suggestions).\n const item = wrapper;\n if (item.offsetHeight < 100) continue;\n\n // Detect real posts: must have a three-dot menu button\n const menuBtn = item.querySelector('button[aria-label^=\"Open control menu for post\"]');\n if (!menuBtn) continue;\n\n // --- Author info ---\n let authorName = null;\n let authorHeadline = null;\n let authorProfileUrl = null;\n\n const authorLink = item.querySelector('a[href*=\"/in/\"], a[href*=\"/company/\"]');\n if (authorLink) {\n authorProfileUrl = authorLink.href.split('?')[0] || null;\n const nameEl = authorLink.querySelector('span[dir=\"ltr\"], span[aria-hidden=\"true\"]')\n || authorLink;\n const rawName = (nameEl.textContent || '').trim();\n authorName = rawName || null;\n }\n\n // Author headline: look for a short descriptive text near the author.\n const allSpans = item.querySelectorAll('span');\n for (const span of allSpans) {\n const txt = (span.textContent || '').trim();\n if (\n txt &&\n txt.length > 5 &&\n txt.length < 200 &&\n txt !== authorName &&\n !txt.match(/^\\d+[smhdw]$/) &&\n !txt.match(/^\\d[\\d,]*\\s+(reactions?|comments?|reposts?|likes?)$/i) &&\n !txt.match(/^Follow$|^Promoted$/i)\n ) {\n authorHeadline = txt;\n break;\n }\n }\n\n // --- Post text ---\n let text = null;\n const ltrSpans = item.querySelectorAll('span[dir=\"ltr\"]');\n let longestText = '';\n for (const span of ltrSpans) {\n const txt = (span.textContent || '').trim();\n if (txt.length > longestText.length && txt !== authorName && txt !== authorHeadline) {\n longestText = txt;\n }\n }\n if (longestText.length > 20) {\n text = longestText;\n }\n\n // --- Media type ---\n let mediaType = null;\n if (item.querySelector('video')) {\n mediaType = 'video';\n } else if (item.querySelector('img[src*=\"media.licdn.com\"]')) {\n const imgs = item.querySelectorAll('img[src*=\"media.licdn.com\"]');\n for (const img of imgs) {\n if (img.offsetHeight > 100) { mediaType = 'image'; break; }\n }\n }\n\n // --- Engagement counts ---\n const itemText = item.textContent || '';\n\n function parseCount(pattern) {\n const m = itemText.match(pattern);\n if (!m) return 0;\n const raw = m[1].replace(/,/g, '');\n const num = parseInt(raw, 10);\n return isNaN(num) ? 0 : num;\n }\n\n const reactionCount = parseCount(/(\\d[\\d,]*)\\s+reactions?/i);\n const commentCount = parseCount(/(\\d[\\d,]*)\\s+comments?/i);\n const shareCount = parseCount(/(\\d[\\d,]*)\\s+reposts?/i);\n\n // --- Timestamp ---\n let timestamp = null;\n const timeEl = item.querySelector('time');\n if (timeEl) {\n const dt = timeEl.getAttribute('datetime');\n if (dt) timestamp = dt;\n }\n if (!timestamp) {\n const timeMatch = itemText.match(/(?:^|\\s)(\\d+[smhdw])(?:\\s|$|\\u00B7|\\xB7)/);\n if (timeMatch) timestamp = timeMatch[1];\n }\n\n posts.push({\n url: null,\n authorName: authorName,\n authorHeadline: authorHeadline,\n authorProfileUrl: authorProfileUrl,\n text: text,\n mediaType: mediaType,\n reactionCount: reactionCount,\n commentCount: commentCount,\n shareCount: shareCount,\n timestamp: timestamp,\n });\n }\n\n return posts;\n})()";
|
|
56
|
+
/**
|
|
57
|
+
* Legacy scraping script using structural heuristics to find the feed
|
|
58
|
+
* container. Used by search-posts which navigates to search result
|
|
59
|
+
* pages where `data-testid="mainFeed"` is not present.
|
|
60
|
+
*
|
|
61
|
+
* @internal Exported for reuse by search-posts.
|
|
62
|
+
*/
|
|
63
|
+
export { SCRAPE_FEED_POSTS_SCRIPT as SCRAPE_FEED_SCRIPT };
|
|
64
|
+
/**
|
|
65
|
+
* Extract hashtags from post text.
|
|
66
|
+
*/
|
|
67
|
+
export declare function extractHashtags(text: string | null): string[];
|
|
68
|
+
/**
|
|
69
|
+
* Parse a relative timestamp string (e.g. "52m", "16h", "2d", "1w") or an
|
|
70
|
+
* ISO date into epoch milliseconds. Returns null for unrecognised formats.
|
|
71
|
+
*/
|
|
72
|
+
export declare function parseTimestamp(raw: string | null): number | null;
|
|
73
|
+
/**
|
|
74
|
+
* Build a LinkedIn post URL from an activity URN.
|
|
75
|
+
*/
|
|
76
|
+
/** @internal Exported for reuse by search-posts. */
|
|
77
|
+
export declare function buildPostUrl(urn: string): string;
|
|
78
|
+
/**
|
|
79
|
+
* Convert raw DOM-scraped posts into normalised FeedPost entries.
|
|
80
|
+
*/
|
|
81
|
+
/** @internal Exported for reuse by search-posts. */
|
|
82
|
+
export declare function mapRawPosts(raw: RawDomPost[]): FeedPost[];
|
|
83
|
+
/** @internal Exported for reuse by other operations. */
|
|
84
|
+
export declare const delay: typeof utilsDelay;
|
|
85
|
+
/**
|
|
86
|
+
* Scroll the feed down by a randomised viewport-like distance.
|
|
87
|
+
*
|
|
88
|
+
* The distance varies between 600–1000 px per scroll to avoid the
|
|
89
|
+
* detection signal of a perfectly uniform scroll cadence.
|
|
90
|
+
*
|
|
91
|
+
* When a {@link HumanizedMouse} is provided, scrolling uses incremental
|
|
92
|
+
* mouse-wheel strokes (150 px / 25 ms) that mimic a physical scroll
|
|
93
|
+
* wheel. Falls back to a single CDP `mouseWheel` event otherwise.
|
|
94
|
+
*
|
|
95
|
+
* @internal Exported for reuse by search-posts.
|
|
96
|
+
*/
|
|
97
|
+
export declare function scrollFeed(client: CDPClient, mouse?: HumanizedMouse | null): Promise<void>;
|
|
98
|
+
/** @internal Exported for reuse by search-posts. */
|
|
99
|
+
export declare function waitForFeedLoad(client: CDPClient, timeoutMs?: number): Promise<void>;
|
|
21
100
|
/**
|
|
22
101
|
* Read the LinkedIn home feed and return structured post data.
|
|
23
102
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
103
|
+
* Navigates to the feed page and extracts posts from the rendered DOM.
|
|
104
|
+
* Supports cursor-based pagination: the first call returns the first page;
|
|
105
|
+
* pass the returned `nextCursor` in subsequent calls to retrieve additional
|
|
106
|
+
* pages via scroll + re-scrape.
|
|
28
107
|
*
|
|
29
108
|
* @param input - Pagination parameters and CDP connection options.
|
|
30
109
|
* @returns Feed posts with a cursor for the next page.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-feed.d.ts","sourceRoot":"","sources":["../../src/operations/get-feed.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-feed.d.ts","sourceRoot":"","sources":["../../src/operations/get-feed.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,KAAK,IAAI,UAAU,EAAkF,MAAM,mBAAmB,CAAC;AACxI,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAGpD;;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