@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.
- package/README.md +3 -3
- package/dist/302.js +473 -0
- package/dist/583.js +540 -0
- package/dist/915.js +1771 -0
- package/dist/cache.cjs +5 -5
- package/dist/cache.js +4 -415
- package/dist/core.cjs +1356 -120
- package/dist/core.js +163 -1981
- package/dist/db/adapters/drizzle.cjs +1 -1
- package/dist/db/adapters/drizzle.js +1 -2
- package/dist/db/adapters/kysely.cjs +1 -1
- package/dist/db/adapters/kysely.js +1 -2
- package/dist/db/adapters/mongo.cjs +1 -1
- package/dist/db/adapters/mongo.js +1 -2
- package/dist/db/adapters/prisma.cjs +1 -1
- package/dist/db/adapters/prisma.js +1 -2
- package/dist/db/adapters/typeorm.cjs +1 -1
- package/dist/db/adapters/typeorm.js +1 -2
- package/dist/db/adapters.cjs +1 -1
- package/dist/db/migrator.cjs +1 -1
- package/dist/db/schema.cjs +43 -3
- package/dist/db/schema.js +35 -4
- package/dist/define-config.cjs +1 -1
- package/dist/edge.cjs +1106 -0
- package/dist/edge.js +190 -0
- package/dist/router.cjs +885 -123
- package/dist/router.js +1 -1507
- package/dist/{types.cjs → types/index.cjs} +1 -1
- package/{dist → dist-types}/cache/adapters/cloudflare-kv.d.ts +0 -1
- package/{dist → dist-types}/cache/adapters/index.d.ts +0 -1
- package/{dist → dist-types}/cache/adapters/memory.d.ts +0 -1
- package/{dist → dist-types}/cache/adapters/upstash-redis.d.ts +0 -1
- package/{dist → dist-types}/cache/gvl-resolver.d.ts +0 -1
- package/{dist → dist-types}/cache/index.d.ts +0 -1
- package/{dist → dist-types}/cache/keys.d.ts +0 -1
- package/{dist → dist-types}/cache/types.d.ts +0 -1
- package/{dist → dist-types}/core.d.ts +8 -1
- package/{dist → dist-types}/db/migrator/index.d.ts +0 -1
- package/dist-types/db/registry/consent-policy.d.ts +78 -0
- package/{dist → dist-types}/db/registry/consent-purpose.d.ts +0 -1
- package/{dist → dist-types}/db/registry/domain.d.ts +0 -1
- package/dist-types/db/registry/index.d.ts +118 -0
- package/dist-types/db/registry/runtime-policy-decision.d.ts +60 -0
- package/{dist → dist-types}/db/registry/subject.d.ts +0 -2
- package/{dist → dist-types}/db/registry/types.d.ts +1 -1
- package/{dist → dist-types}/db/registry/utils/generate-id.d.ts +0 -1
- package/{dist → dist-types}/db/registry/utils.d.ts +0 -1
- package/{dist → dist-types}/db/schema/1.0.0/audit-log.d.ts +0 -1
- package/{dist → dist-types}/db/schema/1.0.0/consent-policy.d.ts +0 -1
- package/{dist → dist-types}/db/schema/1.0.0/consent-purpose.d.ts +0 -1
- package/{dist → dist-types}/db/schema/1.0.0/consent-record.d.ts +0 -1
- package/{dist → dist-types}/db/schema/1.0.0/consent.d.ts +1 -2
- package/{dist → dist-types}/db/schema/1.0.0/domain.d.ts +0 -1
- package/{dist → dist-types}/db/schema/1.0.0/index.d.ts +0 -32
- package/{dist → dist-types}/db/schema/1.0.0/subject.d.ts +0 -2
- package/{dist → dist-types}/db/schema/2.0.0/audit-log.d.ts +1 -2
- package/{dist → dist-types}/db/schema/2.0.0/consent-policy.d.ts +3 -3
- package/{dist → dist-types}/db/schema/2.0.0/consent-purpose.d.ts +1 -2
- package/{dist → dist-types}/db/schema/2.0.0/consent.d.ts +7 -2
- package/{dist → dist-types}/db/schema/2.0.0/domain.d.ts +1 -2
- package/{dist → dist-types}/db/schema/2.0.0/index.d.ts +455 -28
- package/dist-types/db/schema/2.0.0/runtime-policy-decision.d.ts +23 -0
- package/{dist → dist-types}/db/schema/2.0.0/subject.d.ts +1 -3
- package/{dist → dist-types}/db/schema/index.d.ts +908 -86
- package/{dist → dist-types}/db/tenant-scope.d.ts +0 -1
- package/dist-types/define-config.d.ts +17 -0
- package/dist-types/edge/index.d.ts +5 -0
- package/dist-types/edge/init-handler.d.ts +40 -0
- package/dist-types/edge/resolve-consent.d.ts +80 -0
- package/dist-types/edge/types.d.ts +13 -0
- package/{dist → dist-types}/handlers/consent/check.handler.d.ts +0 -1
- package/{src/handlers/consent/index.ts → dist-types/handlers/consent/index.d.ts} +0 -1
- package/{dist → dist-types}/handlers/init/geo.d.ts +2 -3
- package/{dist → dist-types}/handlers/init/index.d.ts +2 -3
- package/dist-types/handlers/init/policy.d.ts +26 -0
- package/dist-types/handlers/init/resolve-init.d.ts +44 -0
- package/dist-types/handlers/init/translations.d.ts +48 -0
- package/dist-types/handlers/legal-document/current.handler.d.ts +11 -0
- package/dist-types/handlers/legal-document/snapshot.d.ts +39 -0
- package/dist-types/handlers/policy/snapshot.d.ts +99 -0
- package/{src/handlers/status/index.ts → dist-types/handlers/status/index.d.ts} +0 -1
- package/{dist → dist-types}/handlers/status/status.handler.d.ts +0 -1
- package/{dist → dist-types}/handlers/subject/get.handler.d.ts +3 -2
- package/{src/handlers/subject/index.ts → dist-types/handlers/subject/index.d.ts} +0 -1
- package/{dist → dist-types}/handlers/subject/list.handler.d.ts +3 -2
- package/{dist → dist-types}/handlers/subject/patch.handler.d.ts +0 -2
- package/{dist → dist-types}/handlers/subject/post.handler.d.ts +12 -1
- package/{dist → dist-types}/handlers/utils/consent-enrichment.d.ts +3 -1
- package/{dist → dist-types}/init.d.ts +4 -7
- package/{dist → dist-types}/middleware/auth/index.d.ts +0 -1
- package/{dist → dist-types}/middleware/auth/validate-api-key.d.ts +0 -1
- package/{dist → dist-types}/middleware/cors/cors.d.ts +0 -1
- package/{src/middleware/cors/index.ts → dist-types/middleware/cors/index.d.ts} +0 -1
- package/{dist → dist-types}/middleware/cors/is-origin-trusted.d.ts +0 -1
- package/{dist → dist-types}/middleware/cors/process-cors.d.ts +0 -1
- package/{dist → dist-types}/middleware/openapi/config.d.ts +0 -1
- package/{dist → dist-types}/middleware/openapi/handlers.d.ts +0 -1
- package/{src/middleware/openapi/index.ts → dist-types/middleware/openapi/index.d.ts} +0 -1
- package/{dist → dist-types}/middleware/process-ip/index.d.ts +0 -1
- package/dist-types/policies/builder.d.ts +127 -0
- package/dist-types/policies/defaults.d.ts +2 -0
- package/dist-types/policies/matchers.d.ts +3 -0
- package/{dist → dist-types}/router.d.ts +0 -1
- package/{dist → dist-types}/routes/consent.d.ts +0 -1
- package/{dist → dist-types}/routes/index.d.ts +1 -1
- package/{dist → dist-types}/routes/init.d.ts +0 -1
- package/dist-types/routes/legal-document.d.ts +7 -0
- package/{dist → dist-types}/routes/status.d.ts +0 -1
- package/{dist → dist-types}/routes/subject.d.ts +0 -1
- package/{dist → dist-types}/types/api.d.ts +0 -1
- package/dist-types/types/index.d.ts +464 -0
- package/dist-types/utils/background.d.ts +6 -0
- package/{dist → dist-types}/utils/create-telemetry-options.d.ts +1 -2
- package/{dist → dist-types}/utils/env.d.ts +0 -1
- package/{dist → dist-types}/utils/extract-error-message.d.ts +0 -1
- package/{dist → dist-types}/utils/instrumentation.d.ts +2 -3
- package/{dist → dist-types}/utils/logger.d.ts +0 -1
- package/{dist → dist-types}/utils/metrics.d.ts +0 -1
- package/dist-types/version.d.ts +1 -0
- package/docs/README.md +49 -0
- package/docs/api/configuration.md +208 -0
- package/docs/api/endpoints.md +211 -0
- package/docs/guides/caching.md +85 -0
- package/docs/guides/database-setup.md +128 -0
- package/docs/guides/edge-deployment.md +251 -0
- package/docs/guides/framework-integration.md +142 -0
- package/docs/guides/iab-tcf.md +89 -0
- package/docs/guides/observability.md +96 -0
- package/docs/guides/policy-packs.md +396 -0
- package/docs/quickstart.md +129 -0
- package/package.json +53 -39
- package/.turbo/turbo-build.log +0 -49
- package/CHANGELOG.md +0 -89
- package/dist/cache/adapters/cloudflare-kv.d.ts.map +0 -1
- package/dist/cache/adapters/index.d.ts.map +0 -1
- package/dist/cache/adapters/memory.d.ts.map +0 -1
- package/dist/cache/adapters/upstash-redis.d.ts.map +0 -1
- package/dist/cache/gvl-resolver.d.ts.map +0 -1
- package/dist/cache/index.d.ts.map +0 -1
- package/dist/cache/keys.d.ts.map +0 -1
- package/dist/cache/types.d.ts.map +0 -1
- package/dist/core.d.ts.map +0 -1
- package/dist/db/adapters/drizzle.d.ts +0 -2
- package/dist/db/adapters/drizzle.d.ts.map +0 -1
- package/dist/db/adapters/index.d.ts +0 -2
- package/dist/db/adapters/index.d.ts.map +0 -1
- package/dist/db/adapters/kysely.d.ts +0 -2
- package/dist/db/adapters/kysely.d.ts.map +0 -1
- package/dist/db/adapters/mongo.d.ts +0 -2
- package/dist/db/adapters/mongo.d.ts.map +0 -1
- package/dist/db/adapters/prisma.d.ts +0 -2
- package/dist/db/adapters/prisma.d.ts.map +0 -1
- package/dist/db/adapters/typeorm.d.ts +0 -2
- package/dist/db/adapters/typeorm.d.ts.map +0 -1
- package/dist/db/migrator/index.d.ts.map +0 -1
- package/dist/db/registry/consent-policy.d.ts +0 -23
- package/dist/db/registry/consent-policy.d.ts.map +0 -1
- package/dist/db/registry/consent-purpose.d.ts.map +0 -1
- package/dist/db/registry/domain.d.ts.map +0 -1
- package/dist/db/registry/index.d.ts +0 -57
- package/dist/db/registry/index.d.ts.map +0 -1
- package/dist/db/registry/subject.d.ts.map +0 -1
- package/dist/db/registry/types.d.ts.map +0 -1
- package/dist/db/registry/utils/generate-id.d.ts.map +0 -1
- package/dist/db/registry/utils.d.ts.map +0 -1
- package/dist/db/schema/1.0.0/audit-log.d.ts.map +0 -1
- package/dist/db/schema/1.0.0/consent-policy.d.ts.map +0 -1
- package/dist/db/schema/1.0.0/consent-purpose.d.ts.map +0 -1
- package/dist/db/schema/1.0.0/consent-record.d.ts.map +0 -1
- package/dist/db/schema/1.0.0/consent.d.ts.map +0 -1
- package/dist/db/schema/1.0.0/domain.d.ts.map +0 -1
- package/dist/db/schema/1.0.0/index.d.ts.map +0 -1
- package/dist/db/schema/1.0.0/subject.d.ts.map +0 -1
- package/dist/db/schema/2.0.0/audit-log.d.ts.map +0 -1
- package/dist/db/schema/2.0.0/consent-policy.d.ts.map +0 -1
- package/dist/db/schema/2.0.0/consent-purpose.d.ts.map +0 -1
- package/dist/db/schema/2.0.0/consent.d.ts.map +0 -1
- package/dist/db/schema/2.0.0/domain.d.ts.map +0 -1
- package/dist/db/schema/2.0.0/index.d.ts.map +0 -1
- package/dist/db/schema/2.0.0/subject.d.ts.map +0 -1
- package/dist/db/schema/index.d.ts.map +0 -1
- package/dist/db/tenant-scope.d.ts.map +0 -1
- package/dist/define-config.d.ts +0 -5
- package/dist/define-config.d.ts.map +0 -1
- package/dist/handlers/consent/check.handler.d.ts.map +0 -1
- package/dist/handlers/consent/index.d.ts +0 -12
- package/dist/handlers/consent/index.d.ts.map +0 -1
- package/dist/handlers/init/geo.d.ts.map +0 -1
- package/dist/handlers/init/index.d.ts.map +0 -1
- package/dist/handlers/init/translations.d.ts +0 -28
- package/dist/handlers/init/translations.d.ts.map +0 -1
- package/dist/handlers/status/index.d.ts +0 -7
- package/dist/handlers/status/index.d.ts.map +0 -1
- package/dist/handlers/status/status.handler.d.ts.map +0 -1
- package/dist/handlers/subject/get.handler.d.ts.map +0 -1
- package/dist/handlers/subject/index.d.ts +0 -10
- package/dist/handlers/subject/index.d.ts.map +0 -1
- package/dist/handlers/subject/list.handler.d.ts.map +0 -1
- package/dist/handlers/subject/patch.handler.d.ts.map +0 -1
- package/dist/handlers/subject/post.handler.d.ts.map +0 -1
- package/dist/handlers/utils/consent-enrichment.d.ts.map +0 -1
- package/dist/init.d.ts.map +0 -1
- package/dist/middleware/auth/index.d.ts.map +0 -1
- package/dist/middleware/auth/validate-api-key.d.ts.map +0 -1
- package/dist/middleware/cors/cors.d.ts.map +0 -1
- package/dist/middleware/cors/index.d.ts +0 -30
- package/dist/middleware/cors/index.d.ts.map +0 -1
- package/dist/middleware/cors/is-origin-trusted.d.ts.map +0 -1
- package/dist/middleware/cors/process-cors.d.ts.map +0 -1
- package/dist/middleware/openapi/config.d.ts.map +0 -1
- package/dist/middleware/openapi/handlers.d.ts.map +0 -1
- package/dist/middleware/openapi/index.d.ts +0 -12
- package/dist/middleware/openapi/index.d.ts.map +0 -1
- package/dist/middleware/process-ip/index.d.ts.map +0 -1
- package/dist/router.d.ts.map +0 -1
- package/dist/routes/consent.d.ts.map +0 -1
- package/dist/routes/index.d.ts.map +0 -1
- package/dist/routes/init.d.ts.map +0 -1
- package/dist/routes/status.d.ts.map +0 -1
- package/dist/routes/subject.d.ts.map +0 -1
- package/dist/types/api.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -255
- package/dist/types/index.d.ts.map +0 -1
- package/dist/utils/create-telemetry-options.d.ts.map +0 -1
- package/dist/utils/env.d.ts.map +0 -1
- package/dist/utils/extract-error-message.d.ts.map +0 -1
- package/dist/utils/index.d.ts +0 -4
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/instrumentation.d.ts.map +0 -1
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/metrics.d.ts.map +0 -1
- package/dist/version.d.ts +0 -2
- package/dist/version.d.ts.map +0 -1
- package/knip.json +0 -31
- package/rslib.config.ts +0 -93
- package/src/cache/adapters/cloudflare-kv.ts +0 -71
- package/src/cache/adapters/index.ts +0 -22
- package/src/cache/adapters/memory.ts +0 -111
- package/src/cache/adapters/upstash-redis.ts +0 -113
- package/src/cache/gvl-resolver.ts +0 -289
- package/src/cache/index.ts +0 -34
- package/src/cache/keys.ts +0 -68
- package/src/cache/types.ts +0 -66
- package/src/core.ts +0 -368
- package/src/db/migrator/index.ts +0 -80
- package/src/db/registry/consent-policy.test.ts +0 -451
- package/src/db/registry/consent-policy.ts +0 -82
- package/src/db/registry/consent-purpose.test.ts +0 -428
- package/src/db/registry/consent-purpose.ts +0 -61
- package/src/db/registry/domain.test.ts +0 -445
- package/src/db/registry/domain.ts +0 -91
- package/src/db/registry/index.ts +0 -14
- package/src/db/registry/subject.test.ts +0 -388
- package/src/db/registry/subject.ts +0 -129
- package/src/db/registry/types.ts +0 -10
- package/src/db/registry/utils/generate-id.test.ts +0 -216
- package/src/db/registry/utils/generate-id.ts +0 -133
- package/src/db/registry/utils.ts +0 -133
- package/src/db/schema/1.0.0/audit-log.ts +0 -15
- package/src/db/schema/1.0.0/consent-policy.ts +0 -14
- package/src/db/schema/1.0.0/consent-purpose.ts +0 -14
- package/src/db/schema/1.0.0/consent-record.ts +0 -10
- package/src/db/schema/1.0.0/consent.ts +0 -20
- package/src/db/schema/1.0.0/domain.ts +0 -12
- package/src/db/schema/1.0.0/index.ts +0 -48
- package/src/db/schema/1.0.0/subject.ts +0 -12
- package/src/db/schema/2.0.0/audit-log.ts +0 -18
- package/src/db/schema/2.0.0/consent-policy.ts +0 -28
- package/src/db/schema/2.0.0/consent-purpose.ts +0 -12
- package/src/db/schema/2.0.0/consent.ts +0 -26
- package/src/db/schema/2.0.0/domain.ts +0 -12
- package/src/db/schema/2.0.0/index.ts +0 -47
- package/src/db/schema/2.0.0/subject.ts +0 -14
- package/src/db/schema/index.ts +0 -15
- package/src/db/tenant-scope.test.ts +0 -750
- package/src/db/tenant-scope.ts +0 -103
- package/src/define-config.ts +0 -5
- package/src/handlers/consent/check.handler.ts +0 -126
- package/src/handlers/init/geo.test.ts +0 -317
- package/src/handlers/init/geo.ts +0 -195
- package/src/handlers/init/index.test.ts +0 -205
- package/src/handlers/init/index.ts +0 -114
- package/src/handlers/init/translations.test.ts +0 -121
- package/src/handlers/init/translations.ts +0 -72
- package/src/handlers/status/status.handler.test.ts +0 -155
- package/src/handlers/status/status.handler.ts +0 -51
- package/src/handlers/subject/get.handler.ts +0 -93
- package/src/handlers/subject/list.handler.ts +0 -93
- package/src/handlers/subject/patch.handler.ts +0 -122
- package/src/handlers/subject/post.handler.test.ts +0 -294
- package/src/handlers/subject/post.handler.ts +0 -254
- package/src/handlers/utils/consent-enrichment.test.ts +0 -380
- package/src/handlers/utils/consent-enrichment.ts +0 -218
- package/src/init.test.ts +0 -126
- package/src/init.ts +0 -87
- package/src/middleware/auth/index.ts +0 -11
- package/src/middleware/auth/validate-api-key.test.ts +0 -86
- package/src/middleware/auth/validate-api-key.ts +0 -107
- package/src/middleware/cors/cors.test.ts +0 -135
- package/src/middleware/cors/cors.ts +0 -186
- package/src/middleware/cors/is-origin-trusted.test.ts +0 -164
- package/src/middleware/cors/is-origin-trusted.ts +0 -130
- package/src/middleware/cors/process-cors.ts +0 -91
- package/src/middleware/openapi/config.ts +0 -29
- package/src/middleware/openapi/handlers.ts +0 -34
- package/src/middleware/process-ip/index.test.ts +0 -195
- package/src/middleware/process-ip/index.ts +0 -199
- package/src/router.ts +0 -15
- package/src/routes/consent.ts +0 -52
- package/src/routes/index.ts +0 -10
- package/src/routes/init.ts +0 -102
- package/src/routes/status.ts +0 -46
- package/src/routes/subject.ts +0 -152
- package/src/types/api.ts +0 -48
- package/src/types/index.ts +0 -288
- package/src/utils/create-telemetry-options.test.ts +0 -302
- package/src/utils/create-telemetry-options.ts +0 -229
- package/src/utils/env.ts +0 -84
- package/src/utils/extract-error-message.ts +0 -21
- package/src/utils/instrumentation.test.ts +0 -185
- package/src/utils/instrumentation.ts +0 -196
- package/src/utils/logger.ts +0 -41
- package/src/utils/metrics.test.ts +0 -323
- package/src/utils/metrics.ts +0 -402
- package/src/utils/telemetry-pii.test.ts +0 -325
- package/src/version.ts +0 -2
- package/tsconfig.json +0 -11
- package/vitest.config.ts +0 -28
- /package/dist/{types.js → types/index.js} +0 -0
- /package/{src/db/adapters/drizzle.ts → dist-types/db/adapters/drizzle.d.ts} +0 -0
- /package/{src/db/adapters/index.ts → dist-types/db/adapters/index.d.ts} +0 -0
- /package/{src/db/adapters/kysely.ts → dist-types/db/adapters/kysely.d.ts} +0 -0
- /package/{src/db/adapters/mongo.ts → dist-types/db/adapters/mongo.d.ts} +0 -0
- /package/{src/db/adapters/prisma.ts → dist-types/db/adapters/prisma.d.ts} +0 -0
- /package/{src/db/adapters/typeorm.ts → dist-types/db/adapters/typeorm.d.ts} +0 -0
- /package/{src/utils/index.ts → dist-types/utils/index.d.ts} +0 -0
|
@@ -13,7 +13,7 @@ var __webpack_require__ = {};
|
|
|
13
13
|
})();
|
|
14
14
|
(()=>{
|
|
15
15
|
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if (
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
17
|
value: 'Module'
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports1, '__esModule', {
|
|
@@ -8,4 +8,3 @@
|
|
|
8
8
|
export { createCloudflareKVAdapter, type KVNamespace, } from './cloudflare-kv';
|
|
9
9
|
export { clearMemoryCache, createMemoryCacheAdapter, getMemoryCacheSize, } from './memory';
|
|
10
10
|
export { createUpstashRedisAdapter, createUpstashRedisAdapterFromClient, type UpstashRedisAdapterOptions, } from './upstash-redis';
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -10,4 +10,3 @@ export { createGVLResolver, type GVLResolver, type GVLResolverOptions, } from '.
|
|
|
10
10
|
export { createCacheKey, createGVLCacheKey } from './keys';
|
|
11
11
|
export type { CacheAdapter } from './types';
|
|
12
12
|
export { GVL_TTL_MS, MEMORY_TTL_MS } from './types';
|
|
13
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -74,6 +74,13 @@ export interface C15TInstance {
|
|
|
74
74
|
*/
|
|
75
75
|
export declare const c15tInstance: (options: C15TOptions) => C15TInstance;
|
|
76
76
|
export { defineConfig } from './define-config';
|
|
77
|
+
export type { PolicyValidationResult } from './handlers/init/policy';
|
|
78
|
+
export { inspectPolicies } from './handlers/init/policy';
|
|
79
|
+
export type { PolicyBuilderInput } from './policies/builder';
|
|
80
|
+
export { policyBuilder } from './policies/builder';
|
|
81
|
+
export type { EuropePolicyMode, PolicyPackPresets, } from './policies/defaults';
|
|
82
|
+
export { policyPackPresets } from './policies/defaults';
|
|
83
|
+
export type { PolicyMatch } from './policies/matchers';
|
|
84
|
+
export { EEA_COUNTRY_CODES, EU_COUNTRY_CODES, POLICY_MATCH_DATASET_VERSION, policyMatchers, UK_COUNTRY_CODES, } from './policies/matchers';
|
|
77
85
|
export type { C15TContext, C15TOptions } from './types';
|
|
78
86
|
export { version } from './version';
|
|
79
|
-
//# sourceMappingURL=core.d.ts.map
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { LegalDocumentPolicyType, PolicyType } from '../schema';
|
|
2
|
+
import type { Registry } from './types';
|
|
3
|
+
export interface LegalDocumentPolicyInput {
|
|
4
|
+
type: LegalDocumentPolicyType;
|
|
5
|
+
version: string;
|
|
6
|
+
hash: string;
|
|
7
|
+
effectiveDate: Date;
|
|
8
|
+
}
|
|
9
|
+
export declare class LegalDocumentPolicyConflictError extends Error {
|
|
10
|
+
constructor(message: string);
|
|
11
|
+
}
|
|
12
|
+
export declare function buildLegalDocumentPolicyId(input: {
|
|
13
|
+
tenantId?: string;
|
|
14
|
+
type: LegalDocumentPolicyType;
|
|
15
|
+
hash: string;
|
|
16
|
+
}): Promise<string>;
|
|
17
|
+
export declare function policyRegistry({ db, ctx }: Registry): {
|
|
18
|
+
findConsentPolicyById: (policyId: string) => Promise<{
|
|
19
|
+
id: string;
|
|
20
|
+
version: string;
|
|
21
|
+
type: string;
|
|
22
|
+
hash: string | null;
|
|
23
|
+
effectiveDate: Date;
|
|
24
|
+
isActive: boolean;
|
|
25
|
+
createdAt: Date;
|
|
26
|
+
tenantId: string | null;
|
|
27
|
+
} | null>;
|
|
28
|
+
findLatestPolicyByType: (type: PolicyType) => Promise<{
|
|
29
|
+
id: string;
|
|
30
|
+
version: string;
|
|
31
|
+
type: string;
|
|
32
|
+
hash: string | null;
|
|
33
|
+
effectiveDate: Date;
|
|
34
|
+
isActive: boolean;
|
|
35
|
+
createdAt: Date;
|
|
36
|
+
tenantId: string | null;
|
|
37
|
+
} | null>;
|
|
38
|
+
findLegalDocumentPolicyByHash: (type: LegalDocumentPolicyType, hash: string) => Promise<{
|
|
39
|
+
id: string;
|
|
40
|
+
version: string;
|
|
41
|
+
type: string;
|
|
42
|
+
hash: string | null;
|
|
43
|
+
effectiveDate: Date;
|
|
44
|
+
isActive: boolean;
|
|
45
|
+
createdAt: Date;
|
|
46
|
+
tenantId: string | null;
|
|
47
|
+
} | null>;
|
|
48
|
+
syncCurrentLegalDocumentPolicy: (input: LegalDocumentPolicyInput) => Promise<{
|
|
49
|
+
id: string;
|
|
50
|
+
version: string;
|
|
51
|
+
type: string;
|
|
52
|
+
hash: string | null;
|
|
53
|
+
effectiveDate: Date;
|
|
54
|
+
isActive: boolean;
|
|
55
|
+
createdAt: Date;
|
|
56
|
+
tenantId: string | null;
|
|
57
|
+
}>;
|
|
58
|
+
findOrCreateLegalDocumentPolicy: (input: LegalDocumentPolicyInput) => 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
|
+
}>;
|
|
68
|
+
findOrCreatePolicy: (type: PolicyType) => 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
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import type { Registry } from './types';
|
|
2
|
+
export declare const createRegistry: (ctx: Registry) => {
|
|
3
|
+
findOrCreateRuntimePolicyDecision: (input: import("./runtime-policy-decision").RuntimePolicyDecisionInput) => Promise<{
|
|
4
|
+
id: string;
|
|
5
|
+
tenantId: string | null;
|
|
6
|
+
policyId: string;
|
|
7
|
+
fingerprint: string;
|
|
8
|
+
matchedBy: string;
|
|
9
|
+
countryCode: string | null;
|
|
10
|
+
regionCode: string | null;
|
|
11
|
+
jurisdiction: string;
|
|
12
|
+
language: string | null;
|
|
13
|
+
model: string;
|
|
14
|
+
policyI18n: unknown;
|
|
15
|
+
uiMode: string | null;
|
|
16
|
+
bannerUi: unknown;
|
|
17
|
+
dialogUi: unknown;
|
|
18
|
+
categories: unknown;
|
|
19
|
+
preselectedCategories: unknown;
|
|
20
|
+
proofConfig: unknown;
|
|
21
|
+
dedupeKey: string;
|
|
22
|
+
createdAt: Date;
|
|
23
|
+
}>;
|
|
24
|
+
findDomainByName: (name: string) => Promise<{
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
createdAt: Date;
|
|
28
|
+
updatedAt: Date;
|
|
29
|
+
tenantId: string | null;
|
|
30
|
+
} | null>;
|
|
31
|
+
findOrCreateDomain: (name: string) => Promise<{
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
createdAt: Date;
|
|
35
|
+
updatedAt: Date;
|
|
36
|
+
tenantId: string | null;
|
|
37
|
+
}>;
|
|
38
|
+
findConsentPolicyById: (policyId: string) => Promise<{
|
|
39
|
+
id: string;
|
|
40
|
+
version: string;
|
|
41
|
+
type: string;
|
|
42
|
+
hash: string | null;
|
|
43
|
+
effectiveDate: Date;
|
|
44
|
+
isActive: boolean;
|
|
45
|
+
createdAt: Date;
|
|
46
|
+
tenantId: string | null;
|
|
47
|
+
} | null>;
|
|
48
|
+
findLatestPolicyByType: (type: import("@c15t/schema").PolicyType) => Promise<{
|
|
49
|
+
id: string;
|
|
50
|
+
version: string;
|
|
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;
|
|
93
|
+
effectiveDate: Date;
|
|
94
|
+
isActive: boolean;
|
|
95
|
+
createdAt: Date;
|
|
96
|
+
tenantId: string | null;
|
|
97
|
+
}>;
|
|
98
|
+
findOrCreateConsentPurposeByCode: (code: string) => Promise<{
|
|
99
|
+
id: string;
|
|
100
|
+
code: string;
|
|
101
|
+
createdAt: Date;
|
|
102
|
+
updatedAt: Date;
|
|
103
|
+
tenantId: string | null;
|
|
104
|
+
}>;
|
|
105
|
+
findOrCreateSubject: ({ subjectId, externalSubjectId, identityProvider, ipAddress, }: {
|
|
106
|
+
subjectId?: string;
|
|
107
|
+
externalSubjectId?: string;
|
|
108
|
+
identityProvider?: string;
|
|
109
|
+
ipAddress?: string | null;
|
|
110
|
+
}) => Promise<{
|
|
111
|
+
id: string;
|
|
112
|
+
externalId: string | null;
|
|
113
|
+
identityProvider: string | null;
|
|
114
|
+
createdAt: Date;
|
|
115
|
+
updatedAt: Date;
|
|
116
|
+
tenantId: string | null;
|
|
117
|
+
}>;
|
|
118
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { PolicyModel } from '../../types';
|
|
2
|
+
import type { Registry } from './types';
|
|
3
|
+
interface RuntimePolicyDecisionUiSurface {
|
|
4
|
+
allowedActions?: Array<'accept' | 'reject' | 'customize'>;
|
|
5
|
+
primaryActions?: Array<'accept' | 'reject' | 'customize'>;
|
|
6
|
+
layout?: Array<'accept' | 'reject' | 'customize' | Array<'accept' | 'reject' | 'customize'>>;
|
|
7
|
+
direction?: 'row' | 'column';
|
|
8
|
+
uiProfile?: 'balanced' | 'compact' | 'strict';
|
|
9
|
+
scrollLock?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface RuntimePolicyDecisionInput {
|
|
12
|
+
tenantId?: string;
|
|
13
|
+
policyId: string;
|
|
14
|
+
fingerprint: string;
|
|
15
|
+
matchedBy: 'region' | 'country' | 'default';
|
|
16
|
+
countryCode: string | null;
|
|
17
|
+
regionCode: string | null;
|
|
18
|
+
jurisdiction: string;
|
|
19
|
+
language?: string;
|
|
20
|
+
model: PolicyModel;
|
|
21
|
+
policyI18n?: {
|
|
22
|
+
language?: string;
|
|
23
|
+
messageProfile?: string;
|
|
24
|
+
};
|
|
25
|
+
uiMode?: 'none' | 'banner' | 'dialog';
|
|
26
|
+
bannerUi?: RuntimePolicyDecisionUiSurface;
|
|
27
|
+
dialogUi?: RuntimePolicyDecisionUiSurface;
|
|
28
|
+
categories?: string[];
|
|
29
|
+
preselectedCategories?: string[];
|
|
30
|
+
proofConfig?: {
|
|
31
|
+
storeIp?: boolean;
|
|
32
|
+
storeUserAgent?: boolean;
|
|
33
|
+
storeLanguage?: boolean;
|
|
34
|
+
};
|
|
35
|
+
dedupeKey: string;
|
|
36
|
+
}
|
|
37
|
+
export declare function runtimePolicyDecisionRegistry({ db, ctx }: Registry): {
|
|
38
|
+
findOrCreateRuntimePolicyDecision: (input: RuntimePolicyDecisionInput) => Promise<{
|
|
39
|
+
id: string;
|
|
40
|
+
tenantId: string | null;
|
|
41
|
+
policyId: string;
|
|
42
|
+
fingerprint: string;
|
|
43
|
+
matchedBy: string;
|
|
44
|
+
countryCode: string | null;
|
|
45
|
+
regionCode: string | null;
|
|
46
|
+
jurisdiction: string;
|
|
47
|
+
language: string | null;
|
|
48
|
+
model: string;
|
|
49
|
+
policyI18n: unknown;
|
|
50
|
+
uiMode: string | null;
|
|
51
|
+
bannerUi: unknown;
|
|
52
|
+
dialogUi: unknown;
|
|
53
|
+
categories: unknown;
|
|
54
|
+
preselectedCategories: unknown;
|
|
55
|
+
proofConfig: unknown;
|
|
56
|
+
dedupeKey: string;
|
|
57
|
+
createdAt: Date;
|
|
58
|
+
}>;
|
|
59
|
+
};
|
|
60
|
+
export {};
|
|
@@ -21,7 +21,6 @@ export declare function subjectRegistry({ db, ctx }: Registry): {
|
|
|
21
21
|
ipAddress?: string | null;
|
|
22
22
|
}) => Promise<{
|
|
23
23
|
id: string;
|
|
24
|
-
isIdentified: boolean;
|
|
25
24
|
externalId: string | null;
|
|
26
25
|
identityProvider: string | null;
|
|
27
26
|
createdAt: Date;
|
|
@@ -29,4 +28,3 @@ export declare function subjectRegistry({ db, ctx }: Registry): {
|
|
|
29
28
|
tenantId: string | null;
|
|
30
29
|
}>;
|
|
31
30
|
};
|
|
32
|
-
//# sourceMappingURL=subject.d.ts.map
|
|
@@ -11,4 +11,3 @@ export declare const auditLogTable: import("fumadb/schema").Table<{
|
|
|
11
11
|
createdAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
|
|
12
12
|
eventTimezone: import("fumadb/schema").Column<"string", string | null, string>;
|
|
13
13
|
}, {}>;
|
|
14
|
-
//# sourceMappingURL=audit-log.d.ts.map
|
|
@@ -10,4 +10,3 @@ export declare const consentPolicyTable: import("fumadb/schema").Table<{
|
|
|
10
10
|
isActive: import("fumadb/schema").Column<"bool", boolean | null, boolean>;
|
|
11
11
|
createdAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
|
|
12
12
|
}, {}>;
|
|
13
|
-
//# sourceMappingURL=consent-policy.d.ts.map
|
|
@@ -10,4 +10,3 @@ export declare const consentPurposeTable: import("fumadb/schema").Table<{
|
|
|
10
10
|
createdAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
|
|
11
11
|
updatedAt: import("fumadb/schema").Column<"timestamp", Date | null, Date>;
|
|
12
12
|
}, {}>;
|
|
13
|
-
//# sourceMappingURL=consent-purpose.d.ts.map
|
|
@@ -14,5 +14,4 @@ export declare const consentTable: import("fumadb/schema").Table<{
|
|
|
14
14
|
validUntil: import("fumadb/schema").Column<"timestamp", Date | null, Date | null>;
|
|
15
15
|
isActive: import("fumadb/schema").Column<"bool", boolean | null, boolean>;
|
|
16
16
|
}, {}>;
|
|
17
|
-
export {
|
|
18
|
-
//# sourceMappingURL=consent.d.ts.map
|
|
17
|
+
export { type Consent, consentSchema };
|