c15t 1.8.3 → 2.0.0-rc.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 (163) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/client/c15t/fetcher.d.ts.map +1 -1
  3. package/dist/client/c15t/identify-user.d.ts +11 -5
  4. package/dist/client/c15t/identify-user.d.ts.map +1 -1
  5. package/dist/client/c15t/index.d.ts +28 -15
  6. package/dist/client/c15t/index.d.ts.map +1 -1
  7. package/dist/client/c15t/init.d.ts +17 -0
  8. package/dist/client/c15t/init.d.ts.map +1 -0
  9. package/dist/client/c15t/pending-submissions.d.ts +9 -4
  10. package/dist/client/c15t/pending-submissions.d.ts.map +1 -1
  11. package/dist/client/c15t/set-consent.d.ts.map +1 -1
  12. package/dist/client/c15t/types.d.ts +26 -1
  13. package/dist/client/c15t/types.d.ts.map +1 -1
  14. package/dist/client/client-factory.d.ts +8 -1
  15. package/dist/client/client-factory.d.ts.map +1 -1
  16. package/dist/client/client-interface.d.ts +29 -24
  17. package/dist/client/client-interface.d.ts.map +1 -1
  18. package/dist/client/custom/index.d.ts +15 -8
  19. package/dist/client/custom/index.d.ts.map +1 -1
  20. package/dist/client/custom/init.d.ts +8 -0
  21. package/dist/client/custom/init.d.ts.map +1 -0
  22. package/dist/client/custom/types.d.ts +11 -10
  23. package/dist/client/custom/types.d.ts.map +1 -1
  24. package/dist/client/index.d.ts +3 -2
  25. package/dist/client/index.d.ts.map +1 -1
  26. package/dist/client/offline/index.d.ts +20 -8
  27. package/dist/client/offline/index.d.ts.map +1 -1
  28. package/dist/client/offline/init.d.ts +10 -0
  29. package/dist/client/offline/init.d.ts.map +1 -0
  30. package/dist/client/offline/set-consent.d.ts +3 -0
  31. package/dist/client/offline/set-consent.d.ts.map +1 -1
  32. package/dist/client/offline/types.d.ts +9 -3
  33. package/dist/client/offline/types.d.ts.map +1 -1
  34. package/dist/client/types.d.ts +19 -10
  35. package/dist/client/types.d.ts.map +1 -1
  36. package/dist/index.cjs +3663 -2546
  37. package/dist/index.d.ts +10 -9
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +2490 -1375
  40. package/dist/libs/cookie/key-mapping.d.ts +5 -1
  41. package/dist/libs/cookie/key-mapping.d.ts.map +1 -1
  42. package/dist/libs/cookie/storage.d.ts +3 -1
  43. package/dist/libs/cookie/storage.d.ts.map +1 -1
  44. package/dist/libs/debug.d.ts +32 -0
  45. package/dist/libs/debug.d.ts.map +1 -0
  46. package/dist/libs/determine-model.d.ts +14 -0
  47. package/dist/libs/determine-model.d.ts.map +1 -0
  48. package/dist/libs/generate-subject-id.d.ts +54 -0
  49. package/dist/libs/generate-subject-id.d.ts.map +1 -0
  50. package/dist/libs/global-privacy-control.d.ts +1 -1
  51. package/dist/libs/global-privacy-control.d.ts.map +1 -1
  52. package/dist/libs/iab-tcf/cmp-api.d.ts +37 -0
  53. package/dist/libs/iab-tcf/cmp-api.d.ts.map +1 -0
  54. package/dist/libs/iab-tcf/cmp-defaults.d.ts +10 -0
  55. package/dist/libs/iab-tcf/cmp-defaults.d.ts.map +1 -0
  56. package/dist/libs/iab-tcf/fetch-gvl.d.ts +71 -0
  57. package/dist/libs/iab-tcf/fetch-gvl.d.ts.map +1 -0
  58. package/dist/libs/iab-tcf/index.d.ts +19 -0
  59. package/dist/libs/iab-tcf/index.d.ts.map +1 -0
  60. package/dist/libs/iab-tcf/lazy-load.d.ts +55 -0
  61. package/dist/libs/iab-tcf/lazy-load.d.ts.map +1 -0
  62. package/dist/libs/iab-tcf/purpose-mapping.d.ts +153 -0
  63. package/dist/libs/iab-tcf/purpose-mapping.d.ts.map +1 -0
  64. package/dist/libs/iab-tcf/stacks.d.ts +139 -0
  65. package/dist/libs/iab-tcf/stacks.d.ts.map +1 -0
  66. package/dist/libs/iab-tcf/store.d.ts +41 -0
  67. package/dist/libs/iab-tcf/store.d.ts.map +1 -0
  68. package/dist/libs/iab-tcf/stub.d.ts +71 -0
  69. package/dist/libs/iab-tcf/stub.d.ts.map +1 -0
  70. package/dist/libs/iab-tcf/tc-string.d.ts +134 -0
  71. package/dist/libs/iab-tcf/tc-string.d.ts.map +1 -0
  72. package/dist/libs/iab-tcf/types.d.ts +297 -0
  73. package/dist/libs/iab-tcf/types.d.ts.map +1 -0
  74. package/dist/libs/iframe-blocker/store.d.ts +29 -11
  75. package/dist/libs/iframe-blocker/store.d.ts.map +1 -1
  76. package/dist/libs/init-consent-manager/iab-initializer.d.ts +26 -0
  77. package/dist/libs/init-consent-manager/iab-initializer.d.ts.map +1 -0
  78. package/dist/libs/init-consent-manager/index.d.ts +36 -0
  79. package/dist/libs/init-consent-manager/index.d.ts.map +1 -0
  80. package/dist/libs/init-consent-manager/store-updater.d.ts +27 -0
  81. package/dist/libs/init-consent-manager/store-updater.d.ts.map +1 -0
  82. package/dist/libs/init-consent-manager/types.d.ts +31 -0
  83. package/dist/libs/init-consent-manager/types.d.ts.map +1 -0
  84. package/dist/libs/init-consent-manager/utils.d.ts +14 -0
  85. package/dist/libs/init-consent-manager/utils.d.ts.map +1 -0
  86. package/dist/libs/jurisdiction.d.ts +8 -7
  87. package/dist/libs/jurisdiction.d.ts.map +1 -1
  88. package/dist/libs/network-blocker/core.d.ts +18 -0
  89. package/dist/libs/network-blocker/core.d.ts.map +1 -0
  90. package/dist/libs/network-blocker/index.d.ts +9 -0
  91. package/dist/libs/network-blocker/index.d.ts.map +1 -0
  92. package/dist/libs/network-blocker/store.d.ts +63 -0
  93. package/dist/libs/network-blocker/store.d.ts.map +1 -0
  94. package/dist/libs/network-blocker/types.d.ts +127 -0
  95. package/dist/libs/network-blocker/types.d.ts.map +1 -0
  96. package/dist/libs/save-consents.d.ts +28 -9
  97. package/dist/libs/save-consents.d.ts.map +1 -1
  98. package/dist/libs/script-loader/core.d.ts +51 -15
  99. package/dist/libs/script-loader/core.d.ts.map +1 -1
  100. package/dist/libs/script-loader/index.d.ts +1 -0
  101. package/dist/libs/script-loader/index.d.ts.map +1 -1
  102. package/dist/libs/script-loader/store.d.ts +18 -11
  103. package/dist/libs/script-loader/store.d.ts.map +1 -1
  104. package/dist/libs/script-loader/types.d.ts +73 -6
  105. package/dist/libs/script-loader/types.d.ts.map +1 -1
  106. package/dist/runtime/index.d.ts +24 -0
  107. package/dist/runtime/index.d.ts.map +1 -0
  108. package/dist/store/index.d.ts +57 -0
  109. package/dist/store/index.d.ts.map +1 -0
  110. package/dist/{store.initial-state.d.ts → store/initial-state.d.ts} +3 -3
  111. package/dist/store/initial-state.d.ts.map +1 -0
  112. package/dist/store/type.d.ts +632 -0
  113. package/dist/store/type.d.ts.map +1 -0
  114. package/dist/types/callbacks.d.ts +24 -4
  115. package/dist/types/callbacks.d.ts.map +1 -1
  116. package/dist/types/compliance.d.ts +4 -179
  117. package/dist/types/compliance.d.ts.map +1 -1
  118. package/dist/types/{gdpr.d.ts → consent-types.d.ts} +30 -9
  119. package/dist/types/consent-types.d.ts.map +1 -0
  120. package/dist/types/iab-tcf.d.ts +260 -0
  121. package/dist/types/iab-tcf.d.ts.map +1 -0
  122. package/dist/types/index.d.ts +4 -2
  123. package/dist/types/index.d.ts.map +1 -1
  124. package/dist/types/non-iab-vendor.d.ts +128 -0
  125. package/dist/types/non-iab-vendor.d.ts.map +1 -0
  126. package/dist/version.d.ts +1 -1
  127. package/dist/version.d.ts.map +1 -1
  128. package/package.json +72 -72
  129. package/LICENSE.md +0 -595
  130. package/dist/client/c15t/show-consent-banner.d.ts +0 -15
  131. package/dist/client/c15t/show-consent-banner.d.ts.map +0 -1
  132. package/dist/client/c15t/verify-consent.d.ts +0 -8
  133. package/dist/client/c15t/verify-consent.d.ts.map +0 -1
  134. package/dist/client/custom/identify-user.d.ts +0 -8
  135. package/dist/client/custom/identify-user.d.ts.map +0 -1
  136. package/dist/client/custom/show-consent-banner.d.ts +0 -8
  137. package/dist/client/custom/show-consent-banner.d.ts.map +0 -1
  138. package/dist/client/custom/verify-consent.d.ts +0 -8
  139. package/dist/client/custom/verify-consent.d.ts.map +0 -1
  140. package/dist/client/offline/identify-user.d.ts +0 -7
  141. package/dist/client/offline/identify-user.d.ts.map +0 -1
  142. package/dist/client/offline/show-consent-banner.d.ts +0 -8
  143. package/dist/client/offline/show-consent-banner.d.ts.map +0 -1
  144. package/dist/client/offline/verify-consent.d.ts +0 -7
  145. package/dist/client/offline/verify-consent.d.ts.map +0 -1
  146. package/dist/libs/consent-utils.d.ts +0 -32
  147. package/dist/libs/consent-utils.d.ts.map +0 -1
  148. package/dist/libs/fetch-consent-banner.d.ts +0 -31
  149. package/dist/libs/fetch-consent-banner.d.ts.map +0 -1
  150. package/dist/libs/gtm.d.ts +0 -100
  151. package/dist/libs/gtm.d.ts.map +0 -1
  152. package/dist/libs/identify-user.d.ts +0 -23
  153. package/dist/libs/identify-user.d.ts.map +0 -1
  154. package/dist/libs/tracking-blocker.d.ts +0 -79
  155. package/dist/libs/tracking-blocker.d.ts.map +0 -1
  156. package/dist/libs/tracking-domains.d.ts +0 -7
  157. package/dist/libs/tracking-domains.d.ts.map +0 -1
  158. package/dist/store.d.ts +0 -227
  159. package/dist/store.d.ts.map +0 -1
  160. package/dist/store.initial-state.d.ts.map +0 -1
  161. package/dist/store.type.d.ts +0 -287
  162. package/dist/store.type.d.ts.map +0 -1
  163. package/dist/types/gdpr.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # c15t
