@consilioweb/payload-support 1.1.1 → 2.0.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 (110) hide show
  1. package/README.md +74 -3
  2. package/dist/components/TicketConversation/components/AISummaryPanel.cjs +22 -14
  3. package/dist/components/TicketConversation/components/AISummaryPanel.js +23 -16
  4. package/dist/components/TicketConversation/components/ActionPanels.cjs +5 -5
  5. package/dist/components/TicketConversation/components/ActionPanels.js +5 -5
  6. package/dist/components/TicketConversation/components/ClientBar.cjs +1 -1
  7. package/dist/components/TicketConversation/components/ClientBar.js +1 -1
  8. package/dist/components/TicketConversation/components/QuickActions.cjs +2 -2
  9. package/dist/components/TicketConversation/components/QuickActions.js +2 -2
  10. package/dist/components/TicketConversation/components/TicketHeader.cjs +1 -1
  11. package/dist/components/TicketConversation/components/TicketHeader.js +1 -1
  12. package/dist/components/TicketConversation/hooks/useTranslation.cjs +25 -2
  13. package/dist/components/TicketConversation/hooks/useTranslation.js +22 -3
  14. package/dist/components/TicketConversation/index.cjs +10 -10
  15. package/dist/components/TicketConversation/index.js +10 -10
  16. package/dist/index.cjs +709 -173
  17. package/dist/index.d.cts +165 -3
  18. package/dist/index.d.ts +165 -3
  19. package/dist/index.js +702 -175
  20. package/dist/styles/ChatView.module.scss +1 -1
  21. package/dist/styles/TicketDetail.module.scss +3 -3
  22. package/dist/styles/_tokens.scss +1 -1
  23. package/dist/styles/theme.css +6 -6
  24. package/dist/views/SupportDashboardView/client.cjs +1 -1
  25. package/dist/views/SupportDashboardView/client.js +1 -1
  26. package/dist/views/TicketingSettingsView/client.cjs +4 -4
  27. package/dist/views/TicketingSettingsView/client.js +4 -4
  28. package/dist/views/shared/locales/en.json +708 -0
  29. package/dist/views/shared/locales/fr.json +708 -0
  30. package/package.json +19 -19
  31. package/src/__tests__/aiSummaryRendering.test.ts +21 -0
  32. package/src/__tests__/authResponses.test.ts +69 -0
  33. package/src/__tests__/capabilities.test.ts +71 -0
  34. package/src/__tests__/generateTrackingToken.test.ts +18 -4
  35. package/src/__tests__/integration/core-behaviors.test.ts +23 -0
  36. package/src/__tests__/rateLimiter.test.ts +60 -66
  37. package/src/__tests__/trackOpenEndpoint.test.ts +54 -0
  38. package/src/__tests__/translations.test.ts +67 -0
  39. package/src/__tests__/webhookSecurity.test.ts +58 -0
  40. package/src/collections/PendingEmails.ts +2 -1
  41. package/src/collections/SupportClients.ts +43 -1
  42. package/src/collections/SupportCounters.ts +14 -0
  43. package/src/collections/SupportRateLimits.ts +20 -0
  44. package/src/collections/TicketMessages.ts +76 -0
  45. package/src/collections/Tickets.ts +179 -39
  46. package/src/collections/index.ts +2 -0
  47. package/src/components/TicketConversation/components/AISummaryPanel.tsx +26 -13
  48. package/src/components/TicketConversation/components/ActionPanels.tsx +5 -5
  49. package/src/components/TicketConversation/components/ClientBar.tsx +1 -1
  50. package/src/components/TicketConversation/components/QuickActions.tsx +2 -2
  51. package/src/components/TicketConversation/components/TicketHeader.tsx +1 -1
  52. package/src/components/TicketConversation/hooks/useTranslation.ts +38 -4
  53. package/src/components/TicketConversation/index.tsx +10 -10
  54. package/src/endpoints/admin-chat.ts +4 -4
  55. package/src/endpoints/ai-agent.ts +6 -1
  56. package/src/endpoints/ai.ts +10 -5
  57. package/src/endpoints/auth-2fa.ts +6 -7
  58. package/src/endpoints/auto-close.ts +2 -1
  59. package/src/endpoints/capabilities.ts +144 -0
  60. package/src/endpoints/channels.ts +2 -1
  61. package/src/endpoints/chat.ts +6 -6
  62. package/src/endpoints/chatbot.ts +4 -4
  63. package/src/endpoints/client-intelligence.ts +13 -4
  64. package/src/endpoints/import-conversation.ts +6 -5
  65. package/src/endpoints/index.ts +35 -14
  66. package/src/endpoints/invite-collaborator.ts +4 -4
  67. package/src/endpoints/login.ts +4 -5
  68. package/src/endpoints/oauth-google.ts +1 -1
  69. package/src/endpoints/process-digests.ts +2 -1
  70. package/src/endpoints/process-scheduled.ts +2 -1
  71. package/src/endpoints/process-snooze.ts +2 -1
  72. package/src/endpoints/resend-notification.ts +4 -4
  73. package/src/endpoints/send-reminder.ts +4 -4
  74. package/src/endpoints/ticket-synthesis.ts +17 -2
  75. package/src/endpoints/track-open.ts +44 -21
  76. package/src/endpoints/transfer-ticket.ts +4 -4
  77. package/src/index.ts +7 -0
  78. package/src/plugin.ts +16 -1
  79. package/src/portal/LiveChat.tsx +1 -1
  80. package/src/portal/auth/ChatWidget.tsx +4 -4
  81. package/src/portal/auth/ChatbotWidget.tsx +4 -4
  82. package/src/portal/auth/dashboard/DashboardClient.tsx +2 -2
  83. package/src/portal/auth/faq/FAQSearch.tsx +1 -1
  84. package/src/portal/auth/faq/page.tsx +2 -2
  85. package/src/portal/auth/profile/page.tsx +17 -17
  86. package/src/portal/auth/tickets/detail/CloseTicketButton.tsx +1 -1
  87. package/src/portal/auth/tickets/detail/MarkSolutionButton.tsx +1 -1
  88. package/src/portal/auth/tickets/detail/ReopenTicketButton.tsx +1 -1
  89. package/src/portal/auth/tickets/detail/SatisfactionForm.tsx +3 -3
  90. package/src/portal/auth/tickets/detail/TicketReplyForm.tsx +3 -3
  91. package/src/portal/auth/tickets/detail/page.tsx +5 -5
  92. package/src/portal/auth/tickets/new/page.tsx +8 -8
  93. package/src/portal/forgot-password/page.tsx +3 -3
  94. package/src/portal/layout.tsx +5 -2
  95. package/src/portal/login/page.tsx +7 -7
  96. package/src/portal/page.tsx +9 -9
  97. package/src/portal/register/page.tsx +4 -4
  98. package/src/portal/reset-password/page.tsx +3 -3
  99. package/src/styles/ChatView.module.scss +1 -1
  100. package/src/styles/TicketDetail.module.scss +3 -3
  101. package/src/styles/_tokens.scss +1 -1
  102. package/src/styles/theme.css +6 -6
  103. package/src/types.ts +71 -0
  104. package/src/utils/rateLimiter.ts +131 -38
  105. package/src/utils/slugs.ts +4 -0
  106. package/src/utils/webhookSecurity.ts +81 -0
  107. package/src/views/SupportDashboardView/client.tsx +1 -1
  108. package/src/views/TicketingSettingsView/client.tsx +4 -4
  109. package/src/views/shared/locales/en.json +2 -2
  110. package/src/views/shared/locales/fr.json +2 -2
