@manta-eu/react 0.11.0 → 0.13.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/README.md +59 -0
- package/dist/components/AppErrorBoundary.d.ts.map +1 -1
- package/dist/components/AppErrorBoundary.js +14 -11
- package/dist/components/AppErrorBoundary.js.map +1 -1
- package/dist/components/app-gate/AppGate.d.ts +8 -0
- package/dist/components/app-gate/AppGate.d.ts.map +1 -0
- package/dist/components/app-gate/AppGate.js +68 -0
- package/dist/components/app-gate/AppGate.js.map +1 -0
- package/dist/components/app-gate/AwaitingDatastoreStatus.d.ts +7 -0
- package/dist/components/app-gate/AwaitingDatastoreStatus.d.ts.map +1 -0
- package/dist/components/app-gate/AwaitingDatastoreStatus.js +19 -0
- package/dist/components/app-gate/AwaitingDatastoreStatus.js.map +1 -0
- package/dist/components/app-gate/EnterDatastoreRoute.d.ts +2 -0
- package/dist/components/app-gate/EnterDatastoreRoute.d.ts.map +1 -0
- package/dist/components/app-gate/EnterDatastoreRoute.js +25 -0
- package/dist/components/app-gate/EnterDatastoreRoute.js.map +1 -0
- package/dist/components/app-gate/ErrorRoute.d.ts +2 -0
- package/dist/components/app-gate/ErrorRoute.d.ts.map +1 -0
- package/dist/components/app-gate/ErrorRoute.js +27 -0
- package/dist/components/app-gate/ErrorRoute.js.map +1 -0
- package/dist/components/app-gate/FailureAlert.d.ts +5 -0
- package/dist/components/app-gate/FailureAlert.d.ts.map +1 -0
- package/dist/components/app-gate/FailureAlert.js +9 -0
- package/dist/components/app-gate/FailureAlert.js.map +1 -0
- package/dist/components/app-gate/NoDatastoreAccess.d.ts +8 -0
- package/dist/components/app-gate/NoDatastoreAccess.d.ts.map +1 -0
- package/dist/components/app-gate/NoDatastoreAccess.js +9 -0
- package/dist/components/app-gate/NoDatastoreAccess.js.map +1 -0
- package/dist/components/app-gate/NotFoundRoute.d.ts +2 -0
- package/dist/components/app-gate/NotFoundRoute.d.ts.map +1 -0
- package/dist/components/app-gate/NotFoundRoute.js +9 -0
- package/dist/components/app-gate/NotFoundRoute.js.map +1 -0
- package/dist/components/app-gate/PendingInvitations.d.ts +5 -0
- package/dist/components/app-gate/PendingInvitations.d.ts.map +1 -0
- package/dist/components/app-gate/PendingInvitations.js +58 -0
- package/dist/components/app-gate/PendingInvitations.js.map +1 -0
- package/dist/components/app-gate/ServiceError.d.ts +8 -0
- package/dist/components/app-gate/ServiceError.d.ts.map +1 -0
- package/dist/components/app-gate/ServiceError.js +10 -0
- package/dist/components/app-gate/ServiceError.js.map +1 -0
- package/dist/components/app-gate/index.d.ts +3 -0
- package/dist/components/app-gate/index.d.ts.map +1 -0
- package/dist/components/app-gate/index.js +3 -0
- package/dist/components/app-gate/index.js.map +1 -0
- package/dist/components/app-gate/sdk-route-elements.d.ts +23 -0
- package/dist/components/app-gate/sdk-route-elements.d.ts.map +1 -0
- package/dist/components/app-gate/sdk-route-elements.js +35 -0
- package/dist/components/app-gate/sdk-route-elements.js.map +1 -0
- package/dist/components/app-shell/AppShell.d.ts +7 -0
- package/dist/components/app-shell/AppShell.d.ts.map +1 -0
- package/dist/components/app-shell/AppShell.js +10 -0
- package/dist/components/app-shell/AppShell.js.map +1 -0
- package/dist/components/app-shell/AppShellRoutes.d.ts +9 -0
- package/dist/components/app-shell/AppShellRoutes.d.ts.map +1 -0
- package/dist/components/app-shell/AppShellRoutes.js +20 -0
- package/dist/components/app-shell/AppShellRoutes.js.map +1 -0
- package/dist/components/app-shell/GroupDatastores.d.ts +8 -0
- package/dist/components/app-shell/GroupDatastores.d.ts.map +1 -0
- package/dist/components/app-shell/GroupDatastores.js +15 -0
- package/dist/components/app-shell/GroupDatastores.js.map +1 -0
- package/dist/components/app-shell/GroupRoute.d.ts +2 -0
- package/dist/components/app-shell/GroupRoute.d.ts.map +1 -0
- package/dist/components/app-shell/GroupRoute.js +22 -0
- package/dist/components/app-shell/GroupRoute.js.map +1 -0
- package/dist/components/app-shell/index.d.ts +3 -0
- package/dist/components/app-shell/index.d.ts.map +1 -0
- package/dist/components/app-shell/index.js +3 -0
- package/dist/components/app-shell/index.js.map +1 -0
- package/dist/components/authenticated-chat/index.d.ts +1 -2
- package/dist/components/authenticated-chat/index.d.ts.map +1 -1
- package/dist/components/authenticated-chat/index.js +1 -12
- package/dist/components/authenticated-chat/index.js.map +1 -1
- package/dist/components/chat-view/Chat.d.ts +2 -1
- package/dist/components/chat-view/Chat.d.ts.map +1 -1
- package/dist/components/chat-view/Chat.js +3 -2
- package/dist/components/chat-view/Chat.js.map +1 -1
- package/dist/components/chat-view/MessageItem.d.ts.map +1 -1
- package/dist/components/chat-view/MessageItem.js +4 -2
- package/dist/components/chat-view/MessageItem.js.map +1 -1
- package/dist/components/chat-view/tool-part-rendering.d.ts +1 -0
- package/dist/components/chat-view/tool-part-rendering.d.ts.map +1 -1
- package/dist/components/chat-view/tool-part-rendering.js +8 -1
- package/dist/components/chat-view/tool-part-rendering.js.map +1 -1
- package/dist/components/chip/index.d.ts +1 -0
- package/dist/components/chip/index.d.ts.map +1 -1
- package/dist/components/chip/index.js +2 -1
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/embedded-chat/index.d.ts +1 -1
- package/dist/components/embedded-chat/index.d.ts.map +1 -1
- package/dist/components/embedded-chat/index.js +1 -1
- package/dist/components/embedded-chat/index.js.map +1 -1
- package/dist/components/input/input-date-time.d.ts +6 -0
- package/dist/components/input/input-date-time.d.ts.map +1 -1
- package/dist/components/input/input-date-time.js +2 -1
- package/dist/components/input/input-date-time.js.map +1 -1
- package/dist/components/input/input-date.d.ts +22 -0
- package/dist/components/input/input-date.d.ts.map +1 -1
- package/dist/components/input/input-date.js +28 -14
- package/dist/components/input/input-date.js.map +1 -1
- package/dist/components/input/input-time.d.ts +9 -0
- package/dist/components/input/input-time.d.ts.map +1 -1
- package/dist/components/input/input-time.js +29 -18
- package/dist/components/input/input-time.js.map +1 -1
- package/dist/components/layouts/RouteLayout.d.ts +0 -9
- package/dist/components/layouts/RouteLayout.d.ts.map +1 -1
- package/dist/components/layouts/RouteLayout.js +7 -4
- package/dist/components/layouts/RouteLayout.js.map +1 -1
- package/dist/components/layouts/Sidebar.d.ts +1 -8
- package/dist/components/layouts/Sidebar.d.ts.map +1 -1
- package/dist/components/layouts/Sidebar.js +7 -14
- package/dist/components/layouts/Sidebar.js.map +1 -1
- package/dist/components/plan-limits/PlanLimitsDialog.d.ts +20 -0
- package/dist/components/plan-limits/PlanLimitsDialog.d.ts.map +1 -0
- package/dist/components/plan-limits/PlanLimitsDialog.js +109 -0
- package/dist/components/plan-limits/PlanLimitsDialog.js.map +1 -0
- package/dist/components/plan-limits/index.d.ts +4 -0
- package/dist/components/plan-limits/index.d.ts.map +1 -0
- package/dist/components/plan-limits/index.js +2 -0
- package/dist/components/plan-limits/index.js.map +1 -0
- package/dist/components/plan-limits/plan-limits-client.d.ts +15 -0
- package/dist/components/plan-limits/plan-limits-client.d.ts.map +1 -0
- package/dist/components/plan-limits/plan-limits-client.js +44 -0
- package/dist/components/plan-limits/plan-limits-client.js.map +1 -0
- package/dist/components/plan-limits/plan-limits-model.d.ts +66 -0
- package/dist/components/plan-limits/plan-limits-model.d.ts.map +1 -0
- package/dist/components/plan-limits/plan-limits-model.js +123 -0
- package/dist/components/plan-limits/plan-limits-model.js.map +1 -0
- package/dist/components/plan-limits/plan-limits-save.d.ts +31 -0
- package/dist/components/plan-limits/plan-limits-save.d.ts.map +1 -0
- package/dist/components/plan-limits/plan-limits-save.js +43 -0
- package/dist/components/plan-limits/plan-limits-save.js.map +1 -0
- package/dist/components/planning/PlanLimitsAction.d.ts +6 -0
- package/dist/components/planning/PlanLimitsAction.d.ts.map +1 -0
- package/dist/components/planning/PlanLimitsAction.js +19 -0
- package/dist/components/planning/PlanLimitsAction.js.map +1 -0
- package/dist/components/slider/index.d.ts.map +1 -1
- package/dist/components/slider/index.js +2 -1
- package/dist/components/slider/index.js.map +1 -1
- package/dist/datastore-picker/datastore-picker-rows.d.ts +7 -0
- package/dist/datastore-picker/datastore-picker-rows.d.ts.map +1 -1
- package/dist/datastore-picker/datastore-picker-rows.js +26 -22
- package/dist/datastore-picker/datastore-picker-rows.js.map +1 -1
- package/dist/globals.css +85 -2
- package/dist/hooks/use-action-plans-list.d.ts +3 -0
- package/dist/hooks/use-action-plans-list.d.ts.map +1 -1
- package/dist/hooks/use-action-plans-list.js +8 -9
- package/dist/hooks/use-action-plans-list.js.map +1 -1
- package/dist/hooks/use-activity-feed.d.ts +10 -1
- package/dist/hooks/use-activity-feed.d.ts.map +1 -1
- package/dist/hooks/use-activity-feed.js +9 -11
- package/dist/hooks/use-activity-feed.js.map +1 -1
- package/dist/hooks/use-entity.d.ts +4 -3
- package/dist/hooks/use-entity.d.ts.map +1 -1
- package/dist/hooks/use-entity.js +4 -4
- package/dist/hooks/use-entity.js.map +1 -1
- package/dist/hooks/use-manual-actions.d.ts +1 -1
- package/dist/hooks/use-manual-actions.d.ts.map +1 -1
- package/dist/hooks/use-manual-actions.js +5 -5
- package/dist/hooks/use-manual-actions.js.map +1 -1
- package/dist/hooks/use-unsaved-changes-warning.d.ts +2 -0
- package/dist/hooks/use-unsaved-changes-warning.d.ts.map +1 -0
- package/dist/hooks/use-unsaved-changes-warning.js +13 -0
- package/dist/hooks/use-unsaved-changes-warning.js.map +1 -0
- package/dist/hooks/useAuth.d.ts.map +1 -1
- package/dist/hooks/useAuth.js +4 -3
- package/dist/hooks/useAuth.js.map +1 -1
- package/dist/hooks/useChatPanelSync.d.ts.map +1 -1
- package/dist/hooks/useChatPanelSync.js +2 -3
- package/dist/hooks/useChatPanelSync.js.map +1 -1
- package/dist/hooks/useDatastoreSelection.d.ts.map +1 -1
- package/dist/hooks/useDatastoreSelection.js +11 -4
- package/dist/hooks/useDatastoreSelection.js.map +1 -1
- package/dist/hooks/useExecuteAction.d.ts +1 -0
- package/dist/hooks/useExecuteAction.d.ts.map +1 -1
- package/dist/hooks/useExecuteAction.js.map +1 -1
- package/dist/hooks/useLoginRedirect.d.ts +6 -0
- package/dist/hooks/useLoginRedirect.d.ts.map +1 -0
- package/dist/hooks/useLoginRedirect.js +51 -0
- package/dist/hooks/useLoginRedirect.js.map +1 -0
- package/dist/hooks/usePlanLimits.d.ts +18 -0
- package/dist/hooks/usePlanLimits.d.ts.map +1 -0
- package/dist/hooks/usePlanLimits.js +56 -0
- package/dist/hooks/usePlanLimits.js.map +1 -0
- package/dist/ldo-ui.d.ts +1 -1
- package/dist/ldo-ui.d.ts.map +1 -1
- package/dist/ldo-ui.js.map +1 -1
- package/dist/lib/app-tools.d.ts +18 -0
- package/dist/lib/app-tools.d.ts.map +1 -0
- package/dist/lib/app-tools.js +42 -0
- package/dist/lib/app-tools.js.map +1 -0
- package/dist/lib/chat-types.d.ts +3 -0
- package/dist/lib/chat-types.d.ts.map +1 -1
- package/dist/lib/chat-types.js.map +1 -1
- package/dist/lib/datastore-route-table.d.ts +3 -0
- package/dist/lib/datastore-route-table.d.ts.map +1 -1
- package/dist/lib/datastore-route-table.js +6 -0
- package/dist/lib/datastore-route-table.js.map +1 -1
- package/dist/lib/graphql-error.d.ts +2 -0
- package/dist/lib/graphql-error.d.ts.map +1 -0
- package/dist/lib/graphql-error.js +7 -0
- package/dist/lib/graphql-error.js.map +1 -0
- package/dist/lib/update-notice.d.ts +2 -1
- package/dist/lib/update-notice.d.ts.map +1 -1
- package/dist/lib/update-notice.js +8 -2
- package/dist/lib/update-notice.js.map +1 -1
- package/dist/providers/ActiveChatProvider.d.ts +2 -0
- package/dist/providers/ActiveChatProvider.d.ts.map +1 -1
- package/dist/providers/ActiveChatProvider.js +6 -3
- package/dist/providers/ActiveChatProvider.js.map +1 -1
- package/dist/providers/ActiveDatastoreProvider.d.ts +12 -0
- package/dist/providers/ActiveDatastoreProvider.d.ts.map +1 -1
- package/dist/providers/ActiveDatastoreProvider.js +114 -11
- package/dist/providers/ActiveDatastoreProvider.js.map +1 -1
- package/dist/providers/AuthContext.d.ts +1 -0
- package/dist/providers/AuthContext.d.ts.map +1 -1
- package/dist/providers/AuthContext.js.map +1 -1
- package/dist/providers/KnowledgeGraphStateContext.d.ts +2 -2
- package/dist/providers/KnowledgeGraphStateContext.d.ts.map +1 -1
- package/dist/providers/KnowledgeGraphStateProvider.d.ts.map +1 -1
- package/dist/providers/KnowledgeGraphStateProvider.js +8 -49
- package/dist/providers/KnowledgeGraphStateProvider.js.map +1 -1
- package/dist/providers/MantaClientProvider.d.ts.map +1 -1
- package/dist/providers/MantaClientProvider.js +3 -3
- package/dist/providers/MantaClientProvider.js.map +1 -1
- package/dist/providers/index.d.ts +3 -1
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +2 -2
- package/dist/providers/index.js.map +1 -1
- package/dist/routes/activity/detail/ActivityDetailRoute.d.ts.map +1 -1
- package/dist/routes/activity/detail/ActivityDetailRoute.js +1 -3
- package/dist/routes/activity/detail/ActivityDetailRoute.js.map +1 -1
- package/dist/routes/activity/index.d.ts.map +1 -1
- package/dist/routes/activity/index.js +1 -3
- package/dist/routes/activity/index.js.map +1 -1
- package/dist/routes/chat/index.d.ts +2 -21
- package/dist/routes/chat/index.d.ts.map +1 -1
- package/dist/routes/chat/index.js +4 -2
- package/dist/routes/chat/index.js.map +1 -1
- package/dist/routes/data-collection/index.d.ts.map +1 -1
- package/dist/routes/data-collection/index.js +1 -3
- package/dist/routes/data-collection/index.js.map +1 -1
- package/dist/routes/data-explorer/components/DataExplorerLayout.d.ts.map +1 -1
- package/dist/routes/data-explorer/components/DataExplorerLayout.js +1 -3
- package/dist/routes/data-explorer/components/DataExplorerLayout.js.map +1 -1
- package/dist/routes/data-explorer/components/class-detail/UsedByRules.js +2 -2
- package/dist/routes/data-explorer/components/class-detail/UsedByRules.js.map +1 -1
- package/dist/routes/datastores/index.d.ts.map +1 -1
- package/dist/routes/datastores/index.js +2 -2
- package/dist/routes/datastores/index.js.map +1 -1
- package/dist/routes/explain/index.d.ts.map +1 -1
- package/dist/routes/explain/index.js +1 -3
- package/dist/routes/explain/index.js.map +1 -1
- package/dist/routes/integrations/components/connect-forms/DashConnectForm.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/DashConnectForm.js +0 -1
- package/dist/routes/integrations/components/connect-forms/DashConnectForm.js.map +1 -1
- package/dist/routes/integrations/components/connect-forms/GoogleAdsConnectForm.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/GoogleAdsConnectForm.js +0 -1
- package/dist/routes/integrations/components/connect-forms/GoogleAdsConnectForm.js.map +1 -1
- package/dist/routes/integrations/components/connect-forms/GoogleAnalyticsConnectForm.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/GoogleAnalyticsConnectForm.js +0 -1
- package/dist/routes/integrations/components/connect-forms/GoogleAnalyticsConnectForm.js.map +1 -1
- package/dist/routes/integrations/components/connect-forms/GoogleMerchantCenterConnectForm.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/GoogleMerchantCenterConnectForm.js +0 -1
- package/dist/routes/integrations/components/connect-forms/GoogleMerchantCenterConnectForm.js.map +1 -1
- package/dist/routes/integrations/components/connect-forms/InferalCredentialConnectForm.d.ts +0 -1
- package/dist/routes/integrations/components/connect-forms/InferalCredentialConnectForm.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/InferalCredentialConnectForm.js +3 -2
- package/dist/routes/integrations/components/connect-forms/InferalCredentialConnectForm.js.map +1 -1
- package/dist/routes/integrations/components/connect-forms/KlaviyoConnectForm.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/KlaviyoConnectForm.js +0 -1
- package/dist/routes/integrations/components/connect-forms/KlaviyoConnectForm.js.map +1 -1
- package/dist/routes/integrations/components/connect-forms/MicrosoftAdsConnectForm.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/MicrosoftAdsConnectForm.js +0 -1
- package/dist/routes/integrations/components/connect-forms/MicrosoftAdsConnectForm.js.map +1 -1
- package/dist/routes/integrations/components/connect-forms/OAuthSetupConnectForm.d.ts +0 -1
- package/dist/routes/integrations/components/connect-forms/OAuthSetupConnectForm.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/OAuthSetupConnectForm.js +4 -3
- package/dist/routes/integrations/components/connect-forms/OAuthSetupConnectForm.js.map +1 -1
- package/dist/routes/integrations/components/connect-forms/TriplewhaleConnectForm.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/TriplewhaleConnectForm.js +0 -1
- package/dist/routes/integrations/components/connect-forms/TriplewhaleConnectForm.js.map +1 -1
- package/dist/routes/integrations/components/connect-forms/WoocommerceConnectForm.d.ts.map +1 -1
- package/dist/routes/integrations/components/connect-forms/WoocommerceConnectForm.js +0 -1
- package/dist/routes/integrations/components/connect-forms/WoocommerceConnectForm.js.map +1 -1
- package/dist/routes/integrations/types.d.ts +2 -1
- package/dist/routes/integrations/types.d.ts.map +1 -1
- package/dist/routes/integrations/types.js +16 -0
- package/dist/routes/integrations/types.js.map +1 -1
- package/dist/routes/memories/components/DateValueInput.d.ts +16 -0
- package/dist/routes/memories/components/DateValueInput.d.ts.map +1 -0
- package/dist/routes/memories/components/DateValueInput.js +35 -0
- package/dist/routes/memories/components/DateValueInput.js.map +1 -0
- package/dist/routes/memories/components/EntityValuePicker.d.ts +11 -0
- package/dist/routes/memories/components/EntityValuePicker.d.ts.map +1 -0
- package/dist/routes/memories/components/EntityValuePicker.js +61 -0
- package/dist/routes/memories/components/EntityValuePicker.js.map +1 -0
- package/dist/routes/memories/components/FieldLabel.d.ts +12 -0
- package/dist/routes/memories/components/FieldLabel.d.ts.map +1 -0
- package/dist/routes/memories/components/FieldLabel.js +12 -0
- package/dist/routes/memories/components/FieldLabel.js.map +1 -0
- package/dist/routes/memories/components/ImportanceSlider.d.ts +2 -0
- package/dist/routes/memories/components/ImportanceSlider.d.ts.map +1 -1
- package/dist/routes/memories/components/ImportanceSlider.js +4 -1
- package/dist/routes/memories/components/ImportanceSlider.js.map +1 -1
- package/dist/routes/memories/components/MemoriesFilters.d.ts +2 -2
- package/dist/routes/memories/components/MemoriesFilters.d.ts.map +1 -1
- package/dist/routes/memories/components/MemoriesFilters.js.map +1 -1
- package/dist/routes/memories/components/MemoriesPanel.d.ts.map +1 -1
- package/dist/routes/memories/components/MemoriesPanel.js +4 -0
- package/dist/routes/memories/components/MemoriesPanel.js.map +1 -1
- package/dist/routes/memories/components/MemoriesTabPanel.d.ts +2 -2
- package/dist/routes/memories/components/MemoriesTabPanel.d.ts.map +1 -1
- package/dist/routes/memories/components/MemoryActions.d.ts +2 -0
- package/dist/routes/memories/components/MemoryActions.d.ts.map +1 -1
- package/dist/routes/memories/components/MemoryActions.js +3 -3
- package/dist/routes/memories/components/MemoryActions.js.map +1 -1
- package/dist/routes/memories/components/MemoryFields.d.ts +15 -3
- package/dist/routes/memories/components/MemoryFields.d.ts.map +1 -1
- package/dist/routes/memories/components/MemoryFields.js +34 -5
- package/dist/routes/memories/components/MemoryFields.js.map +1 -1
- package/dist/routes/memories/components/MemoryFormDialog.d.ts +6 -3
- package/dist/routes/memories/components/MemoryFormDialog.d.ts.map +1 -1
- package/dist/routes/memories/components/MemoryFormDialog.js +105 -59
- package/dist/routes/memories/components/MemoryFormDialog.js.map +1 -1
- package/dist/routes/memories/components/MemoryPropertyFields.d.ts +10 -0
- package/dist/routes/memories/components/MemoryPropertyFields.d.ts.map +1 -0
- package/dist/routes/memories/components/MemoryPropertyFields.js +67 -0
- package/dist/routes/memories/components/MemoryPropertyFields.js.map +1 -0
- package/dist/routes/memories/components/RuleDraftDialog.d.ts +7 -0
- package/dist/routes/memories/components/RuleDraftDialog.d.ts.map +1 -0
- package/dist/routes/memories/components/RuleDraftDialog.js +20 -0
- package/dist/routes/memories/components/RuleDraftDialog.js.map +1 -0
- package/dist/routes/memories/components/SchemasTab.d.ts +17 -2
- package/dist/routes/memories/components/SchemasTab.d.ts.map +1 -1
- package/dist/routes/memories/components/SchemasTab.js +146 -28
- package/dist/routes/memories/components/SchemasTab.js.map +1 -1
- package/dist/routes/memories/components/badges.d.ts +7 -0
- package/dist/routes/memories/components/badges.d.ts.map +1 -1
- package/dist/routes/memories/components/badges.js +11 -3
- package/dist/routes/memories/components/badges.js.map +1 -1
- package/dist/routes/memories/hooks/useMemoryColumns.d.ts +4 -2
- package/dist/routes/memories/hooks/useMemoryColumns.d.ts.map +1 -1
- package/dist/routes/memories/hooks/useMemoryColumns.js +31 -15
- package/dist/routes/memories/hooks/useMemoryColumns.js.map +1 -1
- package/dist/routes/memories/index.d.ts +2 -1
- package/dist/routes/memories/index.d.ts.map +1 -1
- package/dist/routes/memories/index.js +72 -30
- package/dist/routes/memories/index.js.map +1 -1
- package/dist/routes/memories/memory-mutation-input.d.ts.map +1 -1
- package/dist/routes/memories/memory-mutation-input.js +5 -2
- package/dist/routes/memories/memory-mutation-input.js.map +1 -1
- package/dist/routes/memories/memory-property-values.d.ts +13 -0
- package/dist/routes/memories/memory-property-values.d.ts.map +1 -0
- package/dist/routes/memories/memory-property-values.js +40 -0
- package/dist/routes/memories/memory-property-values.js.map +1 -0
- package/dist/routes/memories/schemas/AllowedValuesField.d.ts +14 -0
- package/dist/routes/memories/schemas/AllowedValuesField.d.ts.map +1 -0
- package/dist/routes/memories/schemas/AllowedValuesField.js +64 -0
- package/dist/routes/memories/schemas/AllowedValuesField.js.map +1 -0
- package/dist/routes/memories/schemas/MemorySchemaPage.d.ts +127 -0
- package/dist/routes/memories/schemas/MemorySchemaPage.d.ts.map +1 -0
- package/dist/routes/memories/schemas/MemorySchemaPage.js +285 -0
- package/dist/routes/memories/schemas/MemorySchemaPage.js.map +1 -0
- package/dist/routes/memories/schemas/SchemaChangeReviewDialog.d.ts +20 -0
- package/dist/routes/memories/schemas/SchemaChangeReviewDialog.d.ts.map +1 -0
- package/dist/routes/memories/schemas/SchemaChangeReviewDialog.js +54 -0
- package/dist/routes/memories/schemas/SchemaChangeReviewDialog.js.map +1 -0
- package/dist/routes/memories/schemas/SchemaConfirmDialog.d.ts +15 -0
- package/dist/routes/memories/schemas/SchemaConfirmDialog.d.ts.map +1 -0
- package/dist/routes/memories/schemas/SchemaConfirmDialog.js +8 -0
- package/dist/routes/memories/schemas/SchemaConfirmDialog.js.map +1 -0
- package/dist/routes/memories/schemas/SchemaDetailPage.d.ts +15 -0
- package/dist/routes/memories/schemas/SchemaDetailPage.d.ts.map +1 -0
- package/dist/routes/memories/schemas/SchemaDetailPage.js +74 -0
- package/dist/routes/memories/schemas/SchemaDetailPage.js.map +1 -0
- package/dist/routes/memories/schemas/SchemaEditorForm.d.ts +10 -0
- package/dist/routes/memories/schemas/SchemaEditorForm.d.ts.map +1 -0
- package/dist/routes/memories/schemas/SchemaEditorForm.js +242 -0
- package/dist/routes/memories/schemas/SchemaEditorForm.js.map +1 -0
- package/dist/routes/memories/schemas/SchemaTemplatesDialog.d.ts +13 -0
- package/dist/routes/memories/schemas/SchemaTemplatesDialog.d.ts.map +1 -0
- package/dist/routes/memories/schemas/SchemaTemplatesDialog.js +13 -0
- package/dist/routes/memories/schemas/SchemaTemplatesDialog.js.map +1 -0
- package/dist/routes/memories/schemas/ValueTypeSelect.d.ts +12 -0
- package/dist/routes/memories/schemas/ValueTypeSelect.d.ts.map +1 -0
- package/dist/routes/memories/schemas/ValueTypeSelect.js +10 -0
- package/dist/routes/memories/schemas/ValueTypeSelect.js.map +1 -0
- package/dist/routes/memories/schemas/schema-form.d.ts +72 -0
- package/dist/routes/memories/schemas/schema-form.d.ts.map +1 -0
- package/dist/routes/memories/schemas/schema-form.js +279 -0
- package/dist/routes/memories/schemas/schema-form.js.map +1 -0
- package/dist/routes/memories/schemas/schema-impact.d.ts +13 -0
- package/dist/routes/memories/schemas/schema-impact.d.ts.map +1 -0
- package/dist/routes/memories/schemas/schema-impact.js +40 -0
- package/dist/routes/memories/schemas/schema-impact.js.map +1 -0
- package/dist/routes/memories/schemas/schema-route.d.ts +18 -0
- package/dist/routes/memories/schemas/schema-route.d.ts.map +1 -0
- package/dist/routes/memories/schemas/schema-route.js +21 -0
- package/dist/routes/memories/schemas/schema-route.js.map +1 -0
- package/dist/routes/memories/schemas/schema-rule-context.d.ts +17 -0
- package/dist/routes/memories/schemas/schema-rule-context.d.ts.map +1 -0
- package/dist/routes/memories/schemas/schema-rule-context.js +83 -0
- package/dist/routes/memories/schemas/schema-rule-context.js.map +1 -0
- package/dist/routes/memories/schemas/schema-table.d.ts +11 -0
- package/dist/routes/memories/schemas/schema-table.d.ts.map +1 -0
- package/dist/routes/memories/schemas/schema-table.js +34 -0
- package/dist/routes/memories/schemas/schema-table.js.map +1 -0
- package/dist/routes/memories/schemas/useMemorySchemaMutations.d.ts +32 -0
- package/dist/routes/memories/schemas/useMemorySchemaMutations.d.ts.map +1 -0
- package/dist/routes/memories/schemas/useMemorySchemaMutations.js +31 -0
- package/dist/routes/memories/schemas/useMemorySchemaMutations.js.map +1 -0
- package/dist/routes/memories/schemas/useSchemaChangeReview.d.ts +51 -0
- package/dist/routes/memories/schemas/useSchemaChangeReview.d.ts.map +1 -0
- package/dist/routes/memories/schemas/useSchemaChangeReview.js +175 -0
- package/dist/routes/memories/schemas/useSchemaChangeReview.js.map +1 -0
- package/dist/routes/memories/schemas/useSchemaLifecycle.d.ts +46 -0
- package/dist/routes/memories/schemas/useSchemaLifecycle.d.ts.map +1 -0
- package/dist/routes/memories/schemas/useSchemaLifecycle.js +93 -0
- package/dist/routes/memories/schemas/useSchemaLifecycle.js.map +1 -0
- package/dist/routes/memories/schemas/useSchemasTab.d.ts +18 -0
- package/dist/routes/memories/schemas/useSchemasTab.d.ts.map +1 -0
- package/dist/routes/memories/schemas/useSchemasTab.js +92 -0
- package/dist/routes/memories/schemas/useSchemasTab.js.map +1 -0
- package/dist/routes/plans/index.d.ts.map +1 -1
- package/dist/routes/plans/index.js +2 -2
- package/dist/routes/plans/index.js.map +1 -1
- package/dist/routes/rules/components/CreateRuleChatModal.d.ts +7 -1
- package/dist/routes/rules/components/CreateRuleChatModal.d.ts.map +1 -1
- package/dist/routes/rules/components/CreateRuleChatModal.js +9 -4
- package/dist/routes/rules/components/CreateRuleChatModal.js.map +1 -1
- package/dist/routes/rules/components/RuleValueControls.d.ts.map +1 -1
- package/dist/routes/rules/components/RuleValueControls.js +3 -24
- package/dist/routes/rules/components/RuleValueControls.js.map +1 -1
- package/dist/routes/rules/components/rule-value-input.d.ts +11 -0
- package/dist/routes/rules/components/rule-value-input.d.ts.map +1 -0
- package/dist/routes/rules/components/rule-value-input.js +24 -0
- package/dist/routes/rules/components/rule-value-input.js.map +1 -0
- package/dist/routes/rules/components/rules.utils.d.ts +5 -0
- package/dist/routes/rules/components/rules.utils.d.ts.map +1 -1
- package/dist/routes/rules/components/rules.utils.js +18 -3
- package/dist/routes/rules/components/rules.utils.js.map +1 -1
- package/dist/routes/rules/pages.d.ts +1 -1
- package/dist/routes/rules/pages.d.ts.map +1 -1
- package/dist/routes/rules/pages.js +1 -1
- package/dist/routes/rules/pages.js.map +1 -1
- package/dist/shared/graph-derived-queries.d.ts.map +1 -1
- package/dist/shared/graph-derived-queries.js +4 -1
- package/dist/shared/graph-derived-queries.js.map +1 -1
- package/dist/worker/index.d.ts +22 -0
- package/dist/worker/index.d.ts.map +1 -0
- package/dist/worker/index.js +110 -0
- package/dist/worker/index.js.map +1 -0
- package/dist/worker/policy.d.ts +21 -0
- package/dist/worker/policy.d.ts.map +1 -0
- package/dist/worker/policy.js +42 -0
- package/dist/worker/policy.js.map +1 -0
- package/dist/worker/proxy.d.ts +14 -0
- package/dist/worker/proxy.d.ts.map +1 -0
- package/dist/worker/proxy.js +58 -0
- package/dist/worker/proxy.js.map +1 -0
- package/dist/worker/session.d.ts +24 -0
- package/dist/worker/session.d.ts.map +1 -0
- package/dist/worker/session.js +72 -0
- package/dist/worker/session.js.map +1 -0
- package/package.json +52 -7
- package/src/app-subpaths.json +9 -1
- package/src/components/AppErrorBoundary.tsx +14 -11
- package/src/components/app-gate/AppGate.tsx +122 -0
- package/src/components/app-gate/AwaitingDatastoreStatus.tsx +35 -0
- package/src/components/app-gate/EnterDatastoreRoute.tsx +30 -0
- package/src/components/app-gate/ErrorRoute.tsx +43 -0
- package/src/components/app-gate/FailureAlert.tsx +15 -0
- package/src/components/app-gate/NoDatastoreAccess.tsx +26 -0
- package/src/components/app-gate/NotFoundRoute.tsx +20 -0
- package/src/components/app-gate/PendingInvitations.tsx +134 -0
- package/src/components/app-gate/ServiceError.tsx +27 -0
- package/src/components/app-gate/index.ts +2 -0
- package/src/components/app-gate/sdk-route-elements.tsx +46 -0
- package/src/components/app-shell/AppShell.tsx +22 -0
- package/src/components/app-shell/AppShellRoutes.tsx +34 -0
- package/src/components/app-shell/GroupDatastores.tsx +28 -0
- package/src/components/app-shell/GroupRoute.tsx +34 -0
- package/src/components/app-shell/index.ts +2 -0
- package/src/components/authenticated-chat/index.tsx +1 -34
- package/src/components/chat-view/Chat.tsx +9 -3
- package/src/components/chat-view/MessageItem.tsx +10 -2
- package/src/components/chat-view/tool-part-rendering.ts +10 -1
- package/src/components/chip/index.tsx +8 -1
- package/src/components/embedded-chat/index.tsx +2 -1
- package/src/components/input/input-date-time.tsx +10 -3
- package/src/components/input/input-date.tsx +93 -21
- package/src/components/input/input-time.tsx +59 -26
- package/src/components/layouts/RouteLayout.tsx +11 -50
- package/src/components/layouts/Sidebar.tsx +21 -23
- package/src/components/plan-limits/PlanLimitsDialog.tsx +331 -0
- package/src/components/plan-limits/index.tsx +3 -0
- package/src/components/plan-limits/plan-limits-client.ts +71 -0
- package/src/components/plan-limits/plan-limits-model.ts +180 -0
- package/src/components/plan-limits/plan-limits-save.ts +68 -0
- package/src/components/planning/PlanLimitsAction.tsx +44 -0
- package/src/components/slider/index.tsx +2 -1
- package/src/datastore-picker/datastore-picker-rows.ts +36 -20
- package/src/hooks/use-action-plans-list.ts +20 -12
- package/src/hooks/use-activity-feed.ts +30 -14
- package/src/hooks/use-entity.ts +11 -6
- package/src/hooks/use-manual-actions.ts +11 -6
- package/src/hooks/use-unsaved-changes-warning.ts +12 -0
- package/src/hooks/useAuth.ts +5 -3
- package/src/hooks/useChatPanelSync.ts +2 -3
- package/src/hooks/useDatastoreSelection.ts +10 -4
- package/src/hooks/useExecuteAction.ts +2 -0
- package/src/hooks/useLoginRedirect.ts +66 -0
- package/src/hooks/usePlanLimits.ts +97 -0
- package/src/ldo-ui.ts +1 -0
- package/src/lib/app-tools.ts +63 -0
- package/src/lib/chat-types.ts +5 -0
- package/src/lib/datastore-route-table.ts +9 -0
- package/src/lib/graphql-error.ts +7 -0
- package/src/lib/update-notice.ts +12 -2
- package/src/providers/ActiveChatProvider.tsx +8 -3
- package/src/providers/ActiveDatastoreProvider.tsx +179 -9
- package/src/providers/AuthContext.ts +1 -0
- package/src/providers/KnowledgeGraphStateContext.ts +2 -2
- package/src/providers/KnowledgeGraphStateProvider.tsx +13 -65
- package/src/providers/MantaClientProvider.tsx +8 -3
- package/src/providers/index.tsx +7 -4
- package/src/routes/activity/detail/ActivityDetailRoute.tsx +1 -10
- package/src/routes/activity/index.tsx +1 -10
- package/src/routes/chat/index.tsx +11 -47
- package/src/routes/data-collection/index.tsx +1 -11
- package/src/routes/data-explorer/components/DataExplorerLayout.tsx +1 -11
- package/src/routes/data-explorer/components/class-detail/UsedByRules.tsx +2 -2
- package/src/routes/datastores/index.tsx +3 -9
- package/src/routes/explain/index.tsx +1 -11
- package/src/routes/integrations/components/connect-forms/DashConnectForm.tsx +0 -1
- package/src/routes/integrations/components/connect-forms/GoogleAdsConnectForm.tsx +0 -1
- package/src/routes/integrations/components/connect-forms/GoogleAnalyticsConnectForm.tsx +0 -1
- package/src/routes/integrations/components/connect-forms/GoogleMerchantCenterConnectForm.tsx +0 -1
- package/src/routes/integrations/components/connect-forms/InferalCredentialConnectForm.tsx +5 -3
- package/src/routes/integrations/components/connect-forms/KlaviyoConnectForm.tsx +0 -1
- package/src/routes/integrations/components/connect-forms/MicrosoftAdsConnectForm.tsx +0 -1
- package/src/routes/integrations/components/connect-forms/OAuthSetupConnectForm.tsx +7 -7
- package/src/routes/integrations/components/connect-forms/TriplewhaleConnectForm.tsx +0 -1
- package/src/routes/integrations/components/connect-forms/WoocommerceConnectForm.tsx +0 -1
- package/src/routes/integrations/types.ts +22 -6
- package/src/routes/memories/components/DateValueInput.tsx +72 -0
- package/src/routes/memories/components/EntityValuePicker.tsx +132 -0
- package/src/routes/memories/components/FieldLabel.tsx +49 -0
- package/src/routes/memories/components/ImportanceSlider.tsx +5 -1
- package/src/routes/memories/components/MemoriesFilters.tsx +2 -2
- package/src/routes/memories/components/MemoriesPanel.tsx +7 -3
- package/src/routes/memories/components/MemoriesTabPanel.tsx +2 -2
- package/src/routes/memories/components/MemoryActions.tsx +26 -2
- package/src/routes/memories/components/MemoryFields.tsx +75 -12
- package/src/routes/memories/components/MemoryFormDialog.tsx +305 -199
- package/src/routes/memories/components/MemoryPropertyFields.tsx +288 -0
- package/src/routes/memories/components/RuleDraftDialog.tsx +35 -0
- package/src/routes/memories/components/SchemasTab.tsx +481 -118
- package/src/routes/memories/components/badges.tsx +16 -4
- package/src/routes/memories/hooks/useMemoryColumns.tsx +69 -35
- package/src/routes/memories/index.tsx +125 -51
- package/src/routes/memories/memory-mutation-input.ts +5 -2
- package/src/routes/memories/memory-property-values.ts +83 -0
- package/src/routes/memories/schemas/AllowedValuesField.tsx +188 -0
- package/src/routes/memories/schemas/MemorySchemaPage.tsx +476 -0
- package/src/routes/memories/schemas/SchemaChangeReviewDialog.tsx +290 -0
- package/src/routes/memories/schemas/SchemaConfirmDialog.tsx +62 -0
- package/src/routes/memories/schemas/SchemaDetailPage.tsx +373 -0
- package/src/routes/memories/schemas/SchemaEditorForm.tsx +990 -0
- package/src/routes/memories/schemas/SchemaTemplatesDialog.tsx +81 -0
- package/src/routes/memories/schemas/ValueTypeSelect.tsx +37 -0
- package/src/routes/memories/schemas/schema-form.ts +360 -0
- package/src/routes/memories/schemas/schema-impact.ts +66 -0
- package/src/routes/memories/schemas/schema-route.ts +30 -0
- package/src/routes/memories/schemas/schema-rule-context.ts +103 -0
- package/src/routes/memories/schemas/schema-table.ts +54 -0
- package/src/routes/memories/schemas/useMemorySchemaMutations.ts +49 -0
- package/src/routes/memories/schemas/useSchemaChangeReview.ts +238 -0
- package/src/routes/memories/schemas/useSchemaLifecycle.tsx +151 -0
- package/src/routes/memories/schemas/useSchemasTab.ts +119 -0
- package/src/routes/plans/index.tsx +3 -14
- package/src/routes/rules/components/CreateRuleChatModal.tsx +46 -22
- package/src/routes/rules/components/RuleValueControls.tsx +3 -35
- package/src/routes/rules/components/rule-value-input.ts +34 -0
- package/src/routes/rules/components/rules.utils.ts +25 -3
- package/src/routes/rules/pages.ts +5 -1
- package/src/shared/graph-derived-queries.ts +6 -0
- package/src/themes/manta-dark.css +4 -0
- package/src/worker/index.ts +175 -0
- package/src/worker/policy.ts +62 -0
- package/src/worker/proxy.ts +101 -0
- package/src/worker/session.ts +111 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { isPresent } from "@manta-eu/lib/present";
|
|
2
|
+
export function ruleCountsFrom(response) {
|
|
3
|
+
if (!response || isPresent(response.error))
|
|
4
|
+
return undefined;
|
|
5
|
+
return new Map(response.counts.map(({ iri, ruleCount }) => [iri, ruleCount]));
|
|
6
|
+
}
|
|
7
|
+
export const anyCount = { properties: "ANY", rules: "ANY", memories: "ANY" };
|
|
8
|
+
export function schemaCounts(schema, ruleCounts) {
|
|
9
|
+
return {
|
|
10
|
+
properties: schema.properties.filter((property) => !property.computed).length,
|
|
11
|
+
rules: ruleCounts ? (ruleCounts.get(schema.iri) ?? 0) : null,
|
|
12
|
+
memories: schema.memoryCount ?? null,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export function countMatches(count, filter) {
|
|
16
|
+
if (filter === "ANY")
|
|
17
|
+
return true;
|
|
18
|
+
if (count === null)
|
|
19
|
+
return false;
|
|
20
|
+
return filter === "NONE" ? count === 0 : count > 0;
|
|
21
|
+
}
|
|
22
|
+
export function filterSchemas(schemas, search, filters, ruleCounts) {
|
|
23
|
+
const needle = search.trim().toLowerCase();
|
|
24
|
+
return schemas.filter((schema) => {
|
|
25
|
+
const matchesSearch = !isPresent(needle) ||
|
|
26
|
+
schema.label.toLowerCase().includes(needle) ||
|
|
27
|
+
(schema.description ?? "").toLowerCase().includes(needle);
|
|
28
|
+
if (!matchesSearch)
|
|
29
|
+
return false;
|
|
30
|
+
const counts = schemaCounts(schema, ruleCounts);
|
|
31
|
+
return Object.keys(filters).every((key) => countMatches(counts[key], filters[key]));
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=schema-table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-table.js","sourceRoot":"","sources":["../../../../src/routes/memories/schemas/schema-table.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,MAAM,UAAU,cAAc,CAC5B,QAA8E;IAE9E,IAAI,CAAC,QAAQ,IAAI,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC7D,OAAO,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;AAChF,CAAC;AAQD,MAAM,CAAC,MAAM,QAAQ,GAAuB,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAIjG,MAAM,UAAU,YAAY,CAC1B,MAAqC,EACrC,UAAmD;IAEnD,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,MAAM;QAC7E,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,I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): {
|
|
2
|
+
refresh: () => Promise<void>;
|
|
3
|
+
create: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLCreateMemorySchemaMutation, unknown, import("@manta-eu/client").Exact<{
|
|
4
|
+
input: import("@manta-eu/client").GQLCreateMemorySchemaInput;
|
|
5
|
+
}>, unknown>;
|
|
6
|
+
update: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLUpdateMemorySchemaMutation, unknown, import("@manta-eu/client").Exact<{
|
|
7
|
+
input: import("@manta-eu/client").GQLUpdateMemorySchemaInput;
|
|
8
|
+
}>, unknown>;
|
|
9
|
+
archive: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLArchiveMemorySchemaMutation, unknown, import("@manta-eu/client").Exact<{
|
|
10
|
+
input: import("@manta-eu/client").GQLMemorySchemaRevisionInput;
|
|
11
|
+
}>, unknown>;
|
|
12
|
+
unarchive: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLUnarchiveMemorySchemaMutation, unknown, import("@manta-eu/client").Exact<{
|
|
13
|
+
input: import("@manta-eu/client").GQLMemorySchemaRevisionInput;
|
|
14
|
+
}>, unknown>;
|
|
15
|
+
remove: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLDeleteMemorySchemaMutation, unknown, import("@manta-eu/client").Exact<{
|
|
16
|
+
input: import("@manta-eu/client").GQLMemorySchemaRevisionInput;
|
|
17
|
+
}>, unknown>;
|
|
18
|
+
addFromTemplate: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLAddMemorySchemaFromTemplateMutation, unknown, import("@manta-eu/client").Exact<{
|
|
19
|
+
templateIri: import("@manta-eu/client").Scalars["IRI"]["input"];
|
|
20
|
+
}>, unknown>;
|
|
21
|
+
resetToTemplate: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLResetMemorySchemaToTemplateMutation, unknown, import("@manta-eu/client").Exact<{
|
|
22
|
+
input: import("@manta-eu/client").GQLResetMemorySchemaInput;
|
|
23
|
+
}>, unknown>;
|
|
24
|
+
dismissTemplateUpdate: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLDismissMemorySchemaTemplateUpdateMutation, unknown, import("@manta-eu/client").Exact<{
|
|
25
|
+
input: import("@manta-eu/client").GQLMemorySchemaRevisionInput;
|
|
26
|
+
}>, unknown>;
|
|
27
|
+
clearValues: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLClearMemorySchemaPropertyValuesMutation, unknown, import("@manta-eu/client").Exact<{
|
|
28
|
+
input: import("@manta-eu/client").GQLClearMemorySchemaPropertyValuesInput;
|
|
29
|
+
}>, unknown>;
|
|
30
|
+
};
|
|
31
|
+
export type MemorySchemaMutations = ReturnType<typeof useMemorySchemaMutations>;
|
|
32
|
+
//# sourceMappingURL=useMemorySchemaMutations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMemorySchemaMutations.d.ts","sourceRoot":"","sources":["../../../../src/routes/memories/schemas/useMemorySchemaMutations.ts"],"names":[],"mappings":"AAqBA,wBAAgB,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyBvC;AAED,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useAddMemorySchemaFromTemplateMutation, useArchiveMemorySchemaMutation, useClearMemorySchemaPropertyValuesMutation, useCreateMemorySchemaMutation, useDeleteMemorySchemaMutation, useDismissMemorySchemaTemplateUpdateMutation, useMemoriesQuery, useMemorySchemasQuery, useMemorySchemaTemplatesQuery, useMemorySchemaUsageQuery, useResetMemorySchemaToTemplateMutation, useUnarchiveMemorySchemaMutation, useUpdateMemorySchemaMutation, } from "@manta-eu/client";
|
|
2
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
3
|
+
import { useCallback } from "react";
|
|
4
|
+
import { invalidateQueries } from "#lib/tanstack-query";
|
|
5
|
+
import { useMantaClient } from "#providers/index";
|
|
6
|
+
// A schema write can rewrite stored values, so the memories that hold them are refetched with it.
|
|
7
|
+
export function useMemorySchemaMutations() {
|
|
8
|
+
const { mantaClient } = useMantaClient();
|
|
9
|
+
const queryClient = useQueryClient();
|
|
10
|
+
const refresh = useCallback(async () => {
|
|
11
|
+
await invalidateQueries(queryClient, [
|
|
12
|
+
useMemorySchemasQuery,
|
|
13
|
+
useMemorySchemaUsageQuery,
|
|
14
|
+
useMemorySchemaTemplatesQuery,
|
|
15
|
+
useMemoriesQuery,
|
|
16
|
+
]);
|
|
17
|
+
}, [queryClient]);
|
|
18
|
+
return {
|
|
19
|
+
refresh,
|
|
20
|
+
create: useCreateMemorySchemaMutation(mantaClient),
|
|
21
|
+
update: useUpdateMemorySchemaMutation(mantaClient),
|
|
22
|
+
archive: useArchiveMemorySchemaMutation(mantaClient),
|
|
23
|
+
unarchive: useUnarchiveMemorySchemaMutation(mantaClient),
|
|
24
|
+
remove: useDeleteMemorySchemaMutation(mantaClient),
|
|
25
|
+
addFromTemplate: useAddMemorySchemaFromTemplateMutation(mantaClient),
|
|
26
|
+
resetToTemplate: useResetMemorySchemaToTemplateMutation(mantaClient),
|
|
27
|
+
dismissTemplateUpdate: useDismissMemorySchemaTemplateUpdateMutation(mantaClient),
|
|
28
|
+
clearValues: useClearMemorySchemaPropertyValuesMutation(mantaClient),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=useMemorySchemaMutations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMemorySchemaMutations.js","sourceRoot":"","sources":["../../../../src/routes/memories/schemas/useMemorySchemaMutations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sCAAsC,EACtC,8BAA8B,EAC9B,0CAA0C,EAC1C,6BAA6B,EAC7B,6BAA6B,EAC7B,4CAA4C,EAC5C,gBAAgB,EAChB,qBAAqB,EACrB,6BAA6B,EAC7B,yBAAyB,EACzB,sCAAsC,EACtC,gCAAgC,EAChC,6BAA6B,GAC9B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,kGAAkG;AAClG,MAAM,UAAU,wBAAwB;IACtC,MAAM,EAAE,WAAW,EAAE,GAAG,cAAc,EAAE,CAAC;IACzC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IAErC,MAAM,OAAO,GAAG,WAAW,CAAC,KAAK,IAAI,EAAE;QACrC,MAAM,iBAAiB,CAAC,WAAW,EAAE;YACnC,qBAAqB;YACrB,yBAAyB;YACzB,6BAA6B;YAC7B,gBAAgB;SACjB,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,OAAO;QACL,OAAO;QACP,MAAM,EAAE,6BAA6B,CAAC,WAAW,CAAC;QAClD,MAAM,EAAE,6BAA6B,CAAC,WAAW,CAAC;QAClD,OAAO,EAAE,8BAA8B,CAAC,WAAW,CAAC;QACpD,SAAS,EAAE,gCAAgC,CAAC,WAAW,CAAC;QACxD,MAAM,EAAE,6BAA6B,CAAC,WAAW,CAAC;QAClD,eAAe,EAAE,sCAAsC,CAAC,WAAW,CAAC;QACpE,eAAe,EAAE,sCAAsC,CAAC,WAAW,CAAC;QACpE,qBAAqB,EAAE,4CAA4C,CAAC,WAAW,CAAC;QAChF,WAAW,EAAE,0CAA0C,CAAC,WAAW,CAAC;KACrE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type GQLMemorySchemaMutationResultFragment, type GQLMemorySchemaOptionRemapInput } from "@manta-eu/client";
|
|
2
|
+
import { type MemorySchemaImpact, type OptionRemapChoices } from "./schema-impact.js";
|
|
3
|
+
export type SchemaChangeRequest = {
|
|
4
|
+
expectedRevision: number;
|
|
5
|
+
optionRemaps: GQLMemorySchemaOptionRemapInput[];
|
|
6
|
+
clearUnconvertibleValues: boolean;
|
|
7
|
+
dryRun: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type SchemaChangeResult = GQLMemorySchemaMutationResultFragment;
|
|
10
|
+
export type SchemaChangeRun = (request: SchemaChangeRequest) => Promise<SchemaChangeResult>;
|
|
11
|
+
export type SchemaClearRun = (path: string, expectedRevision: number) => Promise<SchemaChangeResult>;
|
|
12
|
+
export type SchemaChangeCallbacks = {
|
|
13
|
+
onApplied: (result: SchemaChangeResult) => void | Promise<void>;
|
|
14
|
+
onInvalid?: (result: SchemaChangeResult) => void;
|
|
15
|
+
onStale: () => void | Promise<void>;
|
|
16
|
+
onRevisionChange?: (revision: number) => void;
|
|
17
|
+
};
|
|
18
|
+
type ReviewState = {
|
|
19
|
+
session: number;
|
|
20
|
+
title: string;
|
|
21
|
+
run: SchemaChangeRun;
|
|
22
|
+
callbacks: SchemaChangeCallbacks;
|
|
23
|
+
revision: number;
|
|
24
|
+
impact: MemorySchemaImpact | null;
|
|
25
|
+
proposed: SchemaChangeResult["schema"];
|
|
26
|
+
choices: OptionRemapChoices;
|
|
27
|
+
clearUnconvertible: boolean;
|
|
28
|
+
};
|
|
29
|
+
export declare function refusalMessage(result: SchemaChangeResult): string;
|
|
30
|
+
export declare function reportFailure(error: unknown, fallback: string): void;
|
|
31
|
+
export declare function useSchemaChangeReview(): {
|
|
32
|
+
state: ReviewState | null;
|
|
33
|
+
isChecking: boolean;
|
|
34
|
+
isApplying: boolean;
|
|
35
|
+
clearingPath: string | null;
|
|
36
|
+
start: (options: {
|
|
37
|
+
title: string;
|
|
38
|
+
run: SchemaChangeRun;
|
|
39
|
+
revision: number;
|
|
40
|
+
callbacks: SchemaChangeCallbacks;
|
|
41
|
+
alwaysReview?: boolean;
|
|
42
|
+
}) => Promise<void>;
|
|
43
|
+
close: () => void;
|
|
44
|
+
apply: () => Promise<void>;
|
|
45
|
+
setRemapChoice: (key: string, choice: string) => void;
|
|
46
|
+
setClearUnconvertible: (clearUnconvertible: boolean) => void;
|
|
47
|
+
clearValues: (path: string, clear: SchemaClearRun) => Promise<void>;
|
|
48
|
+
};
|
|
49
|
+
export type SchemaChangeReview = ReturnType<typeof useSchemaChangeReview>;
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=useSchemaChangeReview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSchemaChangeReview.d.ts","sourceRoot":"","sources":["../../../../src/routes/memories/schemas/useSchemaChangeReview.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,qCAAqC,EAC1C,KAAK,+BAA+B,EACrC,MAAM,kBAAkB,CAAC;AAM1B,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACxB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,mBAAmB,GAAG;IAChC,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,+BAA+B,EAAE,CAAC;IAChD,wBAAwB,EAAE,OAAO,CAAC;IAClC,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,qCAAqC,CAAC;AAEvE,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,mBAAmB,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAE5F,MAAM,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAErG,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACjD,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/C,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,eAAe,CAAC;IACrB,SAAS,EAAE,qBAAqB,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAClC,QAAQ,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACvC,OAAO,EAAE,kBAAkB,CAAC;IAC5B,kBAAkB,EAAE,OAAO,CAAC;CAC7B,CAAC;AAIF,wBAAgB,cAAc,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAGjE;AAWD,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,QAG7D;AAKD,wBAAgB,qBAAqB;;;;;qBAoFjB;QACd,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,eAAe,CAAC;QACrB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,qBAAqB,CAAC;QACjC,YAAY,CAAC,EAAE,OAAO,CAAC;KACxB;;;0BAoEqB,MAAM,UAAU,MAAM;gDACA,OAAO;wBAjCtC,MAAM,SAAS,cAAc;EAoC7C;AAED,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { GQLMemorySchemaMutationStatus, } from "@manta-eu/client";
|
|
2
|
+
import { parseError } from "@manta-eu/client/shared/error-utils";
|
|
3
|
+
import { isPresent } from "@manta-eu/lib/present";
|
|
4
|
+
import { useCallback, useRef, useState } from "react";
|
|
5
|
+
import { toast } from "sonner";
|
|
6
|
+
import { match, P } from "ts-pattern";
|
|
7
|
+
import { impactNeedsReview, optionRemapsInput, } from "./schema-impact.js";
|
|
8
|
+
export function refusalMessage(result) {
|
|
9
|
+
const validation = result.validationErrors.map((error) => error.message).join("; ");
|
|
10
|
+
return result.error ?? (isPresent(validation) ? validation : "The schema could not be changed");
|
|
11
|
+
}
|
|
12
|
+
function requestFor(state, dryRun) {
|
|
13
|
+
return {
|
|
14
|
+
expectedRevision: state.revision,
|
|
15
|
+
optionRemaps: state.impact ? optionRemapsInput(state.impact, state.choices) : [],
|
|
16
|
+
clearUnconvertibleValues: state.clearUnconvertible,
|
|
17
|
+
dryRun,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export function reportFailure(error, fallback) {
|
|
21
|
+
const parsed = parseError(error, fallback);
|
|
22
|
+
toast.error(parsed.message, { description: parsed.description });
|
|
23
|
+
}
|
|
24
|
+
// Every check is a dry run against the server, so the review shows exactly what applying would do. Each review is a
|
|
25
|
+
// session: closing it ends the session, so a check still in flight cannot open the dialog again. Only the latest check
|
|
26
|
+
// settles, so a slower earlier one cannot bring back choices the person has since changed.
|
|
27
|
+
export function useSchemaChangeReview() {
|
|
28
|
+
const session = useRef(0);
|
|
29
|
+
const latestCheck = useRef(0);
|
|
30
|
+
const [state, setState] = useState(null);
|
|
31
|
+
const [isChecking, setChecking] = useState(false);
|
|
32
|
+
const [isApplying, setApplying] = useState(false);
|
|
33
|
+
const [clearingPath, setClearingPath] = useState(null);
|
|
34
|
+
const settle = useCallback(async (result, next, show = true) => {
|
|
35
|
+
const { onApplied, onInvalid, onStale } = next.callbacks;
|
|
36
|
+
const current = next.session === session.current;
|
|
37
|
+
return match(result.status)
|
|
38
|
+
.with(GQLMemorySchemaMutationStatus.Ok, async () => {
|
|
39
|
+
setState(null);
|
|
40
|
+
await onApplied(result);
|
|
41
|
+
return "closed";
|
|
42
|
+
})
|
|
43
|
+
.with(P.union(GQLMemorySchemaMutationStatus.Preview, GQLMemorySchemaMutationStatus.Blocked), async () => {
|
|
44
|
+
if (show && current)
|
|
45
|
+
setState({ ...next, impact: result.impact ?? null, proposed: result.schema });
|
|
46
|
+
return current ? "open" : "closed";
|
|
47
|
+
})
|
|
48
|
+
.with(GQLMemorySchemaMutationStatus.Invalid, async () => {
|
|
49
|
+
setState(null);
|
|
50
|
+
if (onInvalid)
|
|
51
|
+
onInvalid(result);
|
|
52
|
+
else
|
|
53
|
+
toast.error(refusalMessage(result));
|
|
54
|
+
return "closed";
|
|
55
|
+
})
|
|
56
|
+
.with(P.union(GQLMemorySchemaMutationStatus.Conflict, GQLMemorySchemaMutationStatus.NotFound), async () => {
|
|
57
|
+
setState(null);
|
|
58
|
+
toast.error(refusalMessage(result));
|
|
59
|
+
await onStale();
|
|
60
|
+
return "closed";
|
|
61
|
+
})
|
|
62
|
+
.with(GQLMemorySchemaMutationStatus.Limit, async () => {
|
|
63
|
+
setState(null);
|
|
64
|
+
toast.error(refusalMessage(result));
|
|
65
|
+
return "closed";
|
|
66
|
+
})
|
|
67
|
+
.exhaustive();
|
|
68
|
+
}, []);
|
|
69
|
+
const check = useCallback(async (next, show = true) => {
|
|
70
|
+
const ticket = ++latestCheck.current;
|
|
71
|
+
const superseded = () => ticket !== latestCheck.current;
|
|
72
|
+
setChecking(true);
|
|
73
|
+
try {
|
|
74
|
+
const result = await next.run(requestFor(next, true));
|
|
75
|
+
if (superseded())
|
|
76
|
+
return null;
|
|
77
|
+
return { result, outcome: await settle(result, next, show) };
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
if (superseded())
|
|
81
|
+
return null;
|
|
82
|
+
setState(null);
|
|
83
|
+
reportFailure(error, "Failed to check the change");
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
finally {
|
|
87
|
+
if (!superseded())
|
|
88
|
+
setChecking(false);
|
|
89
|
+
}
|
|
90
|
+
}, [settle]);
|
|
91
|
+
const applyState = useCallback(async (current) => {
|
|
92
|
+
setApplying(true);
|
|
93
|
+
try {
|
|
94
|
+
await settle(await current.run(requestFor(current, false)), current);
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
reportFailure(error, "Failed to save the schema");
|
|
98
|
+
}
|
|
99
|
+
finally {
|
|
100
|
+
setApplying(false);
|
|
101
|
+
}
|
|
102
|
+
}, [settle]);
|
|
103
|
+
// `alwaysReview` shows the dialog even when no stored value moves, for a change the person did not author.
|
|
104
|
+
const start = useCallback(async (options) => {
|
|
105
|
+
session.current += 1;
|
|
106
|
+
const initial = {
|
|
107
|
+
session: session.current,
|
|
108
|
+
title: options.title,
|
|
109
|
+
run: options.run,
|
|
110
|
+
callbacks: options.callbacks,
|
|
111
|
+
revision: options.revision,
|
|
112
|
+
impact: null,
|
|
113
|
+
proposed: null,
|
|
114
|
+
choices: {},
|
|
115
|
+
clearUnconvertible: false,
|
|
116
|
+
};
|
|
117
|
+
const alwaysReview = options.alwaysReview === true;
|
|
118
|
+
if (alwaysReview)
|
|
119
|
+
setState(initial);
|
|
120
|
+
const checked = await check(initial, alwaysReview);
|
|
121
|
+
if (checked === null || checked.outcome === "closed" || alwaysReview)
|
|
122
|
+
return;
|
|
123
|
+
if (initial.session !== session.current)
|
|
124
|
+
return;
|
|
125
|
+
const reviewed = { ...initial, impact: checked.result.impact ?? null, proposed: checked.result.schema };
|
|
126
|
+
if (reviewed.impact && !impactNeedsReview(reviewed.impact))
|
|
127
|
+
await applyState(reviewed);
|
|
128
|
+
else
|
|
129
|
+
setState(reviewed);
|
|
130
|
+
}, [check, applyState]);
|
|
131
|
+
const recheck = useCallback((patch) => {
|
|
132
|
+
if (state === null)
|
|
133
|
+
return;
|
|
134
|
+
const next = { ...state, ...patch };
|
|
135
|
+
setState(next);
|
|
136
|
+
void check(next);
|
|
137
|
+
}, [state, check]);
|
|
138
|
+
const clearValues = useCallback(async (path, clear) => {
|
|
139
|
+
if (state === null)
|
|
140
|
+
return;
|
|
141
|
+
setClearingPath(path);
|
|
142
|
+
try {
|
|
143
|
+
const result = await clear(path, state.revision);
|
|
144
|
+
if (result.status !== GQLMemorySchemaMutationStatus.Ok || !result.schema) {
|
|
145
|
+
toast.error(refusalMessage(result));
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
toast.success("Values cleared");
|
|
149
|
+
state.callbacks.onRevisionChange?.(result.schema.revision);
|
|
150
|
+
await check({ ...state, revision: result.schema.revision });
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
reportFailure(error, "Failed to clear the values");
|
|
154
|
+
}
|
|
155
|
+
finally {
|
|
156
|
+
setClearingPath(null);
|
|
157
|
+
}
|
|
158
|
+
}, [state, check]);
|
|
159
|
+
return {
|
|
160
|
+
state,
|
|
161
|
+
isChecking,
|
|
162
|
+
isApplying,
|
|
163
|
+
clearingPath,
|
|
164
|
+
start,
|
|
165
|
+
close: () => {
|
|
166
|
+
session.current += 1;
|
|
167
|
+
setState(null);
|
|
168
|
+
},
|
|
169
|
+
apply: () => (state ? applyState(state) : Promise.resolve()),
|
|
170
|
+
setRemapChoice: (key, choice) => recheck({ choices: { ...(state?.choices ?? {}), [key]: choice } }),
|
|
171
|
+
setClearUnconvertible: (clearUnconvertible) => recheck({ clearUnconvertible }),
|
|
172
|
+
clearValues,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=useSchemaChangeReview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSchemaChangeReview.js","sourceRoot":"","sources":["../../../../src/routes/memories/schemas/useSchemaChangeReview.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,GAG9B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,QA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EAAE,OAAO,EAAE,EAAE,GAAG,CAAC,KAAK,EAAE,OAAO,IAAI,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;QACnH,qBAAqB,EAAE,CAAC,kBAA2B,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAC;QACvF,WAAW;KACZ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type GQLMemorySchemaFieldsFragment } from "@manta-eu/client";
|
|
2
|
+
import { type SchemaChangeResult } from "./useSchemaChangeReview.js";
|
|
3
|
+
export declare function reportResult(result: SchemaChangeResult, success: string): boolean;
|
|
4
|
+
export declare function archiveBlockedReason(ruleCount: number | null | undefined): string | null;
|
|
5
|
+
export declare function deleteBlockedReason(memoryCount: number | null | undefined, ruleCount?: number | null): string | null;
|
|
6
|
+
export declare function useSchemaLifecycle(options?: {
|
|
7
|
+
onDeleted?: () => void;
|
|
8
|
+
}): {
|
|
9
|
+
mutations: {
|
|
10
|
+
refresh: () => Promise<void>;
|
|
11
|
+
create: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLCreateMemorySchemaMutation, unknown, import("@manta-eu/client").Exact<{
|
|
12
|
+
input: import("@manta-eu/client").GQLCreateMemorySchemaInput;
|
|
13
|
+
}>, unknown>;
|
|
14
|
+
update: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLUpdateMemorySchemaMutation, unknown, import("@manta-eu/client").Exact<{
|
|
15
|
+
input: import("@manta-eu/client").GQLUpdateMemorySchemaInput;
|
|
16
|
+
}>, unknown>;
|
|
17
|
+
archive: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLArchiveMemorySchemaMutation, unknown, import("@manta-eu/client").Exact<{
|
|
18
|
+
input: import("@manta-eu/client").GQLMemorySchemaRevisionInput;
|
|
19
|
+
}>, unknown>;
|
|
20
|
+
unarchive: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLUnarchiveMemorySchemaMutation, unknown, import("@manta-eu/client").Exact<{
|
|
21
|
+
input: import("@manta-eu/client").GQLMemorySchemaRevisionInput;
|
|
22
|
+
}>, unknown>;
|
|
23
|
+
remove: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLDeleteMemorySchemaMutation, unknown, import("@manta-eu/client").Exact<{
|
|
24
|
+
input: import("@manta-eu/client").GQLMemorySchemaRevisionInput;
|
|
25
|
+
}>, unknown>;
|
|
26
|
+
addFromTemplate: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLAddMemorySchemaFromTemplateMutation, unknown, import("@manta-eu/client").Exact<{
|
|
27
|
+
templateIri: import("@manta-eu/client").Scalars["IRI"]["input"];
|
|
28
|
+
}>, unknown>;
|
|
29
|
+
resetToTemplate: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLResetMemorySchemaToTemplateMutation, unknown, import("@manta-eu/client").Exact<{
|
|
30
|
+
input: import("@manta-eu/client").GQLResetMemorySchemaInput;
|
|
31
|
+
}>, unknown>;
|
|
32
|
+
dismissTemplateUpdate: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLDismissMemorySchemaTemplateUpdateMutation, unknown, import("@manta-eu/client").Exact<{
|
|
33
|
+
input: import("@manta-eu/client").GQLMemorySchemaRevisionInput;
|
|
34
|
+
}>, unknown>;
|
|
35
|
+
clearValues: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLClearMemorySchemaPropertyValuesMutation, unknown, import("@manta-eu/client").Exact<{
|
|
36
|
+
input: import("@manta-eu/client").GQLClearMemorySchemaPropertyValuesInput;
|
|
37
|
+
}>, unknown>;
|
|
38
|
+
};
|
|
39
|
+
isPending: boolean;
|
|
40
|
+
runStatus: (action: () => Promise<SchemaChangeResult>, success: string, after?: (result: SchemaChangeResult) => void) => Promise<void>;
|
|
41
|
+
askToArchive: (schema: GQLMemorySchemaFieldsFragment) => void;
|
|
42
|
+
askToDelete: (schema: GQLMemorySchemaFieldsFragment) => void;
|
|
43
|
+
restore: (schema: GQLMemorySchemaFieldsFragment) => void;
|
|
44
|
+
dialogs: import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=useSchemaLifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSchemaLifecycle.d.ts","sourceRoot":"","sources":["../../../../src/routes/memories/schemas/useSchemaLifecycle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AASrG,OAAO,EAAiC,KAAK,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAEjG,wBAAgB,YAAY,CAAC,MAAM,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAcjF;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAKxF;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAKpH;AAID,wBAAgB,kBAAkB,CAAC,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;CAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAS7D,MAAM,OAAO,CAAC,kBAAkB,CAAC,WAChC,MAAM,UACP,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI;2BA2BrC,6BAA6B;0BAI7B,6BAA6B;sBAd7B,6BAA6B;;EA+EzC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { GQLMemorySchemaMutationStatus } from "@manta-eu/client";
|
|
3
|
+
import { humanCount } from "@manta-eu/lib/humanize";
|
|
4
|
+
import { isPresent } from "@manta-eu/lib/present";
|
|
5
|
+
import { useCallback, useState } from "react";
|
|
6
|
+
import { toast } from "sonner";
|
|
7
|
+
import { match, P } from "ts-pattern";
|
|
8
|
+
import { readableBlockers } from "./schema-impact.js";
|
|
9
|
+
import { SchemaConfirmDialog } from "./SchemaConfirmDialog.js";
|
|
10
|
+
import { useMemorySchemaMutations } from "./useMemorySchemaMutations.js";
|
|
11
|
+
import { refusalMessage, reportFailure } from "./useSchemaChangeReview.js";
|
|
12
|
+
export function reportResult(result, success) {
|
|
13
|
+
return match(result)
|
|
14
|
+
.with({ status: GQLMemorySchemaMutationStatus.Ok }, () => {
|
|
15
|
+
toast.success(success);
|
|
16
|
+
return true;
|
|
17
|
+
})
|
|
18
|
+
.with({ status: GQLMemorySchemaMutationStatus.Blocked, impact: { blockers: P.when(isPresent) } }, ({ impact }) => {
|
|
19
|
+
toast.error("This cannot be done yet", { description: readableBlockers(impact).join(" ") });
|
|
20
|
+
return false;
|
|
21
|
+
})
|
|
22
|
+
.otherwise(() => {
|
|
23
|
+
toast.error(refusalMessage(result));
|
|
24
|
+
return false;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export function archiveBlockedReason(ruleCount) {
|
|
28
|
+
if (!ruleCount)
|
|
29
|
+
return null;
|
|
30
|
+
return ruleCount === 1
|
|
31
|
+
? "1 rule uses this schema. Change that rule first."
|
|
32
|
+
: `${humanCount(ruleCount, "rule")} use this schema. Change those rules first.`;
|
|
33
|
+
}
|
|
34
|
+
export function deleteBlockedReason(memoryCount, ruleCount) {
|
|
35
|
+
const rulesBlock = archiveBlockedReason(ruleCount);
|
|
36
|
+
if (rulesBlock !== null)
|
|
37
|
+
return rulesBlock;
|
|
38
|
+
if (!memoryCount)
|
|
39
|
+
return null;
|
|
40
|
+
return `${humanCount(memoryCount, "memory")} ${memoryCount === 1 ? "uses" : "use"} this schema, so it can only be archived`;
|
|
41
|
+
}
|
|
42
|
+
export function useSchemaLifecycle(options = {}) {
|
|
43
|
+
const { onDeleted } = options;
|
|
44
|
+
const mutations = useMemorySchemaMutations();
|
|
45
|
+
const [confirming, setConfirming] = useState(null);
|
|
46
|
+
const isPending = mutations.archive.isPending || mutations.unarchive.isPending || mutations.remove.isPending;
|
|
47
|
+
const { refresh } = mutations;
|
|
48
|
+
const runStatus = useCallback(async (action, success, after) => {
|
|
49
|
+
try {
|
|
50
|
+
const result = await action();
|
|
51
|
+
if (reportResult(result, success))
|
|
52
|
+
after?.(result);
|
|
53
|
+
await refresh();
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
reportFailure(error, "The schema could not be changed");
|
|
57
|
+
}
|
|
58
|
+
finally {
|
|
59
|
+
setConfirming(null);
|
|
60
|
+
}
|
|
61
|
+
}, [refresh]);
|
|
62
|
+
const unarchive = mutations.unarchive.mutateAsync;
|
|
63
|
+
const restore = useCallback((schema) => {
|
|
64
|
+
void runStatus(async () => (await unarchive({ input: { iri: schema.iri, expectedRevision: schema.revision } })).unarchiveMemorySchema, `Restored ${schema.label}`);
|
|
65
|
+
}, [runStatus, unarchive]);
|
|
66
|
+
const askToArchive = useCallback((schema) => setConfirming({ action: "archive", schema }), []);
|
|
67
|
+
const askToDelete = useCallback((schema) => setConfirming({ action: "delete", schema }), []);
|
|
68
|
+
const archiving = confirming?.action === "archive" ? confirming.schema : null;
|
|
69
|
+
const deleting = confirming?.action === "delete" ? confirming.schema : null;
|
|
70
|
+
const dialogs = (_jsxs(_Fragment, { children: [_jsx(SchemaConfirmDialog, { open: archiving !== null, title: `Archive ${archiving?.label ?? "this schema"}?`, description: "No new memory can use it. Memories that already use it keep their values, and you can restore it later.", confirmLabel: "Archive", pendingLabel: "Archiving\u2026", isPending: mutations.archive.isPending, onCancel: () => setConfirming(null), onConfirm: () => {
|
|
71
|
+
if (archiving === null)
|
|
72
|
+
return;
|
|
73
|
+
void runStatus(async () => (await mutations.archive.mutateAsync({
|
|
74
|
+
input: { iri: archiving.iri, expectedRevision: archiving.revision },
|
|
75
|
+
})).archiveMemorySchema, `Archived ${archiving.label}`);
|
|
76
|
+
} }), _jsx(SchemaConfirmDialog, { open: deleting !== null, title: `Delete ${deleting?.label ?? "this schema"}?`, description: "This removes the schema for good. No memory uses it.", confirmLabel: "Delete", pendingLabel: "Deleting\u2026", destructive: true, isPending: mutations.remove.isPending, onCancel: () => setConfirming(null), onConfirm: () => {
|
|
77
|
+
if (deleting === null)
|
|
78
|
+
return;
|
|
79
|
+
void runStatus(async () => (await mutations.remove.mutateAsync({
|
|
80
|
+
input: { iri: deleting.iri, expectedRevision: deleting.revision },
|
|
81
|
+
})).deleteMemorySchema, `Deleted ${deleting.label}`, onDeleted);
|
|
82
|
+
} })] }));
|
|
83
|
+
return {
|
|
84
|
+
mutations,
|
|
85
|
+
isPending,
|
|
86
|
+
runStatus,
|
|
87
|
+
askToArchive,
|
|
88
|
+
askToDelete,
|
|
89
|
+
restore,
|
|
90
|
+
dialogs,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=useSchemaLifecycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSchemaLifecycle.js","sourceRoot":"","sources":["../../../../src/routes/memories/schemas/useSchemaLifecycle.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,6BAA6B,EAAsC,MAAM,kBAAkB,CAAC;AACrG,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,u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 +1,18 @@
|
|
|
1
|
+
import { type GQLMemorySchemaFieldsFragment } from "@manta-eu/client";
|
|
2
|
+
import type { SchemaTemplatesDialogProps } from "./SchemaTemplatesDialog.js";
|
|
3
|
+
import type { PageHeaderAction } from "#components/layouts/page/index";
|
|
4
|
+
export declare function useSchemasTab(options: {
|
|
5
|
+
canManage: boolean;
|
|
6
|
+
}): {
|
|
7
|
+
view: import("./schema-route.js").MemorySchemaView | null;
|
|
8
|
+
schemas: GQLMemorySchemaFieldsFragment[];
|
|
9
|
+
listedSchemas: GQLMemorySchemaFieldsFragment[];
|
|
10
|
+
isLoading: boolean;
|
|
11
|
+
errorMessage: string | null;
|
|
12
|
+
query: string;
|
|
13
|
+
setQuery: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
14
|
+
openNew: () => undefined;
|
|
15
|
+
headerActions: PageHeaderAction[];
|
|
16
|
+
templatesDialog: SchemaTemplatesDialogProps;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=useSchemasTab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSchemasTab.d.ts","sourceRoot":"","sources":["../../../../src/routes/memories/schemas/useSchemasTab.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,6BAA6B,EACnC,MAAM,kBAAkB,CAAC;AAO1B,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAE1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAMvE,wBAAgB,aAAa,CAAC,OAAO,EAAE;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE;;;;;;;;;;;EAiG5D"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { GQLMemorySchemaMutationStatus, GQLMemorySchemaStatus, useMemorySchemasQuery, useMemorySchemaTemplatesQuery, } from "@manta-eu/client";
|
|
2
|
+
import { parseError } from "@manta-eu/client/shared/error-utils";
|
|
3
|
+
import { Archive, EyeOff, LayoutTemplate, Plus } from "lucide-react";
|
|
4
|
+
import { useCallback, useMemo, useState } from "react";
|
|
5
|
+
import { useLocation, useNavigate, useParams } from "react-router";
|
|
6
|
+
import { toast } from "sonner";
|
|
7
|
+
import { memorySchemaView, newMemorySchemaPath } from "./schema-route.js";
|
|
8
|
+
import { useMemorySchemaMutations } from "./useMemorySchemaMutations.js";
|
|
9
|
+
import { useMantaClient } from "#providers/index";
|
|
10
|
+
const emptySchemas = [];
|
|
11
|
+
// Everything the memories route needs for its Schemas tab, the schema pages under it, and the defaults dialog.
|
|
12
|
+
export function useSchemasTab(options) {
|
|
13
|
+
const { canManage } = options;
|
|
14
|
+
const { mantaClient } = useMantaClient();
|
|
15
|
+
const navigate = useNavigate();
|
|
16
|
+
const { schemaName } = useParams();
|
|
17
|
+
const { pathname } = useLocation();
|
|
18
|
+
const { data, isLoading, error } = useMemorySchemasQuery(mantaClient, { includeArchived: true });
|
|
19
|
+
const schemas = data?.memorySchemas.schemas ?? emptySchemas;
|
|
20
|
+
const errorMessage = data?.memorySchemas.error ?? (error ? parseError(error, "Failed to load schemas").message : null);
|
|
21
|
+
const mutations = useMemorySchemaMutations();
|
|
22
|
+
const [query, setQuery] = useState("");
|
|
23
|
+
const [showArchived, setShowArchived] = useState(false);
|
|
24
|
+
const [showTemplates, setShowTemplates] = useState(false);
|
|
25
|
+
const [addingTemplateIri, setAddingTemplateIri] = useState(null);
|
|
26
|
+
const { data: templatesData, isLoading: templatesLoading, error: templatesError, } = useMemorySchemaTemplatesQuery(mantaClient, undefined, { enabled: showTemplates && canManage });
|
|
27
|
+
const listedSchemas = useMemo(() => (showArchived ? schemas : schemas.filter((schema) => schema.status === GQLMemorySchemaStatus.Active)), [schemas, showArchived]);
|
|
28
|
+
const addTemplate = useCallback(async (templateIri) => {
|
|
29
|
+
setAddingTemplateIri(templateIri);
|
|
30
|
+
try {
|
|
31
|
+
const result = (await mutations.addFromTemplate.mutateAsync({ templateIri })).addMemorySchemaFromTemplate;
|
|
32
|
+
if (result.status !== GQLMemorySchemaMutationStatus.Ok) {
|
|
33
|
+
throw new Error(result.error ?? "The default schema could not be restored");
|
|
34
|
+
}
|
|
35
|
+
toast.success(`Restored ${result.schema?.label ?? "the default schema"}`);
|
|
36
|
+
await mutations.refresh();
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
const err = parseError(e, "Failed to restore the default schema");
|
|
40
|
+
toast.error(err.message, { description: err.description });
|
|
41
|
+
}
|
|
42
|
+
finally {
|
|
43
|
+
setAddingTemplateIri(null);
|
|
44
|
+
}
|
|
45
|
+
}, [mutations]);
|
|
46
|
+
const openNew = useCallback(() => void navigate(newMemorySchemaPath), [navigate]);
|
|
47
|
+
const headerActions = [
|
|
48
|
+
{
|
|
49
|
+
key: "archived-schemas",
|
|
50
|
+
label: showArchived ? "Hide archived" : "Show archived",
|
|
51
|
+
icon: showArchived ? EyeOff : Archive,
|
|
52
|
+
variant: "secondary",
|
|
53
|
+
active: showArchived,
|
|
54
|
+
onClick: () => setShowArchived((v) => !v),
|
|
55
|
+
},
|
|
56
|
+
...(canManage
|
|
57
|
+
? [
|
|
58
|
+
{
|
|
59
|
+
key: "templates",
|
|
60
|
+
label: "Restore defaults",
|
|
61
|
+
icon: LayoutTemplate,
|
|
62
|
+
variant: "secondary",
|
|
63
|
+
onClick: () => setShowTemplates(true),
|
|
64
|
+
},
|
|
65
|
+
{ key: "new-schema", label: "New schema", icon: Plus, onClick: openNew },
|
|
66
|
+
]
|
|
67
|
+
: []),
|
|
68
|
+
];
|
|
69
|
+
const templatesDialog = {
|
|
70
|
+
open: showTemplates,
|
|
71
|
+
templates: templatesData?.memorySchemaTemplates.templates ?? [],
|
|
72
|
+
isLoading: templatesLoading,
|
|
73
|
+
errorMessage: templatesData?.memorySchemaTemplates.error ??
|
|
74
|
+
(templatesError ? parseError(templatesError, "Failed to load the default schemas").message : null),
|
|
75
|
+
addingIri: addingTemplateIri,
|
|
76
|
+
onAdd: (iri) => void addTemplate(iri),
|
|
77
|
+
onClose: () => setShowTemplates(false),
|
|
78
|
+
};
|
|
79
|
+
return {
|
|
80
|
+
view: memorySchemaView(pathname, schemaName),
|
|
81
|
+
schemas,
|
|
82
|
+
listedSchemas,
|
|
83
|
+
isLoading,
|
|
84
|
+
errorMessage,
|
|
85
|
+
query,
|
|
86
|
+
setQuery,
|
|
87
|
+
openNew,
|
|
88
|
+
headerActions,
|
|
89
|
+
templatesDialog,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=useSchemasTab.js.map
|