@prisma/orm-framework 0.16.0-dev.36
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/LICENSE +201 -0
- package/README.md +27 -0
- package/dist/abortable-CQO6uG9F.mjs +39 -0
- package/dist/abortable-CQO6uG9F.mjs.map +1 -0
- package/dist/abortable-DBbAaT_4.d.mts +29 -0
- package/dist/abortable-DBbAaT_4.d.mts.map +1 -0
- package/dist/apply-specifier-default-control-policy-CAxiXxKg.d.mts +7 -0
- package/dist/apply-specifier-default-control-policy-CAxiXxKg.d.mts.map +1 -0
- package/dist/apply-specifier-default-control-policy-CsYHsfTF.mjs +12 -0
- package/dist/apply-specifier-default-control-policy-CsYHsfTF.mjs.map +1 -0
- package/dist/array-equal-28xupwIB.mjs +26 -0
- package/dist/array-equal-28xupwIB.mjs.map +1 -0
- package/dist/array-equal-dUd-VPlk.d.mts +22 -0
- package/dist/array-equal-dUd-VPlk.d.mts.map +1 -0
- package/dist/assertions-BEQnOIQd.d.mts +31 -0
- package/dist/assertions-BEQnOIQd.d.mts.map +1 -0
- package/dist/assertions-Cz-GWH8P.mjs +36 -0
- package/dist/assertions-Cz-GWH8P.mjs.map +1 -0
- package/dist/authoring-Dd7p6pTS.d.mts +1 -0
- package/dist/canonical-stringify-Bl6agy_g.d.mts +51 -0
- package/dist/canonical-stringify-Bl6agy_g.d.mts.map +1 -0
- package/dist/canonical-stringify-DY4NaAJi.mjs +104 -0
- package/dist/canonical-stringify-DY4NaAJi.mjs.map +1 -0
- package/dist/canonicalization-DFpB09nP-4OdB2nsy.d.mts +69 -0
- package/dist/canonicalization-DFpB09nP-4OdB2nsy.d.mts.map +1 -0
- package/dist/canonicalization-path-match-CNgHuwM_-CCPBeUuk.mjs +25 -0
- package/dist/canonicalization-path-match-CNgHuwM_-CCPBeUuk.mjs.map +1 -0
- package/dist/capabilities-CPj7MfXO-GRkp0Q_D.mjs +64 -0
- package/dist/capabilities-CPj7MfXO-GRkp0Q_D.mjs.map +1 -0
- package/dist/capabilities-Cupq4-1--C71ORI3N.d.mts +34 -0
- package/dist/capabilities-Cupq4-1--C71ORI3N.d.mts.map +1 -0
- package/dist/casts-D29CHGrr.d.mts +78 -0
- package/dist/casts-D29CHGrr.d.mts.map +1 -0
- package/dist/casts-DpaahrlC-Bd5n2coI.mjs +82 -0
- package/dist/casts-DpaahrlC-Bd5n2coI.mjs.map +1 -0
- package/dist/codec-Cly9VPoA.mjs +78 -0
- package/dist/codec-Cly9VPoA.mjs.map +1 -0
- package/dist/codec-D3GVAkR_.d.mts +116 -0
- package/dist/codec-D3GVAkR_.d.mts.map +1 -0
- package/dist/codec-types-XJO6eC9U-B_K2q0zm.d.mts +221 -0
- package/dist/codec-types-XJO6eC9U-B_K2q0zm.d.mts.map +1 -0
- package/dist/components-CawuxTia.d.mts +1 -0
- package/dist/components.d.mts +20 -0
- package/dist/components.mjs +15 -0
- package/dist/components__authoring.d.mts +3 -0
- package/dist/components__authoring.mjs +2 -0
- package/dist/components__codec.d.mts +3 -0
- package/dist/components__codec.mjs +3 -0
- package/dist/components__components.d.mts +4 -0
- package/dist/components__components.mjs +3 -0
- package/dist/components__control.d.mts +4 -0
- package/dist/components__control.mjs +2 -0
- package/dist/components__emission.d.mts +4 -0
- package/dist/components__emission.mjs +2 -0
- package/dist/components__execution.d.mts +2 -0
- package/dist/components__execution.mjs +2 -0
- package/dist/components__ir.d.mts +3 -0
- package/dist/components__ir.mjs +3 -0
- package/dist/components__psl-ast.d.mts +4 -0
- package/dist/components__psl-ast.mjs +2 -0
- package/dist/components__runtime.d.mts +2 -0
- package/dist/components__runtime.mjs +3 -0
- package/dist/components__utils.d.mts +2 -0
- package/dist/components__utils.mjs +2 -0
- package/dist/config-errors-CBdiX587-DwIyJIX9.mjs +9 -0
- package/dist/config-errors-CBdiX587-DwIyJIX9.mjs.map +1 -0
- package/dist/config-types-Cf9lVsHR.mjs +62 -0
- package/dist/config-types-Cf9lVsHR.mjs.map +1 -0
- package/dist/config-types-W-87vhZ4-BgYaH8YO.d.mts +162 -0
- package/dist/config-types-W-87vhZ4-BgYaH8YO.d.mts.map +1 -0
- package/dist/config-types-zrHI32Om.d.mts +1 -0
- package/dist/config-validation-ByGTw6zQ.mjs +99 -0
- package/dist/config-validation-ByGTw6zQ.mjs.map +1 -0
- package/dist/config-validation-DXggMTZf.d.mts +14 -0
- package/dist/config-validation-DXggMTZf.d.mts.map +1 -0
- package/dist/config.d.mts +4 -0
- package/dist/config.mjs +3 -0
- package/dist/config__config-types.d.mts +3 -0
- package/dist/config__config-types.mjs +2 -0
- package/dist/config__config-validation.d.mts +2 -0
- package/dist/config__config-validation.mjs +2 -0
- package/dist/contract-authoring.d.mts +213 -0
- package/dist/contract-authoring.d.mts.map +1 -0
- package/dist/contract-authoring.mjs +133 -0
- package/dist/contract-authoring.mjs.map +1 -0
- package/dist/contract-types-CkdMH7F7-9EHXSwbH.d.mts +77 -0
- package/dist/contract-types-CkdMH7F7-9EHXSwbH.d.mts.map +1 -0
- package/dist/contract-validation-error-DEiWp_EI-CRwtUgRw.mjs +14 -0
- package/dist/contract-validation-error-DEiWp_EI-CRwtUgRw.mjs.map +1 -0
- package/dist/contract-validation-error-R7cMoK04.d.mts +11 -0
- package/dist/contract-validation-error-R7cMoK04.d.mts.map +1 -0
- package/dist/contract.d.mts +14 -0
- package/dist/contract.mjs +13 -0
- package/dist/contract__apply-specifier-default-control-policy.d.mts +2 -0
- package/dist/contract__apply-specifier-default-control-policy.mjs +2 -0
- package/dist/contract__contract-validation-error.d.mts +2 -0
- package/dist/contract__contract-validation-error.mjs +2 -0
- package/dist/contract__default-namespace.d.mts +2 -0
- package/dist/contract__default-namespace.mjs +2 -0
- package/dist/contract__enum-accessor.d.mts +2 -0
- package/dist/contract__enum-accessor.mjs +2 -0
- package/dist/contract__hashing-utils.d.mts +2 -0
- package/dist/contract__hashing-utils.mjs +3 -0
- package/dist/contract__hashing.d.mts +3 -0
- package/dist/contract__hashing.mjs +2 -0
- package/dist/contract__is-plain-record.d.mts +2 -0
- package/dist/contract__is-plain-record.mjs +2 -0
- package/dist/contract__resolve-domain-model.d.mts +2 -0
- package/dist/contract__resolve-domain-model.mjs +2 -0
- package/dist/contract__types.d.mts +6 -0
- package/dist/contract__types.mjs +5 -0
- package/dist/contract__validate-domain.d.mts +2 -0
- package/dist/contract__validate-domain.mjs +2 -0
- package/dist/control-B87KWI_K-C_R8WfEr.d.mts +213 -0
- package/dist/control-B87KWI_K-C_R8WfEr.d.mts.map +1 -0
- package/dist/control-CBvTj7Ia.d.mts +1383 -0
- package/dist/control-CBvTj7Ia.d.mts.map +1 -0
- package/dist/control-DTouE89s.mjs +621 -0
- package/dist/control-DTouE89s.mjs.map +1 -0
- package/dist/control-Ftiau058-CCeJcAVQ.mjs +284 -0
- package/dist/control-Ftiau058-CCeJcAVQ.mjs.map +1 -0
- package/dist/declarations-DR6To8_k-BFwkCGeP.mjs +1046 -0
- package/dist/declarations-DR6To8_k-BFwkCGeP.mjs.map +1 -0
- package/dist/default-namespace-D4vCwkXg-BaiW8LNK.mjs +39 -0
- package/dist/default-namespace-D4vCwkXg-BaiW8LNK.mjs.map +1 -0
- package/dist/default-namespace-D5X_k6hJ-GH8P1ror.d.mts +26 -0
- package/dist/default-namespace-D5X_k6hJ-GH8P1ror.d.mts.map +1 -0
- package/dist/defined-BQWA85QH-BRSBMULx.mjs +31 -0
- package/dist/defined-BQWA85QH-BRSBMULx.mjs.map +1 -0
- package/dist/defined-BSXuxrnl.d.mts +28 -0
- package/dist/defined-BSXuxrnl.d.mts.map +1 -0
- package/dist/domain-envelope-D6Wn9AmZ-BqZKTT9U.d.mts +359 -0
- package/dist/domain-envelope-D6Wn9AmZ-BqZKTT9U.d.mts.map +1 -0
- package/dist/emission-CeoAV9mj.mjs +26 -0
- package/dist/emission-CeoAV9mj.mjs.map +1 -0
- package/dist/emission-DeoQufVd.d.mts +1 -0
- package/dist/emission-types-hfRVB_Yw-DpQ3hISB.d.mts +75 -0
- package/dist/emission-types-hfRVB_Yw-DpQ3hISB.d.mts.map +1 -0
- package/dist/enum-accessor-Db5DaTNX.mjs +35 -0
- package/dist/enum-accessor-Db5DaTNX.mjs.map +1 -0
- package/dist/enum-accessor-PH5vjghI.d.mts +85 -0
- package/dist/enum-accessor-PH5vjghI.d.mts.map +1 -0
- package/dist/errors.d.mts +4 -0
- package/dist/errors.mjs +4 -0
- package/dist/errors__control.d.mts +2 -0
- package/dist/errors__control.mjs +2 -0
- package/dist/errors__execution.d.mts +2 -0
- package/dist/errors__execution.mjs +2 -0
- package/dist/errors__migration.d.mts +2 -0
- package/dist/errors__migration.mjs +2 -0
- package/dist/execution-BNwBzmRd.mjs +40 -0
- package/dist/execution-BNwBzmRd.mjs.map +1 -0
- package/dist/execution-BbOD4GyR.mjs +164 -0
- package/dist/execution-BbOD4GyR.mjs.map +1 -0
- package/dist/execution-Bo5Bu2Ys.d.mts +79 -0
- package/dist/execution-Bo5Bu2Ys.d.mts.map +1 -0
- package/dist/execution-MOde1lmD.d.mts +98 -0
- package/dist/execution-MOde1lmD.d.mts.map +1 -0
- package/dist/framework-authoring-7YMP9TwM-C9P-N6_a.d.mts +777 -0
- package/dist/framework-authoring-7YMP9TwM-C9P-N6_a.d.mts.map +1 -0
- package/dist/framework-authoring-CDEvlouU-mlMWSksD.mjs +698 -0
- package/dist/framework-authoring-CDEvlouU-mlMWSksD.mjs.map +1 -0
- package/dist/framework-components-D6j4Y5K7-RW9H184y.mjs +27 -0
- package/dist/framework-components-D6j4Y5K7-RW9H184y.mjs.map +1 -0
- package/dist/framework-components-MFoo0sYx-G_6k9jt4.d.mts +388 -0
- package/dist/framework-components-MFoo0sYx-G_6k9jt4.d.mts.map +1 -0
- package/dist/hash-content-Bugg_nZn.mjs +63 -0
- package/dist/hash-content-Bugg_nZn.mjs.map +1 -0
- package/dist/hash-content-DwEUh-Rx.d.mts +59 -0
- package/dist/hash-content-DwEUh-Rx.d.mts.map +1 -0
- package/dist/hashing-BtIZVNYX.mjs +199 -0
- package/dist/hashing-BtIZVNYX.mjs.map +1 -0
- package/dist/hashing-CccSPELN.d.mts +25 -0
- package/dist/hashing-CccSPELN.d.mts.map +1 -0
- package/dist/hashing-utils-DQgS3nOe.mjs +48 -0
- package/dist/hashing-utils-DQgS3nOe.mjs.map +1 -0
- package/dist/hashing-utils-qKu59RSC.d.mts +19 -0
- package/dist/hashing-utils-qKu59RSC.d.mts.map +1 -0
- package/dist/ids.d.mts +44 -0
- package/dist/ids.d.mts.map +1 -0
- package/dist/ids.mjs +96 -0
- package/dist/ids.mjs.map +1 -0
- package/dist/ids__runtime.d.mts +7 -0
- package/dist/ids__runtime.d.mts.map +1 -0
- package/dist/ids__runtime.mjs +31 -0
- package/dist/ids__runtime.mjs.map +1 -0
- package/dist/index-GY2oGH9L.d.mts +120 -0
- package/dist/index-GY2oGH9L.d.mts.map +1 -0
- package/dist/internal-error-BIc-ehme-ouBQPoEL.mjs +24 -0
- package/dist/internal-error-BIc-ehme-ouBQPoEL.mjs.map +1 -0
- package/dist/internal-error-kK8QvlDE.d.mts +19 -0
- package/dist/internal-error-kK8QvlDE.d.mts.map +1 -0
- package/dist/ir-BvE7L9FK.d.mts +359 -0
- package/dist/ir-BvE7L9FK.d.mts.map +1 -0
- package/dist/ir-ChmSSAhX.mjs +200 -0
- package/dist/ir-ChmSSAhX.mjs.map +1 -0
- package/dist/is-plain-record-C9BWiqcw.d.mts +12 -0
- package/dist/is-plain-record-C9BWiqcw.d.mts.map +1 -0
- package/dist/is-plain-record-CUofyVQ7-DWEzdhIx.mjs +16 -0
- package/dist/is-plain-record-CUofyVQ7-DWEzdhIx.mjs.map +1 -0
- package/dist/json-Dkqr3say.d.mts +26 -0
- package/dist/json-Dkqr3say.d.mts.map +1 -0
- package/dist/migration-4VOHVEzx.mjs +118 -0
- package/dist/migration-4VOHVEzx.mjs.map +1 -0
- package/dist/migration-DKbDzBwy.d.mts +74 -0
- package/dist/migration-DKbDzBwy.d.mts.map +1 -0
- package/dist/namespace-id-asbWpwMw-3yxn-tRe.mjs +9 -0
- package/dist/namespace-id-asbWpwMw-3yxn-tRe.mjs.map +1 -0
- package/dist/operations.d.mts +46 -0
- package/dist/operations.d.mts.map +1 -0
- package/dist/operations.mjs +28 -0
- package/dist/operations.mjs.map +1 -0
- package/dist/parse-0ZJjj_2N-WZZ1nlrv.d.mts +427 -0
- package/dist/parse-0ZJjj_2N-WZZ1nlrv.d.mts.map +1 -0
- package/dist/parse-GbZGfMUj-BFSrD2AN.mjs +621 -0
- package/dist/parse-GbZGfMUj-BFSrD2AN.mjs.map +1 -0
- package/dist/promise-D8meygPf.mjs +13 -0
- package/dist/promise-D8meygPf.mjs.map +1 -0
- package/dist/promise-DHJWZv49.d.mts +11 -0
- package/dist/promise-DHJWZv49.d.mts.map +1 -0
- package/dist/psl-ast-BEwO80EH.d.mts +37 -0
- package/dist/psl-ast-BEwO80EH.d.mts.map +1 -0
- package/dist/psl-ast-Chgi8e4o-rSlBk1UV.d.mts +259 -0
- package/dist/psl-ast-Chgi8e4o-rSlBk1UV.d.mts.map +1 -0
- package/dist/psl-ast-DUCvVXbB.mjs +239 -0
- package/dist/psl-ast-DUCvVXbB.mjs.map +1 -0
- package/dist/psl-parser.d.mts +158 -0
- package/dist/psl-parser.d.mts.map +1 -0
- package/dist/psl-parser.mjs +804 -0
- package/dist/psl-parser.mjs.map +1 -0
- package/dist/psl-parser__format.d.mts +12 -0
- package/dist/psl-parser__format.d.mts.map +1 -0
- package/dist/psl-parser__format.mjs +464 -0
- package/dist/psl-parser__format.mjs.map +1 -0
- package/dist/psl-parser__interpret.d.mts +40 -0
- package/dist/psl-parser__interpret.d.mts.map +1 -0
- package/dist/psl-parser__interpret.mjs +25 -0
- package/dist/psl-parser__interpret.mjs.map +1 -0
- package/dist/psl-parser__syntax.d.mts +31 -0
- package/dist/psl-parser__syntax.d.mts.map +1 -0
- package/dist/psl-parser__syntax.mjs +43 -0
- package/dist/psl-parser__syntax.mjs.map +1 -0
- package/dist/psl-parser__tokenizer.d.mts +2 -0
- package/dist/psl-parser__tokenizer.mjs +2 -0
- package/dist/psl-printer.d.mts +37 -0
- package/dist/psl-printer.d.mts.map +1 -0
- package/dist/psl-printer.mjs +393 -0
- package/dist/psl-printer.mjs.map +1 -0
- package/dist/redact-db-url-BlaloOwt.d.mts +22 -0
- package/dist/redact-db-url-BlaloOwt.d.mts.map +1 -0
- package/dist/redact-db-url-CRWJWdB1.mjs +26 -0
- package/dist/redact-db-url-CRWJWdB1.mjs.map +1 -0
- package/dist/resolve-codec-BZF8TZh_-D-xORT9Q.mjs +59 -0
- package/dist/resolve-codec-BZF8TZh_-D-xORT9Q.mjs.map +1 -0
- package/dist/resolve-domain-model-BVSb5wS5-C6Yq0dsD.d.mts +17 -0
- package/dist/resolve-domain-model-BVSb5wS5-C6Yq0dsD.d.mts.map +1 -0
- package/dist/resolve-domain-model-BovPAsW2-8rwyzjxp.mjs +20 -0
- package/dist/resolve-domain-model-BovPAsW2-8rwyzjxp.mjs.map +1 -0
- package/dist/result-Bpupv5vO.d.mts +54 -0
- package/dist/result-Bpupv5vO.d.mts.map +1 -0
- package/dist/result-CBZ8X9mU.mjs +92 -0
- package/dist/result-CBZ8X9mU.mjs.map +1 -0
- package/dist/runtime--RZXG1zP.d.mts +901 -0
- package/dist/runtime--RZXG1zP.d.mts.map +1 -0
- package/dist/runtime-DYTFHGwh.mjs +516 -0
- package/dist/runtime-DYTFHGwh.mjs.map +1 -0
- package/dist/runtime-error-BA9d7XjZ-BlT8t6LB.mjs +40 -0
- package/dist/runtime-error-BA9d7XjZ-BlT8t6LB.mjs.map +1 -0
- package/dist/simplify-deep-Dw9I_ZUl.d.mts +6 -0
- package/dist/simplify-deep-Dw9I_ZUl.d.mts.map +1 -0
- package/dist/structured-error-BVmv2aPB.d.mts +34 -0
- package/dist/structured-error-BVmv2aPB.d.mts.map +1 -0
- package/dist/structured-error-H6WU9Kjt.mjs +31 -0
- package/dist/structured-error-H6WU9Kjt.mjs.map +1 -0
- package/dist/symbol-table-CZ7EVCTL-oYQtrmzq.d.mts +125 -0
- package/dist/symbol-table-CZ7EVCTL-oYQtrmzq.d.mts.map +1 -0
- package/dist/tokenizer-1hAHZzmp-QGPORvmA.mjs +228 -0
- package/dist/tokenizer-1hAHZzmp-QGPORvmA.mjs.map +1 -0
- package/dist/tokenizer-DcYI0Xrq-C-nNE9mE.d.mts +16 -0
- package/dist/tokenizer-DcYI0Xrq-C-nNE9mE.d.mts.map +1 -0
- package/dist/ts-render.d.mts +2 -0
- package/dist/ts-render.mjs +240 -0
- package/dist/ts-render.mjs.map +1 -0
- package/dist/types-ByeQhU9p.d.mts +17 -0
- package/dist/types-ByeQhU9p.d.mts.map +1 -0
- package/dist/types-DGxlljKG.d.mts +7 -0
- package/dist/types-DGxlljKG.d.mts.map +1 -0
- package/dist/types-DgdgskBY.mjs +96 -0
- package/dist/types-DgdgskBY.mjs.map +1 -0
- package/dist/types-import-spec-DRKzrJ20-WYwyCtil.d.mts +14 -0
- package/dist/types-import-spec-DRKzrJ20-WYwyCtil.d.mts.map +1 -0
- package/dist/utils-DMAM0unR.mjs +20 -0
- package/dist/utils-DMAM0unR.mjs.map +1 -0
- package/dist/utils-DeWL_zD9.d.mts +11 -0
- package/dist/utils-DeWL_zD9.d.mts.map +1 -0
- package/dist/utils.d.mts +16 -0
- package/dist/utils.mjs +13 -0
- package/dist/utils__abortable.d.mts +2 -0
- package/dist/utils__abortable.mjs +2 -0
- package/dist/utils__array-equal.d.mts +2 -0
- package/dist/utils__array-equal.mjs +2 -0
- package/dist/utils__assertions.d.mts +2 -0
- package/dist/utils__assertions.mjs +2 -0
- package/dist/utils__canonical-stringify.d.mts +2 -0
- package/dist/utils__canonical-stringify.mjs +2 -0
- package/dist/utils__casts.d.mts +2 -0
- package/dist/utils__casts.mjs +2 -0
- package/dist/utils__defined.d.mts +2 -0
- package/dist/utils__defined.mjs +2 -0
- package/dist/utils__hash-content.d.mts +2 -0
- package/dist/utils__hash-content.mjs +2 -0
- package/dist/utils__internal-error.d.mts +2 -0
- package/dist/utils__internal-error.mjs +2 -0
- package/dist/utils__json.d.mts +2 -0
- package/dist/utils__json.mjs +1 -0
- package/dist/utils__promise.d.mts +2 -0
- package/dist/utils__promise.mjs +2 -0
- package/dist/utils__redact-db-url.d.mts +2 -0
- package/dist/utils__redact-db-url.mjs +2 -0
- package/dist/utils__result.d.mts +2 -0
- package/dist/utils__result.mjs +2 -0
- package/dist/utils__simplify-deep.d.mts +2 -0
- package/dist/utils__simplify-deep.mjs +1 -0
- package/dist/utils__structured-error.d.mts +2 -0
- package/dist/utils__structured-error.mjs +2 -0
- package/dist/utils__types.d.mts +2 -0
- package/dist/utils__types.mjs +1 -0
- package/dist/validate-domain-BNBs-TVv.d.mts +22 -0
- package/dist/validate-domain-BNBs-TVv.d.mts.map +1 -0
- package/dist/validate-domain-BkvFlY3B.mjs +143 -0
- package/dist/validate-domain-BkvFlY3B.mjs.map +1 -0
- package/package.json +114 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"psl-printer.mjs","names":[],"sources":["../../../../1-framework/2-authoring/psl-printer/dist/index.mjs"],"sourcesContent":["import { ifDefined } from \"@internal/utils/defined\";\nimport { UNSPECIFIED_PSL_NAMESPACE_ID, flatPslModels, namespacePslExtensionBlocks } from \"@internal/framework-components/psl-ast\";\nimport { isAuthoringPslBlockDescriptor } from \"@internal/framework-components/authoring\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/contract-errors.ts\nfunction contractError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/serialize-print-document.ts\n/**\n* Indent unit used for PSL block bodies and namespace nesting.\n*/\nconst PSL_INDENT_UNIT = \" \";\nfunction buildPslBlockDispatchMap(namespace) {\n\tconst byKeyword = /* @__PURE__ */ new Map();\n\tif (namespace) collectBlockDescriptors(namespace, byKeyword);\n\treturn { byKeyword };\n}\nfunction collectBlockDescriptors(namespace, byKeyword) {\n\tfor (const value of Object.values(namespace)) {\n\t\tif (isAuthoringPslBlockDescriptor(value)) {\n\t\t\tbyKeyword.set(value.keyword, value);\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof value === \"object\" && value !== null && !Array.isArray(value)) collectBlockDescriptors(value, byKeyword);\n\t}\n}\nfunction escapePslString(value) {\n\treturn value.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\").replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\\\\r\");\n}\nfunction serializePrintDocument(doc, options = {}) {\n\tconst sections = [];\n\tsections.push(doc.headerComment);\n\tconst namedTypeEntries = [...doc.namedTypes].sort((a, b) => a.name.localeCompare(b.name));\n\tif (namedTypeEntries.length > 0) sections.push(serializeTypesBlock(namedTypeEntries));\n\tconst blockDispatchMap = buildPslBlockDispatchMap(options.pslBlockDescriptors);\n\tfor (const namespace of doc.namespaces) {\n\t\tconst namespaceSections = serializeNamespaceContents(namespace, blockDispatchMap, options.codecLookup);\n\t\tif (namespaceSections.length === 0) continue;\n\t\tif (namespace.name === UNSPECIFIED_PSL_NAMESPACE_ID) sections.push(...namespaceSections);\n\t\telse sections.push(wrapNamespaceBlock(namespace.name, namespaceSections));\n\t}\n\treturn `${sections.join(\"\\n\\n\")}\\n`;\n}\nfunction serializeNamespaceContents(namespace, blockDispatchMap, codecLookup) {\n\tconst sections = [];\n\tfor (const model of namespace.models) sections.push(serializeModel(model));\n\tfor (const extensionBlock of namespace.extensionBlocks) sections.push(serializeExtensionBlock(extensionBlock, blockDispatchMap, codecLookup));\n\treturn sections;\n}\nfunction serializeExtensionBlock(extensionBlock, blockDispatchMap, codecLookup) {\n\tconst descriptor = blockDispatchMap.byKeyword.get(extensionBlock.keyword);\n\tif (!descriptor) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `No pslBlockDescriptors contribution registered for extension-contributed block keyword \"${extensionBlock.keyword}\". Provide a matching pslBlockDescriptors contribution to serializePrintDocument, or remove the block from the input AST.`, { meta: {\n\t\treason: \"block-descriptor-missing\",\n\t\tkeyword: extensionBlock.keyword\n\t} });\n\tif (descriptor.discriminator !== extensionBlock.kind) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `The pslBlockDescriptors contribution for keyword \"${extensionBlock.keyword}\" owns discriminator \"${descriptor.discriminator}\", but the block carries kind \"${extensionBlock.kind}\". Provide a matching pslBlockDescriptors contribution to serializePrintDocument, or remove the block from the input AST.`, { meta: {\n\t\treason: \"block-descriptor-kind-mismatch\",\n\t\tkeyword: extensionBlock.keyword,\n\t\tdescriptorDiscriminator: descriptor.discriminator,\n\t\tblockKind: extensionBlock.kind\n\t} });\n\tconst lines = [`${extensionBlock.keyword} ${extensionBlock.name} {`];\n\tfor (const [paramName, paramDescriptor] of Object.entries(descriptor.parameters)) {\n\t\tconst paramValue = extensionBlock.parameters[paramName];\n\t\tif (paramValue === void 0) continue;\n\t\tconst rendered = renderParamValue(paramValue, paramDescriptor, codecLookup, paramName);\n\t\tlines.push(`${PSL_INDENT_UNIT}${paramName} = ${rendered}`);\n\t}\n\tif (descriptor.variadicParameters) for (const [paramName, paramValue] of Object.entries(extensionBlock.parameters)) {\n\t\tif (Object.hasOwn(descriptor.parameters, paramName)) continue;\n\t\tlines.push(`${PSL_INDENT_UNIT}${renderVariadicParam(paramName, paramValue)}`);\n\t}\n\tfor (const attr of extensionBlock.blockAttributes ?? []) {\n\t\tconst args = attr.args.map((arg) => arg.value).join(\", \");\n\t\tlines.push(`${PSL_INDENT_UNIT}@@${attr.name}${args.length > 0 ? `(${args})` : \"\"}`);\n\t}\n\tlines.push(\"}\");\n\treturn lines.join(\"\\n\");\n}\n/**\n* Renders one undeclared parameter of a `variadicParameters` block (e.g. a\n* `native_enum` member line). Variadic entries have no per-parameter\n* descriptor, so there is no codec to round-trip a `value` through — the raw\n* PSL literal is emitted verbatim. A `bare` entry is just its key.\n*/\nfunction renderVariadicParam(paramName, paramValue) {\n\tif (paramValue.kind === \"bare\") return paramName;\n\treturn `${paramName} = ${renderVariadicValue(paramValue)}`;\n}\nfunction renderVariadicValue(paramValue) {\n\tswitch (paramValue.kind) {\n\t\tcase \"bare\": return \"\";\n\t\tcase \"value\": return paramValue.raw;\n\t\tcase \"ref\": return paramValue.identifier;\n\t\tcase \"option\": return paramValue.token;\n\t\tcase \"list\": return `[${paramValue.items.map(renderVariadicValue).join(\", \")}]`;\n\t}\n}\nfunction renderParamValue(paramValue, descriptor, codecLookup, paramName) {\n\tswitch (descriptor.kind) {\n\t\tcase \"ref\":\n\t\t\tif (paramValue.kind !== \"ref\") throw paramKindMismatchError(paramName, \"ref\", paramValue.kind);\n\t\t\treturn paramValue.identifier;\n\t\tcase \"value\":\n\t\t\tif (paramValue.kind !== \"value\") throw paramKindMismatchError(paramName, \"value\", paramValue.kind);\n\t\t\treturn renderValueParam(paramValue.raw, descriptor.codecId, codecLookup, paramName);\n\t\tcase \"option\":\n\t\t\tif (paramValue.kind !== \"option\") throw paramKindMismatchError(paramName, \"option\", paramValue.kind);\n\t\t\treturn paramValue.token;\n\t\tcase \"list\":\n\t\t\tif (paramValue.kind !== \"list\") throw paramKindMismatchError(paramName, \"list\", paramValue.kind);\n\t\t\treturn `[${paramValue.items.map((item) => renderParamValue(item, descriptor.of, codecLookup, paramName)).join(\", \")}]`;\n\t}\n}\nfunction paramKindMismatchError(paramName, descriptorKind, valueKind) {\n\treturn contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Extension block parameter \"${paramName}\": descriptor is \"${descriptorKind}\" but AST node has kind \"${valueKind}\"`, { meta: {\n\t\treason: \"param-kind-mismatch\",\n\t\tparamName,\n\t\tdescriptorKind,\n\t\tvalueKind\n\t} });\n}\nfunction renderValueParam(raw, codecId, codecLookup, paramName) {\n\tif (!codecLookup) return raw;\n\tconst codec = codecLookup.get(codecId);\n\tif (!codec) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Extension block parameter \"${paramName}\": no codec registered for id \"${codecId}\"`, { meta: {\n\t\treason: \"codec-unregistered\",\n\t\tparamName,\n\t\tcodecId\n\t} });\n\tlet parsedJson;\n\ttry {\n\t\tparsedJson = JSON.parse(raw);\n\t} catch (e) {\n\t\tthrow contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Extension block parameter \"${paramName}\": codec \"${codecId}\" — raw literal is not valid JSON: ${String(e)}`, {\n\t\t\tmeta: {\n\t\t\t\treason: \"raw-literal-invalid-json\",\n\t\t\t\tparamName,\n\t\t\t\tcodecId\n\t\t\t},\n\t\t\tcause: e\n\t\t});\n\t}\n\treturn JSON.stringify(codec.encodeJson(codec.decodeJson(blindCast(parsedJson))));\n}\nfunction wrapNamespaceBlock(name, innerSections) {\n\treturn `namespace ${name} {\\n${innerSections.map((section) => section.split(\"\\n\").map((line) => line.length > 0 ? ` ${line}` : line).join(\"\\n\")).join(\"\\n\\n\")}\\n}`;\n}\nfunction serializeTypesBlock(namedTypes) {\n\tconst lines = [\"types {\"];\n\tfor (const nt of namedTypes) {\n\t\tconst attrStr = nt.attributes.length > 0 ? ` ${nt.attributes.join(\" \")}` : \"\";\n\t\tlines.push(` ${nt.name} = ${nt.baseType}${attrStr}`);\n\t}\n\tlines.push(\"}\");\n\treturn lines.join(\"\\n\");\n}\nfunction serializeModel(model) {\n\tconst lines = [];\n\tif (model.comment) lines.push(model.comment);\n\tlines.push(`model ${model.name} {`);\n\tconst idFields = model.fields.filter((f) => f.isId);\n\tconst scalarFields = model.fields.filter((f) => !f.isId && !f.isRelation);\n\tconst relationFields = model.fields.filter((f) => f.isRelation);\n\tconst allOrderedFields = [\n\t\t...idFields,\n\t\t...scalarFields,\n\t\t...relationFields\n\t];\n\tif (allOrderedFields.length > 0) {\n\t\tconst maxNameLen = Math.max(...allOrderedFields.map((f) => f.name.length));\n\t\tconst maxTypeLen = Math.max(...allOrderedFields.map((f) => formatFieldType(f).length));\n\t\tfor (const field of allOrderedFields) {\n\t\t\tconst typePart = formatFieldType(field);\n\t\t\tconst paddedName = field.name.padEnd(maxNameLen);\n\t\t\tconst paddedType = typePart.padEnd(maxTypeLen);\n\t\t\tif (field.comment) lines.push(` ${field.comment}`);\n\t\t\tconst attrStr = field.attributes.length > 0 ? ` ${field.attributes.join(\" \")}` : \"\";\n\t\t\tlines.push(` ${paddedName} ${paddedType}${attrStr}`.trimEnd());\n\t\t}\n\t}\n\tif (model.modelAttributes.length > 0) {\n\t\tif (allOrderedFields.length > 0) lines.push(\"\");\n\t\tfor (const attr of model.modelAttributes) lines.push(` ${attr}`);\n\t}\n\tlines.push(\"}\");\n\treturn lines.join(\"\\n\");\n}\nfunction formatFieldType(field) {\n\tlet type = field.typeName;\n\tif (field.list) type += \"[]\";\n\telse if (field.optional) type += \"?\";\n\treturn type;\n}\n//#endregion\n//#region src/ast-to-print-document.ts\nconst DEFAULT_AST_PRINT_HEADER = \"// use prisma-next\\n// Contract inferred from the live database schema. Edit as needed, then run `prisma-next contract emit`.\";\nfunction astDocumentToPrintDocument(ast) {\n\tconst allModels = flatPslModels(ast);\n\tconst sortedModels = topologicalSortModels(allModels, buildModelFkDeps(allModels, new Set(allModels.map((m) => m.name))));\n\tconst modelNamespaceIndex = /* @__PURE__ */ new Map();\n\tfor (const namespace of ast.namespaces) for (const model of namespace.models) modelNamespaceIndex.set(model.name, namespace.name);\n\tconst namedTypes = ast.types ? ast.types.declarations.map(namedTypeDeclarationToPrinterNamedType) : [];\n\tconst namespaceSections = ast.namespaces.map((namespace) => {\n\t\tconst printerModels = sortedModels.filter((model) => modelNamespaceIndex.get(model.name) === namespace.name).map((m) => modelToPrinterModel(m));\n\t\treturn {\n\t\t\tname: namespace.name,\n\t\t\tmodels: printerModels,\n\t\t\textensionBlocks: namespacePslExtensionBlocks(namespace)\n\t\t};\n\t});\n\tnamespaceSections.sort((a, b) => {\n\t\tif (a.name === b.name) return 0;\n\t\tif (a.name === UNSPECIFIED_PSL_NAMESPACE_ID) return -1;\n\t\tif (b.name === UNSPECIFIED_PSL_NAMESPACE_ID) return 1;\n\t\treturn a.name.localeCompare(b.name);\n\t});\n\treturn {\n\t\theaderComment: DEFAULT_AST_PRINT_HEADER,\n\t\tnamedTypes,\n\t\tnamespaces: namespaceSections\n\t};\n}\nfunction renderPslAttribute(attr) {\n\tconst prefix = attr.target === \"model\" || attr.target === \"enum\" ? \"@@\" : \"@\";\n\tif (attr.args.length === 0) return `${prefix}${attr.name}`;\n\tconst inner = attr.args.map(renderAttributeArgument).join(\", \");\n\treturn `${prefix}${attr.name}(${inner})`;\n}\nfunction renderAttributeArgument(arg) {\n\tif (arg.kind === \"positional\") return arg.value;\n\treturn `${arg.name}: ${arg.value}`;\n}\nfunction namedTypeDeclarationToPrinterNamedType(decl) {\n\tconst base = decl.baseType ?? (decl.typeConstructor !== void 0 ? formatTypeConstructor(decl.typeConstructor) : \"\");\n\tconst attributes = decl.attributes.map(renderPslAttribute);\n\treturn {\n\t\tname: decl.name,\n\t\tbaseType: base,\n\t\tattributes\n\t};\n}\nfunction formatTypeConstructor(tc) {\n\tconst path = tc.path.join(\".\");\n\tif (tc.args.length === 0) return path;\n\treturn `${path}(${tc.args.map(renderAttributeArgument).join(\", \")})`;\n}\nfunction getPositionalStringArg(attr, index) {\n\tconst raw = attr.args.filter((a) => a.kind === \"positional\")[index]?.value.trim();\n\tif (!raw) return void 0;\n\tconst m = raw.match(/^(['\"])(.*)\\1$/);\n\tif (!m) return void 0;\n\treturn unescapePslString(m[2]);\n}\n/**\n* Inverse of `escapePslString`. The parser stores quoted-literal arguments with\n* their PSL escape sequences (`\\\\`, `\\\"`, `\\n`, `\\r`) intact; when we round-trip\n* a value through `getPositionalStringArg` and re-render via `escapePslString`,\n* we must decode it once on extraction to avoid double-escaping the same\n* sequences on output.\n*/\nfunction unescapePslString(value) {\n\tlet result = \"\";\n\tfor (let i = 0; i < value.length; i++) {\n\t\tif (value.charCodeAt(i) !== 92 || i + 1 >= value.length) {\n\t\t\tresult += value[i];\n\t\t\tcontinue;\n\t\t}\n\t\tconst next = value[i + 1];\n\t\tif (next === \"\\\\\" || next === \"\\\"\" || next === \"'\") result += next;\n\t\telse if (next === \"n\") result += \"\\n\";\n\t\telse if (next === \"r\") result += \"\\r\";\n\t\telse {\n\t\t\tresult += \"\\\\\";\n\t\t\tresult += next;\n\t\t}\n\t\ti++;\n\t}\n\treturn result;\n}\nfunction modelToPrinterModel(model) {\n\tlet mapName;\n\tconst modelAttrStrings = [];\n\tfor (const a of model.attributes) {\n\t\tif (a.name === \"map\" && a.target === \"model\") {\n\t\t\tmapName = getPositionalStringArg(a, 0) ?? mapName;\n\t\t\tcontinue;\n\t\t}\n\t\tmodelAttrStrings.push(renderPslAttribute(a));\n\t}\n\tif (mapName !== void 0) modelAttrStrings.push(`@@map(\"${escapePslString(mapName)}\")`);\n\tconst printerFields = model.fields.map((f) => fieldToPrinterField(f));\n\treturn {\n\t\tname: model.name,\n\t\tmapName,\n\t\tfields: printerFields,\n\t\tmodelAttributes: modelAttrStrings,\n\t\tcomment: model.comment\n\t};\n}\n/**\n* Assembles the qualified type name string for a field type reference.\n*\n* Handles all four forms:\n* - `space:ns.Name` — typeContractSpaceId + typeNamespaceId + typeName\n* - `space:Name` — typeContractSpaceId + typeName (no namespace)\n* - `ns.Name` — typeNamespaceId + typeName (no space); fixes TML-2459 printer gap\n* - `Name` — typeName only (no qualifier)\n*/\nfunction assembleQualifiedTypeName(field) {\n\tconst { typeName, typeNamespaceId, typeContractSpaceId } = field;\n\tconst dotted = typeNamespaceId !== void 0 ? `${typeNamespaceId}.${typeName}` : typeName;\n\treturn typeContractSpaceId !== void 0 ? `${typeContractSpaceId}:${dotted}` : dotted;\n}\nfunction fieldToPrinterField(field) {\n\tconst typeName = field.typeConstructor !== void 0 ? formatTypeConstructor(field.typeConstructor) : assembleQualifiedTypeName(field);\n\tlet mapName;\n\tconst attrStrings = [];\n\tfor (const a of field.attributes) {\n\t\tif (a.name === \"map\" && a.target === \"field\") {\n\t\t\tmapName = getPositionalStringArg(a, 0) ?? mapName;\n\t\t\tcontinue;\n\t\t}\n\t\tattrStrings.push(renderPslAttribute(a));\n\t}\n\tif (mapName !== void 0) attrStrings.push(`@map(\"${escapePslString(mapName)}\")`);\n\tconst isRelation = field.attributes.some((a) => a.name === \"relation\" && a.target === \"field\");\n\tconst isUnsupported = typeName.startsWith(\"Unsupported(\");\n\tconst isId = field.attributes.some((a) => a.name === \"id\" && a.target === \"field\");\n\treturn {\n\t\tname: field.name,\n\t\ttypeName,\n\t\toptional: field.optional,\n\t\tlist: field.list,\n\t\tattributes: attrStrings,\n\t\tmapName,\n\t\tisId,\n\t\tisRelation,\n\t\tisUnsupported,\n\t\tcomment: void 0\n\t};\n}\nfunction buildModelFkDeps(models, modelNames) {\n\tconst deps = /* @__PURE__ */ new Map();\n\tfor (const m of models) deps.set(m.name, /* @__PURE__ */ new Set());\n\tfor (const m of models) for (const field of m.fields) {\n\t\tconst refModel = relationReferencedModel(field, modelNames);\n\t\tif (!refModel || refModel === m.name) continue;\n\t\tif (!hasFullRelation(field)) continue;\n\t\tdeps.get(m.name).add(refModel);\n\t}\n\treturn deps;\n}\nfunction hasFullRelation(field) {\n\tconst rel = field.attributes.find((a) => a.name === \"relation\" && a.target === \"field\");\n\tif (!rel) return false;\n\tconst named = Object.fromEntries(rel.args.filter((a) => a.kind === \"named\").map((a) => [a.name, a.value.trim()]));\n\treturn named[\"fields\"] !== void 0 && named[\"references\"] !== void 0;\n}\nfunction relationReferencedModel(field, modelNames) {\n\tconst raw = field.typeConstructor?.path[0] ?? field.typeName.replace(/\\?$/, \"\").replace(/\\[\\]$/, \"\");\n\tif (raw.length === 0) return;\n\treturn modelNames.has(raw) ? raw : void 0;\n}\nfunction topologicalSortModels(models, deps) {\n\tconst byName = new Map(models.map((m) => [m.name, m]));\n\tconst result = [];\n\tconst visited = /* @__PURE__ */ new Set();\n\tconst visiting = /* @__PURE__ */ new Set();\n\tconst sortedNames = [...deps.keys()].sort();\n\tfunction visit(name) {\n\t\tif (visited.has(name)) return;\n\t\tif (visiting.has(name)) return;\n\t\tvisiting.add(name);\n\t\tconst sortedDeps = [...deps.get(name) ?? /* @__PURE__ */ new Set()].sort();\n\t\tfor (const dep of sortedDeps) visit(dep);\n\t\tvisiting.delete(name);\n\t\tvisited.add(name);\n\t\tconst model = byName.get(name);\n\t\tif (model) result.push(model);\n\t}\n\tfor (const name of sortedNames) visit(name);\n\treturn result;\n}\n//#endregion\n//#region src/print-psl.ts\nfunction printPslFromAst(ast, options = {}) {\n\treturn serializePrintDocument(astDocumentToPrintDocument(ast), {\n\t\t...ifDefined(\"pslBlockDescriptors\", options.pslBlockDescriptors),\n\t\t...ifDefined(\"codecLookup\", options.codecLookup)\n\t});\n}\n//#endregion\nexport { printPslFromAst as printPsl };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;AAMA,SAAS,cAAc,MAAM,SAAS,SAAS;CAC9C,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C;;;;AAMA,MAAM,kBAAkB;AACxB,SAAS,yBAAyB,WAAW;CAC5C,MAAM,4BAA4B,IAAI,IAAI;CAC1C,IAAI,WAAW,wBAAwB,WAAW,SAAS;CAC3D,OAAO,EAAE,UAAU;AACpB;AACA,SAAS,wBAAwB,WAAW,WAAW;CACtD,KAAK,MAAM,SAAS,OAAO,OAAO,SAAS,GAAG;EAC7C,IAAI,8BAA8B,KAAK,GAAG;GACzC,UAAU,IAAI,MAAM,SAAS,KAAK;GAClC;EACD;EACA,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK,GAAG,wBAAwB,OAAO,SAAS;CACnH;AACD;AACA,SAAS,gBAAgB,OAAO;CAC/B,OAAO,MAAM,QAAQ,OAAO,MAAM,CAAC,CAAC,QAAQ,MAAM,MAAM,CAAC,CAAC,QAAQ,OAAO,KAAK,CAAC,CAAC,QAAQ,OAAO,KAAK;AACrG;AACA,SAAS,uBAAuB,KAAK,UAAU,CAAC,GAA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,QAAQ,aAAa,MAAM,IAAI;CAC1C,OAAO;AACR;AAGA,SAAS,gBAAgB,KAAK,UAAU,CAAC,GAAG;CAC3C,OAAO,uBAAuB,2BAA2B,GAAG,GAAG;EAC9D,GAAG,UAAU,uBAAuB,QAAQ,mBAAmB;EAC/D,GAAG,UAAU,eAAe,QAAQ,WAAW;CAChD,CAAC;AACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region ../../../1-framework/0-foundation/utils/dist/redact-db-url.d.mts
|
|
2
|
+
//#region src/redact-db-url.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Minimal metadata extracted from a database URL for logging or error output.
|
|
5
|
+
* Sensitive fields (password, full URL) are never returned.
|
|
6
|
+
*/
|
|
7
|
+
interface RedactedDatabaseUrl {
|
|
8
|
+
readonly host?: string;
|
|
9
|
+
readonly port?: string;
|
|
10
|
+
readonly database?: string;
|
|
11
|
+
readonly username?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Redacts a database connection URL to a minimal metadata object.
|
|
15
|
+
*
|
|
16
|
+
* Parsing errors are ignored and result in an empty object so callers never
|
|
17
|
+
* leak raw URLs when the input is malformed.
|
|
18
|
+
*/
|
|
19
|
+
declare function redactDatabaseUrl(url: string): RedactedDatabaseUrl;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { redactDatabaseUrl as n, RedactedDatabaseUrl as t };
|
|
22
|
+
//# sourceMappingURL=redact-db-url-BlaloOwt.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact-db-url-BlaloOwt.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/utils/dist/redact-db-url.d.mts"],"mappings":";;;;;;UAKU;WACC;WACA;WACA;WACA;;;;;;;;iBAQM,kBAAkB,cAAc"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { t as ifDefined } from "./defined-BQWA85QH-BRSBMULx.mjs";
|
|
2
|
+
//#region ../../../1-framework/0-foundation/utils/dist/redact-db-url.mjs
|
|
3
|
+
/**
|
|
4
|
+
* Redacts a database connection URL to a minimal metadata object.
|
|
5
|
+
*
|
|
6
|
+
* Parsing errors are ignored and result in an empty object so callers never
|
|
7
|
+
* leak raw URLs when the input is malformed.
|
|
8
|
+
*/
|
|
9
|
+
function redactDatabaseUrl(url) {
|
|
10
|
+
try {
|
|
11
|
+
const parsed = new URL(url);
|
|
12
|
+
const database = parsed.pathname?.replace(/^\//, "") || void 0;
|
|
13
|
+
return {
|
|
14
|
+
...ifDefined("host", parsed.hostname || void 0),
|
|
15
|
+
...ifDefined("port", parsed.port || void 0),
|
|
16
|
+
...ifDefined("database", database),
|
|
17
|
+
...ifDefined("username", parsed.username || void 0)
|
|
18
|
+
};
|
|
19
|
+
} catch {
|
|
20
|
+
return {};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { redactDatabaseUrl as t };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=redact-db-url-CRWJWdB1.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact-db-url-CRWJWdB1.mjs","names":[],"sources":["../../../../1-framework/0-foundation/utils/dist/redact-db-url.mjs"],"sourcesContent":["import { t as ifDefined } from \"./defined-BQWA85QH.mjs\";\n//#region src/redact-db-url.ts\n/**\n* Redacts a database connection URL to a minimal metadata object.\n*\n* Parsing errors are ignored and result in an empty object so callers never\n* leak raw URLs when the input is malformed.\n*/\nfunction redactDatabaseUrl(url) {\n\ttry {\n\t\tconst parsed = new URL(url);\n\t\tconst database = parsed.pathname?.replace(/^\\//, \"\") || void 0;\n\t\treturn {\n\t\t\t...ifDefined(\"host\", parsed.hostname || void 0),\n\t\t\t...ifDefined(\"port\", parsed.port || void 0),\n\t\t\t...ifDefined(\"database\", database),\n\t\t\t...ifDefined(\"username\", parsed.username || void 0)\n\t\t};\n\t} catch {\n\t\treturn {};\n\t}\n}\n//#endregion\nexport { redactDatabaseUrl };\n\n//# sourceMappingURL=redact-db-url.mjs.map"],"mappings":";;;;;;;;AAQA,SAAS,kBAAkB,KAAK;CAC/B,IAAI;EACH,MAAM,SAAS,IAAI,IAAI,GAAG;EAC1B,MAAM,WAAW,OAAO,UAAU,QAAQ,OAAO,EAAE,KAAK,KAAK;EAC7D,OAAO;GACN,GAAG,UAAU,QAAQ,OAAO,YAAY,KAAK,CAAC;GAC9C,GAAG,UAAU,QAAQ,OAAO,QAAQ,KAAK,CAAC;GAC1C,GAAG,UAAU,YAAY,QAAQ;GACjC,GAAG,UAAU,YAAY,OAAO,YAAY,KAAK,CAAC;EACnD;CACD,QAAQ;EACP,OAAO,CAAC;CACT;AACD"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { t as blindCast } from "./casts-DpaahrlC-Bd5n2coI.mjs";
|
|
2
|
+
import { n as runtimeError } from "./runtime-error-BA9d7XjZ-BlT8t6LB.mjs";
|
|
3
|
+
//#region ../../../1-framework/1-core/framework-components/dist/resolve-codec-BZF8TZh_.mjs
|
|
4
|
+
const CONTRACT_CODEC_DESCRIPTOR_MISSING = "CONTRACT.CODEC_DESCRIPTOR_MISSING";
|
|
5
|
+
/**
|
|
6
|
+
* Look up a descriptor for `ref.codecId` using `descriptorFor`; throw
|
|
7
|
+
* `code` if none is found. Each plane names its own error path: the control
|
|
8
|
+
* plane resolves contract-stack descriptors (`CONTRACT.*`), the execution
|
|
9
|
+
* plane resolves at query time (`RUNTIME.*`).
|
|
10
|
+
*/
|
|
11
|
+
function resolveCodecDescriptorOrThrow(descriptorFor, ref, code) {
|
|
12
|
+
const descriptor = descriptorFor(ref.codecId);
|
|
13
|
+
if (!descriptor) throw runtimeError(code, `No codec descriptor registered for codecId '${ref.codecId}'.`, { codecId: ref.codecId });
|
|
14
|
+
return descriptor;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Validates `ref.typeParams` against `descriptor.paramsSchema`.
|
|
18
|
+
*
|
|
19
|
+
* Parameterized codecs that omit `typeParams` have it normalized to `{}` before
|
|
20
|
+
* validation (mirrors `ast-codec-resolver.ts` semantics). Throws
|
|
21
|
+
* `RUNTIME.TYPE_PARAMS_INVALID` when the validator returns a `Promise` or
|
|
22
|
+
* reports issues.
|
|
23
|
+
*/
|
|
24
|
+
function validateCodecTypeParams(descriptor, ref) {
|
|
25
|
+
const normalized = descriptor.isParameterized && ref.typeParams === void 0 ? {
|
|
26
|
+
...ref,
|
|
27
|
+
typeParams: {}
|
|
28
|
+
} : ref;
|
|
29
|
+
const result = blindCast(descriptor.paramsSchema["~standard"].validate(normalized.typeParams));
|
|
30
|
+
if (result instanceof Promise) throw runtimeError("RUNTIME.TYPE_PARAMS_INVALID", `paramsSchema for codec '${ref.codecId}' returned a Promise; runtime validation requires a synchronous Standard Schema validator.`, {
|
|
31
|
+
codecId: ref.codecId,
|
|
32
|
+
typeParams: ref.typeParams
|
|
33
|
+
});
|
|
34
|
+
if ("issues" in result && result.issues) {
|
|
35
|
+
const messages = result.issues.map((issue) => issue.message).join("; ");
|
|
36
|
+
throw runtimeError("RUNTIME.TYPE_PARAMS_INVALID", `Invalid typeParams for codec '${ref.codecId}': ${messages}`, {
|
|
37
|
+
codecId: ref.codecId,
|
|
38
|
+
typeParams: ref.typeParams
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return blindCast(result).value;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Resolves a `Codec` instance: validates `ref.typeParams` via
|
|
45
|
+
* {@link validateCodecTypeParams} then calls `descriptor.factory(validated)(ctx)`.
|
|
46
|
+
*
|
|
47
|
+
* The descriptor's `factory` is typed against its own `P`; the registry erases
|
|
48
|
+
* `P` to `any`, so the factory is narrowed to `(params: unknown) => (ctx) => Codec`
|
|
49
|
+
* at the call boundary. The `paramsSchema` validates the input above before we
|
|
50
|
+
* forward it, so the narrowing is safe by construction.
|
|
51
|
+
*/
|
|
52
|
+
function materializeCodec(descriptor, ref, ctx) {
|
|
53
|
+
const validated = validateCodecTypeParams(descriptor, ref);
|
|
54
|
+
return blindCast(descriptor.factory)(validated)(ctx);
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { validateCodecTypeParams as i, materializeCodec as n, resolveCodecDescriptorOrThrow as r, CONTRACT_CODEC_DESCRIPTOR_MISSING as t };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=resolve-codec-BZF8TZh_-D-xORT9Q.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-codec-BZF8TZh_-D-xORT9Q.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/resolve-codec-BZF8TZh_.mjs"],"sourcesContent":["import { n as runtimeError } from \"./runtime-error-BA9d7XjZ.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/shared/resolve-codec.ts\nconst CONTRACT_CODEC_DESCRIPTOR_MISSING = \"CONTRACT.CODEC_DESCRIPTOR_MISSING\";\n/**\n* Look up a descriptor for `ref.codecId` using `descriptorFor`; throw\n* `code` if none is found. Each plane names its own error path: the control\n* plane resolves contract-stack descriptors (`CONTRACT.*`), the execution\n* plane resolves at query time (`RUNTIME.*`).\n*/\nfunction resolveCodecDescriptorOrThrow(descriptorFor, ref, code) {\n\tconst descriptor = descriptorFor(ref.codecId);\n\tif (!descriptor) throw runtimeError(code, `No codec descriptor registered for codecId '${ref.codecId}'.`, { codecId: ref.codecId });\n\treturn descriptor;\n}\n/**\n* Validates `ref.typeParams` against `descriptor.paramsSchema`.\n*\n* Parameterized codecs that omit `typeParams` have it normalized to `{}` before\n* validation (mirrors `ast-codec-resolver.ts` semantics). Throws\n* `RUNTIME.TYPE_PARAMS_INVALID` when the validator returns a `Promise` or\n* reports issues.\n*/\nfunction validateCodecTypeParams(descriptor, ref) {\n\tconst normalized = descriptor.isParameterized && ref.typeParams === void 0 ? {\n\t\t...ref,\n\t\ttypeParams: {}\n\t} : ref;\n\tconst result = blindCast(descriptor.paramsSchema[\"~standard\"].validate(normalized.typeParams));\n\tif (result instanceof Promise) throw runtimeError(\"RUNTIME.TYPE_PARAMS_INVALID\", `paramsSchema for codec '${ref.codecId}' returned a Promise; runtime validation requires a synchronous Standard Schema validator.`, {\n\t\tcodecId: ref.codecId,\n\t\ttypeParams: ref.typeParams\n\t});\n\tif (\"issues\" in result && result.issues) {\n\t\tconst messages = result.issues.map((issue) => issue.message).join(\"; \");\n\t\tthrow runtimeError(\"RUNTIME.TYPE_PARAMS_INVALID\", `Invalid typeParams for codec '${ref.codecId}': ${messages}`, {\n\t\t\tcodecId: ref.codecId,\n\t\t\ttypeParams: ref.typeParams\n\t\t});\n\t}\n\treturn blindCast(result).value;\n}\n/**\n* Resolves a `Codec` instance: validates `ref.typeParams` via\n* {@link validateCodecTypeParams} then calls `descriptor.factory(validated)(ctx)`.\n*\n* The descriptor's `factory` is typed against its own `P`; the registry erases\n* `P` to `any`, so the factory is narrowed to `(params: unknown) => (ctx) => Codec`\n* at the call boundary. The `paramsSchema` validates the input above before we\n* forward it, so the narrowing is safe by construction.\n*/\nfunction materializeCodec(descriptor, ref, ctx) {\n\tconst validated = validateCodecTypeParams(descriptor, ref);\n\treturn blindCast(descriptor.factory)(validated)(ctx);\n}\n//#endregion\nexport { validateCodecTypeParams as i, materializeCodec as n, resolveCodecDescriptorOrThrow as r, CONTRACT_CODEC_DESCRIPTOR_MISSING as t };\n\n//# sourceMappingURL=resolve-codec-BZF8TZh_.mjs.map"],"mappings":";;;AAGA,MAAM,oCAAoC;;;;;;;AAO1C,SAAS,8BAA8B,eAAe,KAAK,MAAM;CAChE,MAAM,aAAa,cAAc,IAAI,OAAO;CAC5C,IAAI,CAAC,YAAY,MAAM,aAAa,MAAM,+CAA+C,IAAI,QAAQ,KAAK,EAAE,SAAS,IAAI,QAAQ,CAAC;CAClI,OAAO;AACR;;;;;;;;;AASA,SAAS,wBAAwB,YAAY,KAAK;CACjD,MAAM,aAAa,WAAW,mBAAmB,IAAI,eAAe,KAAK,IAAI;EAC5E,GAAG;EACH,YAAY,CAAC;CACd,IAAI;CACJ,MAAM,SAAS,UAAU,WAAW,aAAa,YAAY,CAAC,SAAS,WAAW,UAAU,CAAC;CAC7F,IAAI,kBAAkB,SAAS,MAAM,aAAa,+BAA+B,2BAA2B,IAAI,QAAQ,6FAA6F;EACpN,SAAS,IAAI;EACb,YAAY,IAAI;CACjB,CAAC;CACD,IAAI,YAAY,UAAU,OAAO,QAAQ;EACxC,MAAM,WAAW,OAAO,OAAO,KAAK,UAAU,MAAM,OAAO,CAAC,CAAC,KAAK,IAAI;EACtE,MAAM,aAAa,+BAA+B,iCAAiC,IAAI,QAAQ,KAAK,YAAY;GAC/G,SAAS,IAAI;GACb,YAAY,IAAI;EACjB,CAAC;CACF;CACA,OAAO,UAAU,MAAM,CAAC,CAAC;AAC1B;;;;;;;;;;AAUA,SAAS,iBAAiB,YAAY,KAAK,KAAK;CAC/C,MAAM,YAAY,wBAAwB,YAAY,GAAG;CACzD,OAAO,UAAU,WAAW,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,GAAG;AACpD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { g as ContractModelBase, n as ApplicationDomain } from "./domain-envelope-D6Wn9AmZ-BqZKTT9U.mjs";
|
|
2
|
+
//#region ../../../1-framework/0-foundation/contract/dist/resolve-domain-model-BVSb5wS5.d.mts
|
|
3
|
+
//#region src/resolve-domain-model.d.ts
|
|
4
|
+
interface ResolvedDomainModel {
|
|
5
|
+
readonly namespaceId: string;
|
|
6
|
+
readonly model: ContractModelBase;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Resolve a bare domain model name to its namespace coordinate and model IR by
|
|
10
|
+
* scanning the contract's namespaces. For the single-namespace contracts in
|
|
11
|
+
* scope the scan is exact; cross-namespace bare-name collisions are selected
|
|
12
|
+
* explicitly (TML-2550).
|
|
13
|
+
*/
|
|
14
|
+
declare function resolveDomainModel(domain: ApplicationDomain, modelName: string): ResolvedDomainModel | undefined;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { resolveDomainModel as n, ResolvedDomainModel as t };
|
|
17
|
+
//# sourceMappingURL=resolve-domain-model-BVSb5wS5-C6Yq0dsD.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-domain-model-BVSb5wS5-C6Yq0dsD.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/resolve-domain-model-BVSb5wS5.d.mts"],"mappings":";;;UAEU;WACC;WACA,OAAO;;;;;;;;iBAQD,mBAAmB,QAAQ,mBAAmB,oBAAoB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region ../../../1-framework/0-foundation/contract/dist/resolve-domain-model-BovPAsW2.mjs
|
|
2
|
+
/**
|
|
3
|
+
* Resolve a bare domain model name to its namespace coordinate and model IR by
|
|
4
|
+
* scanning the contract's namespaces. For the single-namespace contracts in
|
|
5
|
+
* scope the scan is exact; cross-namespace bare-name collisions are selected
|
|
6
|
+
* explicitly (TML-2550).
|
|
7
|
+
*/
|
|
8
|
+
function resolveDomainModel(domain, modelName) {
|
|
9
|
+
for (const namespaceId of Object.keys(domain.namespaces)) {
|
|
10
|
+
const model = domain.namespaces[namespaceId]?.models[modelName];
|
|
11
|
+
if (model !== void 0) return {
|
|
12
|
+
namespaceId,
|
|
13
|
+
model
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { resolveDomainModel as t };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=resolve-domain-model-BovPAsW2-8rwyzjxp.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-domain-model-BovPAsW2-8rwyzjxp.mjs","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/resolve-domain-model-BovPAsW2.mjs"],"sourcesContent":["//#region src/resolve-domain-model.ts\n/**\n* Resolve a bare domain model name to its namespace coordinate and model IR by\n* scanning the contract's namespaces. For the single-namespace contracts in\n* scope the scan is exact; cross-namespace bare-name collisions are selected\n* explicitly (TML-2550).\n*/\nfunction resolveDomainModel(domain, modelName) {\n\tfor (const namespaceId of Object.keys(domain.namespaces)) {\n\t\tconst model = domain.namespaces[namespaceId]?.models[modelName];\n\t\tif (model !== void 0) return {\n\t\t\tnamespaceId,\n\t\t\tmodel\n\t\t};\n\t}\n}\n//#endregion\nexport { resolveDomainModel as t };\n\n//# sourceMappingURL=resolve-domain-model-BovPAsW2.mjs.map"],"mappings":";;;;;;;AAOA,SAAS,mBAAmB,QAAQ,WAAW;CAC9C,KAAK,MAAM,eAAe,OAAO,KAAK,OAAO,UAAU,GAAG;EACzD,MAAM,QAAQ,OAAO,WAAW,YAAY,EAAE,OAAO;EACrD,IAAI,UAAU,KAAK,GAAG,OAAO;GAC5B;GACA;EACD;CACD;AACD"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
//#region ../../../1-framework/0-foundation/utils/dist/result.d.mts
|
|
2
|
+
//#region src/result.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Generic Result type for representing success or failure outcomes.
|
|
5
|
+
*
|
|
6
|
+
* This is the standard way to return "expected failures" as values rather than
|
|
7
|
+
* throwing exceptions. See docs/Error Handling.md for the full taxonomy.
|
|
8
|
+
*
|
|
9
|
+
* Naming rationale:
|
|
10
|
+
* - `Ok<T>` / `NotOk<F>` mirror the `ok: true/false` discriminator
|
|
11
|
+
* - `NotOk` avoids collision with domain types like "Failure" or "Error"
|
|
12
|
+
* - `failure` property distinguishes from JS Error semantics
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Represents a successful result containing a value.
|
|
16
|
+
*/
|
|
17
|
+
interface Ok<T> {
|
|
18
|
+
readonly ok: true;
|
|
19
|
+
readonly value: T;
|
|
20
|
+
assertOk(): T;
|
|
21
|
+
assertNotOk(): never;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Represents an unsuccessful result containing failure details.
|
|
25
|
+
*/
|
|
26
|
+
interface NotOk<F> {
|
|
27
|
+
readonly ok: false;
|
|
28
|
+
readonly failure: F;
|
|
29
|
+
assertOk(): never;
|
|
30
|
+
assertNotOk(): F;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A discriminated union representing either success (Ok) or failure (NotOk).
|
|
34
|
+
*
|
|
35
|
+
* @typeParam T - The success value type
|
|
36
|
+
* @typeParam F - The failure details type
|
|
37
|
+
*/
|
|
38
|
+
type Result<T, F> = Ok<T> | NotOk<F>;
|
|
39
|
+
/**
|
|
40
|
+
* Creates a successful result.
|
|
41
|
+
*/
|
|
42
|
+
declare function ok<T>(value: T): Ok<T>;
|
|
43
|
+
/**
|
|
44
|
+
* Creates an unsuccessful result.
|
|
45
|
+
*/
|
|
46
|
+
declare function notOk<F>(failure: F): NotOk<F>;
|
|
47
|
+
/**
|
|
48
|
+
* Returns a successful void result.
|
|
49
|
+
* Use this for validation checks that don't produce a value.
|
|
50
|
+
*/
|
|
51
|
+
declare function okVoid(): Ok<void>;
|
|
52
|
+
//#endregion
|
|
53
|
+
export { ok as a, notOk as i, Ok as n, okVoid as o, Result as r, NotOk as t };
|
|
54
|
+
//# sourceMappingURL=result-Bpupv5vO.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result-Bpupv5vO.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/utils/dist/result.d.mts"],"mappings":";;;;;;;;;;;;;;;;UAeU,GAAG;WACF;WACA,OAAO;EAChB,YAAY;EACZ;;;;;UAKQ,MAAM;WACL;WACA,SAAS;EAClB;EACA,eAAe;;;;;;;;KAQZ,OAAO,GAAG,KAAK,GAAG,KAAK,MAAM;;;;iBAIjB,GAAG,GAAG,OAAO,IAAI,GAAG;;;;iBAIpB,MAAM,GAAG,SAAS,IAAI,MAAM;;;;;iBAK5B,UAAU"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { t as blindCast } from "./casts-DpaahrlC-Bd5n2coI.mjs";
|
|
2
|
+
import { t as InternalError } from "./internal-error-BIc-ehme-ouBQPoEL.mjs";
|
|
3
|
+
//#region ../../../1-framework/0-foundation/utils/dist/result.mjs
|
|
4
|
+
/**
|
|
5
|
+
* Generic Result type for representing success or failure outcomes.
|
|
6
|
+
*
|
|
7
|
+
* This is the standard way to return "expected failures" as values rather than
|
|
8
|
+
* throwing exceptions. See docs/Error Handling.md for the full taxonomy.
|
|
9
|
+
*
|
|
10
|
+
* Naming rationale:
|
|
11
|
+
* - `Ok<T>` / `NotOk<F>` mirror the `ok: true/false` discriminator
|
|
12
|
+
* - `NotOk` avoids collision with domain types like "Failure" or "Error"
|
|
13
|
+
* - `failure` property distinguishes from JS Error semantics
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Result class that implements both Ok and NotOk variants.
|
|
17
|
+
*/
|
|
18
|
+
var ResultImpl = class ResultImpl {
|
|
19
|
+
ok;
|
|
20
|
+
_value;
|
|
21
|
+
_failure;
|
|
22
|
+
constructor(ok, valueOrFailure) {
|
|
23
|
+
this.ok = ok;
|
|
24
|
+
if (ok) this._value = valueOrFailure;
|
|
25
|
+
else this._failure = valueOrFailure;
|
|
26
|
+
Object.freeze(this);
|
|
27
|
+
}
|
|
28
|
+
get value() {
|
|
29
|
+
if (!this.ok) throw new InternalError("Cannot access value on NotOk result");
|
|
30
|
+
return this._value;
|
|
31
|
+
}
|
|
32
|
+
get failure() {
|
|
33
|
+
if (this.ok) throw new InternalError("Cannot access failure on Ok result");
|
|
34
|
+
return this._failure;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Creates a successful result.
|
|
38
|
+
*/
|
|
39
|
+
static ok(value) {
|
|
40
|
+
return blindCast(new ResultImpl(true, value));
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Creates an unsuccessful result.
|
|
44
|
+
*/
|
|
45
|
+
static notOk(failure) {
|
|
46
|
+
return blindCast(new ResultImpl(false, failure));
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Asserts that this result is Ok and returns the value.
|
|
50
|
+
* Throws if the result is NotOk.
|
|
51
|
+
*/
|
|
52
|
+
assertOk() {
|
|
53
|
+
if (!this.ok) throw new InternalError("Expected Ok result but got NotOk");
|
|
54
|
+
return this.value;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Asserts that this result is NotOk and returns the failure.
|
|
58
|
+
* Throws if the result is Ok.
|
|
59
|
+
*/
|
|
60
|
+
assertNotOk() {
|
|
61
|
+
if (this.ok) throw new InternalError("Expected NotOk result but got Ok");
|
|
62
|
+
return this.failure;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Creates a successful result.
|
|
67
|
+
*/
|
|
68
|
+
function ok(value) {
|
|
69
|
+
return ResultImpl.ok(value);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Creates an unsuccessful result.
|
|
73
|
+
*/
|
|
74
|
+
function notOk(failure) {
|
|
75
|
+
return ResultImpl.notOk(failure);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Singleton for void success results.
|
|
79
|
+
* Use this for validation checks that don't produce a value.
|
|
80
|
+
*/
|
|
81
|
+
const OK_VOID = ResultImpl.ok(void 0);
|
|
82
|
+
/**
|
|
83
|
+
* Returns a successful void result.
|
|
84
|
+
* Use this for validation checks that don't produce a value.
|
|
85
|
+
*/
|
|
86
|
+
function okVoid() {
|
|
87
|
+
return OK_VOID;
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
export { ok as n, okVoid as r, notOk as t };
|
|
91
|
+
|
|
92
|
+
//# sourceMappingURL=result-CBZ8X9mU.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result-CBZ8X9mU.mjs","names":[],"sources":["../../../../1-framework/0-foundation/utils/dist/result.mjs"],"sourcesContent":["import { t as InternalError } from \"./internal-error-BIc-ehme.mjs\";\nimport { t as blindCast } from \"./casts-DpaahrlC.mjs\";\n//#region src/result.ts\n/**\n* Generic Result type for representing success or failure outcomes.\n*\n* This is the standard way to return \"expected failures\" as values rather than\n* throwing exceptions. See docs/Error Handling.md for the full taxonomy.\n*\n* Naming rationale:\n* - `Ok<T>` / `NotOk<F>` mirror the `ok: true/false` discriminator\n* - `NotOk` avoids collision with domain types like \"Failure\" or \"Error\"\n* - `failure` property distinguishes from JS Error semantics\n*/\n/**\n* Result class that implements both Ok and NotOk variants.\n*/\nvar ResultImpl = class ResultImpl {\n\tok;\n\t_value;\n\t_failure;\n\tconstructor(ok, valueOrFailure) {\n\t\tthis.ok = ok;\n\t\tif (ok) this._value = valueOrFailure;\n\t\telse this._failure = valueOrFailure;\n\t\tObject.freeze(this);\n\t}\n\tget value() {\n\t\tif (!this.ok) throw new InternalError(\"Cannot access value on NotOk result\");\n\t\treturn this._value;\n\t}\n\tget failure() {\n\t\tif (this.ok) throw new InternalError(\"Cannot access failure on Ok result\");\n\t\treturn this._failure;\n\t}\n\t/**\n\t* Creates a successful result.\n\t*/\n\tstatic ok(value) {\n\t\treturn blindCast(new ResultImpl(true, value));\n\t}\n\t/**\n\t* Creates an unsuccessful result.\n\t*/\n\tstatic notOk(failure) {\n\t\treturn blindCast(new ResultImpl(false, failure));\n\t}\n\t/**\n\t* Asserts that this result is Ok and returns the value.\n\t* Throws if the result is NotOk.\n\t*/\n\tassertOk() {\n\t\tif (!this.ok) throw new InternalError(\"Expected Ok result but got NotOk\");\n\t\treturn this.value;\n\t}\n\t/**\n\t* Asserts that this result is NotOk and returns the failure.\n\t* Throws if the result is Ok.\n\t*/\n\tassertNotOk() {\n\t\tif (this.ok) throw new InternalError(\"Expected NotOk result but got Ok\");\n\t\treturn this.failure;\n\t}\n};\n/**\n* Creates a successful result.\n*/\nfunction ok(value) {\n\treturn ResultImpl.ok(value);\n}\n/**\n* Creates an unsuccessful result.\n*/\nfunction notOk(failure) {\n\treturn ResultImpl.notOk(failure);\n}\n/**\n* Singleton for void success results.\n* Use this for validation checks that don't produce a value.\n*/\nconst OK_VOID = ResultImpl.ok(void 0);\n/**\n* Returns a successful void result.\n* Use this for validation checks that don't produce a value.\n*/\nfunction okVoid() {\n\treturn OK_VOID;\n}\n//#endregion\nexport { notOk, ok, okVoid };\n\n//# sourceMappingURL=result.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,IAAI,aAAa,MAAM,WAAW;CACjC;CACA;CACA;CACA,YAAY,IAAI,gBAAgB;EAC/B,KAAK,KAAK;EACV,IAAI,IAAI,KAAK,SAAS;OACjB,KAAK,WAAW;EACrB,OAAO,OAAO,IAAI;CACnB;CACA,IAAI,QAAQ;EACX,IAAI,CAAC,KAAK,IAAI,MAAM,IAAI,cAAc,qCAAqC;EAC3E,OAAO,KAAK;CACb;CACA,IAAI,UAAU;EACb,IAAI,KAAK,IAAI,MAAM,IAAI,cAAc,oCAAoC;EACzE,OAAO,KAAK;CACb;;;;CAIA,OAAO,GAAG,OAAO;EAChB,OAAO,UAAU,IAAI,WAAW,MAAM,KAAK,CAAC;CAC7C;;;;CAIA,OAAO,MAAM,SAAS;EACrB,OAAO,UAAU,IAAI,WAAW,OAAO,OAAO,CAAC;CAChD;;;;;CAKA,WAAW;EACV,IAAI,CAAC,KAAK,IAAI,MAAM,IAAI,cAAc,kCAAkC;EACxE,OAAO,KAAK;CACb;;;;;CAKA,cAAc;EACb,IAAI,KAAK,IAAI,MAAM,IAAI,cAAc,kCAAkC;EACvE,OAAO,KAAK;CACb;AACD;;;;AAIA,SAAS,GAAG,OAAO;CAClB,OAAO,WAAW,GAAG,KAAK;AAC3B;;;;AAIA,SAAS,MAAM,SAAS;CACvB,OAAO,WAAW,MAAM,OAAO;AAChC;;;;;AAKA,MAAM,UAAU,WAAW,GAAG,KAAK,CAAC;;;;;AAKpC,SAAS,SAAS;CACjB,OAAO;AACR"}
|