@c15t/backend 2.0.0-rc.6 → 2.0.0

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 (54) hide show
  1. package/README.md +3 -3
  2. package/dist/302.js +2 -3
  3. package/dist/{364.js → 915.js} +656 -25
  4. package/dist/core.cjs +497 -15
  5. package/dist/core.js +8 -156
  6. package/dist/db/schema.cjs +4 -0
  7. package/dist/db/schema.js +3 -2
  8. package/dist/edge.cjs +8 -8
  9. package/dist/edge.js +3 -3
  10. package/dist/router.cjs +253 -42
  11. package/dist/router.js +1 -1
  12. package/dist-types/cache/gvl-resolver.d.ts +1 -1
  13. package/dist-types/db/registry/consent-policy.d.ts +57 -1
  14. package/dist-types/db/registry/index.d.ts +43 -1
  15. package/dist-types/db/registry/types.d.ts +2 -1
  16. package/dist-types/db/schema/1.0.0/consent.d.ts +1 -1
  17. package/dist-types/db/schema/2.0.0/audit-log.d.ts +1 -1
  18. package/dist-types/db/schema/2.0.0/consent-policy.d.ts +3 -2
  19. package/dist-types/db/schema/2.0.0/consent-purpose.d.ts +1 -1
  20. package/dist-types/db/schema/2.0.0/consent.d.ts +1 -1
  21. package/dist-types/db/schema/2.0.0/domain.d.ts +1 -1
  22. package/dist-types/db/schema/2.0.0/index.d.ts +7 -0
  23. package/dist-types/db/schema/2.0.0/runtime-policy-decision.d.ts +1 -1
  24. package/dist-types/db/schema/2.0.0/subject.d.ts +1 -1
  25. package/dist-types/db/schema/index.d.ts +14 -0
  26. package/dist-types/edge/index.d.ts +2 -2
  27. package/dist-types/edge/init-handler.d.ts +5 -3
  28. package/dist-types/edge/resolve-consent.d.ts +6 -6
  29. package/dist-types/edge/types.d.ts +1 -1
  30. package/dist-types/handlers/init/index.d.ts +4 -4
  31. package/dist-types/handlers/init/policy.d.ts +1 -1
  32. package/dist-types/handlers/init/resolve-init.d.ts +2 -2
  33. package/dist-types/handlers/init/translations.d.ts +1 -1
  34. package/dist-types/handlers/legal-document/current.handler.d.ts +11 -0
  35. package/dist-types/handlers/legal-document/snapshot.d.ts +39 -0
  36. package/dist-types/handlers/subject/get.handler.d.ts +3 -0
  37. package/dist-types/handlers/subject/list.handler.d.ts +3 -0
  38. package/dist-types/handlers/utils/consent-enrichment.d.ts +3 -0
  39. package/dist-types/middleware/cors/is-origin-trusted.d.ts +1 -1
  40. package/dist-types/policies/builder.d.ts +7 -7
  41. package/dist-types/policies/defaults.d.ts +2 -2
  42. package/dist-types/policies/matchers.d.ts +2 -2
  43. package/dist-types/routes/index.d.ts +1 -0
  44. package/dist-types/routes/legal-document.d.ts +7 -0
  45. package/dist-types/types/index.d.ts +39 -18
  46. package/dist-types/utils/instrumentation.d.ts +2 -2
  47. package/dist-types/utils/logger.d.ts +1 -1
  48. package/dist-types/version.d.ts +1 -1
  49. package/docs/api/configuration.md +24 -13
  50. package/docs/guides/database-setup.md +4 -4
  51. package/docs/guides/edge-deployment.md +18 -15
  52. package/docs/guides/iab-tcf.md +4 -4
  53. package/docs/quickstart.md +9 -9
  54. package/package.json +8 -8
@@ -39,15 +39,57 @@ export declare const createRegistry: (ctx: Registry) => {
39
39
  id: string;
40
40
  version: string;
41
41
  type: string;
42
+ hash: string | null;
42
43
  effectiveDate: Date;
43
44
  isActive: boolean;
44
45
  createdAt: Date;
45
46
  tenantId: string | null;
46
47
  } | null>;
