@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,442 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
import { describe, expect, it } from "vitest";
|
|
4
|
+
import { CampaignFormatError, parseCampaignJson, parseCampaignYaml, serializeCampaignJson, serializeCampaignYaml, } from "./campaign-format.js";
|
|
5
|
+
const MINIMAL_YAML = `
|
|
6
|
+
version: "1"
|
|
7
|
+
name: "Test Campaign"
|
|
8
|
+
actions:
|
|
9
|
+
- type: VisitAndExtract
|
|
10
|
+
`;
|
|
11
|
+
const FULL_YAML = `
|
|
12
|
+
version: "1"
|
|
13
|
+
name: "Outreach Campaign"
|
|
14
|
+
description: "A test campaign"
|
|
15
|
+
settings:
|
|
16
|
+
cooldownMs: 30000
|
|
17
|
+
maxActionsPerRun: 5
|
|
18
|
+
actions:
|
|
19
|
+
- type: VisitAndExtract
|
|
20
|
+
config:
|
|
21
|
+
extractCurrentOrganizations: true
|
|
22
|
+
- type: MessageToPerson
|
|
23
|
+
config:
|
|
24
|
+
messageTemplate: "Hi {firstName}"
|
|
25
|
+
`;
|
|
26
|
+
const MOCK_CAMPAIGN = {
|
|
27
|
+
id: 1,
|
|
28
|
+
name: "Test Campaign",
|
|
29
|
+
description: "Test description",
|
|
30
|
+
state: "paused",
|
|
31
|
+
liAccountId: 1,
|
|
32
|
+
isPaused: true,
|
|
33
|
+
isArchived: false,
|
|
34
|
+
isValid: true,
|
|
35
|
+
createdAt: "2025-01-15T00:00:00Z",
|
|
36
|
+
};
|
|
37
|
+
const MOCK_ACTIONS = [
|
|
38
|
+
{
|
|
39
|
+
id: 10,
|
|
40
|
+
campaignId: 1,
|
|
41
|
+
name: "Visit & Extract",
|
|
42
|
+
description: null,
|
|
43
|
+
config: {
|
|
44
|
+
id: 100,
|
|
45
|
+
actionType: "VisitAndExtract",
|
|
46
|
+
actionSettings: { extractCurrentOrganizations: true },
|
|
47
|
+
coolDown: 60000,
|
|
48
|
+
maxActionResultsPerIteration: 10,
|
|
49
|
+
isDraft: false,
|
|
50
|
+
},
|
|
51
|
+
versionId: 1000,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: 11,
|
|
55
|
+
campaignId: 1,
|
|
56
|
+
name: "Message",
|
|
57
|
+
description: null,
|
|
58
|
+
config: {
|
|
59
|
+
id: 101,
|
|
60
|
+
actionType: "MessageToPerson",
|
|
61
|
+
actionSettings: { messageTemplate: "Hi {firstName}" },
|
|
62
|
+
coolDown: 60000,
|
|
63
|
+
maxActionResultsPerIteration: 10,
|
|
64
|
+
isDraft: false,
|
|
65
|
+
},
|
|
66
|
+
versionId: 1001,
|
|
67
|
+
},
|
|
68
|
+
];
|
|
69
|
+
describe("parseCampaignYaml", () => {
|
|
70
|
+
it("parses minimal valid YAML", () => {
|
|
71
|
+
const config = parseCampaignYaml(MINIMAL_YAML);
|
|
72
|
+
expect(config.name).toBe("Test Campaign");
|
|
73
|
+
expect(config.description).toBeUndefined();
|
|
74
|
+
expect(config.actions).toHaveLength(1);
|
|
75
|
+
expect(config.actions[0]?.actionType).toBe("VisitAndExtract");
|
|
76
|
+
});
|
|
77
|
+
it("parses full YAML with settings and description", () => {
|
|
78
|
+
const config = parseCampaignYaml(FULL_YAML);
|
|
79
|
+
expect(config.name).toBe("Outreach Campaign");
|
|
80
|
+
expect(config.description).toBe("A test campaign");
|
|
81
|
+
expect(config.actions).toHaveLength(2);
|
|
82
|
+
expect(config.actions[0]?.actionType).toBe("VisitAndExtract");
|
|
83
|
+
expect(config.actions[0]?.actionSettings).toEqual({ extractCurrentOrganizations: true });
|
|
84
|
+
expect(config.actions[1]?.actionType).toBe("MessageToPerson");
|
|
85
|
+
expect(config.actions[1]?.actionSettings).toEqual({
|
|
86
|
+
messageTemplate: "Hi {firstName}",
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
it("applies campaign-level settings as action defaults", () => {
|
|
90
|
+
const config = parseCampaignYaml(FULL_YAML);
|
|
91
|
+
expect(config.actions[0]?.coolDown).toBe(30000);
|
|
92
|
+
expect(config.actions[0]?.maxActionResultsPerIteration).toBe(5);
|
|
93
|
+
expect(config.actions[1]?.coolDown).toBe(30000);
|
|
94
|
+
expect(config.actions[1]?.maxActionResultsPerIteration).toBe(5);
|
|
95
|
+
});
|
|
96
|
+
it("allows per-action overrides of settings", () => {
|
|
97
|
+
const yaml = `
|
|
98
|
+
version: "1"
|
|
99
|
+
name: "Test"
|
|
100
|
+
settings:
|
|
101
|
+
cooldownMs: 30000
|
|
102
|
+
maxActionsPerRun: 5
|
|
103
|
+
actions:
|
|
104
|
+
- type: VisitAndExtract
|
|
105
|
+
cooldownMs: 10000
|
|
106
|
+
maxActionsPerRun: 20
|
|
107
|
+
`;
|
|
108
|
+
const config = parseCampaignYaml(yaml);
|
|
109
|
+
expect(config.actions[0]?.coolDown).toBe(10000);
|
|
110
|
+
expect(config.actions[0]?.maxActionResultsPerIteration).toBe(20);
|
|
111
|
+
});
|
|
112
|
+
it("derives action name from type", () => {
|
|
113
|
+
const config = parseCampaignYaml(MINIMAL_YAML);
|
|
114
|
+
expect(config.actions[0]?.name).toBe("VisitAndExtract");
|
|
115
|
+
});
|
|
116
|
+
it("does not set coolDown/maxActionResultsPerIteration when no settings", () => {
|
|
117
|
+
const config = parseCampaignYaml(MINIMAL_YAML);
|
|
118
|
+
expect(config.actions[0]?.coolDown).toBeUndefined();
|
|
119
|
+
expect(config.actions[0]?.maxActionResultsPerIteration).toBeUndefined();
|
|
120
|
+
});
|
|
121
|
+
it("throws CampaignFormatError for missing version", () => {
|
|
122
|
+
const yaml = `
|
|
123
|
+
name: "Test"
|
|
124
|
+
actions:
|
|
125
|
+
- type: VisitAndExtract
|
|
126
|
+
`;
|
|
127
|
+
expect(() => parseCampaignYaml(yaml)).toThrow(CampaignFormatError);
|
|
128
|
+
expect(() => parseCampaignYaml(yaml)).toThrow("Missing required field: version");
|
|
129
|
+
});
|
|
130
|
+
it("throws CampaignFormatError for wrong version", () => {
|
|
131
|
+
const yaml = `
|
|
132
|
+
version: "2"
|
|
133
|
+
name: "Test"
|
|
134
|
+
actions:
|
|
135
|
+
- type: VisitAndExtract
|
|
136
|
+
`;
|
|
137
|
+
expect(() => parseCampaignYaml(yaml)).toThrow(CampaignFormatError);
|
|
138
|
+
expect(() => parseCampaignYaml(yaml)).toThrow("Unsupported version: 2");
|
|
139
|
+
});
|
|
140
|
+
it("throws CampaignFormatError for missing name", () => {
|
|
141
|
+
const yaml = `
|
|
142
|
+
version: "1"
|
|
143
|
+
actions:
|
|
144
|
+
- type: VisitAndExtract
|
|
145
|
+
`;
|
|
146
|
+
expect(() => parseCampaignYaml(yaml)).toThrow(CampaignFormatError);
|
|
147
|
+
expect(() => parseCampaignYaml(yaml)).toThrow("Missing or empty required field: name");
|
|
148
|
+
});
|
|
149
|
+
it("throws CampaignFormatError for empty name", () => {
|
|
150
|
+
const yaml = `
|
|
151
|
+
version: "1"
|
|
152
|
+
name: ""
|
|
153
|
+
actions:
|
|
154
|
+
- type: VisitAndExtract
|
|
155
|
+
`;
|
|
156
|
+
expect(() => parseCampaignYaml(yaml)).toThrow(CampaignFormatError);
|
|
157
|
+
expect(() => parseCampaignYaml(yaml)).toThrow("Missing or empty required field: name");
|
|
158
|
+
});
|
|
159
|
+
it("throws CampaignFormatError for missing actions", () => {
|
|
160
|
+
const yaml = `
|
|
161
|
+
version: "1"
|
|
162
|
+
name: "Test"
|
|
163
|
+
`;
|
|
164
|
+
expect(() => parseCampaignYaml(yaml)).toThrow(CampaignFormatError);
|
|
165
|
+
expect(() => parseCampaignYaml(yaml)).toThrow("Missing required field: actions");
|
|
166
|
+
});
|
|
167
|
+
it("throws CampaignFormatError for non-array actions", () => {
|
|
168
|
+
const yaml = `
|
|
169
|
+
version: "1"
|
|
170
|
+
name: "Test"
|
|
171
|
+
actions: "visit"
|
|
172
|
+
`;
|
|
173
|
+
expect(() => parseCampaignYaml(yaml)).toThrow(CampaignFormatError);
|
|
174
|
+
expect(() => parseCampaignYaml(yaml)).toThrow("Invalid field: actions must be an array");
|
|
175
|
+
});
|
|
176
|
+
it("throws CampaignFormatError for non-object settings", () => {
|
|
177
|
+
const yaml = `
|
|
178
|
+
version: "1"
|
|
179
|
+
name: "Test"
|
|
180
|
+
settings: "fast"
|
|
181
|
+
actions:
|
|
182
|
+
- type: VisitAndExtract
|
|
183
|
+
`;
|
|
184
|
+
expect(() => parseCampaignYaml(yaml)).toThrow(CampaignFormatError);
|
|
185
|
+
expect(() => parseCampaignYaml(yaml)).toThrow("Invalid field: settings must be an object");
|
|
186
|
+
});
|
|
187
|
+
it("throws CampaignFormatError for array settings", () => {
|
|
188
|
+
const json = JSON.stringify({
|
|
189
|
+
version: "1",
|
|
190
|
+
name: "Test",
|
|
191
|
+
settings: [1, 2, 3],
|
|
192
|
+
actions: [{ type: "VisitAndExtract" }],
|
|
193
|
+
});
|
|
194
|
+
expect(() => parseCampaignJson(json)).toThrow(CampaignFormatError);
|
|
195
|
+
expect(() => parseCampaignJson(json)).toThrow("Invalid field: settings must be an object");
|
|
196
|
+
});
|
|
197
|
+
it("ignores non-numeric cooldownMs in settings", () => {
|
|
198
|
+
const json = JSON.stringify({
|
|
199
|
+
version: "1",
|
|
200
|
+
name: "Test",
|
|
201
|
+
settings: { cooldownMs: null, maxActionsPerRun: 5 },
|
|
202
|
+
actions: [{ type: "VisitAndExtract" }],
|
|
203
|
+
});
|
|
204
|
+
const config = parseCampaignJson(json);
|
|
205
|
+
expect(config.actions[0]?.coolDown).toBeUndefined();
|
|
206
|
+
expect(config.actions[0]?.maxActionResultsPerIteration).toBe(5);
|
|
207
|
+
});
|
|
208
|
+
it("ignores NaN and Infinity in settings via YAML", () => {
|
|
209
|
+
const yaml = `
|
|
210
|
+
version: "1"
|
|
211
|
+
name: "Test"
|
|
212
|
+
settings:
|
|
213
|
+
cooldownMs: .nan
|
|
214
|
+
maxActionsPerRun: .inf
|
|
215
|
+
actions:
|
|
216
|
+
- type: VisitAndExtract
|
|
217
|
+
`;
|
|
218
|
+
const config = parseCampaignYaml(yaml);
|
|
219
|
+
expect(config.actions[0]?.coolDown).toBeUndefined();
|
|
220
|
+
expect(config.actions[0]?.maxActionResultsPerIteration).toBeUndefined();
|
|
221
|
+
});
|
|
222
|
+
it("ignores array config in actions", () => {
|
|
223
|
+
const json = JSON.stringify({
|
|
224
|
+
version: "1",
|
|
225
|
+
name: "Test",
|
|
226
|
+
actions: [{ type: "VisitAndExtract", config: [1, 2, 3] }],
|
|
227
|
+
});
|
|
228
|
+
const config = parseCampaignJson(json);
|
|
229
|
+
expect(config.actions[0]?.actionSettings).toBeUndefined();
|
|
230
|
+
});
|
|
231
|
+
it("throws CampaignFormatError for empty actions array", () => {
|
|
232
|
+
const yaml = `
|
|
233
|
+
version: "1"
|
|
234
|
+
name: "Test"
|
|
235
|
+
actions: []
|
|
236
|
+
`;
|
|
237
|
+
expect(() => parseCampaignYaml(yaml)).toThrow(CampaignFormatError);
|
|
238
|
+
expect(() => parseCampaignYaml(yaml)).toThrow("Actions array must not be empty");
|
|
239
|
+
});
|
|
240
|
+
it("throws CampaignFormatError for action without type", () => {
|
|
241
|
+
const yaml = `
|
|
242
|
+
version: "1"
|
|
243
|
+
name: "Test"
|
|
244
|
+
actions:
|
|
245
|
+
- config:
|
|
246
|
+
extractCurrentOrganizations: true
|
|
247
|
+
`;
|
|
248
|
+
expect(() => parseCampaignYaml(yaml)).toThrow(CampaignFormatError);
|
|
249
|
+
expect(() => parseCampaignYaml(yaml)).toThrow("Action at index 0 is missing required field: type");
|
|
250
|
+
});
|
|
251
|
+
it("throws CampaignFormatError for invalid YAML syntax", () => {
|
|
252
|
+
expect(() => parseCampaignYaml("{{invalid")).toThrow(CampaignFormatError);
|
|
253
|
+
expect(() => parseCampaignYaml("{{invalid")).toThrow("Invalid YAML");
|
|
254
|
+
});
|
|
255
|
+
it("throws CampaignFormatError for non-object document", () => {
|
|
256
|
+
expect(() => parseCampaignYaml("just a string")).toThrow(CampaignFormatError);
|
|
257
|
+
expect(() => parseCampaignYaml("just a string")).toThrow("Campaign document must be an object");
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
describe("parseCampaignJson", () => {
|
|
261
|
+
it("parses valid JSON", () => {
|
|
262
|
+
const json = JSON.stringify({
|
|
263
|
+
version: "1",
|
|
264
|
+
name: "Test Campaign",
|
|
265
|
+
actions: [{ type: "VisitAndExtract" }],
|
|
266
|
+
});
|
|
267
|
+
const config = parseCampaignJson(json);
|
|
268
|
+
expect(config.name).toBe("Test Campaign");
|
|
269
|
+
expect(config.actions).toHaveLength(1);
|
|
270
|
+
expect(config.actions[0]?.actionType).toBe("VisitAndExtract");
|
|
271
|
+
});
|
|
272
|
+
it("throws CampaignFormatError for invalid JSON syntax", () => {
|
|
273
|
+
expect(() => parseCampaignJson("{invalid}")).toThrow(CampaignFormatError);
|
|
274
|
+
expect(() => parseCampaignJson("{invalid}")).toThrow("Invalid JSON");
|
|
275
|
+
});
|
|
276
|
+
it("throws CampaignFormatError for invalid document structure", () => {
|
|
277
|
+
expect(() => parseCampaignJson('"just a string"')).toThrow(CampaignFormatError);
|
|
278
|
+
});
|
|
279
|
+
});
|
|
280
|
+
describe("serializeCampaignYaml", () => {
|
|
281
|
+
it("serializes campaign with uniform settings to campaign-level", () => {
|
|
282
|
+
const yaml = serializeCampaignYaml(MOCK_CAMPAIGN, MOCK_ACTIONS);
|
|
283
|
+
expect(yaml).toContain("version:");
|
|
284
|
+
expect(yaml).toContain('name: Test Campaign');
|
|
285
|
+
expect(yaml).toContain("description: Test description");
|
|
286
|
+
expect(yaml).toContain("cooldownMs: 60000");
|
|
287
|
+
expect(yaml).toContain("maxActionsPerRun: 10");
|
|
288
|
+
expect(yaml).toContain("type: VisitAndExtract");
|
|
289
|
+
expect(yaml).toContain("type: MessageToPerson");
|
|
290
|
+
});
|
|
291
|
+
it("serializes campaign with varied settings as per-action overrides", () => {
|
|
292
|
+
const action0 = MOCK_ACTIONS[0];
|
|
293
|
+
const action1 = MOCK_ACTIONS[1];
|
|
294
|
+
const variedActions = [
|
|
295
|
+
{
|
|
296
|
+
...action0,
|
|
297
|
+
config: { ...action0.config, coolDown: 30000 },
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
...action1,
|
|
301
|
+
config: { ...action1.config, coolDown: 60000 },
|
|
302
|
+
},
|
|
303
|
+
];
|
|
304
|
+
const yaml = serializeCampaignYaml(MOCK_CAMPAIGN, variedActions);
|
|
305
|
+
// cooldownMs should NOT be at campaign-level settings since they differ
|
|
306
|
+
// but maxActionsPerRun is still uniform so should be in settings
|
|
307
|
+
expect(yaml).toContain("maxActionsPerRun: 10");
|
|
308
|
+
// per-action cooldownMs should be present
|
|
309
|
+
expect(yaml).toContain("cooldownMs: 30000");
|
|
310
|
+
expect(yaml).toContain("cooldownMs: 60000");
|
|
311
|
+
});
|
|
312
|
+
it("includes description when non-null", () => {
|
|
313
|
+
const yaml = serializeCampaignYaml(MOCK_CAMPAIGN, MOCK_ACTIONS);
|
|
314
|
+
expect(yaml).toContain("description: Test description");
|
|
315
|
+
});
|
|
316
|
+
it("omits description when null", () => {
|
|
317
|
+
const campaign = { ...MOCK_CAMPAIGN, description: null };
|
|
318
|
+
const yaml = serializeCampaignYaml(campaign, MOCK_ACTIONS);
|
|
319
|
+
expect(yaml).not.toContain("description:");
|
|
320
|
+
});
|
|
321
|
+
it("omits empty actionSettings from config", () => {
|
|
322
|
+
const action0 = MOCK_ACTIONS[0];
|
|
323
|
+
const actions = [
|
|
324
|
+
{
|
|
325
|
+
...action0,
|
|
326
|
+
config: { ...action0.config, actionSettings: {} },
|
|
327
|
+
},
|
|
328
|
+
];
|
|
329
|
+
const yaml = serializeCampaignYaml(MOCK_CAMPAIGN, actions);
|
|
330
|
+
expect(yaml).not.toContain("config:");
|
|
331
|
+
});
|
|
332
|
+
it("includes non-empty actionSettings as config", () => {
|
|
333
|
+
const yaml = serializeCampaignYaml(MOCK_CAMPAIGN, MOCK_ACTIONS);
|
|
334
|
+
expect(yaml).toContain("extractCurrentOrganizations: true");
|
|
335
|
+
expect(yaml).toContain("messageTemplate:");
|
|
336
|
+
});
|
|
337
|
+
});
|
|
338
|
+
describe("serializeCampaignJson", () => {
|
|
339
|
+
it("serializes to pretty-printed JSON", () => {
|
|
340
|
+
const json = serializeCampaignJson(MOCK_CAMPAIGN, MOCK_ACTIONS);
|
|
341
|
+
expect(() => JSON.parse(json)).not.toThrow();
|
|
342
|
+
const doc = JSON.parse(json);
|
|
343
|
+
expect(doc["version"]).toBe("1");
|
|
344
|
+
expect(doc["name"]).toBe("Test Campaign");
|
|
345
|
+
});
|
|
346
|
+
it("produces valid JSON that round-trips through parseCampaignJson", () => {
|
|
347
|
+
const json = serializeCampaignJson(MOCK_CAMPAIGN, MOCK_ACTIONS);
|
|
348
|
+
const config = parseCampaignJson(json);
|
|
349
|
+
expect(config.name).toBe("Test Campaign");
|
|
350
|
+
expect(config.description).toBe("Test description");
|
|
351
|
+
expect(config.actions).toHaveLength(2);
|
|
352
|
+
expect(config.actions[0]?.actionType).toBe("VisitAndExtract");
|
|
353
|
+
expect(config.actions[1]?.actionType).toBe("MessageToPerson");
|
|
354
|
+
});
|
|
355
|
+
});
|
|
356
|
+
describe("round-trip", () => {
|
|
357
|
+
it("YAML: serialize → parse preserves campaign data", () => {
|
|
358
|
+
const yaml = serializeCampaignYaml(MOCK_CAMPAIGN, MOCK_ACTIONS);
|
|
359
|
+
const config = parseCampaignYaml(yaml);
|
|
360
|
+
expect(config.name).toBe("Test Campaign");
|
|
361
|
+
expect(config.description).toBe("Test description");
|
|
362
|
+
expect(config.actions).toHaveLength(2);
|
|
363
|
+
expect(config.actions[0]?.actionType).toBe("VisitAndExtract");
|
|
364
|
+
expect(config.actions[0]?.actionSettings).toEqual({ extractCurrentOrganizations: true });
|
|
365
|
+
expect(config.actions[0]?.coolDown).toBe(60000);
|
|
366
|
+
expect(config.actions[0]?.maxActionResultsPerIteration).toBe(10);
|
|
367
|
+
expect(config.actions[1]?.actionType).toBe("MessageToPerson");
|
|
368
|
+
expect(config.actions[1]?.actionSettings).toEqual({
|
|
369
|
+
messageTemplate: "Hi {firstName}",
|
|
370
|
+
});
|
|
371
|
+
});
|
|
372
|
+
it("JSON: serialize → parse preserves campaign data", () => {
|
|
373
|
+
const json = serializeCampaignJson(MOCK_CAMPAIGN, MOCK_ACTIONS);
|
|
374
|
+
const config = parseCampaignJson(json);
|
|
375
|
+
expect(config.name).toBe("Test Campaign");
|
|
376
|
+
expect(config.description).toBe("Test description");
|
|
377
|
+
expect(config.actions).toHaveLength(2);
|
|
378
|
+
expect(config.actions[0]?.actionType).toBe("VisitAndExtract");
|
|
379
|
+
expect(config.actions[0]?.actionSettings).toEqual({ extractCurrentOrganizations: true });
|
|
380
|
+
expect(config.actions[1]?.actionType).toBe("MessageToPerson");
|
|
381
|
+
});
|
|
382
|
+
it("YAML: serialize → parse preserves varied per-action settings", () => {
|
|
383
|
+
const action0 = MOCK_ACTIONS[0];
|
|
384
|
+
const action1 = MOCK_ACTIONS[1];
|
|
385
|
+
const variedActions = [
|
|
386
|
+
{
|
|
387
|
+
...action0,
|
|
388
|
+
config: { ...action0.config, coolDown: 30000, maxActionResultsPerIteration: 5 },
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
...action1,
|
|
392
|
+
config: { ...action1.config, coolDown: 60000, maxActionResultsPerIteration: 20 },
|
|
393
|
+
},
|
|
394
|
+
];
|
|
395
|
+
const yaml = serializeCampaignYaml(MOCK_CAMPAIGN, variedActions);
|
|
396
|
+
const config = parseCampaignYaml(yaml);
|
|
397
|
+
expect(config.actions[0]?.coolDown).toBe(30000);
|
|
398
|
+
expect(config.actions[0]?.maxActionResultsPerIteration).toBe(5);
|
|
399
|
+
expect(config.actions[1]?.coolDown).toBe(60000);
|
|
400
|
+
expect(config.actions[1]?.maxActionResultsPerIteration).toBe(20);
|
|
401
|
+
});
|
|
402
|
+
it("parse → serialize → parse produces identical config", () => {
|
|
403
|
+
const config1 = parseCampaignYaml(FULL_YAML);
|
|
404
|
+
// Create a mock campaign and actions from parsed config to simulate DB state
|
|
405
|
+
const campaign = {
|
|
406
|
+
id: 1,
|
|
407
|
+
name: config1.name,
|
|
408
|
+
description: config1.description ?? null,
|
|
409
|
+
state: "active",
|
|
410
|
+
liAccountId: 1,
|
|
411
|
+
isPaused: false,
|
|
412
|
+
isArchived: false,
|
|
413
|
+
isValid: true,
|
|
414
|
+
createdAt: "2025-01-15T00:00:00Z",
|
|
415
|
+
};
|
|
416
|
+
const actions = config1.actions.map((a, i) => ({
|
|
417
|
+
id: i + 1,
|
|
418
|
+
campaignId: 1,
|
|
419
|
+
name: a.name,
|
|
420
|
+
description: null,
|
|
421
|
+
config: {
|
|
422
|
+
id: i + 100,
|
|
423
|
+
actionType: a.actionType,
|
|
424
|
+
actionSettings: a.actionSettings ?? {},
|
|
425
|
+
coolDown: a.coolDown ?? 60000,
|
|
426
|
+
maxActionResultsPerIteration: a.maxActionResultsPerIteration ?? 10,
|
|
427
|
+
isDraft: false,
|
|
428
|
+
},
|
|
429
|
+
versionId: i + 1000,
|
|
430
|
+
}));
|
|
431
|
+
const yaml = serializeCampaignYaml(campaign, actions);
|
|
432
|
+
const config2 = parseCampaignYaml(yaml);
|
|
433
|
+
expect(config2.name).toBe(config1.name);
|
|
434
|
+
expect(config2.description).toBe(config1.description);
|
|
435
|
+
expect(config2.actions).toHaveLength(config1.actions.length);
|
|
436
|
+
for (let i = 0; i < config1.actions.length; i++) {
|
|
437
|
+
expect(config2.actions[i]?.actionType).toBe(config1.actions[i]?.actionType);
|
|
438
|
+
expect(config2.actions[i]?.actionSettings).toEqual(config1.actions[i]?.actionSettings);
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
});
|
|
442
|
+
//# sourceMappingURL=campaign-format.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaign-format.test.js","sourceRoot":"","sources":["../../src/formats/campaign-format.test.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAG9C,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,YAAY,GAAG;;;;;CAKpB,CAAC;AAEF,MAAM,SAAS,GAAG;;;;;;;;;;;;;;CAcjB,CAAC;AAEF,MAAM,aAAa,GAAa;IAC9B,EAAE,EAAE,CAAC;IACL,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,kBAAkB;IAC/B,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,CAAC;IACd,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE,KAAK;IACjB,OAAO,EAAE,IAAI;IACb,SAAS,EAAE,sBAAsB;CAClC,CAAC;AAEF,MAAM,YAAY,GAAqB;IACrC;QACE,EAAE,EAAE,EAAE;QACN,UAAU,EAAE,CAAC;QACb,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,IAAI;QACjB,MAAM,EAAE;YACN,EAAE,EAAE,GAAG;YACP,UAAU,EAAE,iBAAiB;YAC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MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,OAAO,CAChD,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,cAAc,CACnC,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/formats/errors.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;gBACxB,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAIpD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
/**
|
|
4
|
+
* Base class for all format/validation errors.
|
|
5
|
+
*/
|
|
6
|
+
export class FormatError extends Error {
|
|
7
|
+
constructor(message, options) {
|
|
8
|
+
super(message, options);
|
|
9
|
+
this.name = "FormatError";
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/formats/errors.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IACpC,YAAY,OAAe,EAAE,OAAsB;QACjD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;IAC5B,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/formats/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
export { FormatError } from "./errors.js";
|
|
4
|
+
export { CampaignFormatError, parseCampaignJson, parseCampaignYaml, serializeCampaignJson, serializeCampaignYaml, } from "./campaign-format.js";
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/formats/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export type { Account, ActionConfig, ActionErrorSummary, ActionPeopleCounts, ActionStatistics, CampaignActionConfig, CampaignActionResult, ActionSettings, ActionTargetPerson, Campaign, CampaignAction, CampaignConfig, CampaignRunResult, CampaignState, CampaignStatistics, CampaignStatus, CampaignSummary, CampaignUpdateConfig, ExcludeListEntry, Chat, ChatParticipant, ConversationMessages, ConversationThread, CurrentPosition, Education, ExternalId, ExternalIdTypeGroup, GetResultsOptions, GetStatisticsOptions, ImportPeopleResult, InstanceInfo, InstanceStatus, ListCampaignsOptions, Message, MessageStats, MessageSummary, MiniProfile, Position, Profile, ProfileSearchOptions, ProfileSearchResult, ProfileSummary, RunnerState, Skill, StartInstanceParams, StartInstanceResult, } from "./types/index.js";
|
|
2
|
+
export { AccountResolutionError, ActionExecutionError, type ActionResult, AppLaunchError, AppNotFoundError, AppService, type AppServiceOptions, CampaignExecutionError, CampaignService, CampaignTimeoutError, type DatabaseContext, ExtractionTimeoutError, type InstanceDatabaseContext, InstanceNotRunningError, InstanceService, InvalidProfileUrlError, LauncherService, LinkedHelperNotRunningError, resolveAccount, ServiceError, StartInstanceError, startInstanceWithRecovery, type StartInstanceOutcome, checkStatus, type AccountInstanceStatus, type DatabaseStatus, type LauncherStatus, type StatusReport, waitForInstancePort, waitForInstanceShutdown, withDatabase, withInstanceDatabase, WrongPortError, } from "./services/index.js";
|
|
3
|
+
export { CampaignExcludeListRepository, CampaignRepository, CampaignStatisticsRepository, DatabaseClient, type DatabaseClientOptions, discoverAllDatabases, discoverDatabase, MessageRepository, ProfileRepository, } from "./db/index.js";
|
|
4
|
+
export { CampaignFormatError, FormatError, parseCampaignJson, parseCampaignYaml, serializeCampaignJson, serializeCampaignYaml, } from "./formats/index.js";
|
|
5
|
+
export { type ActionCategory, type ActionType, type ActionTypeCatalog, type ActionTypeInfo, type ConfigFieldSchema, getActionTypeCatalog, getActionTypeInfo, } from "./data/index.js";
|
|
6
|
+
export { ActionNotFoundError, CampaignNotFoundError, ChatNotFoundError, DatabaseError, DatabaseNotFoundError, ExcludeListNotFoundError, NoNextActionError, ProfileNotFoundError, } from "./db/index.js";
|
|
7
|
+
export { CDPConnectionError, CDPError, CDPEvaluationError, CDPTimeoutError, discoverInstancePort, discoverTargets, findApp, type DiscoveredApp, killInstanceProcesses, } from "./cdp/index.js";
|
|
8
|
+
export { type ConnectionOptions, campaignGet, type CampaignGetInput, type CampaignGetOutput, campaignList, type CampaignListInput, type CampaignListOutput, campaignCreate, type CampaignCreateInput, type CampaignCreateOutput, campaignUpdate, type CampaignUpdateInput, type CampaignUpdateOutput, campaignDelete, type CampaignDeleteInput, type CampaignDeleteOutput, campaignStart, type CampaignStartInput, type CampaignStartOutput, campaignStop, type CampaignStopInput, type CampaignStopOutput, campaignRetry, type CampaignRetryInput, type CampaignRetryOutput, campaignMoveNext, type CampaignMoveNextInput, type CampaignMoveNextOutput, campaignStatistics, type CampaignStatisticsInput, type CampaignStatisticsOutput, campaignStatus, type CampaignStatusInput, type CampaignStatusOutput, campaignAddAction, type CampaignAddActionInput, type CampaignAddActionOutput, campaignRemoveAction, type CampaignRemoveActionInput, type CampaignRemoveActionOutput, campaignReorderActions, type CampaignReorderActionsInput, type CampaignReorderActionsOutput, campaignExport, type CampaignExportInput, type CampaignExportOutput, campaignExcludeAdd, type CampaignExcludeAddInput, type CampaignExcludeAddOutput, campaignExcludeRemove, type CampaignExcludeRemoveInput, type CampaignExcludeRemoveOutput, campaignExcludeList, type CampaignExcludeListInput, type CampaignExcludeListOutput, queryMessages, type QueryMessagesInput, type QueryMessagesOutput, checkReplies, type CheckRepliesInput, type CheckRepliesOutput, scrapeMessagingHistory, type ScrapeMessagingHistoryInput, type ScrapeMessagingHistoryOutput, importPeopleFromUrls, type ImportPeopleFromUrlsInput, type ImportPeopleFromUrlsOutput, } from "./operations/index.js";
|
|
9
|
+
export { DEFAULT_CDP_PORT } from "./constants.js";
|
|
10
|
+
export { delay, errorMessage, isCdpPort, isLoopbackAddress } from "./utils/index.js";
|
|
2
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,YAAY,EACV,OAAO,EACP,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,IAAI,EACJ,eAAe,EACf,oBAAoB,EACpB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kB,EAClB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,qBAAqB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,mBAAmB,EACnB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAE9B,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,sBAAsB,EACtB,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,oBAAoB,EACpB,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,GAChC,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGlD,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
// Services
|
|
4
|
+
export { AccountResolutionError, ActionExecutionError, AppLaunchError, AppNotFoundError, AppService, CampaignExecutionError, CampaignService, CampaignTimeoutError, ExtractionTimeoutError, InstanceNotRunningError, InstanceService, InvalidProfileUrlError, LauncherService, LinkedHelperNotRunningError, resolveAccount, ServiceError, StartInstanceError, startInstanceWithRecovery, checkStatus, waitForInstancePort, waitForInstanceShutdown, withDatabase, withInstanceDatabase, WrongPortError, } from "./services/index.js";
|
|
5
|
+
// Data access
|
|
6
|
+
export { CampaignExcludeListRepository, CampaignRepository, CampaignStatisticsRepository, DatabaseClient, discoverAllDatabases, discoverDatabase, MessageRepository, ProfileRepository, } from "./db/index.js";
|
|
7
|
+
// Formats
|
|
8
|
+
export { CampaignFormatError, FormatError, parseCampaignJson, parseCampaignYaml, serializeCampaignJson, serializeCampaignYaml, } from "./formats/index.js";
|
|
9
|
+
// Data (action types catalog)
|
|
10
|
+
export { getActionTypeCatalog, getActionTypeInfo, } from "./data/index.js";
|
|
11
|
+
// Errors (DB + CDP errors can propagate through the service layer)
|
|
12
|
+
export { ActionNotFoundError, CampaignNotFoundError, ChatNotFoundError, DatabaseError, DatabaseNotFoundError, ExcludeListNotFoundError, NoNextActionError, ProfileNotFoundError, } from "./db/index.js";
|
|
13
|
+
export { CDPConnectionError, CDPError, CDPEvaluationError, CDPTimeoutError, discoverInstancePort, discoverTargets, findApp, killInstanceProcesses, } from "./cdp/index.js";
|
|
14
|
+
// Operations (shared business logic for CLI + MCP)
|
|
15
|
+
export {
|
|
16
|
+
// Campaign CRUD
|
|
17
|
+
campaignGet, campaignList, campaignCreate, campaignUpdate, campaignDelete,
|
|
18
|
+
// Campaign execution
|
|
19
|
+
campaignStart, campaignStop, campaignRetry, campaignMoveNext, campaignStatistics, campaignStatus,
|
|
20
|
+
// Campaign configuration
|
|
21
|
+
campaignAddAction, campaignRemoveAction, campaignReorderActions, campaignExport,
|
|
22
|
+
// Exclude list
|
|
23
|
+
campaignExcludeAdd, campaignExcludeRemove, campaignExcludeList,
|
|
24
|
+
// Messaging
|
|
25
|
+
queryMessages, checkReplies, scrapeMessagingHistory, importPeopleFromUrls, } from "./operations/index.js";
|
|
26
|
+
// Constants
|
|
27
|
+
export { DEFAULT_CDP_PORT } from "./constants.js";
|
|
28
|
+
// Utilities
|
|
29
|
+
export { delay, errorMessage, isCdpPort, isLoopbackAddress } from "./utils/index.js";
|
|
2
30
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAoDpC,WAAW;AACX,OA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Gd,yBAAyB;AACzB,iBAAiB,EAGjB,oBAAoB,EAGpB,sBAAsB,EAGtB,cAAc;AAGd,eAAe;AACf,kBAAkB,EAGlB,qBAAqB,EAGrB,mBAAmB;AAGnB,YAAY;AACZ,aAAa,EAGb,YAAY,EAGZ,sBAAsB,EAGtB,oBAAoB,GAGrB,MAAM,uBAAuB,CAAC;AAE/B,YAAY;AACZ,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,YAAY;AACZ,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CampaignAction } from "../types/index.js";
|
|
2
|
+
import type { ConnectionOptions } from "./types.js";
|
|
3
|
+
export interface CampaignAddActionInput extends ConnectionOptions {
|
|
4
|
+
readonly campaignId: number;
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly actionType: string;
|
|
7
|
+
readonly description?: string | undefined;
|
|
8
|
+
readonly coolDown?: number | undefined;
|
|
9
|
+
readonly maxActionResultsPerIteration?: number | undefined;
|
|
10
|
+
readonly actionSettings?: Record<string, unknown> | undefined;
|
|
11
|
+
}
|
|
12
|
+
export type CampaignAddActionOutput = CampaignAction;
|
|
13
|
+
export declare function campaignAddAction(input: CampaignAddActionInput): Promise<CampaignAddActionOutput>;
|
|
14
|
+
//# sourceMappingURL=campaign-add-action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaign-add-action.d.ts","sourceRoot":"","sources":["../../src/operations/campaign-add-action.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAwB,MAAM,mBAAmB,CAAC;AAK9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,MAAM,WAAW,sBAAuB,SAAQ,iBAAiB;IAC/D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,QAAQ,CAAC,4BAA4B,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3D,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;CAC/D;AAED,MAAM,MAAM,uBAAuB,GAAG,cAAc,CAAC;AAErD,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,sBAAsB,GAC5B,OAAO,CAAC,uBAAuB,CAAC,CA6BlC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
import { resolveAccount } from "../services/account-resolution.js";
|
|
4
|
+
import { withDatabase } from "../services/instance-context.js";
|
|
5
|
+
import { CampaignRepository } from "../db/index.js";
|
|
6
|
+
import { DEFAULT_CDP_PORT } from "../constants.js";
|
|
7
|
+
export async function campaignAddAction(input) {
|
|
8
|
+
const cdpPort = input.cdpPort ?? DEFAULT_CDP_PORT;
|
|
9
|
+
const accountId = await resolveAccount(cdpPort, {
|
|
10
|
+
...(input.cdpHost !== undefined && { host: input.cdpHost }),
|
|
11
|
+
...(input.allowRemote !== undefined && { allowRemote: input.allowRemote }),
|
|
12
|
+
});
|
|
13
|
+
return withDatabase(accountId, ({ db }) => {
|
|
14
|
+
const campaignRepo = new CampaignRepository(db);
|
|
15
|
+
const campaign = campaignRepo.getCampaign(input.campaignId);
|
|
16
|
+
const actionConfig = {
|
|
17
|
+
name: input.name,
|
|
18
|
+
actionType: input.actionType,
|
|
19
|
+
actionSettings: input.actionSettings ?? {},
|
|
20
|
+
};
|
|
21
|
+
if (input.description !== undefined) {
|
|
22
|
+
actionConfig.description = input.description;
|
|
23
|
+
}
|
|
24
|
+
if (input.coolDown !== undefined) {
|
|
25
|
+
actionConfig.coolDown = input.coolDown;
|
|
26
|
+
}
|
|
27
|
+
if (input.maxActionResultsPerIteration !== undefined) {
|
|
28
|
+
actionConfig.maxActionResultsPerIteration = input.maxActionResultsPerIteration;
|
|
29
|
+
}
|
|
30
|
+
return campaignRepo.addAction(input.campaignId, actionConfig, campaign.liAccountId);
|
|
31
|
+
}, { readOnly: false });
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=campaign-add-action.js.map
|