@c15t/backend 2.0.0-rc.0 → 2.0.0-rc.10

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 (336) hide show
  1. package/README.md +3 -3
  2. package/dist/302.js +473 -0
  3. package/dist/583.js +540 -0
  4. package/dist/915.js +1771 -0
  5. package/dist/cache.cjs +5 -5
  6. package/dist/cache.js +4 -415
  7. package/dist/core.cjs +1356 -120
  8. package/dist/core.js +163 -1981
  9. package/dist/db/adapters/drizzle.cjs +1 -1
  10. package/dist/db/adapters/drizzle.js +1 -2
  11. package/dist/db/adapters/kysely.cjs +1 -1
  12. package/dist/db/adapters/kysely.js +1 -2
  13. package/dist/db/adapters/mongo.cjs +1 -1
  14. package/dist/db/adapters/mongo.js +1 -2
  15. package/dist/db/adapters/prisma.cjs +1 -1
  16. package/dist/db/adapters/prisma.js +1 -2
  17. package/dist/db/adapters/typeorm.cjs +1 -1
  18. package/dist/db/adapters/typeorm.js +1 -2
  19. package/dist/db/adapters.cjs +1 -1
  20. package/dist/db/migrator.cjs +1 -1
  21. package/dist/db/schema.cjs +43 -3
  22. package/dist/db/schema.js +35 -4
  23. package/dist/define-config.cjs +1 -1
  24. package/dist/edge.cjs +1106 -0
  25. package/dist/edge.js +190 -0
  26. package/dist/router.cjs +885 -123
  27. package/dist/router.js +1 -1507
  28. package/dist/{types.cjs → types/index.cjs} +1 -1
  29. package/{dist → dist-types}/cache/adapters/cloudflare-kv.d.ts +0 -1
  30. package/{dist → dist-types}/cache/adapters/index.d.ts +0 -1
  31. package/{dist → dist-types}/cache/adapters/memory.d.ts +0 -1
  32. package/{dist → dist-types}/cache/adapters/upstash-redis.d.ts +0 -1
  33. package/{dist → dist-types}/cache/gvl-resolver.d.ts +0 -1
  34. package/{dist → dist-types}/cache/index.d.ts +0 -1
  35. package/{dist → dist-types}/cache/keys.d.ts +0 -1
  36. package/{dist → dist-types}/cache/types.d.ts +0 -1
  37. package/{dist → dist-types}/core.d.ts +8 -1
  38. package/{dist → dist-types}/db/migrator/index.d.ts +0 -1
  39. package/dist-types/db/registry/consent-policy.d.ts +78 -0
  40. package/{dist → dist-types}/db/registry/consent-purpose.d.ts +0 -1
  41. package/{dist → dist-types}/db/registry/domain.d.ts +0 -1
  42. package/dist-types/db/registry/index.d.ts +118 -0
  43. package/dist-types/db/registry/runtime-policy-decision.d.ts +60 -0
  44. package/{dist → dist-types}/db/registry/subject.d.ts +0 -2
  45. package/{dist → dist-types}/db/registry/types.d.ts +1 -1
  46. package/{dist → dist-types}/db/registry/utils/generate-id.d.ts +0 -1
  47. package/{dist → dist-types}/db/registry/utils.d.ts +0 -1
  48. package/{dist → dist-types}/db/schema/1.0.0/audit-log.d.ts +0 -1
  49. package/{dist → dist-types}/db/schema/1.0.0/consent-policy.d.ts +0 -1
  50. package/{dist → dist-types}/db/schema/1.0.0/consent-purpose.d.ts +0 -1
  51. package/{dist → dist-types}/db/schema/1.0.0/consent-record.d.ts +0 -1
  52. package/{dist → dist-types}/db/schema/1.0.0/consent.d.ts +1 -2
  53. package/{dist → dist-types}/db/schema/1.0.0/domain.d.ts +0 -1
  54. package/{dist → dist-types}/db/schema/1.0.0/index.d.ts +0 -32
  55. package/{dist → dist-types}/db/schema/1.0.0/subject.d.ts +0 -2
  56. package/{dist → dist-types}/db/schema/2.0.0/audit-log.d.ts +1 -2
  57. package/{dist → dist-types}/db/schema/2.0.0/consent-policy.d.ts +3 -3
  58. package/{dist → dist-types}/db/schema/2.0.0/consent-purpose.d.ts +1 -2
  59. package/{dist → dist-types}/db/schema/2.0.0/consent.d.ts +7 -2
  60. package/{dist → dist-types}/db/schema/2.0.0/domain.d.ts +1 -2
  61. package/{dist → dist-types}/db/schema/2.0.0/index.d.ts +455 -28
  62. package/dist-types/db/schema/2.0.0/runtime-policy-decision.d.ts +23 -0
  63. package/{dist → dist-types}/db/schema/2.0.0/subject.d.ts +1 -3
  64. package/{dist → dist-types}/db/schema/index.d.ts +908 -86
  65. package/{dist → dist-types}/db/tenant-scope.d.ts +0 -1
  66. package/dist-types/define-config.d.ts +17 -0
  67. package/dist-types/edge/index.d.ts +5 -0
  68. package/dist-types/edge/init-handler.d.ts +40 -0
  69. package/dist-types/edge/resolve-consent.d.ts +80 -0
  70. package/dist-types/edge/types.d.ts +13 -0
  71. package/{dist → dist-types}/handlers/consent/check.handler.d.ts +0 -1
  72. package/{src/handlers/consent/index.ts → dist-types/handlers/consent/index.d.ts} +0 -1
  73. package/{dist → dist-types}/handlers/init/geo.d.ts +2 -3
  74. package/{dist → dist-types}/handlers/init/index.d.ts +2 -3
  75. package/dist-types/handlers/init/policy.d.ts +26 -0
  76. package/dist-types/handlers/init/resolve-init.d.ts +44 -0
  77. package/dist-types/handlers/init/translations.d.ts +48 -0
  78. package/dist-types/handlers/legal-document/current.handler.d.ts +11 -0
  79. package/dist-types/handlers/legal-document/snapshot.d.ts +39 -0
  80. package/dist-types/handlers/policy/snapshot.d.ts +99 -0
  81. package/{src/handlers/status/index.ts → dist-types/handlers/status/index.d.ts} +0 -1
  82. package/{dist → dist-types}/handlers/status/status.handler.d.ts +0 -1
  83. package/{dist → dist-types}/handlers/subject/get.handler.d.ts +3 -2
  84. package/{src/handlers/subject/index.ts → dist-types/handlers/subject/index.d.ts} +0 -1
  85. package/{dist → dist-types}/handlers/subject/list.handler.d.ts +3 -2
  86. package/{dist → dist-types}/handlers/subject/patch.handler.d.ts +0 -2
  87. package/{dist → dist-types}/handlers/subject/post.handler.d.ts +12 -1
  88. package/{dist → dist-types}/handlers/utils/consent-enrichment.d.ts +3 -1
  89. package/{dist → dist-types}/init.d.ts +4 -7
  90. package/{dist → dist-types}/middleware/auth/index.d.ts +0 -1
  91. package/{dist → dist-types}/middleware/auth/validate-api-key.d.ts +0 -1
  92. package/{dist → dist-types}/middleware/cors/cors.d.ts +0 -1
  93. package/{src/middleware/cors/index.ts → dist-types/middleware/cors/index.d.ts} +0 -1
  94. package/{dist → dist-types}/middleware/cors/is-origin-trusted.d.ts +0 -1
  95. package/{dist → dist-types}/middleware/cors/process-cors.d.ts +0 -1
  96. package/{dist → dist-types}/middleware/openapi/config.d.ts +0 -1
  97. package/{dist → dist-types}/middleware/openapi/handlers.d.ts +0 -1
  98. package/{src/middleware/openapi/index.ts → dist-types/middleware/openapi/index.d.ts} +0 -1
  99. package/{dist → dist-types}/middleware/process-ip/index.d.ts +0 -1
  100. package/dist-types/policies/builder.d.ts +127 -0
  101. package/dist-types/policies/defaults.d.ts +2 -0
  102. package/dist-types/policies/matchers.d.ts +3 -0
  103. package/{dist → dist-types}/router.d.ts +0 -1
  104. package/{dist → dist-types}/routes/consent.d.ts +0 -1
  105. package/{dist → dist-types}/routes/index.d.ts +1 -1
  106. package/{dist → dist-types}/routes/init.d.ts +0 -1
  107. package/dist-types/routes/legal-document.d.ts +7 -0
  108. package/{dist → dist-types}/routes/status.d.ts +0 -1
  109. package/{dist → dist-types}/routes/subject.d.ts +0 -1
  110. package/{dist → dist-types}/types/api.d.ts +0 -1
  111. package/dist-types/types/index.d.ts +464 -0
  112. package/dist-types/utils/background.d.ts +6 -0
  113. package/{dist → dist-types}/utils/create-telemetry-options.d.ts +1 -2
  114. package/{dist → dist-types}/utils/env.d.ts +0 -1
  115. package/{dist → dist-types}/utils/extract-error-message.d.ts +0 -1
  116. package/{dist → dist-types}/utils/instrumentation.d.ts +2 -3
  117. package/{dist → dist-types}/utils/logger.d.ts +0 -1
  118. package/{dist → dist-types}/utils/metrics.d.ts +0 -1
  119. package/dist-types/version.d.ts +1 -0
  120. package/docs/README.md +49 -0
  121. package/docs/api/configuration.md +208 -0
  122. package/docs/api/endpoints.md +211 -0
  123. package/docs/guides/caching.md +85 -0
  124. package/docs/guides/database-setup.md +128 -0
  125. package/docs/guides/edge-deployment.md +251 -0
  126. package/docs/guides/framework-integration.md +142 -0
  127. package/docs/guides/iab-tcf.md +89 -0
  128. package/docs/guides/observability.md +96 -0
  129. package/docs/guides/policy-packs.md +396 -0
  130. package/docs/quickstart.md +129 -0
  131. package/package.json +53 -39
  132. package/.turbo/turbo-build.log +0 -49
  133. package/CHANGELOG.md +0 -89
  134. package/dist/cache/adapters/cloudflare-kv.d.ts.map +0 -1
  135. package/dist/cache/adapters/index.d.ts.map +0 -1
  136. package/dist/cache/adapters/memory.d.ts.map +0 -1
  137. package/dist/cache/adapters/upstash-redis.d.ts.map +0 -1
  138. package/dist/cache/gvl-resolver.d.ts.map +0 -1
  139. package/dist/cache/index.d.ts.map +0 -1
  140. package/dist/cache/keys.d.ts.map +0 -1
  141. package/dist/cache/types.d.ts.map +0 -1
  142. package/dist/core.d.ts.map +0 -1
  143. package/dist/db/adapters/drizzle.d.ts +0 -2
  144. package/dist/db/adapters/drizzle.d.ts.map +0 -1
  145. package/dist/db/adapters/index.d.ts +0 -2
  146. package/dist/db/adapters/index.d.ts.map +0 -1
  147. package/dist/db/adapters/kysely.d.ts +0 -2
  148. package/dist/db/adapters/kysely.d.ts.map +0 -1
  149. package/dist/db/adapters/mongo.d.ts +0 -2
  150. package/dist/db/adapters/mongo.d.ts.map +0 -1
  151. package/dist/db/adapters/prisma.d.ts +0 -2
  152. package/dist/db/adapters/prisma.d.ts.map +0 -1
  153. package/dist/db/adapters/typeorm.d.ts +0 -2
  154. package/dist/db/adapters/typeorm.d.ts.map +0 -1
  155. package/dist/db/migrator/index.d.ts.map +0 -1
  156. package/dist/db/registry/consent-policy.d.ts +0 -23
  157. package/dist/db/registry/consent-policy.d.ts.map +0 -1
  158. package/dist/db/registry/consent-purpose.d.ts.map +0 -1
  159. package/dist/db/registry/domain.d.ts.map +0 -1
  160. package/dist/db/registry/index.d.ts +0 -57
  161. package/dist/db/registry/index.d.ts.map +0 -1
  162. package/dist/db/registry/subject.d.ts.map +0 -1
  163. package/dist/db/registry/types.d.ts.map +0 -1
  164. package/dist/db/registry/utils/generate-id.d.ts.map +0 -1
  165. package/dist/db/registry/utils.d.ts.map +0 -1
  166. package/dist/db/schema/1.0.0/audit-log.d.ts.map +0 -1
  167. package/dist/db/schema/1.0.0/consent-policy.d.ts.map +0 -1
  168. package/dist/db/schema/1.0.0/consent-purpose.d.ts.map +0 -1
  169. package/dist/db/schema/1.0.0/consent-record.d.ts.map +0 -1
  170. package/dist/db/schema/1.0.0/consent.d.ts.map +0 -1
  171. package/dist/db/schema/1.0.0/domain.d.ts.map +0 -1
  172. package/dist/db/schema/1.0.0/index.d.ts.map +0 -1
  173. package/dist/db/schema/1.0.0/subject.d.ts.map +0 -1
  174. package/dist/db/schema/2.0.0/audit-log.d.ts.map +0 -1
  175. package/dist/db/schema/2.0.0/consent-policy.d.ts.map +0 -1
  176. package/dist/db/schema/2.0.0/consent-purpose.d.ts.map +0 -1
  177. package/dist/db/schema/2.0.0/consent.d.ts.map +0 -1
  178. package/dist/db/schema/2.0.0/domain.d.ts.map +0 -1
  179. package/dist/db/schema/2.0.0/index.d.ts.map +0 -1
  180. package/dist/db/schema/2.0.0/subject.d.ts.map +0 -1
  181. package/dist/db/schema/index.d.ts.map +0 -1
  182. package/dist/db/tenant-scope.d.ts.map +0 -1
  183. package/dist/define-config.d.ts +0 -5
  184. package/dist/define-config.d.ts.map +0 -1
  185. package/dist/handlers/consent/check.handler.d.ts.map +0 -1
  186. package/dist/handlers/consent/index.d.ts +0 -12
  187. package/dist/handlers/consent/index.d.ts.map +0 -1
  188. package/dist/handlers/init/geo.d.ts.map +0 -1
  189. package/dist/handlers/init/index.d.ts.map +0 -1
  190. package/dist/handlers/init/translations.d.ts +0 -28
  191. package/dist/handlers/init/translations.d.ts.map +0 -1
  192. package/dist/handlers/status/index.d.ts +0 -7
  193. package/dist/handlers/status/index.d.ts.map +0 -1
  194. package/dist/handlers/status/status.handler.d.ts.map +0 -1
  195. package/dist/handlers/subject/get.handler.d.ts.map +0 -1
  196. package/dist/handlers/subject/index.d.ts +0 -10
  197. package/dist/handlers/subject/index.d.ts.map +0 -1
  198. package/dist/handlers/subject/list.handler.d.ts.map +0 -1
  199. package/dist/handlers/subject/patch.handler.d.ts.map +0 -1
  200. package/dist/handlers/subject/post.handler.d.ts.map +0 -1
  201. package/dist/handlers/utils/consent-enrichment.d.ts.map +0 -1
  202. package/dist/init.d.ts.map +0 -1
  203. package/dist/middleware/auth/index.d.ts.map +0 -1
  204. package/dist/middleware/auth/validate-api-key.d.ts.map +0 -1
  205. package/dist/middleware/cors/cors.d.ts.map +0 -1
  206. package/dist/middleware/cors/index.d.ts +0 -30
  207. package/dist/middleware/cors/index.d.ts.map +0 -1
  208. package/dist/middleware/cors/is-origin-trusted.d.ts.map +0 -1
  209. package/dist/middleware/cors/process-cors.d.ts.map +0 -1
  210. package/dist/middleware/openapi/config.d.ts.map +0 -1
  211. package/dist/middleware/openapi/handlers.d.ts.map +0 -1
  212. package/dist/middleware/openapi/index.d.ts +0 -12
  213. package/dist/middleware/openapi/index.d.ts.map +0 -1
  214. package/dist/middleware/process-ip/index.d.ts.map +0 -1
  215. package/dist/router.d.ts.map +0 -1
  216. package/dist/routes/consent.d.ts.map +0 -1
  217. package/dist/routes/index.d.ts.map +0 -1
  218. package/dist/routes/init.d.ts.map +0 -1
  219. package/dist/routes/status.d.ts.map +0 -1
  220. package/dist/routes/subject.d.ts.map +0 -1
  221. package/dist/types/api.d.ts.map +0 -1
  222. package/dist/types/index.d.ts +0 -255
  223. package/dist/types/index.d.ts.map +0 -1
  224. package/dist/utils/create-telemetry-options.d.ts.map +0 -1
  225. package/dist/utils/env.d.ts.map +0 -1
  226. package/dist/utils/extract-error-message.d.ts.map +0 -1
  227. package/dist/utils/index.d.ts +0 -4
  228. package/dist/utils/index.d.ts.map +0 -1
  229. package/dist/utils/instrumentation.d.ts.map +0 -1
  230. package/dist/utils/logger.d.ts.map +0 -1
  231. package/dist/utils/metrics.d.ts.map +0 -1
  232. package/dist/version.d.ts +0 -2
  233. package/dist/version.d.ts.map +0 -1
  234. package/knip.json +0 -31
  235. package/rslib.config.ts +0 -93
  236. package/src/cache/adapters/cloudflare-kv.ts +0 -71
  237. package/src/cache/adapters/index.ts +0 -22
  238. package/src/cache/adapters/memory.ts +0 -111
  239. package/src/cache/adapters/upstash-redis.ts +0 -113
  240. package/src/cache/gvl-resolver.ts +0 -289
  241. package/src/cache/index.ts +0 -34
  242. package/src/cache/keys.ts +0 -68
  243. package/src/cache/types.ts +0 -66
  244. package/src/core.ts +0 -368
  245. package/src/db/migrator/index.ts +0 -80
  246. package/src/db/registry/consent-policy.test.ts +0 -451
  247. package/src/db/registry/consent-policy.ts +0 -82
  248. package/src/db/registry/consent-purpose.test.ts +0 -428
  249. package/src/db/registry/consent-purpose.ts +0 -61
  250. package/src/db/registry/domain.test.ts +0 -445
  251. package/src/db/registry/domain.ts +0 -91
  252. package/src/db/registry/index.ts +0 -14
  253. package/src/db/registry/subject.test.ts +0 -388
  254. package/src/db/registry/subject.ts +0 -129
  255. package/src/db/registry/types.ts +0 -10
  256. package/src/db/registry/utils/generate-id.test.ts +0 -216
  257. package/src/db/registry/utils/generate-id.ts +0 -133
  258. package/src/db/registry/utils.ts +0 -133
  259. package/src/db/schema/1.0.0/audit-log.ts +0 -15
  260. package/src/db/schema/1.0.0/consent-policy.ts +0 -14
  261. package/src/db/schema/1.0.0/consent-purpose.ts +0 -14
  262. package/src/db/schema/1.0.0/consent-record.ts +0 -10
  263. package/src/db/schema/1.0.0/consent.ts +0 -20
  264. package/src/db/schema/1.0.0/domain.ts +0 -12
  265. package/src/db/schema/1.0.0/index.ts +0 -48
  266. package/src/db/schema/1.0.0/subject.ts +0 -12
  267. package/src/db/schema/2.0.0/audit-log.ts +0 -18
  268. package/src/db/schema/2.0.0/consent-policy.ts +0 -28
  269. package/src/db/schema/2.0.0/consent-purpose.ts +0 -12
  270. package/src/db/schema/2.0.0/consent.ts +0 -26
  271. package/src/db/schema/2.0.0/domain.ts +0 -12
  272. package/src/db/schema/2.0.0/index.ts +0 -47
  273. package/src/db/schema/2.0.0/subject.ts +0 -14
  274. package/src/db/schema/index.ts +0 -15
  275. package/src/db/tenant-scope.test.ts +0 -750
  276. package/src/db/tenant-scope.ts +0 -103
  277. package/src/define-config.ts +0 -5
  278. package/src/handlers/consent/check.handler.ts +0 -126
  279. package/src/handlers/init/geo.test.ts +0 -317
  280. package/src/handlers/init/geo.ts +0 -195
  281. package/src/handlers/init/index.test.ts +0 -205
  282. package/src/handlers/init/index.ts +0 -114
  283. package/src/handlers/init/translations.test.ts +0 -121
  284. package/src/handlers/init/translations.ts +0 -72
  285. package/src/handlers/status/status.handler.test.ts +0 -155
  286. package/src/handlers/status/status.handler.ts +0 -51
  287. package/src/handlers/subject/get.handler.ts +0 -93
  288. package/src/handlers/subject/list.handler.ts +0 -93
  289. package/src/handlers/subject/patch.handler.ts +0 -122
  290. package/src/handlers/subject/post.handler.test.ts +0 -294
  291. package/src/handlers/subject/post.handler.ts +0 -254
  292. package/src/handlers/utils/consent-enrichment.test.ts +0 -380
  293. package/src/handlers/utils/consent-enrichment.ts +0 -218
  294. package/src/init.test.ts +0 -126
  295. package/src/init.ts +0 -87
  296. package/src/middleware/auth/index.ts +0 -11
  297. package/src/middleware/auth/validate-api-key.test.ts +0 -86
  298. package/src/middleware/auth/validate-api-key.ts +0 -107
  299. package/src/middleware/cors/cors.test.ts +0 -135
  300. package/src/middleware/cors/cors.ts +0 -186
  301. package/src/middleware/cors/is-origin-trusted.test.ts +0 -164
  302. package/src/middleware/cors/is-origin-trusted.ts +0 -130
  303. package/src/middleware/cors/process-cors.ts +0 -91
  304. package/src/middleware/openapi/config.ts +0 -29
  305. package/src/middleware/openapi/handlers.ts +0 -34
  306. package/src/middleware/process-ip/index.test.ts +0 -195
  307. package/src/middleware/process-ip/index.ts +0 -199
  308. package/src/router.ts +0 -15
  309. package/src/routes/consent.ts +0 -52
  310. package/src/routes/index.ts +0 -10
  311. package/src/routes/init.ts +0 -102
  312. package/src/routes/status.ts +0 -46
  313. package/src/routes/subject.ts +0 -152
  314. package/src/types/api.ts +0 -48
  315. package/src/types/index.ts +0 -288
  316. package/src/utils/create-telemetry-options.test.ts +0 -302
  317. package/src/utils/create-telemetry-options.ts +0 -229
  318. package/src/utils/env.ts +0 -84
  319. package/src/utils/extract-error-message.ts +0 -21
  320. package/src/utils/instrumentation.test.ts +0 -185
  321. package/src/utils/instrumentation.ts +0 -196
  322. package/src/utils/logger.ts +0 -41
  323. package/src/utils/metrics.test.ts +0 -323
  324. package/src/utils/metrics.ts +0 -402
  325. package/src/utils/telemetry-pii.test.ts +0 -325
  326. package/src/version.ts +0 -2
  327. package/tsconfig.json +0 -11
  328. package/vitest.config.ts +0 -28
  329. /package/dist/{types.js → types/index.js} +0 -0
  330. /package/{src/db/adapters/drizzle.ts → dist-types/db/adapters/drizzle.d.ts} +0 -0
  331. /package/{src/db/adapters/index.ts → dist-types/db/adapters/index.d.ts} +0 -0
  332. /package/{src/db/adapters/kysely.ts → dist-types/db/adapters/kysely.d.ts} +0 -0
  333. /package/{src/db/adapters/mongo.ts → dist-types/db/adapters/mongo.d.ts} +0 -0
  334. /package/{src/db/adapters/prisma.ts → dist-types/db/adapters/prisma.d.ts} +0 -0
  335. /package/{src/db/adapters/typeorm.ts → dist-types/db/adapters/typeorm.d.ts} +0 -0
  336. /package/{src/utils/index.ts → dist-types/utils/index.d.ts} +0 -0
