@bcrumbs.net/inbox 0.0.63 → 0.0.65

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 (189) hide show
  1. package/assets/ar/inbox.json +40 -6
  2. package/assets/en/inbox.json +40 -6
  3. package/e2e/auth.setup.d.ts +1 -0
  4. package/e2e/checkout/checkout.flows.d.ts +24 -0
  5. package/e2e/global.teardown.d.ts +1 -0
  6. package/e2e/support/auth.d.ts +22 -0
  7. package/e2e/support/cleanup.d.ts +20 -0
  8. package/e2e/support/config.d.ts +23 -0
  9. package/e2e/support/fixtures.d.ts +16 -0
  10. package/e2e/support/identifiers.d.ts +13 -0
  11. package/e2e/support/index.d.ts +6 -0
  12. package/index.cjs.js +39202 -1083
  13. package/index.esm.js +39206 -1088
  14. package/package.json +2 -2
  15. package/playwright.config.d.ts +0 -4
  16. package/src/app/ai/components/Crumby/CrumbyChatError.d.ts +9 -0
  17. package/src/app/ai/components/Crumby/CrumbyChatErrorBoundary.d.ts +13 -0
  18. package/src/app/ai/components/Crumby/CrumbyHeader.d.ts +9 -0
  19. package/src/app/ai/components/Crumby/CrumbyPageContext.d.ts +22 -0
  20. package/src/app/ai/components/Crumby/CrumbyRuntimeProvider.d.ts +9 -0
  21. package/src/app/ai/components/CrumbySettings/CrumbyEditsBanner.d.ts +14 -0
  22. package/src/app/ai/components/CrumbySettings/VoiceSettingsSection.d.ts +9 -0
  23. package/src/app/ai/components/playground/Button.d.ts +1 -1
  24. package/src/app/ai/components/playground/ThreadMessages.d.ts +3 -1
  25. package/src/app/ai/components/playground/TooltipIconButton.d.ts +1 -1
  26. package/src/app/ai/components/sources/mediaTypeForFile.d.ts +8 -0
  27. package/src/app/ai/config/promptSettings.d.ts +31 -0
  28. package/src/app/ai/hooks/usePromptCopilot.d.ts +22 -0
  29. package/src/app/ai/tools/PromptEditorTool.d.ts +2 -0
  30. package/src/app/ai/types/index.d.ts +1 -1
  31. package/src/app/ai/utils/clientToolResubmit.d.ts +8 -0
  32. package/src/app/ai/utils/crumbyChatFetch.d.ts +15 -0
  33. package/src/app/auth/components/AcceptInvitation.d.ts +2 -0
  34. package/src/app/auth/components/AuthLanguagePicker.d.ts +3 -0
  35. package/src/app/auth/components/AuthVisualCarousel.d.ts +1 -0
  36. package/src/app/auth/components/ClerkSessionBridge.d.ts +4 -0
  37. package/src/app/auth/components/password-page/AuthPasswordPageLayout.d.ts +3 -1
  38. package/src/app/auth/components/password-page/PasswordSuccessView.d.ts +2 -1
  39. package/src/app/auth/config/authProvider.d.ts +20 -2
  40. package/src/app/auth/config/clerkAppearance.d.ts +152 -49
  41. package/src/app/auth/config/clerkLocalization.d.ts +6 -0
  42. package/src/app/auth/pages/Auth.style.d.ts +14 -0
  43. package/src/app/auth/pages/Login.d.ts +2 -1
  44. package/src/app/auth/pages/Register.d.ts +1 -0
  45. package/src/app/billing/pages/GatewayWelcomePage.d.ts +5 -0
  46. package/src/app/billing/utils/isGatewayPlan.d.ts +2 -0
  47. package/src/app/broadcast/components/BroadcastAnalysisReciepientsHeader.d.ts +2 -1
  48. package/src/app/broadcast/components/BroadcastDetailsSection.d.ts +3 -1
  49. package/src/app/broadcast/constants.d.ts +2 -0
  50. package/src/app/dashboard/components/AgentCard.d.ts +2 -1
  51. package/src/app/dashboard/components/AgentsCard.d.ts +4 -2
  52. package/src/app/dashboard/components/BroadcastDashboard.d.ts +3 -1
  53. package/src/app/dashboard/components/ChatsByLifeCycleCard.d.ts +13 -0
  54. package/src/app/dashboard/components/DashboardFilters.d.ts +27 -0
  55. package/src/app/dashboard/components/DashboardPdfCaptureArea.d.ts +11 -0
  56. package/src/app/dashboard/components/DashboardPdfExportButton.d.ts +7 -0
  57. package/src/app/dashboard/components/DashboardPdfHeader.d.ts +11 -0
  58. package/src/app/dashboard/components/DashboardSections.d.ts +7 -2
  59. package/src/app/dashboard/components/InboxDashboard.d.ts +3 -1
  60. package/src/app/dashboard/hooks/useDashboardPdfMeta.d.ts +31 -0
  61. package/src/app/dashboard/hooks/useDashboardTabsPdfExport.d.ts +26 -0
  62. package/src/app/dashboard/utils/dashboardReportExports.d.ts +16 -1
  63. package/src/app/dashboard/utils/exportDashboardPdf.d.ts +19 -0
  64. package/src/app/dashboard/utils/lifecycleStages.d.ts +53 -0
  65. package/src/app/dashboard/utils/reportHelpers.d.ts +9 -0
  66. package/src/app/gatewayHome/components/ChecklistStep.d.ts +15 -0
  67. package/src/app/gatewayHome/components/CreditBalanceCard.d.ts +6 -0
  68. package/src/app/gatewayHome/components/MessageStats.d.ts +5 -0
  69. package/src/app/gatewayHome/components/SetupChecklist.d.ts +11 -0
  70. package/src/app/gatewayHome/components/console/QuickstartConsole.d.ts +11 -0
  71. package/src/app/gatewayHome/components/console/RunRequestBar.d.ts +15 -0
  72. package/src/app/gatewayHome/components/console/consoleStyles.d.ts +77 -0
  73. package/src/app/gatewayHome/components/steps/ApiKeyStepBody.d.ts +8 -0
  74. package/src/app/gatewayHome/components/steps/ChannelStepBody.d.ts +3 -0
  75. package/src/app/gatewayHome/components/steps/MetaStepBody.d.ts +6 -0
  76. package/src/app/gatewayHome/components/steps/WebhookStepBody.d.ts +7 -0
  77. package/src/app/gatewayHome/components/styles.d.ts +29 -0
  78. package/src/app/gatewayHome/config/constants.d.ts +22 -0
  79. package/src/app/gatewayHome/hooks/useGatewaySetup.d.ts +59 -0
  80. package/src/app/gatewayHome/hooks/useMessageStats.d.ts +17 -0
  81. package/src/app/gatewayHome/hooks/useQuickstartRequest.d.ts +31 -0
  82. package/src/app/gatewayHome/hooks/useSendableTemplates.d.ts +9 -0
  83. package/src/app/gatewayHome/pages/GatewayHomePage.d.ts +1 -0
  84. package/src/app/gatewayHome/types/index.d.ts +21 -0
  85. package/src/app/gatewayHome/utils/buildRequestBody.d.ts +7 -0
  86. package/src/app/gatewayHome/utils/buildSnippet.d.ts +9 -0
  87. package/src/app/gatewayHome/utils/sendTestMessage.d.ts +3 -0
  88. package/src/app/gatewayHome/utils/setupStorage.d.ts +8 -0
  89. package/src/app/gatewayHome/utils/templateHasParameters.d.ts +6 -0
  90. package/src/app/generic/components/HeaderImageInput.d.ts +3 -1
  91. package/src/app/generic/components/MessagePreview.d.ts +1 -1
  92. package/src/app/generic/components/PreviewHeaderDocument.d.ts +5 -0
  93. package/src/app/generic/hooks/usePaginatedQuery.d.ts +1 -0
  94. package/src/app/generic/utils/chunkErrorRecovery.d.ts +7 -0
  95. package/src/app/generic/utils/onesignal.d.ts +13 -0
  96. package/src/app/inbox/calls/useIncomingCallAlerts.d.ts +2 -0
  97. package/src/app/inbox/components/Calls/ActiveCallControls.d.ts +6 -0
  98. package/src/app/inbox/components/Calls/IncomingCallBanner.d.ts +6 -0
  99. package/src/app/inbox/components/Chat/ChatContent.d.ts +3 -1
  100. package/src/app/inbox/components/Chat/QuickReplyEmpty.d.ts +5 -0
  101. package/src/app/inbox/components/Chat/QuickReplyPickerMenu.d.ts +2 -2
  102. package/src/app/inbox/components/NewDetails/ClientSection.d.ts +3 -1
  103. package/src/app/inbox/components/NewDetails/ContactActionsMenu.d.ts +9 -0
  104. package/src/app/inbox/components/NewDetails/SuggestedAssignee.d.ts +7 -0
  105. package/src/app/inbox/components/NewDetails/SuggestedStage.d.ts +13 -0
  106. package/src/app/inbox/components/NewDetails/SuggestedTags.d.ts +18 -0
  107. package/src/app/inbox/components/NewDetails/SuggestionItems.d.ts +16 -0
  108. package/src/app/inbox/components/NewDetails/UserHeader.d.ts +2 -1
  109. package/src/app/inbox/components/Shared/SharedStyle.d.ts +8 -0
  110. package/src/app/inbox/constants/index.d.ts +1 -0
  111. package/src/app/inbox/context/CallSession.d.ts +16 -0
  112. package/src/app/inbox/context/SuggestionsContext.d.ts +25 -0
  113. package/src/app/inbox/hooks/useAgentSuggestions.d.ts +20 -0
  114. package/src/app/inbox/hooks/useApplySuggestion.d.ts +18 -0
  115. package/src/app/inbox/hooks/useConvEnhance.d.ts +3 -1
  116. package/src/app/inbox/hooks/useConversationsPerodicFetch.d.ts +37 -0
  117. package/src/app/inbox/hooks/useIncomingCallAlerts.d.ts +2 -0
  118. package/src/app/inbox/hooks/useNewSortedEvents.d.ts +1 -1
  119. package/src/app/inbox/hooks/useQuickReplyPicker.d.ts +5 -3
  120. package/src/app/inbox/pages/InboxPage.d.ts +1 -1
  121. package/src/app/inbox/utils/callUi.d.ts +25 -0
  122. package/src/app/inbox/utils/convAssistStorage.d.ts +9 -4
  123. package/src/app/inbox/utils/convSuggestions.d.ts +59 -0
  124. package/src/app/inbox/utils/convSuggestionsStorage.d.ts +20 -0
  125. package/src/app/inbox/utils/convs.d.ts +4 -0
  126. package/src/app/inbox/utils/sounds.d.ts +4 -0
  127. package/src/app/layout/components/LogoutPopin.d.ts +6 -3
  128. package/src/app/layout/components/language/index.d.ts +5 -1
  129. package/src/app/layout/constants/index.d.ts +35 -0
  130. package/src/app/layout/hooks/useCallsEnabled.d.ts +1 -0
  131. package/src/app/layout/hooks/useGatewayPlanEnabled.d.ts +5 -0
  132. package/src/app/layout/hooks/useWebchatEnabled.d.ts +5 -0
  133. package/src/app/managemnet/components/channels/ChannelItem.d.ts +2 -1
  134. package/src/app/managemnet/components/channels/ChannelSettingsDrawer.d.ts +15 -0
  135. package/src/app/managemnet/components/channels/ShareChannelLinkDialog.d.ts +11 -0
  136. package/src/app/managemnet/components/channels/WebChatSnippetBlock.d.ts +7 -0
  137. package/src/app/managemnet/config/webchat.d.ts +5 -0
  138. package/src/app/managemnet/config/webhookDefinition.d.ts +4 -0
  139. package/src/app/managemnet/pages/connectChannel/ConnectChannel.d.ts +2 -0
  140. package/src/app/managemnet/pages/generalSettings/NoiseFilterSettings.d.ts +8 -0
  141. package/src/app/managemnet/pages/generalSettings/WritingAssistanceSettings.d.ts +9 -0
  142. package/src/app/managemnet/pages/generalSettings/holidayConstants.d.ts +5 -0
  143. package/src/app/managemnet/pages/generalSettings/noiseFilterConstants.d.ts +24 -0
  144. package/src/app/managemnet/pages/generalSettings/writingConstants.d.ts +6 -0
  145. package/src/app/managemnet/utils/webChatSnippet.d.ts +2 -0
  146. package/src/app/onboarding/components/OnboardingView.d.ts +3 -1
  147. package/src/app/onboarding/components/useOnboardingChecklist.d.ts +12 -9
  148. package/src/app/onboarding/constants/workspaceProfileOptions.d.ts +30 -0
  149. package/src/app/onboarding/utils/onboardingApi.d.ts +23 -0
  150. package/src/app/onboarding/utils/onboardingChecklistStorage.d.ts +42 -49
  151. package/src/app/resources/components/Agents/CreateAgent.d.ts +7 -3
  152. package/src/app/resources/components/Integrations/ChannelDialogLayout.d.ts +6 -1
  153. package/src/app/resources/components/Integrations/RenderCorrectIntegrationFlow.d.ts +3 -1
  154. package/src/app/resources/components/Integrations/WebChat/index.d.ts +8 -0
  155. package/src/app/resources/components/Integrations/WhatsApp/index.d.ts +1 -0
  156. package/src/app/resources/components/ListResources/Utils.d.ts +1 -0
  157. package/src/app/resources/hooks/useFBPagesHook.d.ts +4 -2
  158. package/src/app/resources/hooks/useWabaHook.d.ts +5 -4
  159. package/src/app/resources/utils/channelSetupTracking.d.ts +21 -0
  160. package/src/app/resources/utils/facebookSdk.d.ts +11 -0
  161. package/src/app/subscriptions/components/NewSubscription/OnboardingStepper.d.ts +2 -2
  162. package/src/app/subscriptions/components/NewSubscription/SubscriptionName.d.ts +2 -0
  163. package/src/app/subscriptions/components/NewSubscription/SubscriptionSuccess.d.ts +3 -1
  164. package/src/app/subscriptions/components/NewSubscription/WorkspaceProfile.d.ts +18 -0
  165. package/src/app/subscriptions/components/NewSubscription/WorkspaceStepLayout.d.ts +5 -2
  166. package/src/app/subscriptions/components/Plans/PlanCard.d.ts +3 -1
  167. package/src/app/subscriptions/components/Plans/ShowcasePlans.d.ts +3 -1
  168. package/src/app/subscriptions/components/SubscriptionSettings/SubscriptionCreditsCard.d.ts +5 -0
  169. package/src/app/subscriptions/components/SubscriptionSettings/SubscriptionProfile.d.ts +0 -1
  170. package/src/app/subscriptions/components/SubscriptionSettings/SubscriptionUsers.d.ts +0 -1
  171. package/src/app/subscriptions/components/SubscriptionSettings/index.d.ts +17 -2
  172. package/src/app/subscriptions/constants/Plans.d.ts +2 -1
  173. package/src/app/subscriptions/hooks/useWorkspaceProfileSubmit.d.ts +12 -0
  174. package/src/app/subscriptions/utils/estimateUpgradeProration.d.ts +7 -0
  175. package/src/app/subscriptions/utils/newWorkspaceContext.d.ts +8 -0
  176. package/src/assets/locales/translations.d.ts +444 -0
  177. package/src/config/constants.d.ts +1 -2
  178. package/src/environments/environment.dev.d.ts +2 -0
  179. package/src/environments/types.d.ts +2 -0
  180. package/src/graphql.autogenerated.d.ts +2718 -22
  181. package/src/graphql.billing.autogenerated.d.ts +193 -0
  182. package/src/lib/index.d.ts +1 -0
  183. package/src/testUtils/bcUiMock.d.ts +16 -0
  184. package/src/utils/colorPool.d.ts +1 -2
  185. package/src/utils/getActiveChannelList.d.ts +6 -1
  186. package/src/utils/globalHelper.d.ts +22 -0
  187. package/src/app/contact/components/ImportProgressDialog.d.ts +0 -13
  188. package/src/app/managemnet/components/channels/EditChannelDialog.d.ts +0 -11
  189. package/src/app/onboarding/utils/onboardingChecklistPersistence.d.ts +0 -18
