@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,154 @@
|
|
|
1
|
+
import type { C15TOptions } from '../../types';
|
|
2
|
+
import type { EntityInput, EntityName } from '../core/types';
|
|
3
|
+
import type { C15TDBSchema } from '../schema/definition';
|
|
4
|
+
import type { KyselyAdapterConfig } from './kysely-adapter';
|
|
5
|
+
/**
|
|
6
|
+
* Type representing the fields of a database table for a specific entity
|
|
7
|
+
*/
|
|
8
|
+
export type TableFields<EntityType extends EntityName> = C15TDBSchema[EntityType]['fields'];
|
|
9
|
+
/**
|
|
10
|
+
* Type representing the possible value types that can be used in query conditions
|
|
11
|
+
*/
|
|
12
|
+
export type Value = string | number | boolean | string[] | number[] | Date | null;
|
|
13
|
+
/**
|
|
14
|
+
* Type representing the comparison operators available for query conditions
|
|
15
|
+
*/
|
|
16
|
+
export type ComparisonOperator = 'eq' | 'ne' | 'lt' | 'lte' | 'gt' | 'gte' | 'in' | 'contains' | 'starts_with' | 'ends_with' | 'ilike';
|
|
17
|
+
/**
|
|
18
|
+
* Type representing the logical connectors for combining query conditions
|
|
19
|
+
*/
|
|
20
|
+
export type LogicalConnector = 'AND' | 'OR';
|
|
21
|
+
/**
|
|
22
|
+
* Type representing a single query condition
|
|
23
|
+
*/
|
|
24
|
+
export type WhereCondition<EntityType extends EntityName> = {
|
|
25
|
+
/** The comparison operator to use (defaults to 'eq') */
|
|
26
|
+
operator?: ComparisonOperator;
|
|
27
|
+
/** The value to compare against */
|
|
28
|
+
value: Value;
|
|
29
|
+
/** The field to apply the condition to */
|
|
30
|
+
field: keyof TableFields<EntityType> | 'id';
|
|
31
|
+
/** The logical connector to use with previous conditions (defaults to 'AND') */
|
|
32
|
+
connector?: LogicalConnector;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Type representing a complete where clause for database queries
|
|
36
|
+
*/
|
|
37
|
+
export type Where<EntityType extends EntityName> = WhereCondition<EntityType>[];
|
|
38
|
+
/**
|
|
39
|
+
* Type representing sorting options for queries
|
|
40
|
+
*/
|
|
41
|
+
export type SortOptions<EntityType extends EntityName> = {
|
|
42
|
+
/** The field to sort by */
|
|
43
|
+
field: keyof TableFields<EntityType> | 'id';
|
|
44
|
+
/** The sort direction */
|
|
45
|
+
direction: 'asc' | 'desc';
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Type representing the result of a schema creation operation
|
|
49
|
+
*/
|
|
50
|
+
export type AdapterSchemaCreation = {
|
|
51
|
+
/** The code to be inserted into the file */
|
|
52
|
+
code: string;
|
|
53
|
+
/** The path to the file */
|
|
54
|
+
path: string;
|
|
55
|
+
/** Whether to append to existing file */
|
|
56
|
+
append?: boolean;
|
|
57
|
+
/** Whether to overwrite existing file */
|
|
58
|
+
overwrite?: boolean;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Interface defining the contract for database adapters
|
|
62
|
+
*/
|
|
63
|
+
export interface Adapter {
|
|
64
|
+
/** Unique identifier for the adapter */
|
|
65
|
+
id: string;
|
|
66
|
+
/** Creates a new record in the database */
|
|
67
|
+
create: <Model extends EntityName, Data extends Record<string, unknown>, Result extends TableFields<Model>>(data: {
|
|
68
|
+
model: Model;
|
|
69
|
+
data: Data;
|
|
70
|
+
select?: Array<keyof Result>;
|
|
71
|
+
}) => Promise<Result>;
|
|
72
|
+
/** Finds a single record matching the where conditions */
|
|
73
|
+
findOne: <Model extends EntityName, Result extends TableFields<Model>>(data: {
|
|
74
|
+
model: Model;
|
|
75
|
+
where: Where<Model>;
|
|
76
|
+
select?: Array<keyof Result>;
|
|
77
|
+
sortBy?: SortOptions<Model>;
|
|
78
|
+
}) => Promise<Result | null>;
|
|
79
|
+
/** Finds multiple records matching the where conditions */
|
|
80
|
+
findMany: <Model extends EntityName>(data: {
|
|
81
|
+
model: Model;
|
|
82
|
+
where?: Where<Model>;
|
|
83
|
+
limit?: number;
|
|
84
|
+
sortBy?: SortOptions<Model>;
|
|
85
|
+
offset?: number;
|
|
86
|
+
}) => Promise<TableFields<Model>[]>;
|
|
87
|
+
/** Counts records matching the where conditions */
|
|
88
|
+
count: <Model extends EntityName>(data: {
|
|
89
|
+
model: Model;
|
|
90
|
+
where?: Where<Model>;
|
|
91
|
+
}) => Promise<number>;
|
|
92
|
+
/** Updates a single record matching the where conditions */
|
|
93
|
+
update: <Model extends EntityName, Result extends TableFields<Model>>(data: {
|
|
94
|
+
model: Model;
|
|
95
|
+
where: Where<Model>;
|
|
96
|
+
update: EntityInput<Model>;
|
|
97
|
+
}) => Promise<Result | null>;
|
|
98
|
+
/** Updates multiple records matching the where conditions */
|
|
99
|
+
updateMany: <Model extends EntityName, Result extends TableFields<Model>>(data: {
|
|
100
|
+
model: Model;
|
|
101
|
+
where: Where<Model>;
|
|
102
|
+
update: Partial<EntityInput<Model>>;
|
|
103
|
+
}) => Promise<Result[]>;
|
|
104
|
+
/** Deletes a single record matching the where conditions */
|
|
105
|
+
delete: <Model extends EntityName>(data: {
|
|
106
|
+
model: Model;
|
|
107
|
+
where: Where<Model>;
|
|
108
|
+
}) => Promise<void>;
|
|
109
|
+
/** Deletes multiple records matching the where conditions */
|
|
110
|
+
deleteMany: <Model extends EntityName>(data: {
|
|
111
|
+
model: Model;
|
|
112
|
+
where: Where<Model>;
|
|
113
|
+
}) => Promise<number>;
|
|
114
|
+
/**
|
|
115
|
+
* Executes a function within a database transaction
|
|
116
|
+
*
|
|
117
|
+
* This method allows multiple database operations to be executed in a single atomic transaction.
|
|
118
|
+
* If any operation within the transaction fails, all operations are rolled back.
|
|
119
|
+
*
|
|
120
|
+
* @typeParam ResultType - The type of data returned by the transaction
|
|
121
|
+
* @param data - The transaction data containing the callback function
|
|
122
|
+
* @returns A promise that resolves with the result of the callback function
|
|
123
|
+
* @throws {Error} If the transaction fails to complete
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```typescript
|
|
127
|
+
* const result = await adapter.transaction({
|
|
128
|
+
* callback: async (tx) => {
|
|
129
|
+
* const subject = await tx.create({
|
|
130
|
+
* model: 'subject',
|
|
131
|
+
* data: { name: 'John Doe' }
|
|
132
|
+
* });
|
|
133
|
+
* await tx.create({
|
|
134
|
+
* model: 'profile',
|
|
135
|
+
* data: { subjectId: subject.id, bio: 'Test bio' }
|
|
136
|
+
* });
|
|
137
|
+
* return subject;
|
|
138
|
+
* }
|
|
139
|
+
* });
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
142
|
+
transaction: <ResultType>(data: {
|
|
143
|
+
callback: (transactionAdapter: Adapter) => Promise<ResultType>;
|
|
144
|
+
}) => Promise<ResultType>;
|
|
145
|
+
/** Optional method to create database schema */
|
|
146
|
+
createSchema?: (options: C15TOptions, file?: string) => Promise<AdapterSchemaCreation>;
|
|
147
|
+
/** Optional adapter-specific configuration */
|
|
148
|
+
options?: KyselyAdapterConfig | Record<string, unknown>;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Type definition for an adapter factory function
|
|
152
|
+
*/
|
|
153
|
+
export type AdapterInstance = (options: C15TOptions) => Adapter;
|
|
154
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/db/adapters/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,O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CAAC,KAAK,CAAC,CAAC;KACpB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,WAAW,EAAE,CAAC,UAAU,EAAE,IAAI,EAAE;QAC/B,QAAQ,EAAE,CAAC,kBAAkB,EAAE,OAAO,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;KAC/D,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAE1B,gDAAgD;IAChD,YAAY,CAAC,EAAE,CACd,OAAO,EAAE,WAAW,EACpB,IAAI,CAAC,EAAE,MAAM,KACT,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAEpC,8CAA8C;IAC9C,OAAO,CAAC,EAAE,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxD;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Field, Primitive } from '../core/fields/field-types';
|
|
2
|
+
/**
|
|
3
|
+
* Applies the default value of a field if the provided value is undefined or null.
|
|
4
|
+
* Used in create and update operations to handle default values consistently.
|
|
5
|
+
*
|
|
6
|
+
* @typeParam PrimitiveValue - The primitive type of the field value
|
|
7
|
+
* @param inputValue - The input value provided for the field (may be undefined/null)
|
|
8
|
+
* @param field - The field definition containing the default value
|
|
9
|
+
* @param operation - The database operation being performed ('create' or 'update')
|
|
10
|
+
* @returns The original value, or the default value if applicable
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* Default values are only applied:
|
|
14
|
+
* 1. During 'create' operations (not during updates)
|
|
15
|
+
* 2. When the input value is undefined or null
|
|
16
|
+
* 3. When the field has a defaultValue defined
|
|
17
|
+
*
|
|
18
|
+
* If the defaultValue is a function, it will be called to generate the value.
|
|
19
|
+
* This allows for dynamic default values such as timestamps, UUIDs, or any
|
|
20
|
+
* other values that need to be computed at runtime.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* // Field with static default
|
|
25
|
+
* const nameField = { type: 'string', defaultValue: 'Anonymous' };
|
|
26
|
+
* applyDefaultValue(undefined, nameField, 'create'); // 'Anonymous'
|
|
27
|
+
* applyDefaultValue('Alice', nameField, 'create'); // 'Alice'
|
|
28
|
+
* applyDefaultValue(undefined, nameField, 'update'); // undefined
|
|
29
|
+
*
|
|
30
|
+
* // Field with dynamic default
|
|
31
|
+
* const createdField = { type: 'date', defaultValue: () => new Date() };
|
|
32
|
+
* applyDefaultValue(undefined, createdField, 'create'); // Current date
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function applyDefaultValue(inputValue: Primitive, field: Field, operation: 'create' | 'update'): Primitive;
|
|
36
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/db/adapters/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,iBAAiB,CAChC,UAAU,EAAE,SAAS,EACrB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,QAAQ,GAAG,QAAQ,GAC5B,SAAS,CAWX"}
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
import type { InferValueType } from './field-inference';
|
|
2
|
+
import type { Field, FieldConfig, FieldType, JsonValue, Primitive } from './field-types';
|
|
3
|
+
/**
|
|
4
|
+
* Defines transform functions for field input and output operations.
|
|
5
|
+
* Provides properly typed transform functions based on the field type.
|
|
6
|
+
*
|
|
7
|
+
* @template TFieldType - The field type that determines the transform function signatures
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* // Define transform functions for a string field
|
|
12
|
+
* const nameTransformers: FieldTransformers<'string'> = {
|
|
13
|
+
* input: (value) => value.trim(),
|
|
14
|
+
* output: (value) => value.toUpperCase()
|
|
15
|
+
* };
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export type FieldTransformers<TFieldType extends FieldType> = {
|
|
19
|
+
/**
|
|
20
|
+
* Transform function for field input.
|
|
21
|
+
* Applied when data is being saved to the database.
|
|
22
|
+
*/
|
|
23
|
+
input?: (value: InferValueType<TFieldType>) => Primitive | Promise<Primitive>;
|
|
24
|
+
/**
|
|
25
|
+
* Transform function for field output.
|
|
26
|
+
* Applied when data is being retrieved from the database.
|
|
27
|
+
*/
|
|
28
|
+
output?: (value: InferValueType<TFieldType>) => Primitive | Promise<Primitive>;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Configuration options specific to number fields.
|
|
32
|
+
* Provides additional validation options for number fields.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* // Define a number field with min/max constraints
|
|
37
|
+
* const ageField = numberField({
|
|
38
|
+
* required: true,
|
|
39
|
+
* min: 0,
|
|
40
|
+
* max: 120
|
|
41
|
+
* });
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export type NumberFieldOptions = {
|
|
45
|
+
/**
|
|
46
|
+
* Minimum allowed value for the number field.
|
|
47
|
+
*/
|
|
48
|
+
min?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Maximum allowed value for the number field.
|
|
51
|
+
*/
|
|
52
|
+
max?: number;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Configuration options specific to string fields.
|
|
56
|
+
* Provides additional validation options for string fields.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* // Define a string field with length constraints
|
|
61
|
+
* const usernameField = stringField({
|
|
62
|
+
* required: true,
|
|
63
|
+
* minLength: 3,
|
|
64
|
+
* maxLength: 20
|
|
65
|
+
* });
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export type StringFieldOptions = {
|
|
69
|
+
/**
|
|
70
|
+
* Minimum allowed length for the string field.
|
|
71
|
+
*/
|
|
72
|
+
minLength?: number;
|
|
73
|
+
/**
|
|
74
|
+
* Maximum allowed length for the string field.
|
|
75
|
+
*/
|
|
76
|
+
maxLength?: number;
|
|
77
|
+
/**
|
|
78
|
+
* Regular expression pattern that the string must match.
|
|
79
|
+
*/
|
|
80
|
+
pattern?: string;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Configuration options specific to date fields.
|
|
84
|
+
* Provides additional validation and formatting options for date fields.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```typescript
|
|
88
|
+
* // Define a date field with min/max date constraints
|
|
89
|
+
* const birthdateField = dateField({
|
|
90
|
+
* required: true,
|
|
91
|
+
* minDate: new Date('1900-01-01'),
|
|
92
|
+
* maxDate: new Date() // Current date
|
|
93
|
+
* });
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
export type DateFieldOptions = {
|
|
97
|
+
/**
|
|
98
|
+
* Minimum allowed date value.
|
|
99
|
+
* Dates earlier than this will fail validation.
|
|
100
|
+
*/
|
|
101
|
+
minDate?: Date;
|
|
102
|
+
/**
|
|
103
|
+
* Maximum allowed date value.
|
|
104
|
+
* Dates later than this will fail validation.
|
|
105
|
+
*/
|
|
106
|
+
maxDate?: Date;
|
|
107
|
+
/**
|
|
108
|
+
* Whether to store just the date part without time information.
|
|
109
|
+
* When true, time components will be zeroed out.
|
|
110
|
+
* @default false
|
|
111
|
+
*/
|
|
112
|
+
dateOnly?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Format string for date output transformation.
|
|
115
|
+
* If provided, dates will be transformed to strings in this format.
|
|
116
|
+
* Only applies if no custom output transform is provided.
|
|
117
|
+
* Uses Intl.DateTimeFormat for consistent cross-platform formatting.
|
|
118
|
+
*/
|
|
119
|
+
format?: Intl.DateTimeFormatOptions;
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* Configuration options specific to JSON fields.
|
|
123
|
+
* Provides additional validation and schema options for JSON data.
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```typescript
|
|
127
|
+
* // Define a JSON field with schema validation
|
|
128
|
+
* const metadataField = jsonField({
|
|
129
|
+
* required: true,
|
|
130
|
+
* validator: (value) => {
|
|
131
|
+
* if (!value.hasOwnProperty('version')) return 'Missing version property';
|
|
132
|
+
* return null;
|
|
133
|
+
* }
|
|
134
|
+
* });
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
export type JsonFieldOptions = {
|
|
138
|
+
/**
|
|
139
|
+
* Whether to validate that the value is a valid JSON object.
|
|
140
|
+
* When true, the field will ensure the value can be properly stringified/parsed.
|
|
141
|
+
* @default true
|
|
142
|
+
*/
|
|
143
|
+
validateJson?: boolean;
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* Common IANA timezone identifiers.
|
|
147
|
+
* A subset of commonly used timezones from the IANA timezone database.
|
|
148
|
+
* Used for validation and autocompletion in IDE.
|
|
149
|
+
*/
|
|
150
|
+
export declare const COMMON_TIMEZONES: {
|
|
151
|
+
readonly UTC: "UTC";
|
|
152
|
+
readonly GMT: "GMT";
|
|
153
|
+
readonly EASTERN: "America/New_York";
|
|
154
|
+
readonly CENTRAL: "America/Chicago";
|
|
155
|
+
readonly MOUNTAIN: "America/Denver";
|
|
156
|
+
readonly PACIFIC: "America/Los_Angeles";
|
|
157
|
+
readonly LONDON: "Europe/London";
|
|
158
|
+
readonly PARIS: "Europe/Paris";
|
|
159
|
+
readonly BERLIN: "Europe/Berlin";
|
|
160
|
+
readonly TOKYO: "Asia/Tokyo";
|
|
161
|
+
readonly SHANGHAI: "Asia/Shanghai";
|
|
162
|
+
readonly SINGAPORE: "Asia/Singapore";
|
|
163
|
+
readonly SYDNEY: "Australia/Sydney";
|
|
164
|
+
readonly SAO_PAULO: "America/Sao_Paulo";
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* Configuration options specific to timezone fields.
|
|
168
|
+
* Provides additional validation options for timezone fields.
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* ```typescript
|
|
172
|
+
* // Define a timezone field with validation
|
|
173
|
+
* const tzField = timezoneField({
|
|
174
|
+
* required: true,
|
|
175
|
+
* defaultValue: COMMON_TIMEZONES.UTC
|
|
176
|
+
* });
|
|
177
|
+
*
|
|
178
|
+
* // Define a timezone field with suggested values
|
|
179
|
+
* const subjectTimezone = timezoneField({
|
|
180
|
+
* required: true,
|
|
181
|
+
* suggestedValues: [
|
|
182
|
+
* COMMON_TIMEZONES.EASTERN,
|
|
183
|
+
* COMMON_TIMEZONES.CENTRAL,
|
|
184
|
+
* COMMON_TIMEZONES.PACIFIC
|
|
185
|
+
* ]
|
|
186
|
+
* });
|
|
187
|
+
* ```
|
|
188
|
+
*
|
|
189
|
+
* @remarks
|
|
190
|
+
* The timezone field stores timezone identifiers according to the IANA timezone database.
|
|
191
|
+
* It validates timezone strings to ensure they are valid IANA timezone identifiers.
|
|
192
|
+
*/
|
|
193
|
+
export type TimezoneFieldOptions = {
|
|
194
|
+
/**
|
|
195
|
+
* Whether to validate the timezone format against IANA timezone database.
|
|
196
|
+
* When true, ensures the value is a valid IANA timezone name.
|
|
197
|
+
* @default true
|
|
198
|
+
*/
|
|
199
|
+
validateTimezone?: boolean;
|
|
200
|
+
/**
|
|
201
|
+
* Suggested values for the timezone field.
|
|
202
|
+
* Can be used by client UIs to provide dropdown options.
|
|
203
|
+
*/
|
|
204
|
+
suggestedValues?: string[] | readonly string[];
|
|
205
|
+
/**
|
|
206
|
+
* Whether to restrict values to only the provided suggestedValues.
|
|
207
|
+
* If true, values not in suggestedValues will fail validation.
|
|
208
|
+
* @default false
|
|
209
|
+
*/
|
|
210
|
+
restrictToSuggestedValues?: boolean;
|
|
211
|
+
};
|
|
212
|
+
/**
|
|
213
|
+
* Creates a field attribute with the specified configuration.
|
|
214
|
+
* This is the core function for defining schema fields with type safety.
|
|
215
|
+
*
|
|
216
|
+
* @template TFieldType - The field type to create
|
|
217
|
+
* @template TConfig - The configuration type for the field
|
|
218
|
+
*
|
|
219
|
+
* @param type - The field type to create
|
|
220
|
+
* @param config - Configuration options for the field
|
|
221
|
+
* @returns A fully configured field definition
|
|
222
|
+
*
|
|
223
|
+
* @example
|
|
224
|
+
* ```typescript
|
|
225
|
+
* // Create a basic string field
|
|
226
|
+
* const nameField = createField('string', {
|
|
227
|
+
* required: true
|
|
228
|
+
* });
|
|
229
|
+
*
|
|
230
|
+
* // Create a number field with transforms
|
|
231
|
+
* const ageField = createField('number', {
|
|
232
|
+
* required: false,
|
|
233
|
+
* transform: {
|
|
234
|
+
* input: (value) => Math.floor(value)
|
|
235
|
+
* }
|
|
236
|
+
* });
|
|
237
|
+
* ```
|
|
238
|
+
*/
|
|
239
|
+
export declare function createField<TFieldType extends FieldType>(type: TFieldType, config?: Omit<FieldConfig<TFieldType>, 'type'>): Field<TFieldType>;
|
|
240
|
+
/**
|
|
241
|
+
* Creates a string field with the specified configuration.
|
|
242
|
+
*/
|
|
243
|
+
export declare function stringField<TConfig extends Omit<FieldConfig<'string'>, 'type' | 'transform'> & {
|
|
244
|
+
transform?: {
|
|
245
|
+
input?: (value: string) => Primitive | Promise<Primitive>;
|
|
246
|
+
output?: (value: unknown) => string | Promise<string>;
|
|
247
|
+
};
|
|
248
|
+
} & StringFieldOptions>(config?: TConfig): Field<'string'>;
|
|
249
|
+
/**
|
|
250
|
+
* Creates a number field with the specified configuration.
|
|
251
|
+
*/
|
|
252
|
+
export declare function numberField<TConfig extends Omit<FieldConfig<'number'>, 'type' | 'transform'> & {
|
|
253
|
+
transform?: {
|
|
254
|
+
input?: (value: number) => Primitive | Promise<Primitive>;
|
|
255
|
+
output?: (value: unknown) => number | Promise<number>;
|
|
256
|
+
};
|
|
257
|
+
} & NumberFieldOptions>(config?: TConfig): Field<'number'>;
|
|
258
|
+
/**
|
|
259
|
+
* Creates a boolean field with the specified configuration.
|
|
260
|
+
*/
|
|
261
|
+
export declare function booleanField<TConfig extends Omit<FieldConfig<'boolean'>, 'type' | 'transform'> & {
|
|
262
|
+
transform?: {
|
|
263
|
+
input?: (value: boolean) => Primitive | Promise<Primitive>;
|
|
264
|
+
output?: (value: unknown) => boolean | Promise<boolean>;
|
|
265
|
+
};
|
|
266
|
+
}>(config?: TConfig): Field<'boolean'>;
|
|
267
|
+
/**
|
|
268
|
+
* Creates a date field with the specified configuration.
|
|
269
|
+
*/
|
|
270
|
+
export declare function dateField<TConfig extends Omit<FieldConfig<'date'>, 'type' | 'transform' | 'minDate' | 'maxDate' | 'dateOnly' | 'format'> & {
|
|
271
|
+
transform?: {
|
|
272
|
+
input?: (value: Date) => Primitive | Promise<Primitive>;
|
|
273
|
+
output?: (value: unknown) => Date | Promise<Date>;
|
|
274
|
+
};
|
|
275
|
+
} & DateFieldOptions>(config?: TConfig): Field<'date'>;
|
|
276
|
+
/**
|
|
277
|
+
* Creates a timezone field with the specified configuration.
|
|
278
|
+
* Convenience wrapper around createField with timezone type.
|
|
279
|
+
*
|
|
280
|
+
* @template TConfig - The configuration type for the field
|
|
281
|
+
*
|
|
282
|
+
* @param config - Configuration options for the field
|
|
283
|
+
* @returns A fully configured timezone field definition
|
|
284
|
+
*
|
|
285
|
+
* @example
|
|
286
|
+
* ```typescript
|
|
287
|
+
* // Create a required timezone field with a default value
|
|
288
|
+
* const timezoneField = {
|
|
289
|
+
* timezone: timezoneField({
|
|
290
|
+
* required: true,
|
|
291
|
+
* defaultValue: COMMON_TIMEZONES.UTC
|
|
292
|
+
* })
|
|
293
|
+
* };
|
|
294
|
+
*
|
|
295
|
+
* // Create a timezone field with restricted values
|
|
296
|
+
* const regionTimezone = timezoneField({
|
|
297
|
+
* required: true,
|
|
298
|
+
* suggestedValues: [
|
|
299
|
+
* COMMON_TIMEZONES.EASTERN,
|
|
300
|
+
* COMMON_TIMEZONES.CENTRAL,
|
|
301
|
+
* COMMON_TIMEZONES.MOUNTAIN,
|
|
302
|
+
* COMMON_TIMEZONES.PACIFIC
|
|
303
|
+
* ],
|
|
304
|
+
* restrictToSuggestedValues: true
|
|
305
|
+
* });
|
|
306
|
+
* ```
|
|
307
|
+
*
|
|
308
|
+
* @remarks
|
|
309
|
+
* The timezone field stores timezone identifiers according to the IANA timezone database.
|
|
310
|
+
* It validates timezone strings to ensure they are valid IANA timezone identifiers.
|
|
311
|
+
*/
|
|
312
|
+
export declare function timezoneField<TConfig extends Omit<FieldConfig<'timezone'>, 'type' | 'transform'> & {
|
|
313
|
+
transform?: {
|
|
314
|
+
input?: (value: string) => string | Promise<string>;
|
|
315
|
+
output?: (value: unknown) => string | Promise<string>;
|
|
316
|
+
};
|
|
317
|
+
} & TimezoneFieldOptions>(config?: TConfig): Field<'timezone'>;
|
|
318
|
+
/**
|
|
319
|
+
* Creates a string array field with the specified configuration.
|
|
320
|
+
*/
|
|
321
|
+
export declare function stringArrayField<TConfig extends Omit<FieldConfig<'string[]'>, 'type' | 'transform'> & {
|
|
322
|
+
transform?: {
|
|
323
|
+
input?: (value: string[]) => Primitive | Promise<Primitive>;
|
|
324
|
+
output?: (value: unknown) => string[] | Promise<string[]>;
|
|
325
|
+
};
|
|
326
|
+
}>(config?: TConfig): Field<'string[]'>;
|
|
327
|
+
/**
|
|
328
|
+
* Creates a number array field with the specified configuration.
|
|
329
|
+
*/
|
|
330
|
+
export declare function numberArrayField<TConfig extends Omit<FieldConfig<'number[]'>, 'type' | 'transform'> & {
|
|
331
|
+
transform?: {
|
|
332
|
+
input?: (value: number[]) => Primitive | Promise<Primitive>;
|
|
333
|
+
output?: (value: unknown) => number[] | Promise<number[]>;
|
|
334
|
+
};
|
|
335
|
+
}>(config?: TConfig): Field<'number[]'>;
|
|
336
|
+
/**
|
|
337
|
+
* Creates a JSON field with the specified configuration.
|
|
338
|
+
*/
|
|
339
|
+
export declare function jsonField<TConfig extends Omit<FieldConfig<'json'>, 'type' | 'transform'> & {
|
|
340
|
+
transform?: {
|
|
341
|
+
input?: (value: JsonValue) => Primitive | Promise<Primitive>;
|
|
342
|
+
output?: (value: unknown) => JsonValue | Promise<JsonValue>;
|
|
343
|
+
};
|
|
344
|
+
} & JsonFieldOptions>(config?: TConfig): Field<'json'>;
|
|
345
|
+
/**
|
|
346
|
+
* Utility functions for working with dates and timezones.
|
|
347
|
+
* Provides helper methods for common date and timezone operations.
|
|
348
|
+
*/
|
|
349
|
+
export declare const DateTimeUtils: {
|
|
350
|
+
/**
|
|
351
|
+
* Creates a Date object in a specific timezone.
|
|
352
|
+
*
|
|
353
|
+
* @param dateInput - Date object or ISO string to convert
|
|
354
|
+
* @param timezone - Target timezone (IANA timezone identifier)
|
|
355
|
+
* @returns Date object adjusted for the specified timezone
|
|
356
|
+
*/
|
|
357
|
+
createDateInTimezone: (dateInput: Date | string, timezone: string) => Date;
|
|
358
|
+
/**
|
|
359
|
+
* Formats a date according to the specified timezone.
|
|
360
|
+
*
|
|
361
|
+
* @param date - The date to format
|
|
362
|
+
* @param timezone - Target timezone (IANA timezone identifier)
|
|
363
|
+
* @param options - Formatting options for Intl.DateTimeFormat
|
|
364
|
+
* @returns Formatted date string in the specified timezone
|
|
365
|
+
*/
|
|
366
|
+
formatInTimezone: (date: Date, timezone: string, options?: Intl.DateTimeFormatOptions) => string;
|
|
367
|
+
/**
|
|
368
|
+
* Gets the current date in a specific timezone.
|
|
369
|
+
*
|
|
370
|
+
* @param timezone - Target timezone (IANA timezone identifier)
|
|
371
|
+
* @returns Current date adjusted for the specified timezone
|
|
372
|
+
*/
|
|
373
|
+
getNowInTimezone: (timezone: string) => Date;
|
|
374
|
+
/**
|
|
375
|
+
* Calculates the offset in minutes between the local timezone and the specified timezone.
|
|
376
|
+
*
|
|
377
|
+
* @param timezone - Target timezone (IANA timezone identifier)
|
|
378
|
+
* @param date - Optional date to calculate the offset for (defaults to current date)
|
|
379
|
+
* @returns Offset in minutes between local and specified timezone
|
|
380
|
+
*/
|
|
381
|
+
getTimezoneOffset: (timezone: string, date?: Date) => number;
|
|
382
|
+
};
|
|
383
|
+
//# sourceMappingURL=field-factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-factory.d.ts","sourceRoot":"","sources":["../../../../src/db/core/fields/field-factory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EACX,KAAK,EACL,WAAW,EACX,SAAS,EACT,SAAS,EACT,SAAS,EACT,MAAM,eAAe,CAAC;AAQvB;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,iBAAiB,CAAC,UAAU,SAAS,SAAS,IAAI;IAC7D;;;OAGG;IACH,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,CAAC,UAAU,CAAC,KAAK,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAC9E;;;OAGG;IACH,MAAM,CAAC,EAAE,CACR,KAAK,EAAE,cAAc,CAAC,UAAU,CAAC,KAC7B,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;CACpC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAChC;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAChC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAA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