@c15t/backend 2.0.0-rc.6 → 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.
Files changed (49) hide show
  1. package/dist/302.js +1 -1
  2. package/dist/{364.js → 915.js} +626 -24
  3. package/dist/core.cjs +465 -11
  4. package/dist/core.js +4 -152
  5. package/dist/db/schema.cjs +4 -0
  6. package/dist/db/schema.js +3 -2
  7. package/dist/edge.cjs +8 -8
  8. package/dist/edge.js +3 -3
  9. package/dist/router.cjs +224 -41
  10. package/dist/router.js +1 -1
  11. package/dist-types/cache/gvl-resolver.d.ts +1 -1
  12. package/dist-types/db/registry/consent-policy.d.ts +57 -1
  13. package/dist-types/db/registry/index.d.ts +43 -1
  14. package/dist-types/db/registry/types.d.ts +2 -1
  15. package/dist-types/db/schema/1.0.0/consent.d.ts +1 -1
  16. package/dist-types/db/schema/2.0.0/audit-log.d.ts +1 -1
  17. package/dist-types/db/schema/2.0.0/consent-policy.d.ts +3 -2
  18. package/dist-types/db/schema/2.0.0/consent-purpose.d.ts +1 -1
  19. package/dist-types/db/schema/2.0.0/consent.d.ts +1 -1
  20. package/dist-types/db/schema/2.0.0/domain.d.ts +1 -1
  21. package/dist-types/db/schema/2.0.0/index.d.ts +7 -0
  22. package/dist-types/db/schema/2.0.0/runtime-policy-decision.d.ts +1 -1
  23. package/dist-types/db/schema/2.0.0/subject.d.ts +1 -1
  24. package/dist-types/db/schema/index.d.ts +14 -0
  25. package/dist-types/edge/index.d.ts +2 -2
  26. package/dist-types/edge/init-handler.d.ts +5 -3
  27. package/dist-types/edge/resolve-consent.d.ts +6 -6
  28. package/dist-types/edge/types.d.ts +1 -1
  29. package/dist-types/handlers/init/index.d.ts +4 -4
  30. package/dist-types/handlers/init/policy.d.ts +1 -1
  31. package/dist-types/handlers/init/resolve-init.d.ts +2 -2
  32. package/dist-types/handlers/init/translations.d.ts +1 -1
  33. package/dist-types/handlers/legal-document/current.handler.d.ts +11 -0
  34. package/dist-types/handlers/legal-document/snapshot.d.ts +39 -0
  35. package/dist-types/handlers/subject/get.handler.d.ts +3 -0
  36. package/dist-types/handlers/subject/list.handler.d.ts +3 -0
  37. package/dist-types/handlers/utils/consent-enrichment.d.ts +3 -0
  38. package/dist-types/middleware/cors/is-origin-trusted.d.ts +1 -1
  39. package/dist-types/policies/defaults.d.ts +2 -2
  40. package/dist-types/policies/matchers.d.ts +2 -2
  41. package/dist-types/routes/index.d.ts +1 -0
  42. package/dist-types/routes/legal-document.d.ts +7 -0
  43. package/dist-types/types/index.d.ts +26 -5
  44. package/dist-types/utils/instrumentation.d.ts +2 -2
  45. package/dist-types/utils/logger.d.ts +1 -1
  46. package/dist-types/version.d.ts +1 -1
  47. package/docs/api/configuration.md +13 -2
  48. package/docs/guides/edge-deployment.md +18 -15
  49. package/package.json +6 -6
@@ -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:
@@ -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';
@@ -0,0 +1,7 @@
1
+ import { Hono } from 'hono';
2
+ import type { C15TContext } from '../types';
3
+ export declare const createLegalDocumentRoutes: () => Hono<{
4
+ Variables: {
5
+ c15tContext: C15TContext;
6
+ };
7
+ }, import("hono/types").BlankSchema, "/">;
@@ -1,13 +1,13 @@
1
- import type { createLogger, LoggerOptions } from '../../../logger/dist-types/index.d.ts';
2
- import { type Branding, type GlobalVendorList, type NonIABVendor, type PolicyConfig } from '../../../schema/dist-types/types';
3
- import type { Translations } from '../../../translations/dist-types/index.d.ts';
1
+ import type { createLogger, LoggerOptions } from '@c15t/logger';
2
+ import { type Branding, type GlobalVendorList, type NonIABVendor, type PolicyConfig } from '@c15t/schema/types';
3
+ import type { Translations } from '@c15t/translations';
4
4
  import type { Meter, Tracer } from '@opentelemetry/api';
