@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
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { isCdpPort } from "./cdp-port.js";
|
|
2
|
-
export { delay } from "./delay.js";
|
|
2
|
+
export { delay, randomDelay, gaussianRandom, gaussianDelay, gaussianBetween, maybeBreak, simulateReadingTime } from "./delay.js";
|
|
3
3
|
export { errorMessage } from "./error-message.js";
|
|
4
4
|
export { isLoopbackAddress } from "./loopback.js";
|
|
5
|
+
export { SessionPacer, rhythmMultiplier } from "./session-pacer.js";
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjI,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/utils/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
2
|
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
3
|
export { isCdpPort } from "./cdp-port.js";
|
|
4
|
-
export { delay } from "./delay.js";
|
|
4
|
+
export { delay, randomDelay, gaussianRandom, gaussianDelay, gaussianBetween, maybeBreak, simulateReadingTime } from "./delay.js";
|
|
5
5
|
export { errorMessage } from "./error-message.js";
|
|
6
6
|
export { isLoopbackAddress } from "./loopback.js";
|
|
7
|
+
export { SessionPacer, rhythmMultiplier } from "./session-pacer.js";
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjI,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute the session rhythm multiplier based on operation count.
|
|
3
|
+
*
|
|
4
|
+
* Models the natural pacing of a human browsing session:
|
|
5
|
+
* - **Warm-up (ops 0–2):** 1.5× — slower, exploring, getting oriented
|
|
6
|
+
* - **Cruising (ops 3–8):** 0.85× — in the flow, comfortable pace
|
|
7
|
+
* - **Fatigue (ops 9+):** 1.0 + 0.05 × (n − 8) — gradually slowing down
|
|
8
|
+
*/
|
|
9
|
+
export declare function rhythmMultiplier(operationCount: number): number;
|
|
10
|
+
/**
|
|
11
|
+
* Session-level pacer that tracks inter-operation timing and enforces
|
|
12
|
+
* minimum gaps between operations to prevent rapid-fire automation patterns.
|
|
13
|
+
*
|
|
14
|
+
* Each operation should call {@link paceBeforeOperation} before starting
|
|
15
|
+
* and {@link recordOperationEnd} after completing. The pacer applies a
|
|
16
|
+
* Gaussian-distributed cool-down scaled by a session rhythm multiplier
|
|
17
|
+
* that models warm-up, cruising, and fatigue phases.
|
|
18
|
+
*/
|
|
19
|
+
export declare class SessionPacer {
|
|
20
|
+
private lastOperationEnd;
|
|
21
|
+
private operationCount;
|
|
22
|
+
/** Call before starting an operation. Resolves after the appropriate cool-down. */
|
|
23
|
+
paceBeforeOperation(operationType: "read" | "write"): Promise<void>;
|
|
24
|
+
/** Call after an operation completes to record its end timestamp. */
|
|
25
|
+
recordOperationEnd(): void;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=session-pacer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-pacer.d.ts","sourceRoot":"","sources":["../../src/utils/session-pacer.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAI/D;AAED;;;;;;;;GAQG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,gBAAgB,CAAK;IAC7B,OAAO,CAAC,cAAc,CAAK;IAE3B,oFAAoF;IAC9E,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBzE,qEAAqE;IACrE,kBAAkB,IAAI,IAAI;CAI3B"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
import { delay, gaussianBetween } from "./delay.js";
|
|
4
|
+
/**
|
|
5
|
+
* Compute the session rhythm multiplier based on operation count.
|
|
6
|
+
*
|
|
7
|
+
* Models the natural pacing of a human browsing session:
|
|
8
|
+
* - **Warm-up (ops 0–2):** 1.5× — slower, exploring, getting oriented
|
|
9
|
+
* - **Cruising (ops 3–8):** 0.85× — in the flow, comfortable pace
|
|
10
|
+
* - **Fatigue (ops 9+):** 1.0 + 0.05 × (n − 8) — gradually slowing down
|
|
11
|
+
*/
|
|
12
|
+
export function rhythmMultiplier(operationCount) {
|
|
13
|
+
if (operationCount <= 2)
|
|
14
|
+
return 1.5;
|
|
15
|
+
if (operationCount <= 8)
|
|
16
|
+
return 0.85;
|
|
17
|
+
return 1.0 + 0.05 * (operationCount - 8);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Session-level pacer that tracks inter-operation timing and enforces
|
|
21
|
+
* minimum gaps between operations to prevent rapid-fire automation patterns.
|
|
22
|
+
*
|
|
23
|
+
* Each operation should call {@link paceBeforeOperation} before starting
|
|
24
|
+
* and {@link recordOperationEnd} after completing. The pacer applies a
|
|
25
|
+
* Gaussian-distributed cool-down scaled by a session rhythm multiplier
|
|
26
|
+
* that models warm-up, cruising, and fatigue phases.
|
|
27
|
+
*/
|
|
28
|
+
export class SessionPacer {
|
|
29
|
+
lastOperationEnd = 0;
|
|
30
|
+
operationCount = 0;
|
|
31
|
+
/** Call before starting an operation. Resolves after the appropriate cool-down. */
|
|
32
|
+
async paceBeforeOperation(operationType) {
|
|
33
|
+
const now = Date.now();
|
|
34
|
+
// First operation — no cool-down needed
|
|
35
|
+
if (this.lastOperationEnd === 0)
|
|
36
|
+
return;
|
|
37
|
+
const elapsed = now - this.lastOperationEnd;
|
|
38
|
+
const multiplier = rhythmMultiplier(this.operationCount);
|
|
39
|
+
// Base cool-down parameters per operation type
|
|
40
|
+
const baseDelay = operationType === "read"
|
|
41
|
+
? gaussianBetween(2_500, 800, 1_000, 5_000)
|
|
42
|
+
: gaussianBetween(8_000, 3_000, 3_000, 18_000);
|
|
43
|
+
const required = baseDelay * multiplier;
|
|
44
|
+
const remaining = required - elapsed;
|
|
45
|
+
if (remaining > 0) {
|
|
46
|
+
await delay(remaining);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/** Call after an operation completes to record its end timestamp. */
|
|
50
|
+
recordOperationEnd() {
|
|
51
|
+
this.lastOperationEnd = Date.now();
|
|
52
|
+
this.operationCount++;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=session-pacer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-pacer.js","sourceRoot":"","sources":["../../src/utils/session-pacer.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,cAAsB;IACrD,IAAI,cAAc,IAAI,CAAC;QAAE,OAAO,GAAG,CAAC;IACpC,IAAI,cAAc,IAAI,CAAC;QAAE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111 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
import { describe, expect, it, vi, beforeEach, afterEach } from "vitest";
|
|
4
|
+
import { SessionPacer, rhythmMultiplier } from "./session-pacer.js";
|
|
5
|
+
describe("rhythmMultiplier", () => {
|
|
6
|
+
it("returns 1.5 for warm-up phase (ops 0–2)", () => {
|
|
7
|
+
expect(rhythmMultiplier(0)).toBe(1.5);
|
|
8
|
+
expect(rhythmMultiplier(1)).toBe(1.5);
|
|
9
|
+
expect(rhythmMultiplier(2)).toBe(1.5);
|
|
10
|
+
});
|
|
11
|
+
it("returns 0.85 for cruising phase (ops 3–8)", () => {
|
|
12
|
+
expect(rhythmMultiplier(3)).toBe(0.85);
|
|
13
|
+
expect(rhythmMultiplier(5)).toBe(0.85);
|
|
14
|
+
expect(rhythmMultiplier(8)).toBe(0.85);
|
|
15
|
+
});
|
|
16
|
+
it("returns increasing multiplier for fatigue phase (ops 9+)", () => {
|
|
17
|
+
expect(rhythmMultiplier(9)).toBeCloseTo(1.05);
|
|
18
|
+
expect(rhythmMultiplier(10)).toBeCloseTo(1.1);
|
|
19
|
+
expect(rhythmMultiplier(18)).toBeCloseTo(1.5);
|
|
20
|
+
expect(rhythmMultiplier(28)).toBeCloseTo(2.0);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
describe("SessionPacer", () => {
|
|
24
|
+
beforeEach(() => {
|
|
25
|
+
vi.useFakeTimers();
|
|
26
|
+
});
|
|
27
|
+
afterEach(() => {
|
|
28
|
+
vi.useRealTimers();
|
|
29
|
+
});
|
|
30
|
+
it("skips cool-down for the first operation", async () => {
|
|
31
|
+
const pacer = new SessionPacer();
|
|
32
|
+
const start = Date.now();
|
|
33
|
+
const promise = pacer.paceBeforeOperation("read");
|
|
34
|
+
await vi.runAllTimersAsync();
|
|
35
|
+
await promise;
|
|
36
|
+
// Should resolve immediately — no delay for first operation
|
|
37
|
+
expect(Date.now() - start).toBe(0);
|
|
38
|
+
});
|
|
39
|
+
it("enforces cool-down after first operation completes", async () => {
|
|
40
|
+
const pacer = new SessionPacer();
|
|
41
|
+
// Complete a first operation
|
|
42
|
+
pacer.recordOperationEnd();
|
|
43
|
+
// Immediately request pacing for the next — should delay
|
|
44
|
+
const promise = pacer.paceBeforeOperation("read");
|
|
45
|
+
// Advance timers to let the delay resolve
|
|
46
|
+
await vi.runAllTimersAsync();
|
|
47
|
+
await promise;
|
|
48
|
+
// The elapsed time should be positive (cool-down was applied)
|
|
49
|
+
expect(Date.now()).toBeGreaterThan(0);
|
|
50
|
+
});
|
|
51
|
+
it("skips cool-down when enough time has already elapsed", async () => {
|
|
52
|
+
const pacer = new SessionPacer();
|
|
53
|
+
// Complete first operation
|
|
54
|
+
pacer.recordOperationEnd();
|
|
55
|
+
// Advance time well past any possible cool-down
|
|
56
|
+
vi.advanceTimersByTime(60_000);
|
|
57
|
+
const timeBefore = Date.now();
|
|
58
|
+
const promise = pacer.paceBeforeOperation("read");
|
|
59
|
+
await vi.runAllTimersAsync();
|
|
60
|
+
await promise;
|
|
61
|
+
// No additional delay — the gap already exceeds the required cool-down
|
|
62
|
+
expect(Date.now() - timeBefore).toBe(0);
|
|
63
|
+
});
|
|
64
|
+
it("increments operation count on recordOperationEnd", async () => {
|
|
65
|
+
const pacer = new SessionPacer();
|
|
66
|
+
// First op — warm-up phase (1.5x), complete it
|
|
67
|
+
pacer.recordOperationEnd();
|
|
68
|
+
// Second op — still warm-up (1.5x)
|
|
69
|
+
const promise1 = pacer.paceBeforeOperation("read");
|
|
70
|
+
await vi.runAllTimersAsync();
|
|
71
|
+
await promise1;
|
|
72
|
+
pacer.recordOperationEnd();
|
|
73
|
+
// Third op — still warm-up (op count = 2)
|
|
74
|
+
const promise2 = pacer.paceBeforeOperation("read");
|
|
75
|
+
await vi.runAllTimersAsync();
|
|
76
|
+
await promise2;
|
|
77
|
+
pacer.recordOperationEnd();
|
|
78
|
+
// Fourth op — cruising phase (op count = 3, multiplier = 0.85)
|
|
79
|
+
const timeBefore = Date.now();
|
|
80
|
+
const promise3 = pacer.paceBeforeOperation("read");
|
|
81
|
+
await vi.runAllTimersAsync();
|
|
82
|
+
await promise3;
|
|
83
|
+
// The delay should be shorter in cruising than warm-up
|
|
84
|
+
// (0.85x vs 1.5x of the base Gaussian delay)
|
|
85
|
+
const elapsed = Date.now() - timeBefore;
|
|
86
|
+
expect(elapsed).toBeGreaterThan(0);
|
|
87
|
+
});
|
|
88
|
+
it("applies longer cool-down for write operations", async () => {
|
|
89
|
+
// Seed Math.random for deterministic comparison
|
|
90
|
+
vi.spyOn(Math, "random").mockReturnValue(0.5);
|
|
91
|
+
// Measure read cool-down
|
|
92
|
+
const readPacer = new SessionPacer();
|
|
93
|
+
readPacer.recordOperationEnd();
|
|
94
|
+
const readBefore = Date.now();
|
|
95
|
+
const readPromise = readPacer.paceBeforeOperation("read");
|
|
96
|
+
await vi.runAllTimersAsync();
|
|
97
|
+
await readPromise;
|
|
98
|
+
const readElapsed = Date.now() - readBefore;
|
|
99
|
+
// Measure write cool-down in a fresh pacer
|
|
100
|
+
const writePacer = new SessionPacer();
|
|
101
|
+
writePacer.recordOperationEnd();
|
|
102
|
+
const writeBefore = Date.now();
|
|
103
|
+
const writePromise = writePacer.paceBeforeOperation("write");
|
|
104
|
+
await vi.runAllTimersAsync();
|
|
105
|
+
await writePromise;
|
|
106
|
+
const writeElapsed = Date.now() - writeBefore;
|
|
107
|
+
// Write cool-down should be longer than read cool-down
|
|
108
|
+
expect(writeElapsed).toBeGreaterThan(readElapsed);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
//# sourceMappingURL=session-pacer.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-pacer.test.js","sourceRoot":"","sources":["../../src/utils/session-pacer.test.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,QAAQ,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