@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,745 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
/**
|
|
4
|
+
* Generates a test fixture SQLite database with the real LinkedHelper
|
|
5
|
+
* schema populated with synthetic (non-personal) mock data.
|
|
6
|
+
*
|
|
7
|
+
* Run: npx tsx src/db/testing/create-fixture.ts
|
|
8
|
+
*/
|
|
9
|
+
import { dirname, join } from "node:path";
|
|
10
|
+
import { fileURLToPath } from "node:url";
|
|
11
|
+
import { DatabaseSync, backup } from "node:sqlite";
|
|
12
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const FIXTURE_PATH = join(__dirname, "fixture.db");
|
|
14
|
+
const db = new DatabaseSync(":memory:");
|
|
15
|
+
// ── Schema (matches real LinkedHelper DDL) ──────────────────────────
|
|
16
|
+
db.exec(`
|
|
17
|
+
CREATE TABLE disabled_triggers(
|
|
18
|
+
id INTEGER PRIMARY KEY,
|
|
19
|
+
trigger_name TEXT,
|
|
20
|
+
UNIQUE (trigger_name)
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
CREATE TABLE people(
|
|
24
|
+
id INTEGER PRIMARY KEY,
|
|
25
|
+
original_id INTEGER,
|
|
26
|
+
created_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
27
|
+
updated_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW'))
|
|
28
|
+
);
|
|
29
|
+
CREATE INDEX people_original_id_idx ON people(original_id);
|
|
30
|
+
|
|
31
|
+
CREATE TABLE person_mini_profile(
|
|
32
|
+
id INTEGER PRIMARY KEY,
|
|
33
|
+
person_id INTEGER NOT NULL,
|
|
34
|
+
first_name TEXT NOT NULL,
|
|
35
|
+
first_name_uppercase TEXT,
|
|
36
|
+
last_name TEXT,
|
|
37
|
+
last_name_uppercase TEXT,
|
|
38
|
+
headline TEXT,
|
|
39
|
+
headline_uppercase TEXT,
|
|
40
|
+
avatar TEXT,
|
|
41
|
+
first_mutual_full_name TEXT,
|
|
42
|
+
second_mutual_full_name TEXT,
|
|
43
|
+
created_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
44
|
+
updated_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
45
|
+
UNIQUE (person_id),
|
|
46
|
+
FOREIGN KEY(person_id) REFERENCES people(id)
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
CREATE TABLE person_external_ids(
|
|
50
|
+
id INTEGER PRIMARY KEY,
|
|
51
|
+
person_id INTEGER NOT NULL,
|
|
52
|
+
external_id TEXT NOT NULL,
|
|
53
|
+
external_id_uppercase TEXT NOT NULL,
|
|
54
|
+
type_group TEXT NOT NULL CHECK(type_group IN ('member', 'public', 'hash', 'avatar')),
|
|
55
|
+
is_member_id INTEGER,
|
|
56
|
+
created_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
57
|
+
updated_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
58
|
+
UNIQUE(external_id, type_group),
|
|
59
|
+
FOREIGN KEY(person_id) REFERENCES people(id)
|
|
60
|
+
);
|
|
61
|
+
CREATE INDEX person_external_ids_person_idx ON person_external_ids(person_id);
|
|
62
|
+
|
|
63
|
+
CREATE TABLE person_current_position(
|
|
64
|
+
id INTEGER PRIMARY KEY,
|
|
65
|
+
person_id INTEGER NOT NULL,
|
|
66
|
+
company TEXT,
|
|
67
|
+
company_uppercase TEXT,
|
|
68
|
+
position TEXT,
|
|
69
|
+
position_uppercase TEXT,
|
|
70
|
+
created_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
71
|
+
updated_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
72
|
+
UNIQUE(person_id),
|
|
73
|
+
FOREIGN KEY(person_id) REFERENCES people(id)
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
CREATE TABLE person_positions(
|
|
77
|
+
id INTEGER PRIMARY KEY,
|
|
78
|
+
person_id INTEGER NOT NULL,
|
|
79
|
+
title TEXT NOT NULL,
|
|
80
|
+
company_name TEXT NOT NULL,
|
|
81
|
+
company_id TEXT,
|
|
82
|
+
start DATETIME,
|
|
83
|
+
start_year INTEGER,
|
|
84
|
+
start_month INTEGER,
|
|
85
|
+
"end" DATETIME,
|
|
86
|
+
end_year INTEGER,
|
|
87
|
+
end_month INTEGER,
|
|
88
|
+
location_name TEXT,
|
|
89
|
+
description TEXT,
|
|
90
|
+
is_default INTEGER,
|
|
91
|
+
created_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
92
|
+
updated_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
93
|
+
sent_at_to_pas DATETIME,
|
|
94
|
+
actual_at DATETIME NOT NULL,
|
|
95
|
+
UNIQUE(person_id, is_default),
|
|
96
|
+
FOREIGN KEY(person_id) REFERENCES people(id),
|
|
97
|
+
CHECK(is_default IS NULL OR (is_default IS NOT NULL AND "end" IS NULL))
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
CREATE TABLE person_education(
|
|
101
|
+
id INTEGER PRIMARY KEY,
|
|
102
|
+
person_id INTEGER NOT NULL,
|
|
103
|
+
school_name TEXT NOT NULL,
|
|
104
|
+
degree_name TEXT,
|
|
105
|
+
field_of_study TEXT,
|
|
106
|
+
description TEXT,
|
|
107
|
+
start_year INTEGER,
|
|
108
|
+
start_month INTEGER,
|
|
109
|
+
end_year INTEGER,
|
|
110
|
+
end_month INTEGER,
|
|
111
|
+
created_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
112
|
+
updated_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
113
|
+
sent_at_to_pas DATETIME,
|
|
114
|
+
actual_at DATETIME NOT NULL,
|
|
115
|
+
FOREIGN KEY(person_id) REFERENCES people(id)
|
|
116
|
+
);
|
|
117
|
+
CREATE INDEX person_education_person_idx ON person_education(person_id);
|
|
118
|
+
|
|
119
|
+
CREATE TABLE skills(
|
|
120
|
+
id INTEGER PRIMARY KEY,
|
|
121
|
+
name TEXT NOT NULL CHECK (length(name) > 0),
|
|
122
|
+
created_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
123
|
+
updated_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
124
|
+
UNIQUE (name)
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
CREATE TABLE person_skill(
|
|
128
|
+
id INTEGER PRIMARY KEY,
|
|
129
|
+
person_id INTEGER NOT NULL,
|
|
130
|
+
skill_id INTEGER NOT NULL,
|
|
131
|
+
endorsements_count INTEGER CHECK (endorsements_count IS NULL OR typeof(endorsements_count) = 'integer' AND endorsements_count >= 0),
|
|
132
|
+
created_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
133
|
+
updated_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
134
|
+
sent_at_to_pas DATETIME,
|
|
135
|
+
actual_at DATETIME NOT NULL,
|
|
136
|
+
UNIQUE (person_id, skill_id),
|
|
137
|
+
FOREIGN KEY(person_id) REFERENCES people(id),
|
|
138
|
+
FOREIGN KEY(skill_id) REFERENCES skills(id)
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
CREATE TABLE person_email(
|
|
142
|
+
id INTEGER PRIMARY KEY,
|
|
143
|
+
person_id INTEGER NOT NULL,
|
|
144
|
+
email TEXT NOT NULL,
|
|
145
|
+
type TEXT NOT NULL CHECK (type IN ('personal', 'business')),
|
|
146
|
+
created_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
147
|
+
updated_at DATETIME DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%fZ', 'NOW')),
|
|
148
|
+
sent_at_to_pas DATETIME,
|
|
149
|
+
actual_at DATETIME NOT NULL,
|
|
150
|
+
UNIQUE (person_id, email),
|
|
151
|
+
FOREIGN KEY(person_id) REFERENCES people(id)
|
|
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
|
+
`);
|
|
194
|
+
// ── Mock Data (obviously synthetic, no real PII) ────────────────────
|
|
195
|
+
const NOW = "2025-01-15T12:00:00.000Z";
|
|
196
|
+
// Person 1: full profile with all fields populated
|
|
197
|
+
db.exec(`
|
|
198
|
+
INSERT INTO people (id, original_id, created_at, updated_at)
|
|
199
|
+
VALUES (1, 1, '${NOW}', '${NOW}');
|
|
200
|
+
|
|
201
|
+
INSERT INTO person_mini_profile
|
|
202
|
+
(person_id, first_name, first_name_uppercase, last_name, last_name_uppercase,
|
|
203
|
+
headline, headline_uppercase, avatar)
|
|
204
|
+
VALUES
|
|
205
|
+
(1, 'Ada', 'ADA', 'Lovelace', 'LOVELACE',
|
|
206
|
+
'Principal Analytical Engine Programmer',
|
|
207
|
+
'PRINCIPAL ANALYTICAL ENGINE PROGRAMMER',
|
|
208
|
+
'https://example.test/avatars/ada.jpg');
|
|
209
|
+
|
|
210
|
+
INSERT INTO person_external_ids
|
|
211
|
+
(person_id, external_id, external_id_uppercase, type_group, is_member_id)
|
|
212
|
+
VALUES
|
|
213
|
+
(1, 'ada-lovelace-test', 'ADA-LOVELACE-TEST', 'public', NULL),
|
|
214
|
+
(1, '100000001', '100000001', 'member', 1),
|
|
215
|
+
(1, 'h4sh-ada-001', 'H4SH-ADA-001', 'hash', NULL);
|
|
216
|
+
|
|
217
|
+
INSERT INTO person_current_position
|
|
218
|
+
(person_id, company, company_uppercase, position, position_uppercase)
|
|
219
|
+
VALUES
|
|
220
|
+
(1, 'Babbage Industries', 'BABBAGE INDUSTRIES',
|
|
221
|
+
'Lead Programmer', 'LEAD PROGRAMMER');
|
|
222
|
+
|
|
223
|
+
INSERT INTO person_positions
|
|
224
|
+
(person_id, title, company_name, company_id, start_year, start_month,
|
|
225
|
+
is_default, actual_at)
|
|
226
|
+
VALUES
|
|
227
|
+
(1, 'Lead Programmer', 'Babbage Industries', 'C001',
|
|
228
|
+
2020, 3, 1, '${NOW}');
|
|
229
|
+
|
|
230
|
+
INSERT INTO person_positions
|
|
231
|
+
(person_id, title, company_name, company_id, start_year, start_month,
|
|
232
|
+
end_year, end_month, actual_at)
|
|
233
|
+
VALUES
|
|
234
|
+
(1, 'Junior Analyst', 'Difference Engine Co', 'C002',
|
|
235
|
+
2015, 9, 2019, 12, '${NOW}');
|
|
236
|
+
|
|
237
|
+
INSERT INTO person_education
|
|
238
|
+
(person_id, school_name, degree_name, field_of_study,
|
|
239
|
+
start_year, end_year, actual_at)
|
|
240
|
+
VALUES
|
|
241
|
+
(1, 'University of Mathematica', 'BSc', 'Mathematics',
|
|
242
|
+
2011, 2015, '${NOW}');
|
|
243
|
+
|
|
244
|
+
INSERT INTO person_education
|
|
245
|
+
(person_id, school_name, degree_name, field_of_study,
|
|
246
|
+
start_year, end_year, actual_at)
|
|
247
|
+
VALUES
|
|
248
|
+
(1, 'Royal Polytechnic', 'MSc', 'Computational Logic',
|
|
249
|
+
2015, 2017, '${NOW}');
|
|
250
|
+
|
|
251
|
+
INSERT INTO skills (id, name) VALUES (1, 'Algorithm Design');
|
|
252
|
+
INSERT INTO skills (id, name) VALUES (2, 'Mechanical Computing');
|
|
253
|
+
INSERT INTO skills (id, name) VALUES (3, 'Technical Writing');
|
|
254
|
+
|
|
255
|
+
INSERT INTO person_skill (person_id, skill_id, endorsements_count, actual_at)
|
|
256
|
+
VALUES (1, 1, 42, '${NOW}');
|
|
257
|
+
INSERT INTO person_skill (person_id, skill_id, endorsements_count, actual_at)
|
|
258
|
+
VALUES (1, 2, 17, '${NOW}');
|
|
259
|
+
|
|
260
|
+
INSERT INTO person_email (person_id, email, type, actual_at)
|
|
261
|
+
VALUES (1, 'ada@example.test', 'business', '${NOW}');
|
|
262
|
+
`);
|
|
263
|
+
// Person 2: minimal profile (only required fields)
|
|
264
|
+
db.exec(`
|
|
265
|
+
INSERT INTO people (id, original_id, created_at, updated_at)
|
|
266
|
+
VALUES (2, 2, '${NOW}', '${NOW}');
|
|
267
|
+
|
|
268
|
+
INSERT INTO person_mini_profile
|
|
269
|
+
(person_id, first_name, first_name_uppercase)
|
|
270
|
+
VALUES (2, 'Charlie', 'CHARLIE');
|
|
271
|
+
|
|
272
|
+
INSERT INTO person_external_ids
|
|
273
|
+
(person_id, external_id, external_id_uppercase, type_group)
|
|
274
|
+
VALUES (2, 'charlie-test', 'CHARLIE-TEST', 'public');
|
|
275
|
+
`);
|
|
276
|
+
// Person 3: another full profile for variety
|
|
277
|
+
db.exec(`
|
|
278
|
+
INSERT INTO people (id, original_id, created_at, updated_at)
|
|
279
|
+
VALUES (3, 3, '${NOW}', '${NOW}');
|
|
280
|
+
|
|
281
|
+
INSERT INTO person_mini_profile
|
|
282
|
+
(person_id, first_name, first_name_uppercase, last_name, last_name_uppercase,
|
|
283
|
+
headline, headline_uppercase)
|
|
284
|
+
VALUES
|
|
285
|
+
(3, 'Grace', 'GRACE', 'Hopper', 'HOPPER',
|
|
286
|
+
'Compiler Pioneer at COBOL Systems',
|
|
287
|
+
'COMPILER PIONEER AT COBOL SYSTEMS');
|
|
288
|
+
|
|
289
|
+
INSERT INTO person_external_ids
|
|
290
|
+
(person_id, external_id, external_id_uppercase, type_group, is_member_id)
|
|
291
|
+
VALUES
|
|
292
|
+
(3, 'grace-hopper-test', 'GRACE-HOPPER-TEST', 'public', NULL),
|
|
293
|
+
(3, '100000003', '100000003', 'member', 1);
|
|
294
|
+
|
|
295
|
+
INSERT INTO person_current_position
|
|
296
|
+
(person_id, company, company_uppercase, position, position_uppercase)
|
|
297
|
+
VALUES
|
|
298
|
+
(3, 'COBOL Systems Inc', 'COBOL SYSTEMS INC',
|
|
299
|
+
'Distinguished Engineer', 'DISTINGUISHED ENGINEER');
|
|
300
|
+
|
|
301
|
+
INSERT INTO person_positions
|
|
302
|
+
(person_id, title, company_name, start_year, start_month,
|
|
303
|
+
is_default, actual_at)
|
|
304
|
+
VALUES
|
|
305
|
+
(3, 'Distinguished Engineer', 'COBOL Systems Inc',
|
|
306
|
+
2018, 1, 1, '${NOW}');
|
|
307
|
+
|
|
308
|
+
INSERT INTO person_education
|
|
309
|
+
(person_id, school_name, degree_name, field_of_study,
|
|
310
|
+
start_year, end_year, actual_at)
|
|
311
|
+
VALUES
|
|
312
|
+
(3, 'Vassar College', 'BA', 'Mathematics and Physics',
|
|
313
|
+
1924, 1928, '${NOW}');
|
|
314
|
+
|
|
315
|
+
INSERT INTO person_skill (person_id, skill_id, endorsements_count, actual_at)
|
|
316
|
+
VALUES (3, 3, 99, '${NOW}');
|
|
317
|
+
|
|
318
|
+
INSERT INTO person_email (person_id, email, type, actual_at)
|
|
319
|
+
VALUES (3, 'grace@example.test', 'business', '${NOW}');
|
|
320
|
+
INSERT INTO person_email (person_id, email, type, actual_at)
|
|
321
|
+
VALUES (3, 'grace.personal@example.test', 'personal', '${NOW}');
|
|
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
|
+
`);
|
|
741
|
+
// ── Write to disk ───────────────────────────────────────────────────
|
|
742
|
+
await backup(db, FIXTURE_PATH);
|
|
743
|
+
db.close();
|
|
744
|
+
console.log(`Fixture written to ${FIXTURE_PATH}`);
|
|
745
|
+
//# sourceMappingURL=create-fixture.js.map
|