@@ -37,7 +37,7 @@ $font-stack: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', system-ui,
37
37
  .container {
38
38
  display: flex;
39
39
  gap: 16px;
40
- height: calc(100vh - 220px);
40
+ height: calc(100dvh - 220px);
41
41
  min-height: 500px;
42
42
  }
43
43
 
@@ -531,7 +531,7 @@
531
531
  gap: 8px;
532
532
  padding: 8px 14px;
533
533
  font-size: 12px;
534
- color: #7c3aed;
534
+ color: #17807c;
535
535
  font-weight: 500;
536
536
  }
537
537
 
@@ -539,7 +539,7 @@
539
539
  display: flex;
540
540
  gap: 3px;
541
541
  span {
542
- width: 5px; height: 5px; border-radius: 50%; background: #7c3aed;
542
+ width: 5px; height: 5px; border-radius: 50%; background: #17807c;
543
543
  animation: bounce 1.2s infinite;
544
544
  &:nth-child(2) { animation-delay: 150ms; }
545
545
  &:nth-child(3) { animation-delay: 300ms; }
@@ -612,7 +612,7 @@
612
612
  &:disabled { opacity: 0.4; cursor: not-allowed; }
613
613
  }
614
614
 
615
- // Bouton IA — accent purple, pill style
615
+ // AI buttonteal accent, pill style
616
616
  .toolbarBtnAi {
617
617
  background: var(--theme-accent-50, color-mix(in srgb, var(--theme-accent-500, #6b46e8) 10%, transparent));
618
618
  border-color: color-mix(in srgb, var(--theme-accent-500, #6b46e8) 25%, transparent);
@@ -18,7 +18,7 @@ $green: #16a34a;
18
18
  $amber: #d97706;
19
19
  $orange: #ea580c;
20
20
  $red: #dc2626;
21
- $purple: #7c3aed;
21
+ $teal: #17807c;
22
22
  $cyan: #0891b2;
23
23
 
24
24
  // Mixins
@@ -136,7 +136,7 @@
136
136
  --support-cat-core: #2563eb;
137
137
  --support-cat-communication: #16a34a;
138
138
  --support-cat-productivity: #d97706;
139
- --support-cat-advanced: #7c3aed;
139
+ --support-cat-advanced: #17807c;
140
140
 
141
141
  /* ------------------------------------------
142
142
  * 8. PROJECT STATUS COLORS
@@ -385,7 +385,7 @@
385
385
  --support-activity-line-color: var(--support-border-color);
386
386
  --support-activity-dot-default: var(--support-text-muted);
387
387
  --support-activity-dot-status: var(--support-primary);
388
- --support-activity-dot-assign: #7c3aed;
388
+ --support-activity-dot-assign: #17807c;
389
389
  --support-activity-dot-merge: #0891b2;
390
390
 
391
391
  /* ------------------------------------------
@@ -465,10 +465,10 @@
465
465
  * Indicator for messages scheduled to be
466
466
  * sent at a future date/time.
467
467
  * ------------------------------------------ */
468
- --support-scheduled-bg: #f5f3ff;
468
+ --support-scheduled-bg: #eef8f7;
469
469
  --support-scheduled-border: #a78bfa;
470
470
  --support-scheduled-text: #5b21b6;
471
- --support-scheduled-icon: #7c3aed;
471
+ --support-scheduled-icon: #17807c;
472
472
 
473
473
  /* ------------------------------------------
474
474
  * 34. EMAIL TRACKING
@@ -615,8 +615,8 @@
615
615
 
616
616
  /* Scheduled */
617
617
  --support-scheduled-bg: #2e1065;
618
- --support-scheduled-border: #7c3aed;
619
- --support-scheduled-text: #c4b5fd;
618
+ --support-scheduled-border: #17807c;
619
+ --support-scheduled-text: #80bbb7;
620
620
 
621
621
  /* Email tracking */
622
622
  --support-email-pending: #64748b;
@@ -406,7 +406,7 @@ const SupportDashboardClient = () => {
406
406
  /* @__PURE__ */ jsxRuntime.jsx(VolumeChart, { data: volumeData })
407
407
  ] }),
408
408
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles__default.default.panel, children: [
409
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: styles__default.default.panelTitle, children: t("dashboard.csat") }),
409
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: styles__default.default.panelTitle, children: t("dashboard.csatTitle") }),
410
410
  /* @__PURE__ */ jsxRuntime.jsx(CSATRing, { score: stats.satisfactionAvg, count: stats.satisfactionCount })
411
411
  ] })
