@c15t/backend 1.0.5 → 1.2.0-canary.0
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 +33 -39
- package/.turbo/turbo-fmt.log +3 -3
- package/.turbo/turbo-test.log +531 -0
- package/coverage/coverage-final.json +84 -0
- package/coverage/coverage-summary.json +85 -0
- package/coverage/html/backend/index.html +116 -0
- package/coverage/html/backend/rslib.config.ts.html +415 -0
- package/coverage/html/backend/src/contracts/consent/index.html +161 -0
- package/coverage/html/backend/src/contracts/consent/index.ts.html +112 -0
- package/coverage/html/backend/src/contracts/consent/post.contract.ts.html +559 -0
- package/coverage/html/backend/src/contracts/consent/show-banner.contract.ts.html +220 -0
- package/coverage/html/backend/src/contracts/consent/verify.contract.ts.html +463 -0
- package/coverage/html/backend/src/contracts/index.html +116 -0
- package/coverage/html/backend/src/contracts/index.ts.html +139 -0
- package/coverage/html/backend/src/contracts/meta/index.html +131 -0
- package/coverage/html/backend/src/contracts/meta/index.ts.html +100 -0
- package/coverage/html/backend/src/contracts/meta/status.contract.ts.html +196 -0
- package/coverage/html/backend/src/contracts/shared/index.html +116 -0
- package/coverage/html/backend/src/contracts/shared/jurisdiction.schema.ts.html +175 -0
- package/coverage/html/backend/src/core.ts.html +1624 -0
- package/coverage/html/backend/src/handlers/consent/index.html +161 -0
- package/coverage/html/backend/src/handlers/consent/index.ts.html +112 -0
- package/coverage/html/backend/src/handlers/consent/post.handler.ts.html +889 -0
- package/coverage/html/backend/src/handlers/consent/show-banner.handler.ts.html +535 -0
- package/coverage/html/backend/src/handlers/consent/verify.handler.ts.html +1000 -0
- package/coverage/html/backend/src/handlers/meta/index.html +131 -0
- package/coverage/html/backend/src/handlers/meta/index.ts.html +100 -0
- package/coverage/html/backend/src/handlers/meta/status.handler.ts.html +226 -0
- package/coverage/html/backend/src/index.html +161 -0
- package/coverage/html/backend/src/init.ts.html +1018 -0
- package/coverage/html/backend/src/pkgs/api-router/hooks/index.html +116 -0
- package/coverage/html/backend/src/pkgs/api-router/hooks/processor.ts.html +544 -0
- package/coverage/html/backend/src/pkgs/api-router/index.html +116 -0
- package/coverage/html/backend/src/pkgs/api-router/telemetry.ts.html +334 -0
- package/coverage/html/backend/src/pkgs/api-router/utils/cors.ts.html +304 -0
- package/coverage/html/backend/src/pkgs/api-router/utils/index.html +131 -0
- package/coverage/html/backend/src/pkgs/api-router/utils/ip.ts.html +361 -0
- package/coverage/html/backend/src/pkgs/data-model/fields/field-factory.ts.html +709 -0
- package/coverage/html/backend/src/pkgs/data-model/fields/id-generator.ts.html +256 -0
- package/coverage/html/backend/src/pkgs/data-model/fields/index.html +161 -0
- package/coverage/html/backend/src/pkgs/data-model/fields/superjson-utils.ts.html +136 -0
- package/coverage/html/backend/src/pkgs/data-model/fields/zod-fields.ts.html +496 -0
- package/coverage/html/backend/src/pkgs/data-model/hooks/create-hooks.ts.html +349 -0
- package/coverage/html/backend/src/pkgs/data-model/hooks/index.html +176 -0
- package/coverage/html/backend/src/pkgs/data-model/hooks/update-hooks.ts.html +358 -0
- package/coverage/html/backend/src/pkgs/data-model/hooks/update-many-hooks.ts.html +613 -0
- package/coverage/html/backend/src/pkgs/data-model/hooks/utils.ts.html +538 -0
- package/coverage/html/backend/src/pkgs/data-model/hooks/with-hooks-factory.ts.html +289 -0
- package/coverage/html/backend/src/pkgs/db-adapters/adapter-factory.ts.html +289 -0
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/drizzle-adapter/drizzle-adapter.ts.html +2203 -0
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/drizzle-adapter/index.html +116 -0
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/index.html +116 -0
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/kysely-adapter/dialect.ts.html +670 -0
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/kysely-adapter/index.html +131 -0
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/kysely-adapter/kysely-adapter.ts.html +3634 -0
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/kysely-adapter/tests/index.html +116 -0
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/kysely-adapter/tests/test-utils.ts.html +1417 -0
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/memory-adapter/index.html +116 -0
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/memory-adapter/memory-adapter.ts.html +2071 -0
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/prisma-adapter/index.html +116 -0
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/prisma-adapter/prisma-adapter.ts.html +1834 -0
- package/coverage/html/backend/src/pkgs/db-adapters/adapters/test.ts.html +316 -0
- package/coverage/html/backend/src/pkgs/db-adapters/index.html +131 -0
- package/coverage/html/backend/src/pkgs/db-adapters/utils.ts.html +238 -0
- package/coverage/html/backend/src/pkgs/migrations/get-migration.ts.html +343 -0
- package/coverage/html/backend/src/pkgs/migrations/get-schema/get-schema.ts.html +217 -0
- package/coverage/html/backend/src/pkgs/migrations/get-schema/index.html +146 -0
- package/coverage/html/backend/src/pkgs/migrations/get-schema/process-fields.ts.html +280 -0
- package/coverage/html/backend/src/pkgs/migrations/get-schema/process-tables.ts.html +289 -0
- package/coverage/html/backend/src/pkgs/migrations/index.html +176 -0
- package/coverage/html/backend/src/pkgs/migrations/migration-builders.ts.html +595 -0
- package/coverage/html/backend/src/pkgs/migrations/migration-execution.ts.html +301 -0
- package/coverage/html/backend/src/pkgs/migrations/schema-comparison.ts.html +694 -0
- package/coverage/html/backend/src/pkgs/migrations/type-mapping.ts.html +817 -0
- package/coverage/html/backend/src/pkgs/results/core/error-class.ts.html +976 -0
- package/coverage/html/backend/src/pkgs/results/core/error-codes.ts.html +703 -0
- package/coverage/html/backend/src/pkgs/results/core/index.html +146 -0
- package/coverage/html/backend/src/pkgs/results/core/tracing.ts.html +280 -0
- package/coverage/html/backend/src/pkgs/results/create-telemetry-options.ts.html +271 -0
- package/coverage/html/backend/src/pkgs/results/index.html +131 -0
- package/coverage/html/backend/src/pkgs/results/orpc-error-handler.ts.html +496 -0
- package/coverage/html/backend/src/pkgs/results/results/index.html +131 -0
- package/coverage/html/backend/src/pkgs/results/results/recovery-utils.ts.html +628 -0
- package/coverage/html/backend/src/pkgs/results/results/result-helpers.ts.html +1234 -0
- package/coverage/html/backend/src/pkgs/utils/env.ts.html +337 -0
- package/coverage/html/backend/src/pkgs/utils/index.html +146 -0
- package/coverage/html/backend/src/pkgs/utils/logger.ts.html +199 -0
- package/coverage/html/backend/src/pkgs/utils/url.ts.html +400 -0
- package/coverage/html/backend/src/router.ts.html +109 -0
- package/coverage/html/backend/src/schema/audit-log/index.html +146 -0
- package/coverage/html/backend/src/schema/audit-log/registry.ts.html +436 -0
- package/coverage/html/backend/src/schema/audit-log/schema.ts.html +223 -0
- package/coverage/html/backend/src/schema/audit-log/table.ts.html +640 -0
- package/coverage/html/backend/src/schema/consent/index.html +146 -0
- package/coverage/html/backend/src/schema/consent/registry.ts.html +616 -0
- package/coverage/html/backend/src/schema/consent/schema.ts.html +238 -0
- package/coverage/html/backend/src/schema/consent/table.ts.html +748 -0
- package/coverage/html/backend/src/schema/consent-policy/index.html +146 -0
- package/coverage/html/backend/src/schema/consent-policy/registry.ts.html +1063 -0
- package/coverage/html/backend/src/schema/consent-policy/schema.ts.html +265 -0
- package/coverage/html/backend/src/schema/consent-policy/table.ts.html +535 -0
- package/coverage/html/backend/src/schema/consent-purpose/index.html +146 -0
- package/coverage/html/backend/src/schema/consent-purpose/registry.ts.html +589 -0
- package/coverage/html/backend/src/schema/consent-purpose/schema.ts.html +259 -0
- package/coverage/html/backend/src/schema/consent-purpose/table.ts.html +547 -0
- package/coverage/html/backend/src/schema/consent-record/index.html +131 -0
- package/coverage/html/backend/src/schema/consent-record/schema.ts.html +211 -0
- package/coverage/html/backend/src/schema/consent-record/table.ts.html +457 -0
- package/coverage/html/backend/src/schema/create-registry.ts.html +148 -0
- package/coverage/html/backend/src/schema/definition.ts.html +685 -0
- package/coverage/html/backend/src/schema/domain/index.html +146 -0
- package/coverage/html/backend/src/schema/domain/registry.ts.html +973 -0
- package/coverage/html/backend/src/schema/domain/schema.ts.html +214 -0
- package/coverage/html/backend/src/schema/domain/table.ts.html +496 -0
- package/coverage/html/backend/src/schema/index.html +146 -0
- package/coverage/html/backend/src/schema/schemas.ts.html +166 -0
- package/coverage/html/backend/src/schema/subject/index.html +146 -0
- package/coverage/html/backend/src/schema/subject/registry.ts.html +973 -0
- package/coverage/html/backend/src/schema/subject/schema.ts.html +208 -0
- package/coverage/html/backend/src/schema/subject/table.ts.html +499 -0
- package/coverage/html/backend/src/server.ts.html +475 -0
- package/coverage/html/backend/src/testing/contract-testing.ts.html +1348 -0
- package/coverage/html/backend/src/testing/index.html +116 -0
- package/coverage/html/base.css +224 -0
- package/coverage/html/block-navigation.js +87 -0
- package/coverage/html/favicon.png +0 -0
- package/coverage/html/index.html +626 -0
- package/coverage/html/prettify.css +1 -0
- package/coverage/html/prettify.js +2 -0
- package/coverage/html/sort-arrow-sprite.png +0 -0
- package/coverage/html/sorter.js +196 -0
- package/dist/contracts/consent/index.d.ts +401 -0
- package/dist/contracts/consent/index.d.ts.map +1 -0
- package/dist/contracts/consent/index.test.d.ts +2 -0
- package/dist/contracts/consent/index.test.d.ts.map +1 -0
- package/dist/contracts/consent/post.contract.d.ts +212 -0
- package/dist/contracts/consent/post.contract.d.ts.map +1 -0
- package/dist/contracts/consent/post.contract.test.d.ts +2 -0
- package/dist/contracts/consent/post.contract.test.d.ts.map +1 -0
- package/dist/contracts/consent/show-banner.contract.d.ts +45 -0
- package/dist/contracts/consent/show-banner.contract.d.ts.map +1 -0
- package/dist/contracts/consent/show-banner.contract.test.d.ts +2 -0
- package/dist/contracts/consent/show-banner.contract.test.d.ts.map +1 -0
- package/dist/contracts/consent/verify.contract.d.ts +147 -0
- package/dist/contracts/consent/verify.contract.d.ts.map +1 -0
- package/dist/contracts/consent/verify.contract.test.d.ts +2 -0
- package/dist/contracts/consent/verify.contract.test.d.ts.map +1 -0
- package/dist/contracts/index.d.ts +963 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/meta/index.d.ts +78 -0
- package/dist/contracts/meta/index.d.ts.map +1 -0
- package/dist/contracts/meta/index.test.d.ts +2 -0
- package/dist/contracts/meta/index.test.d.ts.map +1 -0
- package/dist/contracts/meta/status.contract.d.ts +77 -0
- package/dist/contracts/meta/status.contract.d.ts.map +1 -0
- package/dist/contracts/meta/status.contract.test.d.ts +2 -0
- package/dist/contracts/meta/status.contract.test.d.ts.map +1 -0
- package/dist/contracts/shared/jurisdiction.schema.d.ts +24 -0
- package/dist/contracts/shared/jurisdiction.schema.d.ts.map +1 -0
- package/dist/core.cjs +3584 -0
- package/dist/core.d.ts +533 -76
- package/dist/core.d.ts.map +1 -1
- package/dist/{index.js → core.js} +1163 -1286
- package/dist/handlers/consent/index.d.ts +401 -0
- package/dist/handlers/consent/index.d.ts.map +1 -0
- package/dist/handlers/consent/post.handler.d.ts +234 -0
- package/dist/handlers/consent/post.handler.d.ts.map +1 -0
- package/dist/handlers/consent/show-banner.handler.d.ts +57 -0
- package/dist/handlers/consent/show-banner.handler.d.ts.map +1 -0
- package/dist/handlers/consent/show-banner.handler.test.d.ts +2 -0
- package/dist/handlers/consent/show-banner.handler.test.d.ts.map +1 -0
- package/dist/handlers/consent/verify.handler.d.ts +169 -0
- package/dist/handlers/consent/verify.handler.d.ts.map +1 -0
- package/dist/handlers/meta/index.d.ts +78 -0
- package/dist/handlers/meta/index.d.ts.map +1 -0
- package/dist/handlers/meta/status.handler.d.ts +76 -0
- package/dist/handlers/meta/status.handler.d.ts.map +1 -0
- package/dist/init.d.ts.map +1 -1
- package/dist/pkgs/api-router/hooks/processor.d.ts.map +1 -1
- package/dist/pkgs/api-router/types/router-props.d.ts +1 -1
- package/dist/pkgs/api-router/types/router-props.d.ts.map +1 -1
- package/dist/pkgs/api-router/utils/cors.d.ts +1 -1
- package/dist/pkgs/api-router/utils/cors.d.ts.map +1 -1
- package/dist/pkgs/data-model/fields/field-types.d.ts +1 -1
- package/dist/pkgs/data-model/fields/zod-fields.d.ts +32 -32
- package/dist/pkgs/data-model/index.cjs +1433 -1799
- package/dist/pkgs/data-model/index.js +20 -385
- package/dist/pkgs/data-model/schema/index.cjs +1402 -1768
- package/dist/pkgs/data-model/schema/index.js +20 -385
- package/dist/pkgs/db-adapters/adapter-factory.d.ts +2 -2
- package/dist/pkgs/db-adapters/adapter-factory.d.ts.map +1 -1
- package/dist/pkgs/db-adapters/adapters/drizzle-adapter/drizzle-adapter.d.ts +4 -4
- package/dist/pkgs/db-adapters/adapters/drizzle-adapter/index.cjs +19 -151
- package/dist/pkgs/db-adapters/adapters/drizzle-adapter/index.js +19 -151
- package/dist/pkgs/db-adapters/adapters/kysely-adapter/dialect.d.ts +1 -1
- package/dist/pkgs/db-adapters/adapters/kysely-adapter/index.cjs +17 -149
- package/dist/pkgs/db-adapters/adapters/kysely-adapter/index.js +17 -149
- package/dist/pkgs/db-adapters/adapters/kysely-adapter/tests/test-utils.d.ts +2 -2
- package/dist/pkgs/db-adapters/adapters/kysely-adapter/tests/test-utils.d.ts.map +1 -1
- package/dist/pkgs/db-adapters/adapters/memory-adapter/index.cjs +17 -149
- package/dist/pkgs/db-adapters/adapters/memory-adapter/index.js +17 -149
- package/dist/pkgs/db-adapters/adapters/prisma-adapter/index.cjs +19 -151
- package/dist/pkgs/db-adapters/adapters/prisma-adapter/index.js +19 -151
- package/dist/pkgs/db-adapters/index.cjs +31 -153
- package/dist/pkgs/db-adapters/index.js +31 -153
- package/dist/pkgs/migrations/get-schema/get-schema.d.ts +2 -2
- package/dist/pkgs/migrations/get-schema/index.d.ts +1 -1
- package/dist/pkgs/migrations/index.cjs +30 -153
- package/dist/pkgs/migrations/index.js +30 -153
- package/dist/pkgs/migrations/schema-comparison.d.ts.map +1 -1
- package/dist/pkgs/results/core/error-class.d.ts +23 -21
- package/dist/pkgs/results/core/error-class.d.ts.map +1 -1
- package/dist/pkgs/results/index.cjs +17 -150
- package/dist/pkgs/results/index.d.ts +0 -3
- package/dist/pkgs/results/index.d.ts.map +1 -1
- package/dist/pkgs/results/index.js +17 -138
- package/dist/pkgs/results/orpc-error-handler.d.ts +65 -0
- package/dist/pkgs/results/orpc-error-handler.d.ts.map +1 -0
- package/dist/pkgs/results/types.d.ts +7 -7
- package/dist/pkgs/results/types.d.ts.map +1 -1
- package/dist/pkgs/types/context.d.ts +15 -4
- package/dist/pkgs/types/context.d.ts.map +1 -1
- package/dist/pkgs/types/endpoints.d.ts +3 -4
- package/dist/pkgs/types/endpoints.d.ts.map +1 -1
- package/dist/pkgs/types/options.d.ts +2 -3
- package/dist/pkgs/types/options.d.ts.map +1 -1
- package/dist/pkgs/types/plugins.d.ts +2 -3
- package/dist/pkgs/types/plugins.d.ts.map +1 -1
- package/dist/pkgs/utils/index.d.ts +1 -0
- package/dist/pkgs/utils/index.d.ts.map +1 -1
- package/dist/pkgs/utils/logger.d.ts +16 -0
- package/dist/pkgs/utils/logger.d.ts.map +1 -0
- package/dist/router.cjs +1213 -0
- package/dist/router.d.ts +480 -0
- package/dist/router.d.ts.map +1 -0
- package/dist/router.js +1169 -0
- package/dist/schema/audit-log/table.d.ts +1 -1
- package/dist/schema/consent/table.d.ts +1 -1
- package/dist/schema/consent-policy/registry.d.ts +12 -12
- package/dist/schema/consent-policy/schema.d.ts +6 -6
- package/dist/schema/consent-policy/table.d.ts +7 -7
- package/dist/schema/consent-purpose/registry.d.ts +6 -6
- package/dist/schema/consent-purpose/schema.d.ts +6 -6
- package/dist/schema/consent-purpose/table.d.ts +7 -7
- package/dist/schema/consent-record/table.d.ts +1 -1
- package/dist/schema/create-registry.d.ts +32 -32
- package/dist/schema/definition.d.ts +19 -19
- package/dist/schema/domain/registry.d.ts +10 -10
- package/dist/schema/domain/schema.d.ts +5 -5
- package/dist/schema/domain/table.d.ts +6 -6
- package/dist/schema/index.cjs +1409 -1775
- package/dist/schema/index.js +20 -385
- package/dist/schema/schemas.d.ts +19 -19
- package/dist/schema/subject/registry.d.ts +4 -4
- package/dist/schema/subject/schema.d.ts +2 -2
- package/dist/schema/subject/table.d.ts +3 -3
- package/dist/server.d.ts +2 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/testing/contract-testing.d.ts +37 -0
- package/dist/testing/contract-testing.d.ts.map +1 -0
- package/dist/types/context.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/options.d.ts +33 -2
- package/dist/types/options.d.ts.map +1 -1
- package/dist/types/plugins.d.ts +3 -4
- package/dist/types/plugins.d.ts.map +1 -1
- package/package.json +22 -30
- package/rslib.config.ts +2 -5
- package/src/contracts/consent/index.test.ts +5 -0
- package/src/contracts/consent/index.ts +9 -0
- package/src/contracts/consent/post.contract.test.ts +526 -0
- package/src/contracts/consent/post.contract.ts +160 -0
- package/src/contracts/consent/show-banner.contract.test.ts +214 -0
- package/src/contracts/consent/show-banner.contract.ts +45 -0
- package/src/contracts/consent/verify.contract.test.ts +185 -0
- package/src/contracts/consent/verify.contract.ts +126 -0
- package/src/contracts/index.ts +18 -0
- package/src/contracts/meta/index.test.ts +5 -0
- package/src/contracts/meta/index.ts +5 -0
- package/src/contracts/meta/status.contract.test.ts +338 -0
- package/src/contracts/meta/status.contract.ts +37 -0
- package/src/contracts/shared/jurisdiction.schema.ts +30 -0
- package/src/core.ts +451 -159
- package/src/handlers/consent/index.ts +9 -0
- package/src/handlers/consent/post.handler.ts +273 -0
- package/src/handlers/consent/show-banner.handler.test.ts +148 -0
- package/src/handlers/consent/show-banner.handler.ts +150 -0
- package/src/handlers/consent/verify.handler.ts +305 -0
- package/src/handlers/meta/index.ts +5 -0
- package/src/handlers/meta/status.handler.ts +47 -0
- package/src/init.ts +8 -5
- package/src/pkgs/api-router/hooks/__tests__/processor.test.ts +6 -0
- package/src/pkgs/api-router/hooks/processor.ts +2 -0
- package/src/pkgs/api-router/types/router-props.ts +1 -1
- package/src/pkgs/api-router/utils/cors.ts +1 -1
- package/src/pkgs/data-model/fields/field-types.ts +1 -1
- package/src/pkgs/data-model/fields/id-generator.ts +1 -1
- package/src/pkgs/db-adapters/README.md +3 -3
- package/src/pkgs/db-adapters/adapter-factory.ts +8 -4
- package/src/pkgs/db-adapters/adapters/drizzle-adapter/drizzle-adapter.ts +13 -13
- package/src/pkgs/db-adapters/adapters/kysely-adapter/dialect.ts +1 -1
- package/src/pkgs/db-adapters/adapters/kysely-adapter/tests/postgres.test.ts +1 -1
- package/src/pkgs/db-adapters/adapters/kysely-adapter/tests/sqlite.test.ts +1 -1
- package/src/pkgs/db-adapters/adapters/kysely-adapter/tests/test-utils.ts +2 -2
- package/src/pkgs/migrations/get-migration.ts +3 -3
- package/src/pkgs/migrations/get-schema/get-schema.ts +2 -2
- package/src/pkgs/migrations/get-schema/index.ts +1 -1
- package/src/pkgs/migrations/migration-builders.ts +2 -2
- package/src/pkgs/migrations/migration-execution.ts +2 -2
- package/src/pkgs/migrations/schema-comparison.ts +5 -4
- package/src/pkgs/results/__tests__/error-class.test.ts +8 -7
- package/src/pkgs/results/core/error-class.ts +31 -43
- package/src/pkgs/results/index.ts +0 -10
- package/src/pkgs/results/orpc-error-handler.ts +137 -0
- package/src/pkgs/results/types.ts +8 -7
- package/src/pkgs/types/context.ts +18 -4
- package/src/pkgs/types/endpoints.ts +3 -5
- package/src/pkgs/types/options.ts +2 -3
- package/src/pkgs/types/plugins.ts +2 -3
- package/src/pkgs/utils/index.ts +1 -0
- package/src/pkgs/utils/logger.ts +38 -0
- package/src/router.ts +8 -0
- package/src/schema/audit-log/table.ts +1 -1
- package/src/schema/consent/table.ts +1 -1
- package/src/schema/consent-policy/table.ts +1 -1
- package/src/schema/consent-purpose/table.ts +1 -1
- package/src/schema/consent-record/table.ts +1 -1
- package/src/schema/definition.ts +2 -2
- package/src/schema/domain/table.ts +1 -1
- package/src/schema/subject/table.ts +1 -1
- package/src/server.ts +130 -0
- package/src/testing/contract-testing.ts +437 -0
- package/src/types/context.ts +1 -1
- package/src/types/index.ts +2 -2
- package/src/types/options.ts +38 -2
- package/src/types/plugins.ts +3 -4
- package/dist/index.cjs +0 -3701
- package/dist/index.d.ts +0 -11
- package/dist/index.d.ts.map +0 -1
- package/dist/init.test.d.ts +0 -2
- package/dist/init.test.d.ts.map +0 -1
- package/dist/integrations/cloudflare.cjs +0 -312
- package/dist/integrations/cloudflare.d.ts +0 -32
- package/dist/integrations/cloudflare.d.ts.map +0 -1
- package/dist/integrations/cloudflare.js +0 -278
- package/dist/integrations/next.cjs +0 -276
- package/dist/integrations/next.d.ts +0 -68
- package/dist/integrations/next.d.ts.map +0 -1
- package/dist/integrations/next.js +0 -239
- package/dist/integrations/node.cjs +0 -257
- package/dist/integrations/node.d.ts +0 -29
- package/dist/integrations/node.d.ts.map +0 -1
- package/dist/integrations/node.js +0 -223
- package/dist/pkgs/api-router/index.d.ts +0 -9
- package/dist/pkgs/api-router/index.d.ts.map +0 -1
- package/dist/pkgs/api-router/utils/define-route.d.ts +0 -87
- package/dist/pkgs/api-router/utils/define-route.d.ts.map +0 -1
- package/dist/pkgs/logger/__tests__/console-formatter.test.d.ts +0 -2
- package/dist/pkgs/logger/__tests__/console-formatter.test.d.ts.map +0 -1
- package/dist/pkgs/logger/__tests__/integration.test.d.ts +0 -2
- package/dist/pkgs/logger/__tests__/integration.test.d.ts.map +0 -1
- package/dist/pkgs/logger/__tests__/log-levels.test.d.ts +0 -2
- package/dist/pkgs/logger/__tests__/log-levels.test.d.ts.map +0 -1
- package/dist/pkgs/logger/__tests__/logger-factory.test.d.ts +0 -2
- package/dist/pkgs/logger/__tests__/logger-factory.test.d.ts.map +0 -1
- package/dist/pkgs/logger/__tests__/result-logging.test.d.ts +0 -2
- package/dist/pkgs/logger/__tests__/result-logging.test.d.ts.map +0 -1
- package/dist/pkgs/logger/__tests__/types.test.d.ts +0 -2
- package/dist/pkgs/logger/__tests__/types.test.d.ts.map +0 -1
- package/dist/pkgs/logger/console-formatter.d.ts +0 -56
- package/dist/pkgs/logger/console-formatter.d.ts.map +0 -1
- package/dist/pkgs/logger/index.cjs +0 -240
- package/dist/pkgs/logger/index.d.ts +0 -35
- package/dist/pkgs/logger/index.d.ts.map +0 -1
- package/dist/pkgs/logger/index.js +0 -185
- package/dist/pkgs/logger/log-levels.d.ts +0 -29
- package/dist/pkgs/logger/log-levels.d.ts.map +0 -1
- package/dist/pkgs/logger/logger-factory.d.ts +0 -42
- package/dist/pkgs/logger/logger-factory.d.ts.map +0 -1
- package/dist/pkgs/logger/result-logging.d.ts +0 -71
- package/dist/pkgs/logger/result-logging.d.ts.map +0 -1
- package/dist/pkgs/logger/telemetry.d.ts +0 -14
- package/dist/pkgs/logger/telemetry.d.ts.map +0 -1
- package/dist/pkgs/logger/types.d.ts +0 -121
- package/dist/pkgs/logger/types.d.ts.map +0 -1
- package/dist/pkgs/results/__tests__/retrieval-pipeline.test.d.ts +0 -2
- package/dist/pkgs/results/__tests__/retrieval-pipeline.test.d.ts.map +0 -1
- package/dist/pkgs/results/__tests__/validation-pipeline.test.d.ts +0 -2
- package/dist/pkgs/results/__tests__/validation-pipeline.test.d.ts.map +0 -1
- package/dist/pkgs/results/h3-integration.d.ts +0 -52
- package/dist/pkgs/results/h3-integration.d.ts.map +0 -1
- package/dist/pkgs/results/pipeline/retrieval-pipeline.d.ts +0 -101
- package/dist/pkgs/results/pipeline/retrieval-pipeline.d.ts.map +0 -1
- package/dist/pkgs/results/pipeline/validation-pipeline.d.ts +0 -89
- package/dist/pkgs/results/pipeline/validation-pipeline.d.ts.map +0 -1
- package/dist/response-types.d.ts +0 -19
- package/dist/response-types.d.ts.map +0 -1
- package/dist/routes/__test__/index.test.d.ts +0 -17
- package/dist/routes/__test__/index.test.d.ts.map +0 -1
- package/dist/routes/__test__/set-consent.test.d.ts +0 -2
- package/dist/routes/__test__/set-consent.test.d.ts.map +0 -1
- package/dist/routes/__test__/show-consent-banner.test.d.ts +0 -2
- package/dist/routes/__test__/show-consent-banner.test.d.ts.map +0 -1
- package/dist/routes/__test__/status.test.d.ts +0 -2
- package/dist/routes/__test__/status.test.d.ts.map +0 -1
- package/dist/routes/__test__/verify-consent.test.d.ts +0 -2
- package/dist/routes/__test__/verify-consent.test.d.ts.map +0 -1
- package/dist/routes/index.d.ts +0 -3
- package/dist/routes/index.d.ts.map +0 -1
- package/dist/routes/set-consent.d.ts +0 -89
- package/dist/routes/set-consent.d.ts.map +0 -1
- package/dist/routes/show-consent-banner.d.ts +0 -15
- package/dist/routes/show-consent-banner.d.ts.map +0 -1
- package/dist/routes/status.d.ts +0 -44
- package/dist/routes/status.d.ts.map +0 -1
- package/dist/routes/types.d.ts +0 -7
- package/dist/routes/types.d.ts.map +0 -1
- package/dist/routes/verify-consent.d.ts +0 -38
- package/dist/routes/verify-consent.d.ts.map +0 -1
- package/src/docs/ADVANCED_JSON_HANDLING.md +0 -99
- package/src/docs/neverthrow.md +0 -171
- package/src/index.ts +0 -34
- package/src/init.test.ts +0 -219
- package/src/integrations/cloudflare.ts +0 -269
- package/src/integrations/next.ts +0 -204
- package/src/integrations/node.ts +0 -141
- package/src/pkgs/api-router/index.ts +0 -148
- package/src/pkgs/api-router/types/h3.d.ts +0 -42
- package/src/pkgs/api-router/utils/define-route.ts +0 -410
- package/src/pkgs/logger/README.md +0 -213
- package/src/pkgs/logger/__tests__/console-formatter.test.ts +0 -67
- package/src/pkgs/logger/__tests__/integration.test.ts +0 -184
- package/src/pkgs/logger/__tests__/log-levels.test.ts +0 -77
- package/src/pkgs/logger/__tests__/logger-factory.test.ts +0 -156
- package/src/pkgs/logger/__tests__/result-logging.test.ts +0 -209
- package/src/pkgs/logger/__tests__/types.test.ts +0 -94
- package/src/pkgs/logger/console-formatter.ts +0 -75
- package/src/pkgs/logger/doc.md +0 -569
- package/src/pkgs/logger/index.ts +0 -59
- package/src/pkgs/logger/log-levels.ts +0 -46
- package/src/pkgs/logger/logger-factory.ts +0 -121
- package/src/pkgs/logger/result-logging.ts +0 -134
- package/src/pkgs/logger/telemetry.ts +0 -96
- package/src/pkgs/logger/types.ts +0 -138
- package/src/pkgs/results/__tests__/retrieval-pipeline.test.ts +0 -157
- package/src/pkgs/results/__tests__/validation-pipeline.test.ts +0 -151
- package/src/pkgs/results/h3-integration.ts +0 -142
- package/src/pkgs/results/pipeline/retrieval-pipeline.ts +0 -188
- package/src/pkgs/results/pipeline/validation-pipeline.ts +0 -164
- package/src/plugins/.keep +0 -0
- package/src/response-types.ts +0 -29
- package/src/routes/__test__/index.test.ts +0 -112
- package/src/routes/__test__/set-consent.test.ts +0 -242
- package/src/routes/__test__/show-consent-banner.test.ts +0 -98
- package/src/routes/__test__/status.test.ts +0 -64
- package/src/routes/__test__/verify-consent.test.ts +0 -266
- package/src/routes/index.ts +0 -12
- package/src/routes/set-consent.ts +0 -249
- package/src/routes/show-consent-banner.ts +0 -131
- package/src/routes/status.ts +0 -61
- package/src/routes/types.ts +0 -7
- package/src/routes/verify-consent.ts +0 -206
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { LogLevel, LoggerOptions } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Gets or creates a tracer for the logger package
|
|
4
|
-
*/
|
|
5
|
-
export declare const getTracer: (options?: LoggerOptions) => import("@opentelemetry/api").Tracer;
|
|
6
|
-
/**
|
|
7
|
-
* Creates a span for a log entry and sets appropriate attributes
|
|
8
|
-
*/
|
|
9
|
-
export declare const createLogSpan: (level: LogLevel, message: string, args?: unknown[], options?: LoggerOptions) => import("@opentelemetry/api").Span | null;
|
|
10
|
-
/**
|
|
11
|
-
* Wraps a logging operation in a span
|
|
12
|
-
*/
|
|
13
|
-
export declare const withLogSpan: <T>(level: LogLevel, message: string, args: unknown[], operation: () => T | Promise<T>, options?: LoggerOptions) => Promise<T>;
|
|
14
|
-
//# sourceMappingURL=telemetry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../../src/pkgs/logger/telemetry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAevD;;GAEG;AACH,eAAO,MAAM,SAAS,GAAI,UAAU,aAAa,wCAKhD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GACzB,OAAO,QAAQ,EACf,SAAS,MAAM,EACf,OAAM,OAAO,EAAO,EACpB,UAAU,aAAa,6CAiCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,GAAU,CAAC,EAClC,OAAO,QAAQ,EACf,SAAS,MAAM,EACf,MAAM,OAAO,EAAE,EACf,WAAW,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAC/B,UAAU,aAAa,KACrB,OAAO,CAAC,CAAC,CAkBX,CAAC"}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import type { Tracer } from '@opentelemetry/api';
|
|
2
|
-
/**
|
|
3
|
-
* Represents the available log severity levels.
|
|
4
|
-
*
|
|
5
|
-
* @remarks
|
|
6
|
-
* These levels determine the priority and visibility of log messages.
|
|
7
|
-
* The order from highest to lowest severity is:
|
|
8
|
-
* error > warn > info > success > debug
|
|
9
|
-
*
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export type LogLevel = 'info' | 'success' | 'warn' | 'error' | 'debug';
|
|
13
|
-
/**
|
|
14
|
-
* Configuration interface for logger instances.
|
|
15
|
-
*
|
|
16
|
-
* @remarks
|
|
17
|
-
* Provides options to customize logger behavior including
|
|
18
|
-
* disabling logs, setting log levels, and custom log handlers.
|
|
19
|
-
*
|
|
20
|
-
* @public
|
|
21
|
-
*/
|
|
22
|
-
export interface LoggerOptions {
|
|
23
|
-
/**
|
|
24
|
-
* Whether logging is disabled.
|
|
25
|
-
*
|
|
26
|
-
* @remarks
|
|
27
|
-
* When true, no logs will be published regardless of log level.
|
|
28
|
-
*/
|
|
29
|
-
disabled?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* The minimum log level to publish.
|
|
32
|
-
*
|
|
33
|
-
* @remarks
|
|
34
|
-
* Only logs with this level or higher severity will be published.
|
|
35
|
-
* Note that 'success' is treated as 'info' when using custom log handlers.
|
|
36
|
-
*/
|
|
37
|
-
level?: Exclude<LogLevel, 'success'>;
|
|
38
|
-
/**
|
|
39
|
-
* Custom log handler function.
|
|
40
|
-
*
|
|
41
|
-
* @remarks
|
|
42
|
-
* When provided, this function will be called instead of console methods.
|
|
43
|
-
*
|
|
44
|
-
* @param level - The severity level of the log message
|
|
45
|
-
* @param message - The message to log
|
|
46
|
-
* @param args - Additional data to include in the log
|
|
47
|
-
*/
|
|
48
|
-
log?: (level: LogLevel, message: string, ...args: unknown[]) => void;
|
|
49
|
-
/**
|
|
50
|
-
* Custom application name to display in log messages.
|
|
51
|
-
*
|
|
52
|
-
* @remarks
|
|
53
|
-
* When provided, this will override the default app name in the log format.
|
|
54
|
-
*
|
|
55
|
-
* @default '🪢 doubletie'
|
|
56
|
-
*/
|
|
57
|
-
appName?: string;
|
|
58
|
-
/**
|
|
59
|
-
* OpenTelemetry configuration options
|
|
60
|
-
*/
|
|
61
|
-
telemetry?: {
|
|
62
|
-
/**
|
|
63
|
-
* Custom tracer to use for OpenTelemetry integration
|
|
64
|
-
*/
|
|
65
|
-
tracer?: Tracer;
|
|
66
|
-
/**
|
|
67
|
-
* Whether to disable OpenTelemetry tracing
|
|
68
|
-
*/
|
|
69
|
-
disabled?: boolean;
|
|
70
|
-
/**
|
|
71
|
-
* Additional attributes to add to all spans
|
|
72
|
-
*/
|
|
73
|
-
defaultAttributes?: Record<string, string | number | boolean>;
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Type representing the parameters for log handlers.
|
|
78
|
-
*
|
|
79
|
-
* @remarks
|
|
80
|
-
* This utility type extracts parameter types from the Logger.log function,
|
|
81
|
-
* excluding the first parameter (log level).
|
|
82
|
-
*
|
|
83
|
-
* @internal
|
|
84
|
-
*/
|
|
85
|
-
export type LogEntry = Parameters<NonNullable<LoggerOptions['log']>> extends [
|
|
86
|
-
LogLevel,
|
|
87
|
-
...infer Rest
|
|
88
|
-
] ? Rest : never;
|
|
89
|
-
/**
|
|
90
|
-
* Type representing a logger instance with methods for each log level.
|
|
91
|
-
*
|
|
92
|
-
* @remarks
|
|
93
|
-
* Each method corresponds to a log level and accepts a message and optional arguments.
|
|
94
|
-
*
|
|
95
|
-
* @public
|
|
96
|
-
*/
|
|
97
|
-
export type Logger = Record<LogLevel, (...params: LogEntry) => void>;
|
|
98
|
-
/**
|
|
99
|
-
* Base error interface that must be implemented by errors used with the logger.
|
|
100
|
-
*
|
|
101
|
-
* @remarks
|
|
102
|
-
* This interface defines the minimum properties an error object should have
|
|
103
|
-
* to work properly with the logging utilities.
|
|
104
|
-
*
|
|
105
|
-
* @public
|
|
106
|
-
*/
|
|
107
|
-
export interface LoggableError {
|
|
108
|
-
/** The error message */
|
|
109
|
-
message: string;
|
|
110
|
-
/** Optional error code */
|
|
111
|
-
code?: string | number;
|
|
112
|
-
/** Optional HTTP status code */
|
|
113
|
-
status?: number;
|
|
114
|
-
/** Optional additional error metadata */
|
|
115
|
-
meta?: Record<string, unknown>;
|
|
116
|
-
/** Optional error category */
|
|
117
|
-
category?: string;
|
|
118
|
-
/** Error stack trace */
|
|
119
|
-
stack?: string;
|
|
120
|
-
}
|
|
121
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/pkgs/logger/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD;;;;;;;;;GASG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAEvE;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC7B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAErC;;;;;;;;;OASG;IACH,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IAErE;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE;QACX;;WAEG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB;;WAEG;QACH,QAAQ,CAAC,EAAE,OAAO,CAAC;QAEnB;;WAEG;QACH,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;KAC9D,CAAC;CACF;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;IAC5E,QAAQ;IACR,GAAG,MAAM,IAAI;CACb,GACE,IAAI,GACJ,KAAK,CAAC;AAET;;;;;;;GAOG;AACH,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC,GAAG,MAAM,EAAE,QAAQ,KAAK,IAAI,CAAC,CAAC;AAErE;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC7B,wBAAwB;IACxB,OAAO,EAAE,MAAM,CAAC;IAEhB,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAEvB,gCAAgC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE/B,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"retrieval-pipeline.test.d.ts","sourceRoot":"","sources":["../../../../src/pkgs/results/__tests__/retrieval-pipeline.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validation-pipeline.test.d.ts","sourceRoot":"","sources":["../../../../src/pkgs/results/__tests__/validation-pipeline.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { H3Event } from 'h3';
|
|
2
|
-
declare module 'h3' {
|
|
3
|
-
interface H3EventContext {
|
|
4
|
-
_onError?: (error: unknown) => unknown;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Creates an H3 error handler middleware that properly handles DoubleTieError instances
|
|
9
|
-
*
|
|
10
|
-
* This utility ensures consistent error handling across your H3.js application and
|
|
11
|
-
* properly converts DoubleTieError objects to H3-compatible error responses.
|
|
12
|
-
*
|
|
13
|
-
* @returns An H3 event handler middleware for error handling
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```typescript
|
|
17
|
-
* import { createH3ErrorHandler } from '@doubletie/results';
|
|
18
|
-
* import { createApp } from 'h3';
|
|
19
|
-
*
|
|
20
|
-
* const app = createApp();
|
|
21
|
-
*
|
|
22
|
-
* // Register the error handler middleware
|
|
23
|
-
* app.use(createH3ErrorHandler());
|
|
24
|
-
*
|
|
25
|
-
* // Your routes...
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export declare function createH3ErrorHandler(): import("h3").EventHandler<import("h3").EventHandlerRequest, void>;
|
|
29
|
-
/**
|
|
30
|
-
* Wraps an H3 event handler with error handling for DoubleTieError
|
|
31
|
-
*
|
|
32
|
-
* @param handler - The event handler to wrap
|
|
33
|
-
* @returns A wrapped handler that automatically handles DoubleTieError instances
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```typescript
|
|
37
|
-
* import { withH3ErrorHandling } from '@doubletie/results';
|
|
38
|
-
* import { eventHandler } from 'h3';
|
|
39
|
-
*
|
|
40
|
-
* app.use('/api/users', withH3ErrorHandling(
|
|
41
|
-
* eventHandler(async (event) => {
|
|
42
|
-
* // Your handler code that might throw DoubleTieError
|
|
43
|
-
* throw new DoubleTieError('User not found', {
|
|
44
|
-
* code: ERROR_CODES.NOT_FOUND,
|
|
45
|
-
* status: 404
|
|
46
|
-
* });
|
|
47
|
-
* })
|
|
48
|
-
* ));
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
export declare function withH3ErrorHandling(handler: (event: H3Event) => Promise<unknown> | unknown): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<unknown>>;
|
|
52
|
-
//# sourceMappingURL=h3-integration.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"h3-integration.d.ts","sourceRoot":"","sources":["../../../src/pkgs/results/h3-integration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAKlC,OAAO,QAAQ,IAAI,CAAC;IACnB,UAAU,cAAc;QACvB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;KACvC;CACD;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,oBAAoB,sEAyCnC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,mBAAmB,CAClC,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,iFA0CvD"}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import type { ErrorMessageType, SDKResultAsync } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Creates a retrieval pipeline that fetches data asynchronously and transforms it.
|
|
4
|
-
* Handles errors in a standardized way and includes null/undefined checks.
|
|
5
|
-
*
|
|
6
|
-
* @template TRawData - Type of the raw data fetched from the source
|
|
7
|
-
* @template TTransformedData - Type of the data after transformation
|
|
8
|
-
*
|
|
9
|
-
* @param fetcher - Async function that fetches the raw data
|
|
10
|
-
* @param transformer - Function that transforms the raw data
|
|
11
|
-
* @param errorCode - Error code to use if the fetcher throws (defaults to NOT_FOUND)
|
|
12
|
-
* @returns A function that returns a ResultAsync with the transformed data or an error
|
|
13
|
-
*
|
|
14
|
-
* @remarks
|
|
15
|
-
* This function implements a common pattern for retrieving and transforming data from
|
|
16
|
-
* external sources like databases, APIs, or file systems. It handles:
|
|
17
|
-
*
|
|
18
|
-
* 1. Asynchronous data fetching with proper error handling
|
|
19
|
-
* 2. Null/undefined checks to detect missing resources
|
|
20
|
-
* 3. Data transformation to convert raw data to the desired format
|
|
21
|
-
* 4. Standardized error creation with appropriate error codes and metadata
|
|
22
|
-
*
|
|
23
|
-
* The pipeline is particularly useful for:
|
|
24
|
-
* - Database queries where records might not exist
|
|
25
|
-
* - API calls that may fail or return empty results
|
|
26
|
-
* - File system operations where files might be missing
|
|
27
|
-
*
|
|
28
|
-
* @see ERROR_CODES.NOT_FOUND for the default error code used when resources are missing
|
|
29
|
-
* @see validationPipeline for handling data validation
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```typescript
|
|
33
|
-
* import { retrievalPipeline, ERROR_CODES } from '@doubletie/results';
|
|
34
|
-
* import { db } from './database';
|
|
35
|
-
*
|
|
36
|
-
* // Define types for raw and transformed data
|
|
37
|
-
* interface UserRecord {
|
|
38
|
-
* id: string;
|
|
39
|
-
* first_name: string;
|
|
40
|
-
* last_name: string;
|
|
41
|
-
* email: string;
|
|
42
|
-
* created_at: string;
|
|
43
|
-
* }
|
|
44
|
-
*
|
|
45
|
-
* interface User {
|
|
46
|
-
* id: string;
|
|
47
|
-
* fullName: string;
|
|
48
|
-
* email: string;
|
|
49
|
-
* createdAt: Date;
|
|
50
|
-
* }
|
|
51
|
-
*
|
|
52
|
-
* // Create a retrieval pipeline for fetching users
|
|
53
|
-
* const getUserById = (userId: string) => {
|
|
54
|
-
* return retrievalPipeline<UserRecord, User>(
|
|
55
|
-
* // Fetcher function to get raw data
|
|
56
|
-
* async () => {
|
|
57
|
-
* return await db.users.findUnique({
|
|
58
|
-
* where: { id: userId }
|
|
59
|
-
* });
|
|
60
|
-
* },
|
|
61
|
-
*
|
|
62
|
-
* // Transformer function to format the data
|
|
63
|
-
* (record) => ({
|
|
64
|
-
* id: record.id,
|
|
65
|
-
* fullName: `${record.first_name} ${record.last_name}`,
|
|
66
|
-
* email: record.email,
|
|
67
|
-
* createdAt: new Date(record.created_at)
|
|
68
|
-
* }),
|
|
69
|
-
*
|
|
70
|
-
* // Custom error code for this specific resource type
|
|
71
|
-
* ERROR_CODES.USER_NOT_FOUND
|
|
72
|
-
* );
|
|
73
|
-
* };
|
|
74
|
-
*
|
|
75
|
-
* // Using the pipeline
|
|
76
|
-
* async function handleUserRequest(req, res) {
|
|
77
|
-
* const userId = req.params.id;
|
|
78
|
-
*
|
|
79
|
-
* const userResult = await getUserById(userId)();
|
|
80
|
-
*
|
|
81
|
-
* return userResult.match(
|
|
82
|
-
* (user) => {
|
|
83
|
-
* // Successfully retrieved and transformed the user
|
|
84
|
-
* return res.json(user);
|
|
85
|
-
* },
|
|
86
|
-
* (error) => {
|
|
87
|
-
* // Handle the error based on its code
|
|
88
|
-
* if (error.code === ERROR_CODES.USER_NOT_FOUND) {
|
|
89
|
-
* return res.status(404).json({ error: `User ${userId} not found` });
|
|
90
|
-
* }
|
|
91
|
-
*
|
|
92
|
-
* // Handle other errors
|
|
93
|
-
* console.error(`Error fetching user:`, error);
|
|
94
|
-
* return res.status(error.status).json({ error: error.message });
|
|
95
|
-
* }
|
|
96
|
-
* );
|
|
97
|
-
* }
|
|
98
|
-
* ```
|
|
99
|
-
*/
|
|
100
|
-
export declare const retrievalPipeline: <TRawData, TTransformedData>(fetcher: () => Promise<TRawData>, transformer: (data: TRawData) => TTransformedData, errorCode?: ErrorMessageType) => (() => SDKResultAsync<TTransformedData>);
|
|
101
|
-
//# sourceMappingURL=retrieval-pipeline.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"retrieval-pipeline.d.ts","sourceRoot":"","sources":["../../../../src/pkgs/results/pipeline/retrieval-pipeline.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiGG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,EAAE,gBAAgB,EAC3D,SAAS,MAAM,OAAO,CAAC,QAAQ,CAAC,EAChC,aAAa,CAAC,IAAI,EAAE,QAAQ,KAAK,gBAAgB,EACjD,YAAW,gBAAwC,KACjD,CAAC,MAAM,cAAc,CAAC,gBAAgB,CAAC,CAgFzC,CAAC"}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import type { ZodSchema } from 'zod';
|
|
2
|
-
import type { SDKResult } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* Creates a validation pipeline that validates input data with a Zod schema
|
|
5
|
-
* and transforms it to an output format.
|
|
6
|
-
*
|
|
7
|
-
* @template TInput - Type of the input data after validation
|
|
8
|
-
* @template TOutput - Type of the output data after transformation
|
|
9
|
-
*
|
|
10
|
-
* @param schema - Zod schema to validate the input data
|
|
11
|
-
* @param transformer - Function to transform validated data
|
|
12
|
-
* @returns A function that takes input data and returns a Result with the transformed data or an error
|
|
13
|
-
*
|
|
14
|
-
* @remarks
|
|
15
|
-
* This function implements a common pattern for validating and transforming input data.
|
|
16
|
-
* It first validates the input using a Zod schema, and if valid, transforms it using
|
|
17
|
-
* the provided transformer function. If validation fails, it returns a well-structured
|
|
18
|
-
* error with validation details.
|
|
19
|
-
*
|
|
20
|
-
* The validation pipeline is particularly useful for:
|
|
21
|
-
* - API request body validation
|
|
22
|
-
* - Form data validation
|
|
23
|
-
* - Configuration validation
|
|
24
|
-
* - Data import/export validation
|
|
25
|
-
*
|
|
26
|
-
* The transformer function allows you to adapt the validated data to the shape
|
|
27
|
-
* expected by your application logic.
|
|
28
|
-
*
|
|
29
|
-
* @see ValidationErrorDetails for the structure of validation errors
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```typescript
|
|
33
|
-
* import { z } from 'zod';
|
|
34
|
-
* import { validationPipeline, ERROR_CODES } from '@doubletie/results';
|
|
35
|
-
*
|
|
36
|
-
* // Define a schema for user input
|
|
37
|
-
* const userSchema = z.object({
|
|
38
|
-
* name: z.string().min(2).max(100),
|
|
39
|
-
* email: z.string().email(),
|
|
40
|
-
* age: z.number().int().min(18).optional(),
|
|
41
|
-
* role: z.enum(['admin', 'user', 'guest'])
|
|
42
|
-
* });
|
|
43
|
-
*
|
|
44
|
-
* // Type inferred from schema
|
|
45
|
-
* type UserInput = z.infer<typeof userSchema>;
|
|
46
|
-
*
|
|
47
|
-
* // Type for the transformed output
|
|
48
|
-
* interface UserRecord {
|
|
49
|
-
* id: string;
|
|
50
|
-
* displayName: string;
|
|
51
|
-
* email: string;
|
|
52
|
-
* age?: number;
|
|
53
|
-
* role: string;
|
|
54
|
-
* createdAt: Date;
|
|
55
|
-
* }
|
|
56
|
-
*
|
|
57
|
-
* // Create a validation pipeline
|
|
58
|
-
* const validateUser = validationPipeline<UserInput, UserRecord>(
|
|
59
|
-
* userSchema,
|
|
60
|
-
* (validData) => ({
|
|
61
|
-
* id: generateId(),
|
|
62
|
-
* displayName: validData.name,
|
|
63
|
-
* email: validData.email.toLowerCase(),
|
|
64
|
-
* age: validData.age,
|
|
65
|
-
* role: validData.role,
|
|
66
|
-
* createdAt: new Date()
|
|
67
|
-
* })
|
|
68
|
-
* );
|
|
69
|
-
*
|
|
70
|
-
* // Using the pipeline
|
|
71
|
-
* function createUser(rawData: unknown) {
|
|
72
|
-
* const result = validateUser(rawData);
|
|
73
|
-
*
|
|
74
|
-
* return result.match(
|
|
75
|
-
* (user) => {
|
|
76
|
-
* // Work with validated and transformed data
|
|
77
|
-
* return saveUserToDatabase(user);
|
|
78
|
-
* },
|
|
79
|
-
* (error) => {
|
|
80
|
-
* // Handle validation errors
|
|
81
|
-
* console.error('Validation failed:', error.meta.validationErrors);
|
|
82
|
-
* throw error;
|
|
83
|
-
* }
|
|
84
|
-
* );
|
|
85
|
-
* }
|
|
86
|
-
* ```
|
|
87
|
-
*/
|
|
88
|
-
export declare const validationPipeline: <TInput, TOutput>(schema: ZodSchema<TInput>, transformer: (data: TInput) => TOutput) => ((data: unknown) => SDKResult<TOutput>);
|
|
89
|
-
//# sourceMappingURL=validation-pipeline.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validation-pipeline.d.ts","sourceRoot":"","sources":["../../../../src/pkgs/results/pipeline/validation-pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAGrC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoFG;AACH,eAAO,MAAM,kBAAkB,GAAI,MAAM,EAAE,OAAO,EACjD,QAAQ,SAAS,CAAC,MAAM,CAAC,EACzB,aAAa,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,KACpC,CAAC,CAAC,IAAI,EAAE,OAAO,KAAK,SAAS,CAAC,OAAO,CAAC,CAsExC,CAAC"}
|
package/dist/response-types.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Public API Types
|
|
3
|
-
*
|
|
4
|
-
* This file exports all the types needed by client applications to interact with the API.
|
|
5
|
-
* It contains request and response type definitions for all public endpoints.
|
|
6
|
-
*/
|
|
7
|
-
import type { z } from 'zod';
|
|
8
|
-
import type { RouteResponseType } from './pkgs/api-router/utils/define-route';
|
|
9
|
-
import type { setConsent } from './routes/set-consent';
|
|
10
|
-
import type { showConsentBanner } from './routes/show-consent-banner';
|
|
11
|
-
import type { verifyConsent } from './routes/verify-consent';
|
|
12
|
-
import type { SetConsentRequestBody as SetConsentRequestBodyZod } from './routes/set-consent';
|
|
13
|
-
import type { VerifyConsentRequestBody as VerifyConsentRequestBodyZod } from './routes/verify-consent';
|
|
14
|
-
export type SetConsentResponse = RouteResponseType<typeof setConsent>;
|
|
15
|
-
export type ShowConsentBannerResponse = RouteResponseType<typeof showConsentBanner>;
|
|
16
|
-
export type VerifyConsentResponse = RouteResponseType<typeof verifyConsent>;
|
|
17
|
-
export type SetConsentRequestBody = z.infer<typeof SetConsentRequestBodyZod>;
|
|
18
|
-
export type VerifyConsentRequestBody = z.infer<typeof VerifyConsentRequestBodyZod>;
|
|
19
|
-
//# sourceMappingURL=response-types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"response-types.d.ts","sourceRoot":"","sources":["../src/response-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,KAAK,EAAE,qBAAqB,IAAI,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAC9F,OAAO,KAAK,EAAE,wBAAwB,IAAI,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAGvG,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,OAAO,UAAU,CAAC,CAAC;AACtE,MAAM,MAAM,yBAAyB,GAAG,iBAAiB,CACxD,OAAO,iBAAiB,CACxB,CAAC;AACF,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,CAAC,OAAO,aAAa,CAAC,CAAC;AAE5E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC7E,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,2BAA2B,CAClC,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Main test suite for consent system route handlers
|
|
3
|
-
*
|
|
4
|
-
* This file imports and runs all the tests for various consent endpoints:
|
|
5
|
-
* - set-consent.ts: Creates consent records for users
|
|
6
|
-
* - verify-consent.ts: Verifies if a user has given consent
|
|
7
|
-
* - show-consent-banner.ts: Determines if a consent banner should be shown
|
|
8
|
-
* - status.ts: Returns system status information
|
|
9
|
-
*
|
|
10
|
-
* Note: These tests expect DoubleTieError validation errors, which is the expected
|
|
11
|
-
* behavior in our test environment due to h3 event simulation challenges.
|
|
12
|
-
*/
|
|
13
|
-
import './set-consent.test';
|
|
14
|
-
import './verify-consent.test';
|
|
15
|
-
import './show-consent-banner.test';
|
|
16
|
-
import './status.test';
|
|
17
|
-
//# sourceMappingURL=index.test.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../src/routes/__test__/index.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA8FH,OAAO,oBAAoB,CAAC;AAC5B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,4BAA4B,CAAC;AACpC,OAAO,eAAe,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-consent.test.d.ts","sourceRoot":"","sources":["../../../src/routes/__test__/set-consent.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"show-consent-banner.test.d.ts","sourceRoot":"","sources":["../../../src/routes/__test__/show-consent-banner.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"status.test.d.ts","sourceRoot":"","sources":["../../../src/routes/__test__/status.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"verify-consent.test.d.ts","sourceRoot":"","sources":["../../../src/routes/__test__/verify-consent.test.ts"],"names":[],"mappings":""}
|
package/dist/routes/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/routes/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGrC,eAAO,MAAM,MAAM,EAAE,KAAK,EAKzB,CAAC"}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const SetConsentRequestBody: z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.objectUtil.extendShape<{
|
|
3
|
-
subjectId: z.ZodOptional<z.ZodString>;
|
|
4
|
-
externalSubjectId: z.ZodOptional<z.ZodString>;
|
|
5
|
-
domain: z.ZodString;
|
|
6
|
-
type: z.ZodEnum<["cookie_banner", "privacy_policy", "dpa", "terms_and_conditions", "marketing_communications", "age_verification", "other"]>;
|
|
7
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
8
|
-
}, {
|
|
9
|
-
type: z.ZodLiteral<"cookie_banner">;
|
|
10
|
-
preferences: z.ZodRecord<z.ZodString, z.ZodBoolean>;
|
|
11
|
-
}>, "strip", z.ZodTypeAny, {
|
|
12
|
-
type: "cookie_banner";
|
|
13
|
-
domain: string;
|
|
14
|
-
preferences: Record<string, boolean>;
|
|
15
|
-
subjectId?: string | undefined;
|
|
16
|
-
metadata?: Record<string, unknown> | undefined;
|
|
17
|
-
externalSubjectId?: string | undefined;
|
|
18
|
-
}, {
|
|
19
|
-
type: "cookie_banner";
|
|
20
|
-
domain: string;
|
|
21
|
-
preferences: Record<string, boolean>;
|
|
22
|
-
subjectId?: string | undefined;
|
|
23
|
-
metadata?: Record<string, unknown> | undefined;
|
|
24
|
-
externalSubjectId?: string | undefined;
|
|
25
|
-
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
26
|
-
subjectId: z.ZodOptional<z.ZodString>;
|
|
27
|
-
externalSubjectId: z.ZodOptional<z.ZodString>;
|
|
28
|
-
domain: z.ZodString;
|
|
29
|
-
type: z.ZodEnum<["cookie_banner", "privacy_policy", "dpa", "terms_and_conditions", "marketing_communications", "age_verification", "other"]>;
|
|
30
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
31
|
-
}, {
|
|
32
|
-
type: z.ZodEnum<["privacy_policy", "dpa", "terms_and_conditions"]>;
|
|
33
|
-
policyId: z.ZodOptional<z.ZodString>;
|
|
34
|
-
preferences: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
35
|
-
}>, "strip", z.ZodTypeAny, {
|
|
36
|
-
type: "privacy_policy" | "dpa" | "terms_and_conditions";
|
|
37
|
-
domain: string;
|
|
38
|
-
subjectId?: string | undefined;
|
|
39
|
-
metadata?: Record<string, unknown> | undefined;
|
|
40
|
-
policyId?: string | undefined;
|
|
41
|
-
externalSubjectId?: string | undefined;
|
|
42
|
-
preferences?: Record<string, boolean> | undefined;
|
|
43
|
-
}, {
|
|
44
|
-
type: "privacy_policy" | "dpa" | "terms_and_conditions";
|
|
45
|
-
domain: string;
|
|
46
|
-
subjectId?: string | undefined;
|
|
47
|
-
metadata?: Record<string, unknown> | undefined;
|
|
48
|
-
policyId?: string | undefined;
|
|
49
|
-
externalSubjectId?: string | undefined;
|
|
50
|
-
preferences?: Record<string, boolean> | undefined;
|
|
51
|
-
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
52
|
-
subjectId: z.ZodOptional<z.ZodString>;
|
|
53
|
-
externalSubjectId: z.ZodOptional<z.ZodString>;
|
|
54
|
-
domain: z.ZodString;
|
|
55
|
-
type: z.ZodEnum<["cookie_banner", "privacy_policy", "dpa", "terms_and_conditions", "marketing_communications", "age_verification", "other"]>;
|
|
56
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
57
|
-
}, {
|
|
58
|
-
type: z.ZodEnum<["marketing_communications", "age_verification", "other"]>;
|
|
59
|
-
preferences: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
60
|
-
}>, "strip", z.ZodTypeAny, {
|
|
61
|
-
type: "marketing_communications" | "age_verification" | "other";
|
|
62
|
-
domain: string;
|
|
63
|
-
subjectId?: string | undefined;
|
|
64
|
-
metadata?: Record<string, unknown> | undefined;
|
|
65
|
-
externalSubjectId?: string | undefined;
|
|
66
|
-
preferences?: Record<string, boolean> | undefined;
|
|
67
|
-
}, {
|
|
68
|
-
type: "marketing_communications" | "age_verification" | "other";
|
|
69
|
-
domain: string;
|
|
70
|
-
subjectId?: string | undefined;
|
|
71
|
-
metadata?: Record<string, unknown> | undefined;
|
|
72
|
-
externalSubjectId?: string | undefined;
|
|
73
|
-
preferences?: Record<string, boolean> | undefined;
|
|
74
|
-
}>]>;
|
|
75
|
-
export declare const setConsent: import("./types").Route & {
|
|
76
|
-
responseType: {
|
|
77
|
-
id: string;
|
|
78
|
-
subjectId: string;
|
|
79
|
-
externalSubjectId: string | undefined;
|
|
80
|
-
domainId: string;
|
|
81
|
-
domain: string;
|
|
82
|
-
type: "cookie_banner" | "privacy_policy" | "dpa" | "terms_and_conditions" | "marketing_communications" | "age_verification" | "other";
|
|
83
|
-
status: "active" | "withdrawn" | "expired";
|
|
84
|
-
recordId: string;
|
|
85
|
-
metadata: Record<string, unknown> | undefined;
|
|
86
|
-
givenAt: string;
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
//# sourceMappingURL=set-consent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-consent.d.ts","sourceRoot":"","sources":["../../src/routes/set-consent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqCxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAIhC,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;CA6MrB,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export interface ShowConsentBannerResponse {
|
|
2
|
-
showConsentBanner: boolean;
|
|
3
|
-
jurisdiction: {
|
|
4
|
-
code: string;
|
|
5
|
-
message: string;
|
|
6
|
-
};
|
|
7
|
-
location: {
|
|
8
|
-
countryCode: string | null;
|
|
9
|
-
regionCode: string | null;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export declare const showConsentBanner: import("./types").Route & {
|
|
13
|
-
responseType: ShowConsentBannerResponse;
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=show-consent-banner.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"show-consent-banner.d.ts","sourceRoot":"","sources":["../../src/routes/show-consent-banner.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,yBAAyB;IACzC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,YAAY,EAAE;QACb,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,QAAQ,EAAE;QACT,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;QAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;KAC1B,CAAC;CACF;AAED,eAAO,MAAM,iBAAiB;;CA2B5B,CAAC"}
|