@redacto.io/consent-sdk-react 10.0.0-beta.1 → 10.0.0-beta.12

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 (258) hide show
  1. package/NOTICE.md +17 -0
  2. package/README.md +145 -3
  3. package/dist/chunk-FEGTW73Q.mjs +182 -0
  4. package/dist/{chunk-6A665OPR.mjs → chunk-OGL6OC3A.mjs} +4 -0
  5. package/dist/fonts.d.mts +35 -0
  6. package/dist/fonts.d.ts +35 -0
  7. package/dist/fonts.js +183 -0
  8. package/dist/fonts.mjs +10 -0
  9. package/dist/index.d.mts +44 -5
  10. package/dist/index.d.ts +44 -5
  11. package/dist/index.js +950 -476
  12. package/dist/index.mjs +572 -314
  13. package/dist/montserrat.generated-NBTECYRW.mjs +22 -0
  14. package/dist/privacy-center.d.mts +55 -12
  15. package/dist/privacy-center.d.ts +55 -12
  16. package/dist/privacy-center.js +848 -950
  17. package/dist/privacy-center.mjs +698 -802
  18. package/dist/types-6Aj7faxL.d.mts +57 -0
  19. package/dist/types-6Aj7faxL.d.ts +57 -0
  20. package/package.json +10 -1
  21. package/.turbo/turbo-build.log +0 -22
  22. package/.turbo/turbo-test.log +0 -203
  23. package/.turbo/turbo-verify-pack.log +0 -6
  24. package/CHANGELOG.md +0 -274
  25. package/src/RedactoNoticeAssisted/RedactoNoticeAssisted.test.tsx +0 -847
  26. package/src/RedactoNoticeAssisted/RedactoNoticeAssisted.tsx +0 -2133
  27. package/src/RedactoNoticeAssisted/api/index.ts +0 -269
  28. package/src/RedactoNoticeAssisted/api/types.ts +0 -180
  29. package/src/RedactoNoticeAssisted/assets/redacto-logo.png +0 -0
  30. package/src/RedactoNoticeAssisted/constants.ts +0 -51
  31. package/src/RedactoNoticeAssisted/i18n.ts +0 -1463
  32. package/src/RedactoNoticeAssisted/index.ts +0 -1
  33. package/src/RedactoNoticeAssisted/injectStyles.ts +0 -251
  34. package/src/RedactoNoticeAssisted/styles.ts +0 -730
  35. package/src/RedactoNoticeAssisted/types.ts +0 -24
  36. package/src/RedactoNoticeAssisted/useMediaQuery.ts +0 -36
  37. package/src/RedactoNoticeConsent/RedactoNoticeConsent.test.tsx +0 -1152
  38. package/src/RedactoNoticeConsent/RedactoNoticeConsent.tsx +0 -4258
  39. package/src/RedactoNoticeConsent/api/index.ts +0 -573
  40. package/src/RedactoNoticeConsent/api/types.ts +0 -490
  41. package/src/RedactoNoticeConsent/assets/redacto-logo.png +0 -0
  42. package/src/RedactoNoticeConsent/components/DigiLockerCallback.tsx +0 -602
  43. package/src/RedactoNoticeConsent/components/index.ts +0 -7
  44. package/src/RedactoNoticeConsent/constants.ts +0 -20
  45. package/src/RedactoNoticeConsent/index.ts +0 -1
  46. package/src/RedactoNoticeConsent/injectStyles.ts +0 -151
  47. package/src/RedactoNoticeConsent/language-codes.ts +0 -97
  48. package/src/RedactoNoticeConsent/services/storage.ts +0 -122
  49. package/src/RedactoNoticeConsent/styles.ts +0 -409
  50. package/src/RedactoNoticeConsent/types.ts +0 -54
  51. package/src/RedactoNoticeConsent/useMediaQuery.ts +0 -36
  52. package/src/RedactoNoticeConsentInline/RedactoNoticeConsentInline.test.tsx +0 -369
  53. package/src/RedactoNoticeConsentInline/RedactoNoticeConsentInline.tsx +0 -629
  54. package/src/RedactoNoticeConsentInline/api/index.ts +0 -106
  55. package/src/RedactoNoticeConsentInline/api/types.ts +0 -183
  56. package/src/RedactoNoticeConsentInline/assets/redacto-logo.png +0 -0
  57. package/src/RedactoNoticeConsentInline/index.ts +0 -1
  58. package/src/RedactoNoticeConsentInline/injectStyles.ts +0 -40
  59. package/src/RedactoNoticeConsentInline/styles.ts +0 -397
  60. package/src/RedactoNoticeConsentInline/types.ts +0 -51
  61. package/src/RedactoNoticeConsentInline/useMediaQuery.ts +0 -36
  62. package/src/RedactoPrivacyCenter/NotificationsPage.tsx +0 -182
  63. package/src/RedactoPrivacyCenter/PrivacyCenterActivityPage.tsx +0 -19
  64. package/src/RedactoPrivacyCenter/PrivacyCenterCaseDetailsPage.tsx +0 -156
  65. package/src/RedactoPrivacyCenter/PrivacyCenterConsentManagerPage.tsx +0 -17
  66. package/src/RedactoPrivacyCenter/PrivacyCenterFormPage.tsx +0 -79
  67. package/src/RedactoPrivacyCenter/PrivacyCenterHomePage.tsx +0 -36
  68. package/src/RedactoPrivacyCenter/PrivacyCenterLayout.tsx +0 -177
  69. package/src/RedactoPrivacyCenter/PrivacyCenterMyReceiptPage.tsx +0 -26
  70. package/src/RedactoPrivacyCenter/RedactoPrivacyCenter.tsx +0 -58
  71. package/src/RedactoPrivacyCenter/api/actions.ts +0 -680
  72. package/src/RedactoPrivacyCenter/api/client.ts +0 -906
  73. package/src/RedactoPrivacyCenter/api/config.ts +0 -33
  74. package/src/RedactoPrivacyCenter/api/fetcher.ts +0 -260
  75. package/src/RedactoPrivacyCenter/api/orgBranding.ts +0 -16
  76. package/src/RedactoPrivacyCenter/api/upload.ts +0 -93
  77. package/src/RedactoPrivacyCenter/assets/character.svg +0 -31
  78. package/src/RedactoPrivacyCenter/assets/fileAttach.svg +0 -9
  79. package/src/RedactoPrivacyCenter/assets/greenTick.svg +0 -4
  80. package/src/RedactoPrivacyCenter/assets/mail.svg +0 -3
  81. package/src/RedactoPrivacyCenter/assets/poweredByRedacto.svg +0 -9
  82. package/src/RedactoPrivacyCenter/assets/sentImg.svg +0 -9
  83. package/src/RedactoPrivacyCenter/assets/uploadFileIcon.svg +0 -9
  84. package/src/RedactoPrivacyCenter/components/ActivitiesList.tsx +0 -252
  85. package/src/RedactoPrivacyCenter/components/ActivityTimeline.tsx +0 -239
  86. package/src/RedactoPrivacyCenter/components/AppShell/AppShell.tsx +0 -240
  87. package/src/RedactoPrivacyCenter/components/AppShell/MobileNavDrawer.tsx +0 -218
  88. package/src/RedactoPrivacyCenter/components/AppShell/NavItem.tsx +0 -205
  89. package/src/RedactoPrivacyCenter/components/AppShell/PageHeader.tsx +0 -107
  90. package/src/RedactoPrivacyCenter/components/AppShell/SidebarNav.tsx +0 -100
  91. package/src/RedactoPrivacyCenter/components/AppShell/TopAppBar.tsx +0 -339
  92. package/src/RedactoPrivacyCenter/components/AppShell/UserMenu.tsx +0 -243
  93. package/src/RedactoPrivacyCenter/components/AppShell/hooks/useIsTruncated.ts +0 -28
  94. package/src/RedactoPrivacyCenter/components/AppShell/hooks/useKeyboardShortcut.ts +0 -40
  95. package/src/RedactoPrivacyCenter/components/AppShell/hooks/useSidebarState.ts +0 -62
  96. package/src/RedactoPrivacyCenter/components/AppShell/usePrivacyCenterExitAction.ts +0 -36
  97. package/src/RedactoPrivacyCenter/components/CaseDetails/AttachmentCard.tsx +0 -38
  98. package/src/RedactoPrivacyCenter/components/CaseDetails/ChatBubble.tsx +0 -31
  99. package/src/RedactoPrivacyCenter/components/CaseDetails/DocumentRequestCard.tsx +0 -79
  100. package/src/RedactoPrivacyCenter/components/CaseDetails/FinalizedTooltipWrapper.tsx +0 -25
  101. package/src/RedactoPrivacyCenter/components/CaseDetails/MessageComposer.tsx +0 -96
  102. package/src/RedactoPrivacyCenter/components/CaseDetails/MessageItem.tsx +0 -97
  103. package/src/RedactoPrivacyCenter/components/CaseDetails/MessagesTab.tsx +0 -156
  104. package/src/RedactoPrivacyCenter/components/CaseDetails/RequestDetailsTab.tsx +0 -171
  105. package/src/RedactoPrivacyCenter/components/CaseDetails/StatusEvent.tsx +0 -23
  106. package/src/RedactoPrivacyCenter/components/CaseDetails/useFileUpload.ts +0 -116
  107. package/src/RedactoPrivacyCenter/components/CaseDetails/useMessagePolling.ts +0 -43
  108. package/src/RedactoPrivacyCenter/components/CaseDetails/utils.ts +0 -71
  109. package/src/RedactoPrivacyCenter/components/CaseDetailsModal.tsx +0 -469
  110. package/src/RedactoPrivacyCenter/components/CaseHistory.tsx +0 -426
  111. package/src/RedactoPrivacyCenter/components/ConsentManager.tsx +0 -1198
  112. package/src/RedactoPrivacyCenter/components/ConsentManagerCells.tsx +0 -201
  113. package/src/RedactoPrivacyCenter/components/ConsentManagerColumns.tsx +0 -138
  114. package/src/RedactoPrivacyCenter/components/ConsentManagerConstants.ts +0 -7
  115. package/src/RedactoPrivacyCenter/components/ConsentManagerExpandedRow.tsx +0 -179
  116. package/src/RedactoPrivacyCenter/components/ConsentManagerGroupedColumns.tsx +0 -318
  117. package/src/RedactoPrivacyCenter/components/ConsentManagerProductCards.tsx +0 -333
  118. package/src/RedactoPrivacyCenter/components/ConsentManagerPurposeCards.tsx +0 -102
  119. package/src/RedactoPrivacyCenter/components/ConsentManagerTableSkeleton.tsx +0 -159
  120. package/src/RedactoPrivacyCenter/components/DataRequest/CorrectionDataSection.tsx +0 -189
  121. package/src/RedactoPrivacyCenter/components/DataRequest/GrievanceDataSection.tsx +0 -118
  122. package/src/RedactoPrivacyCenter/components/DataRequest/NominationDataSection.tsx +0 -66
  123. package/src/RedactoPrivacyCenter/components/DataRequest/ProductSelectionSection.tsx +0 -222
  124. package/src/RedactoPrivacyCenter/components/DataRequest/PurposeSelectionSection.tsx +0 -331
  125. package/src/RedactoPrivacyCenter/components/Form.tsx +0 -1796
  126. package/src/RedactoPrivacyCenter/components/GrievanceTable.tsx +0 -174
  127. package/src/RedactoPrivacyCenter/components/GrievanceTablePagination.tsx +0 -337
  128. package/src/RedactoPrivacyCenter/components/ModifyConsentModal.tsx +0 -334
  129. package/src/RedactoPrivacyCenter/components/NotificationHub/NotificationBell.tsx +0 -173
  130. package/src/RedactoPrivacyCenter/components/NotificationHub/NotificationCTAButton.tsx +0 -18
  131. package/src/RedactoPrivacyCenter/components/NotificationHub/NotificationDropdown.tsx +0 -54
  132. package/src/RedactoPrivacyCenter/components/NotificationHub/NotificationDropdownItem.tsx +0 -57
  133. package/src/RedactoPrivacyCenter/components/NotificationHub/NotificationIcon.tsx +0 -19
  134. package/src/RedactoPrivacyCenter/components/NotificationHub/NotificationListPanel.tsx +0 -92
  135. package/src/RedactoPrivacyCenter/components/NotificationHub/NotificationRefreshButton.tsx +0 -20
  136. package/src/RedactoPrivacyCenter/components/NotificationHub/NotificationRow.tsx +0 -58
  137. package/src/RedactoPrivacyCenter/components/NotificationHub/StatCard.tsx +0 -10
  138. package/src/RedactoPrivacyCenter/components/NotificationHub/useNotificationActions.ts +0 -112
  139. package/src/RedactoPrivacyCenter/components/NotificationHub/utils.ts +0 -27
  140. package/src/RedactoPrivacyCenter/components/Pagination.tsx +0 -140
  141. package/src/RedactoPrivacyCenter/components/PrivacyCenterEmptyState.tsx +0 -76
  142. package/src/RedactoPrivacyCenter/components/PrivacyCenterSessionExpired.tsx +0 -97
  143. package/src/RedactoPrivacyCenter/components/ReceiptsList.tsx +0 -454
  144. package/src/RedactoPrivacyCenter/components/RequestSubmit.tsx +0 -270
  145. package/src/RedactoPrivacyCenter/components/SelectUser.tsx +0 -83
  146. package/src/RedactoPrivacyCenter/components/SelectUserGate.tsx +0 -193
  147. package/src/RedactoPrivacyCenter/components/SideMenuBarPC/constants.tsx +0 -25
  148. package/src/RedactoPrivacyCenter/components/SideMenuBarPC/types.ts +0 -21
  149. package/src/RedactoPrivacyCenter/components/caseHistoryColumns.tsx +0 -159
  150. package/src/RedactoPrivacyCenter/components/constant.ts +0 -52
  151. package/src/RedactoPrivacyCenter/components/groupHelpers.ts +0 -119
  152. package/src/RedactoPrivacyCenter/components/receiptColumns.tsx +0 -203
  153. package/src/RedactoPrivacyCenter/components/types.ts +0 -123
  154. package/src/RedactoPrivacyCenter/components/utils.tsx +0 -10
  155. package/src/RedactoPrivacyCenter/config/routes.ts +0 -9
  156. package/src/RedactoPrivacyCenter/config/table.ts +0 -25
  157. package/src/RedactoPrivacyCenter/context/AuthContext.tsx +0 -160
  158. package/src/RedactoPrivacyCenter/context/BaseUrlContext.tsx +0 -47
  159. package/src/RedactoPrivacyCenter/context/BrandingContext.tsx +0 -52
  160. package/src/RedactoPrivacyCenter/context/DataAvailabilityContext.session-expired.test.tsx +0 -92
  161. package/src/RedactoPrivacyCenter/context/DataAvailabilityContext.tsx +0 -181
  162. package/src/RedactoPrivacyCenter/context/LocaleContext.tsx +0 -11
  163. package/src/RedactoPrivacyCenter/context/NavigationContext.tsx +0 -96
  164. package/src/RedactoPrivacyCenter/context/OrganizationContext.tsx +0 -30
  165. package/src/RedactoPrivacyCenter/context/PageChromeContext.tsx +0 -80
  166. package/src/RedactoPrivacyCenter/context/ProfileSwitchContext.tsx +0 -15
  167. package/src/RedactoPrivacyCenter/context/types.ts +0 -19
  168. package/src/RedactoPrivacyCenter/lib/api.ts +0 -756
  169. package/src/RedactoPrivacyCenter/lib/consent-manager/utils.tsx +0 -67
  170. package/src/RedactoPrivacyCenter/lib/constants.ts +0 -277
  171. package/src/RedactoPrivacyCenter/lib/i18n.ts +0 -81
  172. package/src/RedactoPrivacyCenter/lib/locales.ts +0 -105
  173. package/src/RedactoPrivacyCenter/lib/queries.ts +0 -141
  174. package/src/RedactoPrivacyCenter/lib/types.ts +0 -868
  175. package/src/RedactoPrivacyCenter/lib/useCurrentLanguage.ts +0 -37
  176. package/src/RedactoPrivacyCenter/lib/utils.refresh-circuit.test.ts +0 -127
  177. package/src/RedactoPrivacyCenter/lib/utils.refresh-storage.test.ts +0 -85
  178. package/src/RedactoPrivacyCenter/lib/utils.session-expired.test.ts +0 -109
  179. package/src/RedactoPrivacyCenter/lib/utils.ts +0 -783
  180. package/src/RedactoPrivacyCenter/locales/as/translation.json +0 -340
  181. package/src/RedactoPrivacyCenter/locales/bho/translation.json +0 -340
  182. package/src/RedactoPrivacyCenter/locales/bn/translation.json +0 -340
  183. package/src/RedactoPrivacyCenter/locales/brx/translation.json +0 -340
  184. package/src/RedactoPrivacyCenter/locales/doi/translation.json +0 -340
  185. package/src/RedactoPrivacyCenter/locales/en/translation.json +0 -354
  186. package/src/RedactoPrivacyCenter/locales/gom/translation.json +0 -340
  187. package/src/RedactoPrivacyCenter/locales/gu/translation.json +0 -340
  188. package/src/RedactoPrivacyCenter/locales/hi/translation.json +0 -343
  189. package/src/RedactoPrivacyCenter/locales/kn/translation.json +0 -340
  190. package/src/RedactoPrivacyCenter/locales/ks/translation.json +0 -340
  191. package/src/RedactoPrivacyCenter/locales/mai/translation.json +0 -340
  192. package/src/RedactoPrivacyCenter/locales/ml/translation.json +0 -340
  193. package/src/RedactoPrivacyCenter/locales/mni-Mtei/translation.json +0 -340
  194. package/src/RedactoPrivacyCenter/locales/mr/translation.json +0 -340
  195. package/src/RedactoPrivacyCenter/locales/ne/translation.json +0 -340
  196. package/src/RedactoPrivacyCenter/locales/or/translation.json +0 -340
  197. package/src/RedactoPrivacyCenter/locales/pa/translation.json +0 -340
  198. package/src/RedactoPrivacyCenter/locales/sa/translation.json +0 -340
  199. package/src/RedactoPrivacyCenter/locales/sat/translation.json +0 -340
  200. package/src/RedactoPrivacyCenter/locales/sd/translation.json +0 -340
  201. package/src/RedactoPrivacyCenter/locales/ta/translation.json +0 -340
  202. package/src/RedactoPrivacyCenter/locales/te/translation.json +0 -340
  203. package/src/RedactoPrivacyCenter/locales/ur/translation.json +0 -340
  204. package/src/RedactoPrivacyCenter/styles/applyBrandingTheme.ts +0 -66
  205. package/src/RedactoPrivacyCenter/styles/base.css +0 -117
  206. package/src/RedactoPrivacyCenter/styles/injectStyles.ts +0 -3103
  207. package/src/RedactoPrivacyCenter/styles/pcStyles.ts +0 -814
  208. package/src/RedactoPrivacyCenter/styles/responsive.ts +0 -138
  209. package/src/RedactoPrivacyCenter/styles/variables.css +0 -96
  210. package/src/RedactoPrivacyCenter/table/AdvancedTable.tsx +0 -387
  211. package/src/RedactoPrivacyCenter/table/AdvancedTablePagination.tsx +0 -468
  212. package/src/RedactoPrivacyCenter/table/index.ts +0 -2
  213. package/src/RedactoPrivacyCenter/types/images.d.ts +0 -29
  214. package/src/RedactoPrivacyCenter/ui/Footer.tsx +0 -69
  215. package/src/RedactoPrivacyCenter/ui/FormBlockWrapper.tsx +0 -54
  216. package/src/RedactoPrivacyCenter/ui/PCAccordion.tsx +0 -93
  217. package/src/RedactoPrivacyCenter/ui/PCActionIcon.tsx +0 -47
  218. package/src/RedactoPrivacyCenter/ui/PCAvatar.tsx +0 -69
  219. package/src/RedactoPrivacyCenter/ui/PCBadge.tsx +0 -48
  220. package/src/RedactoPrivacyCenter/ui/PCButton.tsx +0 -77
  221. package/src/RedactoPrivacyCenter/ui/PCCheckbox.tsx +0 -55
  222. package/src/RedactoPrivacyCenter/ui/PCCollapse.tsx +0 -107
  223. package/src/RedactoPrivacyCenter/ui/PCEmpty.tsx +0 -35
  224. package/src/RedactoPrivacyCenter/ui/PCInput.tsx +0 -132
  225. package/src/RedactoPrivacyCenter/ui/PCLoader.tsx +0 -31
  226. package/src/RedactoPrivacyCenter/ui/PCModal.tsx +0 -106
  227. package/src/RedactoPrivacyCenter/ui/PCPopover.tsx +0 -206
  228. package/src/RedactoPrivacyCenter/ui/PCSelect.tsx +0 -433
  229. package/src/RedactoPrivacyCenter/ui/PCTable.tsx +0 -149
  230. package/src/RedactoPrivacyCenter/ui/PCText.tsx +0 -41
  231. package/src/RedactoPrivacyCenter/ui/PCTextarea.tsx +0 -43
  232. package/src/RedactoPrivacyCenter/ui/PCTitle.tsx +0 -37
  233. package/src/RedactoPrivacyCenter/ui/PCTooltip.tsx +0 -121
  234. package/src/RedactoPrivacyCenter/ui/SimpleBar.tsx +0 -25
  235. package/src/RedactoPrivacyCenter/ui/StatusBadge.tsx +0 -53
  236. package/src/RedactoPrivacyCenter/ui/index.ts +0 -18
  237. package/src/RedactoPrivacyCenter/utils/cn.ts +0 -28
  238. package/src/RedactoPrivacyCenter/utils/date.ts +0 -48
  239. package/src/RedactoPrivacyCenter/utils/status.ts +0 -111
  240. package/src/RedactoPrivacyCenter/utils/toast.ts +0 -130
  241. package/src/index.ts +0 -19
  242. package/src/privacy-center.ts +0 -113
  243. package/src/shared/api-errors.ts +0 -180
  244. package/src/types/css.d.ts +0 -4
  245. package/src/types/images.d.ts +0 -19
  246. package/src/types/react-jsx.d.ts +0 -26
  247. package/tests/DataAvailabilityContext.test.tsx +0 -123
  248. package/tests/Form.test.tsx +0 -1287
  249. package/tests/ProductSelectionSection.test.tsx +0 -328
  250. package/tests/RequestSubmit.test.tsx +0 -135
  251. package/tests/consentClient.test.ts +0 -171
  252. package/tests/manageConsentServer.test.ts +0 -38
  253. package/tests/mocks.ts +0 -257
  254. package/tests/resolveContactFromJwt.test.ts +0 -44
  255. package/tests/setup.ts +0 -16
  256. package/tsconfig.json +0 -16
  257. package/tsup.config.ts +0 -31
  258. package/vitest.config.ts +0 -16
