@kelpie/server 0.7.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/consumerEmailDomains.d.ts +2 -0
- package/dist/lib/consumerEmailDomains.d.ts.map +1 -0
- package/dist/lib/consumerEmailDomains.js +62 -0
- package/dist/lib/consumerEmailDomains.js.map +1 -0
- package/dist/lib/email.d.ts +7 -0
- package/dist/lib/email.d.ts.map +1 -1
- package/dist/lib/email.js.map +1 -1
- package/dist/lib/emailContent.d.ts +33 -0
- package/dist/lib/emailContent.d.ts.map +1 -0
- package/dist/lib/emailContent.js +54 -0
- package/dist/lib/emailContent.js.map +1 -0
- package/dist/lib/emailDomainAutoLink.d.ts +27 -0
- package/dist/lib/emailDomainAutoLink.d.ts.map +1 -0
- package/dist/lib/emailDomainAutoLink.js +119 -0
- package/dist/lib/emailDomainAutoLink.js.map +1 -0
- package/dist/lib/ids.d.ts +13 -0
- package/dist/lib/ids.d.ts.map +1 -1
- package/dist/lib/ids.js +13 -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 +18 -2
- package/dist/modules/attachedRecords.js.map +1 -1
- package/dist/modules/auth/preferences.d.ts +11 -1
- package/dist/modules/auth/preferences.d.ts.map +1 -1
- package/dist/modules/auth/preferences.js +11 -0
- package/dist/modules/auth/preferences.js.map +1 -1
- package/dist/modules/auth/routes.d.ts.map +1 -1
- package/dist/modules/auth/routes.js +18 -0
- package/dist/modules/auth/routes.js.map +1 -1
- package/dist/modules/auth/schema.d.ts +20 -0
- package/dist/modules/auth/schema.d.ts.map +1 -1
- package/dist/modules/auth/schema.js +11 -1
- package/dist/modules/auth/schema.js.map +1 -1
- package/dist/modules/auth/service.d.ts.map +1 -1
- package/dist/modules/auth/service.js +27 -3
- package/dist/modules/auth/service.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/repository.d.ts +2 -0
- package/dist/modules/companies/repository.d.ts.map +1 -1
- package/dist/modules/companies/repository.js +1 -0
- package/dist/modules/companies/repository.js.map +1 -1
- package/dist/modules/companies/routes.d.ts +16 -0
- package/dist/modules/companies/routes.d.ts.map +1 -1
- package/dist/modules/companies/routes.js +18 -0
- package/dist/modules/companies/routes.js.map +1 -1
- package/dist/modules/companies/schema.d.ts +37 -0
- package/dist/modules/companies/schema.d.ts.map +1 -1
- package/dist/modules/companies/schema.js +10 -1
- package/dist/modules/companies/schema.js.map +1 -1
- package/dist/modules/companies/service.d.ts +6 -0
- package/dist/modules/companies/service.d.ts.map +1 -1
- package/dist/modules/companies/service.js +45 -11
- 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 +21 -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/email-domain-linker/index.d.ts +12 -0
- package/dist/modules/email-domain-linker/index.d.ts.map +1 -0
- package/dist/modules/email-domain-linker/index.js +34 -0
- package/dist/modules/email-domain-linker/index.js.map +1 -0
- package/dist/modules/email-domain-linker/routes.d.ts +14 -0
- package/dist/modules/email-domain-linker/routes.d.ts.map +1 -0
- package/dist/modules/email-domain-linker/routes.js +15 -0
- package/dist/modules/email-domain-linker/routes.js.map +1 -0
- package/dist/modules/email-domain-linker/service.d.ts +37 -0
- package/dist/modules/email-domain-linker/service.d.ts.map +1 -0
- package/dist/modules/email-domain-linker/service.js +63 -0
- package/dist/modules/email-domain-linker/service.js.map +1 -0
- 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 +4 -0
- package/dist/modules/eventCatalogs.d.ts.map +1 -1
- package/dist/modules/eventCatalogs.js +4 -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/events.d.ts +42 -0
- package/dist/modules/lists/events.d.ts.map +1 -0
- package/dist/modules/lists/events.js +16 -0
- package/dist/modules/lists/events.js.map +1 -0
- package/dist/modules/lists/index.d.ts +10 -0
- package/dist/modules/lists/index.d.ts.map +1 -0
- package/dist/modules/lists/index.js +35 -0
- package/dist/modules/lists/index.js.map +1 -0
- package/dist/modules/lists/repository.d.ts +80 -0
- package/dist/modules/lists/repository.d.ts.map +1 -0
- package/dist/modules/lists/repository.js +178 -0
- package/dist/modules/lists/repository.js.map +1 -0
- package/dist/modules/lists/routes.d.ts +55 -0
- package/dist/modules/lists/routes.d.ts.map +1 -0
- package/dist/modules/lists/routes.js +168 -0
- package/dist/modules/lists/routes.js.map +1 -0
- package/dist/modules/lists/schema.d.ts +281 -0
- package/dist/modules/lists/schema.d.ts.map +1 -0
- package/dist/modules/lists/schema.js +83 -0
- package/dist/modules/lists/schema.js.map +1 -0
- package/dist/modules/lists/service.d.ts +82 -0
- package/dist/modules/lists/service.d.ts.map +1 -0
- package/dist/modules/lists/service.js +262 -0
- package/dist/modules/lists/service.js.map +1 -0
- package/dist/modules/lists/tools.d.ts +4 -0
- package/dist/modules/lists/tools.d.ts.map +1 -0
- package/dist/modules/lists/tools.js +86 -0
- package/dist/modules/lists/tools.js.map +1 -0
- 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 +11 -0
- package/dist/modules/people/repository.d.ts.map +1 -1
- package/dist/modules/people/repository.js +21 -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 +131 -36
- 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/positions/routes.d.ts.map +1 -1
- package/dist/modules/positions/routes.js +4 -2
- package/dist/modules/positions/routes.js.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 +160 -0
- package/dist/modules/sample-data/fixture.d.ts.map +1 -0
- package/dist/modules/sample-data/fixture.js +501 -0
- package/dist/modules/sample-data/fixture.js.map +1 -0
- package/dist/modules/sample-data/index.d.ts +11 -0
- package/dist/modules/sample-data/index.d.ts.map +1 -0
- package/dist/modules/sample-data/index.js +44 -0
- package/dist/modules/sample-data/index.js.map +1 -0
- package/dist/modules/sample-data/routes.d.ts +15 -0
- package/dist/modules/sample-data/routes.d.ts.map +1 -0
- package/dist/modules/sample-data/routes.js +25 -0
- package/dist/modules/sample-data/routes.js.map +1 -0
- package/dist/modules/sample-data/service.d.ts +39 -0
- package/dist/modules/sample-data/service.d.ts.map +1 -0
- package/dist/modules/sample-data/service.js +481 -0
- package/dist/modules/sample-data/service.js.map +1 -0
- package/dist/modules/sample-data/tools.d.ts +4 -0
- package/dist/modules/sample-data/tools.d.ts.map +1 -0
- package/dist/modules/sample-data/tools.js +22 -0
- package/dist/modules/sample-data/tools.js.map +1 -0
- 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/smtp-email/index.d.ts +1 -0
- package/dist/modules/smtp-email/index.d.ts.map +1 -1
- package/dist/modules/smtp-email/index.js +1 -0
- package/dist/modules/smtp-email/index.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 +20 -1
- 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 +4 -0
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +4 -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/0021_certain_maggott.sql +30 -0
- package/migrations/0022_stormy_manta.sql +1 -0
- package/migrations/0023_funny_maddog.sql +1 -0
- 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/0021_snapshot.json +5389 -0
- package/migrations/meta/0022_snapshot.json +5396 -0
- package/migrations/meta/0023_snapshot.json +5403 -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 +112 -0
- package/package.json +3 -2
- package/src/lib/consumerEmailDomains.ts +62 -0
- package/src/lib/email.ts +7 -0
- package/src/lib/emailContent.ts +91 -0
- package/src/lib/emailDomainAutoLink.ts +165 -0
- package/src/lib/ids.ts +13 -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 +37 -3
- package/src/modules/auth/preferences.ts +13 -1
- package/src/modules/auth/routes.ts +22 -0
- package/src/modules/auth/schema.ts +12 -2
- package/src/modules/auth/service.ts +37 -3
- package/src/modules/companies/index.ts +3 -1
- package/src/modules/companies/repository.ts +3 -0
- package/src/modules/companies/routes.ts +20 -0
- package/src/modules/companies/schema.ts +11 -1
- package/src/modules/companies/service.ts +72 -12
- 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 +21 -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/email-domain-linker/index.ts +40 -0
- package/src/modules/email-domain-linker/routes.ts +40 -0
- package/src/modules/email-domain-linker/service.ts +122 -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 +4 -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/events.ts +41 -0
- package/src/modules/lists/index.ts +41 -0
- package/src/modules/lists/repository.ts +343 -0
- package/src/modules/lists/routes.ts +255 -0
- package/src/modules/lists/schema.ts +95 -0
- package/src/modules/lists/service.ts +505 -0
- package/src/modules/lists/tools.ts +128 -0
- 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 +31 -0
- package/src/modules/people/routes.ts +127 -18
- package/src/modules/people/schema.ts +109 -3
- package/src/modules/people/service.ts +205 -39
- package/src/modules/people/tools.ts +5 -1
- package/src/modules/personLinks.ts +278 -0
- package/src/modules/positions/routes.ts +4 -2
- 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 +690 -0
- package/src/modules/sample-data/index.ts +51 -0
- package/src/modules/sample-data/routes.ts +50 -0
- package/src/modules/sample-data/service.ts +679 -0
- package/src/modules/sample-data/tools.ts +32 -0
- 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/smtp-email/index.ts +8 -1
- 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 +27 -1
- package/src/modules/workspace/starters.ts +5 -0
- package/src/runtime/events.ts +1 -0
- package/src/schema/index.ts +4 -0
- package/src/testing/database.ts +97 -11
|
@@ -25,23 +25,6 @@ export declare function findPartnership(db: Queryable, workspaceId: string, id:
|
|
|
25
25
|
export declare function insertPartnership(db: Queryable, values: PartnershipColumns): Promise<PartnershipRecord>;
|
|
26
26
|
export declare function updatePartnership(db: Queryable, workspaceId: string, id: string, changes: Partial<PartnershipColumns>): Promise<PartnershipRecord | undefined>;
|
|
27
27
|
export declare function deletePartnership(db: Queryable, workspaceId: string, id: string): Promise<number>;
|
|
28
|
-
/** The key people on one partnership. Ordered by id so a response is stable across reads. */
|
|
29
|
-
export declare function listPersonIds(db: Queryable, partnershipId: string): Promise<string[]>;
|
|
30
|
-
/**
|
|
31
|
-
* The key people on each of a page of partnerships, in one query rather than one
|
|
32
|
-
* per row.
|
|
33
|
-
*
|
|
34
|
-
* @returns Ids missing from the map have no people.
|
|
35
|
-
*/
|
|
36
|
-
export declare function listPersonIdsFor(db: Queryable, partnershipIds: readonly string[]): Promise<ReadonlyMap<string, readonly string[]>>;
|
|
37
|
-
export declare function insertPartnershipPeople(db: Queryable, partnershipId: string, personIds: readonly string[]): Promise<void>;
|
|
38
|
-
export declare function deletePartnershipPeople(db: Queryable, partnershipId: string, personIds: readonly string[]): Promise<void>;
|
|
39
|
-
/**
|
|
40
|
-
* The names of these people in this workspace, keyed by id. An id missing from
|
|
41
|
-
* the map does not exist here, which is how `person_ids` is validated. Reads the
|
|
42
|
-
* `people` *table*, per the cross-relation rule in `architecture.md`.
|
|
43
|
-
*/
|
|
44
|
-
export declare function findPeopleNamed(db: Queryable, workspaceId: string, personIds: readonly string[]): Promise<ReadonlyMap<string, string>>;
|
|
45
28
|
/** Whether a member belongs to this workspace, for validating `owner_id`. */
|
|
46
29
|
export declare function memberExists(db: Queryable, workspaceId: string, memberId: string): Promise<boolean>;
|
|
47
30
|
//# sourceMappingURL=repository.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../src/modules/partnerships/repository.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAEzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAI7D,OAAO,
|
|
1
|
+
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../src/modules/partnerships/repository.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAEzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAI7D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,MAAM,MAAM,iBAAiB,GAAG,OAAO,YAAY,CAA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V,OAAO,EAAE,OAAO,CAAC,kBAAkB,CAAC,GACnC,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAQxC;AAED,wBAAsB,iBAAiB,CACrC,EAAE,EAAE,SAAS,EACb,WAAW,EAAE,MAAM,EACnB,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,MAAM,CAAC,CAOjB;AAED,6EAA6E;AAC7E,wBAAsB,YAAY,CAChC,EAAE,EAAE,SAAS,EACb,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,CAAC,CAQlB"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { and,
|
|
1
|
+
import { and, eq, ilike, inArray, or, sql } from 'drizzle-orm';
|
|
2
2
|
import { keysetCondition, orderByWindow, textSort, timestampSort } from '../../lib/pagination.js';
|
|
3
3
|
import { arrayContainsPattern, containsPattern } from '../../lib/search.js';
|
|
4
4
|
import { companies } from '../companies/schema.js';
|
|
5
|
-
import {
|
|
5
|
+
import { anyPersonLinked } from '../personLinks.js';
|
|
6
6
|
import { workspaceMembers } from '../workspace/schema.js';
|
|
7
|
-
import {
|
|
7
|
+
import { partnerships } from './schema.js';
|
|
8
8
|
/** The sort fields `?sort=` documents. The nullable touchpoint stays out: a keyset cannot seek past a null. */
|
|
9
9
|
export const PARTNERSHIP_SORTS = {
|
|
10
10
|
name: textSort(partnerships.name, (partnership) => partnership.name),
|
|
@@ -25,14 +25,6 @@ function companyNameMatches(pattern) {
|
|
|
25
25
|
and ${companies.name} ilike ${pattern}
|
|
26
26
|
)`;
|
|
27
27
|
}
|
|
28
|
-
function hasAnyOfPeople(personIds) {
|
|
29
|
-
return sql `exists (
|
|
30
|
-
select 1
|
|
31
|
-
from ${partnershipPeople}
|
|
32
|
-
where ${partnershipPeople.partnershipId} = ${partnerships.id}
|
|
33
|
-
and ${inArray(partnershipPeople.personId, personIds)}
|
|
34
|
-
)`;
|
|
35
|
-
}
|
|
36
28
|
function matchesTerm(term) {
|
|
37
29
|
const pattern = containsPattern(term);
|
|
38
30
|
return or(ilike(partnerships.name, pattern), ilike(partnerships.kind, pattern), ilike(partnerships.summary, pattern), arrayContainsPattern(partnerships.tags, pattern), companyNameMatches(pattern));
|
|
@@ -46,7 +38,9 @@ function conditionsFor(workspaceId, filters) {
|
|
|
46
38
|
? undefined
|
|
47
39
|
: inArray(partnerships.companyId, filters.companyIds),
|
|
48
40
|
filters.stageIds === undefined ? undefined : inArray(partnerships.stageId, filters.stageIds),
|
|
49
|
-
filters.personIds === undefined
|
|
41
|
+
filters.personIds === undefined
|
|
42
|
+
? undefined
|
|
43
|
+
: anyPersonLinked('partnership', partnerships.id, partnerships.workspaceId, filters.personIds),
|
|
50
44
|
];
|
|
51
45
|
}
|
|
52
46
|
/** @returns Up to `window.fetchLimit` rows: one more than the page, so the caller can tell there is a next one. */
|
|
@@ -88,76 +82,6 @@ export async function deletePartnership(db, workspaceId, id) {
|
|
|
88
82
|
.returning({ id: partnerships.id });
|
|
89
83
|
return deleted.length;
|
|
90
84
|
}
|
|
91
|
-
/** The key people on one partnership. Ordered by id so a response is stable across reads. */
|
|
92
|
-
export async function listPersonIds(db, partnershipId) {
|
|
93
|
-
const rows = await db
|
|
94
|
-
.select({ personId: partnershipPeople.personId })
|
|
95
|
-
.from(partnershipPeople)
|
|
96
|
-
.where(eq(partnershipPeople.partnershipId, partnershipId))
|
|
97
|
-
.orderBy(asc(partnershipPeople.personId));
|
|
98
|
-
return rows.map((row) => row.personId);
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* The key people on each of a page of partnerships, in one query rather than one
|
|
102
|
-
* per row.
|
|
103
|
-
*
|
|
104
|
-
* @returns Ids missing from the map have no people.
|
|
105
|
-
*/
|
|
106
|
-
export async function listPersonIdsFor(db, partnershipIds) {
|
|
107
|
-
if (partnershipIds.length === 0) {
|
|
108
|
-
return new Map();
|
|
109
|
-
}
|
|
110
|
-
const rows = await db
|
|
111
|
-
.select({
|
|
112
|
-
partnershipId: partnershipPeople.partnershipId,
|
|
113
|
-
personId: partnershipPeople.personId,
|
|
114
|
-
})
|
|
115
|
-
.from(partnershipPeople)
|
|
116
|
-
.where(inArray(partnershipPeople.partnershipId, partnershipIds))
|
|
117
|
-
.orderBy(asc(partnershipPeople.personId));
|
|
118
|
-
const byPartnership = new Map();
|
|
119
|
-
for (const row of rows) {
|
|
120
|
-
const existing = byPartnership.get(row.partnershipId);
|
|
121
|
-
if (existing === undefined) {
|
|
122
|
-
byPartnership.set(row.partnershipId, [row.personId]);
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
existing.push(row.personId);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return byPartnership;
|
|
129
|
-
}
|
|
130
|
-
export async function insertPartnershipPeople(db, partnershipId, personIds) {
|
|
131
|
-
if (personIds.length === 0) {
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
await db
|
|
135
|
-
.insert(partnershipPeople)
|
|
136
|
-
.values(personIds.map((personId) => ({ partnershipId, personId })));
|
|
137
|
-
}
|
|
138
|
-
export async function deletePartnershipPeople(db, partnershipId, personIds) {
|
|
139
|
-
if (personIds.length === 0) {
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
await db
|
|
143
|
-
.delete(partnershipPeople)
|
|
144
|
-
.where(and(eq(partnershipPeople.partnershipId, partnershipId), inArray(partnershipPeople.personId, personIds)));
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* The names of these people in this workspace, keyed by id. An id missing from
|
|
148
|
-
* the map does not exist here, which is how `person_ids` is validated. Reads the
|
|
149
|
-
* `people` *table*, per the cross-relation rule in `architecture.md`.
|
|
150
|
-
*/
|
|
151
|
-
export async function findPeopleNamed(db, workspaceId, personIds) {
|
|
152
|
-
if (personIds.length === 0) {
|
|
153
|
-
return new Map();
|
|
154
|
-
}
|
|
155
|
-
const rows = await db
|
|
156
|
-
.select({ id: people.id, name: people.name })
|
|
157
|
-
.from(people)
|
|
158
|
-
.where(and(eq(people.workspaceId, workspaceId), inArray(people.id, personIds)));
|
|
159
|
-
return new Map(rows.map((row) => [row.id, row.name]));
|
|
160
|
-
}
|
|
161
85
|
/** Whether a member belongs to this workspace, for validating `owner_id`. */
|
|
162
86
|
export async function memberExists(db, workspaceId, memberId) {
|
|
163
87
|
const [found] = await db
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository.js","sourceRoot":"","sources":["../../../src/modules/partnerships/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"repository.js","sourceRoot":"","sources":["../../../src/modules/partnerships/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAG9D,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAEjG,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAE3E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAO1C,+GAA+G;AAC/G,MAAM,CAAC,MAAM,iBAAiB,GAAsC;IAClE,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC;IACpE,UAAU,EAAE,aAAa,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC;IACzF,UAAU,EAAE,aAAa,CAAC,YAAY,CAAC,SAAS,EAA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SACrB,MAAM,CAAC,EAAE,EAAE,EAAE,gBAAgB,CAAC,EAAE,EAAE,CAAC;SACnC,IAAI,CAAC,gBAAgB,CAAC;SACtB,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,gBAAgB,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC;SAC5F,KAAK,CAAC,CAAC,CAAC,CAAA;IAEX,OAAO,KAAK,KAAK,SAAS,CAAA;AAC5B,CAAC"}
|
|
@@ -22,6 +22,13 @@ export declare const createBody: z.ZodObject<{
|
|
|
22
22
|
person_ids: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
23
23
|
summary: z.ZodDefault<z.ZodString>;
|
|
24
24
|
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
25
|
+
custom_fields: z.ZodDefault<z.ZodType<Readonly<Record<string, string | number | boolean | string[] | {
|
|
26
|
+
amount_cents: number;
|
|
27
|
+
currency: string;
|
|
28
|
+
} | null>>, unknown, z.core.$ZodTypeInternals<Readonly<Record<string, string | number | boolean | string[] | {
|
|
29
|
+
amount_cents: number;
|
|
30
|
+
currency: string;
|
|
31
|
+
} | null>>, unknown>>>;
|
|
25
32
|
}, z.core.$strict>;
|
|
26
33
|
export declare const updateBody: z.ZodObject<{
|
|
27
34
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -35,6 +42,13 @@ export declare const updateBody: z.ZodObject<{
|
|
|
35
42
|
person_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
36
43
|
summary: z.ZodOptional<z.ZodString>;
|
|
37
44
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
45
|
+
custom_fields: z.ZodOptional<z.ZodType<Readonly<Record<string, string | number | boolean | string[] | {
|
|
46
|
+
amount_cents: number;
|
|
47
|
+
currency: string;
|
|
48
|
+
} | null>>, unknown, z.core.$ZodTypeInternals<Readonly<Record<string, string | number | boolean | string[] | {
|
|
49
|
+
amount_cents: number;
|
|
50
|
+
currency: string;
|
|
51
|
+
} | null>>, unknown>>>;
|
|
38
52
|
}, z.core.$strict>;
|
|
39
53
|
export interface PartnershipsRoutesDependencies extends CredentialDependencies {
|
|
40
54
|
readonly service: PartnershipsService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../src/modules/partnerships/routes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../src/modules/partnerships/routes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAW,IAAI,EAAE,MAAM,MAAM,CAAA;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAEpE,OAAO,KAAK,EACV,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,cAAc,CAAA;AAoBrB;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;kBAYrB,CAAA;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;kBAA6C,CAAA;AAEpE,MAAM,WAAW,8BAA+B,SAAQ,sBAAsB;IAC5E,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAA;CACtC;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,GAAG,sBAAsB,CAetF;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,GAAG,sBAAsB,CAiBtF;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAkBzF;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,IAAI,EACZ,YAAY,EAAE,8BAA8B,GAC3C,IAAI,CAsDN"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { customFieldsPatchShape } from '@kelpie/schemas';
|
|
1
2
|
import { z } from 'zod';
|
|
2
3
|
import { isoDateSchema } from '../../lib/dates.js';
|
|
3
4
|
import { pageBody, readIdFilter, readJsonBody, readListParameters } from '../../lib/http.js';
|
|
4
5
|
import { resolveActorFrom } from '../auth/credentials.js';
|
|
6
|
+
import { renderCustomFieldsForWire } from '../custom-fields/wire.js';
|
|
5
7
|
/** Wire shapes for `/v1/partnerships`. Bodies are strict; an unknown field is a 422, per `api.md`. */
|
|
6
8
|
/** The full field set, without defaults. `createBody` adds those; `updateBody` makes it partial. */
|
|
7
9
|
const partnershipShape = {
|
|
@@ -16,6 +18,7 @@ const partnershipShape = {
|
|
|
16
18
|
person_ids: z.array(z.string().min(1)),
|
|
17
19
|
summary: z.string(),
|
|
18
20
|
tags: z.array(z.string().min(1)),
|
|
21
|
+
custom_fields: customFieldsPatchShape,
|
|
19
22
|
};
|
|
20
23
|
/**
|
|
21
24
|
* Only `name` and `company_id` are required: a partnership is with an
|
|
@@ -36,6 +39,7 @@ export const createBody = z.strictObject({
|
|
|
36
39
|
person_ids: partnershipShape.person_ids.default([]),
|
|
37
40
|
summary: partnershipShape.summary.default(''),
|
|
38
41
|
tags: partnershipShape.tags.default([]),
|
|
42
|
+
custom_fields: partnershipShape.custom_fields.default({}),
|
|
39
43
|
});
|
|
40
44
|
export const updateBody = z.strictObject(partnershipShape).partial();
|
|
41
45
|
export function toCreateInput(body) {
|
|
@@ -51,6 +55,7 @@ export function toCreateInput(body) {
|
|
|
51
55
|
personIds: body.person_ids,
|
|
52
56
|
summary: body.summary,
|
|
53
57
|
tags: body.tags,
|
|
58
|
+
customFields: body.custom_fields,
|
|
54
59
|
};
|
|
55
60
|
}
|
|
56
61
|
export function toUpdateInput(body) {
|
|
@@ -68,6 +73,7 @@ export function toUpdateInput(body) {
|
|
|
68
73
|
...(body.person_ids === undefined ? {} : { personIds: body.person_ids }),
|
|
69
74
|
...(body.summary === undefined ? {} : { summary: body.summary }),
|
|
70
75
|
...(body.tags === undefined ? {} : { tags: body.tags }),
|
|
76
|
+
...(body.custom_fields === undefined ? {} : { customFields: body.custom_fields }),
|
|
71
77
|
};
|
|
72
78
|
}
|
|
73
79
|
export function partnershipResponse(partnership) {
|
|
@@ -84,6 +90,7 @@ export function partnershipResponse(partnership) {
|
|
|
84
90
|
person_ids: partnership.personIds,
|
|
85
91
|
summary: partnership.summary,
|
|
86
92
|
tags: partnership.tags,
|
|
93
|
+
custom_fields: renderCustomFieldsForWire(partnership.customFields),
|
|
87
94
|
created_at: partnership.createdAt.toISOString(),
|
|
88
95
|
updated_at: partnership.updatedAt.toISOString(),
|
|
89
96
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../../src/modules/partnerships/routes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../../src/modules/partnerships/routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAExD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAE5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAEzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAA;AAQpE,sGAAsG;AAEtG,oGAAoG;AACpG,MAAM,gBAAgB,GAAG;IACvB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IA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,OAAO,CAAC,MAAM,CACnD,MAAM,YAAY,CAAC,OAAO,CAAC,EAC3B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EACvB,aAAa,CAAC,IAAI,CAAC,CACpB,CAAA;QAED,OAAO,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC,CAAA;IACvD,CAAC,CAAC,CAAA;IAEF,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QACnD,MAAM,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,YAAY,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;QAEvF,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAChC,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CustomFieldValue } from '@kelpie/schemas';
|
|
1
2
|
/**
|
|
2
3
|
* Ongoing two-way relationships. Status is a pipeline stage of kind
|
|
3
4
|
* `partnership`. There is no favour ledger (`brief.md` non-goal).
|
|
@@ -236,6 +237,25 @@ export declare const partnerships: import("drizzle-orm/pg-core").PgTableWithColu
|
|
|
236
237
|
}, {}, {}, import("drizzle-orm").ColumnBuilderExtraConfig>;
|
|
237
238
|
size: undefined;
|
|
238
239
|
}>;
|
|
240
|
+
customFields: import("drizzle-orm/pg-core").PgColumn<{
|
|
241
|
+
name: "custom_fields";
|
|
242
|
+
tableName: "partnerships";
|
|
243
|
+
dataType: "json";
|
|
244
|
+
columnType: "PgJsonb";
|
|
245
|
+
data: Readonly<Record<string, CustomFieldValue>>;
|
|
246
|
+
driverParam: unknown;
|
|
247
|
+
notNull: true;
|
|
248
|
+
hasDefault: true;
|
|
249
|
+
isPrimaryKey: false;
|
|
250
|
+
isAutoincrement: false;
|
|
251
|
+
hasRuntimeDefault: false;
|
|
252
|
+
enumValues: undefined;
|
|
253
|
+
baseColumn: never;
|
|
254
|
+
identity: undefined;
|
|
255
|
+
generated: undefined;
|
|
256
|
+
}, {}, {
|
|
257
|
+
$type: Readonly<Record<string, CustomFieldValue>>;
|
|
258
|
+
}>;
|
|
239
259
|
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
240
260
|
name: "created_at";
|
|
241
261
|
tableName: "partnerships";
|
|
@@ -294,45 +314,4 @@ export declare const partnerships: import("drizzle-orm/pg-core").PgTableWithColu
|
|
|
294
314
|
};
|
|
295
315
|
dialect: 'pg';
|
|
296
316
|
}>;
|
|
297
|
-
export declare const partnershipPeople: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
298
|
-
name: "partnership_people";
|
|
299
|
-
schema: undefined;
|
|
300
|
-
columns: {
|
|
301
|
-
partnershipId: import("drizzle-orm/pg-core").PgColumn<{
|
|
302
|
-
name: "partnership_id";
|
|
303
|
-
tableName: "partnership_people";
|
|
304
|
-
dataType: "string";
|
|
305
|
-
columnType: "PgText";
|
|
306
|
-
data: string;
|
|
307
|
-
driverParam: string;
|
|
308
|
-
notNull: true;
|
|
309
|
-
hasDefault: false;
|
|
310
|
-
isPrimaryKey: false;
|
|
311
|
-
isAutoincrement: false;
|
|
312
|
-
hasRuntimeDefault: false;
|
|
313
|
-
enumValues: [string, ...string[]];
|
|
314
|
-
baseColumn: never;
|
|
315
|
-
identity: undefined;
|
|
316
|
-
generated: undefined;
|
|
317
|
-
}, {}, {}>;
|
|
318
|
-
personId: import("drizzle-orm/pg-core").PgColumn<{
|
|
319
|
-
name: "person_id";
|
|
320
|
-
tableName: "partnership_people";
|
|
321
|
-
dataType: "string";
|
|
322
|
-
columnType: "PgText";
|
|
323
|
-
data: string;
|
|
324
|
-
driverParam: string;
|
|
325
|
-
notNull: true;
|
|
326
|
-
hasDefault: false;
|
|
327
|
-
isPrimaryKey: false;
|
|
328
|
-
isAutoincrement: false;
|
|
329
|
-
hasRuntimeDefault: false;
|
|
330
|
-
enumValues: [string, ...string[]];
|
|
331
|
-
baseColumn: never;
|
|
332
|
-
identity: undefined;
|
|
333
|
-
generated: undefined;
|
|
334
|
-
}, {}, {}>;
|
|
335
|
-
};
|
|
336
|
-
dialect: 'pg';
|
|
337
|
-
}>;
|
|
338
317
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/modules/partnerships/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/modules/partnerships/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AASvD;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CxB,CAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { date, index,
|
|
1
|
+
import { date, index, jsonb, pgTable, text } from 'drizzle-orm/pg-core';
|
|
2
2
|
import { createdAt, primaryId, searchVector, updatedAt } from '../../lib/columns.js';
|
|
3
3
|
import { companies } from '../companies/schema.js';
|
|
4
|
-
import { people } from '../people/schema.js';
|
|
5
4
|
import { pipelineStages } from '../pipelines/schema.js';
|
|
6
5
|
import { workspaceMembers, workspaces } from '../workspace/schema.js';
|
|
7
6
|
/**
|
|
@@ -27,6 +26,11 @@ export const partnerships = pgTable('partnerships', {
|
|
|
27
26
|
successLooksLike: text('success_looks_like').notNull().default(''),
|
|
28
27
|
summary: text('summary').notNull().default(''),
|
|
29
28
|
tags: text('tags').array().notNull().default([]),
|
|
29
|
+
// Workspace-defined fields, keyed by definition key. See people/schema.ts.
|
|
30
|
+
customFields: jsonb('custom_fields')
|
|
31
|
+
.$type()
|
|
32
|
+
.notNull()
|
|
33
|
+
.default({}),
|
|
30
34
|
createdAt: createdAt(),
|
|
31
35
|
updatedAt: updatedAt(),
|
|
32
36
|
searchVector: searchVector(() => [
|
|
@@ -43,12 +47,4 @@ export const partnerships = pgTable('partnerships', {
|
|
|
43
47
|
index('partnerships_stage_idx').on(table.stageId),
|
|
44
48
|
index('partnerships_search_idx').using('gin', table.searchVector),
|
|
45
49
|
]);
|
|
46
|
-
export const partnershipPeople = pgTable('partnership_people', {
|
|
47
|
-
partnershipId: text('partnership_id')
|
|
48
|
-
.notNull()
|
|
49
|
-
.references(() => partnerships.id, { onDelete: 'cascade' }),
|
|
50
|
-
personId: text('person_id')
|
|
51
|
-
.notNull()
|
|
52
|
-
.references(() => people.id, { onDelete: 'restrict' }),
|
|
53
|
-
}, (table) => [primaryKey({ columns: [table.partnershipId, table.personId] })]);
|
|
54
50
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/modules/partnerships/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/modules/partnerships/schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAEvE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAEpF,OAAO,EAAE,SAAS,EAAE,MAAM,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CACF,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CustomFieldWireValue } from '@kelpie/schemas';
|
|
1
2
|
import type { Database } from '../../lib/database.ts';
|
|
2
3
|
import type { IdFactory } from '../../lib/ids.ts';
|
|
3
4
|
import type { ListQueryParameters, Page } from '../../lib/pagination.ts';
|
|
@@ -5,12 +6,13 @@ import type { TransactionScope } from '../../runtime/transaction.ts';
|
|
|
5
6
|
import type { ActivityRecorder } from '../activities/recorder.ts';
|
|
6
7
|
import type { Actor } from '../auth/actor.ts';
|
|
7
8
|
import './events.ts';
|
|
9
|
+
import type { CustomFieldValuesValidator } from '../custom-fields/values.ts';
|
|
8
10
|
import type { PartnershipFilters, PartnershipRecord } from './repository.ts';
|
|
9
11
|
/**
|
|
10
12
|
* Partnerships: ongoing two-way relationships. Status is a stage of the
|
|
11
13
|
* `partnership` pipeline; there is no favour ledger (`brief.md` non-goal).
|
|
12
14
|
*
|
|
13
|
-
* Key people attach through `
|
|
15
|
+
* Key people attach through `person_links` and appear as `person_ids` on
|
|
14
16
|
* the wire, the Deals mechanics; kind is free text, the Opportunities mechanics.
|
|
15
17
|
* A stage move is an ordinary PATCH of `stage_id`, and it is the one change that
|
|
16
18
|
* files a `stage_changed` activity and a `stage.changed` event instead of the
|
|
@@ -22,6 +24,7 @@ export interface PartnershipsDependencies {
|
|
|
22
24
|
readonly createId: IdFactory;
|
|
23
25
|
readonly now: () => Date;
|
|
24
26
|
readonly recordActivity: ActivityRecorder;
|
|
27
|
+
readonly customFields: CustomFieldValuesValidator;
|
|
25
28
|
}
|
|
26
29
|
/** A partnership as the API returns one: the stored row minus tenancy, plus its people. */
|
|
27
30
|
export type PartnershipView = Omit<PartnershipRecord, 'workspaceId'> & {
|
|
@@ -45,6 +48,8 @@ export interface CreatePartnershipInput {
|
|
|
45
48
|
readonly personIds: readonly string[];
|
|
46
49
|
readonly summary: string;
|
|
47
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;
|
|
48
53
|
}
|
|
49
54
|
/** PATCH semantics: an absent field is left alone, and null clears a nullable one. */
|
|
50
55
|
export interface UpdatePartnershipInput {
|
|
@@ -60,6 +65,11 @@ export interface UpdatePartnershipInput {
|
|
|
60
65
|
readonly personIds?: readonly string[] | undefined;
|
|
61
66
|
readonly summary?: string | undefined;
|
|
62
67
|
readonly tags?: readonly string[] | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* Partial merge patch (wire shape): sent keys change, `null` clears a key,
|
|
70
|
+
* absent keys are left alone. Unknown keys are `422`.
|
|
71
|
+
*/
|
|
72
|
+
readonly customFields?: Readonly<Record<string, CustomFieldWireValue | null>> | undefined;
|
|
63
73
|
}
|
|
64
74
|
export interface PartnershipsService {
|
|
65
75
|
list(actor: Actor, filters: PartnershipFilters, query: ListQueryParameters): Promise<Page<PartnershipView>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/modules/partnerships/service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/modules/partnerships/service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAG3D,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;AACxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAUjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO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