@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.
Files changed (186) hide show
  1. package/.turbo/turbo-build.log +53 -52
  2. package/CHANGELOG.md +13 -0
  3. package/dist/__tests__/server.test.d.ts +2 -0
  4. package/dist/__tests__/server.test.d.ts.map +1 -0
  5. package/dist/contracts/index.d.ts +1 -1
  6. package/dist/contracts/index.d.ts.map +1 -1
  7. package/dist/contracts.cjs +708 -0
  8. package/dist/contracts.js +661 -0
  9. package/dist/core.cjs +96 -49
  10. package/dist/core.d.ts.map +1 -1
  11. package/dist/core.js +96 -49
  12. package/dist/middleware/openapi/config.d.ts +1 -1
  13. package/dist/middleware/openapi/config.d.ts.map +1 -1
  14. package/dist/pkgs/data-model/index.cjs +59 -41
  15. package/dist/pkgs/data-model/index.js +59 -41
  16. package/dist/pkgs/data-model/schema/index.cjs +59 -41
  17. package/dist/pkgs/data-model/schema/index.js +59 -41
  18. package/dist/pkgs/db-adapters/adapters/drizzle-adapter/index.cjs +2 -2
  19. package/dist/pkgs/db-adapters/adapters/drizzle-adapter/index.js +2 -2
  20. package/dist/pkgs/db-adapters/adapters/kysely-adapter/index.cjs +2 -2
  21. package/dist/pkgs/db-adapters/adapters/kysely-adapter/index.js +2 -2
  22. package/dist/pkgs/db-adapters/adapters/memory-adapter/index.cjs +2 -2
  23. package/dist/pkgs/db-adapters/adapters/memory-adapter/index.js +2 -2
  24. package/dist/pkgs/db-adapters/adapters/prisma-adapter/index.cjs +2 -2
  25. package/dist/pkgs/db-adapters/adapters/prisma-adapter/index.js +2 -2
  26. package/dist/pkgs/db-adapters/index.cjs +2 -2
  27. package/dist/pkgs/db-adapters/index.js +2 -2
  28. package/dist/pkgs/migrations/index.cjs +2 -2
  29. package/dist/pkgs/migrations/index.js +2 -2
  30. package/dist/router.cjs +5 -3
  31. package/dist/router.js +5 -3
  32. package/dist/schema/consent-policy/registry.d.ts.map +1 -1
  33. package/dist/schema/consent-purpose/registry.d.ts +4 -4
  34. package/dist/schema/consent-purpose/schema.d.ts +6 -6
  35. package/dist/schema/consent-purpose/table.d.ts +6 -6
  36. package/dist/schema/create-registry.d.ts +4 -4
  37. package/dist/schema/create-registry.d.ts.map +1 -1
  38. package/dist/schema/definition.d.ts +6 -6
  39. package/dist/schema/index.cjs +59 -41
  40. package/dist/schema/index.js +59 -41
  41. package/dist/schema/schemas.d.ts +6 -6
  42. package/package.json +7 -2
  43. package/rslib.config.ts +1 -0
  44. package/src/__tests__/server.test.ts +96 -0
  45. package/src/contracts/index.ts +2 -0
  46. package/src/core.ts +29 -1
  47. package/src/middleware/cors/cors.test.ts +0 -1
  48. package/src/middleware/openapi/config.ts +10 -7
  49. package/src/schema/consent-policy/registry.ts +74 -51
  50. package/src/schema/consent-purpose/schema.ts +2 -2
  51. package/.turbo/turbo-fmt.log +0 -7
  52. package/.turbo/turbo-test.log +0 -426
  53. package/coverage/coverage-final.json +0 -88
  54. package/coverage/coverage-summary.json +0 -89
  55. package/coverage/html/backend/index.html +0 -116
  56. package/coverage/html/backend/rslib.config.ts.html +0 -415
  57. package/coverage/html/backend/src/contracts/consent/index.html +0 -161
  58. package/coverage/html/backend/src/contracts/consent/index.ts.html +0 -112
  59. package/coverage/html/backend/src/contracts/consent/post.contract.ts.html +0 -550
  60. package/coverage/html/backend/src/contracts/consent/show-banner.contract.ts.html +0 -220
  61. package/coverage/html/backend/src/contracts/consent/verify.contract.ts.html +0 -463
  62. package/coverage/html/backend/src/contracts/index.html +0 -116
  63. package/coverage/html/backend/src/contracts/index.ts.html +0 -139
  64. package/coverage/html/backend/src/contracts/meta/index.html +0 -131
  65. package/coverage/html/backend/src/contracts/meta/index.ts.html +0 -100
  66. package/coverage/html/backend/src/contracts/meta/status.contract.ts.html +0 -196
  67. package/coverage/html/backend/src/contracts/shared/index.html +0 -116
  68. package/coverage/html/backend/src/contracts/shared/jurisdiction.schema.ts.html +0 -175
  69. package/coverage/html/backend/src/core.ts.html +0 -1342
  70. package/coverage/html/backend/src/handlers/consent/index.html +0 -161
  71. package/coverage/html/backend/src/handlers/consent/index.ts.html +0 -112
  72. package/coverage/html/backend/src/handlers/consent/post.handler.ts.html +0 -904
  73. package/coverage/html/backend/src/handlers/consent/show-banner.handler.ts.html +0 -532
  74. package/coverage/html/backend/src/handlers/consent/verify.handler.ts.html +0 -1000
  75. package/coverage/html/backend/src/handlers/meta/index.html +0 -131
  76. package/coverage/html/backend/src/handlers/meta/index.ts.html +0 -100
  77. package/coverage/html/backend/src/handlers/meta/status.handler.ts.html +0 -226
  78. package/coverage/html/backend/src/index.html +0 -161
  79. package/coverage/html/backend/src/init.ts.html +0 -1018
  80. package/coverage/html/backend/src/middleware/cors/cors.ts.html +0 -661
  81. package/coverage/html/backend/src/middleware/cors/index.html +0 -146
  82. package/coverage/html/backend/src/middleware/cors/is-origin-trusted.ts.html +0 -463
  83. package/coverage/html/backend/src/middleware/cors/process-cors.ts.html +0 -358
  84. package/coverage/html/backend/src/middleware/openapi/config.ts.html +0 -160
  85. package/coverage/html/backend/src/middleware/openapi/handlers.ts.html +0 -481
  86. package/coverage/html/backend/src/middleware/openapi/index.html +0 -131
  87. package/coverage/html/backend/src/pkgs/api-router/hooks/index.html +0 -116
  88. package/coverage/html/backend/src/pkgs/api-router/hooks/processor.ts.html +0 -544
  89. package/coverage/html/backend/src/pkgs/api-router/index.html +0 -116
  90. package/coverage/html/backend/src/pkgs/api-router/telemetry.ts.html +0 -334
  91. package/coverage/html/backend/src/pkgs/api-router/utils/index.html +0 -116
  92. package/coverage/html/backend/src/pkgs/api-router/utils/ip.ts.html +0 -361
  93. package/coverage/html/backend/src/pkgs/data-model/fields/field-factory.ts.html +0 -709
  94. package/coverage/html/backend/src/pkgs/data-model/fields/id-generator.ts.html +0 -256
  95. package/coverage/html/backend/src/pkgs/data-model/fields/index.html +0 -161
  96. package/coverage/html/backend/src/pkgs/data-model/fields/superjson-utils.ts.html +0 -136
  97. package/coverage/html/backend/src/pkgs/data-model/fields/zod-fields.ts.html +0 -496
  98. package/coverage/html/backend/src/pkgs/data-model/hooks/create-hooks.ts.html +0 -349
  99. package/coverage/html/backend/src/pkgs/data-model/hooks/index.html +0 -176
  100. package/coverage/html/backend/src/pkgs/data-model/hooks/update-hooks.ts.html +0 -358
  101. package/coverage/html/backend/src/pkgs/data-model/hooks/update-many-hooks.ts.html +0 -613
  102. package/coverage/html/backend/src/pkgs/data-model/hooks/utils.ts.html +0 -538
  103. package/coverage/html/backend/src/pkgs/data-model/hooks/with-hooks-factory.ts.html +0 -289
  104. package/coverage/html/backend/src/pkgs/db-adapters/adapter-factory.ts.html +0 -289
  105. package/coverage/html/backend/src/pkgs/db-adapters/adapters/drizzle-adapter/drizzle-adapter.ts.html +0 -2203
  106. package/coverage/html/backend/src/pkgs/db-adapters/adapters/drizzle-adapter/index.html +0 -116
  107. package/coverage/html/backend/src/pkgs/db-adapters/adapters/index.html +0 -116
  108. package/coverage/html/backend/src/pkgs/db-adapters/adapters/kysely-adapter/dialect.ts.html +0 -670
  109. package/coverage/html/backend/src/pkgs/db-adapters/adapters/kysely-adapter/index.html +0 -131
  110. package/coverage/html/backend/src/pkgs/db-adapters/adapters/kysely-adapter/kysely-adapter.ts.html +0 -3634
  111. package/coverage/html/backend/src/pkgs/db-adapters/adapters/kysely-adapter/tests/index.html +0 -116
  112. package/coverage/html/backend/src/pkgs/db-adapters/adapters/kysely-adapter/tests/test-utils.ts.html +0 -1417
  113. package/coverage/html/backend/src/pkgs/db-adapters/adapters/memory-adapter/index.html +0 -116
  114. package/coverage/html/backend/src/pkgs/db-adapters/adapters/memory-adapter/memory-adapter.ts.html +0 -2071
  115. package/coverage/html/backend/src/pkgs/db-adapters/adapters/prisma-adapter/index.html +0 -116
  116. package/coverage/html/backend/src/pkgs/db-adapters/adapters/prisma-adapter/prisma-adapter.ts.html +0 -1834
  117. package/coverage/html/backend/src/pkgs/db-adapters/adapters/test.ts.html +0 -316
  118. package/coverage/html/backend/src/pkgs/db-adapters/index.html +0 -131
  119. package/coverage/html/backend/src/pkgs/db-adapters/utils.ts.html +0 -238
  120. package/coverage/html/backend/src/pkgs/migrations/get-migration.ts.html +0 -343
  121. package/coverage/html/backend/src/pkgs/migrations/get-schema/get-schema.ts.html +0 -217
  122. package/coverage/html/backend/src/pkgs/migrations/get-schema/index.html +0 -146
  123. package/coverage/html/backend/src/pkgs/migrations/get-schema/process-fields.ts.html +0 -280
  124. package/coverage/html/backend/src/pkgs/migrations/get-schema/process-tables.ts.html +0 -289
  125. package/coverage/html/backend/src/pkgs/migrations/index.html +0 -176
  126. package/coverage/html/backend/src/pkgs/migrations/migration-builders.ts.html +0 -595
  127. package/coverage/html/backend/src/pkgs/migrations/migration-execution.ts.html +0 -301
  128. package/coverage/html/backend/src/pkgs/migrations/schema-comparison.ts.html +0 -694
  129. package/coverage/html/backend/src/pkgs/migrations/type-mapping.ts.html +0 -817
  130. package/coverage/html/backend/src/pkgs/results/core/error-class.ts.html +0 -976
  131. package/coverage/html/backend/src/pkgs/results/core/error-codes.ts.html +0 -703
  132. package/coverage/html/backend/src/pkgs/results/core/index.html +0 -146
  133. package/coverage/html/backend/src/pkgs/results/core/tracing.ts.html +0 -280
  134. package/coverage/html/backend/src/pkgs/results/create-telemetry-options.ts.html +0 -271
  135. package/coverage/html/backend/src/pkgs/results/index.html +0 -131
  136. package/coverage/html/backend/src/pkgs/results/orpc-error-handler.ts.html +0 -496
  137. package/coverage/html/backend/src/pkgs/results/results/index.html +0 -131
  138. package/coverage/html/backend/src/pkgs/results/results/recovery-utils.ts.html +0 -628
  139. package/coverage/html/backend/src/pkgs/results/results/result-helpers.ts.html +0 -1234
  140. package/coverage/html/backend/src/pkgs/utils/env.ts.html +0 -337
  141. package/coverage/html/backend/src/pkgs/utils/index.html +0 -146
  142. package/coverage/html/backend/src/pkgs/utils/logger.ts.html +0 -199
  143. package/coverage/html/backend/src/pkgs/utils/url.ts.html +0 -400
  144. package/coverage/html/backend/src/router.ts.html +0 -109
  145. package/coverage/html/backend/src/schema/audit-log/index.html +0 -146
  146. package/coverage/html/backend/src/schema/audit-log/registry.ts.html +0 -436
  147. package/coverage/html/backend/src/schema/audit-log/schema.ts.html +0 -223
  148. package/coverage/html/backend/src/schema/audit-log/table.ts.html +0 -640
  149. package/coverage/html/backend/src/schema/consent/index.html +0 -146
  150. package/coverage/html/backend/src/schema/consent/registry.ts.html +0 -616
  151. package/coverage/html/backend/src/schema/consent/schema.ts.html +0 -238
  152. package/coverage/html/backend/src/schema/consent/table.ts.html +0 -748
  153. package/coverage/html/backend/src/schema/consent-policy/index.html +0 -146
  154. package/coverage/html/backend/src/schema/consent-policy/registry.ts.html +0 -1063
  155. package/coverage/html/backend/src/schema/consent-policy/schema.ts.html +0 -265
  156. package/coverage/html/backend/src/schema/consent-policy/table.ts.html +0 -535
  157. package/coverage/html/backend/src/schema/consent-purpose/index.html +0 -146
  158. package/coverage/html/backend/src/schema/consent-purpose/registry.ts.html +0 -589
  159. package/coverage/html/backend/src/schema/consent-purpose/schema.ts.html +0 -259
  160. package/coverage/html/backend/src/schema/consent-purpose/table.ts.html +0 -547
  161. package/coverage/html/backend/src/schema/consent-record/index.html +0 -131
  162. package/coverage/html/backend/src/schema/consent-record/schema.ts.html +0 -211
  163. package/coverage/html/backend/src/schema/consent-record/table.ts.html +0 -457
  164. package/coverage/html/backend/src/schema/create-registry.ts.html +0 -148
  165. package/coverage/html/backend/src/schema/definition.ts.html +0 -685
  166. package/coverage/html/backend/src/schema/domain/index.html +0 -146
  167. package/coverage/html/backend/src/schema/domain/registry.ts.html +0 -973
  168. package/coverage/html/backend/src/schema/domain/schema.ts.html +0 -214
  169. package/coverage/html/backend/src/schema/domain/table.ts.html +0 -496
  170. package/coverage/html/backend/src/schema/index.html +0 -146
  171. package/coverage/html/backend/src/schema/schemas.ts.html +0 -166
  172. package/coverage/html/backend/src/schema/subject/index.html +0 -146
  173. package/coverage/html/backend/src/schema/subject/registry.ts.html +0 -973
  174. package/coverage/html/backend/src/schema/subject/schema.ts.html +0 -208
  175. package/coverage/html/backend/src/schema/subject/table.ts.html +0 -499
  176. package/coverage/html/backend/src/server.ts.html +0 -463
  177. package/coverage/html/backend/src/testing/contract-testing.ts.html +0 -1396
  178. package/coverage/html/backend/src/testing/index.html +0 -116
  179. package/coverage/html/base.css +0 -224
  180. package/coverage/html/block-navigation.js +0 -87
  181. package/coverage/html/favicon.png +0 -0
  182. package/coverage/html/index.html +0 -656
  183. package/coverage/html/prettify.css +0 -1
  184. package/coverage/html/prettify.js +0 -2
  185. package/coverage/html/sort-arrow-sprite.png +0 -0
  186. package/coverage/html/sorter.js +0 -196