@@ -28,4 +28,3 @@ import type { C15TContext } from '../../types';
28
28
  * @see {@link isOriginTrusted} for origin validation details
29
29
  */
30
30
  export declare const processCors: (request: Request, context: C15TContext, trustedOrigins?: string[]) => C15TContext;
31
- //# sourceMappingURL=process-cors.d.ts.map
@@ -39,4 +39,3 @@ export declare const createDefaultOpenAPIOptions: (options: C15TOptions) => {
39
39
  bearerAuth: never[];
40
40
  }[];
41
41
  };
42
- //# sourceMappingURL=config.d.ts.map
@@ -3,4 +3,3 @@ import type { C15TOptions } from '../../types';
3
3
  * Generate the default UI for API documentation
4
4
  */
5
5
  export declare const createDocsUI: (options: C15TOptions) => string;
6
- //# sourceMappingURL=handlers.d.ts.map
@@ -7,6 +7,5 @@
7
7
  *
8
8
  * Note: OpenAPI spec generation is now handled by hono-openapi middleware.
9
9
  */
10
-
11
10
  export { createDefaultOpenAPIOptions, createOpenAPIConfig } from './config';
12
11
  export { createDocsUI } from './handlers';
@@ -9,4 +9,3 @@ import type { C15TOptions } from '../../types';
9
9
  */