412
412
  ] })
@@ -400,7 +400,7 @@ const SupportDashboardClient = () => {
400
400
  /* @__PURE__ */ jsx(VolumeChart, { data: volumeData })
401
401
  ] }),
402
402
  /* @__PURE__ */ jsxs("div", { className: styles.panel, children: [
403
- /* @__PURE__ */ jsx("h2", { className: styles.panelTitle, children: t("dashboard.csat") }),
403
+ /* @__PURE__ */ jsx("h2", { className: styles.panelTitle, children: t("dashboard.csatTitle") }),
404
404
  /* @__PURE__ */ jsx(CSATRing, { score: stats.satisfactionAvg, count: stats.satisfactionCount })
405
405
  ] })
406
406
  ] })
@@ -129,7 +129,7 @@ function getCategories(t) {
129
129
  { key: "core", label: t("settingsView.categories.core"), color: adminTokens.V.blue },
130
130
  { key: "communication", label: t("settingsView.categories.communication"), color: adminTokens.V.green },
131
131
  { key: "productivity", label: t("settingsView.categories.productivity"), color: adminTokens.V.amber },
132
- { key: "advanced", label: t("settingsView.categories.advanced"), color: "#7c3aed" }
132
+ { key: "advanced", label: t("settingsView.categories.advanced"), color: "#17807c" }
133
133
  ];
