@prisma/orm-framework 8.0.0-rc.2-dev.2 → 8.0.0-rc.20
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/README.md +1 -5
- package/dist/{apply-specifier-default-control-policy-CAxiXxKg.d.mts → apply-specifier-default-control-policy-Dlz0iwnK.d.mts} +2 -2
- package/dist/apply-specifier-default-control-policy-Dlz0iwnK.d.mts.map +1 -0
- package/dist/{assertions-Cz-GWH8P.mjs → assertions-Dw1lZz_Q.mjs} +2 -2
- package/dist/{assertions-Cz-GWH8P.mjs.map → assertions-Dw1lZz_Q.mjs.map} +1 -1
- package/dist/authoring-CNUti739.mjs +764 -0
- package/dist/authoring-CNUti739.mjs.map +1 -0
- package/dist/authoring-CjwinhU5.d.mts +206 -0
- package/dist/authoring-CjwinhU5.d.mts.map +1 -0
- package/dist/binder-D_4RBHbt-BJ6VKwEZ.d.mts +515 -0
- package/dist/binder-D_4RBHbt-BJ6VKwEZ.d.mts.map +1 -0
- package/dist/{canonicalization-DFpB09nP-4OdB2nsy.d.mts → canonicalization-CyrrXGmj-CeKUkht1.d.mts} +3 -3
- package/dist/{canonicalization-DFpB09nP-4OdB2nsy.d.mts.map → canonicalization-CyrrXGmj-CeKUkht1.d.mts.map} +1 -1
- package/dist/{hashing-utils-DQgS3nOe.mjs → canonicalization-path-match-D88xLEq6-BFQC39ZG.mjs} +23 -3
- package/dist/canonicalization-path-match-D88xLEq6-BFQC39ZG.mjs.map +1 -0
- package/dist/{utils-DMAM0unR.mjs → canonicalize-json-ZPawceQR-Dua1VNEB.mjs} +2 -2
- package/dist/canonicalize-json-ZPawceQR-Dua1VNEB.mjs.map +1 -0
- package/dist/codec-B4ypaota.d.mts +289 -0
- package/dist/codec-B4ypaota.d.mts.map +1 -0
- package/dist/codec-Do8tfXqk.mjs +457 -0
- package/dist/codec-Do8tfXqk.mjs.map +1 -0
- package/dist/codec-descriptor-D0oY-hgs-C5e11ola.mjs +93 -0
- package/dist/codec-descriptor-D0oY-hgs-C5e11ola.mjs.map +1 -0
- package/dist/codec-types-BXLUbk-Y-DpGfKGK0.mjs +22 -0
- package/dist/codec-types-BXLUbk-Y-DpGfKGK0.mjs.map +1 -0
- package/dist/codec-types-CPgEZoIq-BL9hisr8.d.mts +384 -0
- package/dist/codec-types-CPgEZoIq-BL9hisr8.d.mts.map +1 -0
- package/dist/{components-dZRz3T5y.mjs → components-BaV9iCkq.mjs} +34 -3
- package/dist/components-BaV9iCkq.mjs.map +1 -0
- package/dist/components-CRBcIta_.d.mts +86 -0
- package/dist/components-CRBcIta_.d.mts.map +1 -0
- package/dist/components.d.mts +19 -17
- package/dist/components.mjs +16 -12
- package/dist/components__authoring.d.mts +4 -3
- package/dist/components__authoring.mjs +3 -2
- package/dist/components__codec.d.mts +3 -3
- package/dist/components__codec.mjs +6 -4
- package/dist/components__components.d.mts +6 -4
- package/dist/components__components.mjs +4 -3
- package/dist/components__control.d.mts +5 -4
- package/dist/components__control.mjs +3 -2
- package/dist/components__emission.d.mts +4 -4
- package/dist/components__execution.d.mts +1 -1
- package/dist/components__ir.d.mts +1 -1
- package/dist/components__ir.mjs +2 -1
- package/dist/components__psl-ast.d.mts +4 -4
- package/dist/components__psl-ast.mjs +2 -2
- package/dist/components__runtime.d.mts +3 -2
- package/dist/components__runtime.mjs +2 -2
- package/dist/components__utils.mjs +1 -1
- package/dist/{config-types-CW4PDwMC.d.mts → config-types-BTFT7QfJ.d.mts} +73 -41
- package/dist/config-types-BTFT7QfJ.d.mts.map +1 -0
- package/dist/config-types-D0mYyP62.mjs +61 -0
- package/dist/config-types-D0mYyP62.mjs.map +1 -0
- package/dist/config.d.mts +2 -3
- package/dist/config.mjs +2 -3
- package/dist/config__config-types.d.mts +2 -2
- package/dist/config__config-types.mjs +2 -2
- package/dist/contract-authoring.d.mts +152 -17
- package/dist/contract-authoring.d.mts.map +1 -1
- package/dist/contract-authoring.mjs +190 -9
- package/dist/contract-authoring.mjs.map +1 -1
- package/dist/{contract-types-CkdMH7F7-9EHXSwbH.d.mts → contract-types-DEIEpzU_-DvAVuBr5.d.mts} +14 -8
- package/dist/contract-types-DEIEpzU_-DvAVuBr5.d.mts.map +1 -0
- package/dist/{contract-validation-error-DEiWp_EI-CRwtUgRw.mjs → contract-validation-error-CAnTGhkt-DSnujRaK.mjs} +6 -3
- package/dist/contract-validation-error-CAnTGhkt-DSnujRaK.mjs.map +1 -0
- package/dist/{contract-validation-error-R7cMoK04.d.mts → contract-validation-error-D1QAeOh5.d.mts} +4 -2
- package/dist/contract-validation-error-D1QAeOh5.d.mts.map +1 -0
- package/dist/contract.d.mts +13 -12
- package/dist/contract.mjs +9 -9
- package/dist/contract__apply-specifier-default-control-policy.d.mts +1 -1
- package/dist/contract__contract-validation-error.d.mts +1 -1
- package/dist/contract__contract-validation-error.mjs +1 -1
- package/dist/contract__default-namespace.mjs +1 -1
- package/dist/contract__enum-accessor.d.mts +2 -2
- package/dist/contract__enum-accessor.mjs +1 -1
- package/dist/contract__hashing-utils.d.mts +2 -2
- package/dist/contract__hashing-utils.mjs +2 -3
- package/dist/contract__hashing.d.mts +3 -3
- package/dist/contract__hashing.mjs +2 -2
- package/dist/contract__resolve-domain-model.d.mts +1 -1
- package/dist/contract__types.d.mts +5 -5
- package/dist/contract__types.mjs +3 -3
- package/dist/contract__validate-domain.d.mts +1 -1
- package/dist/contract__validate-domain.mjs +1 -1
- package/dist/contract__validate-once.d.mts +2 -0
- package/dist/contract__validate-once.mjs +2 -0
- package/dist/{control-ql9N9u4f-r3Vv41kZ.d.mts → control-B5ezUWD2-BIAYxeSk.d.mts} +34 -6
- package/dist/control-B5ezUWD2-BIAYxeSk.d.mts.map +1 -0
- package/dist/{control-DLEm6u5m.mjs → control-DMJqhnwU.mjs} +309 -36
- package/dist/control-DMJqhnwU.mjs.map +1 -0
- package/dist/control-DrDTlxCS.d.mts +1 -0
- package/dist/{control-BD96JZi8-NUhO5Kkw.mjs → control-KsXr4fYD-D2Ows0NI.mjs} +70 -24
- package/dist/control-KsXr4fYD-D2Ows0NI.mjs.map +1 -0
- package/dist/{control-BF8qzdnM.d.mts → control-s5ECUABR.d.mts} +635 -156
- package/dist/control-s5ECUABR.d.mts.map +1 -0
- package/dist/data-type-V6mcDhcG-DVQAPOQT.mjs +275 -0
- package/dist/data-type-V6mcDhcG-DVQAPOQT.mjs.map +1 -0
- package/dist/declarations-BgUAq1RG-Dz_-EI1Q.mjs +459 -0
- package/dist/declarations-BgUAq1RG-Dz_-EI1Q.mjs.map +1 -0
- package/dist/{default-namespace-D4vCwkXg-lzVN7gSc.mjs → default-namespace-D4vCwkXg-BEZbN38y.mjs} +2 -2
- package/dist/{default-namespace-D4vCwkXg-lzVN7gSc.mjs.map → default-namespace-D4vCwkXg-BEZbN38y.mjs.map} +1 -1
- package/dist/{dist-Dqbo77p7.mjs → dist-D1f6xr7F.mjs} +51 -24
- package/dist/dist-D1f6xr7F.mjs.map +1 -0
- package/dist/{domain-envelope-D6Wn9AmZ-BqZKTT9U.d.mts → domain-envelope-CN721GnP-4huRt7Wc.d.mts} +27 -13
- package/dist/domain-envelope-CN721GnP-4huRt7Wc.d.mts.map +1 -0
- package/dist/emission-BtJvV97M.d.mts +2 -0
- package/dist/{emission-types-DLXP34Ki-CFms3VrX.d.mts → emission-types-B-jKEbjI-D7BW8Gk1.d.mts} +17 -16
- package/dist/emission-types-B-jKEbjI-D7BW8Gk1.d.mts.map +1 -0
- package/dist/enum-accessor-2OZgavDX.d.mts +104 -0
- package/dist/enum-accessor-2OZgavDX.d.mts.map +1 -0
- package/dist/enum-accessor-B-A2wNok.mjs +122 -0
- package/dist/enum-accessor-B-A2wNok.mjs.map +1 -0
- package/dist/errors.d.mts +5 -4
- package/dist/errors.mjs +4 -4
- package/dist/errors__control.d.mts +3 -2
- package/dist/errors__control.mjs +2 -2
- package/dist/errors__execution.d.mts +2 -2
- package/dist/errors__execution.mjs +2 -2
- package/dist/errors__migration.d.mts +2 -2
- package/dist/errors__migration.mjs +2 -2
- package/dist/execution-CjX5CCTb.d.mts +76 -0
- package/dist/execution-CjX5CCTb.d.mts.map +1 -0
- package/dist/{execution-CSnQT8EX.d.mts → execution-lMPVFj5o.d.mts} +2 -2
- package/dist/{execution-CSnQT8EX.d.mts.map → execution-lMPVFj5o.d.mts.map} +1 -1
- package/dist/execution-vfY4d-SZ.mjs +138 -0
- package/dist/execution-vfY4d-SZ.mjs.map +1 -0
- package/dist/{declarations-DR6To8_k-BFwkCGeP.mjs → expressions-CMQzbnHk-BL2zN0Iv.mjs} +199 -350
- package/dist/expressions-CMQzbnHk-BL2zN0Iv.mjs.map +1 -0
- package/dist/framework-authoring-DDxddXZm-uZYdhoE0.d.mts +1096 -0
- package/dist/framework-authoring-DDxddXZm-uZYdhoE0.d.mts.map +1 -0
- package/dist/{framework-components-hZ2tO-KH-CdRXBOYd.d.mts → framework-components-DKoQnPdB-lax1COaf.d.mts} +28 -91
- package/dist/framework-components-DKoQnPdB-lax1COaf.d.mts.map +1 -0
- package/dist/generator-functions-CXbQfvYu-BIFU1Ryx.mjs +271 -0
- package/dist/generator-functions-CXbQfvYu-BIFU1Ryx.mjs.map +1 -0
- package/dist/{hash-content-DwEUh-Rx.d.mts → hash-content-Bde14N2-.d.mts} +2 -2
- package/dist/{hash-content-DwEUh-Rx.d.mts.map → hash-content-Bde14N2-.d.mts.map} +1 -1
- package/dist/{hash-content-Bugg_nZn.mjs → hash-content-Bdl-HSfq.mjs} +2 -2
- package/dist/hash-content-Bdl-HSfq.mjs.map +1 -0
- package/dist/{hashing-BtIZVNYX.mjs → hashing-CLRfNAxh.mjs} +28 -9
- package/dist/hashing-CLRfNAxh.mjs.map +1 -0
- package/dist/hashing-D-DHz0zl.d.mts +36 -0
- package/dist/hashing-D-DHz0zl.d.mts.map +1 -0
- package/dist/{hashing-utils-qKu59RSC.d.mts → hashing-utils-DiGHKd3b.d.mts} +4 -3
- package/dist/{hashing-utils-qKu59RSC.d.mts.map → hashing-utils-DiGHKd3b.d.mts.map} +1 -1
- package/dist/ids.d.mts +90 -13
- package/dist/ids.d.mts.map +1 -1
- package/dist/ids.mjs +45 -59
- package/dist/ids.mjs.map +1 -1
- package/dist/ids__runtime.d.mts +1 -1
- package/dist/ids__runtime.mjs +1 -1
- package/dist/{index-CDk9yEbw.d.mts → index-MU-ksXsh.d.mts} +23 -6
- package/dist/index-MU-ksXsh.d.mts.map +1 -0
- package/dist/{internal-error-kK8QvlDE.d.mts → internal-error-2fJ9fcZX.d.mts} +2 -2
- package/dist/{internal-error-kK8QvlDE.d.mts.map → internal-error-2fJ9fcZX.d.mts.map} +1 -1
- package/dist/{internal-error-BIc-ehme-ouBQPoEL.mjs → internal-error-ChGYPVpq-DhUD05u0.mjs} +3 -3
- package/dist/internal-error-ChGYPVpq-DhUD05u0.mjs.map +1 -0
- package/dist/{ir-BvE7L9FK.d.mts → ir-LV4tXsw3.d.mts} +6 -5
- package/dist/{ir-BvE7L9FK.d.mts.map → ir-LV4tXsw3.d.mts.map} +1 -1
- package/dist/{ir-ChmSSAhX.mjs → ir-uDGU9vaj.mjs} +7 -53
- package/dist/ir-uDGU9vaj.mjs.map +1 -0
- package/dist/{migration-BvrgDZXw.d.mts → migration-Dluwnqe9.d.mts} +20 -3
- package/dist/migration-Dluwnqe9.d.mts.map +1 -0
- package/dist/{migration-C57VKLUY.mjs → migration-uC-bSKA4.mjs} +30 -4
- package/dist/migration-uC-bSKA4.mjs.map +1 -0
- package/dist/namespace-VUH2dgnS-By5y75h9.mjs +53 -0
- package/dist/namespace-VUH2dgnS-By5y75h9.mjs.map +1 -0
- package/dist/operations.mjs +1 -1
- package/dist/{parse-GbZGfMUj-BFSrD2AN.mjs → parse-bZgfjovA-BNgYhylT.mjs} +311 -55
- package/dist/parse-bZgfjovA-BNgYhylT.mjs.map +1 -0
- package/dist/{parse-0ZJjj_2N-DhQpSVmQ.d.mts → parse-djL5wker-B610mXG4.d.mts} +181 -52
- package/dist/parse-djL5wker-B610mXG4.d.mts.map +1 -0
- package/dist/psl-ast-COcYtLlz.d.mts +2 -0
- package/dist/psl-ast-CyvE6CR-.mjs +116 -0
- package/dist/psl-ast-CyvE6CR-.mjs.map +1 -0
- package/dist/{psl-ast-CWJQF8LA-Vr5JNPdn.d.mts → psl-ast-rY25o3Ze-ClLY3CYt.d.mts} +10 -40
- package/dist/psl-ast-rY25o3Ze-ClLY3CYt.d.mts.map +1 -0
- package/dist/psl-parser.d.mts +415 -101
- package/dist/psl-parser.d.mts.map +1 -1
- package/dist/psl-parser.mjs +2451 -537
- package/dist/psl-parser.mjs.map +1 -1
- package/dist/psl-parser__format.d.mts +8 -2
- package/dist/psl-parser__format.d.mts.map +1 -1
- package/dist/psl-parser__format.mjs +65 -34
- package/dist/psl-parser__format.mjs.map +1 -1
- package/dist/psl-parser__interpret.d.mts +98 -10
- package/dist/psl-parser__interpret.d.mts.map +1 -1
- package/dist/psl-parser__interpret.mjs +393 -2
- package/dist/psl-parser__interpret.mjs.map +1 -1
- package/dist/psl-parser__syntax.d.mts +3 -3
- package/dist/psl-parser__syntax.mjs +4 -43
- package/dist/psl-parser__tokenizer.d.mts +1 -1
- package/dist/psl-parser__tokenizer.mjs +1 -1
- package/dist/psl-printer.d.mts +7 -17
- package/dist/psl-printer.d.mts.map +1 -1
- package/dist/psl-printer.mjs +35 -104
- package/dist/psl-printer.mjs.map +1 -1
- package/dist/resolve-codec-qqMjZrmn-Cok8elAo.mjs +74 -0
- package/dist/resolve-codec-qqMjZrmn-Cok8elAo.mjs.map +1 -0
- package/dist/{resolve-domain-model-BVSb5wS5-C6Yq0dsD.d.mts → resolve-domain-model-BNr1glea-BLuR-phK.d.mts} +3 -3
- package/dist/resolve-domain-model-BNr1glea-BLuR-phK.d.mts.map +1 -0
- package/dist/{result-CBZ8X9mU.mjs → result-8OXF26MN.mjs} +14 -3
- package/dist/{result-CBZ8X9mU.mjs.map → result-8OXF26MN.mjs.map} +1 -1
- package/dist/{result-Bpupv5vO.d.mts → result-BYCOANWy.d.mts} +4 -2
- package/dist/result-BYCOANWy.d.mts.map +1 -0
- package/dist/runtime-B-YYuWy2.d.mts +899 -0
- package/dist/runtime-B-YYuWy2.d.mts.map +1 -0
- package/dist/runtime-DSYSc98Y.mjs +1059 -0
- package/dist/runtime-DSYSc98Y.mjs.map +1 -0
- package/dist/runtime-error-CO4MA3Px-YW5SCUcH.d.mts +19 -0
- package/dist/runtime-error-CO4MA3Px-YW5SCUcH.d.mts.map +1 -0
- package/dist/{structured-error-CgiSMpdU.mjs → structured-error-BXbihKQ-.mjs} +3 -3
- package/dist/{structured-error-CgiSMpdU.mjs.map → structured-error-BXbihKQ-.mjs.map} +1 -1
- package/dist/{structured-error-BsNT4Hun.d.mts → structured-error-Cc7AIRsp.d.mts} +19 -5
- package/dist/structured-error-Cc7AIRsp.d.mts.map +1 -0
- package/dist/suppress-idle-connection-errors-CKrTbp5P.d.mts +18 -0
- package/dist/suppress-idle-connection-errors-CKrTbp5P.d.mts.map +1 -0
- package/dist/suppress-idle-connection-errors-DzApeUb3.mjs +22 -0
- package/dist/suppress-idle-connection-errors-DzApeUb3.mjs.map +1 -0
- package/dist/temporal-presets-5TK1pTYJ-DmhrnMP1.mjs +1276 -0
- package/dist/temporal-presets-5TK1pTYJ-DmhrnMP1.mjs.map +1 -0
- package/dist/temporal-presets-BuMqk7h8-DZSuu4Z_.d.mts +258 -0
- package/dist/temporal-presets-BuMqk7h8-DZSuu4Z_.d.mts.map +1 -0
- package/dist/text-C3TTEtgd.mjs +35 -0
- package/dist/text-C3TTEtgd.mjs.map +1 -0
- package/dist/text-C8_-rheN.d.mts +15 -0
- package/dist/text-C8_-rheN.d.mts.map +1 -0
- package/dist/{tokenizer-1hAHZzmp-QGPORvmA.mjs → tokenizer-C-GTKKjR-B1vOzJy0.mjs} +54 -10
- package/dist/tokenizer-C-GTKKjR-B1vOzJy0.mjs.map +1 -0
- package/dist/{tokenizer-DcYI0Xrq-C-nNE9mE.d.mts → tokenizer-i8RaVWVa-7fRwlCPP.d.mts} +9 -4
- package/dist/tokenizer-i8RaVWVa-7fRwlCPP.d.mts.map +1 -0
- package/dist/ts-render.d.mts +2 -2
- package/dist/ts-render.mjs +2 -2
- package/dist/type-constructor-calls-BLf-HsFy-D_jbIqj8.mjs +261 -0
- package/dist/type-constructor-calls-BLf-HsFy-D_jbIqj8.mjs.map +1 -0
- package/dist/{types-BnH4zYvN.mjs → types-B8ULzMAX.mjs} +36 -3
- package/dist/types-B8ULzMAX.mjs.map +1 -0
- package/dist/types-GNXJ7xW2.d.mts +131 -0
- package/dist/types-GNXJ7xW2.d.mts.map +1 -0
- package/dist/{types-import-spec-3mjbVBhI-DQI6BvKU.d.mts → types-import-spec-DQjfX-gM-zVncuzs0.d.mts} +6 -6
- package/dist/types-import-spec-DQjfX-gM-zVncuzs0.d.mts.map +1 -0
- package/dist/utils.d.mts +7 -5
- package/dist/utils.mjs +9 -7
- package/dist/utils__assertions.mjs +1 -1
- package/dist/utils__hash-content.d.mts +1 -1
- package/dist/utils__hash-content.mjs +1 -1
- package/dist/utils__internal-error.d.mts +1 -1
- package/dist/utils__internal-error.mjs +1 -1
- package/dist/utils__result.d.mts +2 -2
- package/dist/utils__result.mjs +2 -2
- package/dist/utils__structured-error.d.mts +2 -2
- package/dist/utils__structured-error.mjs +1 -1
- package/dist/utils__suppress-idle-connection-errors.d.mts +2 -0
- package/dist/utils__suppress-idle-connection-errors.mjs +2 -0
- package/dist/utils__text.d.mts +2 -0
- package/dist/utils__text.mjs +2 -0
- package/dist/{validate-domain-BNBs-TVv.d.mts → validate-domain-B5kmlBFB.d.mts} +10 -6
- package/dist/validate-domain-B5kmlBFB.d.mts.map +1 -0
- package/dist/{validate-domain-BkvFlY3B.mjs → validate-domain-CbXHDYpF.mjs} +43 -22
- package/dist/validate-domain-CbXHDYpF.mjs.map +1 -0
- package/dist/validate-once-D-IwXHYP.mjs +42 -0
- package/dist/validate-once-D-IwXHYP.mjs.map +1 -0
- package/dist/validate-once-gfCOHsDh.d.mts +16 -0
- package/dist/validate-once-gfCOHsDh.d.mts.map +1 -0
- package/package.json +24 -20
- package/dist/apply-specifier-default-control-policy-CAxiXxKg.d.mts.map +0 -1
- package/dist/authoring-B2H-9qCv.d.mts +0 -1
- package/dist/canonicalization-path-match-CNgHuwM_-CCPBeUuk.mjs +0 -25
- package/dist/canonicalization-path-match-CNgHuwM_-CCPBeUuk.mjs.map +0 -1
- package/dist/capabilities-BCEONw9w-C-lo3rF8.mjs +0 -120
- package/dist/capabilities-BCEONw9w-C-lo3rF8.mjs.map +0 -1
- package/dist/codec-Cd0QcxAx.mjs +0 -63
- package/dist/codec-Cd0QcxAx.mjs.map +0 -1
- package/dist/codec-Ce07W3Mz.d.mts +0 -112
- package/dist/codec-Ce07W3Mz.d.mts.map +0 -1
- package/dist/codec-types-D6VRj2RE-BLElXc-O.d.mts +0 -223
- package/dist/codec-types-D6VRj2RE-BLElXc-O.d.mts.map +0 -1
- package/dist/codec-types-DcNvNeY1-BO6kUiH0.mjs +0 -30
- package/dist/codec-types-DcNvNeY1-BO6kUiH0.mjs.map +0 -1
- package/dist/components-CGA_WwEG.d.mts +0 -50
- package/dist/components-CGA_WwEG.d.mts.map +0 -1
- package/dist/components-dZRz3T5y.mjs.map +0 -1
- package/dist/config-types-BqhNxw0z.mjs +0 -67
- package/dist/config-types-BqhNxw0z.mjs.map +0 -1
- package/dist/config-types-CW4PDwMC.d.mts.map +0 -1
- package/dist/config-validation-DPt5hwQx.mjs +0 -168
- package/dist/config-validation-DPt5hwQx.mjs.map +0 -1
- package/dist/config-validation-Wiqew2J9.d.mts +0 -21
- package/dist/config-validation-Wiqew2J9.d.mts.map +0 -1
- package/dist/config__config-validation.d.mts +0 -2
- package/dist/config__config-validation.mjs +0 -2
- package/dist/contract-types-CkdMH7F7-9EHXSwbH.d.mts.map +0 -1
- package/dist/contract-validation-error-DEiWp_EI-CRwtUgRw.mjs.map +0 -1
- package/dist/contract-validation-error-R7cMoK04.d.mts.map +0 -1
- package/dist/control-BD96JZi8-NUhO5Kkw.mjs.map +0 -1
- package/dist/control-BF8qzdnM.d.mts.map +0 -1
- package/dist/control-DLEm6u5m.mjs.map +0 -1
- package/dist/control-ql9N9u4f-r3Vv41kZ.d.mts.map +0 -1
- package/dist/declarations-DR6To8_k-BFwkCGeP.mjs.map +0 -1
- package/dist/dist-Dqbo77p7.mjs.map +0 -1
- package/dist/domain-envelope-D6Wn9AmZ-BqZKTT9U.d.mts.map +0 -1
- package/dist/emission-CmUO03gQ.d.mts +0 -2
- package/dist/emission-types-DLXP34Ki-CFms3VrX.d.mts.map +0 -1
- package/dist/enum-accessor-Db5DaTNX.mjs +0 -35
- package/dist/enum-accessor-Db5DaTNX.mjs.map +0 -1
- package/dist/enum-accessor-PH5vjghI.d.mts +0 -85
- package/dist/enum-accessor-PH5vjghI.d.mts.map +0 -1
- package/dist/execution-Crk6IfTs.mjs +0 -218
- package/dist/execution-Crk6IfTs.mjs.map +0 -1
- package/dist/execution-Cyl2dXxX.d.mts +0 -115
- package/dist/execution-Cyl2dXxX.d.mts.map +0 -1
- package/dist/framework-authoring-BhctBwih-DQ_6noDM.d.mts +0 -777
- package/dist/framework-authoring-BhctBwih-DQ_6noDM.d.mts.map +0 -1
- package/dist/framework-authoring-CDEvlouU-DKklu-fL.mjs +0 -698
- package/dist/framework-authoring-CDEvlouU-DKklu-fL.mjs.map +0 -1
- package/dist/framework-components-hZ2tO-KH-CdRXBOYd.d.mts.map +0 -1
- package/dist/hash-content-Bugg_nZn.mjs.map +0 -1
- package/dist/hashing-BtIZVNYX.mjs.map +0 -1
- package/dist/hashing-CccSPELN.d.mts +0 -25
- package/dist/hashing-CccSPELN.d.mts.map +0 -1
- package/dist/hashing-utils-DQgS3nOe.mjs.map +0 -1
- package/dist/index-CDk9yEbw.d.mts.map +0 -1
- package/dist/internal-error-BIc-ehme-ouBQPoEL.mjs.map +0 -1
- package/dist/ir-ChmSSAhX.mjs.map +0 -1
- package/dist/migration-BvrgDZXw.d.mts.map +0 -1
- package/dist/migration-C57VKLUY.mjs.map +0 -1
- package/dist/parse-0ZJjj_2N-DhQpSVmQ.d.mts.map +0 -1
- package/dist/parse-GbZGfMUj-BFSrD2AN.mjs.map +0 -1
- package/dist/psl-ast-BXZoFQBk.d.mts +0 -37
- package/dist/psl-ast-BXZoFQBk.d.mts.map +0 -1
- package/dist/psl-ast-CWJQF8LA-Vr5JNPdn.d.mts.map +0 -1
- package/dist/psl-ast-DUCvVXbB.mjs +0 -239
- package/dist/psl-ast-DUCvVXbB.mjs.map +0 -1
- package/dist/psl-parser__syntax.mjs.map +0 -1
- package/dist/resolve-codec-BZF8TZh_-D-xORT9Q.mjs +0 -59
- package/dist/resolve-codec-BZF8TZh_-D-xORT9Q.mjs.map +0 -1
- package/dist/resolve-domain-model-BVSb5wS5-C6Yq0dsD.d.mts.map +0 -1
- package/dist/result-Bpupv5vO.d.mts.map +0 -1
- package/dist/runtime-BqzioOmU.mjs +0 -670
- package/dist/runtime-BqzioOmU.mjs.map +0 -1
- package/dist/runtime-Cuxw8obj.d.mts +0 -1038
- package/dist/runtime-Cuxw8obj.d.mts.map +0 -1
- package/dist/structured-error-BsNT4Hun.d.mts.map +0 -1
- package/dist/symbol-table-CZ7EVCTL-CR-ncCpD.d.mts +0 -125
- package/dist/symbol-table-CZ7EVCTL-CR-ncCpD.d.mts.map +0 -1
- package/dist/tokenizer-1hAHZzmp-QGPORvmA.mjs.map +0 -1
- package/dist/tokenizer-DcYI0Xrq-C-nNE9mE.d.mts.map +0 -1
- package/dist/types-BnH4zYvN.mjs.map +0 -1
- package/dist/types-ByeQhU9p.d.mts +0 -17
- package/dist/types-ByeQhU9p.d.mts.map +0 -1
- package/dist/types-import-spec-3mjbVBhI-DQI6BvKU.d.mts.map +0 -1
- package/dist/utils-DMAM0unR.mjs.map +0 -1
- package/dist/validate-domain-BNBs-TVv.d.mts.map +0 -1
- package/dist/validate-domain-BkvFlY3B.mjs.map +0 -1
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { g as ContractModelBase, n as ApplicationDomain, w as ContractValueObject } from "./domain-envelope-CN721GnP-4huRt7Wc.mjs";
|
|
2
|
+
import { n as ContractExecutionSection } from "./contract-types-DEIEpzU_-DvAVuBr5.mjs";
|
|
3
|
+
//#region ../../../1-framework/0-foundation/contract/dist/types.d.mts
|
|
4
|
+
//#region src/domain-namespace-access.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Models map for the contract's single domain namespace. Throws when the
|
|
7
|
+
* contract does not declare exactly one namespace — bare-name access is
|
|
8
|
+
* ambiguous across namespaces and must be qualified explicitly (TML-2550).
|
|
9
|
+
*/
|
|
10
|
+
declare function domainModelsAtDefaultNamespace(domain: ApplicationDomain): Record<string, ContractModelBase>;
|
|
11
|
+
/**
|
|
12
|
+
* Value objects for the contract's single domain namespace, when present.
|
|
13
|
+
* Throws when the contract does not declare exactly one namespace.
|
|
14
|
+
*/
|
|
15
|
+
declare function domainValueObjectsAtDefaultNamespace(domain: ApplicationDomain): Record<string, ContractValueObject> | undefined;
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/execution-section-schema.d.ts
|
|
18
|
+
declare const ContractExecutionSectionSchema: import("arktype/internal/variants/object.ts").ObjectType<ContractExecutionSection, {}>;
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/parameterized-output-types.d.ts
|
|
21
|
+
/**
|
|
22
|
+
* A pack's codec output types refined by a column's type parameters. A pack declares an interface extending this one whose `outputTypes` reads `this['typeParams']`, and names it in `types.codecTypes.parameterizedOutputTypes`. A codec it leaves out, or maps to `never`, keeps its plain output type.
|
|
23
|
+
*/
|
|
24
|
+
interface ParameterizedOutputTypesFunction {
|
|
25
|
+
readonly typeParams: Record<never, unknown>;
|
|
26
|
+
readonly outputTypes: Record<string, unknown>;
|
|
27
|
+
}
|
|
28
|
+
type ApplyParameterizedOutputTypes<TypeFunction extends ParameterizedOutputTypesFunction, TypeParams extends Record<string, unknown>> = (TypeFunction & {
|
|
29
|
+
readonly typeParams: TypeParams;
|
|
30
|
+
})['outputTypes'];
|
|
31
|
+
type RefinedOutputType<TypeFunction, CodecId, TypeParams extends Record<string, unknown>> = TypeFunction extends ParameterizedOutputTypesFunction ? ApplyParameterizedOutputTypes<TypeFunction, TypeParams> extends (infer Outputs) ? CodecId extends keyof Outputs ? Outputs[CodecId] : never : never : never;
|
|
32
|
+
/**
|
|
33
|
+
* The output type of a column of codec `CodecId` with these type parameters: the type one of `TypeFunctions` gives it, or `Plain` when none gives one. `TypeFunctions` is a union, one member per pack; each is applied on its own, because intersecting type functions makes TypeScript give up on deeply nested types. An emitted `contract.d.ts` and a contract written in TypeScript both type a column with type parameters through it.
|
|
34
|
+
*/
|
|
35
|
+
type ParameterizedOutputType<TypeFunctions extends ParameterizedOutputTypesFunction, CodecId, TypeParams extends Record<string, unknown>, Plain> = [RefinedOutputType<TypeFunctions, CodecId, TypeParams>] extends [never] ? Plain : RefinedOutputType<TypeFunctions, CodecId, TypeParams>;
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/field-value-types.d.ts
|
|
38
|
+
type ValueTypeSide = 'output' | 'input';
|
|
39
|
+
type Lookup<T, Key> = Key extends keyof T ? T[Key] : never;
|
|
40
|
+
type NonEmptyTypeParams<TypeParams> = TypeParams extends Record<string, unknown> ? keyof TypeParams extends never ? undefined : TypeParams : undefined;
|
|
41
|
+
type PlainCodecType<CodecTypes, CodecId, Side extends ValueTypeSide> = CodecId extends keyof CodecTypes ? CodecTypes[CodecId] extends { readonly [S in Side]: infer Plain; } ? Plain : unknown : unknown;
|
|
42
|
+
type CodecType<CodecTypes, CodecId, TypeParams, ParameterizedOutputs extends ParameterizedOutputTypesFunction, Side extends ValueTypeSide> = Side extends 'output' ? NonEmptyTypeParams<TypeParams> extends (infer Params extends Record<string, unknown>) ? ParameterizedOutputType<ParameterizedOutputs, CodecId, Params, PlainCodecType<CodecTypes, CodecId, Side>> : PlainCodecType<CodecTypes, CodecId, Side> : PlainCodecType<CodecTypes, CodecId, Side>;
|
|
43
|
+
/**
|
|
44
|
+
* `Override`, unless the codec's type map entry carries `keepsWrittenForm`: its data type holds values equal that have more than one stored form, so a read can return a value the override's member literals do not name, and the value keeps the codec's type.
|
|
45
|
+
*/
|
|
46
|
+
type MemberOverride<Override, CodecTypes, CodecId> = CodecId extends keyof CodecTypes ? CodecTypes[CodecId] extends {
|
|
47
|
+
readonly keepsWrittenForm: true;
|
|
48
|
+
} ? never : Override : Override;
|
|
49
|
+
/**
|
|
50
|
+
* The type of an enum member's value as a query reads it: `Value`, the member's literal, unless the codec's type map entry carries `keepsWrittenForm`, when a read can return the member in another form and the member has the codec's output type. The emitted `contract.d.ts` and every `defineContract` builder type members by this rule.
|
|
51
|
+
*/
|
|
52
|
+
type EnumMemberValueType<CodecTypes, CodecId, Value> = CodecId extends keyof CodecTypes ? CodecTypes[CodecId] extends {
|
|
53
|
+
readonly keepsWrittenForm: true;
|
|
54
|
+
readonly output: infer Output;
|
|
55
|
+
} ? Output : Value : Value;
|
|
56
|
+
type BaseType<Override, Base, Side extends ValueTypeSide> = [Override] extends [never] ? Base : Override extends { readonly [S in Side]: infer T; } ? T : Base;
|
|
57
|
+
/**
|
|
58
|
+
* The type of the value one storage entry holds, after its override, its list or dictionary wrapping and its nullability. `Item` is the entry, with optional `nullable`, `many` and `dict`, holding values of codec `CodecId`. On each side the value is typed by `Override` for that side when it gives one, else, on the output side, by the type a type function in `ParameterizedOutputs` gives a value with these type parameters, else by the codec's type in `CodecTypes`, or `unknown` for a codec it lacks. A family's storage type maps apply it to each storage entry.
|
|
59
|
+
*/
|
|
60
|
+
type StoredValueType<Item, CodecId, TypeParams, Override, CodecTypes, ParameterizedOutputs extends ParameterizedOutputTypesFunction, Side extends ValueTypeSide> = Item extends {
|
|
61
|
+
readonly many?: infer Many;
|
|
62
|
+
readonly dict?: infer Dictionary;
|
|
63
|
+
} ? ScalarValueType<CodecId, TypeParams, Override, NullableFlag<Item>, Many, Dictionary, CodecTypes, ParameterizedOutputs, Side> : never;
|
|
64
|
+
type NullableFlag<Entry> = Entry extends {
|
|
65
|
+
readonly nullable: true;
|
|
66
|
+
} ? true : false;
|
|
67
|
+
type ClosedWhenEmpty<T> = [keyof T] extends [never] ? Record<string, never> : T;
|
|
68
|
+
type InputClosedWhenEmpty<Side extends ValueTypeSide, T> = Side extends 'input' ? ClosedWhenEmpty<T> : T;
|
|
69
|
+
type NamespaceParts<ValueObjects, NamespaceOverrides> = {
|
|
70
|
+
readonly valueObjects: ValueObjects;
|
|
71
|
+
readonly overrides: NamespaceOverrides;
|
|
72
|
+
};
|
|
73
|
+
type ValueObjectType<Name, Parts, CodecTypes, ParameterizedOutputs extends ParameterizedOutputTypesFunction, Side extends ValueTypeSide> = ClosedWhenEmpty<{ readonly [F in keyof Lookup<Lookup<Lookup<Parts, 'valueObjects'>, Name>, 'fields'>]: FieldValueType<Lookup<Lookup<Lookup<Parts, 'valueObjects'>, Name>, 'fields'>[F], Lookup<Lookup<Lookup<Lookup<Parts, 'overrides'>, 'valueObjects'>, Name>, F>, Parts, CodecTypes, ParameterizedOutputs, Side>; }>;
|
|
74
|
+
type ElementType<FieldType, Parts, CodecTypes, ParameterizedOutputs extends ParameterizedOutputTypesFunction, Side extends ValueTypeSide> = FieldType extends {
|
|
75
|
+
readonly kind: 'valueObject';
|
|
76
|
+
readonly name: infer Name;
|
|
77
|
+
} ? ValueObjectType<Name, Parts, CodecTypes, ParameterizedOutputs, Side> : FieldType extends {
|
|
78
|
+
readonly kind: 'union';
|
|
79
|
+
readonly members: infer Members extends readonly unknown[];
|
|
80
|
+
} ? UnionMemberType<Members[number], Parts, CodecTypes, ParameterizedOutputs, Side> : unknown;
|
|
81
|
+
type UnionMemberType<Member, Parts, CodecTypes, ParameterizedOutputs extends ParameterizedOutputTypesFunction, Side extends ValueTypeSide> = Member extends {
|
|
82
|
+
readonly kind: 'scalar';
|
|
83
|
+
readonly codecId: infer CodecId;
|
|
84
|
+
} ? PlainCodecType<CodecTypes, CodecId, Side> : ElementType<Member, Parts, CodecTypes, ParameterizedOutputs, Side>;
|
|
85
|
+
type Listed<Base, Many> = [Many] extends [{
|
|
86
|
+
readonly elementNullable: infer ElementNullable;
|
|
87
|
+
}] ? ReadonlyArray<Base | (ElementNullable extends true ? null : never)> : Base;
|
|
88
|
+
type WithModifiers<Base, Nullable, Many, Dictionary> = ([Dictionary] extends [true] ? Readonly<Record<string, Listed<Base, Many>>> : Listed<Base, Many>) | ([Nullable] extends [true] ? null : never) extends (infer Value) ? { readonly [K in 'value']: Value; }['value'] : never;
|
|
89
|
+
type ScalarValueType<CodecId, TypeParams, Override, Nullable, Many, Dictionary, CodecTypes, ParameterizedOutputs extends ParameterizedOutputTypesFunction, Side extends ValueTypeSide> = WithModifiers<BaseType<MemberOverride<Override, CodecTypes, CodecId>, CodecType<CodecTypes, CodecId, TypeParams, ParameterizedOutputs, Side>, Side>, Nullable, Many, Dictionary>;
|
|
90
|
+
type FieldValueType<Field, Override, Parts, CodecTypes, ParameterizedOutputs extends ParameterizedOutputTypesFunction, Side extends ValueTypeSide> = Field extends {
|
|
91
|
+
readonly type: {
|
|
92
|
+
readonly kind: 'scalar';
|
|
93
|
+
readonly codecId: infer CodecId;
|
|
94
|
+
readonly typeParams?: infer TypeParams;
|
|
95
|
+
};
|
|
96
|
+
readonly many?: infer Many;
|
|
97
|
+
readonly dict?: infer Dictionary;
|
|
98
|
+
} ? ScalarValueType<CodecId, TypeParams, Override, NullableFlag<Field>, Many, Dictionary, CodecTypes, ParameterizedOutputs, Side> : Field extends {
|
|
99
|
+
readonly type: {
|
|
100
|
+
readonly kind: 'valueObject';
|
|
101
|
+
readonly name: infer Name;
|
|
102
|
+
};
|
|
103
|
+
readonly many?: infer Many;
|
|
104
|
+
readonly dict?: infer Dictionary;
|
|
105
|
+
} ? WithModifiers<BaseType<Override, ValueObjectType<Name, Parts, CodecTypes, ParameterizedOutputs, Side>, Side>, NullableFlag<Field>, Many, Dictionary> : Field extends {
|
|
106
|
+
readonly type: infer FieldType;
|
|
107
|
+
readonly many?: infer Many;
|
|
108
|
+
readonly dict?: infer Dictionary;
|
|
109
|
+
} ? WithModifiers<BaseType<Override, ElementType<FieldType, Parts, CodecTypes, ParameterizedOutputs, Side>, Side>, NullableFlag<Field>, Many, Dictionary> : never;
|
|
110
|
+
type NamespacePartsOf<DomainNamespaces, Ns, Overrides> = NamespaceParts<Lookup<Lookup<DomainNamespaces, Ns>, 'valueObjects'>, Lookup<Overrides, Ns>>;
|
|
111
|
+
/**
|
|
112
|
+
* `FieldOutputTypes` (`Side` `'output'`) or `FieldInputTypes` (`'input'`) of a contract whose domain namespaces are `DomainNamespaces`, computed from the contract's literal shape. Both an emitted `contract.d.ts` and a contract written with `defineContract` type their fields through it.
|
|
113
|
+
*
|
|
114
|
+
* Each value is typed by, in order:
|
|
115
|
+
*
|
|
116
|
+
* 1. its override for that side, `{ output?, input? }`, from `Overrides` at `[namespace]['models'][model][field]` for a model field, or at `[namespace]['valueObjects'][valueObject][field]` for a value object field. An override is the type of a field that the contract's shape and the codec types cannot give: the members of the value set it holds, the type its codec renders as text, or the type a family's storage entry gives it;
|
|
117
|
+
* 2. for a scalar field, on the output side, the type a pack's type function in `ParameterizedOutputs` gives it for its type parameters (`ParameterizedOutputType`), else its codec's `output` or `input` type, or `unknown` for a codec `CodecTypes` lacks;
|
|
118
|
+
* 3. for a value object field, an object of the value object's field types from the same namespace's `valueObjects`, computed by these rules;
|
|
119
|
+
* 4. for a union field, the union of its members' types, each a codec's plain type or a value object's type;
|
|
120
|
+
*
|
|
121
|
+
* then wrapped in `ReadonlyArray` for a list and in `Readonly<Record<string, …>>` for a dictionary, with `null` for a nullable element or value. A model without fields has `{}` output types and `Record<string, never>` input types; a value object without fields has `Record<string, never>` on both sides.
|
|
122
|
+
*/
|
|
123
|
+
type FieldTypesFromDomain<DomainNamespaces, CodecTypes, ParameterizedOutputs extends ParameterizedOutputTypesFunction, Overrides, Side extends ValueTypeSide> = { readonly [Ns in keyof DomainNamespaces]: NamespaceFieldTypes<Lookup<DomainNamespaces[Ns], 'models'>, NamespacePartsOf<DomainNamespaces, Ns, Overrides>, CodecTypes, ParameterizedOutputs, Side>; };
|
|
124
|
+
type NamespaceFieldTypes<Models, Parts, CodecTypes, ParameterizedOutputs extends ParameterizedOutputTypesFunction, Side extends ValueTypeSide> = { readonly [M in keyof Models]: Lookup<Models[M], 'fields'> extends (infer Fields) ? [Fields] extends [never] ? never : InputClosedWhenEmpty<Side, { readonly [F in keyof Fields]: FieldValueType<Fields[F], Lookup<Lookup<Lookup<Lookup<Parts, 'overrides'>, 'models'>, M>, F>, Parts, CodecTypes, ParameterizedOutputs, Side>; }> : never; };
|
|
125
|
+
/**
|
|
126
|
+
* The output (`Side` `'output'`) or input (`'input'`) type of each value object of a contract whose domain namespaces are `DomainNamespaces`, keyed by namespace and value object name, by the rules of {@link FieldTypesFromDomain}.
|
|
127
|
+
*/
|
|
128
|
+
type ValueObjectTypesFromDomain<DomainNamespaces, CodecTypes, ParameterizedOutputs extends ParameterizedOutputTypesFunction, Overrides, Side extends ValueTypeSide> = { readonly [Ns in keyof DomainNamespaces]: { readonly [V in keyof Lookup<DomainNamespaces[Ns], 'valueObjects'>]: ValueObjectType<V, NamespacePartsOf<DomainNamespaces, Ns, Overrides>, CodecTypes, ParameterizedOutputs, Side>; }; };
|
|
129
|
+
//#endregion
|
|
130
|
+
export { ParameterizedOutputType as a, ValueObjectTypesFromDomain as c, domainValueObjectsAtDefaultNamespace as d, FieldTypesFromDomain as i, ValueTypeSide as l, ContractExecutionSectionSchema as n, ParameterizedOutputTypesFunction as o, EnumMemberValueType as r, StoredValueType as s, ApplyParameterizedOutputTypes as t, domainModelsAtDefaultNamespace as u };
|
|
131
|
+
//# sourceMappingURL=types-GNXJ7xW2.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-GNXJ7xW2.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/types.d.mts"],"mappings":";;;;;;;;;iBAUiB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pB,gBAAgB,SAAS,YAAY,UAAU,aAAa,QAAQ,MAAM,YAAY,YAAY,sBAAsB,QAAQ;WACzH;aACE;aACA,YAAY;;WAEd,aAAa;WACb,aAAa;IACpB,cAAc,SAAS,UAAU,gBAAgB,MAAM,OAAO,YAAY,sBAAsB,OAAO,OAAO,aAAa,QAAQ,MAAM,cAAc;WAChJ,YAAY;WACZ,aAAa;WACb,aAAa;IACpB,cAAc,SAAS,UAAU,YAAY,WAAW,OAAO,YAAY,sBAAsB,OAAO,OAAO,aAAa,QAAQ,MAAM;KACzI,iBAAiB,kBAAkB,IAAI,aAAa,eAAe,OAAO,OAAO,kBAAkB,sBAAsB,OAAO,WAAW;;;;;;;;;;;;;KAa3I,qBAAqB,kBAAkB,YAAY,6BAA6B,kCAAkC,WAAW,aAAa,6BAA6B,YAAY,mBAAmB,oBAAoB,OAAO,iBAAiB,gBAAgB,iBAAiB,kBAAkB,IAAI,YAAY,YAAY,sBAAsB;KACvV,oBAAoB,QAAQ,OAAO,YAAY,6BAA6B,kCAAkC,aAAa,6BAA6B,WAAW,SAAS,OAAO,OAAO,6BAA6B,WAAW,kCAAkC,qBAAqB,kBAAkB,WAAW,SAAS,eAAe,OAAO,IAAI,OAAO,OAAO,OAAO,OAAO,gCAAgC,IAAI,IAAI,OAAO,YAAY,sBAAsB;;;;KAItc,2BAA2B,kBAAkB,YAAY,6BAA6B,kCAAkC,WAAW,aAAa,6BAA6B,YAAY,+BAA+B,WAAW,OAAO,iBAAiB,uBAAuB,gBAAgB,GAAG,iBAAiB,kBAAkB,IAAI,YAAY,YAAY,sBAAsB"}
|
package/dist/{types-import-spec-3mjbVBhI-DQI6BvKU.d.mts → types-import-spec-DQjfX-gM-zVncuzs0.d.mts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
//#region ../../../1-framework/1-core/framework-components/dist/types-import-spec-
|
|
1
|
+
import { B as JsonValue } from "./domain-envelope-CN721GnP-4huRt7Wc.mjs";
|
|
2
|
+
import { g as CodecTrait, m as CodecRef } from "./codec-types-CPgEZoIq-BL9hisr8.mjs";
|
|
3
|
+
//#region ../../../1-framework/1-core/framework-components/dist/types-import-spec-DQjfX-gM.d.mts
|
|
4
4
|
//#region src/shared/aggregate-descriptor.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* How a descriptor matches the value an aggregate consumes.
|
|
@@ -42,13 +42,13 @@ type AggregateOutputCodec = SelfAggregateOutput | NamedAggregateOutput;
|
|
|
42
42
|
/**
|
|
43
43
|
* Whether the result can be null — declared, never inferred from the input's nullability — and, where it cannot, the value the operation answers with.
|
|
44
44
|
*
|
|
45
|
-
* A database answers an empty input set itself, so the declared value is read only where no result row reached the caller at all: an absent aggregate alias, or a nested envelope that never arrived. It is stated
|
|
45
|
+
* A database answers an empty input set itself, so the declared value is read only where no result row reached the caller at all: an absent aggregate alias, or a nested envelope that never arrived. It is stated as a wire value of the result codec, the value the database would have returned, and read with the codec's `fromWire`, so the application value's shape stays the codec's to define while the answer stays the operation's to declare — `count` over nothing is a zero whatever type the codec reads a zero as, and an operation whose identity element is not zero declares that instead.
|
|
46
46
|
*/
|
|
47
47
|
type AggregateResultNullability = {
|
|
48
48
|
readonly nullable: true;
|
|
49
49
|
} | {
|
|
50
50
|
readonly nullable: false;
|
|
51
|
-
readonly
|
|
51
|
+
readonly emptyResultWire: unknown;
|
|
52
52
|
};
|
|
53
53
|
type AggregateDescriptorBase = AggregateResultNullability & {
|
|
54
54
|
/** The aggregate operation this descriptor resolves (e.g. `count`, `sum`). */
|
|
@@ -110,4 +110,4 @@ interface TypesImportSpec {
|
|
|
110
110
|
}
|
|
111
111
|
//#endregion
|
|
112
112
|
export { AnyInputAggregateDescriptor as a, SelfAggregateOutput as c, aggregateDescriptorKey as d, isAggregateDescriptor as f, AggregateResultNullability as i, TypesImportSpec as l, isNoInputAggregateDescriptor as m, AggregateInputMatch as n, NamedAggregateOutput as o, isAnyInputAggregateDescriptor as p, AggregateOutputCodec as r, NoInputAggregateDescriptor as s, AggregateDescriptor as t, ValueInputAggregateDescriptor as u };
|
|
113
|
-
//# sourceMappingURL=types-import-spec-
|
|
113
|
+
//# sourceMappingURL=types-import-spec-DQjfX-gM-zVncuzs0.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-import-spec-DQjfX-gM-zVncuzs0.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/types-import-spec-DQjfX-gM.d.mts"],"mappings":";;;;;;;;;;;;;;KAaK;WACM;;WAEA;WACA;;WAEA;WACA,OAAO;;WAEP;;;;;;;UAOD;WACC;WACA;WACA,cAAc,OAAO,yBAAyB;;;UAG/C;WACC;;;KAGN,uBAAuB,sBAAsB;;;;;;KAM7C;WACM;;WAEA;WACA;;KAEN,0BAA0B;;WAEpB;;;KAGN,6BAA6B;WACvB;aACE;;WAEF,QAAQ;;;KAGd,8BAA8B;WACxB;aACE;;WAEF,QAAQ;;;KAGd,gCAAgC;WAC1B;aACE;aACA;;aAEA;aACA,OAAO;;WAET,QAAQ;;;;;;;KAOd,sBAAsB,6BAA6B,8BAA8B;;;;iBAIrE,uBAAuB,YAAY;;iBAEnC,6BAA6B,YAAY,sBAAsB,cAAc;;iBAE7E,8BAA8B,YAAY,sBAAsB,cAAc;;;;iBAI9E,sBAAsB,iBAAiB,SAAS;;;;;;;UAOvD;WACC;WACA;WACA"}
|
package/dist/utils.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { a as notOk, c as or, i as and, n as Ok, o as ok, r as Result, s as okVoid, t as NotOk } from "./result-BYCOANWy.mjs";
|
|
2
|
+
import { a as StructuredError, c as isStructuredError, i as NextAction, l as isStructuredErrorCode, n as DOCS_ERRORS_VERSION, o as StructuredErrorOptions, r as Diagnostic, s as docsUrlFor, t as DOCS_BASE, u as structuredError } from "./structured-error-Cc7AIRsp.mjs";
|
|
1
3
|
import { i as JsonValue, n as JsonObject, r as JsonPrimitive, t as JsonArray } from "./json-Dkqr3say.mjs";
|
|
2
|
-
import { a as ok, i as notOk, n as Ok, o as okVoid, r as Result, t as NotOk } from "./result-Bpupv5vO.mjs";
|
|
3
|
-
import { a as StructuredErrorOptions, c as isStructuredErrorCode, i as StructuredError, l as structuredError, n as DOCS_ERRORS_VERSION, o as docsUrlFor, r as NextAction, s as isStructuredError, t as DOCS_BASE } from "./structured-error-BsNT4Hun.mjs";
|
|
4
4
|
import { n as UnionToIntersection, t as Simplify } from "./types-DGxlljKG.mjs";
|
|
5
5
|
import { t as abortable } from "./abortable-DBbAaT_4.mjs";
|
|
6
6
|
import { t as isArrayEqual } from "./array-equal-dUd-VPlk.mjs";
|
|
@@ -8,9 +8,11 @@ import { n as invariant, t as assertDefined } from "./assertions-BEQnOIQd.mjs";
|
|
|
8
8
|
import { t as canonicalStringify } from "./canonical-stringify-Bl6agy_g.mjs";
|
|
9
9
|
import { n as castAs, t as blindCast } from "./casts-D29CHGrr.mjs";
|
|
10
10
|
import { t as ifDefined } from "./defined-BSXuxrnl.mjs";
|
|
11
|
-
import { t as hashContent } from "./hash-content-
|
|
12
|
-
import { n as assertNever, r as isInternalError, t as InternalError } from "./internal-error-
|
|
11
|
+
import { t as hashContent } from "./hash-content-Bde14N2-.mjs";
|
|
12
|
+
import { n as assertNever, r as isInternalError, t as InternalError } from "./internal-error-2fJ9fcZX.mjs";
|
|
13
13
|
import { t as isThenable } from "./promise-DHJWZv49.mjs";
|
|
14
14
|
import { n as redactDatabaseUrl, t as RedactedDatabaseUrl } from "./redact-db-url-BlaloOwt.mjs";
|
|
15
15
|
import { t as SimplifyDeep } from "./simplify-deep-Dw9I_ZUl.mjs";
|
|
16
|
-
|
|
16
|
+
import { t as suppressIdleConnectionErrors } from "./suppress-idle-connection-errors-CKrTbp5P.mjs";
|
|
17
|
+
import { i as withoutTrailing, n as counted, r as utf8ByteLength, t as clipToUtf8Bytes } from "./text-C8_-rheN.mjs";
|
|
18
|
+
export { DOCS_BASE, DOCS_ERRORS_VERSION, type Diagnostic, InternalError, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, type NextAction, type NotOk, type Ok, type RedactedDatabaseUrl, type Result, type Simplify, type SimplifyDeep, type StructuredError, type StructuredErrorOptions, type UnionToIntersection, abortable, and, assertDefined, assertNever, blindCast, canonicalStringify, castAs, clipToUtf8Bytes, counted, docsUrlFor, hashContent, ifDefined, invariant, isArrayEqual, isInternalError, isStructuredError, isStructuredErrorCode, isThenable, notOk, ok, okVoid, or, redactDatabaseUrl, structuredError, suppressIdleConnectionErrors, utf8ByteLength, withoutTrailing };
|
package/dist/utils.mjs
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { n as castAs, t as blindCast } from "./casts-DpaahrlC-Bd5n2coI.mjs";
|
|
2
2
|
import { t as ifDefined } from "./defined-BQWA85QH-BRSBMULx.mjs";
|
|
3
|
-
import { a as isStructuredErrorCode, i as isStructuredError, n as DOCS_ERRORS_VERSION, o as structuredError, r as docsUrlFor, t as DOCS_BASE } from "./structured-error-
|
|
3
|
+
import { a as isStructuredErrorCode, i as isStructuredError, n as DOCS_ERRORS_VERSION, o as structuredError, r as docsUrlFor, t as DOCS_BASE } from "./structured-error-BXbihKQ-.mjs";
|
|
4
|
+
import { t as canonicalStringify } from "./canonical-stringify-DY4NaAJi.mjs";
|
|
5
|
+
import { n as assertNever, r as isInternalError, t as InternalError } from "./internal-error-ChGYPVpq-DhUD05u0.mjs";
|
|
4
6
|
import { t as isArrayEqual } from "./array-equal-28xupwIB.mjs";
|
|
5
7
|
import { t as abortable } from "./abortable-CQO6uG9F.mjs";
|
|
6
|
-
import { n as
|
|
7
|
-
import {
|
|
8
|
-
import { t as canonicalStringify } from "./canonical-stringify-DY4NaAJi.mjs";
|
|
9
|
-
import { t as hashContent } from "./hash-content-Bugg_nZn.mjs";
|
|
8
|
+
import { n as invariant, t as assertDefined } from "./assertions-Dw1lZz_Q.mjs";
|
|
9
|
+
import { t as hashContent } from "./hash-content-Bdl-HSfq.mjs";
|
|
10
10
|
import { t as isThenable } from "./promise-D8meygPf.mjs";
|
|
11
11
|
import { t as redactDatabaseUrl } from "./redact-db-url-CRWJWdB1.mjs";
|
|
12
|
-
import { n as
|
|
13
|
-
|
|
12
|
+
import { a as or, i as okVoid, n as notOk, r as ok, t as and } from "./result-8OXF26MN.mjs";
|
|
13
|
+
import { t as suppressIdleConnectionErrors } from "./suppress-idle-connection-errors-DzApeUb3.mjs";
|
|
14
|
+
import { i as withoutTrailing, n as counted, r as utf8ByteLength, t as clipToUtf8Bytes } from "./text-C3TTEtgd.mjs";
|
|
15
|
+
export { DOCS_BASE, DOCS_ERRORS_VERSION, InternalError, abortable, and, assertDefined, assertNever, blindCast, canonicalStringify, castAs, clipToUtf8Bytes, counted, docsUrlFor, hashContent, ifDefined, invariant, isArrayEqual, isInternalError, isStructuredError, isStructuredErrorCode, isThenable, notOk, ok, okVoid, or, redactDatabaseUrl, structuredError, suppressIdleConnectionErrors, utf8ByteLength, withoutTrailing };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as invariant, t as assertDefined } from "./assertions-
|
|
1
|
+
import { n as invariant, t as assertDefined } from "./assertions-Dw1lZz_Q.mjs";
|
|
2
2
|
export { assertDefined, invariant };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as hashContent } from "./hash-content-
|
|
1
|
+
import { t as hashContent } from "./hash-content-Bde14N2-.mjs";
|
|
2
2
|
export { hashContent };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as hashContent } from "./hash-content-
|
|
1
|
+
import { t as hashContent } from "./hash-content-Bdl-HSfq.mjs";
|
|
2
2
|
export { hashContent };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as assertNever, r as isInternalError, t as InternalError } from "./internal-error-
|
|
1
|
+
import { n as assertNever, r as isInternalError, t as InternalError } from "./internal-error-2fJ9fcZX.mjs";
|
|
2
2
|
export { InternalError, assertNever, isInternalError };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as assertNever, r as isInternalError, t as InternalError } from "./internal-error-
|
|
1
|
+
import { n as assertNever, r as isInternalError, t as InternalError } from "./internal-error-ChGYPVpq-DhUD05u0.mjs";
|
|
2
2
|
export { InternalError, assertNever, isInternalError };
|
package/dist/utils__result.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { type NotOk, type Ok, type Result, notOk, ok, okVoid };
|
|
1
|
+
import { a as notOk, c as or, i as and, n as Ok, o as ok, r as Result, s as okVoid, t as NotOk } from "./result-BYCOANWy.mjs";
|
|
2
|
+
export { type NotOk, type Ok, type Result, and, notOk, ok, okVoid, or };
|
package/dist/utils__result.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
export { notOk, ok, okVoid };
|
|
1
|
+
import { a as or, i as okVoid, n as notOk, r as ok, t as and } from "./result-8OXF26MN.mjs";
|
|
2
|
+
export { and, notOk, ok, okVoid, or };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { DOCS_BASE, DOCS_ERRORS_VERSION, type NextAction, type StructuredError, type StructuredErrorOptions, docsUrlFor, isStructuredError, isStructuredErrorCode, structuredError };
|
|
1
|
+
import { a as StructuredError, c as isStructuredError, i as NextAction, l as isStructuredErrorCode, n as DOCS_ERRORS_VERSION, o as StructuredErrorOptions, r as Diagnostic, s as docsUrlFor, t as DOCS_BASE, u as structuredError } from "./structured-error-Cc7AIRsp.mjs";
|
|
2
|
+
export { DOCS_BASE, DOCS_ERRORS_VERSION, type Diagnostic, type NextAction, type StructuredError, type StructuredErrorOptions, docsUrlFor, isStructuredError, isStructuredErrorCode, structuredError };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as isStructuredErrorCode, i as isStructuredError, n as DOCS_ERRORS_VERSION, o as structuredError, r as docsUrlFor, t as DOCS_BASE } from "./structured-error-
|
|
1
|
+
import { a as isStructuredErrorCode, i as isStructuredError, n as DOCS_ERRORS_VERSION, o as structuredError, r as docsUrlFor, t as DOCS_BASE } from "./structured-error-BXbihKQ-.mjs";
|
|
2
2
|
export { DOCS_BASE, DOCS_ERRORS_VERSION, docsUrlFor, isStructuredError, isStructuredErrorCode, structuredError };
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as CrossReference, T as ContractWithDomain } from "./domain-envelope-CN721GnP-4huRt7Wc.mjs";
|
|
2
2
|
//#region ../../../1-framework/0-foundation/contract/dist/validate-domain.d.mts
|
|
3
3
|
//#region src/validate-domain.d.ts
|
|
4
|
+
interface DomainRelationShape {
|
|
5
|
+
readonly to: CrossReference;
|
|
6
|
+
readonly cardinality?: string;
|
|
7
|
+
readonly on?: unknown;
|
|
8
|
+
readonly nullable?: unknown;
|
|
9
|
+
}
|
|
4
10
|
interface DomainModelShape {
|
|
5
11
|
readonly fields: Record<string, unknown>;
|
|
6
|
-
readonly relations?: Record<string,
|
|
7
|
-
readonly to: CrossReference;
|
|
8
|
-
}>;
|
|
12
|
+
readonly relations?: Record<string, DomainRelationShape>;
|
|
9
13
|
readonly discriminator?: {
|
|
10
14
|
readonly field: string;
|
|
11
15
|
};
|
|
12
|
-
readonly variants?: Record<string,
|
|
16
|
+
readonly variants?: Record<string, CrossReference>;
|
|
13
17
|
readonly base?: CrossReference;
|
|
14
18
|
readonly owner?: string;
|
|
15
19
|
}
|
|
@@ -19,4 +23,4 @@ interface DomainContractShape extends ContractWithDomain {
|
|
|
19
23
|
declare function validateContractDomain(contract: DomainContractShape): void;
|
|
20
24
|
//#endregion
|
|
21
25
|
export { DomainModelShape as n, validateContractDomain as r, DomainContractShape as t };
|
|
22
|
-
//# sourceMappingURL=validate-domain-
|
|
26
|
+
//# sourceMappingURL=validate-domain-B5kmlBFB.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-domain-B5kmlBFB.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/validate-domain.d.mts"],"mappings":";;;UAEU;WACC,IAAI;WACJ;WACA;WACA;;UAED;WACC,QAAQ;WACR,YAAY,eAAe;WAC3B;aACE;;WAEF,WAAW,eAAe;WAC1B,OAAO;WACP;;UAED,4BAA4B;WAC3B,OAAO,eAAe;;iBAEhB,uBAAuB,UAAU"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { t as ContractValidationError } from "./contract-validation-error-
|
|
1
|
+
import { t as ContractValidationError } from "./contract-validation-error-CAnTGhkt-DSnujRaK.mjs";
|
|
2
|
+
import { t as blindCast } from "./casts-DpaahrlC-Bd5n2coI.mjs";
|
|
2
3
|
import { t as asNamespaceId } from "./namespace-id-asbWpwMw-3yxn-tRe.mjs";
|
|
3
4
|
//#region ../../../1-framework/0-foundation/contract/dist/validate-domain.mjs
|
|
4
5
|
function indexDomainModels(contract) {
|
|
@@ -30,6 +31,7 @@ function validateContractDomain(contract) {
|
|
|
30
31
|
validateRoots(contract, modelIndex, errors);
|
|
31
32
|
validateVariantsAndBases(modelIndex, errors);
|
|
32
33
|
validateRelationTargets(modelIndex, errors);
|
|
34
|
+
validateRelationNullability(modelIndex, errors);
|
|
33
35
|
validateDiscriminators(modelIndex, errors);
|
|
34
36
|
validateOwnership(contract, modelIndex, errors);
|
|
35
37
|
validateValueObjectReferences(contract, errors);
|
|
@@ -51,17 +53,21 @@ function validateRoots(contract, modelIndex, errors) {
|
|
|
51
53
|
}
|
|
52
54
|
function validateVariantsAndBases(modelIndex, errors) {
|
|
53
55
|
for (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) {
|
|
54
|
-
if (model.variants)
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
model
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
if (model.variants) {
|
|
57
|
+
const valuesByVariant = /* @__PURE__ */ new Map();
|
|
58
|
+
for (const [value, variantRef] of Object.entries(model.variants)) {
|
|
59
|
+
const variantKey = JSON.stringify([variantRef.namespace, variantRef.model]);
|
|
60
|
+
const earlierValue = valuesByVariant.get(variantKey);
|
|
61
|
+
if (earlierValue !== void 0) errors.push(`Model "${namespaceId}:${modelName}" lists variant "${variantRef.namespace}:${variantRef.model}" under both discriminator values "${earlierValue}" and "${value}"`);
|
|
62
|
+
valuesByVariant.set(variantKey, value);
|
|
63
|
+
const variantEntry = lookupModel(modelIndex, variantRef);
|
|
64
|
+
if (!variantEntry) {
|
|
65
|
+
errors.push(`Model "${namespaceId}:${modelName}" lists variant "${variantRef.namespace}:${variantRef.model}" which does not exist in domain.namespaces`);
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
const variantBase = variantEntry.model.base;
|
|
69
|
+
if (variantBase?.namespace !== namespaceId || variantBase?.model !== modelName) errors.push(`Variant "${variantRef.namespace}:${variantRef.model}" has base "${variantBase?.namespace ?? "?"}:${variantBase?.model ?? "(none)"}" but expected "${namespaceId}:${modelName}"`);
|
|
62
70
|
}
|
|
63
|
-
const variantBase = variantEntry.model.base;
|
|
64
|
-
if (variantBase?.namespace !== namespaceId || variantBase?.model !== modelName) errors.push(`Variant "${namespaceId}:${variantName}" has base "${variantBase?.namespace ?? "?"}:${variantBase?.model ?? "(none)"}" but expected "${namespaceId}:${modelName}"`);
|
|
65
71
|
}
|
|
66
72
|
if (model.base) {
|
|
67
73
|
const baseEntry = lookupModel(modelIndex, model.base);
|
|
@@ -69,7 +75,7 @@ function validateVariantsAndBases(modelIndex, errors) {
|
|
|
69
75
|
errors.push(`Model "${namespaceId}:${modelName}" has base "${model.base.namespace}:${model.base.model}" which does not exist in domain.namespaces`);
|
|
70
76
|
continue;
|
|
71
77
|
}
|
|
72
|
-
if (!baseEntry.model.variants
|
|
78
|
+
if (!Object.values(baseEntry.model.variants ?? {}).some((ref) => ref.namespace === namespaceId && ref.model === modelName)) errors.push(`Model "${namespaceId}:${modelName}" has base "${model.base.namespace}:${model.base.model}" which does not list it as a variant`);
|
|
73
79
|
}
|
|
74
80
|
}
|
|
75
81
|
}
|
|
@@ -79,6 +85,19 @@ function validateRelationTargets(modelIndex, errors) {
|
|
|
79
85
|
if (!lookupModel(modelIndex, relation.to)) errors.push(`Relation "${relName}" on model "${namespaceId}:${modelName}" targets "${relation.to.namespace}:${relation.to.model}" which does not exist in domain.namespaces`);
|
|
80
86
|
}
|
|
81
87
|
}
|
|
88
|
+
function relationKindLabel(relation) {
|
|
89
|
+
return relation.on === void 0 ? "embed relation" : `${relation.cardinality} relation`;
|
|
90
|
+
}
|
|
91
|
+
function validateRelationNullability(modelIndex, errors) {
|
|
92
|
+
for (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) for (const [relName, relation] of Object.entries(model.relations ?? {})) {
|
|
93
|
+
const location = `Relation "${relName}" on model "${namespaceId}:${modelName}"`;
|
|
94
|
+
if (relation.on !== void 0 && (relation.cardinality === "1:1" || relation.cardinality === "N:1")) {
|
|
95
|
+
if (relation.nullable !== void 0 && typeof relation.nullable !== "boolean") errors.push(`${location} is a ${relation.cardinality} relation and its "nullable" must be a boolean`);
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
if (relation.nullable !== void 0) errors.push(`${location} is a ${relationKindLabel(relation)} and must not carry "nullable"`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
82
101
|
function validateDiscriminators(modelIndex, errors) {
|
|
83
102
|
for (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) {
|
|
84
103
|
if (model.discriminator) {
|
|
@@ -120,24 +139,26 @@ function validateValueObjectReferences(contract, errors) {
|
|
|
120
139
|
}
|
|
121
140
|
for (const [namespaceKey, namespace] of Object.entries(contract.domain.namespaces)) {
|
|
122
141
|
const namespaceId = asNamespaceId(namespaceKey);
|
|
123
|
-
for (const [modelName, model] of Object.entries(namespace.models)) for (const [fieldName, field] of Object.entries(model.fields)) checkType(field?.type, `Model "${namespaceId}:${modelName}" field "${fieldName}"`, namespaceId);
|
|
124
|
-
for (const [voName, vo] of Object.entries(namespace.valueObjects ?? {})) for (const [fieldName, field] of Object.entries(vo.fields)) checkType(field?.type, `Value object "${namespaceId}:${voName}" field "${fieldName}"`, namespaceId);
|
|
142
|
+
for (const [modelName, model] of Object.entries(namespace.models)) for (const [fieldName, field] of Object.entries(model.fields)) checkType(blindCast(field)?.type, `Model "${namespaceId}:${modelName}" field "${fieldName}"`, namespaceId);
|
|
143
|
+
for (const [voName, vo] of Object.entries(namespace.valueObjects ?? {})) for (const [fieldName, field] of Object.entries(vo.fields)) checkType(blindCast(field)?.type, `Value object "${namespaceId}:${voName}" field "${fieldName}"`, namespaceId);
|
|
125
144
|
}
|
|
126
145
|
}
|
|
127
146
|
function validateFieldModifiers(modelIndex, contract, errors) {
|
|
128
|
-
|
|
129
|
-
const
|
|
130
|
-
|
|
147
|
+
function validateField(location, field) {
|
|
148
|
+
const candidate = blindCast(field);
|
|
149
|
+
const many = candidate?.many;
|
|
150
|
+
const isList = typeof many === "object" && many !== null && !Array.isArray(many) && Object.keys(many).length === 1 && "elementNullable" in many && typeof many.elementNullable === "boolean";
|
|
151
|
+
if (many !== void 0 && many !== false && !isList) errors.push(`${location} has invalid "many"; expected false or an elementNullable descriptor`);
|
|
152
|
+
if (candidate?.elementNullable !== void 0) errors.push(`${location} cannot have sibling "elementNullable"; put it inside "many"`);
|
|
153
|
+
if (isList && candidate?.dict) errors.push(`${location} cannot have both "many" and "dict" modifiers`);
|
|
131
154
|
}
|
|
155
|
+
for (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) for (const [fieldName, field] of Object.entries(model.fields)) validateField(`Model "${namespaceId}:${modelName}" field "${fieldName}"`, field);
|
|
132
156
|
for (const [namespaceKey, namespace] of Object.entries(contract.domain.namespaces)) {
|
|
133
157
|
const namespaceId = asNamespaceId(namespaceKey);
|
|
134
|
-
for (const [voName, vo] of Object.entries(namespace.valueObjects ?? {})) for (const [fieldName, field] of Object.entries(vo.fields)) {
|
|
135
|
-
const f = field;
|
|
136
|
-
if (f?.many && f?.dict) errors.push(`Value object "${namespaceId}:${voName}" field "${fieldName}" cannot have both "many" and "dict" modifiers`);
|
|
137
|
-
}
|
|
158
|
+
for (const [voName, vo] of Object.entries(namespace.valueObjects ?? {})) for (const [fieldName, field] of Object.entries(vo.fields)) validateField(`Value object "${namespaceId}:${voName}" field "${fieldName}"`, field);
|
|
138
159
|
}
|
|
139
160
|
}
|
|
140
161
|
//#endregion
|
|
141
162
|
export { validateContractDomain as t };
|
|
142
163
|
|
|
143
|
-
//# sourceMappingURL=validate-domain-
|
|
164
|
+
//# sourceMappingURL=validate-domain-CbXHDYpF.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-domain-CbXHDYpF.mjs","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/validate-domain.mjs"],"sourcesContent":["import { t as asNamespaceId } from \"./namespace-id-asbWpwMw.mjs\";\nimport { t as ContractValidationError } from \"./contract-validation-error-CAnTGhkt.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/validate-domain.ts\nfunction indexDomainModels(contract) {\n\tconst index = /* @__PURE__ */ new Map();\n\tfor (const [namespaceKey, namespace] of Object.entries(contract.domain.namespaces)) {\n\t\tconst namespaceId = asNamespaceId(namespaceKey);\n\t\tlet modelsInNamespace = index.get(namespaceId);\n\t\tif (modelsInNamespace === void 0) {\n\t\t\tmodelsInNamespace = /* @__PURE__ */ new Map();\n\t\t\tindex.set(namespaceId, modelsInNamespace);\n\t\t}\n\t\tfor (const [name, model] of Object.entries(namespace.models)) modelsInNamespace.set(name, {\n\t\t\tnamespaceId,\n\t\t\tname,\n\t\t\tmodel\n\t\t});\n\t}\n\treturn index;\n}\nfunction lookupModel(index, ref) {\n\treturn index.get(ref.namespace)?.get(ref.model);\n}\nfunction* iterateIndexedModels(index) {\n\tfor (const modelsInNamespace of index.values()) for (const entry of modelsInNamespace.values()) yield entry;\n}\nfunction validateContractDomain(contract) {\n\tconst errors = [];\n\tconst modelIndex = indexDomainModels(contract);\n\tvalidateRoots(contract, modelIndex, errors);\n\tvalidateVariantsAndBases(modelIndex, errors);\n\tvalidateRelationTargets(modelIndex, errors);\n\tvalidateRelationNullability(modelIndex, errors);\n\tvalidateDiscriminators(modelIndex, errors);\n\tvalidateOwnership(contract, modelIndex, errors);\n\tvalidateValueObjectReferences(contract, errors);\n\tvalidateFieldModifiers(modelIndex, contract, errors);\n\tif (errors.length > 0) throw new ContractValidationError(`Contract domain validation failed:\\n- ${errors.join(\"\\n- \")}`, \"domain\");\n}\nfunction validateRoots(contract, modelIndex, errors) {\n\tconst seenRootTargets = /* @__PURE__ */ new Map();\n\tfor (const [rootKey, crossRef] of Object.entries(contract.roots)) {\n\t\tlet modelsInNamespace = seenRootTargets.get(crossRef.namespace);\n\t\tif (modelsInNamespace === void 0) {\n\t\t\tmodelsInNamespace = /* @__PURE__ */ new Set();\n\t\t\tseenRootTargets.set(crossRef.namespace, modelsInNamespace);\n\t\t}\n\t\tif (modelsInNamespace.has(crossRef.model)) errors.push(`Duplicate root value: \"${crossRef.namespace}:${crossRef.model}\" is mapped by multiple root keys`);\n\t\tmodelsInNamespace.add(crossRef.model);\n\t\tif (!lookupModel(modelIndex, crossRef)) errors.push(`Root \"${rootKey}\" references model \"${crossRef.namespace}:${crossRef.model}\" which does not exist in domain.namespaces`);\n\t}\n}\nfunction validateVariantsAndBases(modelIndex, errors) {\n\tfor (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) {\n\t\tif (model.variants) {\n\t\t\tconst valuesByVariant = /* @__PURE__ */ new Map();\n\t\t\tfor (const [value, variantRef] of Object.entries(model.variants)) {\n\t\t\t\tconst variantKey = JSON.stringify([variantRef.namespace, variantRef.model]);\n\t\t\t\tconst earlierValue = valuesByVariant.get(variantKey);\n\t\t\t\tif (earlierValue !== void 0) errors.push(`Model \"${namespaceId}:${modelName}\" lists variant \"${variantRef.namespace}:${variantRef.model}\" under both discriminator values \"${earlierValue}\" and \"${value}\"`);\n\t\t\t\tvaluesByVariant.set(variantKey, value);\n\t\t\t\tconst variantEntry = lookupModel(modelIndex, variantRef);\n\t\t\t\tif (!variantEntry) {\n\t\t\t\t\terrors.push(`Model \"${namespaceId}:${modelName}\" lists variant \"${variantRef.namespace}:${variantRef.model}\" which does not exist in domain.namespaces`);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst variantBase = variantEntry.model.base;\n\t\t\t\tif (variantBase?.namespace !== namespaceId || variantBase?.model !== modelName) errors.push(`Variant \"${variantRef.namespace}:${variantRef.model}\" has base \"${variantBase?.namespace ?? \"?\"}:${variantBase?.model ?? \"(none)\"}\" but expected \"${namespaceId}:${modelName}\"`);\n\t\t\t}\n\t\t}\n\t\tif (model.base) {\n\t\t\tconst baseEntry = lookupModel(modelIndex, model.base);\n\t\t\tif (!baseEntry) {\n\t\t\t\terrors.push(`Model \"${namespaceId}:${modelName}\" has base \"${model.base.namespace}:${model.base.model}\" which does not exist in domain.namespaces`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!Object.values(baseEntry.model.variants ?? {}).some((ref) => ref.namespace === namespaceId && ref.model === modelName)) errors.push(`Model \"${namespaceId}:${modelName}\" has base \"${model.base.namespace}:${model.base.model}\" which does not list it as a variant`);\n\t\t}\n\t}\n}\nfunction validateRelationTargets(modelIndex, errors) {\n\tfor (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) for (const [relName, relation] of Object.entries(model.relations ?? {})) {\n\t\tif (relation.to.space !== void 0) continue;\n\t\tif (!lookupModel(modelIndex, relation.to)) errors.push(`Relation \"${relName}\" on model \"${namespaceId}:${modelName}\" targets \"${relation.to.namespace}:${relation.to.model}\" which does not exist in domain.namespaces`);\n\t}\n}\nfunction relationKindLabel(relation) {\n\treturn relation.on === void 0 ? \"embed relation\" : `${relation.cardinality} relation`;\n}\nfunction validateRelationNullability(modelIndex, errors) {\n\tfor (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) for (const [relName, relation] of Object.entries(model.relations ?? {})) {\n\t\tconst location = `Relation \"${relName}\" on model \"${namespaceId}:${modelName}\"`;\n\t\tif (relation.on !== void 0 && (relation.cardinality === \"1:1\" || relation.cardinality === \"N:1\")) {\n\t\t\tif (relation.nullable !== void 0 && typeof relation.nullable !== \"boolean\") errors.push(`${location} is a ${relation.cardinality} relation and its \"nullable\" must be a boolean`);\n\t\t\tcontinue;\n\t\t}\n\t\tif (relation.nullable !== void 0) errors.push(`${location} is a ${relationKindLabel(relation)} and must not carry \"nullable\"`);\n\t}\n}\nfunction validateDiscriminators(modelIndex, errors) {\n\tfor (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) {\n\t\tif (model.discriminator) {\n\t\t\tif (!model.variants || Object.keys(model.variants).length === 0) errors.push(`Model \"${namespaceId}:${modelName}\" has discriminator but no variants`);\n\t\t\tif (!Object.hasOwn(model.fields, model.discriminator.field)) errors.push(`Discriminator field \"${model.discriminator.field}\" is not a field on model \"${namespaceId}:${modelName}\"`);\n\t\t}\n\t\tif (model.variants && Object.keys(model.variants).length > 0 && !model.discriminator) errors.push(`Model \"${namespaceId}:${modelName}\" has variants but no discriminator`);\n\t\tif (model.base) {\n\t\t\tif (model.discriminator) errors.push(`Model \"${namespaceId}:${modelName}\" has base and must not have discriminator`);\n\t\t\tif (model.variants && Object.keys(model.variants).length > 0) errors.push(`Model \"${namespaceId}:${modelName}\" has base and must not have variants`);\n\t\t}\n\t}\n}\nfunction validateOwnership(contract, modelIndex, errors) {\n\tfor (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) {\n\t\tif (!model.owner) continue;\n\t\tif (model.owner === modelName) errors.push(`Model \"${namespaceId}:${modelName}\" cannot own itself`);\n\t\tif (!lookupModel(modelIndex, {\n\t\t\tnamespace: namespaceId,\n\t\t\tmodel: model.owner\n\t\t})) errors.push(`Model \"${namespaceId}:${modelName}\" has owner \"${namespaceId}:${model.owner}\" which does not exist in domain.namespaces`);\n\t\tfor (const [rootKey, rootRef] of Object.entries(contract.roots)) if (rootRef.namespace === namespaceId && rootRef.model === modelName) errors.push(`Owned model \"${namespaceId}:${modelName}\" must not appear in roots (found as root \"${rootKey}\")`);\n\t}\n}\nfunction validateValueObjectReferences(contract, errors) {\n\tconst voNamesByNamespace = /* @__PURE__ */ new Map();\n\tfor (const [namespaceKey, namespace] of Object.entries(contract.domain.namespaces)) {\n\t\tconst namespaceId = asNamespaceId(namespaceKey);\n\t\tvoNamesByNamespace.set(namespaceId, new Set(Object.keys(namespace.valueObjects ?? {})));\n\t}\n\tfunction checkType(type, location, namespaceId) {\n\t\tif (!type) return;\n\t\tconst voNames = voNamesByNamespace.get(namespaceId) ?? /* @__PURE__ */ new Set();\n\t\tif (type.kind === \"valueObject\" && type.name && !voNames.has(type.name)) {\n\t\t\terrors.push(`${location} references value object \"${namespaceId}:${type.name}\" which does not exist in that namespace's valueObjects`);\n\t\t\treturn;\n\t\t}\n\t\tif (type.kind === \"union\") for (const member of type.members ?? []) checkType(member, location, namespaceId);\n\t}\n\tfor (const [namespaceKey, namespace] of Object.entries(contract.domain.namespaces)) {\n\t\tconst namespaceId = asNamespaceId(namespaceKey);\n\t\tfor (const [modelName, model] of Object.entries(namespace.models)) for (const [fieldName, field] of Object.entries(model.fields)) checkType(blindCast(field)?.type, `Model \"${namespaceId}:${modelName}\" field \"${fieldName}\"`, namespaceId);\n\t\tfor (const [voName, vo] of Object.entries(namespace.valueObjects ?? {})) for (const [fieldName, field] of Object.entries(vo.fields)) checkType(blindCast(field)?.type, `Value object \"${namespaceId}:${voName}\" field \"${fieldName}\"`, namespaceId);\n\t}\n}\nfunction validateFieldModifiers(modelIndex, contract, errors) {\n\tfunction validateField(location, field) {\n\t\tconst candidate = blindCast(field);\n\t\tconst many = candidate?.many;\n\t\tconst isList = typeof many === \"object\" && many !== null && !Array.isArray(many) && Object.keys(many).length === 1 && \"elementNullable\" in many && typeof many.elementNullable === \"boolean\";\n\t\tif (many !== void 0 && many !== false && !isList) errors.push(`${location} has invalid \"many\"; expected false or an elementNullable descriptor`);\n\t\tif (candidate?.elementNullable !== void 0) errors.push(`${location} cannot have sibling \"elementNullable\"; put it inside \"many\"`);\n\t\tif (isList && candidate?.dict) errors.push(`${location} cannot have both \"many\" and \"dict\" modifiers`);\n\t}\n\tfor (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) for (const [fieldName, field] of Object.entries(model.fields)) validateField(`Model \"${namespaceId}:${modelName}\" field \"${fieldName}\"`, field);\n\tfor (const [namespaceKey, namespace] of Object.entries(contract.domain.namespaces)) {\n\t\tconst namespaceId = asNamespaceId(namespaceKey);\n\t\tfor (const [voName, vo] of Object.entries(namespace.valueObjects ?? {})) for (const [fieldName, field] of Object.entries(vo.fields)) validateField(`Value object \"${namespaceId}:${voName}\" field \"${fieldName}\"`, field);\n\t}\n}\n//#endregion\nexport { validateContractDomain };\n\n//# sourceMappingURL=validate-domain.mjs.map"],"mappings":";;;;AAIA,SAAS,kBAAkB,UAAU;CACpC,MAAM,wBAAwB,IAAI,IAAI;CACtC,KAAK,MAAM,CAAC,cAAc,cAAc,OAAO,QAAQ,SAAS,OAAO,UAAU,GAAG;EACnF,MAAM,cAAc,cAAc,YAAY;EAC9C,IAAI,oBAAoB,MAAM,IAAI,WAAW;EAC7C,IAAI,sBAAsB,KAAK,GAAG;GACjC,oCAAoC,IAAI,IAAI;GAC5C,MAAM,IAAI,aAAa,iBAAiB;EACzC;EACA,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,UAAU,MAAM,GAAG,kBAAkB,IAAI,MAAM;GACzF;GACA;GACA;EACD,CAAC;CACF;CACA,OAAO;AACR;AACA,SAAS,YAAY,OAAO,KAAK;CAChC,OAAO,MAAM,IAAI,IAAI,SAAS,CAAC,EAAE,IAAI,IAAI,KAAK;AAC/C;AACA,UAAU,qBAAqB,OAAO;CACrC,KAAK,MAAM,qBAAqB,MAAM,OAAO,G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nL,IAAI,SAAS,KAAK,KAAK,SAAS,SAAS,CAAC,QAAQ,OAAO,KAAK,GAAG,SAAS,qEAAqE;EAC/I,IAAI,WAAW,oBAAoB,KAAK,GAAG,OAAO,KAAK,GAAG,SAAS,6DAA6D;EAChI,IAAI,UAAU,WAAW,MAAM,OAAO,KAAK,GAAG,SAAS,8CAA8C;CACtG;CACA,KAAK,MAAM,EAAE,aAAa,MAAM,WAAW,WAAW,qBAAqB,UAAU,GAAG,KAAK,MAAM,CAAC,WAAW,UAAU,OAAO,QAAQ,MAAM,MAAM,GAAG,cAAc,UAAU,YAAY,GAAG,UAAU,WAAW,UAAU,IAAI,KAAK;CACtO,KAAK,MAAM,CAAC,cAAc,cAAc,OAAO,QAAQ,SAAS,OAAO,UAAU,GAAG;EACnF,MAAM,cAAc,cAAc,YAAY;EAC9C,KAAK,MAAM,CAAC,QAAQ,OAAO,OAAO,QAAQ,UAAU,gBAAgB,CAAC,CAAC,GAAG,KAAK,MAAM,CAAC,WAAW,UAAU,OAAO,QAAQ,GAAG,MAAM,GAAG,cAAc,iBAAiB,YAAY,GAAG,OAAO,WAAW,UAAU,IAAI,KAAK;CACzN;AACD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { t as blindCast } from "./casts-DpaahrlC-Bd5n2coI.mjs";
|
|
2
|
+
//#region ../../../1-framework/0-foundation/contract/dist/validate-once.mjs
|
|
3
|
+
const validatedContractsKey = Symbol.for("prisma.orm.validatedContracts");
|
|
4
|
+
function validatedContracts() {
|
|
5
|
+
const existing = Reflect.get(globalThis, validatedContractsKey);
|
|
6
|
+
if (existing instanceof WeakMap) return existing;
|
|
7
|
+
const created = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
Object.defineProperty(globalThis, validatedContractsKey, { value: created });
|
|
9
|
+
return created;
|
|
10
|
+
}
|
|
11
|
+
function isObject(value) {
|
|
12
|
+
return typeof value === "object" && value !== null;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Runs `validate` on `input` unless `validator` already validated `input`, or `input` is a result
|
|
16
|
+
* of that validation. The record is kept on `globalThis` under a `Symbol.for` key, so separate
|
|
17
|
+
* bundles and copies of the code in one program share it; `validator` names the validation rules,
|
|
18
|
+
* including the version that owns them, so another version validates again.
|
|
19
|
+
*
|
|
20
|
+
* The returned contract's top level is frozen; its nested objects are not. The input is not frozen,
|
|
21
|
+
* because it belongs to the caller. Neither may be changed after the call: a later call returns the
|
|
22
|
+
* recorded contract without validating again.
|
|
23
|
+
*/
|
|
24
|
+
function validateContractOnce(input, validator, validate) {
|
|
25
|
+
const registry = validatedContracts();
|
|
26
|
+
if (isObject(input)) {
|
|
27
|
+
const recorded = registry.get(input);
|
|
28
|
+
if (recorded !== void 0 && recorded.validator === validator) return blindCast(recorded.contract);
|
|
29
|
+
}
|
|
30
|
+
const contract = Object.freeze(validate(input));
|
|
31
|
+
const record = {
|
|
32
|
+
validator,
|
|
33
|
+
contract
|
|
34
|
+
};
|
|
35
|
+
registry.set(contract, record);
|
|
36
|
+
if (isObject(input)) registry.set(input, record);
|
|
37
|
+
return contract;
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { validateContractOnce as t };
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=validate-once-D-IwXHYP.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-once-D-IwXHYP.mjs","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/validate-once.mjs"],"sourcesContent":["import { blindCast } from \"@internal/utils/casts\";\n//#region src/validate-once.ts\nconst validatedContractsKey = Symbol.for(\"prisma.orm.validatedContracts\");\nfunction validatedContracts() {\n\tconst existing = Reflect.get(globalThis, validatedContractsKey);\n\tif (existing instanceof WeakMap) return existing;\n\tconst created = /* @__PURE__ */ new WeakMap();\n\tObject.defineProperty(globalThis, validatedContractsKey, { value: created });\n\treturn created;\n}\nfunction isObject(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\n/**\n* Runs `validate` on `input` unless `validator` already validated `input`, or `input` is a result\n* of that validation. The record is kept on `globalThis` under a `Symbol.for` key, so separate\n* bundles and copies of the code in one program share it; `validator` names the validation rules,\n* including the version that owns them, so another version validates again.\n*\n* The returned contract's top level is frozen; its nested objects are not. The input is not frozen,\n* because it belongs to the caller. Neither may be changed after the call: a later call returns the\n* recorded contract without validating again.\n*/\nfunction validateContractOnce(input, validator, validate) {\n\tconst registry = validatedContracts();\n\tif (isObject(input)) {\n\t\tconst recorded = registry.get(input);\n\t\tif (recorded !== void 0 && recorded.validator === validator) return blindCast(recorded.contract);\n\t}\n\tconst contract = Object.freeze(validate(input));\n\tconst record = {\n\t\tvalidator,\n\t\tcontract\n\t};\n\tregistry.set(contract, record);\n\tif (isObject(input)) registry.set(input, record);\n\treturn contract;\n}\n//#endregion\nexport { validateContractOnce };\n\n//# sourceMappingURL=validate-once.mjs.map"],"mappings":";;AAEA,MAAM,wBAAwB,OAAO,IAAI,+BAA+B;AACxE,SAAS,qBAAqB;CAC7B,MAAM,WAAW,QAAQ,IAAI,YAAY,qBAAqB;CAC9D,IAAI,oBAAoB,SAAS,OAAO;CACxC,MAAM,0BAA0B,IAAI,QAAQ;CAC5C,OAAO,eAAe,YAAY,uBAAuB,EAAE,OAAO,QAAQ,CAAC;CAC3E,OAAO;AACR;AACA,SAAS,SAAS,OAAO;CACxB,OAAO,OAAO,UAAU,YAAY,UAAU;AAC/C;;;;;;;;;;;AAWA,SAAS,qBAAqB,OAAO,WAAW,UAAU;CACzD,MAAM,WAAW,mBAAmB;CACpC,IAAI,SAAS,KAAK,GAAG;EACpB,MAAM,WAAW,SAAS,IAAI,KAAK;EACnC,IAAI,aAAa,KAAK,KAAK,SAAS,cAAc,WAAW,OAAO,UAAU,SAAS,QAAQ;CAChG;CACA,MAAM,WAAW,OAAO,OAAO,SAAS,KAAK,CAAC;CAC9C,MAAM,SAAS;EACd;EACA;CACD;CACA,SAAS,IAAI,UAAU,MAAM;CAC7B,IAAI,SAAS,KAAK,GAAG,SAAS,IAAI,OAAO,MAAM;CAC/C,OAAO;AACR"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region ../../../1-framework/0-foundation/contract/dist/validate-once.d.mts
|
|
2
|
+
//#region src/validate-once.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Runs `validate` on `input` unless `validator` already validated `input`, or `input` is a result
|
|
5
|
+
* of that validation. The record is kept on `globalThis` under a `Symbol.for` key, so separate
|
|
6
|
+
* bundles and copies of the code in one program share it; `validator` names the validation rules,
|
|
7
|
+
* including the version that owns them, so another version validates again.
|
|
8
|
+
*
|
|
9
|
+
* The returned contract's top level is frozen; its nested objects are not. The input is not frozen,
|
|
10
|
+
* because it belongs to the caller. Neither may be changed after the call: a later call returns the
|
|
11
|
+
* recorded contract without validating again.
|
|
12
|
+
*/
|
|
13
|
+
declare function validateContractOnce<TContract extends object>(input: unknown, validator: string, validate: (input: unknown) => TContract): TContract;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { validateContractOnce as t };
|
|
16
|
+
//# sourceMappingURL=validate-once-gfCOHsDh.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-once-gfCOHsDh.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/validate-once.d.mts"],"mappings":";;;;;;;;;;;;iBAWiB,qBAAqB,0BAA0B,gBAAgB,mBAAmB,WAAW,mBAAmB,YAAY"}
|