10
10
  export declare function maskIpAddress(ip: string | null): string | null;
11
11
  export declare function getIpAddress(req: Request | Headers, options: C15TOptions): string | null;
12
- //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,127 @@
1
+ import type { PolicyConfig, PolicyModel, PolicyScopeMode, PolicyUiMode, PolicyUiSurfaceConfig } from '../types';
2
+ /**
3
+ * High-level builder input for creating a backend policy config.
4
+ *
5
+ * @remarks
6
+ * This shape is intentionally flatter than {@link PolicyConfig} so backend
7
+ * configuration stays readable in `c15tInstance({ policyPacks })` setup files.
8
+ * Use the builder helpers to normalize this input into runtime-ready policy
9
+ * configs.
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}
13
+ */
14
+ export interface PolicyBuilderInput {
15
+ id: string;
16
+ /**
17
+ * @deprecated Metadata-only label. Not used at runtime, not sent to clients,
18
+ * and not fingerprinted. Will be removed in a future version.
19
+ */
20
+ name?: string;
21
+ countries?: string[];
22
+ regions?: Array<{
23
+ country: string;
24
+ region: string;
25
+ }>;
26
+ isDefault?: boolean;
27
+ model?: PolicyModel;
28
+ expiryDays?: number;
29
+ scopeMode?: PolicyScopeMode;
30
+ /**
31
+ * Consent categories scoped by the policy.
32
+ */
33
+ categories?: string[];
34
+ preselectedCategories?: string[];
35
+ /**
36
+ * Whether the policy should respect the Global Privacy Control signal.
37
+ */
38
+ gpc?: boolean;
39
+ uiMode?: PolicyUiMode;
40
+ banner?: PolicyUiSurfaceConfig;
41
+ dialog?: PolicyUiSurfaceConfig;
42
+ i18n?: {
43
+ language?: string;
44
+ messageProfile?: string;
45
+ };
46
+ proof?: {
47
+ storeIp?: boolean;
48
+ storeUserAgent?: boolean;
49
+ storeLanguage?: boolean;
50
+ };
51
+ }
52
+ /**
53
+ * Converts a single {@link PolicyBuilderInput} into a normalized
54
+ * backend-compatible {@link PolicyConfig}.
55
+ *
56
+ * @remarks
57
+ * Empty optional fields are removed from the final output, matcher input is
58
+ * merged into `match`, and duplicate string arrays are deduplicated.
59
+ *
60
+ * @see {@link https://v2.c15t.com/docs/self-host/guides/policy-packs}
61
+ */
62
+ export declare function buildPolicyConfig(input: PolicyBuilderInput): PolicyConfig;
63
+ /**
64
+ * Converts an ordered list of builder inputs into a policy pack.
65
+ *
66
+ * @remarks
67
+ * The resulting array preserves input order. That order matters because
68
+ * duplicate region/country matchers use first-match-wins semantics within the
69
+ * same matcher type.
70
+ *
71
+ * @see {@link https://v2.c15t.com/docs/self-host/guides/policy-packs}
72
+ */
73
+ export declare function buildPolicyPack(inputs: PolicyBuilderInput[]): PolicyConfig[];
74
+ /**
75
+ * Creates a policy pack and guarantees that it ends with a default policy.
76
+ *
77
+ * @remarks
78
+ * If the provided inputs already contain a default matcher, the pack is
79
+ * returned unchanged. Otherwise c15t appends either:
80
+ *
81
+ * - the supplied `defaultPolicy`, coerced to `match.isDefault = true`
82
+ * - or the built-in "World No Banner" fallback
83
+ *
84
+ * When `defaultPolicy` is provided, its `countries` and `regions` fields are
85
+ * stripped and replaced with `match.isDefault = true`.
86
+ *
87
+ * @see {@link https://v2.c15t.com/docs/self-host/guides/policy-packs}
88
+ */
89
+ export declare function buildPolicyPackWithDefault(inputs: PolicyBuilderInput[], defaultPolicy?: PolicyBuilderInput): PolicyConfig[];
90
+ /**
91
+ * Merges multiple policy packs or individual policies into a single pack.
92
+ *
93
+ * @remarks
94
+ * Useful for combining preset packs with custom policies without manual
95
+ * spread and deduplication. Policies are deduplicated by `id` — the first
96
+ * occurrence wins.
97
+ *
98
+ * @example
99
+ * ```ts
100
+ * import { composePacks, policyPackPresets, policyBuilder } from '@c15t/backend';
101
+ *
102
+ * const pack = composePacks(
103
+ * [policyPackPresets.europeOptIn()],
104
+ * [policyPackPresets.californiaOptOut()],
105
+ * [policyBuilder.create({ id: 'custom', countries: ['JP'], model: 'opt-in' })],
106
+ * [policyPackPresets.worldNoBanner()],
107
+ * );
108
+ * ```
109
+ *
110
+ * @see {@link https://v2.c15t.com/docs/self-host/guides/policy-packs}
111
+ */
112
+ export declare function composePacks(...packs: PolicyConfig[][]): PolicyConfig[];
113
+ /**
114
+ * Convenience namespace for the policy builder helpers.
115
+ *
116
+ * @remarks
117
+ * Useful when you prefer a grouped API such as `policyBuilder.createPack()`
118
+ * inside backend config files.
119
+ *
120
+ * @see {@link https://v2.c15t.com/docs/self-host/guides/policy-packs}
121
+ */
122
+ export declare const policyBuilder: {
123
+ create: typeof buildPolicyConfig;
124
+ createPack: typeof buildPolicyPack;
125
+ createPackWithDefault: typeof buildPolicyPackWithDefault;
126
+ composePacks: typeof composePacks;
127
+ };
@@ -0,0 +1,2 @@
1
+ export { policyPackPresets } from '@c15t/schema';
2
+ export type { EuropePolicyMode, PolicyPackPresets } from '@c15t/schema/types';
@@ -0,0 +1,3 @@
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
+ export type { PolicyMatch };
@@ -7,4 +7,3 @@
7
7
  * @packageDocumentation