2
2
 
3
+ ## 2.0.0-rc.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 0bc4f86: fixed workspace resolving
8
+ - Updated dependencies [0bc4f86]
9
+ - @c15t/translations@2.0.0-rc.1
10
+ - @c15t/backend@2.0.0-rc.1
11
+ - @c15t/schema@2.0.0-rc.1
12
+
13
+ ## 2.0.0-rc.0
14
+
15
+ ### Major Changes
16
+
17
+ - 126a78b: https://v2.c15t.com/changelog/2026-02-12-v2.0.0-rc.0
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies [126a78b]
22
+ - @c15t/backend@2.0.0-rc.0
23
+ - @c15t/schema@2.0.0-rc.0
24
+ - @c15t/translations@2.0.0-rc.0
25
+
26
+ ## 2.0.0
27
+
28
+ ### Major Changes
29
+
30
+ - **Breaking:** `showPopup` and `isPrivacyDialogOpen` replaced with single `activeUI` enum (`'none' | 'banner' | 'dialog'`)
31
+ - **Breaking:** `setShowPopup()` and `setIsPrivacyDialogOpen()` replaced with `setActiveUI(ui, options?)`
32
+ - feat: add Quebec Law 25 support
33
+
34
+ ### Migration
35
+
36
+ | Before (1.x) | After (2.0) |
37
+ | ------------------------------- | ---------------------------------------- |
38
+ | `state.showPopup` | `state.activeUI === 'banner'` |
39
+ | `state.isPrivacyDialogOpen` | `state.activeUI === 'dialog'` |
40
+ | `setShowPopup(true, true)` | `setActiveUI('banner', { force: true })` |
41
+ | `setShowPopup(false)` | `setActiveUI('none')` |
42
+ | `setIsPrivacyDialogOpen(true)` | `setActiveUI('dialog')` |
43
+ | `setIsPrivacyDialogOpen(false)` | `setActiveUI('none')` |
44
+
3
45
  ## 1.8.3
