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.
- package/CHANGELOG.md +42 -0
- package/dist/client/c15t/fetcher.d.ts.map +1 -1
- package/dist/client/c15t/identify-user.d.ts +11 -5
- package/dist/client/c15t/identify-user.d.ts.map +1 -1
- package/dist/client/c15t/index.d.ts +28 -15
- package/dist/client/c15t/index.d.ts.map +1 -1
- package/dist/client/c15t/init.d.ts +17 -0
- package/dist/client/c15t/init.d.ts.map +1 -0
- package/dist/client/c15t/pending-submissions.d.ts +9 -4
- package/dist/client/c15t/pending-submissions.d.ts.map +1 -1
- package/dist/client/c15t/set-consent.d.ts.map +1 -1
- package/dist/client/c15t/types.d.ts +26 -1
- package/dist/client/c15t/types.d.ts.map +1 -1
- package/dist/client/client-factory.d.ts +8 -1
- package/dist/client/client-factory.d.ts.map +1 -1
- package/dist/client/client-interface.d.ts +29 -24
- package/dist/client/client-interface.d.ts.map +1 -1
- package/dist/client/custom/index.d.ts +15 -8
- package/dist/client/custom/index.d.ts.map +1 -1
- package/dist/client/custom/init.d.ts +8 -0
- package/dist/client/custom/init.d.ts.map +1 -0
- package/dist/client/custom/types.d.ts +11 -10
- package/dist/client/custom/types.d.ts.map +1 -1
- package/dist/client/index.d.ts +3 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/offline/index.d.ts +20 -8
- package/dist/client/offline/index.d.ts.map +1 -1
- package/dist/client/offline/init.d.ts +10 -0
- package/dist/client/offline/init.d.ts.map +1 -0
- package/dist/client/offline/set-consent.d.ts +3 -0
- package/dist/client/offline/set-consent.d.ts.map +1 -1
- package/dist/client/offline/types.d.ts +9 -3
- package/dist/client/offline/types.d.ts.map +1 -1
- package/dist/client/types.d.ts +19 -10
- package/dist/client/types.d.ts.map +1 -1
- package/dist/index.cjs +3663 -2546
- package/dist/index.d.ts +10 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2490 -1375
- package/dist/libs/cookie/key-mapping.d.ts +5 -1
- package/dist/libs/cookie/key-mapping.d.ts.map +1 -1
- package/dist/libs/cookie/storage.d.ts +3 -1
- package/dist/libs/cookie/storage.d.ts.map +1 -1
- package/dist/libs/debug.d.ts +32 -0
- package/dist/libs/debug.d.ts.map +1 -0
- package/dist/libs/determine-model.d.ts +14 -0
- package/dist/libs/determine-model.d.ts.map +1 -0
- package/dist/libs/generate-subject-id.d.ts +54 -0
- package/dist/libs/generate-subject-id.d.ts.map +1 -0
- package/dist/libs/global-privacy-control.d.ts +1 -1
- package/dist/libs/global-privacy-control.d.ts.map +1 -1
- package/dist/libs/iab-tcf/cmp-api.d.ts +37 -0
- package/dist/libs/iab-tcf/cmp-api.d.ts.map +1 -0
- package/dist/libs/iab-tcf/cmp-defaults.d.ts +10 -0
- package/dist/libs/iab-tcf/cmp-defaults.d.ts.map +1 -0
- package/dist/libs/iab-tcf/fetch-gvl.d.ts +71 -0
- package/dist/libs/iab-tcf/fetch-gvl.d.ts.map +1 -0
- package/dist/libs/iab-tcf/index.d.ts +19 -0
- package/dist/libs/iab-tcf/index.d.ts.map +1 -0
- package/dist/libs/iab-tcf/lazy-load.d.ts +55 -0
- package/dist/libs/iab-tcf/lazy-load.d.ts.map +1 -0
- package/dist/libs/iab-tcf/purpose-mapping.d.ts +153 -0
- package/dist/libs/iab-tcf/purpose-mapping.d.ts.map +1 -0
- package/dist/libs/iab-tcf/stacks.d.ts +139 -0
- package/dist/libs/iab-tcf/stacks.d.ts.map +1 -0
- package/dist/libs/iab-tcf/store.d.ts +41 -0
- package/dist/libs/iab-tcf/store.d.ts.map +1 -0
- package/dist/libs/iab-tcf/stub.d.ts +71 -0
- package/dist/libs/iab-tcf/stub.d.ts.map +1 -0
- package/dist/libs/iab-tcf/tc-string.d.ts +134 -0
- package/dist/libs/iab-tcf/tc-string.d.ts.map +1 -0
- package/dist/libs/iab-tcf/types.d.ts +297 -0
- package/dist/libs/iab-tcf/types.d.ts.map +1 -0
- package/dist/libs/iframe-blocker/store.d.ts +29 -11
- package/dist/libs/iframe-blocker/store.d.ts.map +1 -1
- package/dist/libs/init-consent-manager/iab-initializer.d.ts +26 -0
- package/dist/libs/init-consent-manager/iab-initializer.d.ts.map +1 -0
- package/dist/libs/init-consent-manager/index.d.ts +36 -0
- package/dist/libs/init-consent-manager/index.d.ts.map +1 -0
- package/dist/libs/init-consent-manager/store-updater.d.ts +27 -0
- package/dist/libs/init-consent-manager/store-updater.d.ts.map +1 -0
- package/dist/libs/init-consent-manager/types.d.ts +31 -0
- package/dist/libs/init-consent-manager/types.d.ts.map +1 -0
- package/dist/libs/init-consent-manager/utils.d.ts +14 -0
- package/dist/libs/init-consent-manager/utils.d.ts.map +1 -0
- package/dist/libs/jurisdiction.d.ts +8 -7
- package/dist/libs/jurisdiction.d.ts.map +1 -1
- package/dist/libs/network-blocker/core.d.ts +18 -0
- package/dist/libs/network-blocker/core.d.ts.map +1 -0
- package/dist/libs/network-blocker/index.d.ts +9 -0
- package/dist/libs/network-blocker/index.d.ts.map +1 -0
- package/dist/libs/network-blocker/store.d.ts +63 -0
- package/dist/libs/network-blocker/store.d.ts.map +1 -0
- package/dist/libs/network-blocker/types.d.ts +127 -0
- package/dist/libs/network-blocker/types.d.ts.map +1 -0
- package/dist/libs/save-consents.d.ts +28 -9
- package/dist/libs/save-consents.d.ts.map +1 -1
- package/dist/libs/script-loader/core.d.ts +51 -15
- package/dist/libs/script-loader/core.d.ts.map +1 -1
- package/dist/libs/script-loader/index.d.ts +1 -0
- package/dist/libs/script-loader/index.d.ts.map +1 -1
- package/dist/libs/script-loader/store.d.ts +18 -11
- package/dist/libs/script-loader/store.d.ts.map +1 -1
- package/dist/libs/script-loader/types.d.ts +73 -6
- package/dist/libs/script-loader/types.d.ts.map +1 -1
- package/dist/runtime/index.d.ts +24 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/store/index.d.ts +57 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/{store.initial-state.d.ts → store/initial-state.d.ts} +3 -3
- package/dist/store/initial-state.d.ts.map +1 -0
- package/dist/store/type.d.ts +632 -0
- package/dist/store/type.d.ts.map +1 -0
- package/dist/types/callbacks.d.ts +24 -4
- package/dist/types/callbacks.d.ts.map +1 -1
- package/dist/types/compliance.d.ts +4 -179
- package/dist/types/compliance.d.ts.map +1 -1
- package/dist/types/{gdpr.d.ts → consent-types.d.ts} +30 -9
- package/dist/types/consent-types.d.ts.map +1 -0
- package/dist/types/iab-tcf.d.ts +260 -0
- package/dist/types/iab-tcf.d.ts.map +1 -0
- package/dist/types/index.d.ts +4 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/non-iab-vendor.d.ts +128 -0
- package/dist/types/non-iab-vendor.d.ts.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/package.json +72 -72
- package/LICENSE.md +0 -595
- package/dist/client/c15t/show-consent-banner.d.ts +0 -15
- package/dist/client/c15t/show-consent-banner.d.ts.map +0 -1
- package/dist/client/c15t/verify-consent.d.ts +0 -8
- package/dist/client/c15t/verify-consent.d.ts.map +0 -1
- package/dist/client/custom/identify-user.d.ts +0 -8
- package/dist/client/custom/identify-user.d.ts.map +0 -1
- package/dist/client/custom/show-consent-banner.d.ts +0 -8
- package/dist/client/custom/show-consent-banner.d.ts.map +0 -1
- package/dist/client/custom/verify-consent.d.ts +0 -8
- package/dist/client/custom/verify-consent.d.ts.map +0 -1
- package/dist/client/offline/identify-user.d.ts +0 -7
- package/dist/client/offline/identify-user.d.ts.map +0 -1
- package/dist/client/offline/show-consent-banner.d.ts +0 -8
- package/dist/client/offline/show-consent-banner.d.ts.map +0 -1
- package/dist/client/offline/verify-consent.d.ts +0 -7
- package/dist/client/offline/verify-consent.d.ts.map +0 -1
- package/dist/libs/consent-utils.d.ts +0 -32
- package/dist/libs/consent-utils.d.ts.map +0 -1
- package/dist/libs/fetch-consent-banner.d.ts +0 -31
- package/dist/libs/fetch-consent-banner.d.ts.map +0 -1
- package/dist/libs/gtm.d.ts +0 -100
- package/dist/libs/gtm.d.ts.map +0 -1
- package/dist/libs/identify-user.d.ts +0 -23
- package/dist/libs/identify-user.d.ts.map +0 -1
- package/dist/libs/tracking-blocker.d.ts +0 -79
- package/dist/libs/tracking-blocker.d.ts.map +0 -1
- package/dist/libs/tracking-domains.d.ts +0 -7
- package/dist/libs/tracking-domains.d.ts.map +0 -1
- package/dist/store.d.ts +0 -227
- package/dist/store.d.ts.map +0 -1
- package/dist/store.initial-state.d.ts.map +0 -1
- package/dist/store.type.d.ts +0 -287
- package/dist/store.type.d.ts.map +0 -1
- 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":"
|
|
1
|
+
{"version":3,"file":"fetcher.d.ts","sourceRoot":"","sources":["../../../src/client/c15t/fetcher.ts"],"names":[],"mappings":"AACA,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,IAAI,EAAE,MAAM,GAAG,MAAM,CAmBnE;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,oCAA8B,CAAC;AAEjE;;GAEG;AACH,wBAAsB,OAAO,CAC5B,YAAY,EACZ,QAAQ,GAAG,OAAO,EAClB,SAAS,GAAG,OAAO,EAEnB,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,YAAY,CAAC,YAAY,EAAE,QAAQ,EAAE,SAAS,CAAC,GACvD,OAAO,CAAC,eAAe,CAAC,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
|
-
*
|
|
7
|
+
* Queues the identify request for retry on next page load.
|
|
7
8
|
* @internal
|
|
8
9
|
*/
|
|
9
|
-
export declare function offlineFallbackForIdentifyUser(
|
|
10
|
+
export declare function offlineFallbackForIdentifyUser(options?: FetchOptions<IdentifyUserResponse, IdentifyUserRequestBody>): Promise<ResponseContext<IdentifyUserResponse>>;
|
|
10
11
|
/**
|
|
11
|
-
* Links
|
|
12
|
-
*
|
|
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:
|
|
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":"
|
|
1
|
+
{"version":3,"file":"identify-user.d.ts","sourceRoot":"","sources":["../../../src/client/c15t/identify-user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAKvD,OAAO,KAAK,EACX,uBAAuB,EACvB,oBAAoB,EACpB,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,8BAA8B,CACnD,OAAO,CAAC,EAAE,YAAY,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GACnE,OAAO,CAAC,eAAe,CAAC,oBAAoB,CAAC,CAAC,CA+DhD;AAED;;;;;;;;GAQG;AACH,wBAAsB,YAAY,CACjC,OAAO,EAAE,cAAc,EACvB,aAAa,EAAE,aAAa,GAAG,SAAS,EACxC,OAAO,EAAE,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
|
|
7
|
+
import type { ConsentManagerInterface, IdentifyUserRequestBody, IdentifyUserResponse, InitResponse, SetConsentRequestBody, SetConsentResponse } from '../client-interface';
|
|
6
8
|
import type { FetchOptions, ResponseContext } from '../types';
|
|
7
|
-
import type {
|
|
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:
|
|
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
|
-
|
|
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
|
-
*
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
*
|
|
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
|
|
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
|
|
100
|
+
* Check for pending identify user submissions on initialization
|
|
88
101
|
* @internal
|
|
89
102
|
*/
|
|
90
|
-
private
|
|
103
|
+
private checkPendingIdentifySubmissions;
|
|
91
104
|
/**
|
|
92
|
-
* Process pending identify
|
|
105
|
+
* Process pending identify user submissions
|
|
93
106
|
* @internal
|
|
94
107
|
*/
|
|
95
|
-
private
|
|
108
|
+
private processPendingIdentifySubmissions;
|
|
96
109
|
}
|
|
97
|
-
export type {
|
|
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":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/c15t/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACX,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,YAAY,EACZ,qBAAqB,EACrB,kBAAkB,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAa9D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEzD;;;;;;GAMG;AACH,qBAAa,UAAW,YAAW,uBAAuB;IACzD;;;OAGG;IACH,OAAO,CAAC,UAAU,CAAS;IAE3B;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAA4C;IAE3E;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAyC;IAEpE;;;OAGG;IACH,OAAO,CAAC,OAAO,CAAyB;IAExC;;;OAGG;IACH,OAAO,CAAC,WAAW,CAAC,CAAe;IAEnC;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAc;IAE9B;;;OAGG;IACH,OAAO,CAAC,WAAW,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
|
|
19
|
+
* Check for pending identify user submissions on initialization
|
|
15
20
|
* @internal
|
|
16
21
|
*/
|
|
17
|
-
export declare function
|
|
22
|
+
export declare function checkPendingIdentifySubmissions(_context: FetcherContext, processPendingSubmissions: (submissions: IdentifyUserRequestBody[]) => Promise<void>): void;
|
|
18
23
|
/**
|
|
19
|
-
* Process pending identify
|
|
24
|
+
* Process pending identify user submissions
|
|
20
25
|
* @internal
|
|
21
26
|
*/
|
|
22
|
-
export declare function
|
|
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;
|
|
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":"
|
|
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
|
|
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;
|
|
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,KAAK,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"client-factory.d.ts","sourceRoot":"","sources":["../../src/client/client-factory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAgB,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,YAAY,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAClE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAuG1E;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG;IACjC;;OAEG;IACH,IAAI,EAAE,QAAQ,CAAC;IAEf;;;OAGG;IACH,gBAAgB,EAAE,gBAAgB,CAAC;IAEnC;;OAEG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;IAErB;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC/B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;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;;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 {
|
|
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
|
|
8
|
-
export type
|
|
9
|
-
export type
|
|
10
|
-
export type
|
|
11
|
-
export type
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
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
|
-
*
|
|
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 -
|
|
47
|
-
* @returns Response confirming the
|
|
51
|
+
* @param options - Request configuration with subjectId, externalId, and identityProvider
|
|
52
|
+
* @returns Response confirming the subject was updated
|
|
48
53
|
*/
|
|
49
|
-
identifyUser(options
|
|
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,
|
|
1
|
+
{"version":3,"file":"client-interface.d.ts","sourceRoot":"","sources":["../../src/client/client-interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE7D,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,CAAC;AACpD,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,CAAC;AAClD,YAAY,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,CAAC;AAC1D,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,CAAC;AACtD,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAEnD;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAEtD,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC;;;;;OAKG;IACH,IAAI,CACH,OAAO,CAAC,EAAE,YAAY,CAAC,YAAY,CAAC,GAClC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC;IAE1C;;;;;OAKG;IACH,UAAU,CACT,OAAO,CAAC,EAAE,YAAY,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAC/D,OAAO,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAEhD;;;;;OAKG;IACH,YAAY,CACX,OAAO,EAAE,YAAY,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GAClE,OAAO,CAAC,eAAe,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAElD;;;;;;OAMG;IACH,MAAM,CAAC,YAAY,EAAE,QAAQ,GAAG,OAAO,EAAE,SAAS,GAAG,OAAO,EAC3D,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,YAAY,CAAC,YAAY,EAAE,QAAQ,EAAE,SAAS,CAAC,GACvD,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,mCAAmC;IACnD,iBAAiB,EAAE,OAAO,CAAC;IAC3B,YAAY,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAChD,QAAQ,CAAC,EAAE;QAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;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
|
|
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
|
-
|
|
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
|
-
*
|
|
39
|
-
|
|
40
|
-
|
|
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
|
|
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
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/custom/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACX,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,YAAY,EACZ,qBAAqB,EACrB,kBAAkB,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAI9D,OAAO,KAAK,EACX,mBAAmB,EACnB,eAAe,EAEf,MAAM,SAAS,CAAC;AAEjB;;;;;;GAMG;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,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
|
-
|
|
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
|
|
16
|
+
* Handler for the init endpoint.
|
|
13
17
|
*/
|
|
14
|
-
|
|
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
|
|
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
|
|
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,
|
|
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"}
|
package/dist/client/index.d.ts
CHANGED
|
@@ -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
|
|
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,
|
|
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"}
|