134
134
  }
135
135
  const Toggle = ({ checked, onChange, color = adminTokens.V.blue, size = "md" }) => {
@@ -305,7 +305,7 @@ const TicketingSettingsClient = () => {
305
305
  /* @__PURE__ */ jsxRuntime.jsxs(
306
306
  CollapsibleSection,
307
307
  {
308
- title: t("settingsView.features"),
308
+ title: t("settingsView.featuresTitle"),
309
309
  icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, { size: 16 }),
310
310
  color: adminTokens.V.blue,
311
311
  badge: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: ts__default.default.badge, style: { backgroundColor: "#dbeafe", color: "#1e40af" }, children: [
@@ -421,7 +421,7 @@ const TicketingSettingsClient = () => {
421
421
  {
422
422
  title: t("settingsView.aiTitle"),
423
423
  icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bot, { size: 16 }),
424
- color: "#7c3aed",
424
+ color: "#17807c",
425
425
  defaultOpen: false,
426
426
  badge: features.ai ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: ts__default.default.badge, style: { backgroundColor: "#dcfce7", color: "#166534" }, children: t("settingsView.aiBadgeActive") }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: ts__default.default.badge, style: { backgroundColor: "#fee2e2", color: "#991b1b" }, children: t("settingsView.aiBadgeInactive") }),
427
427
  children: [
@@ -484,7 +484,7 @@ const TicketingSettingsClient = () => {
484
484
  {
485
485
  checked: settings.ai[item.key],
486
486
  onChange: () => updateAI(item.key, !settings.ai[item.key]),
487
- color: "#7c3aed",
487
+ color: "#17807c",
488
488
  size: "sm"
489
489
  }
490
490
  ),
@@ -123,7 +123,7 @@ function getCategories(t) {
123
123
  { key: "core", label: t("settingsView.categories.core"), color: V.blue },
124
124
  { key: "communication", label: t("settingsView.categories.communication"), color: V.green },
125
125
  { key: "productivity", label: t("settingsView.categories.productivity"), color: V.amber },
126
- { key: "advanced", label: t("settingsView.categories.advanced"), color: "#7c3aed" }
126
+ { key: "advanced", label: t("settingsView.categories.advanced"), color: "#17807c" }
127
127
  ];
128
128
  }
129
129
  const Toggle = ({ checked, onChange, color = V.blue, size = "md" }) => {
@@ -299,7 +299,7 @@ const TicketingSettingsClient = () => {
299
299
  /* @__PURE__ */ jsxs(
300
300
  CollapsibleSection,
301
301
  {
302
- title: t("settingsView.features"),
302
+ title: t("settingsView.featuresTitle"),
303
303
  icon: /* @__PURE__ */ jsx(Settings, { size: 16 }),
304
304
  color: V.blue,
305
305
  badge: /* @__PURE__ */ jsxs("span", { className: ts.badge, style: { backgroundColor: "#dbeafe", color: "#1e40af" }, children: [
@@ -415,7 +415,7 @@ const TicketingSettingsClient = () => {
415
415
  {
416
416
  title: t("settingsView.aiTitle"),
417
417
  icon: /* @__PURE__ */ jsx(Bot, { size: 16 }),
418
- color: "#7c3aed",
418
+ color: "#17807c",
419
419
  defaultOpen: false,
420
420
  badge: features.ai ? /* @__PURE__ */ jsx("span", { className: ts.badge, style: { backgroundColor: "#dcfce7", color: "#166534" }, children: t("settingsView.aiBadgeActive") }) : /* @__PURE__ */ jsx("span", { className: ts.badge, style: { backgroundColor: "#fee2e2", color: "#991b1b" }, children: t("settingsView.aiBadgeInactive") }),
421
421
  children: [
@@ -478,7 +478,7 @@ const TicketingSettingsClient = () => {
478
478
  {
479
479
  checked: settings.ai[item.key],
480
480
  onChange: () => updateAI(item.key, !settings.ai[item.key]),
481
- color: "#7c3aed",
481
+ color: "#17807c",
482
482
  size: "sm"
483
483
  }
484
484
  ),