@c15t/backend 1.2.0-canary.9 → 1.2.1
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/.turbo/turbo-build.log +53 -52
- package/CHANGELOG.md +13 -0
- package/dist/__tests__/server.test.d.ts +2 -0
- package/dist/__tests__/server.test.d.ts.map +1 -0
- package/dist/contracts/index.d.ts +1 -1
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts.cjs +708 -0
- package/dist/contracts.js +661 -0
- package/dist/core.cjs +96 -49
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +96 -49
- package/dist/middleware/openapi/config.d.ts +1 -1
- package/dist/middleware/openapi/config.d.ts.map +1 -1
- package/dist/pkgs/data-model/index.cjs +59 -41
- package/dist/pkgs/data-model/index.js +59 -41
- package/dist/pkgs/data-model/schema/index.cjs +59 -41
- package/dist/pkgs/data-model/schema/index.js +59 -41
- package/dist/pkgs/db-adapters/adapters/drizzle-adapter/index.cjs +2 -2
- package/dist/pkgs/db-adapters/adapters/drizzle-adapter/index.js +2 -2
- package/dist/pkgs/db-adapters/adapters/kysely-adapter/index.cjs +2 -2
- package/dist/pkgs/db-adapters/adapters/kysely-adapter/index.js +2 -2
- package/dist/pkgs/db-adapters/adapters/memory-adapter/index.cjs +2 -2
- package/dist/pkgs/db-adapters/adapters/memory-adapter/index.js +2 -2
- package/dist/pkgs/db-adapters/adapters/prisma-adapter/index.cjs +2 -2
- package/dist/pkgs/db-adapters/adapters/prisma-adapter/index.js +2 -2
- package/dist/pkgs/db-adapters/index.cjs +2 -2
- package/dist/pkgs/db-adapters/index.js +2 -2
- package/dist/pkgs/migrations/index.cjs +2 -2
- package/dist/pkgs/migrations/index.js +2 -2
- package/dist/router.cjs +5 -3
- package/dist/router.js +5 -3
- package/dist/schema/consent-policy/registry.d.ts.map +1 -1
- package/dist/schema/consent-purpose/registry.d.ts +4 -4
- package/dist/schema/consent-purpose/schema.d.ts +6 -6
- package/dist/schema/consent-purpose/table.d.ts +6 -6
- package/dist/schema/create-registry.d.ts +4 -4
- package/dist/schema/create-registry.d.ts.map +1 -1
- package/dist/schema/definition.d.ts +6 -6
- package/dist/schema/index.cjs +59 -41
- package/dist/schema/index.js +59 -41
- package/dist/schema/schemas.d.ts +6 -6
- package/package.json +7 -2
- package/rslib.config.ts +1 -0
- package/src/__tests__/server.test.ts +96 -0
- package/src/contracts/index.ts +2 -0
- package/src/core.ts +29 -1
- package/src/middleware/cors/cors.test.ts +0 -1
- package/src/middleware/openapi/config.ts +10 -7
- package/src/schema/consent-policy/registry.ts +74 -51
- package/src/schema/consent-purpose/schema.ts +2 -2
- package/.turbo/turbo-fmt.log +0 -7
- package/.turbo/turbo-test.log +0 -426
- package/coverage/coverage-final.json +0 -88
- package/coverage/coverage-summary.json +0 -89
- package/coverage/html/backend/index.html +0 -116
- package/coverage/html/backend/rslib.config.ts.html +0 -415
- package/coverage/html/backend/src/contracts/consent/index.html +0 -161
- package/coverage/html/backend/src/contracts/consent/index.ts.html +0 -112
- package/coverage/html/backend/src/contracts/consent/post.contract.ts.html +0 -550
- package/coverage/html/backend/src/contracts/consent/show-banner.contract.ts.html +0 -220
- package/coverage/html/backend/src/contracts/consent/verify.contract.ts.html +0 -463
- package/coverage/html/backend/src/contracts/index.html +0 -116
- package/coverage/html/backend/src/contracts/index.ts.html +0 -139
- package/coverage/html/backend/src/contracts/meta/index.html +0 -131
- package/coverage/html/backend/src/contracts/meta/index.ts.html +0 -100
- package/coverage/html/backend/src/contracts/meta/status.contract.ts.html +0 -196
- package/coverage/html/backend/src/contracts/shared/index.html +0 -116
- package/coverage/html/backend/src/contracts/shared/jurisdiction.schema.ts.html +0 -175
- package/coverage/html/backend/src/core.ts.html +0 -1342
- package/coverage/html/backend/src/handlers/consent/index.html +0 -161
- package/coverage/html/backend/src/handlers/consent/index.ts.html +0 -112
- package/coverage/html/backend/src/handlers/consent/post.handler.ts.html +0 -904
- package/coverage/html/backend/src/handlers/consent/show-banner.handler.ts.html +0 -532
- package/coverage/html/backend/src/handlers/consent/verify.handler.ts.html +0 -1000
- package/coverage/html/backend/src/handlers/meta/index.html +0 -131
- package/coverage/html/backend/src/handlers/meta/index.ts.html +0 -100
- package/coverage/html/backend/src/handlers/meta/status.handler.ts.html +0 -226
- package/coverage/html/backend/src/index.html +0 -161
- package/coverage/html/backend/src/init.ts.html +0 -1018
- package/coverage/html/backend/src/middleware/cors/cors.ts.html +0 -661
- package/coverage/html/backend/src/middleware/cors/index.html +0 -146
- package/coverage/html/backend/src/middleware/cors/is-origin-trusted.ts.html +0 -463
- package/coverage/html/backend/src/middleware/cors/process-cors.ts.html +0 -358
- package/coverage/html/backend/src/middleware/openapi/config.ts.html +0 -160
- package/coverage/html/backend/src/middleware/openapi/handlers.ts.html +0 -481
- package/coverage/html/backend/src/middleware/openapi/index.html +0 -131
- package/coverage/html/backend/src/pkgs/api-router/hooks/index.html +0 -116
- package/coverage/html/backend/src/pkgs/api-router/hooks/processor.ts.html +0 -544
- package/coverage/html/backend/src/pkgs/api-router/index.html +0 -116
- package/coverage/html/backend/src/pkgs/api-router/telemetry.ts.html +0 -334
- package/coverage/html/backend/src/pkgs/api-router/utils/index.html +0 -116
- package/coverage/html/backend/src/pkgs/api-router/utils/ip.ts.html +0 -361
- package/coverage/html/backend/src/pkgs/data-model/fields/field-factory.ts.html +0 -709
- package/coverage/html/backend/src/pkgs/data-model/fields/id-generator.ts.html +0 -256
- package/coverage/html/backend/src/pkgs/data-model/fields/index.html +0 -161
- package/coverage/html/backend/src/pkgs/data-model/fields/superjson-utils.ts.html +0 -136
- package/coverage/html/backend/src/pkgs/data-model/fields/zod-fields.ts.html +0 -496
- package/coverage/html/backend/src/pkgs/data-model/hooks/create-hooks.ts.html +0 -349
- package/coverage/html/backend/src/pkgs/data-model/hooks/index.html +0 -176
- package/coverage/html/backend/src/pkgs/data-model/hooks/update-hooks.ts.html +0 -358
- package/coverage/html/backend/src/pkgs/data-model/hooks/update-many-hooks.ts.html +0 -613
- package/coverage/html/backend/src/pkgs/data-model/hooks/utils.ts.html +0 -538
- package/coverage/html/backend/src/pkgs/data-model/hooks/with-hooks-factory.ts.html +0 -289
- package/coverage/html/backend/src/pkgs/db-adapters/adapter-factory.ts.html +0 -289
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/drizzle-adapter/drizzle-adapter.ts.html +0 -2203
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/drizzle-adapter/index.html +0 -116
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/index.html +0 -116
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/kysely-adapter/dialect.ts.html +0 -670
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/kysely-adapter/index.html +0 -131
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/kysely-adapter/kysely-adapter.ts.html +0 -3634
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/kysely-adapter/tests/index.html +0 -116
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/kysely-adapter/tests/test-utils.ts.html +0 -1417
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/memory-adapter/index.html +0 -116
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/memory-adapter/memory-adapter.ts.html +0 -2071
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/prisma-adapter/index.html +0 -116
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/prisma-adapter/prisma-adapter.ts.html +0 -1834
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/test.ts.html +0 -316
- package/coverage/html/backend/src/pkgs/db-adapters/index.html +0 -131
- package/coverage/html/backend/src/pkgs/db-adapters/utils.ts.html +0 -238
- package/coverage/html/backend/src/pkgs/migrations/get-migration.ts.html +0 -343
- package/coverage/html/backend/src/pkgs/migrations/get-schema/get-schema.ts.html +0 -217
- package/coverage/html/backend/src/pkgs/migrations/get-schema/index.html +0 -146
- package/coverage/html/backend/src/pkgs/migrations/get-schema/process-fields.ts.html +0 -280
- package/coverage/html/backend/src/pkgs/migrations/get-schema/process-tables.ts.html +0 -289
- package/coverage/html/backend/src/pkgs/migrations/index.html +0 -176
- package/coverage/html/backend/src/pkgs/migrations/migration-builders.ts.html +0 -595
- package/coverage/html/backend/src/pkgs/migrations/migration-execution.ts.html +0 -301
- package/coverage/html/backend/src/pkgs/migrations/schema-comparison.ts.html +0 -694
- package/coverage/html/backend/src/pkgs/migrations/type-mapping.ts.html +0 -817
- package/coverage/html/backend/src/pkgs/results/core/error-class.ts.html +0 -976
- package/coverage/html/backend/src/pkgs/results/core/error-codes.ts.html +0 -703
- package/coverage/html/backend/src/pkgs/results/core/index.html +0 -146
- package/coverage/html/backend/src/pkgs/results/core/tracing.ts.html +0 -280
- package/coverage/html/backend/src/pkgs/results/create-telemetry-options.ts.html +0 -271
- package/coverage/html/backend/src/pkgs/results/index.html +0 -131
- package/coverage/html/backend/src/pkgs/results/orpc-error-handler.ts.html +0 -496
- package/coverage/html/backend/src/pkgs/results/results/index.html +0 -131
- package/coverage/html/backend/src/pkgs/results/results/recovery-utils.ts.html +0 -628
- package/coverage/html/backend/src/pkgs/results/results/result-helpers.ts.html +0 -1234
- package/coverage/html/backend/src/pkgs/utils/env.ts.html +0 -337
- package/coverage/html/backend/src/pkgs/utils/index.html +0 -146
- package/coverage/html/backend/src/pkgs/utils/logger.ts.html +0 -199
- package/coverage/html/backend/src/pkgs/utils/url.ts.html +0 -400
- package/coverage/html/backend/src/router.ts.html +0 -109
- package/coverage/html/backend/src/schema/audit-log/index.html +0 -146
- package/coverage/html/backend/src/schema/audit-log/registry.ts.html +0 -436
- package/coverage/html/backend/src/schema/audit-log/schema.ts.html +0 -223
- package/coverage/html/backend/src/schema/audit-log/table.ts.html +0 -640
- package/coverage/html/backend/src/schema/consent/index.html +0 -146
- package/coverage/html/backend/src/schema/consent/registry.ts.html +0 -616
- package/coverage/html/backend/src/schema/consent/schema.ts.html +0 -238
- package/coverage/html/backend/src/schema/consent/table.ts.html +0 -748
- package/coverage/html/backend/src/schema/consent-policy/index.html +0 -146
- package/coverage/html/backend/src/schema/consent-policy/registry.ts.html +0 -1063
- package/coverage/html/backend/src/schema/consent-policy/schema.ts.html +0 -265
- package/coverage/html/backend/src/schema/consent-policy/table.ts.html +0 -535
- package/coverage/html/backend/src/schema/consent-purpose/index.html +0 -146
- package/coverage/html/backend/src/schema/consent-purpose/registry.ts.html +0 -589
- package/coverage/html/backend/src/schema/consent-purpose/schema.ts.html +0 -259
- package/coverage/html/backend/src/schema/consent-purpose/table.ts.html +0 -547
- package/coverage/html/backend/src/schema/consent-record/index.html +0 -131
- package/coverage/html/backend/src/schema/consent-record/schema.ts.html +0 -211
- package/coverage/html/backend/src/schema/consent-record/table.ts.html +0 -457
- package/coverage/html/backend/src/schema/create-registry.ts.html +0 -148
- package/coverage/html/backend/src/schema/definition.ts.html +0 -685
- package/coverage/html/backend/src/schema/domain/index.html +0 -146
- package/coverage/html/backend/src/schema/domain/registry.ts.html +0 -973
- package/coverage/html/backend/src/schema/domain/schema.ts.html +0 -214
- package/coverage/html/backend/src/schema/domain/table.ts.html +0 -496
- package/coverage/html/backend/src/schema/index.html +0 -146
- package/coverage/html/backend/src/schema/schemas.ts.html +0 -166
- package/coverage/html/backend/src/schema/subject/index.html +0 -146
- package/coverage/html/backend/src/schema/subject/registry.ts.html +0 -973
- package/coverage/html/backend/src/schema/subject/schema.ts.html +0 -208
- package/coverage/html/backend/src/schema/subject/table.ts.html +0 -499
- package/coverage/html/backend/src/server.ts.html +0 -463
- package/coverage/html/backend/src/testing/contract-testing.ts.html +0 -1396
- package/coverage/html/backend/src/testing/index.html +0 -116
- package/coverage/html/base.css +0 -224
- package/coverage/html/block-navigation.js +0 -87
- package/coverage/html/favicon.png +0 -0
- package/coverage/html/index.html +0 -656
- package/coverage/html/prettify.css +0 -1
- package/coverage/html/prettify.js +0 -2
- package/coverage/html/sort-arrow-sprite.png +0 -0
- package/coverage/html/sorter.js +0 -196
|
@@ -616,8 +616,8 @@ const purposeSchema = __WEBPACK_EXTERNAL_MODULE_zod__.z.object({
|
|
|
616
616
|
name: __WEBPACK_EXTERNAL_MODULE_zod__.z.string(),
|
|
617
617
|
description: __WEBPACK_EXTERNAL_MODULE_zod__.z.string(),
|
|
618
618
|
isEssential: __WEBPACK_EXTERNAL_MODULE_zod__.z.boolean().default(false),
|
|
619
|
-
dataCategory: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().
|
|
620
|
-
legalBasis: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().
|
|
619
|
+
dataCategory: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().nullish(),
|
|
620
|
+
legalBasis: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().nullish(),
|
|
621
621
|
isActive: __WEBPACK_EXTERNAL_MODULE_zod__.z.boolean().default(true),
|
|
622
622
|
createdAt: __WEBPACK_EXTERNAL_MODULE_zod__.z.date().default(()=>new Date()),
|
|
623
623
|
updatedAt: __WEBPACK_EXTERNAL_MODULE_zod__.z.date().default(()=>new Date())
|
|
@@ -1221,10 +1221,19 @@ function consentRegistry({ adapter, ...ctx }) {
|
|
|
1221
1221
|
}
|
|
1222
1222
|
async function generatePolicyPlaceholder(name, date) {
|
|
1223
1223
|
const content = `[PLACEHOLDER] This is an automatically generated version of the ${name} policy.\n\nThis placeholder content should be replaced with actual policy terms before being presented to users.\n\nGenerated on: ${date.toISOString()}`;
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1224
|
+
let contentHash;
|
|
1225
|
+
try {
|
|
1226
|
+
const encoder = new TextEncoder();
|
|
1227
|
+
const data = encoder.encode(content);
|
|
1228
|
+
const hashBuffer = await crypto.subtle.digest('SHA-256', data);
|
|
1229
|
+
contentHash = Array.from(new Uint8Array(hashBuffer)).map((b)=>b.toString(16).padStart(2, '0')).join('');
|
|
1230
|
+
} catch (error) {
|
|
1231
|
+
throw new error_class_DoubleTieError('Failed to generate policy content hash', {
|
|
1232
|
+
code: error_codes_ERROR_CODES.INTERNAL_SERVER_ERROR,
|
|
1233
|
+
status: 500,
|
|
1234
|
+
cause: error instanceof Error ? error : new Error(String(error))
|
|
1235
|
+
});
|
|
1236
|
+
}
|
|
1228
1237
|
return {
|
|
1229
1238
|
content,
|
|
1230
1239
|
contentHash
|
|
@@ -1286,42 +1295,51 @@ function policyRegistry({ adapter, ...ctx }) {
|
|
|
1286
1295
|
},
|
|
1287
1296
|
findOrCreatePolicy: async (type)=>await adapter.transaction({
|
|
1288
1297
|
callback: async (txAdapter)=>{
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1298
|
+
try {
|
|
1299
|
+
const now = new Date();
|
|
1300
|
+
const txRegistry = policyRegistry({
|
|
1301
|
+
adapter: txAdapter,
|
|
1302
|
+
...ctx
|
|
1303
|
+
});
|
|
1304
|
+
const rawLatestPolicy = await txAdapter.findOne({
|
|
1305
|
+
model: 'consentPolicy',
|
|
1306
|
+
where: [
|
|
1307
|
+
{
|
|
1308
|
+
field: 'isActive',
|
|
1309
|
+
value: true
|
|
1310
|
+
},
|
|
1311
|
+
{
|
|
1312
|
+
field: 'type',
|
|
1313
|
+
value: type
|
|
1314
|
+
}
|
|
1315
|
+
],
|
|
1316
|
+
sortBy: {
|
|
1317
|
+
field: 'effectiveDate',
|
|
1318
|
+
direction: 'desc'
|
|
1304
1319
|
}
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1320
|
+
});
|
|
1321
|
+
const latestPolicy = rawLatestPolicy ? validateEntityOutput('consentPolicy', rawLatestPolicy, ctx.options) : null;
|
|
1322
|
+
if (latestPolicy) return latestPolicy;
|
|
1323
|
+
const { content: defaultContent, contentHash } = await generatePolicyPlaceholder(type, now);
|
|
1324
|
+
return txRegistry.createConsentPolicy({
|
|
1325
|
+
version: '1.0.0',
|
|
1326
|
+
type,
|
|
1327
|
+
name: type,
|
|
1328
|
+
effectiveDate: now,
|
|
1329
|
+
content: defaultContent,
|
|
1330
|
+
contentHash,
|
|
1331
|
+
isActive: true,
|
|
1332
|
+
updatedAt: now,
|
|
1333
|
+
expirationDate: null
|
|
1334
|
+
});
|
|
1335
|
+
} catch (error) {
|
|
1336
|
+
ctx.logger.error('Error in findOrCreatePolicy transaction:', error);
|
|
1337
|
+
throw new error_class_DoubleTieError('Failed to find or create policy', {
|
|
1338
|
+
code: error_codes_ERROR_CODES.INTERNAL_SERVER_ERROR,
|
|
1339
|
+
status: 500,
|
|
1340
|
+
cause: error instanceof Error ? error : new Error(String(error))
|
|
1341
|
+
});
|
|
1342
|
+
}
|
|
1325
1343
|
}
|
|
1326
1344
|
})
|
|
1327
1345
|
};
|
|
@@ -651,8 +651,8 @@ const purposeSchema = external_zod_namespaceObject.z.object({
|
|
|
651
651
|
name: external_zod_namespaceObject.z.string(),
|
|
652
652
|
description: external_zod_namespaceObject.z.string(),
|
|
653
653
|
isEssential: external_zod_namespaceObject.z.boolean().default(false),
|
|
654
|
-
dataCategory: external_zod_namespaceObject.z.string().
|
|
655
|
-
legalBasis: external_zod_namespaceObject.z.string().
|
|
654
|
+
dataCategory: external_zod_namespaceObject.z.string().nullish(),
|
|
655
|
+
legalBasis: external_zod_namespaceObject.z.string().nullish(),
|
|
656
656
|
isActive: external_zod_namespaceObject.z.boolean().default(true),
|
|
657
657
|
createdAt: external_zod_namespaceObject.z.date().default(()=>new Date()),
|
|
658
658
|
updatedAt: external_zod_namespaceObject.z.date().default(()=>new Date())
|
|
@@ -1256,10 +1256,19 @@ function consentRegistry({ adapter, ...ctx }) {
|
|
|
1256
1256
|
}
|
|
1257
1257
|
async function generatePolicyPlaceholder(name, date) {
|
|
1258
1258
|
const content = `[PLACEHOLDER] This is an automatically generated version of the ${name} policy.\n\nThis placeholder content should be replaced with actual policy terms before being presented to users.\n\nGenerated on: ${date.toISOString()}`;
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1259
|
+
let contentHash;
|
|
1260
|
+
try {
|
|
1261
|
+
const encoder = new TextEncoder();
|
|
1262
|
+
const data = encoder.encode(content);
|
|
1263
|
+
const hashBuffer = await crypto.subtle.digest('SHA-256', data);
|
|
1264
|
+
contentHash = Array.from(new Uint8Array(hashBuffer)).map((b)=>b.toString(16).padStart(2, '0')).join('');
|
|
1265
|
+
} catch (error) {
|
|
1266
|
+
throw new error_class_DoubleTieError('Failed to generate policy content hash', {
|
|
1267
|
+
code: error_codes_ERROR_CODES.INTERNAL_SERVER_ERROR,
|
|
1268
|
+
status: 500,
|
|
1269
|
+
cause: error instanceof Error ? error : new Error(String(error))
|
|
1270
|
+
});
|
|
1271
|
+
}
|
|
1263
1272
|
return {
|
|
1264
1273
|
content,
|
|
1265
1274
|
contentHash
|
|
@@ -1321,42 +1330,51 @@ function policyRegistry({ adapter, ...ctx }) {
|
|
|
1321
1330
|
},
|
|
1322
1331
|
findOrCreatePolicy: async (type)=>await adapter.transaction({
|
|
1323
1332
|
callback: async (txAdapter)=>{
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1333
|
+
try {
|
|
1334
|
+
const now = new Date();
|
|
1335
|
+
const txRegistry = policyRegistry({
|
|
1336
|
+
adapter: txAdapter,
|
|
1337
|
+
...ctx
|
|
1338
|
+
});
|
|
1339
|
+
const rawLatestPolicy = await txAdapter.findOne({
|
|
1340
|
+
model: 'consentPolicy',
|
|
1341
|
+
where: [
|
|
1342
|
+
{
|
|
1343
|
+
field: 'isActive',
|
|
1344
|
+
value: true
|
|
1345
|
+
},
|
|
1346
|
+
{
|
|
1347
|
+
field: 'type',
|
|
1348
|
+
value: type
|
|
1349
|
+
}
|
|
1350
|
+
],
|
|
1351
|
+
sortBy: {
|
|
1352
|
+
field: 'effectiveDate',
|
|
1353
|
+
direction: 'desc'
|
|
1339
1354
|
}
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1355
|
+
});
|
|
1356
|
+
const latestPolicy = rawLatestPolicy ? validateEntityOutput('consentPolicy', rawLatestPolicy, ctx.options) : null;
|
|
1357
|
+
if (latestPolicy) return latestPolicy;
|
|
1358
|
+
const { content: defaultContent, contentHash } = await generatePolicyPlaceholder(type, now);
|
|
1359
|
+
return txRegistry.createConsentPolicy({
|
|
1360
|
+
version: '1.0.0',
|
|
1361
|
+
type,
|
|
1362
|
+
name: type,
|
|
1363
|
+
effectiveDate: now,
|
|
1364
|
+
content: defaultContent,
|
|
1365
|
+
contentHash,
|
|
1366
|
+
isActive: true,
|
|
1367
|
+
updatedAt: now,
|
|
1368
|
+
expirationDate: null
|
|
1369
|
+
});
|
|
1370
|
+
} catch (error) {
|
|
1371
|
+
ctx.logger.error('Error in findOrCreatePolicy transaction:', error);
|
|
1372
|
+
throw new error_class_DoubleTieError('Failed to find or create policy', {
|
|
1373
|
+
code: error_codes_ERROR_CODES.INTERNAL_SERVER_ERROR,
|
|
1374
|
+
status: 500,
|
|
1375
|
+
cause: error instanceof Error ? error : new Error(String(error))
|
|
1376
|
+
});
|
|
1377
|
+
}
|
|
1360
1378
|
}
|
|
1361
1379
|
})
|
|
1362
1380
|
};
|
|
@@ -593,8 +593,8 @@ const purposeSchema = __WEBPACK_EXTERNAL_MODULE_zod__.z.object({
|
|
|
593
593
|
name: __WEBPACK_EXTERNAL_MODULE_zod__.z.string(),
|
|
594
594
|
description: __WEBPACK_EXTERNAL_MODULE_zod__.z.string(),
|
|
595
595
|
isEssential: __WEBPACK_EXTERNAL_MODULE_zod__.z.boolean().default(false),
|
|
596
|
-
dataCategory: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().
|
|
597
|
-
legalBasis: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().
|
|
596
|
+
dataCategory: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().nullish(),
|
|
597
|
+
legalBasis: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().nullish(),
|
|
598
598
|
isActive: __WEBPACK_EXTERNAL_MODULE_zod__.z.boolean().default(true),
|
|
599
599
|
createdAt: __WEBPACK_EXTERNAL_MODULE_zod__.z.date().default(()=>new Date()),
|
|
600
600
|
updatedAt: __WEBPACK_EXTERNAL_MODULE_zod__.z.date().default(()=>new Date())
|
|
@@ -1198,10 +1198,19 @@ function consentRegistry({ adapter, ...ctx }) {
|
|
|
1198
1198
|
}
|
|
1199
1199
|
async function generatePolicyPlaceholder(name, date) {
|
|
1200
1200
|
const content = `[PLACEHOLDER] This is an automatically generated version of the ${name} policy.\n\nThis placeholder content should be replaced with actual policy terms before being presented to users.\n\nGenerated on: ${date.toISOString()}`;
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1201
|
+
let contentHash;
|
|
1202
|
+
try {
|
|
1203
|
+
const encoder = new TextEncoder();
|
|
1204
|
+
const data = encoder.encode(content);
|
|
1205
|
+
const hashBuffer = await crypto.subtle.digest('SHA-256', data);
|
|
1206
|
+
contentHash = Array.from(new Uint8Array(hashBuffer)).map((b)=>b.toString(16).padStart(2, '0')).join('');
|
|
1207
|
+
} catch (error) {
|
|
1208
|
+
throw new error_class_DoubleTieError('Failed to generate policy content hash', {
|
|
1209
|
+
code: error_codes_ERROR_CODES.INTERNAL_SERVER_ERROR,
|
|
1210
|
+
status: 500,
|
|
1211
|
+
cause: error instanceof Error ? error : new Error(String(error))
|
|
1212
|
+
});
|
|
1213
|
+
}
|
|
1205
1214
|
return {
|
|
1206
1215
|
content,
|
|
1207
1216
|
contentHash
|
|
@@ -1263,42 +1272,51 @@ function policyRegistry({ adapter, ...ctx }) {
|
|
|
1263
1272
|
},
|
|
1264
1273
|
findOrCreatePolicy: async (type)=>await adapter.transaction({
|
|
1265
1274
|
callback: async (txAdapter)=>{
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1275
|
+
try {
|
|
1276
|
+
const now = new Date();
|
|
1277
|
+
const txRegistry = policyRegistry({
|
|
1278
|
+
adapter: txAdapter,
|
|
1279
|
+
...ctx
|
|
1280
|
+
});
|
|
1281
|
+
const rawLatestPolicy = await txAdapter.findOne({
|
|
1282
|
+
model: 'consentPolicy',
|
|
1283
|
+
where: [
|
|
1284
|
+
{
|
|
1285
|
+
field: 'isActive',
|
|
1286
|
+
value: true
|
|
1287
|
+
},
|
|
1288
|
+
{
|
|
1289
|
+
field: 'type',
|
|
1290
|
+
value: type
|
|
1291
|
+
}
|
|
1292
|
+
],
|
|
1293
|
+
sortBy: {
|
|
1294
|
+
field: 'effectiveDate',
|
|
1295
|
+
direction: 'desc'
|
|
1281
1296
|
}
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1297
|
+
});
|
|
1298
|
+
const latestPolicy = rawLatestPolicy ? validateEntityOutput('consentPolicy', rawLatestPolicy, ctx.options) : null;
|
|
1299
|
+
if (latestPolicy) return latestPolicy;
|
|
1300
|
+
const { content: defaultContent, contentHash } = await generatePolicyPlaceholder(type, now);
|
|
1301
|
+
return txRegistry.createConsentPolicy({
|
|
1302
|
+
version: '1.0.0',
|
|
1303
|
+
type,
|
|
1304
|
+
name: type,
|
|
1305
|
+
effectiveDate: now,
|
|
1306
|
+
content: defaultContent,
|
|
1307
|
+
contentHash,
|
|
1308
|
+
isActive: true,
|
|
1309
|
+
updatedAt: now,
|
|
1310
|
+
expirationDate: null
|
|
1311
|
+
});
|
|
1312
|
+
} catch (error) {
|
|
1313
|
+
ctx.logger.error('Error in findOrCreatePolicy transaction:', error);
|
|
1314
|
+
throw new error_class_DoubleTieError('Failed to find or create policy', {
|
|
1315
|
+
code: error_codes_ERROR_CODES.INTERNAL_SERVER_ERROR,
|
|
1316
|
+
status: 500,
|
|
1317
|
+
cause: error instanceof Error ? error : new Error(String(error))
|
|
1318
|
+
});
|
|
1319
|
+
}
|
|
1302
1320
|
}
|
|
1303
1321
|
})
|
|
1304
1322
|
};
|
|
@@ -529,8 +529,8 @@ const purposeSchema = external_zod_namespaceObject.z.object({
|
|
|
529
529
|
name: external_zod_namespaceObject.z.string(),
|
|
530
530
|
description: external_zod_namespaceObject.z.string(),
|
|
531
531
|
isEssential: external_zod_namespaceObject.z.boolean().default(false),
|
|
532
|
-
dataCategory: external_zod_namespaceObject.z.string().
|
|
533
|
-
legalBasis: external_zod_namespaceObject.z.string().
|
|
532
|
+
dataCategory: external_zod_namespaceObject.z.string().nullish(),
|
|
533
|
+
legalBasis: external_zod_namespaceObject.z.string().nullish(),
|
|
534
534
|
isActive: external_zod_namespaceObject.z.boolean().default(true),
|
|
535
535
|
createdAt: external_zod_namespaceObject.z.date().default(()=>new Date()),
|
|
536
536
|
updatedAt: external_zod_namespaceObject.z.date().default(()=>new Date())
|
|
@@ -491,8 +491,8 @@ const purposeSchema = __WEBPACK_EXTERNAL_MODULE_zod__.z.object({
|
|
|
491
491
|
name: __WEBPACK_EXTERNAL_MODULE_zod__.z.string(),
|
|
492
492
|
description: __WEBPACK_EXTERNAL_MODULE_zod__.z.string(),
|
|
493
493
|
isEssential: __WEBPACK_EXTERNAL_MODULE_zod__.z.boolean().default(false),
|
|
494
|
-
dataCategory: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().
|
|
495
|
-
legalBasis: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().
|
|
494
|
+
dataCategory: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().nullish(),
|
|
495
|
+
legalBasis: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().nullish(),
|
|
496
496
|
isActive: __WEBPACK_EXTERNAL_MODULE_zod__.z.boolean().default(true),
|
|
497
497
|
createdAt: __WEBPACK_EXTERNAL_MODULE_zod__.z.date().default(()=>new Date()),
|
|
498
498
|
updatedAt: __WEBPACK_EXTERNAL_MODULE_zod__.z.date().default(()=>new Date())
|
|
@@ -497,8 +497,8 @@ const schema_purposeSchema = external_zod_namespaceObject.z.object({
|
|
|
497
497
|
name: external_zod_namespaceObject.z.string(),
|
|
498
498
|
description: external_zod_namespaceObject.z.string(),
|
|
499
499
|
isEssential: external_zod_namespaceObject.z.boolean().default(false),
|
|
500
|
-
dataCategory: external_zod_namespaceObject.z.string().
|
|
501
|
-
legalBasis: external_zod_namespaceObject.z.string().
|
|
500
|
+
dataCategory: external_zod_namespaceObject.z.string().nullish(),
|
|
501
|
+
legalBasis: external_zod_namespaceObject.z.string().nullish(),
|
|
502
502
|
isActive: external_zod_namespaceObject.z.boolean().default(true),
|
|
503
503
|
createdAt: external_zod_namespaceObject.z.date().default(()=>new Date()),
|
|
504
504
|
updatedAt: external_zod_namespaceObject.z.date().default(()=>new Date())
|
|
@@ -459,8 +459,8 @@ const schema_purposeSchema = __WEBPACK_EXTERNAL_MODULE_zod__.z.object({
|
|
|
459
459
|
name: __WEBPACK_EXTERNAL_MODULE_zod__.z.string(),
|
|
460
460
|
description: __WEBPACK_EXTERNAL_MODULE_zod__.z.string(),
|
|
461
461
|
isEssential: __WEBPACK_EXTERNAL_MODULE_zod__.z.boolean().default(false),
|
|
462
|
-
dataCategory: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().
|
|
463
|
-
legalBasis: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().
|
|
462
|
+
dataCategory: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().nullish(),
|
|
463
|
+
legalBasis: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().nullish(),
|
|
464
464
|
isActive: __WEBPACK_EXTERNAL_MODULE_zod__.z.boolean().default(true),
|
|
465
465
|
createdAt: __WEBPACK_EXTERNAL_MODULE_zod__.z.date().default(()=>new Date()),
|
|
466
466
|
updatedAt: __WEBPACK_EXTERNAL_MODULE_zod__.z.date().default(()=>new Date())
|
|
@@ -494,8 +494,8 @@ const schema_purposeSchema = external_zod_namespaceObject.z.object({
|
|
|
494
494
|
name: external_zod_namespaceObject.z.string(),
|
|
495
495
|
description: external_zod_namespaceObject.z.string(),
|
|
496
496
|
isEssential: external_zod_namespaceObject.z.boolean().default(false),
|
|
497
|
-
dataCategory: external_zod_namespaceObject.z.string().
|
|
498
|
-
legalBasis: external_zod_namespaceObject.z.string().
|
|
497
|
+
dataCategory: external_zod_namespaceObject.z.string().nullish(),
|
|
498
|
+
legalBasis: external_zod_namespaceObject.z.string().nullish(),
|
|
499
499
|
isActive: external_zod_namespaceObject.z.boolean().default(true),
|
|
500
500
|
createdAt: external_zod_namespaceObject.z.date().default(()=>new Date()),
|
|
501
501
|
updatedAt: external_zod_namespaceObject.z.date().default(()=>new Date())
|
|
@@ -456,8 +456,8 @@ const schema_purposeSchema = __WEBPACK_EXTERNAL_MODULE_zod__.z.object({
|
|
|
456
456
|
name: __WEBPACK_EXTERNAL_MODULE_zod__.z.string(),
|
|
457
457
|
description: __WEBPACK_EXTERNAL_MODULE_zod__.z.string(),
|
|
458
458
|
isEssential: __WEBPACK_EXTERNAL_MODULE_zod__.z.boolean().default(false),
|
|
459
|
-
dataCategory: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().
|
|
460
|
-
legalBasis: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().
|
|
459
|
+
dataCategory: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().nullish(),
|
|
460
|
+
legalBasis: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().nullish(),
|
|
461
461
|
isActive: __WEBPACK_EXTERNAL_MODULE_zod__.z.boolean().default(true),
|
|
462
462
|
createdAt: __WEBPACK_EXTERNAL_MODULE_zod__.z.date().default(()=>new Date()),
|
|
463
463
|
updatedAt: __WEBPACK_EXTERNAL_MODULE_zod__.z.date().default(()=>new Date())
|
|
@@ -528,8 +528,8 @@ const purposeSchema = external_zod_namespaceObject.z.object({
|
|
|
528
528
|
name: external_zod_namespaceObject.z.string(),
|
|
529
529
|
description: external_zod_namespaceObject.z.string(),
|
|
530
530
|
isEssential: external_zod_namespaceObject.z.boolean().default(false),
|
|
531
|
-
dataCategory: external_zod_namespaceObject.z.string().
|
|
532
|
-
legalBasis: external_zod_namespaceObject.z.string().
|
|
531
|
+
dataCategory: external_zod_namespaceObject.z.string().nullish(),
|
|
532
|
+
legalBasis: external_zod_namespaceObject.z.string().nullish(),
|
|
533
533
|
isActive: external_zod_namespaceObject.z.boolean().default(true),
|
|
534
534
|
createdAt: external_zod_namespaceObject.z.date().default(()=>new Date()),
|
|
535
535
|
updatedAt: external_zod_namespaceObject.z.date().default(()=>new Date())
|
|
@@ -490,8 +490,8 @@ const purposeSchema = __WEBPACK_EXTERNAL_MODULE_zod__.z.object({
|
|
|
490
490
|
name: __WEBPACK_EXTERNAL_MODULE_zod__.z.string(),
|
|
491
491
|
description: __WEBPACK_EXTERNAL_MODULE_zod__.z.string(),
|
|
492
492
|
isEssential: __WEBPACK_EXTERNAL_MODULE_zod__.z.boolean().default(false),
|
|
493
|
-
dataCategory: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().
|
|
494
|
-
legalBasis: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().
|
|
493
|
+
dataCategory: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().nullish(),
|
|
494
|
+
legalBasis: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().nullish(),
|
|
495
495
|
isActive: __WEBPACK_EXTERNAL_MODULE_zod__.z.boolean().default(true),
|
|
496
496
|
createdAt: __WEBPACK_EXTERNAL_MODULE_zod__.z.date().default(()=>new Date()),
|
|
497
497
|
updatedAt: __WEBPACK_EXTERNAL_MODULE_zod__.z.date().default(()=>new Date())
|
|
@@ -544,8 +544,8 @@ const schema_purposeSchema = external_zod_namespaceObject.z.object({
|
|
|
544
544
|
name: external_zod_namespaceObject.z.string(),
|
|
545
545
|
description: external_zod_namespaceObject.z.string(),
|
|
546
546
|
isEssential: external_zod_namespaceObject.z.boolean().default(false),
|
|
547
|
-
dataCategory: external_zod_namespaceObject.z.string().
|
|
548
|
-
legalBasis: external_zod_namespaceObject.z.string().
|
|
547
|
+
dataCategory: external_zod_namespaceObject.z.string().nullish(),
|
|
548
|
+
legalBasis: external_zod_namespaceObject.z.string().nullish(),
|
|
549
549
|
isActive: external_zod_namespaceObject.z.boolean().default(true),
|
|
550
550
|
createdAt: external_zod_namespaceObject.z.date().default(()=>new Date()),
|
|
551
551
|
updatedAt: external_zod_namespaceObject.z.date().default(()=>new Date())
|
|
@@ -501,8 +501,8 @@ const schema_purposeSchema = __WEBPACK_EXTERNAL_MODULE_zod__.z.object({
|
|
|
501
501
|
name: __WEBPACK_EXTERNAL_MODULE_zod__.z.string(),
|
|
502
502
|
description: __WEBPACK_EXTERNAL_MODULE_zod__.z.string(),
|
|
503
503
|
isEssential: __WEBPACK_EXTERNAL_MODULE_zod__.z.boolean().default(false),
|
|
504
|
-
dataCategory: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().
|
|
505
|
-
legalBasis: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().
|
|
504
|
+
dataCategory: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().nullish(),
|
|
505
|
+
legalBasis: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().nullish(),
|
|
506
506
|
isActive: __WEBPACK_EXTERNAL_MODULE_zod__.z.boolean().default(true),
|
|
507
507
|
createdAt: __WEBPACK_EXTERNAL_MODULE_zod__.z.date().default(()=>new Date()),
|
|
508
508
|
updatedAt: __WEBPACK_EXTERNAL_MODULE_zod__.z.date().default(()=>new Date())
|
|
@@ -486,8 +486,8 @@ const schema_purposeSchema = external_zod_namespaceObject.z.object({
|
|
|
486
486
|
name: external_zod_namespaceObject.z.string(),
|
|
487
487
|
description: external_zod_namespaceObject.z.string(),
|
|
488
488
|
isEssential: external_zod_namespaceObject.z.boolean().default(false),
|
|
489
|
-
dataCategory: external_zod_namespaceObject.z.string().
|
|
490
|
-
legalBasis: external_zod_namespaceObject.z.string().
|
|
489
|
+
dataCategory: external_zod_namespaceObject.z.string().nullish(),
|
|
490
|
+
legalBasis: external_zod_namespaceObject.z.string().nullish(),
|
|
491
491
|
isActive: external_zod_namespaceObject.z.boolean().default(true),
|
|
492
492
|
createdAt: external_zod_namespaceObject.z.date().default(()=>new Date()),
|
|
493
493
|
updatedAt: external_zod_namespaceObject.z.date().default(()=>new Date())
|
|
@@ -443,8 +443,8 @@ const schema_purposeSchema = __WEBPACK_EXTERNAL_MODULE_zod__.z.object({
|
|
|
443
443
|
name: __WEBPACK_EXTERNAL_MODULE_zod__.z.string(),
|
|
444
444
|
description: __WEBPACK_EXTERNAL_MODULE_zod__.z.string(),
|
|
445
445
|
isEssential: __WEBPACK_EXTERNAL_MODULE_zod__.z.boolean().default(false),
|
|
446
|
-
dataCategory: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().
|
|
447
|
-
legalBasis: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().
|
|
446
|
+
dataCategory: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().nullish(),
|
|
447
|
+
legalBasis: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().nullish(),
|
|
448
448
|
isActive: __WEBPACK_EXTERNAL_MODULE_zod__.z.boolean().default(true),
|
|
449
449
|
createdAt: __WEBPACK_EXTERNAL_MODULE_zod__.z.date().default(()=>new Date()),
|
|
450
450
|
updatedAt: __WEBPACK_EXTERNAL_MODULE_zod__.z.date().default(()=>new Date())
|
package/dist/router.cjs
CHANGED
|
@@ -306,8 +306,8 @@ external_zod_namespaceObject.z.object({
|
|
|
306
306
|
name: external_zod_namespaceObject.z.string(),
|
|
307
307
|
description: external_zod_namespaceObject.z.string(),
|
|
308
308
|
isEssential: external_zod_namespaceObject.z.boolean().default(false),
|
|
309
|
-
dataCategory: external_zod_namespaceObject.z.string().
|
|
310
|
-
legalBasis: external_zod_namespaceObject.z.string().
|
|
309
|
+
dataCategory: external_zod_namespaceObject.z.string().nullish(),
|
|
310
|
+
legalBasis: external_zod_namespaceObject.z.string().nullish(),
|
|
311
311
|
isActive: external_zod_namespaceObject.z.boolean().default(true),
|
|
312
312
|
createdAt: external_zod_namespaceObject.z.date().default(()=>new Date()),
|
|
313
313
|
updatedAt: external_zod_namespaceObject.z.date().default(()=>new Date())
|
|
@@ -1167,7 +1167,9 @@ const consentHandlers = {
|
|
|
1167
1167
|
showBanner: show_banner_handler_showConsentBanner,
|
|
1168
1168
|
verify: verifyConsent
|
|
1169
1169
|
};
|
|
1170
|
-
var package_namespaceObject =
|
|
1170
|
+
var package_namespaceObject = {
|
|
1171
|
+
i8: "1.2.1"
|
|
1172
|
+
};
|
|
1171
1173
|
const statusHandler = os.meta.status.handler(({ context })=>{
|
|
1172
1174
|
const typedContext = context;
|
|
1173
1175
|
const headers = typedContext.headers;
|
package/dist/router.js
CHANGED
|
@@ -268,8 +268,8 @@ __WEBPACK_EXTERNAL_MODULE_zod__.z.object({
|
|
|
268
268
|
name: __WEBPACK_EXTERNAL_MODULE_zod__.z.string(),
|
|
269
269
|
description: __WEBPACK_EXTERNAL_MODULE_zod__.z.string(),
|
|
270
270
|
isEssential: __WEBPACK_EXTERNAL_MODULE_zod__.z.boolean().default(false),
|
|
271
|
-
dataCategory: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().
|
|
272
|
-
legalBasis: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().
|
|
271
|
+
dataCategory: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().nullish(),
|
|
272
|
+
legalBasis: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().nullish(),
|
|
273
273
|
isActive: __WEBPACK_EXTERNAL_MODULE_zod__.z.boolean().default(true),
|
|
274
274
|
createdAt: __WEBPACK_EXTERNAL_MODULE_zod__.z.date().default(()=>new Date()),
|
|
275
275
|
updatedAt: __WEBPACK_EXTERNAL_MODULE_zod__.z.date().default(()=>new Date())
|
|
@@ -1129,7 +1129,9 @@ const consentHandlers = {
|
|
|
1129
1129
|
showBanner: show_banner_handler_showConsentBanner,
|
|
1130
1130
|
verify: verifyConsent
|
|
1131
1131
|
};
|
|
1132
|
-
var package_namespaceObject =
|
|
1132
|
+
var package_namespaceObject = {
|
|
1133
|
+
i8: "1.2.1"
|
|
1134
|
+
};
|
|
1133
1135
|
const statusHandler = os.meta.status.handler(({ context })=>{
|
|
1134
1136
|
const typedContext = context;
|
|
1135
1137
|
const headers = typedContext.headers;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/schema/consent-policy/registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/schema/consent-policy/registry.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE5E,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAgD1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,GAAG,GAAG,EAAE,EAAE,eAAe;IAGjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;kCAEM,IAAI,CAAC,aAAa,EAAE,IAAI,GAAG,WAAW,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,YAC9D,sBAAsB;;;;;;;;;;;;;IAwBjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;4BAEM;QACP,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,eAAe,CAAC,EAAE,OAAO,CAAC;KAC1B;;;;;;;;;;;;;IAuCF;;;;;;;;;;;;;;;;;;;;;;OAsBG;sCACqC,MAAM;;;;;;;;;;;;;IAe9C;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;+BAC8B,UAAU;;;;;;;;;;;;;EAuE5C"}
|
|
@@ -94,8 +94,8 @@ export declare function consentPurposeRegistry({ adapter, ...ctx }: RegistryCont
|
|
|
94
94
|
updatedAt: Date;
|
|
95
95
|
isEssential: boolean;
|
|
96
96
|
isActive: boolean;
|
|
97
|
-
dataCategory?: string | undefined;
|
|
98
|
-
legalBasis?: string | undefined;
|
|
97
|
+
dataCategory?: string | null | undefined;
|
|
98
|
+
legalBasis?: string | null | undefined;
|
|
99
99
|
}>;
|
|
100
100
|
/**
|
|
101
101
|
* Finds a consent purpose by its unique code.
|
|
@@ -131,8 +131,8 @@ export declare function consentPurposeRegistry({ adapter, ...ctx }: RegistryCont
|
|
|
131
131
|
updatedAt: Date;
|
|
132
132
|
isEssential: boolean;
|
|
133
133
|
isActive: boolean;
|
|
134
|
-
dataCategory?: string | undefined;
|
|
135
|
-
legalBasis?: string | undefined;
|
|
134
|
+
dataCategory?: string | null | undefined;
|
|
135
|
+
legalBasis?: string | null | undefined;
|
|
136
136
|
} | null>;
|
|
137
137
|
};
|
|
138
138
|
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -40,8 +40,8 @@ export declare const purposeSchema: z.ZodObject<{
|
|
|
40
40
|
name: z.ZodString;
|
|
41
41
|
description: z.ZodString;
|
|
42
42
|
isEssential: z.ZodDefault<z.ZodBoolean>;
|
|
43
|
-
dataCategory: z.ZodOptional<z.ZodString
|
|
44
|
-
legalBasis: z.ZodOptional<z.ZodString
|
|
43
|
+
dataCategory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
44
|
+
legalBasis: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
45
45
|
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
46
46
|
createdAt: z.ZodDefault<z.ZodDate>;
|
|
47
47
|
updatedAt: z.ZodDefault<z.ZodDate>;
|
|
@@ -54,8 +54,8 @@ export declare const purposeSchema: z.ZodObject<{
|
|
|
54
54
|
updatedAt: Date;
|
|
55
55
|
isEssential: boolean;
|
|
56
56
|
isActive: boolean;
|
|
57
|
-
dataCategory?: string | undefined;
|
|
58
|
-
legalBasis?: string | undefined;
|
|
57
|
+
dataCategory?: string | null | undefined;
|
|
58
|
+
legalBasis?: string | null | undefined;
|
|
59
59
|
}, {
|
|
60
60
|
code: string;
|
|
61
61
|
name: string;
|
|
@@ -64,8 +64,8 @@ export declare const purposeSchema: z.ZodObject<{
|
|
|
64
64
|
createdAt?: Date | undefined;
|
|
65
65
|
updatedAt?: Date | undefined;
|
|
66
66
|
isEssential?: boolean | undefined;
|
|
67
|
-
dataCategory?: string | undefined;
|
|
68
|
-
legalBasis?: string | undefined;
|
|
67
|
+
dataCategory?: string | null | undefined;
|
|
68
|
+
legalBasis?: string | null | undefined;
|
|
69
69
|
isActive?: boolean | undefined;
|
|
70
70
|
}>;
|
|
71
71
|
/**
|