8
8
  */
9
9
  export { createConsentRoutes, createInitRoute, createStatusRoute, createSubjectRoutes, } from './routes';
10
- //# sourceMappingURL=router.d.ts.map
@@ -13,4 +13,3 @@ export declare const createConsentRoutes: () => Hono<{
13
13
  c15tContext: C15TContext;
14
14
  };
15
15
  }, import("hono/types").BlankSchema, "/">;
16
- //# sourceMappingURL=consent.d.ts.map
@@ -5,6 +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';
10
- //# sourceMappingURL=index.d.ts.map
@@ -13,4 +13,3 @@ export declare const createInitRoute: (options: C15TOptions) => Hono<{
13
13
  c15tContext: C15TContext;
14
14
  };
15
15
  }, import("hono/types").BlankSchema, "/">;
16
- //# sourceMappingURL=init.d.ts.map
@@ -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, "/">;
@@ -13,4 +13,3 @@ export declare const createStatusRoute: () => Hono<{
13
13
  c15tContext: C15TContext;
14
14
  };
15
15
  }, import("hono/types").BlankSchema, "/">;
16
- //# sourceMappingURL=status.d.ts.map
@@ -13,4 +13,3 @@ export declare const createSubjectRoutes: () => Hono<{
13
13
  c15tContext: C15TContext;
14
14
  };
