@c15t/node-sdk 3.0.0-alpha.1 → 3.0.0-alpha.2

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.js CHANGED
@@ -46,7 +46,7 @@ class C15TError extends Error {
46
46
  const error_isC15TError = function(error) {
47
47
  return error instanceof C15TError;
48
48
  };
49
- const version = '3.0.0-alpha.1';
49
+ const version = '3.0.0-alpha.2';
50
50
  const C15T_VERSION_HEADERS = {
51
51
  'x-c15t-version': version
52
52
  };
@@ -1,5 +1,5 @@
1
1
  import type { CheckConsentOutput, CheckConsentQuery, GetSubjectOutput, GetSubjectQuery, InitOutput, ListSubjectsOutput, ListSubjectsQuery, PatchSubjectFullInput, PatchSubjectOutput, PostSubjectInput, PostSubjectOutput, StatusOutput } from '@c15t/schema/types';
2
- import type { C15TClientOptions, FetchOptions, ResponseContext } from './types';
2
+ import type { C15TClientOptions, FetchOptions, ResponseContext } from './types.js';
3
3
  /**
4
4
  * C15T Client for interacting with the consent management API
5
5
  *
@@ -203,6 +203,13 @@ export declare class C15TClient {
203
203
  [x: string]: boolean;
204
204
  } | undefined;
205
205
  type: string;
206
+ vendorChoice?: {
207
+ confirmedAt: number;
208
+ grants: {
209
+ [x: string]: boolean;
210
+ };
211
+ version: 1;
212
+ } | null | undefined;
206
213
  }[];
207
214
  isValid: boolean;
208
215
  privacyDirectives?: {
@@ -268,6 +275,13 @@ export declare class C15TClient {
268
275
  };
269
276
  version: 3;
270
277
  } | null | undefined;
278
+ subjectVendorChoice?: {
279
+ confirmedAt: number;
280
+ grants: {
281
+ [x: string]: boolean;
282
+ };
283
+ version: 1;
284
+ } | null | undefined;
271
285
  }>>;
272
286
  /**
273
287
  * List subjects
@@ -335,6 +349,13 @@ export declare class C15TClient {
335
349
  [x: string]: boolean;
336
350
  } | undefined;
337
351
  type: string;
352
+ vendorChoice?: {
353
+ confirmedAt: number;
354
+ grants: {
355
+ [x: string]: boolean;
356
+ };
357
+ version: 1;
358
+ } | null | undefined;
338
359
  }[];
339
360
  createdAt: Date;
340
361
  externalId: string;
@@ -567,6 +588,12 @@ export declare class C15TClient {
567
588
  consentManagerDialog: {
568
589
  description: string;
569
590
  title: string;
591
+ vendors?: {
592
+ disabledByCategory?: string | undefined;
593
+ privacyPolicy?: string | undefined;
594
+ switchLabel?: string | undefined;
595
+ title?: string | undefined;
596
+ } | undefined;
570
597
  };
571
598
  consentTypes: {
572
599
  experience: {
@@ -621,6 +648,12 @@ export declare class C15TClient {
621
648
  consentManagerDialog: {
622
649
  description?: string | undefined;
623
650
  title?: string | undefined;
651
+ vendors?: {
652
+ disabledByCategory?: string | undefined;
653
+ privacyPolicy?: string | undefined;
654
+ switchLabel?: string | undefined;
655
+ title?: string | undefined;
656
+ } | undefined;
624
657
  };
625
658
  consentTypes: {
626
659
  experience?: {
@@ -665,6 +698,17 @@ export declare class C15TClient {
665
698
  } | undefined;
666
699
  };
667
700
  };
701
+ vendorListVersion?: string | undefined;
702
+ vendors?: {
703
+ category: import("@c15t/schema/shared").VendorCategoryCondition;
704
+ description?: string | undefined;
705
+ disabled?: boolean | undefined;
706
+ homepageUrl?: string | undefined;
707
+ id: string;
708
+ legalName?: string | undefined;
709
+ name: string;
710
+ privacyPolicyUrl: string;
711
+ }[] | undefined;
668
712
  }>>;
669
713
  /**
670
714
  * Get API status
@@ -1,6 +1,6 @@
1
1
  import type { CheckConsentOutput, CheckConsentQuery } from '@c15t/schema/types';
2
- import type { FetcherContext } from '../fetcher';
3
- import type { FetchOptions, ResponseContext } from '../types';
2
+ import type { FetcherContext } from '../fetcher.js';
3
+ import type { FetchOptions, ResponseContext } from '../types.js';
4
4
  /**
5
5
  * API endpoint path for consent check
6
6
  */
@@ -1,4 +1,4 @@
1
- export { CONSENT_CHECK_PATH, checkConsent } from './consent';
2
- export { INIT_PATH, init } from './init';
3
- export { STATUS_PATH, status } from './status';
4
- export { createSubject, getSubject, listSubjects, patchSubject, SUBJECTS_PATH, } from './subjects';
1
+ export { CONSENT_CHECK_PATH, checkConsent } from './consent.js';
2
+ export { INIT_PATH, init } from './init.js';
3
+ export { STATUS_PATH, status } from './status.js';
4
+ export { createSubject, getSubject, listSubjects, patchSubject, SUBJECTS_PATH, } from './subjects.js';
@@ -1,6 +1,6 @@
1
1
  import type { InitOutput } from '@c15t/schema/types';
2
- import type { FetcherContext } from '../fetcher';
3
- import type { FetchOptions, ResponseContext } from '../types';
2
+ import type { FetcherContext } from '../fetcher.js';
3
+ import type { FetchOptions, ResponseContext } from '../types.js';
4
4
  /**
5
5
  * API endpoint path for init
6
6
  */
@@ -1,6 +1,6 @@
1
1
  import type { StatusOutput } from '@c15t/schema/types';
2
- import type { FetcherContext } from '../fetcher';
3
- import type { FetchOptions, ResponseContext } from '../types';
2
+ import type { FetcherContext } from '../fetcher.js';
3
+ import type { FetchOptions, ResponseContext } from '../types.js';
4
4
  /**
5
5
  * API endpoint path for status
6
6
  */
@@ -1,6 +1,6 @@
1
1
  import type { GetSubjectOutput, GetSubjectQuery, ListSubjectsOutput, ListSubjectsQuery, PatchSubjectFullInput, PatchSubjectOutput, PostSubjectInput, PostSubjectOutput } from '@c15t/schema/types';
2
- import type { FetcherContext } from '../fetcher';
3
- import type { FetchOptions, ResponseContext } from '../types';
2
+ import type { FetcherContext } from '../fetcher.js';
3
+ import type { FetchOptions, ResponseContext } from '../types.js';
4
4
  /**
5
5
  * API endpoint paths for subjects
6
6
  */
@@ -1,4 +1,4 @@
1
- import type { FetchOptions, ResponseContext, RetryConfig } from './types';
1
+ import type { FetchOptions, ResponseContext, RetryConfig } from './types.js';
2
2
  /**
3
3
  * Default retry configuration
4
4
  */
@@ -1,3 +1,3 @@
1
1
  export declare const C15T_VERSION_HEADERS: {
2
- readonly 'x-c15t-version': "3.0.0-alpha.1";
2
+ readonly 'x-c15t-version': "3.0.0-alpha.2";
3
3
  };
@@ -1,5 +1,5 @@
1
- import { C15TClient } from './client';
2
- import type { C15TClientOptions } from './types';
1
+ import { C15TClient } from './client.js';
2
+ import type { C15TClientOptions } from './types.js';
3
3
  /**
4
4
  * Creates a type-safe C15T client instance
5
5
  *
@@ -36,8 +36,8 @@ import type { C15TClientOptions } from './types';
36
36
  */
37
37
  export declare const c15tClient: (options?: C15TClientOptions) => C15TClient;
38
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
- export { C15TClient } from './client';
40
- export { C15TError, isC15TError } from './error';
41
- export type { FetcherContext } from './fetcher';
42
- export { createResponseContext, fetcher, resolveUrl } from './fetcher';
43
- export type { C15TClientOptions, FetchOptions, ResponseContext, RetryConfig, } from './types';
39
+ export { C15TClient } from './client.js';
40
+ export { C15TError, isC15TError } from './error.js';
41
+ export type { FetcherContext } from './fetcher.js';
42
+ export { createResponseContext, fetcher, resolveUrl } from './fetcher.js';
43
+ export type { C15TClientOptions, FetchOptions, ResponseContext, RetryConfig, } from './types.js';
@@ -16,7 +16,7 @@
16
16
  * expect(result.data?.id).toBe('sub_123');
17
17
  * ```
18
18
  */
19
- import type { ResponseContext } from './types';
19
+ import type { ResponseContext } from './types.js';
20
20
  /**
21
21
  * Creates a mock ResponseContext for testing
22
22
  *
@@ -1 +1 @@
1
- export declare const version = "3.0.0-alpha.1";
1
+ export declare const version = "3.0.0-alpha.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c15t/node-sdk",
3
- "version": "3.0.0-alpha.1",
3
+ "version": "3.0.0-alpha.2",
4
4
  "description": "Type-safe Node.js SDK for hosted and self-hosted c15t consent APIs, consent records, privacy preferences, and backend automation.",
5
5
  "keywords": [
6
6
  "c15t",
@@ -61,7 +61,8 @@
61
61
  "test:watch": "bun prebuild && vitest"
62
62
  },
63
63
  "dependencies": {
64
- "@c15t/backend": "3.0.0-alpha.1"
64
+ "@c15t/backend": "3.0.0-alpha.2",
65
+ "@c15t/schema": "3.0.0-alpha.1"
65
66
  },
66
67
  "devDependencies": {
67
68
  "@c15t/typescript-config": "0.0.1",
package/readme.json DELETED
@@ -1,29 +0,0 @@
1
- {
2
- "title": "@c15t/node-sdk: Type-Safe Node.js API Client",
3
- "description": "Type-safe Node.js SDK for hosted and self-hosted c15t consent APIs, consent records, privacy preferences, and backend automation.",
4
- "features": [
5
- "Type-safe API client with full TypeScript support",
6
- "Works with hosted c15t instances on inth.com and self-hosted @c15t/backend deployments",
7
- "Read and write consent records, subjects, and privacy preferences from Node.js",
8
- "Flexible client configuration with authentication and custom headers",
9
- "Supports dynamic base URL and API prefix configuration",
10
- "Built on top of @orpc/client for robust API interactions",
11
- "Comprehensive error handling and URL validation"
12
- ],
13
- "prerequisites": [
14
- "Node.js 20.19 or later",
15
- "A hosted [c15t instance](https://inth.com) (free sign-up) or [self-hosted deployment](https://c15t.com/docs/self-host/quickstart)"
16
- ],
17
- "manualInstallation": ["", "```bash\npnpm add @c15t/node-sdk\n```"],
18
- "usage": [
19
- "Import `c15tClient` from `@c15t/node-sdk`",
20
- "Configure with a base URL and token, or set `C15T_API_URL` and `C15T_API_TOKEN` so the client picks them up automatically",
21
- "Call API methods on `client.meta`, `client.subjects`, etc. — every method is fully typed",
22
-
23
- "```ts\n// server.ts\nimport { c15tClient } from '@c15t/node-sdk'\n\n// Auto-configure from C15T_API_URL + C15T_API_TOKEN env vars\nconst client = c15tClient()\n\n// Or pass options explicitly\n// const client = c15tClient({\n// baseUrl: process.env.C15T_API_URL!,\n// token: process.env.C15T_API_TOKEN!,\n// })\n\ntry {\n const status = await client.meta.status()\n console.log('c15t API status:', status)\n\n const subject = await client.subjects.create({\n type: 'cookie_banner',\n subjectId: 'sub_123',\n domain: 'example.com',\n preferences: { analytics: true },\n givenAt: Date.now(),\n })\n console.log('Created subject', subject.id)\n} catch (error) {\n console.error('c15t request failed:', error)\n}\n```"
24
- ],
25
- "showCLIGeneration": false,
26
- "customSections": {
27
- "Common Use Cases": "- Sync consent records between your application and c15t\n- Build admin tooling around hosted or self-hosted consent APIs\n- Automate privacy preference workflows from server-side jobs\n- Integrate c15t consent records with internal data systems"
28
- }
29
- }