@kelpie/server 0.8.0 → 0.9.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/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/repository.d.ts +11 -0
- package/dist/modules/lists/repository.d.ts.map +1 -1
- package/dist/modules/lists/repository.js +13 -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/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/repository.ts +30 -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":"schema.d.ts","sourceRoot":"","sources":["../../../src/modules/forms/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/modules/forms/schema.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AAerF;;;;;GAKG;AACH,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,EACtB,gBAAgB,EAChB,uBAAuB,EACvB,aAAa,EACb,mBAAmB,GACpB,MAAM,iBAAiB,CAAA;AACxB,YAAY,EACV,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,UAAU,GACX,MAAM,iBAAiB,CAAA;AAExB;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAA;CACxC;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;GASG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8B3B,CAAA"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { FORM_FIELD_MAP_TARGETS, FORM_FIELD_TYPES, FORM_STATUSES } from '@kelpie/schemas';
|
|
2
|
-
import { boolean, index, integer, jsonb, pgTable, text } from 'drizzle-orm/pg-core';
|
|
1
|
+
import { FORM_FIELD_MAP_TARGETS, FORM_FIELD_TYPES, FORM_STATUSES, PIPELINE_KINDS, } from '@kelpie/schemas';
|
|
2
|
+
import { boolean, index, integer, jsonb, pgTable, primaryKey, text } from 'drizzle-orm/pg-core';
|
|
3
3
|
import { checkOneOf, createdAt, moment, primaryId, updatedAt } from '../../lib/columns.js';
|
|
4
4
|
import { companies } from '../companies/schema.js';
|
|
5
5
|
import { deals } from '../deals/schema.js';
|
|
6
|
+
import { enquiries } from '../enquiries/schema.js';
|
|
7
|
+
import { lists } from '../lists/schema.js';
|
|
8
|
+
import { opportunities } from '../opportunities/schema.js';
|
|
9
|
+
import { partnerships } from '../partnerships/schema.js';
|
|
6
10
|
import { people } from '../people/schema.js';
|
|
7
11
|
import { pipelineStages } from '../pipelines/schema.js';
|
|
8
12
|
import { positions } from '../positions/schema.js';
|
|
9
|
-
import { workspaces } from '../workspace/schema.js';
|
|
13
|
+
import { workspaceMembers, workspaces } from '../workspace/schema.js';
|
|
10
14
|
/**
|
|
11
15
|
* The fixed value sets come from `@kelpie/schemas`, so these tables' check
|
|
12
16
|
* constraints, this module's Zod enums, and the browser's decoder are one list
|
|
@@ -17,6 +21,14 @@ export { FORM_FIELD_MAP_TARGET_LABELS, FORM_FIELD_MAP_TARGETS, FORM_FIELD_TYPES,
|
|
|
17
21
|
/**
|
|
18
22
|
* Embeddable inbound forms. `public_key` is globally unique because the public
|
|
19
23
|
* submit endpoint resolves the workspace from it, with no credentials.
|
|
24
|
+
*
|
|
25
|
+
* The opportunity/partnership trigger columns mirror the deal trigger: a
|
|
26
|
+
* toggle, an optional stage (null → first open at submit), a required kind
|
|
27
|
+
* while the toggle is on (enforced in the service, so a stage id from the
|
|
28
|
+
* wrong pipeline can be rejected in the same 422 the deal path uses), a
|
|
29
|
+
* template that expands `{{company.name}}` / `{{person.name}}`, and an owner
|
|
30
|
+
* (null → workspace default member). Owner fks are `set null` on member
|
|
31
|
+
* removal so the workspace can still delete a member who owns a form action.
|
|
20
32
|
*/
|
|
21
33
|
export const forms = pgTable('forms', {
|
|
22
34
|
id: primaryId(),
|
|
@@ -24,12 +36,51 @@ export const forms = pgTable('forms', {
|
|
|
24
36
|
.notNull()
|
|
25
37
|
.references(() => workspaces.id, { onDelete: 'cascade' }),
|
|
26
38
|
name: text('name').notNull(),
|
|
39
|
+
/**
|
|
40
|
+
* Heading shown on the hosted/embed page. Independent of `name` (the CRM
|
|
41
|
+
* label); defaults to `name` at create time.
|
|
42
|
+
*/
|
|
43
|
+
title: text('title').notNull(),
|
|
27
44
|
description: text('description'),
|
|
28
45
|
status: text('status').notNull().default('active'),
|
|
29
46
|
thankYouMessage: text('thank_you_message').notNull().default(''),
|
|
30
47
|
createDeal: boolean('create_deal').notNull().default(false),
|
|
31
48
|
dealStageId: text('deal_stage_id').references(() => pipelineStages.id, { onDelete: 'restrict' }),
|
|
32
49
|
dealNameTemplate: text('deal_name_template'),
|
|
50
|
+
createOpportunity: boolean('create_opportunity').notNull().default(false),
|
|
51
|
+
opportunityKind: text('opportunity_kind'),
|
|
52
|
+
opportunityStageId: text('opportunity_stage_id').references(() => pipelineStages.id, {
|
|
53
|
+
onDelete: 'restrict',
|
|
54
|
+
}),
|
|
55
|
+
opportunityNameTemplate: text('opportunity_name_template'),
|
|
56
|
+
opportunityOwnerId: text('opportunity_owner_id').references(() => workspaceMembers.id, {
|
|
57
|
+
onDelete: 'set null',
|
|
58
|
+
}),
|
|
59
|
+
createPartnership: boolean('create_partnership').notNull().default(false),
|
|
60
|
+
partnershipKind: text('partnership_kind'),
|
|
61
|
+
partnershipStageId: text('partnership_stage_id').references(() => pipelineStages.id, {
|
|
62
|
+
onDelete: 'restrict',
|
|
63
|
+
}),
|
|
64
|
+
partnershipNameTemplate: text('partnership_name_template'),
|
|
65
|
+
partnershipOwnerId: text('partnership_owner_id').references(() => workspaceMembers.id, {
|
|
66
|
+
onDelete: 'set null',
|
|
67
|
+
}),
|
|
68
|
+
createEnquiry: boolean('create_enquiry').notNull().default(false),
|
|
69
|
+
/**
|
|
70
|
+
* Optional free-text `source` written onto every enquiry the form creates
|
|
71
|
+
* (e.g. "Website contact"). Enquiries have no `kind` so there is no
|
|
72
|
+
* required-kind rule — an unset source stores empty on the enquiry.
|
|
73
|
+
*/
|
|
74
|
+
enquirySource: text('enquiry_source'),
|
|
75
|
+
enquiryStageId: text('enquiry_stage_id').references(() => pipelineStages.id, {
|
|
76
|
+
onDelete: 'restrict',
|
|
77
|
+
}),
|
|
78
|
+
enquiryNameTemplate: text('enquiry_name_template'),
|
|
79
|
+
enquiryOwnerId: text('enquiry_owner_id').references(() => workspaceMembers.id, {
|
|
80
|
+
onDelete: 'set null',
|
|
81
|
+
}),
|
|
82
|
+
personTags: text('person_tags').array().notNull().default([]),
|
|
83
|
+
companyTags: text('company_tags').array().notNull().default([]),
|
|
33
84
|
publicKey: text('public_key').notNull().unique(),
|
|
34
85
|
createdAt: createdAt(),
|
|
35
86
|
updatedAt: updatedAt(),
|
|
@@ -37,6 +88,51 @@ export const forms = pgTable('forms', {
|
|
|
37
88
|
index('forms_workspace_idx').on(table.workspaceId),
|
|
38
89
|
checkOneOf('forms_status_check', table.status, FORM_STATUSES),
|
|
39
90
|
]);
|
|
91
|
+
/**
|
|
92
|
+
* Lists (person or company) every matching record from a submit is added to.
|
|
93
|
+
*
|
|
94
|
+
* The pair `(form_id, list_id)` is the natural key. No `id`, because the row
|
|
95
|
+
* never crosses the wire — the form body carries a `list_ids: [...]` array
|
|
96
|
+
* and the service reconciles it by set-diff. Both fks cascade: deleting a
|
|
97
|
+
* list drops the action from every form naming it, keeping the promise in
|
|
98
|
+
* `lists.md` that a list delete is never blocked.
|
|
99
|
+
*/
|
|
100
|
+
export const formLists = pgTable('form_lists', {
|
|
101
|
+
workspaceId: text('workspace_id')
|
|
102
|
+
.notNull()
|
|
103
|
+
.references(() => workspaces.id, { onDelete: 'cascade' }),
|
|
104
|
+
formId: text('form_id')
|
|
105
|
+
.notNull()
|
|
106
|
+
.references(() => forms.id, { onDelete: 'cascade' }),
|
|
107
|
+
listId: text('list_id')
|
|
108
|
+
.notNull()
|
|
109
|
+
.references(() => lists.id, { onDelete: 'cascade' }),
|
|
110
|
+
}, (table) => [
|
|
111
|
+
primaryKey({ columns: [table.formId, table.listId] }),
|
|
112
|
+
index('form_lists_workspace_idx').on(table.workspaceId),
|
|
113
|
+
]);
|
|
114
|
+
/**
|
|
115
|
+
* Pre-existing pipeline records every submitter is linked to via
|
|
116
|
+
* `person_links`. Polymorphic per the convention notes/lists/plans/person_links
|
|
117
|
+
* use: no fk to the target, existence checked by the service, rows removed in
|
|
118
|
+
* the target's own delete transaction (`attachedRecords.ts`). No `id` — the
|
|
119
|
+
* triple already identifies a row and the wire carries `attach_targets`
|
|
120
|
+
* nested in the form body.
|
|
121
|
+
*/
|
|
122
|
+
export const formAttachTargets = pgTable('form_attach_targets', {
|
|
123
|
+
workspaceId: text('workspace_id')
|
|
124
|
+
.notNull()
|
|
125
|
+
.references(() => workspaces.id, { onDelete: 'cascade' }),
|
|
126
|
+
formId: text('form_id')
|
|
127
|
+
.notNull()
|
|
128
|
+
.references(() => forms.id, { onDelete: 'cascade' }),
|
|
129
|
+
targetType: text('target_type').notNull(),
|
|
130
|
+
targetId: text('target_id').notNull(),
|
|
131
|
+
}, (table) => [
|
|
132
|
+
primaryKey({ columns: [table.formId, table.targetType, table.targetId] }),
|
|
133
|
+
index('form_attach_targets_target_idx').on(table.workspaceId, table.targetType, table.targetId),
|
|
134
|
+
checkOneOf('form_attach_targets_target_type_check', table.targetType, PIPELINE_KINDS),
|
|
135
|
+
]);
|
|
40
136
|
/**
|
|
41
137
|
* `map_to` decides what a field writes on submit. At most one `person.email`
|
|
42
138
|
* mapping per form, enforced in the service layer because that is a per-form
|
|
@@ -56,6 +152,36 @@ export const formFields = pgTable('form_fields', {
|
|
|
56
152
|
mapTo: text('map_to').notNull(),
|
|
57
153
|
options: jsonb('options').$type().notNull().default([]),
|
|
58
154
|
placeholder: text('placeholder'),
|
|
155
|
+
/**
|
|
156
|
+
* The checkbox statement for a `consent` field — the intro sentence that
|
|
157
|
+
* sits above the list of purpose checkboxes. `label` is the field's
|
|
158
|
+
* heading; `statement` is what the visitor reads before ticking. Null for
|
|
159
|
+
* every other type.
|
|
160
|
+
*/
|
|
161
|
+
statement: text('statement'),
|
|
162
|
+
/**
|
|
163
|
+
* The workspace consent purposes a `consent` field offers, in the order
|
|
164
|
+
* the visitor sees them. Required (non-empty) when `type === 'consent'`.
|
|
165
|
+
* A `text[]` rather than a join table because the set is small (usually
|
|
166
|
+
* one to three), always read whole, and never queried into; the service
|
|
167
|
+
* validates each id against `consent_purposes` and refuses an unknown one
|
|
168
|
+
* at 422, and the purposes module refuses to delete a purpose still
|
|
169
|
+
* listed on any form field (`form_fields.consent_purpose_ids` scan).
|
|
170
|
+
*/
|
|
171
|
+
consentPurposeIds: text('consent_purpose_ids')
|
|
172
|
+
.array()
|
|
173
|
+
.notNull()
|
|
174
|
+
.default([]),
|
|
175
|
+
/**
|
|
176
|
+
* Optional per-purpose override for the text shown next to each checkbox.
|
|
177
|
+
* Keyed by purpose id; absent keys fall back to the workspace purpose's
|
|
178
|
+
* own label. Bound to the same purpose the checkbox grants — the map
|
|
179
|
+
* changes wording, never which purpose is being consented to.
|
|
180
|
+
*/
|
|
181
|
+
consentPurposeLabels: jsonb('consent_purpose_labels')
|
|
182
|
+
.$type()
|
|
183
|
+
.notNull()
|
|
184
|
+
.default({}),
|
|
59
185
|
sortOrder: integer('sort_order').notNull(),
|
|
60
186
|
createdAt: createdAt(),
|
|
61
187
|
updatedAt: updatedAt(),
|
|
@@ -67,6 +193,12 @@ export const formFields = pgTable('form_fields', {
|
|
|
67
193
|
/**
|
|
68
194
|
* Record links are set null rather than cascade: a submission stays as evidence
|
|
69
195
|
* of what arrived even after the record it created is deleted.
|
|
196
|
+
*
|
|
197
|
+
* `action_log` is one entry per post-submit action attempted, in order. Empty
|
|
198
|
+
* for a form with no post-actions configured, and empty on a legacy row from
|
|
199
|
+
* before the column existed (the migration defaults it). Persisted so the
|
|
200
|
+
* Submissions UI and API readers see what ran, what was skipped, and what
|
|
201
|
+
* rolled back.
|
|
70
202
|
*/
|
|
71
203
|
export const formSubmissions = pgTable('form_submissions', {
|
|
72
204
|
id: primaryId(),
|
|
@@ -82,6 +214,17 @@ export const formSubmissions = pgTable('form_submissions', {
|
|
|
82
214
|
companyId: text('company_id').references(() => companies.id, { onDelete: 'set null' }),
|
|
83
215
|
positionId: text('position_id').references(() => positions.id, { onDelete: 'set null' }),
|
|
84
216
|
dealId: text('deal_id').references(() => deals.id, { onDelete: 'set null' }),
|
|
217
|
+
opportunityId: text('opportunity_id').references(() => opportunities.id, {
|
|
218
|
+
onDelete: 'set null',
|
|
219
|
+
}),
|
|
220
|
+
partnershipId: text('partnership_id').references(() => partnerships.id, {
|
|
221
|
+
onDelete: 'set null',
|
|
222
|
+
}),
|
|
223
|
+
enquiryId: text('enquiry_id').references(() => enquiries.id, { onDelete: 'set null' }),
|
|
224
|
+
actionLog: jsonb('action_log')
|
|
225
|
+
.$type()
|
|
226
|
+
.notNull()
|
|
227
|
+
.default([]),
|
|
85
228
|
createdAt: createdAt(),
|
|
86
229
|
}, (table) => [index('form_submissions_form_idx').on(table.formId)]);
|
|
87
230
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/modules/forms/schema.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/modules/forms/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,aAAa,EACb,cAAc,GACf,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAE/F,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAC1F,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAErE;;;;;GAKG;AACH,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,EACtB,gBAAgB,EAChB,uBAAuB,EACvB,aA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,GAAG,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE;QACvE,QAAQ,EAAE,UAAU;KACrB,CAAC;IACF,aAAa,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE;QACtE,QAAQ,EAAE,UAAU;KACrB,CAAC;IACF,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;IACtF,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC;SAC3B,KAAK,EAAwC;SAC7C,OAAO,EAAE;SACT,OAAO,CAAC,EAAE,CAAC;IACd,SAAS,EAAE,SAAS,EAAE;CACvB,EACD,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CACjE,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { FormAttachTarget, FormSubmissionLinkTarget } 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';
|
|
@@ -23,14 +24,23 @@ export interface FormsDependencies {
|
|
|
23
24
|
/** Injected so a test can pin the generated `public_key`. */
|
|
24
25
|
readonly generatePublicKey?: () => string;
|
|
25
26
|
}
|
|
26
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* A form as the API returns one: the stored row minus tenancy, with its
|
|
29
|
+
* fields, its list memberships, and its attach targets. `list_ids` and
|
|
30
|
+
* `attach_targets` are not columns of `forms` — they live in the joined
|
|
31
|
+
* `form_lists` / `form_attach_targets` tables — but they cross the wire
|
|
32
|
+
* nested under the form to keep write and read shapes symmetric.
|
|
33
|
+
*/
|
|
27
34
|
export type FormView = Omit<FormRecord, 'workspaceId'> & {
|
|
28
35
|
readonly fields: readonly FormFieldView[];
|
|
36
|
+
readonly listIds: readonly string[];
|
|
37
|
+
readonly attachTargets: readonly FormAttachTarget[];
|
|
29
38
|
};
|
|
30
39
|
export type FormFieldView = Omit<FormFieldRecord, 'workspaceId' | 'formId'>;
|
|
31
40
|
export type FormSubmissionView = Omit<FormSubmissionRecord, 'workspaceId'>;
|
|
32
41
|
export interface CreateFormInput {
|
|
33
42
|
readonly name: string;
|
|
43
|
+
readonly title: string;
|
|
34
44
|
readonly description: string | null;
|
|
35
45
|
readonly status: FormStatus;
|
|
36
46
|
readonly fields: readonly FieldDraft[];
|
|
@@ -38,10 +48,30 @@ export interface CreateFormInput {
|
|
|
38
48
|
readonly createDeal: boolean;
|
|
39
49
|
readonly dealStageId: string | null;
|
|
40
50
|
readonly dealNameTemplate: string | null;
|
|
51
|
+
readonly createOpportunity: boolean;
|
|
52
|
+
readonly opportunityKind: string | null;
|
|
53
|
+
readonly opportunityStageId: string | null;
|
|
54
|
+
readonly opportunityNameTemplate: string | null;
|
|
55
|
+
readonly opportunityOwnerId: string | null;
|
|
56
|
+
readonly createPartnership: boolean;
|
|
57
|
+
readonly partnershipKind: string | null;
|
|
58
|
+
readonly partnershipStageId: string | null;
|
|
59
|
+
readonly partnershipNameTemplate: string | null;
|
|
60
|
+
readonly partnershipOwnerId: string | null;
|
|
61
|
+
readonly createEnquiry: boolean;
|
|
62
|
+
readonly enquirySource: string | null;
|
|
63
|
+
readonly enquiryStageId: string | null;
|
|
64
|
+
readonly enquiryNameTemplate: string | null;
|
|
65
|
+
readonly enquiryOwnerId: string | null;
|
|
66
|
+
readonly personTags: readonly string[];
|
|
67
|
+
readonly companyTags: readonly string[];
|
|
68
|
+
readonly listIds: readonly string[];
|
|
69
|
+
readonly attachTargets: readonly FormAttachTarget[];
|
|
41
70
|
}
|
|
42
71
|
/** PATCH semantics: an absent field is left alone, and null clears a nullable one. */
|
|
43
72
|
export interface UpdateFormInput {
|
|
44
73
|
readonly name?: string | undefined;
|
|
74
|
+
readonly title?: string | undefined;
|
|
45
75
|
readonly description?: string | null | undefined;
|
|
46
76
|
readonly status?: FormStatus | undefined;
|
|
47
77
|
/** Absent leaves the field list alone. Present replaces all of it. */
|
|
@@ -50,6 +80,27 @@ export interface UpdateFormInput {
|
|
|
50
80
|
readonly createDeal?: boolean | undefined;
|
|
51
81
|
readonly dealStageId?: string | null | undefined;
|
|
52
82
|
readonly dealNameTemplate?: string | null | undefined;
|
|
83
|
+
readonly createOpportunity?: boolean | undefined;
|
|
84
|
+
readonly opportunityKind?: string | null | undefined;
|
|
85
|
+
readonly opportunityStageId?: string | null | undefined;
|
|
86
|
+
readonly opportunityNameTemplate?: string | null | undefined;
|
|
87
|
+
readonly opportunityOwnerId?: string | null | undefined;
|
|
88
|
+
readonly createPartnership?: boolean | undefined;
|
|
89
|
+
readonly partnershipKind?: string | null | undefined;
|
|
90
|
+
readonly partnershipStageId?: string | null | undefined;
|
|
91
|
+
readonly partnershipNameTemplate?: string | null | undefined;
|
|
92
|
+
readonly partnershipOwnerId?: string | null | undefined;
|
|
93
|
+
readonly createEnquiry?: boolean | undefined;
|
|
94
|
+
readonly enquirySource?: string | null | undefined;
|
|
95
|
+
readonly enquiryStageId?: string | null | undefined;
|
|
96
|
+
readonly enquiryNameTemplate?: string | null | undefined;
|
|
97
|
+
readonly enquiryOwnerId?: string | null | undefined;
|
|
98
|
+
readonly personTags?: readonly string[] | undefined;
|
|
99
|
+
readonly companyTags?: readonly string[] | undefined;
|
|
100
|
+
/** Absent leaves list memberships alone. Present replaces the whole set. */
|
|
101
|
+
readonly listIds?: readonly string[] | undefined;
|
|
102
|
+
/** Absent leaves attach targets alone. Present replaces the whole set. */
|
|
103
|
+
readonly attachTargets?: readonly FormAttachTarget[] | undefined;
|
|
53
104
|
}
|
|
54
105
|
export interface FormsService {
|
|
55
106
|
list(actor: Actor, filters: FormFilters, query: ListQueryParameters): Promise<Page<FormView>>;
|
|
@@ -58,6 +109,8 @@ export interface FormsService {
|
|
|
58
109
|
update(actor: Actor, id: string, changes: UpdateFormInput): Promise<FormView>;
|
|
59
110
|
remove(actor: Actor, id: string): Promise<void>;
|
|
60
111
|
listSubmissions(actor: Actor, formId: string, query: ListQueryParameters): Promise<Page<FormSubmissionView>>;
|
|
112
|
+
listSubmissionsLinkedTo(actor: Actor, target: FormSubmissionLinkTarget, targetId: string, query: ListQueryParameters): Promise<Page<FormSubmissionView>>;
|
|
113
|
+
getSubmission(actor: Actor, formId: string, submissionId: string): Promise<FormSubmissionView>;
|
|
61
114
|
}
|
|
62
115
|
export declare function createFormsService(dependencies: FormsDependencies): FormsService;
|
|
63
116
|
//# sourceMappingURL=service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/modules/forms/service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/modules/forms/service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,wBAAwB,EAEzB,MAAM,iBAAiB,CAAA;AAIxB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAErD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAEjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAExE,OAAO,KAAK,EAAe,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAEjF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO,aAAa,CAAA;AAMpB,OAAO,KAAK,EAAE,UAAU,EAAc,MAAM,aAAa,CAAA;AAQzD,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACX,UAAU,EACV,oBAAoB,EACrB,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,UA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