@lhremote/core 0.0.0 → 0.2.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/LICENSE +661 -0
- package/README.md +124 -0
- package/dist/cdp/app-discovery.d.ts +22 -0
- package/dist/cdp/app-discovery.d.ts.map +1 -0
- package/dist/cdp/app-discovery.js +60 -0
- package/dist/cdp/app-discovery.js.map +1 -0
- package/dist/cdp/app-discovery.test.d.ts +2 -0
- package/dist/cdp/app-discovery.test.d.ts.map +1 -0
- package/dist/cdp/app-discovery.test.js +124 -0
- package/dist/cdp/app-discovery.test.js.map +1 -0
- package/dist/cdp/client.d.ts +114 -0
- package/dist/cdp/client.d.ts.map +1 -0
- package/dist/cdp/client.integration.test.d.ts +2 -0
- package/dist/cdp/client.integration.test.d.ts.map +1 -0
- package/dist/cdp/client.integration.test.js +77 -0
- package/dist/cdp/client.integration.test.js.map +1 -0
- package/dist/cdp/client.js +319 -0
- package/dist/cdp/client.js.map +1 -0
- package/dist/cdp/client.test.d.ts +2 -0
- package/dist/cdp/client.test.d.ts.map +1 -0
- package/dist/cdp/client.test.js +533 -0
- package/dist/cdp/client.test.js.map +1 -0
- package/dist/cdp/discovery.d.ts +14 -0
- package/dist/cdp/discovery.d.ts.map +1 -0
- package/dist/cdp/discovery.integration.test.d.ts +2 -0
- package/dist/cdp/discovery.integration.test.d.ts.map +1 -0
- package/dist/cdp/discovery.integration.test.js +27 -0
- package/dist/cdp/discovery.integration.test.js.map +1 -0
- package/dist/cdp/discovery.js +33 -0
- package/dist/cdp/discovery.js.map +1 -0
- package/dist/cdp/discovery.test.d.ts +2 -0
- package/dist/cdp/discovery.test.d.ts.map +1 -0
- package/dist/cdp/discovery.test.js +56 -0
- package/dist/cdp/discovery.test.js.map +1 -0
- package/dist/cdp/errors.d.ts +28 -0
- package/dist/cdp/errors.d.ts.map +1 -0
- package/dist/cdp/errors.js +42 -0
- package/dist/cdp/errors.js.map +1 -0
- package/dist/cdp/errors.test.d.ts +2 -0
- package/dist/cdp/errors.test.d.ts.map +1 -0
- package/dist/cdp/errors.test.js +37 -0
- package/dist/cdp/errors.test.js.map +1 -0
- package/dist/cdp/index.d.ts +6 -0
- package/dist/cdp/index.d.ts.map +1 -0
- package/dist/cdp/index.js +8 -0
- package/dist/cdp/index.js.map +1 -0
- package/dist/cdp/instance-discovery.d.ts +30 -0
- package/dist/cdp/instance-discovery.d.ts.map +1 -0
- package/dist/cdp/instance-discovery.integration.test.d.ts +2 -0
- package/dist/cdp/instance-discovery.integration.test.d.ts.map +1 -0
- package/dist/cdp/instance-discovery.integration.test.js +36 -0
- package/dist/cdp/instance-discovery.integration.test.js.map +1 -0
- package/dist/cdp/instance-discovery.js +118 -0
- package/dist/cdp/instance-discovery.js.map +1 -0
- package/dist/cdp/instance-discovery.test.d.ts +2 -0
- package/dist/cdp/instance-discovery.test.d.ts.map +1 -0
- package/dist/cdp/instance-discovery.test.js +112 -0
- package/dist/cdp/instance-discovery.test.js.map +1 -0
- package/dist/cdp/testing/launch-chromium.d.ts +24 -0
- package/dist/cdp/testing/launch-chromium.d.ts.map +1 -0
- package/dist/cdp/testing/launch-chromium.js +93 -0
- package/dist/cdp/testing/launch-chromium.js.map +1 -0
- package/dist/constants.d.ts +5 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +7 -0
- package/dist/constants.js.map +1 -0
- package/dist/data/action-types.d.ts +39 -0
- package/dist/data/action-types.d.ts.map +1 -0
- package/dist/data/action-types.js +497 -0
- package/dist/data/action-types.js.map +1 -0
- package/dist/data/action-types.test.d.ts +2 -0
- package/dist/data/action-types.test.d.ts.map +1 -0
- package/dist/data/action-types.test.js +544 -0
- package/dist/data/action-types.test.js.map +1 -0
- package/dist/data/index.d.ts +3 -0
- package/dist/data/index.d.ts.map +1 -0
- package/dist/data/index.js +4 -0
- package/dist/data/index.js.map +1 -0
- package/dist/db/client.d.ts +27 -0
- package/dist/db/client.d.ts.map +1 -0
- package/dist/db/client.integration.test.d.ts +2 -0
- package/dist/db/client.integration.test.d.ts.map +1 -0
- package/dist/db/client.integration.test.js +63 -0
- package/dist/db/client.integration.test.js.map +1 -0
- package/dist/db/client.js +23 -0
- package/dist/db/client.js.map +1 -0
- package/dist/db/client.test.d.ts +2 -0
- package/dist/db/client.test.d.ts.map +1 -0
- package/dist/db/client.test.js +48 -0
- package/dist/db/client.test.js.map +1 -0
- package/dist/db/discovery.d.ts +14 -0
- package/dist/db/discovery.d.ts.map +1 -0
- package/dist/db/discovery.integration.test.d.ts +2 -0
- package/dist/db/discovery.integration.test.d.ts.map +1 -0
- package/dist/db/discovery.integration.test.js +101 -0
- package/dist/db/discovery.integration.test.js.map +1 -0
- package/dist/db/discovery.js +76 -0
- package/dist/db/discovery.js.map +1 -0
- package/dist/db/discovery.test.d.ts +2 -0
- package/dist/db/discovery.test.d.ts.map +1 -0
- package/dist/db/discovery.test.js +125 -0
- package/dist/db/discovery.test.js.map +1 -0
- package/dist/db/errors.d.ts +52 -0
- package/dist/db/errors.d.ts.map +1 -0
- package/dist/db/errors.js +82 -0
- package/dist/db/errors.js.map +1 -0
- package/dist/db/errors.test.d.ts +2 -0
- package/dist/db/errors.test.d.ts.map +1 -0
- package/dist/db/errors.test.js +34 -0
- package/dist/db/errors.test.js.map +1 -0
- package/dist/db/escape-like.d.ts +8 -0
- package/dist/db/escape-like.d.ts.map +1 -0
- package/dist/db/escape-like.js +12 -0
- package/dist/db/escape-like.js.map +1 -0
- package/dist/db/escape-like.test.d.ts +2 -0
- package/dist/db/escape-like.test.d.ts.map +1 -0
- package/dist/db/escape-like.test.js +25 -0
- package/dist/db/escape-like.test.js.map +1 -0
- package/dist/db/index.d.ts +5 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +7 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/repositories/campaign-exclude-list.d.ts +89 -0
- package/dist/db/repositories/campaign-exclude-list.d.ts.map +1 -0
- package/dist/db/repositories/campaign-exclude-list.js +204 -0
- package/dist/db/repositories/campaign-exclude-list.js.map +1 -0
- package/dist/db/repositories/campaign-exclude-list.test.d.ts +2 -0
- package/dist/db/repositories/campaign-exclude-list.test.d.ts.map +1 -0
- package/dist/db/repositories/campaign-exclude-list.test.js +132 -0
- package/dist/db/repositories/campaign-exclude-list.test.js.map +1 -0
- package/dist/db/repositories/campaign-statistics.d.ts +58 -0
- package/dist/db/repositories/campaign-statistics.d.ts.map +1 -0
- package/dist/db/repositories/campaign-statistics.js +278 -0
- package/dist/db/repositories/campaign-statistics.js.map +1 -0
- package/dist/db/repositories/campaign-statistics.test.d.ts +2 -0
- package/dist/db/repositories/campaign-statistics.test.d.ts.map +1 -0
- package/dist/db/repositories/campaign-statistics.test.js +266 -0
- package/dist/db/repositories/campaign-statistics.test.js.map +1 -0
- package/dist/db/repositories/campaign.d.ts +103 -0
- package/dist/db/repositories/campaign.d.ts.map +1 -0
- package/dist/db/repositories/campaign.js +388 -0
- package/dist/db/repositories/campaign.js.map +1 -0
- package/dist/db/repositories/campaign.test.d.ts +2 -0
- package/dist/db/repositories/campaign.test.d.ts.map +1 -0
- package/dist/db/repositories/campaign.test.js +392 -0
- package/dist/db/repositories/campaign.test.js.map +1 -0
- package/dist/db/repositories/index.d.ts +6 -0
- package/dist/db/repositories/index.d.ts.map +1 -0
- package/dist/db/repositories/index.js +8 -0
- package/dist/db/repositories/index.js.map +1 -0
- package/dist/db/repositories/message.d.ts +57 -0
- package/dist/db/repositories/message.d.ts.map +1 -0
- package/dist/db/repositories/message.integration.test.d.ts +2 -0
- package/dist/db/repositories/message.integration.test.d.ts.map +1 -0
- package/dist/db/repositories/message.integration.test.js +137 -0
- package/dist/db/repositories/message.integration.test.js.map +1 -0
- package/dist/db/repositories/message.js +308 -0
- package/dist/db/repositories/message.js.map +1 -0
- package/dist/db/repositories/message.test.d.ts +2 -0
- package/dist/db/repositories/message.test.d.ts.map +1 -0
- package/dist/db/repositories/message.test.js +179 -0
- package/dist/db/repositories/message.test.js.map +1 -0
- package/dist/db/repositories/profile.d.ts +42 -0
- package/dist/db/repositories/profile.d.ts.map +1 -0
- package/dist/db/repositories/profile.integration.test.d.ts +2 -0
- package/dist/db/repositories/profile.integration.test.d.ts.map +1 -0
- package/dist/db/repositories/profile.integration.test.js +222 -0
- package/dist/db/repositories/profile.integration.test.js.map +1 -0
- package/dist/db/repositories/profile.js +163 -0
- package/dist/db/repositories/profile.js.map +1 -0
- package/dist/db/repositories/profile.test.d.ts +2 -0
- package/dist/db/repositories/profile.test.d.ts.map +1 -0
- package/dist/db/repositories/profile.test.js +216 -0
- package/dist/db/repositories/profile.test.js.map +1 -0
- package/dist/db/testing/create-fixture.d.ts +2 -0
- package/dist/db/testing/create-fixture.d.ts.map +1 -0
- package/dist/db/testing/create-fixture.js +745 -0
- package/dist/db/testing/create-fixture.js.map +1 -0
- package/dist/db/testing/open-fixture.d.ts +15 -0
- package/dist/db/testing/open-fixture.d.ts.map +1 -0
- package/dist/db/testing/open-fixture.js +39 -0
- package/dist/db/testing/open-fixture.js.map +1 -0
- package/dist/formats/campaign-format.d.ts +31 -0
- package/dist/formats/campaign-format.d.ts.map +1 -0
- package/dist/formats/campaign-format.js +225 -0
- package/dist/formats/campaign-format.js.map +1 -0
- package/dist/formats/campaign-format.test.d.ts +2 -0
- package/dist/formats/campaign-format.test.d.ts.map +1 -0
- package/dist/formats/campaign-format.test.js +442 -0
- package/dist/formats/campaign-format.test.js.map +1 -0
- package/dist/formats/errors.d.ts +7 -0
- package/dist/formats/errors.d.ts.map +1 -0
- package/dist/formats/errors.js +12 -0
- package/dist/formats/errors.js.map +1 -0
- package/dist/formats/index.d.ts +3 -0
- package/dist/formats/index.d.ts.map +1 -0
- package/dist/formats/index.js +5 -0
- package/dist/formats/index.js.map +1 -0
- package/dist/index.d.ts +10 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -1
- package/dist/index.js.map +1 -1
- package/dist/operations/campaign-add-action.d.ts +14 -0
- package/dist/operations/campaign-add-action.d.ts.map +1 -0
- package/dist/operations/campaign-add-action.js +33 -0
- package/dist/operations/campaign-add-action.js.map +1 -0
- package/dist/operations/campaign-add-action.test.d.ts +2 -0
- package/dist/operations/campaign-add-action.test.d.ts.map +1 -0
- package/dist/operations/campaign-add-action.test.js +122 -0
- package/dist/operations/campaign-add-action.test.js.map +1 -0
- package/dist/operations/campaign-create.d.ts +17 -0
- package/dist/operations/campaign-create.d.ts.map +1 -0
- package/dist/operations/campaign-create.js +21 -0
- package/dist/operations/campaign-create.js.map +1 -0
- package/dist/operations/campaign-create.test.d.ts +2 -0
- package/dist/operations/campaign-create.test.d.ts.map +1 -0
- package/dist/operations/campaign-create.test.js +113 -0
- package/dist/operations/campaign-create.test.js.map +1 -0
- package/dist/operations/campaign-delete.d.ts +20 -0
- package/dist/operations/campaign-delete.d.ts.map +1 -0
- package/dist/operations/campaign-delete.js +22 -0
- package/dist/operations/campaign-delete.js.map +1 -0
- package/dist/operations/campaign-delete.test.d.ts +2 -0
- package/dist/operations/campaign-delete.test.d.ts.map +1 -0
- package/dist/operations/campaign-delete.test.js +92 -0
- package/dist/operations/campaign-delete.test.js.map +1 -0
- package/dist/operations/campaign-exclude-add.d.ts +16 -0
- package/dist/operations/campaign-exclude-add.d.ts.map +1 -0
- package/dist/operations/campaign-exclude-add.js +27 -0
- package/dist/operations/campaign-exclude-add.js.map +1 -0
- package/dist/operations/campaign-exclude-add.test.d.ts +2 -0
- package/dist/operations/campaign-exclude-add.test.d.ts.map +1 -0
- package/dist/operations/campaign-exclude-add.test.js +114 -0
- package/dist/operations/campaign-exclude-add.test.js.map +1 -0
- package/dist/operations/campaign-exclude-list.d.ts +14 -0
- package/dist/operations/campaign-exclude-list.d.ts.map +1 -0
- package/dist/operations/campaign-exclude-list.js +26 -0
- package/dist/operations/campaign-exclude-list.js.map +1 -0
- package/dist/operations/campaign-exclude-list.test.d.ts +2 -0
- package/dist/operations/campaign-exclude-list.test.d.ts.map +1 -0
- package/dist/operations/campaign-exclude-list.test.js +113 -0
- package/dist/operations/campaign-exclude-list.test.js.map +1 -0
- package/dist/operations/campaign-exclude-remove.d.ts +16 -0
- package/dist/operations/campaign-exclude-remove.d.ts.map +1 -0
- package/dist/operations/campaign-exclude-remove.js +27 -0
- package/dist/operations/campaign-exclude-remove.js.map +1 -0
- package/dist/operations/campaign-exclude-remove.test.d.ts +2 -0
- package/dist/operations/campaign-exclude-remove.test.d.ts.map +1 -0
- package/dist/operations/campaign-exclude-remove.test.js +114 -0
- package/dist/operations/campaign-exclude-remove.test.js.map +1 -0
- package/dist/operations/campaign-export.d.ts +12 -0
- package/dist/operations/campaign-export.d.ts.map +1 -0
- package/dist/operations/campaign-export.js +24 -0
- package/dist/operations/campaign-export.js.map +1 -0
- package/dist/operations/campaign-export.test.d.ts +2 -0
- package/dist/operations/campaign-export.test.d.ts.map +1 -0
- package/dist/operations/campaign-export.test.js +134 -0
- package/dist/operations/campaign-export.test.js.map +1 -0
- package/dist/operations/campaign-get.d.ts +19 -0
- package/dist/operations/campaign-get.d.ts.map +1 -0
- package/dist/operations/campaign-get.js +23 -0
- package/dist/operations/campaign-get.js.map +1 -0
- package/dist/operations/campaign-get.test.d.ts +2 -0
- package/dist/operations/campaign-get.test.d.ts.map +1 -0
- package/dist/operations/campaign-get.test.js +99 -0
- package/dist/operations/campaign-get.test.js.map +1 -0
- package/dist/operations/campaign-list.d.ts +20 -0
- package/dist/operations/campaign-list.d.ts.map +1 -0
- package/dist/operations/campaign-list.js +23 -0
- package/dist/operations/campaign-list.js.map +1 -0
- package/dist/operations/campaign-list.test.d.ts +2 -0
- package/dist/operations/campaign-list.test.d.ts.map +1 -0
- package/dist/operations/campaign-list.test.js +106 -0
- package/dist/operations/campaign-list.test.js.map +1 -0
- package/dist/operations/campaign-move-next.d.ts +15 -0
- package/dist/operations/campaign-move-next.d.ts.map +1 -0
- package/dist/operations/campaign-move-next.js +25 -0
- package/dist/operations/campaign-move-next.js.map +1 -0
- package/dist/operations/campaign-move-next.test.d.ts +2 -0
- package/dist/operations/campaign-move-next.test.d.ts.map +1 -0
- package/dist/operations/campaign-move-next.test.js +105 -0
- package/dist/operations/campaign-move-next.test.js.map +1 -0
- package/dist/operations/campaign-remove-action.d.ts +12 -0
- package/dist/operations/campaign-remove-action.d.ts.map +1 -0
- package/dist/operations/campaign-remove-action.js +23 -0
- package/dist/operations/campaign-remove-action.js.map +1 -0
- package/dist/operations/campaign-remove-action.test.d.ts +2 -0
- package/dist/operations/campaign-remove-action.test.d.ts.map +1 -0
- package/dist/operations/campaign-remove-action.test.js +95 -0
- package/dist/operations/campaign-remove-action.test.js.map +1 -0
- package/dist/operations/campaign-reorder-actions.d.ts +13 -0
- package/dist/operations/campaign-reorder-actions.d.ts.map +1 -0
- package/dist/operations/campaign-reorder-actions.js +19 -0
- package/dist/operations/campaign-reorder-actions.js.map +1 -0
- package/dist/operations/campaign-reorder-actions.test.d.ts +2 -0
- package/dist/operations/campaign-reorder-actions.test.d.ts.map +1 -0
- package/dist/operations/campaign-reorder-actions.test.js +103 -0
- package/dist/operations/campaign-reorder-actions.test.js.map +1 -0
- package/dist/operations/campaign-retry.d.ts +13 -0
- package/dist/operations/campaign-retry.d.ts.map +1 -0
- package/dist/operations/campaign-retry.js +24 -0
- package/dist/operations/campaign-retry.js.map +1 -0
- package/dist/operations/campaign-retry.test.d.ts +2 -0
- package/dist/operations/campaign-retry.test.d.ts.map +1 -0
- package/dist/operations/campaign-retry.test.js +100 -0
- package/dist/operations/campaign-retry.test.js.map +1 -0
- package/dist/operations/campaign-start.d.ts +13 -0
- package/dist/operations/campaign-start.d.ts.map +1 -0
- package/dist/operations/campaign-start.js +24 -0
- package/dist/operations/campaign-start.js.map +1 -0
- package/dist/operations/campaign-start.test.d.ts +2 -0
- package/dist/operations/campaign-start.test.d.ts.map +1 -0
- package/dist/operations/campaign-start.test.js +96 -0
- package/dist/operations/campaign-start.test.js.map +1 -0
- package/dist/operations/campaign-statistics.d.ts +10 -0
- package/dist/operations/campaign-statistics.d.ts.map +1 -0
- package/dist/operations/campaign-statistics.js +23 -0
- package/dist/operations/campaign-statistics.js.map +1 -0
- package/dist/operations/campaign-statistics.test.d.ts +2 -0
- package/dist/operations/campaign-statistics.test.d.ts.map +1 -0
- package/dist/operations/campaign-statistics.test.js +120 -0
- package/dist/operations/campaign-statistics.test.js.map +1 -0
- package/dist/operations/campaign-status.d.ts +26 -0
- package/dist/operations/campaign-status.d.ts.map +1 -0
- package/dist/operations/campaign-status.js +32 -0
- package/dist/operations/campaign-status.js.map +1 -0
- package/dist/operations/campaign-status.test.d.ts +2 -0
- package/dist/operations/campaign-status.test.d.ts.map +1 -0
- package/dist/operations/campaign-status.test.js +142 -0
- package/dist/operations/campaign-status.test.js.map +1 -0
- package/dist/operations/campaign-stop.d.ts +11 -0
- package/dist/operations/campaign-stop.d.ts.map +1 -0
- package/dist/operations/campaign-stop.js +23 -0
- package/dist/operations/campaign-stop.js.map +1 -0
- package/dist/operations/campaign-stop.test.d.ts +2 -0
- package/dist/operations/campaign-stop.test.d.ts.map +1 -0
- package/dist/operations/campaign-stop.test.js +92 -0
- package/dist/operations/campaign-stop.test.js.map +1 -0
- package/dist/operations/campaign-update.d.ts +18 -0
- package/dist/operations/campaign-update.d.ts.map +1 -0
- package/dist/operations/campaign-update.js +21 -0
- package/dist/operations/campaign-update.js.map +1 -0
- package/dist/operations/campaign-update.test.d.ts +2 -0
- package/dist/operations/campaign-update.test.d.ts.map +1 -0
- package/dist/operations/campaign-update.test.js +105 -0
- package/dist/operations/campaign-update.test.js.map +1 -0
- package/dist/operations/check-replies.d.ts +12 -0
- package/dist/operations/check-replies.d.ts.map +1 -0
- package/dist/operations/check-replies.js +26 -0
- package/dist/operations/check-replies.js.map +1 -0
- package/dist/operations/check-replies.test.d.ts +2 -0
- package/dist/operations/check-replies.test.d.ts.map +1 -0
- package/dist/operations/check-replies.test.js +118 -0
- package/dist/operations/check-replies.test.js.map +1 -0
- package/dist/operations/import-people-from-urls.d.ts +16 -0
- package/dist/operations/import-people-from-urls.d.ts.map +1 -0
- package/dist/operations/import-people-from-urls.js +27 -0
- package/dist/operations/import-people-from-urls.js.map +1 -0
- package/dist/operations/import-people-from-urls.test.d.ts +2 -0
- package/dist/operations/import-people-from-urls.test.d.ts.map +1 -0
- package/dist/operations/import-people-from-urls.test.js +118 -0
- package/dist/operations/import-people-from-urls.test.js.map +1 -0
- package/dist/operations/index.d.ts +24 -0
- package/dist/operations/index.d.ts.map +1 -0
- package/dist/operations/index.js +30 -0
- package/dist/operations/index.js.map +1 -0
- package/dist/operations/query-messages.d.ts +23 -0
- package/dist/operations/query-messages.d.ts.map +1 -0
- package/dist/operations/query-messages.js +33 -0
- package/dist/operations/query-messages.js.map +1 -0
- package/dist/operations/query-messages.test.d.ts +2 -0
- package/dist/operations/query-messages.test.d.ts.map +1 -0
- package/dist/operations/query-messages.test.js +134 -0
- package/dist/operations/query-messages.test.js.map +1 -0
- package/dist/operations/scrape-messaging-history.d.ts +10 -0
- package/dist/operations/scrape-messaging-history.d.ts.map +1 -0
- package/dist/operations/scrape-messaging-history.js +24 -0
- package/dist/operations/scrape-messaging-history.js.map +1 -0
- package/dist/operations/scrape-messaging-history.test.d.ts +2 -0
- package/dist/operations/scrape-messaging-history.test.d.ts.map +1 -0
- package/dist/operations/scrape-messaging-history.test.js +112 -0
- package/dist/operations/scrape-messaging-history.test.js.map +1 -0
- package/dist/operations/types.d.ts +10 -0
- package/dist/operations/types.d.ts.map +1 -0
- package/dist/operations/types.js +4 -0
- package/dist/operations/types.js.map +1 -0
- package/dist/services/account-resolution.d.ts +22 -0
- package/dist/services/account-resolution.d.ts.map +1 -0
- package/dist/services/account-resolution.js +45 -0
- package/dist/services/account-resolution.js.map +1 -0
- package/dist/services/account-resolution.test.d.ts +2 -0
- package/dist/services/account-resolution.test.d.ts.map +1 -0
- package/dist/services/account-resolution.test.js +91 -0
- package/dist/services/account-resolution.test.js.map +1 -0
- package/dist/services/app.d.ts +62 -0
- package/dist/services/app.d.ts.map +1 -0
- package/dist/services/app.js +200 -0
- package/dist/services/app.js.map +1 -0
- package/dist/services/app.test.d.ts +2 -0
- package/dist/services/app.test.d.ts.map +1 -0
- package/dist/services/app.test.js +267 -0
- package/dist/services/app.test.js.map +1 -0
- package/dist/services/campaign.d.ts +143 -0
- package/dist/services/campaign.d.ts.map +1 -0
- package/dist/services/campaign.js +409 -0
- package/dist/services/campaign.js.map +1 -0
- package/dist/services/campaign.test.d.ts +2 -0
- package/dist/services/campaign.test.d.ts.map +1 -0
- package/dist/services/campaign.test.js +481 -0
- package/dist/services/campaign.test.js.map +1 -0
- package/dist/services/errors.d.ts +83 -0
- package/dist/services/errors.d.ts.map +1 -0
- package/dist/services/errors.js +126 -0
- package/dist/services/errors.js.map +1 -0
- package/dist/services/errors.test.d.ts +2 -0
- package/dist/services/errors.test.d.ts.map +1 -0
- package/dist/services/errors.test.js +123 -0
- package/dist/services/errors.test.js.map +1 -0
- package/dist/services/index.d.ts +10 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +12 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/instance-context.d.ts +37 -0
- package/dist/services/instance-context.d.ts.map +1 -0
- package/dist/services/instance-context.js +49 -0
- package/dist/services/instance-context.js.map +1 -0
- package/dist/services/instance-context.test.d.ts +2 -0
- package/dist/services/instance-context.test.d.ts.map +1 -0
- package/dist/services/instance-context.test.js +203 -0
- package/dist/services/instance-context.test.js.map +1 -0
- package/dist/services/instance-lifecycle.d.ts +38 -0
- package/dist/services/instance-lifecycle.d.ts.map +1 -0
- package/dist/services/instance-lifecycle.js +87 -0
- package/dist/services/instance-lifecycle.js.map +1 -0
- package/dist/services/instance-lifecycle.test.d.ts +2 -0
- package/dist/services/instance-lifecycle.test.d.ts.map +1 -0
- package/dist/services/instance-lifecycle.test.js +158 -0
- package/dist/services/instance-lifecycle.test.js.map +1 -0
- package/dist/services/instance.d.ts +90 -0
- package/dist/services/instance.d.ts.map +1 -0
- package/dist/services/instance.js +178 -0
- package/dist/services/instance.js.map +1 -0
- package/dist/services/instance.test.d.ts +2 -0
- package/dist/services/instance.test.d.ts.map +1 -0
- package/dist/services/instance.test.js +291 -0
- package/dist/services/instance.test.js.map +1 -0
- package/dist/services/launcher.d.ts +54 -0
- package/dist/services/launcher.d.ts.map +1 -0
- package/dist/services/launcher.js +162 -0
- package/dist/services/launcher.js.map +1 -0
- package/dist/services/launcher.test.d.ts +2 -0
- package/dist/services/launcher.test.d.ts.map +1 -0
- package/dist/services/launcher.test.js +163 -0
- package/dist/services/launcher.test.js.map +1 -0
- package/dist/services/status.d.ts +37 -0
- package/dist/services/status.d.ts.map +1 -0
- package/dist/services/status.js +85 -0
- package/dist/services/status.js.map +1 -0
- package/dist/services/status.test.d.ts +2 -0
- package/dist/services/status.test.d.ts.map +1 -0
- package/dist/services/status.test.js +248 -0
- package/dist/services/status.test.js.map +1 -0
- package/dist/testing/e2e-helpers.d.ts +41 -0
- package/dist/testing/e2e-helpers.d.ts.map +1 -0
- package/dist/testing/e2e-helpers.js +114 -0
- package/dist/testing/e2e-helpers.js.map +1 -0
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +4 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/types/account.d.ts +13 -0
- package/dist/types/account.d.ts.map +1 -0
- package/dist/types/account.js +4 -0
- package/dist/types/account.js.map +1 -0
- package/dist/types/account.test.d.ts +2 -0
- package/dist/types/account.test.d.ts.map +1 -0
- package/dist/types/account.test.js +26 -0
- package/dist/types/account.test.js.map +1 -0
- package/dist/types/campaign.d.ts +267 -0
- package/dist/types/campaign.d.ts.map +1 -0
- package/dist/types/campaign.js +4 -0
- package/dist/types/campaign.js.map +1 -0
- package/dist/types/cdp.d.ts +18 -0
- package/dist/types/cdp.d.ts.map +1 -0
- package/dist/types/cdp.js +4 -0
- package/dist/types/cdp.js.map +1 -0
- package/dist/types/cdp.test.d.ts +2 -0
- package/dist/types/cdp.test.d.ts.map +1 -0
- package/dist/types/cdp.test.js +30 -0
- package/dist/types/cdp.test.js.map +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +4 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/instance.d.ts +36 -0
- package/dist/types/instance.d.ts.map +1 -0
- package/dist/types/instance.js +4 -0
- package/dist/types/instance.js.map +1 -0
- package/dist/types/instance.test.d.ts +2 -0
- package/dist/types/instance.test.d.ts.map +1 -0
- package/dist/types/instance.test.js +59 -0
- package/dist/types/instance.test.js.map +1 -0
- package/dist/types/messaging.d.ts +51 -0
- package/dist/types/messaging.d.ts.map +1 -0
- package/dist/types/messaging.js +4 -0
- package/dist/types/messaging.js.map +1 -0
- package/dist/types/profile.d.ts +81 -0
- package/dist/types/profile.d.ts.map +1 -0
- package/dist/types/profile.js +4 -0
- package/dist/types/profile.js.map +1 -0
- package/dist/types/profile.test.d.ts +2 -0
- package/dist/types/profile.test.d.ts.map +1 -0
- package/dist/types/profile.test.js +105 -0
- package/dist/types/profile.test.js.map +1 -0
- package/dist/utils/cdp-port.d.ts +5 -0
- package/dist/utils/cdp-port.d.ts.map +1 -0
- package/dist/utils/cdp-port.js +15 -0
- package/dist/utils/cdp-port.js.map +1 -0
- package/dist/utils/cdp-port.test.d.ts +2 -0
- package/dist/utils/cdp-port.test.d.ts.map +1 -0
- package/dist/utils/cdp-port.test.js +23 -0
- package/dist/utils/cdp-port.test.js.map +1 -0
- package/dist/utils/delay.d.ts +5 -0
- package/dist/utils/delay.d.ts.map +1 -0
- package/dist/utils/delay.js +9 -0
- package/dist/utils/delay.js.map +1 -0
- package/dist/utils/delay.test.d.ts +2 -0
- package/dist/utils/delay.test.d.ts.map +1 -0
- package/dist/utils/delay.test.js +17 -0
- package/dist/utils/delay.test.js.map +1 -0
- package/dist/utils/error-message.d.ts +5 -0
- package/dist/utils/error-message.d.ts.map +1 -0
- package/dist/utils/error-message.js +9 -0
- package/dist/utils/error-message.js.map +1 -0
- package/dist/utils/error-message.test.d.ts +2 -0
- package/dist/utils/error-message.test.d.ts.map +1 -0
- package/dist/utils/error-message.test.js +28 -0
- package/dist/utils/error-message.test.js.map +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +7 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/loopback.d.ts +10 -0
- package/dist/utils/loopback.d.ts.map +1 -0
- package/dist/utils/loopback.js +28 -0
- package/dist/utils/loopback.js.map +1 -0
- package/dist/utils/loopback.test.d.ts +2 -0
- package/dist/utils/loopback.test.d.ts.map +1 -0
- package/dist/utils/loopback.test.js +34 -0
- package/dist/utils/loopback.test.js.map +1 -0
- package/package.json +26 -9
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
import { ActionNotFoundError, CampaignNotFoundError, NoNextActionError, } from "../errors.js";
|
|
4
|
+
function deriveCampaignState(isPaused, isArchived, isValid) {
|
|
5
|
+
if (isArchived === 1)
|
|
6
|
+
return "archived";
|
|
7
|
+
if (isValid === 0)
|
|
8
|
+
return "invalid";
|
|
9
|
+
if (isPaused === 1)
|
|
10
|
+
return "paused";
|
|
11
|
+
return "active";
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Repository for campaign CRUD, creation support, and action chain operations.
|
|
15
|
+
*
|
|
16
|
+
* Provides read operations (list, get, getActions, getResults, getState)
|
|
17
|
+
* and write operations (fixIsValid, createActionExcludeLists, addAction,
|
|
18
|
+
* moveToNextAction, updateCampaign) for LinkedHelper campaigns.
|
|
19
|
+
*
|
|
20
|
+
* Write operations require the DatabaseClient to be opened with
|
|
21
|
+
* `{ readOnly: false }`.
|
|
22
|
+
*/
|
|
23
|
+
export class CampaignRepository {
|
|
24
|
+
client;
|
|
25
|
+
stmtListCampaigns;
|
|
26
|
+
stmtListAllCampaigns;
|
|
27
|
+
stmtGetCampaign;
|
|
28
|
+
stmtGetCampaignActions;
|
|
29
|
+
stmtGetResults;
|
|
30
|
+
// Write statements (prepared lazily to avoid issues with read-only mode)
|
|
31
|
+
writeStatements = null;
|
|
32
|
+
constructor(client) {
|
|
33
|
+
this.client = client;
|
|
34
|
+
const { db } = client;
|
|
35
|
+
this.stmtListCampaigns = db.prepare(`SELECT c.id, c.name, c.description, c.is_paused, c.is_archived,
|
|
36
|
+
c.is_valid, c.li_account_id, c.created_at,
|
|
37
|
+
(SELECT COUNT(*) FROM actions a WHERE a.campaign_id = c.id) AS action_count
|
|
38
|
+
FROM campaigns c
|
|
39
|
+
WHERE c.is_archived IS NULL OR c.is_archived = 0
|
|
40
|
+
ORDER BY c.created_at DESC`);
|
|
41
|
+
this.stmtListAllCampaigns = db.prepare(`SELECT c.id, c.name, c.description, c.is_paused, c.is_archived,
|
|
42
|
+
c.is_valid, c.li_account_id, c.created_at,
|
|
43
|
+
(SELECT COUNT(*) FROM actions a WHERE a.campaign_id = c.id) AS action_count
|
|
44
|
+
FROM campaigns c
|
|
45
|
+
ORDER BY c.created_at DESC`);
|
|
46
|
+
this.stmtGetCampaign = db.prepare(`SELECT id, name, description, is_paused, is_archived, is_valid,
|
|
47
|
+
li_account_id, created_at
|
|
48
|
+
FROM campaigns WHERE id = ?`);
|
|
49
|
+
this.stmtGetCampaignActions = db.prepare(`SELECT a.id, a.campaign_id, a.name, a.description,
|
|
50
|
+
ac.id AS config_id, ac.actionType AS action_type,
|
|
51
|
+
ac.actionSettings AS action_settings, ac.coolDown AS cool_down,
|
|
52
|
+
ac.maxActionResultsPerIteration AS max_action_results_per_iteration,
|
|
53
|
+
ac.isDraft AS is_draft, av.id AS version_id
|
|
54
|
+
FROM actions a
|
|
55
|
+
JOIN action_versions av ON av.action_id = a.id
|
|
56
|
+
JOIN action_configs ac ON av.config_id = ac.id
|
|
57
|
+
WHERE a.campaign_id = ?
|
|
58
|
+
ORDER BY a.id`);
|
|
59
|
+
this.stmtGetResults = db.prepare(`SELECT ar.id, ar.action_version_id, ar.person_id, ar.result,
|
|
60
|
+
ar.platform, ar.created_at
|
|
61
|
+
FROM action_results ar
|
|
62
|
+
JOIN action_versions av ON ar.action_version_id = av.id
|
|
63
|
+
JOIN actions a ON av.action_id = a.id
|
|
64
|
+
WHERE a.campaign_id = ?
|
|
65
|
+
ORDER BY ar.created_at DESC
|
|
66
|
+
LIMIT ?`);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* List campaigns, optionally including archived ones.
|
|
70
|
+
*/
|
|
71
|
+
listCampaigns(options = {}) {
|
|
72
|
+
const { includeArchived = false } = options;
|
|
73
|
+
const stmt = includeArchived
|
|
74
|
+
? this.stmtListAllCampaigns
|
|
75
|
+
: this.stmtListCampaigns;
|
|
76
|
+
const rows = stmt.all();
|
|
77
|
+
return rows.map((r) => ({
|
|
78
|
+
id: r.id,
|
|
79
|
+
name: r.name,
|
|
80
|
+
description: r.description,
|
|
81
|
+
state: deriveCampaignState(r.is_paused, r.is_archived, r.is_valid),
|
|
82
|
+
liAccountId: r.li_account_id,
|
|
83
|
+
actionCount: r.action_count,
|
|
84
|
+
createdAt: r.created_at,
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Get a campaign by ID.
|
|
89
|
+
*
|
|
90
|
+
* @throws {CampaignNotFoundError} if no campaign exists with the given ID.
|
|
91
|
+
*/
|
|
92
|
+
getCampaign(campaignId) {
|
|
93
|
+
const row = this.stmtGetCampaign.get(campaignId);
|
|
94
|
+
if (!row)
|
|
95
|
+
throw new CampaignNotFoundError(campaignId);
|
|
96
|
+
return {
|
|
97
|
+
id: row.id,
|
|
98
|
+
name: row.name,
|
|
99
|
+
description: row.description,
|
|
100
|
+
state: deriveCampaignState(row.is_paused, row.is_archived, row.is_valid),
|
|
101
|
+
liAccountId: row.li_account_id,
|
|
102
|
+
isPaused: row.is_paused === 1,
|
|
103
|
+
isArchived: row.is_archived === 1,
|
|
104
|
+
isValid: row.is_valid === null ? null : row.is_valid === 1,
|
|
105
|
+
createdAt: row.created_at,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Get all actions for a campaign.
|
|
110
|
+
*
|
|
111
|
+
* @throws {CampaignNotFoundError} if no campaign exists with the given ID.
|
|
112
|
+
*/
|
|
113
|
+
getCampaignActions(campaignId) {
|
|
114
|
+
// Verify campaign exists
|
|
115
|
+
this.getCampaign(campaignId);
|
|
116
|
+
const rows = this.stmtGetCampaignActions.all(campaignId);
|
|
117
|
+
return rows.map((r) => {
|
|
118
|
+
let actionSettings = {};
|
|
119
|
+
try {
|
|
120
|
+
actionSettings = JSON.parse(r.action_settings);
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
// Keep empty object if parsing fails
|
|
124
|
+
}
|
|
125
|
+
const config = {
|
|
126
|
+
id: r.config_id,
|
|
127
|
+
actionType: r.action_type,
|
|
128
|
+
actionSettings,
|
|
129
|
+
coolDown: r.cool_down,
|
|
130
|
+
maxActionResultsPerIteration: r.max_action_results_per_iteration,
|
|
131
|
+
isDraft: r.is_draft === 1,
|
|
132
|
+
};
|
|
133
|
+
return {
|
|
134
|
+
id: r.id,
|
|
135
|
+
campaignId: r.campaign_id,
|
|
136
|
+
name: r.name,
|
|
137
|
+
description: r.description,
|
|
138
|
+
config,
|
|
139
|
+
versionId: r.version_id,
|
|
140
|
+
};
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Get execution results for a campaign.
|
|
145
|
+
*
|
|
146
|
+
* @throws {CampaignNotFoundError} if no campaign exists with the given ID.
|
|
147
|
+
*/
|
|
148
|
+
getResults(campaignId, options = {}) {
|
|
149
|
+
// Verify campaign exists
|
|
150
|
+
this.getCampaign(campaignId);
|
|
151
|
+
const { limit = 100 } = options;
|
|
152
|
+
const rows = this.stmtGetResults.all(campaignId, limit);
|
|
153
|
+
return rows.map((r) => ({
|
|
154
|
+
id: r.id,
|
|
155
|
+
actionVersionId: r.action_version_id,
|
|
156
|
+
personId: r.person_id,
|
|
157
|
+
result: r.result,
|
|
158
|
+
platform: r.platform,
|
|
159
|
+
createdAt: r.created_at,
|
|
160
|
+
}));
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Get the current state of a campaign.
|
|
164
|
+
*
|
|
165
|
+
* @throws {CampaignNotFoundError} if no campaign exists with the given ID.
|
|
166
|
+
*/
|
|
167
|
+
getCampaignState(campaignId) {
|
|
168
|
+
const campaign = this.getCampaign(campaignId);
|
|
169
|
+
return campaign.state;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Update a campaign's name and/or description.
|
|
173
|
+
*
|
|
174
|
+
* @throws {CampaignNotFoundError} if no campaign exists with the given ID.
|
|
175
|
+
*/
|
|
176
|
+
updateCampaign(campaignId, updates) {
|
|
177
|
+
// Verify campaign exists
|
|
178
|
+
this.getCampaign(campaignId);
|
|
179
|
+
const setClauses = [];
|
|
180
|
+
const params = [];
|
|
181
|
+
if (updates.name !== undefined) {
|
|
182
|
+
setClauses.push("name = ?");
|
|
183
|
+
params.push(updates.name);
|
|
184
|
+
}
|
|
185
|
+
if (updates.description !== undefined) {
|
|
186
|
+
setClauses.push("description = ?");
|
|
187
|
+
params.push(updates.description);
|
|
188
|
+
}
|
|
189
|
+
if (setClauses.length > 0) {
|
|
190
|
+
params.push(campaignId);
|
|
191
|
+
const sql = `UPDATE campaigns SET ${setClauses.join(", ")} WHERE id = ?`;
|
|
192
|
+
this.client.db.prepare(sql).run(...params);
|
|
193
|
+
}
|
|
194
|
+
return this.getCampaign(campaignId);
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Prepare write statements lazily (only when needed).
|
|
198
|
+
* This avoids issues when the client is opened in read-only mode.
|
|
199
|
+
*/
|
|
200
|
+
getWriteStatements() {
|
|
201
|
+
if (this.writeStatements)
|
|
202
|
+
return this.writeStatements;
|
|
203
|
+
const { db } = this.client;
|
|
204
|
+
this.writeStatements = {
|
|
205
|
+
fixIsValid: db.prepare(`UPDATE campaigns SET is_valid = 1 WHERE id = ?`),
|
|
206
|
+
insertActionConfig: db.prepare(`INSERT INTO action_configs (actionType, actionSettings, coolDown, maxActionResultsPerIteration, isDraft)
|
|
207
|
+
VALUES (?, ?, ?, ?, 0)`),
|
|
208
|
+
insertAction: db.prepare(`INSERT INTO actions (campaign_id, name, description, startAt)
|
|
209
|
+
VALUES (?, ?, ?, datetime('now'))`),
|
|
210
|
+
insertActionVersion: db.prepare(`INSERT INTO action_versions (action_id, config_id)
|
|
211
|
+
VALUES (?, ?)`),
|
|
212
|
+
insertCollection: db.prepare(`INSERT INTO collections (li_account_id, name, created_at, updated_at)
|
|
213
|
+
VALUES (?, NULL, datetime('now'), datetime('now'))`),
|
|
214
|
+
insertCollectionPeopleVersion: db.prepare(`INSERT INTO collection_people_versions
|
|
215
|
+
(collection_id, version_operation_status, additional_data, created_at, updated_at)
|
|
216
|
+
VALUES (?, 'addToTarget', NULL, datetime('now'), datetime('now'))`),
|
|
217
|
+
setActionVersionExcludeList: db.prepare(`UPDATE action_versions SET exclude_list_id = ? WHERE action_id = ?`),
|
|
218
|
+
markTargetSuccessful: db.prepare(`UPDATE action_target_people SET state = 3
|
|
219
|
+
WHERE action_id = ? AND person_id = ?`),
|
|
220
|
+
queueTarget: db.prepare(`UPDATE action_target_people SET state = 1
|
|
221
|
+
WHERE action_id = ? AND person_id = ?`),
|
|
222
|
+
insertTarget: db.prepare(`INSERT INTO action_target_people
|
|
223
|
+
(action_id, action_version_id, person_id, state, li_account_id)
|
|
224
|
+
VALUES (?, ?, ?, 1, ?)`),
|
|
225
|
+
countTarget: db.prepare(`SELECT COUNT(*) AS cnt FROM action_target_people
|
|
226
|
+
WHERE action_id = ? AND person_id = ?`),
|
|
227
|
+
};
|
|
228
|
+
return this.writeStatements;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Fix the is_valid flag after programmatic campaign creation.
|
|
232
|
+
*
|
|
233
|
+
* Campaigns created via `createCampaign()` have `is_valid = NULL`,
|
|
234
|
+
* making them invisible in the LinkedHelper UI. This sets
|
|
235
|
+
* `is_valid = 1` to match the behavior of the UI campaign editor.
|
|
236
|
+
*/
|
|
237
|
+
fixIsValid(campaignId) {
|
|
238
|
+
const stmts = this.getWriteStatements();
|
|
239
|
+
stmts.fixIsValid.run(campaignId);
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Create action-level exclude lists after programmatic campaign creation.
|
|
243
|
+
*
|
|
244
|
+
* The `createCampaign()` API creates campaign-level exclude lists but
|
|
245
|
+
* skips action-level ones due to a code path bug. The LH UI crashes
|
|
246
|
+
* with "Expected excludeListId but got null" when opening campaigns
|
|
247
|
+
* missing these. This creates the full exclude list chain for each
|
|
248
|
+
* action: collection -> collection_people_versions -> action_versions.
|
|
249
|
+
*/
|
|
250
|
+
createActionExcludeLists(campaignId, liAccountId) {
|
|
251
|
+
const actions = this.getCampaignActions(campaignId);
|
|
252
|
+
if (actions.length === 0)
|
|
253
|
+
return;
|
|
254
|
+
const stmts = this.getWriteStatements();
|
|
255
|
+
this.client.db.exec("BEGIN");
|
|
256
|
+
try {
|
|
257
|
+
for (const action of actions) {
|
|
258
|
+
// 1. Create a collection for this action's exclude list
|
|
259
|
+
stmts.insertCollection.run(liAccountId);
|
|
260
|
+
const collectionId = this.client.db
|
|
261
|
+
.prepare("SELECT last_insert_rowid() AS id")
|
|
262
|
+
.get().id;
|
|
263
|
+
// 2. Create a collection_people_versions entry
|
|
264
|
+
stmts.insertCollectionPeopleVersion.run(collectionId);
|
|
265
|
+
const cpvId = this.client.db
|
|
266
|
+
.prepare("SELECT last_insert_rowid() AS id")
|
|
267
|
+
.get().id;
|
|
268
|
+
// 3. Set exclude_list_id on all action_versions for this action
|
|
269
|
+
stmts.setActionVersionExcludeList.run(cpvId, action.id);
|
|
270
|
+
}
|
|
271
|
+
this.client.db.exec("COMMIT");
|
|
272
|
+
}
|
|
273
|
+
catch (e) {
|
|
274
|
+
this.client.db.exec("ROLLBACK");
|
|
275
|
+
throw e;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Add a new action to an existing campaign's action chain.
|
|
280
|
+
*
|
|
281
|
+
* Creates the full action record set via direct DB operations:
|
|
282
|
+
* action_configs -> actions -> action_versions (x2) -> exclude list chain.
|
|
283
|
+
*
|
|
284
|
+
* @throws {CampaignNotFoundError} if no campaign exists with the given ID.
|
|
285
|
+
*/
|
|
286
|
+
addAction(campaignId, actionConfig, liAccountId) {
|
|
287
|
+
// Verify campaign exists
|
|
288
|
+
this.getCampaign(campaignId);
|
|
289
|
+
const stmts = this.getWriteStatements();
|
|
290
|
+
const { db } = this.client;
|
|
291
|
+
const getLastId = db.prepare("SELECT last_insert_rowid() AS id");
|
|
292
|
+
db.exec("BEGIN");
|
|
293
|
+
try {
|
|
294
|
+
// 1. Insert action_configs
|
|
295
|
+
const actionSettings = JSON.stringify(actionConfig.actionSettings ?? {});
|
|
296
|
+
const coolDown = actionConfig.coolDown ?? 60_000;
|
|
297
|
+
const maxResults = actionConfig.maxActionResultsPerIteration ?? 10;
|
|
298
|
+
stmts.insertActionConfig.run(actionConfig.actionType, actionSettings, coolDown, maxResults);
|
|
299
|
+
const configId = getLastId.get().id;
|
|
300
|
+
// 2. Insert actions
|
|
301
|
+
stmts.insertAction.run(campaignId, actionConfig.name, actionConfig.description ?? "");
|
|
302
|
+
const actionId = getLastId.get().id;
|
|
303
|
+
// 3. Insert two action_versions (matching createCampaign pattern)
|
|
304
|
+
stmts.insertActionVersion.run(actionId, configId);
|
|
305
|
+
const versionId1 = getLastId.get().id;
|
|
306
|
+
stmts.insertActionVersion.run(actionId, configId);
|
|
307
|
+
// 4. Create exclude list chain for the new action
|
|
308
|
+
stmts.insertCollection.run(liAccountId);
|
|
309
|
+
const collectionId = getLastId.get().id;
|
|
310
|
+
stmts.insertCollectionPeopleVersion.run(collectionId);
|
|
311
|
+
const cpvId = getLastId.get().id;
|
|
312
|
+
stmts.setActionVersionExcludeList.run(cpvId, actionId);
|
|
313
|
+
db.exec("COMMIT");
|
|
314
|
+
// Build and return the CampaignAction
|
|
315
|
+
const config = {
|
|
316
|
+
id: configId,
|
|
317
|
+
actionType: actionConfig.actionType,
|
|
318
|
+
actionSettings: actionConfig.actionSettings ?? {},
|
|
319
|
+
coolDown,
|
|
320
|
+
maxActionResultsPerIteration: maxResults,
|
|
321
|
+
isDraft: false,
|
|
322
|
+
};
|
|
323
|
+
return {
|
|
324
|
+
id: actionId,
|
|
325
|
+
campaignId,
|
|
326
|
+
name: actionConfig.name,
|
|
327
|
+
description: actionConfig.description ?? null,
|
|
328
|
+
config,
|
|
329
|
+
versionId: versionId1,
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
catch (e) {
|
|
333
|
+
db.exec("ROLLBACK");
|
|
334
|
+
throw e;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Move people from the current action to the next action in the chain.
|
|
339
|
+
*
|
|
340
|
+
* For each person:
|
|
341
|
+
* 1. Mark the person as successful (state=3) in the current action
|
|
342
|
+
* 2. Queue the person (state=1) in the next action's target list
|
|
343
|
+
*
|
|
344
|
+
* @throws {CampaignNotFoundError} if no campaign exists with the given ID.
|
|
345
|
+
* @throws {ActionNotFoundError} if the action does not belong to the campaign.
|
|
346
|
+
* @throws {NoNextActionError} if the action is the last in the chain.
|
|
347
|
+
*/
|
|
348
|
+
moveToNextAction(campaignId, actionId, personIds) {
|
|
349
|
+
if (personIds.length === 0)
|
|
350
|
+
return { nextActionId: 0 };
|
|
351
|
+
// Get all actions ordered by id
|
|
352
|
+
const actions = this.getCampaignActions(campaignId);
|
|
353
|
+
// Find the current action index
|
|
354
|
+
const currentIndex = actions.findIndex((a) => a.id === actionId);
|
|
355
|
+
if (currentIndex === -1) {
|
|
356
|
+
throw new ActionNotFoundError(actionId, campaignId);
|
|
357
|
+
}
|
|
358
|
+
// Find the next action
|
|
359
|
+
if (currentIndex >= actions.length - 1) {
|
|
360
|
+
throw new NoNextActionError(actionId, campaignId);
|
|
361
|
+
}
|
|
362
|
+
const nextAction = actions[currentIndex + 1];
|
|
363
|
+
const campaign = this.getCampaign(campaignId);
|
|
364
|
+
const stmts = this.getWriteStatements();
|
|
365
|
+
this.client.db.exec("BEGIN");
|
|
366
|
+
try {
|
|
367
|
+
for (const personId of personIds) {
|
|
368
|
+
// 1. Mark person as successful in the current action
|
|
369
|
+
stmts.markTargetSuccessful.run(actionId, personId);
|
|
370
|
+
// 2. Queue person in the next action's target list
|
|
371
|
+
const { cnt } = stmts.countTarget.get(nextAction.id, personId);
|
|
372
|
+
if (cnt > 0) {
|
|
373
|
+
stmts.queueTarget.run(nextAction.id, personId);
|
|
374
|
+
}
|
|
375
|
+
else {
|
|
376
|
+
stmts.insertTarget.run(nextAction.id, nextAction.versionId, personId, campaign.liAccountId);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
this.client.db.exec("COMMIT");
|
|
380
|
+
}
|
|
381
|
+
catch (e) {
|
|
382
|
+
this.client.db.exec("ROLLBACK");
|
|
383
|
+
throw e;
|
|
384
|
+
}
|
|
385
|
+
return { nextActionId: nextAction.id };
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
//# sourceMappingURL=campaign.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaign.js","sourceRoot":"","sources":["../../../src/db/repositories/campaign.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAiBpC,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AA0CtB,SAAS,mBAAmB,CAC1B,QAAuB,EACvB,UAAyB,EACzB,OAAsB;IAEtB,IAAI,UAAU,KAAK,CAAC;QAAE,OAAO,UAAU,CAAC;IACxC,IAAI,OAAO,KAAK,CAAC;QAA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