@pattern-stack/frontend-patterns 0.1.3 → 0.2.0-alpha.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/CHANGELOG.md +69 -74
- package/README.md +17 -2
- package/cli/commands/generate-hooks.ts +2 -2
- package/cli/commands/scaffold.ts +1 -1
- package/cli/index.ts +1 -3
- package/cli/src/codegen/openapi/client-generator.js +4 -17
- package/cli/src/codegen/openapi/hook-generator.js +181 -513
- package/cli/src/codegen/openapi/parser.js +9 -14
- package/cli/src/codegen/openapi/type-generator.js +6 -16
- package/dist/atoms/components/core/Avatar/Avatar.d.ts +6 -6
- package/dist/atoms/components/core/Avatar/Avatar.d.ts.map +1 -1
- package/dist/atoms/components/core/Avatar/index.d.ts +1 -1
- package/dist/atoms/components/core/Badge/Badge.d.ts +6 -6
- package/dist/atoms/components/core/Badge/Badge.d.ts.map +1 -1
- package/dist/atoms/components/core/Badge/index.d.ts +1 -1
- package/dist/atoms/components/core/Button/Button.d.ts +3 -3
- package/dist/atoms/components/core/Button/Button.d.ts.map +1 -1
- package/dist/atoms/components/core/Button/index.d.ts +2 -2
- package/dist/atoms/components/core/Card/Card.d.ts +2 -2
- package/dist/atoms/components/core/Card/Card.d.ts.map +1 -1
- package/dist/atoms/components/core/Card/index.d.ts +2 -2
- package/dist/atoms/components/core/Card/index.d.ts.map +1 -1
- package/dist/atoms/components/core/Checkbox/Checkbox.d.ts +4 -4
- package/dist/atoms/components/core/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/atoms/components/core/Checkbox/index.d.ts +2 -2
- package/dist/atoms/components/core/Input/Input.d.ts +2 -2
- package/dist/atoms/components/core/Input/Input.d.ts.map +1 -1
- package/dist/atoms/components/core/Input/index.d.ts +2 -2
- package/dist/atoms/components/core/Label/Label.d.ts +3 -4
- package/dist/atoms/components/core/Label/Label.d.ts.map +1 -1
- package/dist/atoms/components/core/Label/index.d.ts +2 -2
- package/dist/atoms/components/core/Select/Select.d.ts +5 -5
- package/dist/atoms/components/core/Select/Select.d.ts.map +1 -1
- package/dist/atoms/components/core/Select/index.d.ts +2 -2
- package/dist/atoms/components/core/Select/index.d.ts.map +1 -1
- package/dist/atoms/components/core/Spinner/Spinner.d.ts +4 -4
- package/dist/atoms/components/core/Spinner/Spinner.d.ts.map +1 -1
- package/dist/atoms/components/core/Spinner/index.d.ts +2 -2
- package/dist/atoms/components/core/Switch/Switch.d.ts +4 -4
- package/dist/atoms/components/core/Switch/Switch.d.ts.map +1 -1
- package/dist/atoms/components/core/Switch/index.d.ts +1 -1
- package/dist/atoms/components/core/index.d.ts +10 -10
- package/dist/atoms/components/core/index.d.ts.map +1 -1
- package/dist/atoms/components/data/ActivityFeed/ActivityFeed.d.ts +2 -2
- package/dist/atoms/components/data/ActivityFeed/ActivityFeed.d.ts.map +1 -1
- package/dist/atoms/components/data/ActivityFeed/ActivityFeedItem.d.ts +3 -3
- package/dist/atoms/components/data/ActivityFeed/ActivityFeedItem.d.ts.map +1 -1
- package/dist/atoms/components/data/ActivityFeed/index.d.ts +3 -3
- package/dist/atoms/components/data/ActivityFeed/index.d.ts.map +1 -1
- package/dist/atoms/components/data/ActivityFeed/types.d.ts +3 -3
- package/dist/atoms/components/data/ActivityFeed/types.d.ts.map +1 -1
- package/dist/atoms/components/data/ActivityFeed/utils.d.ts +2 -2
- package/dist/atoms/components/data/ActivityFeed/utils.d.ts.map +1 -1
- package/dist/atoms/components/data/Chart/Chart.d.ts +52 -5
- package/dist/atoms/components/data/Chart/Chart.d.ts.map +1 -1
- package/dist/atoms/components/data/Chart/index.d.ts +2 -2
- package/dist/atoms/components/data/Chart/index.d.ts.map +1 -1
- package/dist/atoms/components/data/DataBadge/DataBadge.d.ts +6 -6
- package/dist/atoms/components/data/DataBadge/DataBadge.d.ts.map +1 -1
- package/dist/atoms/components/data/DataBadge/index.d.ts +1 -1
- package/dist/atoms/components/data/DataTable/DataTable.d.ts +4 -4
- package/dist/atoms/components/data/DataTable/DataTable.d.ts.map +1 -1
- package/dist/atoms/components/data/DataTable/DataTable.types.d.ts +4 -4
- package/dist/atoms/components/data/DataTable/DataTable.types.d.ts.map +1 -1
- package/dist/atoms/components/data/DataTable/TableCellWithTooltip.d.ts +1 -1
- package/dist/atoms/components/data/DataTable/index.d.ts +2 -2
- package/dist/atoms/components/data/DetailedCard/DetailedCard.d.ts +4 -4
- package/dist/atoms/components/data/DetailedCard/DetailedCard.d.ts.map +1 -1
- package/dist/atoms/components/data/DetailedCard/index.d.ts +2 -2
- package/dist/atoms/components/data/EntityIcon/EntityIcon.d.ts +3 -3
- package/dist/atoms/components/data/EntityIcon/EntityIcon.d.ts.map +1 -1
- package/dist/atoms/components/data/EntityIcon/index.d.ts +1 -1
- package/dist/atoms/components/data/IconBadge/IconBadge.d.ts +6 -6
- package/dist/atoms/components/data/IconBadge/IconBadge.d.ts.map +1 -1
- package/dist/atoms/components/data/IconBadge/index.d.ts +2 -2
- package/dist/atoms/components/data/ListCard/ListCard.d.ts +9 -9
- package/dist/atoms/components/data/ListCard/ListCard.d.ts.map +1 -1
- package/dist/atoms/components/data/ListCard/index.d.ts +1 -1
- package/dist/atoms/components/data/ProgressBar/ProgressBar.d.ts +5 -5
- package/dist/atoms/components/data/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/atoms/components/data/ProgressBar/index.d.ts +1 -1
- package/dist/atoms/components/data/StatCard/StatCard.d.ts +3 -3
- package/dist/atoms/components/data/StatCard/StatCard.d.ts.map +1 -1
- package/dist/atoms/components/data/StatCard/index.d.ts +1 -1
- package/dist/atoms/components/data/Table/Table.d.ts +2 -2
- package/dist/atoms/components/data/Table/Table.d.ts.map +1 -1
- package/dist/atoms/components/data/Table/index.d.ts +1 -1
- package/dist/atoms/components/data/TruncatedText/TruncatedText.d.ts +2 -2
- package/dist/atoms/components/data/TruncatedText/TruncatedText.d.ts.map +1 -1
- package/dist/atoms/components/data/TruncatedText/index.d.ts +1 -1
- package/dist/atoms/components/data/index.d.ts +12 -12
- package/dist/atoms/components/data/index.d.ts.map +1 -1
- package/dist/atoms/components/domain/SalesPanel/SalesPanel.d.ts +15 -15
- package/dist/atoms/components/domain/SalesPanel/SalesPanel.d.ts.map +1 -1
- package/dist/atoms/components/domain/SalesPanel/index.d.ts +1 -1
- package/dist/atoms/components/domain/SalesPanel/index.d.ts.map +1 -1
- package/dist/atoms/components/domain/index.d.ts +1 -1
- package/dist/atoms/components/feedback/Alert/Alert.d.ts +4 -4
- package/dist/atoms/components/feedback/Alert/Alert.d.ts.map +1 -1
- package/dist/atoms/components/feedback/Alert/index.d.ts +1 -1
- package/dist/atoms/components/feedback/EmptyState/EmptyState.d.ts +3 -3
- package/dist/atoms/components/feedback/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/atoms/components/feedback/EmptyState/index.d.ts +1 -1
- package/dist/atoms/components/feedback/ErrorBoundary/ErrorBoundary.d.ts +1 -1
- package/dist/atoms/components/feedback/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
- package/dist/atoms/components/feedback/ErrorBoundary/index.d.ts +1 -1
- package/dist/atoms/components/feedback/Skeleton/Skeleton.d.ts +30 -4
- package/dist/atoms/components/feedback/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/atoms/components/feedback/Skeleton/index.d.ts +1 -1
- package/dist/atoms/components/feedback/Toast/Toast.d.ts +4 -4
- package/dist/atoms/components/feedback/Toast/Toast.d.ts.map +1 -1
- package/dist/atoms/components/feedback/Toast/index.d.ts +1 -1
- package/dist/atoms/components/feedback/Toast/index.d.ts.map +1 -1
- package/dist/atoms/components/feedback/index.d.ts +5 -5
- package/dist/atoms/components/feedback/index.d.ts.map +1 -1
- package/dist/atoms/components/forms/DateTimePicker/DateTimePicker.d.ts +6 -6
- package/dist/atoms/components/forms/DateTimePicker/DateTimePicker.d.ts.map +1 -1
- package/dist/atoms/components/forms/DateTimePicker/index.d.ts +2 -2
- package/dist/atoms/components/forms/FileUpload/FileUpload.d.ts +3 -3
- package/dist/atoms/components/forms/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/atoms/components/forms/FileUpload/index.d.ts +2 -2
- package/dist/atoms/components/forms/FormField/FormField.d.ts +2 -2
- package/dist/atoms/components/forms/FormField/FormField.d.ts.map +1 -1
- package/dist/atoms/components/forms/FormField/index.d.ts +1 -1
- package/dist/atoms/components/forms/index.d.ts +3 -3
- package/dist/atoms/components/index.d.ts +9 -9
- package/dist/atoms/components/layout/Accordion/Accordion.d.ts +3 -3
- package/dist/atoms/components/layout/Accordion/Accordion.d.ts.map +1 -1
- package/dist/atoms/components/layout/Accordion/index.d.ts +1 -1
- package/dist/atoms/components/layout/Accordion/index.d.ts.map +1 -1
- package/dist/atoms/components/layout/Breadcrumb/Breadcrumb.d.ts +2 -3
- package/dist/atoms/components/layout/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/atoms/components/layout/Breadcrumb/index.d.ts +1 -1
- package/dist/atoms/components/layout/Breadcrumb/index.d.ts.map +1 -1
- package/dist/atoms/components/layout/Dialog/Dialog.d.ts +45 -0
- package/dist/atoms/components/layout/Dialog/Dialog.d.ts.map +1 -0
- package/dist/atoms/components/layout/Dialog/index.d.ts +2 -2
- package/dist/atoms/components/layout/Dialog/index.d.ts.map +1 -1
- package/dist/atoms/components/layout/Dropdown/Dropdown.d.ts +9 -9
- package/dist/atoms/components/layout/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/atoms/components/layout/Dropdown/index.d.ts +2 -2
- package/dist/atoms/components/layout/Dropdown/index.d.ts.map +1 -1
- package/dist/atoms/components/layout/Modal/Modal.d.ts +6 -6
- package/dist/atoms/components/layout/Modal/Modal.d.ts.map +1 -1
- package/dist/atoms/components/layout/Modal/index.d.ts +2 -2
- package/dist/atoms/components/layout/Tabs/Tabs.d.ts +46 -0
- package/dist/atoms/components/layout/Tabs/Tabs.d.ts.map +1 -0
- package/dist/atoms/components/layout/Tabs/index.d.ts +1 -1
- package/dist/atoms/components/layout/Tooltip/Tooltip.d.ts +6 -6
- package/dist/atoms/components/layout/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/atoms/components/layout/Tooltip/index.d.ts +1 -1
- package/dist/atoms/components/layout/index.d.ts +7 -7
- package/dist/atoms/components/layout/index.d.ts.map +1 -1
- package/dist/atoms/components/navigation/GlobalSearch/GlobalSearch.d.ts +2 -3
- package/dist/atoms/components/navigation/GlobalSearch/GlobalSearch.d.ts.map +1 -1
- package/dist/atoms/components/navigation/GlobalSearch/index.d.ts +1 -1
- package/dist/atoms/components/navigation/GlobalSearch/index.d.ts.map +1 -1
- package/dist/atoms/components/navigation/index.d.ts +1 -1
- package/dist/atoms/components/theme/ColorSwatch/ColorSwatch.d.ts +2 -2
- package/dist/atoms/components/theme/ColorSwatch/ColorSwatch.d.ts.map +1 -1
- package/dist/atoms/components/theme/ColorSwatch/index.d.ts +1 -1
- package/dist/atoms/components/theme/DarkModeToggle.d.ts.map +1 -1
- package/dist/atoms/components/theme/PaletteSwitcher.d.ts +1 -1
- package/dist/atoms/components/theme/PaletteSwitcher.d.ts.map +1 -1
- package/dist/atoms/components/theme/StyleGuide.d.ts +1 -1
- package/dist/atoms/components/theme/StyleGuide.d.ts.map +1 -1
- package/dist/atoms/components/theme/index.d.ts +4 -4
- package/dist/atoms/components/user/UserAvatar/UserAvatar.d.ts +2 -3
- package/dist/atoms/components/user/UserAvatar/UserAvatar.d.ts.map +1 -1
- package/dist/atoms/components/user/UserAvatar/index.d.ts +1 -1
- package/dist/atoms/components/user/UserAvatar/index.d.ts.map +1 -1
- package/dist/atoms/components/user/UserMenu/UserMenu.d.ts +2 -3
- package/dist/atoms/components/user/UserMenu/UserMenu.d.ts.map +1 -1
- package/dist/atoms/components/user/UserMenu/index.d.ts +1 -1
- package/dist/atoms/components/user/UserMenu/index.d.ts.map +1 -1
- package/dist/atoms/components/user/index.d.ts +2 -2
- package/dist/atoms/config/responsive.d.ts +16 -16
- package/dist/atoms/config/responsive.d.ts.map +1 -1
- package/dist/atoms/hooks/index.d.ts +4 -4
- package/dist/atoms/hooks/use-toast.d.ts +1 -1
- package/dist/atoms/hooks/use-toast.d.ts.map +1 -1
- package/dist/atoms/hooks/useApi.d.ts +2 -2
- package/dist/atoms/hooks/useApi.d.ts.map +1 -1
- package/dist/atoms/hooks/useResponsive.d.ts +1 -1
- package/dist/atoms/hooks/useResponsive.d.ts.map +1 -1
- package/dist/atoms/index.d.ts +6 -7
- package/dist/atoms/index.d.ts.map +1 -1
- package/dist/atoms/primitives/Badge.d.ts +6 -6
- package/dist/atoms/primitives/Badge.d.ts.map +1 -1
- package/dist/atoms/primitives/ErrorBoundary.d.ts +3 -3
- package/dist/atoms/primitives/ErrorBoundary.d.ts.map +1 -1
- package/dist/atoms/primitives/Select.d.ts +9 -7
- package/dist/atoms/primitives/Select.d.ts.map +1 -1
- package/dist/atoms/primitives/Switch.d.ts +4 -3
- package/dist/atoms/primitives/Switch.d.ts.map +1 -1
- package/dist/atoms/primitives/Tabs.d.ts +10 -10
- package/dist/atoms/primitives/Tabs.d.ts.map +1 -1
- package/dist/atoms/primitives/avatar.d.ts.map +1 -1
- package/dist/atoms/primitives/button.d.ts +2 -5
- package/dist/atoms/primitives/button.d.ts.map +1 -1
- package/dist/atoms/primitives/button.variants.d.ts +7 -0
- package/dist/atoms/primitives/button.variants.d.ts.map +1 -0
- package/dist/atoms/primitives/card.d.ts +3 -2
- package/dist/atoms/primitives/card.d.ts.map +1 -1
- package/dist/atoms/primitives/checkbox.d.ts +3 -3
- package/dist/atoms/primitives/checkbox.d.ts.map +1 -1
- package/dist/atoms/primitives/dialog.d.ts +4 -4
- package/dist/atoms/primitives/dialog.d.ts.map +1 -1
- package/dist/atoms/primitives/dropdown-menu.d.ts.map +1 -1
- package/dist/atoms/primitives/index.d.ts +16 -16
- package/dist/atoms/primitives/index.d.ts.map +1 -1
- package/dist/atoms/primitives/input.d.ts.map +1 -1
- package/dist/atoms/primitives/label.d.ts +4 -3
- package/dist/atoms/primitives/label.d.ts.map +1 -1
- package/dist/atoms/primitives/skeleton.d.ts.map +1 -1
- package/dist/atoms/primitives/spinner.d.ts +5 -5
- package/dist/atoms/primitives/spinner.d.ts.map +1 -1
- package/dist/atoms/primitives/table.d.ts.map +1 -1
- package/dist/atoms/services/api/client.d.ts +11 -2
- package/dist/atoms/services/api/client.d.ts.map +1 -1
- package/dist/atoms/services/auth-service.d.ts +1 -1
- package/dist/atoms/services/auth-service.d.ts.map +1 -1
- package/dist/atoms/services/health.d.ts +2 -2
- package/dist/atoms/services/index.d.ts +3 -3
- package/dist/atoms/shared/config/dashboard-sizes.d.ts +17 -17
- package/dist/atoms/shared/config/dashboard-sizes.d.ts.map +1 -1
- package/dist/atoms/shared/config/environment.d.ts.map +1 -1
- package/dist/atoms/shared/index.d.ts +4 -4
- package/dist/atoms/shared/index.d.ts.map +1 -1
- package/dist/atoms/types/auth.d.ts +11 -1
- package/dist/atoms/types/auth.d.ts.map +1 -1
- package/dist/atoms/types/entity-config.d.ts +9 -9
- package/dist/atoms/types/entity-config.d.ts.map +1 -1
- package/dist/atoms/types/generated.d.ts.map +1 -1
- package/dist/atoms/types/index.d.ts +6 -6
- package/dist/atoms/types/loading.d.ts +1 -1
- package/dist/atoms/types/navigation.d.ts +1 -1
- package/dist/atoms/types/navigation.d.ts.map +1 -1
- package/dist/atoms/types/ui-config.d.ts +8 -8
- package/dist/atoms/types/ui-config.d.ts.map +1 -1
- package/dist/atoms/utils/animations.d.ts +7 -7
- package/dist/atoms/utils/animations.d.ts.map +1 -1
- package/dist/atoms/utils/color-manager.d.ts +1 -1
- package/dist/atoms/utils/debounce.d.ts +1 -1
- package/dist/atoms/utils/debounce.d.ts.map +1 -1
- package/dist/atoms/utils/field-detection.d.ts +2 -2
- package/dist/atoms/utils/field-detection.d.ts.map +1 -1
- package/dist/atoms/utils/icon-map.d.ts +68 -0
- package/dist/atoms/utils/icon-map.d.ts.map +1 -0
- package/dist/atoms/utils/icon-resolver.d.ts +7 -67
- package/dist/atoms/utils/icon-resolver.d.ts.map +1 -1
- package/dist/atoms/utils/index.d.ts +4 -4
- package/dist/atoms/utils/metric-engine.d.ts +2 -10
- package/dist/atoms/utils/metric-engine.d.ts.map +1 -1
- package/dist/atoms/utils/tooltip-helpers.d.ts +1 -1
- package/dist/atoms/utils/tooltip-helpers.d.ts.map +1 -1
- package/dist/atoms/utils/ui-mapping.d.ts +6 -4
- package/dist/atoms/utils/ui-mapping.d.ts.map +1 -1
- package/dist/atoms/utils/utils.d.ts +7 -6
- package/dist/atoms/utils/utils.d.ts.map +1 -1
- package/dist/codegen/openapi/bulk-types.d.ts +4 -4
- package/dist/codegen/openapi/bulk-types.d.ts.map +1 -1
- package/dist/features/auth/components/LoginForm.d.ts.map +1 -1
- package/dist/features/auth/components/LogoutButton.d.ts.map +1 -1
- package/dist/features/auth/components/ProtectedRoute.d.ts +2 -2
- package/dist/features/auth/components/ProtectedRoute.d.ts.map +1 -1
- package/dist/features/auth/components/index.d.ts +3 -3
- package/dist/features/auth/hooks/auth-context.d.ts +3 -0
- package/dist/features/auth/hooks/auth-context.d.ts.map +1 -0
- package/dist/features/auth/hooks/index.d.ts +4 -3
- package/dist/features/auth/hooks/index.d.ts.map +1 -1
- package/dist/features/auth/hooks/use-auth.d.ts +3 -0
- package/dist/features/auth/hooks/use-auth.d.ts.map +1 -0
- package/dist/features/auth/hooks/useAuth.d.ts +3 -4
- package/dist/features/auth/hooks/useAuth.d.ts.map +1 -1
- package/dist/features/auth/hooks/useAuthContext.d.ts +1 -1
- package/dist/features/auth/hooks/useAuthContext.d.ts.map +1 -1
- package/dist/features/auth/hooks/usePermissions.d.ts +3 -3
- package/dist/features/auth/index.d.ts +3 -3
- package/dist/features/auth/providers/MockAuthProvider.d.ts +3 -4
- package/dist/features/auth/providers/MockAuthProvider.d.ts.map +1 -1
- package/dist/features/auth/providers/index.d.ts +2 -1
- package/dist/features/auth/providers/index.d.ts.map +1 -1
- package/dist/features/auth/providers/mock-auth-context.d.ts +3 -0
- package/dist/features/auth/providers/mock-auth-context.d.ts.map +1 -0
- package/dist/features/auth/providers/use-mock-auth.d.ts +3 -0
- package/dist/features/auth/providers/use-mock-auth.d.ts.map +1 -0
- package/dist/features/auth/services/mock-auth-service.d.ts +3 -3
- package/dist/features/auth/services/mock-auth-service.d.ts.map +1 -1
- package/dist/features/index.d.ts +1 -1
- package/dist/frontend-patterns.css +713 -576
- package/dist/index.d.ts +17 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +21400 -21788
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +21404 -21792
- package/dist/index.js.map +1 -1
- package/dist/molecules/forms/FormGroup.d.ts +2 -2
- package/dist/molecules/forms/FormGroup.d.ts.map +1 -1
- package/dist/molecules/forms/SearchInput.d.ts +1 -1
- package/dist/molecules/forms/SearchInput.d.ts.map +1 -1
- package/dist/molecules/forms/index.d.ts +2 -2
- package/dist/molecules/forms/index.d.ts.map +1 -1
- package/dist/molecules/index.d.ts +3 -3
- package/dist/molecules/layout/AppHeader/AppHeader.d.ts +1 -1
- package/dist/molecules/layout/AppHeader/AppHeader.d.ts.map +1 -1
- package/dist/molecules/layout/AppHeader/index.d.ts +1 -1
- package/dist/molecules/layout/BulkSelectionBar.d.ts +2 -2
- package/dist/molecules/layout/BulkSelectionBar.d.ts.map +1 -1
- package/dist/molecules/layout/DashboardWithSidePanel/DashboardWithSidePanel.d.ts +1 -1
- package/dist/molecules/layout/DashboardWithSidePanel/index.d.ts +1 -1
- package/dist/molecules/layout/NavigationContext.d.ts +3 -9
- package/dist/molecules/layout/NavigationContext.d.ts.map +1 -1
- package/dist/molecules/layout/PageTemplate.d.ts +1 -1
- package/dist/molecules/layout/PageTemplate.d.ts.map +1 -1
- package/dist/molecules/layout/SectionHeader/SectionHeader.d.ts +4 -4
- package/dist/molecules/layout/SectionHeader/SectionHeader.d.ts.map +1 -1
- package/dist/molecules/layout/SectionHeader/index.d.ts +1 -1
- package/dist/molecules/layout/ShowcaseSection.d.ts +4 -4
- package/dist/molecules/layout/ShowcaseSection.d.ts.map +1 -1
- package/dist/molecules/layout/Sidebar.d.ts.map +1 -1
- package/dist/molecules/layout/SidebarButton/SidebarButton.d.ts +1 -1
- package/dist/molecules/layout/SidebarButton/SidebarButton.d.ts.map +1 -1
- package/dist/molecules/layout/SidebarButton/index.d.ts +1 -1
- package/dist/molecules/layout/SidebarContext.d.ts +1 -8
- package/dist/molecules/layout/SidebarContext.d.ts.map +1 -1
- package/dist/molecules/layout/index.d.ts +14 -11
- package/dist/molecules/layout/index.d.ts.map +1 -1
- package/dist/molecules/layout/navigation-context.d.ts +9 -0
- package/dist/molecules/layout/navigation-context.d.ts.map +1 -0
- package/dist/molecules/layout/sidebar-context.d.ts +7 -0
- package/dist/molecules/layout/sidebar-context.d.ts.map +1 -0
- package/dist/molecules/layout/use-navigation.d.ts +2 -0
- package/dist/molecules/layout/use-navigation.d.ts.map +1 -0
- package/dist/molecules/layout/use-sidebar.d.ts +2 -0
- package/dist/molecules/layout/use-sidebar.d.ts.map +1 -0
- package/dist/molecules/navigation/NavMenu.d.ts +2 -2
- package/dist/molecules/navigation/NavMenu.d.ts.map +1 -1
- package/dist/molecules/navigation/Pagination.d.ts +2 -2
- package/dist/molecules/navigation/index.d.ts +2 -2
- package/dist/organisms/index.d.ts +1 -1
- package/dist/organisms/showcase/ComponentShowcasePage.d.ts +1 -1
- package/dist/organisms/showcase/ComponentShowcasePage.d.ts.map +1 -1
- package/dist/templates/AuthTemplate.d.ts +4 -4
- package/dist/templates/AuthTemplate.d.ts.map +1 -1
- package/dist/templates/ComponentShowcaseTemplate.d.ts +7 -7
- package/dist/templates/ComponentShowcaseTemplate.d.ts.map +1 -1
- package/dist/templates/DashboardTemplate.d.ts +3 -3
- package/dist/templates/DashboardTemplate.d.ts.map +1 -1
- package/dist/templates/DataTemplate.d.ts +3 -3
- package/dist/templates/DataTemplate.d.ts.map +1 -1
- package/dist/templates/EnhancedDataTemplate.d.ts +11 -11
- package/dist/templates/EnhancedDataTemplate.d.ts.map +1 -1
- package/dist/templates/EnhancedDataTemplate.hooks.bulk.d.ts +2 -2
- package/dist/templates/EnhancedDataTemplate.hooks.bulk.d.ts.map +1 -1
- package/dist/templates/EnhancedDataTemplate.hooks.d.ts +4 -4
- package/dist/templates/EnhancedDataTemplate.hooks.d.ts.map +1 -1
- package/dist/templates/admin/AdminCRUDTemplate.d.ts +4 -4
- package/dist/templates/admin/AdminCRUDTemplate.d.ts.map +1 -1
- package/dist/templates/admin/AdminDashboardTemplate.d.ts +7 -7
- package/dist/templates/admin/AdminDashboardTemplate.d.ts.map +1 -1
- package/dist/templates/admin/AdminDetailTemplate.d.ts +4 -4
- package/dist/templates/admin/AdminDetailTemplate.d.ts.map +1 -1
- package/dist/templates/admin/index.d.ts +3 -3
- package/dist/templates/admin/index.d.ts.map +1 -1
- package/dist/templates/api/APIDataTemplate.d.ts +14 -9
- package/dist/templates/api/APIDataTemplate.d.ts.map +1 -1
- package/dist/templates/api/create-api-data-template.d.ts +4 -0
- package/dist/templates/api/create-api-data-template.d.ts.map +1 -0
- package/dist/templates/api/index.d.ts +3 -2
- package/dist/templates/api/index.d.ts.map +1 -1
- package/dist/templates/factory.d.ts +3 -3
- package/dist/templates/factory.d.ts.map +1 -1
- package/dist/templates/index.d.ts +8 -8
- package/dist/templates/index.d.ts.map +1 -1
- package/package.json +10 -7
- package/LICENSE +0 -19
- package/cli/cli/commands/generate-hooks.js +0 -291
- package/cli/cli/commands/init.js +0 -25
- package/cli/cli/commands/scaffold.js +0 -201
- package/cli/cli/index.js +0 -113
- package/cli/commands/generate-hooks.js +0 -291
- package/cli/commands/init.js +0 -25
- package/cli/commands/scaffold.js +0 -201
- package/cli/index.js +0 -6665
- package/cli/src/codegen/openapi/bulk-hook-generator.js +0 -252
- package/cli/src/codegen/openapi/bulk-types.js +0 -89
- package/cli/src/codegen/openapi/confidence-scorer.js +0 -204
- package/cli/src/codegen/openapi/hook-config.js +0 -66
- package/dist/atoms/components/data/ActivityFeed/ActivityFeed.stories.d.ts +0 -38
- package/dist/atoms/components/data/ActivityFeed/ActivityFeed.stories.d.ts.map +0 -1
- package/dist/codegen/index.d.ts +0 -7
- package/dist/codegen/index.d.ts.map +0 -1
- package/dist/codegen/openapi/bulk-hook-generator.d.ts +0 -40
- package/dist/codegen/openapi/bulk-hook-generator.d.ts.map +0 -1
- package/dist/codegen/openapi/client-generator.d.ts +0 -52
- package/dist/codegen/openapi/client-generator.d.ts.map +0 -1
- package/dist/codegen/openapi/confidence-scorer.d.ts +0 -30
- package/dist/codegen/openapi/confidence-scorer.d.ts.map +0 -1
- package/dist/codegen/openapi/hook-config.d.ts +0 -50
- package/dist/codegen/openapi/hook-config.d.ts.map +0 -1
- package/dist/codegen/openapi/hook-generator.d.ts +0 -108
- package/dist/codegen/openapi/hook-generator.d.ts.map +0 -1
- package/dist/codegen/openapi/index.d.ts +0 -27
- package/dist/codegen/openapi/index.d.ts.map +0 -1
- package/dist/codegen/openapi/parser.d.ts +0 -107
- package/dist/codegen/openapi/parser.d.ts.map +0 -1
- package/dist/codegen/openapi/type-generator.d.ts +0 -53
- package/dist/codegen/openapi/type-generator.d.ts.map +0 -1
- package/dist/generated/client/client.d.ts +0 -23
- package/dist/generated/client/client.d.ts.map +0 -1
- package/dist/generated/client/config.d.ts +0 -10
- package/dist/generated/client/config.d.ts.map +0 -1
- package/dist/generated/client/index.d.ts +0 -12
- package/dist/generated/client/index.d.ts.map +0 -1
- package/dist/generated/client/methods.d.ts +0 -591
- package/dist/generated/client/methods.d.ts.map +0 -1
- package/dist/generated/client/types.d.ts +0 -37
- package/dist/generated/client/types.d.ts.map +0 -1
- package/dist/generated/example.d.ts +0 -8
- package/dist/generated/example.d.ts.map +0 -1
- package/dist/generated/hooks/index.d.ts +0 -11
- package/dist/generated/hooks/index.d.ts.map +0 -1
- package/dist/generated/hooks/keys.d.ts +0 -59
- package/dist/generated/hooks/keys.d.ts.map +0 -1
- package/dist/generated/hooks/mutations.d.ts +0 -551
- package/dist/generated/hooks/mutations.d.ts.map +0 -1
- package/dist/generated/hooks/queries.d.ts +0 -426
- package/dist/generated/hooks/queries.d.ts.map +0 -1
- package/dist/generated/hooks/types.d.ts +0 -318
- package/dist/generated/hooks/types.d.ts.map +0 -1
- package/dist/generated/index.d.ts +0 -13
- package/dist/generated/index.d.ts.map +0 -1
- package/dist/generated/types/endpoints.d.ts +0 -1364
- package/dist/generated/types/endpoints.d.ts.map +0 -1
- package/dist/generated/types/index.d.ts +0 -11
- package/dist/generated/types/index.d.ts.map +0 -1
- package/dist/generated/types/parameters.d.ts +0 -8
- package/dist/generated/types/parameters.d.ts.map +0 -1
- package/dist/generated/types/responses.d.ts +0 -8
- package/dist/generated/types/responses.d.ts.map +0 -1
- package/dist/generated/types/schemas.d.ts +0 -652
- package/dist/generated/types/schemas.d.ts.map +0 -1
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Bulk Operations Hook Generator
|
|
4
|
-
*
|
|
5
|
-
* Generates specialized React hooks for bulk operations with proper typing,
|
|
6
|
-
* error handling, and progress tracking.
|
|
7
|
-
*
|
|
8
|
-
* Part of FRO-35: Bulk Operations Hook Generation
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.BulkHookGenerator = void 0;
|
|
12
|
-
const bulk_types_1 = require("./bulk-types");
|
|
13
|
-
class BulkHookGenerator {
|
|
14
|
-
/**
|
|
15
|
-
* Generate a bulk mutation hook with progress tracking and retry logic
|
|
16
|
-
*/
|
|
17
|
-
generateBulkMutationHook(endpoint, hookName, operationName) {
|
|
18
|
-
const bulkType = (0, bulk_types_1.detectBulkOperationType)(endpoint.path, endpoint.method);
|
|
19
|
-
const lines = [];
|
|
20
|
-
// Generate JSDoc
|
|
21
|
-
lines.push('/**');
|
|
22
|
-
if (endpoint.summary) {
|
|
23
|
-
lines.push(` * ${endpoint.summary}`);
|
|
24
|
-
}
|
|
25
|
-
if (endpoint.description) {
|
|
26
|
-
lines.push(` * ${endpoint.description}`);
|
|
27
|
-
}
|
|
28
|
-
lines.push(' * @param options Mutation options with bulk operation support');
|
|
29
|
-
lines.push(' */');
|
|
30
|
-
// Generate hook signature
|
|
31
|
-
const resource = endpoint.tags?.[0] || 'default';
|
|
32
|
-
lines.push(`export function ${hookName}(`);
|
|
33
|
-
lines.push(` options?: UseMutationOptions<BulkOperationResponse, any, BulkOperationRequest> & BulkMutationOptions`);
|
|
34
|
-
lines.push(') {');
|
|
35
|
-
lines.push(' const queryClient = useQueryClient()');
|
|
36
|
-
lines.push(' ');
|
|
37
|
-
lines.push(' return useMutation({');
|
|
38
|
-
// Generate mutation function with progress tracking
|
|
39
|
-
lines.push(' mutationFn: async (request: BulkOperationRequest) => {');
|
|
40
|
-
lines.push(' // Transform request if needed');
|
|
41
|
-
lines.push(' const transformedRequest = options?.transformRequest ');
|
|
42
|
-
lines.push(' ? options.transformRequest(request) ');
|
|
43
|
-
lines.push(' : request');
|
|
44
|
-
lines.push(' ');
|
|
45
|
-
lines.push(' // Simulate progress updates for demo');
|
|
46
|
-
lines.push(' if (options?.onProgress) {');
|
|
47
|
-
lines.push(' options.onProgress({');
|
|
48
|
-
lines.push(' total: request.ids.length,');
|
|
49
|
-
lines.push(' processed: 0,');
|
|
50
|
-
lines.push(' succeeded: 0,');
|
|
51
|
-
lines.push(' failed: 0,');
|
|
52
|
-
lines.push(' percentage: 0,');
|
|
53
|
-
lines.push(" status: 'processing'");
|
|
54
|
-
lines.push(' })');
|
|
55
|
-
lines.push(' }');
|
|
56
|
-
lines.push(' ');
|
|
57
|
-
lines.push(` const response = await apiClient.${this.camelCase(operationName)}(transformedRequest)`);
|
|
58
|
-
lines.push(' ');
|
|
59
|
-
lines.push(' // Transform response if needed');
|
|
60
|
-
lines.push(' const transformedResponse = options?.transformResponse');
|
|
61
|
-
lines.push(' ? options.transformResponse(response)');
|
|
62
|
-
lines.push(' : response');
|
|
63
|
-
lines.push(' ');
|
|
64
|
-
lines.push(' // Final progress update');
|
|
65
|
-
lines.push(' if (options?.onProgress && transformedResponse) {');
|
|
66
|
-
lines.push(' options.onProgress({');
|
|
67
|
-
lines.push(' total: transformedResponse.summary?.total || request.ids.length,');
|
|
68
|
-
lines.push(' processed: transformedResponse.summary?.total || request.ids.length,');
|
|
69
|
-
lines.push(' succeeded: transformedResponse.summary?.succeeded || 0,');
|
|
70
|
-
lines.push(' failed: transformedResponse.summary?.failed || 0,');
|
|
71
|
-
lines.push(' percentage: 100,');
|
|
72
|
-
lines.push(" status: 'completed'");
|
|
73
|
-
lines.push(' })');
|
|
74
|
-
lines.push(' }');
|
|
75
|
-
lines.push(' ');
|
|
76
|
-
lines.push(' return transformedResponse');
|
|
77
|
-
lines.push(' },');
|
|
78
|
-
// Generate optimistic updates for bulk operations
|
|
79
|
-
lines.push(this.generateBulkOptimisticUpdate(resource, bulkType));
|
|
80
|
-
// Generate cache invalidation
|
|
81
|
-
lines.push(this.generateBulkCacheInvalidation(resource));
|
|
82
|
-
// Handle partial success
|
|
83
|
-
lines.push(' onSuccess: (data, variables, context) => {');
|
|
84
|
-
lines.push(' // Handle partial success');
|
|
85
|
-
lines.push(' if (data.failed.length > 0 && options?.onPartialSuccess) {');
|
|
86
|
-
lines.push(' options.onPartialSuccess(data)');
|
|
87
|
-
lines.push(' }');
|
|
88
|
-
lines.push(' ');
|
|
89
|
-
lines.push(' // Call original onSuccess if provided');
|
|
90
|
-
lines.push(' options?.onSuccess?.(data, variables, context)');
|
|
91
|
-
lines.push(' },');
|
|
92
|
-
// Retry configuration for bulk operations
|
|
93
|
-
lines.push(' retry: (failureCount, error) => {');
|
|
94
|
-
lines.push(' // Use custom retry config if provided');
|
|
95
|
-
lines.push(' if (options?.retry?.maxAttempts !== undefined) {');
|
|
96
|
-
lines.push(' return failureCount < options.retry.maxAttempts');
|
|
97
|
-
lines.push(' }');
|
|
98
|
-
lines.push(' // Default: retry up to 3 times for bulk operations');
|
|
99
|
-
lines.push(' return failureCount < 3');
|
|
100
|
-
lines.push(' },');
|
|
101
|
-
lines.push(' retryDelay: (attemptIndex) => {');
|
|
102
|
-
lines.push(' // Use custom retry delay if provided');
|
|
103
|
-
lines.push(' if (options?.retry?.initialDelay) {');
|
|
104
|
-
lines.push(' const delay = Math.min(');
|
|
105
|
-
lines.push(' options.retry.initialDelay * Math.pow(options.retry.backoffMultiplier || 2, attemptIndex),');
|
|
106
|
-
lines.push(' options.retry.maxDelay || 30000');
|
|
107
|
-
lines.push(' )');
|
|
108
|
-
lines.push(' return delay');
|
|
109
|
-
lines.push(' }');
|
|
110
|
-
lines.push(' // Default exponential backoff: 1s, 2s, 4s...');
|
|
111
|
-
lines.push(' return Math.min(1000 * Math.pow(2, attemptIndex), 30000)');
|
|
112
|
-
lines.push(' },');
|
|
113
|
-
lines.push(' ...options');
|
|
114
|
-
lines.push(' })');
|
|
115
|
-
lines.push('}');
|
|
116
|
-
return lines.join('\n');
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Generate optimistic updates for bulk operations
|
|
120
|
-
*/
|
|
121
|
-
generateBulkOptimisticUpdate(resource, bulkType) {
|
|
122
|
-
switch (bulkType) {
|
|
123
|
-
case 'delete':
|
|
124
|
-
return ` onMutate: async (request: BulkOperationRequest) => {
|
|
125
|
-
// Cancel outgoing refetches
|
|
126
|
-
await queryClient.cancelQueries({ queryKey: queryKeys.${resource}() })
|
|
127
|
-
|
|
128
|
-
// Snapshot previous value
|
|
129
|
-
const previousData = queryClient.getQueryData(queryKeys.${resource}())
|
|
130
|
-
|
|
131
|
-
// Optimistically remove items
|
|
132
|
-
queryClient.setQueryData(queryKeys.${resource}(), (old: any) => {
|
|
133
|
-
if (Array.isArray(old)) {
|
|
134
|
-
return old.filter((item: any) => !request.ids.includes(item.id))
|
|
135
|
-
}
|
|
136
|
-
return old
|
|
137
|
-
})
|
|
138
|
-
|
|
139
|
-
return { previousData }
|
|
140
|
-
},
|
|
141
|
-
onError: (err: any, request: any, context: any) => {
|
|
142
|
-
// Rollback on error
|
|
143
|
-
if (context?.previousData !== undefined) {
|
|
144
|
-
queryClient.setQueryData(queryKeys.${resource}(), context.previousData)
|
|
145
|
-
}
|
|
146
|
-
},`;
|
|
147
|
-
case 'update':
|
|
148
|
-
return ` onMutate: async (request: BulkOperationRequest) => {
|
|
149
|
-
await queryClient.cancelQueries({ queryKey: queryKeys.${resource}() })
|
|
150
|
-
|
|
151
|
-
const previousData = queryClient.getQueryData(queryKeys.${resource}())
|
|
152
|
-
|
|
153
|
-
// Optimistically update items
|
|
154
|
-
queryClient.setQueryData(queryKeys.${resource}(), (old: any) => {
|
|
155
|
-
if (Array.isArray(old)) {
|
|
156
|
-
return old.map((item: any) =>
|
|
157
|
-
request.ids.includes(item.id)
|
|
158
|
-
? { ...item, ...request.data }
|
|
159
|
-
: item
|
|
160
|
-
)
|
|
161
|
-
}
|
|
162
|
-
return old
|
|
163
|
-
})
|
|
164
|
-
|
|
165
|
-
return { previousData }
|
|
166
|
-
},
|
|
167
|
-
onError: (err: any, request: any, context: any) => {
|
|
168
|
-
if (context?.previousData !== undefined) {
|
|
169
|
-
queryClient.setQueryData(queryKeys.${resource}(), context.previousData)
|
|
170
|
-
}
|
|
171
|
-
},`;
|
|
172
|
-
case 'create':
|
|
173
|
-
return ` onMutate: async (request: BulkOperationRequest) => {
|
|
174
|
-
await queryClient.cancelQueries({ queryKey: queryKeys.${resource}() })
|
|
175
|
-
|
|
176
|
-
const previousData = queryClient.getQueryData(queryKeys.${resource}())
|
|
177
|
-
|
|
178
|
-
// Optimistically add items (if data provided)
|
|
179
|
-
if (request.data && Array.isArray(request.data)) {
|
|
180
|
-
queryClient.setQueryData(queryKeys.${resource}(), (old: any) => {
|
|
181
|
-
if (Array.isArray(old)) {
|
|
182
|
-
return [...old, ...request.data]
|
|
183
|
-
}
|
|
184
|
-
return old
|
|
185
|
-
})
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
return { previousData }
|
|
189
|
-
},
|
|
190
|
-
onError: (err: any, request: any, context: any) => {
|
|
191
|
-
if (context?.previousData !== undefined) {
|
|
192
|
-
queryClient.setQueryData(queryKeys.${resource}(), context.previousData)
|
|
193
|
-
}
|
|
194
|
-
},`;
|
|
195
|
-
default:
|
|
196
|
-
return '';
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Generate cache invalidation for bulk operations
|
|
201
|
-
*/
|
|
202
|
-
generateBulkCacheInvalidation(resource) {
|
|
203
|
-
return ` onSettled: () => {
|
|
204
|
-
// Invalidate related queries after bulk operation
|
|
205
|
-
queryClient.invalidateQueries({ queryKey: queryKeys.${resource}() })
|
|
206
|
-
queryClient.invalidateQueries({ queryKey: queryKeys.all })
|
|
207
|
-
},`;
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Generate bulk mutation hook name
|
|
211
|
-
*/
|
|
212
|
-
generateBulkMutationHookName(endpoint, resourceName) {
|
|
213
|
-
const requestBody = endpoint.requestBody;
|
|
214
|
-
if (!(0, bulk_types_1.isBulkOperation)(endpoint.path, endpoint.method, requestBody)) {
|
|
215
|
-
return null;
|
|
216
|
-
}
|
|
217
|
-
const bulkType = (0, bulk_types_1.detectBulkOperationType)(endpoint.path, endpoint.method);
|
|
218
|
-
if (bulkType && resourceName) {
|
|
219
|
-
const bulkName = (0, bulk_types_1.generateBulkOperationName)(resourceName, bulkType);
|
|
220
|
-
return `use${this.capitalize(bulkName)}`;
|
|
221
|
-
}
|
|
222
|
-
return null;
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* Check if endpoint is a bulk operation
|
|
226
|
-
*/
|
|
227
|
-
isBulkEndpoint(endpoint) {
|
|
228
|
-
const requestBody = endpoint.requestBody;
|
|
229
|
-
return (0, bulk_types_1.isBulkOperation)(endpoint.path, endpoint.method, requestBody);
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
* Helper to convert to camelCase
|
|
233
|
-
*/
|
|
234
|
-
camelCase(str) {
|
|
235
|
-
return str.replace(/[-_](.)/g, (_, char) => char.toUpperCase())
|
|
236
|
-
.replace(/^./, char => char.toLowerCase());
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* Helper to capitalize string
|
|
240
|
-
*/
|
|
241
|
-
capitalize(str) {
|
|
242
|
-
// Convert snake_case to PascalCase
|
|
243
|
-
if (str.includes('_')) {
|
|
244
|
-
return str.split('_')
|
|
245
|
-
.map(part => part.charAt(0).toUpperCase() + part.slice(1).toLowerCase())
|
|
246
|
-
.join('');
|
|
247
|
-
}
|
|
248
|
-
// Simple capitalization
|
|
249
|
-
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
exports.BulkHookGenerator = BulkHookGenerator;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Bulk Operations Types
|
|
4
|
-
*
|
|
5
|
-
* Standard types for bulk operations in generated hooks
|
|
6
|
-
* Part of FRO-35: Bulk Operations Hook Generation
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.isBulkOperation = isBulkOperation;
|
|
10
|
-
exports.detectBulkOperationType = detectBulkOperationType;
|
|
11
|
-
exports.generateBulkOperationName = generateBulkOperationName;
|
|
12
|
-
/**
|
|
13
|
-
* Type guard to check if an endpoint handles bulk operations
|
|
14
|
-
*/
|
|
15
|
-
function isBulkOperation(path, method, requestBody) {
|
|
16
|
-
const bulkPatterns = [
|
|
17
|
-
/\/bulk[-_]?delete$/i,
|
|
18
|
-
/\/bulk[-_]?update$/i,
|
|
19
|
-
/\/bulk[-_]?create$/i,
|
|
20
|
-
/\/batch$/i,
|
|
21
|
-
/\/bulk$/i,
|
|
22
|
-
/\/multiple$/i
|
|
23
|
-
];
|
|
24
|
-
// Check path patterns
|
|
25
|
-
if (bulkPatterns.some(pattern => pattern.test(path))) {
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
// Check if request body expects an array of items
|
|
29
|
-
if (requestBody && typeof requestBody === 'object') {
|
|
30
|
-
// Check for ParsedRequestBody structure
|
|
31
|
-
const body = requestBody;
|
|
32
|
-
if (body.content?.['application/json']?.schema) {
|
|
33
|
-
const schema = body.content['application/json'].schema;
|
|
34
|
-
return schema.type === 'array' && !!schema.items;
|
|
35
|
-
}
|
|
36
|
-
// Check direct schema
|
|
37
|
-
if ('type' in requestBody) {
|
|
38
|
-
const bodyType = requestBody;
|
|
39
|
-
return bodyType.type === 'array' && !!bodyType.items;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Detect bulk operation type from endpoint
|
|
46
|
-
*/
|
|
47
|
-
function detectBulkOperationType(path, method) {
|
|
48
|
-
const lowercasePath = path.toLowerCase();
|
|
49
|
-
const lowercaseMethod = method.toLowerCase();
|
|
50
|
-
if (lowercasePath.includes('delete') || lowercaseMethod === 'delete') {
|
|
51
|
-
return 'delete';
|
|
52
|
-
}
|
|
53
|
-
if (lowercasePath.includes('update') || lowercaseMethod === 'put' || lowercaseMethod === 'patch') {
|
|
54
|
-
return 'update';
|
|
55
|
-
}
|
|
56
|
-
if (lowercasePath.includes('create') || lowercaseMethod === 'post') {
|
|
57
|
-
return 'create';
|
|
58
|
-
}
|
|
59
|
-
if (lowercasePath.includes('batch') || lowercasePath.includes('bulk')) {
|
|
60
|
-
return 'mixed';
|
|
61
|
-
}
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Generate a descriptive bulk operation name
|
|
66
|
-
*/
|
|
67
|
-
function generateBulkOperationName(resource, operationType) {
|
|
68
|
-
const cleanResource = resource.replace(/[^a-zA-Z0-9]/g, '');
|
|
69
|
-
const singular = cleanResource.endsWith('s') ? cleanResource.slice(0, -1) : cleanResource;
|
|
70
|
-
// Capitalize first letter of singular resource
|
|
71
|
-
const capitalizedSingular = capitalize(singular);
|
|
72
|
-
switch (operationType) {
|
|
73
|
-
case 'delete':
|
|
74
|
-
return `bulkDelete${capitalizedSingular}s`;
|
|
75
|
-
case 'update':
|
|
76
|
-
return `bulkUpdate${capitalizedSingular}s`;
|
|
77
|
-
case 'create':
|
|
78
|
-
return `bulkCreate${capitalizedSingular}s`;
|
|
79
|
-
case 'mixed':
|
|
80
|
-
return `bulk${capitalizedSingular}Operations`;
|
|
81
|
-
default:
|
|
82
|
-
return `bulk${capitalizedSingular}s`;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
function capitalize(str) {
|
|
86
|
-
if (!str)
|
|
87
|
-
return '';
|
|
88
|
-
return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
|
|
89
|
-
}
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Confidence scoring for generated hook names
|
|
4
|
-
* Helps identify names that may need human review
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.ConfidenceScorer = void 0;
|
|
8
|
-
class ConfidenceScorer {
|
|
9
|
-
/**
|
|
10
|
-
* Score a generated hook name based on various quality indicators
|
|
11
|
-
*/
|
|
12
|
-
scoreHookName(generatedName, originalOperationId, path, method) {
|
|
13
|
-
const issues = [];
|
|
14
|
-
const suggestions = [];
|
|
15
|
-
let score = 100;
|
|
16
|
-
// Check for camelCase issues
|
|
17
|
-
if (!this.isProperCamelCase(generatedName)) {
|
|
18
|
-
score -= 20;
|
|
19
|
-
issues.push('Improper camelCase formatting');
|
|
20
|
-
}
|
|
21
|
-
// Check for consecutive uppercase letters (like "useAssignRolesusersUserRoles")
|
|
22
|
-
if (this.hasConsecutiveUppercase(generatedName)) {
|
|
23
|
-
score -= 30;
|
|
24
|
-
issues.push('Consecutive uppercase letters suggest concatenation issues');
|
|
25
|
-
suggestions.push(this.suggestFixForConsecutiveUppercase(generatedName));
|
|
26
|
-
}
|
|
27
|
-
// Check for overly long names
|
|
28
|
-
const nameLength = generatedName.length;
|
|
29
|
-
if (nameLength > 30) {
|
|
30
|
-
score -= 20;
|
|
31
|
-
issues.push(`Name is too long (${nameLength} chars)`);
|
|
32
|
-
}
|
|
33
|
-
// Check for repeated words
|
|
34
|
-
if (this.hasRepeatedWords(generatedName)) {
|
|
35
|
-
score -= 25;
|
|
36
|
-
issues.push('Contains repeated word segments');
|
|
37
|
-
}
|
|
38
|
-
// Check if it matches common patterns
|
|
39
|
-
if (this.matchesCommonPattern(generatedName, method)) {
|
|
40
|
-
score += 10;
|
|
41
|
-
score = Math.min(score, 100); // Cap at 100
|
|
42
|
-
}
|
|
43
|
-
// Check for word boundaries issues
|
|
44
|
-
if (this.hasWordBoundaryIssues(generatedName)) {
|
|
45
|
-
score -= 15;
|
|
46
|
-
issues.push('Potential word boundary issues');
|
|
47
|
-
}
|
|
48
|
-
// Determine confidence level
|
|
49
|
-
let confidence;
|
|
50
|
-
if (score >= 80) {
|
|
51
|
-
confidence = 'high';
|
|
52
|
-
}
|
|
53
|
-
else if (score >= 60) {
|
|
54
|
-
confidence = 'medium';
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
confidence = 'low';
|
|
58
|
-
}
|
|
59
|
-
return {
|
|
60
|
-
name: generatedName,
|
|
61
|
-
confidence,
|
|
62
|
-
score,
|
|
63
|
-
issues,
|
|
64
|
-
suggestions: suggestions.filter(s => s !== generatedName)
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
isProperCamelCase(name) {
|
|
68
|
-
// Should start with lowercase 'use'
|
|
69
|
-
if (!name.startsWith('use'))
|
|
70
|
-
return false;
|
|
71
|
-
// Check for proper camelCase pattern
|
|
72
|
-
const afterUse = name.substring(3);
|
|
73
|
-
return /^[A-Z][a-zA-Z0-9]*$/.test(afterUse);
|
|
74
|
-
}
|
|
75
|
-
hasConsecutiveUppercase(name) {
|
|
76
|
-
// Look for patterns like "RolesUsers" which suggest poor concatenation
|
|
77
|
-
return /[A-Z]{2,}[a-z]/.test(name) || /[a-z][A-Z]{2,}/.test(name);
|
|
78
|
-
}
|
|
79
|
-
hasRepeatedWords(name) {
|
|
80
|
-
// Convert camelCase to words
|
|
81
|
-
const words = this.camelCaseToWords(name).map(w => w.toLowerCase());
|
|
82
|
-
const uniqueWords = new Set(words);
|
|
83
|
-
// If we have significantly fewer unique words, there's repetition
|
|
84
|
-
return words.length > uniqueWords.size + 1; // Allow one repeat
|
|
85
|
-
}
|
|
86
|
-
matchesCommonPattern(name, method) {
|
|
87
|
-
const commonPatterns = {
|
|
88
|
-
get: /^use[A-Z][a-zA-Z]+$/,
|
|
89
|
-
post: /^useCreate[A-Z][a-zA-Z]+$/,
|
|
90
|
-
put: /^useUpdate[A-Z][a-zA-Z]+$/,
|
|
91
|
-
patch: /^useUpdate[A-Z][a-zA-Z]+$/,
|
|
92
|
-
delete: /^useDelete[A-Z][a-zA-Z]+$/
|
|
93
|
-
};
|
|
94
|
-
const pattern = commonPatterns[method];
|
|
95
|
-
return pattern ? pattern.test(name) : false;
|
|
96
|
-
}
|
|
97
|
-
hasWordBoundaryIssues(name) {
|
|
98
|
-
// Look for lowercase letters followed by uppercase without proper boundaries
|
|
99
|
-
// Exclude common patterns like "useCreate", "useUpdate", etc.
|
|
100
|
-
const afterUse = name.substring(3);
|
|
101
|
-
const knownPrefixes = ['Create', 'Update', 'Delete', 'Get', 'List', 'Fetch', 'Assign', 'Reassign'];
|
|
102
|
-
for (const prefix of knownPrefixes) {
|
|
103
|
-
if (afterUse.startsWith(prefix)) {
|
|
104
|
-
const remaining = afterUse.substring(prefix.length);
|
|
105
|
-
// Check for patterns like "Rolesusers" or "Budgettransactions"
|
|
106
|
-
if (/[a-z]{2,}[A-Z]/.test(remaining)) {
|
|
107
|
-
return true;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
// Check for lowercase word running into uppercase (3+ lowercase chars)
|
|
112
|
-
if (/[a-z]{3,}[A-Z]/.test(afterUse)) {
|
|
113
|
-
return true;
|
|
114
|
-
}
|
|
115
|
-
// Check for patterns like "RolesusersUser" where we have clear word concatenation
|
|
116
|
-
if (/[A-Z][a-z]+[a-z][A-Z]/.test(afterUse)) {
|
|
117
|
-
return true;
|
|
118
|
-
}
|
|
119
|
-
return false;
|
|
120
|
-
}
|
|
121
|
-
suggestFixForConsecutiveUppercase(name) {
|
|
122
|
-
// Try to fix patterns like "useAssignRolesusersUserRoles"
|
|
123
|
-
// This is a simple heuristic - the review process will catch if it's wrong
|
|
124
|
-
let suggestion = name;
|
|
125
|
-
// Specific fixes for known patterns
|
|
126
|
-
const knownFixes = {
|
|
127
|
-
'useAssignRolesusersUserRoles': 'useAssignUserRoles',
|
|
128
|
-
'useReassignBudgettransactionsReassignBudget': 'useReassignTransactionBudget',
|
|
129
|
-
'useCategorySubcategories': 'useCreateSubcategory'
|
|
130
|
-
};
|
|
131
|
-
if (knownFixes[name]) {
|
|
132
|
-
return knownFixes[name];
|
|
133
|
-
}
|
|
134
|
-
// Fix patterns where lowercase runs into uppercase (like "Rolesusers")
|
|
135
|
-
suggestion = suggestion.replace(/([a-z]{2,})([A-Z])/g, (match, p1, p2) => {
|
|
136
|
-
// If the lowercase part is a known word ending, add proper boundary
|
|
137
|
-
if (p1.endsWith('roles') || p1.endsWith('users') || p1.endsWith('budget')) {
|
|
138
|
-
return p1 + p2;
|
|
139
|
-
}
|
|
140
|
-
return match;
|
|
141
|
-
});
|
|
142
|
-
// Try to extract the main action and resource
|
|
143
|
-
const parts = this.camelCaseToWords(suggestion);
|
|
144
|
-
if (parts.length > 4) {
|
|
145
|
-
// Likely too many parts, try to simplify
|
|
146
|
-
// Keep: use + action + main resource
|
|
147
|
-
const action = parts[1]; // After 'use'
|
|
148
|
-
const resources = parts.slice(2);
|
|
149
|
-
// Find the most significant resource (usually the last one that's not a duplicate)
|
|
150
|
-
const uniqueResources = [...new Set(resources.map(r => r.toLowerCase()))];
|
|
151
|
-
if (uniqueResources.length === 1) {
|
|
152
|
-
return `use${action}${resources[resources.length - 1]}`;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
return suggestion;
|
|
156
|
-
}
|
|
157
|
-
camelCaseToWords(str) {
|
|
158
|
-
// Split camelCase into words
|
|
159
|
-
return str
|
|
160
|
-
.replace(/([a-z])([A-Z])/g, '$1 $2')
|
|
161
|
-
.replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')
|
|
162
|
-
.split(' ')
|
|
163
|
-
.filter(w => w.length > 0);
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Generate a confidence report for review
|
|
167
|
-
*/
|
|
168
|
-
generateReport(scoredNames) {
|
|
169
|
-
const byConfidence = {
|
|
170
|
-
high: scoredNames.filter(s => s.confidence === 'high'),
|
|
171
|
-
medium: scoredNames.filter(s => s.confidence === 'medium'),
|
|
172
|
-
low: scoredNames.filter(s => s.confidence === 'low')
|
|
173
|
-
};
|
|
174
|
-
let report = '# Hook Name Generation Report\n\n';
|
|
175
|
-
report += `Generated ${scoredNames.length} hooks\n\n`;
|
|
176
|
-
report += `- High confidence: ${byConfidence.high.length}\n`;
|
|
177
|
-
report += `- Medium confidence: ${byConfidence.medium.length}\n`;
|
|
178
|
-
report += `- Low confidence: ${byConfidence.low.length}\n\n`;
|
|
179
|
-
if (byConfidence.low.length > 0) {
|
|
180
|
-
report += '## Low Confidence Names (Review Recommended)\n\n';
|
|
181
|
-
for (const scored of byConfidence.low) {
|
|
182
|
-
report += `### ${scored.name}\n`;
|
|
183
|
-
report += `- Score: ${scored.score}/100\n`;
|
|
184
|
-
report += `- Issues: ${scored.issues.join(', ')}\n`;
|
|
185
|
-
if (scored.suggestions.length > 0) {
|
|
186
|
-
report += `- Suggestions: ${scored.suggestions.join(', ')}\n`;
|
|
187
|
-
}
|
|
188
|
-
report += '\n';
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
if (byConfidence.medium.length > 0) {
|
|
192
|
-
report += '## Medium Confidence Names (Optional Review)\n\n';
|
|
193
|
-
for (const scored of byConfidence.medium) {
|
|
194
|
-
report += `- ${scored.name} (${scored.score}/100)\n`;
|
|
195
|
-
if (scored.issues.length > 0) {
|
|
196
|
-
report += ` Issues: ${scored.issues.join(', ')}\n`;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
report += '\n';
|
|
200
|
-
}
|
|
201
|
-
return report;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
exports.ConfidenceScorer = ConfidenceScorer;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Hook generation configuration system
|
|
4
|
-
* Stores learned patterns and manual overrides for hook name generation
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.HookConfigManager = void 0;
|
|
8
|
-
const fs_1 = require("fs");
|
|
9
|
-
const path_1 = require("path");
|
|
10
|
-
const DEFAULT_CONFIG = {
|
|
11
|
-
version: '1.0.0',
|
|
12
|
-
nameOverrides: {},
|
|
13
|
-
reviewedNames: [],
|
|
14
|
-
patterns: {
|
|
15
|
-
removeDoubleWords: true,
|
|
16
|
-
smartCasing: true,
|
|
17
|
-
deduplicateSegments: true
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
class HookConfigManager {
|
|
21
|
-
constructor(configPath = './hooks.config.json') {
|
|
22
|
-
this.config = DEFAULT_CONFIG;
|
|
23
|
-
this.configPath = (0, path_1.resolve)(configPath);
|
|
24
|
-
}
|
|
25
|
-
async load() {
|
|
26
|
-
try {
|
|
27
|
-
const content = await fs_1.promises.readFile(this.configPath, 'utf8');
|
|
28
|
-
this.config = { ...DEFAULT_CONFIG, ...JSON.parse(content) };
|
|
29
|
-
}
|
|
30
|
-
catch (error) {
|
|
31
|
-
// File doesn't exist, use defaults
|
|
32
|
-
this.config = DEFAULT_CONFIG;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
async save() {
|
|
36
|
-
const content = JSON.stringify(this.config, null, 2);
|
|
37
|
-
await fs_1.promises.writeFile(this.configPath, content, 'utf8');
|
|
38
|
-
}
|
|
39
|
-
getOverride(operationId) {
|
|
40
|
-
return this.config.nameOverrides[operationId];
|
|
41
|
-
}
|
|
42
|
-
addOverride(override) {
|
|
43
|
-
this.config.nameOverrides[override.original] = override.override;
|
|
44
|
-
this.config.reviewedNames.push({
|
|
45
|
-
...override,
|
|
46
|
-
approvedAt: new Date().toISOString()
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
getPatterns() {
|
|
50
|
-
return this.config.patterns;
|
|
51
|
-
}
|
|
52
|
-
updateStatistics(stats) {
|
|
53
|
-
this.config.statistics = {
|
|
54
|
-
...this.config.statistics,
|
|
55
|
-
...stats,
|
|
56
|
-
lastUpdated: new Date().toISOString()
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
getReviewedNames() {
|
|
60
|
-
return this.config.reviewedNames;
|
|
61
|
-
}
|
|
62
|
-
hasBeenReviewed(operationId) {
|
|
63
|
-
return operationId in this.config.nameOverrides;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
exports.HookConfigManager = HookConfigManager;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
type StoryObj<T> = {
|
|
3
|
-
args?: any;
|
|
4
|
-
render?: (args: any) => React.ReactElement;
|
|
5
|
-
};
|
|
6
|
-
declare const meta: {
|
|
7
|
-
title: string;
|
|
8
|
-
component: React.FC<import("./types").ActivityFeedProps>;
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: string;
|
|
11
|
-
};
|
|
12
|
-
tags: string[];
|
|
13
|
-
argTypes: {
|
|
14
|
-
variant: {
|
|
15
|
-
control: string;
|
|
16
|
-
options: string[];
|
|
17
|
-
};
|
|
18
|
-
maxItems: {
|
|
19
|
-
control: string;
|
|
20
|
-
};
|
|
21
|
-
showFooter: {
|
|
22
|
-
control: string;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
export default meta;
|
|
27
|
-
type Story = StoryObj<typeof meta>;
|
|
28
|
-
export declare const Default: Story;
|
|
29
|
-
export declare const Compact: Story;
|
|
30
|
-
export declare const Borderless: Story;
|
|
31
|
-
export declare const WithFooter: Story;
|
|
32
|
-
export declare const Empty: Story;
|
|
33
|
-
export declare const NoTitle: Story;
|
|
34
|
-
export declare const LongMessages: Story;
|
|
35
|
-
export declare const MixedTypes: Story;
|
|
36
|
-
export declare const RealTimeUpdates: Story;
|
|
37
|
-
export declare const CustomRenderer: Story;
|
|
38
|
-
//# sourceMappingURL=ActivityFeed.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ActivityFeed.stories.d.ts","sourceRoot":"","sources":["../../../../../src/atoms/components/data/ActivityFeed/ActivityFeed.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,KAAK,QAAQ,CAAC,CAAC,IAAI;IACjB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,KAAK,CAAC,YAAY,CAAC;CAC5C,CAAC;AAEF,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;CAmB2B,CAAC;AAEtC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAgCnC,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAGF,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAGF,eAAO,MAAM,UAAU,EAAE,KAMxB,CAAC;AAGF,eAAO,MAAM,UAAU,EAAE,KAOxB,CAAC;AAGF,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAC;AAGF,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAGF,eAAO,MAAM,YAAY,EAAE,KA0B1B,CAAC;AAGF,eAAO,MAAM,UAAU,EAAE,KAuCxB,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,KA4B7B,CAAC;AAGF,eAAO,MAAM,cAAc,EAAE,KAkB5B,CAAC"}
|
package/dist/codegen/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/codegen/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,WAAW,CAAC"}
|