4
46
 
5
47
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"fetcher.d.ts","sourceRoot":"","sources":["../../../src/client/c15t/fetcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,qBAAqB,IAAI,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAQhF;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,WAAW,CAAC,EAAE,OAAO,KAAK,CAAC;IAC3B,QAAQ,EAAE,WAAW,CAAC;IACtB,WAAW,EAAE,WAAW,CAAC;CACzB;AAcD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,IAA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AC,YAAY,CAAC,CAAC,CAiSxC"}
@@ -1,15 +1,21 @@
1
+ import type { StorageConfig } from '../../libs/cookie';
1
2
  import type { IdentifyUserRequestBody, IdentifyUserResponse } from '../client-interface';
2
3
  import type { FetchOptions, ResponseContext } from '../types';
3
4
  import type { FetcherContext } from './fetcher';
4
5
  /**
5
6
  * Provides offline mode fallback for identifyUser API.
6
- * Simulates the behavior of OfflineClient when API requests fail.
7
+ * Queues the identify request for retry on next page load.
7
8
  * @internal
8
9
  */
9
- export declare function offlineFallbackForIdentifyUser(storageConfig: import('../../libs/cookie').StorageConfig | undefined, options?: FetchOptions<IdentifyUserResponse, IdentifyUserRequestBody>): Promise<ResponseContext<IdentifyUserResponse>>;
10
+ export declare function offlineFallbackForIdentifyUser(options?: FetchOptions<IdentifyUserResponse, IdentifyUserRequestBody>): Promise<ResponseContext<IdentifyUserResponse>>;
10
11
  /**
11
- * Links a subject's external ID to a consent record by consent ID.
12
- * If the API request fails, falls back to offline mode behavior.
12
+ * Links an external user ID to a subject via PATCH /subjects/:id.
13
+ * Saves to storage first (optimistic), then makes API call with fallback.
14
+ *
15
+ * @param context - Fetcher context for API requests
16
+ * @param storageConfig - Storage configuration for cookie/localStorage
17
+ * @param options - Request options containing subjectId, externalId, and identityProvider
18
+ * @returns Response context with the updated subject
13
19
  */
14
- export declare function identifyUser(context: FetcherContext, storageConfig: import('../../libs/cookie').StorageConfig | undefined, options?: FetchOptions<IdentifyUserResponse, IdentifyUserRequestBody>): Promise<ResponseContext<IdentifyUserResponse>>;
20
+ export declare function identifyUser(context: FetcherContext, storageConfig: StorageConfig | undefined, options: FetchOptions<IdentifyUserResponse, IdentifyUserRequestBody>): Promise<ResponseContext<IdentifyUserResponse>>;
15
21
  //# sourceMappingURL=identify-user.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"identify-user.d.ts","sourceRoot":"","sources":["../../../src/client/c15t/identify-user.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,uBAAuB,EAC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E,YAAY,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GAClE,OAAO,CAAC,eAAe,CAAC,oBAAoB,CAAC,CAAC,CA+DhD"}
@@ -1,13 +1,18 @@
1
1
  /**
2
2
  * c15t backend implementation of the consent client interface.
3
3
  * This client makes HTTP requests to the c15t consent management backend.
4
+ *
5
+
4
6
  */
5
- import type { ConsentManagerInterface, IdentifyUserRequestBody, IdentifyUserResponse, SetConsentRequestBody, SetConsentResponse, ShowConsentBannerResponse, VerifyConsentRequestBody, VerifyConsentResponse } from '../client-interface';
7
+ import type { ConsentManagerInterface, IdentifyUserRequestBody, IdentifyUserResponse, InitResponse, SetConsentRequestBody, SetConsentResponse } from '../client-interface';
6
8
  import type { FetchOptions, ResponseContext } from '../types';
7
- import type { C15tClientOptions } from './types';
9
+ import type { C15tInternalClientOptions } from './types';
8
10
  /**
9
11
  * c15t backend implementation of the consent client interface.
10
12
  * Makes HTTP requests to the c15t consent management backend.
13
+ *
14
+ * @remarks
15
+ * v2.0: Subject-centric API. Use setConsent for all consent operations.
11
16
  */