47
- findOrCreatePolicy: (type: import("../../../../schema/dist-types/index.d.ts").PolicyType) => Promise<{
48
+ findLatestPolicyByType: (type: import("@c15t/schema").PolicyType) => Promise<{
48
49
  id: string;
49
50
  version: string;
50
51
  type: string;
52
+ hash: string | null;
53
+ effectiveDate: Date;
54
+ isActive: boolean;
55
+ createdAt: Date;
56
+ tenantId: string | null;
57
+ } | null>;
58
+ findLegalDocumentPolicyByHash: (type: import("@c15t/schema").LegalDocumentPolicyType, hash: string) => Promise<{
59
+ id: string;
60
+ version: string;
61
+ type: string;
62
+ hash: string | null;
63
+ effectiveDate: Date;
64
+ isActive: boolean;
65
+ createdAt: Date;
66
+ tenantId: string | null;
67
+ } | null>;
68
+ syncCurrentLegalDocumentPolicy: (input: import("./consent-policy").LegalDocumentPolicyInput) => Promise<{
69
+ id: string;
70
+ version: string;
71
+ type: string;
72
+ hash: string | null;
73
+ effectiveDate: Date;
74
+ isActive: boolean;
75
+ createdAt: Date;
76
+ tenantId: string | null;
77
+ }>;
78
+ findOrCreateLegalDocumentPolicy: (input: import("./consent-policy").LegalDocumentPolicyInput) => Promise<{
79
+ id: string;
80
+ version: string;
81
+ type: string;
82
+ hash: string | null;
83
+ effectiveDate: Date;
84
+ isActive: boolean;
85
+ createdAt: Date;
86
+ tenantId: string | null;
87
+ }>;
88
+ findOrCreatePolicy: (type: import("@c15t/schema").PolicyType) => Promise<{
89
+ id: string;
90
+ version: string;
91
+ type: string;
92
+ hash: string | null;
51
93
  effectiveDate: Date;
52
94
  isActive: boolean;
53
95
  createdAt: Date;
@@ -1,9 +1,10 @@
1
- import type { createLogger } from '../../../../logger/dist-types/index.d.ts';
1
+ import type { createLogger } from '@c15t/logger';
2
2
  import type { InferFumaDB } from 'fumadb';
3
3
  import type { LatestDB } from '../schema';
4
4
  export interface Registry {
5
5
  db: ReturnType<InferFumaDB<typeof LatestDB>['orm']>;
6
6
  ctx: {
7
7
  logger: ReturnType<typeof createLogger>;
8
+ tenantId?: string;
8
9
  };
9
10
  }
@@ -1,4 +1,4 @@
1
- import { type Consent, consentSchema } from '../../../../../schema/dist-types/index.d.ts';
1
+ import { type Consent, consentSchema } from '@c15t/schema';
2
2
  export declare const consentTable: import("fumadb/schema").Table<{
3
3
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
4
4
  subjectId: import("fumadb/schema").Column<"string", string, string>;
@@ -1,4 +1,4 @@
1
- import { type AuditLog, auditLogSchema } from '../../../../../schema/dist-types/index.d.ts';
1
+ import { type AuditLog, auditLogSchema } from '@c15t/schema';
2
2
  export declare const auditLogTable: import("fumadb/schema").Table<{
3
3
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
4
4
  entityType: import("fumadb/schema").Column<"string", string, string>;
@@ -1,12 +1,13 @@
1
- import { type ConsentPolicy, consentPolicySchema, type PolicyType, policyTypeSchema } from '../../../../../schema/dist-types/index.d.ts';
1
+ import { type ConsentPolicy, consentPolicySchema, type LegalDocumentPolicyType, legalDocumentPolicyTypeSchema, type PolicyType, policyTypeSchema } from '@c15t/schema';
2
2
  export declare const consentPolicyTable: import("fumadb/schema").Table<{
3
3
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
4
4
  version: import("fumadb/schema").Column<"string", string, string>;
5
5
  type: import("fumadb/schema").Column<"string", string, string>;
6
+ hash: import("fumadb/schema").Column<"string", string | null, string | null>;
6
7
  effectiveDate: import("fumadb/schema").Column<"timestamp", Date, Date>;
7
8
  isActive: import("fumadb/schema").Column<"bool", boolean | null, boolean>;
8
9
  createdAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
9
10
  tenantId: import("fumadb/schema").Column<"string", string | null, string | null>;
10
11
  }, {}>;
11
- export { type ConsentPolicy, consentPolicySchema, type PolicyType, policyTypeSchema, };
12
+ export { type ConsentPolicy, consentPolicySchema, type LegalDocumentPolicyType, legalDocumentPolicyTypeSchema, type PolicyType, policyTypeSchema, };
12
13
  export declare const PolicyTypeSchema: import("valibot").PicklistSchema<["cookie_banner", "privacy_policy", "dpa", "terms_and_conditions", "marketing_communications", "age_verification", "other"], undefined>;
@@ -1,4 +1,4 @@
1
- import { type ConsentPurpose, consentPurposeSchema } from '../../../../../schema/dist-types/index.d.ts';
1
+ import { type ConsentPurpose, consentPurposeSchema } from '@c15t/schema';
2
2
  export declare const consentPurposeTable: import("fumadb/schema").Table<{
3
3
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
4
4
  code: import("fumadb/schema").Column<"string", string, string>;
@@ -1,4 +1,4 @@
1
- import { type Consent, consentSchema } from '../../../../../schema/dist-types/index.d.ts';
1
+ import { type Consent, consentSchema } from '@c15t/schema';
2
2
  export declare const consentTable: import("fumadb/schema").Table<{
3
3
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
4
4
  subjectId: import("fumadb/schema").Column<"string", string, string>;
@@ -1,4 +1,4 @@
1
- import { type Domain, domainSchema } from '../../../../../schema/dist-types/index.d.ts';
1
+ import { type Domain, domainSchema } from '@c15t/schema';
2
2
  export declare const domainTable: import("fumadb/schema").Table<{
3
3
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
4
4
  name: import("fumadb/schema").Column<"string", string, string>;
@@ -67,6 +67,7 @@ export declare const v2: import("fumadb/schema").Schema<"2.0.0", {
67
67
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
68
68
  version: import("fumadb/schema").Column<"string", string, string>;
69
69
  type: import("fumadb/schema").Column<"string", string, string>;
70
+ hash: import("fumadb/schema").Column<"string", string | null, string | null>;
70
71
  effectiveDate: import("fumadb/schema").Column<"timestamp", Date, Date>;
71
72
  isActive: import("fumadb/schema").Column<"bool", boolean | null, boolean>;
72
73
  createdAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
@@ -248,6 +249,7 @@ export declare const v2: import("fumadb/schema").Schema<"2.0.0", {
248
249
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
249
250
  version: import("fumadb/schema").Column<"string", string, string>;
250
251
  type: import("fumadb/schema").Column<"string", string, string>;
252
+ hash: import("fumadb/schema").Column<"string", string | null, string | null>;
251
253
  effectiveDate: import("fumadb/schema").Column<"timestamp", Date, Date>;
252
254
  isActive: import("fumadb/schema").Column<"bool", boolean | null, boolean>;
253
255
  createdAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
@@ -322,6 +324,7 @@ export declare const v2: import("fumadb/schema").Schema<"2.0.0", {
322
324
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
323
325
  version: import("fumadb/schema").Column<"string", string, string>;
324
326
  type: import("fumadb/schema").Column<"string", string, string>;
327
+ hash: import("fumadb/schema").Column<"string", string | null, string | null>;
325
328
  effectiveDate: import("fumadb/schema").Column<"timestamp", Date, Date>;
326
329
  isActive: import("fumadb/schema").Column<"bool", boolean | null, boolean>;
327
330
  createdAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
@@ -430,6 +433,7 @@ export declare const v2: import("fumadb/schema").Schema<"2.0.0", {
430
433
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
431
434
  version: import("fumadb/schema").Column<"string", string, string>;
432
435
  type: import("fumadb/schema").Column<"string", string, string>;
436
+ hash: import("fumadb/schema").Column<"string", string | null, string | null>;
433
437
  effectiveDate: import("fumadb/schema").Column<"timestamp", Date, Date>;
434
438
  isActive: import("fumadb/schema").Column<"bool", boolean | null, boolean>;
435
439
  createdAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
@@ -603,6 +607,7 @@ export declare const v2: import("fumadb/schema").Schema<"2.0.0", {
603
607
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
604
608
  version: import("fumadb/schema").Column<"string", string, string>;
605
609
  type: import("fumadb/schema").Column<"string", string, string>;
610
+ hash: import("fumadb/schema").Column<"string", string | null, string | null>;
606
611
  effectiveDate: import("fumadb/schema").Column<"timestamp", Date, Date>;
607
612
  isActive: import("fumadb/schema").Column<"bool", boolean | null, boolean>;
608
613
  createdAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
@@ -762,6 +767,7 @@ export declare const v2: import("fumadb/schema").Schema<"2.0.0", {
762
767
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
763
768
  version: import("fumadb/schema").Column<"string", string, string>;
764
769
  type: import("fumadb/schema").Column<"string", string, string>;
770
+ hash: import("fumadb/schema").Column<"string", string | null, string | null>;
765
771
  effectiveDate: import("fumadb/schema").Column<"timestamp", Date, Date>;
766
772
  isActive: import("fumadb/schema").Column<"bool", boolean | null, boolean>;
767
773
  createdAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
@@ -912,6 +918,7 @@ export declare const v2: import("fumadb/schema").Schema<"2.0.0", {
912
918
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
913
919
  version: import("fumadb/schema").Column<"string", string, string>;
914
920
  type: import("fumadb/schema").Column<"string", string, string>;
921
+ hash: import("fumadb/schema").Column<"string", string | null, string | null>;
915
922
  effectiveDate: import("fumadb/schema").Column<"timestamp", Date, Date>;
916
923
  isActive: import("fumadb/schema").Column<"bool", boolean | null, boolean>;
917
924
  createdAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
@@ -1,4 +1,4 @@
1
- import { type RuntimePolicyDecision, runtimePolicyDecisionSchema } from '../../../../../schema/dist-types/index.d.ts';
1
+ import { type RuntimePolicyDecision, runtimePolicyDecisionSchema } from '@c15t/schema';
2
2
  export declare const runtimePolicyDecisionTable: import("fumadb/schema").Table<{
3
3
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
4
4
  tenantId: import("fumadb/schema").Column<"string", string | null, string | null>;
@@ -1,4 +1,4 @@
1
- import { type Subject, subjectSchema } from '../../../../../schema/dist-types/index.d.ts';
1
+ import { type Subject, subjectSchema } from '@c15t/schema';
2
2
  export declare const subjectTable: import("fumadb/schema").Table<{
3
3
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
4
4
  externalId: import("fumadb/schema").Column<"string", string | null, string | null>;
@@ -1541,6 +1541,7 @@ export declare const DB: import("fumadb").FumaDBFactory<(import("fumadb/schema")
1541
1541
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
1542
1542
  version: import("fumadb/schema").Column<"string", string, string>;
1543
1543
  type: import("fumadb/schema").Column<"string", string, string>;
1544
+ hash: import("fumadb/schema").Column<"string", string | null, string | null>;
1544
1545
  effectiveDate: import("fumadb/schema").Column<"timestamp", Date, Date>;
1545
1546
  isActive: import("fumadb/schema").Column<"bool", boolean | null, boolean>;
1546
1547
  createdAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
@@ -1722,6 +1723,7 @@ export declare const DB: import("fumadb").FumaDBFactory<(import("fumadb/schema")
1722
1723
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
1723
1724
  version: import("fumadb/schema").Column<"string", string, string>;
1724
1725
  type: import("fumadb/schema").Column<"string", string, string>;
1726
+ hash: import("fumadb/schema").Column<"string", string | null, string | null>;
1725
1727
  effectiveDate: import("fumadb/schema").Column<"timestamp", Date, Date>;
1726
1728
  isActive: import("fumadb/schema").Column<"bool", boolean | null, boolean>;
1727
1729
  createdAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
@@ -1796,6 +1798,7 @@ export declare const DB: import("fumadb").FumaDBFactory<(import("fumadb/schema")
1796
1798
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
1797
1799
  version: import("fumadb/schema").Column<"string", string, string>;
1798
1800
  type: import("fumadb/schema").Column<"string", string, string>;
1801
+ hash: import("fumadb/schema").Column<"string", string | null, string | null>;
1799
1802
  effectiveDate: import("fumadb/schema").Column<"timestamp", Date, Date>;
1800
1803
  isActive: import("fumadb/schema").Column<"bool", boolean | null, boolean>;
1801
1804
  createdAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
@@ -1904,6 +1907,7 @@ export declare const DB: import("fumadb").FumaDBFactory<(import("fumadb/schema")
1904
1907
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
1905
1908
  version: import("fumadb/schema").Column<"string", string, string>;
1906
1909
  type: import("fumadb/schema").Column<"string", string, string>;
1910
+ hash: import("fumadb/schema").Column<"string", string | null, string | null>;
1907
1911
  effectiveDate: import("fumadb/schema").Column<"timestamp", Date, Date>;
1908
1912
  isActive: import("fumadb/schema").Column<"bool", boolean | null, boolean>;
1909
1913
  createdAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
@@ -2077,6 +2081,7 @@ export declare const DB: import("fumadb").FumaDBFactory<(import("fumadb/schema")
2077
2081
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
2078
2082
  version: import("fumadb/schema").Column<"string", string, string>;
2079
2083
  type: import("fumadb/schema").Column<"string", string, string>;
2084
+ hash: import("fumadb/schema").Column<"string", string | null, string | null>;
2080
2085
  effectiveDate: import("fumadb/schema").Column<"timestamp", Date, Date>;
2081
2086
  isActive: import("fumadb/schema").Column<"bool", boolean | null, boolean>;
2082
2087
  createdAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
@@ -2236,6 +2241,7 @@ export declare const DB: import("fumadb").FumaDBFactory<(import("fumadb/schema")
2236
2241
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
2237
2242
  version: import("fumadb/schema").Column<"string", string, string>;
2238
2243
  type: import("fumadb/schema").Column<"string", string, string>;
2244
+ hash: import("fumadb/schema").Column<"string", string | null, string | null>;
2239
2245
  effectiveDate: import("fumadb/schema").Column<"timestamp", Date, Date>;
2240
2246
  isActive: import("fumadb/schema").Column<"bool", boolean | null, boolean>;
2241
2247
  createdAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
@@ -2386,6 +2392,7 @@ export declare const DB: import("fumadb").FumaDBFactory<(import("fumadb/schema")
2386
2392
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
2387
2393
  version: import("fumadb/schema").Column<"string", string, string>;
2388
2394
  type: import("fumadb/schema").Column<"string", string, string>;
2395
+ hash: import("fumadb/schema").Column<"string", string | null, string | null>;
2389
2396
  effectiveDate: import("fumadb/schema").Column<"timestamp", Date, Date>;
2390
2397
  isActive: import("fumadb/schema").Column<"bool", boolean | null, boolean>;
2391
2398
  createdAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
@@ -2540,6 +2547,7 @@ export declare const LatestDB: import("fumadb").FumaDBFactory<import("fumadb/sch
2540
2547
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
2541
2548
  version: import("fumadb/schema").Column<"string", string, string>;
2542
2549
  type: import("fumadb/schema").Column<"string", string, string>;
2550
+ hash: import("fumadb/schema").Column<"string", string | null, string | null>;
2543
2551
  effectiveDate: import("fumadb/schema").Column<"timestamp", Date, Date>;
2544
2552
  isActive: import("fumadb/schema").Column<"bool", boolean | null, boolean>;
2545
2553
  createdAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
@@ -2721,6 +2729,7 @@ export declare const LatestDB: import("fumadb").FumaDBFactory<import("fumadb/sch
2721
2729
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
2722
2730
  version: import("fumadb/schema").Column<"string", string, string>;
2723
2731
  type: import("fumadb/schema").Column<"string", string, string>;
2732
+ hash: import("fumadb/schema").Column<"string", string | null, string | null>;
2724
2733
  effectiveDate: import("fumadb/schema").Column<"timestamp", Date, Date>;
2725
2734
  isActive: import("fumadb/schema").Column<"bool", boolean | null, boolean>;
2726
2735
  createdAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
@@ -2795,6 +2804,7 @@ export declare const LatestDB: import("fumadb").FumaDBFactory<import("fumadb/sch
2795
2804
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
2796
2805
  version: import("fumadb/schema").Column<"string", string, string>;
2797
2806
  type: import("fumadb/schema").Column<"string", string, string>;
2807
+ hash: import("fumadb/schema").Column<"string", string | null, string | null>;
2798
2808
  effectiveDate: import("fumadb/schema").Column<"timestamp", Date, Date>;
2799
2809
  isActive: import("fumadb/schema").Column<"bool", boolean | null, boolean>;
2800
2810
  createdAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
@@ -2903,6 +2913,7 @@ export declare const LatestDB: import("fumadb").FumaDBFactory<import("fumadb/sch
2903
2913
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
2904
2914
  version: import("fumadb/schema").Column<"string", string, string>;
2905
2915
  type: import("fumadb/schema").Column<"string", string, string>;
2916
+ hash: import("fumadb/schema").Column<"string", string | null, string | null>;
2906
2917
  effectiveDate: import("fumadb/schema").Column<"timestamp", Date, Date>;
2907
2918
  isActive: import("fumadb/schema").Column<"bool", boolean | null, boolean>;
2908
2919
  createdAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
@@ -3076,6 +3087,7 @@ export declare const LatestDB: import("fumadb").FumaDBFactory<import("fumadb/sch
3076
3087
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
3077
3088
  version: import("fumadb/schema").Column<"string", string, string>;
3078
3089
  type: import("fumadb/schema").Column<"string", string, string>;
3090
+ hash: import("fumadb/schema").Column<"string", string | null, string | null>;
3079
3091
  effectiveDate: import("fumadb/schema").Column<"timestamp", Date, Date>;
3080
3092
  isActive: import("fumadb/schema").Column<"bool", boolean | null, boolean>;
3081
3093
  createdAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
@@ -3235,6 +3247,7 @@ export declare const LatestDB: import("fumadb").FumaDBFactory<import("fumadb/sch
3235
3247
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
3236
3248
  version: import("fumadb/schema").Column<"string", string, string>;
3237
3249
  type: import("fumadb/schema").Column<"string", string, string>;
3250
+ hash: import("fumadb/schema").Column<"string", string | null, string | null>;
3238
3251
  effectiveDate: import("fumadb/schema").Column<"timestamp", Date, Date>;
3239
3252
  isActive: import("fumadb/schema").Column<"bool", boolean | null, boolean>;
3240
3253
  createdAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
@@ -3385,6 +3398,7 @@ export declare const LatestDB: import("fumadb").FumaDBFactory<import("fumadb/sch
3385
3398
  id: import("fumadb/schema").IdColumn<"varchar(255)", string, string>;
3386
3399
  version: import("fumadb/schema").Column<"string", string, string>;
3387
3400
  type: import("fumadb/schema").Column<"string", string, string>;
3401
+ hash: import("fumadb/schema").Column<"string", string | null, string | null>;
3388
3402
  effectiveDate: import("fumadb/schema").Column<"timestamp", Date, Date>;
3389
3403
  isActive: import("fumadb/schema").Column<"bool", boolean | null, boolean>;
3390
3404
  createdAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
@@ -1,5 +1,5 @@
1
1
  export type { InitPayload } from './init-handler';
2
- export { c15tEdgeInit } from './init-handler';
2
+ export { unstable_c15tEdgeInit } from './init-handler';
3
3
  export type { C15TConsentResolverOptions, CategoryConsent, ResolvedConsent, } from './resolve-consent';
4
- export { resolveConsent } from './resolve-consent';
4
+ export { unstable_resolveConsent } from './resolve-consent';
5
5
  export type { C15TEdgeOptions } from './types';
@@ -14,12 +14,14 @@ export type { InitPayload };
14
14
  * It has no dependency on Hono or any database adapter, making it suitable for
15
15
  * edge runtimes such as Vercel Middleware, Cloudflare Workers, or Deno Deploy.
16
16
  *
17
+ * @experimental This API is unstable in 2.0 and may change or be removed.
18
+ *
17
19
  * @example
18
20
  * ```ts
19
21
  * // middleware.ts (Vercel Edge)
20
- * import { c15tEdgeInit } from '@c15t/backend/edge';
22
+ * import { unstable_c15tEdgeInit } from '@c15t/backend/edge';
21
23
  *
22
- * const initHandler = c15tEdgeInit({
24
+ * const initHandler = unstable_c15tEdgeInit({
23
25
  * trustedOrigins: ['https://myapp.com'],
24
26
  * policyPacks: [
25
27
  * { id: 'eu', match: { countries: ['DE', 'FR'] }, consent: { model: 'opt-in' }, ui: { mode: 'banner' } },
@@ -35,4 +37,4 @@ export type { InitPayload };
35
37
  * }
36
38
  * ```
37
39
  */
38
- export declare function c15tEdgeInit(options: C15TEdgeOptions): (request: Request) => Promise<Response>;
40
+ export declare function unstable_c15tEdgeInit(options: C15TEdgeOptions): (request: Request) => Promise<Response>;
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * @packageDocumentation
9
9
  */
10
- import type { Logger } from '../../../logger/dist-types/index.d.ts';
10
+ import type { Logger } from '@c15t/logger';
11
11
  import type { C15TEdgeOptions } from './types';
12
12
  /**
13
13
  * Options for the consent resolver — a subset of C15TEdgeOptions
@@ -50,19 +50,19 @@ export interface ResolvedConsent {
50
50
  *
51
51
  * Fully synchronous — no async, no fetch calls, no crypto.
52
52
  *
53
- * This is a lightweight alternative to `c15tEdgeInit` for enterprise
53
+ * This is a lightweight alternative to `unstable_c15tEdgeInit` for enterprise
54
54
  * customers who manage their own consent cookie. It returns the resolved
55
55
  * policy and default consent state without translations, GVL, branding,
56
56
  * or snapshot tokens.
57
57
  *
58
- * @experimental This API may change in future versions.
58
+ * @experimental This API is unstable in 2.0 and may change or be removed.
59
59
  *
60
60
  * @example
61
61
  * ```ts
62
- * import { resolveConsent } from '@c15t/backend/edge';
62
+ * import { unstable_resolveConsent } from '@c15t/backend/edge';
63
63
  *
64
64
  * export function middleware(request: Request) {
65
- * const consent = resolveConsent(request, {
65
+ * const consent = unstable_resolveConsent(request, {
66
66
  * policyPacks: [
67
67
  * { id: 'eu', match: { countries: ['DE', 'FR'] }, consent: { model: 'opt-in', categories: ['necessary', 'marketing', 'measurement'] }, ui: { mode: 'banner' } },
68
68
  * { id: 'us', match: { isDefault: true }, consent: { model: 'opt-out', categories: ['necessary', 'marketing', 'measurement'] }, ui: { mode: 'banner' } },
@@ -77,4 +77,4 @@ export interface ResolvedConsent {
77
77
  * }
78
78
  * ```
79
79
  */
80
- export declare function resolveConsent(request: Request, options: C15TConsentResolverOptions, logger?: Logger): ResolvedConsent;
80
+ export declare function unstable_resolveConsent(request: Request, options: C15TConsentResolverOptions, logger?: Logger): ResolvedConsent;
@@ -10,4 +10,4 @@ import type { C15TOptions } from '../types';
10
10
  * This is a strict subset of {@link C15TOptions} containing only the fields
11
11
  * needed for consent policy resolution — no database adapter required.
12
12
  */
13
- export type C15TEdgeOptions = Pick<C15TOptions, 'appName' | 'tenantId' | 'trustedOrigins' | 'disableGeoLocation' | 'customTranslations' | 'i18n' | 'policyPacks' | 'branding' | 'iab' | 'cache' | 'policySnapshot' | 'telemetry' | 'logger'>;
13
+ export type C15TEdgeOptions = Pick<C15TOptions, 'appName' | 'tenantId' | 'trustedOrigins' | 'disableGeoLocation' | 'customTranslations' | 'i18n' | 'policyPacks' | 'branding' | 'iab' | 'cache' | 'policySnapshot' | 'legalDocumentSnapshot' | 'telemetry' | 'logger'>;
@@ -1,5 +1,5 @@
1
- import type { GlobalVendorList, NonIABVendor } from '../../../../schema/dist-types/types';
2
- import type { Translations } from '../../../../translations/dist-types/index.d.ts';
1
+ import type { GlobalVendorList, NonIABVendor } from '@c15t/schema/types';
2
+ import type { Translations } from '@c15t/translations';
3
3
  import type { Branding } from '../../types';
4
4
  import type { JurisdictionCode } from '../../types/api';
5
5
  /**
@@ -38,10 +38,10 @@ export declare function buildResponse({ jurisdiction, location, acceptLanguage,
38
38
  regionCode: string | null;
39
39
  };
40
40
  translations: {
41
- translations: import("../../../../translations/dist-types/index.d.ts").CompleteTranslations;
41
+ translations: import("@c15t/translations").CompleteTranslations;
42
42
  language: string;
43
43
  };
44
- branding: "c15t" | "consent" | "none";
44
+ branding: "c15t" | "consent" | "none" | "inth";
45
45
  gvl: {
46
46
  gvlSpecificationVersion: number;
47
47
  vendorListVersion: number;
@@ -1,4 +1,4 @@
1
- import type { PolicyMatchedBy, PolicyValidationResult, ResolvedPolicyDecision as SharedResolvedPolicyDecision, ResolvedPolicyMatch as SharedResolvedPolicyMatch, ResolvedPolicy as SharedResolvedRuntimePolicy } from '../../../../schema/dist-types/types';
1
+ import type { PolicyMatchedBy, PolicyValidationResult, ResolvedPolicyDecision as SharedResolvedPolicyDecision, ResolvedPolicyMatch as SharedResolvedPolicyMatch, ResolvedPolicy as SharedResolvedRuntimePolicy } from '@c15t/schema/types';
2
2
  import type { JurisdictionCode as BackendJurisdictionCode } from '../../types';
3
3
  export type { PolicyMatchedBy, PolicyValidationResult };
4
4
  export type ResolvedRuntimePolicy = SharedResolvedRuntimePolicy;
@@ -3,8 +3,8 @@
3
3
  *
4
4
  * @packageDocumentation
5
5
  */
6
- import type { Logger } from '../../../../logger/dist-types/index.d.ts';
7
- import type { ResolvedPolicy } from '../../../../schema/dist-types/types';
6
+ import type { Logger } from '@c15t/logger';
7
+ import type { ResolvedPolicy } from '@c15t/schema/types';
8
8
  import type { C15TEdgeOptions } from '../../edge/types';
9
9
  /**
10
10
  * Subset of C15TOptions needed by the init resolver.
@@ -1,4 +1,4 @@
1
- import { type CompleteTranslations, type Translations } from '../../../../translations/dist-types/index.d.ts';
1
+ import { type CompleteTranslations, type Translations } from '@c15t/translations';
2
2
  import type { C15TOptions, PolicyConfig } from '../../types';
3
3
  interface LoggerLike {
4
4
  warn: (message: string, metadata?: Record<string, unknown>) => void;
@@ -0,0 +1,11 @@
1
+ import type { Context } from 'hono';
2
+ export declare const syncCurrentLegalDocumentHandler: (c: Context) => Promise<Response & import("hono").TypedResponse<{
3
+ policy: {
4
+ id: string;
5
+ type: string;
6
+ version: string;
7
+ hash: string;
8
+ effectiveDate: string;
9
+ isActive: boolean;
10
+ };
11
+ }, import("hono/utils/http-status").ContentfulStatusCode, "json">>;
@@ -0,0 +1,39 @@
1
+ import { type JWTPayload } from 'jose';
2
+ import type { LegalDocumentPolicyType, LegalDocumentSnapshotOptions } from '../../types';
3
+ export type LegalDocumentSnapshotVerificationFailureReason = 'missing' | 'malformed' | 'expired' | 'invalid';
4
+ export type LegalDocumentSnapshotVerificationResult = {
5
+ valid: true;
6
+ payload: LegalDocumentSnapshotPayload;
7
+ } | {
8
+ valid: false;
9
+ reason: LegalDocumentSnapshotVerificationFailureReason;
10
+ };
11
+ export interface LegalDocumentSnapshotPayload extends JWTPayload {
12
+ iss: string;
13
+ aud: string;
14
+ sub: string;
15
+ tenantId?: string;
16
+ type: LegalDocumentPolicyType;
17
+ version: string;
18
+ hash: string;
19
+ effectiveDate: string;
20
+ iat: number;
21
+ exp: number;
22
+ }
23
+ export declare function createLegalDocumentSnapshotToken(params: {
24
+ options?: LegalDocumentSnapshotOptions;
25
+ tenantId?: string;
26
+ type: LegalDocumentPolicyType;
27
+ version: string;
28
+ hash: string;
29
+ effectiveDate: string;
30
+ ttlSeconds?: number;
31
+ }): Promise<{
32
+ token: string;
33
+ payload: LegalDocumentSnapshotPayload;
34
+ } | undefined>;
35
+ export declare function verifyLegalDocumentSnapshotToken(params: {
36
+ token?: string;
37
+ options?: LegalDocumentSnapshotOptions;
38
+ tenantId?: string;
39
+ }): Promise<LegalDocumentSnapshotVerificationResult>;
@@ -20,6 +20,9 @@ export declare const getSubjectHandler: (c: Context) => Promise<Response & impor
20
20
  id: string;
21
21
  type: string;
22
22
  policyId: string | undefined;
23
+ policyVersion: string | undefined;
24
+ policyHash: string | undefined;
25
+ policyEffectiveDate: string | undefined;
23
26
  isLatestPolicy: boolean;
24
27
  preferences: {
25
28
  [x: string]: boolean;
@@ -19,6 +19,9 @@ export declare const listSubjectsHandler: (c: Context) => Promise<Response & imp
19
19
  id: string;
20
20
  type: string;
21
21
  policyId: string | undefined;
22
+ policyVersion: string | undefined;
23
+ policyHash: string | undefined;
24
+ policyEffectiveDate: string | undefined;
22
25
  isLatestPolicy: boolean;
23
26
  preferences: {
24
27
  [x: string]: boolean;
@@ -12,6 +12,9 @@ export interface EnrichedConsentItem {
12
12
  id: string;
13
13
  type: string;
14
14
  policyId: string | undefined;
15
+ policyVersion: string | undefined;
16
+ policyHash: string | undefined;
17
+ policyEffectiveDate: Date | undefined;
15
18
  isLatestPolicy: boolean;
16
19
  preferences: Record<string, boolean> | undefined;
17
20
  givenAt: Date;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @packageDocumentation
5
5
  */
6
- import type { Logger } from '../../../../logger/dist-types/index.d.ts';
6
+ import type { Logger } from '@c15t/logger';
7
7
  /**
8
8
  * Regular expression to strip protocol, trailing slashes, and port numbers from URLs
9
9
  * Matches:
@@ -8,8 +8,8 @@ import type { PolicyConfig, PolicyModel, PolicyScopeMode, PolicyUiMode, PolicyUi
8
8
  * Use the builder helpers to normalize this input into runtime-ready policy
9
9
  * configs.
10
10
  *
11
- * @see {@link https://v2.c15t.com/docs/self-host/guides/policy-packs}
12
- * @see {@link https://v2.c15t.com/docs/frameworks/react/concepts/policy-packs}
11
+ * @see {@link https://c15t.com/docs/self-host/guides/policy-packs}
12
+ * @see {@link https://c15t.com/docs/frameworks/react/concepts/policy-packs}
13
13
  */
14
14
  export interface PolicyBuilderInput {
15
15
  id: string;
@@ -57,7 +57,7 @@ export interface PolicyBuilderInput {
57
57
  * Empty optional fields are removed from the final output, matcher input is
58
58
  * merged into `match`, and duplicate string arrays are deduplicated.
59
59
  *
60
- * @see {@link https://v2.c15t.com/docs/self-host/guides/policy-packs}
60
+ * @see {@link https://c15t.com/docs/self-host/guides/policy-packs}
61
61
  */
62
62
  export declare function buildPolicyConfig(input: PolicyBuilderInput): PolicyConfig;
63
63
  /**
@@ -68,7 +68,7 @@ export declare function buildPolicyConfig(input: PolicyBuilderInput): PolicyConf
68
68
  * duplicate region/country matchers use first-match-wins semantics within the
69
69
  * same matcher type.
70
70
  *
71
- * @see {@link https://v2.c15t.com/docs/self-host/guides/policy-packs}
71
+ * @see {@link https://c15t.com/docs/self-host/guides/policy-packs}
72
72
  */
73
73
  export declare function buildPolicyPack(inputs: PolicyBuilderInput[]): PolicyConfig[];
74
74
  /**
@@ -84,7 +84,7 @@ export declare function buildPolicyPack(inputs: PolicyBuilderInput[]): PolicyCon
84
84
  * When `defaultPolicy` is provided, its `countries` and `regions` fields are
85
85
  * stripped and replaced with `match.isDefault = true`.
86
86
  *
87
- * @see {@link https://v2.c15t.com/docs/self-host/guides/policy-packs}
87
+ * @see {@link https://c15t.com/docs/self-host/guides/policy-packs}
88
88
  */
89
89
  export declare function buildPolicyPackWithDefault(inputs: PolicyBuilderInput[], defaultPolicy?: PolicyBuilderInput): PolicyConfig[];
90
90
  /**
@@ -107,7 +107,7 @@ export declare function buildPolicyPackWithDefault(inputs: PolicyBuilderInput[],
107
107
  * );
108
108
  * ```
109
109
  *
110
- * @see {@link https://v2.c15t.com/docs/self-host/guides/policy-packs}
110
+ * @see {@link https://c15t.com/docs/self-host/guides/policy-packs}
111
111
  */
112
112
  export declare function composePacks(...packs: PolicyConfig[][]): PolicyConfig[];
113
113
  /**
@@ -117,7 +117,7 @@ export declare function composePacks(...packs: PolicyConfig[][]): PolicyConfig[]
117
117
  * Useful when you prefer a grouped API such as `policyBuilder.createPack()`
118
118
  * inside backend config files.
119
119
  *
120
- * @see {@link https://v2.c15t.com/docs/self-host/guides/policy-packs}
120
+ * @see {@link https://c15t.com/docs/self-host/guides/policy-packs}
121
121
  */
122
122
  export declare const policyBuilder: {
123
123
  create: typeof buildPolicyConfig;
@@ -1,2 +1,2 @@
1
- export { policyPackPresets } from '../../../schema/dist-types/index.d.ts';
2
- export type { EuropePolicyMode, PolicyPackPresets } from '../../../schema/dist-types/types';
1
+ export { policyPackPresets } from '@c15t/schema';
2
+ export type { EuropePolicyMode, PolicyPackPresets } from '@c15t/schema/types';
@@ -1,3 +1,3 @@
1
- import type { PolicyMatch } from '../../../schema/dist-types/types';
2
- export { EEA_COUNTRY_CODES, EU_COUNTRY_CODES, POLICY_MATCH_DATASET_VERSION, policyMatchers, UK_COUNTRY_CODES, } from '../../../schema/dist-types/types';
1
+ import type { PolicyMatch } from '@c15t/schema/types';
2
+ export { EEA_COUNTRY_CODES, EU_COUNTRY_CODES, POLICY_MATCH_DATASET_VERSION, policyMatchers, UK_COUNTRY_CODES, } from '@c15t/schema/types';
3
3
  export type { PolicyMatch };
@@ -5,5 +5,6 @@
5
5
  */
6
6
  export { createConsentRoutes } from './consent';
7
7
  export { createInitRoute } from './init';
8
+ export { createLegalDocumentRoutes } from './legal-document';
8
9
  export { createStatusRoute } from './status';
9
10
  export { createSubjectRoutes } from './subject';