5
5
  import type { FumaDB, InferFumaDB } from 'fumadb';
6
6
  import type { CacheAdapter } from '../cache/types';
7
7
  import type { createRegistry } from '../db/registry';
8
8
  import type { DB, LatestDB } from '../db/schema';
9
9
  export * from './api';
10
- export declare const branding: readonly ["c15t", "consent", "none"];
10
+ export declare const branding: readonly ["c15t", "inth", "consent", "none"];
11
11
  export type { Branding };
12
12
  export interface DatabaseOptions {
13
13
  /**
@@ -244,7 +244,7 @@ export interface I18nOptions {
244
244
  */
245
245
  defaultProfile?: string;
246
246
  }
247
- export type { PolicyConfig, PolicyModel, PolicyPack, PolicyScopeMode, PolicyUiAction, PolicyUiActionDirection, PolicyUiActionGroup, PolicyUiMode, PolicyUiProfile, PolicyUiSurfaceConfig, } from '../../../schema/dist-types/types';
247
+ export type { LegalDocumentPolicyType, PolicyConfig, PolicyModel, PolicyPack, PolicyScopeMode, PolicyUiAction, PolicyUiActionDirection, PolicyUiActionGroup, PolicyUiMode, PolicyUiProfile, PolicyUiSurfaceConfig, } from '@c15t/schema/types';
248
248
  export interface PolicySnapshotOptions {
249
249
  /**
250
250
  * Secret used for signing and verifying policy snapshot tokens.
@@ -271,6 +271,22 @@ export interface PolicySnapshotOptions {
271
271
  */
272
272
  ttlSeconds?: number;
273
273
  }
274
+ export interface LegalDocumentSnapshotOptions {
275
+ /**
276
+ * Secret used for signing and verifying legal-document snapshot tokens.
277
+ */
278
+ signingKey: string;
279
+ /**
280
+ * JWT issuer claim for legal-document snapshot tokens.
281
+ * @default "c15t"
282
+ */
283
+ issuer?: string;
284
+ /**
285
+ * JWT audience claim for legal-document snapshot tokens.
286
+ * When omitted, c15t derives a default audience and scopes it per tenant.
287
+ */
288
+ audience?: string;
289
+ }
274
290
  export interface BackgroundOptions {
275
291
  /**
276
292
  * Executes non-critical tasks after the response path has completed.
@@ -362,6 +378,7 @@ export interface C15TOptions {
362
378
  policyPacks?: PolicyConfig[];
363
379
  /**
364
380
  * Select which branding to show in the consent banner.
381
+ * Use "inth" for the INTH brand. "consent" is a deprecated alias for "inth".
365
382
  * Use "none" to hide branding.
366
383
  * @default "c15t"
367
384
  */
@@ -415,6 +432,10 @@ export interface C15TOptions {
415
432
  * Optional signed policy snapshots used to keep /init and /subjects consistent.
416
433
  */
417
434
  policySnapshot?: PolicySnapshotOptions;
435
+ /**
436
+ * Optional signed legal-document snapshots issued by external document renderers.
437
+ */
438
+ legalDocumentSnapshot?: LegalDocumentSnapshotOptions;
418
439
  /**
419
440
  * Optional background task runner for non-critical side effects.
420
441
  */
@@ -3,8 +3,8 @@ import type { C15TOptions } from '../types';
3
3
  * Span attributes for database operations
4
4
  */
5
5
  export interface DatabaseSpanAttributes {
6
- /** The database operation type (find, create, update, delete) */
7
- operation: 'find' | 'create' | 'update' | 'delete' | 'findOrCreate';
6
+ /** The database operation type */
7
+ operation: 'find' | 'create' | 'update' | 'delete' | 'findOrCreate' | 'findLatest' | 'findByHash' | 'syncCurrent' | 'findOrCreateLegalDocument';
8
8
  /** The entity type being operated on */
9
9
  entity: string;
10
10
  /** Optional additional attributes */
@@ -1,4 +1,4 @@
1
- import { createLogger, type LoggerOptions } from '../../../logger/dist-types/index.d.ts';
1
+ import { createLogger, type LoggerOptions } from '@c15t/logger';
2
2
  /**
3
3
  * Gets or creates a global logger instance
4
4
  *
@@ -1 +1 @@
1
- export declare const version = "2.0.0-rc.6";
1
+ export declare const version = "2.0.0-rc.8";