@kelpie/ui 0.1.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/LICENSE +661 -0
- package/README.md +44 -0
- package/dist/ServiceStatus.d.ts +6 -0
- package/dist/ServiceStatus.d.ts.map +1 -0
- package/dist/ServiceStatus.js +35 -0
- package/dist/ServiceStatus.js.map +1 -0
- package/dist/api/ApiProvider.d.ts +19 -0
- package/dist/api/ApiProvider.d.ts.map +1 -0
- package/dist/api/ApiProvider.js +18 -0
- package/dist/api/ApiProvider.js.map +1 -0
- package/dist/api/client.d.ts +83 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +162 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/context.d.ts +14 -0
- package/dist/api/context.d.ts.map +1 -0
- package/dist/api/context.js +20 -0
- package/dist/api/context.js.map +1 -0
- package/dist/api/errors.d.ts +9 -0
- package/dist/api/errors.d.ts.map +1 -0
- package/dist/api/errors.js +14 -0
- package/dist/api/errors.js.map +1 -0
- package/dist/api/health.d.ts +15 -0
- package/dist/api/health.d.ts.map +1 -0
- package/dist/api/health.js +22 -0
- package/dist/api/health.js.map +1 -0
- package/dist/api/json.d.ts +3 -0
- package/dist/api/json.d.ts.map +1 -0
- package/dist/api/json.js +5 -0
- package/dist/api/json.js.map +1 -0
- package/dist/api/queryClient.d.ts +17 -0
- package/dist/api/queryClient.d.ts.map +1 -0
- package/dist/api/queryClient.js +33 -0
- package/dist/api/queryClient.js.map +1 -0
- package/dist/api/resource.d.ts +110 -0
- package/dist/api/resource.d.ts.map +1 -0
- package/dist/api/resource.js +238 -0
- package/dist/api/resource.js.map +1 -0
- package/dist/api/resources/account.d.ts +49 -0
- package/dist/api/resources/account.d.ts.map +1 -0
- package/dist/api/resources/account.js +146 -0
- package/dist/api/resources/account.js.map +1 -0
- package/dist/api/resources/activities.d.ts +8 -0
- package/dist/api/resources/activities.d.ts.map +1 -0
- package/dist/api/resources/activities.js +21 -0
- package/dist/api/resources/activities.js.map +1 -0
- package/dist/api/resources/agentTasks.d.ts +31 -0
- package/dist/api/resources/agentTasks.d.ts.map +1 -0
- package/dist/api/resources/agentTasks.js +103 -0
- package/dist/api/resources/agentTasks.js.map +1 -0
- package/dist/api/resources/candidates.d.ts +17 -0
- package/dist/api/resources/candidates.d.ts.map +1 -0
- package/dist/api/resources/candidates.js +40 -0
- package/dist/api/resources/candidates.js.map +1 -0
- package/dist/api/resources/companies.d.ts +22 -0
- package/dist/api/resources/companies.d.ts.map +1 -0
- package/dist/api/resources/companies.js +36 -0
- package/dist/api/resources/companies.js.map +1 -0
- package/dist/api/resources/dashboard.d.ts +8 -0
- package/dist/api/resources/dashboard.d.ts.map +1 -0
- package/dist/api/resources/dashboard.js +27 -0
- package/dist/api/resources/dashboard.js.map +1 -0
- package/dist/api/resources/deals.d.ts +30 -0
- package/dist/api/resources/deals.d.ts.map +1 -0
- package/dist/api/resources/deals.js +38 -0
- package/dist/api/resources/deals.js.map +1 -0
- package/dist/api/resources/decisions.d.ts +13 -0
- package/dist/api/resources/decisions.d.ts.map +1 -0
- package/dist/api/resources/decisions.js +38 -0
- package/dist/api/resources/decisions.js.map +1 -0
- package/dist/api/resources/forms.d.ts +82 -0
- package/dist/api/resources/forms.d.ts.map +1 -0
- package/dist/api/resources/forms.js +129 -0
- package/dist/api/resources/forms.js.map +1 -0
- package/dist/api/resources/handbookPages.d.ts +33 -0
- package/dist/api/resources/handbookPages.d.ts.map +1 -0
- package/dist/api/resources/handbookPages.js +49 -0
- package/dist/api/resources/handbookPages.js.map +1 -0
- package/dist/api/resources/importJobs.d.ts +72 -0
- package/dist/api/resources/importJobs.d.ts.map +1 -0
- package/dist/api/resources/importJobs.js +145 -0
- package/dist/api/resources/importJobs.js.map +1 -0
- package/dist/api/resources/invites.d.ts +19 -0
- package/dist/api/resources/invites.d.ts.map +1 -0
- package/dist/api/resources/invites.js +78 -0
- package/dist/api/resources/invites.js.map +1 -0
- package/dist/api/resources/mcpTools.d.ts +8 -0
- package/dist/api/resources/mcpTools.d.ts.map +1 -0
- package/dist/api/resources/mcpTools.js +23 -0
- package/dist/api/resources/mcpTools.js.map +1 -0
- package/dist/api/resources/members.d.ts +40 -0
- package/dist/api/resources/members.d.ts.map +1 -0
- package/dist/api/resources/members.js +67 -0
- package/dist/api/resources/members.js.map +1 -0
- package/dist/api/resources/moduleSettings.d.ts +14 -0
- package/dist/api/resources/moduleSettings.d.ts.map +1 -0
- package/dist/api/resources/moduleSettings.js +43 -0
- package/dist/api/resources/moduleSettings.js.map +1 -0
- package/dist/api/resources/mutation.d.ts +18 -0
- package/dist/api/resources/mutation.d.ts.map +1 -0
- package/dist/api/resources/mutation.js +12 -0
- package/dist/api/resources/mutation.js.map +1 -0
- package/dist/api/resources/notes.d.ts +14 -0
- package/dist/api/resources/notes.d.ts.map +1 -0
- package/dist/api/resources/notes.js +39 -0
- package/dist/api/resources/notes.js.map +1 -0
- package/dist/api/resources/opportunities.d.ts +29 -0
- package/dist/api/resources/opportunities.d.ts.map +1 -0
- package/dist/api/resources/opportunities.js +38 -0
- package/dist/api/resources/opportunities.js.map +1 -0
- package/dist/api/resources/partnerships.d.ts +33 -0
- package/dist/api/resources/partnerships.d.ts.map +1 -0
- package/dist/api/resources/partnerships.js +39 -0
- package/dist/api/resources/partnerships.js.map +1 -0
- package/dist/api/resources/people.d.ts +22 -0
- package/dist/api/resources/people.d.ts.map +1 -0
- package/dist/api/resources/people.js +36 -0
- package/dist/api/resources/people.js.map +1 -0
- package/dist/api/resources/pipelineStages.d.ts +22 -0
- package/dist/api/resources/pipelineStages.d.ts.map +1 -0
- package/dist/api/resources/pipelineStages.js +61 -0
- package/dist/api/resources/pipelineStages.js.map +1 -0
- package/dist/api/resources/planItems.d.ts +31 -0
- package/dist/api/resources/planItems.d.ts.map +1 -0
- package/dist/api/resources/planItems.js +60 -0
- package/dist/api/resources/planItems.js.map +1 -0
- package/dist/api/resources/positions.d.ts +23 -0
- package/dist/api/resources/positions.d.ts.map +1 -0
- package/dist/api/resources/positions.js +31 -0
- package/dist/api/resources/positions.js.map +1 -0
- package/dist/api/resources/raises.d.ts +30 -0
- package/dist/api/resources/raises.d.ts.map +1 -0
- package/dist/api/resources/raises.js +38 -0
- package/dist/api/resources/raises.js.map +1 -0
- package/dist/api/resources/roles.d.ts +20 -0
- package/dist/api/resources/roles.d.ts.map +1 -0
- package/dist/api/resources/roles.js +31 -0
- package/dist/api/resources/roles.js.map +1 -0
- package/dist/api/resources/search.d.ts +12 -0
- package/dist/api/resources/search.d.ts.map +1 -0
- package/dist/api/resources/search.js +37 -0
- package/dist/api/resources/search.js.map +1 -0
- package/dist/api/resources/session.d.ts +58 -0
- package/dist/api/resources/session.d.ts.map +1 -0
- package/dist/api/resources/session.js +157 -0
- package/dist/api/resources/session.js.map +1 -0
- package/dist/api/resources/webhooks.d.ts +45 -0
- package/dist/api/resources/webhooks.d.ts.map +1 -0
- package/dist/api/resources/webhooks.js +106 -0
- package/dist/api/resources/webhooks.js.map +1 -0
- package/dist/api/resources/workspace.d.ts +20 -0
- package/dist/api/resources/workspace.d.ts.map +1 -0
- package/dist/api/resources/workspace.js +63 -0
- package/dist/api/resources/workspace.js.map +1 -0
- package/dist/app/KelpieApp.d.ts +18 -0
- package/dist/app/KelpieApp.d.ts.map +1 -0
- package/dist/app/KelpieApp.js +59 -0
- package/dist/app/KelpieApp.js.map +1 -0
- package/dist/app/SessionGate.d.ts +14 -0
- package/dist/app/SessionGate.d.ts.map +1 -0
- package/dist/app/SessionGate.js +33 -0
- package/dist/app/SessionGate.js.map +1 -0
- package/dist/components/ActivitiesPanel.d.ts +28 -0
- package/dist/components/ActivitiesPanel.d.ts.map +1 -0
- package/dist/components/ActivitiesPanel.js +75 -0
- package/dist/components/ActivitiesPanel.js.map +1 -0
- package/dist/components/AgentTasks.d.ts +16 -0
- package/dist/components/AgentTasks.d.ts.map +1 -0
- package/dist/components/AgentTasks.js +166 -0
- package/dist/components/AgentTasks.js.map +1 -0
- package/dist/components/Chip.d.ts +10 -0
- package/dist/components/Chip.d.ts.map +1 -0
- package/dist/components/Chip.js +21 -0
- package/dist/components/Chip.js.map +1 -0
- package/dist/components/CopyButton.d.ts +7 -0
- package/dist/components/CopyButton.d.ts.map +1 -0
- package/dist/components/CopyButton.js +30 -0
- package/dist/components/CopyButton.js.map +1 -0
- package/dist/components/DataTable.d.ts +36 -0
- package/dist/components/DataTable.d.ts.map +1 -0
- package/dist/components/DataTable.js +43 -0
- package/dist/components/DataTable.js.map +1 -0
- package/dist/components/DecisionsPanel.d.ts +14 -0
- package/dist/components/DecisionsPanel.d.ts.map +1 -0
- package/dist/components/DecisionsPanel.js +73 -0
- package/dist/components/DecisionsPanel.js.map +1 -0
- package/dist/components/DeleteRecord.d.ts +19 -0
- package/dist/components/DeleteRecord.d.ts.map +1 -0
- package/dist/components/DeleteRecord.js +22 -0
- package/dist/components/DeleteRecord.js.map +1 -0
- package/dist/components/EntitySearch.d.ts +33 -0
- package/dist/components/EntitySearch.d.ts.map +1 -0
- package/dist/components/EntitySearch.js +111 -0
- package/dist/components/EntitySearch.js.map +1 -0
- package/dist/components/ErrorBoundary.d.ts +21 -0
- package/dist/components/ErrorBoundary.d.ts.map +1 -0
- package/dist/components/ErrorBoundary.js +26 -0
- package/dist/components/ErrorBoundary.js.map +1 -0
- package/dist/components/InlineEdit.d.ts +37 -0
- package/dist/components/InlineEdit.d.ts.map +1 -0
- package/dist/components/InlineEdit.js +77 -0
- package/dist/components/InlineEdit.js.map +1 -0
- package/dist/components/KanbanBoard.d.ts +24 -0
- package/dist/components/KanbanBoard.d.ts.map +1 -0
- package/dist/components/KanbanBoard.js +92 -0
- package/dist/components/KanbanBoard.js.map +1 -0
- package/dist/components/MarkdownView.d.ts +4 -0
- package/dist/components/MarkdownView.d.ts.map +1 -0
- package/dist/components/MarkdownView.js +45 -0
- package/dist/components/MarkdownView.js.map +1 -0
- package/dist/components/NotesPanel.d.ts +17 -0
- package/dist/components/NotesPanel.d.ts.map +1 -0
- package/dist/components/NotesPanel.js +53 -0
- package/dist/components/NotesPanel.js.map +1 -0
- package/dist/components/PageHeader.d.ts +20 -0
- package/dist/components/PageHeader.d.ts.map +1 -0
- package/dist/components/PageHeader.js +15 -0
- package/dist/components/PageHeader.js.map +1 -0
- package/dist/components/PhonesField.d.ts +7 -0
- package/dist/components/PhonesField.d.ts.map +1 -0
- package/dist/components/PhonesField.js +92 -0
- package/dist/components/PhonesField.js.map +1 -0
- package/dist/components/PlanAttention.d.ts +40 -0
- package/dist/components/PlanAttention.d.ts.map +1 -0
- package/dist/components/PlanAttention.js +86 -0
- package/dist/components/PlanAttention.js.map +1 -0
- package/dist/components/PlanPanel.d.ts +18 -0
- package/dist/components/PlanPanel.d.ts.map +1 -0
- package/dist/components/PlanPanel.js +102 -0
- package/dist/components/PlanPanel.js.map +1 -0
- package/dist/components/QueryState.d.ts +24 -0
- package/dist/components/QueryState.d.ts.map +1 -0
- package/dist/components/QueryState.js +34 -0
- package/dist/components/QueryState.js.map +1 -0
- package/dist/components/RecordTabs.d.ts +16 -0
- package/dist/components/RecordTabs.d.ts.map +1 -0
- package/dist/components/RecordTabs.js +15 -0
- package/dist/components/RecordTabs.js.map +1 -0
- package/dist/components/SectionHeader.d.ts +15 -0
- package/dist/components/SectionHeader.d.ts.map +1 -0
- package/dist/components/SectionHeader.js +14 -0
- package/dist/components/SectionHeader.js.map +1 -0
- package/dist/components/SegmentedControl.d.ts +13 -0
- package/dist/components/SegmentedControl.d.ts.map +1 -0
- package/dist/components/SegmentedControl.js +14 -0
- package/dist/components/SegmentedControl.js.map +1 -0
- package/dist/components/Shell.d.ts +2 -0
- package/dist/components/Shell.d.ts.map +1 -0
- package/dist/components/Shell.js +143 -0
- package/dist/components/Shell.js.map +1 -0
- package/dist/components/SidebarField.d.ts +8 -0
- package/dist/components/SidebarField.d.ts.map +1 -0
- package/dist/components/SidebarField.js +6 -0
- package/dist/components/SidebarField.js.map +1 -0
- package/dist/components/SocialProfilesField.d.ts +8 -0
- package/dist/components/SocialProfilesField.d.ts.map +1 -0
- package/dist/components/SocialProfilesField.js +176 -0
- package/dist/components/SocialProfilesField.js.map +1 -0
- package/dist/components/StageSettings.d.ts +16 -0
- package/dist/components/StageSettings.d.ts.map +1 -0
- package/dist/components/StageSettings.js +107 -0
- package/dist/components/StageSettings.js.map +1 -0
- package/dist/components/SummaryBlock.d.ts +12 -0
- package/dist/components/SummaryBlock.d.ts.map +1 -0
- package/dist/components/SummaryBlock.js +12 -0
- package/dist/components/SummaryBlock.js.map +1 -0
- package/dist/index.d.ts +90 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +55 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/dates.d.ts +26 -0
- package/dist/lib/dates.d.ts.map +1 -0
- package/dist/lib/dates.js +71 -0
- package/dist/lib/dates.js.map +1 -0
- package/dist/lib/money.d.ts +7 -0
- package/dist/lib/money.d.ts.map +1 -0
- package/dist/lib/money.js +13 -0
- package/dist/lib/money.js.map +1 -0
- package/dist/lib/names.d.ts +9 -0
- package/dist/lib/names.d.ts.map +1 -0
- package/dist/lib/names.js +13 -0
- package/dist/lib/names.js.map +1 -0
- package/dist/lib/plan.d.ts +67 -0
- package/dist/lib/plan.d.ts.map +1 -0
- package/dist/lib/plan.js +96 -0
- package/dist/lib/plan.js.map +1 -0
- package/dist/lib/theme.d.ts +19 -0
- package/dist/lib/theme.d.ts.map +1 -0
- package/dist/lib/theme.js +30 -0
- package/dist/lib/theme.js.map +1 -0
- package/dist/pages/CompaniesPage.d.ts +2 -0
- package/dist/pages/CompaniesPage.d.ts.map +1 -0
- package/dist/pages/CompaniesPage.js +77 -0
- package/dist/pages/CompaniesPage.js.map +1 -0
- package/dist/pages/CompanyDetail.d.ts +2 -0
- package/dist/pages/CompanyDetail.d.ts.map +1 -0
- package/dist/pages/CompanyDetail.js +177 -0
- package/dist/pages/CompanyDetail.js.map +1 -0
- package/dist/pages/DealDetail.d.ts +2 -0
- package/dist/pages/DealDetail.d.ts.map +1 -0
- package/dist/pages/DealDetail.js +192 -0
- package/dist/pages/DealDetail.js.map +1 -0
- package/dist/pages/DealStageSettingsPage.d.ts +7 -0
- package/dist/pages/DealStageSettingsPage.d.ts.map +1 -0
- package/dist/pages/DealStageSettingsPage.js +38 -0
- package/dist/pages/DealStageSettingsPage.js.map +1 -0
- package/dist/pages/DealsPage.d.ts +2 -0
- package/dist/pages/DealsPage.d.ts.map +1 -0
- package/dist/pages/DealsPage.js +177 -0
- package/dist/pages/DealsPage.js.map +1 -0
- package/dist/pages/DecisionsPage.d.ts +2 -0
- package/dist/pages/DecisionsPage.d.ts.map +1 -0
- package/dist/pages/DecisionsPage.js +121 -0
- package/dist/pages/DecisionsPage.js.map +1 -0
- package/dist/pages/FormDetail.d.ts +2 -0
- package/dist/pages/FormDetail.d.ts.map +1 -0
- package/dist/pages/FormDetail.js +56 -0
- package/dist/pages/FormDetail.js.map +1 -0
- package/dist/pages/FormsPage.d.ts +2 -0
- package/dist/pages/FormsPage.d.ts.map +1 -0
- package/dist/pages/FormsPage.js +67 -0
- package/dist/pages/FormsPage.js.map +1 -0
- package/dist/pages/FundraisingPage.d.ts +2 -0
- package/dist/pages/FundraisingPage.d.ts.map +1 -0
- package/dist/pages/FundraisingPage.js +187 -0
- package/dist/pages/FundraisingPage.js.map +1 -0
- package/dist/pages/HiringPage.d.ts +9 -0
- package/dist/pages/HiringPage.d.ts.map +1 -0
- package/dist/pages/HiringPage.js +73 -0
- package/dist/pages/HiringPage.js.map +1 -0
- package/dist/pages/NotFoundPage.d.ts +10 -0
- package/dist/pages/NotFoundPage.d.ts.map +1 -0
- package/dist/pages/NotFoundPage.js +14 -0
- package/dist/pages/NotFoundPage.js.map +1 -0
- package/dist/pages/OpportunitiesPage.d.ts +2 -0
- package/dist/pages/OpportunitiesPage.d.ts.map +1 -0
- package/dist/pages/OpportunitiesPage.js +184 -0
- package/dist/pages/OpportunitiesPage.js.map +1 -0
- package/dist/pages/OpportunityDetail.d.ts +2 -0
- package/dist/pages/OpportunityDetail.d.ts.map +1 -0
- package/dist/pages/OpportunityDetail.js +132 -0
- package/dist/pages/OpportunityDetail.js.map +1 -0
- package/dist/pages/OpportunityStageSettingsPage.d.ts +3 -0
- package/dist/pages/OpportunityStageSettingsPage.d.ts.map +1 -0
- package/dist/pages/OpportunityStageSettingsPage.js +34 -0
- package/dist/pages/OpportunityStageSettingsPage.js.map +1 -0
- package/dist/pages/PartnershipDetail.d.ts +2 -0
- package/dist/pages/PartnershipDetail.d.ts.map +1 -0
- package/dist/pages/PartnershipDetail.js +179 -0
- package/dist/pages/PartnershipDetail.js.map +1 -0
- package/dist/pages/PartnershipStageSettingsPage.d.ts +3 -0
- package/dist/pages/PartnershipStageSettingsPage.d.ts.map +1 -0
- package/dist/pages/PartnershipStageSettingsPage.js +34 -0
- package/dist/pages/PartnershipStageSettingsPage.js.map +1 -0
- package/dist/pages/PartnershipsPage.d.ts +2 -0
- package/dist/pages/PartnershipsPage.d.ts.map +1 -0
- package/dist/pages/PartnershipsPage.js +182 -0
- package/dist/pages/PartnershipsPage.js.map +1 -0
- package/dist/pages/PeoplePage.d.ts +10 -0
- package/dist/pages/PeoplePage.d.ts.map +1 -0
- package/dist/pages/PeoplePage.js +71 -0
- package/dist/pages/PeoplePage.js.map +1 -0
- package/dist/pages/PersonDetail.d.ts +2 -0
- package/dist/pages/PersonDetail.d.ts.map +1 -0
- package/dist/pages/PersonDetail.js +193 -0
- package/dist/pages/PersonDetail.js.map +1 -0
- package/dist/pages/PlanningPage.d.ts +2 -0
- package/dist/pages/PlanningPage.d.ts.map +1 -0
- package/dist/pages/PlanningPage.js +112 -0
- package/dist/pages/PlanningPage.js.map +1 -0
- package/dist/pages/RaiseDetail.d.ts +2 -0
- package/dist/pages/RaiseDetail.d.ts.map +1 -0
- package/dist/pages/RaiseDetail.js +198 -0
- package/dist/pages/RaiseDetail.js.map +1 -0
- package/dist/pages/RaiseStageSettingsPage.d.ts +3 -0
- package/dist/pages/RaiseStageSettingsPage.d.ts.map +1 -0
- package/dist/pages/RaiseStageSettingsPage.js +34 -0
- package/dist/pages/RaiseStageSettingsPage.js.map +1 -0
- package/dist/pages/RoleDetail.d.ts +2 -0
- package/dist/pages/RoleDetail.d.ts.map +1 -0
- package/dist/pages/RoleDetail.js +177 -0
- package/dist/pages/RoleDetail.js.map +1 -0
- package/dist/pages/SearchPage.d.ts +2 -0
- package/dist/pages/SearchPage.d.ts.map +1 -0
- package/dist/pages/SearchPage.js +51 -0
- package/dist/pages/SearchPage.js.map +1 -0
- package/dist/pages/account/AccountLayout.d.ts +2 -0
- package/dist/pages/account/AccountLayout.d.ts.map +1 -0
- package/dist/pages/account/AccountLayout.js +25 -0
- package/dist/pages/account/AccountLayout.js.map +1 -0
- package/dist/pages/account/Field.d.ts +8 -0
- package/dist/pages/account/Field.d.ts.map +1 -0
- package/dist/pages/account/Field.js +6 -0
- package/dist/pages/account/Field.js.map +1 -0
- package/dist/pages/account/PreferencesPage.d.ts +2 -0
- package/dist/pages/account/PreferencesPage.d.ts.map +1 -0
- package/dist/pages/account/PreferencesPage.js +92 -0
- package/dist/pages/account/PreferencesPage.js.map +1 -0
- package/dist/pages/account/ProfilePage.d.ts +14 -0
- package/dist/pages/account/ProfilePage.d.ts.map +1 -0
- package/dist/pages/account/ProfilePage.js +71 -0
- package/dist/pages/account/ProfilePage.js.map +1 -0
- package/dist/pages/account/SecurityPage.d.ts +11 -0
- package/dist/pages/account/SecurityPage.d.ts.map +1 -0
- package/dist/pages/account/SecurityPage.js +78 -0
- package/dist/pages/account/SecurityPage.js.map +1 -0
- package/dist/pages/admin/DataPage.d.ts +3 -0
- package/dist/pages/admin/DataPage.d.ts.map +1 -0
- package/dist/pages/admin/DataPage.js +210 -0
- package/dist/pages/admin/DataPage.js.map +1 -0
- package/dist/pages/admin/McpPage.d.ts +2 -0
- package/dist/pages/admin/McpPage.d.ts.map +1 -0
- package/dist/pages/admin/McpPage.js +128 -0
- package/dist/pages/admin/McpPage.js.map +1 -0
- package/dist/pages/admin/ModulesPage.d.ts +2 -0
- package/dist/pages/admin/ModulesPage.d.ts.map +1 -0
- package/dist/pages/admin/ModulesPage.js +53 -0
- package/dist/pages/admin/ModulesPage.js.map +1 -0
- package/dist/pages/admin/TeamPage.d.ts +2 -0
- package/dist/pages/admin/TeamPage.d.ts.map +1 -0
- package/dist/pages/admin/TeamPage.js +99 -0
- package/dist/pages/admin/TeamPage.js.map +1 -0
- package/dist/pages/admin/WebhookDeliveries.d.ts +4 -0
- package/dist/pages/admin/WebhookDeliveries.d.ts.map +1 -0
- package/dist/pages/admin/WebhookDeliveries.js +88 -0
- package/dist/pages/admin/WebhookDeliveries.js.map +1 -0
- package/dist/pages/admin/WebhooksPage.d.ts +2 -0
- package/dist/pages/admin/WebhooksPage.d.ts.map +1 -0
- package/dist/pages/admin/WebhooksPage.js +152 -0
- package/dist/pages/admin/WebhooksPage.js.map +1 -0
- package/dist/pages/admin/WorkspaceSettingsPage.d.ts +2 -0
- package/dist/pages/admin/WorkspaceSettingsPage.d.ts.map +1 -0
- package/dist/pages/admin/WorkspaceSettingsPage.js +117 -0
- package/dist/pages/admin/WorkspaceSettingsPage.js.map +1 -0
- package/dist/pages/auth/AuthForm.d.ts +46 -0
- package/dist/pages/auth/AuthForm.d.ts.map +1 -0
- package/dist/pages/auth/AuthForm.js +32 -0
- package/dist/pages/auth/AuthForm.js.map +1 -0
- package/dist/pages/auth/AuthLayout.d.ts +24 -0
- package/dist/pages/auth/AuthLayout.d.ts.map +1 -0
- package/dist/pages/auth/AuthLayout.js +19 -0
- package/dist/pages/auth/AuthLayout.js.map +1 -0
- package/dist/pages/auth/ForgotPasswordPage.d.ts +13 -0
- package/dist/pages/auth/ForgotPasswordPage.d.ts.map +1 -0
- package/dist/pages/auth/ForgotPasswordPage.js +39 -0
- package/dist/pages/auth/ForgotPasswordPage.js.map +1 -0
- package/dist/pages/auth/JoinPage.d.ts +12 -0
- package/dist/pages/auth/JoinPage.d.ts.map +1 -0
- package/dist/pages/auth/JoinPage.js +43 -0
- package/dist/pages/auth/JoinPage.js.map +1 -0
- package/dist/pages/auth/ResetPasswordPage.d.ts +13 -0
- package/dist/pages/auth/ResetPasswordPage.d.ts.map +1 -0
- package/dist/pages/auth/ResetPasswordPage.js +58 -0
- package/dist/pages/auth/ResetPasswordPage.js.map +1 -0
- package/dist/pages/auth/SignInPage.d.ts +2 -0
- package/dist/pages/auth/SignInPage.d.ts.map +1 -0
- package/dist/pages/auth/SignInPage.js +38 -0
- package/dist/pages/auth/SignInPage.js.map +1 -0
- package/dist/pages/auth/SignUpPage.d.ts +13 -0
- package/dist/pages/auth/SignUpPage.d.ts.map +1 -0
- package/dist/pages/auth/SignUpPage.js +43 -0
- package/dist/pages/auth/SignUpPage.js.map +1 -0
- package/dist/pages/candidateFields.d.ts +22 -0
- package/dist/pages/candidateFields.d.ts.map +1 -0
- package/dist/pages/candidateFields.js +82 -0
- package/dist/pages/candidateFields.js.map +1 -0
- package/dist/pages/dashboard/DashboardPage.d.ts +2 -0
- package/dist/pages/dashboard/DashboardPage.d.ts.map +1 -0
- package/dist/pages/dashboard/DashboardPage.js +40 -0
- package/dist/pages/dashboard/DashboardPage.js.map +1 -0
- package/dist/pages/dashboard/attention.d.ts +41 -0
- package/dist/pages/dashboard/attention.d.ts.map +1 -0
- package/dist/pages/dashboard/attention.js +146 -0
- package/dist/pages/dashboard/attention.js.map +1 -0
- package/dist/pages/dashboard/sections.d.ts +20 -0
- package/dist/pages/dashboard/sections.d.ts.map +1 -0
- package/dist/pages/dashboard/sections.js +60 -0
- package/dist/pages/dashboard/sections.js.map +1 -0
- package/dist/pages/fields.d.ts +11 -0
- package/dist/pages/fields.d.ts.map +1 -0
- package/dist/pages/fields.js +17 -0
- package/dist/pages/fields.js.map +1 -0
- package/dist/pages/forms/EmbedPanel.d.ts +14 -0
- package/dist/pages/forms/EmbedPanel.d.ts.map +1 -0
- package/dist/pages/forms/EmbedPanel.js +19 -0
- package/dist/pages/forms/EmbedPanel.js.map +1 -0
- package/dist/pages/forms/FieldsEditor.d.ts +6 -0
- package/dist/pages/forms/FieldsEditor.d.ts.map +1 -0
- package/dist/pages/forms/FieldsEditor.js +115 -0
- package/dist/pages/forms/FieldsEditor.js.map +1 -0
- package/dist/pages/forms/FormSettings.d.ts +6 -0
- package/dist/pages/forms/FormSettings.d.ts.map +1 -0
- package/dist/pages/forms/FormSettings.js +47 -0
- package/dist/pages/forms/FormSettings.js.map +1 -0
- package/dist/pages/forms/SubmissionsTable.d.ts +8 -0
- package/dist/pages/forms/SubmissionsTable.d.ts.map +1 -0
- package/dist/pages/forms/SubmissionsTable.js +91 -0
- package/dist/pages/forms/SubmissionsTable.js.map +1 -0
- package/dist/pages/forms/fieldList.d.ts +70 -0
- package/dist/pages/forms/fieldList.d.ts.map +1 -0
- package/dist/pages/forms/fieldList.js +126 -0
- package/dist/pages/forms/fieldList.js.map +1 -0
- package/dist/pages/forms/template.d.ts +18 -0
- package/dist/pages/forms/template.d.ts.map +1 -0
- package/dist/pages/forms/template.js +34 -0
- package/dist/pages/forms/template.js.map +1 -0
- package/dist/pages/handbook/HandbookPage.d.ts +2 -0
- package/dist/pages/handbook/HandbookPage.d.ts.map +1 -0
- package/dist/pages/handbook/HandbookPage.js +197 -0
- package/dist/pages/handbook/HandbookPage.js.map +1 -0
- package/dist/pages/handbook/tree.d.ts +62 -0
- package/dist/pages/handbook/tree.d.ts.map +1 -0
- package/dist/pages/handbook/tree.js +222 -0
- package/dist/pages/handbook/tree.js.map +1 -0
- package/dist/pages/hiringDirectory.d.ts +60 -0
- package/dist/pages/hiringDirectory.d.ts.map +1 -0
- package/dist/pages/hiringDirectory.js +81 -0
- package/dist/pages/hiringDirectory.js.map +1 -0
- package/dist/pages/onboarding/HandbookStepPage.d.ts +14 -0
- package/dist/pages/onboarding/HandbookStepPage.d.ts.map +1 -0
- package/dist/pages/onboarding/HandbookStepPage.js +29 -0
- package/dist/pages/onboarding/HandbookStepPage.js.map +1 -0
- package/dist/pages/onboarding/InvitesStepPage.d.ts +2 -0
- package/dist/pages/onboarding/InvitesStepPage.d.ts.map +1 -0
- package/dist/pages/onboarding/InvitesStepPage.js +77 -0
- package/dist/pages/onboarding/InvitesStepPage.js.map +1 -0
- package/dist/pages/onboarding/WorkspaceStepPage.d.ts +2 -0
- package/dist/pages/onboarding/WorkspaceStepPage.d.ts.map +1 -0
- package/dist/pages/onboarding/WorkspaceStepPage.js +72 -0
- package/dist/pages/onboarding/WorkspaceStepPage.js.map +1 -0
- package/dist/pages/positionDirectory.d.ts +20 -0
- package/dist/pages/positionDirectory.d.ts.map +1 -0
- package/dist/pages/positionDirectory.js +58 -0
- package/dist/pages/positionDirectory.js.map +1 -0
- package/dist/registry/UiExtensionProvider.d.ts +12 -0
- package/dist/registry/UiExtensionProvider.d.ts.map +1 -0
- package/dist/registry/UiExtensionProvider.js +10 -0
- package/dist/registry/UiExtensionProvider.js.map +1 -0
- package/dist/registry/context.d.ts +31 -0
- package/dist/registry/context.d.ts.map +1 -0
- package/dist/registry/context.js +45 -0
- package/dist/registry/context.js.map +1 -0
- package/dist/registry/contributions.d.ts +71 -0
- package/dist/registry/contributions.d.ts.map +1 -0
- package/dist/registry/contributions.js +25 -0
- package/dist/registry/contributions.js.map +1 -0
- package/dist/registry/overridable.d.ts +27 -0
- package/dist/registry/overridable.d.ts.map +1 -0
- package/dist/registry/overridable.js +29 -0
- package/dist/registry/overridable.js.map +1 -0
- package/dist/registry/registry.d.ts +68 -0
- package/dist/registry/registry.d.ts.map +1 -0
- package/dist/registry/registry.js +112 -0
- package/dist/registry/registry.js.map +1 -0
- package/dist/testing/inputs.d.ts +13 -0
- package/dist/testing/inputs.d.ts.map +1 -0
- package/dist/testing/inputs.js +16 -0
- package/dist/testing/inputs.js.map +1 -0
- package/dist/testing/stubClient.d.ts +42 -0
- package/dist/testing/stubClient.d.ts.map +1 -0
- package/dist/testing/stubClient.js +29 -0
- package/dist/testing/stubClient.js.map +1 -0
- package/package.json +73 -0
- package/src/ServiceStatus.tsx +61 -0
- package/src/api/ApiProvider.tsx +40 -0
- package/src/api/client.ts +267 -0
- package/src/api/context.ts +25 -0
- package/src/api/errors.ts +14 -0
- package/src/api/health.ts +38 -0
- package/src/api/json.ts +4 -0
- package/src/api/queryClient.ts +35 -0
- package/src/api/resource.ts +412 -0
- package/src/api/resources/account.ts +220 -0
- package/src/api/resources/activities.ts +31 -0
- package/src/api/resources/agentTasks.ts +172 -0
- package/src/api/resources/candidates.ts +69 -0
- package/src/api/resources/companies.ts +72 -0
- package/src/api/resources/dashboard.ts +39 -0
- package/src/api/resources/deals.ts +82 -0
- package/src/api/resources/decisions.ts +60 -0
- package/src/api/resources/forms.ts +218 -0
- package/src/api/resources/handbookPages.ts +77 -0
- package/src/api/resources/importJobs.ts +229 -0
- package/src/api/resources/invites.ts +112 -0
- package/src/api/resources/mcpTools.ts +28 -0
- package/src/api/resources/members.ts +105 -0
- package/src/api/resources/moduleSettings.ts +67 -0
- package/src/api/resources/mutation.ts +31 -0
- package/src/api/resources/notes.ts +62 -0
- package/src/api/resources/opportunities.ts +84 -0
- package/src/api/resources/partnerships.ts +89 -0
- package/src/api/resources/people.ts +72 -0
- package/src/api/resources/pipelineStages.ts +93 -0
- package/src/api/resources/planItems.ts +103 -0
- package/src/api/resources/positions.ts +70 -0
- package/src/api/resources/raises.ts +82 -0
- package/src/api/resources/roles.ts +65 -0
- package/src/api/resources/search.ts +49 -0
- package/src/api/resources/session.ts +220 -0
- package/src/api/resources/webhooks.ts +157 -0
- package/src/api/resources/workspace.ts +81 -0
- package/src/app/KelpieApp.tsx +162 -0
- package/src/app/SessionGate.tsx +42 -0
- package/src/components/ActivitiesPanel.tsx +235 -0
- package/src/components/AgentTasks.tsx +473 -0
- package/src/components/Chip.tsx +36 -0
- package/src/components/CopyButton.tsx +48 -0
- package/src/components/DataTable.tsx +209 -0
- package/src/components/DecisionsPanel.tsx +233 -0
- package/src/components/DeleteRecord.tsx +73 -0
- package/src/components/EntitySearch.tsx +268 -0
- package/src/components/ErrorBoundary.tsx +58 -0
- package/src/components/InlineEdit.tsx +179 -0
- package/src/components/KanbanBoard.tsx +234 -0
- package/src/components/MarkdownView.tsx +73 -0
- package/src/components/NotesPanel.tsx +169 -0
- package/src/components/PageHeader.tsx +61 -0
- package/src/components/PhonesField.tsx +204 -0
- package/src/components/PlanAttention.tsx +249 -0
- package/src/components/PlanPanel.tsx +317 -0
- package/src/components/QueryState.tsx +83 -0
- package/src/components/RecordTabs.tsx +69 -0
- package/src/components/SectionHeader.tsx +63 -0
- package/src/components/SegmentedControl.tsx +48 -0
- package/src/components/Shell.tsx +300 -0
- package/src/components/SidebarField.tsx +18 -0
- package/src/components/SocialProfilesField.tsx +356 -0
- package/src/components/StageSettings.tsx +319 -0
- package/src/components/SummaryBlock.tsx +27 -0
- package/src/index.ts +190 -0
- package/src/lib/dates.ts +90 -0
- package/src/lib/money.ts +12 -0
- package/src/lib/names.ts +13 -0
- package/src/lib/plan.ts +147 -0
- package/src/lib/theme.ts +53 -0
- package/src/pages/CompaniesPage.tsx +143 -0
- package/src/pages/CompanyDetail.tsx +502 -0
- package/src/pages/DealDetail.tsx +512 -0
- package/src/pages/DealStageSettingsPage.tsx +67 -0
- package/src/pages/DealsPage.tsx +342 -0
- package/src/pages/DecisionsPage.tsx +211 -0
- package/src/pages/FormDetail.tsx +130 -0
- package/src/pages/FormsPage.tsx +151 -0
- package/src/pages/FundraisingPage.tsx +354 -0
- package/src/pages/HiringPage.tsx +169 -0
- package/src/pages/NotFoundPage.tsx +27 -0
- package/src/pages/OpportunitiesPage.tsx +349 -0
- package/src/pages/OpportunityDetail.tsx +337 -0
- package/src/pages/OpportunityStageSettingsPage.tsx +63 -0
- package/src/pages/PartnershipDetail.tsx +490 -0
- package/src/pages/PartnershipStageSettingsPage.tsx +63 -0
- package/src/pages/PartnershipsPage.tsx +353 -0
- package/src/pages/PeoplePage.tsx +145 -0
- package/src/pages/PersonDetail.tsx +526 -0
- package/src/pages/PlanningPage.tsx +318 -0
- package/src/pages/RaiseDetail.tsx +498 -0
- package/src/pages/RaiseStageSettingsPage.tsx +63 -0
- package/src/pages/RoleDetail.tsx +455 -0
- package/src/pages/SearchPage.tsx +135 -0
- package/src/pages/account/AccountLayout.tsx +38 -0
- package/src/pages/account/Field.tsx +20 -0
- package/src/pages/account/PreferencesPage.tsx +224 -0
- package/src/pages/account/ProfilePage.tsx +147 -0
- package/src/pages/account/SecurityPage.tsx +237 -0
- package/src/pages/admin/DataPage.tsx +772 -0
- package/src/pages/admin/McpPage.tsx +404 -0
- package/src/pages/admin/ModulesPage.tsx +113 -0
- package/src/pages/admin/TeamPage.tsx +386 -0
- package/src/pages/admin/WebhookDeliveries.tsx +184 -0
- package/src/pages/admin/WebhooksPage.tsx +443 -0
- package/src/pages/admin/WorkspaceSettingsPage.tsx +274 -0
- package/src/pages/auth/AuthForm.tsx +118 -0
- package/src/pages/auth/AuthLayout.tsx +74 -0
- package/src/pages/auth/ForgotPasswordPage.tsx +80 -0
- package/src/pages/auth/JoinPage.tsx +85 -0
- package/src/pages/auth/ResetPasswordPage.tsx +124 -0
- package/src/pages/auth/SignInPage.tsx +83 -0
- package/src/pages/auth/SignUpPage.tsx +93 -0
- package/src/pages/candidateFields.tsx +175 -0
- package/src/pages/dashboard/DashboardPage.tsx +108 -0
- package/src/pages/dashboard/attention.ts +206 -0
- package/src/pages/dashboard/sections.tsx +269 -0
- package/src/pages/fields.ts +21 -0
- package/src/pages/forms/EmbedPanel.tsx +95 -0
- package/src/pages/forms/FieldsEditor.tsx +412 -0
- package/src/pages/forms/FormSettings.tsx +159 -0
- package/src/pages/forms/SubmissionsTable.tsx +171 -0
- package/src/pages/forms/fieldList.ts +209 -0
- package/src/pages/forms/template.ts +37 -0
- package/src/pages/handbook/HandbookPage.tsx +500 -0
- package/src/pages/handbook/tree.ts +327 -0
- package/src/pages/hiringDirectory.ts +146 -0
- package/src/pages/onboarding/HandbookStepPage.tsx +75 -0
- package/src/pages/onboarding/InvitesStepPage.tsx +180 -0
- package/src/pages/onboarding/WorkspaceStepPage.tsx +122 -0
- package/src/pages/positionDirectory.ts +98 -0
- package/src/registry/UiExtensionProvider.tsx +20 -0
- package/src/registry/context.ts +67 -0
- package/src/registry/contributions.ts +89 -0
- package/src/registry/overridable.ts +62 -0
- package/src/registry/registry.ts +204 -0
- package/src/styles.css +175 -0
- package/src/testing/inputs.ts +18 -0
- package/src/testing/stubClient.ts +78 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { createFormBody, formBody, formSchema, formSubmissionSchema } from '@kelpie/schemas';
|
|
2
|
+
import { keepPreviousData, useInfiniteQuery, useMutation, useQuery, useQueryClient, } from '@tanstack/react-query';
|
|
3
|
+
import { isRecord } from '../json.js';
|
|
4
|
+
import { useApiClient } from '../context.js';
|
|
5
|
+
import { toError } from '../errors.js';
|
|
6
|
+
import { createResourceHooks } from '../resource.js';
|
|
7
|
+
const forms = createResourceHooks({
|
|
8
|
+
name: 'forms',
|
|
9
|
+
path: '/forms',
|
|
10
|
+
decode: formSchema.parse,
|
|
11
|
+
createBody: createFormBody,
|
|
12
|
+
updateBody: formBody,
|
|
13
|
+
});
|
|
14
|
+
function formQuery(filters) {
|
|
15
|
+
return { q: filters.term, status: filters.status, sort: filters.sort };
|
|
16
|
+
}
|
|
17
|
+
export function useForms(filters = {}) {
|
|
18
|
+
return forms.useList(formQuery(filters));
|
|
19
|
+
}
|
|
20
|
+
export function useForm(id) {
|
|
21
|
+
return forms.useRecord(id);
|
|
22
|
+
}
|
|
23
|
+
export function useCreateForm() {
|
|
24
|
+
return forms.useCreate();
|
|
25
|
+
}
|
|
26
|
+
export function useUpdateForm() {
|
|
27
|
+
return forms.useUpdate();
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Replaces a form's field list.
|
|
31
|
+
*
|
|
32
|
+
* Deliberately not optimistic. The response is the authority on what the list
|
|
33
|
+
* became: the server assigns every field id and position from the array's order,
|
|
34
|
+
* and answers with the stored list unchanged when it matches what was already
|
|
35
|
+
* there. Writing the response into the cache is what turns the builder's local
|
|
36
|
+
* ids into real ones.
|
|
37
|
+
*/
|
|
38
|
+
export function useUpdateFormFields() {
|
|
39
|
+
const client = useApiClient();
|
|
40
|
+
const queryClient = useQueryClient();
|
|
41
|
+
const mutation = useMutation({
|
|
42
|
+
mutationFn: ({ id, fields }) => client.patch(`/forms/${id}`, formBody({ fields }), formSchema.parse),
|
|
43
|
+
onSuccess: (form) => {
|
|
44
|
+
queryClient.setQueryData(['forms', 'detail', form.id], form);
|
|
45
|
+
},
|
|
46
|
+
onSettled: () => {
|
|
47
|
+
void queryClient.invalidateQueries({ queryKey: ['forms', 'list'] });
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
return {
|
|
51
|
+
run: (input) => {
|
|
52
|
+
mutation.mutate(input);
|
|
53
|
+
},
|
|
54
|
+
runAsync: (input) => mutation.mutateAsync(input),
|
|
55
|
+
isPending: mutation.isPending,
|
|
56
|
+
error: toError(mutation.error),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/** Deletes the form, and by cascade its fields and its submissions. */
|
|
60
|
+
export function useDeleteForm() {
|
|
61
|
+
return forms.useRemove();
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* One form's submissions, newest first.
|
|
65
|
+
*
|
|
66
|
+
* Written out rather than built from `createResourceHooks`, because the path
|
|
67
|
+
* carries the form id: `GET /v1/forms/:id/submissions`. Every other resource in
|
|
68
|
+
* this package is a top-level collection with a fixed path, and generalising the
|
|
69
|
+
* factory for the one nested list would complicate five modules to shorten one.
|
|
70
|
+
* The result shape is the same, so a page cannot tell the difference.
|
|
71
|
+
*/
|
|
72
|
+
export function useFormSubmissions(formId) {
|
|
73
|
+
const client = useApiClient();
|
|
74
|
+
const result = useInfiniteQuery({
|
|
75
|
+
queryKey: ['forms', 'submissions', formId ?? ''],
|
|
76
|
+
queryFn: ({ pageParam }) => client.list(`/forms/${formId ?? ''}/submissions`, formSubmissionSchema.parse, {
|
|
77
|
+
...(pageParam === null ? {} : { cursor: pageParam }),
|
|
78
|
+
}),
|
|
79
|
+
initialPageParam: null,
|
|
80
|
+
getNextPageParam: (lastPage) => lastPage.nextCursor,
|
|
81
|
+
placeholderData: keepPreviousData,
|
|
82
|
+
enabled: formId !== undefined,
|
|
83
|
+
});
|
|
84
|
+
return {
|
|
85
|
+
records: result.data?.pages.flatMap((page) => page.items) ?? [],
|
|
86
|
+
isLoading: result.isPending && formId !== undefined,
|
|
87
|
+
error: toError(result.error),
|
|
88
|
+
hasMore: result.hasNextPage,
|
|
89
|
+
isLoadingMore: result.isFetchingNextPage,
|
|
90
|
+
loadMore: () => {
|
|
91
|
+
void result.fetchNextPage();
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function decodeSnippets(value) {
|
|
96
|
+
if (!isRecord(value) ||
|
|
97
|
+
typeof value.url !== 'string' ||
|
|
98
|
+
typeof value.iframe_snippet !== 'string' ||
|
|
99
|
+
typeof value.script_snippet !== 'string') {
|
|
100
|
+
throw new TypeError('Expected an embed snippet response');
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
url: value.url,
|
|
104
|
+
iframeSnippet: value.iframe_snippet,
|
|
105
|
+
scriptSnippet: value.script_snippet,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The embed URL and snippets for one form.
|
|
110
|
+
*
|
|
111
|
+
* Fetched rather than built here: the URL depends on the origin the API is
|
|
112
|
+
* reached at, which the server knows from the request and the browser only
|
|
113
|
+
* happens to share today. A cloud deployment serving the app and the API from
|
|
114
|
+
* different hosts would make a locally-built URL wrong.
|
|
115
|
+
*/
|
|
116
|
+
export function useFormEmbed(formId) {
|
|
117
|
+
const client = useApiClient();
|
|
118
|
+
const result = useQuery({
|
|
119
|
+
queryKey: ['forms', 'embed', formId ?? ''],
|
|
120
|
+
queryFn: () => client.get(`/forms/${formId ?? ''}/embed`, decodeSnippets),
|
|
121
|
+
enabled: formId !== undefined,
|
|
122
|
+
});
|
|
123
|
+
return {
|
|
124
|
+
snippets: result.data,
|
|
125
|
+
isLoading: result.isPending && formId !== undefined,
|
|
126
|
+
error: toError(result.error),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=forms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forms.js","sourceRoot":"","sources":["../../../src/api/resources/forms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAQ5F,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,cAAc,GACf,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAgCpD,MAAM,KAAK,GAAG,mBAAmB,CAA2C;IAC1E,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE,UAAU,CAAC,KAAK;IACxB,UAAU,EAAE,cAAc;IAC1B,UAAU,EAAE,QAAQ;CACrB,CAAC,CAAA;AAUF,SAAS,SAAS,CAAC,OAAoB;IACrC,OAAO,EAAE,CAAC,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAA;AACxE,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,OAAO,GAAgB,EAAE;IAChD,OAAO,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;AAC1C,CAAC;AAED,M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C;AASD,SAAS,cAAc,CAAC,KAAc;IACpC,IACE,CAAC,QAAQ,CAAC,KAAK,CAAC;QAChB,OAAO,KAAK,CAAC,GAAG,KAAK,QAAQ;QAC7B,OAAO,KAAK,CAAC,cAAc,KAAK,QAAQ;QACxC,OAAO,KAAK,CAAC,cAAc,KAAK,QAAQ,EACxC,CAAC;QACD,MAAM,IAAI,SAAS,CAAC,oCAAoC,CAAC,CAAA;IAC3D,CAAC;IAED,OAAO;QACL,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,aAAa,EAAE,KAAK,CAAC,cAAc;QACnC,aAAa,EAAE,KAAK,CAAC,cAAc;KACpC,CAAA;AACH,CAAC;AAQD;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,MAA0B;IACrD,MAAM,MAAM,GAAG,YAAY,EAAE,CAAA;IAC7B,MAAM,MAAM,GAAG,QAAQ,CAAC;QACtB,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,EAAE,CAAC;QAC1C,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,MAAM,IAAI,EAAE,QAAQ,EAAE,cAAc,CAAC;QACzE,OAAO,EAAE,MAAM,KAAK,SAAS;KAC9B,CAAC,CAAA;IAEF,OAAO;QACL,QAAQ,EAAE,MAAM,CAAC,IAAI;QACrB,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,MAAM,KAAK,SAAS;QACnD,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;KAC7B,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { CreateHandbookPageInput, HandbookPage, HandbookPageInput } from '@kelpie/schemas';
|
|
2
|
+
import type { MutationResult, RecordListResult, RecordResult, UpdateArguments } from '../resource.ts';
|
|
3
|
+
/** The documented filters on `GET /v1/handbook_pages`. */
|
|
4
|
+
export interface HandbookPageFilters {
|
|
5
|
+
/** Matches a page's title and its body. A handbook is searched for what it says. */
|
|
6
|
+
readonly term?: string;
|
|
7
|
+
/** Pages at these slugs. Repeats on the wire. */
|
|
8
|
+
readonly slugs?: readonly string[];
|
|
9
|
+
readonly limit?: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The whole handbook, at the documented page maximum.
|
|
13
|
+
*
|
|
14
|
+
* The same call the kanban board makes for its stages, for the same reason: a
|
|
15
|
+
* tree cannot be drawn from part of itself, and a page whose parent is on the
|
|
16
|
+
* next page of results would render at the top level as though somebody had
|
|
17
|
+
* moved it there. The caller reads `hasMore` and says so rather than drawing a
|
|
18
|
+
* tree with holes in it.
|
|
19
|
+
*/
|
|
20
|
+
export declare function useHandbookPages(filters?: HandbookPageFilters): RecordListResult<HandbookPage>;
|
|
21
|
+
export declare function useHandbookPage(id: string | undefined): RecordResult<HandbookPage>;
|
|
22
|
+
export declare function useCreateHandbookPage(): MutationResult<CreateHandbookPageInput, HandbookPage>;
|
|
23
|
+
export declare function useUpdateHandbookPage(): MutationResult<UpdateArguments<HandbookPageInput>, HandbookPage>;
|
|
24
|
+
/**
|
|
25
|
+
* Deletes a page and, by cascade, every page nested under it.
|
|
26
|
+
*
|
|
27
|
+
* The optimistic removal in `createResourceHooks` takes the clicked page out of
|
|
28
|
+
* the cached list and leaves its subpages behind for the moment it takes the
|
|
29
|
+
* refetch to land. The sidebar therefore renders from the tree it can build,
|
|
30
|
+
* which drops a subtree whose parent is gone rather than floating it to the top.
|
|
31
|
+
*/
|
|
32
|
+
export declare function useDeleteHandbookPage(): MutationResult<string, void>;
|
|
33
|
+
//# sourceMappingURL=handbookPages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handbookPages.d.ts","sourceRoot":"","sources":["../../../src/api/resources/handbookPages.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAI/F,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,eAAe,EAChB,MAAM,gBAAgB,CAAA;AAevB,0DAA0D;AAC1D,MAAM,WAAW,mBAAmB;IAClC,oFAAoF;IACpF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,iDAAiD;IACjD,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACxB;AAMD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,mBAAwB,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAElG;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,YAAY,CAAC,YAAY,CAAC,CAElF;AAED,wBAAgB,qBAAqB,IAAI,cAAc,CAAC,uBAAuB,EAAE,YAAY,CAAC,CAE7F;AAED,wBAAgB,qBAAqB,IAAI,cAAc,CACrD,eAAe,CAAC,iBAAiB,CAAC,EAClC,YAAY,CACb,CAEA;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,IAAI,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,CAEpE"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { createHandbookPageBody, handbookPageBody, handbookPageSchema } from '@kelpie/schemas';
|
|
2
|
+
import { createResourceHooks } from '../resource.js';
|
|
3
|
+
/**
|
|
4
|
+
* `/v1/handbook_pages`: the workspace handbook, as a flat list the sidebar
|
|
5
|
+
* builds a tree from.
|
|
6
|
+
*/
|
|
7
|
+
const pages = createResourceHooks({
|
|
8
|
+
name: 'handbook_pages',
|
|
9
|
+
path: '/handbook_pages',
|
|
10
|
+
decode: handbookPageSchema.parse,
|
|
11
|
+
createBody: createHandbookPageBody,
|
|
12
|
+
updateBody: handbookPageBody,
|
|
13
|
+
});
|
|
14
|
+
function handbookQuery(filters) {
|
|
15
|
+
return { q: filters.term, slug: filters.slugs, limit: filters.limit };
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The whole handbook, at the documented page maximum.
|
|
19
|
+
*
|
|
20
|
+
* The same call the kanban board makes for its stages, for the same reason: a
|
|
21
|
+
* tree cannot be drawn from part of itself, and a page whose parent is on the
|
|
22
|
+
* next page of results would render at the top level as though somebody had
|
|
23
|
+
* moved it there. The caller reads `hasMore` and says so rather than drawing a
|
|
24
|
+
* tree with holes in it.
|
|
25
|
+
*/
|
|
26
|
+
export function useHandbookPages(filters = {}) {
|
|
27
|
+
return pages.useList(handbookQuery({ limit: 200, ...filters }));
|
|
28
|
+
}
|
|
29
|
+
export function useHandbookPage(id) {
|
|
30
|
+
return pages.useRecord(id);
|
|
31
|
+
}
|
|
32
|
+
export function useCreateHandbookPage() {
|
|
33
|
+
return pages.useCreate();
|
|
34
|
+
}
|
|
35
|
+
export function useUpdateHandbookPage() {
|
|
36
|
+
return pages.useUpdate();
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Deletes a page and, by cascade, every page nested under it.
|
|
40
|
+
*
|
|
41
|
+
* The optimistic removal in `createResourceHooks` takes the clicked page out of
|
|
42
|
+
* the cached list and leaves its subpages behind for the moment it takes the
|
|
43
|
+
* refetch to land. The sidebar therefore renders from the tree it can build,
|
|
44
|
+
* which drops a subtree whose parent is gone rather than floating it to the top.
|
|
45
|
+
*/
|
|
46
|
+
export function useDeleteHandbookPage() {
|
|
47
|
+
return pages.useRemove();
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=handbookPages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handbookPages.js","sourceRoot":"","sources":["../../../src/api/resources/handbookPages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAI9F,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAQpD;;;GAGG;AAEH,MAAM,KAAK,GAAG,mBAAmB,CAA2D;IAC1F,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,iBAAiB;IACvB,MAAM,EAAE,kBAAkB,CAAC,KAAK;IAChC,UAAU,EAAE,sBAAsB;IAClC,UAAU,EAAE,gBAAgB;CAC7B,CAAC,CAAA;AAWF,SAAS,aAAa,CAAC,OAA4B;IACjD,OAAO,EAAE,CAAC,EAAE,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAA;AACvE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAO,GAAwB,EAAE;IAChE,OAAO,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAA;AACjE,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,EAAsB;IACpD,OAAO,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;AAC5B,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC,OAAO,KAAK,CAAC,SAAS,EAAE,CAAA;AAC1B,CAAC;AAED,MAAM,UAAU,qBAAqB;IAInC,OAAO,KAAK,CAAC,SAAS,EAAE,CAAA;AAC1B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,KAAK,CAAC,SAAS,EAAE,CAAA;AAC1B,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { ImportColumnMap, ImportConflictMode, ImportJob, ImportObject, ImportSource } from '@kelpie/schemas';
|
|
2
|
+
import type { MutationResult, RecordResult } from '../resource.ts';
|
|
3
|
+
export interface CreateImportJobInput {
|
|
4
|
+
readonly file: File;
|
|
5
|
+
readonly source: ImportSource;
|
|
6
|
+
readonly object: ImportObject;
|
|
7
|
+
readonly conflictMode: ImportConflictMode;
|
|
8
|
+
readonly matchKeyId: string;
|
|
9
|
+
/**
|
|
10
|
+
* Absent on the first upload, so the server derives one from the source preset
|
|
11
|
+
* and the file's own headers. The mapping screen sends the corrected map back
|
|
12
|
+
* with the same file.
|
|
13
|
+
*/
|
|
14
|
+
readonly columnMap?: ImportColumnMap;
|
|
15
|
+
}
|
|
16
|
+
export declare function useCreateImportJob(): MutationResult<CreateImportJobInput, ImportJob>;
|
|
17
|
+
export interface CommitImportJobInput {
|
|
18
|
+
readonly id: string;
|
|
19
|
+
/**
|
|
20
|
+
* The same file the dry run read. A job keeps only its digest, so the bytes
|
|
21
|
+
* come back here and the server refuses anything that hashes differently.
|
|
22
|
+
* The wizard has held this `File` since the upload for exactly this reason.
|
|
23
|
+
*/
|
|
24
|
+
readonly file: File;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Commits a job, sending back the file it forecast.
|
|
28
|
+
*
|
|
29
|
+
* The response replaces the cached job, which is what restarts polling: the
|
|
30
|
+
* watcher stops while a job sits in `ready`, and a commit moves it to
|
|
31
|
+
* `committing` or `completed`. It also invalidates every CRM list, because the
|
|
32
|
+
* records this just wrote are in all of them.
|
|
33
|
+
*/
|
|
34
|
+
export declare function useCommitImportJob(): MutationResult<CommitImportJobInput, ImportJob>;
|
|
35
|
+
/**
|
|
36
|
+
* Deletes a job and the rows stored against it.
|
|
37
|
+
*
|
|
38
|
+
* What a wizard calls on the job it is walking away from. Correcting a mapping
|
|
39
|
+
* uploads the same file again as a new job, so without this a caller who
|
|
40
|
+
* corrects a ten thousand row map three times leaves three files stored.
|
|
41
|
+
*
|
|
42
|
+
* No CRM list is invalidated: a job that never committed wrote nothing, and one
|
|
43
|
+
* that did keeps the records it wrote.
|
|
44
|
+
*/
|
|
45
|
+
export declare function useDeleteImportJob(): MutationResult<string, void>;
|
|
46
|
+
/**
|
|
47
|
+
* Watches one job, asking again while it is still working.
|
|
48
|
+
*
|
|
49
|
+
* A file over the synchronous limit validates and commits in the background, so
|
|
50
|
+
* the only way to learn it finished is to look. Polling stops the moment the
|
|
51
|
+
* status settles, which for a small file is the first read.
|
|
52
|
+
*/
|
|
53
|
+
export declare function useImportJob(id: string | undefined): RecordResult<ImportJob>;
|
|
54
|
+
export interface CsvDownload {
|
|
55
|
+
readonly fileName: string;
|
|
56
|
+
readonly csv: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Fetches an export through the API client rather than pointing the browser at
|
|
60
|
+
* the URL.
|
|
61
|
+
*
|
|
62
|
+
* A plain link would work for a session cookie and not for anything else, and it
|
|
63
|
+
* would render the server's error body as a page if the request failed. This way
|
|
64
|
+
* a failure is an `ApiError` the page can show beside the button.
|
|
65
|
+
*/
|
|
66
|
+
export declare function useExportCsv(): MutationResult<{
|
|
67
|
+
object: ImportObject;
|
|
68
|
+
template: boolean;
|
|
69
|
+
}, CsvDownload>;
|
|
70
|
+
/** Hands the browser a file it never fetched from a URL. */
|
|
71
|
+
export declare function saveCsv(download: CsvDownload): void;
|
|
72
|
+
//# sourceMappingURL=importJobs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"importJobs.d.ts","sourceRoot":"","sources":["../../../src/api/resources/importJobs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,SAAS,EACT,YAAY,EACZ,YAAY,EACb,MAAM,iBAAiB,CAAA;AAKxB,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAelE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;IACnB,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAA;IAC7B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAA;IAC7B,QAAQ,CAAC,YAAY,EAAE,kBAAkB,CAAA;IACzC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,eAAe,CAAA;CACrC;AAwBD,wBAAgB,kBAAkB,IAAI,cAAc,CAAC,oBAAoB,EAAE,SAAS,CAAC,CAgBpF;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,IAAI,cAAc,CAAC,oBAAoB,EAAE,SAAS,CAAC,CAwBpF;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,IAAI,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,CAcjE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,CAoB5E;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CACrB;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,cAAc,CAC5C;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,EAC3C,WAAW,CACZ,CAqBA;AAED,4DAA4D;AAC5D,wBAAgB,OAAO,CAAC,QAAQ,EAAE,WAAW,GAAG,IAAI,CAQnD"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { importJobSchema, isImportJobSettled } from '@kelpie/schemas';
|
|
2
|
+
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
3
|
+
import { useApiClient } from '../context.js';
|
|
4
|
+
import { toError } from '../errors.js';
|
|
5
|
+
import { asMutationResult } from './mutation.js';
|
|
6
|
+
/**
|
|
7
|
+
* Import jobs and CSV export.
|
|
8
|
+
*
|
|
9
|
+
* Hand-written rather than built from `createResourceHooks`: an import job is
|
|
10
|
+
* not a CRM collection. It is created by uploading a file, read while it is
|
|
11
|
+
* still running, and finished by a second `POST` — none of which the five shared
|
|
12
|
+
* verbs describe.
|
|
13
|
+
*/
|
|
14
|
+
/** How often a job that is still working is asked again. */
|
|
15
|
+
const POLL_INTERVAL_MS = 750;
|
|
16
|
+
function jobForm(input) {
|
|
17
|
+
const form = new FormData();
|
|
18
|
+
form.set('file', input.file);
|
|
19
|
+
form.set('source', input.source);
|
|
20
|
+
form.set('object', input.object);
|
|
21
|
+
form.set('conflict_mode', input.conflictMode);
|
|
22
|
+
form.set('match_key', input.matchKeyId);
|
|
23
|
+
form.set('dry_run', 'true');
|
|
24
|
+
if (input.columnMap !== undefined) {
|
|
25
|
+
form.set('column_map', JSON.stringify(input.columnMap));
|
|
26
|
+
}
|
|
27
|
+
return form;
|
|
28
|
+
}
|
|
29
|
+
/** The cache entry `useImportJob` reads, so a write and the watcher agree. */
|
|
30
|
+
function jobKey(id) {
|
|
31
|
+
return ['import-jobs', 'detail', id];
|
|
32
|
+
}
|
|
33
|
+
export function useCreateImportJob() {
|
|
34
|
+
const client = useApiClient();
|
|
35
|
+
const cache = useQueryClient();
|
|
36
|
+
return asMutationResult(useMutation({
|
|
37
|
+
mutationFn: (input) => client.postForm('/import/jobs', jobForm(input), importJobSchema.parse),
|
|
38
|
+
// Seeds the watcher rather than letting it fetch what this response already
|
|
39
|
+
// carries. For a file large enough to validate in the background, that
|
|
40
|
+
// seed is also what starts the polling.
|
|
41
|
+
onSuccess: (job) => {
|
|
42
|
+
cache.setQueryData(jobKey(job.id), job);
|
|
43
|
+
},
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Commits a job, sending back the file it forecast.
|
|
48
|
+
*
|
|
49
|
+
* The response replaces the cached job, which is what restarts polling: the
|
|
50
|
+
* watcher stops while a job sits in `ready`, and a commit moves it to
|
|
51
|
+
* `committing` or `completed`. It also invalidates every CRM list, because the
|
|
52
|
+
* records this just wrote are in all of them.
|
|
53
|
+
*/
|
|
54
|
+
export function useCommitImportJob() {
|
|
55
|
+
const client = useApiClient();
|
|
56
|
+
const cache = useQueryClient();
|
|
57
|
+
return asMutationResult(useMutation({
|
|
58
|
+
mutationFn: ({ id, file }) => {
|
|
59
|
+
const form = new FormData();
|
|
60
|
+
form.set('file', file);
|
|
61
|
+
return client.postForm(`/import/jobs/${id}/commit`, form, importJobSchema.parse);
|
|
62
|
+
},
|
|
63
|
+
onSuccess: async (job) => {
|
|
64
|
+
cache.setQueryData(jobKey(job.id), job);
|
|
65
|
+
await Promise.all(['people', 'companies', 'positions', 'deals', 'activities'].map((name) => cache.invalidateQueries({ queryKey: [name] })));
|
|
66
|
+
},
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Deletes a job and the rows stored against it.
|
|
71
|
+
*
|
|
72
|
+
* What a wizard calls on the job it is walking away from. Correcting a mapping
|
|
73
|
+
* uploads the same file again as a new job, so without this a caller who
|
|
74
|
+
* corrects a ten thousand row map three times leaves three files stored.
|
|
75
|
+
*
|
|
76
|
+
* No CRM list is invalidated: a job that never committed wrote nothing, and one
|
|
77
|
+
* that did keeps the records it wrote.
|
|
78
|
+
*/
|
|
79
|
+
export function useDeleteImportJob() {
|
|
80
|
+
const client = useApiClient();
|
|
81
|
+
const cache = useQueryClient();
|
|
82
|
+
return asMutationResult(useMutation({
|
|
83
|
+
mutationFn: (id) => client.delete(`/import/jobs/${id}`),
|
|
84
|
+
onSuccess: (_result, id) => {
|
|
85
|
+
// Dropped rather than invalidated. Refetching a deleted job is a 404,
|
|
86
|
+
// and the watcher would report it as one.
|
|
87
|
+
cache.removeQueries({ queryKey: jobKey(id) });
|
|
88
|
+
},
|
|
89
|
+
}));
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Watches one job, asking again while it is still working.
|
|
93
|
+
*
|
|
94
|
+
* A file over the synchronous limit validates and commits in the background, so
|
|
95
|
+
* the only way to learn it finished is to look. Polling stops the moment the
|
|
96
|
+
* status settles, which for a small file is the first read.
|
|
97
|
+
*/
|
|
98
|
+
export function useImportJob(id) {
|
|
99
|
+
const client = useApiClient();
|
|
100
|
+
const query = useQuery({
|
|
101
|
+
queryKey: jobKey(id ?? ''),
|
|
102
|
+
enabled: id !== undefined,
|
|
103
|
+
queryFn: () => client.get(`/import/jobs/${String(id)}`, importJobSchema.parse),
|
|
104
|
+
refetchInterval: (query) => query.state.data !== undefined && isImportJobSettled(query.state.data.status)
|
|
105
|
+
? false
|
|
106
|
+
: POLL_INTERVAL_MS,
|
|
107
|
+
});
|
|
108
|
+
const error = toError(query.error);
|
|
109
|
+
return {
|
|
110
|
+
record: query.data,
|
|
111
|
+
isLoading: query.isPending && id !== undefined,
|
|
112
|
+
error,
|
|
113
|
+
isNotFound: error !== null && 'status' in error && error.status === 404,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Fetches an export through the API client rather than pointing the browser at
|
|
118
|
+
* the URL.
|
|
119
|
+
*
|
|
120
|
+
* A plain link would work for a session cookie and not for anything else, and it
|
|
121
|
+
* would render the server's error body as a page if the request failed. This way
|
|
122
|
+
* a failure is an `ApiError` the page can show beside the button.
|
|
123
|
+
*/
|
|
124
|
+
export function useExportCsv() {
|
|
125
|
+
const client = useApiClient();
|
|
126
|
+
return asMutationResult(useMutation({
|
|
127
|
+
mutationFn: async ({ object, template, }) => {
|
|
128
|
+
const path = template ? `/export/templates/${object}.csv` : `/export/${object}.csv`;
|
|
129
|
+
return {
|
|
130
|
+
fileName: template ? `kelpie-${object}-template.csv` : `kelpie-${object}.csv`,
|
|
131
|
+
csv: await client.getText(path),
|
|
132
|
+
};
|
|
133
|
+
},
|
|
134
|
+
}));
|
|
135
|
+
}
|
|
136
|
+
/** Hands the browser a file it never fetched from a URL. */
|
|
137
|
+
export function saveCsv(download) {
|
|
138
|
+
const url = URL.createObjectURL(new Blob([download.csv], { type: 'text/csv;charset=utf-8' }));
|
|
139
|
+
const link = document.createElement('a');
|
|
140
|
+
link.href = url;
|
|
141
|
+
link.download = download.fileName;
|
|
142
|
+
link.click();
|
|
143
|
+
URL.revokeObjectURL(url);
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=importJobs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"importJobs.js","sourceRoot":"","sources":["../../../src/api/resources/importJobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAQrE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAE7E,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAEhD;;;;;;;GAOG;AAEH,4DAA4D;AAC5D,MAAM,gBAAgB,GAAG,GAAG,CAAA;AAgB5B,SAAS,OAAO,CAAC,KAA2B;IAC1C,MAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAA;IAE3B,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;IAC5B,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAChC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAChC,IAAI,CAAC,GAAG,CAAC,eAAe,EAAE,KAAK,CAAC,YAAY,CAAC,CAAA;IAC7C,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,UAAU,CAAC,CAAA;IACvC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;IAE3B,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QAClC,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC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,IAAI,EAAE,wBAAwB,EAAE,CAAC,CAAC,CAAA;IAC7F,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAA;IAExC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAA;IACf,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAA;IACjC,IAAI,CAAC,KAAK,EAAE,CAAA;IACZ,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAA;AAC1B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { InvitableRole, Invite } from '@kelpie/schemas';
|
|
2
|
+
import type { MutationResult } from '../resource.ts';
|
|
3
|
+
/** Where an invitee lands. `JoinPage` reads the token out of the query string. */
|
|
4
|
+
export declare function inviteUrlTemplate(origin: string): string;
|
|
5
|
+
export interface InviteListResult {
|
|
6
|
+
readonly invites: readonly Invite[];
|
|
7
|
+
readonly isLoading: boolean;
|
|
8
|
+
readonly error: Error | null;
|
|
9
|
+
}
|
|
10
|
+
export declare function useInvites(): InviteListResult;
|
|
11
|
+
export interface SendInviteArguments {
|
|
12
|
+
readonly email: string;
|
|
13
|
+
readonly role: InvitableRole;
|
|
14
|
+
}
|
|
15
|
+
export declare function useSendInvite(): MutationResult<SendInviteArguments, Invite>;
|
|
16
|
+
/** Reissues the token and emails it again. The link in the first email stops working. */
|
|
17
|
+
export declare function useResendInvite(): MutationResult<string, Invite>;
|
|
18
|
+
export declare function useRevokeInvite(): MutationResult<string, void>;
|
|
19
|
+
//# sourceMappingURL=invites.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invites.d.ts","sourceRoot":"","sources":["../../../src/api/resources/invites.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAK5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAkBpD,kFAAkF;AAClF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;IACnC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;CAC7B;AAED,wBAAgB,UAAU,IAAI,gBAAgB,CAe7C;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAA;CAC7B;AAED,wBAAgB,aAAa,IAAI,cAAc,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAkB3E;AAED,yFAAyF;AACzF,wBAAgB,eAAe,IAAI,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAkBhE;AAED,wBAAgB,eAAe,IAAI,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,CAa9D"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { createInviteBody, inviteSchema, resendInviteBody } from '@kelpie/schemas';
|
|
2
|
+
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
3
|
+
import { useApiClient } from '../context.js';
|
|
4
|
+
import { toError } from '../errors.js';
|
|
5
|
+
import { asMutationResult } from './mutation.js';
|
|
6
|
+
import { useSession } from './session.js';
|
|
7
|
+
/**
|
|
8
|
+
* Outstanding invitations for the workspace.
|
|
9
|
+
*
|
|
10
|
+
* Admin-only server-side, so a member's request answers `403`. The team page
|
|
11
|
+
* only renders this half for an admin, which keeps the refusal off screen
|
|
12
|
+
* without the browser being what decides it.
|
|
13
|
+
*
|
|
14
|
+
* The URL the emailed link points at is built here rather than server-side: the
|
|
15
|
+
* service knows nothing about where a browser reached it from, and `{token}` is
|
|
16
|
+
* the placeholder it fills in.
|
|
17
|
+
*/
|
|
18
|
+
const INVITES_KEY = 'invites';
|
|
19
|
+
/** Where an invitee lands. `JoinPage` reads the token out of the query string. */
|
|
20
|
+
export function inviteUrlTemplate(origin) {
|
|
21
|
+
return `${origin}/join?token={token}`;
|
|
22
|
+
}
|
|
23
|
+
export function useInvites() {
|
|
24
|
+
const client = useApiClient();
|
|
25
|
+
const { session } = useSession();
|
|
26
|
+
const workspaceId = session?.workspaceId ?? undefined;
|
|
27
|
+
const result = useQuery({
|
|
28
|
+
queryKey: [INVITES_KEY, workspaceId],
|
|
29
|
+
queryFn: () => client.list(`/workspaces/${workspaceId ?? ''}/invites`, inviteSchema.parse),
|
|
30
|
+
enabled: workspaceId !== undefined,
|
|
31
|
+
});
|
|
32
|
+
return {
|
|
33
|
+
invites: result.data?.items ?? [],
|
|
34
|
+
isLoading: result.isPending && workspaceId !== undefined,
|
|
35
|
+
error: toError(result.error),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export function useSendInvite() {
|
|
39
|
+
const client = useApiClient();
|
|
40
|
+
const queryClient = useQueryClient();
|
|
41
|
+
const { session } = useSession();
|
|
42
|
+
const workspaceId = session?.workspaceId ?? '';
|
|
43
|
+
const mutation = useMutation({
|
|
44
|
+
mutationFn: ({ email, role }) => client.post(`/workspaces/${workspaceId}/invites`, createInviteBody({ email, role, inviteUrlTemplate: inviteUrlTemplate(window.location.origin) }), inviteSchema.parse),
|
|
45
|
+
onSuccess: async () => {
|
|
46
|
+
await queryClient.invalidateQueries({ queryKey: [INVITES_KEY, workspaceId] });
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
return asMutationResult(mutation);
|
|
50
|
+
}
|
|
51
|
+
/** Reissues the token and emails it again. The link in the first email stops working. */
|
|
52
|
+
export function useResendInvite() {
|
|
53
|
+
const client = useApiClient();
|
|
54
|
+
const queryClient = useQueryClient();
|
|
55
|
+
const { session } = useSession();
|
|
56
|
+
const workspaceId = session?.workspaceId ?? '';
|
|
57
|
+
const mutation = useMutation({
|
|
58
|
+
mutationFn: (inviteId) => client.post(`/workspaces/${workspaceId}/invites/${inviteId}/resend`, resendInviteBody({ inviteUrlTemplate: inviteUrlTemplate(window.location.origin) }), inviteSchema.parse),
|
|
59
|
+
onSuccess: async () => {
|
|
60
|
+
await queryClient.invalidateQueries({ queryKey: [INVITES_KEY, workspaceId] });
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
return asMutationResult(mutation);
|
|
64
|
+
}
|
|
65
|
+
export function useRevokeInvite() {
|
|
66
|
+
const client = useApiClient();
|
|
67
|
+
const queryClient = useQueryClient();
|
|
68
|
+
const { session } = useSession();
|
|
69
|
+
const workspaceId = session?.workspaceId ?? '';
|
|
70
|
+
const mutation = useMutation({
|
|
71
|
+
mutationFn: (inviteId) => client.delete(`/workspaces/${workspaceId}/invites/${inviteId}`),
|
|
72
|
+
onSuccess: async () => {
|
|
73
|
+
await queryClient.invalidateQueries({ queryKey: [INVITES_KEY, workspaceId] });
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
return asMutationResult(mutation);
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=invites.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invites.js","sourceRoot":"","sources":["../../../src/api/resources/invites.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAElF,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAE7E,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,GAAG,SAAS,CAAA;AAE7B,kFAAkF;AAClF,MAAM,UAAU,iBAAiB,CAAC,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AQ,GAAG,WAAW,CAAC;QAC3B,UAAU,EAAE,CAAC,QAAgB,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,eAAe,WAAW,YAAY,QAAQ,EAAE,CAAC;QACjG,SAAS,EAAE,KAAK,IAAI,EAAE;YACpB,MAAM,WAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,CAAC,CAAA;QAC/E,CAAC;KACF,CAAC,CAAA;IAEF,OAAO,gBAAgB,CAAC,QAAQ,CAAC,CAAA;AACnC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { McpTool } from '@kelpie/schemas';
|
|
2
|
+
import type { RecordListResult } from '../resource.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The whole set in one request. It is fixed at boot, not paged, and answers
|
|
5
|
+
* `next_cursor: null` however many tools there are.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useMcpTools(): RecordListResult<McpTool>;
|
|
8
|
+
//# sourceMappingURL=mcpTools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcpTools.d.ts","sourceRoot":"","sources":["../../../src/api/resources/mcpTools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAG9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAiBtD;;;GAGG;AACH,wBAAgB,WAAW,IAAI,gBAAgB,CAAC,OAAO,CAAC,CAEvD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { mcpToolSchema } from '@kelpie/schemas';
|
|
2
|
+
import { createReadOnlyResourceHooks } from '../resource.js';
|
|
3
|
+
/**
|
|
4
|
+
* `/v1/mcp/tools`, read-only: what this deployment exposes over MCP.
|
|
5
|
+
*
|
|
6
|
+
* Read rather than hard-coded, because the tool set is whatever the modules in
|
|
7
|
+
* this assembly registered. A cloud install with extra modules exposes more than
|
|
8
|
+
* an open-source one, and a list written into the page would be wrong for both
|
|
9
|
+
* the moment somebody added a resource.
|
|
10
|
+
*/
|
|
11
|
+
const tools = createReadOnlyResourceHooks({
|
|
12
|
+
name: 'mcp_tools',
|
|
13
|
+
path: '/mcp/tools',
|
|
14
|
+
decode: mcpToolSchema.parse,
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* The whole set in one request. It is fixed at boot, not paged, and answers
|
|
18
|
+
* `next_cursor: null` however many tools there are.
|
|
19
|
+
*/
|
|
20
|
+
export function useMcpTools() {
|
|
21
|
+
return tools.useList();
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=mcpTools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcpTools.js","sourceRoot":"","sources":["../../../src/api/resources/mcpTools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAG/C,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAA;AAG5D;;;;;;;GAOG;AAEH,MAAM,KAAK,GAAG,2BAA2B,CAAU;IACjD,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE,aAAa,CAAC,KAAK;CAC5B,CAAC,CAAA;AAEF;;;GAGG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,KAAK,CAAC,OAAO,EAAE,CAAA;AACxB,CAAC"}
|