@prisma/orm-framework 0.16.0
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 +109 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
//#region ../../../1-framework/1-core/ts-render/dist/index.d.mts
|
|
2
|
+
//#region src/json-to-ts-source.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Pure JSON-to-TypeScript-source printer.
|
|
5
|
+
*
|
|
6
|
+
* This module is the second stage of the codec → TS pipeline:
|
|
7
|
+
*
|
|
8
|
+
* jsValue → codec.encodeJson → JsonValue → jsonToTsSource → TS source text
|
|
9
|
+
*
|
|
10
|
+
* Stage 1 (`codec.encodeJson`) is a codec responsibility — date serialization,
|
|
11
|
+
* opaque domain types (vector, bigint, uuid), JSON canonicalization. Stage 2
|
|
12
|
+
* (this module) is a pure JSON-to-TS printer that must never grow type-specific
|
|
13
|
+
* branches.
|
|
14
|
+
*
|
|
15
|
+
* To render a non-JSON JS value (Date, Vector, BigInt, Buffer, …), encode it
|
|
16
|
+
* through the relevant codec's `encodeJson` first. Adding special cases to
|
|
17
|
+
* this file is not the answer — that's what codecs are for.
|
|
18
|
+
*/
|
|
19
|
+
type JsonValue = string | number | boolean | null | readonly JsonValue[] | JsonObject;
|
|
20
|
+
type JsonObject = {
|
|
21
|
+
readonly [key: string]: JsonValue | undefined;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Render a JSON-compatible value as a TypeScript source-text literal.
|
|
25
|
+
*
|
|
26
|
+
* Accepts `unknown` for ergonomics with structural types (e.g. `ColumnSpec`,
|
|
27
|
+
* `ForeignKeySpec`) whose fields are all JSON-compatible but whose interfaces
|
|
28
|
+
* lack the index signature TypeScript requires for `JsonObject` assignability.
|
|
29
|
+
* Non-JSON values (Date, Symbol, Function, etc.) throw at runtime.
|
|
30
|
+
*/
|
|
31
|
+
declare function jsonToTsSource(value: unknown): string;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/ts-expression.d.ts
|
|
34
|
+
/**
|
|
35
|
+
* Declarative contribution to the `import` block of a rendered TypeScript
|
|
36
|
+
* source file. Each node in an IR declares which symbols it needs from which
|
|
37
|
+
* modules; the top-level renderer deduplicates across nodes and emits one
|
|
38
|
+
* `import { a, b, c } from "…"` line per module.
|
|
39
|
+
*
|
|
40
|
+
* `kind` defaults to `"named"` (e.g. `import { a } from "m"`). Setting it to
|
|
41
|
+
* `"default"` emits `import a from "m"`. `attributes`, if provided, emits an
|
|
42
|
+
* import attributes clause (`with { type: "json" }`) verbatim — required for
|
|
43
|
+
* JSON module imports in the rendered scaffolds.
|
|
44
|
+
*
|
|
45
|
+
* `alias`, when present and different from `symbol`, renders `symbol as alias`.
|
|
46
|
+
* `typeOnly` marks the symbol as a type import: when every symbol contributed
|
|
47
|
+
* for a module is `typeOnly`, the whole statement collapses to
|
|
48
|
+
* `import type { … } from "m"`; when a module mixes value and type symbols, the
|
|
49
|
+
* type-only ones carry a per-specifier `type` prefix (`import { type T, val }`).
|
|
50
|
+
*/
|
|
51
|
+
interface ImportRequirement {
|
|
52
|
+
readonly moduleSpecifier: string;
|
|
53
|
+
readonly symbol: string;
|
|
54
|
+
readonly kind?: 'named' | 'default';
|
|
55
|
+
readonly attributes?: Readonly<Record<string, string>>;
|
|
56
|
+
readonly alias?: string;
|
|
57
|
+
readonly typeOnly?: boolean;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Abstract base class for any IR node that can be emitted as a TypeScript
|
|
61
|
+
* expression and declare its own import requirements.
|
|
62
|
+
*
|
|
63
|
+
* A top-level renderer walks an array of these polymorphically, concatenates
|
|
64
|
+
* `renderTypeScript()` results, and aggregates `importRequirements()` into a
|
|
65
|
+
* deduplicated import block.
|
|
66
|
+
*/
|
|
67
|
+
declare abstract class TsExpression {
|
|
68
|
+
abstract renderTypeScript(): string;
|
|
69
|
+
abstract importRequirements(): readonly ImportRequirement[];
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region src/render-imports.d.ts
|
|
73
|
+
/**
|
|
74
|
+
* Render an aggregated `import` block from a flat list of
|
|
75
|
+
* `ImportRequirement`s. Each target's migration renderer collects
|
|
76
|
+
* requirements polymorphically from its call nodes and pipes them here.
|
|
77
|
+
*
|
|
78
|
+
* The emitter invariants:
|
|
79
|
+
*
|
|
80
|
+
* - **Usually one line per module specifier.** Named imports are aggregated
|
|
81
|
+
* and emitted sorted; a single default symbol is combined onto the same
|
|
82
|
+
* line when attributes agree (`import def, { a, b } from "m";`). Aliased
|
|
83
|
+
* symbols render `symbol as alias`. When every symbol for a module is
|
|
84
|
+
* `typeOnly`, the statement collapses to `import type { … }`; a module
|
|
85
|
+
* mixing value and type symbols prefixes the type-only ones
|
|
86
|
+
* (`import { type T, v }`). Exceptions that split into multiple lines: a
|
|
87
|
+
* fully type-only statement with both a default and one or more named
|
|
88
|
+
* bindings (`import type D from "m";` then `import type { N } from "m";`,
|
|
89
|
+
* because TypeScript rejects `import type D, { N } from "m"` — TS1363),
|
|
90
|
+
* and multiple distinct default symbols (see below).
|
|
91
|
+
* - **Multiple distinct default symbols per module are allowed.** JS permits
|
|
92
|
+
* re-importing the same specifier under different default-binding names
|
|
93
|
+
* (`import a from 'm'; import b from 'm';`), so each distinct default
|
|
94
|
+
* symbol renders its own `import` line, sorted alphabetically; a repeated
|
|
95
|
+
* requirement for the same symbol still collapses into one binding,
|
|
96
|
+
* merging `typeOnly` by AND.
|
|
97
|
+
* - **Attribute unanimity per module.** All requirements for the same
|
|
98
|
+
* module specifier must carry the same (or no) `attributes` map.
|
|
99
|
+
* Divergent attribute maps throw — they can't collapse to one line
|
|
100
|
+
* and there's no user-resolvable recovery at this layer.
|
|
101
|
+
* - **Distinct (symbol, alias) pairs are distinct bindings.** TypeScript
|
|
102
|
+
* permits importing the same export under multiple local names, so
|
|
103
|
+
* `{ A }` + `{ A as B }` renders as `import { A, A as B } from "m"` and
|
|
104
|
+
* `{ A as B }` + `{ A as C }` renders as `import { A as B, A as C } from "m"`.
|
|
105
|
+
* Truly identical `(symbol, alias)` pairs still collapse to one binding,
|
|
106
|
+
* merging `typeOnly` by AND.
|
|
107
|
+
* - **Deterministic ordering.** Modules are emitted sorted by specifier;
|
|
108
|
+
* within a module, named bindings are emitted sorted by `(symbol, alias)`
|
|
109
|
+
* using JavaScript code-unit comparison, with the un-aliased form (no
|
|
110
|
+
* alias) treated as alias `""` so it sorts before any aliased form of the
|
|
111
|
+
* same symbol.
|
|
112
|
+
*
|
|
113
|
+
* Returns a string containing one or more import lines per module (see the
|
|
114
|
+
* splitting exceptions above), joined by `\n` (no trailing newline). An
|
|
115
|
+
* empty requirement list returns `""`.
|
|
116
|
+
*/
|
|
117
|
+
declare function renderImports(requirements: readonly ImportRequirement[]): string;
|
|
118
|
+
//#endregion
|
|
119
|
+
export { jsonToTsSource as a, TsExpression as i, JsonObject as n, renderImports as o, JsonValue as r, ImportRequirement as t };
|
|
120
|
+
//# sourceMappingURL=index-GY2oGH9L.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-GY2oGH9L.d.mts","names":[],"sources":["../../../../1-framework/1-core/ts-render/dist/index.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;KAiBK,wDAAwD,cAAc;KACtE;YACO,cAAc;;;;;;;;;;iBAUT,eAAe;;;;;;;;;;;;;;;;;;;;UAoBtB;WACC;WACA;WACA;WACA,aAAa,SAAS;WACtB;WACA;;;;;;;;;;uBAUY;WACZ;WACA,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgDzB,cAAc,uBAAuB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region ../../../1-framework/0-foundation/utils/dist/internal-error-BIc-ehme.mjs
|
|
2
|
+
/**
|
|
3
|
+
* A bug in Prisma Next, not a user error. Never catch this except at the
|
|
4
|
+
* outermost boundary for crash reporting — an InternalError means an invariant
|
|
5
|
+
* broke and the process cannot reliably continue. User-facing failures use
|
|
6
|
+
* `structuredError` with a dotted code instead.
|
|
7
|
+
*/
|
|
8
|
+
var InternalError = class extends Error {
|
|
9
|
+
isPrismaInternalError = true;
|
|
10
|
+
constructor(message, options) {
|
|
11
|
+
super(message, options?.cause !== void 0 ? { cause: options.cause } : void 0);
|
|
12
|
+
this.name = "InternalError";
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
function isInternalError(e) {
|
|
16
|
+
return typeof e === "object" && e !== null && "isPrismaInternalError" in e && e.isPrismaInternalError === true;
|
|
17
|
+
}
|
|
18
|
+
function assertNever(value, message) {
|
|
19
|
+
throw new InternalError(message ?? `Unreachable: unexpected value ${String(value)}`);
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { assertNever as n, isInternalError as r, InternalError as t };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=internal-error-BIc-ehme-ouBQPoEL.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-error-BIc-ehme-ouBQPoEL.mjs","names":[],"sources":["../../../../1-framework/0-foundation/utils/dist/internal-error-BIc-ehme.mjs"],"sourcesContent":["//#region src/internal-error.ts\n/**\n* A bug in Prisma Next, not a user error. Never catch this except at the\n* outermost boundary for crash reporting — an InternalError means an invariant\n* broke and the process cannot reliably continue. User-facing failures use\n* `structuredError` with a dotted code instead.\n*/\nvar InternalError = class extends Error {\n\tisPrismaInternalError = true;\n\tconstructor(message, options) {\n\t\tsuper(message, options?.cause !== void 0 ? { cause: options.cause } : void 0);\n\t\tthis.name = \"InternalError\";\n\t}\n};\nfunction isInternalError(e) {\n\treturn typeof e === \"object\" && e !== null && \"isPrismaInternalError\" in e && e.isPrismaInternalError === true;\n}\nfunction assertNever(value, message) {\n\tthrow new InternalError(message ?? `Unreachable: unexpected value ${String(value)}`);\n}\n//#endregion\nexport { assertNever as n, isInternalError as r, InternalError as t };\n\n//# sourceMappingURL=internal-error-BIc-ehme.mjs.map"],"mappings":";;;;;;;AAOA,IAAI,gBAAgB,cAAc,MAAM;CACvC,wBAAwB;CACxB,YAAY,SAAS,SAAS;EAC7B,MAAM,SAAS,SAAS,UAAU,KAAK,IAAI,EAAE,OAAO,QAAQ,MAAM,IAAI,KAAK,CAAC;EAC5E,KAAK,OAAO;CACb;AACD;AACA,SAAS,gBAAgB,GAAG;CAC3B,OAAO,OAAO,MAAM,YAAY,MAAM,QAAQ,2BAA2B,KAAK,EAAE,0BAA0B;AAC3G;AACA,SAAS,YAAY,OAAO,SAAS;CACpC,MAAM,IAAI,cAAc,WAAW,iCAAiC,OAAO,KAAK,GAAG;AACpF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region ../../../1-framework/0-foundation/utils/dist/internal-error.d.mts
|
|
2
|
+
//#region src/internal-error.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* A bug in Prisma Next, not a user error. Never catch this except at the
|
|
5
|
+
* outermost boundary for crash reporting — an InternalError means an invariant
|
|
6
|
+
* broke and the process cannot reliably continue. User-facing failures use
|
|
7
|
+
* `structuredError` with a dotted code instead.
|
|
8
|
+
*/
|
|
9
|
+
declare class InternalError extends Error {
|
|
10
|
+
readonly isPrismaInternalError = true;
|
|
11
|
+
constructor(message: string, options?: {
|
|
12
|
+
readonly cause?: unknown;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
declare function isInternalError(e: unknown): e is InternalError;
|
|
16
|
+
declare function assertNever(value: never, message?: string): never;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { assertNever as n, isInternalError as r, InternalError as t };
|
|
19
|
+
//# sourceMappingURL=internal-error-kK8QvlDE.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-error-kK8QvlDE.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/utils/dist/internal-error.d.mts"],"mappings":";;;;;;;;cAOc,sBAAsB;WACzB;EACT,YAAY,iBAAiB;aAClB;;;iBAGI,gBAAgB,aAAa,KAAK;iBAClC,YAAY,cAAc"}
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import { J as StorageBase, Z as StorageNamespace, n as ApplicationDomain } from "./domain-envelope-D6Wn9AmZ-BqZKTT9U.mjs";
|
|
2
|
+
import { Type } from "arktype";
|
|
3
|
+
//#region ../../../1-framework/1-core/framework-components/dist/ir.d.mts
|
|
4
|
+
//#region src/ir/ir-node.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Framework-level IR alphabet.
|
|
7
|
+
*
|
|
8
|
+
* The framework's contribution to Contract IR / Schema IR is a common
|
|
9
|
+
* root for the IR class hierarchy and a freeze affordance. Family
|
|
10
|
+
* abstract bases (e.g. `SqlNode`, `MongoSchemaIRNode`) refine the alphabet
|
|
11
|
+
* for their family shape; targets ship the concrete classes.
|
|
12
|
+
*
|
|
13
|
+
* `kind` is an optional discriminator on the base. Families and leaves
|
|
14
|
+
* that benefit from discriminated-union dispatch declare their own
|
|
15
|
+
* literal `kind` at the level that earns it — Mongo leaves carry
|
|
16
|
+
* per-class literals (`readonly kind = 'mongo-collection' as const`)
|
|
17
|
+
* because Mongo IR has polymorphic walkers; SQL declares a single
|
|
18
|
+
* family-level `kind = 'sql'` on `SqlNode` because SQL IR has no
|
|
19
|
+
* polymorphic dispatch today. No framework consumer dispatches on
|
|
20
|
+
* `IRNode.kind` at the BASE type — every dispatch site narrows
|
|
21
|
+
* through a union of leaves where each leaf carries a literal kind, so
|
|
22
|
+
* requiring `kind` at the base would be unearned. Future leaves that
|
|
23
|
+
* earn polymorphic dispatch override with a required literal at that
|
|
24
|
+
* leaf (e.g. `override readonly kind = 'pack-contributed-kind' as const`).
|
|
25
|
+
*
|
|
26
|
+
* `IRNodeBase` carries no methods: the freeze-and-assign affordance
|
|
27
|
+
* lives in the free `freezeNode` helper below. Keeping `freezeNode` out
|
|
28
|
+
* of the class type means an emitted contract literal type
|
|
29
|
+
* (`{ readonly kind: 'mongo-collection', ... }` or an unkeyed literal
|
|
30
|
+
* like `{ nativeType, codecId, nullable }`) is structurally assignable
|
|
31
|
+
* to its class type — a `protected freeze()` instance method would
|
|
32
|
+
* otherwise leak into the public type surface and require the literal
|
|
33
|
+
* to carry it too.
|
|
34
|
+
*
|
|
35
|
+
* Subclasses construct fields then call `freezeNode(this)` to seal the
|
|
36
|
+
* instance. Frozen instances + plain readonly fields keep IR nodes
|
|
37
|
+
* JSON-clean by construction, so `JSON.stringify(node)` produces canonical
|
|
38
|
+
* JSON without a `toJSON()` method. The `ContractSerializer` SPI handles
|
|
39
|
+
* round-trip from canonical JSON back to typed class instances.
|
|
40
|
+
*
|
|
41
|
+
* The name (`IRNode` / `IRNodeBase`) reflects the dual-hierarchy reality:
|
|
42
|
+
* this base is the common root for both Contract IR and Schema IR class
|
|
43
|
+
* hierarchies, not a Schema-IR-specific alphabet.
|
|
44
|
+
*/
|
|
45
|
+
interface IRNode {
|
|
46
|
+
readonly kind?: string;
|
|
47
|
+
}
|
|
48
|
+
declare abstract class IRNodeBase implements IRNode {
|
|
49
|
+
abstract readonly kind?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Seal an IR class instance after its constructor has assigned all
|
|
53
|
+
* fields. The free-helper form (rather than a `protected freeze()`
|
|
54
|
+
* instance method) keeps the class type structurally narrow so emitted
|
|
55
|
+
* contract literal types remain assignable to their class types.
|
|
56
|
+
*
|
|
57
|
+
* The helper name stays `freezeNode` — it operates on IR nodes
|
|
58
|
+
* regardless of root naming.
|
|
59
|
+
*/
|
|
60
|
+
declare function freezeNode<T extends IRNode>(node: T): T;
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/ir/namespace.d.ts
|
|
63
|
+
/**
|
|
64
|
+
* Reserved sentinel namespace id for the late-bound storage slot —
|
|
65
|
+
* the slot whose binding the target resolves at connection time
|
|
66
|
+
* rather than at authoring time. Postgres uses it for `search_path`
|
|
67
|
+
* late binding; SQLite uses it for the trivial singleton; Mongo uses
|
|
68
|
+
* it for the connection's `db` binding.
|
|
69
|
+
*
|
|
70
|
+
* Materialised target-side as a singleton subclass of the target's
|
|
71
|
+
* `NamespaceBase` concretion that overrides the namespace's
|
|
72
|
+
* qualifier-emission methods to elide the prefix entirely. Call sites
|
|
73
|
+
* stay polymorphic and never branch on `id === UNBOUND_NAMESPACE_ID`
|
|
74
|
+
* — the singleton's overrides drop the qualifier so emitted SQL / Mongo
|
|
75
|
+
* commands look unqualified.
|
|
76
|
+
*
|
|
77
|
+
* The double-underscore decoration marks the id as a framework-reserved
|
|
78
|
+
* coordinate when it appears in a JSON envelope (cold-read-as-reserved
|
|
79
|
+
* — no realistic collision with user-declared namespace names).
|
|
80
|
+
*
|
|
81
|
+
* Encoded as an exported const (rather than scattered string literals)
|
|
82
|
+
* so the sentinel-id invariant is single-sourced: any production-source
|
|
83
|
+
* site that constructs an unbound-namespace singleton imports this
|
|
84
|
+
* constant.
|
|
85
|
+
*/
|
|
86
|
+
declare const UNBOUND_NAMESPACE_ID: "__unbound__";
|
|
87
|
+
/**
|
|
88
|
+
* Framework-level building block for a "namespace" — the database-level
|
|
89
|
+
* grouping under which storage objects (tables, collections, enums, …)
|
|
90
|
+
* reside. Each target's namespace concretion maps the framework concept to
|
|
91
|
+
* a target-native binding:
|
|
92
|
+
*
|
|
93
|
+
* - Postgres: a schema (`CREATE SCHEMA …`); rendered as `"<schema>"`.
|
|
94
|
+
* - SQLite: the singleton `UNBOUND_NAMESPACE_ID`; emitted SQL has no qualifier.
|
|
95
|
+
* - Mongo: the connection's `db` field; addressed as a database name.
|
|
96
|
+
*
|
|
97
|
+
* See `UNBOUND_NAMESPACE_ID` above for the sentinel id and the
|
|
98
|
+
* singleton-subclass pattern that materialises it.
|
|
99
|
+
*
|
|
100
|
+
* The framework promises only the coordinate (`id`) — the named storage
|
|
101
|
+
* entities a namespace contains are family-typed (SQL contributes
|
|
102
|
+
* `table` / `type`, Mongo contributes `collection`, future families pick
|
|
103
|
+
* their own native idiom under `entries`). Generic consumers walking "all
|
|
104
|
+
* named entries" go through a family-typed namespace, not the framework
|
|
105
|
+
* `Namespace`.
|
|
106
|
+
*
|
|
107
|
+
* Every namespace concretion (e.g. family-built SQL namespaces,
|
|
108
|
+
* `MongoUnboundNamespace`, target-promoted namespaces like
|
|
109
|
+
* `PostgresSchema`) carries exactly: `id` (enumerable string),
|
|
110
|
+
* `entries` (frozen object holding entity-kind slot maps), and `kind`
|
|
111
|
+
* (non-enumerable string discriminator set via `Object.defineProperty`).
|
|
112
|
+
* Each slot map under `entries` uses a singular essence key (`table`,
|
|
113
|
+
* `type`, `collection`, …) mapping entity names to IR classes. No other
|
|
114
|
+
* own-enumerable data lives on a namespace; non-entity computed data lives
|
|
115
|
+
* on the surrounding storage or contract IR. The framework's
|
|
116
|
+
* `elementCoordinates(storage)` walk relies on this invariant to enumerate
|
|
117
|
+
* entities structurally without family-specific knowledge.
|
|
118
|
+
*/
|
|
119
|
+
interface Namespace extends IRNode, StorageNamespace {
|
|
120
|
+
readonly kind: string;
|
|
121
|
+
readonly entries: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
|
|
122
|
+
/**
|
|
123
|
+
* Whether this namespace is the late-bound unbound slot (see
|
|
124
|
+
* {@link UNBOUND_NAMESPACE_ID}). Optional so JSON-shaped structural
|
|
125
|
+
* satisfiers remain valid; every hydrated `NamespaceBase` concretion
|
|
126
|
+
* answers it.
|
|
127
|
+
*/
|
|
128
|
+
readonly isUnbound?: boolean;
|
|
129
|
+
}
|
|
130
|
+
declare abstract class NamespaceBase extends IRNodeBase implements Namespace {
|
|
131
|
+
abstract readonly id: string;
|
|
132
|
+
abstract readonly entries: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
|
|
133
|
+
abstract readonly kind: string;
|
|
134
|
+
/**
|
|
135
|
+
* Answers "am I the unbound namespace" as node behavior, so consumers
|
|
136
|
+
* never compare ids against the sentinel. This getter is the single
|
|
137
|
+
* encapsulated place the {@link UNBOUND_NAMESPACE_ID} comparison lives.
|
|
138
|
+
*/
|
|
139
|
+
get isUnbound(): boolean;
|
|
140
|
+
}
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region src/ir/storage.d.ts
|
|
143
|
+
/**
|
|
144
|
+
* Canonical address for a named entity in Contract IR / Schema IR.
|
|
145
|
+
*
|
|
146
|
+
* `plane` is `'domain' | 'storage'`: which top-level contract plane the
|
|
147
|
+
* entity lives on. Domain-side walks yield `plane: 'domain'` via
|
|
148
|
+
* {@link domainElementCoordinates}; {@link elementCoordinates} over storage
|
|
149
|
+
* yields `plane: 'storage'`.
|
|
150
|
+
*
|
|
151
|
+
* Cross-plane references obey a directional invariant: domain → storage is
|
|
152
|
+
* allowed; storage → domain is forbidden. That rule is enforced by a
|
|
153
|
+
* separate validator, not by constraining this coordinate shape — the
|
|
154
|
+
* coordinate carries the axis the validator checks.
|
|
155
|
+
*
|
|
156
|
+
* Iteration order over namespace properties follows `Object.entries` order;
|
|
157
|
+
* consumers that depend on ordering must sort.
|
|
158
|
+
*/
|
|
159
|
+
interface EntityCoordinate {
|
|
160
|
+
readonly plane: 'domain' | 'storage';
|
|
161
|
+
readonly namespaceId: string;
|
|
162
|
+
readonly entityKind: string;
|
|
163
|
+
readonly entityName: string;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Lazy walk over every named storage entity in a `Storage`-shaped
|
|
167
|
+
* value, yielded as {@link EntityCoordinate} tuples with
|
|
168
|
+
* `plane: 'storage'` (the parameter type binds the plane).
|
|
169
|
+
*
|
|
170
|
+
* Iterates each namespace's `entries` kind maps structurally. Skips
|
|
171
|
+
* non-object `entries`; `id` and `kind` are not walked (`kind` is
|
|
172
|
+
* non-enumerable on concretions). For every entity-kind key under
|
|
173
|
+
* `entries` whose value is a non-null object, yields one coordinate per
|
|
174
|
+
* entity name in that map. No family-specific kind vocabulary is required.
|
|
175
|
+
*/
|
|
176
|
+
declare function elementCoordinates(storage: Pick<StorageBase, 'namespaces'>): Generator<EntityCoordinate>;
|
|
177
|
+
/**
|
|
178
|
+
* Canonical, collision-safe key for an {@link EntityCoordinate}. Encodes each
|
|
179
|
+
* axis individually with `JSON.stringify` before joining with `-`, so no
|
|
180
|
+
* namespace id, entity kind, or entity name can forge a collision by
|
|
181
|
+
* embedding the delimiter itself (e.g. a delimiter of `:` would let
|
|
182
|
+
* `('a', 'b:c', 'd')` collide with `('a:b', 'c', 'd')`) — each component is
|
|
183
|
+
* quoted, and any `-` or `"` inside it is escaped or safely inside those
|
|
184
|
+
* quotes.
|
|
185
|
+
*
|
|
186
|
+
* The single shared key every coordinate-driven ownership/omission/collision
|
|
187
|
+
* check should use — `contract infer`'s pack-described-element omission and
|
|
188
|
+
* the migration tools' cross-space disjointness check both key on this.
|
|
189
|
+
*/
|
|
190
|
+
declare function coordinateKey(coordinate: Pick<EntityCoordinate, 'namespaceId' | 'entityKind' | 'entityName'>): string;
|
|
191
|
+
/**
|
|
192
|
+
* Looks up a single entity in a `Storage`-shaped value by its full coordinate.
|
|
193
|
+
* Returns `undefined` if the namespace, entity kind, or entity name is absent.
|
|
194
|
+
* The type parameter is a caller assertion — the walk itself is structural
|
|
195
|
+
* and cannot verify the entity's shape.
|
|
196
|
+
*/
|
|
197
|
+
declare function entityAt<T = unknown>(storage: Pick<StorageBase, 'namespaces'>, coord: Pick<EntityCoordinate, 'namespaceId' | 'entityKind' | 'entityName'>): T | undefined;
|
|
198
|
+
/**
|
|
199
|
+
* Framework-level promise that every Contract IR / Schema IR carries a
|
|
200
|
+
* collection of namespaces keyed by namespace id. Family storage
|
|
201
|
+
* concretions (`SqlStorage`, `MongoStorage`) refine the shape with
|
|
202
|
+
* family-specific fields (tables, collections, enums, …); target
|
|
203
|
+
* concretions add target fields where the family vocabulary doesn't
|
|
204
|
+
* reach.
|
|
205
|
+
*
|
|
206
|
+
* Keeping `namespaces` at the framework layer enforces that every storage
|
|
207
|
+
* object — across any target — is namespace-scoped. The framework can
|
|
208
|
+
* therefore walk the namespace map without knowing the family alphabet, and
|
|
209
|
+
* the `(namespace.id, name)` keying that the verifier and planner depend on
|
|
210
|
+
* is honest at every layer.
|
|
211
|
+
*
|
|
212
|
+
* Extends `IRNode` so the framework's IR-walking surfaces (verifiers,
|
|
213
|
+
* serializers) can dispatch on `Storage`-typed fields through the same
|
|
214
|
+
* IR-node alphabet as every other node — the structural dual already
|
|
215
|
+
* holds in code (every concrete storage class extends an IR-node base);
|
|
216
|
+
* the interface promotion makes the typing honest.
|
|
217
|
+
*
|
|
218
|
+
* **Persisted envelope shape is target-owned, not framework-promised.**
|
|
219
|
+
* Whether the `namespaces` map appears in the on-disk JSON envelope is
|
|
220
|
+
* a per-target decision made by `ContractSerializer.serializeContract`.
|
|
221
|
+
* Some targets emit a JSON-clean namespace shape that round-trips
|
|
222
|
+
* through `JSON.stringify` cleanly (SQL today via the family-layer
|
|
223
|
+
* identity serializer); others ship runtime-only fields on their
|
|
224
|
+
* namespace concretions and override `serializeContract` to strip
|
|
225
|
+
* them (Mongo). Future open (F16): extend the per-target
|
|
226
|
+
* `ContractSerializer` integration-test surface with an explicit
|
|
227
|
+
* envelope-shape assertion for each target, so the strip-vs-pass-through
|
|
228
|
+
* choice is locked at test time rather than implied by the override
|
|
229
|
+
* presence/absence. Earned by PR2's per-target namespace lift, when
|
|
230
|
+
* `PostgresSchema` / `SqliteUnboundDatabase` start carrying
|
|
231
|
+
* target-specific fields.
|
|
232
|
+
*/
|
|
233
|
+
interface Storage extends IRNode {
|
|
234
|
+
readonly namespaces: Readonly<Record<string, Namespace>>;
|
|
235
|
+
}
|
|
236
|
+
//#endregion
|
|
237
|
+
//#region src/ir/contract-view.d.ts
|
|
238
|
+
/**
|
|
239
|
+
* Extracts the entries map of a contract's single default namespace
|
|
240
|
+
* (`UNBOUND_NAMESPACE_ID`). Both single-namespace families (Mongo, SQLite)
|
|
241
|
+
* store all entities under this one namespace.
|
|
242
|
+
*/
|
|
243
|
+
type DefaultNamespaceEntries<TStorage extends {
|
|
244
|
+
readonly namespaces: object;
|
|
245
|
+
}> = TStorage['namespaces'] extends Record<typeof UNBOUND_NAMESPACE_ID, {
|
|
246
|
+
readonly entries: infer E;
|
|
247
|
+
}> ? E : never;
|
|
248
|
+
/**
|
|
249
|
+
* Generic single-namespace projection shape — one namespace's entity-kind slots.
|
|
250
|
+
* A family supplies:
|
|
251
|
+
* - `TEntries` — the family's `*NamespaceEntries` type for the namespace.
|
|
252
|
+
* - `TBuiltinKinds` — the union of the family's statically-named built-in kind
|
|
253
|
+
* keys (Mongo `'collection'`; SQL `'table' | 'valueSet'`).
|
|
254
|
+
*
|
|
255
|
+
* Each built-in kind becomes a top-level accessor; the remaining pack-contributed
|
|
256
|
+
* kinds stay under `.entries` (keyed by their registered singular kind string).
|
|
257
|
+
*
|
|
258
|
+
* A built-in kind that the emitted contract does not carry resolves to an empty
|
|
259
|
+
* map (`Record<string, never>`), matching the runtime which always materializes
|
|
260
|
+
* each built-in slot. The `& string` index-signature member of `TEntries` is
|
|
261
|
+
* excluded from `.entries` so only the literal pack-kind keys remain.
|
|
262
|
+
*/
|
|
263
|
+
type SingleNamespaceView<TEntries, TBuiltinKinds extends string> = { readonly [K in TBuiltinKinds]-?: K extends keyof TEntries ? NonNullable<TEntries[K]> : Record<string, never>; } & {
|
|
264
|
+
readonly entries: { readonly [K in Exclude<keyof TEntries, TBuiltinKinds | number | symbol> as string extends K ? never : K]: TEntries[K]; };
|
|
265
|
+
};
|
|
266
|
+
/** The `entries` shape of one namespace in a storage map. */
|
|
267
|
+
type EntriesOf<TNamespace> = TNamespace extends {
|
|
268
|
+
readonly entries: infer E;
|
|
269
|
+
} ? E : never;
|
|
270
|
+
/**
|
|
271
|
+
* The namespace-keyed entity-view map — every storage namespace keyed by its raw
|
|
272
|
+
* id, each projected to its {@link SingleNamespaceView}. Mirrors
|
|
273
|
+
* `NamespacedEnums` from `@internal/contract/enum-accessor`: the migration
|
|
274
|
+
* author's storage-side `view.namespace.<nsId>` is the twin of the runtime's
|
|
275
|
+
* `db.enums.<nsId>`. Nesting the schema map under one fixed `namespace` member
|
|
276
|
+
* makes it collision-proof — a schema named `storage` is `view.namespace.storage`,
|
|
277
|
+
* never a contract-root key.
|
|
278
|
+
*/
|
|
279
|
+
type NamespacedEntities<TStorage extends {
|
|
280
|
+
readonly namespaces: object;
|
|
281
|
+
}, TBuiltinKinds extends string> = { readonly [Ns in keyof TStorage['namespaces']]: SingleNamespaceView<EntriesOf<TStorage['namespaces'][Ns]>, TBuiltinKinds>; };
|
|
282
|
+
/**
|
|
283
|
+
* Projects one namespace's `entries` into the view shape: each built-in kind
|
|
284
|
+
* becomes a top-level slot (materialized empty if absent), and the remaining
|
|
285
|
+
* pack-contributed kinds sit under `.entries`. Shared by the single-namespace
|
|
286
|
+
* builder and the namespace-map builder.
|
|
287
|
+
*/
|
|
288
|
+
declare function promoteBuiltinKinds<TView>(entries: Readonly<Record<string, unknown>>, builtinKinds: readonly string[]): TView;
|
|
289
|
+
/**
|
|
290
|
+
* Builds one namespace's entity view: promotes the given built-in kind slots to
|
|
291
|
+
* top-level for the default (`UNBOUND_NAMESPACE_ID`) namespace. Single-namespace
|
|
292
|
+
* targets (Mongo, SQLite) use this to unwrap their sole namespace to the root.
|
|
293
|
+
*
|
|
294
|
+
* Throws if the contract has no default (`UNBOUND_NAMESPACE_ID`) namespace.
|
|
295
|
+
*/
|
|
296
|
+
declare function buildSingleNamespaceView<TView>(storage: Storage, builtinKinds: readonly string[]): TView;
|
|
297
|
+
/**
|
|
298
|
+
* Builds the namespace-keyed entity-view map (`{ <nsId>: SingleNamespaceView }`)
|
|
299
|
+
* for every namespace in the storage, keyed by raw namespace id. Mirrors
|
|
300
|
+
* `buildNamespacedEnums(domain)` — the storage-side twin.
|
|
301
|
+
*/
|
|
302
|
+
declare function buildNamespacedEntities<TMap>(storage: Storage, builtinKinds: readonly string[]): TMap;
|
|
303
|
+
//#endregion
|
|
304
|
+
//#region src/ir/domain.d.ts
|
|
305
|
+
/**
|
|
306
|
+
* Lazy walk over every named domain entity in a {@link ApplicationDomain},
|
|
307
|
+
* yielded as {@link EntityCoordinate} tuples with `plane: 'domain'`.
|
|
308
|
+
*
|
|
309
|
+
* Same structural rules as {@link elementCoordinates} over storage: skip
|
|
310
|
+
* scalar `id`; each other object-valued property is an entity-kind slot.
|
|
311
|
+
*/
|
|
312
|
+
declare function domainElementCoordinates(domain: Pick<ApplicationDomain, 'namespaces'>): Generator<EntityCoordinate>;
|
|
313
|
+
//#endregion
|
|
314
|
+
//#region src/ir/entity-kind.d.ts
|
|
315
|
+
interface EntityKindDescriptor<Input, Node> {
|
|
316
|
+
readonly kind: string;
|
|
317
|
+
readonly schema: Type<unknown>;
|
|
318
|
+
readonly construct: (input: Input) => Node;
|
|
319
|
+
}
|
|
320
|
+
type AnyEntityKindDescriptor = EntityKindDescriptor<never, unknown>;
|
|
321
|
+
/**
|
|
322
|
+
* Hydrates a namespace's entities from raw JSON maps into IR class instances.
|
|
323
|
+
*
|
|
324
|
+
* For each kind in `entries`: if the descriptor map has a descriptor,
|
|
325
|
+
* construct each inner-map value; otherwise freeze-and-carry (`'carry'`)
|
|
326
|
+
* or throw naming the kind and nsId (`'fail'`).
|
|
327
|
+
*
|
|
328
|
+
* The single boundary cast hands `value` to `descriptor.construct` as its
|
|
329
|
+
* `Input`. The value satisfies the kind's `Input` either by the
|
|
330
|
+
* entries-input contract at authoring time or by prior `validateStorage`
|
|
331
|
+
* validation at hydration time.
|
|
332
|
+
*/
|
|
333
|
+
declare function hydrateNamespaceEntities(entries: Readonly<Record<string, Readonly<Record<string, unknown>>>>, kinds: ReadonlyMap<string, AnyEntityKindDescriptor>, onUnknown: 'carry' | 'fail', nsId?: string): Record<string, Readonly<Record<string, unknown>>>;
|
|
334
|
+
//#endregion
|
|
335
|
+
//#region src/ir/storage-type.d.ts
|
|
336
|
+
/**
|
|
337
|
+
* Framework-level alphabet for entries in a storage `types` slot.
|
|
338
|
+
*
|
|
339
|
+
* The slot is polymorphic at the framework level: a family or target can
|
|
340
|
+
* persist either a JSON-clean codec-triple object literal (carrying
|
|
341
|
+
* `kind: 'codec-instance'`) or a class-instance IR node with a narrower
|
|
342
|
+
* kind discriminator (e.g. `'<kind>'`). Hydration walkers,
|
|
343
|
+
* verifiers, and planners dispatch on the `kind` literal to recover the
|
|
344
|
+
* precise variant.
|
|
345
|
+
*
|
|
346
|
+
* The `kind` field is required at this layer (in contrast with
|
|
347
|
+
* `IRNode.kind` which is optional) because the slot's downstream
|
|
348
|
+
* consumers dispatch on it — without a guaranteed discriminator the
|
|
349
|
+
* polymorphic walk cannot pick the right reader. Concrete variants
|
|
350
|
+
* narrow `kind` to their literal and add their own field set;
|
|
351
|
+
* downstream consumers use `kind`-discriminator helpers to recover
|
|
352
|
+
* the precise shape.
|
|
353
|
+
*/
|
|
354
|
+
interface StorageType extends IRNode {
|
|
355
|
+
readonly kind: string;
|
|
356
|
+
}
|
|
357
|
+
//#endregion
|
|
358
|
+
export { promoteBuiltinKinds as S, domainElementCoordinates as _, IRNode as a, freezeNode as b, NamespaceBase as c, Storage as d, StorageType as f, coordinateKey as g, buildSingleNamespaceView as h, EntityKindDescriptor as i, NamespacedEntities as l, buildNamespacedEntities as m, DefaultNamespaceEntries as n, IRNodeBase as o, UNBOUND_NAMESPACE_ID as p, EntityCoordinate as r, Namespace as s, AnyEntityKindDescriptor as t, SingleNamespaceView as u, elementCoordinates as v, hydrateNamespaceEntities as x, entityAt as y };
|
|
359
|
+
//# sourceMappingURL=ir-BvE7L9FK.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ir-BvE7L9FK.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/ir.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA4CU;WACC;;uBAEY,sBAAsB;oBACzB;;;;;;;;;;;iBAWH,WAAW,UAAU,QAAQ,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;cA0B1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAiCJ,kBAAkB,QAAQ;WACzB;WACA,SAAS,SAAS,eAAe,SAAS;;;;;;;WAO1C;;uBAEY,sBAAsB,sBAAsB;oBAC/C;oBACA,SAAS,SAAS,eAAe,SAAS;oBAC1C;;;;;;MAMd;;;;;;;;;;;;;;;;;;;;UAoBI;WACC;WACA;WACA;WACA;;;;;;;;;;;;;iBAaM,mBAAmB,SAAS,KAAK,6BAA6B,UAAU;;;;;;;;;;;;;;iBAcxE,cAAc,YAAY,KAAK;;;;;;;iBAO/B,SAAS,aAAa,SAAS,KAAK,4BAA4B,OAAO,KAAK,iEAAiE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAoCpJ,gBAAgB;WACf,YAAY,SAAS,eAAe;;;;;;;;;KAS1C,wBAAwB;WAClB;KACN,+BAA+B,cAAc;WACvC,eAAe;KACrB;;;;;;;;;;;;;;;;KAgBA,oBAAoB,UAAU,4CAA4C,KAAK,kBAAkB,gBAAgB,WAAW,YAAY,SAAS,MAAM;WACjJ,qBAAqB,KAAK,cAAc,UAAU,mDAAmD,YAAY,IAAI,SAAS;;;KAGpI,UAAU,cAAc;WAClB,eAAe;IACtB;;;;;;;;;;KAUC,mBAAmB;WACb;GACR,4CAA4C,YAAY,yBAAyB,oBAAoB,UAAU,uBAAuB,MAAM;;;;;;;iBAO9H,oBAAoB,OAAO,SAAS,SAAS,0BAA0B,kCAAkC;;;;;;;;iBAQzG,yBAAyB,OAAO,SAAS,SAAS,kCAAkC;;;;;;iBAMpF,wBAAwB,MAAM,SAAS,SAAS,kCAAkC;;;;;;;;;;iBAUlF,yBAAyB,QAAQ,KAAK,mCAAmC,UAAU;;;UAG1F,qBAAqB,OAAO;WAC3B;WACA,QAAQ;WACR,YAAY,OAAO,UAAU;;KAEnC,0BAA0B;;;;;;;;;;;;;iBAad,yBAAyB,SAAS,SAAS,eAAe,SAAS,4BAA4B,OAAO,oBAAoB,0BAA0B,6BAA6B,gBAAgB,eAAe,SAAS;;;;;;;;;;;;;;;;;;;;;UAqBhO,oBAAoB;WACnB"}
|