@@ -1,8 +1,7 @@
1
1
  import { getWithHooks } from '~/pkgs/data-model';
2
2
  import type { Where } from '~/pkgs/db-adapters';
3
- import type { GenericEndpointContext, RegistryContext } from '~/pkgs/types';
4
-
5
3
  import { DoubleTieError, ERROR_CODES } from '~/pkgs/results';
4
+ import type { GenericEndpointContext, RegistryContext } from '~/pkgs/types';
6
5
  import { validateEntityOutput } from '../definition';
7
6
  import type { ConsentPolicy, PolicyType } from './schema';
8
7
 
@@ -31,12 +30,24 @@ import type { ConsentPolicy, PolicyType } from './schema';
31
30
  */
32
31
  async function generatePolicyPlaceholder(name: string, date: Date) {
33
32
  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()}`;
34
- const encoder = new TextEncoder();
35
- const data = encoder.encode(content);
36
- const hashBuffer = await crypto.subtle.digest('SHA-256', data);
37
- const contentHash = Array.from(new Uint8Array(hashBuffer))
38
- .map((b) => b.toString(16).padStart(2, '0'))
39
- .join('');
33
+
34
+ let contentHash: string;
35
+ try {
36
+ // Use Web Crypto API which is available in both browsers and edge environments
37
+ const encoder = new TextEncoder();
38
+ const data = encoder.encode(content);
39
+ const hashBuffer = await crypto.subtle.digest('SHA-256', data);
40
+ contentHash = Array.from(new Uint8Array(hashBuffer))
41
+ .map((b) => b.toString(16).padStart(2, '0'))
42
+ .join('');
43
+ } catch (error) {
44
+ throw new DoubleTieError('Failed to generate policy content hash', {
45
+ code: ERROR_CODES.INTERNAL_SERVER_ERROR,
46
+ status: 500,
47
+ cause: error instanceof Error ? error : new Error(String(error)),
48
+ });
49
+ }
50
+
40
51
  return { content, contentHash };
41
52
  }
42
53
 
@@ -271,55 +282,67 @@ export function policyRegistry({ adapter, ...ctx }: RegistryContext) {
271
282
  // Use a transaction to prevent race conditions
272
283
  return await adapter.transaction({
273
284
  callback: async (txAdapter) => {
274
- const now = new Date();
275
- const txRegistry = policyRegistry({
276
- adapter: txAdapter,
277
- ...ctx,
278
- });
285
+ try {
286
+ const now = new Date();
287
+ const txRegistry = policyRegistry({
288
+ adapter: txAdapter,
289
+ ...ctx,
290
+ });
279
291
 
280
- // Find latest policy with exact name match directly from database
281
- const rawLatestPolicy = await txAdapter.findOne({
282
- model: 'consentPolicy',
283
- where: [
284
- { field: 'isActive', value: true },
285
- {
286
- field: 'type',
287
- value: type,
292
+ // Find latest policy with exact name match directly from database
293
+ const rawLatestPolicy = await txAdapter.findOne({
294
+ model: 'consentPolicy',
295
+ where: [
296
+ { field: 'isActive', value: true },
297
+ {
298
+ field: 'type',
299
+ value: type,
300
+ },
301
+ ],
302
+ sortBy: {
303
+ field: 'effectiveDate',
304
+ direction: 'desc',
288
305
  },
289
- ],
290
- sortBy: {
291
- field: 'effectiveDate',
292
- direction: 'desc',
293
- },
294
- });
306
+ });
295
307
 
296
- const latestPolicy = rawLatestPolicy
297
- ? validateEntityOutput(
298
- 'consentPolicy',
299
- rawLatestPolicy,
300
- ctx.options
301
- )
302
- : null;
308
+ const latestPolicy = rawLatestPolicy
309
+ ? validateEntityOutput(
310
+ 'consentPolicy',
311
+ rawLatestPolicy,
312
+ ctx.options
313
+ )
314
+ : null;
303
315
 
304
- if (latestPolicy) {
305
- return latestPolicy;
306
- }
316
+ if (latestPolicy) {
317
+ return latestPolicy;
318
+ }
307
319
 
308
- // Generate policy content and hash
309
- const { content: defaultContent, contentHash } =
310
- await generatePolicyPlaceholder(type, now);
320
+ // Generate policy content and hash
321
+ const { content: defaultContent, contentHash } =
322
+ await generatePolicyPlaceholder(type, now);
311
323
 
312
- return txRegistry.createConsentPolicy({
313
- version: '1.0.0',
314
- type,
315
- name: type,
316
- effectiveDate: now,
317
- content: defaultContent,
318
- contentHash,
319
- isActive: true,
320
- updatedAt: now,
321
- expirationDate: null,
322
- });
324
+ return txRegistry.createConsentPolicy({
325
+ version: '1.0.0',
326
+ type,
327
+ name: type,
328
+ effectiveDate: now,
329
+ content: defaultContent,
330
+ contentHash,
331
+ isActive: true,
332
+ updatedAt: now,
333
+ expirationDate: null,
334
+ });
335
+ } catch (error) {
336
+ // Log the error for debugging purposes
337
+ ctx.logger.error('Error in findOrCreatePolicy transaction:', error);
338
+
339
+ // Rethrow as a DoubleTieError with appropriate context
340
+ throw new DoubleTieError('Failed to find or create policy', {
341
+ code: ERROR_CODES.INTERNAL_SERVER_ERROR,
342
+ status: 500,
343
+ cause: error instanceof Error ? error : new Error(String(error)),
344
+ });
345
+ }
323
346
  },
324
347
  });
325
348
  },
@@ -41,8 +41,8 @@ export const purposeSchema = z.object({
41
41
  name: z.string(),
42
42
  description: z.string(),
43
43
  isEssential: z.boolean().default(false),
44
- dataCategory: z.string().optional(),
45
- legalBasis: z.string().optional(),
44
+ dataCategory: z.string().nullish(),
45
+ legalBasis: z.string().nullish(),
46
46
  isActive: z.boolean().default(true),
47
47
  createdAt: z.date().default(() => new Date()),
48
48
  updatedAt: z.date().default(() => new Date()),
@@ -1,7 +0,0 @@
1
-
2
- 
3
- > @c15t/backend@1.2.0-canary.9 fmt /Users/christopherburns/glados/k/c15t/packages/backend
4
- > pnpm biome format --write . && biome check --formatter-enabled=false --linter-enabled=false --organize-imports-enabled=true --write
5
-
6
- Formatted 162 files in 114ms. Fixed 1 file.
7
- Checked 162 files in 16ms. No fixes applied.
@@ -1,426 +0,0 @@
1
-
2
- 
3
- > @c15t/backend@1.2.0-canary.5 test /Users/christopherburns/glados/k/c15t/packages/backend
4
- > vitest run
5
-
6
- [?25l
7
-  RUN  v3.1.1 /Users/christopherburns/glados/k/c15t/packages/backend
8
- Coverage enabled with istanbul
9
-
10
- [?2026h
11
-  ❯ src/middleware/cors/cors.test.ts [queued]
12
-
13
-  Test Files 0 passed (17)
14
-  Tests 0 passed (0)
15
-  Start at 20:21:16
16
-  Duration 506ms
17
- [?2026l[?2026h
18
-  ❯ src/contracts/consent/post.contract.test.ts [queued]
19
-  ❯ src/contracts/consent/show-banner.contract.test.ts [queued]
20
-  ❯ src/contracts/consent/verify.contract.test.ts [queued]
21
-  ❯ src/contracts/meta/status.contract.test.ts [queued]
22
-  ❯ src/middleware/cors/cors.test.ts [queued]
23
-  ❯ src/pkgs/api-router/hooks/__tests__/processor.test.ts 0/6
24
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/postgres.test.ts [queued]
25
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/sqlite.test.ts [queued]
26
-  ❯ src/pkgs/results/__tests__/error-class.test.ts [queued]
27
-  ❯ src/pkgs/results/__tests__/recovery-utils.test.ts [queued]
28
-  ❯ src/pkgs/results/__tests__/result-helpers.test.ts [queued]
29
-
30
-  Test Files 0 passed (17)
31
-  Tests 0 passed (6)
32
-  Start at 20:21:16
33
-  Duration 977ms
34
- [?2026l[?2026h
35
-  ❯ src/contracts/consent/post.contract.test.ts [queued]
36
-  ❯ src/contracts/consent/show-banner.contract.test.ts [queued]
37
-  ❯ src/contracts/consent/verify.contract.test.ts [queued]
38
-  ❯ src/contracts/meta/status.contract.test.ts [queued]
39
-  ❯ src/middleware/cors/cors.test.ts [queued]
40
-  ❯ src/pkgs/api-router/hooks/__tests__/processor.test.ts 1/6
41
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/postgres.test.ts [queued]
42
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/sqlite.test.ts [queued]
43
-  ❯ src/pkgs/results/__tests__/error-class.test.ts [queued]
44
-  ❯ src/pkgs/results/__tests__/recovery-utils.test.ts [queued]
45
-  ❯ src/pkgs/results/__tests__/result-helpers.test.ts [queued]
46
-
47
-  Test Files 0 passed (17)
48
-  Tests 1 passed (6)
49
-  Start at 20:21:16
50
-  Duration 1.12s
51
- [?2026l[?2026h ✓ src/pkgs/api-router/hooks/__tests__/processor.test.ts (6 tests) 26ms
52
-
53
-  ❯ src/contracts/consent/post.contract.test.ts [queued]
54
-  ❯ src/contracts/consent/show-banner.contract.test.ts 1/9
55
-  ❯ src/contracts/consent/verify.contract.test.ts [queued]
56
-  ❯ src/contracts/meta/status.contract.test.ts 0/21
57
-  ❯ src/middleware/cors/cors.test.ts [queued]
58
-  ❯ src/pkgs/api-router/hooks/__tests__/processor.test.ts 6/6
59
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/postgres.test.ts [queued]
60
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/sqlite.test.ts [queued]
61
-  ❯ src/pkgs/results/__tests__/error-class.test.ts [queued]
62
-  ❯ src/pkgs/results/__tests__/recovery-utils.test.ts [queued]
63
-  ❯ src/pkgs/results/__tests__/result-helpers.test.ts [queued]
64
-
65
-  Test Files 1 passed (17)
66
-  Tests 7 passed (36)
67
-  Start at 20:21:16
68
-  Duration 1.45s
69
- [?2026l[?2026h ✓ src/contracts/consent/show-banner.contract.test.ts (9 tests) 7ms
70
- ✓ src/contracts/meta/status.contract.test.ts (21 tests) 10ms
71
-
72
-  ❯ src/contracts/consent/post.contract.test.ts [queued]
73
-  ❯ src/contracts/consent/show-banner.contract.test.ts 9/9
74
-  ❯ src/contracts/consent/verify.contract.test.ts [queued]
75
-  ❯ src/contracts/meta/status.contract.test.ts 21/21
76
-  ❯ src/middleware/cors/cors.test.ts [queued]
77
-  ❯ src/pkgs/api-router/hooks/__tests__/processor.test.ts 6/6
78
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/postgres.test.ts [queued]
79
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/sqlite.test.ts [queued]
80
-  ❯ src/pkgs/results/__tests__/error-class.test.ts 0/12
81
-  ❯ src/pkgs/results/__tests__/recovery-utils.test.ts 0/7
82
-  ❯ src/pkgs/results/__tests__/result-helpers.test.ts [queued]
83
-
84
-  Test Files 3 passed (17)
85
-  Tests 36 passed (55)
86
-  Start at 20:21:16
87
-  Duration 1.55s
88
- [?2026l[?2026h ✓ src/pkgs/results/__tests__/error-class.test.ts (12 tests) 23ms
89
- ✓ src/pkgs/results/__tests__/recovery-utils.test.ts (7 tests) 3ms
90
-
91
-  ❯ src/contracts/consent/post.contract.test.ts [queued]
92
-  ❯ src/contracts/consent/verify.contract.test.ts [queued]
93
-  ❯ src/contracts/meta/status.contract.test.ts 21/21
94
-  ❯ src/handlers/consent/show-banner.handler.test.ts [queued]
95
-  ❯ src/middleware/cors/cors.test.ts [queued]
96
-  ❯ src/middleware/cors/is-origin-trusted.test.ts [queued]
97
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/postgres.test.ts [queued]
98
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/sqlite.test.ts [queued]
99
-  ❯ src/pkgs/results/__tests__/error-class.test.ts 12/12
100
-  ❯ src/pkgs/results/__tests__/recovery-utils.test.ts 7/7
101
-  ❯ src/pkgs/results/__tests__/result-helpers.test.ts 0/11
102
-
103
-  Test Files 5 passed (17)
104
-  Tests 55 passed (66)
105
-  Start at 20:21:16
106
-  Duration 1.89s
107
- [?2026l[?2026h ✓ src/pkgs/results/__tests__/result-helpers.test.ts (11 tests) 5ms
108
-
109
-  ❯ src/contracts/consent/post.contract.test.ts [queued]
110
-  ❯ src/contracts/consent/verify.contract.test.ts [queued]
111
-  ❯ src/handlers/consent/show-banner.handler.test.ts [queued]
112
-  ❯ src/middleware/cors/cors.test.ts [queued]
113
-  ❯ src/middleware/cors/is-origin-trusted.test.ts [queued]
114
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/postgres.test.ts [queued]
115
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/sqlite.test.ts [queued]
116
-  ❯ src/pkgs/results/__tests__/error-class.test.ts 12/12
117
-  ❯ src/pkgs/results/__tests__/neverthrow-integration.test.ts [queued]
118
-  ❯ src/pkgs/results/__tests__/recovery-utils.test.ts 7/7
119
-
120
-  Test Files 6 passed (17)
121
-  Tests 66 passed (66)
122
-  Start at 20:21:16
123
-  Duration 1.99s
124
- [?2026l[?2026h ✓ src/middleware/cors/is-origin-trusted.test.ts (11 tests) 6ms
125
- ✓ src/handlers/consent/show-banner.handler.test.ts (9 tests) 18ms
126
-
127
-  ❯ src/contracts/consent/post.contract.test.ts [queued]
128
-  ❯ src/contracts/consent/verify.contract.test.ts [queued]
129
-  ❯ src/middleware/cors/cors.test.ts [queued]
130
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/postgres.test.ts [queued]
131
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/sqlite.test.ts [queued]
132
-  ❯ src/pkgs/results/__tests__/error-codes.test.ts 1/6
133
-  ❯ src/pkgs/results/__tests__/neverthrow-integration.test.ts [queued]
134
-  ❯ src/pkgs/results/__tests__/recovery-utils.test.ts 7/7
135
-
136
-  Test Files 8 passed (17)
137
-  Tests 87 passed (92)
138
-  Start at 20:21:16
139
-  Duration 2.09s
140
- [?2026l[?2026h ✓ src/pkgs/results/__tests__/error-codes.test.ts (6 tests) 3ms
141
-
142
-  ❯ src/contracts/consent/post.contract.test.ts [queued]
143
-  ❯ src/contracts/consent/verify.contract.test.ts [queued]
144
-  ❯ src/middleware/cors/cors.test.ts [queued]
145
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/postgres.test.ts [queued]
146
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/sqlite.test.ts [queued]
147
-  ❯ src/pkgs/results/__tests__/neverthrow-integration.test.ts 0/5
148
-  ❯ src/pkgs/results/__tests__/recovery-utils.test.ts 7/7
149
-
150
-  Test Files 9 passed (17)
151
-  Tests 92 passed (97)
152
-  Start at 20:21:16
153
-  Duration 2.19s
154
- [?2026l[?2026h ✓ src/pkgs/results/__tests__/neverthrow-integration.test.ts (5 tests) 8ms
155
-
156
-  ❯ src/contracts/consent/index.test.ts [queued]
157
-  ❯ src/contracts/consent/post.contract.test.ts [queued]
158
-  ❯ src/contracts/consent/verify.contract.test.ts [queued]
159
-  ❯ src/contracts/meta/index.test.ts 0/5
160
-  ❯ src/middleware/cors/cors.test.ts [queued]
161
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/postgres.test.ts [queued]
162
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/sqlite.test.ts [queued]
163
-
164
-  Test Files 10 passed (17)
165
-  Tests 97 passed (102)
166
-  Start at 20:21:16
167
-  Duration 2.29s
168
- [?2026l[?2026h ✓ src/contracts/meta/index.test.ts (5 tests) 4ms
169
-
170
-  ❯ src/contracts/consent/index.test.ts [queued]
171
-  ❯ src/contracts/consent/post.contract.test.ts [queued]
172
-  ❯ src/contracts/consent/verify.contract.test.ts 0/17
173
-  ❯ src/middleware/cors/cors.test.ts [queued]
174
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/postgres.test.ts [queued]
175
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/sqlite.test.ts [queued]
176
-
177
-  Test Files 11 passed (17)
178
-  Tests 102 passed (119)
179
-  Start at 20:21:16
180
-  Duration 2.60s
181
- [?2026l[?2026h ✓ src/contracts/consent/verify.contract.test.ts (17 tests) 8ms
182
- ✓ src/contracts/consent/index.test.ts (5 tests) 3ms
183
-
184
-  ❯ src/contracts/consent/post.contract.test.ts 1/41
185
-  ❯ src/middleware/cors/cors.test.ts [queued]
186
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/postgres.test.ts [queued]
187
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/sqlite.test.ts [queued]
188
-
189
-  Test Files 13 passed (17)
190
-  Tests 125 passed (165)
191
-  Start at 20:21:16
192
-  Duration 2.80s
193
- [?2026l[?2026h ✓ src/contracts/consent/post.contract.test.ts (41 tests) 18ms
194
-
195
-  ❯ src/middleware/cors/cors.test.ts [queued]
196
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/postgres.test.ts [queued]
197
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/sqlite.test.ts [queued]
198
-
199
-  Test Files 14 passed (17)
200
-  Tests 165 passed (165)
201
-  Start at 20:21:16
202
-  Duration 2.90s
203
- [?2026l[?2026h
204
-  ❯ src/middleware/cors/cors.test.ts [queued]
205
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/postgres.test.ts 0/9
206
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/sqlite.test.ts [queued]
207
-
208
-  Test Files 14 passed (17)
209
-  Tests 165 passed (174)
210
-  Start at 20:21:16
211
-  Duration 3.10s
212
- [?2026l[?2026hstdout | src/pkgs/db-adapters/adapters/kysely-adapter/tests/sqlite.test.ts > Kysely Adapter Tests > SQLite Tests
213
-  INFO [c15t] Creating table subject with fields: isIdentified, externalId, identityProvider, lastIpAddress, createdAt, updatedAt, subjectTimezone
214
- INFO [c15t] Adding column isIdentified (fieldName: isIdentified) to table subject
215
- INFO [c15t] Adding column externalId (fieldName: externalId) to table subject
216
- INFO [c15t] Adding column identityProvider (fieldName: identityProvider) to table subject
217
- INFO [c15t] Adding column lastIpAddress (fieldName: lastIpAddress) to table subject
218
- INFO [c15t] Adding column createdAt (fieldName: createdAt) to table subject
219
- INFO [c15t] Adding column updatedAt (fieldName: updatedAt) to table subject
220
- INFO [c15t] Adding column subjectTimezone (fieldName: subjectTimezone) to table subject
221
- INFO [c15t] SQL for table subject:
222
- create table "subject" ("id" text not null primary key, "isIdentified" integer not null, "externalId" text, "identityProvider" text, "lastIpAddress" text, "createdAt" date not null, "updatedAt" date not null, "subjectTimezone" text)
223
- INFO [c15t] Creating table consentPurpose with fields: code, name, description, isEssential, dataCategory, legalBasis, isActive, createdAt, updatedAt
224
- INFO [c15t] Adding column code (fieldName: code) to table consentPurpose
225
- INFO [c15t] Adding column name (fieldName: name) to table consentPurpose
226
- INFO [c15t] Adding column description (fieldName: description) to table consentPurpose
227
- INFO [c15t] Adding column isEssential (fieldName: isEssential) to table consentPurpose
228
- INFO [c15t] Adding column dataCategory (fieldName: dataCategory) to table consentPurpose
229
- INFO [c15t] Adding column legalBasis (fieldName: legalBasis) to table consentPurpose
230
- INFO [c15t] Adding column isActive (fieldName: isActive) to table consentPurpose
231
- INFO [c15t] Adding column createdAt (fieldName: createdAt) to table consentPurpose
232
- INFO [c15t] Adding column updatedAt (fieldName: updatedAt) to table consentPurpose
233
- INFO [c15t] SQL for table consentPurpose:
234
- create table "consentPurpose" ("id" text not null primary key, "code" text not null, "name" text not null, "description" text not null, "isEssential" integer not null, "dataCategory" text, "legalBasis" text, "isActive" integer not null, "createdAt" date not null, "updatedAt" date not null)
235
- INFO [c15t] Creating table domain with fields: name, description, allowedOrigins, isVerified, isActive, createdAt, updatedAt
236
- INFO [c15t] Adding column name (fieldName: name) to table domain
237
- INFO [c15t] Adding column description (fieldName: description) to table domain
238
- INFO [c15t] Adding column allowedOrigins (fieldName: allowedOrigins) to table domain
239
- INFO [c15t] Adding column isVerified (fieldName: isVerified) to table domain
240
- INFO [c15t] Adding column isActive (fieldName: isActive) to table domain
241
- INFO [c15t] Adding column createdAt (fieldName: createdAt) to table domain
242
- INFO [c15t] Adding column updatedAt (fieldName: updatedAt) to table domain
243
- INFO [c15t] SQL for table domain:
244
- create table "domain" ("id" text not null primary key, "name" text not null unique, "description" text, "allowedOrigins" text, "isVerified" integer not null, "isActive" integer not null, "createdAt" date not null, "updatedAt" date)
245
- INFO [c15t] Creating table consentPolicy with fields: version, type, name, effectiveDate, expirationDate, content, contentHash, isActive, createdAt
246
- INFO [c15t] Adding column version (fieldName: version) to table consentPolicy
247
- INFO [c15t] Adding column type (fieldName: type) to table consentPolicy
248
- INFO [c15t] Adding column name (fieldName: name) to table consentPolicy
249
- INFO [c15t] Adding column effectiveDate (fieldName: effectiveDate) to table consentPolicy
250
- INFO [c15t] Adding column expirationDate (fieldName: expirationDate) to table consentPolicy
251
- INFO [c15t] Adding column content (fieldName: content) to table consentPolicy
252
- INFO [c15t] Adding column contentHash (fieldName: contentHash) to table consentPolicy
253
- INFO [c15t] Adding column isActive (fieldName: isActive) to table consentPolicy
254
- INFO [c15t] Adding column createdAt (fieldName: createdAt) to table consentPolicy
255
- INFO [c15t] SQL for table consentPolicy:
256
- create table "consentPolicy" ("id" text not null primary key, "version" text not null, "type" text not null, "name" text not null, "effectiveDate" date not null, "expirationDate" date, "content" text not null, "contentHash" text not null, "isActive" integer not null, "createdAt" date not null)
257
- INFO [c15t] Creating table consent with fields: subjectId, domainId, purposeIds, metadata, policyId, ipAddress, userAgent, status, withdrawalReason, givenAt, validUntil, isActive
258
- INFO [c15t] Adding column subjectId (fieldName: subjectId) to table consent
259
- INFO [c15t] Adding column domainId (fieldName: domainId) to table consent
260
- INFO [c15t] Adding column purposeIds (fieldName: purposeIds) to table consent
261
- INFO [c15t] Adding column metadata (fieldName: metadata) to table consent
262
- INFO [c15t] Adding column policyId (fieldName: policyId) to table consent
263
- INFO [c15t] Adding column ipAddress (fieldName: ipAddress) to table consent
264
- INFO [c15t] Adding column userAgent (fieldName: userAgent) to table consent
265
- INFO [c15t] Adding column status (fieldName: status) to table consent
266
- INFO [c15t] Adding column withdrawalReason (fieldName: withdrawalReason) to table consent
267
- INFO [c15t] Adding column givenAt (fieldName: givenAt) to table consent
268
- INFO [c15t] Adding column validUntil (fieldName: validUntil) to table consent
269
- INFO [c15t] Adding column isActive (fieldName: isActive) to table consent
270
- INFO [c15t] SQL for table consent:
271
- create table "consent" ("id" text not null primary key, "subjectId" text not null references "subject" ("id"), "domainId" text not null references "domain" ("id"), "purposeIds" text, "metadata" text, "policyId" text references "consentPolicy" ("id"), "ipAddress" text, "userAgent" text, "status" text not null, "withdrawalReason" text, "givenAt" date not null, "validUntil" date, "isActive" integer not null)
272
- INFO [c15t] Creating table consentRecord with fields: subjectId, consentId, actionType, details, createdAt
273
- INFO [c15t] Adding column subjectId (fieldName: subjectId) to table consentRecord
274
- INFO [c15t] Adding column consentId (fieldName: consentId) to table consentRecord
275
- INFO [c15t] Adding column actionType (fieldName: actionType) to table consentRecord
276
- INFO [c15t] Adding column details (fieldName: details) to table consentRecord
277
- INFO [c15t] Adding column createdAt (fieldName: createdAt) to table consentRecord
278
- INFO [c15t] SQL for table consentRecord:
279
- create table "consentRecord" ("id" text not null primary key, "subjectId" text not null references "subject" ("id"), "consentId" text references "consent" ("id"), "actionType" text not null, "details" text, "createdAt" date not null)
280
- INFO [c15t] Creating table auditLog with fields: entityType, entityId, actionType, subjectId, ipAddress, userAgent, changes, metadata, createdAt, eventTimezone
281
- INFO [c15t] Adding column entityType (fieldName: entityType) to table auditLog
282
- INFO [c15t] Adding column entityId (fieldName: entityId) to table auditLog
283
- INFO [c15t] Adding column actionType (fieldName: actionType) to table auditLog
284
- INFO [c15t] Adding column subjectId (fieldName: subjectId) to table auditLog
285
- INFO [c15t] Adding column ipAddress (fieldName: ipAddress) to table auditLog
286
- INFO [c15t] Adding column userAgent (fieldName: userAgent) to table auditLog
287
- INFO [c15t] Adding column changes (fieldName: changes) to table auditLog
288
- INFO [c15t] Adding column metadata (fieldName: metadata) to table auditLog
289
- INFO [c15t] Adding column createdAt (fieldName: createdAt) to table auditLog
290
- INFO [c15t] Adding column eventTimezone (fieldName: eventTimezone) to table auditLog
291
- INFO [c15t] SQL for table auditLog:
292
- create table "auditLog" ("id" text not null primary key, "entityType" text not null, "entityId" text not null, "actionType" text not null, "subjectId" text references "subject" ("id"), "ipAddress" text, "userAgent" text, "changes" text, "metadata" text, "createdAt" date not null, "eventTimezone" text not null)
293
-
294
- ✓ src/pkgs/db-adapters/adapters/kysely-adapter/tests/sqlite.test.ts (9 tests | 1 skipped) 25ms
295
-
296
-  ❯ src/middleware/cors/cors.test.ts 0/23
297
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/postgres.test.ts 0/9
298
-
299
-  Test Files 15 passed (17)
300
-  Tests 173 passed | 1 skipped (206)
301
-  Start at 20:21:16
302
-  Duration 3.41s
303
- [?2026l[?2026h
304
-  ❯ src/middleware/cors/cors.test.ts 1/23
305
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/postgres.test.ts 0/9
306
-
307
-  Test Files 15 passed (17)
308
-  Tests 174 passed | 1 skipped (206)
309
-  Start at 20:21:16
310
-  Duration 3.52s
311
- [?2026l[?2026h ❯ src/middleware/cors/cors.test.ts (23 tests | 2 failed) 48ms
312
- ✓ C15T CORS Configuration > Wildcard Origin Configuration > should allow any origin when trustedOrigins includes "*" 18ms
313
- ✓ C15T CORS Configuration > Wildcard Origin Configuration > should handle requests without origin header 1ms
314
- ✓ C15T CORS Configuration > Specific Origin Configuration > should allow requests from trusted origins 2ms
315
- ✓ C15T CORS Configuration > Specific Origin Configuration > should deny requests from untrusted origins 1ms
316
- ✓ C15T CORS Configuration > Default Configuration > should use default CORS settings when no trustedOrigins specified 1ms
317
- ✓ C15T CORS Configuration > Preflight Requests > should handle OPTIONS requests correctly 1ms
318
- ✓ C15T CORS Configuration > Method Support > should support all required HTTP methods 2ms
319
- ✓ C15T CORS Configuration > CORS Blocking Scenarios > should block preflight requests from untrusted origins 1ms
320
- ✓ C15T CORS Configuration > CORS Blocking Scenarios > should block actual requests from untrusted origins 1ms
321
- ✓ C15T CORS Configuration > CORS Blocking Scenarios > should handle preflight requests with missing origin header 1ms
322
- ✓ C15T CORS Configuration > CORS Header Requirements > should include all required CORS headers for preflight requests from trusted origins 1ms
323
- ✓ C15T CORS Configuration > CORS Header Requirements > should NOT include CORS headers for preflight requests from untrusted origins 1ms
324
- ✓ C15T CORS Configuration > CORS Header Requirements > should include all required CORS headers for actual requests from trusted origins 1ms
325
- ✓ C15T CORS Configuration > CORS Header Requirements > should NOT include Access-Control-Allow-Origin for actual requests from untrusted origins 1ms
326
- ✓ C15T CORS Configuration > C15T CORS www/non-www Origin Handling > should allow www origin if non-www is trusted 1ms
327
- ✓ C15T CORS Configuration > C15T CORS www/non-www Origin Handling > should allow non-www origin if www is trusted 2ms
328
- ✓ C15T CORS Configuration > C15T CORS www/non-www Origin Handling > should allow both www and non-www origins if both are trusted 1ms
329
- ✓ C15T CORS Configuration > C15T CORS www/non-www Origin Handling > should deny unrelated origins 0ms
330
-  × C15T CORS Configuration > CORS trustedOrigins normalization and matching > should match http and https with and without www 5ms
331
-  → expected null to be 'http://localhost:3002' // Object.is equality
332
- ✓ C15T CORS Configuration > CORS trustedOrigins normalization and matching > should not match unrelated origins 0ms
333
- ✓ C15T CORS Configuration > CORS trustedOrigins normalization and matching > should match wildcard * 0ms
334
-  × C15T CORS Configuration > CORS trustedOrigins normalization and matching > should match with port 1ms
335
-  → expected null to be 'http://localhost:3002' // Object.is equality
336
- ✓ C15T CORS Configuration > CORS trustedOrigins normalization and matching > should not match if port is different 0ms
337
- stdout | src/pkgs/db-adapters/adapters/kysely-adapter/tests/postgres.test.ts > Kysely Adapter Tests > Postgres Tests
338
-  INFO [c15t] Creating table subject with fields: isIdentified, externalId, identityProvider, lastIpAddress, createdAt, updatedAt, subjectTimezone
339
- INFO [c15t] Adding column isIdentified (fieldName: isIdentified) to table subject
340
- INFO [c15t] Adding column externalId (fieldName: externalId) to table subject
341
- INFO [c15t] Adding column identityProvider (fieldName: identityProvider) to table subject
342
- INFO [c15t] Adding column lastIpAddress (fieldName: lastIpAddress) to table subject
343
- INFO [c15t] Adding column createdAt (fieldName: createdAt) to table subject
344
- INFO [c15t] Adding column updatedAt (fieldName: updatedAt) to table subject
345
- INFO [c15t] Adding column subjectTimezone (fieldName: subjectTimezone) to table subject
346
- INFO [c15t] SQL for table subject:
347
- create table "subject" ("id" text not null primary key, "isIdentified" boolean not null, "externalId" text, "identityProvider" text, "lastIpAddress" text, "createdAt" timestamp not null, "updatedAt" timestamp not null, "subjectTimezone" text)
348
- INFO [c15t] Creating table consentPurpose with fields: code, name, description, isEssential, dataCategory, legalBasis, isActive, createdAt, updatedAt
349
- INFO [c15t] Adding column code (fieldName: code) to table consentPurpose
350
- INFO [c15t] Adding column name (fieldName: name) to table consentPurpose
351
- INFO [c15t] Adding column description (fieldName: description) to table consentPurpose
352
- INFO [c15t] Adding column isEssential (fieldName: isEssential) to table consentPurpose
353
- INFO [c15t] Adding column dataCategory (fieldName: dataCategory) to table consentPurpose
354
- INFO [c15t] Adding column legalBasis (fieldName: legalBasis) to table consentPurpose
355
- INFO [c15t] Adding column isActive (fieldName: isActive) to table consentPurpose
356
- INFO [c15t] Adding column createdAt (fieldName: createdAt) to table consentPurpose
357
- INFO [c15t] Adding column updatedAt (fieldName: updatedAt) to table consentPurpose
358
- INFO [c15t] SQL for table consentPurpose:
359
- create table "consentPurpose" ("id" text not null primary key, "code" text not null, "name" text not null, "description" text not null, "isEssential" boolean not null, "dataCategory" text, "legalBasis" text, "isActive" boolean not null, "createdAt" timestamp not null, "updatedAt" timestamp not null)
360
- INFO [c15t] Creating table domain with fields: name, description, allowedOrigins, isVerified, isActive, createdAt, updatedAt
361
- INFO [c15t] Adding column name (fieldName: name) to table domain
362
- INFO [c15t] Adding column description (fieldName: description) to table domain
363
- INFO [c15t] Adding column allowedOrigins (fieldName: allowedOrigins) to table domain
364
- INFO [c15t] Adding column isVerified (fieldName: isVerified) to table domain
365
- INFO [c15t] Adding column isActive (fieldName: isActive) to table domain
366
- INFO [c15t] Adding column createdAt (fieldName: createdAt) to table domain
367
- INFO [c15t] Adding column updatedAt (fieldName: updatedAt) to table domain
368
- INFO [c15t] SQL for table domain:
369
- create table "domain" ("id" text not null primary key, "name" text not null unique, "description" text, "allowedOrigins" jsonb, "isVerified" boolean not null, "isActive" boolean not null, "createdAt" timestamp not null, "updatedAt" timestamp)
370
- INFO [c15t] Creating table consentPolicy with fields: version, type, name, effectiveDate, expirationDate, content, contentHash, isActive, createdAt
371
- INFO [c15t] Adding column version (fieldName: version) to table consentPolicy
372
- INFO [c15t] Adding column type (fieldName: type) to table consentPolicy
373
- INFO [c15t] Adding column name (fieldName: name) to table consentPolicy
374
- INFO [c15t] Adding column effectiveDate (fieldName: effectiveDate) to table consentPolicy
375
- INFO [c15t] Adding column expirationDate (fieldName: expirationDate) to table consentPolicy
376
- INFO [c15t] Adding column content (fieldName: content) to table consentPolicy
377
- INFO [c15t] Adding column contentHash (fieldName: contentHash) to table consentPolicy
378
- INFO [c15t] Adding column isActive (fieldName: isActive) to table consentPolicy
379
- INFO [c15t] Adding column createdAt (fieldName: createdAt) to table consentPolicy
380
- INFO [c15t] SQL for table consentPolicy:
381
- create table "consentPolicy" ("id" text not null primary key, "version" text not null, "type" text not null, "name" text not null, "effectiveDate" timestamp not null, "expirationDate" timestamp, "content" text not null, "contentHash" text not null, "isActive" boolean not null, "createdAt" timestamp not null)
382
- INFO [c15t] Creating table consent with fields: subjectId, domainId, purposeIds, metadata, policyId, ipAddress, userAgent, status, withdrawalReason, givenAt, validUntil, isActive
383
- INFO [c15t] Adding column subjectId (fieldName: subjectId) to table consent
384
- INFO [c15t] Adding column domainId (fieldName: domainId) to table consent
385
- INFO [c15t] Adding column purposeIds (fieldName: purposeIds) to table consent
386
- INFO [c15t] Adding column metadata (fieldName: metadata) to table consent
387
- INFO [c15t] Adding column policyId (fieldName: policyId) to table consent
388
- INFO [c15t] Adding column ipAddress (fieldName: ipAddress) to table consent
389
- INFO [c15t] Adding column userAgent (fieldName: userAgent) to table consent
390
- INFO [c15t] Adding column status (fieldName: status) to table consent
391
- INFO [c15t] Adding column withdrawalReason (fieldName: withdrawalReason) to table consent
392
- INFO [c15t] Adding column givenAt (fieldName: givenAt) to table consent
393
- INFO [c15t] Adding column validUntil (fieldName: validUntil) to table consent
394
- INFO [c15t] Adding column isActive (fieldName: isActive) to table consent
395
- INFO [c15t] SQL for table consent:
396
- create table "consent" ("id" text not null primary key, "subjectId" text not null references "subject" ("id"), "domainId" text not null references "domain" ("id"), "purposeIds" jsonb, "metadata" jsonb, "policyId" text references "consentPolicy" ("id"), "ipAddress" text, "userAgent" text, "status" text not null, "withdrawalReason" text, "givenAt" timestamp not null, "validUntil" timestamp, "isActive" boolean not null)
397
- INFO [c15t] Creating table consentRecord with fields: subjectId, consentId, actionType, details, createdAt
398
- INFO [c15t] Adding column subjectId (fieldName: subjectId) to table consentRecord
399
- INFO [c15t] Adding column consentId (fieldName: consentId) to table consentRecord
400
- INFO [c15t] Adding column actionType (fieldName: actionType) to table consentRecord
401
- INFO [c15t] Adding column details (fieldName: details) to table consentRecord
402
- INFO [c15t] Adding column createdAt (fieldName: createdAt) to table consentRecord
403
- INFO [c15t] SQL for table consentRecord:
404
- create table "consentRecord" ("id" text not null primary key, "subjectId" text not null references "subject" ("id"), "consentId" text references "consent" ("id"), "actionType" text not null, "details" jsonb, "createdAt" timestamp not null)
405
- INFO [c15t] Creating table auditLog with fields: entityType, entityId, actionType, subjectId, ipAddress, userAgent, changes, metadata, createdAt, eventTimezone
406
- INFO [c15t] Adding column entityType (fieldName: entityType) to table auditLog
407
- INFO [c15t] Adding column entityId (fieldName: entityId) to table auditLog
408
- INFO [c15t] Adding column actionType (fieldName: actionType) to table auditLog
409
- INFO [c15t] Adding column subjectId (fieldName: subjectId) to table auditLog
410
- INFO [c15t] Adding column ipAddress (fieldName: ipAddress) to table auditLog
411
- INFO [c15t] Adding column userAgent (fieldName: userAgent) to table auditLog
412
- INFO [c15t] Adding column changes (fieldName: changes) to table auditLog
413
- INFO [c15t] Adding column metadata (fieldName: metadata) to table auditLog
414
- INFO [c15t] Adding column createdAt (fieldName: createdAt) to table auditLog
415
- INFO [c15t] Adding column eventTimezone (fieldName: eventTimezone) to table auditLog
416
- INFO [c15t] SQL for table auditLog:
417
- create table "auditLog" ("id" text not null primary key, "entityType" text not null, "entityId" text not null, "actionType" text not null, "subjectId" text references "subject" ("id"), "ipAddress" text, "userAgent" text, "changes" jsonb, "metadata" jsonb, "createdAt" timestamp not null, "eventTimezone" text not null)
418
-
419
-
420
-  ❯ src/pkgs/db-adapters/adapters/kysely-adapter/tests/postgres.test.ts 1/9
421
-
422
-  Test Files 1 failed | 15 passed (17)
423
-  Tests 2 failed | 195 passed | 1 skipped (206)
424
-  Start at 20:21:16
425
-  Duration 3.92s
426
- [?2026l