@lhremote/core 0.7.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/index.d.ts +1 -1
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js +1 -1
- package/dist/db/index.js.map +1 -1
- package/dist/db/repositories/action-budget.d.ts +29 -0
- package/dist/db/repositories/action-budget.d.ts.map +1 -0
- package/dist/db/repositories/action-budget.js +100 -0
- package/dist/db/repositories/action-budget.js.map +1 -0
- package/dist/db/repositories/action-budget.test.d.ts +2 -0
- package/dist/db/repositories/action-budget.test.d.ts.map +1 -0
- package/dist/db/repositories/action-budget.test.js +181 -0
- package/dist/db/repositories/action-budget.test.js.map +1 -0
- package/dist/db/repositories/campaign-hard-delete.integration.test.d.ts +2 -0
- package/dist/db/repositories/campaign-hard-delete.integration.test.d.ts.map +1 -0
- package/dist/db/repositories/campaign-hard-delete.integration.test.js +78 -0
- package/dist/db/repositories/campaign-hard-delete.integration.test.js.map +1 -0
- package/dist/db/repositories/campaign.d.ts +14 -0
- package/dist/db/repositories/campaign.d.ts.map +1 -1
- package/dist/db/repositories/campaign.js +125 -0
- package/dist/db/repositories/campaign.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/db/repositories/index.d.ts +1 -0
- package/dist/db/repositories/index.d.ts.map +1 -1
- package/dist/db/repositories/index.js +1 -0
- package/dist/db/repositories/index.js.map +1 -1
- package/dist/index.d.ts +7 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -7
- package/dist/index.js.map +1 -1
- package/dist/linkedin/__tests__/dom-automation.integration.test.d.ts +2 -0
- package/dist/linkedin/__tests__/dom-automation.integration.test.d.ts.map +1 -0
- package/dist/linkedin/__tests__/dom-automation.integration.test.js +160 -0
- package/dist/linkedin/__tests__/dom-automation.integration.test.js.map +1 -0
- 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 +224 -0
- package/dist/linkedin/dom-automation.d.ts.map +1 -0
- package/dist/linkedin/dom-automation.js +614 -0
- package/dist/linkedin/dom-automation.js.map +1 -0
- 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 +4 -0
- package/dist/linkedin/index.d.ts.map +1 -0
- package/dist/linkedin/index.js +6 -0
- package/dist/linkedin/index.js.map +1 -0
- package/dist/linkedin/selectors.d.ts +67 -0
- package/dist/linkedin/selectors.d.ts.map +1 -0
- package/dist/linkedin/selectors.js +74 -0
- package/dist/linkedin/selectors.js.map +1 -0
- 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 +7 -3
- package/dist/operations/campaign-delete.d.ts.map +1 -1
- package/dist/operations/campaign-delete.js +12 -8
- package/dist/operations/campaign-delete.js.map +1 -1
- package/dist/operations/campaign-delete.test.js +41 -1
- package/dist/operations/campaign-delete.test.js.map +1 -1
- package/dist/operations/campaign-erase.d.ts +19 -0
- package/dist/operations/campaign-erase.d.ts.map +1 -0
- package/dist/operations/campaign-erase.js +19 -0
- package/dist/operations/campaign-erase.js.map +1 -0
- package/dist/operations/campaign-erase.test.d.ts +2 -0
- package/dist/operations/campaign-erase.test.d.ts.map +1 -0
- package/dist/operations/campaign-erase.test.js +101 -0
- package/dist/operations/campaign-erase.test.js.map +1 -0
- 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 +37 -0
- package/dist/operations/comment-on-post.d.ts.map +1 -0
- package/dist/operations/comment-on-post.js +104 -0
- package/dist/operations/comment-on-post.js.map +1 -0
- package/dist/operations/comment-on-post.test.d.ts +2 -0
- package/dist/operations/comment-on-post.test.d.ts.map +1 -0
- package/dist/operations/comment-on-post.test.js +242 -0
- package/dist/operations/comment-on-post.test.js.map +1 -0
- 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 +25 -0
- package/dist/operations/dismiss-errors.d.ts.map +1 -0
- package/dist/operations/dismiss-errors.js +74 -0
- package/dist/operations/dismiss-errors.js.map +1 -0
- package/dist/operations/dismiss-errors.test.d.ts +2 -0
- package/dist/operations/dismiss-errors.test.d.ts.map +1 -0
- package/dist/operations/dismiss-errors.test.js +183 -0
- package/dist/operations/dismiss-errors.test.js.map +1 -0
- package/dist/operations/endorse-skills.d.ts +10 -0
- package/dist/operations/endorse-skills.d.ts.map +1 -0
- package/dist/operations/endorse-skills.js +12 -0
- package/dist/operations/endorse-skills.js.map +1 -0
- 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.d.ts +18 -0
- package/dist/operations/enrich-profile.d.ts.map +1 -0
- package/dist/operations/enrich-profile.js +15 -0
- package/dist/operations/enrich-profile.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 +22 -0
- package/dist/operations/ephemeral-action.d.ts.map +1 -0
- package/dist/operations/ephemeral-action.js +28 -0
- package/dist/operations/ephemeral-action.js.map +1 -0
- 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.d.ts +9 -0
- package/dist/operations/follow-person.d.ts.map +1 -0
- package/dist/operations/follow-person.js +11 -0
- package/dist/operations/follow-person.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 +6 -0
- package/dist/operations/get-action-budget.d.ts.map +1 -0
- package/dist/operations/get-action-budget.js +19 -0
- package/dist/operations/get-action-budget.js.map +1 -0
- package/dist/operations/get-action-budget.test.d.ts +2 -0
- package/dist/operations/get-action-budget.test.d.ts.map +1 -0
- package/dist/operations/get-action-budget.test.js +79 -0
- package/dist/operations/get-action-budget.test.js.map +1 -0
- package/dist/operations/get-errors.d.ts +14 -4
- package/dist/operations/get-errors.d.ts.map +1 -1
- package/dist/operations/get-errors.js +72 -13
- package/dist/operations/get-errors.js.map +1 -1
- package/dist/operations/get-errors.test.js +108 -43
- package/dist/operations/get-errors.test.js.map +1 -1
- package/dist/operations/get-feed.d.ts +112 -0
- package/dist/operations/get-feed.d.ts.map +1 -0
- package/dist/operations/get-feed.js +467 -0
- package/dist/operations/get-feed.js.map +1 -0
- package/dist/operations/get-feed.test.d.ts +2 -0
- package/dist/operations/get-feed.test.d.ts.map +1 -0
- package/dist/operations/get-feed.test.js +502 -0
- package/dist/operations/get-feed.test.js.map +1 -0
- package/dist/operations/get-post-engagers.d.ts +43 -0
- package/dist/operations/get-post-engagers.d.ts.map +1 -0
- package/dist/operations/get-post-engagers.js +328 -0
- package/dist/operations/get-post-engagers.js.map +1 -0
- package/dist/operations/get-post-engagers.test.d.ts +2 -0
- package/dist/operations/get-post-engagers.test.d.ts.map +1 -0
- package/dist/operations/get-post-engagers.test.js +297 -0
- package/dist/operations/get-post-engagers.test.js.map +1 -0
- package/dist/operations/get-post-stats.d.ts +43 -0
- package/dist/operations/get-post-stats.d.ts.map +1 -0
- package/dist/operations/get-post-stats.js +164 -0
- package/dist/operations/get-post-stats.js.map +1 -0
- package/dist/operations/get-post-stats.test.d.ts +2 -0
- package/dist/operations/get-post-stats.test.d.ts.map +1 -0
- package/dist/operations/get-post-stats.test.js +169 -0
- package/dist/operations/get-post-stats.test.js.map +1 -0
- package/dist/operations/get-post.d.ts +42 -0
- package/dist/operations/get-post.d.ts.map +1 -0
- package/dist/operations/get-post.js +416 -0
- package/dist/operations/get-post.js.map +1 -0
- package/dist/operations/get-post.test.d.ts +2 -0
- package/dist/operations/get-post.test.d.ts.map +1 -0
- package/dist/operations/get-post.test.js +272 -0
- package/dist/operations/get-post.test.js.map +1 -0
- package/dist/operations/get-profile-activity.d.ts +50 -0
- package/dist/operations/get-profile-activity.d.ts.map +1 -0
- package/dist/operations/get-profile-activity.js +381 -0
- package/dist/operations/get-profile-activity.js.map +1 -0
- package/dist/operations/get-profile-activity.test.d.ts +2 -0
- package/dist/operations/get-profile-activity.test.d.ts.map +1 -0
- package/dist/operations/get-profile-activity.test.js +324 -0
- package/dist/operations/get-profile-activity.test.js.map +1 -0
- package/dist/operations/get-throttle-status.d.ts +6 -0
- package/dist/operations/get-throttle-status.d.ts.map +1 -0
- package/dist/operations/get-throttle-status.js +24 -0
- package/dist/operations/get-throttle-status.js.map +1 -0
- package/dist/operations/get-throttle-status.test.d.ts +2 -0
- package/dist/operations/get-throttle-status.test.d.ts.map +1 -0
- package/dist/operations/get-throttle-status.test.js +62 -0
- package/dist/operations/get-throttle-status.test.js.map +1 -0
- 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 +23 -1
- package/dist/operations/index.d.ts.map +1 -1
- package/dist/operations/index.js +33 -0
- package/dist/operations/index.js.map +1 -1
- package/dist/operations/like-person-posts.d.ts +14 -0
- package/dist/operations/like-person-posts.d.ts.map +1 -0
- package/dist/operations/like-person-posts.js +28 -0
- package/dist/operations/like-person-posts.js.map +1 -0
- 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.d.ts +11 -0
- package/dist/operations/message-person.d.ts.map +1 -0
- package/dist/operations/message-person.js +19 -0
- package/dist/operations/message-person.js.map +1 -0
- 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 +41 -0
- package/dist/operations/react-to-post.d.ts.map +1 -0
- package/dist/operations/react-to-post.js +80 -0
- package/dist/operations/react-to-post.js.map +1 -0
- package/dist/operations/react-to-post.test.d.ts +2 -0
- package/dist/operations/react-to-post.test.d.ts.map +1 -0
- package/dist/operations/react-to-post.test.js +157 -0
- package/dist/operations/react-to-post.test.js.map +1 -0
- package/dist/operations/remove-connection.d.ts +6 -0
- package/dist/operations/remove-connection.d.ts.map +1 -0
- package/dist/operations/remove-connection.js +7 -0
- package/dist/operations/remove-connection.js.map +1 -0
- 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 +51 -0
- package/dist/operations/search-posts.d.ts.map +1 -0
- package/dist/operations/search-posts.js +419 -0
- package/dist/operations/search-posts.js.map +1 -0
- package/dist/operations/search-posts.test.d.ts +2 -0
- package/dist/operations/search-posts.test.d.ts.map +1 -0
- package/dist/operations/search-posts.test.js +300 -0
- package/dist/operations/search-posts.test.js.map +1 -0
- package/dist/operations/send-inmail.d.ts +11 -0
- package/dist/operations/send-inmail.d.ts.map +1 -0
- package/dist/operations/send-inmail.js +19 -0
- package/dist/operations/send-inmail.js.map +1 -0
- 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.d.ts +9 -0
- package/dist/operations/send-invite.d.ts.map +1 -0
- package/dist/operations/send-invite.js +14 -0
- package/dist/operations/send-invite.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 +14 -0
- package/dist/operations/visit-profile.d.ts.map +1 -0
- package/dist/operations/visit-profile.js +46 -0
- package/dist/operations/visit-profile.js.map +1 -0
- package/dist/operations/visit-profile.test.d.ts +2 -0
- package/dist/operations/visit-profile.test.d.ts.map +1 -0
- package/dist/operations/visit-profile.test.js +193 -0
- package/dist/operations/visit-profile.test.js.map +1 -0
- 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 +44 -2
- package/dist/services/campaign.d.ts.map +1 -1
- package/dist/services/campaign.js +124 -1
- package/dist/services/campaign.js.map +1 -1
- package/dist/services/collection.d.ts +5 -2
- package/dist/services/collection.d.ts.map +1 -1
- package/dist/services/collection.js +24 -5
- package/dist/services/collection.js.map +1 -1
- package/dist/services/collection.test.js +51 -9
- package/dist/services/collection.test.js.map +1 -1
- package/dist/services/ephemeral-campaign.d.ts +64 -0
- package/dist/services/ephemeral-campaign.d.ts.map +1 -0
- package/dist/services/ephemeral-campaign.js +210 -0
- package/dist/services/ephemeral-campaign.js.map +1 -0
- package/dist/services/ephemeral-campaign.test.d.ts +2 -0
- package/dist/services/ephemeral-campaign.test.d.ts.map +1 -0
- package/dist/services/ephemeral-campaign.test.js +333 -0
- package/dist/services/ephemeral-campaign.test.js.map +1 -0
- package/dist/services/errors.d.ts +12 -1
- package/dist/services/errors.d.ts.map +1 -1
- package/dist/services/errors.js +26 -3
- package/dist/services/errors.js.map +1 -1
- package/dist/services/index.d.ts +2 -1
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +2 -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 -20
- package/dist/services/instance-context.js.map +1 -1
- package/dist/services/instance-context.test.js +82 -2
- 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 +43 -0
- package/dist/services/instance.d.ts.map +1 -1
- package/dist/services/instance.js +163 -1
- package/dist/services/instance.js.map +1 -1
- package/dist/services/instance.test.js +135 -0
- package/dist/services/instance.test.js.map +1 -1
- package/dist/services/launcher.d.ts +54 -3
- package/dist/services/launcher.d.ts.map +1 -1
- package/dist/services/launcher.js +223 -34
- 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/action-budget.d.ts +52 -0
- package/dist/types/action-budget.d.ts.map +1 -0
- package/dist/types/action-budget.js +4 -0
- package/dist/types/action-budget.js.map +1 -0
- package/dist/types/campaign.d.ts +24 -0
- package/dist/types/campaign.d.ts.map +1 -1
- package/dist/types/feed.d.ts +30 -0
- package/dist/types/feed.d.ts.map +1 -0
- package/dist/types/feed.js +4 -0
- package/dist/types/feed.js.map +1 -0
- package/dist/types/index.d.ts +6 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/post-analytics.d.ts +40 -0
- package/dist/types/post-analytics.d.ts.map +1 -0
- package/dist/types/post-analytics.js +4 -0
- package/dist/types/post-analytics.js.map +1 -0
- package/dist/types/post.d.ts +43 -0
- package/dist/types/post.d.ts.map +1 -0
- package/dist/types/post.js +4 -0
- package/dist/types/post.js.map +1 -0
- package/dist/types/ui-health.d.ts +16 -0
- package/dist/types/ui-health.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
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { PostStats } from "../types/post-analytics.js";
|
|
2
|
+
import type { ConnectionOptions } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Input for the get-post-stats operation.
|
|
5
|
+
*/
|
|
6
|
+
export interface GetPostStatsInput extends ConnectionOptions {
|
|
7
|
+
/** LinkedIn post URL or raw URN (e.g. `urn:li:activity:1234567890`). */
|
|
8
|
+
readonly postUrl: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Output from the get-post-stats operation.
|
|
12
|
+
*/
|
|
13
|
+
export interface GetPostStatsOutput {
|
|
14
|
+
readonly stats: PostStats;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Extract a post activity URN from a LinkedIn post URL or raw URN.
|
|
18
|
+
*
|
|
19
|
+
* Supported formats:
|
|
20
|
+
* - `https://www.linkedin.com/feed/update/urn:li:activity:XXXXX/`
|
|
21
|
+
* - `https://www.linkedin.com/feed/update/urn:li:ugcPost:XXXXX/`
|
|
22
|
+
* - `https://www.linkedin.com/feed/update/urn:li:share:XXXXX/`
|
|
23
|
+
* - `https://www.linkedin.com/posts/username_activity-XXXXX-xxxx/`
|
|
24
|
+
* - Raw URN: `urn:li:activity:XXXXX`
|
|
25
|
+
*/
|
|
26
|
+
export declare function extractPostUrn(input: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* Resolve a post URL or URN into a navigable LinkedIn post detail URL.
|
|
29
|
+
* Accepts full LinkedIn URLs (returned as-is) or raw URNs (converted to URL).
|
|
30
|
+
*/
|
|
31
|
+
export declare function resolvePostDetailUrl(input: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* Retrieve engagement statistics for a LinkedIn post.
|
|
34
|
+
*
|
|
35
|
+
* Connects to the LinkedIn webview in LinkedHelper, navigates to the
|
|
36
|
+
* post detail page, and extracts engagement statistics from the
|
|
37
|
+
* rendered DOM.
|
|
38
|
+
*
|
|
39
|
+
* @param input - Post URL or URN and CDP connection parameters.
|
|
40
|
+
* @returns Engagement statistics for the post.
|
|
41
|
+
*/
|
|
42
|
+
export declare function getPostStats(input: GetPostStatsInput): Promise<GetPostStatsOutput>;
|
|
43
|
+
//# sourceMappingURL=get-post-stats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-post-stats.d.ts","sourceRoot":"","sources":["../../src/operations/get-post-stats.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAI5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAIpD;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB;IAC1D,wEAAwE;IACxE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;CAC3B;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAapD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAI1D;AA+ED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,KAAK,EAAE,iBAAiB,GACvB,OAAO,CAAC,kBAAkB,CAAC,CAqE7B"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
import { resolveInstancePort } from "../cdp/index.js";
|
|
4
|
+
import { CDPClient } from "../cdp/client.js";
|
|
5
|
+
import { discoverTargets } from "../cdp/discovery.js";
|
|
6
|
+
import { gaussianDelay } from "../utils/delay.js";
|
|
7
|
+
import { delay } from "./get-feed.js";
|
|
8
|
+
import { navigateAwayIf } from "./navigate-away.js";
|
|
9
|
+
/**
|
|
10
|
+
* Extract a post activity URN from a LinkedIn post URL or raw URN.
|
|
11
|
+
*
|
|
12
|
+
* Supported formats:
|
|
13
|
+
* - `https://www.linkedin.com/feed/update/urn:li:activity:XXXXX/`
|
|
14
|
+
* - `https://www.linkedin.com/feed/update/urn:li:ugcPost:XXXXX/`
|
|
15
|
+
* - `https://www.linkedin.com/feed/update/urn:li:share:XXXXX/`
|
|
16
|
+
* - `https://www.linkedin.com/posts/username_activity-XXXXX-xxxx/`
|
|
17
|
+
* - Raw URN: `urn:li:activity:XXXXX`
|
|
18
|
+
*/
|
|
19
|
+
export function extractPostUrn(input) {
|
|
20
|
+
// Handle /feed/update/ URLs containing a URN path segment
|
|
21
|
+
const updateMatch = /\/feed\/update\/(urn:li:\w+:\d+)/.exec(input);
|
|
22
|
+
if (updateMatch?.[1])
|
|
23
|
+
return updateMatch[1];
|
|
24
|
+
// Handle /posts/ URLs that embed the activity ID in the slug
|
|
25
|
+
const postsMatch = /\/posts\/[^/]+_activity-(\d+)/.exec(input);
|
|
26
|
+
if (postsMatch?.[1])
|
|
27
|
+
return `urn:li:activity:${postsMatch[1]}`;
|
|
28
|
+
// Handle raw URN input
|
|
29
|
+
if (/^urn:li:\w+:\d+$/.test(input))
|
|
30
|
+
return input;
|
|
31
|
+
throw new Error(`Cannot extract post URN from: ${input}`);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Resolve a post URL or URN into a navigable LinkedIn post detail URL.
|
|
35
|
+
* Accepts full LinkedIn URLs (returned as-is) or raw URNs (converted to URL).
|
|
36
|
+
*/
|
|
37
|
+
export function resolvePostDetailUrl(input) {
|
|
38
|
+
if (input.startsWith("https://"))
|
|
39
|
+
return input;
|
|
40
|
+
if (input.startsWith("urn:li:"))
|
|
41
|
+
return `https://www.linkedin.com/feed/update/${input}/`;
|
|
42
|
+
throw new Error(`Invalid post identifier: ${input}`);
|
|
43
|
+
}
|
|
44
|
+
// ---------------------------------------------------------------------------
|
|
45
|
+
// In-page DOM scraping script
|
|
46
|
+
// ---------------------------------------------------------------------------
|
|
47
|
+
/**
|
|
48
|
+
* JavaScript source evaluated inside the LinkedIn post detail page to
|
|
49
|
+
* extract engagement statistics from the rendered DOM.
|
|
50
|
+
*
|
|
51
|
+
* The post detail page renders engagement counts as text content
|
|
52
|
+
* (e.g. "42 reactions", "5 comments", "3 reposts"). The script
|
|
53
|
+
* searches the page body text for these patterns.
|
|
54
|
+
*/
|
|
55
|
+
const SCRAPE_POST_STATS_SCRIPT = `(() => {
|
|
56
|
+
let reactionCount = 0;
|
|
57
|
+
let commentCount = 0;
|
|
58
|
+
let shareCount = 0;
|
|
59
|
+
|
|
60
|
+
const countText = document.body.textContent || '';
|
|
61
|
+
|
|
62
|
+
function parseCount(pattern) {
|
|
63
|
+
const m = countText.match(pattern);
|
|
64
|
+
if (!m) return 0;
|
|
65
|
+
const raw = m[1].replace(/,/g, '');
|
|
66
|
+
const num = parseInt(raw, 10);
|
|
67
|
+
return isNaN(num) ? 0 : num;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
reactionCount = parseCount(/(\\d[\\d,]*)\\s+reactions?/i);
|
|
71
|
+
commentCount = parseCount(/(\\d[\\d,]*)\\s+comments?/i);
|
|
72
|
+
shareCount = parseCount(/(\\d[\\d,]*)\\s+reposts?/i);
|
|
73
|
+
|
|
74
|
+
return { reactionCount, commentCount, shareCount };
|
|
75
|
+
})()`;
|
|
76
|
+
// ---------------------------------------------------------------------------
|
|
77
|
+
// Wait for post detail to load
|
|
78
|
+
// ---------------------------------------------------------------------------
|
|
79
|
+
/**
|
|
80
|
+
* Poll the DOM until the post detail page has rendered. The page is
|
|
81
|
+
* considered ready when an author link and at least one `span[dir="ltr"]`
|
|
82
|
+
* are present.
|
|
83
|
+
*/
|
|
84
|
+
async function waitForPostLoad(client, timeoutMs = 15_000) {
|
|
85
|
+
const deadline = Date.now() + timeoutMs;
|
|
86
|
+
while (Date.now() < deadline) {
|
|
87
|
+
const ready = await client.evaluate(`(() => {
|
|
88
|
+
const authorLink = document.querySelector('a[href*="/in/"], a[href*="/company/"]');
|
|
89
|
+
if (!authorLink) return false;
|
|
90
|
+
const ltrSpans = document.querySelectorAll('span[dir="ltr"]');
|
|
91
|
+
return ltrSpans.length > 0;
|
|
92
|
+
})()`);
|
|
93
|
+
if (ready)
|
|
94
|
+
return;
|
|
95
|
+
await delay(500);
|
|
96
|
+
}
|
|
97
|
+
throw new Error("Timed out waiting for post detail to appear in the DOM");
|
|
98
|
+
}
|
|
99
|
+
// ---------------------------------------------------------------------------
|
|
100
|
+
// Main operation
|
|
101
|
+
// ---------------------------------------------------------------------------
|
|
102
|
+
/**
|
|
103
|
+
* Retrieve engagement statistics for a LinkedIn post.
|
|
104
|
+
*
|
|
105
|
+
* Connects to the LinkedIn webview in LinkedHelper, navigates to the
|
|
106
|
+
* post detail page, and extracts engagement statistics from the
|
|
107
|
+
* rendered DOM.
|
|
108
|
+
*
|
|
109
|
+
* @param input - Post URL or URN and CDP connection parameters.
|
|
110
|
+
* @returns Engagement statistics for the post.
|
|
111
|
+
*/
|
|
112
|
+
export async function getPostStats(input) {
|
|
113
|
+
const cdpPort = await resolveInstancePort(input.cdpPort, input.cdpHost);
|
|
114
|
+
const cdpHost = input.cdpHost ?? "127.0.0.1";
|
|
115
|
+
const allowRemote = input.allowRemote ?? false;
|
|
116
|
+
const postDetailUrl = resolvePostDetailUrl(input.postUrl);
|
|
117
|
+
// Keep using extractPostUrn for the output postUrn field
|
|
118
|
+
let postUrn;
|
|
119
|
+
try {
|
|
120
|
+
postUrn = extractPostUrn(input.postUrl);
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
postUrn = input.postUrl;
|
|
124
|
+
}
|
|
125
|
+
// Enforce loopback guard
|
|
126
|
+
if (!allowRemote && cdpHost !== "127.0.0.1" && cdpHost !== "localhost") {
|
|
127
|
+
throw new Error(`Non-loopback CDP host "${cdpHost}" requires --allow-remote. ` +
|
|
128
|
+
"This is a security measure to prevent remote code execution.");
|
|
129
|
+
}
|
|
130
|
+
const targets = await discoverTargets(cdpPort, cdpHost);
|
|
131
|
+
const linkedInTarget = targets.find((t) => t.type === "page" && t.url?.includes("linkedin.com"));
|
|
132
|
+
if (!linkedInTarget) {
|
|
133
|
+
throw new Error("No LinkedIn page found in LinkedHelper. " +
|
|
134
|
+
"Ensure LinkedHelper is running with an active LinkedIn session.");
|
|
135
|
+
}
|
|
136
|
+
const client = new CDPClient(cdpPort, { host: cdpHost, allowRemote });
|
|
137
|
+
await client.connect(linkedInTarget.id);
|
|
138
|
+
try {
|
|
139
|
+
// Navigate away if already on the post detail page to force a fresh load
|
|
140
|
+
await navigateAwayIf(client, "/feed/update/");
|
|
141
|
+
// Navigate to the post detail page
|
|
142
|
+
await client.navigate(postDetailUrl);
|
|
143
|
+
// Wait for the post content to render
|
|
144
|
+
await waitForPostLoad(client);
|
|
145
|
+
// Extract engagement stats from the DOM
|
|
146
|
+
const raw = await client.evaluate(SCRAPE_POST_STATS_SCRIPT);
|
|
147
|
+
if (!raw) {
|
|
148
|
+
throw new Error("Failed to extract post stats from the DOM");
|
|
149
|
+
}
|
|
150
|
+
const stats = {
|
|
151
|
+
postUrn,
|
|
152
|
+
reactionCount: raw.reactionCount,
|
|
153
|
+
reactionsByType: [],
|
|
154
|
+
commentCount: raw.commentCount,
|
|
155
|
+
shareCount: raw.shareCount,
|
|
156
|
+
};
|
|
157
|
+
await gaussianDelay(800, 300, 300, 1_800); // Post-action dwell
|
|
158
|
+
return { stats };
|
|
159
|
+
}
|
|
160
|
+
finally {
|
|
161
|
+
client.disconnect();
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=get-post-stats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-post-stats.js","sourceRoot":"","sources":["../../src/operations/get-post-stats.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAiBpD;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,0DAA0D;IAC1D,MAAM,WAAW,GAAG,kCAAkC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACnE,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC;QAAE,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC;IAE5C,6DAA6D;IAC7D,MAAM,UAAU,GAAG,+BAA+B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/D,IAAI,UAAU,EAAE,CAAC,CAAC,CAAC;QAAE,OAAO,mB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MAAM,cAAc,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;QAE9C,mCAAmC;QACnC,MAAM,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QAErC,sCAAsC;QACtC,MAAM,eAAe,CAAC,MAAM,CAAC,CAAC;QAE9B,wCAAwC;QACxC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAe,wBAAwB,CAAC,CAAC;QAC1E,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CACb,2CAA2C,CAC5C,CAAC;QACJ,CAAC;QAED,MAAM,KAAK,GAAc;YACvB,OAAO;YACP,aAAa,EAAE,GAAG,CAAC,aAAa;YAChC,eAAe,EAAE,EAAE;YACnB,YAAY,EAAE,GAAG,CAAC,YAAY;YAC9B,UAAU,EAAE,GAAG,CAAC,UAAU;SAC3B,CAAC;QAEF,MAAM,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,oBAAoB;QAC/D,OAAO,EAAE,KAAK,EAAE,CAAC;IACnB,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-post-stats.test.d.ts","sourceRoot":"","sources":["../../src/operations/get-post-stats.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
4
|
+
vi.mock("../cdp/discovery.js", () => ({
|
|
5
|
+
discoverTargets: vi.fn(),
|
|
6
|
+
}));
|
|
7
|
+
vi.mock("../cdp/client.js", () => ({
|
|
8
|
+
CDPClient: vi.fn(),
|
|
9
|
+
}));
|
|
10
|
+
vi.mock("../utils/delay.js", () => ({
|
|
11
|
+
gaussianDelay: vi.fn().mockResolvedValue(undefined),
|
|
12
|
+
}));
|
|
13
|
+
vi.mock("./navigate-away.js", () => ({
|
|
14
|
+
navigateAwayIf: vi.fn().mockResolvedValue(undefined),
|
|
15
|
+
}));
|
|
16
|
+
vi.mock("./get-feed.js", () => ({
|
|
17
|
+
delay: vi.fn().mockResolvedValue(undefined),
|
|
18
|
+
}));
|
|
19
|
+
import { discoverTargets } from "../cdp/discovery.js";
|
|
20
|
+
import { CDPClient } from "../cdp/client.js";
|
|
21
|
+
import { extractPostUrn, getPostStats, } from "./get-post-stats.js";
|
|
22
|
+
describe("extractPostUrn", () => {
|
|
23
|
+
it("extracts URN from /feed/update/ URL with activity URN", () => {
|
|
24
|
+
expect(extractPostUrn("https://www.linkedin.com/feed/update/urn:li:activity:7123456789012345678/")).toBe("urn:li:activity:7123456789012345678");
|
|
25
|
+
});
|
|
26
|
+
it("extracts URN from /feed/update/ URL with ugcPost URN", () => {
|
|
27
|
+
expect(extractPostUrn("https://www.linkedin.com/feed/update/urn:li:ugcPost:7123456789012345678/")).toBe("urn:li:ugcPost:7123456789012345678");
|
|
28
|
+
});
|
|
29
|
+
it("extracts URN from /feed/update/ URL with share URN", () => {
|
|
30
|
+
expect(extractPostUrn("https://www.linkedin.com/feed/update/urn:li:share:7123456789012345678/")).toBe("urn:li:share:7123456789012345678");
|
|
31
|
+
});
|
|
32
|
+
it("extracts URN from /feed/update/ URL without trailing slash", () => {
|
|
33
|
+
expect(extractPostUrn("https://www.linkedin.com/feed/update/urn:li:activity:7123456789012345678")).toBe("urn:li:activity:7123456789012345678");
|
|
34
|
+
});
|
|
35
|
+
it("extracts activity URN from /posts/ URL", () => {
|
|
36
|
+
expect(extractPostUrn("https://www.linkedin.com/posts/johndoe_activity-7123456789012345678-abcd/")).toBe("urn:li:activity:7123456789012345678");
|
|
37
|
+
});
|
|
38
|
+
it("passes through raw URN input", () => {
|
|
39
|
+
expect(extractPostUrn("urn:li:activity:7123456789012345678")).toBe("urn:li:activity:7123456789012345678");
|
|
40
|
+
});
|
|
41
|
+
it("passes through raw ugcPost URN", () => {
|
|
42
|
+
expect(extractPostUrn("urn:li:ugcPost:7123456789012345678")).toBe("urn:li:ugcPost:7123456789012345678");
|
|
43
|
+
});
|
|
44
|
+
it("throws on unrecognised input", () => {
|
|
45
|
+
expect(() => extractPostUrn("https://example.com/foo")).toThrow("Cannot extract post URN from");
|
|
46
|
+
});
|
|
47
|
+
it("throws on empty input", () => {
|
|
48
|
+
expect(() => extractPostUrn("")).toThrow("Cannot extract post URN from");
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
describe("getPostStats", () => {
|
|
52
|
+
const CDP_PORT = 9222;
|
|
53
|
+
const POST_URL = "https://www.linkedin.com/feed/update/urn:li:activity:1234567890/";
|
|
54
|
+
function setupMocks(opts) {
|
|
55
|
+
const { postStats = { reactionCount: 42, commentCount: 5, shareCount: 3 }, readySequence = [true], } = opts ?? {};
|
|
56
|
+
vi.mocked(discoverTargets).mockResolvedValue([
|
|
57
|
+
{
|
|
58
|
+
id: "target-1",
|
|
59
|
+
type: "page",
|
|
60
|
+
title: "LinkedIn",
|
|
61
|
+
url: "https://www.linkedin.com/feed/",
|
|
62
|
+
description: "",
|
|
63
|
+
devtoolsFrontendUrl: "",
|
|
64
|
+
},
|
|
65
|
+
]);
|
|
66
|
+
const disconnect = vi.fn();
|
|
67
|
+
const navigate = vi.fn().mockResolvedValue(undefined);
|
|
68
|
+
// Build evaluate mock call sequence:
|
|
69
|
+
// 1. readiness checks (boolean)
|
|
70
|
+
// 2. post stats scrape (object)
|
|
71
|
+
const evaluateMock = vi.fn();
|
|
72
|
+
for (const ready of readySequence) {
|
|
73
|
+
evaluateMock.mockResolvedValueOnce(ready);
|
|
74
|
+
}
|
|
75
|
+
evaluateMock.mockResolvedValueOnce(postStats);
|
|
76
|
+
vi.mocked(CDPClient).mockImplementation(function () {
|
|
77
|
+
return {
|
|
78
|
+
connect: vi.fn().mockResolvedValue(undefined),
|
|
79
|
+
disconnect,
|
|
80
|
+
navigate,
|
|
81
|
+
evaluate: evaluateMock,
|
|
82
|
+
send: vi.fn().mockResolvedValue(undefined),
|
|
83
|
+
};
|
|
84
|
+
});
|
|
85
|
+
return { evaluateMock, disconnect, navigate };
|
|
86
|
+
}
|
|
87
|
+
beforeEach(() => {
|
|
88
|
+
vi.clearAllMocks();
|
|
89
|
+
});
|
|
90
|
+
afterEach(() => {
|
|
91
|
+
vi.restoreAllMocks();
|
|
92
|
+
});
|
|
93
|
+
it("throws on non-loopback host without allowRemote", async () => {
|
|
94
|
+
await expect(getPostStats({
|
|
95
|
+
postUrl: POST_URL,
|
|
96
|
+
cdpPort: CDP_PORT,
|
|
97
|
+
cdpHost: "192.168.1.1",
|
|
98
|
+
})).rejects.toThrow("requires --allow-remote");
|
|
99
|
+
});
|
|
100
|
+
it("throws when no LinkedIn page found", async () => {
|
|
101
|
+
vi.mocked(discoverTargets).mockResolvedValue([]);
|
|
102
|
+
await expect(getPostStats({ postUrl: POST_URL, cdpPort: CDP_PORT })).rejects.toThrow("No LinkedIn page found in LinkedHelper");
|
|
103
|
+
});
|
|
104
|
+
it("navigates to post detail URL and extracts stats from DOM", async () => {
|
|
105
|
+
const { navigate } = setupMocks();
|
|
106
|
+
const result = await getPostStats({
|
|
107
|
+
postUrl: POST_URL,
|
|
108
|
+
cdpPort: CDP_PORT,
|
|
109
|
+
});
|
|
110
|
+
expect(navigate).toHaveBeenCalledWith("https://www.linkedin.com/feed/update/urn:li:activity:1234567890/");
|
|
111
|
+
expect(result.stats).toEqual({
|
|
112
|
+
postUrn: "urn:li:activity:1234567890",
|
|
113
|
+
reactionCount: 42,
|
|
114
|
+
reactionsByType: [],
|
|
115
|
+
commentCount: 5,
|
|
116
|
+
shareCount: 3,
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
it("returns empty reactionsByType (DOM has no breakdown)", async () => {
|
|
120
|
+
setupMocks({
|
|
121
|
+
postStats: { reactionCount: 100, commentCount: 10, shareCount: 5 },
|
|
122
|
+
});
|
|
123
|
+
const result = await getPostStats({
|
|
124
|
+
postUrl: POST_URL,
|
|
125
|
+
cdpPort: CDP_PORT,
|
|
126
|
+
});
|
|
127
|
+
expect(result.stats.reactionsByType).toEqual([]);
|
|
128
|
+
expect(result.stats.reactionCount).toBe(100);
|
|
129
|
+
});
|
|
130
|
+
it("handles zero counts gracefully", async () => {
|
|
131
|
+
setupMocks({
|
|
132
|
+
postStats: { reactionCount: 0, commentCount: 0, shareCount: 0 },
|
|
133
|
+
});
|
|
134
|
+
const result = await getPostStats({
|
|
135
|
+
postUrl: POST_URL,
|
|
136
|
+
cdpPort: CDP_PORT,
|
|
137
|
+
});
|
|
138
|
+
expect(result.stats).toEqual({
|
|
139
|
+
postUrn: "urn:li:activity:1234567890",
|
|
140
|
+
reactionCount: 0,
|
|
141
|
+
reactionsByType: [],
|
|
142
|
+
commentCount: 0,
|
|
143
|
+
shareCount: 0,
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
it("throws when DOM extraction returns null", async () => {
|
|
147
|
+
setupMocks({ postStats: null });
|
|
148
|
+
await expect(getPostStats({ postUrl: POST_URL, cdpPort: CDP_PORT })).rejects.toThrow("Failed to extract post stats from the DOM");
|
|
149
|
+
});
|
|
150
|
+
it("waits for post to load with polling", async () => {
|
|
151
|
+
const { evaluateMock } = setupMocks({
|
|
152
|
+
readySequence: [false, false, true],
|
|
153
|
+
});
|
|
154
|
+
await getPostStats({ postUrl: POST_URL, cdpPort: CDP_PORT });
|
|
155
|
+
// 3 readiness checks + 1 stats scrape = 4
|
|
156
|
+
expect(evaluateMock).toHaveBeenCalledTimes(4);
|
|
157
|
+
});
|
|
158
|
+
it("disconnects CDP client after successful operation", async () => {
|
|
159
|
+
const { disconnect } = setupMocks();
|
|
160
|
+
await getPostStats({ postUrl: POST_URL, cdpPort: CDP_PORT });
|
|
161
|
+
expect(disconnect).toHaveBeenCalled();
|
|
162
|
+
});
|
|
163
|
+
it("disconnects CDP client even on error", async () => {
|
|
164
|
+
const { disconnect } = setupMocks({ postStats: null });
|
|
165
|
+
await expect(getPostStats({ postUrl: POST_URL, cdpPort: CDP_PORT })).rejects.toThrow();
|
|
166
|
+
expect(disconnect).toHaveBeenCalled();
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
//# sourceMappingURL=get-post-stats.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-post-stats.test.js","sourceRoot":"","sources":["../../src/operations/get-post-stats.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,qBAAqB,EAAE,GAAG,EAAE,CAAC,CAAC;IACpC,eAAe,EAAE,EAAE,CAAC,EAAE,EAAE;CACzB,CAAC,CAAC,CAAC;AAEJ,EAAE,CAAC,IAAI,CAAC,kBAAkB,EAAE,GAAG,EAAE,CAAC,CAAC;IACjC,SAAS,EAAE,EAAE,CAAC,EAAE,EAAE;CACnB,CAAC,CAAC,CAAC;AAEJ,EAAE,CAAC,IAAI,CAAC,mBAAmB,EAAE,GAAG,EAAE,CAAC,CAAC;IAClC,aAAa,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,SAAS,CAAC;CACpD,CAAC,CAAC,CAAC;AAEJ,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,GAAG,EAAE,CAAC,CAAC;IACnC,cAAc,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,SAAS,CAAC;CACrD,CAAC,CAAC,CAAC;AAEJ,EAAE,CAAC,IAAI,CAAC,eAAe,EAAE,GAAG,EAAE,CAAC,CAAC;IAC9B,KAAK,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,i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AEpC,MAAM,YAAY,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;QAE7D,MAAM,CAAC,UAAU,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sCAAsC,EAAE,KAAK,IAAI,EAAE;QACpD,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAEvD,MAAM,MAAM,CACV,YAAY,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CACvD,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QAEpB,MAAM,CAAC,UAAU,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { PostComment, PostDetail } from "../types/post.js";
|
|
2
|
+
import type { ConnectionOptions } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Input for the get-post operation.
|
|
5
|
+
*/
|
|
6
|
+
export interface GetPostInput extends ConnectionOptions {
|
|
7
|
+
/** LinkedIn post URL or raw URN (e.g. `urn:li:activity:1234567890`). */
|
|
8
|
+
readonly postUrl: string;
|
|
9
|
+
/**
|
|
10
|
+
* Maximum number of comments to load. The operation clicks "Load more
|
|
11
|
+
* comments" until this limit is reached or no more comments are available.
|
|
12
|
+
* Defaults to 100. Set to 0 to skip comment loading entirely.
|
|
13
|
+
*/
|
|
14
|
+
readonly commentCount?: number | undefined;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Output from the get-post operation.
|
|
18
|
+
*/
|
|
19
|
+
export interface GetPostOutput {
|
|
20
|
+
/** Full post detail. */
|
|
21
|
+
readonly post: PostDetail;
|
|
22
|
+
/** Comments on this post. */
|
|
23
|
+
readonly comments: PostComment[];
|
|
24
|
+
/** Comment pagination metadata. */
|
|
25
|
+
readonly commentsPaging: {
|
|
26
|
+
readonly start: number;
|
|
27
|
+
readonly count: number;
|
|
28
|
+
readonly total: number;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Retrieve detailed data for a single LinkedIn post with its comment thread.
|
|
33
|
+
*
|
|
34
|
+
* Connects to the LinkedIn webview in LinkedHelper, navigates to the
|
|
35
|
+
* post detail page, and extracts post data and comments from the
|
|
36
|
+
* rendered DOM.
|
|
37
|
+
*
|
|
38
|
+
* @param input - Post URL or URN, and CDP connection options.
|
|
39
|
+
* @returns Post detail with comments and pagination metadata.
|
|
40
|
+
*/
|
|
41
|
+
export declare function getPost(input: GetPostInput): Promise<GetPostOutput>;
|
|
42
|
+
//# sourceMappingURL=get-post.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-post.d.ts","sourceRoot":"","sources":["../../src/operations/get-post.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAIhE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAKpD;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,iBAAiB;IACrD,wEAAwE;IACxE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5C;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,wBAAwB;IACxB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,6BAA6B;IAC7B,QAAQ,CAAC,QAAQ,EAAE,WAAW,EAAE,CAAC;IACjC,mCAAmC;IACnC,QAAQ,CAAC,cAAc,EAAE;QACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;KACxB,CAAC;CACH;AAqVD;;;;;;;;;GASG;AACH,wBAAsB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC,CAmHzE"}
|