@c15t/backend 0.0.1-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +11 -0
- package/.turbo/turbo-check-types.log +5 -0
- package/.turbo/turbo-fmt.log +7 -0
- package/.turbo/turbo-lint.log +6 -0
- package/.turbo/turbo-test.log +26 -0
- package/README-next.md +223 -0
- package/README.md +164 -0
- package/dist/api/call.d.ts +176 -0
- package/dist/api/call.d.ts.map +1 -0
- package/dist/api/index.d.ts +935 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/middlewares/index.d.ts +39 -0
- package/dist/api/middlewares/index.d.ts.map +1 -0
- package/dist/api/middlewares/origin-check.d.ts +82 -0
- package/dist/api/middlewares/origin-check.d.ts.map +1 -0
- package/dist/api/middlewares/validate-context.d.ts +38 -0
- package/dist/api/middlewares/validate-context.d.ts.map +1 -0
- package/dist/api/routes/__tests__/consent.test.d.ts +2 -0
- package/dist/api/routes/__tests__/consent.test.d.ts.map +1 -0
- package/dist/api/routes/__tests__/status.test.d.ts +2 -0
- package/dist/api/routes/__tests__/status.test.d.ts.map +1 -0
- package/dist/api/routes/error.d.ts +57 -0
- package/dist/api/routes/error.d.ts.map +1 -0
- package/dist/api/routes/generate-consent-receipt.d.ts +130 -0
- package/dist/api/routes/generate-consent-receipt.d.ts.map +1 -0
- package/dist/api/routes/get-consent-history.d.ts +133 -0
- package/dist/api/routes/get-consent-history.d.ts.map +1 -0
- package/dist/api/routes/get-consent-policy.d.ts +164 -0
- package/dist/api/routes/get-consent-policy.d.ts.map +1 -0
- package/dist/api/routes/get-consent.d.ts +148 -0
- package/dist/api/routes/get-consent.d.ts.map +1 -0
- package/dist/api/routes/index.d.ts +339 -0
- package/dist/api/routes/index.d.ts.map +1 -0
- package/dist/api/routes/ok.d.ts +87 -0
- package/dist/api/routes/ok.d.ts.map +1 -0
- package/dist/api/routes/set-consent.d.ts +245 -0
- package/dist/api/routes/set-consent.d.ts.map +1 -0
- package/dist/api/routes/show-consent-banner.d.ts +127 -0
- package/dist/api/routes/show-consent-banner.d.ts.map +1 -0
- package/dist/api/routes/status.d.ts +61 -0
- package/dist/api/routes/status.d.ts.map +1 -0
- package/dist/api/routes/verify-consent.d.ts +179 -0
- package/dist/api/routes/verify-consent.d.ts.map +1 -0
- package/dist/api/routes/withdraw-consent.d.ts +194 -0
- package/dist/api/routes/withdraw-consent.d.ts.map +1 -0
- package/dist/api/to-endpoints.d.ts +35 -0
- package/dist/api/to-endpoints.d.ts.map +1 -0
- package/dist/client/index.cjs +139 -0
- package/dist/client/index.d.ts +203 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +106 -0
- package/dist/client/types.d.ts +431 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/core.d.ts +124 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.test.d.ts +2 -0
- package/dist/core.test.d.ts.map +1 -0
- package/dist/db/adapters/drizzle-adapter/drizzle-adapter.d.ts +122 -0
- package/dist/db/adapters/drizzle-adapter/drizzle-adapter.d.ts.map +1 -0
- package/dist/db/adapters/drizzle-adapter/index.d.ts +2 -0
- package/dist/db/adapters/drizzle-adapter/index.d.ts.map +1 -0
- package/dist/db/adapters/drizzle.cjs +1531 -0
- package/dist/db/adapters/drizzle.js +1489 -0
- package/dist/db/adapters/kysely-adapter/dialect.d.ts +72 -0
- package/dist/db/adapters/kysely-adapter/dialect.d.ts.map +1 -0
- package/dist/db/adapters/kysely-adapter/index.d.ts +4 -0
- package/dist/db/adapters/kysely-adapter/index.d.ts.map +1 -0
- package/dist/db/adapters/kysely-adapter/kysely-adapter.d.ts +98 -0
- package/dist/db/adapters/kysely-adapter/kysely-adapter.d.ts.map +1 -0
- package/dist/db/adapters/kysely-adapter/types.d.ts +281 -0
- package/dist/db/adapters/kysely-adapter/types.d.ts.map +1 -0
- package/dist/db/adapters/kysely.cjs +1551 -0
- package/dist/db/adapters/kysely.js +1508 -0
- package/dist/db/adapters/memory-adapter/index.d.ts +2 -0
- package/dist/db/adapters/memory-adapter/index.d.ts.map +1 -0
- package/dist/db/adapters/memory-adapter/memory-adapter.d.ts +56 -0
- package/dist/db/adapters/memory-adapter/memory-adapter.d.ts.map +1 -0
- package/dist/db/adapters/memory.cjs +1391 -0
- package/dist/db/adapters/memory.js +1349 -0
- package/dist/db/adapters/prisma-adapter/index.d.ts +2 -0
- package/dist/db/adapters/prisma-adapter/index.d.ts.map +1 -0
- package/dist/db/adapters/prisma-adapter/prisma-adapter.d.ts +143 -0
- package/dist/db/adapters/prisma-adapter/prisma-adapter.d.ts.map +1 -0
- package/dist/db/adapters/prisma.cjs +1503 -0
- package/dist/db/adapters/prisma.js +1461 -0
- package/dist/db/adapters/types.d.ts +154 -0
- package/dist/db/adapters/types.d.ts.map +1 -0
- package/dist/db/adapters/utils.d.ts +36 -0
- package/dist/db/adapters/utils.d.ts.map +1 -0
- package/dist/db/core/fields/field-factory.d.ts +383 -0
- package/dist/db/core/fields/field-factory.d.ts.map +1 -0
- package/dist/db/core/fields/field-inference.d.ts +218 -0
- package/dist/db/core/fields/field-inference.d.ts.map +1 -0
- package/dist/db/core/fields/field-options-integration.d.ts +90 -0
- package/dist/db/core/fields/field-options-integration.d.ts.map +1 -0
- package/dist/db/core/fields/field-types.d.ts +182 -0
- package/dist/db/core/fields/field-types.d.ts.map +1 -0
- package/dist/db/core/fields/id-generator.d.ts +19 -0
- package/dist/db/core/fields/id-generator.d.ts.map +1 -0
- package/dist/db/core/fields/index.d.ts +8 -0
- package/dist/db/core/fields/index.d.ts.map +1 -0
- package/dist/db/core/fields/superjson-utils.d.ts +34 -0
- package/dist/db/core/fields/superjson-utils.d.ts.map +1 -0
- package/dist/db/core/fields/zod-fields.d.ts +1011 -0
- package/dist/db/core/fields/zod-fields.d.ts.map +1 -0
- package/dist/db/core/get-schema.d.ts +36 -0
- package/dist/db/core/get-schema.d.ts.map +1 -0
- package/dist/db/core/types.d.ts +41 -0
- package/dist/db/core/types.d.ts.map +1 -0
- package/dist/db/create-registry.d.ts +760 -0
- package/dist/db/create-registry.d.ts.map +1 -0
- package/dist/db/hooks/create-hooks.d.ts +32 -0
- package/dist/db/hooks/create-hooks.d.ts.map +1 -0
- package/dist/db/hooks/index.d.ts +40 -0
- package/dist/db/hooks/index.d.ts.map +1 -0
- package/dist/db/hooks/types.d.ts +133 -0
- package/dist/db/hooks/types.d.ts.map +1 -0
- package/dist/db/hooks/update-hooks.d.ts +33 -0
- package/dist/db/hooks/update-hooks.d.ts.map +1 -0
- package/dist/db/hooks/update-many-hooks.d.ts +55 -0
- package/dist/db/hooks/update-many-hooks.d.ts.map +1 -0
- package/dist/db/hooks/utils.d.ts +62 -0
- package/dist/db/hooks/utils.d.ts.map +1 -0
- package/dist/db/hooks/with-hooks-factory.d.ts +33 -0
- package/dist/db/hooks/with-hooks-factory.d.ts.map +1 -0
- package/dist/db/index.cjs +2458 -0
- package/dist/db/index.d.ts +11 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +2404 -0
- package/dist/db/migration/get-migration.d.ts +32 -0
- package/dist/db/migration/get-migration.d.ts.map +1 -0
- package/dist/db/migration/get-schema/get-schema.d.ts +27 -0
- package/dist/db/migration/get-schema/get-schema.d.ts.map +1 -0
- package/dist/db/migration/get-schema/index.d.ts +21 -0
- package/dist/db/migration/get-schema/index.d.ts.map +1 -0
- package/dist/db/migration/get-schema/process-fields.d.ts +16 -0
- package/dist/db/migration/get-schema/process-fields.d.ts.map +1 -0
- package/dist/db/migration/get-schema/process-tables.d.ts +13 -0
- package/dist/db/migration/get-schema/process-tables.d.ts.map +1 -0
- package/dist/db/migration/get-schema/types.d.ts +17 -0
- package/dist/db/migration/get-schema/types.d.ts.map +1 -0
- package/dist/db/migration/index.cjs +1613 -0
- package/dist/db/migration/index.d.ts +14 -0
- package/dist/db/migration/index.d.ts.map +1 -0
- package/dist/db/migration/index.js +1571 -0
- package/dist/db/migration/migration-builders.d.ts +28 -0
- package/dist/db/migration/migration-builders.d.ts.map +1 -0
- package/dist/db/migration/migration-execution.d.ts +12 -0
- package/dist/db/migration/migration-execution.d.ts.map +1 -0
- package/dist/db/migration/schema-comparison.d.ts +54 -0
- package/dist/db/migration/schema-comparison.d.ts.map +1 -0
- package/dist/db/migration/type-mapping.d.ts +86 -0
- package/dist/db/migration/type-mapping.d.ts.map +1 -0
- package/dist/db/migration/types.d.ts +37 -0
- package/dist/db/migration/types.d.ts.map +1 -0
- package/dist/db/schema/audit-log/index.d.ts +4 -0
- package/dist/db/schema/audit-log/index.d.ts.map +1 -0
- package/dist/db/schema/audit-log/registry.d.ts +128 -0
- package/dist/db/schema/audit-log/registry.d.ts.map +1 -0
- package/dist/db/schema/audit-log/schema.d.ts +67 -0
- package/dist/db/schema/audit-log/schema.d.ts.map +1 -0
- package/dist/db/schema/audit-log/table.d.ts +175 -0
- package/dist/db/schema/audit-log/table.d.ts.map +1 -0
- package/dist/db/schema/audit-log/types.d.ts +29 -0
- package/dist/db/schema/audit-log/types.d.ts.map +1 -0
- package/dist/db/schema/consent/index.d.ts +4 -0
- package/dist/db/schema/consent/index.d.ts.map +1 -0
- package/dist/db/schema/consent/registry.d.ts +318 -0
- package/dist/db/schema/consent/registry.d.ts.map +1 -0
- package/dist/db/schema/consent/schema.d.ts +135 -0
- package/dist/db/schema/consent/schema.d.ts.map +1 -0
- package/dist/db/schema/consent/table.d.ts +245 -0
- package/dist/db/schema/consent/table.d.ts.map +1 -0
- package/dist/db/schema/consent/types.d.ts +37 -0
- package/dist/db/schema/consent/types.d.ts.map +1 -0
- package/dist/db/schema/consent-geo-location/index.d.ts +4 -0
- package/dist/db/schema/consent-geo-location/index.d.ts.map +1 -0
- package/dist/db/schema/consent-geo-location/registry.d.ts +96 -0
- package/dist/db/schema/consent-geo-location/registry.d.ts.map +1 -0
- package/dist/db/schema/consent-geo-location/schema.d.ts +71 -0
- package/dist/db/schema/consent-geo-location/schema.d.ts.map +1 -0
- package/dist/db/schema/consent-geo-location/table.d.ts +167 -0
- package/dist/db/schema/consent-geo-location/table.d.ts.map +1 -0
- package/dist/db/schema/consent-geo-location/types.d.ts +21 -0
- package/dist/db/schema/consent-geo-location/types.d.ts.map +1 -0
- package/dist/db/schema/consent-policy/index.d.ts +4 -0
- package/dist/db/schema/consent-policy/index.d.ts.map +1 -0
- package/dist/db/schema/consent-policy/registry.d.ts +186 -0
- package/dist/db/schema/consent-policy/registry.d.ts.map +1 -0
- package/dist/db/schema/consent-policy/schema.d.ts +68 -0
- package/dist/db/schema/consent-policy/schema.d.ts.map +1 -0
- package/dist/db/schema/consent-policy/table.d.ts +147 -0
- package/dist/db/schema/consent-policy/table.d.ts.map +1 -0
- package/dist/db/schema/consent-policy/types.d.ts +28 -0
- package/dist/db/schema/consent-policy/types.d.ts.map +1 -0
- package/dist/db/schema/consent-purpose/index.d.ts +4 -0
- package/dist/db/schema/consent-purpose/index.d.ts.map +1 -0
- package/dist/db/schema/consent-purpose/registry.d.ts +136 -0
- package/dist/db/schema/consent-purpose/registry.d.ts.map +1 -0
- package/dist/db/schema/consent-purpose/schema.d.ts +79 -0
- package/dist/db/schema/consent-purpose/schema.d.ts.map +1 -0
- package/dist/db/schema/consent-purpose/table.d.ts +161 -0
- package/dist/db/schema/consent-purpose/table.d.ts.map +1 -0
- package/dist/db/schema/consent-purpose/types.d.ts +16 -0
- package/dist/db/schema/consent-purpose/types.d.ts.map +1 -0
- package/dist/db/schema/consent-purpose-junction/index.d.ts +4 -0
- package/dist/db/schema/consent-purpose-junction/index.d.ts.map +1 -0
- package/dist/db/schema/consent-purpose-junction/registry.d.ts +109 -0
- package/dist/db/schema/consent-purpose-junction/registry.d.ts.map +1 -0
- package/dist/db/schema/consent-purpose-junction/schema.d.ts +57 -0
- package/dist/db/schema/consent-purpose-junction/schema.d.ts.map +1 -0
- package/dist/db/schema/consent-purpose-junction/table.d.ts +138 -0
- package/dist/db/schema/consent-purpose-junction/table.d.ts.map +1 -0
- package/dist/db/schema/consent-purpose-junction/types.d.ts +14 -0
- package/dist/db/schema/consent-purpose-junction/types.d.ts.map +1 -0
- package/dist/db/schema/consent-record/index.d.ts +4 -0
- package/dist/db/schema/consent-record/index.d.ts.map +1 -0
- package/dist/db/schema/consent-record/registry.d.ts +119 -0
- package/dist/db/schema/consent-record/registry.d.ts.map +1 -0
- package/dist/db/schema/consent-record/schema.d.ts +57 -0
- package/dist/db/schema/consent-record/schema.d.ts.map +1 -0
- package/dist/db/schema/consent-record/table.d.ts +123 -0
- package/dist/db/schema/consent-record/table.d.ts.map +1 -0
- package/dist/db/schema/consent-record/types.d.ts +21 -0
- package/dist/db/schema/consent-record/types.d.ts.map +1 -0
- package/dist/db/schema/consent-withdrawal/index.d.ts +4 -0
- package/dist/db/schema/consent-withdrawal/index.d.ts.map +1 -0
- package/dist/db/schema/consent-withdrawal/registry.d.ts +134 -0
- package/dist/db/schema/consent-withdrawal/registry.d.ts.map +1 -0
- package/dist/db/schema/consent-withdrawal/schema.d.ts +67 -0
- package/dist/db/schema/consent-withdrawal/schema.d.ts.map +1 -0
- package/dist/db/schema/consent-withdrawal/table.d.ts +170 -0
- package/dist/db/schema/consent-withdrawal/table.d.ts.map +1 -0
- package/dist/db/schema/consent-withdrawal/types.d.ts +28 -0
- package/dist/db/schema/consent-withdrawal/types.d.ts.map +1 -0
- package/dist/db/schema/definition.d.ts +1100 -0
- package/dist/db/schema/definition.d.ts.map +1 -0
- package/dist/db/schema/domain/index.d.ts +4 -0
- package/dist/db/schema/domain/index.d.ts.map +1 -0
- package/dist/db/schema/domain/registry.d.ts +169 -0
- package/dist/db/schema/domain/registry.d.ts.map +1 -0
- package/dist/db/schema/domain/schema.d.ts +60 -0
- package/dist/db/schema/domain/schema.d.ts.map +1 -0
- package/dist/db/schema/domain/table.d.ts +140 -0
- package/dist/db/schema/domain/table.d.ts.map +1 -0
- package/dist/db/schema/domain/types.d.ts +27 -0
- package/dist/db/schema/domain/types.d.ts.map +1 -0
- package/dist/db/schema/geo-location/index.d.ts +4 -0
- package/dist/db/schema/geo-location/index.d.ts.map +1 -0
- package/dist/db/schema/geo-location/registry.d.ts +114 -0
- package/dist/db/schema/geo-location/registry.d.ts.map +1 -0
- package/dist/db/schema/geo-location/schema.d.ts +58 -0
- package/dist/db/schema/geo-location/schema.d.ts.map +1 -0
- package/dist/db/schema/geo-location/table.d.ts +132 -0
- package/dist/db/schema/geo-location/table.d.ts.map +1 -0
- package/dist/db/schema/geo-location/types.d.ts +17 -0
- package/dist/db/schema/geo-location/types.d.ts.map +1 -0
- package/dist/db/schema/index.d.ts +85 -0
- package/dist/db/schema/index.d.ts.map +1 -0
- package/dist/db/schema/parser.d.ts +183 -0
- package/dist/db/schema/parser.d.ts.map +1 -0
- package/dist/db/schema/schemas.d.ts +383 -0
- package/dist/db/schema/schemas.d.ts.map +1 -0
- package/dist/db/schema/subject/index.d.ts +4 -0
- package/dist/db/schema/subject/index.d.ts.map +1 -0
- package/dist/db/schema/subject/registry.d.ts +141 -0
- package/dist/db/schema/subject/registry.d.ts.map +1 -0
- package/dist/db/schema/subject/schema.d.ts +56 -0
- package/dist/db/schema/subject/schema.d.ts.map +1 -0
- package/dist/db/schema/subject/table.d.ts +136 -0
- package/dist/db/schema/subject/table.d.ts.map +1 -0
- package/dist/db/schema/subject/types.d.ts +22 -0
- package/dist/db/schema/subject/types.d.ts.map +1 -0
- package/dist/db/schema/types.d.ts +136 -0
- package/dist/db/schema/types.d.ts.map +1 -0
- package/dist/db/utils/adapter-factory.d.ts +21 -0
- package/dist/db/utils/adapter-factory.d.ts.map +1 -0
- package/dist/db/utils/index.d.ts +10 -0
- package/dist/db/utils/index.d.ts.map +1 -0
- package/dist/db/utils.d.ts +4 -0
- package/dist/db/utils.d.ts.map +1 -0
- package/dist/error/codes.cjs +68 -0
- package/dist/error/codes.d.ts +175 -0
- package/dist/error/codes.d.ts.map +1 -0
- package/dist/error/codes.js +35 -0
- package/dist/error/error.d.ts +79 -0
- package/dist/error/error.d.ts.map +1 -0
- package/dist/error/index.cjs +172 -0
- package/dist/error/index.d.ts +9 -0
- package/dist/error/index.d.ts.map +1 -0
- package/dist/error/index.js +129 -0
- package/dist/error/logging.d.ts +25 -0
- package/dist/error/logging.d.ts.map +1 -0
- package/dist/error/pipeline.d.ts +19 -0
- package/dist/error/pipeline.d.ts.map +1 -0
- package/dist/error/recovery.d.ts +22 -0
- package/dist/error/recovery.d.ts.map +1 -0
- package/dist/error/results.d.ts +56 -0
- package/dist/error/results.d.ts.map +1 -0
- package/dist/index.cjs +4777 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4708 -0
- package/dist/init.d.ts +52 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/init.test.d.ts +2 -0
- package/dist/init.test.d.ts.map +1 -0
- package/dist/integrations/index.cjs +281 -0
- package/dist/integrations/index.d.ts +7 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +248 -0
- package/dist/integrations/next.cjs +131 -0
- package/dist/integrations/next.d.ts +29 -0
- package/dist/integrations/next.d.ts.map +1 -0
- package/dist/integrations/next.js +99 -0
- package/dist/integrations/react.cjs +182 -0
- package/dist/integrations/react.d.ts +257 -0
- package/dist/integrations/react.d.ts.map +1 -0
- package/dist/integrations/react.js +150 -0
- package/dist/plugins/geo/index.d.ts +2 -0
- package/dist/plugins/geo/index.d.ts.map +1 -0
- package/dist/test/utils.d.ts +65 -0
- package/dist/test/utils.d.ts.map +1 -0
- package/dist/types/api.d.ts +89 -0
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/context.d.ts +205 -0
- package/dist/types/context.d.ts.map +1 -0
- package/dist/types/helper.d.ts +78 -0
- package/dist/types/helper.d.ts.map +1 -0
- package/dist/types/index.cjs +19 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +0 -0
- package/dist/types/options.d.ts +172 -0
- package/dist/types/options.d.ts.map +1 -0
- package/dist/types/plugins.d.ts +442 -0
- package/dist/types/plugins.d.ts.map +1 -0
- package/dist/utils/env.d.ts +77 -0
- package/dist/utils/env.d.ts.map +1 -0
- package/dist/utils/hide-metadata.d.ts +22 -0
- package/dist/utils/hide-metadata.d.ts.map +1 -0
- package/dist/utils/index.cjs +268 -0
- package/dist/utils/index.d.ts +18 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +210 -0
- package/dist/utils/ip.d.ts +10 -0
- package/dist/utils/ip.d.ts.map +1 -0
- package/dist/utils/json.d.ts +14 -0
- package/dist/utils/json.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +108 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/url.d.ts +87 -0
- package/dist/utils/url.d.ts.map +1 -0
- package/dist/utils/wildcard.d.ts +46 -0
- package/dist/utils/wildcard.d.ts.map +1 -0
- package/knip.json +37 -0
- package/package.json +146 -0
- package/rslib.config.ts +104 -0
- package/src/api/call.ts +177 -0
- package/src/api/index.ts +303 -0
- package/src/api/middlewares/index.ts +38 -0
- package/src/api/middlewares/origin-check.ts +260 -0
- package/src/api/middlewares/validate-context.ts +175 -0
- package/src/api/routes/__tests__/consent.test.ts +270 -0
- package/src/api/routes/__tests__/status.test.ts +36 -0
- package/src/api/routes/error.ts +130 -0
- package/src/api/routes/generate-consent-receipt.ts +244 -0
- package/src/api/routes/get-consent-history.ts +128 -0
- package/src/api/routes/get-consent-policy.ts +327 -0
- package/src/api/routes/get-consent.ts +230 -0
- package/src/api/routes/index.ts +12 -0
- package/src/api/routes/ok.ts +45 -0
- package/src/api/routes/set-consent.ts +328 -0
- package/src/api/routes/show-consent-banner.ts +149 -0
- package/src/api/routes/status.ts +62 -0
- package/src/api/routes/verify-consent.ts +272 -0
- package/src/api/routes/withdraw-consent.ts +293 -0
- package/src/api/to-endpoints.ts +371 -0
- package/src/client/index.ts +471 -0
- package/src/client/types.ts +458 -0
- package/src/core.test.ts +303 -0
- package/src/core.ts +267 -0
- package/src/db/adapters/drizzle-adapter/drizzle-adapter.ts +711 -0
- package/src/db/adapters/drizzle-adapter/index.ts +1 -0
- package/src/db/adapters/kysely-adapter/dialect.ts +192 -0
- package/src/db/adapters/kysely-adapter/index.ts +3 -0
- package/src/db/adapters/kysely-adapter/kysely-adapter.ts +1168 -0
- package/src/db/adapters/kysely-adapter/types.ts +307 -0
- package/src/db/adapters/memory-adapter/index.ts +1 -0
- package/src/db/adapters/memory-adapter/memory-adapter.ts +648 -0
- package/src/db/adapters/prisma-adapter/index.ts +1 -0
- package/src/db/adapters/prisma-adapter/prisma-adapter.ts +586 -0
- package/src/db/adapters/types.ts +203 -0
- package/src/db/adapters/utils.ts +51 -0
- package/src/db/core/fields/field-factory.ts +804 -0
- package/src/db/core/fields/field-inference.ts +298 -0
- package/src/db/core/fields/field-options-integration.ts +135 -0
- package/src/db/core/fields/field-types.ts +233 -0
- package/src/db/core/fields/id-generator.ts +57 -0
- package/src/db/core/fields/index.ts +56 -0
- package/src/db/core/fields/superjson-utils.ts +155 -0
- package/src/db/core/fields/zod-fields.ts +269 -0
- package/src/db/core/get-schema.ts +102 -0
- package/src/db/core/types.ts +52 -0
- package/src/db/create-registry.ts +31 -0
- package/src/db/hooks/create-hooks.ts +88 -0
- package/src/db/hooks/index.ts +39 -0
- package/src/db/hooks/types.ts +164 -0
- package/src/db/hooks/update-hooks.ts +91 -0
- package/src/db/hooks/update-many-hooks.ts +176 -0
- package/src/db/hooks/utils.ts +151 -0
- package/src/db/hooks/with-hooks-factory.ts +68 -0
- package/src/db/index.ts +32 -0
- package/src/db/migration/get-migration.ts +89 -0
- package/src/db/migration/get-schema/get-schema.ts +44 -0
- package/src/db/migration/get-schema/index.ts +20 -0
- package/src/db/migration/get-schema/process-fields.ts +66 -0
- package/src/db/migration/get-schema/process-tables.ts +68 -0
- package/src/db/migration/get-schema/types.ts +18 -0
- package/src/db/migration/index.ts +18 -0
- package/src/db/migration/migration-builders.ts +170 -0
- package/src/db/migration/migration-execution.ts +79 -0
- package/src/db/migration/schema-comparison.ts +216 -0
- package/src/db/migration/type-mapping.ts +255 -0
- package/src/db/migration/types.ts +46 -0
- package/src/db/schema/audit-log/index.ts +3 -0
- package/src/db/schema/audit-log/registry.ts +228 -0
- package/src/db/schema/audit-log/schema.ts +46 -0
- package/src/db/schema/audit-log/table.ts +185 -0
- package/src/db/schema/audit-log/types.ts +29 -0
- package/src/db/schema/consent/index.ts +3 -0
- package/src/db/schema/consent/registry.ts +381 -0
- package/src/db/schema/consent/schema.ts +65 -0
- package/src/db/schema/consent/table.ts +220 -0
- package/src/db/schema/consent/types.ts +39 -0
- package/src/db/schema/consent-geo-location/index.ts +3 -0
- package/src/db/schema/consent-geo-location/registry.ts +124 -0
- package/src/db/schema/consent-geo-location/schema.ts +51 -0
- package/src/db/schema/consent-geo-location/table.ts +169 -0
- package/src/db/schema/consent-geo-location/types.ts +21 -0
- package/src/db/schema/consent-policy/index.ts +3 -0
- package/src/db/schema/consent-policy/registry.ts +313 -0
- package/src/db/schema/consent-policy/schema.ts +47 -0
- package/src/db/schema/consent-policy/table.ts +141 -0
- package/src/db/schema/consent-policy/types.ts +28 -0
- package/src/db/schema/consent-purpose/index.ts +3 -0
- package/src/db/schema/consent-purpose/registry.ts +188 -0
- package/src/db/schema/consent-purpose/schema.ts +58 -0
- package/src/db/schema/consent-purpose/table.ts +154 -0
- package/src/db/schema/consent-purpose/types.ts +16 -0
- package/src/db/schema/consent-purpose-junction/index.ts +3 -0
- package/src/db/schema/consent-purpose-junction/registry.ts +189 -0
- package/src/db/schema/consent-purpose-junction/schema.ts +49 -0
- package/src/db/schema/consent-purpose-junction/table.ts +142 -0
- package/src/db/schema/consent-purpose-junction/types.ts +14 -0
- package/src/db/schema/consent-record/index.ts +3 -0
- package/src/db/schema/consent-record/registry.ts +209 -0
- package/src/db/schema/consent-record/schema.ts +42 -0
- package/src/db/schema/consent-record/table.ts +124 -0
- package/src/db/schema/consent-record/types.ts +21 -0
- package/src/db/schema/consent-withdrawal/index.ts +3 -0
- package/src/db/schema/consent-withdrawal/registry.ts +219 -0
- package/src/db/schema/consent-withdrawal/schema.ts +48 -0
- package/src/db/schema/consent-withdrawal/table.ts +181 -0
- package/src/db/schema/consent-withdrawal/types.ts +29 -0
- package/src/db/schema/definition.ts +196 -0
- package/src/db/schema/domain/index.ts +3 -0
- package/src/db/schema/domain/registry.ts +272 -0
- package/src/db/schema/domain/schema.ts +43 -0
- package/src/db/schema/domain/table.ts +137 -0
- package/src/db/schema/domain/types.ts +27 -0
- package/src/db/schema/geo-location/index.ts +3 -0
- package/src/db/schema/geo-location/registry.ts +159 -0
- package/src/db/schema/geo-location/schema.ts +45 -0
- package/src/db/schema/geo-location/table.ts +148 -0
- package/src/db/schema/geo-location/types.ts +18 -0
- package/src/db/schema/index.ts +96 -0
- package/src/db/schema/parser.ts +417 -0
- package/src/db/schema/schemas.ts +35 -0
- package/src/db/schema/subject/index.ts +3 -0
- package/src/db/schema/subject/registry.ts +371 -0
- package/src/db/schema/subject/schema.ts +41 -0
- package/src/db/schema/subject/table.ts +139 -0
- package/src/db/schema/subject/types.ts +22 -0
- package/src/db/schema/types.ts +154 -0
- package/src/db/utils/adapter-factory.ts +64 -0
- package/src/db/utils/index.ts +10 -0
- package/src/db/utils.ts +42 -0
- package/src/docs/ADVANCED_JSON_HANDLING.md +99 -0
- package/src/docs/neverthrow.md +171 -0
- package/src/error/codes.ts +201 -0
- package/src/error/error.ts +145 -0
- package/src/error/index.ts +23 -0
- package/src/error/logging.ts +52 -0
- package/src/error/pipeline.ts +57 -0
- package/src/error/recovery.ts +45 -0
- package/src/error/results.ts +100 -0
- package/src/index.ts +79 -0
- package/src/init.test.ts +235 -0
- package/src/init.ts +261 -0
- package/src/integrations/index.ts +10 -0
- package/src/integrations/next.ts +136 -0
- package/src/integrations/react.ts +567 -0
- package/src/plugins/geo/index.ts +563 -0
- package/src/test/utils.ts +244 -0
- package/src/types/api.ts +101 -0
- package/src/types/context.ts +235 -0
- package/src/types/helper.ts +87 -0
- package/src/types/index.ts +5 -0
- package/src/types/options.ts +189 -0
- package/src/types/plugins.ts +538 -0
- package/src/utils/env.ts +103 -0
- package/src/utils/hide-metadata.ts +21 -0
- package/src/utils/index.ts +17 -0
- package/src/utils/ip.ts +45 -0
- package/src/utils/json.ts +19 -0
- package/src/utils/logger.ts +252 -0
- package/src/utils/url.ts +194 -0
- package/src/utils/wildcard.ts +253 -0
- package/tsconfig.json +12 -0
- package/vitest.config.ts +14 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Kysely } from 'kysely';
|
|
2
|
+
import type { Database, KyselyDatabaseType } from '../adapters/kysely-adapter/types';
|
|
3
|
+
import type { ColumnsToAdd, MigrationOperation, TableToCreate } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Builds migrations for adding columns to existing tables
|
|
6
|
+
*
|
|
7
|
+
* This function creates ALTER TABLE statements to add missing columns
|
|
8
|
+
* to existing tables in the database.
|
|
9
|
+
*
|
|
10
|
+
* @param db - Kysely database instance used to build SQL operations
|
|
11
|
+
* @param toBeAdded - Collection of tables and columns that need to be added
|
|
12
|
+
* @param dbType - Database type to determine appropriate column types
|
|
13
|
+
* @returns Array of migration operations ready to be executed
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildColumnAddMigrations(db: Kysely<Database>, toBeAdded: ColumnsToAdd[], dbType: KyselyDatabaseType): MigrationOperation[];
|
|
16
|
+
/**
|
|
17
|
+
* Builds migrations for creating new tables
|
|
18
|
+
*
|
|
19
|
+
* This function creates CREATE TABLE statements for tables
|
|
20
|
+
* that don't exist in the database but are defined in the schema.
|
|
21
|
+
*
|
|
22
|
+
* @param db - Kysely database instance used to build SQL operations
|
|
23
|
+
* @param toBeCreated - Collection of tables that need to be created
|
|
24
|
+
* @param dbType - Database type to determine appropriate column types
|
|
25
|
+
* @returns Array of migration operations ready to be executed
|
|
26
|
+
*/
|
|
27
|
+
export declare function buildTableCreateMigrations(db: Kysely<Database>, toBeCreated: TableToCreate[], dbType: KyselyDatabaseType): MigrationOperation[];
|
|
28
|
+
//# sourceMappingURL=migration-builders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-builders.d.ts","sourceRoot":"","sources":["../../../src/db/migration/migration-builders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA8B,MAAM,EAAE,MAAM,QAAQ,CAAC;AACjE,OAAO,KAAK,EACX,QAAQ,EACR,kBAAkB,EAClB,MAAM,oCAAoC,CAAC;AAI5C,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE/E;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CACvC,EAAE,EAAE,MAAM,CAAC,QAAQ,CAAC,EACpB,SAAS,EAAE,YAAY,EAAE,EACzB,MAAM,EAAE,kBAAkB,GACxB,kBAAkB,EAAE,CA0CtB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CACzC,EAAE,EAAE,MAAM,CAAC,QAAQ,CAAC,EACpB,WAAW,EAAE,aAAa,EAAE,EAC5B,MAAM,EAAE,kBAAkB,GACxB,kBAAkB,EAAE,CAqFtB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MigrationOperation } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Creates functions to run or compile the generated migrations
|
|
4
|
+
*
|
|
5
|
+
* @param migrations - Migration operations to execute
|
|
6
|
+
* @returns Object with runMigrations and compileMigrations functions
|
|
7
|
+
*/
|
|
8
|
+
export declare function createMigrationExecutors(migrations: MigrationOperation[]): {
|
|
9
|
+
runMigrations: () => Promise<void>;
|
|
10
|
+
compileMigrations: () => Promise<string>;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=migration-execution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-execution.d.ts","sourceRoot":"","sources":["../../../src/db/migration/migration-execution.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,kBAAkB,EAAE;;;EA8DxE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { TableMetadata } from 'kysely';
|
|
2
|
+
/**
|
|
3
|
+
* Schema comparison functionality for database migrations
|
|
4
|
+
*
|
|
5
|
+
* This module analyzes differences between the expected schema definition and the
|
|
6
|
+
* actual database schema to determine what tables need to be created and what
|
|
7
|
+
* columns need to be added to existing tables.
|
|
8
|
+
*
|
|
9
|
+
* The comparison process follows these steps:
|
|
10
|
+
* 1. Load the expected schema from configuration
|
|
11
|
+
* 2. Compare it with tables in the actual database
|
|
12
|
+
* 3. Identify tables that don't exist but should be created
|
|
13
|
+
* 4. Identify columns that need to be added to existing tables
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* This is a core part of the migration system and is used by the main migration
|
|
17
|
+
* generator to determine what database changes are needed.
|
|
18
|
+
*
|
|
19
|
+
* @module migration/schema-comparison
|
|
20
|
+
*/
|
|
21
|
+
import type { C15TOptions } from '../../types';
|
|
22
|
+
import type { KyselyDatabaseType } from '../adapters/kysely-adapter/types';
|
|
23
|
+
import type { ColumnsToAdd, TableToCreate } from './types';
|
|
24
|
+
/**
|
|
25
|
+
* Analyzes schema differences between the expected schema and actual database
|
|
26
|
+
*
|
|
27
|
+
* This function compares the schema defined in the application with the
|
|
28
|
+
* actual database structure to determine what changes need to be made.
|
|
29
|
+
*
|
|
30
|
+
* @param config - c15t configuration containing the schema definition
|
|
31
|
+
* @param tableMetadata - Database table metadata from introspection, containing
|
|
32
|
+
* information about existing tables and columns
|
|
33
|
+
* @param dbType - The database type (postgres, mysql, sqlite, mssql) which affects
|
|
34
|
+
* how types are compared and mapped
|
|
35
|
+
*
|
|
36
|
+
* @returns An object containing tables to be created and columns to be added
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* const changes = analyzeSchemaChanges(
|
|
41
|
+
* appConfig,
|
|
42
|
+
* databaseMetadata,
|
|
43
|
+
* 'postgres'
|
|
44
|
+
* );
|
|
45
|
+
*
|
|
46
|
+
* console.log(`Need to create ${changes.toBeCreated.length} tables`);
|
|
47
|
+
* console.log(`Need to add columns to ${changes.toBeAdded.length} tables`);
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare function analyzeSchemaChanges(config: C15TOptions, tableMetadata: TableMetadata[], dbType: KyselyDatabaseType): {
|
|
51
|
+
toBeCreated: TableToCreate[];
|
|
52
|
+
toBeAdded: ColumnsToAdd[];
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=schema-comparison.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-comparison.d.ts","sourceRoot":"","sources":["../../../src/db/migration/schema-comparison.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAI3E,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,oBAAoB,CACnC,MAAM,EAAE,WAAW,EACnB,aAAa,EAAE,aAAa,EAAE,EAC9B,MAAM,EAAE,kBAAkB,GACxB;IAAE,WAAW,EAAE,aAAa,EAAE,CAAC;IAAC,SAAS,EAAE,YAAY,EAAE,CAAA;CAAE,CAwB7D"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { Field, FieldType } from '../core/fields';
|
|
2
|
+
/**
|
|
3
|
+
* Database type mapping functionality
|
|
4
|
+
*
|
|
5
|
+
* This module handles mapping between abstract field types and
|
|
6
|
+
* database-specific column types. It provides utilities for:
|
|
7
|
+
* 1. Converting between c15t field types and database-specific types
|
|
8
|
+
* 2. Checking type compatibility across different databases
|
|
9
|
+
* 3. Determining appropriate database types based on field attributes
|
|
10
|
+
*
|
|
11
|
+
* @module migration/type-mapping
|
|
12
|
+
*/
|
|
13
|
+
import type { KyselyDatabaseType } from '../adapters/kysely-adapter/types';
|
|
14
|
+
/**
|
|
15
|
+
* Determines MySQL string type based on field attributes
|
|
16
|
+
*
|
|
17
|
+
* @param field - Field attributes including unique and references properties
|
|
18
|
+
* @returns The appropriate MySQL type for the string field
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* // Returns 'varchar(255)' for unique fields
|
|
23
|
+
* getMySqlStringType({ type: 'string', unique: true });
|
|
24
|
+
*
|
|
25
|
+
* // Returns 'varchar(36)' for reference fields
|
|
26
|
+
* getMySqlStringType({ type: 'string', references: 'subjects' });
|
|
27
|
+
*
|
|
28
|
+
* // Returns 'text' for regular string fields
|
|
29
|
+
* getMySqlStringType({ type: 'string' });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function getMySqlStringType(field: Field): string;
|
|
33
|
+
/**
|
|
34
|
+
* Checks if a database column type matches the expected field type
|
|
35
|
+
*
|
|
36
|
+
* @param columnDataType - The actual column type in the database
|
|
37
|
+
* @param fieldType - The expected field type from c15t
|
|
38
|
+
* @param dbType - The database type (postgres, mysql, etc.)
|
|
39
|
+
* @returns True if types match, false otherwise
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
* This function handles type compatibility across different databases,
|
|
43
|
+
* accounting for the fact that the same logical type may have different
|
|
44
|
+
* names in different database systems.
|
|
45
|
+
*
|
|
46
|
+
* Array types (string[] and number[]) are treated specially and matched
|
|
47
|
+
* against JSON-compatible column types.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```typescript
|
|
51
|
+
* // Returns true because 'text' is compatible with 'string' in PostgreSQL
|
|
52
|
+
* matchType('text', 'string', 'postgres');
|
|
53
|
+
*
|
|
54
|
+
* // Returns true because 'jsonb' is compatible with array types
|
|
55
|
+
* matchType('jsonb', 'string[]', 'postgres');
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export declare function matchType(columnDataType: string, fieldType: FieldType, dbType: KyselyDatabaseType): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Gets the appropriate database type for a field
|
|
61
|
+
*
|
|
62
|
+
* @param field - Field attributes including type and other properties
|
|
63
|
+
* @param dbType - Database type to get the appropriate type for
|
|
64
|
+
* @returns The appropriate database-specific type
|
|
65
|
+
*
|
|
66
|
+
* @remarks
|
|
67
|
+
* This function determines the most appropriate database type for a given field,
|
|
68
|
+
* taking into account:
|
|
69
|
+
* - The field's base type (string, number, boolean, etc.)
|
|
70
|
+
* - Special attributes (unique, references, bigint)
|
|
71
|
+
* - Database-specific requirements and best practices
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```typescript
|
|
75
|
+
* // Returns 'text' for a regular string field in SQLite
|
|
76
|
+
* getType({ type: 'string' }, 'sqlite');
|
|
77
|
+
*
|
|
78
|
+
* // Returns 'jsonb' for a JSON field in PostgreSQL
|
|
79
|
+
* getType({ type: 'json' }, 'postgres');
|
|
80
|
+
*
|
|
81
|
+
* // Returns 'bigint' for a number field with bigint flag
|
|
82
|
+
* getType({ type: 'number', bigint: true }, 'mysql');
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
export declare function getType(field: Field, dbType?: KyselyDatabaseType): string;
|
|
86
|
+
//# sourceMappingURL=type-mapping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-mapping.d.ts","sourceRoot":"","sources":["../../../src/db/migration/type-mapping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACzD;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAqF3E;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAQvD;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,SAAS,CACxB,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,kBAAkB,GACxB,OAAO,CAUT;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,GAAE,kBAA6B,UA8D1E"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types used throughout the migration system
|
|
3
|
+
*
|
|
4
|
+
* @module migration/types
|
|
5
|
+
*/
|
|
6
|
+
import type { AlterTableColumnAlteringBuilder, CreateTableBuilder } from 'kysely';
|
|
7
|
+
import type { Field } from '../core/fields';
|
|
8
|
+
/**
|
|
9
|
+
* Type representing a table to be created during migration
|
|
10
|
+
*/
|
|
11
|
+
export interface TableToCreate {
|
|
12
|
+
table: string;
|
|
13
|
+
fields: Record<string, Field>;
|
|
14
|
+
order: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Type representing table columns to be added during migration
|
|
18
|
+
*/
|
|
19
|
+
export interface ColumnsToAdd {
|
|
20
|
+
table: string;
|
|
21
|
+
fields: Record<string, Field>;
|
|
22
|
+
order: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Type for migration operations
|
|
26
|
+
*/
|
|
27
|
+
export type MigrationOperation = AlterTableColumnAlteringBuilder | CreateTableBuilder<string, string>;
|
|
28
|
+
/**
|
|
29
|
+
* Result of migration generation
|
|
30
|
+
*/
|
|
31
|
+
export interface MigrationResult {
|
|
32
|
+
toBeCreated: TableToCreate[];
|
|
33
|
+
toBeAdded: ColumnsToAdd[];
|
|
34
|
+
runMigrations: () => Promise<void>;
|
|
35
|
+
compileMigrations: () => Promise<string>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/db/migration/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACX,+BAA+B,EAC/B,kBAAkB,EAClB,MAAM,QAAQ,CAAC;AAChB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC3B,+BAA+B,GAC/B,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,WAAW,EAAE,aAAa,EAAE,CAAC;IAC7B,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,aAAa,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,iBAAiB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;CACzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/db/schema/audit-log/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { GenericEndpointContext } from '../../../types';
|
|
2
|
+
import type { RegistryContext } from '../../../types/context';
|
|
3
|
+
import type { AuditLog } from './schema';
|
|
4
|
+
/**
|
|
5
|
+
* Creates and returns a set of consent audit log adapter methods to interact with the database.
|
|
6
|
+
* These methods provide a consistent interface for creating and querying audit logs
|
|
7
|
+
* while applying hooks and enforcing data validation rules.
|
|
8
|
+
*
|
|
9
|
+
* @param adapter - The database adapter used for direct database operations
|
|
10
|
+
* @param ctx - The context object containing the database adapter, hooks, and options
|
|
11
|
+
* @returns An object containing type-safe consent audit log operations
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const auditLogAdapter = createAuditLogAdapter({
|
|
16
|
+
* adapter: databaseAdapter,
|
|
17
|
+
* createWithHooks,
|
|
18
|
+
* options: c15tOptions
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* // Create a new audit log entry
|
|
22
|
+
* const log = await auditLogAdapter.createAuditLog({
|
|
23
|
+
* entityType: 'consent',
|
|
24
|
+
* entityId: 'cns_hadt8w7nngm7xmx2bn',
|
|
25
|
+
* actionType: 'update',
|
|
26
|
+
* subjectId: 'sub_x1pftyoufsm7xgo1kv',
|
|
27
|
+
* changes: { status: { from: 'active', to: 'withdrawn' } }
|
|
28
|
+
* });
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare function auditLogRegistry({ adapter, ...ctx }: RegistryContext): {
|
|
32
|
+
/**
|
|
33
|
+
* Creates a new consent audit log entry in the database.
|
|
34
|
+
* Automatically sets creation timestamp and applies any
|
|
35
|
+
* configured hooks during the creation process.
|
|
36
|
+
*
|
|
37
|
+
* @param auditLog - Audit log data to create (without id and timestamp)
|
|
38
|
+
* @param context - Optional endpoint context for hooks
|
|
39
|
+
* @returns The created audit log entry with all fields populated
|
|
40
|
+
* @throws May throw an error if hooks prevent creation or if database operations fail
|
|
41
|
+
*/
|
|
42
|
+
createAuditLog: (auditLog: Omit<AuditLog, "id" | "createdAt"> & Partial<AuditLog>, context?: GenericEndpointContext) => Promise<{
|
|
43
|
+
id: string;
|
|
44
|
+
entityType: string;
|
|
45
|
+
entityId: string;
|
|
46
|
+
actionType: string;
|
|
47
|
+
createdAt: Date;
|
|
48
|
+
subjectId?: string | undefined;
|
|
49
|
+
ipAddress?: string | undefined;
|
|
50
|
+
userAgent?: string | undefined;
|
|
51
|
+
changes?: Record<string, unknown> | undefined;
|
|
52
|
+
metadata?: Record<string, unknown> | undefined;
|
|
53
|
+
}>;
|
|
54
|
+
/**
|
|
55
|
+
* Finds all audit log entries matching specified filters.
|
|
56
|
+
* Returns logs with processed output fields according to the schema configuration.
|
|
57
|
+
*
|
|
58
|
+
* @param entityType - Optional entity type to filter logs (e.g., 'consent', 'subject')
|
|
59
|
+
* @param entityId - Optional entity ID to filter logs
|
|
60
|
+
* @param actionType - Optional action type to filter logs (e.g., 'create', 'update')
|
|
61
|
+
* @param limit - Optional maximum number of logs to return
|
|
62
|
+
* @param offset - Optional number of logs to skip for pagination
|
|
63
|
+
* @returns Array of audit log entries matching the criteria
|
|
64
|
+
*/
|
|
65
|
+
findAuditLogs: (entityType?: string, entityId?: string, actionType?: string, limit?: number, offset?: number) => Promise<{
|
|
66
|
+
id: string;
|
|
67
|
+
entityType: string;
|
|
68
|
+
entityId: string;
|
|
69
|
+
actionType: string;
|
|
70
|
+
createdAt: Date;
|
|
71
|
+
subjectId?: string | undefined;
|
|
72
|
+
ipAddress?: string | undefined;
|
|
73
|
+
userAgent?: string | undefined;
|
|
74
|
+
changes?: Record<string, unknown> | undefined;
|
|
75
|
+
metadata?: Record<string, unknown> | undefined;
|
|
76
|
+
}[]>;
|
|
77
|
+
/**
|
|
78
|
+
* Finds a specific audit log entry by its ID.
|
|
79
|
+
* Returns the log with processed output fields according to the schema configuration.
|
|
80
|
+
*
|
|
81
|
+
* @param auditLogId - The unique identifier of the audit log entry
|
|
82
|
+
* @returns The audit log entry if found, null otherwise
|
|
83
|
+
*/
|
|
84
|
+
findAuditLogById: (auditLogId: string) => Promise<{
|
|
85
|
+
id: string;
|
|
86
|
+
entityType: string;
|
|
87
|
+
entityId: string;
|
|
88
|
+
actionType: string;
|
|
89
|
+
createdAt: Date;
|
|
90
|
+
subjectId?: string | undefined;
|
|
91
|
+
ipAddress?: string | undefined;
|
|
92
|
+
userAgent?: string | undefined;
|
|
93
|
+
changes?: Record<string, unknown> | undefined;
|
|
94
|
+
metadata?: Record<string, unknown> | undefined;
|
|
95
|
+
} | null>;
|
|
96
|
+
/**
|
|
97
|
+
* Finds all audit log entries for a specific entity.
|
|
98
|
+
* Returns logs with processed output fields according to the schema configuration.
|
|
99
|
+
*
|
|
100
|
+
* @param entityType - The type of entity (e.g., 'consent', 'subject')
|
|
101
|
+
* @param entityId - The unique identifier of the entity
|
|
102
|
+
* @param limit - Optional maximum number of logs to return
|
|
103
|
+
* @returns Array of audit log entries for the specified entity
|
|
104
|
+
*/
|
|
105
|
+
findAuditLogsByEntity: (entityType: string, entityId: string, limit?: number) => Promise<{
|
|
106
|
+
id: string;
|
|
107
|
+
entityType: string;
|
|
108
|
+
entityId: string;
|
|
109
|
+
actionType: string;
|
|
110
|
+
createdAt: Date;
|
|
111
|
+
subjectId?: string | undefined;
|
|
112
|
+
ipAddress?: string | undefined;
|
|
113
|
+
userAgent?: string | undefined;
|
|
114
|
+
changes?: Record<string, unknown> | undefined;
|
|
115
|
+
metadata?: Record<string, unknown> | undefined;
|
|
116
|
+
}[]>;
|
|
117
|
+
/**
|
|
118
|
+
* Counts the total number of audit log entries matching specified filters.
|
|
119
|
+
* Useful for pagination and reporting.
|
|
120
|
+
*
|
|
121
|
+
* @param entityType - Optional entity type to filter logs
|
|
122
|
+
* @param entityId - Optional entity ID to filter logs
|
|
123
|
+
* @param actionType - Optional action type to filter logs
|
|
124
|
+
* @returns The total count of matching audit log entries
|
|
125
|
+
*/
|
|
126
|
+
countAuditLogs: (entityType?: string, entityId?: string, actionType?: string) => Promise<number>;
|
|
127
|
+
};
|
|
128
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/db/schema/audit-log/registry.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,GAAG,GAAG,EAAE,EAAE,eAAe;IAInE;;;;;;;;;OASG;+BAEQ,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,WAAW,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,YACtD,sBAAsB;;;;;;;;;;;;IAqBjC;;;;;;;;;;OAUG;iCAEW,MAAM,aACR,MAAM,eACJ,MAAM,UACX,MAAM,WACL,MAAM;;;;;;;;;;;;IAyChB;;;;;;OAMG;mCACkC,MAAM;;;;;;;;;;;;IAa3C;;;;;;;;OAQG;wCAEU,MAAM,YACR,MAAM,UACR,MAAM;;;;;;;;;;;;IAyBf;;;;;;;;OAQG;kCAEW,MAAM,aACR,MAAM,eACJ,MAAM;EA+BrB"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Zod schema for validating consent audit log entities.
|
|
4
|
+
*
|
|
5
|
+
* This defines the structure and validation rules for audit log entries:
|
|
6
|
+
* - Required fields: entityType, entityId, actionType
|
|
7
|
+
* - Optional fields: subjectId, ipAddress, changes, metadata
|
|
8
|
+
* - Default current date/time for creation timestamp
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const auditLogData = {
|
|
13
|
+
* id: 'log_w5qufx2a66m7xkn3ty',
|
|
14
|
+
* entityType: 'consent',
|
|
15
|
+
* entityId: 'cns_hadt8w7nngm7xmx2bn',
|
|
16
|
+
* actionType: 'update',
|
|
17
|
+
* subjectId: 'sub_x1pftyoufsm7xgo1kv',
|
|
18
|
+
* changes: { status: { from: 'active', to: 'withdrawn' } }
|
|
19
|
+
* };
|
|
20
|
+
*
|
|
21
|
+
* // Validate and parse the audit log data
|
|
22
|
+
* const validAuditLog = auditLogSchema.parse(auditLogData);
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare const auditLogSchema: z.ZodObject<{
|
|
26
|
+
id: z.ZodString;
|
|
27
|
+
entityType: z.ZodString;
|
|
28
|
+
entityId: z.ZodString;
|
|
29
|
+
actionType: z.ZodString;
|
|
30
|
+
subjectId: z.ZodOptional<z.ZodString>;
|
|
31
|
+
ipAddress: z.ZodOptional<z.ZodString>;
|
|
32
|
+
userAgent: z.ZodOptional<z.ZodString>;
|
|
33
|
+
changes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
34
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
35
|
+
createdAt: z.ZodDefault<z.ZodDate>;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
id: string;
|
|
38
|
+
entityType: string;
|
|
39
|
+
entityId: string;
|
|
40
|
+
actionType: string;
|
|
41
|
+
createdAt: Date;
|
|
42
|
+
subjectId?: string | undefined;
|
|
43
|
+
ipAddress?: string | undefined;
|
|
44
|
+
userAgent?: string | undefined;
|
|
45
|
+
changes?: Record<string, unknown> | undefined;
|
|
46
|
+
metadata?: Record<string, unknown> | undefined;
|
|
47
|
+
}, {
|
|
48
|
+
id: string;
|
|
49
|
+
entityType: string;
|
|
50
|
+
entityId: string;
|
|
51
|
+
actionType: string;
|
|
52
|
+
subjectId?: string | undefined;
|
|
53
|
+
ipAddress?: string | undefined;
|
|
54
|
+
userAgent?: string | undefined;
|
|
55
|
+
changes?: Record<string, unknown> | undefined;
|
|
56
|
+
metadata?: Record<string, unknown> | undefined;
|
|
57
|
+
createdAt?: Date | undefined;
|
|
58
|
+
}>;
|
|
59
|
+
/**
|
|
60
|
+
* Type definition for AuditLog
|
|
61
|
+
*
|
|
62
|
+
* This type represents the structure of a consent audit log entry
|
|
63
|
+
* as defined by the auditLogSchema. It includes all fields
|
|
64
|
+
* that are part of the audit log entity.
|
|
65
|
+
*/
|
|
66
|
+
export type AuditLog = z.infer<typeof auditLogSchema>;
|
|
67
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/db/schema/audit-log/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWzB,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { type Field } from '../../core/fields';
|
|
2
|
+
import type { C15TOptions } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Generates the database table configuration for the consent audit log entity.
|
|
5
|
+
*
|
|
6
|
+
* This function creates a schema definition that includes all standard audit log fields
|
|
7
|
+
* and any additional fields from plugins or configuration. The resulting schema is used
|
|
8
|
+
* for database migrations, schema validation, and query building.
|
|
9
|
+
*
|
|
10
|
+
* @param options - C15T configuration options that may contain audit log table customizations
|
|
11
|
+
* @param auditLogFields - Additional fields from plugins to include in the audit log table
|
|
12
|
+
* @returns A complete table schema definition with fields, model name, and metadata
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const auditLogTableSchema = getAuditLogTable(c15tOptions);
|
|
17
|
+
* // Use the schema for migrations or data access
|
|
18
|
+
* const migrationPlans = generateMigrations(auditLogTableSchema);
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function getAuditLogTable(options: C15TOptions, auditLogFields?: Record<string, Field>): {
|
|
22
|
+
/**
|
|
23
|
+
* The name of the audit log table in the database, configurable through options
|
|
24
|
+
*/
|
|
25
|
+
entityName: string;
|
|
26
|
+
/**
|
|
27
|
+
* The ID prefix for the audit log table
|
|
28
|
+
* Used to generate unique prefixed IDs
|
|
29
|
+
*/
|
|
30
|
+
entityPrefix: string;
|
|
31
|
+
/**
|
|
32
|
+
* The schema for the audit log table
|
|
33
|
+
*/
|
|
34
|
+
schema: import("zod").ZodObject<{
|
|
35
|
+
id: import("zod").ZodString;
|
|
36
|
+
entityType: import("zod").ZodString;
|
|
37
|
+
entityId: import("zod").ZodString;
|
|
38
|
+
actionType: import("zod").ZodString;
|
|
39
|
+
subjectId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
40
|
+
ipAddress: import("zod").ZodOptional<import("zod").ZodString>;
|
|
41
|
+
userAgent: import("zod").ZodOptional<import("zod").ZodString>;
|
|
42
|
+
changes: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
43
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
44
|
+
createdAt: import("zod").ZodDefault<import("zod").ZodDate>;
|
|
45
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
46
|
+
id: string;
|
|
47
|
+
entityType: string;
|
|
48
|
+
entityId: string;
|
|
49
|
+
actionType: string;
|
|
50
|
+
createdAt: Date;
|
|
51
|
+
subjectId?: string | undefined;
|
|
52
|
+
ipAddress?: string | undefined;
|
|
53
|
+
userAgent?: string | undefined;
|
|
54
|
+
changes?: Record<string, unknown> | undefined;
|
|
55
|
+
metadata?: Record<string, unknown> | undefined;
|
|
56
|
+
}, {
|
|
57
|
+
id: string;
|
|
58
|
+
entityType: string;
|
|
59
|
+
entityId: string;
|
|
60
|
+
actionType: string;
|
|
61
|
+
subjectId?: string | undefined;
|
|
62
|
+
ipAddress?: string | undefined;
|
|
63
|
+
userAgent?: string | undefined;
|
|
64
|
+
changes?: Record<string, unknown> | undefined;
|
|
65
|
+
metadata?: Record<string, unknown> | undefined;
|
|
66
|
+
createdAt?: Date | undefined;
|
|
67
|
+
}>;
|
|
68
|
+
/**
|
|
69
|
+
* Field definitions for the consent audit log table
|
|
70
|
+
*/
|
|
71
|
+
fields: {
|
|
72
|
+
/**
|
|
73
|
+
* Type of entity this audit log entry is about (e.g., 'consent', 'subject', 'consentPurpose')
|
|
74
|
+
*/
|
|
75
|
+
entityType: {
|
|
76
|
+
type: string;
|
|
77
|
+
required: boolean;
|
|
78
|
+
fieldName: string;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* ID of the entity this audit log entry is about
|
|
82
|
+
*/
|
|
83
|
+
entityId: {
|
|
84
|
+
type: string;
|
|
85
|
+
required: boolean;
|
|
86
|
+
fieldName: string;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Type of action that was performed on the entity
|
|
90
|
+
* Common values: 'create', 'update', 'delete', 'view'
|
|
91
|
+
*/
|
|
92
|
+
actionType: {
|
|
93
|
+
type: string;
|
|
94
|
+
required: boolean;
|
|
95
|
+
fieldName: string;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Optional ID of the subject who performed the action
|
|
99
|
+
*/
|
|
100
|
+
subjectId: {
|
|
101
|
+
type: string;
|
|
102
|
+
required: boolean;
|
|
103
|
+
fieldName: string;
|
|
104
|
+
references: {
|
|
105
|
+
model: string;
|
|
106
|
+
field: string;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* IP address from which the action was performed
|
|
111
|
+
*/
|
|
112
|
+
ipAddress: {
|
|
113
|
+
type: string;
|
|
114
|
+
required: boolean;
|
|
115
|
+
fieldName: string;
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Subject agent (browser/device) from which the action was performed
|
|
119
|
+
*/
|
|
120
|
+
userAgent: {
|
|
121
|
+
type: string;
|
|
122
|
+
required: boolean;
|
|
123
|
+
fieldName: string;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Detailed changes made to the entity
|
|
127
|
+
* For updates, this typically contains before/after values
|
|
128
|
+
*/
|
|
129
|
+
changes: {
|
|
130
|
+
type: string;
|
|
131
|
+
required: boolean;
|
|
132
|
+
fieldName: string;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Additional metadata about the action
|
|
136
|
+
*/
|
|
137
|
+
metadata: {
|
|
138
|
+
type: string;
|
|
139
|
+
required: boolean;
|
|
140
|
+
fieldName: string;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* When the audit log entry was created
|
|
144
|
+
* Automatically set to current time by default
|
|
145
|
+
*/
|
|
146
|
+
createdAt: {
|
|
147
|
+
type: string;
|
|
148
|
+
defaultValue: () => Date;
|
|
149
|
+
required: boolean;
|
|
150
|
+
fieldName: string;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Timezone where the audit event occurred
|
|
154
|
+
*/
|
|
155
|
+
eventTimezone: {
|
|
156
|
+
type: string;
|
|
157
|
+
required: boolean;
|
|
158
|
+
defaultValue: "UTC";
|
|
159
|
+
fieldName: string;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Add indexes for better query performance
|
|
164
|
+
*/
|
|
165
|
+
indexes: {
|
|
166
|
+
name: string;
|
|
167
|
+
fields: string[];
|
|
168
|
+
}[];
|
|
169
|
+
/**
|
|
170
|
+
* Execution order during migrations (lower numbers run first)
|
|
171
|
+
* Audit log table needs to be created after the subject table it references
|
|
172
|
+
*/
|
|
173
|
+
order: number;
|
|
174
|
+
};
|
|
175
|
+
//# sourceMappingURL=table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/db/schema/audit-log/table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAG3C;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAC/B,OAAO,EAAE,WAAW,EACpB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;IAMrC;;OAEG;;IAGH;;;OAGG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAGH;;OAEG;;QAEF;;WAEG;;;;;;QAOH;;WAEG;;;;;;QAOH;;;WAGG;;;;;;QAOH;;WAEG;;;;;;;;;;QAWH;;WAEG;;;;;;QAOH;;WAEG;;;;;;QAOH;;;WAGG;;;;;;QAOH;;WAEG;;;;;;QAOH;;;WAGG;;;;;;;QAQH;;WAEG;;;;;;;;IAeJ;;OAEG;;;;;IAoBH;;;OAGG;;EAGJ"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Audit Log Entity Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* This module contains type definitions specific to the audit log entity.
|
|
5
|
+
*/
|
|
6
|
+
import type { BaseEntityConfig } from '../types';
|
|
7
|
+
/**
|
|
8
|
+
* Audit log entity configuration
|
|
9
|
+
* @default {entityName: "auditLog", entityPrefix: "log"}
|
|
10
|
+
*
|
|
11
|
+
* These defaults are applied when creating an audit log entity if not explicitly specified.
|
|
12
|
+
* See the entity creation utilities for implementation details.
|
|
13
|
+
*/
|
|
14
|
+
export interface AuditLogEntityConfig extends BaseEntityConfig {
|
|
15
|
+
fields?: Record<string, string> & {
|
|
16
|
+
id?: string;
|
|
17
|
+
timestamp: string;
|
|
18
|
+
action: string;
|
|
19
|
+
subjectId?: string;
|
|
20
|
+
resourceType: string;
|
|
21
|
+
resourceId?: string;
|
|
22
|
+
actor?: string;
|
|
23
|
+
changes?: string;
|
|
24
|
+
deviceInfo?: string;
|
|
25
|
+
ipAddress?: string;
|
|
26
|
+
createdAt?: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/db/schema/audit-log/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG;QACjC,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACF"}
|