12
17
  export declare class C15tClient implements ConsentManagerInterface {
13
18
  /**
@@ -20,6 +25,11 @@ export declare class C15tClient implements ConsentManagerInterface {
20
25
  * @internal
21
26
  */
22
27
  private readonly storageConfig?;
28
+ /**
29
+ * IAB configuration for offline/fallback mode
30
+ * @internal
31
+ */
32
+ private readonly iabConfig?;
23
33
  /**
24
34
  * Default headers to include with all requests
25
35
  * @internal
@@ -50,25 +60,28 @@ export declare class C15tClient implements ConsentManagerInterface {
50
60
  *
51
61
  * @param options - Configuration options for the client
52
62
  */
53
- constructor(options: C15tClientOptions);
63
+ constructor(options: C15tInternalClientOptions);
54
64
  /**
55
65
  * Checks if a consent banner should be shown.
56
66
  * If the API request fails, falls back to offline mode behavior.
57
67
  */
58
- showConsentBanner(options?: FetchOptions<ShowConsentBannerResponse>): Promise<ResponseContext<ShowConsentBannerResponse>>;
68
+ init(options?: FetchOptions<InitResponse>): Promise<ResponseContext<InitResponse>>;
59
69
  /**
60
70
  * Sets consent preferences for a subject.
61
71
  * If the API request fails, falls back to offline mode behavior.
72
+ *
73
+ * @remarks
74
+ * v2.0: This calls POST /subjects with a client-generated subjectId.
62
75
  */
63
76
  setConsent(options?: FetchOptions<SetConsentResponse, SetConsentRequestBody>): Promise<ResponseContext<SetConsentResponse>>;
64
77
  /**
65
- * Verifies if valid consent exists.
66
- */
67
- verifyConsent(options?: FetchOptions<VerifyConsentResponse, VerifyConsentRequestBody>): Promise<ResponseContext<VerifyConsentResponse>>;
68
- /**
69
- * Links a subject's external ID to a consent record by consent ID.
78
+ * Links an external user ID to a subject via PATCH /subjects/:id.
79
+ * Saves to storage first (optimistic), then makes API call with fallback.
80
+ *
81
+ * @remarks
82
+ * v2.0: Maps to PATCH /subjects/:id endpoint.
70
83
  */
71
- identifyUser(options?: FetchOptions<IdentifyUserResponse, IdentifyUserRequestBody>): Promise<ResponseContext<IdentifyUserResponse>>;
84
+ identifyUser(options: FetchOptions<IdentifyUserResponse, IdentifyUserRequestBody>): Promise<ResponseContext<IdentifyUserResponse>>;
72
85
  /**
73
86
  * Makes a custom API request to any endpoint.
74
87
  */
@@ -84,15 +97,15 @@ export declare class C15tClient implements ConsentManagerInterface {
84
97
  */
85
98
  private processPendingConsentSubmissions;
86
99
  /**
87
- * Check for pending identify-user submissions on initialization
100
+ * Check for pending identify user submissions on initialization
88
101
  * @internal
89
102
  */
90
- private checkPendingIdentifyUserSubmissions;
103
+ private checkPendingIdentifySubmissions;
91
104
  /**
92
- * Process pending identify-user submissions
105
+ * Process pending identify user submissions
93
106
  * @internal
94
107
  */
95
- private processPendingIdentifyUserSubmissions;
108
+ private processPendingIdentifySubmissions;
96
109
  }
97
- export type { C15tClientOptions } from './types';
110
+ export type { C15tInternalClientOptions } from './types';
98
111
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/c15t/index.ts"],"names":[],"mappings":"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,CAAiC;IAEpD;;;OAGG;IACH,OAAO,CAAC,cAAc,CAAiB;IAEvC;;;;OAIG;gBACS,OAAO,EAAE,yBAAyB;IAsD9C;;;OAGG;IACG,IAAI,CACT,OAAO,CAAC,EAAE,YAAY,CAAC,YAAY,CAAC,GAClC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;IAIzC;;;;;;OAMG;IACG,UAAU,CACf,OAAO,CAAC,EAAE,YAAY,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAC/D,OAAO,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;IAI/C;;;;;;OAMG;IACG,YAAY,CACjB,OAAO,EAAE,YAAY,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GAClE,OAAO,CAAC,eAAe,CAAC,oBAAoB,CAAC,CAAC;IAIjD;;OAEG;IACG,MAAM,CAAC,YAAY,EAAE,QAAQ,GAAG,OAAO,EAAE,SAAS,GAAG,OAAO,EACjE,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,YAAY,CAAC,YAAY,EAAE,QAAQ,EAAE,SAAS,CAAC,GACvD,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;IAQzC;;;OAGG;IACH,OAAO,CAAC,8BAA8B;IAMtC;;;OAGG;YACW,gCAAgC;IAM9C;;;OAGG;IACH,OAAO,CAAC,+BAA+B;IAMvC;;;OAGG;YACW,iCAAiC;CAK/C;AAGD,YAAY,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { InitResponse } from '../client-interface';
2
+ import type { FetchOptions, ResponseContext } from '../types';
3
+ import type { FetcherContext } from './fetcher';
4
+ import type { IABFallbackConfig } from './types';
5
+ /**
6
+ * Provides offline mode fallback for showConsentBanner API.
7
+ * Simulates the behavior of OfflineClient when API requests fail.
8
+ * In fallback mode, fetches GVL from gvl.consent.io when IAB is enabled.
9
+ * @internal
10
+ */
11
+ export declare function offlineFallbackForConsentBanner(options?: FetchOptions<InitResponse>, iabConfig?: IABFallbackConfig): Promise<ResponseContext<InitResponse>>;
12
+ /**
13
+ * Checks if a consent banner should be shown.
14
+ * If the API request fails, falls back to offline mode behavior.
15
+ */
16
+ export declare function init(context: FetcherContext, options?: FetchOptions<InitResponse>, iabConfig?: IABFallbackConfig): Promise<ResponseContext<InitResponse>>;
17
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/client/c15t/init.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD;;;;;GAKG;AACH,wBAAsB,+BAA+B,CACpD,OAAO,CAAC,EAAE,YAAY,CAAC,YAAY,CAAC,EACpC,SAAS,CAAC,EAAE,iBAAiB,GAC3B,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAsCxC;AAED;;;GAGG;AACH,wBAAsB,IAAI,CACzB,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE,YAAY,CAAC,YAAY,CAAC,EACpC,SAAS,CAAC,EAAE,iBAAiB,GAC3B,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CA0BxC"}
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Pending submissions management for offline fallback.
3
+ *
4
+ * @packageDocumentation
5
+ */
1
6
  import type { IdentifyUserRequestBody, SetConsentRequestBody } from '../client-interface';
2
7
  import type { FetcherContext } from './fetcher';
3
8
  /**
@@ -11,13 +16,13 @@ export declare function checkPendingConsentSubmissions(_context: FetcherContext,
11
16
  */
12
17
  export declare function processPendingConsentSubmissions(context: FetcherContext, submissions: SetConsentRequestBody[]): Promise<void>;
13
18
  /**
14
- * Check for pending identify-user submissions on initialization
19
+ * Check for pending identify user submissions on initialization
15
20
  * @internal
16
21
  */
17
- export declare function checkPendingIdentifyUserSubmissions(_context: FetcherContext, processPendingSubmissions: (submissions: IdentifyUserRequestBody[]) => Promise<void>): void;
22
+ export declare function checkPendingIdentifySubmissions(_context: FetcherContext, processPendingSubmissions: (submissions: IdentifyUserRequestBody[]) => Promise<void>): void;
18
23
  /**
19
- * Process pending identify-user submissions
24
+ * Process pending identify user submissions
20
25
  * @internal
21
26
  */
22
- export declare function processPendingIdentifyUserSubmissions(context: FetcherContext, submissions: IdentifyUserRequestBody[]): Promise<void>;
27
+ export declare function processPendingIdentifySubmissions(context: FetcherContext, submissions: IdentifyUserRequestBody[]): Promise<void>;
23
28
  //# sourceMappingURL=pending-submissions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pending-submissions.d.ts","sourceRoot":"","sources":["../../../src/client/c15t/pending-submissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,uBAAuB,EAEvB,qBAAqB,EAErB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAIhD;;;GAGG;AACH,wBAAgB,8BAA8B,CAC7C,QAAQ,EAAE,cAAc,EACxB,yBAAyB,EAAE,CAC1B,WAAW,EAAE,qBAAqB,EAAE,KAChC,OAAO,CAAC,IAAI,CAAC,QA0ClB;AAED;;;GAGG;AACH,wBAAsB,gCAAgC,CACrD,OAAO,EAAE,cAAc,EACvB,WAAW,EAAE,qBAAqB,EAAE,iBAyEpC;AAED;;;GAGG;AACH,wBAAgB,mCAAmC,CAClD,QAAQ,EAAE,cAAc,EACxB,yBAAyB,EAAE,CAC1B,WAAW,EAAE,uBAAuB,EAAE,KAClC,OAAO,CAAC,IAAI,CAAC,QA6ClB;AAED;;;GAGG;AACH,wBAAsB,qCAAqC,CAC1D,OAAO,EAAE,cAAc,EACvB,WAAW,EAAE,uBAAuB,EAAE,iBA8EtC"}
1
+ {"version":3,"file":"pending-submissions.d.ts","sourceRoot":"","sources":["../../../src/client/c15t/pending-submissions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACX,uBAAuB,EAEvB,qBAAqB,EAErB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAOhD;;;GAGG;AACH,wBAAgB,8BAA8B,CAC7C,QAAQ,EAAE,cAAc,EACxB,yBAAyB,EAAE,CAC1B,WAAW,EAAE,qBAAqB,EAAE,KAChC,OAAO,CAAC,IAAI,CAAC,QA0ClB;AAED;;;GAGG;AACH,wBAAsB,gCAAgC,CACrD,OAAO,EAAE,cAAc,EACvB,WAAW,EAAE,qBAAqB,EAAE,iBA0EpC;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAC9C,QAAQ,EAAE,cAAc,EACxB,yBAAyB,EAAE,CAC1B,WAAW,EAAE,uBAAuB,EAAE,KAClC,OAAO,CAAC,IAAI,CAAC,QAmClB;AAED;;;GAGG;AACH,wBAAsB,iCAAiC,CACtD,OAAO,EAAE,cAAc,EACvB,WAAW,EAAE,uBAAuB,EAAE,iBAkFtC"}
@@ -1 +1 @@
1
- {"version":3,"file":"set-consent.d.ts","sourceRoot":"","sources":["../../../src/client/c15t/set-consent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,qBAAqB,EACrB,kBAAkB,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAIhD;;;;GAIG;AACH,wBAAsB,4BAA4B,CACjD,aAAa,EAAE,OAAO,mBAAmB,EAAE,aAAa,GAAG,SAAS,EACpE,OAAO,CAAC,EAAE,YAAY,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAC/D,OAAO,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC,CAyF9C;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAC/B,OAAO,EAAE,cAAc,EACvB,aAAa,EAAE,OAAO,mBAAmB,EAAE,aAAa,GAAG,SAAS,EACpE,OAAO,CAAC,EAAE,YAAY,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAC/D,OAAO,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC,CA+B9C"}
1
+ {"version":3,"file":"set-consent.d.ts","sourceRoot":"","sources":["../../../src/client/c15t/set-consent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,qBAAqB,EACrB,kBAAkB,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAIhD;;;;GAIG;AACH,wBAAsB,4BAA4B,CACjD,aAAa,EAAE,OAAO,mBAAmB,EAAE,aAAa,GAAG,SAAS,EACpE,OAAO,CAAC,EAAE,YAAY,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAC/D,OAAO,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC,CAiF9C;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAC/B,OAAO,EAAE,cAAc,EACvB,aAAa,EAAE,OAAO,mBAAmB,EAAE,aAAa,GAAG,SAAS,EACpE,OAAO,CAAC,EAAE,YAAY,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAC/D,OAAO,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC,CA6B9C"}
@@ -1,7 +1,26 @@
1
+ import type { GlobalVendorList } from '../../types/iab-tcf';
2
+ /**
3
+ * IAB configuration for offline/fallback mode GVL fetching.
4
+ */
5
+ export interface IABFallbackConfig {
6
+ /**
7
+ * Whether IAB mode is enabled on the client.
8
+ */
9
+ enabled: boolean;
10
+ /**
11
+ * Vendor IDs to fetch from GVL endpoint.
12
+ */
13
+ vendorIds?: number[];
14
+ /**
15
+ * Pre-loaded Global Vendor List for testing or SSR.
16
+ * When provided, skips network fetch entirely.
17
+ */
18
+ gvl?: GlobalVendorList;
19
+ }
1
20
  /**
2
21
  * Configuration options for the c15t backend client
3
22
  */
4
- export interface C15tClientOptions {
23
+ export interface C15tInternalClientOptions {
5
24
  /**
6
25
  * Backend URL for API endpoints. Can be absolute or relative.
7
26
  *
@@ -31,5 +50,11 @@ export interface C15tClientOptions {
31
50
  * Storage configuration for offline fallback
32
51
  */
33
52
  storageConfig?: import('../../libs/cookie').StorageConfig;
53
+ /**
54
+ * IAB configuration for offline/fallback mode.
55
+ * When the backend is unavailable and IAB is enabled,
56
+ * the client will fetch GVL from gvl.consent.io with these settings.
57
+ */
58
+ iabConfig?: IABFallbackConfig;
34
59
  }
35
60
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/client/c15t/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjC;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,KAAK,CAAC;IAE3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC;IAEvB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,UAAU,EAAE,WAAW,CAAC;IAE7C;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,mBAAmB,EAAE,aAAa,CAAC;CAC1D"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/client/c15t/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAErB;;;OAGG;IACH,GAAG,CAAC,EAAE,gBAAgB,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjC;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,KAAK,CAAC;IAE3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC;IAEvB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,UAAU,EAAE,WAAW,CAAC;IAE7C;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,mBAAmB,EAAE,aAAa,CAAC;IAE1D;;;;OAIG;IACH,SAAS,CAAC,EAAE,iBAAiB,CAAC;CAC9B"}
@@ -3,7 +3,7 @@
3
3
  * This module provides the main factory function for creating
4
4
  * client instances based on configuration options.
5
5
  */
6
- import type { StoreOptions } from '../store';
6
+ import type { StoreOptions } from '../store/type';
7
7
  import type { ConsentManagerInterface } from './client-interface';
8
8
  import { type EndpointHandlers } from './custom';
9
9
  import type { RetryConfig } from './types';
@@ -164,4 +164,11 @@ export type ConsentManagerOptions = {
164
164
  * ```
165
165
  */
166
166
  export declare function configureConsentManager(options: ConsentManagerOptions): ConsentManagerInterface;
167
+ /**
168
+ * Clears the internal client registry cache.
169
+ *
170
+ * This is primarily useful for testing scenarios where different
171
+ * configurations need fresh client instances between tests.
172
+ */
173
+ export declare function clearClientRegistry(): void;
167
174
  //# sourceMappingURL=client-factory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client-factory.d.ts","sourceRoot":"","sources":["../../src/client/client-factory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,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AW,CAAC,EAAE,OAAO,KAAK,CAAC;IAE3B;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAClC;;OAEG;IACH,IAAI,EAAE,SAAS,CAAC;IAEhB;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC;IAEhB;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IACnC,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB;;;;;;;;;;;;;;;;;;OAkBG;IACH,aAAa,CAAC,EAAE,OAAO,gBAAgB,EAAE,aAAa,CAAC;CACvD,GAAG,CAAC,mBAAmB,GAAG,iBAAiB,GAAG,oBAAoB,CAAC,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,wBAAgB,uBAAuB,CACtC,OAAO,EAAE,qBAAqB,GAC5B,uBAAuB,CA8FzB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C"}
@@ -2,21 +2,33 @@
2
2
  * Core client interface for consent management.
3
3
  * This interface defines the methods that any consent client must implement.
4
4
  */
5
- import type { ContractsInputs, ContractsOutputs } from '@c15t/backend';
5
+ import type { CheckConsentOutput, CheckConsentQuery, GetSubjectInput, GetSubjectOutput, InitOutput, ListSubjectsOutput, ListSubjectsQuery, PatchSubjectFullInput, PatchSubjectOutput, PostSubjectInput, PostSubjectOutput } from '@c15t/schema/types';
6
6
  import type { FetchOptions, ResponseContext } from './types';
7
- export type SetConsentRequestBody = ContractsInputs['consent']['post'];
8
- export type SetConsentResponse = ContractsOutputs['consent']['post'];
9
- export type ShowConsentBannerResponse = ContractsOutputs['consent']['showBanner'];
10
- export type VerifyConsentRequestBody = ContractsInputs['consent']['verify'];
11
- export type VerifyConsentResponse = ContractsOutputs['consent']['verify'];
12
- export type IdentifyUserRequestBody = ContractsInputs['consent']['identify'];
13
- export type IdentifyUserResponse = ContractsOutputs['consent']['identify'];
7
+ export type { PostSubjectInput, PostSubjectOutput };
8
+ export type { GetSubjectInput, GetSubjectOutput };
9
+ export type { PatchSubjectFullInput, PatchSubjectOutput };
10
+ export type { ListSubjectsQuery, ListSubjectsOutput };
11
+ export type { CheckConsentQuery, CheckConsentOutput };
12
+ /**
13
+ * Request body for setConsent.
14
+ */
15
+ export type SetConsentRequestBody = PostSubjectInput;
16
+ /**
17
+ * Response from setConsent.
18
+ */
19
+ export type SetConsentResponse = PostSubjectOutput;
20
+ /**
21
+ * Request body for identifyUser (links external ID to subject).
22
+ * Requires subjectId in path, externalId and identityProvider in body.
23
+ */
24
+ export type IdentifyUserRequestBody = PatchSubjectFullInput;
25
+ /**
26
+ * Response from identifyUser.
27
+ */
28
+ export type IdentifyUserResponse = PatchSubjectOutput;
29
+ export type InitResponse = InitOutput;
14
30
  /**
15
31
  * Core interface that all consent management clients must implement
16
- *
17
- * @remarks
18
- * This interface defines the standard methods for interacting with
19
- * consent management functionality, regardless of implementation.
20
32
  */
21
33
  export interface ConsentManagerInterface {
22
34
  /**
@@ -25,7 +37,7 @@ export interface ConsentManagerInterface {
25
37
  * @param options - Optional request configuration
26
38
  * @returns Response with information about whether to show the consent banner
27
39
  */
28
- showConsentBanner(options?: FetchOptions<ShowConsentBannerResponse>): Promise<ResponseContext<ShowConsentBannerResponse>>;
40
+ init(options?: FetchOptions<InitResponse>): Promise<ResponseContext<InitResponse>>;
29
41
  /**
30
42
  * Sets consent preferences for a subject.
31
43
  *
@@ -34,19 +46,12 @@ export interface ConsentManagerInterface {
34
46
  */
35
47
  setConsent(options?: FetchOptions<SetConsentResponse, SetConsentRequestBody>): Promise<ResponseContext<SetConsentResponse>>;
36
48
  /**
37
- * Verifies if valid consent exists.
38
- *
39
- * @param options - Optional request configuration with verification criteria
40
- * @returns Response with consent verification status
41
- */
42
- verifyConsent(options?: FetchOptions<VerifyConsentResponse, VerifyConsentRequestBody>): Promise<ResponseContext<VerifyConsentResponse>>;
43
- /**
44
- * Links a subject's external ID to a consent record by consent ID.
49
+ * Links an external user ID to a subject (PATCH /subjects/:id).
45
50
  *
46
- * @param options - Optional request configuration with consent ID and external ID
47
- * @returns Response confirming the user was identified
51
+ * @param options - Request configuration with subjectId, externalId, and identityProvider
52
+ * @returns Response confirming the subject was updated
48
53
  */
49
- identifyUser(options?: FetchOptions<IdentifyUserResponse, IdentifyUserRequestBody>): Promise<ResponseContext<IdentifyUserResponse>>;
54
+ identifyUser(options: FetchOptions<IdentifyUserResponse, IdentifyUserRequestBody>): Promise<ResponseContext<IdentifyUserResponse>>;
50
55
  /**
51
56
  * Makes a custom API request to any endpoint.
52
57
  *
@@ -1 +1 @@
1
- {"version":3,"file":"client-interface.d.ts","sourceRoot":"","sources":["../../src/client/client-interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE7D,MAAM,MAAM,qBAAqB,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AACvE,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AACrE,MAAM,MAAM,yBAAyB,GACpC,gBAAgB,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC;AAC3C,MAAM,MAAM,wBAAwB,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC;AAC5E,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC;AAC1E,MAAM,MAAM,uBAAuB,GAAG,e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AAA;KAAE,CAAC;CACrE;AAED;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,EAAE,OAAO,CAAC;CACf"}
@@ -1,13 +1,18 @@
1
1
  /**
2
2
  * Custom implementation of the consent client interface.
3
3
  * This client uses provided handlers instead of making HTTP requests.
4
+ *
5
+
4
6
  */
5
- import type { ConsentManagerInterface, IdentifyUserRequestBody, IdentifyUserResponse, SetConsentRequestBody, SetConsentResponse, ShowConsentBannerResponse, VerifyConsentRequestBody, VerifyConsentResponse } from '../client-interface';
7
+ import type { ConsentManagerInterface, IdentifyUserRequestBody, IdentifyUserResponse, InitResponse, SetConsentRequestBody, SetConsentResponse } from '../client-interface';
6
8
  import type { FetchOptions, ResponseContext } from '../types';
7
9
  import type { CustomClientOptions, EndpointHandler } from './types';
8
10
  /**
9
11
  * Custom implementation of the consent client interface.
10
12
  * Uses provided handlers instead of making HTTP requests.
13
+ *
14
+ * @remarks
15
+ * v2.0: Subject-centric API. Use setConsent for all consent operations.
11
16
  */
12
17
  export declare class CustomClient implements ConsentManagerInterface {
13
18
  /**
@@ -29,19 +34,21 @@ export declare class CustomClient implements ConsentManagerInterface {
29
34
  /**
30
35
  * Checks if a consent banner should be shown.
31
36
  */
32
- showConsentBanner(options?: FetchOptions<ShowConsentBannerResponse>): Promise<ResponseContext<ShowConsentBannerResponse>>;
37
+ init(options?: FetchOptions<InitResponse>): Promise<ResponseContext<InitResponse>>;
33
38
  /**
34
39
  * Sets consent preferences for a subject.
40
+ *
41
+ * @remarks
42
+ * v2.0: This uses the subject endpoint handler.
35
43
  */
36
44
  setConsent(options?: FetchOptions<SetConsentResponse, SetConsentRequestBody>): Promise<ResponseContext<SetConsentResponse>>;
37
45
  /**
38
- * Verifies if valid consent exists.
39
- */
40
- verifyConsent(options?: FetchOptions<VerifyConsentResponse, VerifyConsentRequestBody>): Promise<ResponseContext<VerifyConsentResponse>>;
41
- /**
42
- * Links a subject's external ID to a consent record by consent ID.
46
+ * Links an external user ID to a subject.
47
+ *
48
+ * @remarks
49
+ * v2.0: Uses identifyUser endpoint handler if provided, otherwise falls back to $fetch.
43
50
  */
44
- identifyUser(options?: FetchOptions<IdentifyUserResponse, IdentifyUserRequestBody>): Promise<ResponseContext<IdentifyUserResponse>>;
51
+ identifyUser(options: FetchOptions<IdentifyUserResponse, IdentifyUserRequestBody>): Promise<ResponseContext<IdentifyUserResponse>>;
45
52
  /**
46
53
  * Registers a dynamic endpoint handler
47
54
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/custom/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,yBAAyB,EACzB,wBAAwB,EACxB,qBAAqB,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAK9D,OAAO,KAAK,EACX,mBAAmB,EACnB,eAAe,EAEf,MAAM,SAAS,CAAC;AAGjB;;;GAGG;AACH,qBAAa,YAAa,YAAW,uBAAuB;IAC3D;;;OAGG;IACH,OAAO,CAAC,gBAAgB,CAAmB;IAE3C;;;OAGG;IACH,OAAO,CAAC,eAAe,CAGhB;IAEP;;;;OAIG;gBACS,OAAO,EAAE,mBAAmB;IAIxC;;OAEG;IACG,iBAAiB,CACtB,OAAO,CAAC,EAAE,YAAY,CAAC,yBAAyB,CAAC,GAC/C,OAAO,CAAC,eAAe,CAAC,yBAAyB,CAAC,CAAC;IAItD;;OAEG;IACG,UAAU,CACf,OAAO,CAAC,EAAE,YAAY,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAC/D,OAAO,CAAC,eAAe,CAAC,kBAAkB,CA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,gBAAgB,CAAmB;IAE3C;;;OAGG;IACH,OAAO,CAAC,eAAe,CAGhB;IAEP;;;;OAIG;gBACS,OAAO,EAAE,mBAAmB;IAIxC;;OAEG;IACG,IAAI,CACT,OAAO,CAAC,EAAE,YAAY,CAAC,YAAY,CAAC,GAClC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;IAIzC;;;;;OAKG;IACG,UAAU,CACf,OAAO,CAAC,EAAE,YAAY,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAC/D,OAAO,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;IAI/C;;;;;OAKG;IACG,YAAY,CACjB,OAAO,EAAE,YAAY,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GAClE,OAAO,CAAC,eAAe,CAAC,oBAAoB,CAAC,CAAC;IAwBjD;;OAEG;IACH,eAAe,CAAC,YAAY,EAAE,QAAQ,GAAG,OAAO,EAAE,SAAS,GAAG,OAAO,EACpE,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,eAAe,CAAC,YAAY,EAAE,QAAQ,EAAE,SAAS,CAAC,GACzD,IAAI;IAQP;;OAEG;IACG,MAAM,CAAC,YAAY,EAAE,QAAQ,GAAG,OAAO,EAAE,SAAS,GAAG,OAAO,EACjE,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,YAAY,CAAC,YAAY,EAAE,QAAQ,EAAE,SAAS,CAAC,GACvD,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;CAazC;AAGD,YAAY,EACX,mBAAmB,EACnB,eAAe,EACf,gBAAgB,GAChB,MAAM,SAAS,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { InitResponse } from '../client-interface';
2
+ import type { FetchOptions, ResponseContext } from '../types';
3
+ import type { EndpointHandlers } from './types';
4
+ /**
5
+ * Initializes consent manager by fetching jurisdiction, location, translations, and branding information.
6
+ */
7
+ export declare function init(endpointHandlers: EndpointHandlers, options?: FetchOptions<InitResponse>): Promise<ResponseContext<InitResponse>>;
8
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/client/custom/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGhD;;GAEG;AACH,wBAAsB,IAAI,CACzB,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,CAAC,EAAE,YAAY,CAAC,YAAY,CAAC,GAClC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAaxC"}
@@ -1,4 +1,8 @@
1
- import type { IdentifyUserRequestBody, IdentifyUserResponse, SetConsentRequestBody, SetConsentResponse, ShowConsentBannerResponse, VerifyConsentRequestBody, VerifyConsentResponse } from '../client-interface';
1
+ /**
2
+ * Types for the custom client.
3
+ * @packageDocumentation
4
+ */
5
+ import type { IdentifyUserRequestBody, IdentifyUserResponse, InitResponse, SetConsentRequestBody, SetConsentResponse } from '../client-interface';
2
6
  import type { FetchOptions, ResponseContext } from '../types';
3
7
  /**
4
8
  * Handler function for a specific endpoint
@@ -9,21 +13,18 @@ export type EndpointHandler<ResponseType = unknown, BodyType = unknown, QueryTyp
9
13
  */
10
14
  export interface EndpointHandlers {
11
15
  /**
12
- * Handler for the showConsentBanner endpoint
16
+ * Handler for the init endpoint.
13
17
  */
14
- showConsentBanner: EndpointHandler<ShowConsentBannerResponse>;
18
+ init?: EndpointHandler<InitResponse>;
15
19
  /**
16
- * Handler for the setConsent endpoint
20
+ * Handler for the setConsent endpoint.
17
21
  */
18
22
  setConsent: EndpointHandler<SetConsentResponse, SetConsentRequestBody>;
19
23
  /**
20
- * Handler for the verifyConsent endpoint
21
- */
22
- verifyConsent: EndpointHandler<VerifyConsentResponse, VerifyConsentRequestBody>;
23
- /**
24
- * Handler for the identifyUser endpoint
24
+ * Handler for the identifyUser endpoint (PATCH /subjects/:id).
25
+ * @remarks v2.0: Links external ID to a subject.
25
26
  */
26
- identifyUser: EndpointHandler<IdentifyUserResponse, IdentifyUserRequestBody>;
27
+ identifyUser?: EndpointHandler<IdentifyUserResponse, IdentifyUserRequestBody>;
27
28
  }
28
29
  /**
29
30
  * Configuration options for the custom client
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/client/custom/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,yBAAyB,EACzB,wBAAwB,EACxB,qBAAqB,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,eAAe,CAC1B,YAAY,GAAG,OAAO,EACtB,QAAQ,GAAG,OAAO,EAClB,SAAS,GAAG,OAAO,IAChB,CACH,OAAO,CAAC,EAAE,YAAY,CAAC,YAAY,EAAE,QAAQ,EAAE,SAAS,CAAC,KACrD,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,iBAAiB,EAAE,eAAe,CAAC,yBAAyB,CAAC,CAAC;IAE9D;;OAEG;IACH,UAAU,EAAE,eAAe,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,CAAC;IAEvE;;OAEG;IACH,aAAa,EAAE,eAAe,CAC7B,qBAAqB,EACrB,wBAAwB,CACxB,CAAC;IAEF;;OAEG;IACH,YAAY,EAAE,eAAe,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,CAAC;CAC7E;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC;;OAEG;IACH,gBAAgB,EAAE,gBAAgB,CAAC;CACnC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/client/custom/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,uBAAuB,EACvB,oBAAoB,EACpB,YAAY,EACZ,qBAAqB,EACrB,kBAAkB,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,eAAe,CAC1B,YAAY,GAAG,OAAO,EACtB,QAAQ,GAAG,OAAO,EAClB,SAAS,GAAG,OAAO,IAChB,CACH,OAAO,CAAC,EAAE,YAAY,CAAC,YAAY,EAAE,QAAQ,EAAE,SAAS,CAAC,KACrD,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;IAErC;;OAEG;IACH,UAAU,EAAE,eAAe,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,CAAC;IAEvE;;;OAGG;IACH,YAAY,CAAC,EAAE,eAAe,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,CAAC;CAC9E;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC;;OAEG;IACH,gBAAgB,EAAE,gBAAgB,CAAC;CACnC"}
@@ -2,8 +2,9 @@
2
2
  * Client exports for consent management.
3
3
  * This file provides a centralized export point for all client-related functionality.
4
4
  */
5
- export { C15tClient, type C15tClientOptions, } from './c15t';
6
- export { type ConsentManagerInterface, type ConsentManagerOptions, configureConsentManager, } from './client-factory';
5
+ export { C15tClient, type C15tInternalClientOptions, } from './c15t';
6
+ export { type ConsentManagerInterface, type ConsentManagerOptions, clearClientRegistry, configureConsentManager, } from './client-factory';
7
+ export type { IdentifyUserRequestBody, IdentifyUserResponse, InitResponse, SetConsentRequestBody, SetConsentResponse, } from './client-interface';
7
8
  export { CustomClient, type CustomClientOptions, type EndpointHandler, } from './custom';
8
9
  export { OfflineClient, type OfflineClientOptions, } from './offline';
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,UAAU,EACV,KAAK,iBAAiB,GACtB,MAAM,QAAQ,CAAC;AAChB,OAAO,EACN,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,uBAAuB,GACvB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACN,YAAY,EACZ,KAAK,mBAAmB,EACxB,KAAK,eAAe,GACpB,MAAM,UAAU,CAAC;AAGlB,OAAO,EACN,aAAa,EACb,KAAK,oBAAoB,GACzB,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,UAAU,EACV,KAAK,yBAAyB,GAC9B,MAAM,QAAQ,CAAC;AAChB,OAAO,EACN,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,mBAAmB,EACnB,uBAAuB,GACvB,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACX,uBAAuB,EACvB,oBAAoB,EACpB,YAAY,EACZ,qBAAqB,EACrB,kBAAkB,GAClB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACN,YAAY,EACZ,KAAK,mBAAmB,EACxB,KAAK,eAAe,GACpB,MAAM,UAAU,CAAC;AAGlB,OAAO,EACN,aAAa,EACb,KAAK,oBAAoB,GACzB,MAAM,WAAW,CAAC"}