@opensaas/stack-core 0.43.0 → 0.44.0-alpha.2
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/CHANGELOG.md +2753 -0
- package/README.md +182 -115
- package/dist/.build-hash +1 -0
- package/dist/access/declared-dependencies.d.ts +102 -88
- package/dist/access/declared-dependencies.d.ts.map +1 -1
- package/dist/access/declared-dependencies.js +83 -71
- package/dist/access/declared-dependencies.js.map +1 -1
- package/dist/access/depth-limits.d.ts +4 -0
- package/dist/access/depth-limits.d.ts.map +1 -1
- package/dist/access/depth-limits.js +4 -0
- package/dist/access/depth-limits.js.map +1 -1
- package/dist/access/engine.d.ts +68 -20
- package/dist/access/engine.d.ts.map +1 -1
- package/dist/access/engine.js +151 -37
- package/dist/access/engine.js.map +1 -1
- package/dist/access/errors.d.ts +33 -48
- package/dist/access/errors.d.ts.map +1 -1
- package/dist/access/errors.js +73 -63
- package/dist/access/errors.js.map +1 -1
- package/dist/access/field-access.d.ts +76 -5
- package/dist/access/field-access.d.ts.map +1 -1
- package/dist/access/field-access.js +235 -61
- package/dist/access/field-access.js.map +1 -1
- package/dist/access/field-visibility.d.ts +50 -4
- package/dist/access/field-visibility.d.ts.map +1 -1
- package/dist/access/field-visibility.js +143 -160
- package/dist/access/field-visibility.js.map +1 -1
- package/dist/access/index.d.ts +5 -12
- package/dist/access/index.d.ts.map +1 -1
- package/dist/access/index.js +6 -19
- package/dist/access/index.js.map +1 -1
- package/dist/access/orm-client.d.ts +19 -0
- package/dist/access/orm-client.d.ts.map +1 -0
- package/dist/access/orm-client.js +37 -0
- package/dist/access/orm-client.js.map +1 -0
- package/dist/access/query-validation.d.ts +7 -129
- package/dist/access/query-validation.d.ts.map +1 -1
- package/dist/access/query-validation.js +12 -314
- package/dist/access/query-validation.js.map +1 -1
- package/dist/access/system-fields.d.ts +2 -0
- package/dist/access/system-fields.d.ts.map +1 -0
- package/dist/access/system-fields.js +7 -0
- package/dist/access/system-fields.js.map +1 -0
- package/dist/access/transaction-registry.d.ts +25 -2
- package/dist/access/transaction-registry.d.ts.map +1 -1
- package/dist/access/transaction-registry.js +34 -17
- package/dist/access/transaction-registry.js.map +1 -1
- package/dist/access/types.d.ts +217 -131
- package/dist/access/types.d.ts.map +1 -1
- package/dist/config/field-kind.d.ts +66 -0
- package/dist/config/field-kind.d.ts.map +1 -0
- package/dist/config/field-kind.js +63 -0
- package/dist/config/field-kind.js.map +1 -0
- package/dist/config/hook-only-fields.d.ts +3 -0
- package/dist/config/hook-only-fields.d.ts.map +1 -0
- package/dist/config/hook-only-fields.js +17 -0
- package/dist/config/hook-only-fields.js.map +1 -0
- package/dist/config/index.d.ts +3 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +6 -3
- package/dist/config/index.js.map +1 -1
- package/dist/config/mcp-tool-names.d.ts +3 -0
- package/dist/config/mcp-tool-names.d.ts.map +1 -0
- package/dist/config/mcp-tool-names.js +25 -0
- package/dist/config/mcp-tool-names.js.map +1 -0
- package/dist/config/nav-count.d.ts.map +1 -1
- package/dist/config/nav-count.js +4 -4
- package/dist/config/nav-count.js.map +1 -1
- package/dist/config/plugin-engine.d.ts +8 -2
- package/dist/config/plugin-engine.d.ts.map +1 -1
- package/dist/config/plugin-engine.js +102 -38
- package/dist/config/plugin-engine.js.map +1 -1
- package/dist/config/types.d.ts +1035 -611
- package/dist/config/types.d.ts.map +1 -1
- package/dist/context/apply-defaults.d.ts +18 -1
- package/dist/context/apply-defaults.d.ts.map +1 -1
- package/dist/context/apply-defaults.js +30 -4
- package/dist/context/apply-defaults.js.map +1 -1
- package/dist/context/engine-context.d.ts +73 -0
- package/dist/context/engine-context.d.ts.map +1 -0
- package/dist/context/engine-context.js +67 -0
- package/dist/context/engine-context.js.map +1 -0
- package/dist/context/hook-pipeline.d.ts +9 -2
- package/dist/context/hook-pipeline.d.ts.map +1 -1
- package/dist/context/hook-pipeline.js +5 -4
- package/dist/context/hook-pipeline.js.map +1 -1
- package/dist/context/index.d.ts +98 -89
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +917 -722
- package/dist/context/index.js.map +1 -1
- package/dist/context/junction.d.ts +59 -0
- package/dist/context/junction.d.ts.map +1 -0
- package/dist/context/junction.js +126 -0
- package/dist/context/junction.js.map +1 -0
- package/dist/context/plugin-field-read.d.ts +33 -0
- package/dist/context/plugin-field-read.d.ts.map +1 -0
- package/dist/context/plugin-field-read.js +41 -0
- package/dist/context/plugin-field-read.js.map +1 -0
- package/dist/context/plugin-field-write.d.ts +104 -0
- package/dist/context/plugin-field-write.d.ts.map +1 -0
- package/dist/context/plugin-field-write.js +184 -0
- package/dist/context/plugin-field-write.js.map +1 -0
- package/dist/context/relationship-input.d.ts +146 -0
- package/dist/context/relationship-input.d.ts.map +1 -0
- package/dist/context/relationship-input.js +453 -0
- package/dist/context/relationship-input.js.map +1 -0
- package/dist/context/transaction-boundary.d.ts +54 -28
- package/dist/context/transaction-boundary.d.ts.map +1 -1
- package/dist/context/transaction-boundary.js +87 -169
- package/dist/context/transaction-boundary.js.map +1 -1
- package/dist/context/write-pipeline.d.ts +33 -51
- package/dist/context/write-pipeline.d.ts.map +1 -1
- package/dist/context/write-pipeline.js +372 -185
- package/dist/context/write-pipeline.js.map +1 -1
- package/dist/contract/dependencies.d.ts +88 -0
- package/dist/contract/dependencies.d.ts.map +1 -0
- package/dist/contract/dependencies.js +237 -0
- package/dist/contract/dependencies.js.map +1 -0
- package/dist/contract/derive.d.ts +49 -0
- package/dist/contract/derive.d.ts.map +1 -0
- package/dist/contract/derive.js +629 -0
- package/dist/contract/derive.js.map +1 -0
- package/dist/contract/fixtures/contract-configs.d.ts +64 -0
- package/dist/contract/fixtures/contract-configs.d.ts.map +1 -0
- package/dist/contract/fixtures/contract-configs.js +345 -0
- package/dist/contract/fixtures/contract-configs.js.map +1 -0
- package/dist/contract/id-boundary.d.ts +53 -0
- package/dist/contract/id-boundary.d.ts.map +1 -0
- package/dist/contract/id-boundary.js +76 -0
- package/dist/contract/id-boundary.js.map +1 -0
- package/dist/contract/index.d.ts +8 -0
- package/dist/contract/index.d.ts.map +1 -0
- package/dist/contract/index.js +11 -0
- package/dist/contract/index.js.map +1 -0
- package/dist/contract/prisma.d.ts +58 -0
- package/dist/contract/prisma.d.ts.map +1 -0
- package/dist/contract/prisma.js +294 -0
- package/dist/contract/prisma.js.map +1 -0
- package/dist/contract/relation-graph.d.ts +70 -0
- package/dist/contract/relation-graph.d.ts.map +1 -0
- package/dist/contract/relation-graph.js +113 -0
- package/dist/contract/relation-graph.js.map +1 -0
- package/dist/contract/types.d.ts +153 -0
- package/dist/contract/types.d.ts.map +1 -0
- package/dist/contract/types.js +2 -0
- package/dist/contract/types.js.map +1 -0
- package/dist/db/client.d.ts +55 -0
- package/dist/db/client.d.ts.map +1 -0
- package/dist/db/client.js +73 -0
- package/dist/db/client.js.map +1 -0
- package/dist/db/dev-database.d.ts +124 -0
- package/dist/db/dev-database.d.ts.map +1 -0
- package/dist/db/dev-database.js +291 -0
- package/dist/db/dev-database.js.map +1 -0
- package/dist/db/password-front.d.ts +10 -0
- package/dist/db/password-front.d.ts.map +1 -0
- package/dist/db/password-front.js +147 -0
- package/dist/db/password-front.js.map +1 -0
- package/dist/db/process-identity.d.ts +36 -0
- package/dist/db/process-identity.d.ts.map +1 -0
- package/dist/db/process-identity.js +114 -0
- package/dist/db/process-identity.js.map +1 -0
- package/dist/db/state-file.d.ts +54 -0
- package/dist/db/state-file.d.ts.map +1 -0
- package/dist/db/state-file.js +91 -0
- package/dist/db/state-file.js.map +1 -0
- package/dist/db/url.d.ts +89 -0
- package/dist/db/url.d.ts.map +1 -0
- package/dist/db/url.js +118 -0
- package/dist/db/url.js.map +1 -0
- package/dist/extend.d.ts +13 -2
- package/dist/extend.d.ts.map +1 -1
- package/dist/extend.js +24 -1
- package/dist/extend.js.map +1 -1
- package/dist/fields/index.d.ts +87 -42
- package/dist/fields/index.d.ts.map +1 -1
- package/dist/fields/index.js +462 -678
- package/dist/fields/index.js.map +1 -1
- package/dist/filter/collect.d.ts +3 -4
- package/dist/filter/collect.d.ts.map +1 -1
- package/dist/filter/collect.js +2 -2
- package/dist/filter/collect.js.map +1 -1
- package/dist/filter/index.d.ts +1 -2
- package/dist/filter/index.d.ts.map +1 -1
- package/dist/filter/index.js +0 -1
- package/dist/filter/index.js.map +1 -1
- package/dist/filter/map.d.ts +12 -5
- package/dist/filter/map.d.ts.map +1 -1
- package/dist/filter/map.js +47 -19
- package/dist/filter/map.js.map +1 -1
- package/dist/filter/types.d.ts +10 -24
- package/dist/filter/types.d.ts.map +1 -1
- package/dist/filter/types.js +2 -11
- package/dist/filter/types.js.map +1 -1
- package/dist/hooks/index.d.ts +22 -31
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +33 -37
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/transition-guard.d.ts +61 -0
- package/dist/hooks/transition-guard.d.ts.map +1 -0
- package/dist/hooks/transition-guard.js +93 -0
- package/dist/hooks/transition-guard.js.map +1 -0
- package/dist/index.d.ts +52 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +105 -51
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +4 -2
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +16 -0
- package/dist/internal.js.map +1 -1
- package/dist/lib/case-utils.d.ts +0 -1
- package/dist/lib/case-utils.d.ts.map +1 -1
- package/dist/lib/case-utils.js +0 -3
- package/dist/lib/case-utils.js.map +1 -1
- package/dist/lib/client-safe-error.d.ts +9 -0
- package/dist/lib/client-safe-error.d.ts.map +1 -0
- package/dist/lib/client-safe-error.js +23 -0
- package/dist/lib/client-safe-error.js.map +1 -0
- package/dist/lib/database-errors.d.ts +78 -0
- package/dist/lib/database-errors.d.ts.map +1 -0
- package/dist/lib/database-errors.js +148 -0
- package/dist/lib/database-errors.js.map +1 -0
- package/dist/lib/null-prototype-registry.d.ts +9 -0
- package/dist/lib/null-prototype-registry.d.ts.map +1 -0
- package/dist/lib/null-prototype-registry.js +11 -0
- package/dist/lib/null-prototype-registry.js.map +1 -0
- package/dist/lib/prisma-errors.d.ts +30 -32
- package/dist/lib/prisma-errors.d.ts.map +1 -1
- package/dist/lib/prisma-errors.js +86 -46
- package/dist/lib/prisma-errors.js.map +1 -1
- package/dist/lib/process-global.d.ts +23 -0
- package/dist/lib/process-global.d.ts.map +1 -0
- package/dist/lib/process-global.js +33 -0
- package/dist/lib/process-global.js.map +1 -0
- package/dist/lib/warn-once.d.ts +7 -0
- package/dist/lib/warn-once.d.ts.map +1 -0
- package/dist/lib/warn-once.js +13 -0
- package/dist/lib/warn-once.js.map +1 -0
- package/dist/mcp/advertise.d.ts +16 -0
- package/dist/mcp/advertise.d.ts.map +1 -0
- package/dist/mcp/advertise.js +25 -0
- package/dist/mcp/advertise.js.map +1 -0
- package/dist/mcp/arguments.d.ts +10 -0
- package/dist/mcp/arguments.d.ts.map +1 -0
- package/dist/mcp/arguments.js +143 -0
- package/dist/mcp/arguments.js.map +1 -0
- package/dist/mcp/field-schema.d.ts +50 -5
- package/dist/mcp/field-schema.d.ts.map +1 -1
- package/dist/mcp/field-schema.js +137 -14
- package/dist/mcp/field-schema.js.map +1 -1
- package/dist/mcp/handler.d.ts +16 -5
- package/dist/mcp/handler.d.ts.map +1 -1
- package/dist/mcp/handler.js +404 -126
- package/dist/mcp/handler.js.map +1 -1
- package/dist/mcp/index.d.ts +1 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +1 -0
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/projection.d.ts +42 -34
- package/dist/mcp/projection.d.ts.map +1 -1
- package/dist/mcp/projection.js +246 -200
- package/dist/mcp/projection.js.map +1 -1
- package/dist/mcp/tool-error.d.ts +8 -0
- package/dist/mcp/tool-error.d.ts.map +1 -0
- package/dist/mcp/tool-error.js +11 -0
- package/dist/mcp/tool-error.js.map +1 -0
- package/dist/mcp/types.d.ts +3 -2
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/mcp/where-id-boundary.d.ts +28 -0
- package/dist/mcp/where-id-boundary.d.ts.map +1 -0
- package/dist/mcp/where-id-boundary.js +187 -0
- package/dist/mcp/where-id-boundary.js.map +1 -0
- package/dist/origin.d.ts +147 -0
- package/dist/origin.d.ts.map +1 -0
- package/dist/origin.js +191 -0
- package/dist/origin.js.map +1 -0
- package/dist/query/relationship-options.d.ts +35 -6
- package/dist/query/relationship-options.d.ts.map +1 -1
- package/dist/query/relationship-options.js +33 -23
- package/dist/query/relationship-options.js.map +1 -1
- package/dist/secured/aggregate.d.ts +32 -0
- package/dist/secured/aggregate.d.ts.map +1 -0
- package/dist/secured/aggregate.js +31 -0
- package/dist/secured/aggregate.js.map +1 -0
- package/dist/secured/include.d.ts +320 -0
- package/dist/secured/include.d.ts.map +1 -0
- package/dist/secured/include.js +650 -0
- package/dist/secured/include.js.map +1 -0
- package/dist/secured/lock.d.ts +127 -0
- package/dist/secured/lock.d.ts.map +1 -0
- package/dist/secured/lock.js +275 -0
- package/dist/secured/lock.js.map +1 -0
- package/dist/secured/lower.d.ts +82 -0
- package/dist/secured/lower.d.ts.map +1 -0
- package/dist/secured/lower.js +162 -0
- package/dist/secured/lower.js.map +1 -0
- package/dist/secured/operators.d.ts +7 -0
- package/dist/secured/operators.d.ts.map +1 -0
- package/dist/secured/operators.js +18 -0
- package/dist/secured/operators.js.map +1 -0
- package/dist/secured/read.d.ts +208 -0
- package/dist/secured/read.d.ts.map +1 -0
- package/dist/secured/read.js +1245 -0
- package/dist/secured/read.js.map +1 -0
- package/dist/secured/select.d.ts +87 -0
- package/dist/secured/select.d.ts.map +1 -0
- package/dist/secured/select.js +250 -0
- package/dist/secured/select.js.map +1 -0
- package/dist/secured/vector.d.ts +58 -0
- package/dist/secured/vector.d.ts.map +1 -0
- package/dist/secured/vector.js +113 -0
- package/dist/secured/vector.js.map +1 -0
- package/dist/secured/vocabulary.d.ts +227 -0
- package/dist/secured/vocabulary.d.ts.map +1 -0
- package/dist/secured/vocabulary.js +578 -0
- package/dist/secured/vocabulary.js.map +1 -0
- package/dist/secured/write.d.ts +58 -0
- package/dist/secured/write.d.ts.map +1 -0
- package/dist/secured/write.js +87 -0
- package/dist/secured/write.js.map +1 -0
- package/dist/testing/context.d.ts +236 -0
- package/dist/testing/context.d.ts.map +1 -0
- package/dist/testing/context.js +457 -0
- package/dist/testing/context.js.map +1 -0
- package/dist/testing/escape.d.ts +83 -0
- package/dist/testing/escape.d.ts.map +1 -0
- package/dist/testing/escape.js +148 -0
- package/dist/testing/escape.js.map +1 -0
- package/dist/testing/extensions.d.ts +48 -0
- package/dist/testing/extensions.d.ts.map +1 -0
- package/dist/testing/extensions.js +107 -0
- package/dist/testing/extensions.js.map +1 -0
- package/dist/testing/index.d.ts +5 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +11 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/plans.d.ts +64 -0
- package/dist/testing/plans.d.ts.map +1 -0
- package/dist/testing/plans.js +47 -0
- package/dist/testing/plans.js.map +1 -0
- package/dist/types/context.d.ts +110 -0
- package/dist/types/context.d.ts.map +1 -0
- package/dist/types/context.js +2 -0
- package/dist/types/context.js.map +1 -0
- package/dist/types/contract.d.ts +198 -0
- package/dist/types/contract.d.ts.map +1 -0
- package/dist/types/contract.js +2 -0
- package/dist/types/contract.js.map +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +11 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/inputs.d.ts +83 -0
- package/dist/types/inputs.d.ts.map +1 -0
- package/dist/types/inputs.js +2 -0
- package/dist/types/inputs.js.map +1 -0
- package/dist/types/rows.d.ts +76 -0
- package/dist/types/rows.d.ts.map +1 -0
- package/dist/types/rows.js +2 -0
- package/dist/types/rows.js.map +1 -0
- package/dist/types/secured-list.d.ts +396 -0
- package/dist/types/secured-list.d.ts.map +1 -0
- package/dist/types/secured-list.js +2 -0
- package/dist/types/secured-list.js.map +1 -0
- package/dist/unsafe.d.ts +162 -0
- package/dist/unsafe.d.ts.map +1 -0
- package/dist/unsafe.js +177 -0
- package/dist/unsafe.js.map +1 -0
- package/dist/validation/config-refusal.d.ts +16 -0
- package/dist/validation/config-refusal.d.ts.map +1 -0
- package/dist/validation/config-refusal.js +2 -0
- package/dist/validation/config-refusal.js.map +1 -0
- package/dist/validation/database-config.d.ts +19 -0
- package/dist/validation/database-config.d.ts.map +1 -0
- package/dist/validation/database-config.js +237 -0
- package/dist/validation/database-config.js.map +1 -0
- package/dist/validation/default-value.d.ts +21 -0
- package/dist/validation/default-value.d.ts.map +1 -0
- package/dist/validation/default-value.js +72 -0
- package/dist/validation/default-value.js.map +1 -0
- package/dist/validation/extension-packs.d.ts +11 -0
- package/dist/validation/extension-packs.d.ts.map +1 -0
- package/dist/validation/extension-packs.js +53 -0
- package/dist/validation/extension-packs.js.map +1 -0
- package/dist/validation/field-config.d.ts +35 -21
- package/dist/validation/field-config.d.ts.map +1 -1
- package/dist/validation/field-config.js +51 -41
- package/dist/validation/field-config.js.map +1 -1
- package/dist/validation/field-names.d.ts +15 -0
- package/dist/validation/field-names.d.ts.map +1 -0
- package/dist/validation/field-names.js +155 -0
- package/dist/validation/field-names.js.map +1 -0
- package/dist/validation/identifier-names.d.ts +4 -0
- package/dist/validation/identifier-names.d.ts.map +1 -0
- package/dist/validation/identifier-names.js +39 -0
- package/dist/validation/identifier-names.js.map +1 -0
- package/dist/validation/needs-closure.d.ts +20 -30
- package/dist/validation/needs-closure.d.ts.map +1 -1
- package/dist/validation/needs-closure.js +29 -105
- package/dist/validation/needs-closure.js.map +1 -1
- package/dist/validation/relations.d.ts +17 -0
- package/dist/validation/relations.d.ts.map +1 -0
- package/dist/validation/relations.js +268 -0
- package/dist/validation/relations.js.map +1 -0
- package/dist/validation/schema.d.ts.map +1 -1
- package/dist/validation/schema.js +1 -3
- package/dist/validation/schema.js.map +1 -1
- package/dist/where/like.d.ts +32 -0
- package/dist/where/like.d.ts.map +1 -0
- package/dist/where/like.js +42 -0
- package/dist/where/like.js.map +1 -0
- package/package.json +70 -8
- package/.turbo/turbo-build.log +0 -4
- package/CLAUDE.md +0 -609
- package/dist/access/access-filter.d.ts +0 -241
- package/dist/access/access-filter.d.ts.map +0 -1
- package/dist/access/access-filter.js +0 -692
- package/dist/access/access-filter.js.map +0 -1
- package/dist/access/access-filter.test.d.ts +0 -2
- package/dist/access/access-filter.test.d.ts.map +0 -1
- package/dist/access/access-filter.test.js +0 -1256
- package/dist/access/access-filter.test.js.map +0 -1
- package/dist/access/declared-dependencies.test.d.ts +0 -2
- package/dist/access/declared-dependencies.test.d.ts.map +0 -1
- package/dist/access/declared-dependencies.test.js +0 -226
- package/dist/access/declared-dependencies.test.js.map +0 -1
- package/dist/access/denied-relation-visibility.test.d.ts +0 -2
- package/dist/access/denied-relation-visibility.test.d.ts.map +0 -1
- package/dist/access/denied-relation-visibility.test.js +0 -114
- package/dist/access/denied-relation-visibility.test.js.map +0 -1
- package/dist/access/engine.test.d.ts +0 -2
- package/dist/access/engine.test.d.ts.map +0 -1
- package/dist/access/engine.test.js +0 -56
- package/dist/access/engine.test.js.map +0 -1
- package/dist/access/field-access.test.d.ts +0 -2
- package/dist/access/field-access.test.d.ts.map +0 -1
- package/dist/access/field-access.test.js +0 -635
- package/dist/access/field-access.test.js.map +0 -1
- package/dist/access/multi-column-read-write.test.d.ts +0 -2
- package/dist/access/multi-column-read-write.test.d.ts.map +0 -1
- package/dist/access/multi-column-read-write.test.js +0 -183
- package/dist/access/multi-column-read-write.test.js.map +0 -1
- package/dist/access/relationship-count.d.ts +0 -98
- package/dist/access/relationship-count.d.ts.map +0 -1
- package/dist/access/relationship-count.js +0 -262
- package/dist/access/relationship-count.js.map +0 -1
- package/dist/access/relationship-count.test.d.ts +0 -2
- package/dist/access/relationship-count.test.d.ts.map +0 -1
- package/dist/access/relationship-count.test.js +0 -247
- package/dist/access/relationship-count.test.js.map +0 -1
- package/dist/access/relationship-label-filter.d.ts +0 -45
- package/dist/access/relationship-label-filter.d.ts.map +0 -1
- package/dist/access/relationship-label-filter.js +0 -22
- package/dist/access/relationship-label-filter.js.map +0 -1
- package/dist/access/relationship-label-filter.test.d.ts +0 -2
- package/dist/access/relationship-label-filter.test.d.ts.map +0 -1
- package/dist/access/relationship-label-filter.test.js +0 -89
- package/dist/access/relationship-label-filter.test.js.map +0 -1
- package/dist/access/synthetic-include-read.test.d.ts +0 -2
- package/dist/access/synthetic-include-read.test.d.ts.map +0 -1
- package/dist/access/synthetic-include-read.test.js +0 -121
- package/dist/access/synthetic-include-read.test.js.map +0 -1
- package/dist/context/nested-operations.d.ts +0 -74
- package/dist/context/nested-operations.d.ts.map +0 -1
- package/dist/context/nested-operations.js +0 -847
- package/dist/context/nested-operations.js.map +0 -1
- package/dist/fields/calendar-day.test.d.ts +0 -2
- package/dist/fields/calendar-day.test.d.ts.map +0 -1
- package/dist/fields/calendar-day.test.js +0 -246
- package/dist/fields/calendar-day.test.js.map +0 -1
- package/dist/fields/format-prisma-default.d.ts +0 -35
- package/dist/fields/format-prisma-default.d.ts.map +0 -1
- package/dist/fields/format-prisma-default.js +0 -49
- package/dist/fields/format-prisma-default.js.map +0 -1
- package/dist/fields/format-prisma-default.test.d.ts +0 -2
- package/dist/fields/format-prisma-default.test.d.ts.map +0 -1
- package/dist/fields/format-prisma-default.test.js +0 -54
- package/dist/fields/format-prisma-default.test.js.map +0 -1
- package/dist/fields/relationship-foreign-key.test.d.ts +0 -2
- package/dist/fields/relationship-foreign-key.test.d.ts.map +0 -1
- package/dist/fields/relationship-foreign-key.test.js +0 -18
- package/dist/fields/relationship-foreign-key.test.js.map +0 -1
- package/dist/fields/select.test.d.ts +0 -2
- package/dist/fields/select.test.d.ts.map +0 -1
- package/dist/fields/select.test.js +0 -279
- package/dist/fields/select.test.js.map +0 -1
- package/dist/fields/text-keystone-compat.test.d.ts +0 -2
- package/dist/fields/text-keystone-compat.test.d.ts.map +0 -1
- package/dist/fields/text-keystone-compat.test.js +0 -93
- package/dist/fields/text-keystone-compat.test.js.map +0 -1
- package/dist/filter/filter.test.d.ts +0 -2
- package/dist/filter/filter.test.d.ts.map +0 -1
- package/dist/filter/filter.test.js +0 -431
- package/dist/filter/filter.test.js.map +0 -1
- package/dist/filter/serialize.test.d.ts +0 -2
- package/dist/filter/serialize.test.d.ts.map +0 -1
- package/dist/filter/serialize.test.js +0 -83
- package/dist/filter/serialize.test.js.map +0 -1
- package/dist/index.test.d.ts +0 -2
- package/dist/index.test.d.ts.map +0 -1
- package/dist/index.test.js +0 -33
- package/dist/index.test.js.map +0 -1
- package/dist/lib/case-utils.test.d.ts +0 -2
- package/dist/lib/case-utils.test.d.ts.map +0 -1
- package/dist/lib/case-utils.test.js +0 -123
- package/dist/lib/case-utils.test.js.map +0 -1
- package/dist/query/index.d.ts +0 -127
- package/dist/query/index.d.ts.map +0 -1
- package/dist/query/index.js +0 -179
- package/dist/query/index.js.map +0 -1
- package/dist/query/index.test.d.ts +0 -2
- package/dist/query/index.test.d.ts.map +0 -1
- package/dist/query/index.test.js +0 -632
- package/dist/query/index.test.js.map +0 -1
- package/dist/query/relationship-options.test.d.ts +0 -2
- package/dist/query/relationship-options.test.d.ts.map +0 -1
- package/dist/query/relationship-options.test.js +0 -150
- package/dist/query/relationship-options.test.js.map +0 -1
- package/dist/validation/field-config.test.d.ts +0 -2
- package/dist/validation/field-config.test.d.ts.map +0 -1
- package/dist/validation/field-config.test.js +0 -159
- package/dist/validation/field-config.test.js.map +0 -1
- package/dist/validation/schema.test.d.ts +0 -2
- package/dist/validation/schema.test.d.ts.map +0 -1
- package/dist/validation/schema.test.js +0 -409
- package/dist/validation/schema.test.js.map +0 -1
- package/docs/type-distribution-fix.md +0 -136
- package/src/access/access-filter.test.ts +0 -1919
- package/src/access/access-filter.ts +0 -1041
- package/src/access/declared-dependencies.test.ts +0 -277
- package/src/access/declared-dependencies.ts +0 -220
- package/src/access/denied-relation-visibility.test.ts +0 -173
- package/src/access/depth-limits.ts +0 -27
- package/src/access/engine.test.ts +0 -67
- package/src/access/engine.ts +0 -193
- package/src/access/errors.ts +0 -242
- package/src/access/field-access.test.ts +0 -792
- package/src/access/field-access.ts +0 -353
- package/src/access/field-transforms.ts +0 -68
- package/src/access/field-visibility.ts +0 -569
- package/src/access/index.ts +0 -82
- package/src/access/multi-column-read-write.test.ts +0 -305
- package/src/access/query-validation.ts +0 -486
- package/src/access/relationship-count.test.ts +0 -344
- package/src/access/relationship-count.ts +0 -346
- package/src/access/relationship-label-filter.test.ts +0 -128
- package/src/access/relationship-label-filter.ts +0 -63
- package/src/access/synthetic-include-read.test.ts +0 -179
- package/src/access/transaction-registry.ts +0 -58
- package/src/access/types.ts +0 -391
- package/src/config/index.ts +0 -177
- package/src/config/label.ts +0 -51
- package/src/config/nav-count.ts +0 -77
- package/src/config/plugin-engine.ts +0 -261
- package/src/config/types.ts +0 -3270
- package/src/context/apply-defaults.ts +0 -47
- package/src/context/hook-pipeline.ts +0 -137
- package/src/context/index.ts +0 -1737
- package/src/context/nested-operations.ts +0 -1470
- package/src/context/transaction-boundary.ts +0 -485
- package/src/context/write-pipeline.ts +0 -732
- package/src/extend.ts +0 -28
- package/src/fields/calendar-day.test.ts +0 -291
- package/src/fields/format-prisma-default.test.ts +0 -64
- package/src/fields/format-prisma-default.ts +0 -64
- package/src/fields/index.ts +0 -1901
- package/src/fields/relationship-foreign-key.test.ts +0 -29
- package/src/fields/select.test.ts +0 -336
- package/src/fields/text-keystone-compat.test.ts +0 -126
- package/src/filter/collect.ts +0 -108
- package/src/filter/filter.test.ts +0 -538
- package/src/filter/index.ts +0 -26
- package/src/filter/map.ts +0 -63
- package/src/filter/parse.ts +0 -99
- package/src/filter/serialize.test.ts +0 -115
- package/src/filter/serialize.ts +0 -73
- package/src/filter/types.ts +0 -120
- package/src/hooks/index.ts +0 -752
- package/src/index.test.ts +0 -50
- package/src/index.ts +0 -192
- package/src/internal.ts +0 -61
- package/src/lib/case-utils.test.ts +0 -159
- package/src/lib/case-utils.ts +0 -68
- package/src/lib/prisma-errors.ts +0 -86
- package/src/mcp/constants.ts +0 -24
- package/src/mcp/field-schema.ts +0 -84
- package/src/mcp/handler.ts +0 -633
- package/src/mcp/index.ts +0 -7
- package/src/mcp/projection.ts +0 -497
- package/src/mcp/types.ts +0 -18
- package/src/query/index.test.ts +0 -830
- package/src/query/index.ts +0 -352
- package/src/query/relationship-options.test.ts +0 -194
- package/src/query/relationship-options.ts +0 -78
- package/src/utils/password.ts +0 -80
- package/src/validation/field-config.test.ts +0 -199
- package/src/validation/field-config.ts +0 -139
- package/src/validation/needs-closure.ts +0 -188
- package/src/validation/schema.test.ts +0 -487
- package/src/validation/schema.ts +0 -51
- package/tests/access-relationships.test.ts +0 -646
- package/tests/access.test.ts +0 -590
- package/tests/apply-defaults.test.ts +0 -119
- package/tests/bare-read-scalars.test.ts +0 -147
- package/tests/computed-field-selective-evaluation.test.ts +0 -418
- package/tests/config.test.ts +0 -242
- package/tests/context.test.ts +0 -3146
- package/tests/default-value-create.test.ts +0 -299
- package/tests/field-hooks.test.ts +0 -410
- package/tests/field-types.test.ts +0 -1291
- package/tests/hook-context-secured.test.ts +0 -424
- package/tests/hook-pipeline.test.ts +0 -233
- package/tests/hooks.test.ts +0 -481
- package/tests/interactive-transaction.test.ts +0 -444
- package/tests/label.test.ts +0 -135
- package/tests/mcp-fields-projection-access.test.ts +0 -250
- package/tests/mcp-handler.test.ts +0 -1411
- package/tests/multi-column-validation-ordering.test.ts +0 -305
- package/tests/nav-count.test.ts +0 -189
- package/tests/needs-declared-dependencies.test.ts +0 -503
- package/tests/nested-access-and-hooks.test.ts +0 -2566
- package/tests/nested-operation-registry.test.ts +0 -317
- package/tests/nested-write-hooks.test.ts +0 -864
- package/tests/nested-write-synthetic-relation.test.ts +0 -437
- package/tests/password-type-distribution.test.ts +0 -154
- package/tests/password-types.test.ts +0 -174
- package/tests/password.test.ts +0 -263
- package/tests/plugin-engine.test.ts +0 -1155
- package/tests/prisma-errors.test.ts +0 -141
- package/tests/resolve-chain.test.ts +0 -411
- package/tests/singleton.test.ts +0 -421
- package/tests/sudo.test.ts +0 -676
- package/tests/to-one-include-access-filter.test.ts +0 -172
- package/tests/transaction-boundary-hooks.test.ts +0 -710
- package/tests/transaction-boundary-outermost.test.ts +0 -530
- package/tests/virtual-fields.test.ts +0 -421
- package/tests/with-session.test.ts +0 -243
- package/tests/write-pipeline.test.ts +0 -617
- package/tsconfig.json +0 -12
- package/tsconfig.tsbuildinfo +0 -1
- package/vitest.config.ts +0 -69
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { AnyExpression } from '@prisma/orm-postgres/relational-core';
|
|
2
|
+
import type { OrmClient, OrmRow } from '../access/types.js';
|
|
3
|
+
import { type PredicateAccessor, type WhereCombinators } from './lower.js';
|
|
4
|
+
import type { WherePlan } from './vocabulary.js';
|
|
5
|
+
export { whereCombinators } from './lower.js';
|
|
6
|
+
export type { WhereCombinators } from './lower.js';
|
|
7
|
+
/** What a bare aggregate spec names on the ORM's aggregate accessor. */
|
|
8
|
+
interface AggregateAccessor {
|
|
9
|
+
count(): AggregateReduction;
|
|
10
|
+
}
|
|
11
|
+
interface AggregateReduction {
|
|
12
|
+
readonly aggregated?: never;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The part of a Prisma 8 collection a write drives, structurally.
|
|
16
|
+
*
|
|
17
|
+
* `where` appends a predicate — repeated calls are AND-combined by the ORM,
|
|
18
|
+
* which is what makes the Access Filter a second entry beside the target's own
|
|
19
|
+
* rather than something hand-merged into it (ADR-0044). `update` and `delete`
|
|
20
|
+
* answer `null` when nothing matched, which is how a row that vanished between
|
|
21
|
+
* the target read and the write reaches the pipeline.
|
|
22
|
+
*/
|
|
23
|
+
export interface WriteCollection {
|
|
24
|
+
where(predicate: (model: PredicateAccessor) => AnyExpression): WriteCollection;
|
|
25
|
+
first(): Promise<OrmRow | null>;
|
|
26
|
+
aggregate(build: (aggregate: AggregateAccessor) => Record<string, AggregateReduction>): Promise<Record<string, unknown>>;
|
|
27
|
+
create(data: Record<string, unknown>): Promise<OrmRow>;
|
|
28
|
+
update(data: Record<string, unknown>): Promise<OrmRow | null>;
|
|
29
|
+
delete(): Promise<OrmRow | null>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Thrown when the ORM client carries no collection for a list the config
|
|
33
|
+
* declares — a generation or wiring fault rather than an access denial, so it
|
|
34
|
+
* is reported rather than silently treated as a denied write.
|
|
35
|
+
*/
|
|
36
|
+
export declare class WriteCollectionMissingError extends Error {
|
|
37
|
+
readonly listName: string;
|
|
38
|
+
constructor(listName: string);
|
|
39
|
+
}
|
|
40
|
+
export declare function writeCollection(ormHandle: OrmClient, listName: string): WriteCollection;
|
|
41
|
+
/**
|
|
42
|
+
* The predicate a write runs under: the engine's own target predicate, and the
|
|
43
|
+
* Access Filter beside it when the list's rule returned one. Each entry is its
|
|
44
|
+
* own `where` call, so the ORM ANDs them.
|
|
45
|
+
*/
|
|
46
|
+
export type WriteScope = readonly WherePlan[];
|
|
47
|
+
/** The engine's own `id = <value>` predicate for a targeted write. */
|
|
48
|
+
export declare function identityPredicate(listName: string, id: string | number): WherePlan;
|
|
49
|
+
/** The engine's own `column = <value>` (or `IS NULL`) predicate for a guarded write. */
|
|
50
|
+
export declare function columnEqualsPredicate(listName: string, column: string, value: string | number | boolean | null): WherePlan;
|
|
51
|
+
/** The first row this scope matches, or `null` — the write's target read. */
|
|
52
|
+
export declare function firstMatching(collection: WriteCollection, scope: WriteScope, ops: WhereCombinators): Promise<OrmRow | null>;
|
|
53
|
+
/** How many rows the list holds. Only a singleton's constraint asks. */
|
|
54
|
+
export declare function countRows(collection: WriteCollection, listName: string): Promise<number>;
|
|
55
|
+
export declare function insertRow(collection: WriteCollection, data: Record<string, unknown>): Promise<OrmRow>;
|
|
56
|
+
export declare function updateFirst(collection: WriteCollection, scope: WriteScope, ops: WhereCombinators, data: Record<string, unknown>): Promise<OrmRow | null>;
|
|
57
|
+
export declare function deleteFirst(collection: WriteCollection, scope: WriteScope, ops: WhereCombinators): Promise<OrmRow | null>;
|
|
58
|
+
//# sourceMappingURL=write.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../../src/secured/write.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAA;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAG3D,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACtB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAC7C,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD,wEAAwE;AACxE,UAAU,iBAAiB;IACzB,KAAK,IAAI,kBAAkB,CAAA;CAC5B;AAED,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,UAAU,CAAC,EAAE,KAAK,CAAA;CAC5B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,aAAa,GAAG,eAAe,CAAA;IAC9E,KAAK,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IAC/B,SAAS,CACP,KAAK,EAAE,CAAC,SAAS,EAAE,iBAAiB,KAAK,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAC1E,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IACnC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IACtD,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EACjB,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAExB;AAED,wBAAgB,WAAW,CACzB,UAAU,EAAE,eAAe,EAC3B,KAAK,EAAE,UAAU,EACjB,GAAG,EAAE,gBAAgB,GACpB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAExB"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// The secured write surface's ORM lane: the part of a Prisma 8 collection the
|
|
2
|
+
// Write Pipeline drives, and the statements it issues. Reads compose through
|
|
3
|
+
// `read.ts`; a write composes here, over the same lowered predicates, so the
|
|
4
|
+
// Access Filter reaches an `UPDATE` the way it reaches a `SELECT`.
|
|
5
|
+
// See ADR-0044, ADR-0050, ADR-0059.
|
|
6
|
+
import { ValidationError } from '../hooks/index.js';
|
|
7
|
+
import { withOrigin } from '../origin.js';
|
|
8
|
+
import { lowerWhere, toColumnValue, } from './lower.js';
|
|
9
|
+
export { whereCombinators } from './lower.js';
|
|
10
|
+
/**
|
|
11
|
+
* Presence, not completeness — the same rule `isReadableCollection` states in
|
|
12
|
+
* `read.ts`. A test double implements only the operations its test reaches, so
|
|
13
|
+
* requiring the full set would refuse a client the engine can drive; a member
|
|
14
|
+
* that is genuinely absent surfaces at its own call site.
|
|
15
|
+
*/
|
|
16
|
+
function isWriteCollection(value) {
|
|
17
|
+
return typeof value === 'object' && value !== null;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Thrown when the ORM client carries no collection for a list the config
|
|
21
|
+
* declares — a generation or wiring fault rather than an access denial, so it
|
|
22
|
+
* is reported rather than silently treated as a denied write.
|
|
23
|
+
*/
|
|
24
|
+
export class WriteCollectionMissingError extends Error {
|
|
25
|
+
listName;
|
|
26
|
+
constructor(listName) {
|
|
27
|
+
super(`The ORM client has no collection for list "${listName}" to write through. Re-run ` +
|
|
28
|
+
`\`opensaas generate\` so the emitted contract matches the config.`);
|
|
29
|
+
this.listName = listName;
|
|
30
|
+
this.name = 'WriteCollectionMissingError';
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export function writeCollection(ormHandle, listName) {
|
|
34
|
+
const collection = ormHandle[listName];
|
|
35
|
+
if (!isWriteCollection(collection))
|
|
36
|
+
throw new WriteCollectionMissingError(listName);
|
|
37
|
+
return collection;
|
|
38
|
+
}
|
|
39
|
+
/** The engine's own `id = <value>` predicate for a targeted write. */
|
|
40
|
+
export function identityPredicate(listName, id) {
|
|
41
|
+
return { kind: 'scalar', listName, column: 'id', steps: [{ op: 'eq', value: id }] };
|
|
42
|
+
}
|
|
43
|
+
/** The engine's own `column = <value>` (or `IS NULL`) predicate for a guarded write. */
|
|
44
|
+
export function columnEqualsPredicate(listName, column, value) {
|
|
45
|
+
return {
|
|
46
|
+
kind: 'scalar',
|
|
47
|
+
listName,
|
|
48
|
+
column,
|
|
49
|
+
steps: [value === null ? { op: 'isNull' } : { op: 'eq', value }],
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function scoped(collection, scope, ops) {
|
|
53
|
+
let composed = collection;
|
|
54
|
+
for (const plan of scope) {
|
|
55
|
+
composed = composed.where((model) => lowerWhere(plan, model, ops));
|
|
56
|
+
}
|
|
57
|
+
return composed;
|
|
58
|
+
}
|
|
59
|
+
/** The first row this scope matches, or `null` — the write's target read. */
|
|
60
|
+
export function firstMatching(collection, scope, ops) {
|
|
61
|
+
return withOrigin('engine', () => scoped(collection, scope, ops).first());
|
|
62
|
+
}
|
|
63
|
+
/** How many rows the list holds. Only a singleton's constraint asks. */
|
|
64
|
+
export async function countRows(collection, listName) {
|
|
65
|
+
const result = await withOrigin('engine', () => collection.aggregate((aggregate) => ({ rows: aggregate.count() })));
|
|
66
|
+
const rows = result.rows;
|
|
67
|
+
if (typeof rows !== 'number') {
|
|
68
|
+
throw new ValidationError([
|
|
69
|
+
`The database answered a count of "${listName}" with something other than a number. ` +
|
|
70
|
+
`Re-run \`opensaas generate\` so the emitted contract matches the config.`,
|
|
71
|
+
]);
|
|
72
|
+
}
|
|
73
|
+
return rows;
|
|
74
|
+
}
|
|
75
|
+
function toColumnValues(data) {
|
|
76
|
+
return Object.fromEntries(Object.entries(data).map(([key, value]) => [key, toColumnValue(value)]));
|
|
77
|
+
}
|
|
78
|
+
export function insertRow(collection, data) {
|
|
79
|
+
return withOrigin('engine', () => collection.create(toColumnValues(data)));
|
|
80
|
+
}
|
|
81
|
+
export function updateFirst(collection, scope, ops, data) {
|
|
82
|
+
return withOrigin('engine', () => scoped(collection, scope, ops).update(toColumnValues(data)));
|
|
83
|
+
}
|
|
84
|
+
export function deleteFirst(collection, scope, ops) {
|
|
85
|
+
return withOrigin('engine', () => scoped(collection, scope, ops).delete());
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=write.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write.js","sourceRoot":"","sources":["../../src/secured/write.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,6EAA6E;AAC7E,6EAA6E;AAC7E,mEAAmE;AACnE,oCAAoC;AAIpC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EACL,UAAU,EACV,aAAa,GAGd,MAAM,YAAY,CAAA;AAGnB,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAgC7C;;;;;GAKG;AACH,SAAS,iBAAiB,CAAC,KAAc;IACvC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAA;AACpD,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,2BAA4B,SAAQ,KAAK;IAC/B,QAAQ;IAA7B,YAAqB,QAAgB;QACnC,KAAK,CACH,8CAA8C,QAAQ,6BAA6B;YACjF,mEAAmE,CACtE,CAAA;wBAJkB,QAAQ;QAK3B,IA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U,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AAChG,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,UAA2B,EAC3B,KAAiB,EACjB,GAAqB;IAErB,OAAO,UAAU,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,CAAA;AAC5E,CAAC"}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import type { PostgresClient } from '@prisma/orm-postgres/runtime';
|
|
2
|
+
import type { SqlMiddleware } from '@prisma/orm-postgres/family-runtime';
|
|
3
|
+
import type { AccessControlledDB, StorageUtils } from '../access/index.js';
|
|
4
|
+
import type { OrmClient } from '../access/types.js';
|
|
5
|
+
import type { OpenSaasConfig } from '../config/types.js';
|
|
6
|
+
import { type PrismaContract } from '../contract/prisma.js';
|
|
7
|
+
import type { ContractData } from '../contract/types.js';
|
|
8
|
+
import type { StackContext } from '../types/context.js';
|
|
9
|
+
import { type LoadedExtensionPacks } from './extensions.js';
|
|
10
|
+
/**
|
|
11
|
+
* The prefix every database the escape path creates carries, followed by a
|
|
12
|
+
* UTC `YYYYMMDDHHMMSS` stamp and a UUID. A run killed before `close()` leaves
|
|
13
|
+
* one behind, and the stamp is what makes the leftovers sweepable by age
|
|
14
|
+
* rather than only greppable — see the `Known limits` note on
|
|
15
|
+
* {@link createTestDatabase} for the statement.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ESCAPE_DATABASE_PREFIX = "opensaas_test_";
|
|
18
|
+
/** Options for {@link createTestDatabase} and {@link createTestContext}. */
|
|
19
|
+
export interface TestDatabaseOptions {
|
|
20
|
+
/**
|
|
21
|
+
* Already-loaded extension packs, by binding name. Pass these when a
|
|
22
|
+
* declared pack is not resolvable from `@opensaas/stack-core` itself; any
|
|
23
|
+
* pack not named here is imported from its own package.
|
|
24
|
+
*/
|
|
25
|
+
packs?: LoadedExtensionPacks;
|
|
26
|
+
/**
|
|
27
|
+
* Extra middleware registered after the tripwire — a
|
|
28
|
+
* {@link createPlanRecorder} recorder, typically. The tripwire is always
|
|
29
|
+
* first and is never omitted.
|
|
30
|
+
*/
|
|
31
|
+
middleware?: readonly SqlMiddleware[];
|
|
32
|
+
/**
|
|
33
|
+
* The storage surface a `file()`/`image()` field writes through. Core cannot
|
|
34
|
+
* build one — the providers live in `@opensaas/stack-storage`, which depends
|
|
35
|
+
* on core rather than the other way round — so the generated context supplies
|
|
36
|
+
* it in an application, and a test that exercises a storage-backed field
|
|
37
|
+
* supplies the same thing here. Without it those fields throw "No storage
|
|
38
|
+
* providers configured", exactly as they do in an app that declares none.
|
|
39
|
+
*/
|
|
40
|
+
storage?: StorageUtils;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A stood-up database, its client, and the contexts built over it.
|
|
44
|
+
*
|
|
45
|
+
* @typeParam TContext - the context shape `context()` hands back. Defaults to
|
|
46
|
+
* the engine's own untyped {@link StackContext}`<AccessControlledDB>`, whose
|
|
47
|
+
* rows are unknown. Name the app's own generated `Context` here —
|
|
48
|
+
* `createTestDatabase<Context>(config)` — to get back the same row, `where`,
|
|
49
|
+
* `select` and `include` types the generated `getContext()` gives an
|
|
50
|
+
* application, over the harness's own isolated database.
|
|
51
|
+
*/
|
|
52
|
+
export interface TestDatabase<TContext extends {
|
|
53
|
+
session: unknown;
|
|
54
|
+
} = StackContext<AccessControlledDB>> {
|
|
55
|
+
/** The connection string this instance is bound to. */
|
|
56
|
+
readonly url: string;
|
|
57
|
+
/** `'pglite'` for the in-process dev database, `'escape'` for `DATABASE_URL`. */
|
|
58
|
+
readonly provenance: 'pglite' | 'escape';
|
|
59
|
+
/** The built contract the schema was applied from. */
|
|
60
|
+
readonly contract: PrismaContract;
|
|
61
|
+
/** The derived contract data, for a test that needs the models it declares. */
|
|
62
|
+
readonly data: ContractData;
|
|
63
|
+
/**
|
|
64
|
+
* The Prisma 8 client the contexts are built over — the construction option
|
|
65
|
+
* itself, not a seam on the secured wrapper. Its queries run under the
|
|
66
|
+
* tripwire like every other, so a call must enter an origin
|
|
67
|
+
* (`withOrigin('unsafe', …)`) or be refused.
|
|
68
|
+
*/
|
|
69
|
+
readonly client: PostgresClient<PrismaContract>;
|
|
70
|
+
/** A real, fully secured context over this database, at `session`. */
|
|
71
|
+
context(session?: TContext['session']): TContext;
|
|
72
|
+
/** Empty every table the contract declares, restarting identity sequences. */
|
|
73
|
+
truncate(): Promise<void>;
|
|
74
|
+
/** Close the client, drop the instance, and remove its temporary files. */
|
|
75
|
+
close(): Promise<void>;
|
|
76
|
+
}
|
|
77
|
+
/** What {@link createTestContext} returns: a {@link TestDatabase} and one context. */
|
|
78
|
+
export interface TestContext<TContext extends {
|
|
79
|
+
session: unknown;
|
|
80
|
+
} = StackContext<AccessControlledDB>> extends Omit<TestDatabase<TContext>, 'context'> {
|
|
81
|
+
/** The secured context at the session `createTestContext` was called with. */
|
|
82
|
+
readonly context: TContext;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Thrown when the client exposes no collection for a model the contract
|
|
86
|
+
* declares. The engine reaches every model through this map, so an entry that
|
|
87
|
+
* resolved to `undefined` would build a context that refuses every operation
|
|
88
|
+
* with `OrmModelMissingError` — advice to re-run `opensaas generate`, which a
|
|
89
|
+
* harness user cannot act on. This is the assertion that the client's shape is
|
|
90
|
+
* the one the harness derives from.
|
|
91
|
+
*/
|
|
92
|
+
export declare class OrmCollectionMissingError extends Error {
|
|
93
|
+
readonly model: string;
|
|
94
|
+
readonly namespace: string;
|
|
95
|
+
readonly namespaces: readonly string[];
|
|
96
|
+
readonly collections: readonly string[];
|
|
97
|
+
constructor(model: string, namespace: string, namespaces: readonly string[], collections: readonly string[]);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* The client's collections, keyed the way {@link ormModel} looks them up.
|
|
101
|
+
*
|
|
102
|
+
* A Prisma 8 client exposes its collections at `orm.<namespace>.<Model>` while
|
|
103
|
+
* the engine reaches a model by db key; this is the same reconciliation the
|
|
104
|
+
* generated context performs, in one place, until the runtime spec makes it
|
|
105
|
+
* unnecessary.
|
|
106
|
+
*/
|
|
107
|
+
export declare function ormClientFor(data: ContractData, orm: unknown): OrmClient;
|
|
108
|
+
/**
|
|
109
|
+
* Thrown when the control client refuses to apply the schema — a server
|
|
110
|
+
* missing a declared extension is the common case, and ADR-0065 leaves that
|
|
111
|
+
* report to Prisma. `assertOk()` would say only "Expected Ok result but got
|
|
112
|
+
* NotOk", so the failure's own payload is carried through here.
|
|
113
|
+
*/
|
|
114
|
+
export declare class SchemaApplyError extends Error {
|
|
115
|
+
readonly url: string;
|
|
116
|
+
readonly failure: unknown;
|
|
117
|
+
constructor(url: string, failure: unknown);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Thrown when the harness falls to the in-process database and one of PGlite's
|
|
121
|
+
* packages is not installed. They are optional peers of core, so a production
|
|
122
|
+
* install carries no WASM Postgres — and a test run without them needs to say
|
|
123
|
+
* which install is missing rather than report a bare module-resolution failure
|
|
124
|
+
* from inside the dev database.
|
|
125
|
+
*/
|
|
126
|
+
export declare class DevDatabaseUnavailableError extends Error {
|
|
127
|
+
readonly cause: unknown;
|
|
128
|
+
constructor(cause: unknown);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Stand up one database for a test file: derive the contract from `config`,
|
|
132
|
+
* seed every declared pack's Extension contract space, apply the schema once
|
|
133
|
+
* through the control client's `dbUpdate`, and bind a Prisma 8 client to it
|
|
134
|
+
* with the stack's own tripwire installed (ADR-0057, ADR-0063, ADR-0065).
|
|
135
|
+
*
|
|
136
|
+
* Call this once per file in `beforeAll`, {@link TestDatabase.truncate} in
|
|
137
|
+
* `beforeEach`, and {@link TestDatabase.close} in `afterAll`. Tests within a
|
|
138
|
+
* file share the schema and nothing else.
|
|
139
|
+
*
|
|
140
|
+
* With `DATABASE_URL` set to a Postgres server the identical suite runs there
|
|
141
|
+
* instead, in a database of its own that is dropped on close; set to anything
|
|
142
|
+
* else the variable is a misconfiguration and this throws rather than dialling
|
|
143
|
+
* it. PGlite and its socket and pgvector packages are optional peers imported
|
|
144
|
+
* only on the unset path, so a production install carries no WASM Postgres.
|
|
145
|
+
*
|
|
146
|
+
* The tripwire is installed unconditionally, from the same `../origin.js` the
|
|
147
|
+
* generator emits — one copy, so a regression in the Engine stamp fails a test
|
|
148
|
+
* rather than a production login. A query the harness itself issues through
|
|
149
|
+
* {@link TestDatabase.client} is refused unless it enters an origin.
|
|
150
|
+
*
|
|
151
|
+
* Known limits:
|
|
152
|
+
* - `context.db` reads and writes for real; `connect` and the row lock arrive
|
|
153
|
+
* in later specs, so a payload here carries this list's own scalars.
|
|
154
|
+
* - PGlite serialises every transaction, so nothing contention-shaped is
|
|
155
|
+
* observable on the default harness. Those guarantees are escape-only.
|
|
156
|
+
* - Only `pgvector` is mapped to a PGlite extension. A pack outside that map
|
|
157
|
+
* reaches `CREATE EXTENSION` with nothing installed and the apply fails
|
|
158
|
+
* naming the missing control file; run it under the escape.
|
|
159
|
+
* - Packs are imported by package name from core's own module. A pack the
|
|
160
|
+
* consuming package depends on but core cannot resolve must be passed as
|
|
161
|
+
* `options.packs`.
|
|
162
|
+
* - The escape path issues `CREATE DATABASE` and `DROP DATABASE`, so the role
|
|
163
|
+
* `DATABASE_URL` names needs `CREATEDB`. A superuser — CI's container, a
|
|
164
|
+
* local install — has it. `DROP DATABASE … WITH (FORCE)` needs PostgreSQL
|
|
165
|
+
* 13 or newer.
|
|
166
|
+
* - `close()` runs from `afterAll`, so a killed worker or a `Ctrl-C` leaves
|
|
167
|
+
* its database on the escape server. Each is named
|
|
168
|
+
* `opensaas_test_<YYYYMMDDHHMMSS>_<uuid>` in UTC, so a sweep is:
|
|
169
|
+
* `select 'drop database ' || quote_ident(datname) || ' with (force);'
|
|
170
|
+
* from pg_database where datname like 'opensaas_test\_%'` — filter on the
|
|
171
|
+
* stamp to spare a run in flight, then execute what it returns.
|
|
172
|
+
* - `truncate()` empties the tables the contract declares. It does not touch
|
|
173
|
+
* Prisma's own marker tables, which the schema apply owns. A contract
|
|
174
|
+
* declaring no model has nothing to empty and `truncate()` is a no-op. It
|
|
175
|
+
* runs the statement through the harness's own client — the same `max: 1`
|
|
176
|
+
* pool a write uses — rather than opening a client of its own, so the
|
|
177
|
+
* database never sees more than the one declared connection while a test
|
|
178
|
+
* is running. The only step that opens a second connection is
|
|
179
|
+
* `startInstance`'s escape-path `CREATE DATABASE`/`DROP DATABASE`, and it
|
|
180
|
+
* necessarily does: those statements run against the control database,
|
|
181
|
+
* before the target database (and its pool) exist to route through, and
|
|
182
|
+
* after `close()` releases that pool.
|
|
183
|
+
* - {@link TestDatabase.client} is the raw Prisma collections, which carry none
|
|
184
|
+
* of the engine's access control or hooks. It is the construction option,
|
|
185
|
+
* not a seam on the secured wrapper: seed through it when a fixture must
|
|
186
|
+
* bypass the engine, and through `context.db` when the engine is the subject.
|
|
187
|
+
*
|
|
188
|
+
* Generic over the context {@link TestDatabase.context} hands back — name the
|
|
189
|
+
* app's own generated `Context` (`createTestDatabase<Context>(config)`) to get
|
|
190
|
+
* typed rows, `where`, `select` and `include` over this harness's database;
|
|
191
|
+
* omitted, `context()` returns the engine's untyped `StackContext<AccessControlledDB>`.
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* ```typescript
|
|
195
|
+
* let db: TestDatabase
|
|
196
|
+
* beforeAll(async () => { db = await createTestDatabase(config) }, 60_000)
|
|
197
|
+
* afterAll(async () => { await db.close() })
|
|
198
|
+
* beforeEach(async () => { await db.truncate() })
|
|
199
|
+
* ```
|
|
200
|
+
*/
|
|
201
|
+
export declare function createTestDatabase<TContext extends {
|
|
202
|
+
session: unknown;
|
|
203
|
+
} = StackContext<AccessControlledDB>>(config: OpenSaasConfig, options?: TestDatabaseOptions): Promise<TestDatabase<TContext>>;
|
|
204
|
+
/**
|
|
205
|
+
* A real, fully secured context over an in-process Postgres — the only double
|
|
206
|
+
* the stack offers (ADR-0057). No test fakes the secured surface: the config
|
|
207
|
+
* is derived to a contract, the schema is applied to a database the harness
|
|
208
|
+
* owns, and the context is the same `getContext` an application gets.
|
|
209
|
+
*
|
|
210
|
+
* This is the single-call form of {@link createTestDatabase}, for a file with
|
|
211
|
+
* one session. A file that needs several sessions, or that truncates between
|
|
212
|
+
* tests, should stand the database up once and call
|
|
213
|
+
* {@link TestDatabase.context} per test — every limit documented on
|
|
214
|
+
* `createTestDatabase` applies here unchanged.
|
|
215
|
+
*
|
|
216
|
+
* Generic over the context returned, exactly as {@link createTestDatabase} is
|
|
217
|
+
* — name the app's own generated `Context` to get typed rows over this
|
|
218
|
+
* harness's database instead of the engine's untyped `StackContext<AccessControlledDB>`:
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
221
|
+
* ```typescript
|
|
222
|
+
* import { createTestContext } from '@opensaas/stack-core/testing'
|
|
223
|
+
* import type { Context } from '../.opensaas/types.js'
|
|
224
|
+
*
|
|
225
|
+
* const harness = await createTestContext<Context>(config, { userId: 'user-1' })
|
|
226
|
+
* try {
|
|
227
|
+
* const posts = await harness.context.db.Post.all()
|
|
228
|
+
* } finally {
|
|
229
|
+
* await harness.close()
|
|
230
|
+
* }
|
|
231
|
+
* ```
|
|
232
|
+
*/
|
|
233
|
+
export declare function createTestContext<TContext extends {
|
|
234
|
+
session: unknown;
|
|
235
|
+
} = StackContext<AccessControlledDB>>(config: OpenSaasConfig, session?: TContext['session'], options?: TestDatabaseOptions): Promise<TestContext<TContext>>;
|
|
236
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/testing/context.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAA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