@@ -1,756 +0,0 @@
1
- import {
2
- createCaseRequestServer,
3
- fetchActivitiesServer,
4
- fetchReceiptsServer,
5
- fetchReceiptPdfServer,
6
- fetchCaseHistoryServer,
7
- fetchProductsServer,
8
- fetchUserConsentsServer,
9
- fetchGroupPurposesServer,
10
- getFormDataServer,
11
- manageConsentServer,
12
- getCaseMessagesServer,
13
- sendCaseMessageServer,
14
- uploadCaseDocumentServer,
15
- submitDocumentForRequestServer,
16
- getCaseDocumentServer,
17
- getNotificationsServer,
18
- getNotificationSummaryServer,
19
- getUnreadCountServer,
20
- markNotificationReadServer,
21
- markAllNotificationsReadServer,
22
- acknowledgeNotificationServer,
23
- } from '../api/actions';
24
- import type { BaseUrlContextValue } from '../context/BaseUrlContext';
25
- import type {
26
- ActivityDetail,
27
- CaseHistoryDetail,
28
- CaseMessage,
29
- CreateCaseResponse,
30
- FormData,
31
- MessageDocument,
32
- NotificationActionResponse,
33
- NotificationListResponse,
34
- NotificationQueryParams,
35
- NotificationSummary,
36
- UnreadCountResponse,
37
- UploadDocumentResponse,
38
- UserConsentDetail,
39
- UserDataRequest,
40
- GroupPurposesOut,
41
- ReceiptEventType,
42
- ReceiptPurposeStatus,
43
- } from './types';
44
- import { ensureValidToken } from './utils';
45
-
46
- // Auth context type for passing to API functions
47
- export interface AuthContext {
48
- accessToken?: string;
49
- refreshToken?: string;
50
- onError?: (error: Error) => boolean;
51
- updateTokens?: (accessToken: string, refreshToken?: string) => void;
52
- }
53
-
54
- // Re-export server actions for client components
55
- export {
56
- createOtpServer as createOtp,
57
- exchangeTokenServer as exchangeToken,
58
- verifyOtpServer as verifyOtp,
59
- } from '../api/actions';
60
-
61
- // Re-export refreshOtpTokenServer for utils
62
- export { refreshOtpTokenServer } from '../api/actions';
63
-
64
- // Re-export types
65
- export type {
66
- ActivityDetail,
67
- CaseHistoryDetail,
68
- CreateCaseResponse,
69
- FormData,
70
- OrganizationResponse,
71
- OtpResponse,
72
- OtpVerificationResponse,
73
- TokenExchangeResponse,
74
- UserConsentDetail,
75
- UserDataRequest,
76
- } from './types';
77
-
78
- // Keep utility functions
79
- export { getCookieValue } from './utils';
80
-
81
- /**
82
- * Check if an error is an authentication/JWT related error
83
- */
84
- function isAuthError(error: any): boolean {
85
- const errorMessage = error?.message || '';
86
- return (
87
- errorMessage.includes('401') ||
88
- errorMessage.includes('JWT') ||
89
- errorMessage.includes('expired') ||
90
- errorMessage.includes('token') ||
91
- errorMessage.includes('Unauthorized')
92
- );
93
- }
94
-
95
- /**
96
- * Handle client-side auth errors by attempting token refresh
97
- * If refresh fails, signs out and redirects to sign-in
98
- * @returns true if token was refreshed successfully and caller should retry, false otherwise
99
- */
100
- async function handleClientAuthError(
101
- error: any,
102
- organizationId: string,
103
- workspaceId: string,
104
- authContext?: AuthContext,
105
- consentClient?: BaseUrlContextValue['consentClient']
106
- ): Promise<boolean> {
107
- if (isAuthError(error)) {
108
- // Try to get a fresh token
109
- const newToken = await ensureValidToken(organizationId, workspaceId, undefined, authContext, consentClient);
110
- if (newToken) {
111
- // Token refresh succeeded - caller should retry with new token
112
- return true;
113
- }
114
- // Token refresh failed - ensureValidToken already handled sign out and redirect
115
- return false;
116
- }
117
- return false;
118
- }
119
-
120
- export const getFormData = async (
121
- organizationId: string,
122
- workspaceId: string,
123
- contact: string,
124
- _isPopup?: boolean,
125
- useSessionAuth?: boolean,
126
- authContext?: AuthContext,
127
- consentClient?: BaseUrlContextValue['consentClient'],
128
- language?: string
129
- ): Promise<FormData | null> => {
130
- try {
131
- // If useSessionAuth is explicitly set to true (case management), use session auth
132
- if (useSessionAuth) {
133
- return await getFormDataServer(organizationId, workspaceId, contact, undefined, true, consentClient, language);
134
- }
135
-
136
- // Ensure we have a valid token before making the API call
137
- const authToken = await ensureValidToken(organizationId, workspaceId, undefined, authContext, consentClient);
138
- if (!authToken) {
139
- // ensureValidToken already handled sign out and redirect
140
- return null;
141
- }
142
-
143
- const data = await getFormDataServer(
144
- organizationId,
145
- workspaceId,
146
- contact,
147
- authToken,
148
- false,
149
- consentClient,
150
- language
151
- );
152
- return data;
153
- } catch (error: any) {
154
- const shouldRetry = await handleClientAuthError(error, organizationId, workspaceId, authContext, consentClient);
155
- if (shouldRetry) {
156
- // Read from sessionStorage first (synchronously updated) then fall back to context
157
- const newAuthToken = sessionStorage.getItem('access_token') || authContext?.accessToken || '';
158
- return await getFormDataServer(
159
- organizationId,
160
- workspaceId,
161
- contact,
162
- newAuthToken,
163
- false,
164
- consentClient,
165
- language
166
- );
167
- }
168
- console.error('Error fetching form data:', error);
169
- if (error.message?.includes('404')) {
170
- throw error;
171
- }
172
- return null;
173
- }
174
- };
175
-
176
- /**
177
- * Public helper for creating a case request. Returns `null` on any
178
- * non-auth error (preserves the documented
179
- * `Promise<CreateCaseResponse | null>` contract the SDK exposes to
180
- * consumers) — does NOT throw. Auth errors trigger a single token
181
- * refresh + retry before falling through.
182
- */
183
- export const createCaseRequest = async (
184
- organizationId: string,
185
- workspaceId: string,
186
- data: UserDataRequest,
187
- _isPopup?: boolean,
188
- useSessionAuth?: boolean,
189
- authContext?: AuthContext,
190
- consentClient?: BaseUrlContextValue['consentClient']
191
- ): Promise<CreateCaseResponse | null> => {
192
- try {
193
- // If useSessionAuth is explicitly set to true (case management), use session auth
194
- if (useSessionAuth) {
195
- return await createCaseRequestServer(organizationId, workspaceId, data, undefined, true, consentClient);
196
- }
197
-
198
- // Ensure we have a valid token before making the API call
199
- const authToken = await ensureValidToken(organizationId, workspaceId, undefined, authContext, consentClient);
200
- if (!authToken) {
201
- // ensureValidToken already handled sign out and redirect
202
- return null;
203
- }
204
-
205
- return await createCaseRequestServer(
206
- organizationId,
207
- workspaceId,
208
- data,
209
- authToken,
210
- false,
211
- consentClient
212
- );
213
- } catch (error: any) {
214
- const shouldRetry = await handleClientAuthError(error, organizationId, workspaceId, authContext, consentClient);
215
- if (shouldRetry) {
216
- // Read from sessionStorage first (synchronously updated) then fall back to context
217
- const newAuthToken = sessionStorage.getItem('access_token') || authContext?.accessToken || '';
218
- try {
219
- return await createCaseRequestServer(
220
- organizationId,
221
- workspaceId,
222
- data,
223
- newAuthToken,
224
- false,
225
- consentClient
226
- );
227
- } catch (retryError) {
228
- // The post-refresh retry can still fail (network blip, 5xx,
229
- // expired-again token). Honor the documented `Promise<… | null>`
230
- // contract by swallowing here rather than letting the rethrow
231
- // escape — callers (e.g. Form.tsx) rely on null-on-error.
232
- console.error('Error creating case request after auth refresh:', retryError);
233
- return null;
234
- }
235
- }
236
- console.error('Error creating case request:', error);
237
- return null;
238
- }
239
- };
240
-
241
- export const fetchProducts = async (
242
- organizationId: string,
243
- workspaceId: string,
244
- skip?: number,
245
- limit?: number,
246
- authContext?: AuthContext,
247
- consentClient?: BaseUrlContextValue['consentClient']
248
- ): Promise<Array<{ uuid: string; name: string; description?: string }> | null> => {
249
- try {
250
- // Ensure we have a valid token before making the API call
251
- const accessToken = await ensureValidToken(organizationId, workspaceId, undefined, authContext, consentClient);
252
- if (!accessToken) {
253
- // ensureValidToken already handled sign out and redirect
254
- return null;
255
- }
256
-
257
- const result = await fetchProductsServer({
258
- organizationId,
259
- workspaceId,
260
- skip,
261
- limit,
262
- authToken: accessToken,
263
- consentClient,
264
- });
265
- return result;
266
- } catch (error: any) {
267
- const shouldRetry = await handleClientAuthError(error, organizationId, workspaceId, authContext, consentClient);
268
- if (shouldRetry) {
269
- // Read from sessionStorage first (synchronously updated) then fall back to context
270
- const newAccessToken = sessionStorage.getItem('access_token') || authContext?.accessToken || '';
271
- return await fetchProductsServer({
272
- organizationId,
273
- workspaceId,
274
- skip,
275
- limit,
276
- authToken: newAccessToken || undefined,
277
- consentClient,
278
- });
279
- }
280
- console.error('Error fetching products:', error);
281
- return null;
282
- }
283
- };
284
-
285
- export type FetchUserConsentsParams = {
286
- organizationId: string;
287
- workspaceId: string;
288
- offset?: number;
289
- limit?: number;
290
- nominatedOffset?: number;
291
- nominatedLimit?: number;
292
- search?: string;
293
- status?: string;
294
- product_uuid?: string;
295
- language?: string;
296
- authContext?: AuthContext;
297
- consentClient?: BaseUrlContextValue['consentClient'];
298
- };
299
-
300
- export const fetchUserConsents = async (
301
- params: FetchUserConsentsParams
302
- ): Promise<UserConsentDetail | null> => {
303
- const { organizationId, workspaceId, authContext, consentClient, ...rest } = params;
304
- try {
305
- const accessToken = await ensureValidToken(organizationId, workspaceId, undefined, authContext, consentClient);
306
- if (!accessToken) {
307
- return null;
308
- }
309
-
310
- const result = await fetchUserConsentsServer({
311
- organizationId,
312
- workspaceId,
313
- ...rest,
314
- authToken: accessToken,
315
- consentClient,
316
- });
317
- return result;
318
- } catch (error: any) {
319
- const shouldRetry = await handleClientAuthError(error, organizationId, workspaceId, authContext, consentClient);
320
- if (shouldRetry) {
321
- const newAccessToken = sessionStorage.getItem('access_token') || authContext?.accessToken || '';
322
- return await fetchUserConsentsServer({
323
- organizationId,
324
- workspaceId,
325
- ...rest,
326
- authToken: newAccessToken || undefined,
327
- consentClient,
328
- });
329
- }
330
- console.error('Error fetching user consent data:', error);
331
- return null;
332
- }
333
- };
334
-
335
- export type FetchGroupPurposesParams = {
336
- organizationId: string;
337
- workspaceId: string;
338
- productUuid: string;
339
- offset?: number;
340
- limit?: number;
341
- status?: string;
342
- search?: string;
343
- language?: string;
344
- nominatorUuid?: string;
345
- authContext?: AuthContext;
346
- consentClient?: BaseUrlContextValue['consentClient'];
347
- };
348
-
349
- export const fetchGroupPurposes = async (
350
- params: FetchGroupPurposesParams
351
- ): Promise<GroupPurposesOut | null> => {
352
- const { organizationId, workspaceId, authContext, consentClient, ...rest } = params;
353
- try {
354
- const accessToken = await ensureValidToken(organizationId, workspaceId, undefined, authContext, consentClient);
355
- if (!accessToken) {
356
- return null;
357
- }
358
-
359
- const result = await fetchGroupPurposesServer({
360
- organizationId,
361
- workspaceId,
362
- ...rest,
363
- authToken: accessToken,
364
- consentClient,
365
- });
366
- return result;
367
- } catch (error: any) {
368
- const shouldRetry = await handleClientAuthError(error, organizationId, workspaceId, authContext, consentClient);
369
- if (shouldRetry) {
370
- const newAccessToken = sessionStorage.getItem('access_token') || authContext?.accessToken || '';
371
- return await fetchGroupPurposesServer({
372
- organizationId,
373
- workspaceId,
374
- ...rest,
375
- authToken: newAccessToken || undefined,
376
- consentClient,
377
- });
378
- }
379
- console.error('Error fetching group purposes:', error);
380
- return null;
381
- }
382
- };
383
-
384
- export const manageConsent = async ({
385
- organizationId,
386
- workspaceId,
387
- purposeId,
388
- contact,
389
- action,
390
- authContext,
391
- consentClient,
392
- nominatorContact,
393
- dataElementUuids,
394
- productUuid,
395
- noticeUuid,
396
- dataElements,
397
- }: {
398
- organizationId: string;
399
- workspaceId: string;
400
- purposeId: string;
401
- contact: string;
402
- action: 'revoke' | 'regrant' | 'renew';
403
- authContext?: AuthContext;
404
- consentClient?: BaseUrlContextValue['consentClient'];
405
- nominatorContact?: string;
406
- dataElementUuids?: string[];
407
- productUuid?: string;
408
- noticeUuid?: string;
409
- dataElements?: Array<{ uuid: string; selected: boolean }>;
410
- }): Promise<boolean | null> => {
411
- try {
412
- // Ensure we have a valid token before making the API call
413
- const accessToken = await ensureValidToken(organizationId, workspaceId, undefined, authContext, consentClient);
414
- if (!accessToken) {
415
- // ensureValidToken already handled sign out and redirect
416
- return null;
417
- }
418
-
419
- const result = await manageConsentServer({
420
- organizationId,
421
- workspaceId,
422
- purposeId,
423
- contact,
424
- action,
425
- authToken: accessToken,
426
- consentClient,
427
- nominatorContact,
428
- dataElementUuids,
429
- productUuid,
430
- noticeUuid,
431
- dataElements,
432
- });
433
- return result;
434
- } catch (error: any) {
435
- // Re-throw nominator-specific errors (stable code) so the UI can show targeted messages
436
- if (error?.name === 'ConsentApiError') {
437
- throw error;
438
- }
439
- // Auth errors (401) mean the request was rejected before processing, so a single retry is safe
440
- const recovered = await handleClientAuthError(error, organizationId, workspaceId, authContext, consentClient);
441
- if (recovered) {
442
- const newAccessToken = sessionStorage.getItem('access_token') || authContext?.accessToken || '';
443
- return await manageConsentServer({
444
- organizationId,
445
- workspaceId,
446
- purposeId,
447
- contact,
448
- action,
449
- authToken: newAccessToken || undefined,
450
- consentClient,
451
- nominatorContact,
452
- dataElementUuids,
453
- productUuid,
454
- noticeUuid,
455
- dataElements,
456
- });
457
- }
458
- console.error(`Error ${action} consent:`, error);
459
- return null;
460
- }
461
- };
462
-
463
- export const fetchActivities = async (
464
- organizationId: string,
465
- workspaceId: string,
466
- offset?: number,
467
- limit?: number,
468
- authContext?: AuthContext,
469
- consentClient?: BaseUrlContextValue['consentClient'],
470
- language?: string
471
- ): Promise<ActivityDetail | null> => {
472
- try {
473
- // Ensure we have a valid token before making the API call
474
- const accessToken = await ensureValidToken(organizationId, workspaceId, undefined, authContext, consentClient);
475
- if (!accessToken) {
476
- // ensureValidToken already handled sign out and redirect
477
- return null;
478
- }
479
-
480
- const result = await fetchActivitiesServer({
481
- organizationId,
482
- workspaceId,
483
- offset,
484
- limit,
485
- language,
486
- authToken: accessToken,
487
- consentClient,
488
- });
489
- return result;
490
- } catch (error: any) {
491
- const shouldRetry = await handleClientAuthError(error, organizationId, workspaceId, authContext, consentClient);
492
- if (shouldRetry) {
493
- // Read from sessionStorage first (synchronously updated) then fall back to context
494
- const newAccessToken = sessionStorage.getItem('access_token') || authContext?.accessToken || '';
495
- return await fetchActivitiesServer({
496
- organizationId,
497
- workspaceId,
498
- offset,
499
- limit,
500
- language,
501
- authToken: newAccessToken || undefined,
502
- consentClient,
503
- });
504
- }
505
- console.error('Error fetching activities:', error);
506
- return null;
507
- }
508
- };
509
-
510
- export const fetchCaseHistory = async (
511
- organizationId: string,
512
- workspaceId: string,
513
- contact: string,
514
- offset?: number,
515
- limit?: number,
516
- authContext?: AuthContext,
517
- consentClient?: BaseUrlContextValue['consentClient'],
518
- language?: string
519
- ): Promise<CaseHistoryDetail | null> => {
520
- try {
521
- // Ensure we have a valid token before making the API call
522
- const accessToken = await ensureValidToken(organizationId, workspaceId, undefined, authContext, consentClient);
523
- if (!accessToken) {
524
- // ensureValidToken already handled sign out and redirect
525
- return null;
526
- }
527
-
528
- const result = await fetchCaseHistoryServer({
529
- organizationId,
530
- workspaceId,
531
- contact,
532
- offset,
533
- limit,
534
- language,
535
- authToken: accessToken,
536
- consentClient,
537
- });
538
- return result;
539
- } catch (error: any) {
540
- const shouldRetry = await handleClientAuthError(error, organizationId, workspaceId, authContext, consentClient);
541
- if (shouldRetry) {
542
- // Read from sessionStorage first (synchronously updated) then fall back to context
543
- const newAccessToken = sessionStorage.getItem('access_token') || authContext?.accessToken || '';
544
- return await fetchCaseHistoryServer({
545
- organizationId,
546
- workspaceId,
547
- contact,
548
- offset,
549
- limit,
550
- language,
551
- authToken: newAccessToken || undefined,
552
- consentClient,
553
- });
554
- }
555
- console.error('Error fetching case history: ', error);
556
- return null;
557
- }
558
- };
559
-
560
- // ─── Auth-retry helper ──────────────────────────────────────────────────────
561
-
562
- /**
563
- * Wraps an API call with token acquisition and single-retry-on-auth-error logic.
564
- * `fn` receives a valid access token and returns the API result.
565
- */
566
- async function withAuthRetry<T>(
567
- organizationId: string,
568
- workspaceId: string,
569
- authContext: AuthContext | undefined,
570
- consentClient: BaseUrlContextValue['consentClient'] | undefined,
571
- errorLabel: string,
572
- fn: (token: string) => Promise<T>
573
- ): Promise<T | null> {
574
- try {
575
- const accessToken = await ensureValidToken(organizationId, workspaceId, undefined, authContext, consentClient);
576
- if (!accessToken) return null;
577
- return await fn(accessToken);
578
- } catch (error: any) {
579
- const shouldRetry = await handleClientAuthError(error, organizationId, workspaceId, authContext, consentClient);
580
- if (shouldRetry) {
581
- const token = sessionStorage.getItem('access_token') || authContext?.accessToken || '';
582
- return await fn(token);
583
- }
584
- console.error(errorLabel, error);
585
- return null;
586
- }
587
- }
588
-
589
- // ─── Case Communication ──────────────────────────────────────────────────────
590
-
591
- export const getCaseMessages = async (
592
- organizationId: string,
593
- workspaceId: string,
594
- caseUuid: string,
595
- authContext?: AuthContext,
596
- consentClient?: BaseUrlContextValue['consentClient']
597
- ): Promise<CaseMessage[] | null> =>
598
- withAuthRetry(organizationId, workspaceId, authContext, consentClient, 'Error fetching case messages:', (token) =>
599
- getCaseMessagesServer({ organizationId, workspaceId, caseUuid, authToken: token, consentClient })
600
- );
601
-
602
- export const sendCaseMessage = async (
603
- organizationId: string,
604
- workspaceId: string,
605
- caseUuid: string,
606
- body: string,
607
- documentUuids: string[],
608
- authContext?: AuthContext,
609
- consentClient?: BaseUrlContextValue['consentClient']
610
- ): Promise<CaseMessage | null> =>
611
- withAuthRetry(organizationId, workspaceId, authContext, consentClient, 'Error sending case message:', (token) =>
612
- sendCaseMessageServer({ organizationId, workspaceId, caseUuid, body, documentUuids, authToken: token, consentClient })
613
- );
614
-
615
- export const uploadCaseDocument = async (
616
- organizationId: string,
617
- workspaceId: string,
618
- caseUuid: string,
619
- file: File,
620
- authContext?: AuthContext,
621
- consentClient?: BaseUrlContextValue['consentClient']
622
- ): Promise<UploadDocumentResponse | null> =>
623
- withAuthRetry(organizationId, workspaceId, authContext, consentClient, 'Error uploading case document:', (token) =>
624
- uploadCaseDocumentServer({ organizationId, workspaceId, caseUuid, file, authToken: token, consentClient })
625
- );
626
-
627
- export const submitDocumentForRequest = async (
628
- organizationId: string,
629
- workspaceId: string,
630
- caseUuid: string,
631
- requestEventUuid: string,
632
- documentUuid: string,
633
- body: string,
634
- authContext?: AuthContext,
635
- consentClient?: BaseUrlContextValue['consentClient']
636
- ): Promise<CaseMessage | null> =>
637
- withAuthRetry(organizationId, workspaceId, authContext, consentClient, 'Error submitting document for request:', (token) =>
638
- submitDocumentForRequestServer({ organizationId, workspaceId, caseUuid, requestEventUuid, documentUuid, body, authToken: token, consentClient })
639
- );
640
-
641
- export const getCaseDocument = async (
642
- organizationId: string,
643
- workspaceId: string,
644
- caseUuid: string,
645
- documentUuid: string,
646
- authContext?: AuthContext,
647
- consentClient?: BaseUrlContextValue['consentClient']
648
- ): Promise<MessageDocument | null> =>
649
- withAuthRetry(organizationId, workspaceId, authContext, consentClient, 'Error fetching case document:', (token) =>
650
- getCaseDocumentServer({ organizationId, workspaceId, caseUuid, documentUuid, authToken: token, consentClient })
651
- );
652
-
653
- // ─── Receipts ────────────────────────────────────────────────────────────────
654
-
655
- export type FetchReceiptsParams = {
656
- skip?: number;
657
- limit?: number;
658
- notice_uuid?: string;
659
- event_type?: ReceiptEventType;
660
- status?: ReceiptPurposeStatus;
661
- created_after?: string;
662
- created_before?: string;
663
- language?: string;
664
- };
665
-
666
- export const fetchReceipts = async (
667
- organizationId: string,
668
- workspaceId: string,
669
- params?: FetchReceiptsParams,
670
- authContext?: AuthContext,
671
- consentClient?: BaseUrlContextValue['consentClient'],
672
- ): Promise<unknown | null> =>
673
- withAuthRetry(organizationId, workspaceId, authContext, consentClient, 'Error fetching receipts:', (token) =>
674
- fetchReceiptsServer({ organizationId, workspaceId, ...params, authToken: token, consentClient })
675
- );
676
-
677
- /**
678
- * Download a single receipt as a PDF Blob. The UI builds an object URL from the
679
- * Blob to open/save it (PDF UI is a later pass; the SDK function is ready now).
680
- */
681
- export const fetchReceiptPdf = async (
682
- organizationId: string,
683
- workspaceId: string,
684
- receiptUuid: string,
685
- authContext?: AuthContext,
686
- consentClient?: BaseUrlContextValue['consentClient'],
687
- ): Promise<Blob | null> =>
688
- withAuthRetry(organizationId, workspaceId, authContext, consentClient, 'Error downloading receipt PDF:', (token) =>
689
- fetchReceiptPdfServer({ organizationId, workspaceId, receiptUuid, authToken: token, consentClient })
690
- );
691
-
692
- // ─── Notification Hub ───────────────────────────────────────────────────────
693
-
694
- export const fetchNotifications = async (
695
- organizationId: string,
696
- workspaceId: string,
697
- params?: NotificationQueryParams,
698
- authContext?: AuthContext,
699
- consentClient?: BaseUrlContextValue['consentClient'],
700
- language?: string,
701
- ): Promise<NotificationListResponse | null> =>
702
- withAuthRetry(organizationId, workspaceId, authContext, consentClient, 'Error fetching notifications:', (token) =>
703
- getNotificationsServer({ organizationId, workspaceId, ...params, language, authToken: token, consentClient })
704
- );
705
-
706
- export const fetchNotificationSummary = async (
707
- organizationId: string,
708
- workspaceId: string,
709
- authContext?: AuthContext,
710
- consentClient?: BaseUrlContextValue['consentClient']
711
- ): Promise<NotificationSummary | null> =>
712
- withAuthRetry(organizationId, workspaceId, authContext, consentClient, 'Error fetching notification summary:', (token) =>
713
- getNotificationSummaryServer({ organizationId, workspaceId, authToken: token, consentClient })
714
- );
715
-
716
- export const fetchUnreadCount = async (
717
- organizationId: string,
718
- workspaceId: string,
719
- authContext?: AuthContext,
720
- consentClient?: BaseUrlContextValue['consentClient']
721
- ): Promise<UnreadCountResponse | null> =>
722
- withAuthRetry(organizationId, workspaceId, authContext, consentClient, 'Error fetching unread count:', (token) =>
723
- getUnreadCountServer({ organizationId, workspaceId, authToken: token, consentClient })
724
- );
725
-
726
- export const markNotificationRead = async (
727
- organizationId: string,
728
- workspaceId: string,
729
- notificationUuid: string,
730
- authContext?: AuthContext,
731
- consentClient?: BaseUrlContextValue['consentClient']
732
- ): Promise<NotificationActionResponse | null> =>
733
- withAuthRetry(organizationId, workspaceId, authContext, consentClient, 'Error marking notification as read:', (token) =>
734
- markNotificationReadServer({ organizationId, workspaceId, notificationUuid, authToken: token, consentClient })
735
- );
736
-
737
- export const markAllRead = async (
738
- organizationId: string,
739
- workspaceId: string,
740
- authContext?: AuthContext,
741
- consentClient?: BaseUrlContextValue['consentClient']
742
- ): Promise<NotificationActionResponse | null> =>
743
- withAuthRetry(organizationId, workspaceId, authContext, consentClient, 'Error marking all notifications as read:', (token) =>
744
- markAllNotificationsReadServer({ organizationId, workspaceId, authToken: token, consentClient })
745
- );
746
-
747
- export const acknowledgeNotification = async (
748
- organizationId: string,
749
- workspaceId: string,
750
- notificationUuid: string,
751
- authContext?: AuthContext,
752
- consentClient?: BaseUrlContextValue['consentClient']
753
- ): Promise<NotificationActionResponse | null> =>
754
- withAuthRetry(organizationId, workspaceId, authContext, consentClient, 'Error acknowledging notification:', (token) =>
755
- acknowledgeNotificationServer({ organizationId, workspaceId, notificationUuid, authToken: token, consentClient })
756
- );