@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
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import type { CustomFieldValue } from '@kelpie/schemas';
|
|
2
|
+
/**
|
|
3
|
+
* Enquiries: the top-of-funnel pipeline. An inbound request — website form,
|
|
4
|
+
* email, referral — that may become a Deal once qualified.
|
|
5
|
+
*
|
|
6
|
+
* `source` is free text like Opportunity's `kind`; a form is a source, and the
|
|
7
|
+
* kinds a workspace uses vary. `company_id` is nullable because an early
|
|
8
|
+
* enquiry may arrive before a company is on file. `converted_deal_id` becomes
|
|
9
|
+
* non-null when the enquiry is converted via
|
|
10
|
+
* `POST /v1/enquiries/:id/convert`; deleting the deal nulls it back so a
|
|
11
|
+
* fresh conversion is possible.
|
|
12
|
+
*/
|
|
13
|
+
export declare const enquiries: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
14
|
+
name: "enquiries";
|
|
15
|
+
schema: undefined;
|
|
16
|
+
columns: {
|
|
17
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
18
|
+
name: "id";
|
|
19
|
+
tableName: "enquiries";
|
|
20
|
+
dataType: "string";
|
|
21
|
+
columnType: "PgText";
|
|
22
|
+
data: string;
|
|
23
|
+
driverParam: string;
|
|
24
|
+
notNull: true;
|
|
25
|
+
hasDefault: false;
|
|
26
|
+
isPrimaryKey: true;
|
|
27
|
+
isAutoincrement: false;
|
|
28
|
+
hasRuntimeDefault: false;
|
|
29
|
+
enumValues: [string, ...string[]];
|
|
30
|
+
baseColumn: never;
|
|
31
|
+
identity: undefined;
|
|
32
|
+
generated: undefined;
|
|
33
|
+
}, {}, {}>;
|
|
34
|
+
workspaceId: import("drizzle-orm/pg-core").PgColumn<{
|
|
35
|
+
name: "workspace_id";
|
|
36
|
+
tableName: "enquiries";
|
|
37
|
+
dataType: "string";
|
|
38
|
+
columnType: "PgText";
|
|
39
|
+
data: string;
|
|
40
|
+
driverParam: string;
|
|
41
|
+
notNull: true;
|
|
42
|
+
hasDefault: false;
|
|
43
|
+
isPrimaryKey: false;
|
|
44
|
+
isAutoincrement: false;
|
|
45
|
+
hasRuntimeDefault: false;
|
|
46
|
+
enumValues: [string, ...string[]];
|
|
47
|
+
baseColumn: never;
|
|
48
|
+
identity: undefined;
|
|
49
|
+
generated: undefined;
|
|
50
|
+
}, {}, {}>;
|
|
51
|
+
name: import("drizzle-orm/pg-core").PgColumn<{
|
|
52
|
+
name: "name";
|
|
53
|
+
tableName: "enquiries";
|
|
54
|
+
dataType: "string";
|
|
55
|
+
columnType: "PgText";
|
|
56
|
+
data: string;
|
|
57
|
+
driverParam: string;
|
|
58
|
+
notNull: true;
|
|
59
|
+
hasDefault: false;
|
|
60
|
+
isPrimaryKey: false;
|
|
61
|
+
isAutoincrement: false;
|
|
62
|
+
hasRuntimeDefault: false;
|
|
63
|
+
enumValues: [string, ...string[]];
|
|
64
|
+
baseColumn: never;
|
|
65
|
+
identity: undefined;
|
|
66
|
+
generated: undefined;
|
|
67
|
+
}, {}, {}>;
|
|
68
|
+
source: import("drizzle-orm/pg-core").PgColumn<{
|
|
69
|
+
name: "source";
|
|
70
|
+
tableName: "enquiries";
|
|
71
|
+
dataType: "string";
|
|
72
|
+
columnType: "PgText";
|
|
73
|
+
data: string;
|
|
74
|
+
driverParam: string;
|
|
75
|
+
notNull: true;
|
|
76
|
+
hasDefault: true;
|
|
77
|
+
isPrimaryKey: false;
|
|
78
|
+
isAutoincrement: false;
|
|
79
|
+
hasRuntimeDefault: false;
|
|
80
|
+
enumValues: [string, ...string[]];
|
|
81
|
+
baseColumn: never;
|
|
82
|
+
identity: undefined;
|
|
83
|
+
generated: undefined;
|
|
84
|
+
}, {}, {}>;
|
|
85
|
+
stageId: import("drizzle-orm/pg-core").PgColumn<{
|
|
86
|
+
name: "stage_id";
|
|
87
|
+
tableName: "enquiries";
|
|
88
|
+
dataType: "string";
|
|
89
|
+
columnType: "PgText";
|
|
90
|
+
data: string;
|
|
91
|
+
driverParam: string;
|
|
92
|
+
notNull: true;
|
|
93
|
+
hasDefault: false;
|
|
94
|
+
isPrimaryKey: false;
|
|
95
|
+
isAutoincrement: false;
|
|
96
|
+
hasRuntimeDefault: false;
|
|
97
|
+
enumValues: [string, ...string[]];
|
|
98
|
+
baseColumn: never;
|
|
99
|
+
identity: undefined;
|
|
100
|
+
generated: undefined;
|
|
101
|
+
}, {}, {}>;
|
|
102
|
+
companyId: import("drizzle-orm/pg-core").PgColumn<{
|
|
103
|
+
name: "company_id";
|
|
104
|
+
tableName: "enquiries";
|
|
105
|
+
dataType: "string";
|
|
106
|
+
columnType: "PgText";
|
|
107
|
+
data: string;
|
|
108
|
+
driverParam: string;
|
|
109
|
+
notNull: false;
|
|
110
|
+
hasDefault: false;
|
|
111
|
+
isPrimaryKey: false;
|
|
112
|
+
isAutoincrement: false;
|
|
113
|
+
hasRuntimeDefault: false;
|
|
114
|
+
enumValues: [string, ...string[]];
|
|
115
|
+
baseColumn: never;
|
|
116
|
+
identity: undefined;
|
|
117
|
+
generated: undefined;
|
|
118
|
+
}, {}, {}>;
|
|
119
|
+
ownerId: import("drizzle-orm/pg-core").PgColumn<{
|
|
120
|
+
name: "owner_id";
|
|
121
|
+
tableName: "enquiries";
|
|
122
|
+
dataType: "string";
|
|
123
|
+
columnType: "PgText";
|
|
124
|
+
data: string;
|
|
125
|
+
driverParam: string;
|
|
126
|
+
notNull: false;
|
|
127
|
+
hasDefault: false;
|
|
128
|
+
isPrimaryKey: false;
|
|
129
|
+
isAutoincrement: false;
|
|
130
|
+
hasRuntimeDefault: false;
|
|
131
|
+
enumValues: [string, ...string[]];
|
|
132
|
+
baseColumn: never;
|
|
133
|
+
identity: undefined;
|
|
134
|
+
generated: undefined;
|
|
135
|
+
}, {}, {}>;
|
|
136
|
+
convertedDealId: import("drizzle-orm/pg-core").PgColumn<{
|
|
137
|
+
name: "converted_deal_id";
|
|
138
|
+
tableName: "enquiries";
|
|
139
|
+
dataType: "string";
|
|
140
|
+
columnType: "PgText";
|
|
141
|
+
data: string;
|
|
142
|
+
driverParam: string;
|
|
143
|
+
notNull: false;
|
|
144
|
+
hasDefault: false;
|
|
145
|
+
isPrimaryKey: false;
|
|
146
|
+
isAutoincrement: false;
|
|
147
|
+
hasRuntimeDefault: false;
|
|
148
|
+
enumValues: [string, ...string[]];
|
|
149
|
+
baseColumn: never;
|
|
150
|
+
identity: undefined;
|
|
151
|
+
generated: undefined;
|
|
152
|
+
}, {}, {}>;
|
|
153
|
+
summary: import("drizzle-orm/pg-core").PgColumn<{
|
|
154
|
+
name: "summary";
|
|
155
|
+
tableName: "enquiries";
|
|
156
|
+
dataType: "string";
|
|
157
|
+
columnType: "PgText";
|
|
158
|
+
data: string;
|
|
159
|
+
driverParam: string;
|
|
160
|
+
notNull: true;
|
|
161
|
+
hasDefault: true;
|
|
162
|
+
isPrimaryKey: false;
|
|
163
|
+
isAutoincrement: false;
|
|
164
|
+
hasRuntimeDefault: false;
|
|
165
|
+
enumValues: [string, ...string[]];
|
|
166
|
+
baseColumn: never;
|
|
167
|
+
identity: undefined;
|
|
168
|
+
generated: undefined;
|
|
169
|
+
}, {}, {}>;
|
|
170
|
+
tags: import("drizzle-orm/pg-core").PgColumn<{
|
|
171
|
+
name: "tags";
|
|
172
|
+
tableName: "enquiries";
|
|
173
|
+
dataType: "array";
|
|
174
|
+
columnType: "PgArray";
|
|
175
|
+
data: string[];
|
|
176
|
+
driverParam: string | string[];
|
|
177
|
+
notNull: true;
|
|
178
|
+
hasDefault: true;
|
|
179
|
+
isPrimaryKey: false;
|
|
180
|
+
isAutoincrement: false;
|
|
181
|
+
hasRuntimeDefault: false;
|
|
182
|
+
enumValues: [string, ...string[]];
|
|
183
|
+
baseColumn: import("drizzle-orm").Column<{
|
|
184
|
+
name: "tags";
|
|
185
|
+
tableName: "enquiries";
|
|
186
|
+
dataType: "string";
|
|
187
|
+
columnType: "PgText";
|
|
188
|
+
data: string;
|
|
189
|
+
driverParam: string;
|
|
190
|
+
notNull: false;
|
|
191
|
+
hasDefault: false;
|
|
192
|
+
isPrimaryKey: false;
|
|
193
|
+
isAutoincrement: false;
|
|
194
|
+
hasRuntimeDefault: false;
|
|
195
|
+
enumValues: [string, ...string[]];
|
|
196
|
+
baseColumn: never;
|
|
197
|
+
identity: undefined;
|
|
198
|
+
generated: undefined;
|
|
199
|
+
}, {}, {}>;
|
|
200
|
+
identity: undefined;
|
|
201
|
+
generated: undefined;
|
|
202
|
+
}, {}, {
|
|
203
|
+
baseBuilder: import("drizzle-orm/pg-core").PgColumnBuilder<{
|
|
204
|
+
name: "tags";
|
|
205
|
+
dataType: 'string';
|
|
206
|
+
columnType: 'PgText';
|
|
207
|
+
data: string;
|
|
208
|
+
enumValues: [string, ...string[]];
|
|
209
|
+
driverParam: string;
|
|
210
|
+
}, {}, {}, import("drizzle-orm").ColumnBuilderExtraConfig>;
|
|
211
|
+
size: undefined;
|
|
212
|
+
}>;
|
|
213
|
+
customFields: import("drizzle-orm/pg-core").PgColumn<{
|
|
214
|
+
name: "custom_fields";
|
|
215
|
+
tableName: "enquiries";
|
|
216
|
+
dataType: "json";
|
|
217
|
+
columnType: "PgJsonb";
|
|
218
|
+
data: Readonly<Record<string, CustomFieldValue>>;
|
|
219
|
+
driverParam: unknown;
|
|
220
|
+
notNull: true;
|
|
221
|
+
hasDefault: true;
|
|
222
|
+
isPrimaryKey: false;
|
|
223
|
+
isAutoincrement: false;
|
|
224
|
+
hasRuntimeDefault: false;
|
|
225
|
+
enumValues: undefined;
|
|
226
|
+
baseColumn: never;
|
|
227
|
+
identity: undefined;
|
|
228
|
+
generated: undefined;
|
|
229
|
+
}, {}, {
|
|
230
|
+
$type: Readonly<Record<string, CustomFieldValue>>;
|
|
231
|
+
}>;
|
|
232
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
233
|
+
name: "created_at";
|
|
234
|
+
tableName: "enquiries";
|
|
235
|
+
dataType: "date";
|
|
236
|
+
columnType: "PgTimestamp";
|
|
237
|
+
data: Date;
|
|
238
|
+
driverParam: string;
|
|
239
|
+
notNull: true;
|
|
240
|
+
hasDefault: true;
|
|
241
|
+
isPrimaryKey: false;
|
|
242
|
+
isAutoincrement: false;
|
|
243
|
+
hasRuntimeDefault: false;
|
|
244
|
+
enumValues: undefined;
|
|
245
|
+
baseColumn: never;
|
|
246
|
+
identity: undefined;
|
|
247
|
+
generated: undefined;
|
|
248
|
+
}, {}, {}>;
|
|
249
|
+
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
250
|
+
name: "updated_at";
|
|
251
|
+
tableName: "enquiries";
|
|
252
|
+
dataType: "date";
|
|
253
|
+
columnType: "PgTimestamp";
|
|
254
|
+
data: Date;
|
|
255
|
+
driverParam: string;
|
|
256
|
+
notNull: true;
|
|
257
|
+
hasDefault: true;
|
|
258
|
+
isPrimaryKey: false;
|
|
259
|
+
isAutoincrement: false;
|
|
260
|
+
hasRuntimeDefault: false;
|
|
261
|
+
enumValues: undefined;
|
|
262
|
+
baseColumn: never;
|
|
263
|
+
identity: undefined;
|
|
264
|
+
generated: undefined;
|
|
265
|
+
}, {}, {}>;
|
|
266
|
+
searchVector: import("drizzle-orm/pg-core").PgColumn<{
|
|
267
|
+
name: string;
|
|
268
|
+
tableName: "enquiries";
|
|
269
|
+
dataType: "custom";
|
|
270
|
+
columnType: "PgCustomColumn";
|
|
271
|
+
data: string;
|
|
272
|
+
driverParam: string;
|
|
273
|
+
notNull: false;
|
|
274
|
+
hasDefault: true;
|
|
275
|
+
isPrimaryKey: false;
|
|
276
|
+
isAutoincrement: false;
|
|
277
|
+
hasRuntimeDefault: false;
|
|
278
|
+
enumValues: undefined;
|
|
279
|
+
baseColumn: never;
|
|
280
|
+
identity: undefined;
|
|
281
|
+
generated: {
|
|
282
|
+
type: 'always';
|
|
283
|
+
};
|
|
284
|
+
}, {}, {
|
|
285
|
+
pgColumnBuilderBrand: 'PgCustomColumnBuilderBrand';
|
|
286
|
+
}>;
|
|
287
|
+
};
|
|
288
|
+
dialect: 'pg';
|
|
289
|
+
}>;
|
|
290
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/modules/enquiries/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAUvD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqCrB,CAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { index, jsonb, pgTable, text } from 'drizzle-orm/pg-core';
|
|
2
|
+
import { createdAt, primaryId, searchVector, updatedAt } from '../../lib/columns.js';
|
|
3
|
+
import { companies } from '../companies/schema.js';
|
|
4
|
+
import { deals } from '../deals/schema.js';
|
|
5
|
+
import { pipelineStages } from '../pipelines/schema.js';
|
|
6
|
+
import { workspaceMembers, workspaces } from '../workspace/schema.js';
|
|
7
|
+
/**
|
|
8
|
+
* Enquiries: the top-of-funnel pipeline. An inbound request — website form,
|
|
9
|
+
* email, referral — that may become a Deal once qualified.
|
|
10
|
+
*
|
|
11
|
+
* `source` is free text like Opportunity's `kind`; a form is a source, and the
|
|
12
|
+
* kinds a workspace uses vary. `company_id` is nullable because an early
|
|
13
|
+
* enquiry may arrive before a company is on file. `converted_deal_id` becomes
|
|
14
|
+
* non-null when the enquiry is converted via
|
|
15
|
+
* `POST /v1/enquiries/:id/convert`; deleting the deal nulls it back so a
|
|
16
|
+
* fresh conversion is possible.
|
|
17
|
+
*/
|
|
18
|
+
export const enquiries = pgTable('enquiries', {
|
|
19
|
+
id: primaryId(),
|
|
20
|
+
workspaceId: text('workspace_id')
|
|
21
|
+
.notNull()
|
|
22
|
+
.references(() => workspaces.id, { onDelete: 'cascade' }),
|
|
23
|
+
name: text('name').notNull(),
|
|
24
|
+
source: text('source').notNull().default(''),
|
|
25
|
+
stageId: text('stage_id')
|
|
26
|
+
.notNull()
|
|
27
|
+
.references(() => pipelineStages.id, { onDelete: 'restrict' }),
|
|
28
|
+
companyId: text('company_id').references(() => companies.id, { onDelete: 'restrict' }),
|
|
29
|
+
ownerId: text('owner_id').references(() => workspaceMembers.id, { onDelete: 'restrict' }),
|
|
30
|
+
convertedDealId: text('converted_deal_id').references(() => deals.id, { onDelete: 'set null' }),
|
|
31
|
+
summary: text('summary').notNull().default(''),
|
|
32
|
+
tags: text('tags').array().notNull().default([]),
|
|
33
|
+
// Workspace-defined fields, keyed by definition key. See people/schema.ts.
|
|
34
|
+
customFields: jsonb('custom_fields')
|
|
35
|
+
.$type()
|
|
36
|
+
.notNull()
|
|
37
|
+
.default({}),
|
|
38
|
+
createdAt: createdAt(),
|
|
39
|
+
updatedAt: updatedAt(),
|
|
40
|
+
searchVector: searchVector(() => [
|
|
41
|
+
{ column: enquiries.name, weight: 'A' },
|
|
42
|
+
{ column: enquiries.source, weight: 'B' },
|
|
43
|
+
{ column: enquiries.summary, weight: 'B' },
|
|
44
|
+
{ column: enquiries.tags, weight: 'C', array: true },
|
|
45
|
+
]),
|
|
46
|
+
}, (table) => [
|
|
47
|
+
index('enquiries_workspace_idx').on(table.workspaceId),
|
|
48
|
+
index('enquiries_stage_idx').on(table.stageId),
|
|
49
|
+
index('enquiries_converted_deal_idx').on(table.convertedDealId),
|
|
50
|
+
index('enquiries_search_idx').using('gin', table.searchVector),
|
|
51
|
+
]);
|
|
52
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/modules/enquiries/schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAEjE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAEpF,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAErE;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAC9B,WAAW,EACX;IACE,EAAE,EAAE,SAAS,EAAE;IACf,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC;SAC9B,OAAO,EAAE;SACT,UAAU,CAAC,GAAG,EA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,CAAC;QAC5D,EAAE,MAAM,EAAE,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE;QACvC,EAAE,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE;QACzC,EAAE,MAAM,EAAE,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE;QAC1C,EAAE,MAAM,EAAE,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE;KACrD,CAAC;CACH,EACD,CAAC,KAAK,EAAE,EAAE,CAAC;IACT,KAAK,CAAC,yBAAyB,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC;IACtD,KAAK,CAAC,qBAAqB,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;IAC9C,KAAK,CAAC,8BAA8B,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC;IAC/D,KAAK,CAAC,sBAAsB,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC;CAC/D,CACF,CAAA"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { CustomFieldWireValue } from '@kelpie/schemas';
|
|
2
|
+
import type { Database } from '../../lib/database.ts';
|
|
3
|
+
import type { IdFactory } from '../../lib/ids.ts';
|
|
4
|
+
import type { ListQueryParameters, Page } from '../../lib/pagination.ts';
|
|
5
|
+
import type { TransactionScope } from '../../runtime/transaction.ts';
|
|
6
|
+
import type { ActivityRecorder } from '../activities/recorder.ts';
|
|
7
|
+
import type { Actor } from '../auth/actor.ts';
|
|
8
|
+
import './events.ts';
|
|
9
|
+
import '../deals/events.ts';
|
|
10
|
+
import type { CustomFieldValuesValidator } from '../custom-fields/values.ts';
|
|
11
|
+
import type { DealRecord } from '../deals/repository.ts';
|
|
12
|
+
import type { EnquiryFilters, EnquiryRecord } from './repository.ts';
|
|
13
|
+
/**
|
|
14
|
+
* Enquiries: the top-of-funnel pipeline. Inbound requests that may become a
|
|
15
|
+
* Deal once qualified. People attach through `person_links`; company is
|
|
16
|
+
* optional (some enquiries arrive before a company is on file).
|
|
17
|
+
*
|
|
18
|
+
* A stage move is an ordinary PATCH of `stage_id`, and it is the one change
|
|
19
|
+
* that files a `stage_changed` activity and a `stage.changed` event instead of
|
|
20
|
+
* the generic update pair.
|
|
21
|
+
*
|
|
22
|
+
* The one non-CRUD action is `convertToDeal`, which is what
|
|
23
|
+
* `POST /v1/enquiries/:id/convert` calls: it inserts a new deal, copies the
|
|
24
|
+
* enquiry's people to it, sets `convertedDealId`, and moves the enquiry to
|
|
25
|
+
* its first closed stage.
|
|
26
|
+
*/
|
|
27
|
+
export interface EnquiriesDependencies {
|
|
28
|
+
readonly db: Database;
|
|
29
|
+
readonly transaction: TransactionScope;
|
|
30
|
+
readonly createId: IdFactory;
|
|
31
|
+
readonly now: () => Date;
|
|
32
|
+
readonly recordActivity: ActivityRecorder;
|
|
33
|
+
readonly customFields: CustomFieldValuesValidator;
|
|
34
|
+
}
|
|
35
|
+
/** An enquiry as the API returns one: the stored row minus tenancy, plus its people. */
|
|
36
|
+
export type EnquiryView = Omit<EnquiryRecord, 'workspaceId'> & {
|
|
37
|
+
readonly personIds: readonly string[];
|
|
38
|
+
};
|
|
39
|
+
export interface CreateEnquiryInput {
|
|
40
|
+
readonly name: string;
|
|
41
|
+
/** Free text ("Website", "Email", "Referral"). Empty means unclassified. */
|
|
42
|
+
readonly source: string;
|
|
43
|
+
/** Absent means the pipeline's default stage: the first open one. */
|
|
44
|
+
readonly stageId: string | undefined;
|
|
45
|
+
readonly companyId: string | null;
|
|
46
|
+
/** Absent means the caller: the member creating an enquiry starts as its owner. */
|
|
47
|
+
readonly ownerId: string | null | undefined;
|
|
48
|
+
readonly personIds: readonly string[];
|
|
49
|
+
readonly summary: string;
|
|
50
|
+
readonly tags: readonly string[];
|
|
51
|
+
/** Wire shape for a create body: `null` values are ignored, non-null are validated. */
|
|
52
|
+
readonly customFields: Readonly<Record<string, CustomFieldWireValue | null>> | undefined;
|
|
53
|
+
}
|
|
54
|
+
/** PATCH semantics: an absent field is left alone, and null clears a nullable one. */
|
|
55
|
+
export interface UpdateEnquiryInput {
|
|
56
|
+
readonly name?: string | undefined;
|
|
57
|
+
readonly source?: string | undefined;
|
|
58
|
+
readonly stageId?: string | undefined;
|
|
59
|
+
readonly companyId?: string | null | undefined;
|
|
60
|
+
readonly ownerId?: string | null | undefined;
|
|
61
|
+
/** Replaces the set. The service works out who was added and who left. */
|
|
62
|
+
readonly personIds?: readonly string[] | undefined;
|
|
63
|
+
readonly summary?: string | undefined;
|
|
64
|
+
readonly tags?: readonly string[] | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Partial merge patch (wire shape): sent keys change, `null` clears a key,
|
|
67
|
+
* absent keys are left alone. Unknown keys are `422`.
|
|
68
|
+
*/
|
|
69
|
+
readonly customFields?: Readonly<Record<string, CustomFieldWireValue | null>> | undefined;
|
|
70
|
+
}
|
|
71
|
+
/** What `convertToDeal` returns: the freshly created deal, plus its people. */
|
|
72
|
+
export interface ConvertedDealView {
|
|
73
|
+
readonly deal: DealRecord;
|
|
74
|
+
readonly personIds: readonly string[];
|
|
75
|
+
}
|
|
76
|
+
export interface EnquiriesService {
|
|
77
|
+
list(actor: Actor, filters: EnquiryFilters, query: ListQueryParameters): Promise<Page<EnquiryView>>;
|
|
78
|
+
get(actor: Actor, id: string): Promise<EnquiryView>;
|
|
79
|
+
create(actor: Actor, input: CreateEnquiryInput): Promise<EnquiryView>;
|
|
80
|
+
update(actor: Actor, id: string, changes: UpdateEnquiryInput): Promise<EnquiryView>;
|
|
81
|
+
remove(actor: Actor, id: string): Promise<void>;
|
|
82
|
+
convertToDeal(actor: Actor, id: string): Promise<ConvertedDealView>;
|
|
83
|
+
}
|
|
84
|
+
export declare function createEnquiriesService(dependencies: EnquiriesDependencies): EnquiriesService;
|
|
85
|
+
//# sourceMappingURL=service.d.ts.map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