@burdenoff/microfe-support 2026.626.1 → 2026.715.1

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.
Files changed (77) hide show
  1. package/dist/generated/global-operations.d.ts +2517 -0
  2. package/dist/generated/global-types.d.ts +22913 -0
  3. package/dist/generated/wspace-operations.d.ts +1 -0
  4. package/dist/generated/wspace-types.d.ts +57850 -0
  5. package/dist/index.d.ts +5 -0
  6. package/dist/support/SupportAdminRoot.d.ts +20 -0
  7. package/dist/support/SupportAdminRoutes.d.ts +13 -0
  8. package/dist/support/SupportUserRoot.d.ts +17 -0
  9. package/dist/support/SupportUserRoutes.d.ts +11 -0
  10. package/dist/support/components/NotificationToast.d.ts +17 -0
  11. package/dist/support/components/PageLayout.d.ts +71 -0
  12. package/dist/support/components/RouteHelpers.d.ts +9 -0
  13. package/dist/support/components/analytics/CategoryBreakdown.d.ts +9 -0
  14. package/dist/support/components/analytics/MetricCard.d.ts +10 -0
  15. package/dist/support/components/analytics/PriorityBreakdown.d.ts +9 -0
  16. package/dist/support/components/analytics/SLAReport.d.ts +23 -0
  17. package/dist/support/components/analytics/SatisfactionDistribution.d.ts +23 -0
  18. package/dist/support/components/analytics/TopAgents.d.ts +19 -0
  19. package/dist/support/components/analytics/TrendChart.d.ts +15 -0
  20. package/dist/support/components/kb/ArticleForm.d.ts +25 -0
  21. package/dist/support/components/settings/CannedResponsesSettings.d.ts +21 -0
  22. package/dist/support/components/settings/SLAPoliciesSettings.d.ts +18 -0
  23. package/dist/support/components/settings/TicketCategoriesSettings.d.ts +20 -0
  24. package/dist/support/components/tickets/AttachmentList.d.ts +7 -0
  25. package/dist/support/components/tickets/MarkdownContent.d.ts +7 -0
  26. package/dist/support/components/tickets/MessageComposer.d.ts +22 -0
  27. package/dist/support/components/tickets/MessageThread.d.ts +12 -0
  28. package/dist/support/components/tickets/TicketDetailHeader.d.ts +16 -0
  29. package/dist/support/components/tickets/TicketHeader.d.ts +9 -0
  30. package/dist/support/components/tickets/TicketSidebar.d.ts +7 -0
  31. package/dist/support/components/ui.d.ts +5 -0
  32. package/dist/support/constants.d.ts +20 -0
  33. package/dist/support/events/rybbit.d.ts +13 -0
  34. package/dist/support/hooks/index.d.ts +5 -0
  35. package/dist/support/hooks/useAnalyticsOperations.d.ts +51 -0
  36. package/dist/support/hooks/useAttachmentsFailedToast.d.ts +2 -0
  37. package/dist/support/hooks/useChatOperations.d.ts +27 -0
  38. package/dist/support/hooks/useKnowledgeBaseOperations.d.ts +55 -0
  39. package/dist/support/hooks/useNotification.d.ts +20 -0
  40. package/dist/support/hooks/useRegisterFooter.d.ts +6 -0
  41. package/dist/support/hooks/useSettingsOperations.d.ts +47 -0
  42. package/dist/support/hooks/useSupportAttachments.d.ts +10 -0
  43. package/dist/support/hooks/useTicketListOperations.d.ts +31 -0
  44. package/dist/support/hooks/useTicketOperations.d.ts +39 -0
  45. package/dist/support/index.d.ts +44 -0
  46. package/dist/support/pages/AnalyticsPage.d.ts +1 -0
  47. package/dist/support/pages/ArticleDetailAdminPage.d.ts +7 -0
  48. package/dist/support/pages/ArticleDetailUserPage.d.ts +7 -0
  49. package/dist/support/pages/ContactInquiriesPage.d.ts +1 -0
  50. package/dist/support/pages/ContactInquiryDetailPage.d.ts +1 -0
  51. package/dist/support/pages/CreateArticlePage.d.ts +1 -0
  52. package/dist/support/pages/CreateTicketPage.d.ts +1 -0
  53. package/dist/support/pages/EditArticlePage.d.ts +1 -0
  54. package/dist/support/pages/JobApplicationDetailPage.d.ts +1 -0
  55. package/dist/support/pages/JobApplicationsPage.d.ts +1 -0
  56. package/dist/support/pages/KnowledgeBaseAdminPage.d.ts +7 -0
  57. package/dist/support/pages/KnowledgeBaseUserPage.d.ts +8 -0
  58. package/dist/support/pages/SettingsPage.d.ts +1 -0
  59. package/dist/support/pages/TicketDetailAdminPage.d.ts +8 -0
  60. package/dist/support/pages/TicketDetailUserPage.d.ts +8 -0
  61. package/dist/support/pages/TicketListPage.d.ts +11 -0
  62. package/dist/support/providers/SupportProvider.d.ts +16 -0
  63. package/dist/support/store/supportStore.d.ts +66 -0
  64. package/dist/support/types/index.d.ts +160 -0
  65. package/dist/support/utils/attachments.d.ts +27 -0
  66. package/dist/support/utils/categoryColors.d.ts +10 -0
  67. package/dist/support/utils/cn.d.ts +6 -0
  68. package/dist/support/utils/context.d.ts +2 -0
  69. package/dist/support/utils/errors.d.ts +2 -0
  70. package/dist/support/utils/i18n.d.ts +4 -0
  71. package/dist/support/utils/index.d.ts +57 -0
  72. package/dist/support/utils/markdown.d.ts +2 -0
  73. package/dist/support/utils/supportFiles.d.ts +15 -0
  74. package/dist/support/utils/ticketFilters.d.ts +6 -0
  75. package/dist/support/utils/uiTokens.d.ts +7 -0
  76. package/dist/utils/nativeBridge.d.ts +2 -0
  77. package/package.json +3 -3