15
15
  }, import("hono/types").BlankSchema, "/">;
16
- //# sourceMappingURL=subject.d.ts.map
@@ -28,4 +28,3 @@ export type ApiPathBase = `/api/c15t`;
28
28
  * ```
29
29
  */
30
30
  export type ApiPath = `${ApiPathBase}` | `${ApiPathBase}/consent` | `${ApiPathBase}/consent/:id` | `${ApiPathBase}/jurisdictions` | `${ApiPathBase}/jurisdictions/:code`;
31
- //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1,464 @@
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
+ import type { Meter, Tracer } from '@opentelemetry/api';
5
+ import type { FumaDB, InferFumaDB } from 'fumadb';
6
+ import type { CacheAdapter } from '../cache/types';
7
+ import type { createRegistry } from '../db/registry';
8
+ import type { DB, LatestDB } from '../db/schema';
9
+ export * from './api';
10
+ export declare const branding: readonly ["c15t", "inth", "consent", "none"];
11
+ export type { Branding };
12
+ export interface DatabaseOptions {
13
+ /**
14
+ * The database adapter to use.
15
+ *
16
+ * @see {@link https://v2.c15t.com/docs/self-host/guides/database-setup}
17
+ */
18
+ adapter: FumaDB<FumaDBSchema>['adapter'];
19
+ /**
20
+ * Tenant ID for multi-tenant deployments.
21
+ * When set, all database queries are automatically scoped to this tenant.
22
+ */
23
+ tenantId?: string;
24
+ /**
25
+ * Optional prefix for all database table names.
26
+ * Useful when sharing a database with other applications to avoid naming conflicts.
27
+ *
28
+ * @example 'c15t_' // tables become: c15t_subject, c15t_consent, etc.
29
+ * @see {@link https://v2.c15t.com/docs/self-host/guides/database-setup}
30
+ */
31
+ tablePrefix?: string;
32
+ }
33
+ /**
34
+ * OpenAPI spec generation and documentation UI options.
35
+ */
36
+ export interface OpenAPIOptions {
37
+ /**
38
+ * Enable/disable OpenAPI spec generation
39
+ * @default true
40
+ */
41
+ enabled?: boolean;
42
+ /**
43
+ * Path to serve the OpenAPI JSON spec
44
+ * @default "/spec.json"
45
+ */
46
+ specPath?: string;
47
+ /**
48
+ * Path to serve the API documentation UI
49
+ * @default "/docs"
50
+ */
51
+ docsPath?: string;
52
+ /**
53
+ * OpenAPI specification options
54
+ */
55
+ options?: {
56
+ info?: {
57
+ title?: string;
58
+ version?: string;
59
+ description?: string;
60
+ };
61
+ servers?: Array<{
62
+ url: string;
63
+ description?: string;
64
+ }>;
65
+ security?: Array<Record<string, string[]>>;
66
+ };
67
+ /**
68
+ * Custom template for rendering the API documentation UI
69
+ * If provided, this will be used instead of the default Scalar UI
70
+ */
71
+ customUiTemplate?: string;
72
+ }
73
+ /**
74
+ * OpenTelemetry configuration for tracing and metrics.
75
+ * Telemetry is opt-in and disabled by default.
76
+ * Users must provide their own SDK setup (Node, Bun, edge, etc.).
77
+ */
78
+ export interface TelemetryOptions {
79
+ /**
80
+ * Enable telemetry (tracing and metrics).
81
+ * Must be explicitly set to true to activate.
82
+ * @default false
83
+ */
84
+ enabled?: boolean;
85
+ /**
86
+ * User-provided tracer instance.
87
+ * Users should set up their own OpenTelemetry SDK and pass the tracer here.
88
+ * @example trace.getTracer('my-app')
89
+ */
90
+ tracer?: Tracer;
91
+ /**
92
+ * User-provided meter instance for metrics.
93
+ * Users should set up their own OpenTelemetry SDK and pass the meter here.
94
+ * @example metrics.getMeter('my-app')
95
+ */
96
+ meter?: Meter;
97
+ /**
98
+ * Default attributes to include on all spans and metrics.
99
+ */
100
+ defaultAttributes?: Record<string, string | number | boolean>;
101
+ }
102
+ /**
103
+ * IP address tracking and masking options.
104
+ */
105
+ export interface IPAddressOptions {
106
+ /**
107
+ * Enable/disable IP address tracking.
108
+ * When disabled, all IP addresses will be stored as null.
109
+ * @default true
110
+ */
111
+ tracking?: boolean;
112
+ /**
113
+ * Enable/disable IP address masking to reduce PII collection.
114
+ * - IPv4: Last octet is replaced with 0 (e.g., 192.168.1.100 -> 192.168.1.0)
115
+ * - IPv6: Last 80 bits are masked (e.g., 2001:db8:85a3::1 -> 2001:db8:85a3::)
116
+ * @default true
117
+ */
118
+ masking?: boolean;
119
+ /**
120
+ * Override the default IP address headers used to extract client IP.
121
+ * Headers are checked in order, first match wins.
122
+ */
123
+ ipAddressHeaders?: string[];
124
+ }
125
+ /**
126
+ * Cache configuration for external persistent storage.
127
+ * Used for caching GVL and other data.
128
+ */
129
+ export interface CacheOptions {
130
+ /**
131
+ * External cache adapter (Redis, KV, etc.).
132
+ * If not provided, only in-memory cache is used.
133
+ */
134
+ adapter?: CacheAdapter;
135
+ }
136
+ /**
137
+ * IAB TCF configuration including GVL, CMP registration, and custom vendors.
138
+ * Disabled by default - most users don't need IAB TCF.
139
+ * Set enabled: true to activate IAB support.
140
+ */
141
+ export interface IABOptions {
142
+ /**
143
+ * Enable IAB TCF support.
144
+ * When false or not provided, /init does not include IAB payload fields.
145
+ * When true, /init includes IAB payload only when IAB is active for the
146
+ * resolved request policy (or when no policies are configured).
147
+ */
148
+ enabled: true;
149
+ /**
150
+ * CMP ID registered with IAB Europe.
151
+ * This is returned to clients via the /init endpoint so they
152
+ * can use the correct CMP identity in TC Strings.
153
+ *
154
+ * @see https://iabeurope.eu/cmp-list/ - List of registered CMPs
155
+ */
156
+ cmpId?: number;
157
+ /**
158
+ * Bundled GVL translations by language code.
159
+ * These are checked first before any cache or fetch.
160
+ *
161
+ * @example
162
+ * ```ts
163
+ * import enGVL from './gvl/en.json';
164
+ * import deGVL from './gvl/de.json';
165
+ *
166
+ * iab: {
167
+ * enabled: true,
168
+ * bundled: { en: enGVL, de: deGVL }
169
+ * }
170
+ * ```
171
+ */
172
+ bundled?: Record<string, GlobalVendorList>;
173
+ /**
174
+ * Vendor IDs to filter when fetching non-bundled languages.
175
+ * Reduces payload size.
176
+ */
177
+ vendorIds?: number[];
178
+ /**
179
+ * Override the default GVL endpoint.
180
+ * @default 'https://gvl.consent.io'
181
+ */
182
+ endpoint?: string;
183
+ /**
184
+ * Custom vendors not registered with IAB.
185
+ * These are synced to the frontend via the /init endpoint.
186
+ *
187
+ * @example
188
+ * ```ts
189
+ * customVendors: [
190
+ * {
191
+ * id: 'internal-analytics',
192
+ * name: 'Our Analytics',
193
+ * privacyPolicyUrl: 'https://example.com/privacy',
194
+ * purposes: [1, 8],
195
+ * }
196
+ * ]
197
+ * ```
198
+ */
199
+ customVendors?: NonIABVendor[];
200
+ }
201
+ type FumaDBSchema = InferFumaDB<typeof DB>['schemas'];
202
+ export interface I18nMessageProfile {
203
+ /**
204
+ * Fallback language used when the requested language is not configured in
205
+ * this profile.
206
+ *
207
+ * @remarks
208
+ * This does not expand the profile's allowed languages. If the configured
209
+ * fallback is not present in the profile, c15t falls back to English when
210
+ * available, otherwise to the first configured language in the profile.
211
+ *
212
+ * @default "en"
213
+ */
214
+ fallbackLanguage?: string;
215
+ /**
216
+ * Translation overrides keyed by language code.
217
+ */
218
+ translations: Record<string, Partial<Translations>>;
219
+ }
220
+ export type I18nMessageProfiles = Record<string, I18nMessageProfile>;
221
+ export interface I18nOptions {
222
+ /**
223
+ * Named translation catalogs grouped by profile.
224
+ *
225
+ * @example
226
+ * ```ts
227
+ * i18n: {
228
+ * messages: {
229
+ * default: {
230
+ * translations: { en: { cookieBanner: { title: '...' } } },
231
+ * },
232
+ * us_ca: {
233
+ * fallbackLanguage: 'en',
234
+ * translations: { en: { cookieBanner: { title: '...' } } },
235
+ * },
236
+ * }
237
+ * }
238
+ * ```
239
+ */
240
+ messages?: I18nMessageProfiles;
241
+ /**
242
+ * Fallback profile used when a policy does not provide `messageProfile`.
243
+ * @default "default"
244
+ */
245
+ defaultProfile?: string;
246
+ }
247
+ export type { LegalDocumentPolicyType, PolicyConfig, PolicyModel, PolicyPack, PolicyScopeMode, PolicyUiAction, PolicyUiActionDirection, PolicyUiActionGroup, PolicyUiMode, PolicyUiProfile, PolicyUiSurfaceConfig, } from '@c15t/schema/types';
248
+ export interface PolicySnapshotOptions {
249
+ /**
250
+ * Secret used for signing and verifying policy snapshot tokens.
251
+ */
252
+ signingKey: string;
253
+ /**
254
+ * How writes should behave when snapshot validation fails.
255
+ * @default "reject"
256
+ */
257
+ onValidationFailure?: 'reject' | 'resolve_current';
258
+ /**
259
+ * JWT issuer claim for snapshot tokens.
260
+ * @default "c15t"
261
+ */
262
+ issuer?: string;
263
+ /**
264
+ * JWT audience claim for snapshot tokens.
265
+ * When omitted, c15t derives a default snapshot audience and scopes it per tenant.
266
+ */
267
+ audience?: string;
268
+ /**
269
+ * Snapshot token lifetime in seconds.
270
+ * @default 1800 (30 minutes)
271
+ */
272
+ ttlSeconds?: number;
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
+ }
290
+ export interface BackgroundOptions {
291
+ /**
292
+ * Executes non-critical tasks after the response path has completed.
293
+ */
294
+ run: (task: () => Promise<void>) => void;
295
+ }
296
+ export interface C15TOptions {
297
+ /**
298
+ * The database adapter to use.
299
+ *
300
+ * @see {@link https://v2.c15t.com/docs/self-host/guides/database-setup}
301
+ */
302
+ adapter: FumaDB<FumaDBSchema>['adapter'];
303
+ /**
304
+ * Tenant ID for multi-tenant deployments.
305
+ * When set, all database queries are automatically scoped to this tenant.
306
+ */
307
+ tenantId?: string;
308
+ /**
309
+ * Optional prefix for all database table names.
310
+ * Useful when sharing a database with other applications to avoid naming conflicts.
311
+ *
312
+ * @example 'c15t_' // tables become: c15t_subject, c15t_consent, etc.
313
+ * @see {@link https://v2.c15t.com/docs/self-host/guides/database-setup}
314
+ */
315
+ tablePrefix?: string;
316
+ /**
317
+ * Application name used as backend metadata and identity.
318
+ * Returned by `/init` (`appName`), used in logs, telemetry defaults (`service.name`),
319
+ * and cache key prefixing.
320
+ *
321
+ * @default "c15t"
322
+ * @see {@link https://v2.c15t.com/docs/self-host/api/configuration}
323
+ */
324
+ appName?: string;
325
+ /**
326
+ * Base path prefix for all API routes (e.g. `/api/self-host`).
327
+ *
328
+ * @see {@link https://v2.c15t.com/docs/self-host/api/endpoints}
329
+ */
330
+ basePath?: string;
331
+ /**
332
+ * Allowed origins for CORS. Required for browser-based consent collection.
333
+ * Protocol is optional; matching is protocol-agnostic and normalized.
334
+ *
335
+ * @example ['example.com', 'app.example.com', 'localhost:3000']
336
+ * @see {@link https://v2.c15t.com/docs/self-host/api/configuration}
337
+ */
338
+ trustedOrigins: string[];
339
+ /** Logger configuration. */
340
+ logger?: LoggerOptions;
341
+ /**
342
+ * Disables the use of Geo Location to determine the jurisdiction.
343
+ *
344
+ * When enabled, the jurisdiction will be set to "GDPR" to show the strictest
345
+ * version of the banner as we don't know the jurisdiction in this case.
346
+ *
347
+ * @default false
348
+ */
349
+ disableGeoLocation?: boolean;
350
+ /**
351
+ * Override base translations.
352
+ *
353
+ * @deprecated Use `i18n.messages` instead. This alias is kept for compatibility.
354
+ *
355
+ * @example
356
+ * ```ts
357
+ * {
358
+ * en: enTranslations,
359
+ * de: deTranslations,
360
+ * }
361
+ * ```
362
+ */
363
+ customTranslations?: Record<string, Partial<Translations>>;
364
+ /**
365
+ * Internationalization message profiles used by runtime policies.
366
+ */
367
+ i18n?: I18nOptions;
368
+ /**
369
+ * Runtime regional policy pack resolved per request.
370
+ *
371
+ * @remarks
372
+ * Omit this field to keep legacy non-policy behavior. Pass `[]` to force
373
+ * explicit no-banner mode. In production, prefer including a default policy
374
+ * so unmatched traffic still resolves deterministically.
375
+ *
376
+ * @see {@link https://v2.c15t.com/docs/self-host/guides/policy-packs}
377
+ */
378
+ policyPacks?: PolicyConfig[];
379
+ /**
380
+ * Select which branding to show in the consent banner.
381
+ * Use "inth" for the INTH brand. "consent" is a deprecated alias for "inth".
382
+ * Use "none" to hide branding.
383
+ * @default "c15t"
384
+ */
385
+ branding?: Branding;
386
+ /**
387
+ * OpenAPI spec generation and documentation UI options.
388
+ *
389
+ * @see {@link https://v2.c15t.com/docs/self-host/api/endpoints}
390
+ */
391
+ openapi?: OpenAPIOptions;
392
+ /**
393
+ * OpenTelemetry configuration for tracing and metrics.
394
+ * Telemetry is opt-in and disabled by default.
395
+ * Users must provide their own SDK setup (Node, Bun, edge, etc.).
396
+ *
397
+ * @see {@link https://v2.c15t.com/docs/self-host/guides/observability}
398
+ */
399
+ telemetry?: TelemetryOptions;
400
+ /**
401
+ * IP address tracking and masking options.
402
+ *
403
+ * @see {@link https://v2.c15t.com/docs/self-host/api/configuration}
404
+ */
405
+ ipAddress?: IPAddressOptions;
406
+ /**
407
+ * Cache configuration for external persistent storage.
408
+ * Used for caching GVL and other data.
409
+ *
410
+ * @see {@link https://v2.c15t.com/docs/self-host/guides/caching}
411
+ */
412
+ cache?: CacheOptions;
413
+ /**
414
+ * API keys for authenticated endpoints.
415
+ * Used for server-side endpoints like GET /subjects.
416
+ *
417
+ * @example
418
+ * ```ts
419
+ * apiKeys: ['sk_live_abc123', 'sk_live_def456']
420
+ * ```
421
+ */
422
+ apiKeys?: string[];
423
+ /**
424
+ * IAB TCF configuration including GVL, CMP registration, and custom vendors.
425
+ * Disabled by default - most users don't need IAB TCF.
426
+ * Set enabled: true to activate IAB support.
427
+ *
428
+ * @see {@link https://v2.c15t.com/docs/self-host/guides/iab-tcf}
429
+ */
430
+ iab?: IABOptions;
431
+ /**
432
+ * Optional signed policy snapshots used to keep /init and /subjects consistent.
433
+ */
434
+ policySnapshot?: PolicySnapshotOptions;
435
+ /**
436
+ * Optional signed legal-document snapshots issued by external document renderers.
437
+ */
438
+ legalDocumentSnapshot?: LegalDocumentSnapshotOptions;
439
+ /**
440
+ * Optional background task runner for non-critical side effects.
441
+ */
442
+ background?: BackgroundOptions;
443
+ }
444
+ export interface C15TContext extends Omit<C15TOptions, 'ipAddress' | 'adapter' | 'logger' | 'tablePrefix'> {
445
+ appName: string;
446
+ logger: ReturnType<typeof createLogger>;
447
+ registry: ReturnType<typeof createRegistry>;
448
+ db: ReturnType<InferFumaDB<typeof LatestDB>['orm']>;
449
+ ipAddress?: string | null;
450
+ userAgent?: string;
451
+ origin?: string;
452
+ trustedOrigin?: boolean;
453
+ path?: string;
454
+ method?: string;
455
+ headers?: Headers;
456
+ /**
457
+ * Whether the request was authenticated with a valid API key.
458
+ * Set to true when a valid Bearer token is provided in the Authorization header.
459
+ */
460
+ apiKeyAuthenticated?: boolean;
461
+ }
462
+ export type DeepPartial<T> = T extends (...args: unknown[]) => unknown ? T : T extends object ? {
463
+ [K in keyof T]?: DeepPartial<T[K]>;
464
+ } : T;