@@ -1,7 +1,8 @@
1
- import { Agent, AgentsReportQuery, ConvTagsReportQuery, ConvsReportQuery, Conversation } from '../../../graphql.autogenerated';
1
+ import { Agent, AgentsReportQuery, ConvTagsReportQuery, ConvsReportQuery, Conversation, ConvStagesReportQuery } from '../../../graphql.autogenerated';
2
2
  import React from 'react';
3
3
  type AgentReportNode = NonNullable<AgentsReportQuery['agentsReport']['nodes']>[number];
4
4
  type ConvTagReportNode = NonNullable<ConvTagsReportQuery['convTagsReport']['nodes']>[number];
5
+ type ConvLifecycleReportNode = NonNullable<ConvStagesReportQuery['convStagesReport']['nodes']>[number];
5
6
  type ConvReportNode = NonNullable<ConvsReportQuery['convsReport']['nodes']>[number];
6
7
  type ReportNode = AgentReportNode | ConvReportNode;
7
8
  interface DashboardSectionsProps {
@@ -11,7 +12,11 @@ interface DashboardSectionsProps {
11
12
  agentsLoading?: boolean;
12
13
  agentsReportLoading?: boolean;
13
14
  convTagsReportData?: ConvTagReportNode[];
15
+ convLifecycleReportData?: ConvLifecycleReportNode[];
16
+ /** Workspace lifecycle stage names in configured order. */
17
+ convLifecycleStages?: string[];
14
18
  convTagsReportLoading?: boolean;
19
+ convLifecycleReportLoading?: boolean;
15
20
  totalMessages?: number;
16
21
  convsLoading?: boolean;
17
22
  integrationId?: string;
@@ -25,5 +30,5 @@ interface DashboardSectionsProps {
25
30
  selectedPeriod: string;
26
31
  reportNodes: ReportNode[];
27
32
  }
28
- declare const _default: React.MemoExoticComponent<({ agentsData, allAgentsData, agentsReportData, agentsLoading, agentsReportLoading, convTagsReportData, convTagsReportLoading, totalMessages, convsLoading, integrationId, agentIds, assignedConversations, unassignedConversations, liveConvs, periodFilteredLiveConvs, startDate, endDate, selectedPeriod, reportNodes, }: DashboardSectionsProps) => import("@emotion/react/jsx-runtime").JSX.Element>;
33
+ declare const _default: React.MemoExoticComponent<({ agentsData, allAgentsData, agentsReportData, agentsLoading, agentsReportLoading, convTagsReportData, convTagsReportLoading, totalMessages, convsLoading, integrationId, agentIds, assignedConversations, unassignedConversations, liveConvs, periodFilteredLiveConvs, startDate, endDate, selectedPeriod, reportNodes, convLifecycleReportData, convLifecycleStages, convLifecycleReportLoading, }: DashboardSectionsProps) => import("@emotion/react/jsx-runtime").JSX.Element>;
29
34
  export default _default;
@@ -5,6 +5,8 @@ export interface InboxDashboardProps {
5
5
  selectedAgents: string[];
6
6
  agentsData?: Agent[];
7
7
  agentsLoading?: boolean;
8
+ /** Reports whether this section still waits for data — used by the PDF export. */
9
+ onLoadingChange?: (loading: boolean) => void;
8
10
  }
9
- declare const InboxDashboard: ({ selectedChannel, selectedPeriod, selectedAgents, agentsData, agentsLoading, }: InboxDashboardProps) => import("@emotion/react/jsx-runtime").JSX.Element;
11
+ declare const InboxDashboard: ({ selectedChannel, selectedPeriod, selectedAgents, agentsData, agentsLoading, onLoadingChange, }: InboxDashboardProps) => import("@emotion/react/jsx-runtime").JSX.Element;
10
12
  export default InboxDashboard;
@@ -0,0 +1,31 @@
1
+ type Option = {
2
+ value: string;
3
+ text: string;
4
+ };
5
+ export type DashboardPdfMetaInput = {
6
+ reportPeriod: {
7
+ options: Option[];
8
+ selected: string;
9
+ };
10
+ broadcastPeriod: {
11
+ options: Option[];
12
+ selected: string;
13
+ };
14
+ channelOptions: Option[];
15
+ selectedChannel?: string;
16
+ agents: {
17
+ options: Option[];
18
+ selected: string[];
19
+ };
20
+ };
21
+ export type DashboardPdfMeta = {
22
+ title: string;
23
+ meta: {
24
+ label: string;
25
+ value: string;
26
+ }[];
27
+ filename: string;
28
+ };
29
+ /** Builds the localized header lines and the file name used by the dashboard PDF export. */
30
+ export declare function useDashboardPdfMeta({ reportPeriod, broadcastPeriod, channelOptions, selectedChannel, agents, }: DashboardPdfMetaInput): DashboardPdfMeta;
31
+ export default useDashboardPdfMeta;
@@ -0,0 +1,26 @@
1
+ import { RefObject } from 'react';
2
+ export type DashboardSectionKey = 'reports' | 'broadcast';
3
+ export type DashboardPdfExportPhase = 'loadingData' | 'renderingCharts' | 'generatingPdf';
4
+ export type DashboardPdfExportStatus = 'processing' | 'completed' | 'failed';
5
+ export type DashboardTabsPdfExportInput = {
6
+ targetRef: RefObject<HTMLElement>;
7
+ filename: string;
8
+ };
9
+ export type DashboardTabsPdfExport = {
10
+ exporting: boolean;
11
+ /** True while both dashboard tabs must stay mounted for the capture. */
12
+ renderAllSections: boolean;
13
+ setSectionLoading: (section: DashboardSectionKey, loading: boolean) => void;
14
+ exportAllSections: () => Promise<void>;
15
+ /** Progress percentage (0-100) for the export dialog. */
16
+ progress: number;
17
+ /** Which step of the export is running, for the dialog status text. */
18
+ phase: DashboardPdfExportPhase;
19
+ status: DashboardPdfExportStatus;
20
+ progressDialogOpen: boolean;
21
+ cancelExport: () => void;
22
+ closeProgressDialog: () => void;
23
+ };
24
+ /** Mounts every dashboard section, waits for its data, then exports the whole board as one PDF. */
25
+ export declare function useDashboardTabsPdfExport({ targetRef, filename }: DashboardTabsPdfExportInput): DashboardTabsPdfExport;
26
+ export default useDashboardTabsPdfExport;
@@ -1,6 +1,7 @@
1
1
  import { BroadcastReportFragment, Conversation } from '../../../graphql.autogenerated';
2
2
  import { CsvCell } from '../../../utils/exportCsv';
3
- export type DashboardExportReportKey = 'opened_chats' | 'conversation_analytics' | 'agent_performance' | 'tag_performance' | 'broadcast_recipients' | 'campaign_progress' | 'status_distribution';
3
+ import { LifecycleStageNode } from './lifecycleStages';
4
+ export type DashboardExportReportKey = 'opened_chats' | 'chats_by_lifecycle' | 'conversation_analytics' | 'agent_performance' | 'tag_performance' | 'broadcast_recipients' | 'campaign_progress' | 'status_distribution';
4
5
  export declare function dashboardExportFilename(reportKey: DashboardExportReportKey, startDate: string): string;
5
6
  /** Matches ticket examples: "21 sec", "4m 30s", "2h 05m". */
6
7
  export declare function formatExportDuration(seconds: number): string;
@@ -13,6 +14,18 @@ export interface OpenedChatsExportLabels {
13
14
  }
14
15
  export declare function buildOpenedChatsExportRows(conversations: Pick<Conversation, 'createdAt' | 'assigneeId'>[], startDate: string, endDate: string): CsvCell[][];
15
16
  export declare function exportOpenedChatsCsv(conversations: Pick<Conversation, 'createdAt' | 'assigneeId'>[], startDate: string, endDate: string, labels: OpenedChatsExportLabels): void;
17
+ export interface LifecycleStagesExportLabels {
18
+ date: string;
19
+ total: string;
20
+ /** Display name for each canonical stage key; the key is used when missing. */
21
+ stageNames: Record<string, string>;
22
+ }
23
+ /**
24
+ * One row per day with a column per stage and the day's total, then a totals row.
25
+ * Totals come from every report row, so the last row always matches the pie chart.
26
+ */
27
+ export declare function buildLifecycleStagesExportRows(nodes: LifecycleStageNode[], stages: string[], configuredStages: string[], startDate: string, endDate: string): CsvCell[][];
28
+ export declare function exportLifecycleStagesCsv(nodes: LifecycleStageNode[], stages: string[], configuredStages: string[], startDate: string, endDate: string, labels: LifecycleStagesExportLabels): void;
16
29
  export interface ConversationAnalyticsExportLabels {
17
30
  date: string;
18
31
  conversations: string;
@@ -27,6 +40,7 @@ export declare function exportConversationAnalyticsCsv(reportNodes: {
27
40
  }[], startDate: string, endDate: string, labels: ConversationAnalyticsExportLabels): void;
28
41
  export interface AgentPerformanceExportRow {
29
42
  agentName: string;
43
+ averageRating: number | null;
30
44
  conversationCount: number;
31
45
  newClientConvCount: number;
32
46
  agentMessagesCount: number;
@@ -36,6 +50,7 @@ export interface AgentPerformanceExportRow {
36
50
  }
37
51
  export interface AgentPerformanceExportLabels {
38
52
  agent: string;
53
+ rating: string;
39
54
  closed: string;
40
55
  uniqueClosed: string;
41
56
  messagesSent: string;
@@ -0,0 +1,19 @@
1
+ export interface ExportDashboardPdfOptions {
2
+ element: HTMLElement;
3
+ filename: string;
4
+ /** Checked between steps; when it returns true the export stops without downloading. */
5
+ isCancelled?: () => boolean;
6
+ }
7
+ export declare function prepareClone(doc: Document): void;
8
+ /** Walks up from the element to find the first non-transparent background color. */
9
+ export declare function resolveBackgroundColor(element: HTMLElement): string;
10
+ export interface PdfPageLayout {
11
+ contentWidthPt: number;
12
+ pxToPt: number;
13
+ pageHeightPx: number;
14
+ totalPages: number;
15
+ }
16
+ /** Maps a full-height capture onto A4 pages: how many pages, and how many source pixels each holds. */
17
+ export declare function calculatePdfPageLayout(canvasWidth: number, canvasHeight: number): PdfPageLayout;
18
+ /** Renders the given dashboard container into a paginated A4 PDF and downloads it. */
19
+ export declare function exportDashboardPdf({ element, filename, isCancelled }: ExportDashboardPdfOptions): Promise<void>;
@@ -0,0 +1,53 @@
1
+ /** Stage key for conversations that have no lifecycle stage. */
2
+ export declare const NOT_SET_STAGE = "notSet";
3
+ /**
4
+ * Main colors for lifecycle slices (light surface), assigned in this fixed order to stages 1–8.
5
+ * The order is what keeps neighbouring slices apart for colour-blind readers: it was checked
6
+ * with a palette validator for 2–8 slices, including the last-to-first pair a donut closes.
7
+ * Change the values or the order only after re-running that validation.
8
+ */
9
+ export declare const LIFECYCLE_STAGE_COLORS: readonly ["#2a78d6", "#eb6834", "#1baf7a", "#eda100", "#e87ba4", "#008300", "#4a3aa7", "#e34948"];
10
+ /**
11
+ * Extra main colors for stages 9–12. Each one stays clearly apart from every other main color
12
+ * (ΔE ≥ 15 for normal vision and ≥ 8 for colour-blind vision), not just from its neighbours.
13
+ * Light blue is faint on white (about 2:1), so the legend label carries it.
14
+ */
15
+ export declare const LIFECYCLE_STAGE_EXTRA_COLORS: readonly ["#92074c", "#82b5ef", "#ac4aa6", "#7706fd"];
16
+ /**
17
+ * Lighter or darker versions of main hues for stages 13–18. They keep neighbouring slices apart,
18
+ * but each sits close to one of the main colors, so these stages lean more on the legend labels.
19
+ */
20
+ export declare const LIFECYCLE_STAGE_VARIANT_COLORS: readonly ["#9f0117", "#a56f00", "#ab446e", "#52bc4c", "#a33902", "#01724d"];
21
+ /** Conversations without a stage read as "no data", so they get a neutral. */
22
+ export declare const NOT_SET_STAGE_COLOR = "#9da4ae";
23
+ /** Stages past the sequence (19 and up) share one darker neutral, so no series color ever means two stages. */
24
+ export declare const LIFECYCLE_OVERFLOW_COLOR = "#6c737f";
25
+ export interface LifecycleStageNode {
26
+ stage: string;
27
+ conversationCount: number;
28
+ createdAt: string;
29
+ }
30
+ export interface LifecycleStageTotal {
31
+ /** Canonical stage key: the configured stage name, the raw report name, or NOT_SET_STAGE. */
32
+ stage: string;
33
+ value: number;
34
+ color: string;
35
+ }
36
+ /**
37
+ * Maps a report stage name onto the workspace's configured spelling (case-insensitive),
38
+ * and folds blank or "notSet" values into NOT_SET_STAGE.
39
+ */
40
+ export declare function createStageResolver(configuredStages: string[]): (stage?: string | null) => string;
41
+ /**
42
+ * Orders every stage the chart may show: configured stages in workspace order, then stages the
43
+ * report returned that are no longer configured (alphabetically), then "not set".
44
+ * A stage's color comes from its position here, so it stays the same when filters hide other stages.
45
+ */
46
+ export declare function orderLifecycleStages(configuredStages: string[], reportedStages: Iterable<string>): string[];
47
+ /** Color for the stage at `index` of the ordered stage list. */
48
+ export declare function lifecycleStageColor(stage: string, index: number): string;
49
+ /**
50
+ * Sums conversations per stage across days and channels, in chart order.
51
+ * Stages with no conversations are left out; colors still follow each stage's position.
52
+ */
53
+ export declare function buildLifecycleStageTotals(nodes: LifecycleStageNode[], configuredStages: string[]): LifecycleStageTotal[];
@@ -14,3 +14,12 @@ export type FirstResponseReportSlice = {
14
14
  * Uses firstResponseConversationCount when present.
15
15
  */
16
16
  export declare function getFirstResponseWeightForReport(node: FirstResponseReportSlice): number;
17
+ /** Fields needed to weight averageRating when aggregating report rows. */
18
+ export type RatingReportSlice = {
19
+ conversationCount?: number | null;
20
+ responseRate?: number | null;
21
+ averageRating?: number | null;
22
+ };
23
+ /** Weighted average rating across report nodes; null when no rated conversations. */
24
+ export declare function aggregateAverageRating(reports: RatingReportSlice[]): number | null;
25
+ export declare function formatAgentRating(rating: number | null | undefined): string;
@@ -0,0 +1,15 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { SetupStepStatus } from '../types';
3
+ type ChecklistStepProps = {
4
+ index: number;
5
+ title: string;
6
+ status: SetupStepStatus;
7
+ optional?: boolean;
8
+ summary?: string | null;
9
+ expanded: boolean;
10
+ isLast: boolean;
11
+ onToggle: () => void;
12
+ children?: ReactNode;
13
+ };
14
+ declare const ChecklistStep: ({ index, title, status, optional, summary, expanded, isLast, onToggle, children, }: ChecklistStepProps) => import("@emotion/react/jsx-runtime").JSX.Element;
15
+ export default ChecklistStep;
@@ -0,0 +1,6 @@
1
+ type CreditBalanceCardProps = {
2
+ workspaceId: number;
3
+ remainingCredits: number | null;
4
+ };
5
+ declare const CreditBalanceCard: ({ workspaceId, remainingCredits }: CreditBalanceCardProps) => import("@emotion/react/jsx-runtime").JSX.Element;
6
+ export default CreditBalanceCard;
@@ -0,0 +1,5 @@
1
+ type MessageStatsProps = {
2
+ workspaceId: number;
3
+ };
4
+ declare const MessageStats: ({ workspaceId }: MessageStatsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
5
+ export default MessageStats;
@@ -0,0 +1,11 @@
1
+ import type { GatewaySetup } from '../hooks/useGatewaySetup';
2
+ type SetupChecklistProps = {
3
+ workspaceId: number;
4
+ setup: GatewaySetup;
5
+ apiKeyToken: string | null;
6
+ lastSentTo: string | null;
7
+ onApiKeyGenerated: (token: string) => void;
8
+ onGoToDashboard: () => void;
9
+ };
10
+ declare const SetupChecklist: (props: SetupChecklistProps) => import("@emotion/react/jsx-runtime").JSX.Element;
11
+ export default SetupChecklist;
@@ -0,0 +1,11 @@
1
+ import type { IntegrationFragment } from '../../../../graphql.autogenerated';
2
+ import type { RunResult } from '../../types';
3
+ type QuickstartConsoleProps = {
4
+ workspaceId: number;
5
+ apiKeyToken: string | null;
6
+ webhookUrl: string | null;
7
+ integrations: IntegrationFragment[];
8
+ onSent: (to: string, result: RunResult) => void;
9
+ };
10
+ declare const QuickstartConsole: ({ workspaceId, apiKeyToken, webhookUrl, integrations, onSent }: QuickstartConsoleProps) => import("@emotion/react/jsx-runtime").JSX.Element;
11
+ export default QuickstartConsole;
@@ -0,0 +1,15 @@
1
+ import type { RunResult } from '../../types';
2
+ type RunRequestBarProps = {
3
+ to: string;
4
+ onToChange: (value: string) => void;
5
+ /** Shown only when no key is known in this session (keys are revealed once). */
6
+ needsApiKey: boolean;
7
+ apiKeyInput: string;
8
+ onApiKeyInputChange: (value: string) => void;
9
+ disabledReason: string | null;
10
+ running: boolean;
11
+ result: RunResult | null;
12
+ onRun: () => void;
13
+ };
14
+ declare const RunRequestBar: (props: RunRequestBarProps) => import("@emotion/react/jsx-runtime").JSX.Element;
15
+ export default RunRequestBar;
@@ -0,0 +1,77 @@
1
+ /// <reference types="react" />
2
+ /** Dark "terminal" surface from the design, built on the --bc-dark / --bc-light-color tokens. */
3
+ export declare const ConsoleSurface: import("@emotion/styled").StyledComponent<{
4
+ theme?: import("@emotion/react").Theme | undefined;
5
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
6
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
7
+ export declare const ConsoleHeader: import("@emotion/styled").StyledComponent<{
8
+ theme?: import("@emotion/react").Theme | undefined;
9
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
10
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
11
+ export declare const ConsoleTitle: import("@emotion/styled").StyledComponent<{
12
+ theme?: import("@emotion/react").Theme | undefined;
13
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
14
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {}>;
15
+ export declare const Endpoint: import("@emotion/styled").StyledComponent<{
16
+ theme?: import("@emotion/react").Theme | undefined;
17
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
18
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
19
+ export declare const PillRow: import("@emotion/styled").StyledComponent<{
20
+ theme?: import("@emotion/react").Theme | undefined;
21
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
22
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
23
+ export declare const Pill: import("@emotion/styled").StyledComponent<{
24
+ theme?: import("@emotion/react").Theme | undefined;
25
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
26
+ } & {
27
+ active: boolean;
28
+ }, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
29
+ /** Code keeps left-to-right order in RTL (Arabic) layouts. */
30
+ export declare const CodePanel: import("@emotion/styled").StyledComponent<{
31
+ theme?: import("@emotion/react").Theme | undefined;
32
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
33
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
34
+ export declare const CodeTabs: import("@emotion/styled").StyledComponent<{
35
+ theme?: import("@emotion/react").Theme | undefined;
36
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
37
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
38
+ export declare const LangTab: import("@emotion/styled").StyledComponent<{
39
+ theme?: import("@emotion/react").Theme | undefined;
40
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
41
+ } & {
42
+ active: boolean;
43
+ }, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
44
+ export declare const Code: import("@emotion/styled").StyledComponent<{
45
+ theme?: import("@emotion/react").Theme | undefined;
46
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
47
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLPreElement>, HTMLPreElement>, {}>;
48
+ export declare const ConsoleNote: import("@emotion/styled").StyledComponent<{
49
+ theme?: import("@emotion/react").Theme | undefined;
50
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
51
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
52
+ export declare const ConsoleInput: import("@emotion/styled").StyledComponent<{
53
+ theme?: import("@emotion/react").Theme | undefined;
54
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
55
+ }, import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, {}>;
56
+ export declare const ConsoleSelect: import("@emotion/styled").StyledComponent<{
57
+ theme?: import("@emotion/react").Theme | undefined;
58
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
59
+ }, import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, {}>;
60
+ export declare const ResponseBox: import("@emotion/styled").StyledComponent<{
61
+ theme?: import("@emotion/react").Theme | undefined;
62
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
63
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
64
+ export declare const StatusText: import("@emotion/styled").StyledComponent<{
65
+ theme?: import("@emotion/react").Theme | undefined;
66
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
67
+ } & {
68
+ ok: boolean;
69
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
70
+ export declare const TabsEnd: import("@emotion/styled").StyledComponent<{
71
+ theme?: import("@emotion/react").Theme | undefined;
72
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
73
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
74
+ export declare const TemplateRow: import("@emotion/styled").StyledComponent<{
75
+ theme?: import("@emotion/react").Theme | undefined;
76
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
77
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,8 @@
1
+ type ApiKeyStepBodyProps = {
2
+ workspaceId: number;
3
+ token: string | null;
4
+ onGenerated: (token: string) => void;
5
+ onSaved: () => void;
6
+ };
7
+ declare const ApiKeyStepBody: ({ workspaceId, token, onGenerated, onSaved }: ApiKeyStepBodyProps) => import("@emotion/react/jsx-runtime").JSX.Element;
8
+ export default ApiKeyStepBody;
@@ -0,0 +1,3 @@
1
+ /** Channels are connected on the management page; the checklist refetches when the tab regains focus. */
2
+ declare const ChannelStepBody: () => import("@emotion/react/jsx-runtime").JSX.Element;
3
+ export default ChannelStepBody;
@@ -0,0 +1,6 @@
1
+ type MetaStepBodyProps = {
2
+ onDone: () => void;
3
+ onSkip: () => void;
4
+ };
5
+ declare const MetaStepBody: ({ onDone, onSkip }: MetaStepBodyProps) => import("@emotion/react/jsx-runtime").JSX.Element;
6
+ export default MetaStepBody;
@@ -0,0 +1,7 @@
1
+ type WebhookStepBodyProps = {
2
+ workspaceId: number;
3
+ onSaved: () => void;
4
+ onSkip: () => void;
5
+ };
6
+ declare const WebhookStepBody: ({ workspaceId, onSaved, onSkip }: WebhookStepBodyProps) => import("@emotion/react/jsx-runtime").JSX.Element;
7
+ export default WebhookStepBody;
@@ -0,0 +1,29 @@
1
+ /// <reference types="react" />
2
+ export declare const Muted: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
6
+ export declare const SmallMuted: import("@emotion/styled").StyledComponent<{
7
+ theme?: import("@emotion/react").Theme | undefined;
8
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
9
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
10
+ export declare const Badge: import("@emotion/styled").StyledComponent<{
11
+ theme?: import("@emotion/react").Theme | undefined;
12
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
13
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
14
+ export declare const ButtonRow: import("@emotion/styled").StyledComponent<{
15
+ theme?: import("@emotion/react").Theme | undefined;
16
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
17
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
18
+ export declare const TextInput: import("@emotion/styled").StyledComponent<{
19
+ theme?: import("@emotion/react").Theme | undefined;
20
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
21
+ }, import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, {}>;
22
+ export declare const MonoBox: import("@emotion/styled").StyledComponent<{
23
+ theme?: import("@emotion/react").Theme | undefined;
24
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
25
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
26
+ export declare const WarningText: import("@emotion/styled").StyledComponent<{
27
+ theme?: import("@emotion/react").Theme | undefined;
28
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
29
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -0,0 +1,22 @@
1
+ import { CreditPack } from '../../../graphql.billing.autogenerated';
2
+ import { IntegrationType } from '../../../graphql.autogenerated';
3
+ import type { ChannelKind, RequestKind, SnippetLang } from '../types';
4
+ export declare const MESSAGES_ENDPOINT: string;
5
+ export declare const META_PAYMENT_URL = "https://business.facebook.com/billing_hub/payment_settings";
6
+ export declare const API_KEY_PLACEHOLDER = "YOUR_API_KEY";
7
+ export declare const SAMPLE_TEXT = "Your order #1042 has shipped.";
8
+ export declare const SAMPLE_IMAGE_URL = "https://example.com/receipt.png";
9
+ export declare const REQUEST_KINDS: RequestKind[];
10
+ export declare const SNIPPET_LANGS: SnippetLang[];
11
+ export declare const CHANNELS: Array<{
12
+ kind: ChannelKind;
13
+ types: IntegrationType[];
14
+ }>;
15
+ /** Credit packs sold through Polar; mirrors CREDIT_PACKS in SubscriptionCreditsCard. */
16
+ export declare const CREDIT_PACKS: Array<{
17
+ pack: CreditPack;
18
+ usd: number;
19
+ credits: number;
20
+ }>;
21
+ export declare const DEFAULT_CREDIT_PACK: "CREDITS_20";
22
+ export declare const SETUP_STORAGE_KEY = "bc-gateway-home-setup";
@@ -0,0 +1,59 @@
1
+ import { IntegrationState } from '../../../graphql.autogenerated';
2
+ import { type LocalSetupChoices } from '../utils/setupStorage';
3
+ import type { SetupStepId, SetupStepStatus } from '../types';
4
+ /**
5
+ * Derives the Gateway checklist from live data:
6
+ * - channel / apiKey / webhook: the workspace has at least one of them
7
+ * - firstMessage: the credit wallet recorded at least one send attempt
8
+ * - meta / webhook skip: the user's choice, kept per workspace in the browser
9
+ * Setup counts as complete once an API key exists and a message was attempted.
10
+ */
11
+ export declare function useGatewaySetup(workspaceId: number): {
12
+ statuses: Record<SetupStepId, SetupStepStatus>;
13
+ nextStep: SetupStepId | null;
14
+ isComplete: boolean;
15
+ loaded: boolean;
16
+ creditWallet: {
17
+ __typename?: "CreditWalletView" | undefined;
18
+ workspaceId: number;
19
+ balanceMicroUsd: string;
20
+ pendingMicroUsd: string;
21
+ remainingMicroUsd: string;
22
+ remainingCredits: number;
23
+ remainingMessages: number;
24
+ lifetimePurchasedMicroUsd: string;
25
+ lifetimeUsedMicroUsd: string;
26
+ lifetimeAttemptCount: string;
27
+ pendingAttempts: string;
28
+ usedAttempts: string;
29
+ usedMicroUsd: string;
30
+ usedCredits: number;
31
+ } | null;
32
+ webhookUrl: string;
33
+ integrations: {
34
+ __typename?: "Integration" | undefined;
35
+ workspaceId: number;
36
+ id: string;
37
+ name: string;
38
+ identifier?: string | null | undefined;
39
+ type: import("../../../graphql.autogenerated").IntegrationType;
40
+ properties?: any;
41
+ state: IntegrationState;
42
+ createdAt: any;
43
+ deletedAt?: any;
44
+ patchedAt?: any;
45
+ callingEnabled?: boolean | null | undefined;
46
+ }[];
47
+ setChoice: (step: keyof LocalSetupChoices, status: SetupStepStatus) => void;
48
+ markDone: (step: SetupStepId) => void;
49
+ refetchApiKeys: (variables?: Partial<import("../../../graphql.autogenerated").Exact<{
50
+ input: import("../../../graphql.autogenerated").ApiKeysInput;
51
+ }>> | undefined) => Promise<import("@apollo/client").ApolloQueryResult<import("../../../graphql.autogenerated").ApiKeysQuery>>;
52
+ refetchWebhooks: (variables?: Partial<import("../../../graphql.autogenerated").Exact<{
53
+ input: import("../../../graphql.autogenerated").WebhooksInput;
54
+ }>> | undefined) => Promise<import("@apollo/client").ApolloQueryResult<import("../../../graphql.autogenerated").WebhooksQuery>>;
55
+ refetchWallet: (variables?: Partial<import("../../../graphql.billing.autogenerated").Exact<{
56
+ input: import("../../../graphql.billing.autogenerated").CreditWalletInput;
57
+ }>> | undefined) => Promise<import("@apollo/client").ApolloQueryResult<import("../../../graphql.billing.autogenerated").CreditWalletQuery>>;
58
+ };
59
+ export type GatewaySetup = ReturnType<typeof useGatewaySetup>;
@@ -0,0 +1,17 @@
1
+ export type DailyMessageCount = {
2
+ /** UTC midnight of the day. */
3
+ date: Date;
4
+ count: number;
5
+ };
6
+ /**
7
+ * Messages in the last 30 days, delivery rate, and a per-day series for the last 14 days.
8
+ * Days are UTC. Past days come from the hourly report (up to the end of yesterday) and
9
+ * today comes from the live `messageReportToday` query, so no hour is counted twice.
10
+ */
11
+ export declare function useMessageStats(workspaceId: number): {
12
+ loading: boolean;
13
+ totalMessages: number;
14
+ /** 0..1, or null when no outgoing message has a status yet. */
15
+ deliveredRate: number | null;
16
+ daily: DailyMessageCount[];
17
+ };
@@ -0,0 +1,31 @@
1
+ /// <reference types="react" />
2
+ import type { IntegrationFragment } from '../../../graphql.autogenerated';
3
+ import type { ChannelKind, RequestKind, RunResult } from '../types';
4
+ type QuickstartOptions = {
5
+ workspaceId: number;
6
+ apiKeyToken: string | null;
7
+ integrations: IntegrationFragment[];
8
+ onSent: (to: string, result: RunResult) => void;
9
+ };
10
+ /** State and actions behind the Quickstart console: what to send, where, and running it. */
11
+ export declare function useQuickstartRequest({ workspaceId, apiKeyToken, integrations, onSent }: QuickstartOptions): {
12
+ kind: RequestKind;
13
+ setKind: import("react").Dispatch<import("react").SetStateAction<RequestKind>>;
14
+ channel: ChannelKind;
15
+ setChannel: import("react").Dispatch<import("react").SetStateAction<ChannelKind>>;
16
+ availableChannels: Partial<Record<ChannelKind, IntegrationFragment>>;
17
+ templates: import("../types").TemplateOption[];
18
+ template: import("../types").TemplateOption;
19
+ setTemplateName: import("react").Dispatch<import("react").SetStateAction<string>>;
20
+ to: string;
21
+ setTo: import("react").Dispatch<import("react").SetStateAction<string>>;
22
+ apiKeyInput: string;
23
+ setApiKeyInput: import("react").Dispatch<import("react").SetStateAction<string>>;
24
+ needsApiKey: boolean;
25
+ body: Record<string, unknown> | null;
26
+ disabledReason: string | null;
27
+ running: boolean;
28
+ result: RunResult | null;
29
+ run: () => Promise<void>;
30
+ };
31
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { TemplateOption } from '../types';
2
+ /**
3
+ * Approved WhatsApp templates that need no parameters, so the console can send them as-is.
4
+ * The list query has no components, so each template's details are fetched (and cached by Apollo).
5
+ */
6
+ export declare function useSendableTemplates(workspaceId: number, integrationId?: string): {
7
+ templates: TemplateOption[];
8
+ loading: boolean;
9
+ };
@@ -0,0 +1 @@
1
+ export default function GatewayHomePage(): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ export type RequestKind = 'text' | 'template' | 'image' | 'webhook';
2
+ export type ChannelKind = 'whatsapp' | 'instagram' | 'facebook' | 'telegram';
3
+ export type SnippetLang = 'cURL' | 'Node.js' | 'Python' | 'PHP' | 'Java' | 'C#' | 'Go';
4
+ export type SetupStepId = 'channel' | 'apiKey' | 'webhook' | 'meta' | 'firstMessage';
5
+ export type SetupStepStatus = 'pending' | 'done' | 'skipped';
6
+ export type TemplateOption = {
7
+ name: string;
8
+ language: string;
9
+ };
10
+ export type MessageRequestInput = {
11
+ workspaceId: number;
12
+ integrationId?: string;
13
+ to: string;
14
+ kind: Exclude<RequestKind, 'webhook'>;
15
+ template?: TemplateOption;
16
+ };
17
+ export type RunResult = {
18
+ status: number;
19
+ ok: boolean;
20
+ body: string;
21
+ };
@@ -0,0 +1,7 @@
1
+ import type { MessageRequestInput } from '../types';
2
+ /** Keeps digits only: the REST API expects the number without "+" or spaces. */
3
+ export declare function normalizePhone(value: string): string;
4
+ /** Body for POST /core/v1/messages — mirrors SendMessageRequestDto in core. */
5
+ export declare function buildRequestBody(input: MessageRequestInput): Record<string, unknown>;
6
+ /** Sample INCOMING_MESSAGE payload as documented in bc-api-docs (apis/webhooks). */
7
+ export declare function buildWebhookPayload(workspaceId: number, to: string): Record<string, unknown>;