@lhremote/core 0.1.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/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 +14 -0
- package/dist/cdp/client.d.ts.map +1 -1
- package/dist/cdp/client.integration.test.js +10 -3
- package/dist/cdp/client.integration.test.js.map +1 -1
- package/dist/cdp/client.js +41 -8
- package/dist/cdp/client.js.map +1 -1
- package/dist/cdp/client.test.js +267 -3
- package/dist/cdp/client.test.js.map +1 -1
- package/dist/cdp/discovery.d.ts.map +1 -1
- package/dist/cdp/discovery.integration.test.js +2 -0
- package/dist/cdp/discovery.integration.test.js.map +1 -1
- package/dist/cdp/discovery.js +2 -0
- package/dist/cdp/discovery.js.map +1 -1
- package/dist/cdp/discovery.test.js +2 -0
- package/dist/cdp/discovery.test.js.map +1 -1
- package/dist/cdp/errors.d.ts.map +1 -1
- package/dist/cdp/errors.js +2 -0
- package/dist/cdp/errors.js.map +1 -1
- package/dist/cdp/errors.test.js +2 -0
- package/dist/cdp/errors.test.js.map +1 -1
- package/dist/cdp/index.d.ts +1 -0
- package/dist/cdp/index.d.ts.map +1 -1
- package/dist/cdp/index.js +3 -0
- package/dist/cdp/index.js.map +1 -1
- package/dist/cdp/instance-discovery.d.ts.map +1 -1
- package/dist/cdp/instance-discovery.integration.test.js +2 -0
- package/dist/cdp/instance-discovery.integration.test.js.map +1 -1
- package/dist/cdp/instance-discovery.js +5 -17
- package/dist/cdp/instance-discovery.js.map +1 -1
- package/dist/cdp/instance-discovery.test.js +2 -0
- package/dist/cdp/instance-discovery.test.js.map +1 -1
- package/dist/cdp/testing/launch-chromium.d.ts.map +1 -1
- package/dist/cdp/testing/launch-chromium.js +4 -1
- package/dist/cdp/testing/launch-chromium.js.map +1 -1
- 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 +19 -5
- package/dist/db/client.d.ts.map +1 -1
- package/dist/db/client.integration.test.js +5 -1
- package/dist/db/client.integration.test.js.map +1 -1
- package/dist/db/client.js +11 -5
- package/dist/db/client.js.map +1 -1
- package/dist/db/client.test.js +2 -0
- package/dist/db/client.test.js.map +1 -1
- package/dist/db/discovery.d.ts.map +1 -1
- package/dist/db/discovery.integration.test.js +2 -0
- package/dist/db/discovery.integration.test.js.map +1 -1
- package/dist/db/discovery.js +2 -0
- package/dist/db/discovery.js.map +1 -1
- package/dist/db/discovery.test.js +2 -0
- package/dist/db/discovery.test.js.map +1 -1
- package/dist/db/errors.d.ts +31 -0
- package/dist/db/errors.d.ts.map +1 -1
- package/dist/db/errors.js +49 -0
- package/dist/db/errors.js.map +1 -1
- package/dist/db/errors.test.js +2 -0
- package/dist/db/errors.test.js.map +1 -1
- 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 +3 -3
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js +4 -2
- package/dist/db/index.js.map +1 -1
- 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 +4 -0
- package/dist/db/repositories/index.d.ts.map +1 -1
- package/dist/db/repositories/index.js +6 -0
- package/dist/db/repositories/index.js.map +1 -1
- 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 +11 -1
- package/dist/db/repositories/profile.d.ts.map +1 -1
- package/dist/db/repositories/profile.integration.test.js +103 -0
- package/dist/db/repositories/profile.integration.test.js.map +1 -1
- package/dist/db/repositories/profile.js +52 -15
- package/dist/db/repositories/profile.js.map +1 -1
- package/dist/db/repositories/profile.test.js +90 -0
- package/dist/db/repositories/profile.test.js.map +1 -1
- package/dist/db/testing/create-fixture.d.ts +0 -6
- package/dist/db/testing/create-fixture.d.ts.map +1 -1
- package/dist/db/testing/create-fixture.js +463 -4
- package/dist/db/testing/create-fixture.js.map +1 -1
- package/dist/db/testing/open-fixture.d.ts +5 -4
- package/dist/db/testing/open-fixture.d.ts.map +1 -1
- package/dist/db/testing/open-fixture.js +24 -6
- package/dist/db/testing/open-fixture.js.map +1 -1
- 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 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -4
- 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.map +1 -1
- package/dist/services/app.js +2 -0
- package/dist/services/app.js.map +1 -1
- package/dist/services/app.test.js +2 -0
- package/dist/services/app.test.js.map +1 -1
- 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 +38 -0
- package/dist/services/errors.d.ts.map +1 -1
- package/dist/services/errors.js +60 -0
- package/dist/services/errors.js.map +1 -1
- package/dist/services/errors.test.js +53 -1
- package/dist/services/errors.test.js.map +1 -1
- package/dist/services/index.d.ts +5 -3
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +6 -2
- package/dist/services/index.js.map +1 -1
- 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.map +1 -1
- package/dist/services/instance-lifecycle.js +6 -6
- package/dist/services/instance-lifecycle.js.map +1 -1
- package/dist/services/instance-lifecycle.test.js +8 -2
- package/dist/services/instance-lifecycle.test.js.map +1 -1
- package/dist/services/instance.d.ts +40 -0
- package/dist/services/instance.d.ts.map +1 -1
- package/dist/services/instance.js +66 -9
- package/dist/services/instance.js.map +1 -1
- package/dist/services/instance.test.js +116 -6
- package/dist/services/instance.test.js.map +1 -1
- package/dist/services/launcher.d.ts +3 -0
- package/dist/services/launcher.d.ts.map +1 -1
- package/dist/services/launcher.js +25 -10
- package/dist/services/launcher.js.map +1 -1
- package/dist/services/launcher.test.js +39 -2
- package/dist/services/launcher.test.js.map +1 -1
- package/dist/services/status.d.ts +5 -1
- package/dist/services/status.d.ts.map +1 -1
- package/dist/services/status.js +24 -15
- package/dist/services/status.js.map +1 -1
- package/dist/services/status.test.js +42 -1
- package/dist/services/status.test.js.map +1 -1
- package/dist/testing/e2e-helpers.d.ts.map +1 -1
- package/dist/testing/e2e-helpers.js +7 -4
- package/dist/testing/e2e-helpers.js.map +1 -1
- 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.map +1 -1
- package/dist/types/account.js +2 -0
- package/dist/types/account.js.map +1 -1
- package/dist/types/account.test.js +2 -0
- package/dist/types/account.test.js.map +1 -1
- 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.map +1 -1
- package/dist/types/cdp.js +2 -0
- package/dist/types/cdp.js.map +1 -1
- package/dist/types/cdp.test.js +2 -0
- package/dist/types/cdp.test.js.map +1 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/instance.d.ts.map +1 -1
- package/dist/types/instance.js +2 -6
- package/dist/types/instance.js.map +1 -1
- package/dist/types/instance.test.js +2 -0
- package/dist/types/instance.test.js.map +1 -1
- 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 +31 -0
- package/dist/types/profile.d.ts.map +1 -1
- package/dist/types/profile.js +2 -6
- package/dist/types/profile.js.map +1 -1
- package/dist/types/profile.test.js +2 -0
- package/dist/types/profile.test.js.map +1 -1
- 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 +13 -8
- package/dist/services/profile.d.ts +0 -44
- package/dist/services/profile.d.ts.map +0 -1
- package/dist/services/profile.js +0 -83
- package/dist/services/profile.js.map +0 -1
- package/dist/services/profile.test.d.ts +0 -2
- package/dist/services/profile.test.d.ts.map +0 -1
- package/dist/services/profile.test.js +0 -145
- package/dist/services/profile.test.js.map +0 -1
|
@@ -1,16 +1,17 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
1
3
|
/**
|
|
2
4
|
* Generates a test fixture SQLite database with the real LinkedHelper
|
|
3
5
|
* schema populated with synthetic (non-personal) mock data.
|
|
4
6
|
*
|
|
5
7
|
* Run: npx tsx src/db/testing/create-fixture.ts
|
|
6
8
|
*/
|
|
7
|
-
import { writeFileSync } from "node:fs";
|
|
8
9
|
import { dirname, join } from "node:path";
|
|
9
10
|
import { fileURLToPath } from "node:url";
|
|
10
|
-
import
|
|
11
|
+
import { DatabaseSync, backup } from "node:sqlite";
|
|
11
12
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
12
13
|
const FIXTURE_PATH = join(__dirname, "fixture.db");
|
|
13
|
-
const db = new
|
|
14
|
+
const db = new DatabaseSync(":memory:");
|
|
14
15
|
// ── Schema (matches real LinkedHelper DDL) ──────────────────────────
|
|
15
16
|
db.exec(`
|
|
16
17
|
CREATE TABLE disabled_triggers(
|
|
@@ -150,6 +151,46 @@ db.exec(`
|
|
|
150
151
|
FOREIGN KEY(person_id) REFERENCES people(id)
|
|
151
152
|
);
|
|
152
153
|
`);
|
|
154
|
+
db.exec(`
|
|
155
|
+
CREATE TABLE chats(
|
|
156
|
+
id INTEGER PRIMARY KEY,
|
|
157
|
+
original_id INTEGER,
|
|
158
|
+
type TEXT NOT NULL,
|
|
159
|
+
platform TEXT NOT NULL,
|
|
160
|
+
created_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
161
|
+
updated_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW'))
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
CREATE TABLE messages(
|
|
165
|
+
id INTEGER PRIMARY KEY,
|
|
166
|
+
type TEXT NOT NULL,
|
|
167
|
+
subject TEXT,
|
|
168
|
+
message_text TEXT NOT NULL,
|
|
169
|
+
attachments_count INTEGER NOT NULL DEFAULT 0,
|
|
170
|
+
send_at TEXT NOT NULL,
|
|
171
|
+
original_message_id INTEGER,
|
|
172
|
+
created_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
173
|
+
updated_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW'))
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
CREATE TABLE chat_participants(
|
|
177
|
+
id INTEGER PRIMARY KEY,
|
|
178
|
+
chat_id INTEGER NOT NULL,
|
|
179
|
+
person_id INTEGER NOT NULL,
|
|
180
|
+
UNIQUE(chat_id, person_id),
|
|
181
|
+
FOREIGN KEY(chat_id) REFERENCES chats(id),
|
|
182
|
+
FOREIGN KEY(person_id) REFERENCES people(id)
|
|
183
|
+
);
|
|
184
|
+
|
|
185
|
+
CREATE TABLE participant_messages(
|
|
186
|
+
id INTEGER PRIMARY KEY,
|
|
187
|
+
chat_participant_id INTEGER NOT NULL,
|
|
188
|
+
message_id INTEGER NOT NULL,
|
|
189
|
+
UNIQUE(chat_participant_id, message_id),
|
|
190
|
+
FOREIGN KEY(chat_participant_id) REFERENCES chat_participants(id),
|
|
191
|
+
FOREIGN KEY(message_id) REFERENCES messages(id)
|
|
192
|
+
);
|
|
193
|
+
`);
|
|
153
194
|
// ── Mock Data (obviously synthetic, no real PII) ────────────────────
|
|
154
195
|
const NOW = "2025-01-15T12:00:00.000Z";
|
|
155
196
|
// Person 1: full profile with all fields populated
|
|
@@ -279,8 +320,426 @@ db.exec(`
|
|
|
279
320
|
INSERT INTO person_email (person_id, email, type, actual_at)
|
|
280
321
|
VALUES (3, 'grace.personal@example.test', 'personal', '${NOW}');
|
|
281
322
|
`);
|
|
323
|
+
// Person 4: profile with LIKE wildcard characters in headline
|
|
324
|
+
db.exec(`
|
|
325
|
+
INSERT INTO people (id, original_id, created_at, updated_at)
|
|
326
|
+
VALUES (4, 4, '${NOW}', '${NOW}');
|
|
327
|
+
|
|
328
|
+
INSERT INTO person_mini_profile
|
|
329
|
+
(person_id, first_name, first_name_uppercase, last_name, last_name_uppercase,
|
|
330
|
+
headline, headline_uppercase)
|
|
331
|
+
VALUES
|
|
332
|
+
(4, 'Alan', 'ALAN', 'Turing', 'TURING',
|
|
333
|
+
'Achieved 100% on Enigma_v2 decryption',
|
|
334
|
+
'ACHIEVED 100% ON ENIGMA_V2 DECRYPTION');
|
|
335
|
+
|
|
336
|
+
INSERT INTO person_external_ids
|
|
337
|
+
(person_id, external_id, external_id_uppercase, type_group)
|
|
338
|
+
VALUES (4, 'alan-turing-test', 'ALAN-TURING-TEST', 'public');
|
|
339
|
+
`);
|
|
340
|
+
// ── Messaging Data (chats between Ada, Charlie, Grace) ──────────────
|
|
341
|
+
// Chat 1: Ada ↔ Grace (3 messages)
|
|
342
|
+
db.exec(`
|
|
343
|
+
INSERT INTO chats (id, original_id, type, platform, created_at, updated_at)
|
|
344
|
+
VALUES (1, 1001, 'MEMBER_TO_MEMBER', 'LINKEDIN', '${NOW}', '${NOW}');
|
|
345
|
+
|
|
346
|
+
INSERT INTO chat_participants (id, chat_id, person_id)
|
|
347
|
+
VALUES (1, 1, 1), (2, 1, 3);
|
|
348
|
+
|
|
349
|
+
INSERT INTO messages (id, type, message_text, attachments_count, send_at, created_at, updated_at)
|
|
350
|
+
VALUES
|
|
351
|
+
(1, 'MEMBER_TO_MEMBER', 'Hello Grace, I enjoyed your talk on compilers.', 0,
|
|
352
|
+
'2025-01-10T09:00:00.000Z', '${NOW}', '${NOW}'),
|
|
353
|
+
(2, 'MEMBER_TO_MEMBER', 'Thank you Ada! Would love to discuss analytical engines sometime.', 0,
|
|
354
|
+
'2025-01-10T09:15:00.000Z', '${NOW}', '${NOW}'),
|
|
355
|
+
(3, 'MEMBER_TO_MEMBER', 'Let us schedule a meeting next week.', 1,
|
|
356
|
+
'2025-01-11T14:30:00.000Z', '${NOW}', '${NOW}');
|
|
357
|
+
|
|
358
|
+
INSERT INTO participant_messages (id, chat_participant_id, message_id)
|
|
359
|
+
VALUES (1, 1, 1), (2, 2, 2), (3, 1, 3);
|
|
360
|
+
`);
|
|
361
|
+
// Chat 2: Ada ↔ Charlie (1 message, InMail with subject)
|
|
362
|
+
db.exec(`
|
|
363
|
+
INSERT INTO chats (id, original_id, type, platform, created_at, updated_at)
|
|
364
|
+
VALUES (2, 1002, 'MEMBER_TO_MEMBER', 'LINKEDIN', '${NOW}', '${NOW}');
|
|
365
|
+
|
|
366
|
+
INSERT INTO chat_participants (id, chat_id, person_id)
|
|
367
|
+
VALUES (3, 2, 1), (4, 2, 2);
|
|
368
|
+
|
|
369
|
+
INSERT INTO messages (id, type, subject, message_text, attachments_count, send_at, created_at, updated_at)
|
|
370
|
+
VALUES
|
|
371
|
+
(4, 'DEFAULT', 'Job Opportunity', 'Hi Charlie, we have an opening on our team.', 0,
|
|
372
|
+
'2025-01-12T10:00:00.000Z', '${NOW}', '${NOW}');
|
|
373
|
+
|
|
374
|
+
INSERT INTO participant_messages (id, chat_participant_id, message_id)
|
|
375
|
+
VALUES (4, 3, 4);
|
|
376
|
+
`);
|
|
377
|
+
// Chat 3: Grace ↔ Charlie (2 messages)
|
|
378
|
+
db.exec(`
|
|
379
|
+
INSERT INTO chats (id, original_id, type, platform, created_at, updated_at)
|
|
380
|
+
VALUES (3, 1003, 'MEMBER_TO_MEMBER', 'LINKEDIN', '${NOW}', '${NOW}');
|
|
381
|
+
|
|
382
|
+
INSERT INTO chat_participants (id, chat_id, person_id)
|
|
383
|
+
VALUES (5, 3, 3), (6, 3, 2);
|
|
384
|
+
|
|
385
|
+
INSERT INTO messages (id, type, message_text, attachments_count, send_at, created_at, updated_at)
|
|
386
|
+
VALUES
|
|
387
|
+
(5, 'MEMBER_TO_MEMBER', 'Charlie, have you tried the new COBOL compiler?', 0,
|
|
388
|
+
'2025-01-13T08:00:00.000Z', '${NOW}', '${NOW}'),
|
|
389
|
+
(6, 'MEMBER_TO_MEMBER', 'Not yet, but I will check it out!', 0,
|
|
390
|
+
'2025-01-13T08:30:00.000Z', '${NOW}', '${NOW}');
|
|
391
|
+
|
|
392
|
+
INSERT INTO participant_messages (id, chat_participant_id, message_id)
|
|
393
|
+
VALUES (5, 5, 5), (6, 6, 6);
|
|
394
|
+
`);
|
|
395
|
+
// Chat 4: Ada ↔ Charlie (messages with LIKE wildcard characters)
|
|
396
|
+
db.exec(`
|
|
397
|
+
INSERT INTO chats (id, original_id, type, platform, created_at, updated_at)
|
|
398
|
+
VALUES (4, 1004, 'MEMBER_TO_MEMBER', 'LINKEDIN', '${NOW}', '${NOW}');
|
|
399
|
+
|
|
400
|
+
INSERT INTO chat_participants (id, chat_id, person_id)
|
|
401
|
+
VALUES (7, 4, 1), (8, 4, 2);
|
|
402
|
+
|
|
403
|
+
INSERT INTO messages (id, type, message_text, attachments_count, send_at, created_at, updated_at)
|
|
404
|
+
VALUES
|
|
405
|
+
(7, 'MEMBER_TO_MEMBER', 'We achieved 100% coverage on the test suite!', 0,
|
|
406
|
+
'2025-01-14T09:00:00.000Z', '${NOW}', '${NOW}'),
|
|
407
|
+
(8, 'MEMBER_TO_MEMBER', 'The field_name parameter needs updating.', 0,
|
|
408
|
+
'2025-01-14T09:30:00.000Z', '${NOW}', '${NOW}');
|
|
409
|
+
|
|
410
|
+
INSERT INTO participant_messages (id, chat_participant_id, message_id)
|
|
411
|
+
VALUES (7, 7, 7), (8, 8, 8);
|
|
412
|
+
`);
|
|
413
|
+
// ── Campaign Schema ──────────────────────────────────────────────────
|
|
414
|
+
db.exec(`
|
|
415
|
+
CREATE TABLE campaigns(
|
|
416
|
+
id INTEGER PRIMARY KEY,
|
|
417
|
+
name TEXT NOT NULL,
|
|
418
|
+
description TEXT,
|
|
419
|
+
type INTEGER NOT NULL DEFAULT 1,
|
|
420
|
+
is_paused INTEGER,
|
|
421
|
+
is_archived INTEGER,
|
|
422
|
+
is_valid INTEGER,
|
|
423
|
+
li_account_id INTEGER NOT NULL,
|
|
424
|
+
created_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
425
|
+
updated_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW'))
|
|
426
|
+
);
|
|
427
|
+
|
|
428
|
+
CREATE TABLE actions(
|
|
429
|
+
id INTEGER PRIMARY KEY,
|
|
430
|
+
campaign_id INTEGER NOT NULL,
|
|
431
|
+
name TEXT NOT NULL,
|
|
432
|
+
description TEXT,
|
|
433
|
+
startAt DATETIME,
|
|
434
|
+
postpone_reason TEXT,
|
|
435
|
+
postpone_reason_data TEXT,
|
|
436
|
+
created_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
437
|
+
updated_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
438
|
+
FOREIGN KEY(campaign_id) REFERENCES campaigns(id)
|
|
439
|
+
);
|
|
440
|
+
CREATE INDEX actions_campaign_idx ON actions(campaign_id);
|
|
441
|
+
|
|
442
|
+
CREATE TABLE action_configs(
|
|
443
|
+
id INTEGER PRIMARY KEY,
|
|
444
|
+
actionType TEXT NOT NULL,
|
|
445
|
+
actionSettings TEXT NOT NULL DEFAULT '{}',
|
|
446
|
+
coolDown INTEGER NOT NULL DEFAULT 60000,
|
|
447
|
+
maxActionResultsPerIteration INTEGER NOT NULL DEFAULT 10,
|
|
448
|
+
isDraft INTEGER,
|
|
449
|
+
created_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
450
|
+
updated_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW'))
|
|
451
|
+
);
|
|
452
|
+
|
|
453
|
+
CREATE TABLE action_versions(
|
|
454
|
+
id INTEGER PRIMARY KEY,
|
|
455
|
+
action_id INTEGER NOT NULL,
|
|
456
|
+
config_id INTEGER NOT NULL,
|
|
457
|
+
exclude_list_id INTEGER,
|
|
458
|
+
created_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
459
|
+
updated_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
460
|
+
FOREIGN KEY(action_id) REFERENCES actions(id),
|
|
461
|
+
FOREIGN KEY(config_id) REFERENCES action_configs(id)
|
|
462
|
+
);
|
|
463
|
+
CREATE INDEX action_versions_action_idx ON action_versions(action_id);
|
|
464
|
+
|
|
465
|
+
CREATE TABLE action_target_people(
|
|
466
|
+
id INTEGER PRIMARY KEY,
|
|
467
|
+
action_id INTEGER NOT NULL,
|
|
468
|
+
action_version_id INTEGER NOT NULL,
|
|
469
|
+
person_id INTEGER NOT NULL,
|
|
470
|
+
state INTEGER NOT NULL DEFAULT 1,
|
|
471
|
+
li_account_id INTEGER NOT NULL,
|
|
472
|
+
created_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
473
|
+
updated_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
474
|
+
FOREIGN KEY(action_id) REFERENCES actions(id),
|
|
475
|
+
FOREIGN KEY(action_version_id) REFERENCES action_versions(id),
|
|
476
|
+
FOREIGN KEY(person_id) REFERENCES people(id)
|
|
477
|
+
);
|
|
478
|
+
CREATE INDEX action_target_people_action_idx ON action_target_people(action_id);
|
|
479
|
+
CREATE INDEX action_target_people_person_idx ON action_target_people(person_id);
|
|
480
|
+
|
|
481
|
+
CREATE TABLE person_in_campaigns_history(
|
|
482
|
+
id INTEGER PRIMARY KEY,
|
|
483
|
+
campaign_id INTEGER NOT NULL,
|
|
484
|
+
person_id INTEGER NOT NULL,
|
|
485
|
+
action_target_people_id INTEGER,
|
|
486
|
+
result_status INTEGER,
|
|
487
|
+
result_id INTEGER,
|
|
488
|
+
result_action_version_id INTEGER,
|
|
489
|
+
result_action_iteration_id INTEGER,
|
|
490
|
+
result_created_at DATETIME,
|
|
491
|
+
result_data TEXT,
|
|
492
|
+
result_data_message TEXT,
|
|
493
|
+
result_code TEXT,
|
|
494
|
+
result_is_exception INTEGER,
|
|
495
|
+
result_who_to_blame TEXT,
|
|
496
|
+
result_is_retryable INTEGER,
|
|
497
|
+
result_flag_recipient_replied INTEGER,
|
|
498
|
+
result_flag_sender_messaged INTEGER,
|
|
499
|
+
result_invited_platform TEXT,
|
|
500
|
+
result_messaged_platform TEXT,
|
|
501
|
+
add_to_target_date DATETIME,
|
|
502
|
+
add_to_target_or_result_saved_date DATETIME,
|
|
503
|
+
created_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
504
|
+
updated_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
505
|
+
FOREIGN KEY(campaign_id) REFERENCES campaigns(id),
|
|
506
|
+
FOREIGN KEY(person_id) REFERENCES people(id)
|
|
507
|
+
);
|
|
508
|
+
CREATE INDEX person_in_campaigns_history_campaign_idx ON person_in_campaigns_history(campaign_id);
|
|
509
|
+
CREATE INDEX person_in_campaigns_history_person_idx ON person_in_campaigns_history(person_id);
|
|
510
|
+
|
|
511
|
+
CREATE TABLE action_results(
|
|
512
|
+
id INTEGER PRIMARY KEY,
|
|
513
|
+
action_version_id INTEGER NOT NULL,
|
|
514
|
+
person_id INTEGER NOT NULL,
|
|
515
|
+
result INTEGER NOT NULL,
|
|
516
|
+
platform TEXT,
|
|
517
|
+
created_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
518
|
+
updated_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
519
|
+
UNIQUE(action_version_id, person_id),
|
|
520
|
+
FOREIGN KEY(action_version_id) REFERENCES action_versions(id),
|
|
521
|
+
FOREIGN KEY(person_id) REFERENCES people(id)
|
|
522
|
+
);
|
|
523
|
+
CREATE INDEX action_results_version_idx ON action_results(action_version_id);
|
|
524
|
+
CREATE INDEX action_results_person_idx ON action_results(person_id);
|
|
525
|
+
|
|
526
|
+
CREATE TABLE action_result_flags(
|
|
527
|
+
id INTEGER PRIMARY KEY,
|
|
528
|
+
action_result_id INTEGER NOT NULL,
|
|
529
|
+
flag_name TEXT NOT NULL,
|
|
530
|
+
flag_value INTEGER,
|
|
531
|
+
code INTEGER,
|
|
532
|
+
is_exception INTEGER DEFAULT 0,
|
|
533
|
+
who_to_blame TEXT DEFAULT '',
|
|
534
|
+
created_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
535
|
+
updated_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
536
|
+
FOREIGN KEY(action_result_id) REFERENCES action_results(id)
|
|
537
|
+
);
|
|
538
|
+
CREATE INDEX action_result_flags_result_idx ON action_result_flags(action_result_id);
|
|
539
|
+
|
|
540
|
+
CREATE TABLE action_result_messages(
|
|
541
|
+
id INTEGER PRIMARY KEY,
|
|
542
|
+
action_result_id INTEGER NOT NULL,
|
|
543
|
+
type TEXT NOT NULL,
|
|
544
|
+
message_id INTEGER,
|
|
545
|
+
created_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
546
|
+
updated_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
547
|
+
FOREIGN KEY(action_result_id) REFERENCES action_results(id)
|
|
548
|
+
);
|
|
549
|
+
CREATE INDEX action_result_messages_result_idx ON action_result_messages(action_result_id);
|
|
550
|
+
`);
|
|
551
|
+
db.exec(`
|
|
552
|
+
CREATE TABLE collections(
|
|
553
|
+
id INTEGER PRIMARY KEY,
|
|
554
|
+
li_account_id INTEGER NOT NULL,
|
|
555
|
+
name TEXT,
|
|
556
|
+
created_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
557
|
+
updated_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW'))
|
|
558
|
+
);
|
|
559
|
+
|
|
560
|
+
CREATE TABLE collection_people_versions(
|
|
561
|
+
id INTEGER PRIMARY KEY,
|
|
562
|
+
collection_id INTEGER NOT NULL,
|
|
563
|
+
version_operation_status TEXT NOT NULL,
|
|
564
|
+
additional_data TEXT,
|
|
565
|
+
created_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
566
|
+
updated_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
567
|
+
FOREIGN KEY(collection_id) REFERENCES collections(id)
|
|
568
|
+
);
|
|
569
|
+
CREATE INDEX collection_people_versions_collection_idx ON collection_people_versions(collection_id);
|
|
570
|
+
|
|
571
|
+
CREATE TABLE collection_people(
|
|
572
|
+
collection_id INTEGER,
|
|
573
|
+
person_id INTEGER,
|
|
574
|
+
UNIQUE(collection_id, person_id)
|
|
575
|
+
);
|
|
576
|
+
|
|
577
|
+
CREATE TABLE campaign_versions(
|
|
578
|
+
id INTEGER PRIMARY KEY,
|
|
579
|
+
campaign_id INTEGER NOT NULL,
|
|
580
|
+
exclude_list_id INTEGER,
|
|
581
|
+
created_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
582
|
+
updated_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
583
|
+
FOREIGN KEY(campaign_id) REFERENCES campaigns(id),
|
|
584
|
+
FOREIGN KEY(exclude_list_id) REFERENCES collection_people_versions(id)
|
|
585
|
+
);
|
|
586
|
+
CREATE INDEX campaign_versions_campaign_idx ON campaign_versions(campaign_id);
|
|
587
|
+
`);
|
|
588
|
+
// ── Campaign Mock Data ───────────────────────────────────────────────
|
|
589
|
+
// Campaign 1: Active campaign with MessageToPerson action
|
|
590
|
+
db.exec(`
|
|
591
|
+
INSERT INTO campaigns (id, name, description, type, is_paused, is_archived, is_valid, li_account_id, created_at, updated_at)
|
|
592
|
+
VALUES (1, 'Outreach Campaign', 'Test outreach campaign', 1, 0, 0, 1, 1, '${NOW}', '${NOW}');
|
|
593
|
+
|
|
594
|
+
INSERT INTO action_configs (id, actionType, actionSettings, coolDown, maxActionResultsPerIteration, isDraft)
|
|
595
|
+
VALUES (1, 'MessageToPerson', '{"messageTemplate":{"type":"variants","variants":[{"type":"variant","child":{"type":"group","children":[{"type":"text","value":"Hello "},{"type":"var","name":"firstName"}]}}]},"rejectIfReplied":false}', 60000, 10, 0);
|
|
596
|
+
|
|
597
|
+
INSERT INTO actions (id, campaign_id, name, description, created_at, updated_at)
|
|
598
|
+
VALUES (1, 1, 'Send Welcome Message', 'First touch message', '${NOW}', '${NOW}');
|
|
599
|
+
|
|
600
|
+
INSERT INTO action_versions (id, action_id, config_id, created_at, updated_at)
|
|
601
|
+
VALUES (1, 1, 1, '${NOW}', '${NOW}');
|
|
602
|
+
|
|
603
|
+
INSERT INTO action_target_people (id, action_id, action_version_id, person_id, state, li_account_id, created_at, updated_at)
|
|
604
|
+
VALUES
|
|
605
|
+
(1, 1, 1, 1, 2, 1, '${NOW}', '${NOW}'),
|
|
606
|
+
(2, 1, 1, 3, 2, 1, '${NOW}', '${NOW}'),
|
|
607
|
+
(10, 1, 1, 2, 2, 1, '${NOW}', '${NOW}'),
|
|
608
|
+
(11, 1, 1, 4, 2, 1, '${NOW}', '${NOW}');
|
|
609
|
+
|
|
610
|
+
INSERT INTO person_in_campaigns_history (id, campaign_id, person_id, action_target_people_id, result_status, result_id, result_action_version_id, add_to_target_date, add_to_target_or_result_saved_date, created_at, updated_at)
|
|
611
|
+
VALUES
|
|
612
|
+
(1, 1, 1, 1, 1, 1, 1, '${NOW}', '${NOW}', '${NOW}', '${NOW}'),
|
|
613
|
+
(2, 1, 3, 2, 2, 2, 1, '${NOW}', '${NOW}', '${NOW}', '${NOW}'),
|
|
614
|
+
(10, 1, 2, 10, -1, 3, 1, '${NOW}', '${NOW}', '${NOW}', '${NOW}'),
|
|
615
|
+
(11, 1, 4, 11, -2, 4, 1, '${NOW}', '${NOW}', '${NOW}', '${NOW}');
|
|
616
|
+
|
|
617
|
+
INSERT INTO action_results (id, action_version_id, person_id, result, platform, created_at, updated_at)
|
|
618
|
+
VALUES
|
|
619
|
+
(1, 1, 1, 1, 'LINKEDIN', '2025-01-15T12:30:00.000Z', '${NOW}'),
|
|
620
|
+
(2, 1, 3, 2, 'LINKEDIN', '2025-01-15T13:00:00.000Z', '${NOW}'),
|
|
621
|
+
(3, 1, 2, -1, 'LINKEDIN', '2025-01-15T13:30:00.000Z', '${NOW}'),
|
|
622
|
+
(4, 1, 4, -2, 'LINKEDIN', '2025-01-15T14:00:00.000Z', '${NOW}');
|
|
623
|
+
|
|
624
|
+
INSERT INTO action_result_flags (id, action_result_id, flag_name, flag_value, code, is_exception, who_to_blame)
|
|
625
|
+
VALUES
|
|
626
|
+
(1, 1, 'message_sent', 1, NULL, 0, ''),
|
|
627
|
+
(2, 3, 'error', 1, 100, 0, 'LinkedIn'),
|
|
628
|
+
(3, 3, 'error', 1, 200, 1, 'LH'),
|
|
629
|
+
(4, 4, 'skipped', 1, 100, 0, 'LinkedIn');
|
|
630
|
+
|
|
631
|
+
INSERT INTO action_result_messages (id, action_result_id, type, message_id)
|
|
632
|
+
VALUES (1, 1, 'Sent', 1);
|
|
633
|
+
`);
|
|
634
|
+
// Campaign 2: Paused campaign
|
|
635
|
+
db.exec(`
|
|
636
|
+
INSERT INTO campaigns (id, name, description, type, is_paused, is_archived, is_valid, li_account_id, created_at, updated_at)
|
|
637
|
+
VALUES (2, 'Follow-up Campaign', 'Paused follow-up', 1, 1, 0, 1, 1, '2025-01-14T10:00:00.000Z', '${NOW}');
|
|
638
|
+
|
|
639
|
+
INSERT INTO action_configs (id, actionType, actionSettings, coolDown, maxActionResultsPerIteration, isDraft)
|
|
640
|
+
VALUES (2, 'VisitAndExtract', '{"extractCurrentOrganizations":true}', 30000, 20, 0);
|
|
641
|
+
|
|
642
|
+
INSERT INTO actions (id, campaign_id, name, description, created_at, updated_at)
|
|
643
|
+
VALUES (2, 2, 'Visit Profile', 'Extract profile data', '${NOW}', '${NOW}');
|
|
644
|
+
|
|
645
|
+
INSERT INTO action_versions (id, action_id, config_id, created_at, updated_at)
|
|
646
|
+
VALUES (2, 2, 2, '${NOW}', '${NOW}');
|
|
647
|
+
`);
|
|
648
|
+
// Campaign 3: Archived campaign
|
|
649
|
+
db.exec(`
|
|
650
|
+
INSERT INTO campaigns (id, name, description, type, is_paused, is_archived, is_valid, li_account_id, created_at, updated_at)
|
|
651
|
+
VALUES (3, 'Old Campaign', 'Archived old campaign', 1, 0, 1, 1, 1, '2025-01-01T10:00:00.000Z', '${NOW}');
|
|
652
|
+
`);
|
|
653
|
+
// Campaign 4: Invalid campaign
|
|
654
|
+
db.exec(`
|
|
655
|
+
INSERT INTO campaigns (id, name, description, type, is_paused, is_archived, is_valid, li_account_id, created_at, updated_at)
|
|
656
|
+
VALUES (4, 'Invalid Campaign', 'Invalid configuration', 1, 0, 0, 0, 1, '2025-01-13T10:00:00.000Z', '${NOW}');
|
|
657
|
+
`);
|
|
658
|
+
// Campaign 5: Multi-action campaign for move-next testing
|
|
659
|
+
db.exec(`
|
|
660
|
+
INSERT INTO campaigns (id, name, description, type, is_paused, is_archived, is_valid, li_account_id, created_at, updated_at)
|
|
661
|
+
VALUES (5, 'Multi-Action Campaign', 'Campaign with 3 actions', 1, 0, 0, 1, 1, '2025-01-12T10:00:00.000Z', '${NOW}');
|
|
662
|
+
|
|
663
|
+
INSERT INTO action_configs (id, actionType, actionSettings, coolDown, maxActionResultsPerIteration, isDraft)
|
|
664
|
+
VALUES
|
|
665
|
+
(5, 'VisitAndExtract', '{"extractCurrentOrganizations":true}', 60000, 10, 0),
|
|
666
|
+
(6, 'Waiter', '{"delay":48}', 0, -1, 0),
|
|
667
|
+
(7, 'InvitePerson', '{"messageTemplate":{"type":"variants","variants":[]},"saveAsLeadSN":false}', 60000, 10, 0);
|
|
668
|
+
|
|
669
|
+
INSERT INTO actions (id, campaign_id, name, description, created_at, updated_at)
|
|
670
|
+
VALUES
|
|
671
|
+
(5, 5, 'Visit Profile', 'Extract profile data', '${NOW}', '${NOW}'),
|
|
672
|
+
(6, 5, 'Wait 48h', 'Wait before invite', '${NOW}', '${NOW}'),
|
|
673
|
+
(7, 5, 'Send Invite', 'Invite to connect', '${NOW}', '${NOW}');
|
|
674
|
+
|
|
675
|
+
INSERT INTO action_versions (id, action_id, config_id, created_at, updated_at)
|
|
676
|
+
VALUES
|
|
677
|
+
(5, 5, 5, '${NOW}', '${NOW}'),
|
|
678
|
+
(6, 6, 6, '${NOW}', '${NOW}'),
|
|
679
|
+
(7, 7, 7, '${NOW}', '${NOW}');
|
|
680
|
+
|
|
681
|
+
INSERT INTO action_target_people (id, action_id, action_version_id, person_id, state, li_account_id, created_at, updated_at)
|
|
682
|
+
VALUES
|
|
683
|
+
(3, 5, 5, 1, 1, 1, '${NOW}', '${NOW}'),
|
|
684
|
+
(4, 5, 5, 3, 2, 1, '${NOW}', '${NOW}');
|
|
685
|
+
|
|
686
|
+
INSERT INTO person_in_campaigns_history (id, campaign_id, person_id, action_target_people_id, result_status, add_to_target_date, add_to_target_or_result_saved_date, created_at, updated_at)
|
|
687
|
+
VALUES
|
|
688
|
+
(3, 5, 1, 3, -999, '${NOW}', '${NOW}', '${NOW}', '${NOW}'),
|
|
689
|
+
(4, 5, 3, 4, -999, '${NOW}', '${NOW}', '${NOW}', '${NOW}');
|
|
690
|
+
`);
|
|
691
|
+
// ── Exclude List Data ────────────────────────────────────────────────
|
|
692
|
+
// Campaign 1: campaign-level exclude list chain
|
|
693
|
+
// collection 1 → CPV 1 → campaign_version.exclude_list_id
|
|
694
|
+
// collection 2 → CPV 2 → action_version 1.exclude_list_id
|
|
695
|
+
db.exec(`
|
|
696
|
+
INSERT INTO collections (id, li_account_id, name, created_at, updated_at)
|
|
697
|
+
VALUES
|
|
698
|
+
(1, 1, NULL, '${NOW}', '${NOW}'),
|
|
699
|
+
(2, 1, NULL, '${NOW}', '${NOW}');
|
|
700
|
+
|
|
701
|
+
INSERT INTO collection_people_versions (id, collection_id, version_operation_status, created_at, updated_at)
|
|
702
|
+
VALUES
|
|
703
|
+
(1, 1, 'addToTarget', '${NOW}', '${NOW}'),
|
|
704
|
+
(2, 2, 'addToTarget', '${NOW}', '${NOW}');
|
|
705
|
+
|
|
706
|
+
INSERT INTO campaign_versions (id, campaign_id, exclude_list_id, created_at, updated_at)
|
|
707
|
+
VALUES (1, 1, 1, '${NOW}', '${NOW}');
|
|
708
|
+
|
|
709
|
+
UPDATE action_versions SET exclude_list_id = 2 WHERE id = 1;
|
|
710
|
+
|
|
711
|
+
INSERT INTO collection_people (collection_id, person_id)
|
|
712
|
+
VALUES (1, 2);
|
|
713
|
+
`);
|
|
714
|
+
// Campaign 5: campaign-level + action-level exclude list chains
|
|
715
|
+
// collection 3 → CPV 3 → campaign_version for campaign 5
|
|
716
|
+
// collection 4 → CPV 4 → action_version 5.exclude_list_id
|
|
717
|
+
// collection 5 → CPV 5 → action_version 6.exclude_list_id
|
|
718
|
+
// collection 6 → CPV 6 → action_version 7.exclude_list_id
|
|
719
|
+
db.exec(`
|
|
720
|
+
INSERT INTO collections (id, li_account_id, name, created_at, updated_at)
|
|
721
|
+
VALUES
|
|
722
|
+
(3, 1, NULL, '${NOW}', '${NOW}'),
|
|
723
|
+
(4, 1, NULL, '${NOW}', '${NOW}'),
|
|
724
|
+
(5, 1, NULL, '${NOW}', '${NOW}'),
|
|
725
|
+
(6, 1, NULL, '${NOW}', '${NOW}');
|
|
726
|
+
|
|
727
|
+
INSERT INTO collection_people_versions (id, collection_id, version_operation_status, created_at, updated_at)
|
|
728
|
+
VALUES
|
|
729
|
+
(3, 3, 'addToTarget', '${NOW}', '${NOW}'),
|
|
730
|
+
(4, 4, 'addToTarget', '${NOW}', '${NOW}'),
|
|
731
|
+
(5, 5, 'addToTarget', '${NOW}', '${NOW}'),
|
|
732
|
+
(6, 6, 'addToTarget', '${NOW}', '${NOW}');
|
|
733
|
+
|
|
734
|
+
INSERT INTO campaign_versions (id, campaign_id, exclude_list_id, created_at, updated_at)
|
|
735
|
+
VALUES (2, 5, 3, '${NOW}', '${NOW}');
|
|
736
|
+
|
|
737
|
+
UPDATE action_versions SET exclude_list_id = 4 WHERE id = 5;
|
|
738
|
+
UPDATE action_versions SET exclude_list_id = 5 WHERE id = 6;
|
|
739
|
+
UPDATE action_versions SET exclude_list_id = 6 WHERE id = 7;
|
|
740
|
+
`);
|
|
282
741
|
// ── Write to disk ───────────────────────────────────────────────────
|
|
283
|
-
|
|
742
|
+
await backup(db, FIXTURE_PATH);
|
|
284
743
|
db.close();
|
|
285
744
|
console.log(`Fixture written to ${FIXTURE_PATH}`);
|
|
286
745
|
//# sourceMappingURL=create-fixture.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-fixture.js","sourceRoot":"","sources":["../../../src/db/testing/create-fixture.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"create-fixture.js","sourceRoot":"","sources":["../../../src/db/testing/create-fixture.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { DatabaseSync } from "node:sqlite";
|
|
2
2
|
/** Absolute path to the test fixture database file. */
|
|
3
3
|
export declare const FIXTURE_PATH: string;
|
|
4
4
|
/**
|
|
5
|
-
* Opens the fixture database as a writable
|
|
5
|
+
* Opens the fixture database as a writable temporary copy.
|
|
6
6
|
*
|
|
7
7
|
* Each call returns an independent database instance so tests cannot
|
|
8
8
|
* interfere with each other. The real LinkedHelper schema (tables,
|
|
9
9
|
* indexes, CHECK constraints) and synthetic mock data are included.
|
|
10
10
|
*
|
|
11
|
-
* Call `.close()` when done
|
|
11
|
+
* Call `.close()` when done — the temporary file is deleted
|
|
12
|
+
* automatically on close.
|
|
12
13
|
*/
|
|
13
|
-
export declare function openFixture():
|
|
14
|
+
export declare function openFixture(): DatabaseSync;
|
|
14
15
|
//# sourceMappingURL=open-fixture.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open-fixture.d.ts","sourceRoot":"","sources":["../../../src/db/testing/open-fixture.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"open-fixture.d.ts","sourceRoot":"","sources":["../../../src/db/testing/open-fixture.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI3C,uDAAuD;AACvD,eAAO,MAAM,YAAY,QAAgC,CAAC;AAE1D;;;;;;;;;GASG;AACH,wBAAgB,WAAW,IAAI,YAAY,CAkB1C"}
|
|
@@ -1,21 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
import { copyFileSync, unlinkSync } from "node:fs";
|
|
2
4
|
import { dirname, join } from "node:path";
|
|
5
|
+
import { randomUUID } from "node:crypto";
|
|
6
|
+
import { tmpdir } from "node:os";
|
|
3
7
|
import { fileURLToPath } from "node:url";
|
|
4
|
-
import
|
|
8
|
+
import { DatabaseSync } from "node:sqlite";
|
|
5
9
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
10
|
/** Absolute path to the test fixture database file. */
|
|
7
11
|
export const FIXTURE_PATH = join(__dirname, "fixture.db");
|
|
8
12
|
/**
|
|
9
|
-
* Opens the fixture database as a writable
|
|
13
|
+
* Opens the fixture database as a writable temporary copy.
|
|
10
14
|
*
|
|
11
15
|
* Each call returns an independent database instance so tests cannot
|
|
12
16
|
* interfere with each other. The real LinkedHelper schema (tables,
|
|
13
17
|
* indexes, CHECK constraints) and synthetic mock data are included.
|
|
14
18
|
*
|
|
15
|
-
* Call `.close()` when done
|
|
19
|
+
* Call `.close()` when done — the temporary file is deleted
|
|
20
|
+
* automatically on close.
|
|
16
21
|
*/
|
|
17
22
|
export function openFixture() {
|
|
18
|
-
const
|
|
19
|
-
|
|
23
|
+
const tmpPath = join(tmpdir(), `lhremote-fixture-${randomUUID()}.db`);
|
|
24
|
+
copyFileSync(FIXTURE_PATH, tmpPath);
|
|
25
|
+
const db = new DatabaseSync(tmpPath);
|
|
26
|
+
// Wrap close() to also clean up the temp file
|
|
27
|
+
const originalClose = db.close.bind(db);
|
|
28
|
+
db.close = () => {
|
|
29
|
+
originalClose();
|
|
30
|
+
try {
|
|
31
|
+
unlinkSync(tmpPath);
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
// Ignore cleanup errors
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
return db;
|
|
20
38
|
}
|
|
21
39
|
//# sourceMappingURL=open-fixture.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open-fixture.js","sourceRoot":"","sources":["../../../src/db/testing/open-fixture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"open-fixture.js","sourceRoot":"","sources":["../../../src/db/testing/open-fixture.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D,uDAAuD;AACvD,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AAE1D;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW;IACzB,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,oBAAoB,UAAU,EAAE,KAAK,CAAC,CAAC;IACtE,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAEpC,MAAM,EAAE,GAAG,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC;IAErC,8CAA8C;IAC9C,MAAM,aAAa,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACxC,EAAE,CAAC,KAAK,GAAG,GAAG,EAAE;QACd,aAAa,EAAE,CAAC;QAChB,IAAI,CAAC;YACH,UAAU,CAAC,OAAO,CAAC,CAAC;QACtB,CAAC;QAAC,MAAM,CAAC;YACP,wBAAwB;QAC1B,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Campaign, CampaignAction, CampaignConfig } from "../types/index.js";
|
|
2
|
+
import { FormatError } from "./errors.js";
|
|
3
|
+
/**
|
|
4
|
+
* Thrown when a campaign document fails structural validation.
|
|
5
|
+
*/
|
|
6
|
+
export declare class CampaignFormatError extends FormatError {
|
|
7
|
+
constructor(message: string);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Parse a YAML string into a CampaignConfig.
|
|
11
|
+
*
|
|
12
|
+
* @throws {CampaignFormatError} if the YAML is malformed or the document
|
|
13
|
+
* fails structural validation.
|
|
14
|
+
*/
|
|
15
|
+
export declare function parseCampaignYaml(yamlString: string): CampaignConfig;
|
|
16
|
+
/**
|
|
17
|
+
* Parse a JSON string into a CampaignConfig.
|
|
18
|
+
*
|
|
19
|
+
* @throws {CampaignFormatError} if the JSON is malformed or the document
|
|
20
|
+
* fails structural validation.
|
|
21
|
+
*/
|
|
22
|
+
export declare function parseCampaignJson(jsonString: string): CampaignConfig;
|
|
23
|
+
/**
|
|
24
|
+
* Serialize a campaign and its actions to a YAML string.
|
|
25
|
+
*/
|
|
26
|
+
export declare function serializeCampaignYaml(campaign: Campaign, actions: CampaignAction[]): string;
|
|
27
|
+
/**
|
|
28
|
+
* Serialize a campaign and its actions to a JSON string.
|
|
29
|
+
*/
|
|
30
|
+
export declare function serializeCampaignJson(campaign: Campaign, actions: CampaignAction[]): string;
|
|
31
|
+
//# sourceMappingURL=campaign-format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaign-format.d.ts","sourceRoot":"","sources":["../../src/formats/campaign-format.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EAEd,cAAc,EACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAgC1C;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,WAAW;gBACtC,OAAO,EAAE,MAAM;CAI5B;AAMD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,CASpE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,CASpE;AAMD;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,cAAc,EAAE,GACxB,MAAM,CAGR;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,cAAc,EAAE,GACxB,MAAM,CAGR"}
|