@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,490 +0,0 @@
1
- export type RedactoJwtPayload = {
2
- organisation_uuid: string;
3
- workspace_uuid: string;
4
- user_uuid?: string;
5
- exp?: number;
6
- iat?: number;
7
- };
8
-
9
- export type PurposeSelection = {
10
- selected: boolean;
11
- status: string; // ACTIVE | EXPIRED | WITHDRAW | DECLINED
12
- needs_reconsent: boolean;
13
- data_elements: Record<string, DataElementSelection>;
14
- };
15
-
16
- export type DataElementSelection = {
17
- selected: boolean;
18
- enabled: boolean;
19
- required: boolean;
20
- };
21
-
22
- // ─── Ledger notice check-consent ────────────────────────────────────────────
23
- // Mirrors the Go ledger's `NoticeConsentStatusResponse`. Used to overlay the
24
- // banner's prior-consent / reconsent state from the ledger, since Python's
25
- // notice-validation overlay is empty after the consent cutover.
26
- export type NoticeConsentStatusDataElement = {
27
- uuid: string;
28
- name: string;
29
- selected: boolean;
30
- };
31
-
32
- export type NoticeConsentStatusPurpose = {
33
- uuid: string;
34
- name: string;
35
- selected: boolean;
36
- status: string; // ACTIVE | EXPIRED | WITHDRAW | DECLINED | INACTIVE
37
- expiry_datetime?: string | null;
38
- data_elements: NoticeConsentStatusDataElement[];
39
- };
40
-
41
- export type NoticeConsentStatusResponse = {
42
- consented: boolean;
43
- all_mandatory_active: boolean;
44
- purposes: NoticeConsentStatusPurpose[];
45
- };
46
-
47
- export type FetchNoticeConsentStatusParams = {
48
- accessToken: string;
49
- ledgerBaseUrl?: string;
50
- noticeUuid: string;
51
- signal?: AbortSignal;
52
- };
53
-
54
- export type ConsentContent = {
55
- code: number;
56
- status: string;
57
- detail: {
58
- uuid: string;
59
- name: string;
60
- organisation_uuid: string;
61
- workspace_uuid: string;
62
- collection_point_uuids: string[];
63
- collection_points: {
64
- uuid: string;
65
- organisation_uuid: string;
66
- workspace_uuid: string;
67
- name: string;
68
- created_at: string;
69
- updated_at: string;
70
- }[];
71
- active_config: {
72
- uuid: string;
73
- notice_uuid: string;
74
- organisation_uuid: string;
75
- workspace_uuid: string;
76
- version: number;
77
- status: string;
78
- notice_text: string;
79
- additional_text: string;
80
- confirm_button_text: string;
81
- decline_button_text: string;
82
- logo_url: string;
83
- privacy_policy_url: string;
84
- privacy_center_url: string;
85
- primary_color: string;
86
- secondary_color: string;
87
- font_preference: string;
88
- purposes: {
89
- uuid: string;
90
- name: string;
91
- description: string;
92
- industries?: string;
93
- data_elements: {
94
- uuid: string;
95
- name: string;
96
- description: string | null;
97
- industries?: string | null;
98
- enabled: boolean;
99
- required: boolean;
100
- }[];
101
- }[];
102
- default_language: string;
103
- supported_languages_and_translations: {
104
- [key: string]: {
105
- notice_text: string;
106
- additional_text: string;
107
- confirm_button_text: string;
108
- decline_button_text: string;
109
- privacy_policy_prefix_text: string;
110
- privacy_policy_anchor_text: string;
111
- privacy_center_anchor_text?: string;
112
- purpose_section_heading: string;
113
- notice_banner_heading: string;
114
- data_elements: {
115
- [key: string]: string;
116
- };
117
- purposes: {
118
- [key: string]: string | { name: string; description: string };
119
- };
120
- dpo_info?: DpoInfoTranslation;
121
- };
122
- };
123
- created_at: string;
124
- updated_at: string;
125
- deployed_at: string;
126
- privacy_policy_prefix_text: string;
127
- privacy_policy_anchor_text: string;
128
- privacy_center_anchor_text?: string;
129
- purpose_section_heading: string;
130
- notice_banner_heading: string;
131
- dpo_info?: DpoInfo;
132
- };
133
- notice_type?: string;
134
- compliance_requirement?: string;
135
- is_minor?: boolean;
136
- purpose_selections?: Record<string, PurposeSelection>;
137
- reconsent_required?: boolean;
138
- created_at: string;
139
- updated_at: string;
140
- };
141
- };
142
-
143
- export type ConsentPreference = {
144
- id: string;
145
- name: string;
146
- description: string;
147
- required: boolean;
148
- };
149
-
150
- export type ConsentSelection = {
151
- id: string;
152
- enabled: boolean;
153
- };
154
-
155
- export type Settings = {
156
- button: {
157
- accept: {
158
- backgroundColor: string;
159
- textColor: string;
160
- };
161
- decline: {
162
- backgroundColor: string;
163
- textColor: string;
164
- };
165
- language: {
166
- backgroundColor: string;
167
- textColor: string;
168
- selectedBackgroundColor?: string;
169
- selectedTextColor?: string;
170
- };
171
- };
172
- link: string;
173
- borderRadius?: string;
174
- backgroundColor?: string;
175
- headingColor?: string;
176
- textColor?: string;
177
- borderColor?: string;
178
- font?: string;
179
- };
180
-
181
- export type FetchConsentContentParams = {
182
- noticeId: string;
183
- accessToken: string;
184
- refreshToken: string;
185
- baseUrl?: string;
186
- language?: string;
187
- specific_uuid?: string;
188
- validate_against?: "all" | "required";
189
- include_fully_consented_data?: boolean;
190
- };
191
-
192
- export type ConsentEventPayload = {
193
- notice_uuid: string;
194
- purposes: Array<{
195
- purpose_uuid: string;
196
- selected: boolean;
197
- data_elements?: Array<{
198
- uuid: string;
199
- selected: boolean;
200
- }>;
201
- }>;
202
- select_all_mandatory: boolean;
203
- source?: string;
204
- declined?: boolean;
205
- language?: string;
206
- meta_data?: {
207
- specific_uuid?: string;
208
- minor_age?: number;
209
- };
210
- guardian_verification_reference?: string;
211
- self_declared_adult?: boolean;
212
- };
213
-
214
- export type DataElement = {
215
- uuid: string;
216
- name: string;
217
- enabled: boolean;
218
- required: boolean;
219
- selected: boolean;
220
- };
221
-
222
- export type Purpose = {
223
- uuid: string;
224
- name: string;
225
- description: string;
226
- industries?: string;
227
- selected: boolean;
228
- data_elements: Array<DataElement>;
229
- };
230
-
231
- export type SubmitConsentEventParams = {
232
- accessToken: string;
233
- baseUrl?: string;
234
- ledgerBaseUrl?: string;
235
- noticeUuid: string;
236
- purposes: Array<Purpose>;
237
- declined: boolean;
238
- language?: string;
239
- meta_data?: {
240
- specific_uuid?: string;
241
- minor_age?: number;
242
- };
243
- guardianVerificationReference?: string;
244
- selfDeclaredAdult?: boolean;
245
- };
246
-
247
- // UI Component Types
248
- export type PurposeItemData = {
249
- uuid: string;
250
- name: string;
251
- description: string;
252
- industries?: string;
253
- data_elements: Array<{
254
- uuid: string;
255
- name: string;
256
- required: boolean;
257
- enabled: boolean;
258
- description: string | null;
259
- industries?: string | null;
260
- }>;
261
- };
262
-
263
- export type PurposeItemSettings = {
264
- headingColor?: string;
265
- textColor?: string;
266
- font?: string;
267
- };
268
-
269
- export type PurposeItemProps = {
270
- purpose: PurposeItemData;
271
- selectedPurposes: Record<string, boolean>;
272
- collapsedPurposes: Record<string, boolean>;
273
- selectedDataElements: Record<string, boolean>;
274
- settings?: PurposeItemSettings;
275
- styles: Record<string, any>;
276
- responsiveStyles: Record<string, any>;
277
- onPurposeToggle: (purposeId: string) => void;
278
- onPurposeCollapse: (purposeId: string) => void;
279
- onDataElementToggle: (elementUuid: string, purposeUuid: string) => void;
280
- getTranslatedText: (key: string, defaultText: string, itemId?: string) => string;
281
- isAlreadyConsented: boolean;
282
- };
283
-
284
- // DPO Info Types
285
- export type DpoInfo = {
286
- grievance_text: string;
287
- grievance_anchor_text: string;
288
- grievance_url: string;
289
- grievance_email: string;
290
- grievance_email_connector_text?: string;
291
- dp_board_text: string;
292
- dp_board_anchor_text: string;
293
- dp_board_url: string;
294
- dpo_text: string;
295
- dpo_anchor_text: string;
296
- dpo_url: string;
297
- dpo_email?: string;
298
- };
299
-
300
- export type DpoInfoTranslation = {
301
- grievance_text?: string;
302
- grievance_anchor_text?: string;
303
- grievance_email_connector_text?: string;
304
- dp_board_text?: string;
305
- dp_board_anchor_text?: string;
306
- dpo_text?: string;
307
- dpo_anchor_text?: string;
308
- };
309
-
310
- // TTS Audio Types
311
- export type PurposeAudioUrls = {
312
- name_audio_url: string;
313
- description_audio_url: string;
314
- };
315
-
316
- export type DataElementAudioUrls = {
317
- name_audio_url: string;
318
- };
319
-
320
- export type TTSAudioUrlsResponse = {
321
- code: number;
322
- status: string;
323
- detail: {
324
- uuid: string;
325
- language: string;
326
- notice_text_audio_url: string;
327
- additional_text_audio_url: string;
328
- notice_summary_audio_url: string;
329
- confirm_button_text_audio_url: string;
330
- decline_button_text_audio_url: string;
331
- privacy_policy_prefix_text_audio_url: string;
332
- privacy_policy_anchor_text_audio_url: string;
333
- privacy_center_anchor_text_audio_url?: string;
334
- purpose_section_heading_audio_url: string;
335
- notice_banner_heading_audio_url: string;
336
- purposes_audio: Record<string, PurposeAudioUrls>;
337
- data_elements_audio: Record<string, DataElementAudioUrls>;
338
- dpo_info_audio?: DpoInfoAudio;
339
- };
340
- };
341
-
342
- export type DpoInfoAudioKey = keyof DpoInfoAudio;
343
-
344
- export type DpoInfoAudio = {
345
- grievance_text_audio_url?: string;
346
- grievance_anchor_text_audio_url?: string;
347
- dp_board_text_audio_url?: string;
348
- dp_board_anchor_text_audio_url?: string;
349
- dpo_text_audio_url?: string;
350
- dpo_anchor_text_audio_url?: string;
351
- grievance_email_connector_text_audio_url?: string;
352
- grievance_email_audio_url?: string;
353
- };
354
-
355
- export type FetchTTSAudioUrlsParams = {
356
- accessToken: string;
357
- baseUrl?: string;
358
- noticeUuid: string;
359
- language: string;
360
- };
361
-
362
- // =============================================================================
363
- // Guardian Verification Types (aligned with backend API)
364
- // =============================================================================
365
-
366
- /**
367
- * Parameters for initiating guardian verification
368
- * POST /guardian/initiate-verification
369
- */
370
- export type InitiateGuardianVerificationParams = {
371
- accessToken: string;
372
- baseUrl?: string;
373
- guardianName: string;
374
- guardianContact: string;
375
- guardianRelationship: string;
376
- frontendCallbackUrl?: string;
377
- metadata?: Record<string, unknown>;
378
- signal?: AbortSignal;
379
- };
380
-
381
- /**
382
- * Response from initiate verification API
383
- *
384
- * Two shapes:
385
- * 1. New verification needed: already_verified=false, includes session_token + digilocker_redirect_url
386
- * 2. Already verified: already_verified=true, includes verification_reference — skip DigiLocker
387
- */
388
- export type InitiateGuardianVerificationResponse = {
389
- success: boolean;
390
- guardian_info_uuid: string;
391
- already_verified: boolean;
392
- /** Present only when already_verified=true */
393
- verification_reference?: string;
394
- /** Present only when already_verified=false (new flow) */
395
- session_token?: string;
396
- /** Present only when already_verified=false (new flow) */
397
- digilocker_redirect_url?: string;
398
- /** Present only when already_verified=false (new flow) */
399
- expires_at?: string;
400
- };
401
-
402
- /**
403
- * Parameters for checking verification status
404
- * POST /guardian/verify-status
405
- */
406
- export type VerifyGuardianStatusParams = {
407
- accessToken: string;
408
- baseUrl?: string;
409
- sessionToken: string;
410
- signal?: AbortSignal;
411
- };
412
-
413
- /**
414
- * Guardian details returned after successful verification
415
- */
416
- export type GuardianVerificationDetails = {
417
- verified_name: string | null;
418
- is_guardian_adult: boolean | null;
419
- verified_at: string;
420
- verification_reference: string | null;
421
- };
422
-
423
- /**
424
- * Response from verify status API
425
- */
426
- export type VerifyGuardianStatusResponse = {
427
- status: "pending" | "in_progress" | "verified" | "failed" | "expired";
428
- guardian_info_uuid: string | null;
429
- verification_reference: string | null;
430
- guardian_details: GuardianVerificationDetails | null;
431
- error: string | null;
432
- error_code: GuardianVerificationErrorCode | null;
433
- can_retry: boolean;
434
- };
435
-
436
- /**
437
- * Error codes from guardian verification
438
- */
439
- export type GuardianVerificationErrorCode =
440
- | "SESSION_EXPIRED"
441
- | "GUARDIAN_UNDER_18"
442
- | "TOKEN_FAILED"
443
- | "DIGILOCKER_AUTH_FAILED"
444
- | "NO_AUTH_CODE";
445
-
446
- // =============================================================================
447
- // Session Storage Types for redirect flow
448
- // =============================================================================
449
-
450
- /**
451
- * State persisted during DigiLocker redirect flow.
452
- * NOTE: accessToken is intentionally excluded — never store tokens in sessionStorage.
453
- * The host app must provide the token when the component re-mounts.
454
- */
455
- export type PersistedConsentState = {
456
- flowState: ConsentFlowState;
457
- sessionToken?: string;
458
- guardianInfoUuid?: string;
459
- verificationReference?: string;
460
- selectedPurposes?: Record<string, boolean>;
461
- selectedDataElements?: Record<string, boolean>;
462
- timestamp: string;
463
- originalUrl: string;
464
- verificationResult?: "pending" | "verified" | "failed" | "in_progress" | "expired";
465
- noticeId?: string;
466
- baseUrl?: string;
467
- };
468
-
469
- export type ConsentFlowState =
470
- | "age-check"
471
- | "guardian-details"
472
- | "digilocker-pending"
473
- | "consent-form"
474
- | "submitting"
475
- | "success"
476
- | "error";
477
-
478
- // =============================================================================
479
- // DigiLocker Callback Types
480
- // =============================================================================
481
-
482
- /**
483
- * Props for DigiLockerCallback component
484
- */
485
- export type DigiLockerCallbackProps = {
486
- accessToken: string;
487
- baseUrl?: string;
488
- onSuccess?: (verificationReference: string) => void;
489
- onError?: (error: Error, errorCode?: GuardianVerificationErrorCode) => void;
490
- };