@c15t/node-sdk 2.0.0-rc.5 → 2.0.0-rc.8
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/dist/index.cjs +4 -4
- package/dist/index.js +3 -3
- package/dist-types/client.d.ts +14 -8
- package/dist-types/endpoints/consent.d.ts +1 -1
- package/dist-types/endpoints/init.d.ts +1 -1
- package/dist-types/endpoints/status.d.ts +1 -1
- package/dist-types/endpoints/subjects.d.ts +1 -1
- package/dist-types/index.d.ts +1 -1
- package/package.json +12 -12
package/dist/index.cjs
CHANGED
|
@@ -13,7 +13,7 @@ var __webpack_require__ = {};
|
|
|
13
13
|
})();
|
|
14
14
|
(()=>{
|
|
15
15
|
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if (
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
17
|
value: 'Module'
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports1, '__esModule', {
|
|
@@ -333,11 +333,11 @@ async function listSubjects(context, query, options) {
|
|
|
333
333
|
class C15TClient {
|
|
334
334
|
context;
|
|
335
335
|
constructor(options = {}){
|
|
336
|
-
const baseUrlString = options.baseUrl || (
|
|
336
|
+
const baseUrlString = options.baseUrl || ("u" > typeof process ? process.env?.C15T_API_URL : void 0);
|
|
337
337
|
if (!baseUrlString) throw new TypeError('baseUrl is required. Provide it in options or set C15T_API_URL environment variable.');
|
|
338
338
|
const baseUrl = new URL(baseUrlString);
|
|
339
339
|
if (options.prefix) baseUrl.pathname = options.prefix;
|
|
340
|
-
const token = options.token || (
|
|
340
|
+
const token = options.token || ("u" > typeof process ? process.env?.C15T_API_TOKEN : void 0);
|
|
341
341
|
const authHeaders = token ? {
|
|
342
342
|
Authorization: `Bearer ${token}`
|
|
343
343
|
} : {};
|
|
@@ -345,7 +345,7 @@ class C15TClient {
|
|
|
345
345
|
...DEFAULT_RETRY_CONFIG,
|
|
346
346
|
...options.retryConfig
|
|
347
347
|
};
|
|
348
|
-
const debug = options.debug ?? (
|
|
348
|
+
const debug = options.debug ?? ("u" > typeof process ? process.env?.C15T_DEBUG === 'true' : false);
|
|
349
349
|
const timeout = options.timeout ?? DEFAULT_TIMEOUT_MS;
|
|
350
350
|
this.context = {
|
|
351
351
|
baseUrl: baseUrl.toString(),
|
package/dist/index.js
CHANGED
|
@@ -299,11 +299,11 @@ async function listSubjects(context, query, options) {
|
|
|
299
299
|
class C15TClient {
|
|
300
300
|
context;
|
|
301
301
|
constructor(options = {}){
|
|
302
|
-
const baseUrlString = options.baseUrl || (
|
|
302
|
+
const baseUrlString = options.baseUrl || ("u" > typeof process ? process.env?.C15T_API_URL : void 0);
|
|
303
303
|
if (!baseUrlString) throw new TypeError('baseUrl is required. Provide it in options or set C15T_API_URL environment variable.');
|
|
304
304
|
const baseUrl = new URL(baseUrlString);
|
|
305
305
|
if (options.prefix) baseUrl.pathname = options.prefix;
|
|
306
|
-
const token = options.token || (
|
|
306
|
+
const token = options.token || ("u" > typeof process ? process.env?.C15T_API_TOKEN : void 0);
|
|
307
307
|
const authHeaders = token ? {
|
|
308
308
|
Authorization: `Bearer ${token}`
|
|
309
309
|
} : {};
|
|
@@ -311,7 +311,7 @@ class C15TClient {
|
|
|
311
311
|
...DEFAULT_RETRY_CONFIG,
|
|
312
312
|
...options.retryConfig
|
|
313
313
|
};
|
|
314
|
-
const debug = options.debug ?? (
|
|
314
|
+
const debug = options.debug ?? ("u" > typeof process ? process.env?.C15T_DEBUG === 'true' : false);
|
|
315
315
|
const timeout = options.timeout ?? DEFAULT_TIMEOUT_MS;
|
|
316
316
|
this.context = {
|
|
317
317
|
baseUrl: baseUrl.toString(),
|
package/dist-types/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CheckConsentOutput, CheckConsentQuery, GetSubjectOutput, GetSubjectQuery, InitOutput, ListSubjectsOutput, ListSubjectsQuery, PatchSubjectFullInput, PatchSubjectOutput, PostSubjectInput, PostSubjectOutput, StatusOutput } from '
|
|
1
|
+
import type { CheckConsentOutput, CheckConsentQuery, GetSubjectOutput, GetSubjectQuery, InitOutput, ListSubjectsOutput, ListSubjectsQuery, PatchSubjectFullInput, PatchSubjectOutput, PostSubjectInput, PostSubjectOutput, StatusOutput } from '@c15t/schema/types';
|
|
2
2
|
import type { C15TClientOptions, FetchOptions, ResponseContext } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* C15T Client for interacting with the consent management API
|
|
@@ -151,6 +151,9 @@ export declare class C15TClient {
|
|
|
151
151
|
id: string;
|
|
152
152
|
type: string;
|
|
153
153
|
policyId?: string | undefined;
|
|
154
|
+
policyVersion?: string | undefined;
|
|
155
|
+
policyHash?: string | undefined;
|
|
156
|
+
policyEffectiveDate?: Date | undefined;
|
|
154
157
|
isLatestPolicy: boolean;
|
|
155
158
|
preferences?: {
|
|
156
159
|
[x: string]: boolean;
|
|
@@ -181,6 +184,9 @@ export declare class C15TClient {
|
|
|
181
184
|
id: string;
|
|
182
185
|
type: string;
|
|
183
186
|
policyId?: string | undefined;
|
|
187
|
+
policyVersion?: string | undefined;
|
|
188
|
+
policyHash?: string | undefined;
|
|
189
|
+
policyEffectiveDate?: Date | undefined;
|
|
184
190
|
isLatestPolicy: boolean;
|
|
185
191
|
preferences?: {
|
|
186
192
|
[x: string]: boolean;
|
|
@@ -315,7 +321,7 @@ export declare class C15TClient {
|
|
|
315
321
|
} | undefined;
|
|
316
322
|
};
|
|
317
323
|
};
|
|
318
|
-
branding: "c15t" | "consent" | "none";
|
|
324
|
+
branding: "c15t" | "inth" | "consent" | "none";
|
|
319
325
|
gvl?: {
|
|
320
326
|
gvlSpecificationVersion: number;
|
|
321
327
|
vendorListVersion: number;
|
|
@@ -443,17 +449,17 @@ export declare class C15TClient {
|
|
|
443
449
|
ui?: {
|
|
444
450
|
mode?: "none" | "banner" | "dialog" | undefined;
|
|
445
451
|
banner?: {
|
|
446
|
-
allowedActions?: ("
|
|
447
|
-
|
|
448
|
-
layout?: ("
|
|
452
|
+
allowedActions?: ("accept" | "customize" | "reject")[] | undefined;
|
|
453
|
+
primaryActions?: ("accept" | "customize" | "reject")[] | undefined;
|
|
454
|
+
layout?: ("accept" | "customize" | "reject" | ("accept" | "customize" | "reject")[])[] | undefined;
|
|
449
455
|
direction?: "row" | "column" | undefined;
|
|
450
456
|
uiProfile?: "strict" | "balanced" | "compact" | undefined;
|
|
451
457
|
scrollLock?: boolean | undefined;
|
|
452
458
|
} | undefined;
|
|
453
459
|
dialog?: {
|
|
454
|
-
allowedActions?: ("
|
|
455
|
-
|
|
456
|
-
layout?: ("
|
|
460
|
+
allowedActions?: ("accept" | "customize" | "reject")[] | undefined;
|
|
461
|
+
primaryActions?: ("accept" | "customize" | "reject")[] | undefined;
|
|
462
|
+
layout?: ("accept" | "customize" | "reject" | ("accept" | "customize" | "reject")[])[] | undefined;
|
|
457
463
|
direction?: "row" | "column" | undefined;
|
|
458
464
|
uiProfile?: "strict" | "balanced" | "compact" | undefined;
|
|
459
465
|
scrollLock?: boolean | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CheckConsentOutput, CheckConsentQuery } from '
|
|
1
|
+
import type { CheckConsentOutput, CheckConsentQuery } from '@c15t/schema/types';
|
|
2
2
|
import type { FetcherContext } from '../fetcher';
|
|
3
3
|
import type { FetchOptions, ResponseContext } from '../types';
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GetSubjectOutput, GetSubjectQuery, ListSubjectsOutput, ListSubjectsQuery, PatchSubjectFullInput, PatchSubjectOutput, PostSubjectInput, PostSubjectOutput } from '
|
|
1
|
+
import type { GetSubjectOutput, GetSubjectQuery, ListSubjectsOutput, ListSubjectsQuery, PatchSubjectFullInput, PatchSubjectOutput, PostSubjectInput, PostSubjectOutput } from '@c15t/schema/types';
|
|
2
2
|
import type { FetcherContext } from '../fetcher';
|
|
3
3
|
import type { FetchOptions, ResponseContext } from '../types';
|
|
4
4
|
/**
|
package/dist-types/index.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ import type { C15TClientOptions } from './types';
|
|
|
35
35
|
* ```
|
|
36
36
|
*/
|
|
37
37
|
export declare function c15tClient(options?: C15TClientOptions): C15TClient;
|
|
38
|
-
export type { CheckConsentOutput, CheckConsentQuery, ConsentCheckResult, ConsentItem, GetSubjectInput, GetSubjectOutput, GetSubjectParams, GetSubjectQuery, InitOutput, ListSubjectsOutput, ListSubjectsQuery, PatchSubjectFullInput, PatchSubjectOutput, PostSubjectInput, PostSubjectOutput, StatusOutput, SubjectItem, } from '
|
|
38
|
+
export type { CheckConsentOutput, CheckConsentQuery, ConsentCheckResult, ConsentItem, GetSubjectInput, GetSubjectOutput, GetSubjectParams, GetSubjectQuery, InitOutput, ListSubjectsOutput, ListSubjectsQuery, PatchSubjectFullInput, PatchSubjectOutput, PostSubjectInput, PostSubjectOutput, StatusOutput, SubjectItem, } from '@c15t/schema/types';
|
|
39
39
|
export { C15TClient } from './client';
|
|
40
40
|
export { C15TError, isC15TError } from './error';
|
|
41
41
|
export type { FetcherContext } from './fetcher';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c15t/node-sdk",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.8",
|
|
4
4
|
"description": "Official Node.js SDK for c15t. Connects to the Consent Engine to read and write consent records and preferences. TypeScript-first, simple APIs, built-in auth and retries.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"dist-types"
|
|
48
48
|
],
|
|
49
49
|
"scripts": {
|
|
50
|
-
"build": "rslib build",
|
|
50
|
+
"build": "rslib build && bun ../../scripts/normalize-dist-types.mjs",
|
|
51
51
|
"check-types": "tsc --noEmit",
|
|
52
52
|
"check-types:test": "tsc -p tsconfig.test.json",
|
|
53
53
|
"dev": "rslib build --watch",
|
|
@@ -57,23 +57,23 @@
|
|
|
57
57
|
"test:watch": "vitest"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@c15t/backend": "2.0.0-rc.
|
|
61
|
-
"@orpc/client": "1.13.
|
|
62
|
-
"@orpc/contract": "1.13.
|
|
63
|
-
"@orpc/openapi-client": "^1.13.
|
|
64
|
-
"@orpc/server": "1.13.
|
|
60
|
+
"@c15t/backend": "2.0.0-rc.8",
|
|
61
|
+
"@orpc/client": "1.13.13",
|
|
62
|
+
"@orpc/contract": "1.13.13",
|
|
63
|
+
"@orpc/openapi-client": "^1.13.13",
|
|
64
|
+
"@orpc/server": "1.13.13"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@c15t/typescript-config": "0.0.1-beta.1",
|
|
68
68
|
"@c15t/vitest-config": "1.0.0",
|
|
69
|
-
"@electric-sql/pglite": "0.2
|
|
69
|
+
"@electric-sql/pglite": "0.4.2",
|
|
70
70
|
"@libsql/kysely-libsql": "^0.4.1",
|
|
71
71
|
"@types/better-sqlite3": "^7.6.13",
|
|
72
72
|
"@types/express": "^5.0.6",
|
|
73
|
-
"@types/node": "
|
|
74
|
-
"@types/pg": "8.
|
|
73
|
+
"@types/node": "25.5.0",
|
|
74
|
+
"@types/pg": "8.20.0",
|
|
75
75
|
"kysely-pglite": "^0.6.1",
|
|
76
|
-
"msw": "^2.
|
|
77
|
-
"typescript": "^
|
|
76
|
+
"msw": "^2.12.14",
|
|
77
|
+
"typescript": "^6.0.2"
|
|
78
78
|
}
|
|
79
79
|
}
|