@@ -0,0 +1,55 @@
1
+ import type { KnowledgeBaseArticle, CreateKnowledgeBaseArticleInput, UpdateKnowledgeBaseArticleInput } from '../../generated/global-types';
2
+ import type { KnowledgeBaseArticleState } from '../store/supportStore';
3
+ export type { CreateKnowledgeBaseArticleInput, UpdateKnowledgeBaseArticleInput };
4
+ export declare function useKnowledgeBaseOperations(articleSlug?: string): {
5
+ articles: KnowledgeBaseArticle[];
6
+ popularArticles: KnowledgeBaseArticle[];
7
+ categories: any;
8
+ searchResults: KnowledgeBaseArticleState[];
9
+ articleDetail: any;
10
+ totalArticles: any;
11
+ totalResults: any;
12
+ hasMoreArticles: any;
13
+ hasMoreResults: boolean;
14
+ articlesLoading: boolean;
15
+ popularLoading: boolean;
16
+ categoriesLoading: boolean;
17
+ searchLoading: boolean;
18
+ articleLoading: boolean;
19
+ ratingArticle: boolean;
20
+ creatingArticle: boolean;
21
+ updatingArticle: boolean;
22
+ deletingArticle: boolean;
23
+ publishingArticle: boolean;
24
+ unpublishingArticle: boolean;
25
+ archivingArticle: boolean;
26
+ articlesError: import("@apollo/client").ErrorLike | undefined;
27
+ searchError: import("@apollo/client").ErrorLike | undefined;
28
+ articleError: import("@apollo/client").ErrorLike | undefined;
29
+ searchArticles: (query: string, filters?: {
30
+ categoryId?: string;
31
+ tags?: string[];
32
+ }) => void;
33
+ filterArticles: (filters?: {
34
+ categoryId?: string;
35
+ tags?: string[];
36
+ }) => void;
37
+ loadMoreArticles: () => void;
38
+ voteArticle: (articleId: string, helpful: boolean) => Promise<void>;
39
+ recordView: (articleId: string) => Promise<void>;
40
+ refetchArticles: (variables?: any) => Promise<{
41
+ data: any;
42
+ error?: import("@apollo/client").ErrorLike;
43
+ }>;
44
+ refetchArticle: (variables?: any) => Promise<{
45
+ data: any;
46
+ error?: import("@apollo/client").ErrorLike;
47
+ }>;
48
+ setSelectedArticle: (article: KnowledgeBaseArticleState | null) => void;
49
+ createArticle: (input: CreateKnowledgeBaseArticleInput) => Promise<any>;
50
+ updateArticle: (id: string, input: UpdateKnowledgeBaseArticleInput) => Promise<any>;
51
+ deleteArticle: (id: string) => Promise<any>;
52
+ publishArticle: (id: string) => Promise<any>;
53
+ unpublishArticle: (id: string) => Promise<any>;
54
+ archiveArticle: (id: string) => Promise<any>;
55
+ };
@@ -0,0 +1,20 @@
1
+ export type NotificationType = 'success' | 'error' | 'info';
2
+ export interface NotificationState {
3
+ type: NotificationType;
4
+ message: string;
5
+ }
6
+ export interface UseNotificationApi {
7
+ notification: NotificationState | null;
8
+ notify: (type: NotificationType, message: string, durationMs?: number) => void;
9
+ dismiss: () => void;
10
+ }
11
+ /**
12
+ * Single-slot notification toast with timer coalescing.
13
+ *
14
+ * Back-to-back `notify()` calls cancel the previous auto-dismiss timer so a
15
+ * slow earlier toast cannot wipe out a fresher one. The timer is also cleared
16
+ * on unmount to avoid a setState-after-unmount warning when the user navigates
17
+ * away mid-toast. A single `duration` of `Infinity` keeps the toast until the
18
+ * caller dismisses it manually or a new `notify()` supersedes it.
19
+ */
20
+ export declare function useNotification(): UseNotificationApi;
@@ -0,0 +1,6 @@
1
+ import type { FooterItem } from '../types';
2
+ /**
3
+ * Shared hook for registering the support footer status indicator.
4
+ * Used by SupportUserRoot, SupportAdminRoot, and SupportRoot.
5
+ */
6
+ export declare function useRegisterFooter(registerFooterItems?: (items: FooterItem | FooterItem[]) => () => void): void;
@@ -0,0 +1,47 @@
1
+ import type { CreateSlaPolicyInput, UpdateSlaPolicyInput, CreateCannedResponseInput, UpdateCannedResponseInput, CreateTicketCategoryInput, UpdateTicketCategoryInput } from '../../generated/global-types';
2
+ export type { CreateSlaPolicyInput, UpdateSlaPolicyInput, CreateCannedResponseInput, UpdateCannedResponseInput, CreateTicketCategoryInput, UpdateTicketCategoryInput, };
3
+ export declare function useSettingsOperations(): {
4
+ slaPolicies: any;
5
+ totalSLAPolicies: any;
6
+ cannedResponses: any;
7
+ totalCannedResponses: any;
8
+ ticketCategories: any;
9
+ totalCategories: any;
10
+ slaPoliciesLoading: boolean;
11
+ cannedResponsesLoading: boolean;
12
+ categoriesLoading: boolean;
13
+ createSLAPolicyLoading: boolean;
14
+ updateSLAPolicyLoading: boolean;
15
+ deleteSLAPolicyLoading: boolean;
16
+ createCannedResponseLoading: boolean;
17
+ updateCannedResponseLoading: boolean;
18
+ deleteCannedResponseLoading: boolean;
19
+ createCategoryLoading: boolean;
20
+ updateCategoryLoading: boolean;
21
+ deleteCategoryLoading: boolean;
22
+ isLoading: boolean;
23
+ slaPoliciesError: import("@apollo/client").ErrorLike | undefined;
24
+ cannedResponsesError: import("@apollo/client").ErrorLike | undefined;
25
+ categoriesError: import("@apollo/client").ErrorLike | undefined;
26
+ createSLAPolicy: (input: CreateSlaPolicyInput) => Promise<any>;
27
+ updateSLAPolicy: (id: string, input: UpdateSlaPolicyInput) => Promise<any>;
28
+ deleteSLAPolicy: (id: string) => Promise<any>;
29
+ refetchSLAPolicies: (variables?: any) => Promise<{
30
+ data: any;
31
+ error?: import("@apollo/client").ErrorLike;
32
+ }>;
33
+ createCannedResponse: (input: CreateCannedResponseInput) => Promise<any>;
34
+ updateCannedResponse: (id: string, input: UpdateCannedResponseInput) => Promise<any>;
35
+ deleteCannedResponse: (id: string) => Promise<any>;
36
+ refetchCannedResponses: (variables?: any) => Promise<{
37
+ data: any;
38
+ error?: import("@apollo/client").ErrorLike;
39
+ }>;
40
+ createTicketCategory: (input: CreateTicketCategoryInput) => Promise<any>;
41
+ updateTicketCategory: (id: string, input: UpdateTicketCategoryInput) => Promise<any>;
42
+ deleteTicketCategory: (id: string) => Promise<any>;
43
+ refetchCategories: (variables?: any) => Promise<{
44
+ data: any;
45
+ error?: import("@apollo/client").ErrorLike;
46
+ }>;
47
+ };
@@ -0,0 +1,10 @@
1
+ import { type SupportAttachmentRecord } from '../utils/supportFiles';
2
+ interface UseSupportAttachmentsOptions {
3
+ fileIds: string[];
4
+ ticketId: string;
5
+ }
6
+ export declare function useSupportAttachments({ fileIds, ticketId }: UseSupportAttachmentsOptions): {
7
+ attachments: SupportAttachmentRecord[];
8
+ isLoading: boolean;
9
+ };
10
+ export {};
@@ -0,0 +1,31 @@
1
+ import { type SupportTicket } from '../../generated/global-types';
2
+ /**
3
+ * Drives the ticket list query for both the consumer ("my tickets") surface and
4
+ * the admin triage surface.
5
+ *
6
+ * `adminView` is the authoritative switch:
7
+ * - `false` (default — consumer routes): query `mySupportTickets`, which the
8
+ * backend pins to the calling actor (`payload.sub`). This is the privacy
9
+ * boundary — a user only ever sees tickets they created, even when the user
10
+ * is a @burdenoff.com platform admin (the `supportTickets` query widens for
11
+ * those accounts and would otherwise leak every user's tickets here).
12
+ * - `true` (admin routes): query `supportTickets`, the cross-user/admin read.
13
+ *
14
+ * In consumer mode, search runs locally over the loaded self-scoped tickets
15
+ * rather than calling the server `searchTickets` resolver, which applies the
16
+ * same platform-admin widening and would re-introduce the leak.
17
+ */
18
+ export declare function useTicketListOperations(adminView?: boolean): {
19
+ tickets: SupportTicket[];
20
+ ticketsLoading: boolean;
21
+ ticketsError: import("@apollo/client").ErrorLike | undefined;
22
+ totalTickets: any;
23
+ hasMoreTickets: boolean;
24
+ isScopedLocalSearch: boolean;
25
+ isMissingProductScope: boolean;
26
+ loadMoreTickets: () => void;
27
+ refetchTickets: (variables?: any) => Promise<{
28
+ data: any;
29
+ error?: import("@apollo/client").ErrorLike;
30
+ }>;
31
+ };
@@ -0,0 +1,39 @@
1
+ import { SupportTicketStatus, type SupportTicket, type CreateSupportTicketInput, type UpdateSupportTicketInput, type CreateSupportMessageInput, type SubmitSatisfactionSurveyInput } from '../../generated/global-types';
2
+ interface UseTicketOperationsOptions {
3
+ loadAgentProfiles?: boolean;
4
+ }
5
+ export declare function useTicketOperations(options?: UseTicketOperationsOptions): {
6
+ tickets: SupportTicket[];
7
+ ticketDetail: any;
8
+ agentProfiles: any;
9
+ totalTickets: any;
10
+ hasMoreTickets: any;
11
+ ticketsLoading: boolean;
12
+ ticketDetailLoading: boolean;
13
+ agentProfilesLoading: boolean;
14
+ createTicketLoading: boolean;
15
+ updateTicketLoading: boolean;
16
+ assignTicketLoading: boolean;
17
+ changeStatusLoading: boolean;
18
+ addMessageLoading: boolean;
19
+ submitSurveyLoading: boolean;
20
+ ticketsError: import("@apollo/client").ErrorLike | undefined;
21
+ ticketDetailError: import("@apollo/client").ErrorLike | undefined;
22
+ createTicket: (input: CreateSupportTicketInput) => Promise<any>;
23
+ updateTicket: (id: string, input: UpdateSupportTicketInput) => Promise<any>;
24
+ assignTicket: (ticketId: string, assignedTo: string) => Promise<any>;
25
+ changeTicketStatus: (ticketId: string, status: SupportTicketStatus) => Promise<any>;
26
+ addTicketMessage: (input: CreateSupportMessageInput) => Promise<any>;
27
+ submitSatisfactionSurvey: (input: SubmitSatisfactionSurveyInput) => Promise<any>;
28
+ loadMoreTickets: () => void;
29
+ refetchTickets: (variables?: any) => Promise<{
30
+ data: any;
31
+ error?: import("@apollo/client").ErrorLike;
32
+ }>;
33
+ refetchTicketDetail: (variables?: any) => Promise<{
34
+ data: any;
35
+ error?: import("@apollo/client").ErrorLike;
36
+ }>;
37
+ setSelectedTicket: (ticket: SupportTicket | null) => void;
38
+ };
39
+ export {};
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Support Microfrontend
3
+ *
4
+ * Provides a comprehensive customer support and help desk UI for the Burdenoff
5
+ * multi-tenant platform. This is a GLOBAL module (uses the global API gateway).
6
+ *
7
+ * Features:
8
+ * - Ticket management (create, track, respond)
9
+ * - Ticket conversation thread
10
+ * - Knowledge base and help center
11
+ * - Support analytics and reporting
12
+ * - SLA tracking and alerts
13
+ *
14
+ * Pick a root based on who the host shell serves:
15
+ * - `SupportUserRoot` — end-user app-shells (vibecontrols-app, workspaces,
16
+ * bigconsole, botlit-app, etc.). Tickets + KB browse only.
17
+ * - `SupportAdminRoot` — admin-app. Adds contact-inquiry inbox, KB authoring,
18
+ * analytics, and settings.
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * import { SupportUserRoot, type SupportRootProps } from '@burdenoff/microfe-support';
23
+ *
24
+ * function App() {
25
+ * const props: SupportRootProps = {
26
+ * basePath: '/support',
27
+ * navigate: (path) => router.push(path),
28
+ * currentUser: { id: '1', email: 'user@example.com' },
29
+ * apiGatewayUrl: 'http://localhost:4000/global/graphql',
30
+ * authToken: 'token',
31
+ * onTicketCreated: (ticket) => console.log('Ticket created:', ticket),
32
+ * };
33
+ *
34
+ * return <SupportUserRoot {...props} />;
35
+ * }
36
+ * ```
37
+ */
38
+ export { SupportUserRoot } from './SupportUserRoot';
39
+ export { SupportAdminRoot } from './SupportAdminRoot';
40
+ export { SUPPORT_RYBBIT_EVENT_ALLOWLIST } from './events/rybbit';
41
+ export type { SupportRootProps, Ticket, SLAMetrics, ChatSession, ChatMessage, TicketFilters, AddTicketMessageInput, ViewMode, KnowledgeBaseArticleState, SupportTicketStatus, SupportTicketPriority, SLABreachStatus, } from './types';
42
+ export { useSupport } from './providers/SupportProvider';
43
+ export { useTicketOperations, useChatOperations, useKnowledgeBaseOperations, useAnalyticsOperations, useSupportStore, } from './hooks';
44
+ export { formatTicketStatus, getPriorityColor, getPriorityIcon, formatFileSize, formatTimeAgo, formatDuration, calculateSLAStatus, truncateText, getInitials, isValidEmail, stringToColor, } from './utils';
@@ -0,0 +1 @@
1
+ export declare function AnalyticsPage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Admin-facing article detail page.
3
+ *
4
+ * Full controls: edit, publish, unpublish, archive, delete,
5
+ * status badges, in addition to article content and voting.
6
+ */
7
+ export declare function ArticleDetailAdminPage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * User-facing article detail page.
3
+ *
4
+ * Displays article content, metadata, tags, and voting feedback.
5
+ * No admin controls (edit, publish, unpublish, archive, delete).
6
+ */
7
+ export declare function ArticleDetailUserPage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function ContactInquiriesPage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function ContactInquiryDetailPage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function CreateArticlePage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function CreateTicketPage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function EditArticlePage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function JobApplicationDetailPage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function JobApplicationsPage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Admin-facing knowledge base page.
3
+ *
4
+ * Shows all articles (published, draft, archived) with status badges.
5
+ * Includes "New Article" button for creating KB content.
6
+ */
7
+ export declare function KnowledgeBaseAdminPage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * User-facing knowledge base page.
3
+ *
4
+ * Shows only published articles. No "New Article" button,
5
+ * no draft/archived status badges. Users can browse, search,
6
+ * and read articles.
7
+ */
8
+ export declare function KnowledgeBaseUserPage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function SettingsPage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Admin-facing ticket detail page.
3
+ *
4
+ * Admins/agents get full controls: status changes, ticket assignment,
5
+ * internal notes, and all reply types in addition to the standard
6
+ * ticket view and conversation.
7
+ */
8
+ export declare function TicketDetailAdminPage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * User-facing ticket detail page.
3
+ *
4
+ * Users can view ticket details, read conversation history,
5
+ * and add replies. Admin controls (status changes, assignments,
6
+ * internal notes) are not available.
7
+ */
8
+ export declare function TicketDetailUserPage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ interface TicketListPageProps {
2
+ /**
3
+ * When true, lists tickets across all users (admin triage view, backed by
4
+ * `supportTickets`). When false/omitted, lists only the calling user's own
5
+ * tickets (consumer view, backed by `mySupportTickets`) — this is the privacy
6
+ * boundary for the user-facing support surface.
7
+ */
8
+ adminView?: boolean;
9
+ }
10
+ export declare function TicketListPage({ adminView }: TicketListPageProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { FC, PropsWithChildren } from 'react';
2
+ import type { SupportRootProps } from '../types';
3
+ /**
4
+ * Hook to access Support context
5
+ */
6
+ export declare const useSupport: () => SupportRootProps;
7
+ /**
8
+ * Provider component for Support microfrontend
9
+ * Sets up routing and context.
10
+ *
11
+ * NOTE: Apollo client is provided by the app shell's MultiGatewayProvider +
12
+ * GatewayRoute. Support routes are wrapped with <GatewayRoute gateway="global">
13
+ * so all useQuery/useMutation calls automatically use the global gateway client.
14
+ * This MFE does NOT create its own Apollo client.
15
+ */
16
+ export declare const SupportProvider: FC<PropsWithChildren<SupportRootProps>>;
@@ -0,0 +1,66 @@
1
+ import type { SupportTicket, SupportTicketStatus, SupportTicketPriority } from '../../generated/global-types';
2
+ export type ViewMode = 'list' | 'grid' | 'compact';
3
+ export interface TicketFilters {
4
+ search: string;
5
+ status: SupportTicketStatus | 'all';
6
+ priority: SupportTicketPriority | 'all';
7
+ categoryId: string | null;
8
+ productId: string | null;
9
+ assignedToId: string | null;
10
+ dateRange: {
11
+ start: Date | null;
12
+ end: Date | null;
13
+ };
14
+ }
15
+ export interface KnowledgeBaseArticleState {
16
+ id: string;
17
+ slug: string;
18
+ title: string;
19
+ excerpt?: string;
20
+ categoryId?: string | null;
21
+ tags?: string[];
22
+ }
23
+ export interface ChatSessionState {
24
+ isActive: boolean;
25
+ isMinimized: boolean;
26
+ queuePosition: number | null;
27
+ agentTyping: boolean;
28
+ }
29
+ interface KBSearchState {
30
+ query: string;
31
+ filters: {
32
+ categoryId: string | null;
33
+ tags: string[];
34
+ };
35
+ results: KnowledgeBaseArticleState[];
36
+ }
37
+ interface SupportState {
38
+ selectedTicket: SupportTicket | null;
39
+ selectedArticle: KnowledgeBaseArticleState | null;
40
+ viewMode: ViewMode;
41
+ ticketFilter: TicketFilters;
42
+ chatSession: ChatSessionState;
43
+ kbSearch: KBSearchState;
44
+ unreadTicketCount: number;
45
+ newMessageNotifications: Map<string, number>;
46
+ setSelectedTicket: (ticket: SupportTicket | null) => void;
47
+ setSelectedArticle: (article: KnowledgeBaseArticleState | null) => void;
48
+ setViewMode: (mode: ViewMode) => void;
49
+ updateTicketFilter: (filter: Partial<TicketFilters>) => void;
50
+ resetTicketFilter: () => void;
51
+ startChatSession: () => void;
52
+ endChatSession: () => void;
53
+ minimizeChat: () => void;
54
+ maximizeChat: () => void;
55
+ setAgentTyping: (typing: boolean) => void;
56
+ setQueuePosition: (position: number | null) => void;
57
+ updateKbSearch: (query: string, filters?: Partial<KBSearchState['filters']>) => void;
58
+ setKbResults: (results: KnowledgeBaseArticleState[]) => void;
59
+ markTicketAsRead: (ticketId: string) => void;
60
+ incrementUnreadCount: () => void;
61
+ addMessageNotification: (ticketId: string) => void;
62
+ clearAllNotifications: () => void;
63
+ resetForContextChange: () => void;
64
+ }
65
+ export declare const useSupportStore: import("zustand").UseBoundStore<import("zustand").StoreApi<SupportState>>;
66
+ export {};
@@ -0,0 +1,160 @@
1
+ /**
2
+ * Support Microfrontend Types
3
+ *
4
+ * This file defines types for the support microfrontend module.
5
+ */
6
+ export interface NavItem {
7
+ id: string;
8
+ label: string;
9
+ path: string;
10
+ icon?: React.ReactNode;
11
+ order?: number;
12
+ group?: string;
13
+ }
14
+ export interface FooterItem {
15
+ id: string;
16
+ label: string;
17
+ path?: string;
18
+ onClick?: () => void;
19
+ type?: 'status' | 'action' | 'link';
20
+ order?: number;
21
+ section?: 'left' | 'center' | 'right';
22
+ }
23
+ export type { ViewMode, TicketFilters, KnowledgeBaseArticleState } from '../store/supportStore';
24
+ export interface ChatMessage {
25
+ id: string;
26
+ content: string;
27
+ senderType: 'CUSTOMER' | 'AGENT' | 'SYSTEM';
28
+ createdAt: string;
29
+ attachments?: Array<{
30
+ id: string;
31
+ filename: string;
32
+ url: string;
33
+ size: number;
34
+ }>;
35
+ }
36
+ export interface ChatSession {
37
+ id: string;
38
+ status: 'WAITING' | 'ACTIVE' | 'ENDED';
39
+ startedAt: string;
40
+ endedAt?: string;
41
+ queuePosition?: number;
42
+ assignedAgent?: {
43
+ id: string;
44
+ displayName: string;
45
+ email: string;
46
+ };
47
+ messages?: ChatMessage[];
48
+ lastMessage?: ChatMessage;
49
+ }
50
+ export interface Ticket {
51
+ id: string;
52
+ ticketNumber: string;
53
+ subject: string;
54
+ description?: string;
55
+ status: SupportTicketStatus;
56
+ priority: SupportTicketPriority;
57
+ createdAt: string;
58
+ updatedAt: string;
59
+ userId: string;
60
+ assignedTo?: string;
61
+ ticketCategory?: {
62
+ id: string;
63
+ name: string;
64
+ color?: string;
65
+ };
66
+ slaBreachStatus?: SLABreachStatus;
67
+ }
68
+ export interface AddTicketMessageInput {
69
+ content: string;
70
+ isInternal?: boolean;
71
+ attachments?: File[];
72
+ }
73
+ export type SupportTicketStatus = 'NEW' | 'IN_PROGRESS' | 'WAITING_CUSTOMER' | 'RESOLVED' | 'CLOSED' | 'REOPENED';
74
+ export type SupportTicketPriority = 'CRITICAL' | 'HIGH' | 'NORMAL' | 'LOW';
75
+ export type SLABreachStatus = 'NONE' | 'WARNING_50' | 'WARNING_75' | 'WARNING_90' | 'BREACHED';
76
+ /**
77
+ * Current user information passed from the app shell
78
+ */
79
+ export interface CurrentUser {
80
+ id: string;
81
+ email: string;
82
+ displayName?: string;
83
+ firstName?: string;
84
+ lastName?: string;
85
+ avatar?: string;
86
+ username?: string;
87
+ name?: string;
88
+ /** User role (e.g., 'admin', 'member', 'viewer') */
89
+ role?: string;
90
+ }
91
+ /**
92
+ * Base props for microfrontend root components
93
+ */
94
+ export interface MicrofrontendRootProps {
95
+ basePath?: string;
96
+ apiGatewayUrl?: string;
97
+ authToken?: string;
98
+ tenantId?: string;
99
+ workspaceId?: string;
100
+ organizationId?: string;
101
+ productId?: string;
102
+ navigate?: (path: string) => void;
103
+ currentUser?: CurrentUser;
104
+ }
105
+ /**
106
+ * Props for the SupportRoot component
107
+ */
108
+ export interface SupportRootProps extends MicrofrontendRootProps {
109
+ /**
110
+ * Show support tickets across all products instead of scoping user lists to productId.
111
+ * Intended for hub surfaces such as workspaces-app; admin views keep their own filters.
112
+ */
113
+ showAllProductTickets?: boolean;
114
+ /**
115
+ * Optional callback when a ticket is created
116
+ */
117
+ onTicketCreated?: (ticket: {
118
+ id: string;
119
+ ticketNumber: string;
120
+ }) => void;
121
+ /**
122
+ * Optional callback when a chat session starts
123
+ */
124
+ onChatStarted?: (session: {
125
+ id: string;
126
+ }) => void;
127
+ /**
128
+ * Optional callback when an article is viewed
129
+ */
130
+ onArticleViewed?: (article: {
131
+ id: string;
132
+ slug: string;
133
+ }) => void;
134
+ /**
135
+ * Optional function to register navigation items with the shell
136
+ * Injected by the shell app
137
+ */
138
+ registerNavItems?: (items: NavItem | NavItem[]) => () => void;
139
+ /**
140
+ * Optional function to register footer items with the shell
141
+ */
142
+ registerFooterItems?: (items: FooterItem | FooterItem[]) => () => void;
143
+ /**
144
+ * Chat widget configuration
145
+ */
146
+ chatWidget?: {
147
+ position?: 'bottom-right' | 'bottom-left';
148
+ primaryColor?: string;
149
+ enableProactiveChat?: boolean;
150
+ };
151
+ }
152
+ export type TicketStatus = 'OPEN' | 'IN_PROGRESS' | 'WAITING_ON_CUSTOMER' | 'WAITING_ON_THIRD_PARTY' | 'RESOLVED' | 'CLOSED';
153
+ export type TicketPriority = 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
154
+ export interface SLAMetrics {
155
+ isMet: boolean;
156
+ breachPercentage: number;
157
+ minutesRemaining: number;
158
+ targetMinutes: number;
159
+ elapsedMinutes: number;
160
+ }
@@ -0,0 +1,27 @@
1
+ export declare const SUPPORT_ALLOWED_EXTENSIONS: readonly string[];
2
+ /**
3
+ * `accept` value for <input type="file">. Derived from EXT_TO_MIME so it always
4
+ * matches the validator. Includes both MIME types and extension hints so the
5
+ * native picker filters correctly across browsers/OSes.
6
+ */
7
+ export declare const SUPPORT_ATTACHMENT_ACCEPT: string;
8
+ /** Human-readable allowed-types label for error messages. */
9
+ export declare const SUPPORT_ALLOWED_TYPES_LABEL: string;
10
+ /**
11
+ * Max attachment size, mirroring the backend cap
12
+ * (`global-support-svc` SUPPORT_MAX_FILE_SIZE_BYTES, default 5 GiB; the service
13
+ * throws "Attachment exceeds the maximum support upload size" past this). We
14
+ * reject oversized files here too so the user gets immediate feedback instead
15
+ * of waiting through a long upload only to be rejected server-side.
16
+ */
17
+ export declare const SUPPORT_MAX_ATTACHMENT_BYTES: number;
18
+ export declare function isAllowedAttachment(file: File): boolean;
19
+ /**
20
+ * Split a selection into allowed/rejected. Drag-drop and "All files" picker
21
+ * overrides bypass the `accept` attribute, so callers must validate here too.
22
+ */
23
+ export declare function partitionAttachments(files: File[]): {
24
+ accepted: File[];
25
+ rejected: File[];
26
+ };
27
+ export declare function rejectedAttachmentsMessage(rejected: File[]): string;
@@ -0,0 +1,10 @@
1
+ export type CategoryColorOption = {
2
+ value: string;
3
+ label: string;
4
+ swatchClass: string;
5
+ badgeClass: string;
6
+ };
7
+ export declare const CATEGORY_COLOR_OPTIONS: CategoryColorOption[];
8
+ export declare function getCategoryColorOption(color?: string | null): CategoryColorOption;
9
+ export declare function getCategoryBadgeClass(color?: string | null): string;
10
+ export declare function getCategorySwatchClass(color?: string | null): string;
@@ -0,0 +1,6 @@
1
+ import { type ClassValue } from 'clsx';
2
+ /**
3
+ * Utility function to merge Tailwind CSS classes
4
+ * Combines clsx for conditional classes and tailwind-merge for deduplication
5
+ */
6
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -0,0 +1,2 @@
1
+ export declare function resolveSupportProductId(explicitProductId?: string): string | undefined;
2
+ export declare function resolveSupportOrganizationId(explicitOrganizationId?: string): string | undefined;
@@ -0,0 +1,2 @@
1
+ export declare function extractErrorMessage(error: unknown, fallback: string): string;
2
+ export declare function extractErrorCode(error: unknown): string | null;