@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,148 @@
|
|
|
1
|
+
import { CONNECTION_VARIABLES, connectionStringFault } from '../db/url.js';
|
|
2
|
+
/**
|
|
3
|
+
* The variables the harness reads, in the same order `resolveDatabaseUrl()`
|
|
4
|
+
* does — `DIRECT_DATABASE_URL` first — and the only escape from in-process
|
|
5
|
+
* PGlite. Re-exported from `../db/url.js` rather than declared here, so the
|
|
6
|
+
* application's lookup and the harness's cannot drift apart again (issue
|
|
7
|
+
* #1210): with only `DIRECT_DATABASE_URL` set, both now agree it names a
|
|
8
|
+
* usable connection.
|
|
9
|
+
*/
|
|
10
|
+
export const ESCAPE_VARIABLES = CONNECTION_VARIABLES;
|
|
11
|
+
/**
|
|
12
|
+
* Thrown when one of {@link ESCAPE_VARIABLES} is set to something that is not
|
|
13
|
+
* a Postgres connection string. Names the variable, its value, the fault and
|
|
14
|
+
* both remedies.
|
|
15
|
+
*
|
|
16
|
+
* A set-but-unusable value is not the same as an unset one: node-postgres
|
|
17
|
+
* quietly falls back to `localhost:5432` for a string it cannot parse, so a
|
|
18
|
+
* suite that dialled it would report a bare `ECONNREFUSED` several frames from
|
|
19
|
+
* the actual mistake. This is the failure a stale SQLite `DATABASE_URL` in CI
|
|
20
|
+
* produced after Postgres became the only provider.
|
|
21
|
+
*/
|
|
22
|
+
export class UnusableDatabaseEscapeError extends Error {
|
|
23
|
+
variable;
|
|
24
|
+
url;
|
|
25
|
+
fault;
|
|
26
|
+
constructor(variable, url, fault) {
|
|
27
|
+
super(`${variable} is set to \`${url}\`, which ${fault}. The test harness dials this ` +
|
|
28
|
+
`variable when it is set, so either point it at a Postgres server (\`postgres://…\`) or ` +
|
|
29
|
+
`unset it to run the suite on the in-process dev database.`);
|
|
30
|
+
this.variable = variable;
|
|
31
|
+
this.url = url;
|
|
32
|
+
this.fault = fault;
|
|
33
|
+
this.name = 'UnusableDatabaseEscapeError';
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Classify {@link ESCAPE_VARIABLES} without dialling them. The first variable
|
|
38
|
+
* that is set and non-empty wins — the same rule `resolveDatabaseUrl()` uses —
|
|
39
|
+
* so a value in `DIRECT_DATABASE_URL` alone is classified exactly as the
|
|
40
|
+
* application would resolve it, rather than falling through to `'absent'`.
|
|
41
|
+
*
|
|
42
|
+
* Read this at module scope in a suite whose guarantee PGlite cannot exercise —
|
|
43
|
+
* ADR-0047's row-lock contention, real pool concurrency — and skip on it by
|
|
44
|
+
* name, so the skip is visible in the reporter rather than silent:
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* const escape = readDatabaseEscape()
|
|
49
|
+
* test.skipIf(escape.kind !== 'postgres')(
|
|
50
|
+
* `two bookings contend for one slot [escape-only: ${ESCAPE_VARIABLES.join('/')} names no Postgres]`,
|
|
51
|
+
* async () => { … },
|
|
52
|
+
* )
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export function readDatabaseEscape() {
|
|
56
|
+
for (const variable of ESCAPE_VARIABLES) {
|
|
57
|
+
const url = process.env[variable];
|
|
58
|
+
if (url === undefined || url.length === 0)
|
|
59
|
+
continue;
|
|
60
|
+
const fault = connectionStringFault(url);
|
|
61
|
+
if (fault !== undefined)
|
|
62
|
+
return { kind: 'unusable', variable, url, fault };
|
|
63
|
+
return { kind: 'postgres', url };
|
|
64
|
+
}
|
|
65
|
+
return { kind: 'absent' };
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The escape's URL, or `undefined` to run on the dev database.
|
|
69
|
+
*
|
|
70
|
+
* @throws {UnusableDatabaseEscapeError} when one of {@link ESCAPE_VARIABLES}
|
|
71
|
+
* is set to anything that is not a Postgres connection string.
|
|
72
|
+
*/
|
|
73
|
+
export function requireUsableDatabaseEscape() {
|
|
74
|
+
const escape = readDatabaseEscape();
|
|
75
|
+
if (escape.kind === 'unusable') {
|
|
76
|
+
throw new UnusableDatabaseEscapeError(escape.variable, escape.url, escape.fault);
|
|
77
|
+
}
|
|
78
|
+
return escape.kind === 'postgres' ? escape.url : undefined;
|
|
79
|
+
}
|
|
80
|
+
/** How long {@link probePgvectorAvailability} keeps redialling a server it cannot reach yet. */
|
|
81
|
+
const PROBE_DEADLINE = 30_000;
|
|
82
|
+
const PROBE_CONNECT_TIMEOUT = 5_000;
|
|
83
|
+
const PROBE_BACKOFF = 500;
|
|
84
|
+
function pause(ms) {
|
|
85
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
86
|
+
}
|
|
87
|
+
/** node-postgres reports a refused dial as an `AggregateError` whose own message is empty. */
|
|
88
|
+
function describeFault(fault) {
|
|
89
|
+
if (fault instanceof AggregateError) {
|
|
90
|
+
return fault.errors.map(describeFault).join('; ') || fault.name;
|
|
91
|
+
}
|
|
92
|
+
return fault instanceof Error ? `${fault.name}: ${fault.message}` : String(fault);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* `pg` is a real dependency of core, but a production install without the
|
|
96
|
+
* PGlite peers must still be able to load this subpath — so, like
|
|
97
|
+
* `testing/context.ts`'s own `pgModule`, it is reached only through a
|
|
98
|
+
* dynamic `import()`, never a static one.
|
|
99
|
+
*/
|
|
100
|
+
async function pgModule() {
|
|
101
|
+
return (await import('pg')).default;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Whether a Postgres server named by the escape carries the pgvector
|
|
105
|
+
* extension, for a suite that guards a config declaring it (ADR-0065).
|
|
106
|
+
*
|
|
107
|
+
* Only an answer from the server is an answer. A server that is not
|
|
108
|
+
* accepting connections yet is redialled until {@link PROBE_DEADLINE} and
|
|
109
|
+
* then thrown on, so a container still coming up can never be recorded as
|
|
110
|
+
* one without pgvector — the only skip this can produce is a server that
|
|
111
|
+
* answered and said no.
|
|
112
|
+
*
|
|
113
|
+
* @throws when the server stays unreachable for the whole deadline.
|
|
114
|
+
*/
|
|
115
|
+
export async function probePgvectorAvailability(url) {
|
|
116
|
+
const until = Date.now() + PROBE_DEADLINE;
|
|
117
|
+
let attempts = 0;
|
|
118
|
+
let unreachable;
|
|
119
|
+
do {
|
|
120
|
+
attempts++;
|
|
121
|
+
const pg = await pgModule();
|
|
122
|
+
const client = new pg.Client({
|
|
123
|
+
connectionString: url,
|
|
124
|
+
connectionTimeoutMillis: PROBE_CONNECT_TIMEOUT,
|
|
125
|
+
});
|
|
126
|
+
try {
|
|
127
|
+
await client.connect();
|
|
128
|
+
}
|
|
129
|
+
catch (fault) {
|
|
130
|
+
unreachable = fault;
|
|
131
|
+
await pause(PROBE_BACKOFF);
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
// Connected: whatever the server says now is the truth about pgvector, and
|
|
135
|
+
// a query that fails from here is a real fault rather than a slow boot.
|
|
136
|
+
try {
|
|
137
|
+
const result = await client.query(`select 1 from pg_available_extensions where name = 'vector'`);
|
|
138
|
+
return result.rowCount === 1;
|
|
139
|
+
}
|
|
140
|
+
finally {
|
|
141
|
+
await client.end();
|
|
142
|
+
}
|
|
143
|
+
} while (Date.now() < until);
|
|
144
|
+
throw new Error(`Could not reach the ${ESCAPE_VARIABLES.join('/')} server to probe for pgvector after ${attempts} ` +
|
|
145
|
+
`attempts over ${PROBE_DEADLINE}ms. This is a broken connection, not a server without ` +
|
|
146
|
+
`pgvector, so the caller should fail rather than skip. Last fault: ${describeFault(unreachable)}`);
|
|
147
|
+
}
|
|
148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AAE,GAAG,cAAc,CAAA;IACzC,IAAI,QAAQ,GAAG,CAAC,CAAA;IAChB,IAAI,WAAoB,CAAA;IAExB,GAAG,CAAC;QACF,QAAQ,EAAE,CAAA;QACV,MAAM,EAAE,GAAG,MAAM,QAAQ,EAAE,CAAA;QAC3B,MAAM,MAAM,GAAG,IAAI,EAAE,CAAC,MAAM,CAAC;YAC3B,gBAAgB,EAAE,GAAG;YACrB,uBAAuB,EAAE,qBAAqB;SAC/C,CAAC,CAAA;QACF,IAAI,CAAC;YACH,MAAM,MAAM,CAAC,OAAO,EAAE,CAAA;QACxB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,WAAW,GAAG,KAAK,CAAA;YACnB,MAAM,KAAK,CAAC,aAAa,CAAC,CAAA;YAC1B,SAAQ;QACV,CAAC;QACD,2EAA2E;QAC3E,wEAAwE;QACxE,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAC/B,6DAA6D,CAC9D,CAAA;YACD,OAAO,MAAM,CAAC,QAAQ,KAAK,CAAC,CAAA;QAC9B,CAAC;gBAAS,CAAC;YACT,MAAM,MAAM,CAAC,GAAG,EAAE,CAAA;QACpB,CAAC;IACH,CAAC,QAAQ,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,EAAC;IAE5B,MAAM,IAAI,KAAK,CACb,uBAAuB,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,uCAAuC,QAAQ,GAAG;QACjG,iBAAiB,cAAc,wDAAwD;QACvF,qEAAqE,aAAa,CAAC,WAAW,CAAC,EAAE,CACpG,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { PostgresControlClientOptions } from '@prisma/orm-postgres/control';
|
|
2
|
+
import type { PostgresOptionsBase } from '@prisma/orm-postgres/runtime';
|
|
3
|
+
import type { ExtensionDescriptor } from '../config/types.js';
|
|
4
|
+
import type { PrismaContractPacks } from '../contract/prisma.js';
|
|
5
|
+
/** The `/control` descriptor: what the seed phase and the control client take. */
|
|
6
|
+
export type ExtensionControlDescriptor = NonNullable<PostgresControlClientOptions['extensions']>[number];
|
|
7
|
+
/** The `/runtime` descriptor: what `postgres({ extensions })` takes. */
|
|
8
|
+
export type ExtensionRuntimeDescriptor = NonNullable<PostgresOptionsBase['extensions']>[number];
|
|
9
|
+
/** The `/pack` descriptor: what the contract builder takes. */
|
|
10
|
+
export type ExtensionPackDescriptor = PrismaContractPacks[string];
|
|
11
|
+
/** One declared pack's three façades, as ADR-0065 requires each to publish. */
|
|
12
|
+
export interface LoadedExtensionPack {
|
|
13
|
+
readonly pack: ExtensionPackDescriptor;
|
|
14
|
+
readonly control: ExtensionControlDescriptor;
|
|
15
|
+
readonly runtime: ExtensionRuntimeDescriptor;
|
|
16
|
+
}
|
|
17
|
+
/** Loaded packs keyed by the binding name `db.extensions` spells. */
|
|
18
|
+
export type LoadedExtensionPacks = Record<string, LoadedExtensionPack>;
|
|
19
|
+
/**
|
|
20
|
+
* Thrown when a declared extension pack cannot be imported, or imports without
|
|
21
|
+
* a usable descriptor on one of its three subpaths.
|
|
22
|
+
*
|
|
23
|
+
* Resolution runs from core's own module, so a pack the consuming package
|
|
24
|
+
* depends on must also be reachable from `@opensaas/stack-core`. Where it is
|
|
25
|
+
* not, load the pack in the test and pass it as `options.packs`.
|
|
26
|
+
*/
|
|
27
|
+
export declare class ExtensionPackUnavailableError extends Error {
|
|
28
|
+
readonly pack: string;
|
|
29
|
+
readonly specifier: string;
|
|
30
|
+
readonly reason: string;
|
|
31
|
+
constructor(pack: string, specifier: string, reason: string);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Load the `/pack`, `/control` and `/runtime` façades of every pack a derived
|
|
35
|
+
* contract declares, so the harness can build the contract, seed the extension
|
|
36
|
+
* contract space and bind the runtime from one declaration (ADR-0065).
|
|
37
|
+
*
|
|
38
|
+
* The imports are dynamic and run only for a config that declares a pack, so a
|
|
39
|
+
* suite over a pack-free config never reaches the pack packages.
|
|
40
|
+
*
|
|
41
|
+
* @param packs - Already-loaded packs, by binding name. An entry here is used
|
|
42
|
+
* as given and its subpaths are never imported.
|
|
43
|
+
* @throws {ExtensionPackUnavailableError} naming the pack, the subpath and why.
|
|
44
|
+
*/
|
|
45
|
+
export declare function loadExtensionPacks(extensions: readonly ExtensionDescriptor[], packs?: LoadedExtensionPacks): Promise<LoadedExtensionPacks>;
|
|
46
|
+
/** The contract builder's `packs` option, projected off the loaded façades. */
|
|
47
|
+
export declare function contractPacks(loaded: LoadedExtensionPacks): PrismaContractPacks;
|
|
48
|
+
//# sourceMappingURL=extensions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../src/testing/extensions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAA;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAEhE,kFAAkF;AAClF,MAAM,MAAM,0BAA0B,GAAG,WAAW,CAClD,4BAA4B,CAAC,YAAY,CAAC,CAC3C,CAAC,MAAM,CAAC,CAAA;AAET,wEAAwE;AACxE,MAAM,MAAM,0BAA0B,GAAG,WAAW,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;AAE/F,+DAA+D;AAC/D,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAA;AAEjE,+EAA+E;AAC/E,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAAA;IACtC,QAAQ,CAAC,OAAO,EAAE,0BAA0B,CAAA;IAC5C,QAAQ,CAAC,OAAO,EAAE,0BAA0B,CAAA;CAC7C;AAED,qEAAqE;AACrE,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAA;AAEtE;;;;;;;GAOG;AACH,qBAAa,6BAA8B,SAAQ,KAAK;IAEpD,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM;IAHzB,YACW,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EASxB;CACF;AAiDD;;;;;;;;;;;GAWG;AACH,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,SAAS,mBAAmB,EAAE,EAC1C,KAAK,GAAE,oBAAyB,GAC/B,OAAO,CAAC,oBAAoB,CAAC,CA2C/B;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,MAAM,EAAE,oBAAoB,GAAG,mBAAmB,CAI/E"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thrown when a declared extension pack cannot be imported, or imports without
|
|
3
|
+
* a usable descriptor on one of its three subpaths.
|
|
4
|
+
*
|
|
5
|
+
* Resolution runs from core's own module, so a pack the consuming package
|
|
6
|
+
* depends on must also be reachable from `@opensaas/stack-core`. Where it is
|
|
7
|
+
* not, load the pack in the test and pass it as `options.packs`.
|
|
8
|
+
*/
|
|
9
|
+
export class ExtensionPackUnavailableError extends Error {
|
|
10
|
+
pack;
|
|
11
|
+
specifier;
|
|
12
|
+
reason;
|
|
13
|
+
constructor(pack, specifier, reason) {
|
|
14
|
+
super(`The test harness could not load extension pack "${pack}" from "${specifier}": ${reason}. ` +
|
|
15
|
+
`A declared pack must publish /pack, /control and /runtime (ADR-0065) and must be ` +
|
|
16
|
+
`resolvable from @opensaas/stack-core. Install the package, or load the three subpaths ` +
|
|
17
|
+
`in your test and pass them to createTestDatabase as options.packs["${pack}"].`);
|
|
18
|
+
this.pack = pack;
|
|
19
|
+
this.specifier = specifier;
|
|
20
|
+
this.reason = reason;
|
|
21
|
+
this.name = 'ExtensionPackUnavailableError';
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Every pack descriptor Prisma publishes carries a string `kind` and a string
|
|
26
|
+
* `id`; the seed phase and the control client both key on `id`. Checking those
|
|
27
|
+
* two is what the CLI's own loader checks, and it is what separates "a pack
|
|
28
|
+
* built against a different toolchain generation" from a `TypeError` thrown
|
|
29
|
+
* from inside Prisma.
|
|
30
|
+
*/
|
|
31
|
+
function isDescriptor(value) {
|
|
32
|
+
return (typeof value === 'object' &&
|
|
33
|
+
value !== null &&
|
|
34
|
+
'id' in value &&
|
|
35
|
+
typeof value.id === 'string' &&
|
|
36
|
+
'kind' in value &&
|
|
37
|
+
typeof value.kind === 'string');
|
|
38
|
+
}
|
|
39
|
+
function isPackDescriptor(value) {
|
|
40
|
+
return isDescriptor(value);
|
|
41
|
+
}
|
|
42
|
+
function isControlDescriptor(value) {
|
|
43
|
+
return isDescriptor(value);
|
|
44
|
+
}
|
|
45
|
+
function isRuntimeDescriptor(value) {
|
|
46
|
+
return isDescriptor(value);
|
|
47
|
+
}
|
|
48
|
+
async function loadDefault(pack, specifier) {
|
|
49
|
+
let namespace;
|
|
50
|
+
try {
|
|
51
|
+
namespace = await import(specifier);
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
throw new ExtensionPackUnavailableError(pack, specifier, error instanceof Error ? error.message : 'the import failed');
|
|
55
|
+
}
|
|
56
|
+
if (typeof namespace !== 'object' || namespace === null || !('default' in namespace)) {
|
|
57
|
+
throw new ExtensionPackUnavailableError(pack, specifier, 'it has no default export');
|
|
58
|
+
}
|
|
59
|
+
return namespace.default;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Load the `/pack`, `/control` and `/runtime` façades of every pack a derived
|
|
63
|
+
* contract declares, so the harness can build the contract, seed the extension
|
|
64
|
+
* contract space and bind the runtime from one declaration (ADR-0065).
|
|
65
|
+
*
|
|
66
|
+
* The imports are dynamic and run only for a config that declares a pack, so a
|
|
67
|
+
* suite over a pack-free config never reaches the pack packages.
|
|
68
|
+
*
|
|
69
|
+
* @param packs - Already-loaded packs, by binding name. An entry here is used
|
|
70
|
+
* as given and its subpaths are never imported.
|
|
71
|
+
* @throws {ExtensionPackUnavailableError} naming the pack, the subpath and why.
|
|
72
|
+
*/
|
|
73
|
+
export async function loadExtensionPacks(extensions, packs = {}) {
|
|
74
|
+
const loaded = {};
|
|
75
|
+
for (const extension of extensions) {
|
|
76
|
+
const provided = packs[extension.name];
|
|
77
|
+
if (provided !== undefined) {
|
|
78
|
+
loaded[extension.name] = provided;
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
const packSpecifier = `${extension.from}/pack`;
|
|
82
|
+
const controlSpecifier = `${extension.from}/control`;
|
|
83
|
+
const runtimeSpecifier = `${extension.from}/runtime`;
|
|
84
|
+
const pack = await loadDefault(extension.name, packSpecifier);
|
|
85
|
+
if (!isPackDescriptor(pack)) {
|
|
86
|
+
throw new ExtensionPackUnavailableError(extension.name, packSpecifier, 'its default export is not a pack descriptor');
|
|
87
|
+
}
|
|
88
|
+
const control = await loadDefault(extension.name, controlSpecifier);
|
|
89
|
+
if (!isControlDescriptor(control)) {
|
|
90
|
+
throw new ExtensionPackUnavailableError(extension.name, controlSpecifier, 'its default export is not a control descriptor');
|
|
91
|
+
}
|
|
92
|
+
const runtime = await loadDefault(extension.name, runtimeSpecifier);
|
|
93
|
+
if (!isRuntimeDescriptor(runtime)) {
|
|
94
|
+
throw new ExtensionPackUnavailableError(extension.name, runtimeSpecifier, 'its default export is not a runtime descriptor');
|
|
95
|
+
}
|
|
96
|
+
loaded[extension.name] = { pack, control, runtime };
|
|
97
|
+
}
|
|
98
|
+
return loaded;
|
|
99
|
+
}
|
|
100
|
+
/** The contract builder's `packs` option, projected off the loaded façades. */
|
|
101
|
+
export function contractPacks(loaded) {
|
|
102
|
+
const packs = {};
|
|
103
|
+
for (const [name, loadedPack] of Object.entries(loaded))
|
|
104
|
+
packs[name] = loadedPack.pack;
|
|
105
|
+
return packs;
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=extensions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensions.js","sourceRoot":"","sources":["../../src/testing/extensions.ts"],"names":[],"mappings":"AA0BA;;;;;;;GAOG;AACH,MAAM,OAAO,6BAA8B,SAAQ,KAAK;IAE3C,IAAI;IACJ,SAAS;IACT,MAAM;IAHjB,YACW,IAAY,EACZ,SAAiB,EACjB,MAAc;QAEvB,KAAK,CACH,mDAAmD,IAAI,WAAW,SAAS,MAAM,MAAM,IAAI;YACzF,mFAAmF;YACnF,wFAAwF;YACxF,sEAAsE,IAAI,KAAK,CAClF,CAAA;oBATQ,IAAI;yBACJ,SAAS;sBACT,MAAM;QAQf,IAAI,CAAC,IAAI,GAAG,+BAA+B,CAAA;IAC7C,CAAC;CACF;AAED;;;;;;GAMG;AACH,SAAS,YAAY,CAAC,KAAc;IAClC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,IAAI,IAAI,KAAK;QACb,OAAO,KAAK,CAAC,EAAE,KAAK,QAAQ;QAC5B,MAAM,IAAI,KAAK;QACf,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAC/B,CAAA;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAc;IACtC,OAAO,YAAY,CAAC,KAAK,CAAC,CAAA;AAC5B,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAc;IACzC,OAAO,YAAY,CAAC,KAAK,CAAC,CAAA;AAC5B,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAc;IACzC,OAAO,YAAY,CAAC,KAAK,CAAC,CAAA;AAC5B,CAAC;AAED,KAAK,UAAU,WAAW,CAAC,IAAY,EAAE,SAAiB;IACxD,IAAI,SAAkB,CA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E,CAAC;YAC5B,MAAM,IAAI,6BAA6B,CACrC,SAAS,CAAC,IAAI,EACd,aAAa,EACb,6CAA6C,CAC9C,CAAA;QACH,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,SAAS,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAA;QACnE,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,6BAA6B,CACrC,SAAS,CAAC,IAAI,EACd,gBAAgB,EAChB,gDAAgD,CACjD,CAAA;QACH,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,SAAS,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAA;QACnE,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,6BAA6B,CACrC,SAAS,CAAC,IAAI,EACd,gBAAgB,EAChB,gDAAgD,CACjD,CAAA;QACH,CAAC;QAED,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAA;IACrD,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,aAAa,CAAC,MAA4B;IACxD,MAAM,KAAK,GAAwB,EAAE,CAAA;IACrC,KAAK,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,IAAI,CAAA;IACtF,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { createTestContext, createTestDatabase, DevDatabaseUnavailableError, ESCAPE_DATABASE_PREFIX, OrmCollectionMissingError, SchemaApplyError, type TestContext, type TestDatabase, type TestDatabaseOptions, } from './context.js';
|
|
2
|
+
export { ESCAPE_VARIABLES, readDatabaseEscape, requireUsableDatabaseEscape, UnusableDatabaseEscapeError, type DatabaseEscape, } from './escape.js';
|
|
3
|
+
export { ExtensionPackUnavailableError, loadExtensionPacks, type ExtensionControlDescriptor, type ExtensionPackDescriptor, type ExtensionRuntimeDescriptor, type LoadedExtensionPack, type LoadedExtensionPacks, } from './extensions.js';
|
|
4
|
+
export { createPlanRecorder, type DraftPlan, type PlanRecorder, type RecordedPlan, } from './plans.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,2BAA2B,EAC3B,sBAAsB,EACtB,yBAAyB,EACzB,gBAAgB,EAChB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,mBAAmB,GACzB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,2BAA2B,EAC3B,2BAA2B,EAC3B,KAAK,cAAc,GACpB,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,6BAA6B,EAC7B,kBAAkB,EAClB,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,GAC1B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,kBAAkB,EAClB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,YAAY,GAClB,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @opensaas/stack-core/testing
|
|
2
|
+
//
|
|
3
|
+
// The Test context (ADR-0057): a real, fully secured context over an
|
|
4
|
+
// in-process Postgres, and the recording middleware that lets a test assert on
|
|
5
|
+
// the plan the engine built. The only double the stack offers — nothing here
|
|
6
|
+
// fakes the secured surface.
|
|
7
|
+
export { createTestContext, createTestDatabase, DevDatabaseUnavailableError, ESCAPE_DATABASE_PREFIX, OrmCollectionMissingError, SchemaApplyError, } from './context.js';
|
|
8
|
+
export { ESCAPE_VARIABLES, readDatabaseEscape, requireUsableDatabaseEscape, UnusableDatabaseEscapeError, } from './escape.js';
|
|
9
|
+
export { ExtensionPackUnavailableError, loadExtensionPacks, } from './extensions.js';
|
|
10
|
+
export { createPlanRecorder, } from './plans.js';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,EAAE;AACF,qEAAqE;AACrE,+EAA+E;AAC/E,6EAA6E;AAC7E,6BAA6B;AAE7B,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,2BAA2B,EAC3B,sBAAsB,EACtB,yBAAyB,EACzB,gBAAgB,GAIjB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,2BAA2B,EAC3B,2BAA2B,GAE5B,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,6BAA6B,EAC7B,kBAAkB,GAMnB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,kBAAkB,GAInB,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { SqlMiddleware } from '@prisma/orm-postgres/family-runtime';
|
|
2
|
+
import { type QueryOrigin } from '../origin.js';
|
|
3
|
+
type BeforeCompile = NonNullable<SqlMiddleware['beforeCompile']>;
|
|
4
|
+
/**
|
|
5
|
+
* Prisma's pre-lowering view of a query — the typed AST and the plan metadata,
|
|
6
|
+
* before the adapter renders SQL. Projected off `SqlMiddleware` rather than
|
|
7
|
+
* imported: `DraftPlan` is declared inside `@prisma/orm-family-sql` and is not
|
|
8
|
+
* on any package's export map.
|
|
9
|
+
*/
|
|
10
|
+
export type DraftPlan = Parameters<BeforeCompile>[0];
|
|
11
|
+
/** One plan a {@link PlanRecorder} saw, and the origin it compiled under. */
|
|
12
|
+
export interface RecordedPlan {
|
|
13
|
+
/** The plan's lane, as Prisma reports it on {@link DraftPlan.meta}. */
|
|
14
|
+
readonly lane: DraftPlan['meta']['lane'];
|
|
15
|
+
/** The AST's root kind — `'select' | 'insert' | 'update' | 'delete' | …`. */
|
|
16
|
+
readonly kind: DraftPlan['ast']['kind'];
|
|
17
|
+
/** The whole typed AST, for asserting on the query the engine built. */
|
|
18
|
+
readonly ast: DraftPlan['ast'];
|
|
19
|
+
/** The plan metadata, including the annotations Prisma carries. */
|
|
20
|
+
readonly meta: DraftPlan['meta'];
|
|
21
|
+
/**
|
|
22
|
+
* The origin in scope when the plan compiled, read from the same store
|
|
23
|
+
* {@link originTripwire} reads. `undefined` never reaches a recorder
|
|
24
|
+
* registered after the tripwire — the tripwire has already refused.
|
|
25
|
+
*/
|
|
26
|
+
readonly origin: QueryOrigin | undefined;
|
|
27
|
+
}
|
|
28
|
+
/** A recording `beforeCompile` and the plans it has seen. */
|
|
29
|
+
export interface PlanRecorder {
|
|
30
|
+
/**
|
|
31
|
+
* Register this beside the tripwire in the client's `middleware` array.
|
|
32
|
+
* It rewrites nothing and returns `undefined`, so the plan passes through.
|
|
33
|
+
*/
|
|
34
|
+
readonly middleware: SqlMiddleware;
|
|
35
|
+
/** Every plan compiled since the last {@link PlanRecorder.clear}, in order. */
|
|
36
|
+
readonly plans: readonly RecordedPlan[];
|
|
37
|
+
/** Drop the recorded plans, typically between tests. */
|
|
38
|
+
clear(): void;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A recording `beforeCompile` middleware — the supported way to assert on the
|
|
42
|
+
* query the engine built (ADR-0057). It is one more entry in the client's
|
|
43
|
+
* `middleware` array, not a seam on the secured wrapper, so the wrapper stays
|
|
44
|
+
* as opaque to a test as it is to a caller and the tripwire is taught nothing.
|
|
45
|
+
*
|
|
46
|
+
* Register it **after** the tripwire so a refusal is still a refusal; the
|
|
47
|
+
* recorder never rewrites a plan and never throws.
|
|
48
|
+
*
|
|
49
|
+
* Assert on `ast` and `origin` — plan shape and origin presence. Never assert
|
|
50
|
+
* on rendered SQL: it is not on the draft, and pinning it would pin Prisma's
|
|
51
|
+
* renderer rather than the stack's behaviour.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* const recorder = createPlanRecorder()
|
|
56
|
+
* const db = await createTestDatabase(config, { middleware: [recorder.middleware] })
|
|
57
|
+
* // … run a query …
|
|
58
|
+
* expect(recorder.plans.map((plan) => plan.origin)).toEqual(['engine'])
|
|
59
|
+
* expect(recorder.plans[0].ast.kind).toBe('select')
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export declare function createPlanRecorder(): PlanRecorder;
|
|
63
|
+
export {};
|
|
64
|
+
//# sourceMappingURL=plans.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../../src/testing/plans.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AACxE,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AAE9D,KAAK,aAAa,GAAG,WAAW,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC,CAAA;AAEhE;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;AAEpD,6EAA6E;AAC7E,MAAM,WAAW,YAAY;IAC3B,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAA;IACxC,6EAA6E;IAC7E,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAA;IACvC,wEAAwE;IACxE,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC,CAAA;IAC9B,mEAAmE;IACnE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAA;IAChC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,CAAA;CACzC;AAED,6DAA6D;AAC7D,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAA;IAClC,+EAA+E;IAC/E,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAA;IACvC,wDAAwD;IACxD,KAAK,IAAI,IAAI,CAAA;CACd;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,kBAAkB,IAAI,YAAY,CAuBjD"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { currentOrigin } from '../origin.js';
|
|
2
|
+
/**
|
|
3
|
+
* A recording `beforeCompile` middleware — the supported way to assert on the
|
|
4
|
+
* query the engine built (ADR-0057). It is one more entry in the client's
|
|
5
|
+
* `middleware` array, not a seam on the secured wrapper, so the wrapper stays
|
|
6
|
+
* as opaque to a test as it is to a caller and the tripwire is taught nothing.
|
|
7
|
+
*
|
|
8
|
+
* Register it **after** the tripwire so a refusal is still a refusal; the
|
|
9
|
+
* recorder never rewrites a plan and never throws.
|
|
10
|
+
*
|
|
11
|
+
* Assert on `ast` and `origin` — plan shape and origin presence. Never assert
|
|
12
|
+
* on rendered SQL: it is not on the draft, and pinning it would pin Prisma's
|
|
13
|
+
* renderer rather than the stack's behaviour.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const recorder = createPlanRecorder()
|
|
18
|
+
* const db = await createTestDatabase(config, { middleware: [recorder.middleware] })
|
|
19
|
+
* // … run a query …
|
|
20
|
+
* expect(recorder.plans.map((plan) => plan.origin)).toEqual(['engine'])
|
|
21
|
+
* expect(recorder.plans[0].ast.kind).toBe('select')
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export function createPlanRecorder() {
|
|
25
|
+
const plans = [];
|
|
26
|
+
return {
|
|
27
|
+
middleware: {
|
|
28
|
+
name: 'opensaas-plan-recorder',
|
|
29
|
+
familyId: 'sql',
|
|
30
|
+
async beforeCompile(draft) {
|
|
31
|
+
plans.push({
|
|
32
|
+
lane: draft.meta.lane,
|
|
33
|
+
kind: draft.ast.kind,
|
|
34
|
+
ast: draft.ast,
|
|
35
|
+
meta: draft.meta,
|
|
36
|
+
origin: currentOrigin(),
|
|
37
|
+
});
|
|
38
|
+
return undefined;
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
plans,
|
|
42
|
+
clear: () => {
|
|
43
|
+
plans.length = 0;
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=plans.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plans.js","sourceRoot":"","sources":["../../src/testing/plans.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAoB,MAAM,cAAc,CAAA;AA2C9D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,KAAK,GAAmB,EAAE,CAAA;IAEhC,OAAO;QACL,UAAU,EAAE;YACV,IAAI,EAAE,wBAAwB;YAC9B,QAAQ,EAAE,KAAK;YACf,KAAK,CAAC,aAAa,CAAC,KAAgB;gBAClC,KAAK,CAAC,IAAI,CAAC;oBACT,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI;oBACrB,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI;oBACpB,GAAG,EAAE,KAAK,CAAC,GAAG;oBACd,IAAI,EAAE,KAAK,CAAC,IAAI;oBAChB,MAAM,EAAE,aAAa,EAAE;iBACxB,CAAC,CAAA;gBACF,OAAO,SAAS,CAAA;YAClB,CAAC;SACF;QACD,KAAK;QACL,KAAK,EAAE,GAAG,EAAE;YACV,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;QAClB,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { AccessControlledDB, Session, StackDb, StorageUtils } from '../access/types.js';
|
|
2
|
+
import type { ServerActionProps } from '../context/index.js';
|
|
3
|
+
import type { UnsafeCapableClient, UnsafeSurface } from '../unsafe.js';
|
|
4
|
+
export type { StackDb };
|
|
5
|
+
/**
|
|
6
|
+
* The context a hook, an access rule and a plugin service all see: the secured
|
|
7
|
+
* `db`, the session, the raw ORM client and the ambient plumbing. It carries
|
|
8
|
+
* nothing that can start a transaction or change who is asking — that is
|
|
9
|
+
* {@link StackContext}.
|
|
10
|
+
*
|
|
11
|
+
* `.opensaas/types.ts` names it per app, keying `TClient` to the app's own
|
|
12
|
+
* Prisma 8 client so `unsafe.sql`/`unsafe.raw` carry the emitted contract's
|
|
13
|
+
* types rather than degrading to `object` (ADR-0052):
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* export interface BaseContext<S extends Session = Session>
|
|
17
|
+
* extends StackBaseContext<DB, S, PluginServices, PostgresClient<Contract>> {}
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @typeParam DB - the generated `db` surface, one `SecuredList` per list.
|
|
21
|
+
* @typeParam S - the app's session shape.
|
|
22
|
+
* @typeParam P - the app's plugin services, from `.opensaas/plugin-types.ts`.
|
|
23
|
+
* @typeParam TClient - the Prisma 8 client `unsafe`'s lanes are keyed to.
|
|
24
|
+
* Defaults to the structural {@link UnsafeCapableClient}, which is why
|
|
25
|
+
* `context.unsafe.sql`/`.raw` read as `object` unless a caller — the
|
|
26
|
+
* generated bundle, most often — names the app's own client type here.
|
|
27
|
+
*/
|
|
28
|
+
export interface StackBaseContext<DB extends StackDb<DB> = AccessControlledDB, S extends Session = Session, P = Record<string, unknown>, TClient extends UnsafeCapableClient = UnsafeCapableClient> {
|
|
29
|
+
db: DB;
|
|
30
|
+
session: S | null;
|
|
31
|
+
/**
|
|
32
|
+
* The {@link UnsafeSurface}: Prisma's own query lanes, bypassing access
|
|
33
|
+
* control, Field Visibility, hooks and error normalisation entirely. It is
|
|
34
|
+
* the documented escape hatch for the cases the secured surface cannot
|
|
35
|
+
* express, and every use should say why.
|
|
36
|
+
*/
|
|
37
|
+
unsafe: UnsafeSurface<TClient>;
|
|
38
|
+
storage: StorageUtils;
|
|
39
|
+
plugins: P;
|
|
40
|
+
_isSudo: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The full context a server action and a page component hold: everything
|
|
44
|
+
* {@link StackBaseContext} carries, plus the operations that derive a new
|
|
45
|
+
* context — `sudo()`, `withSession()` and `transaction()`.
|
|
46
|
+
*
|
|
47
|
+
* ```ts
|
|
48
|
+
* export interface Context<S extends Session = Session>
|
|
49
|
+
* extends StackContext<DB, S, PluginServices, TxDB, PostgresClient<Contract>> {}
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export interface StackContext<DB extends StackDb<DB> = AccessControlledDB, S extends Session = Session, P = Record<string, unknown>, TxDB extends StackDb<TxDB> = DB, TClient extends UnsafeCapableClient = UnsafeCapableClient> extends StackBaseContext<DB, S, P, TClient> {
|
|
53
|
+
serverAction: (props: ServerActionProps) => Promise<unknown>;
|
|
54
|
+
/**
|
|
55
|
+
* Bypass access control for operations reached through the returned
|
|
56
|
+
* context. Hooks still run. This is not an authorisation — the caller owns
|
|
57
|
+
* the decision to elevate.
|
|
58
|
+
*/
|
|
59
|
+
sudo: () => StackContext<DB, S, P, TxDB, TClient>;
|
|
60
|
+
/**
|
|
61
|
+
* Substitute the session without changing what access control decides.
|
|
62
|
+
* Preserves the receiver's sudo state.
|
|
63
|
+
*/
|
|
64
|
+
withSession: (session: S | null) => StackContext<DB, S, P, TxDB, TClient>;
|
|
65
|
+
/**
|
|
66
|
+
* Run `fn` inside ONE interactive transaction. The context handed to `fn`
|
|
67
|
+
* is access-checked and hook-firing exactly as this one is, but persists
|
|
68
|
+
* against the transaction client, so a throw anywhere rolls the whole
|
|
69
|
+
* transaction back (ADR-0012).
|
|
70
|
+
*
|
|
71
|
+
* The transaction holds one pooled connection for the whole callback. Work
|
|
72
|
+
* reached through the transaction context — its `db` and its `unsafe` —
|
|
73
|
+
* runs on that connection; work reached through the OUTER context inside
|
|
74
|
+
* the callback asks the pool for a second one, and on a single-connection
|
|
75
|
+
* pool (the dev database's, ADR-0063) waits for one that will not come.
|
|
76
|
+
*
|
|
77
|
+
* The transaction takes the callback and nothing else, and runs at the
|
|
78
|
+
* connection's default isolation level — Read Committed on PostgreSQL. An
|
|
79
|
+
* invariant that a stricter level would have closed is expressed as a lock
|
|
80
|
+
* on the contended row inside the callback — `.forUpdate()`, which is on
|
|
81
|
+
* the transaction-bound `db` and nowhere else (ADR-0042, ADR-0047).
|
|
82
|
+
*/
|
|
83
|
+
transaction: <T>(fn: (txContext: StackTransactionContext<TxDB, S, P, TxDB, TClient>) => Promise<T>) => Promise<T>;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The context inside `context.transaction()`: everything {@link StackContext}
|
|
87
|
+
* carries, over the transaction-bound `db` whose reads can take a row lock,
|
|
88
|
+
* plus {@link StackTransactionContext.advisoryLock}. `transaction()` on it
|
|
89
|
+
* joins the enclosing transaction rather than opening a second one (ADR-0028).
|
|
90
|
+
*
|
|
91
|
+
* The two shapes are genuinely different types rather than one name twice, so
|
|
92
|
+
* a signature can say which side of the boundary it expects and `forUpdate()`
|
|
93
|
+
* outside a transaction is a compile error (ADR-0047).
|
|
94
|
+
*/
|
|
95
|
+
export interface StackTransactionContext<DB extends StackDb<DB> = AccessControlledDB, S extends Session = Session, P = Record<string, unknown>, TxDB extends StackDb<TxDB> = DB, TClient extends UnsafeCapableClient = UnsafeCapableClient> extends StackContext<DB, S, P, TxDB, TClient> {
|
|
96
|
+
/**
|
|
97
|
+
* Take PostgreSQL's transaction-scoped advisory lock on `key`, waiting until
|
|
98
|
+
* it is free. Released when the transaction ends, whichever way it ends.
|
|
99
|
+
*
|
|
100
|
+
* It locks a number rather than rows, so it belongs to no list and there is
|
|
101
|
+
* nothing for the engine to scope — which is why it sits here and not on
|
|
102
|
+
* `db`. The key is hashed with `hashtext()`, matching what Prisma does
|
|
103
|
+
* internally; `hashtext` is 32-bit, so two distinct keys can collide. A
|
|
104
|
+
* collision costs spurious serialisation, never a missed lock (ADR-0047).
|
|
105
|
+
*/
|
|
106
|
+
advisoryLock: (key: string) => Promise<void>;
|
|
107
|
+
sudo: () => StackTransactionContext<DB, S, P, TxDB, TClient>;
|
|
108
|
+
withSession: (session: S | null) => StackTransactionContext<DB, S, P, TxDB, TClient>;
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/types/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC5F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAC5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAEtE,YAAY,EAAE,OAAO,EAAE,CAAA;AAEvB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,gBAAgB,CAC/B,EAAE,SAAS,OAAO,CAAC,EAAE,CAAC,GAAG,kBAAkB,EAC3C,CAAC,SAAS,OAAO,GAAG,OAAO,EAC3B,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3B,OAAO,SAAS,mBAAmB,GAAG,mBAAmB;IAEzD,EAAE,EAAE,EAAE,CAAA;IACN,OAAO,EAAE,CAAC,GAAG,IAAI,CAAA;IACjB;;;;;OAKG;IACH,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,CAAA;IAC9B,OAAO,EAAE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