@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
package/src/index.test.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, expectTypeOf } from 'vitest'
|
|
2
|
-
// Import from the package root entry point exactly as the docs / CHANGELOG /
|
|
3
|
-
// migrate-context-calls skill instruct consumers to. If the root `index.ts`
|
|
4
|
-
// stops re-exporting the query API, this file fails to type-check / run,
|
|
5
|
-
// preventing a silent regression (issue #496).
|
|
6
|
-
import { defineFragment, runQuery, runQueryOne } from './index.js'
|
|
7
|
-
import type { ResultOf, RelationSelector, QueryArgs } from './index.js'
|
|
8
|
-
|
|
9
|
-
// ─────────────────────────────────────────────────────────────
|
|
10
|
-
// Stand-in model type (mirrors a Prisma-generated type)
|
|
11
|
-
// ─────────────────────────────────────────────────────────────
|
|
12
|
-
|
|
13
|
-
type User = {
|
|
14
|
-
id: string
|
|
15
|
-
name: string
|
|
16
|
-
email: string
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
describe('@opensaas/stack-core root entry point — query API re-exports (issue #496)', () => {
|
|
20
|
-
it('re-exports the runtime query functions from the package root', () => {
|
|
21
|
-
expect(typeof defineFragment).toBe('function')
|
|
22
|
-
expect(typeof runQuery).toBe('function')
|
|
23
|
-
expect(typeof runQueryOne).toBe('function')
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
it('defineFragment imported from the root produces a usable fragment', () => {
|
|
27
|
-
const userFragment = defineFragment<User>()({ id: true, name: true } as const)
|
|
28
|
-
|
|
29
|
-
expect(userFragment._type).toBe('fragment')
|
|
30
|
-
expect(userFragment._fields).toEqual({ id: true, name: true })
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
it('exposes ResultOf as a usable type alias from the root', () => {
|
|
34
|
-
const userFragment = defineFragment<User>()({ id: true, name: true } as const)
|
|
35
|
-
expect(userFragment._type).toBe('fragment')
|
|
36
|
-
|
|
37
|
-
// Type-level assertion: ResultOf<typeof fragment> narrows to the selection.
|
|
38
|
-
expectTypeOf<ResultOf<typeof userFragment>>().toEqualTypeOf<{ id: string; name: string }>()
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
it('exposes QueryArgs and RelationSelector as usable types from the root', () => {
|
|
42
|
-
// Type-level usage — these annotations only compile if the types resolve
|
|
43
|
-
// from the root entry point.
|
|
44
|
-
const args: QueryArgs = { where: { id: 'abc' }, take: 5 }
|
|
45
|
-
expect(args.take).toBe(5)
|
|
46
|
-
|
|
47
|
-
const selector: RelationSelector<User> = defineFragment<User>()({ id: true } as const)
|
|
48
|
-
expectTypeOf(selector).not.toBeNever()
|
|
49
|
-
})
|
|
50
|
-
})
|
package/src/index.ts
DELETED
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
// ───────────────────────────────────────────────────────────────
|
|
2
|
-
// @opensaas/stack-core — consumer entry point
|
|
3
|
-
//
|
|
4
|
-
// The everyday surface for defining a config and using a context.
|
|
5
|
-
// • Field builders → '@opensaas/stack-core/fields'
|
|
6
|
-
// • Plugin / field authoring → '@opensaas/stack-core/extend'
|
|
7
|
-
// • MCP runtime → '@opensaas/stack-core/mcp'
|
|
8
|
-
// Internal plumbing lives on '@opensaas/stack-core/internal' (unstable).
|
|
9
|
-
// ───────────────────────────────────────────────────────────────
|
|
10
|
-
|
|
11
|
-
// Config builders
|
|
12
|
-
export { config, list } from './config/index.js'
|
|
13
|
-
|
|
14
|
-
// Config types a consumer annotates with.
|
|
15
|
-
// Concrete field-config types (TextField, …) live on '@opensaas/stack-core/fields'
|
|
16
|
-
// alongside their builders.
|
|
17
|
-
export type {
|
|
18
|
-
OpenSaasConfig,
|
|
19
|
-
OutputConfig,
|
|
20
|
-
ListConfig,
|
|
21
|
-
DatabaseConfig,
|
|
22
|
-
ListIndex,
|
|
23
|
-
ListIndexFieldRef,
|
|
24
|
-
FieldConfig,
|
|
25
|
-
OperationAccess,
|
|
26
|
-
// Custom Bulk actions (issue #736) — declared per list in
|
|
27
|
-
// `ui.listView.bulkActions`; the handler runs server-side over the selected
|
|
28
|
-
// ids through the secured context.
|
|
29
|
-
BulkAction,
|
|
30
|
-
BulkActionContext,
|
|
31
|
-
BulkActionResult,
|
|
32
|
-
BulkActionVariant,
|
|
33
|
-
} from './config/index.js'
|
|
34
|
-
|
|
35
|
-
// Access control — the types a consumer writes against
|
|
36
|
-
export type {
|
|
37
|
-
AccessControl,
|
|
38
|
-
FieldAccess,
|
|
39
|
-
Session,
|
|
40
|
-
AccessContext,
|
|
41
|
-
PrismaFilter,
|
|
42
|
-
} from './access/index.js'
|
|
43
|
-
|
|
44
|
-
// Context factory
|
|
45
|
-
export { getContext } from './context/index.js'
|
|
46
|
-
export type {
|
|
47
|
-
StackContext,
|
|
48
|
-
TransactionOptions,
|
|
49
|
-
TransactionIsolationLevel,
|
|
50
|
-
} from './context/index.js'
|
|
51
|
-
|
|
52
|
-
// Naming utilities (documented public helpers; used for URLs and db keys)
|
|
53
|
-
export { getDbKey, getUrlKey, getListKeyFromUrl, resolveListKeyFromUrl } from './lib/case-utils.js'
|
|
54
|
-
|
|
55
|
-
// Label seam — resolves the field that represents a row as a single label
|
|
56
|
-
// (projection) and reads it off a row (render). Used by the admin UI for
|
|
57
|
-
// relationship cells, dropdown options, and page headings.
|
|
58
|
-
export { getLabelFieldName, getItemLabel } from './config/label.js'
|
|
59
|
-
|
|
60
|
-
// Access-scoped nav counts — resolves per-list record counts (opt-in via
|
|
61
|
-
// `ui.navCount`) through the secured context for the admin chrome (issue #735).
|
|
62
|
-
export { resolveNavCounts, isListQueryStaticallyDenied } from './config/nav-count.js'
|
|
63
|
-
|
|
64
|
-
// Validation error surfaced by write operations
|
|
65
|
-
export { ValidationError } from './hooks/index.js'
|
|
66
|
-
|
|
67
|
-
// Resolves which columns (and, where recoverable, which named constraint) a
|
|
68
|
-
// caught P2002 unique-constraint violation hit — normalising Prisma 7 driver
|
|
69
|
-
// adapters' undocumented error shape to the documented `meta.target` one, so
|
|
70
|
-
// a caller of `context.db.*` never needs to reach into adapter internals
|
|
71
|
-
// (see issue #979).
|
|
72
|
-
export { uniqueConstraintOf } from './lib/prisma-errors.js'
|
|
73
|
-
export type { UniqueConstraintInfo } from './lib/prisma-errors.js'
|
|
74
|
-
|
|
75
|
-
// Thrown by a read when a caller-supplied `include` names a relation nested
|
|
76
|
-
// deeper than the Access Filter can scope (see ADR-0022). Distinct from
|
|
77
|
-
// `ValidationError` — this is the engine refusing to return unscoped data, not
|
|
78
|
-
// a user-input validation failure.
|
|
79
|
-
export { AccessScopeDepthExceededError } from './access/index.js'
|
|
80
|
-
|
|
81
|
-
// Thrown by a `resolveOutput` hook whose own read cycles back into a
|
|
82
|
-
// `(list, field)` pair already on its resolve chain (see ADR-0023). Distinct
|
|
83
|
-
// from `ValidationError` for the same reason as `AccessScopeDepthExceededError`.
|
|
84
|
-
export { ResolveOutputCycleError } from './access/index.js'
|
|
85
|
-
|
|
86
|
-
// Thrown by `checkFieldAccess` when a field-level access control function
|
|
87
|
-
// returns anything other than a strict boolean (see ADR-0001 and ADR-0030).
|
|
88
|
-
// Distinct from `ValidationError` for the same reason as
|
|
89
|
-
// `AccessScopeDepthExceededError` — this is the engine refusing to interpret
|
|
90
|
-
// a result it cannot treat as an allow/deny decision, not a user-input
|
|
91
|
-
// validation failure.
|
|
92
|
-
export { InvalidFieldAccessResultError } from './access/index.js'
|
|
93
|
-
|
|
94
|
-
// Thrown by the write pipeline's create strategy and by the nested-create
|
|
95
|
-
// path when operation-level `create` access returns anything other than a
|
|
96
|
-
// strict boolean (see #1009, ADR-0022, and ADR-0030). A filter — the shape
|
|
97
|
-
// `query`/`update`/`delete` legitimately return — cannot be honoured on
|
|
98
|
-
// create: there is no existing row and no way to test it against input data,
|
|
99
|
-
// so it is refused loudly rather than silently treated as a full allow.
|
|
100
|
-
export { InvalidCreateAccessResultError } from './access/index.js'
|
|
101
|
-
|
|
102
|
-
// Thrown by a read when a caller-supplied `where` filters on a relation whose
|
|
103
|
-
// related list denies operation-level `query` access outright (see #916 and
|
|
104
|
-
// ADR-0022). Distinct from `ValidationError` for the same reason as
|
|
105
|
-
// `AccessScopeDepthExceededError` — this is the engine declining to return a
|
|
106
|
-
// silently-narrowed match on a relation it cannot scope, not a user-input
|
|
107
|
-
// validation failure.
|
|
108
|
-
export { RelationFilterAccessDeniedError } from './access/index.js'
|
|
109
|
-
|
|
110
|
-
// Thrown by a non-sudo write whose payload carries a nested `set`,
|
|
111
|
-
// `updateMany` or `deleteMany` under a relationship key (see #1384). These
|
|
112
|
-
// three kinds were a pass-through straight to Prisma with no target-list
|
|
113
|
-
// access check and no hooks; `sudo()` still accepts them unchanged. Author
|
|
114
|
-
// the writes against the target list directly instead (`context.db.<list>`,
|
|
115
|
-
// wrapped in `context.transaction` when they must land atomically).
|
|
116
|
-
export { NestedRelationInputError } from './context/nested-operations.js'
|
|
117
|
-
|
|
118
|
-
// Field self-containment validation — checks each field implements the
|
|
119
|
-
// generation contract (getPrismaType / getTypeScriptType / getZodSchema, or
|
|
120
|
-
// getPrismaRelation for relationships) so a misimplemented field fails early
|
|
121
|
-
// with a clear per-field message instead of deep inside generation.
|
|
122
|
-
export { validateFieldConfig, validateConfigFields } from './validation/field-config.js'
|
|
123
|
-
export type { FieldConfigValidationError } from './validation/field-config.js'
|
|
124
|
-
|
|
125
|
-
// Declared-dependency validation (`needs`, ADR-0025) — checks every `needs`
|
|
126
|
-
// entry names an immediate relationship field on the same list, and that no
|
|
127
|
-
// field's declaration closure (the recursive fold of its dependencies, and
|
|
128
|
-
// theirs) exceeds the read-include depth cap from any starting point. A
|
|
129
|
-
// config that fails either must not generate.
|
|
130
|
-
export { validateNeedsDeclarations, validateNeedsClosureDepth } from './validation/needs-closure.js'
|
|
131
|
-
export type { NeedsClosureError } from './validation/needs-closure.js'
|
|
132
|
-
|
|
133
|
-
// Fragment-based query API — composable, type-safe reads that mirror
|
|
134
|
-
// Keystone's GraphQL fragments without a GraphQL runtime. The migration
|
|
135
|
-
// guide, CHANGELOG, and migrate-context-calls skill all advertise importing
|
|
136
|
-
// these from the root entry point. The internal runtime helpers (isFragment,
|
|
137
|
-
// buildInclude, pickFields) and the Fragment/FieldSelection types stay off the
|
|
138
|
-
// root surface — those live on '@opensaas/stack-core/internal'.
|
|
139
|
-
export { defineFragment, runQuery, runQueryOne } from './query/index.js'
|
|
140
|
-
export type { ResultOf, RelationSelector, QueryArgs } from './query/index.js'
|
|
141
|
-
|
|
142
|
-
// Relationship-options read primitive — bounded, projected fetch for
|
|
143
|
-
// relationship editors. Backs the `relationshipOptions` context.serverAction
|
|
144
|
-
// op; also callable directly wherever a full context is already in hand.
|
|
145
|
-
export { getRelationshipOptions } from './query/relationship-options.js'
|
|
146
|
-
export type { RelationshipOption, RelationshipOptionsArgs } from './query/relationship-options.js'
|
|
147
|
-
|
|
148
|
-
// Filter engine (ADR-0017) — the admin UI's Filter builder. The pure seam
|
|
149
|
-
// (`parseFilterQuery`, `buildFilterWhere`) plus config-aware helpers that
|
|
150
|
-
// collect each field's Filter spec and compose a list's server-side `where`.
|
|
151
|
-
// The produced fragment is ANDed with the access filter through the secured
|
|
152
|
-
// context, so the filter can only ever narrow visibility.
|
|
153
|
-
export {
|
|
154
|
-
parseFilterQuery,
|
|
155
|
-
serializeFilterQuery,
|
|
156
|
-
buildFilterWhere,
|
|
157
|
-
collectFilterSpecs,
|
|
158
|
-
buildListFilterWhere,
|
|
159
|
-
collectFilterSuggestions,
|
|
160
|
-
RELATIONSHIP_COUNT_FILTER_KEY,
|
|
161
|
-
} from './filter/index.js'
|
|
162
|
-
export type {
|
|
163
|
-
FilterOperator,
|
|
164
|
-
FilterToken,
|
|
165
|
-
FilterCondition,
|
|
166
|
-
FilterSpec,
|
|
167
|
-
FilterValueSource,
|
|
168
|
-
FilterFieldSuggestion,
|
|
169
|
-
RelationshipCountFilterMarker,
|
|
170
|
-
FilterAccessArgs,
|
|
171
|
-
} from './filter/index.js'
|
|
172
|
-
|
|
173
|
-
// Access-scoped to-many relationship counts for the admin list view (#732):
|
|
174
|
-
// build the filtered `_count` select for count cells/sort, and resolve the
|
|
175
|
-
// count Filter spec's markers into `{ id: { in } }` — all through the secured
|
|
176
|
-
// context, so counts never include related rows the session cannot read.
|
|
177
|
-
export {
|
|
178
|
-
buildRelationshipCountSelect,
|
|
179
|
-
resolveRelationshipCountFilters,
|
|
180
|
-
isToManyRelationshipField,
|
|
181
|
-
} from './access/relationship-count.js'
|
|
182
|
-
|
|
183
|
-
// To-one relationship label filter helpers for the admin list view (#749).
|
|
184
|
-
// `resolveRelationshipLabelFilters` is now a pass-through: the engine itself
|
|
185
|
-
// scopes every relation filter in `where` (`buildAccessScopedWhere`, #916),
|
|
186
|
-
// including the `{ is: {...} } }` shape a label filter produces, so this no
|
|
187
|
-
// longer needs its own access fold. Kept exported, unchanged in shape, for
|
|
188
|
-
// API compatibility — see `relationship-label-filter.ts`'s doc comment.
|
|
189
|
-
export {
|
|
190
|
-
resolveRelationshipLabelFilters,
|
|
191
|
-
isToOneRelationshipField,
|
|
192
|
-
} from './access/relationship-label-filter.js'
|
package/src/internal.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
// ───────────────────────────────────────────────────────────────
|
|
2
|
-
// @opensaas/stack-core/internal
|
|
3
|
-
//
|
|
4
|
-
// @internal — plumbing shared between the @opensaas/* packages and the
|
|
5
|
-
// code emitted by the generator (`.opensaas/`). NOT a public API: these
|
|
6
|
-
// exports carry NO semver guarantees and may change or disappear in any
|
|
7
|
-
// release. Application authors should never import from this path; use
|
|
8
|
-
// the root entry point, `/fields`, or `/extend` instead.
|
|
9
|
-
// ───────────────────────────────────────────────────────────────
|
|
10
|
-
|
|
11
|
-
// Runtime context internals consumed by generated `.opensaas/` code
|
|
12
|
-
export type { ServerActionProps } from './context/index.js'
|
|
13
|
-
export type {
|
|
14
|
-
PrismaClientLike,
|
|
15
|
-
AccessControlledDB,
|
|
16
|
-
StorageUtils,
|
|
17
|
-
AugmentedFindMany,
|
|
18
|
-
AugmentedFindUnique,
|
|
19
|
-
FindManyQueryArgs,
|
|
20
|
-
} from './access/types.js'
|
|
21
|
-
|
|
22
|
-
// Typed-query internals (Fragment/FieldSelection/ResultOf appear in generated types)
|
|
23
|
-
export type { Fragment, FieldSelection, ResultOf } from './query/index.js'
|
|
24
|
-
|
|
25
|
-
// Password hashing internals (the password field emits HashedPassword into generated types)
|
|
26
|
-
export {
|
|
27
|
-
hashPassword,
|
|
28
|
-
comparePassword,
|
|
29
|
-
isHashedPassword,
|
|
30
|
-
HashedPassword,
|
|
31
|
-
} from './utils/password.js'
|
|
32
|
-
|
|
33
|
-
// Case conversion helpers used by sibling packages
|
|
34
|
-
export { pascalToCamel, pascalToKebab, kebabToPascal, kebabToCamel } from './lib/case-utils.js'
|
|
35
|
-
|
|
36
|
-
// Zod schema helpers used internally for validation
|
|
37
|
-
export { validateWithZod, generateZodSchema } from './validation/schema.js'
|
|
38
|
-
|
|
39
|
-
// Canonical field-level access evaluator, reused by @opensaas/stack-ui to decide
|
|
40
|
-
// whether a Relationship-table cell may show an inline-edit affordance (#737).
|
|
41
|
-
// This is the single field-access evaluator — the UI must not re-implement it.
|
|
42
|
-
export { checkFieldAccess } from './access/index.js'
|
|
43
|
-
|
|
44
|
-
// Predicate-time field-read evaluator (#915), reused by @opensaas/stack-ui to
|
|
45
|
-
// keep the admin list view's sort validation in lockstep with the engine: a
|
|
46
|
-
// field the session cannot read cannot seed an `orderBy` either.
|
|
47
|
-
export { isFieldReadableForPredicate } from './access/index.js'
|
|
48
|
-
|
|
49
|
-
// Config-shape sub-types consumed by sibling packages (not part of the consumer surface)
|
|
50
|
-
export type {
|
|
51
|
-
DatabaseConfig,
|
|
52
|
-
SessionConfig,
|
|
53
|
-
ThemeConfig,
|
|
54
|
-
ThemePreset,
|
|
55
|
-
ThemeColors,
|
|
56
|
-
ThemeFonts,
|
|
57
|
-
ThemeShadows,
|
|
58
|
-
FileMetadata,
|
|
59
|
-
ImageMetadata,
|
|
60
|
-
ImageTransformationResult,
|
|
61
|
-
} from './config/index.js'
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest'
|
|
2
|
-
import {
|
|
3
|
-
pascalToCamel,
|
|
4
|
-
pascalToKebab,
|
|
5
|
-
kebabToPascal,
|
|
6
|
-
kebabToCamel,
|
|
7
|
-
getDbKey,
|
|
8
|
-
getUrlKey,
|
|
9
|
-
getListKeyFromUrl,
|
|
10
|
-
resolveListKeyFromUrl,
|
|
11
|
-
} from './case-utils.js'
|
|
12
|
-
|
|
13
|
-
describe('Case Conversion Utilities', () => {
|
|
14
|
-
describe('pascalToCamel', () => {
|
|
15
|
-
it('should convert single word PascalCase to camelCase', () => {
|
|
16
|
-
expect(pascalToCamel('User')).toBe('user')
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
it('should convert multi-word PascalCase to camelCase', () => {
|
|
20
|
-
expect(pascalToCamel('AuthUser')).toBe('authUser')
|
|
21
|
-
expect(pascalToCamel('BlogPost')).toBe('blogPost')
|
|
22
|
-
expect(pascalToCamel('UserProfile')).toBe('userProfile')
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
it('should handle already camelCase strings', () => {
|
|
26
|
-
expect(pascalToCamel('user')).toBe('user')
|
|
27
|
-
expect(pascalToCamel('authUser')).toBe('authUser')
|
|
28
|
-
})
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
describe('pascalToKebab', () => {
|
|
32
|
-
it('should convert single word PascalCase to kebab-case', () => {
|
|
33
|
-
expect(pascalToKebab('User')).toBe('user')
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
it('should convert multi-word PascalCase to kebab-case', () => {
|
|
37
|
-
expect(pascalToKebab('AuthUser')).toBe('auth-user')
|
|
38
|
-
expect(pascalToKebab('BlogPost')).toBe('blog-post')
|
|
39
|
-
expect(pascalToKebab('UserProfile')).toBe('user-profile')
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
it('should handle consecutive capital letters', () => {
|
|
43
|
-
expect(pascalToKebab('HTMLElement')).toBe('h-t-m-l-element')
|
|
44
|
-
})
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
describe('kebabToPascal', () => {
|
|
48
|
-
it('should convert single word kebab-case to PascalCase', () => {
|
|
49
|
-
expect(kebabToPascal('user')).toBe('User')
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
it('should convert multi-word kebab-case to PascalCase', () => {
|
|
53
|
-
expect(kebabToPascal('auth-user')).toBe('AuthUser')
|
|
54
|
-
expect(kebabToPascal('blog-post')).toBe('BlogPost')
|
|
55
|
-
expect(kebabToPascal('user-profile')).toBe('UserProfile')
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
it('should handle already PascalCase strings without hyphens', () => {
|
|
59
|
-
expect(kebabToPascal('User')).toBe('User')
|
|
60
|
-
// Note: "AuthUser" without hyphens is treated as a single word
|
|
61
|
-
expect(kebabToPascal('AuthUser')).toBe('AuthUser')
|
|
62
|
-
})
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
describe('kebabToCamel', () => {
|
|
66
|
-
it('should convert single word kebab-case to camelCase', () => {
|
|
67
|
-
expect(kebabToCamel('user')).toBe('user')
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
it('should convert multi-word kebab-case to camelCase', () => {
|
|
71
|
-
expect(kebabToCamel('auth-user')).toBe('authUser')
|
|
72
|
-
expect(kebabToCamel('blog-post')).toBe('blogPost')
|
|
73
|
-
expect(kebabToCamel('user-profile')).toBe('userProfile')
|
|
74
|
-
})
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
describe('getDbKey', () => {
|
|
78
|
-
it('should convert list key to database key format', () => {
|
|
79
|
-
expect(getDbKey('User')).toBe('user')
|
|
80
|
-
expect(getDbKey('AuthUser')).toBe('authUser')
|
|
81
|
-
expect(getDbKey('BlogPost')).toBe('blogPost')
|
|
82
|
-
})
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
describe('getUrlKey', () => {
|
|
86
|
-
it('should convert list key to URL key format', () => {
|
|
87
|
-
expect(getUrlKey('User')).toBe('user')
|
|
88
|
-
expect(getUrlKey('AuthUser')).toBe('auth-user')
|
|
89
|
-
expect(getUrlKey('BlogPost')).toBe('blog-post')
|
|
90
|
-
})
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
describe('getListKeyFromUrl', () => {
|
|
94
|
-
it('should convert URL key to list key format', () => {
|
|
95
|
-
expect(getListKeyFromUrl('user')).toBe('User')
|
|
96
|
-
expect(getListKeyFromUrl('auth-user')).toBe('AuthUser')
|
|
97
|
-
expect(getListKeyFromUrl('blog-post')).toBe('BlogPost')
|
|
98
|
-
})
|
|
99
|
-
})
|
|
100
|
-
|
|
101
|
-
describe('resolveListKeyFromUrl', () => {
|
|
102
|
-
it('resolves a PascalCase list key from its URL segment', () => {
|
|
103
|
-
expect(resolveListKeyFromUrl('blog-post', ['User', 'BlogPost'])).toBe('BlogPost')
|
|
104
|
-
})
|
|
105
|
-
|
|
106
|
-
it('resolves a camelCase list key (e.g. a derived plugin list) from its URL segment', () => {
|
|
107
|
-
// getListKeyFromUrl('oauth-application') would reconstruct 'OauthApplication',
|
|
108
|
-
// which isn't a key in this list — that's the bug this resolver fixes.
|
|
109
|
-
expect(resolveListKeyFromUrl('oauth-application', ['oauthApplication'])).toBe(
|
|
110
|
-
'oauthApplication',
|
|
111
|
-
)
|
|
112
|
-
})
|
|
113
|
-
|
|
114
|
-
it('returns undefined for a URL segment matching no list key', () => {
|
|
115
|
-
expect(resolveListKeyFromUrl('does-not-exist', ['User', 'BlogPost'])).toBeUndefined()
|
|
116
|
-
})
|
|
117
|
-
|
|
118
|
-
it('throws when two distinct list keys produce the same URL segment', () => {
|
|
119
|
-
expect(() =>
|
|
120
|
-
resolveListKeyFromUrl('oauth-application', ['oauthApplication', 'OauthApplication']),
|
|
121
|
-
).toThrow(/Ambiguous list URL/)
|
|
122
|
-
})
|
|
123
|
-
|
|
124
|
-
it('is derived from getUrlKey, so it cannot drift from how URLs are built', () => {
|
|
125
|
-
const listKeys = ['User', 'AuthUser', 'BlogPost', 'oauthApplication']
|
|
126
|
-
for (const listKey of listKeys) {
|
|
127
|
-
expect(resolveListKeyFromUrl(getUrlKey(listKey), listKeys)).toBe(listKey)
|
|
128
|
-
}
|
|
129
|
-
})
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
describe('Round-trip conversions', () => {
|
|
133
|
-
it('should maintain consistency: PascalCase -> kebab-case -> PascalCase', () => {
|
|
134
|
-
const original = 'BlogPost'
|
|
135
|
-
const kebab = getUrlKey(original)
|
|
136
|
-
const backToPascal = getListKeyFromUrl(kebab)
|
|
137
|
-
expect(backToPascal).toBe(original)
|
|
138
|
-
})
|
|
139
|
-
|
|
140
|
-
it('should maintain consistency: PascalCase -> camelCase -> operations', () => {
|
|
141
|
-
const original = 'AuthUser'
|
|
142
|
-
const camel = getDbKey(original)
|
|
143
|
-
expect(camel).toBe('authUser')
|
|
144
|
-
})
|
|
145
|
-
|
|
146
|
-
it('should handle multi-word conversions correctly', () => {
|
|
147
|
-
const testCases = ['User', 'AuthUser', 'BlogPost', 'UserProfile']
|
|
148
|
-
|
|
149
|
-
testCases.forEach((original) => {
|
|
150
|
-
const url = getUrlKey(original)
|
|
151
|
-
const db = getDbKey(original)
|
|
152
|
-
const fromUrl = getListKeyFromUrl(url)
|
|
153
|
-
|
|
154
|
-
expect(fromUrl).toBe(original)
|
|
155
|
-
expect(db.charAt(0)).toBe(original.charAt(0).toLowerCase())
|
|
156
|
-
})
|
|
157
|
-
})
|
|
158
|
-
})
|
|
159
|
-
})
|
package/src/lib/case-utils.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Case conversion utilities for consistent naming across the stack
|
|
3
|
-
*
|
|
4
|
-
* - Config list names: PascalCase (e.g., "AuthUser", "BlogPost")
|
|
5
|
-
* - Prisma models: PascalCase (e.g., "AuthUser", "BlogPost")
|
|
6
|
-
* - Prisma client properties: camelCase (e.g., "authUser", "blogPost")
|
|
7
|
-
* - Context db properties: camelCase (e.g., "authUser", "blogPost")
|
|
8
|
-
* - URLs: kebab-case (e.g., "auth-user", "blog-post")
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export function pascalToCamel(str: string): string {
|
|
12
|
-
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function pascalToKebab(str: string): string {
|
|
16
|
-
return str.replace(/([A-Z])/g, (match, p1, offset) => {
|
|
17
|
-
return offset > 0 ? `-${p1.toLowerCase()}` : p1.toLowerCase()
|
|
18
|
-
})
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function kebabToPascal(str: string): string {
|
|
22
|
-
return str
|
|
23
|
-
.split('-')
|
|
24
|
-
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
25
|
-
.join('')
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function kebabToCamel(str: string): string {
|
|
29
|
-
return str.replace(/-([a-z])/g, (match, p1) => p1.toUpperCase())
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function getDbKey(listKey: string): string {
|
|
33
|
-
return pascalToCamel(listKey)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function getUrlKey(listKey: string): string {
|
|
37
|
-
return pascalToKebab(listKey)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function getListKeyFromUrl(urlSegment: string): string {
|
|
41
|
-
return kebabToPascal(urlSegment)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Resolves a URL segment back to the list key that produced it, by checking
|
|
46
|
-
* each candidate key against `getUrlKey` — the same helper that builds the
|
|
47
|
-
* URL — rather than reconstructing a key by string transformation the way
|
|
48
|
-
* `getListKeyFromUrl` does. That reconstruction is lossy for any list key
|
|
49
|
-
* that isn't strict PascalCase (e.g. a camelCase key from a derived list),
|
|
50
|
-
* so this is the config-aware resolver route lookups should use instead.
|
|
51
|
-
*
|
|
52
|
-
* Returns `undefined` when no candidate key's URL matches — callers render
|
|
53
|
-
* their usual "not found" state rather than treating this as an error.
|
|
54
|
-
* Throws if more than one candidate key produces the same URL segment: that
|
|
55
|
-
* is a configuration error (two list keys collide once case-folded to a
|
|
56
|
-
* URL) and must be reported, not resolved by silently picking one.
|
|
57
|
-
*/
|
|
58
|
-
export function resolveListKeyFromUrl(urlSegment: string, listKeys: string[]): string | undefined {
|
|
59
|
-
const matches = listKeys.filter((listKey) => getUrlKey(listKey) === urlSegment)
|
|
60
|
-
|
|
61
|
-
if (matches.length > 1) {
|
|
62
|
-
throw new Error(
|
|
63
|
-
`Ambiguous list URL "${urlSegment}": list keys ${matches.map((key) => `"${key}"`).join(', ')} all resolve to this URL. Rename these lists so their URLs are unique.`,
|
|
64
|
-
)
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return matches[0]
|
|
68
|
-
}
|
package/src/lib/prisma-errors.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
type PrismaP2002Meta = {
|
|
2
|
-
target?: string[]
|
|
3
|
-
driverAdapterError?: {
|
|
4
|
-
cause?: {
|
|
5
|
-
originalMessage?: string
|
|
6
|
-
constraint?: { fields?: unknown[] }
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// Postgres quotes an identifier in `constraint.fields` only when it needed
|
|
12
|
-
// quoting (e.g. camelCase columns), so `"tenantId"` and `slug` are both valid
|
|
13
|
-
// entries for the same array.
|
|
14
|
-
function stripIdentifierQuotes(field: string): string {
|
|
15
|
-
const match = field.match(/^"(.*)"$/)
|
|
16
|
-
return match ? match[1] : field
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface UniqueConstraintInfo {
|
|
20
|
-
/** Column names covered by the violated constraint, quote-stripped. */
|
|
21
|
-
fields: string[]
|
|
22
|
-
/**
|
|
23
|
-
* The violated constraint's name, when recoverable from the error.
|
|
24
|
-
*
|
|
25
|
-
* Known limit: this is parsed out of Postgres' English-locale error text
|
|
26
|
-
* (`cause.originalMessage`) — the adapter exposes no structured field for
|
|
27
|
-
* it. A server running under a non-English `lc_messages` locale will not
|
|
28
|
-
* match, leaving this `undefined` while `fields` (structured data) still
|
|
29
|
-
* resolves correctly.
|
|
30
|
-
*/
|
|
31
|
-
constraintName?: string
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Resolve which columns — and, where recoverable, which named constraint — a
|
|
36
|
-
* Prisma `P2002` unique-constraint violation hit.
|
|
37
|
-
*
|
|
38
|
-
* Prisma documents `error.meta.target` for this. Under Prisma 7 driver
|
|
39
|
-
* adapters (verified against `@prisma/adapter-pg` and PGlite; see issue #979)
|
|
40
|
-
* that field is `undefined` instead — the same information sits at
|
|
41
|
-
* `error.meta.driverAdapterError.cause`, with the constraint name only
|
|
42
|
-
* recoverable as free text inside `cause.originalMessage`. This normalises
|
|
43
|
-
* both shapes to one stable result so callers never need to reach into that
|
|
44
|
-
* adapter-specific structure themselves.
|
|
45
|
-
*
|
|
46
|
-
* A derived constraint name is truncated by Postgres at its 63-character
|
|
47
|
-
* identifier limit, and one row can violate two unique indexes at once (with
|
|
48
|
-
* Postgres reporting whichever it checked first) — an index an application
|
|
49
|
-
* means to branch on should be named explicitly, and a caller may still need
|
|
50
|
-
* to re-read the colliding row to fully disambiguate.
|
|
51
|
-
*
|
|
52
|
-
* Returns `undefined` when `error` isn't a `P2002` with any recoverable
|
|
53
|
-
* column or constraint information — never throws, since the adapter error
|
|
54
|
-
* shape is untrusted and every level of it may be absent.
|
|
55
|
-
*/
|
|
56
|
-
export function uniqueConstraintOf(error: unknown): UniqueConstraintInfo | undefined {
|
|
57
|
-
if (
|
|
58
|
-
!error ||
|
|
59
|
-
typeof error !== 'object' ||
|
|
60
|
-
!('code' in error) ||
|
|
61
|
-
(error as { code?: unknown }).code !== 'P2002'
|
|
62
|
-
) {
|
|
63
|
-
return undefined
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const meta = (error as { meta?: PrismaP2002Meta }).meta
|
|
67
|
-
|
|
68
|
-
if (meta?.target && Array.isArray(meta.target)) {
|
|
69
|
-
return { fields: meta.target }
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const cause = meta?.driverAdapterError?.cause
|
|
73
|
-
const rawFields = cause?.constraint?.fields
|
|
74
|
-
const fields = Array.isArray(rawFields)
|
|
75
|
-
? rawFields.filter((f): f is string => typeof f === 'string').map(stripIdentifierQuotes)
|
|
76
|
-
: []
|
|
77
|
-
|
|
78
|
-
const constraintName =
|
|
79
|
-
typeof cause?.originalMessage === 'string'
|
|
80
|
-
? cause.originalMessage.match(/unique constraint "([^"]+)"/)?.[1]
|
|
81
|
-
: undefined
|
|
82
|
-
|
|
83
|
-
if (fields.length === 0 && !constraintName) return undefined
|
|
84
|
-
|
|
85
|
-
return constraintName ? { fields, constraintName } : { fields }
|
|
86
|
-
}
|
package/src/mcp/constants.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* How many levels deep the `query` tool's `fields` projection schema
|
|
3
|
-
* enumerates a list's relations: the root list's own fields (level 1), and
|
|
4
|
-
* for each relation, the related list's own scalar/virtual fields (level 2).
|
|
5
|
-
* A relation named at level 2 is not itself selectable further — reaching
|
|
6
|
-
* past it is a second tool call, the same round-trip a bare read already
|
|
7
|
-
* assumes. Deliberately shallower than `READ_INCLUDE_MAX_DEPTH` (5) so no
|
|
8
|
-
* schema-conforming request can reach the engine's depth refusal.
|
|
9
|
-
*
|
|
10
|
-
* Fixed (not configurable) by design (ADR-0033, ADR-0026's position on the
|
|
11
|
-
* depth cap) — `generateFieldsProjectionSchema` and `resolveFieldsProjection`
|
|
12
|
-
* (`projection.ts`) are hand-written for exactly this depth (one loop over
|
|
13
|
-
* the root list's fields, one nested loop over a relation's), not driven by
|
|
14
|
-
* this value at runtime. It exists so the depth has one documented, tested
|
|
15
|
-
* name rather than an unexplained "2" in two places; changing it is a
|
|
16
|
-
* deliberate rewrite of both functions, not a config knob.
|
|
17
|
-
*/
|
|
18
|
-
export const MCP_FIELDS_SCHEMA_DEPTH = 2
|
|
19
|
-
|
|
20
|
-
/** Row cap applied to a nested to-many relation in a `fields` projection when the caller omits `take`. */
|
|
21
|
-
export const MCP_NESTED_TAKE_DEFAULT = 5
|
|
22
|
-
|
|
23
|
-
/** Hard ceiling a nested to-many relation's `take` is clamped to, regardless of what the caller requests. */
|
|
24
|
-
export const MCP_NESTED_TAKE_MAX = 50
|