@kelpie/server 0.8.0 → 0.10.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/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/ids.d.ts +11 -0
- package/dist/lib/ids.d.ts.map +1 -1
- package/dist/lib/ids.js +11 -0
- package/dist/lib/ids.js.map +1 -1
- package/dist/modules/activities/repository.d.ts.map +1 -1
- package/dist/modules/activities/repository.js +19 -20
- package/dist/modules/activities/repository.js.map +1 -1
- package/dist/modules/activities/wording.d.ts +12 -0
- package/dist/modules/activities/wording.d.ts.map +1 -1
- package/dist/modules/activities/wording.js +16 -0
- package/dist/modules/activities/wording.js.map +1 -1
- package/dist/modules/agent-tasks/catalog.d.ts.map +1 -1
- package/dist/modules/agent-tasks/catalog.js +62 -0
- package/dist/modules/agent-tasks/catalog.js.map +1 -1
- package/dist/modules/agent-tasks/resolve.d.ts.map +1 -1
- package/dist/modules/agent-tasks/resolve.js +42 -9
- package/dist/modules/agent-tasks/resolve.js.map +1 -1
- package/dist/modules/agent-tasks/routes.d.ts +2 -0
- package/dist/modules/agent-tasks/routes.d.ts.map +1 -1
- package/dist/modules/attachedRecords.d.ts +6 -1
- package/dist/modules/attachedRecords.d.ts.map +1 -1
- package/dist/modules/attachedRecords.js +15 -1
- package/dist/modules/attachedRecords.js.map +1 -1
- package/dist/modules/companies/index.d.ts.map +1 -1
- package/dist/modules/companies/index.js +3 -1
- package/dist/modules/companies/index.js.map +1 -1
- package/dist/modules/companies/routes.d.ts +14 -0
- package/dist/modules/companies/routes.d.ts.map +1 -1
- package/dist/modules/companies/routes.js +7 -0
- package/dist/modules/companies/routes.js.map +1 -1
- package/dist/modules/companies/schema.d.ts +20 -0
- package/dist/modules/companies/schema.d.ts.map +1 -1
- package/dist/modules/companies/schema.js +6 -1
- package/dist/modules/companies/schema.js.map +1 -1
- package/dist/modules/companies/service.d.ts +5 -0
- package/dist/modules/companies/service.d.ts.map +1 -1
- package/dist/modules/companies/service.js +24 -12
- package/dist/modules/companies/service.js.map +1 -1
- package/dist/modules/consent-purposes/capabilities.d.ts +7 -0
- package/dist/modules/consent-purposes/capabilities.d.ts.map +1 -0
- package/dist/modules/consent-purposes/capabilities.js +10 -0
- package/dist/modules/consent-purposes/capabilities.js.map +1 -0
- package/dist/modules/consent-purposes/events.d.ts +38 -0
- package/dist/modules/consent-purposes/events.d.ts.map +1 -0
- package/dist/modules/consent-purposes/events.js +17 -0
- package/dist/modules/consent-purposes/events.js.map +1 -0
- package/dist/modules/consent-purposes/index.d.ts +13 -0
- package/dist/modules/consent-purposes/index.d.ts.map +1 -0
- package/dist/modules/consent-purposes/index.js +41 -0
- package/dist/modules/consent-purposes/index.js.map +1 -0
- package/dist/modules/consent-purposes/repository.d.ts +21 -0
- package/dist/modules/consent-purposes/repository.d.ts.map +1 -0
- package/dist/modules/consent-purposes/repository.js +98 -0
- package/dist/modules/consent-purposes/repository.js.map +1 -0
- package/dist/modules/consent-purposes/routes.d.ts +39 -0
- package/dist/modules/consent-purposes/routes.d.ts.map +1 -0
- package/dist/modules/consent-purposes/routes.js +79 -0
- package/dist/modules/consent-purposes/routes.js.map +1 -0
- package/dist/modules/consent-purposes/schema.d.ts +175 -0
- package/dist/modules/consent-purposes/schema.d.ts.map +1 -0
- package/dist/modules/consent-purposes/schema.js +35 -0
- package/dist/modules/consent-purposes/schema.js.map +1 -0
- package/dist/modules/consent-purposes/service.d.ts +50 -0
- package/dist/modules/consent-purposes/service.d.ts.map +1 -0
- package/dist/modules/consent-purposes/service.js +263 -0
- package/dist/modules/consent-purposes/service.js.map +1 -0
- package/dist/modules/consent-purposes/starters.d.ts +17 -0
- package/dist/modules/consent-purposes/starters.d.ts.map +1 -0
- package/dist/modules/consent-purposes/starters.js +15 -0
- package/dist/modules/consent-purposes/starters.js.map +1 -0
- package/dist/modules/consent-purposes/tools.d.ts +4 -0
- package/dist/modules/consent-purposes/tools.d.ts.map +1 -0
- package/dist/modules/consent-purposes/tools.js +29 -0
- package/dist/modules/consent-purposes/tools.js.map +1 -0
- package/dist/modules/core.d.ts.map +1 -1
- package/dist/modules/core.js +10 -0
- package/dist/modules/core.js.map +1 -1
- package/dist/modules/custom-fields/capabilities.d.ts +12 -0
- package/dist/modules/custom-fields/capabilities.d.ts.map +1 -0
- package/dist/modules/custom-fields/capabilities.js +15 -0
- package/dist/modules/custom-fields/capabilities.js.map +1 -0
- package/dist/modules/custom-fields/events.d.ts +49 -0
- package/dist/modules/custom-fields/events.d.ts.map +1 -0
- package/dist/modules/custom-fields/events.js +25 -0
- package/dist/modules/custom-fields/events.js.map +1 -0
- package/dist/modules/custom-fields/index.d.ts +19 -0
- package/dist/modules/custom-fields/index.d.ts.map +1 -0
- package/dist/modules/custom-fields/index.js +46 -0
- package/dist/modules/custom-fields/index.js.map +1 -0
- package/dist/modules/custom-fields/repository.d.ts +37 -0
- package/dist/modules/custom-fields/repository.d.ts.map +1 -0
- package/dist/modules/custom-fields/repository.js +144 -0
- package/dist/modules/custom-fields/repository.js.map +1 -0
- package/dist/modules/custom-fields/routes.d.ts +44 -0
- package/dist/modules/custom-fields/routes.d.ts.map +1 -0
- package/dist/modules/custom-fields/routes.js +103 -0
- package/dist/modules/custom-fields/routes.js.map +1 -0
- package/dist/modules/custom-fields/schema.d.ts +215 -0
- package/dist/modules/custom-fields/schema.d.ts.map +1 -0
- package/dist/modules/custom-fields/schema.js +43 -0
- package/dist/modules/custom-fields/schema.js.map +1 -0
- package/dist/modules/custom-fields/service.d.ts +57 -0
- package/dist/modules/custom-fields/service.d.ts.map +1 -0
- package/dist/modules/custom-fields/service.js +273 -0
- package/dist/modules/custom-fields/service.js.map +1 -0
- package/dist/modules/custom-fields/tools.d.ts +4 -0
- package/dist/modules/custom-fields/tools.d.ts.map +1 -0
- package/dist/modules/custom-fields/tools.js +38 -0
- package/dist/modules/custom-fields/tools.js.map +1 -0
- package/dist/modules/custom-fields/values.d.ts +49 -0
- package/dist/modules/custom-fields/values.d.ts.map +1 -0
- package/dist/modules/custom-fields/values.js +249 -0
- package/dist/modules/custom-fields/values.js.map +1 -0
- package/dist/modules/custom-fields/wire.d.ts +12 -0
- package/dist/modules/custom-fields/wire.d.ts.map +1 -0
- package/dist/modules/custom-fields/wire.js +30 -0
- package/dist/modules/custom-fields/wire.js.map +1 -0
- package/dist/modules/dashboard/repository.d.ts.map +1 -1
- package/dist/modules/dashboard/repository.js +4 -3
- package/dist/modules/dashboard/repository.js.map +1 -1
- package/dist/modules/deals/index.d.ts +2 -1
- package/dist/modules/deals/index.d.ts.map +1 -1
- package/dist/modules/deals/index.js +5 -2
- package/dist/modules/deals/index.js.map +1 -1
- package/dist/modules/deals/repository.d.ts +0 -16
- package/dist/modules/deals/repository.d.ts.map +1 -1
- package/dist/modules/deals/repository.js +6 -76
- package/dist/modules/deals/repository.js.map +1 -1
- package/dist/modules/deals/routes.d.ts +14 -0
- package/dist/modules/deals/routes.d.ts.map +1 -1
- package/dist/modules/deals/routes.js +7 -0
- package/dist/modules/deals/routes.js.map +1 -1
- package/dist/modules/deals/schema.d.ts +20 -42
- package/dist/modules/deals/schema.d.ts.map +1 -1
- package/dist/modules/deals/schema.js +6 -11
- package/dist/modules/deals/schema.js.map +1 -1
- package/dist/modules/deals/service.d.ts +13 -2
- package/dist/modules/deals/service.d.ts.map +1 -1
- package/dist/modules/deals/service.js +43 -20
- package/dist/modules/deals/service.js.map +1 -1
- package/dist/modules/decisions/repository.d.ts.map +1 -1
- package/dist/modules/decisions/repository.js +2 -0
- package/dist/modules/decisions/repository.js.map +1 -1
- package/dist/modules/decisions/routes.d.ts +1 -0
- package/dist/modules/decisions/routes.d.ts.map +1 -1
- package/dist/modules/enquiries/events.d.ts +44 -0
- package/dist/modules/enquiries/events.d.ts.map +1 -0
- package/dist/modules/enquiries/events.js +19 -0
- package/dist/modules/enquiries/events.js.map +1 -0
- package/dist/modules/enquiries/index.d.ts +13 -0
- package/dist/modules/enquiries/index.d.ts.map +1 -0
- package/dist/modules/enquiries/index.js +44 -0
- package/dist/modules/enquiries/index.js.map +1 -0
- package/dist/modules/enquiries/repository.d.ts +30 -0
- package/dist/modules/enquiries/repository.d.ts.map +1 -0
- package/dist/modules/enquiries/repository.js +94 -0
- package/dist/modules/enquiries/repository.js.map +1 -0
- package/dist/modules/enquiries/routes.d.ts +52 -0
- package/dist/modules/enquiries/routes.d.ts.map +1 -0
- package/dist/modules/enquiries/routes.js +127 -0
- package/dist/modules/enquiries/routes.js.map +1 -0
- package/dist/modules/enquiries/schema.d.ts +290 -0
- package/dist/modules/enquiries/schema.d.ts.map +1 -0
- package/dist/modules/enquiries/schema.js +52 -0
- package/dist/modules/enquiries/schema.js.map +1 -0
- package/dist/modules/enquiries/service.d.ts +85 -0
- package/dist/modules/enquiries/service.d.ts.map +1 -0
- package/dist/modules/enquiries/service.js +370 -0
- package/dist/modules/enquiries/service.js.map +1 -0
- package/dist/modules/enquiries/tools.d.ts +4 -0
- package/dist/modules/enquiries/tools.d.ts.map +1 -0
- package/dist/modules/enquiries/tools.js +50 -0
- package/dist/modules/enquiries/tools.js.map +1 -0
- package/dist/modules/eventCatalogs.d.ts +3 -0
- package/dist/modules/eventCatalogs.d.ts.map +1 -1
- package/dist/modules/eventCatalogs.js +3 -0
- package/dist/modules/eventCatalogs.js.map +1 -1
- package/dist/modules/forms/embed.d.ts +20 -6
- package/dist/modules/forms/embed.d.ts.map +1 -1
- package/dist/modules/forms/embed.js +359 -43
- package/dist/modules/forms/embed.js.map +1 -1
- package/dist/modules/forms/events.d.ts +20 -7
- package/dist/modules/forms/events.d.ts.map +1 -1
- package/dist/modules/forms/events.js +20 -2
- package/dist/modules/forms/events.js.map +1 -1
- package/dist/modules/forms/fields.d.ts +14 -1
- package/dist/modules/forms/fields.d.ts.map +1 -1
- package/dist/modules/forms/fields.js +87 -3
- package/dist/modules/forms/fields.js.map +1 -1
- package/dist/modules/forms/index.d.ts.map +1 -1
- package/dist/modules/forms/index.js +12 -1
- package/dist/modules/forms/index.js.map +1 -1
- package/dist/modules/forms/mapping.d.ts +62 -5
- package/dist/modules/forms/mapping.d.ts.map +1 -1
- package/dist/modules/forms/mapping.js +139 -5
- package/dist/modules/forms/mapping.js.map +1 -1
- package/dist/modules/forms/publicRoutes.d.ts.map +1 -1
- package/dist/modules/forms/publicRoutes.js +29 -1
- package/dist/modules/forms/publicRoutes.js.map +1 -1
- package/dist/modules/forms/repository.d.ts +31 -0
- package/dist/modules/forms/repository.d.ts.map +1 -1
- package/dist/modules/forms/repository.js +90 -1
- package/dist/modules/forms/repository.js.map +1 -1
- package/dist/modules/forms/routes.d.ts +83 -1
- package/dist/modules/forms/routes.d.ts.map +1 -1
- package/dist/modules/forms/routes.js +185 -2
- package/dist/modules/forms/routes.js.map +1 -1
- package/dist/modules/forms/schema.d.ts +672 -1
- package/dist/modules/forms/schema.d.ts.map +1 -1
- package/dist/modules/forms/schema.js +146 -3
- package/dist/modules/forms/schema.js.map +1 -1
- package/dist/modules/forms/service.d.ts +54 -1
- package/dist/modules/forms/service.d.ts.map +1 -1
- package/dist/modules/forms/service.js +338 -28
- package/dist/modules/forms/service.js.map +1 -1
- package/dist/modules/forms/submission.d.ts +15 -0
- package/dist/modules/forms/submission.d.ts.map +1 -1
- package/dist/modules/forms/submission.js +418 -40
- package/dist/modules/forms/submission.js.map +1 -1
- package/dist/modules/import-export/drafts.d.ts +10 -0
- package/dist/modules/import-export/drafts.d.ts.map +1 -1
- package/dist/modules/import-export/drafts.js +16 -2
- package/dist/modules/import-export/drafts.js.map +1 -1
- package/dist/modules/import-export/exportRows.d.ts +7 -4
- package/dist/modules/import-export/exportRows.d.ts.map +1 -1
- package/dist/modules/import-export/exportRows.js +20 -5
- package/dist/modules/import-export/exportRows.js.map +1 -1
- package/dist/modules/import-export/plan.d.ts +12 -1
- package/dist/modules/import-export/plan.d.ts.map +1 -1
- package/dist/modules/import-export/plan.js +29 -2
- 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 +10 -0
- package/dist/modules/import-export/presets.js.map +1 -1
- package/dist/modules/import-export/repository.d.ts +11 -1
- package/dist/modules/import-export/repository.d.ts.map +1 -1
- package/dist/modules/import-export/repository.js +42 -9
- 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 +4 -0
- package/dist/modules/import-export/routes.js.map +1 -1
- package/dist/modules/import-export/schema.d.ts +17 -0
- package/dist/modules/import-export/schema.d.ts.map +1 -1
- package/dist/modules/import-export/schema.js +11 -0
- package/dist/modules/import-export/schema.js.map +1 -1
- package/dist/modules/import-export/service.d.ts +6 -0
- package/dist/modules/import-export/service.d.ts.map +1 -1
- package/dist/modules/import-export/service.js +14 -2
- package/dist/modules/import-export/service.js.map +1 -1
- package/dist/modules/import-export/streams.d.ts.map +1 -1
- package/dist/modules/import-export/streams.js +3 -3
- package/dist/modules/import-export/streams.js.map +1 -1
- package/dist/modules/import-export/tools.d.ts.map +1 -1
- package/dist/modules/import-export/tools.js +8 -0
- package/dist/modules/import-export/tools.js.map +1 -1
- package/dist/modules/import-export/validation.d.ts.map +1 -1
- package/dist/modules/import-export/validation.js +22 -1
- package/dist/modules/import-export/validation.js.map +1 -1
- package/dist/modules/import-export/writes.d.ts.map +1 -1
- package/dist/modules/import-export/writes.js +37 -4
- package/dist/modules/import-export/writes.js.map +1 -1
- package/dist/modules/lists/index.d.ts +38 -0
- package/dist/modules/lists/index.d.ts.map +1 -1
- package/dist/modules/lists/index.js +27 -0
- package/dist/modules/lists/index.js.map +1 -1
- package/dist/modules/lists/repository.d.ts +26 -0
- package/dist/modules/lists/repository.d.ts.map +1 -1
- package/dist/modules/lists/repository.js +32 -0
- package/dist/modules/lists/repository.js.map +1 -1
- package/dist/modules/lists/routes.d.ts +4 -0
- package/dist/modules/lists/routes.d.ts.map +1 -1
- package/dist/modules/lists/routes.js +8 -0
- package/dist/modules/lists/routes.js.map +1 -1
- package/dist/modules/lists/schema.d.ts +17 -0
- package/dist/modules/lists/schema.d.ts.map +1 -1
- package/dist/modules/lists/schema.js +10 -0
- package/dist/modules/lists/schema.js.map +1 -1
- package/dist/modules/lists/service.d.ts +14 -2
- package/dist/modules/lists/service.d.ts.map +1 -1
- package/dist/modules/lists/service.js +55 -7
- package/dist/modules/lists/service.js.map +1 -1
- package/dist/modules/mcp/index.d.ts.map +1 -1
- package/dist/modules/mcp/index.js +5 -0
- package/dist/modules/mcp/index.js.map +1 -1
- package/dist/modules/notes/routes.d.ts +1 -0
- package/dist/modules/notes/routes.d.ts.map +1 -1
- package/dist/modules/opportunities/index.d.ts.map +1 -1
- package/dist/modules/opportunities/index.js +3 -1
- package/dist/modules/opportunities/index.js.map +1 -1
- package/dist/modules/opportunities/repository.d.ts +2 -0
- package/dist/modules/opportunities/repository.d.ts.map +1 -1
- package/dist/modules/opportunities/repository.js +4 -0
- package/dist/modules/opportunities/repository.js.map +1 -1
- package/dist/modules/opportunities/routes.d.ts +16 -0
- package/dist/modules/opportunities/routes.d.ts.map +1 -1
- package/dist/modules/opportunities/routes.js +13 -0
- package/dist/modules/opportunities/routes.js.map +1 -1
- package/dist/modules/opportunities/schema.d.ts +20 -0
- package/dist/modules/opportunities/schema.d.ts.map +1 -1
- package/dist/modules/opportunities/schema.js +6 -1
- package/dist/modules/opportunities/schema.js.map +1 -1
- package/dist/modules/opportunities/service.d.ts +20 -3
- package/dist/modules/opportunities/service.d.ts.map +1 -1
- package/dist/modules/opportunities/service.js +99 -18
- package/dist/modules/opportunities/service.js.map +1 -1
- package/dist/modules/opportunities/tools.d.ts.map +1 -1
- package/dist/modules/opportunities/tools.js +2 -0
- package/dist/modules/opportunities/tools.js.map +1 -1
- package/dist/modules/partnerships/index.d.ts.map +1 -1
- package/dist/modules/partnerships/index.js +3 -1
- package/dist/modules/partnerships/index.js.map +1 -1
- package/dist/modules/partnerships/repository.d.ts +0 -17
- package/dist/modules/partnerships/repository.d.ts.map +1 -1
- package/dist/modules/partnerships/repository.js +6 -82
- package/dist/modules/partnerships/repository.js.map +1 -1
- package/dist/modules/partnerships/routes.d.ts +14 -0
- package/dist/modules/partnerships/routes.d.ts.map +1 -1
- package/dist/modules/partnerships/routes.js +7 -0
- package/dist/modules/partnerships/routes.js.map +1 -1
- package/dist/modules/partnerships/schema.d.ts +20 -41
- package/dist/modules/partnerships/schema.d.ts.map +1 -1
- package/dist/modules/partnerships/schema.js +6 -10
- package/dist/modules/partnerships/schema.js.map +1 -1
- package/dist/modules/partnerships/service.d.ts +11 -1
- package/dist/modules/partnerships/service.d.ts.map +1 -1
- package/dist/modules/partnerships/service.js +43 -20
- package/dist/modules/partnerships/service.js.map +1 -1
- package/dist/modules/people/consentHydration.d.ts +26 -0
- package/dist/modules/people/consentHydration.d.ts.map +1 -0
- package/dist/modules/people/consentHydration.js +100 -0
- package/dist/modules/people/consentHydration.js.map +1 -0
- package/dist/modules/people/index.d.ts.map +1 -1
- package/dist/modules/people/index.js +3 -1
- package/dist/modules/people/index.js.map +1 -1
- package/dist/modules/people/personConsentWrites.d.ts +40 -0
- package/dist/modules/people/personConsentWrites.d.ts.map +1 -0
- package/dist/modules/people/personConsentWrites.js +98 -0
- package/dist/modules/people/personConsentWrites.js.map +1 -0
- package/dist/modules/people/repository.d.ts.map +1 -1
- package/dist/modules/people/repository.js +5 -1
- package/dist/modules/people/repository.js.map +1 -1
- package/dist/modules/people/routes.d.ts +57 -4
- package/dist/modules/people/routes.d.ts.map +1 -1
- package/dist/modules/people/routes.js +104 -5
- package/dist/modules/people/routes.js.map +1 -1
- package/dist/modules/people/schema.d.ts +366 -1
- package/dist/modules/people/schema.d.ts.map +1 -1
- package/dist/modules/people/schema.js +92 -2
- package/dist/modules/people/schema.js.map +1 -1
- package/dist/modules/people/service.d.ts +30 -1
- package/dist/modules/people/service.d.ts.map +1 -1
- package/dist/modules/people/service.js +115 -38
- package/dist/modules/people/service.js.map +1 -1
- package/dist/modules/people/tools.d.ts.map +1 -1
- package/dist/modules/people/tools.js +4 -1
- package/dist/modules/people/tools.js.map +1 -1
- package/dist/modules/personLinks.d.ts +79 -0
- package/dist/modules/personLinks.d.ts.map +1 -0
- package/dist/modules/personLinks.js +155 -0
- package/dist/modules/personLinks.js.map +1 -0
- package/dist/modules/pipelines/routes.d.ts +1 -0
- package/dist/modules/pipelines/routes.d.ts.map +1 -1
- package/dist/modules/plans/routes.d.ts +1 -0
- package/dist/modules/plans/routes.d.ts.map +1 -1
- package/dist/modules/raises/index.d.ts.map +1 -1
- package/dist/modules/raises/index.js +3 -1
- package/dist/modules/raises/index.js.map +1 -1
- package/dist/modules/raises/repository.d.ts +0 -17
- package/dist/modules/raises/repository.d.ts.map +1 -1
- package/dist/modules/raises/repository.js +6 -77
- package/dist/modules/raises/repository.js.map +1 -1
- package/dist/modules/raises/routes.d.ts +14 -0
- package/dist/modules/raises/routes.d.ts.map +1 -1
- package/dist/modules/raises/routes.js +7 -0
- package/dist/modules/raises/routes.js.map +1 -1
- package/dist/modules/raises/schema.d.ts +20 -41
- package/dist/modules/raises/schema.d.ts.map +1 -1
- package/dist/modules/raises/schema.js +6 -10
- package/dist/modules/raises/schema.js.map +1 -1
- package/dist/modules/raises/service.d.ts +11 -1
- package/dist/modules/raises/service.d.ts.map +1 -1
- package/dist/modules/raises/service.js +41 -18
- package/dist/modules/raises/service.js.map +1 -1
- package/dist/modules/recordTargets.d.ts.map +1 -1
- package/dist/modules/recordTargets.js +2 -0
- package/dist/modules/recordTargets.js.map +1 -1
- package/dist/modules/references.d.ts +10 -0
- package/dist/modules/references.d.ts.map +1 -1
- package/dist/modules/references.js +27 -4
- package/dist/modules/references.js.map +1 -1
- package/dist/modules/sample-data/fixture.d.ts +21 -0
- package/dist/modules/sample-data/fixture.d.ts.map +1 -1
- package/dist/modules/sample-data/fixture.js +40 -0
- package/dist/modules/sample-data/fixture.js.map +1 -1
- package/dist/modules/sample-data/index.d.ts.map +1 -1
- package/dist/modules/sample-data/index.js +1 -0
- package/dist/modules/sample-data/index.js.map +1 -1
- package/dist/modules/sample-data/routes.d.ts.map +1 -1
- package/dist/modules/sample-data/routes.js +1 -0
- package/dist/modules/sample-data/routes.js.map +1 -1
- package/dist/modules/sample-data/service.d.ts +1 -0
- package/dist/modules/sample-data/service.d.ts.map +1 -1
- package/dist/modules/sample-data/service.js +77 -8
- package/dist/modules/sample-data/service.js.map +1 -1
- package/dist/modules/search/index.d.ts +1 -1
- package/dist/modules/search/index.d.ts.map +1 -1
- package/dist/modules/search/index.js +2 -1
- package/dist/modules/search/index.js.map +1 -1
- package/dist/modules/search/repository.d.ts +1 -0
- package/dist/modules/search/repository.d.ts.map +1 -1
- package/dist/modules/search/repository.js +23 -0
- package/dist/modules/search/repository.js.map +1 -1
- package/dist/modules/search/service.d.ts +3 -3
- package/dist/modules/search/service.d.ts.map +1 -1
- package/dist/modules/search/service.js +5 -4
- package/dist/modules/search/service.js.map +1 -1
- package/dist/modules/stagedRecords.d.ts +3 -3
- package/dist/modules/stagedRecords.d.ts.map +1 -1
- package/dist/modules/stagedRecords.js +9 -0
- package/dist/modules/stagedRecords.js.map +1 -1
- package/dist/modules/webhooks/payloads.d.ts.map +1 -1
- package/dist/modules/webhooks/payloads.js +15 -2
- package/dist/modules/webhooks/payloads.js.map +1 -1
- package/dist/modules/workspace/repository.d.ts +2 -0
- package/dist/modules/workspace/repository.d.ts.map +1 -1
- package/dist/modules/workspace/repository.js +7 -0
- package/dist/modules/workspace/repository.js.map +1 -1
- package/dist/modules/workspace/service.d.ts.map +1 -1
- package/dist/modules/workspace/service.js +10 -0
- package/dist/modules/workspace/service.js.map +1 -1
- package/dist/modules/workspace/starters.d.ts.map +1 -1
- package/dist/modules/workspace/starters.js +5 -0
- package/dist/modules/workspace/starters.js.map +1 -1
- package/dist/runtime/events.d.ts +1 -1
- package/dist/runtime/events.d.ts.map +1 -1
- package/dist/runtime/events.js +1 -0
- package/dist/runtime/events.js.map +1 -1
- package/dist/schema/index.d.ts +3 -0
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +3 -0
- package/dist/schema/index.js.map +1 -1
- package/dist/testing/database.d.ts +5 -1
- package/dist/testing/database.d.ts.map +1 -1
- package/dist/testing/database.js +81 -10
- package/dist/testing/database.js.map +1 -1
- package/migrations/0024_third_king_cobra.sql +46 -0
- package/migrations/0025_worthless_chimera.sql +3 -0
- package/migrations/0026_late_aqueduct.sql +46 -0
- package/migrations/0027_brainy_silver_sable.sql +3 -0
- package/migrations/0028_freezing_scrambler.sql +19 -0
- package/migrations/0029_custom_fields.sql +26 -0
- package/migrations/0030_enquiries.sql +79 -0
- package/migrations/0031_consent.sql +45 -0
- package/migrations/0032_form_field_statement.sql +1 -0
- package/migrations/0033_form_field_consent_purpose_ids.sql +5 -0
- package/migrations/0034_drop_form_field_consent_purpose_id.sql +1 -0
- package/migrations/0035_form_field_consent_purpose_labels.sql +1 -0
- package/migrations/0036_form_field_notice_type.sql +2 -0
- package/migrations/meta/0024_snapshot.json +5516 -0
- package/migrations/meta/0025_snapshot.json +5336 -0
- package/migrations/meta/0026_snapshot.json +5710 -0
- package/migrations/meta/0027_snapshot.json +5716 -0
- package/migrations/meta/0028_snapshot.json +5740 -0
- package/migrations/meta/0029_snapshot.json +5935 -0
- package/migrations/meta/0030_snapshot.json +6245 -0
- package/migrations/meta/0031_snapshot.json +6572 -0
- package/migrations/meta/0032_snapshot.json +6578 -0
- package/migrations/meta/0033_snapshot.json +6572 -0
- package/migrations/meta/0034_snapshot.json +6566 -0
- package/migrations/meta/0035_snapshot.json +6573 -0
- package/migrations/meta/0036_snapshot.json +6573 -0
- package/migrations/meta/_journal.json +91 -0
- package/package.json +2 -2
- package/src/index.ts +6 -0
- package/src/lib/ids.ts +11 -0
- package/src/modules/activities/repository.ts +22 -23
- package/src/modules/activities/wording.ts +18 -0
- package/src/modules/agent-tasks/catalog.ts +63 -0
- package/src/modules/agent-tasks/resolve.ts +64 -24
- package/src/modules/attachedRecords.ts +29 -2
- package/src/modules/companies/index.ts +3 -1
- package/src/modules/companies/routes.ts +7 -0
- package/src/modules/companies/schema.ts +7 -1
- package/src/modules/companies/service.ts +48 -13
- package/src/modules/consent-purposes/capabilities.ts +12 -0
- package/src/modules/consent-purposes/events.ts +38 -0
- package/src/modules/consent-purposes/index.ts +48 -0
- package/src/modules/consent-purposes/repository.ts +163 -0
- package/src/modules/consent-purposes/routes.ts +122 -0
- package/src/modules/consent-purposes/schema.ts +46 -0
- package/src/modules/consent-purposes/service.ts +423 -0
- package/src/modules/consent-purposes/starters.ts +32 -0
- package/src/modules/consent-purposes/tools.ts +44 -0
- package/src/modules/core.ts +10 -0
- package/src/modules/custom-fields/capabilities.ts +17 -0
- package/src/modules/custom-fields/events.ts +51 -0
- package/src/modules/custom-fields/index.ts +61 -0
- package/src/modules/custom-fields/repository.ts +225 -0
- package/src/modules/custom-fields/routes.ts +155 -0
- package/src/modules/custom-fields/schema.ts +61 -0
- package/src/modules/custom-fields/service.ts +439 -0
- package/src/modules/custom-fields/tools.ts +53 -0
- package/src/modules/custom-fields/values.ts +352 -0
- package/src/modules/custom-fields/wire.ts +32 -0
- package/src/modules/dashboard/repository.ts +4 -3
- package/src/modules/deals/index.ts +5 -2
- package/src/modules/deals/repository.ts +6 -106
- package/src/modules/deals/routes.ts +7 -0
- package/src/modules/deals/schema.ts +7 -15
- package/src/modules/deals/service.ts +92 -23
- package/src/modules/decisions/repository.ts +2 -0
- package/src/modules/enquiries/events.ts +45 -0
- package/src/modules/enquiries/index.ts +50 -0
- package/src/modules/enquiries/repository.ts +164 -0
- package/src/modules/enquiries/routes.ts +172 -0
- package/src/modules/enquiries/schema.ts +59 -0
- package/src/modules/enquiries/service.ts +644 -0
- package/src/modules/enquiries/tools.ts +66 -0
- package/src/modules/eventCatalogs.ts +3 -0
- package/src/modules/forms/embed.ts +391 -44
- package/src/modules/forms/events.ts +30 -2
- package/src/modules/forms/fields.ts +102 -2
- package/src/modules/forms/index.ts +12 -1
- package/src/modules/forms/mapping.ts +183 -6
- package/src/modules/forms/publicRoutes.ts +43 -1
- package/src/modules/forms/repository.ts +162 -1
- package/src/modules/forms/routes.ts +212 -2
- package/src/modules/forms/schema.ts +166 -4
- package/src/modules/forms/service.ts +565 -41
- package/src/modules/forms/submission.ts +718 -44
- package/src/modules/import-export/drafts.ts +20 -1
- package/src/modules/import-export/exportRows.ts +21 -5
- package/src/modules/import-export/plan.ts +47 -2
- package/src/modules/import-export/presets.ts +10 -0
- package/src/modules/import-export/repository.ts +73 -8
- package/src/modules/import-export/routes.ts +4 -0
- package/src/modules/import-export/schema.ts +11 -0
- package/src/modules/import-export/service.ts +28 -2
- package/src/modules/import-export/streams.ts +3 -1
- package/src/modules/import-export/tools.ts +10 -0
- package/src/modules/import-export/validation.ts +28 -0
- package/src/modules/import-export/writes.ts +70 -5
- package/src/modules/lists/index.ts +71 -0
- package/src/modules/lists/repository.ts +64 -0
- package/src/modules/lists/routes.ts +8 -0
- package/src/modules/lists/schema.ts +10 -0
- package/src/modules/lists/service.ts +110 -9
- package/src/modules/mcp/index.ts +5 -0
- package/src/modules/opportunities/index.ts +3 -1
- package/src/modules/opportunities/repository.ts +11 -0
- package/src/modules/opportunities/routes.ts +13 -0
- package/src/modules/opportunities/schema.ts +7 -1
- package/src/modules/opportunities/service.ts +188 -22
- package/src/modules/opportunities/tools.ts +2 -0
- package/src/modules/partnerships/index.ts +3 -1
- package/src/modules/partnerships/repository.ts +6 -117
- package/src/modules/partnerships/routes.ts +7 -0
- package/src/modules/partnerships/schema.ts +7 -14
- package/src/modules/partnerships/service.ts +93 -22
- package/src/modules/people/consentHydration.ts +167 -0
- package/src/modules/people/index.ts +3 -1
- package/src/modules/people/personConsentWrites.ts +177 -0
- package/src/modules/people/repository.ts +5 -0
- package/src/modules/people/routes.ts +127 -18
- package/src/modules/people/schema.ts +109 -3
- package/src/modules/people/service.ts +186 -40
- package/src/modules/people/tools.ts +5 -1
- package/src/modules/personLinks.ts +278 -0
- package/src/modules/raises/index.ts +3 -1
- package/src/modules/raises/repository.ts +6 -107
- package/src/modules/raises/routes.ts +7 -0
- package/src/modules/raises/schema.ts +7 -14
- package/src/modules/raises/service.ts +91 -20
- package/src/modules/recordTargets.ts +2 -0
- package/src/modules/references.ts +43 -4
- package/src/modules/sample-data/fixture.ts +63 -0
- package/src/modules/sample-data/index.ts +1 -0
- package/src/modules/sample-data/routes.ts +1 -0
- package/src/modules/sample-data/service.ts +97 -8
- package/src/modules/search/index.ts +2 -1
- package/src/modules/search/repository.ts +33 -1
- package/src/modules/search/service.ts +7 -5
- package/src/modules/stagedRecords.ts +18 -3
- package/src/modules/webhooks/payloads.ts +20 -2
- package/src/modules/workspace/repository.ts +12 -0
- package/src/modules/workspace/service.ts +14 -0
- package/src/modules/workspace/starters.ts +5 -0
- package/src/runtime/events.ts +1 -0
- package/src/schema/index.ts +3 -0
- package/src/testing/database.ts +97 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../../src/modules/people/routes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../../src/modules/people/routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAGvF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAE5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAEzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAA;AAEpE,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,aAAa,CAAA;AAGpB;;;;;;GAMG;AAEH,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Y,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,YAAY,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;QAEvF,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAChC,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SocialProfile } from '@kelpie/schemas';
|
|
1
|
+
import type { CustomFieldValue, SocialProfile } from '@kelpie/schemas';
|
|
2
2
|
/**
|
|
3
3
|
* The fixed value sets come from `@kelpie/schemas`, so this table's check
|
|
4
4
|
* constraints, this module's Zod enums, and the browser's decoder are one list
|
|
@@ -74,6 +74,74 @@ export declare const people: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
74
74
|
identity: undefined;
|
|
75
75
|
generated: undefined;
|
|
76
76
|
}, {}, {}>;
|
|
77
|
+
salutation: import("drizzle-orm/pg-core").PgColumn<{
|
|
78
|
+
name: "salutation";
|
|
79
|
+
tableName: "people";
|
|
80
|
+
dataType: "string";
|
|
81
|
+
columnType: "PgText";
|
|
82
|
+
data: string;
|
|
83
|
+
driverParam: string;
|
|
84
|
+
notNull: false;
|
|
85
|
+
hasDefault: false;
|
|
86
|
+
isPrimaryKey: false;
|
|
87
|
+
isAutoincrement: false;
|
|
88
|
+
hasRuntimeDefault: false;
|
|
89
|
+
enumValues: [string, ...string[]];
|
|
90
|
+
baseColumn: never;
|
|
91
|
+
identity: undefined;
|
|
92
|
+
generated: undefined;
|
|
93
|
+
}, {}, {}>;
|
|
94
|
+
firstName: import("drizzle-orm/pg-core").PgColumn<{
|
|
95
|
+
name: "first_name";
|
|
96
|
+
tableName: "people";
|
|
97
|
+
dataType: "string";
|
|
98
|
+
columnType: "PgText";
|
|
99
|
+
data: string;
|
|
100
|
+
driverParam: string;
|
|
101
|
+
notNull: false;
|
|
102
|
+
hasDefault: false;
|
|
103
|
+
isPrimaryKey: false;
|
|
104
|
+
isAutoincrement: false;
|
|
105
|
+
hasRuntimeDefault: false;
|
|
106
|
+
enumValues: [string, ...string[]];
|
|
107
|
+
baseColumn: never;
|
|
108
|
+
identity: undefined;
|
|
109
|
+
generated: undefined;
|
|
110
|
+
}, {}, {}>;
|
|
111
|
+
lastName: import("drizzle-orm/pg-core").PgColumn<{
|
|
112
|
+
name: "last_name";
|
|
113
|
+
tableName: "people";
|
|
114
|
+
dataType: "string";
|
|
115
|
+
columnType: "PgText";
|
|
116
|
+
data: string;
|
|
117
|
+
driverParam: string;
|
|
118
|
+
notNull: false;
|
|
119
|
+
hasDefault: false;
|
|
120
|
+
isPrimaryKey: false;
|
|
121
|
+
isAutoincrement: false;
|
|
122
|
+
hasRuntimeDefault: false;
|
|
123
|
+
enumValues: [string, ...string[]];
|
|
124
|
+
baseColumn: never;
|
|
125
|
+
identity: undefined;
|
|
126
|
+
generated: undefined;
|
|
127
|
+
}, {}, {}>;
|
|
128
|
+
suffix: import("drizzle-orm/pg-core").PgColumn<{
|
|
129
|
+
name: "suffix";
|
|
130
|
+
tableName: "people";
|
|
131
|
+
dataType: "string";
|
|
132
|
+
columnType: "PgText";
|
|
133
|
+
data: string;
|
|
134
|
+
driverParam: string;
|
|
135
|
+
notNull: false;
|
|
136
|
+
hasDefault: false;
|
|
137
|
+
isPrimaryKey: false;
|
|
138
|
+
isAutoincrement: false;
|
|
139
|
+
hasRuntimeDefault: false;
|
|
140
|
+
enumValues: [string, ...string[]];
|
|
141
|
+
baseColumn: never;
|
|
142
|
+
identity: undefined;
|
|
143
|
+
generated: undefined;
|
|
144
|
+
}, {}, {}>;
|
|
77
145
|
email: import("drizzle-orm/pg-core").PgColumn<{
|
|
78
146
|
name: "email";
|
|
79
147
|
tableName: "people";
|
|
@@ -293,6 +361,42 @@ export declare const people: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
293
361
|
identity: undefined;
|
|
294
362
|
generated: undefined;
|
|
295
363
|
}, {}, {}>;
|
|
364
|
+
doNotContact: import("drizzle-orm/pg-core").PgColumn<{
|
|
365
|
+
name: "do_not_contact";
|
|
366
|
+
tableName: "people";
|
|
367
|
+
dataType: "boolean";
|
|
368
|
+
columnType: "PgBoolean";
|
|
369
|
+
data: boolean;
|
|
370
|
+
driverParam: boolean;
|
|
371
|
+
notNull: true;
|
|
372
|
+
hasDefault: true;
|
|
373
|
+
isPrimaryKey: false;
|
|
374
|
+
isAutoincrement: false;
|
|
375
|
+
hasRuntimeDefault: false;
|
|
376
|
+
enumValues: undefined;
|
|
377
|
+
baseColumn: never;
|
|
378
|
+
identity: undefined;
|
|
379
|
+
generated: undefined;
|
|
380
|
+
}, {}, {}>;
|
|
381
|
+
customFields: import("drizzle-orm/pg-core").PgColumn<{
|
|
382
|
+
name: "custom_fields";
|
|
383
|
+
tableName: "people";
|
|
384
|
+
dataType: "json";
|
|
385
|
+
columnType: "PgJsonb";
|
|
386
|
+
data: Readonly<Record<string, CustomFieldValue>>;
|
|
387
|
+
driverParam: unknown;
|
|
388
|
+
notNull: true;
|
|
389
|
+
hasDefault: true;
|
|
390
|
+
isPrimaryKey: false;
|
|
391
|
+
isAutoincrement: false;
|
|
392
|
+
hasRuntimeDefault: false;
|
|
393
|
+
enumValues: undefined;
|
|
394
|
+
baseColumn: never;
|
|
395
|
+
identity: undefined;
|
|
396
|
+
generated: undefined;
|
|
397
|
+
}, {}, {
|
|
398
|
+
$type: Readonly<Record<string, CustomFieldValue>>;
|
|
399
|
+
}>;
|
|
296
400
|
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
297
401
|
name: "created_at";
|
|
298
402
|
tableName: "people";
|
|
@@ -351,4 +455,265 @@ export declare const people: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
351
455
|
};
|
|
352
456
|
dialect: 'pg';
|
|
353
457
|
}>;
|
|
458
|
+
/**
|
|
459
|
+
* The explicit consent decision for one (person, purpose) pair.
|
|
460
|
+
*
|
|
461
|
+
* Absence of a row means "inherits the purpose's `default_status`", so no
|
|
462
|
+
* `unknown` status here — a stored row always carries a decision. The pk is
|
|
463
|
+
* composite on `(person_id, purpose_id)` with no public id; the row is
|
|
464
|
+
* addressed by the pair, like `form_lists` and `form_attach_targets`.
|
|
465
|
+
*
|
|
466
|
+
* `source` records where the decision came from: `form:<form_id>`,
|
|
467
|
+
* `list:<list_id>`, `import`, or `manual`. Cascade with both the person and
|
|
468
|
+
* the purpose — erasing a person drops these with the rest of their record,
|
|
469
|
+
* and removing a purpose drops every row that still names it.
|
|
470
|
+
*/
|
|
471
|
+
export declare const personConsents: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
472
|
+
name: "person_consents";
|
|
473
|
+
schema: undefined;
|
|
474
|
+
columns: {
|
|
475
|
+
workspaceId: import("drizzle-orm/pg-core").PgColumn<{
|
|
476
|
+
name: "workspace_id";
|
|
477
|
+
tableName: "person_consents";
|
|
478
|
+
dataType: "string";
|
|
479
|
+
columnType: "PgText";
|
|
480
|
+
data: string;
|
|
481
|
+
driverParam: string;
|
|
482
|
+
notNull: true;
|
|
483
|
+
hasDefault: false;
|
|
484
|
+
isPrimaryKey: false;
|
|
485
|
+
isAutoincrement: false;
|
|
486
|
+
hasRuntimeDefault: false;
|
|
487
|
+
enumValues: [string, ...string[]];
|
|
488
|
+
baseColumn: never;
|
|
489
|
+
identity: undefined;
|
|
490
|
+
generated: undefined;
|
|
491
|
+
}, {}, {}>;
|
|
492
|
+
personId: import("drizzle-orm/pg-core").PgColumn<{
|
|
493
|
+
name: "person_id";
|
|
494
|
+
tableName: "person_consents";
|
|
495
|
+
dataType: "string";
|
|
496
|
+
columnType: "PgText";
|
|
497
|
+
data: string;
|
|
498
|
+
driverParam: string;
|
|
499
|
+
notNull: true;
|
|
500
|
+
hasDefault: false;
|
|
501
|
+
isPrimaryKey: false;
|
|
502
|
+
isAutoincrement: false;
|
|
503
|
+
hasRuntimeDefault: false;
|
|
504
|
+
enumValues: [string, ...string[]];
|
|
505
|
+
baseColumn: never;
|
|
506
|
+
identity: undefined;
|
|
507
|
+
generated: undefined;
|
|
508
|
+
}, {}, {}>;
|
|
509
|
+
purposeId: import("drizzle-orm/pg-core").PgColumn<{
|
|
510
|
+
name: "purpose_id";
|
|
511
|
+
tableName: "person_consents";
|
|
512
|
+
dataType: "string";
|
|
513
|
+
columnType: "PgText";
|
|
514
|
+
data: string;
|
|
515
|
+
driverParam: string;
|
|
516
|
+
notNull: true;
|
|
517
|
+
hasDefault: false;
|
|
518
|
+
isPrimaryKey: false;
|
|
519
|
+
isAutoincrement: false;
|
|
520
|
+
hasRuntimeDefault: false;
|
|
521
|
+
enumValues: [string, ...string[]];
|
|
522
|
+
baseColumn: never;
|
|
523
|
+
identity: undefined;
|
|
524
|
+
generated: undefined;
|
|
525
|
+
}, {}, {}>;
|
|
526
|
+
status: import("drizzle-orm/pg-core").PgColumn<{
|
|
527
|
+
name: "status";
|
|
528
|
+
tableName: "person_consents";
|
|
529
|
+
dataType: "string";
|
|
530
|
+
columnType: "PgText";
|
|
531
|
+
data: string;
|
|
532
|
+
driverParam: string;
|
|
533
|
+
notNull: true;
|
|
534
|
+
hasDefault: false;
|
|
535
|
+
isPrimaryKey: false;
|
|
536
|
+
isAutoincrement: false;
|
|
537
|
+
hasRuntimeDefault: false;
|
|
538
|
+
enumValues: [string, ...string[]];
|
|
539
|
+
baseColumn: never;
|
|
540
|
+
identity: undefined;
|
|
541
|
+
generated: undefined;
|
|
542
|
+
}, {}, {}>;
|
|
543
|
+
notedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
544
|
+
name: string;
|
|
545
|
+
tableName: "person_consents";
|
|
546
|
+
dataType: "date";
|
|
547
|
+
columnType: "PgTimestamp";
|
|
548
|
+
data: Date;
|
|
549
|
+
driverParam: string;
|
|
550
|
+
notNull: true;
|
|
551
|
+
hasDefault: true;
|
|
552
|
+
isPrimaryKey: false;
|
|
553
|
+
isAutoincrement: false;
|
|
554
|
+
hasRuntimeDefault: false;
|
|
555
|
+
enumValues: undefined;
|
|
556
|
+
baseColumn: never;
|
|
557
|
+
identity: undefined;
|
|
558
|
+
generated: undefined;
|
|
559
|
+
}, {}, {}>;
|
|
560
|
+
source: import("drizzle-orm/pg-core").PgColumn<{
|
|
561
|
+
name: "source";
|
|
562
|
+
tableName: "person_consents";
|
|
563
|
+
dataType: "string";
|
|
564
|
+
columnType: "PgText";
|
|
565
|
+
data: string;
|
|
566
|
+
driverParam: string;
|
|
567
|
+
notNull: true;
|
|
568
|
+
hasDefault: false;
|
|
569
|
+
isPrimaryKey: false;
|
|
570
|
+
isAutoincrement: false;
|
|
571
|
+
hasRuntimeDefault: false;
|
|
572
|
+
enumValues: [string, ...string[]];
|
|
573
|
+
baseColumn: never;
|
|
574
|
+
identity: undefined;
|
|
575
|
+
generated: undefined;
|
|
576
|
+
}, {}, {}>;
|
|
577
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
578
|
+
name: "created_at";
|
|
579
|
+
tableName: "person_consents";
|
|
580
|
+
dataType: "date";
|
|
581
|
+
columnType: "PgTimestamp";
|
|
582
|
+
data: Date;
|
|
583
|
+
driverParam: string;
|
|
584
|
+
notNull: true;
|
|
585
|
+
hasDefault: true;
|
|
586
|
+
isPrimaryKey: false;
|
|
587
|
+
isAutoincrement: false;
|
|
588
|
+
hasRuntimeDefault: false;
|
|
589
|
+
enumValues: undefined;
|
|
590
|
+
baseColumn: never;
|
|
591
|
+
identity: undefined;
|
|
592
|
+
generated: undefined;
|
|
593
|
+
}, {}, {}>;
|
|
594
|
+
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
595
|
+
name: "updated_at";
|
|
596
|
+
tableName: "person_consents";
|
|
597
|
+
dataType: "date";
|
|
598
|
+
columnType: "PgTimestamp";
|
|
599
|
+
data: Date;
|
|
600
|
+
driverParam: string;
|
|
601
|
+
notNull: true;
|
|
602
|
+
hasDefault: true;
|
|
603
|
+
isPrimaryKey: false;
|
|
604
|
+
isAutoincrement: false;
|
|
605
|
+
hasRuntimeDefault: false;
|
|
606
|
+
enumValues: undefined;
|
|
607
|
+
baseColumn: never;
|
|
608
|
+
identity: undefined;
|
|
609
|
+
generated: undefined;
|
|
610
|
+
}, {}, {}>;
|
|
611
|
+
};
|
|
612
|
+
dialect: 'pg';
|
|
613
|
+
}>;
|
|
614
|
+
/**
|
|
615
|
+
* A person's involvement in a pipeline record — a deal, opportunity, raise, or
|
|
616
|
+
* partnership. One polymorphic table instead of a join per pipeline type; the
|
|
617
|
+
* person side keeps a real foreign key with **restrict**, so the database still
|
|
618
|
+
* blocks deleting a person who is on a deal. The target side is polymorphic per
|
|
619
|
+
* the convention: no FK, existence checked by the service, rows removed in the
|
|
620
|
+
* target's own delete transaction (`attachedRecords.ts`).
|
|
621
|
+
*
|
|
622
|
+
* `company` and `role` are deliberately absent from the check constraint: a
|
|
623
|
+
* link with a payload and its own lifecycle stays a typed object —
|
|
624
|
+
* Person↔Company is **Position** (title), Person↔Role is **Candidate** (status,
|
|
625
|
+
* stage, referrer).
|
|
626
|
+
*/
|
|
627
|
+
export declare const personLinks: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
628
|
+
name: "person_links";
|
|
629
|
+
schema: undefined;
|
|
630
|
+
columns: {
|
|
631
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
632
|
+
name: "id";
|
|
633
|
+
tableName: "person_links";
|
|
634
|
+
dataType: "string";
|
|
635
|
+
columnType: "PgText";
|
|
636
|
+
data: string;
|
|
637
|
+
driverParam: string;
|
|
638
|
+
notNull: true;
|
|
639
|
+
hasDefault: false;
|
|
640
|
+
isPrimaryKey: true;
|
|
641
|
+
isAutoincrement: false;
|
|
642
|
+
hasRuntimeDefault: false;
|
|
643
|
+
enumValues: [string, ...string[]];
|
|
644
|
+
baseColumn: never;
|
|
645
|
+
identity: undefined;
|
|
646
|
+
generated: undefined;
|
|
647
|
+
}, {}, {}>;
|
|
648
|
+
workspaceId: import("drizzle-orm/pg-core").PgColumn<{
|
|
649
|
+
name: "workspace_id";
|
|
650
|
+
tableName: "person_links";
|
|
651
|
+
dataType: "string";
|
|
652
|
+
columnType: "PgText";
|
|
653
|
+
data: string;
|
|
654
|
+
driverParam: string;
|
|
655
|
+
notNull: true;
|
|
656
|
+
hasDefault: false;
|
|
657
|
+
isPrimaryKey: false;
|
|
658
|
+
isAutoincrement: false;
|
|
659
|
+
hasRuntimeDefault: false;
|
|
660
|
+
enumValues: [string, ...string[]];
|
|
661
|
+
baseColumn: never;
|
|
662
|
+
identity: undefined;
|
|
663
|
+
generated: undefined;
|
|
664
|
+
}, {}, {}>;
|
|
665
|
+
personId: import("drizzle-orm/pg-core").PgColumn<{
|
|
666
|
+
name: "person_id";
|
|
667
|
+
tableName: "person_links";
|
|
668
|
+
dataType: "string";
|
|
669
|
+
columnType: "PgText";
|
|
670
|
+
data: string;
|
|
671
|
+
driverParam: string;
|
|
672
|
+
notNull: true;
|
|
673
|
+
hasDefault: false;
|
|
674
|
+
isPrimaryKey: false;
|
|
675
|
+
isAutoincrement: false;
|
|
676
|
+
hasRuntimeDefault: false;
|
|
677
|
+
enumValues: [string, ...string[]];
|
|
678
|
+
baseColumn: never;
|
|
679
|
+
identity: undefined;
|
|
680
|
+
generated: undefined;
|
|
681
|
+
}, {}, {}>;
|
|
682
|
+
targetType: import("drizzle-orm/pg-core").PgColumn<{
|
|
683
|
+
name: "target_type";
|
|
684
|
+
tableName: "person_links";
|
|
685
|
+
dataType: "string";
|
|
686
|
+
columnType: "PgText";
|
|
687
|
+
data: string;
|
|
688
|
+
driverParam: string;
|
|
689
|
+
notNull: true;
|
|
690
|
+
hasDefault: false;
|
|
691
|
+
isPrimaryKey: false;
|
|
692
|
+
isAutoincrement: false;
|
|
693
|
+
hasRuntimeDefault: false;
|
|
694
|
+
enumValues: [string, ...string[]];
|
|
695
|
+
baseColumn: never;
|
|
696
|
+
identity: undefined;
|
|
697
|
+
generated: undefined;
|
|
698
|
+
}, {}, {}>;
|
|
699
|
+
targetId: import("drizzle-orm/pg-core").PgColumn<{
|
|
700
|
+
name: "target_id";
|
|
701
|
+
tableName: "person_links";
|
|
702
|
+
dataType: "string";
|
|
703
|
+
columnType: "PgText";
|
|
704
|
+
data: string;
|
|
705
|
+
driverParam: string;
|
|
706
|
+
notNull: true;
|
|
707
|
+
hasDefault: false;
|
|
708
|
+
isPrimaryKey: false;
|
|
709
|
+
isAutoincrement: false;
|
|
710
|
+
hasRuntimeDefault: false;
|
|
711
|
+
enumValues: [string, ...string[]];
|
|
712
|
+
baseColumn: never;
|
|
713
|
+
identity: undefined;
|
|
714
|
+
generated: undefined;
|
|
715
|
+
}, {}, {}>;
|
|
716
|
+
};
|
|
717
|
+
dialect: 'pg';
|
|
718
|
+
}>;
|
|
354
719
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/modules/people/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/modules/people/schema.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAgBtE;;;;;;;;GAQG;AACH,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,iBAAiB,CAAA;AACxB,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,eAAe,GAChB,MAAM,iBAAiB,CAAA;AACxB,YAAY,EAAE,aAAa,EAAE,CAAA;AAE7B;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoElB,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwB1B,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBvB,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { INFLUENCE_LEVELS, PREFERRED_CHANNELS, RELATIONSHIP_LEVELS } from '@kelpie/schemas';
|
|
2
|
-
import { index, jsonb, pgTable, text, unique } from 'drizzle-orm/pg-core';
|
|
1
|
+
import { CONSENT_STATUSES, INFLUENCE_LEVELS, PIPELINE_KINDS, PREFERRED_CHANNELS, RELATIONSHIP_LEVELS, } from '@kelpie/schemas';
|
|
2
|
+
import { boolean, index, jsonb, pgTable, primaryKey, text, unique } from 'drizzle-orm/pg-core';
|
|
3
3
|
import { checkOneOf, citext, createdAt, moment, primaryId, searchVector, updatedAt, } from '../../lib/columns.js';
|
|
4
|
+
import { consentPurposes } from '../consent-purposes/schema.js';
|
|
4
5
|
import { workspaces } from '../workspace/schema.js';
|
|
5
6
|
/**
|
|
6
7
|
* The fixed value sets come from `@kelpie/schemas`, so this table's check
|
|
@@ -26,6 +27,14 @@ export const people = pgTable('people', {
|
|
|
26
27
|
.notNull()
|
|
27
28
|
.references(() => workspaces.id, { onDelete: 'cascade' }),
|
|
28
29
|
name: text('name').notNull(),
|
|
30
|
+
// The canonical display name is `name`, and it is the only one of these that
|
|
31
|
+
// is required. The parts are recorded when they are known and left null when
|
|
32
|
+
// they are not; nothing composes them back into `name` after the row exists,
|
|
33
|
+
// so an edit to one never renames the record behind the editor's back.
|
|
34
|
+
salutation: text('salutation'),
|
|
35
|
+
firstName: text('first_name'),
|
|
36
|
+
lastName: text('last_name'),
|
|
37
|
+
suffix: text('suffix'),
|
|
29
38
|
email: citext('email'),
|
|
30
39
|
phones: jsonb('phones').$type().notNull().default([]),
|
|
31
40
|
socialProfiles: jsonb('social_profiles')
|
|
@@ -40,12 +49,31 @@ export const people = pgTable('people', {
|
|
|
40
49
|
summary: text('summary').notNull().default(''),
|
|
41
50
|
tags: text('tags').array().notNull().default([]),
|
|
42
51
|
lastContactedAt: moment('last_contacted_at'),
|
|
52
|
+
// The Article 21 objection. A global do-not-contact signal, independent
|
|
53
|
+
// of consent purposes: agents check this before outreach regardless of
|
|
54
|
+
// per-purpose consent state. Never touched by forms, lists, or imports —
|
|
55
|
+
// the workspace member owns this flag.
|
|
56
|
+
doNotContact: boolean('do_not_contact').notNull().default(false),
|
|
57
|
+
// Workspace-defined fields, keyed by definition key. The custom-fields
|
|
58
|
+
// service validates every key on write; the store here just carries the
|
|
59
|
+
// shape. Default `{}` mirrors `tags`'s default — the object is always
|
|
60
|
+
// present, never null.
|
|
61
|
+
customFields: jsonb('custom_fields')
|
|
62
|
+
.$type()
|
|
63
|
+
.notNull()
|
|
64
|
+
.default({}),
|
|
43
65
|
createdAt: createdAt(),
|
|
44
66
|
updatedAt: updatedAt(),
|
|
45
67
|
// Their title is not here because it is not on this table. `GET /v1/search`
|
|
46
68
|
// reaches it through `positions.search_vector`.
|
|
47
69
|
searchVector: searchVector(() => [
|
|
48
70
|
{ column: people.name, weight: 'A' },
|
|
71
|
+
// The parts carry the same weight as the display name: they exist so a
|
|
72
|
+
// person can be found by a name they are not displayed under, and finding
|
|
73
|
+
// them is the whole point of storing them. `salutation` and `suffix` are
|
|
74
|
+
// left out — "Dr" and "Jr" match half a workspace and narrow nothing.
|
|
75
|
+
{ column: people.firstName, weight: 'A' },
|
|
76
|
+
{ column: people.lastName, weight: 'A' },
|
|
49
77
|
{ column: people.email, weight: 'B' },
|
|
50
78
|
{ column: people.summary, weight: 'B' },
|
|
51
79
|
{ column: people.tags, weight: 'C', array: true },
|
|
@@ -58,4 +86,66 @@ export const people = pgTable('people', {
|
|
|
58
86
|
checkOneOf('people_influence_check', table.influence, INFLUENCE_LEVELS),
|
|
59
87
|
checkOneOf('people_relationship_check', table.relationship, RELATIONSHIP_LEVELS),
|
|
60
88
|
]);
|
|
89
|
+
/**
|
|
90
|
+
* The explicit consent decision for one (person, purpose) pair.
|
|
91
|
+
*
|
|
92
|
+
* Absence of a row means "inherits the purpose's `default_status`", so no
|
|
93
|
+
* `unknown` status here — a stored row always carries a decision. The pk is
|
|
94
|
+
* composite on `(person_id, purpose_id)` with no public id; the row is
|
|
95
|
+
* addressed by the pair, like `form_lists` and `form_attach_targets`.
|
|
96
|
+
*
|
|
97
|
+
* `source` records where the decision came from: `form:<form_id>`,
|
|
98
|
+
* `list:<list_id>`, `import`, or `manual`. Cascade with both the person and
|
|
99
|
+
* the purpose — erasing a person drops these with the rest of their record,
|
|
100
|
+
* and removing a purpose drops every row that still names it.
|
|
101
|
+
*/
|
|
102
|
+
export const personConsents = pgTable('person_consents', {
|
|
103
|
+
workspaceId: text('workspace_id')
|
|
104
|
+
.notNull()
|
|
105
|
+
.references(() => workspaces.id, { onDelete: 'cascade' }),
|
|
106
|
+
personId: text('person_id')
|
|
107
|
+
.notNull()
|
|
108
|
+
.references(() => people.id, { onDelete: 'cascade' }),
|
|
109
|
+
purposeId: text('purpose_id')
|
|
110
|
+
.notNull()
|
|
111
|
+
.references(() => consentPurposes.id, { onDelete: 'cascade' }),
|
|
112
|
+
status: text('status').notNull(),
|
|
113
|
+
notedAt: moment('noted_at').notNull().defaultNow(),
|
|
114
|
+
source: text('source').notNull(),
|
|
115
|
+
createdAt: createdAt(),
|
|
116
|
+
updatedAt: updatedAt(),
|
|
117
|
+
}, (table) => [
|
|
118
|
+
primaryKey({ columns: [table.personId, table.purposeId] }),
|
|
119
|
+
index('person_consents_workspace_idx').on(table.workspaceId),
|
|
120
|
+
index('person_consents_purpose_idx').on(table.purposeId),
|
|
121
|
+
checkOneOf('person_consents_status_check', table.status, CONSENT_STATUSES),
|
|
122
|
+
]);
|
|
123
|
+
/**
|
|
124
|
+
* A person's involvement in a pipeline record — a deal, opportunity, raise, or
|
|
125
|
+
* partnership. One polymorphic table instead of a join per pipeline type; the
|
|
126
|
+
* person side keeps a real foreign key with **restrict**, so the database still
|
|
127
|
+
* blocks deleting a person who is on a deal. The target side is polymorphic per
|
|
128
|
+
* the convention: no FK, existence checked by the service, rows removed in the
|
|
129
|
+
* target's own delete transaction (`attachedRecords.ts`).
|
|
130
|
+
*
|
|
131
|
+
* `company` and `role` are deliberately absent from the check constraint: a
|
|
132
|
+
* link with a payload and its own lifecycle stays a typed object —
|
|
133
|
+
* Person↔Company is **Position** (title), Person↔Role is **Candidate** (status,
|
|
134
|
+
* stage, referrer).
|
|
135
|
+
*/
|
|
136
|
+
export const personLinks = pgTable('person_links', {
|
|
137
|
+
id: primaryId(),
|
|
138
|
+
workspaceId: text('workspace_id')
|
|
139
|
+
.notNull()
|
|
140
|
+
.references(() => workspaces.id, { onDelete: 'cascade' }),
|
|
141
|
+
personId: text('person_id')
|
|
142
|
+
.notNull()
|
|
143
|
+
.references(() => people.id, { onDelete: 'restrict' }),
|
|
144
|
+
targetType: text('target_type').notNull(),
|
|
145
|
+
targetId: text('target_id').notNull(),
|
|
146
|
+
}, (table) => [
|
|
147
|
+
index('person_links_target_idx').on(table.workspaceId, table.targetType, table.targetId),
|
|
148
|
+
unique('person_links_person_target_key').on(table.personId, table.targetType, table.targetId),
|
|
149
|
+
checkOneOf('person_links_target_type_check', table.targetType, PIPELINE_KINDS),
|
|
150
|
+
]);
|
|
61
151
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/modules/people/schema.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/modules/people/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAE9F,OAAO,EACL,UAAU,EACV,MAAM,EACN,SAAS,EACT,MAAM,EACN,SAAS,EACT,YAAY,EACZ,SAAS,GACV,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAEnD;;;;;;;;GAQG;AACH,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,iBAAiB,CAAA;AASxB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,OAAO,CAC3B,QAAQ,EACR;IACE,EAAE,EAAE,SAAS,EAAE;IACf,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC;SAC9B,OAAO,EAAE;SACT,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAA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,KAAK,CAAC,SAAS,CAAC;IACxD,UAAU,CAAC,8BAA8B,EAAE,KAAK,CAAC,MAAM,EAAE,gBAAgB,CAAC;CAC3E,CACF,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAChC,cAAc,EACd;IACE,EAAE,EAAE,SAAS,EAAE;IACf,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC;SAC9B,OAAO,EAAE;SACT,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAC3D,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC;SACxB,OAAO,EAAE;SACT,UAAU,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;IACxD,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE;IACzC,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE;CACtC,EACD,CAAC,KAAK,EAAE,EAAE,CAAC;IACT,KAAK,CAAC,yBAAyB,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC;IACxF,MAAM,CAAC,gCAAgC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC7F,UAAU,CAAC,gCAAgC,EAAE,KAAK,CAAC,UAAU,EAAE,cAAc,CAAC;CAC/E,CACF,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ConsentStatus, CustomFieldWireValue } from '@kelpie/schemas';
|
|
1
2
|
import type { Database } from '../../lib/database.ts';
|
|
2
3
|
import type { IdFactory } from '../../lib/ids.ts';
|
|
3
4
|
import type { ListQueryParameters, Page } from '../../lib/pagination.ts';
|
|
@@ -5,8 +6,10 @@ import type { TransactionScope } from '../../runtime/transaction.ts';
|
|
|
5
6
|
import type { ActivityRecorder } from '../activities/recorder.ts';
|
|
6
7
|
import type { Actor } from '../auth/actor.ts';
|
|
7
8
|
import './events.ts';
|
|
9
|
+
import type { CustomFieldValuesValidator } from '../custom-fields/values.ts';
|
|
8
10
|
import type { PersonFilters, PersonRecord } from './repository.ts';
|
|
9
11
|
import type { Influence, PreferredChannel, Relationship, SocialProfile } from './schema.ts';
|
|
12
|
+
import type { EffectiveConsent } from './consentHydration.ts';
|
|
10
13
|
/**
|
|
11
14
|
* People: who the workspace knows.
|
|
12
15
|
*
|
|
@@ -22,6 +25,7 @@ export interface PeopleDependencies {
|
|
|
22
25
|
readonly createId: IdFactory;
|
|
23
26
|
readonly now: () => Date;
|
|
24
27
|
readonly recordActivity: ActivityRecorder;
|
|
28
|
+
readonly customFields: CustomFieldValuesValidator;
|
|
25
29
|
}
|
|
26
30
|
/**
|
|
27
31
|
* A person as the API returns one: the stored row minus the tenancy column.
|
|
@@ -29,9 +33,25 @@ export interface PeopleDependencies {
|
|
|
29
33
|
* Deliberately an alias rather than a parallel interface. A hand-written copy of
|
|
30
34
|
* fifteen fields drifts from the table the first time one is added.
|
|
31
35
|
*/
|
|
32
|
-
export type PersonView = Omit<PersonRecord, 'workspaceId'
|
|
36
|
+
export type PersonView = Omit<PersonRecord, 'workspaceId'> & {
|
|
37
|
+
/**
|
|
38
|
+
* The effective consent status for every workspace purpose. An entry with
|
|
39
|
+
* `inherited: true` has no explicit `person_consents` row and carries the
|
|
40
|
+
* purpose's `default_status`; the rest have their own row.
|
|
41
|
+
*/
|
|
42
|
+
readonly consents: readonly EffectiveConsent[];
|
|
43
|
+
};
|
|
44
|
+
export interface PersonConsentWriteInput {
|
|
45
|
+
readonly purposeSlug: string;
|
|
46
|
+
readonly status: ConsentStatus | null;
|
|
47
|
+
}
|
|
33
48
|
export interface CreatePersonInput {
|
|
49
|
+
/** Already resolved. The route composes one from the parts when the caller sent none. */
|
|
34
50
|
readonly name: string;
|
|
51
|
+
readonly salutation: string | null;
|
|
52
|
+
readonly firstName: string | null;
|
|
53
|
+
readonly lastName: string | null;
|
|
54
|
+
readonly suffix: string | null;
|
|
35
55
|
readonly email: string | null;
|
|
36
56
|
readonly phones: readonly string[];
|
|
37
57
|
readonly socialProfiles: readonly SocialProfile[];
|
|
@@ -43,6 +63,15 @@ export interface CreatePersonInput {
|
|
|
43
63
|
readonly summary: string;
|
|
44
64
|
readonly tags: readonly string[];
|
|
45
65
|
readonly lastContactedAt: Date | null;
|
|
66
|
+
readonly doNotContact: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Consent writes for named purposes. `status: null` deletes the row and
|
|
69
|
+
* inherits the purpose default; anything else upserts `source: manual`.
|
|
70
|
+
* Absent purposes are left alone.
|
|
71
|
+
*/
|
|
72
|
+
readonly consents: readonly PersonConsentWriteInput[];
|
|
73
|
+
/** Wire shape merge patch (undefined for a create without any): sent keys change, null clears. */
|
|
74
|
+
readonly customFields: Readonly<Record<string, CustomFieldWireValue | null>> | undefined;
|
|
46
75
|
}
|
|
47
76
|
/** PATCH semantics: an absent field is left alone, and null clears a nullable one. */
|
|
48
77
|
export type UpdatePersonInput = Partial<CreatePersonInput>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/modules/people/service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/modules/people/service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAI1E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAGrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAGjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,yBA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