@kelpie/server 0.5.2 → 0.7.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 +5 -2
- package/dist/app.d.ts +13 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +9 -0
- package/dist/app.js.map +1 -1
- package/dist/boot.d.ts +42 -0
- package/dist/boot.d.ts.map +1 -0
- package/dist/boot.js +57 -0
- package/dist/boot.js.map +1 -0
- package/dist/index.d.ts +20 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -4
- package/dist/index.js.map +1 -1
- package/dist/lib/actor.d.ts +9 -1
- package/dist/lib/actor.d.ts.map +1 -1
- package/dist/lib/actor.js +13 -0
- package/dist/lib/actor.js.map +1 -1
- package/dist/lib/config.d.ts +51 -6
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +11 -5
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/email.d.ts +15 -63
- package/dist/lib/email.d.ts.map +1 -1
- package/dist/lib/email.js +13 -65
- package/dist/lib/email.js.map +1 -1
- package/dist/lib/fromEnv.d.ts +60 -0
- package/dist/lib/fromEnv.d.ts.map +1 -0
- package/dist/lib/fromEnv.js +94 -0
- package/dist/lib/fromEnv.js.map +1 -0
- package/dist/lib/ids.d.ts +6 -0
- package/dist/lib/ids.d.ts.map +1 -1
- package/dist/lib/ids.js +6 -0
- package/dist/lib/ids.js.map +1 -1
- package/dist/lib/kelpieConfigFile.d.ts +129 -0
- package/dist/lib/kelpieConfigFile.d.ts.map +1 -0
- package/dist/lib/kelpieConfigFile.js +112 -0
- package/dist/lib/kelpieConfigFile.js.map +1 -0
- package/dist/lib/logger.d.ts +38 -7
- package/dist/lib/logger.d.ts.map +1 -1
- package/dist/lib/logger.js +58 -20
- package/dist/lib/logger.js.map +1 -1
- package/dist/modules/agent-tasks/index.d.ts.map +1 -1
- package/dist/modules/agent-tasks/index.js +4 -1
- package/dist/modules/agent-tasks/index.js.map +1 -1
- package/dist/modules/agent-tasks/prompt.d.ts +36 -6
- package/dist/modules/agent-tasks/prompt.d.ts.map +1 -1
- package/dist/modules/agent-tasks/prompt.js +33 -4
- package/dist/modules/agent-tasks/prompt.js.map +1 -1
- package/dist/modules/agent-tasks/service.d.ts.map +1 -1
- package/dist/modules/agent-tasks/service.js +3 -2
- package/dist/modules/agent-tasks/service.js.map +1 -1
- package/dist/modules/agent-tasks/wire.d.ts +11 -0
- package/dist/modules/agent-tasks/wire.d.ts.map +1 -1
- package/dist/modules/agent-tasks/wire.js +1 -0
- package/dist/modules/agent-tasks/wire.js.map +1 -1
- package/dist/modules/auth/index.d.ts.map +1 -1
- package/dist/modules/auth/index.js +8 -7
- package/dist/modules/auth/index.js.map +1 -1
- package/dist/modules/companies/events.d.ts +22 -0
- package/dist/modules/companies/events.d.ts.map +1 -0
- package/dist/modules/companies/events.js +8 -0
- package/dist/modules/companies/events.js.map +1 -0
- package/dist/modules/companies/index.d.ts.map +1 -1
- package/dist/modules/companies/index.js +2 -0
- package/dist/modules/companies/index.js.map +1 -1
- package/dist/modules/companies/service.d.ts +1 -0
- package/dist/modules/companies/service.d.ts.map +1 -1
- package/dist/modules/companies/service.js +8 -11
- package/dist/modules/companies/service.js.map +1 -1
- package/dist/modules/core.d.ts.map +1 -1
- package/dist/modules/core.js +4 -0
- package/dist/modules/core.js.map +1 -1
- package/dist/modules/deals/events.d.ts +31 -0
- package/dist/modules/deals/events.d.ts.map +1 -0
- package/dist/modules/deals/events.js +12 -0
- package/dist/modules/deals/events.js.map +1 -0
- package/dist/modules/deals/index.d.ts.map +1 -1
- package/dist/modules/deals/index.js +2 -0
- package/dist/modules/deals/index.js.map +1 -1
- package/dist/modules/deals/service.d.ts +1 -0
- package/dist/modules/deals/service.d.ts.map +1 -1
- package/dist/modules/deals/service.js +9 -18
- package/dist/modules/deals/service.js.map +1 -1
- package/dist/modules/decisions/events.d.ts +21 -0
- package/dist/modules/decisions/events.d.ts.map +1 -0
- package/dist/modules/decisions/events.js +11 -0
- package/dist/modules/decisions/events.js.map +1 -0
- package/dist/modules/decisions/index.d.ts.map +1 -1
- package/dist/modules/decisions/index.js +2 -0
- package/dist/modules/decisions/index.js.map +1 -1
- package/dist/modules/decisions/service.d.ts +1 -0
- package/dist/modules/decisions/service.d.ts.map +1 -1
- package/dist/modules/decisions/service.js +4 -7
- package/dist/modules/decisions/service.js.map +1 -1
- package/dist/modules/eventCatalogs.d.ts +35 -0
- package/dist/modules/eventCatalogs.d.ts.map +1 -0
- package/dist/modules/eventCatalogs.js +35 -0
- package/dist/modules/eventCatalogs.js.map +1 -0
- package/dist/modules/forms/events.d.ts +37 -0
- package/dist/modules/forms/events.d.ts.map +1 -0
- package/dist/modules/forms/events.js +15 -0
- package/dist/modules/forms/events.js.map +1 -0
- package/dist/modules/forms/index.d.ts.map +1 -1
- package/dist/modules/forms/index.js +2 -0
- package/dist/modules/forms/index.js.map +1 -1
- package/dist/modules/forms/service.d.ts +1 -0
- package/dist/modules/forms/service.d.ts.map +1 -1
- package/dist/modules/forms/service.js +8 -11
- package/dist/modules/forms/service.js.map +1 -1
- package/dist/modules/forms/submission.d.ts +5 -0
- package/dist/modules/forms/submission.d.ts.map +1 -1
- package/dist/modules/forms/submission.js +54 -28
- package/dist/modules/forms/submission.js.map +1 -1
- package/dist/modules/handbook/events.d.ts +28 -0
- package/dist/modules/handbook/events.d.ts.map +1 -0
- package/dist/modules/handbook/events.js +14 -0
- package/dist/modules/handbook/events.js.map +1 -0
- package/dist/modules/handbook/index.d.ts.map +1 -1
- package/dist/modules/handbook/index.js +2 -0
- package/dist/modules/handbook/index.js.map +1 -1
- package/dist/modules/handbook/service.d.ts +1 -0
- package/dist/modules/handbook/service.d.ts.map +1 -1
- package/dist/modules/handbook/service.js +8 -15
- package/dist/modules/handbook/service.js.map +1 -1
- package/dist/modules/hiring/candidates.d.ts +1 -0
- package/dist/modules/hiring/candidates.d.ts.map +1 -1
- package/dist/modules/hiring/candidates.js +8 -11
- package/dist/modules/hiring/candidates.js.map +1 -1
- package/dist/modules/hiring/events.d.ts +35 -0
- package/dist/modules/hiring/events.d.ts.map +1 -0
- package/dist/modules/hiring/events.js +11 -0
- package/dist/modules/hiring/events.js.map +1 -0
- package/dist/modules/hiring/index.d.ts.map +1 -1
- package/dist/modules/hiring/index.js +2 -0
- package/dist/modules/hiring/index.js.map +1 -1
- package/dist/modules/hiring/roles.d.ts +1 -0
- package/dist/modules/hiring/roles.d.ts.map +1 -1
- package/dist/modules/hiring/roles.js +8 -11
- package/dist/modules/hiring/roles.js.map +1 -1
- package/dist/modules/import-export/drafts.d.ts +9 -0
- package/dist/modules/import-export/drafts.d.ts.map +1 -1
- package/dist/modules/import-export/drafts.js +25 -0
- package/dist/modules/import-export/drafts.js.map +1 -1
- package/dist/modules/import-export/events.d.ts +22 -0
- package/dist/modules/import-export/events.d.ts.map +1 -0
- package/dist/modules/import-export/events.js +12 -0
- package/dist/modules/import-export/events.js.map +1 -0
- package/dist/modules/import-export/exportRows.d.ts +9 -0
- package/dist/modules/import-export/exportRows.d.ts.map +1 -1
- package/dist/modules/import-export/exportRows.js +10 -1
- package/dist/modules/import-export/exportRows.js.map +1 -1
- package/dist/modules/import-export/index.d.ts.map +1 -1
- package/dist/modules/import-export/index.js +2 -0
- package/dist/modules/import-export/index.js.map +1 -1
- package/dist/modules/import-export/plan.d.ts +23 -1
- package/dist/modules/import-export/plan.d.ts.map +1 -1
- package/dist/modules/import-export/plan.js +62 -3
- package/dist/modules/import-export/plan.js.map +1 -1
- package/dist/modules/import-export/presets.d.ts.map +1 -1
- package/dist/modules/import-export/presets.js +25 -0
- package/dist/modules/import-export/presets.js.map +1 -1
- package/dist/modules/import-export/repository.d.ts +17 -0
- package/dist/modules/import-export/repository.d.ts.map +1 -1
- package/dist/modules/import-export/repository.js +21 -1
- package/dist/modules/import-export/repository.js.map +1 -1
- package/dist/modules/import-export/routes.d.ts.map +1 -1
- package/dist/modules/import-export/routes.js +5 -1
- package/dist/modules/import-export/routes.js.map +1 -1
- package/dist/modules/import-export/schema.d.ts +55 -0
- package/dist/modules/import-export/schema.d.ts.map +1 -1
- package/dist/modules/import-export/schema.js +13 -1
- package/dist/modules/import-export/schema.js.map +1 -1
- package/dist/modules/import-export/service.d.ts +9 -1
- package/dist/modules/import-export/service.d.ts.map +1 -1
- package/dist/modules/import-export/service.js +104 -17
- package/dist/modules/import-export/service.js.map +1 -1
- package/dist/modules/import-export/tools.d.ts.map +1 -1
- package/dist/modules/import-export/tools.js +7 -1
- package/dist/modules/import-export/tools.js.map +1 -1
- package/dist/modules/import-export/writes.d.ts +16 -0
- package/dist/modules/import-export/writes.d.ts.map +1 -1
- package/dist/modules/import-export/writes.js +77 -2
- package/dist/modules/import-export/writes.js.map +1 -1
- package/dist/modules/notes/events.d.ts +22 -0
- package/dist/modules/notes/events.d.ts.map +1 -0
- package/dist/modules/notes/events.js +12 -0
- package/dist/modules/notes/events.js.map +1 -0
- package/dist/modules/notes/index.d.ts.map +1 -1
- package/dist/modules/notes/index.js +2 -0
- package/dist/modules/notes/index.js.map +1 -1
- package/dist/modules/notes/service.d.ts +1 -0
- package/dist/modules/notes/service.d.ts.map +1 -1
- package/dist/modules/notes/service.js +4 -7
- package/dist/modules/notes/service.js.map +1 -1
- package/dist/modules/opportunities/events.d.ts +31 -0
- package/dist/modules/opportunities/events.d.ts.map +1 -0
- package/dist/modules/opportunities/events.js +12 -0
- package/dist/modules/opportunities/events.js.map +1 -0
- package/dist/modules/opportunities/index.d.ts.map +1 -1
- package/dist/modules/opportunities/index.js +2 -0
- package/dist/modules/opportunities/index.js.map +1 -1
- package/dist/modules/opportunities/service.d.ts +1 -0
- package/dist/modules/opportunities/service.d.ts.map +1 -1
- package/dist/modules/opportunities/service.js +9 -18
- package/dist/modules/opportunities/service.js.map +1 -1
- package/dist/modules/partnerships/events.d.ts +31 -0
- package/dist/modules/partnerships/events.d.ts.map +1 -0
- package/dist/modules/partnerships/events.js +12 -0
- package/dist/modules/partnerships/events.js.map +1 -0
- package/dist/modules/partnerships/index.d.ts.map +1 -1
- package/dist/modules/partnerships/index.js +2 -0
- package/dist/modules/partnerships/index.js.map +1 -1
- package/dist/modules/partnerships/service.d.ts +1 -0
- package/dist/modules/partnerships/service.d.ts.map +1 -1
- package/dist/modules/partnerships/service.js +9 -18
- package/dist/modules/partnerships/service.js.map +1 -1
- package/dist/modules/people/events.d.ts +28 -0
- package/dist/modules/people/events.d.ts.map +1 -0
- package/dist/modules/people/events.js +18 -0
- package/dist/modules/people/events.js.map +1 -0
- package/dist/modules/people/index.d.ts.map +1 -1
- package/dist/modules/people/index.js +2 -0
- package/dist/modules/people/index.js.map +1 -1
- package/dist/modules/people/service.d.ts +1 -0
- package/dist/modules/people/service.d.ts.map +1 -1
- package/dist/modules/people/service.js +8 -11
- package/dist/modules/people/service.js.map +1 -1
- package/dist/modules/pipelines/service.d.ts +4 -0
- package/dist/modules/pipelines/service.d.ts.map +1 -1
- package/dist/modules/pipelines/service.js +31 -8
- package/dist/modules/pipelines/service.js.map +1 -1
- package/dist/modules/plans/events.d.ts +21 -0
- package/dist/modules/plans/events.d.ts.map +1 -0
- package/dist/modules/plans/events.js +11 -0
- package/dist/modules/plans/events.js.map +1 -0
- package/dist/modules/plans/index.d.ts.map +1 -1
- package/dist/modules/plans/index.js +2 -0
- package/dist/modules/plans/index.js.map +1 -1
- package/dist/modules/plans/service.d.ts +1 -0
- package/dist/modules/plans/service.d.ts.map +1 -1
- package/dist/modules/plans/service.js +6 -14
- package/dist/modules/plans/service.js.map +1 -1
- package/dist/modules/positions/events.d.ts +22 -0
- package/dist/modules/positions/events.d.ts.map +1 -0
- package/dist/modules/positions/events.js +8 -0
- package/dist/modules/positions/events.js.map +1 -0
- package/dist/modules/positions/index.d.ts.map +1 -1
- package/dist/modules/positions/index.js +2 -0
- package/dist/modules/positions/index.js.map +1 -1
- package/dist/modules/positions/service.d.ts +1 -0
- package/dist/modules/positions/service.d.ts.map +1 -1
- package/dist/modules/positions/service.js +8 -11
- package/dist/modules/positions/service.js.map +1 -1
- package/dist/modules/raises/events.d.ts +31 -0
- package/dist/modules/raises/events.d.ts.map +1 -0
- package/dist/modules/raises/events.js +12 -0
- package/dist/modules/raises/events.js.map +1 -0
- package/dist/modules/raises/index.d.ts.map +1 -1
- package/dist/modules/raises/index.js +2 -0
- package/dist/modules/raises/index.js.map +1 -1
- package/dist/modules/raises/service.d.ts +1 -0
- package/dist/modules/raises/service.d.ts.map +1 -1
- package/dist/modules/raises/service.js +9 -18
- package/dist/modules/raises/service.js.map +1 -1
- package/dist/modules/reseal.d.ts +55 -0
- package/dist/modules/reseal.d.ts.map +1 -1
- package/dist/modules/reseal.js +90 -1
- package/dist/modules/reseal.js.map +1 -1
- package/dist/modules/smtp-email/index.d.ts +69 -0
- package/dist/modules/smtp-email/index.d.ts.map +1 -0
- package/dist/modules/smtp-email/index.js +82 -0
- package/dist/modules/smtp-email/index.js.map +1 -0
- package/dist/modules/webhooks/index.d.ts.map +1 -1
- package/dist/modules/webhooks/index.js +5 -1
- package/dist/modules/webhooks/index.js.map +1 -1
- package/dist/modules/webhooks/payloads.d.ts +22 -7
- package/dist/modules/webhooks/payloads.d.ts.map +1 -1
- package/dist/modules/webhooks/payloads.js +63 -44
- package/dist/modules/webhooks/payloads.js.map +1 -1
- package/dist/modules/workspace/events.d.ts +52 -0
- package/dist/modules/workspace/events.d.ts.map +1 -0
- package/dist/modules/workspace/events.js +16 -0
- package/dist/modules/workspace/events.js.map +1 -0
- package/dist/modules/workspace/index.d.ts.map +1 -1
- package/dist/modules/workspace/index.js +6 -2
- package/dist/modules/workspace/index.js.map +1 -1
- package/dist/modules/workspace/service.d.ts +1 -0
- package/dist/modules/workspace/service.d.ts.map +1 -1
- package/dist/modules/workspace/service.js +13 -15
- package/dist/modules/workspace/service.js.map +1 -1
- package/dist/runtime/events.d.ts +86 -108
- package/dist/runtime/events.d.ts.map +1 -1
- package/dist/runtime/events.js +123 -52
- package/dist/runtime/events.js.map +1 -1
- package/dist/runtime/module.d.ts +54 -2
- package/dist/runtime/module.d.ts.map +1 -1
- package/dist/runtime/registry.d.ts +23 -0
- package/dist/runtime/registry.d.ts.map +1 -1
- package/dist/runtime/registry.js +102 -2
- package/dist/runtime/registry.js.map +1 -1
- package/dist/runtime/transaction.d.ts +29 -4
- package/dist/runtime/transaction.d.ts.map +1 -1
- package/dist/runtime/transaction.js +48 -7
- package/dist/runtime/transaction.js.map +1 -1
- package/dist/testing/app.d.ts +5 -1
- package/dist/testing/app.d.ts.map +1 -1
- package/dist/testing/app.js +13 -3
- package/dist/testing/app.js.map +1 -1
- package/dist/testing/database.d.ts.map +1 -1
- package/dist/testing/database.js +6 -3
- package/dist/testing/database.js.map +1 -1
- package/dist/testing/services.d.ts +21 -1
- package/dist/testing/services.d.ts.map +1 -1
- package/dist/testing/services.js +20 -5
- package/dist/testing/services.js.map +1 -1
- package/migrations/0019_sharp_red_skull.sql +4 -0
- package/migrations/0020_early_nemesis.sql +2 -0
- package/migrations/meta/0019_snapshot.json +5138 -0
- package/migrations/meta/0020_snapshot.json +5138 -0
- package/migrations/meta/_journal.json +14 -0
- package/package.json +5 -2
- package/src/app.ts +26 -0
- package/src/boot.ts +89 -0
- package/src/index.ts +52 -9
- package/src/lib/actor.ts +15 -1
- package/src/lib/config.ts +65 -7
- package/src/lib/email.ts +22 -92
- package/src/lib/fromEnv.ts +143 -0
- package/src/lib/ids.ts +6 -0
- package/src/lib/kelpieConfigFile.ts +291 -0
- package/src/lib/logger.ts +92 -34
- package/src/modules/agent-tasks/index.ts +4 -1
- package/src/modules/agent-tasks/prompt.ts +57 -9
- package/src/modules/agent-tasks/service.ts +3 -2
- package/src/modules/agent-tasks/wire.ts +12 -0
- package/src/modules/auth/index.ts +11 -9
- package/src/modules/companies/events.ts +25 -0
- package/src/modules/companies/index.ts +2 -0
- package/src/modules/companies/service.ts +8 -11
- package/src/modules/core.ts +4 -0
- package/src/modules/deals/events.ts +34 -0
- package/src/modules/deals/index.ts +2 -0
- package/src/modules/deals/service.ts +17 -18
- package/src/modules/decisions/events.ts +24 -0
- package/src/modules/decisions/index.ts +2 -0
- package/src/modules/decisions/service.ts +8 -7
- package/src/modules/eventCatalogs.ts +35 -0
- package/src/modules/forms/events.ts +37 -0
- package/src/modules/forms/index.ts +2 -0
- package/src/modules/forms/service.ts +12 -11
- package/src/modules/forms/submission.ts +80 -29
- package/src/modules/handbook/events.ts +31 -0
- package/src/modules/handbook/index.ts +2 -0
- package/src/modules/handbook/service.ts +8 -15
- package/src/modules/hiring/candidates.ts +8 -11
- package/src/modules/hiring/events.ts +36 -0
- package/src/modules/hiring/index.ts +2 -0
- package/src/modules/hiring/roles.ts +8 -11
- package/src/modules/import-export/drafts.ts +27 -0
- package/src/modules/import-export/events.ts +25 -0
- package/src/modules/import-export/exportRows.ts +10 -1
- package/src/modules/import-export/index.ts +2 -0
- package/src/modules/import-export/plan.ts +107 -5
- package/src/modules/import-export/presets.ts +25 -0
- package/src/modules/import-export/repository.ts +35 -1
- package/src/modules/import-export/routes.ts +5 -0
- package/src/modules/import-export/schema.ts +13 -0
- package/src/modules/import-export/service.ts +153 -19
- package/src/modules/import-export/tools.ts +9 -0
- package/src/modules/import-export/writes.ts +116 -3
- package/src/modules/notes/events.ts +25 -0
- package/src/modules/notes/index.ts +2 -0
- package/src/modules/notes/service.ts +8 -7
- package/src/modules/opportunities/events.ts +34 -0
- package/src/modules/opportunities/index.ts +2 -0
- package/src/modules/opportunities/service.ts +17 -18
- package/src/modules/partnerships/events.ts +34 -0
- package/src/modules/partnerships/index.ts +2 -0
- package/src/modules/partnerships/service.ts +17 -18
- package/src/modules/people/events.ts +36 -0
- package/src/modules/people/index.ts +2 -0
- package/src/modules/people/service.ts +97 -87
- package/src/modules/pipelines/service.ts +47 -8
- package/src/modules/plans/events.ts +24 -0
- package/src/modules/plans/index.ts +2 -0
- package/src/modules/plans/service.ts +14 -14
- package/src/modules/positions/events.ts +25 -0
- package/src/modules/positions/index.ts +2 -0
- package/src/modules/positions/service.ts +8 -11
- package/src/modules/raises/events.ts +34 -0
- package/src/modules/raises/index.ts +2 -0
- package/src/modules/raises/service.ts +17 -18
- package/src/modules/reseal.ts +144 -1
- package/src/modules/smtp-email/index.ts +119 -0
- package/src/modules/webhooks/index.ts +5 -1
- package/src/modules/webhooks/payloads.ts +94 -48
- package/src/modules/workspace/events.ts +46 -0
- package/src/modules/workspace/index.ts +6 -2
- package/src/modules/workspace/service.ts +37 -15
- package/src/runtime/events.ts +268 -107
- package/src/runtime/module.ts +55 -2
- package/src/runtime/registry.ts +169 -1
- package/src/runtime/transaction.ts +94 -17
- package/src/testing/app.ts +18 -4
- package/src/testing/database.ts +6 -3
- package/src/testing/services.ts +34 -5
|
@@ -7,14 +7,19 @@ import { moduleCapabilityName } from '../../runtime/moduleConfig.ts'
|
|
|
7
7
|
import type { BufferedEvents, Transaction, TransactionScope } from '../../runtime/transaction.ts'
|
|
8
8
|
import type { ActivityRecorder, SystemActor } from '../activities/recorder.ts'
|
|
9
9
|
import { describeCreationVia, describeFormSubmission } from '../activities/wording.ts'
|
|
10
|
+
import '../companies/events.ts'
|
|
10
11
|
import * as companyRepository from '../companies/repository.ts'
|
|
11
12
|
import type { CompanyRecord } from '../companies/repository.ts'
|
|
12
13
|
import * as dealRepository from '../deals/repository.ts'
|
|
14
|
+
import '../deals/events.ts'
|
|
15
|
+
import '../people/events.ts'
|
|
13
16
|
import * as peopleRepository from '../people/repository.ts'
|
|
14
17
|
import type { PersonRecord } from '../people/repository.ts'
|
|
15
18
|
import * as pipelineRepository from '../pipelines/repository.ts'
|
|
19
|
+
import '../positions/events.ts'
|
|
16
20
|
import * as positionRepository from '../positions/repository.ts'
|
|
17
21
|
import * as workspaceRepository from '../workspace/repository.ts'
|
|
22
|
+
import './events.ts'
|
|
18
23
|
import {
|
|
19
24
|
DEAL_CLOSE_HORIZON_DAYS,
|
|
20
25
|
companyNameFrom,
|
|
@@ -148,34 +153,80 @@ function emitRecordEvents(
|
|
|
148
153
|
workspaceId: string,
|
|
149
154
|
touched: TouchedRecords,
|
|
150
155
|
): void {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
156
|
+
if (touched.person !== undefined) {
|
|
157
|
+
emitUpsertEvent(events, 'person', touched.person)
|
|
158
|
+
}
|
|
159
|
+
if (touched.company !== undefined) {
|
|
160
|
+
emitUpsertEvent(events, 'company', touched.company)
|
|
161
|
+
}
|
|
162
|
+
if (touched.position !== undefined) {
|
|
163
|
+
emitUpsertEvent(events, 'position', touched.position)
|
|
164
|
+
}
|
|
161
165
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
+
if (touched.dealId !== null) {
|
|
167
|
+
events.emit('deals.deal.created', { type: 'deal', id: touched.dealId }, {})
|
|
168
|
+
}
|
|
169
|
+
// workspaceId is used by the transaction scope's envelope stamping; the
|
|
170
|
+
// parameter stays on the signature so future call sites keep the same shape.
|
|
171
|
+
void workspaceId
|
|
172
|
+
}
|
|
166
173
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
+
/**
|
|
175
|
+
* Dispatches the created/updated event owned by the record's module for one
|
|
176
|
+
* upsert. Split from the loop above so TypeScript can correlate the object
|
|
177
|
+
* type with its typed event name at each call site.
|
|
178
|
+
*/
|
|
179
|
+
function emitUpsertEvent(
|
|
180
|
+
events: BufferedEvents,
|
|
181
|
+
objectType: 'person' | 'company' | 'position',
|
|
182
|
+
outcome: { readonly created: boolean; readonly record: { readonly id: string }; readonly filled: readonly string[] },
|
|
183
|
+
): void {
|
|
184
|
+
if (outcome.created) {
|
|
185
|
+
switch (objectType) {
|
|
186
|
+
case 'person':
|
|
187
|
+
events.emit('people.person.created', { type: 'person', id: outcome.record.id }, {})
|
|
188
|
+
return
|
|
189
|
+
case 'company':
|
|
190
|
+
events.emit('companies.company.created', { type: 'company', id: outcome.record.id }, {})
|
|
191
|
+
return
|
|
192
|
+
case 'position':
|
|
193
|
+
events.emit(
|
|
194
|
+
'positions.position.created',
|
|
195
|
+
{ type: 'position', id: outcome.record.id },
|
|
196
|
+
{},
|
|
197
|
+
)
|
|
198
|
+
return
|
|
174
199
|
}
|
|
175
200
|
}
|
|
176
201
|
|
|
177
|
-
if (
|
|
178
|
-
|
|
202
|
+
if (outcome.filled.length === 0) {
|
|
203
|
+
return
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
const changed = outcome.filled
|
|
207
|
+
|
|
208
|
+
switch (objectType) {
|
|
209
|
+
case 'person':
|
|
210
|
+
events.emit(
|
|
211
|
+
'people.person.updated',
|
|
212
|
+
{ type: 'person', id: outcome.record.id },
|
|
213
|
+
{ changed },
|
|
214
|
+
)
|
|
215
|
+
return
|
|
216
|
+
case 'company':
|
|
217
|
+
events.emit(
|
|
218
|
+
'companies.company.updated',
|
|
219
|
+
{ type: 'company', id: outcome.record.id },
|
|
220
|
+
{ changed },
|
|
221
|
+
)
|
|
222
|
+
return
|
|
223
|
+
case 'position':
|
|
224
|
+
events.emit(
|
|
225
|
+
'positions.position.updated',
|
|
226
|
+
{ type: 'position', id: outcome.record.id },
|
|
227
|
+
{ changed },
|
|
228
|
+
)
|
|
229
|
+
return
|
|
179
230
|
}
|
|
180
231
|
}
|
|
181
232
|
|
|
@@ -484,11 +535,11 @@ export function createFormSubmitService(dependencies: SubmissionDependencies): F
|
|
|
484
535
|
}
|
|
485
536
|
|
|
486
537
|
emitRecordEvents(events, workspaceId, { person, company, position, dealId })
|
|
487
|
-
events.emit(
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
submissionId: submission.id,
|
|
491
|
-
|
|
538
|
+
events.emit(
|
|
539
|
+
'forms.submission.submitted',
|
|
540
|
+
{ type: 'submission', id: submission.id },
|
|
541
|
+
{ formId: form.id, submissionId: submission.id },
|
|
542
|
+
)
|
|
492
543
|
|
|
493
544
|
return {
|
|
494
545
|
submissionId: submission.id,
|
|
@@ -500,7 +551,7 @@ export function createFormSubmitService(dependencies: SubmissionDependencies): F
|
|
|
500
551
|
submittedAt: submission.submittedAt,
|
|
501
552
|
thankYouMessage: form.thankYouMessage,
|
|
502
553
|
}
|
|
503
|
-
})
|
|
554
|
+
}, { workspaceId })
|
|
504
555
|
},
|
|
505
556
|
}
|
|
506
557
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
import type { ModuleEventCatalog } from '../../runtime/module.ts'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Domain events published by the handbook module.
|
|
7
|
+
*
|
|
8
|
+
* Handbook pages are content objects, not CRM records — the target type is
|
|
9
|
+
* `handbook_page`, and the webhooks bridge does not (yet) deliver these to
|
|
10
|
+
* subscribers. They still fire on the bus for in-process consumers.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export const handbookEvents = {
|
|
14
|
+
'handbook.page.created': z.object({}).strict(),
|
|
15
|
+
'handbook.page.updated': z.object({ changed: z.array(z.string()).readonly() }),
|
|
16
|
+
'handbook.page.deleted': z.object({}).strict(),
|
|
17
|
+
} satisfies ModuleEventCatalog
|
|
18
|
+
|
|
19
|
+
export type HandbookPageCreatedData = Record<string, never>
|
|
20
|
+
export interface HandbookPageUpdatedData {
|
|
21
|
+
readonly changed: readonly string[]
|
|
22
|
+
}
|
|
23
|
+
export type HandbookPageDeletedData = Record<string, never>
|
|
24
|
+
|
|
25
|
+
declare module '../../runtime/events.ts' {
|
|
26
|
+
interface KelpieEventMap {
|
|
27
|
+
'handbook.page.created': HandbookPageCreatedData
|
|
28
|
+
'handbook.page.updated': HandbookPageUpdatedData
|
|
29
|
+
'handbook.page.deleted': HandbookPageDeletedData
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { KelpieModule } from '../../runtime/module.ts'
|
|
2
|
+
import { handbookEvents } from './events.ts'
|
|
2
3
|
import { mountHandbookRoutes } from './routes.ts'
|
|
3
4
|
import * as schema from './schema.ts'
|
|
4
5
|
import { createHandbookService } from './service.ts'
|
|
@@ -20,6 +21,7 @@ export function createHandbookModule(migrationsDirectory: string): KelpieModule
|
|
|
20
21
|
return {
|
|
21
22
|
id: 'handbook',
|
|
22
23
|
requires: ['workspace'],
|
|
24
|
+
events: handbookEvents,
|
|
23
25
|
|
|
24
26
|
register(context) {
|
|
25
27
|
const service = createHandbookService({
|
|
@@ -6,8 +6,10 @@ import type { IdFactory } from '../../lib/ids.ts'
|
|
|
6
6
|
import { mapPage, readListWindow, toPage } from '../../lib/pagination.ts'
|
|
7
7
|
import type { ListQueryParameters, Page } from '../../lib/pagination.ts'
|
|
8
8
|
import type { Transaction, TransactionScope } from '../../runtime/transaction.ts'
|
|
9
|
+
import { toEventActor } from '../../lib/actor.ts'
|
|
9
10
|
import type { Actor } from '../auth/actor.ts'
|
|
10
11
|
import { actorMemberId, requireWorkspaceId } from '../auth/actor.ts'
|
|
12
|
+
import './events.ts'
|
|
11
13
|
import * as repository from './repository.ts'
|
|
12
14
|
import { DEFAULT_HANDBOOK_PAGE_SORT, HANDBOOK_PAGE_SORTS } from './repository.ts'
|
|
13
15
|
import type { HandbookPageFilters, HandbookPageRecord } from './repository.ts'
|
|
@@ -292,11 +294,7 @@ export function createHandbookService(dependencies: HandbookDependencies): Handb
|
|
|
292
294
|
updatedBy: actorMemberId(actor),
|
|
293
295
|
})
|
|
294
296
|
|
|
295
|
-
events.emit('
|
|
296
|
-
workspaceId,
|
|
297
|
-
objectType: 'handbook_page',
|
|
298
|
-
recordId: id,
|
|
299
|
-
})
|
|
297
|
+
events.emit('handbook.page.created', { type: 'handbook_page', id }, {})
|
|
300
298
|
|
|
301
299
|
return toView(created)
|
|
302
300
|
} catch (error: unknown) {
|
|
@@ -308,7 +306,7 @@ export function createHandbookService(dependencies: HandbookDependencies): Handb
|
|
|
308
306
|
|
|
309
307
|
throw error
|
|
310
308
|
}
|
|
311
|
-
})
|
|
309
|
+
}, { workspaceId, actor: toEventActor(actor) })
|
|
312
310
|
},
|
|
313
311
|
|
|
314
312
|
async update(actor, id, changes) {
|
|
@@ -346,16 +344,11 @@ export function createHandbookService(dependencies: HandbookDependencies): Handb
|
|
|
346
344
|
const changed = [...written, ...movedFields]
|
|
347
345
|
|
|
348
346
|
if (changed.length > 0) {
|
|
349
|
-
events.emit('
|
|
350
|
-
workspaceId,
|
|
351
|
-
objectType: 'handbook_page',
|
|
352
|
-
recordId: id,
|
|
353
|
-
changedFields: changed,
|
|
354
|
-
})
|
|
347
|
+
events.emit('handbook.page.updated', { type: 'handbook_page', id }, { changed })
|
|
355
348
|
}
|
|
356
349
|
|
|
357
350
|
return toView(updated)
|
|
358
|
-
})
|
|
351
|
+
}, { workspaceId, actor: toEventActor(actor) })
|
|
359
352
|
},
|
|
360
353
|
|
|
361
354
|
/**
|
|
@@ -391,9 +384,9 @@ export function createHandbookService(dependencies: HandbookDependencies): Handb
|
|
|
391
384
|
)
|
|
392
385
|
|
|
393
386
|
for (const recordId of removed) {
|
|
394
|
-
events.emit('
|
|
387
|
+
events.emit('handbook.page.deleted', { type: 'handbook_page', id: recordId }, {})
|
|
395
388
|
}
|
|
396
|
-
})
|
|
389
|
+
}, { workspaceId, actor: toEventActor(actor) })
|
|
397
390
|
},
|
|
398
391
|
}
|
|
399
392
|
}
|
|
@@ -12,8 +12,10 @@ import type { TransactionScope } from '../../runtime/transaction.ts'
|
|
|
12
12
|
import type { ActivityRecorder } from '../activities/recorder.ts'
|
|
13
13
|
import { describeLink, describeUnlink, describeUpdate } from '../activities/wording.ts'
|
|
14
14
|
import type { FieldLabels } from '../activities/wording.ts'
|
|
15
|
+
import { toEventActor } from '../../lib/actor.ts'
|
|
15
16
|
import type { Actor } from '../auth/actor.ts'
|
|
16
17
|
import { requireWorkspaceId } from '../auth/actor.ts'
|
|
18
|
+
import './events.ts'
|
|
17
19
|
import { deleteRecordsAttachedTo } from '../attachedRecords.ts'
|
|
18
20
|
import * as repository from './repository.ts'
|
|
19
21
|
import { DEFAULT_CANDIDATE_SORT, CANDIDATE_SORTS } from './repository.ts'
|
|
@@ -287,10 +289,10 @@ export function createCandidatesService(dependencies: CandidatesDependencies): C
|
|
|
287
289
|
...describeLink('role', roleTitle),
|
|
288
290
|
})
|
|
289
291
|
|
|
290
|
-
events.emit('
|
|
292
|
+
events.emit('hiring.candidate.created', { type: 'candidate', id }, {})
|
|
291
293
|
|
|
292
294
|
return toView(created)
|
|
293
|
-
})
|
|
295
|
+
}, { workspaceId, actor: toEventActor(actor) })
|
|
294
296
|
},
|
|
295
297
|
|
|
296
298
|
async update(actor, id, changes) {
|
|
@@ -354,15 +356,10 @@ export function createCandidatesService(dependencies: CandidatesDependencies): C
|
|
|
354
356
|
),
|
|
355
357
|
})
|
|
356
358
|
|
|
357
|
-
events.emit('
|
|
358
|
-
workspaceId,
|
|
359
|
-
objectType: 'candidate',
|
|
360
|
-
recordId: id,
|
|
361
|
-
changedFields: changed,
|
|
362
|
-
})
|
|
359
|
+
events.emit('hiring.candidate.updated', { type: 'candidate', id }, { changed })
|
|
363
360
|
|
|
364
361
|
return toView(updated)
|
|
365
|
-
})
|
|
362
|
+
}, { workspaceId, actor: toEventActor(actor) })
|
|
366
363
|
},
|
|
367
364
|
|
|
368
365
|
async remove(actor, id) {
|
|
@@ -384,8 +381,8 @@ export function createCandidatesService(dependencies: CandidatesDependencies): C
|
|
|
384
381
|
...describeUnlink('role', roleTitle),
|
|
385
382
|
})
|
|
386
383
|
|
|
387
|
-
events.emit('
|
|
388
|
-
})
|
|
384
|
+
events.emit('hiring.candidate.deleted', { type: 'candidate', id }, {})
|
|
385
|
+
}, { workspaceId, actor: toEventActor(actor) })
|
|
389
386
|
},
|
|
390
387
|
}
|
|
391
388
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
import type { ModuleEventCatalog } from '../../runtime/module.ts'
|
|
4
|
+
|
|
5
|
+
/** Domain events published by the hiring module (roles + candidates). */
|
|
6
|
+
|
|
7
|
+
export const hiringEvents = {
|
|
8
|
+
'hiring.role.created': z.object({}).strict(),
|
|
9
|
+
'hiring.role.updated': z.object({ changed: z.array(z.string()).readonly() }),
|
|
10
|
+
'hiring.role.deleted': z.object({}).strict(),
|
|
11
|
+
'hiring.candidate.created': z.object({}).strict(),
|
|
12
|
+
'hiring.candidate.updated': z.object({ changed: z.array(z.string()).readonly() }),
|
|
13
|
+
'hiring.candidate.deleted': z.object({}).strict(),
|
|
14
|
+
} satisfies ModuleEventCatalog
|
|
15
|
+
|
|
16
|
+
export type RoleCreatedData = Record<string, never>
|
|
17
|
+
export interface RoleUpdatedData {
|
|
18
|
+
readonly changed: readonly string[]
|
|
19
|
+
}
|
|
20
|
+
export type RoleDeletedData = Record<string, never>
|
|
21
|
+
export type CandidateCreatedData = Record<string, never>
|
|
22
|
+
export interface CandidateUpdatedData {
|
|
23
|
+
readonly changed: readonly string[]
|
|
24
|
+
}
|
|
25
|
+
export type CandidateDeletedData = Record<string, never>
|
|
26
|
+
|
|
27
|
+
declare module '../../runtime/events.ts' {
|
|
28
|
+
interface KelpieEventMap {
|
|
29
|
+
'hiring.role.created': RoleCreatedData
|
|
30
|
+
'hiring.role.updated': RoleUpdatedData
|
|
31
|
+
'hiring.role.deleted': RoleDeletedData
|
|
32
|
+
'hiring.candidate.created': CandidateCreatedData
|
|
33
|
+
'hiring.candidate.updated': CandidateUpdatedData
|
|
34
|
+
'hiring.candidate.deleted': CandidateDeletedData
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { KelpieModule } from '../../runtime/module.ts'
|
|
2
2
|
import { createActivityRecorder } from '../activities/index.ts'
|
|
3
3
|
import { createCandidatesService } from './candidates.ts'
|
|
4
|
+
import { hiringEvents } from './events.ts'
|
|
4
5
|
import { createRolesService } from './roles.ts'
|
|
5
6
|
import { mountHiringRoutes } from './routes.ts'
|
|
6
7
|
import * as schema from './schema.ts'
|
|
@@ -22,6 +23,7 @@ export function createHiringModule(migrationsDirectory: string): KelpieModule {
|
|
|
22
23
|
return {
|
|
23
24
|
id: 'hiring',
|
|
24
25
|
requires: ['people', 'activities'],
|
|
26
|
+
events: hiringEvents,
|
|
25
27
|
|
|
26
28
|
register(context) {
|
|
27
29
|
const recordActivity = createActivityRecorder({
|
|
@@ -9,8 +9,10 @@ import type { ListQueryParameters, Page } from '../../lib/pagination.ts'
|
|
|
9
9
|
import type { TransactionScope } from '../../runtime/transaction.ts'
|
|
10
10
|
import type { ActivityRecorder } from '../activities/recorder.ts'
|
|
11
11
|
import { describeUnlink } from '../activities/wording.ts'
|
|
12
|
+
import { toEventActor } from '../../lib/actor.ts'
|
|
12
13
|
import type { Actor } from '../auth/actor.ts'
|
|
13
14
|
import { requireWorkspaceId } from '../auth/actor.ts'
|
|
15
|
+
import './events.ts'
|
|
14
16
|
import { deleteRecordsAttachedTo } from '../attachedRecords.ts'
|
|
15
17
|
import * as repository from './repository.ts'
|
|
16
18
|
import { DEFAULT_ROLE_SORT, ROLE_SORTS } from './repository.ts'
|
|
@@ -103,10 +105,10 @@ export function createRolesService(dependencies: RolesDependencies): RolesServic
|
|
|
103
105
|
status: input.status,
|
|
104
106
|
})
|
|
105
107
|
|
|
106
|
-
events.emit('
|
|
108
|
+
events.emit('hiring.role.created', { type: 'role', id }, {})
|
|
107
109
|
|
|
108
110
|
return toView(created)
|
|
109
|
-
})
|
|
111
|
+
}, { workspaceId, actor: toEventActor(actor) })
|
|
110
112
|
},
|
|
111
113
|
|
|
112
114
|
async update(actor, id, changes) {
|
|
@@ -129,15 +131,10 @@ export function createRolesService(dependencies: RolesDependencies): RolesServic
|
|
|
129
131
|
throw AppError.notFound('Role not found')
|
|
130
132
|
}
|
|
131
133
|
|
|
132
|
-
events.emit('
|
|
133
|
-
workspaceId,
|
|
134
|
-
objectType: 'role',
|
|
135
|
-
recordId: id,
|
|
136
|
-
changedFields: changed,
|
|
137
|
-
})
|
|
134
|
+
events.emit('hiring.role.updated', { type: 'role', id }, { changed })
|
|
138
135
|
|
|
139
136
|
return toView(updated)
|
|
140
|
-
})
|
|
137
|
+
}, { workspaceId, actor: toEventActor(actor) })
|
|
141
138
|
},
|
|
142
139
|
|
|
143
140
|
/**
|
|
@@ -167,8 +164,8 @@ export function createRolesService(dependencies: RolesDependencies): RolesServic
|
|
|
167
164
|
|
|
168
165
|
await repository.deleteRole(tx, workspaceId, id)
|
|
169
166
|
|
|
170
|
-
events.emit('
|
|
171
|
-
})
|
|
167
|
+
events.emit('hiring.role.deleted', { type: 'role', id }, {})
|
|
168
|
+
}, { workspaceId, actor: toEventActor(actor) })
|
|
172
169
|
},
|
|
173
170
|
}
|
|
174
171
|
}
|
|
@@ -174,6 +174,33 @@ export function personDraft(mapped: Readonly<Record<string, string>>): PersonDra
|
|
|
174
174
|
})
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
/**
|
|
178
|
+
* The company a People row's affiliation would create.
|
|
179
|
+
*
|
|
180
|
+
* Built from the row's `company_domain` and `company_name` cells, not the
|
|
181
|
+
* `name`/`domain` a Companies file uses. The name falls back to the raw domain
|
|
182
|
+
* so a create from a domain-only row is not a nameless company. The write lays
|
|
183
|
+
* `NEW_COMPANY_DEFAULTS` over this, the same as a Companies import.
|
|
184
|
+
*/
|
|
185
|
+
export function affiliationCompanyDraft(mapped: Readonly<Record<string, string>>): CompanyDraft {
|
|
186
|
+
const domainRaw = text(mapped, 'company_domain')
|
|
187
|
+
|
|
188
|
+
return present<CompanyDraft>({
|
|
189
|
+
name: text(mapped, 'company_name') ?? domainRaw,
|
|
190
|
+
domain: domainRaw === undefined ? undefined : (normaliseDomain(domainRaw) ?? undefined),
|
|
191
|
+
industry: undefined,
|
|
192
|
+
description: undefined,
|
|
193
|
+
stage: undefined,
|
|
194
|
+
sizeBand: undefined,
|
|
195
|
+
hq: undefined,
|
|
196
|
+
website: undefined,
|
|
197
|
+
accountType: undefined,
|
|
198
|
+
icpFit: undefined,
|
|
199
|
+
summary: undefined,
|
|
200
|
+
tags: undefined,
|
|
201
|
+
})
|
|
202
|
+
}
|
|
203
|
+
|
|
177
204
|
/**
|
|
178
205
|
* `value` is required, so `moneyToCents` has already been checked by
|
|
179
206
|
* `validateRow` and cannot be undefined here.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
import type { ModuleEventCatalog } from '../../runtime/module.ts'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Domain events published by the import-export module.
|
|
7
|
+
*
|
|
8
|
+
* Record events (`people.person.created`, etc.) fire from this module during
|
|
9
|
+
* an import, but they are owned by the record's module and declared in its
|
|
10
|
+
* catalog. `imports.job.completed` is what this module owns.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export const importExportEvents = {
|
|
14
|
+
'imports.job.completed': z.object({ object: z.string() }),
|
|
15
|
+
} satisfies ModuleEventCatalog
|
|
16
|
+
|
|
17
|
+
export interface ImportCompletedData {
|
|
18
|
+
readonly object: string
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare module '../../runtime/events.ts' {
|
|
22
|
+
interface KelpieEventMap {
|
|
23
|
+
'imports.job.completed': ImportCompletedData
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -26,8 +26,17 @@ function joinList(values: readonly string[]): string {
|
|
|
26
26
|
return values.join('|')
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* The header row of an export and of a template.
|
|
31
|
+
*
|
|
32
|
+
* `importOnly` columns are left out: a People import may map `company_domain`,
|
|
33
|
+
* `company_name` and `title` to drive a Position, but a person holds many
|
|
34
|
+
* positions and none of them is a field on the person. Writing one on the export
|
|
35
|
+
* would be lossy, so the export and the template carry the round-trippable
|
|
36
|
+
* columns only, and each cell function matches this order one for one.
|
|
37
|
+
*/
|
|
29
38
|
export function headersFor(object: ImportObject): readonly string[] {
|
|
30
|
-
return OBJECT_COLUMNS[object].map((column) => column.key)
|
|
39
|
+
return OBJECT_COLUMNS[object].filter((column) => column.importOnly !== true).map((column) => column.key)
|
|
31
40
|
}
|
|
32
41
|
|
|
33
42
|
export function companyCells(row: ExportCompanyRow): readonly string[] {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { KelpieModule } from '../../runtime/module.ts'
|
|
2
2
|
import { createActivityRecorder } from '../activities/index.ts'
|
|
3
|
+
import { importExportEvents } from './events.ts'
|
|
3
4
|
import { mountImportExportRoutes } from './routes.ts'
|
|
4
5
|
import * as schema from './schema.ts'
|
|
5
6
|
import { createImportExportService } from './service.ts'
|
|
@@ -21,6 +22,7 @@ export function createImportExportModule(migrationsDirectory: string): KelpieMod
|
|
|
21
22
|
return {
|
|
22
23
|
id: 'import-export',
|
|
23
24
|
requires: ['people', 'companies', 'positions', 'pipelines', 'deals', 'activities'],
|
|
25
|
+
events: importExportEvents,
|
|
24
26
|
|
|
25
27
|
register(context) {
|
|
26
28
|
const service = createImportExportService({
|