@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,200 @@
|
|
|
1
|
+
import { t as blindCast } from "./casts-DpaahrlC-Bd5n2coI.mjs";
|
|
2
|
+
import { t as isPlainRecord } from "./is-plain-record-CUofyVQ7-DWEzdhIx.mjs";
|
|
3
|
+
import { t as InternalError } from "./internal-error-BIc-ehme-ouBQPoEL.mjs";
|
|
4
|
+
import { n as runtimeError } from "./runtime-error-BA9d7XjZ-BlT8t6LB.mjs";
|
|
5
|
+
//#region ../../../1-framework/1-core/framework-components/dist/ir.mjs
|
|
6
|
+
var IRNodeBase = class {};
|
|
7
|
+
/**
|
|
8
|
+
* Seal an IR class instance after its constructor has assigned all
|
|
9
|
+
* fields. The free-helper form (rather than a `protected freeze()`
|
|
10
|
+
* instance method) keeps the class type structurally narrow so emitted
|
|
11
|
+
* contract literal types remain assignable to their class types.
|
|
12
|
+
*
|
|
13
|
+
* The helper name stays `freezeNode` — it operates on IR nodes
|
|
14
|
+
* regardless of root naming.
|
|
15
|
+
*/
|
|
16
|
+
function freezeNode(node) {
|
|
17
|
+
Object.freeze(node);
|
|
18
|
+
return node;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Reserved sentinel namespace id for the late-bound storage slot —
|
|
22
|
+
* the slot whose binding the target resolves at connection time
|
|
23
|
+
* rather than at authoring time. Postgres uses it for `search_path`
|
|
24
|
+
* late binding; SQLite uses it for the trivial singleton; Mongo uses
|
|
25
|
+
* it for the connection's `db` binding.
|
|
26
|
+
*
|
|
27
|
+
* Materialised target-side as a singleton subclass of the target's
|
|
28
|
+
* `NamespaceBase` concretion that overrides the namespace's
|
|
29
|
+
* qualifier-emission methods to elide the prefix entirely. Call sites
|
|
30
|
+
* stay polymorphic and never branch on `id === UNBOUND_NAMESPACE_ID`
|
|
31
|
+
* — the singleton's overrides drop the qualifier so emitted SQL / Mongo
|
|
32
|
+
* commands look unqualified.
|
|
33
|
+
*
|
|
34
|
+
* The double-underscore decoration marks the id as a framework-reserved
|
|
35
|
+
* coordinate when it appears in a JSON envelope (cold-read-as-reserved
|
|
36
|
+
* — no realistic collision with user-declared namespace names).
|
|
37
|
+
*
|
|
38
|
+
* Encoded as an exported const (rather than scattered string literals)
|
|
39
|
+
* so the sentinel-id invariant is single-sourced: any production-source
|
|
40
|
+
* site that constructs an unbound-namespace singleton imports this
|
|
41
|
+
* constant.
|
|
42
|
+
*/
|
|
43
|
+
const UNBOUND_NAMESPACE_ID = "__unbound__";
|
|
44
|
+
var NamespaceBase = class extends IRNodeBase {
|
|
45
|
+
/**
|
|
46
|
+
* Answers "am I the unbound namespace" as node behavior, so consumers
|
|
47
|
+
* never compare ids against the sentinel. This getter is the single
|
|
48
|
+
* encapsulated place the {@link UNBOUND_NAMESPACE_ID} comparison lives.
|
|
49
|
+
*/
|
|
50
|
+
get isUnbound() {
|
|
51
|
+
return this.id === UNBOUND_NAMESPACE_ID;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Projects one namespace's `entries` into the view shape: each built-in kind
|
|
56
|
+
* becomes a top-level slot (materialized empty if absent), and the remaining
|
|
57
|
+
* pack-contributed kinds sit under `.entries`. Shared by the single-namespace
|
|
58
|
+
* builder and the namespace-map builder.
|
|
59
|
+
*/
|
|
60
|
+
function promoteBuiltinKinds(entries, builtinKinds) {
|
|
61
|
+
const view = {};
|
|
62
|
+
const rest = {};
|
|
63
|
+
for (const [kind, kindMap] of Object.entries(entries)) if (builtinKinds.includes(kind)) view[kind] = kindMap;
|
|
64
|
+
else rest[kind] = kindMap;
|
|
65
|
+
for (const kind of builtinKinds) if (!(kind in view)) view[kind] = {};
|
|
66
|
+
view["entries"] = rest;
|
|
67
|
+
return blindCast(view);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Builds one namespace's entity view: promotes the given built-in kind slots to
|
|
71
|
+
* top-level for the default (`UNBOUND_NAMESPACE_ID`) namespace. Single-namespace
|
|
72
|
+
* targets (Mongo, SQLite) use this to unwrap their sole namespace to the root.
|
|
73
|
+
*
|
|
74
|
+
* Throws if the contract has no default (`UNBOUND_NAMESPACE_ID`) namespace.
|
|
75
|
+
*/
|
|
76
|
+
function buildSingleNamespaceView(storage, builtinKinds) {
|
|
77
|
+
const defaultNs = storage.namespaces[UNBOUND_NAMESPACE_ID];
|
|
78
|
+
if (defaultNs === void 0) throw new InternalError(`ContractView: contract has no default namespace (${UNBOUND_NAMESPACE_ID})`);
|
|
79
|
+
return promoteBuiltinKinds(blindCast(defaultNs.entries), builtinKinds);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Builds the namespace-keyed entity-view map (`{ <nsId>: SingleNamespaceView }`)
|
|
83
|
+
* for every namespace in the storage, keyed by raw namespace id. Mirrors
|
|
84
|
+
* `buildNamespacedEnums(domain)` — the storage-side twin.
|
|
85
|
+
*/
|
|
86
|
+
function buildNamespacedEntities(storage, builtinKinds) {
|
|
87
|
+
const out = {};
|
|
88
|
+
for (const [nsId, ns] of Object.entries(storage.namespaces)) out[nsId] = promoteBuiltinKinds(blindCast(ns.entries), builtinKinds);
|
|
89
|
+
return blindCast(out);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Lazy walk over every named domain entity in a {@link ApplicationDomain},
|
|
93
|
+
* yielded as {@link EntityCoordinate} tuples with `plane: 'domain'`.
|
|
94
|
+
*
|
|
95
|
+
* Same structural rules as {@link elementCoordinates} over storage: skip
|
|
96
|
+
* scalar `id`; each other object-valued property is an entity-kind slot.
|
|
97
|
+
*/
|
|
98
|
+
function* domainElementCoordinates(domain) {
|
|
99
|
+
for (const [namespaceId, ns] of Object.entries(domain.namespaces)) for (const [entityKind, slot] of Object.entries(ns)) {
|
|
100
|
+
if (entityKind === "id") continue;
|
|
101
|
+
if (slot === null || typeof slot !== "object") continue;
|
|
102
|
+
for (const entityName of Object.keys(slot)) yield {
|
|
103
|
+
plane: "domain",
|
|
104
|
+
namespaceId,
|
|
105
|
+
entityKind,
|
|
106
|
+
entityName
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Hydrates a namespace's entities from raw JSON maps into IR class instances.
|
|
112
|
+
*
|
|
113
|
+
* For each kind in `entries`: if the descriptor map has a descriptor,
|
|
114
|
+
* construct each inner-map value; otherwise freeze-and-carry (`'carry'`)
|
|
115
|
+
* or throw naming the kind and nsId (`'fail'`).
|
|
116
|
+
*
|
|
117
|
+
* The single boundary cast hands `value` to `descriptor.construct` as its
|
|
118
|
+
* `Input`. The value satisfies the kind's `Input` either by the
|
|
119
|
+
* entries-input contract at authoring time or by prior `validateStorage`
|
|
120
|
+
* validation at hydration time.
|
|
121
|
+
*/
|
|
122
|
+
function hydrateNamespaceEntities(entries, kinds, onUnknown, nsId) {
|
|
123
|
+
const result = {};
|
|
124
|
+
for (const [kind, rawMap] of Object.entries(entries)) {
|
|
125
|
+
const descriptor = kinds.get(kind);
|
|
126
|
+
if (descriptor !== void 0) {
|
|
127
|
+
const built = {};
|
|
128
|
+
for (const [name, value] of Object.entries(rawMap)) built[name] = descriptor.construct(blindCast(value));
|
|
129
|
+
result[kind] = Object.freeze(built);
|
|
130
|
+
} else if (onUnknown === "carry") result[kind] = Object.freeze(rawMap);
|
|
131
|
+
else throw runtimeError("CONTRACT.ENTITY_KIND_UNKNOWN", `Unknown entries key "${kind}" in namespace "${nsId ?? "?"}"; no hydration factory registered for this entity kind`);
|
|
132
|
+
}
|
|
133
|
+
return result;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Lazy walk over every named storage entity in a `Storage`-shaped
|
|
137
|
+
* value, yielded as {@link EntityCoordinate} tuples with
|
|
138
|
+
* `plane: 'storage'` (the parameter type binds the plane).
|
|
139
|
+
*
|
|
140
|
+
* Iterates each namespace's `entries` kind maps structurally. Skips
|
|
141
|
+
* non-object `entries`; `id` and `kind` are not walked (`kind` is
|
|
142
|
+
* non-enumerable on concretions). For every entity-kind key under
|
|
143
|
+
* `entries` whose value is a non-null object, yields one coordinate per
|
|
144
|
+
* entity name in that map. No family-specific kind vocabulary is required.
|
|
145
|
+
*/
|
|
146
|
+
function* elementCoordinates(storage) {
|
|
147
|
+
for (const [namespaceId, ns] of Object.entries(storage.namespaces)) {
|
|
148
|
+
const entries = ns.entries;
|
|
149
|
+
if (entries === null || typeof entries !== "object") continue;
|
|
150
|
+
for (const [entityKind, kindMap] of Object.entries(entries)) {
|
|
151
|
+
if (kindMap === null || typeof kindMap !== "object") continue;
|
|
152
|
+
for (const entityName of Object.keys(kindMap)) yield {
|
|
153
|
+
plane: "storage",
|
|
154
|
+
namespaceId,
|
|
155
|
+
entityKind,
|
|
156
|
+
entityName
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Canonical, collision-safe key for an {@link EntityCoordinate}. Encodes each
|
|
163
|
+
* axis individually with `JSON.stringify` before joining with `-`, so no
|
|
164
|
+
* namespace id, entity kind, or entity name can forge a collision by
|
|
165
|
+
* embedding the delimiter itself (e.g. a delimiter of `:` would let
|
|
166
|
+
* `('a', 'b:c', 'd')` collide with `('a:b', 'c', 'd')`) — each component is
|
|
167
|
+
* quoted, and any `-` or `"` inside it is escaped or safely inside those
|
|
168
|
+
* quotes.
|
|
169
|
+
*
|
|
170
|
+
* The single shared key every coordinate-driven ownership/omission/collision
|
|
171
|
+
* check should use — `contract infer`'s pack-described-element omission and
|
|
172
|
+
* the migration tools' cross-space disjointness check both key on this.
|
|
173
|
+
*/
|
|
174
|
+
function coordinateKey(coordinate) {
|
|
175
|
+
return [
|
|
176
|
+
coordinate.namespaceId,
|
|
177
|
+
coordinate.entityKind,
|
|
178
|
+
coordinate.entityName
|
|
179
|
+
].map((value) => JSON.stringify(value)).join("-");
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Looks up a single entity in a `Storage`-shaped value by its full coordinate.
|
|
183
|
+
* Returns `undefined` if the namespace, entity kind, or entity name is absent.
|
|
184
|
+
* The type parameter is a caller assertion — the walk itself is structural
|
|
185
|
+
* and cannot verify the entity's shape.
|
|
186
|
+
*/
|
|
187
|
+
function entityAt(storage, coord) {
|
|
188
|
+
const ns = storage.namespaces[coord.namespaceId];
|
|
189
|
+
if (ns === void 0) return void 0;
|
|
190
|
+
const entries = ns.entries;
|
|
191
|
+
if (!isPlainRecord(entries)) return void 0;
|
|
192
|
+
const kindMap = entries[coord.entityKind];
|
|
193
|
+
if (!isPlainRecord(kindMap)) return void 0;
|
|
194
|
+
if (!Object.hasOwn(kindMap, coord.entityName)) return void 0;
|
|
195
|
+
return blindCast(kindMap[coord.entityName]);
|
|
196
|
+
}
|
|
197
|
+
//#endregion
|
|
198
|
+
export { buildSingleNamespaceView as a, elementCoordinates as c, hydrateNamespaceEntities as d, promoteBuiltinKinds as f, buildNamespacedEntities as i, entityAt as l, NamespaceBase as n, coordinateKey as o, UNBOUND_NAMESPACE_ID as r, domainElementCoordinates as s, IRNodeBase as t, freezeNode as u };
|
|
199
|
+
|
|
200
|
+
//# sourceMappingURL=ir-ChmSSAhX.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ir-ChmSSAhX.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/ir.mjs"],"sourcesContent":["import { n as runtimeError } from \"./runtime-error-BA9d7XjZ.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { isPlainRecord } from \"@internal/contract/is-plain-record\";\n//#region src/ir/ir-node.ts\nvar IRNodeBase = class {};\n/**\n* Seal an IR class instance after its constructor has assigned all\n* fields. The free-helper form (rather than a `protected freeze()`\n* instance method) keeps the class type structurally narrow so emitted\n* contract literal types remain assignable to their class types.\n*\n* The helper name stays `freezeNode` — it operates on IR nodes\n* regardless of root naming.\n*/\nfunction freezeNode(node) {\n\tObject.freeze(node);\n\treturn node;\n}\n//#endregion\n//#region src/ir/namespace.ts\n/**\n* Reserved sentinel namespace id for the late-bound storage slot —\n* the slot whose binding the target resolves at connection time\n* rather than at authoring time. Postgres uses it for `search_path`\n* late binding; SQLite uses it for the trivial singleton; Mongo uses\n* it for the connection's `db` binding.\n*\n* Materialised target-side as a singleton subclass of the target's\n* `NamespaceBase` concretion that overrides the namespace's\n* qualifier-emission methods to elide the prefix entirely. Call sites\n* stay polymorphic and never branch on `id === UNBOUND_NAMESPACE_ID`\n* — the singleton's overrides drop the qualifier so emitted SQL / Mongo\n* commands look unqualified.\n*\n* The double-underscore decoration marks the id as a framework-reserved\n* coordinate when it appears in a JSON envelope (cold-read-as-reserved\n* — no realistic collision with user-declared namespace names).\n*\n* Encoded as an exported const (rather than scattered string literals)\n* so the sentinel-id invariant is single-sourced: any production-source\n* site that constructs an unbound-namespace singleton imports this\n* constant.\n*/\nconst UNBOUND_NAMESPACE_ID = \"__unbound__\";\nvar NamespaceBase = class extends IRNodeBase {\n\t/**\n\t* Answers \"am I the unbound namespace\" as node behavior, so consumers\n\t* never compare ids against the sentinel. This getter is the single\n\t* encapsulated place the {@link UNBOUND_NAMESPACE_ID} comparison lives.\n\t*/\n\tget isUnbound() {\n\t\treturn this.id === UNBOUND_NAMESPACE_ID;\n\t}\n};\n//#endregion\n//#region src/ir/contract-view.ts\n/**\n* Projects one namespace's `entries` into the view shape: each built-in kind\n* becomes a top-level slot (materialized empty if absent), and the remaining\n* pack-contributed kinds sit under `.entries`. Shared by the single-namespace\n* builder and the namespace-map builder.\n*/\nfunction promoteBuiltinKinds(entries, builtinKinds) {\n\tconst view = {};\n\tconst rest = {};\n\tfor (const [kind, kindMap] of Object.entries(entries)) if (builtinKinds.includes(kind)) view[kind] = kindMap;\n\telse rest[kind] = kindMap;\n\tfor (const kind of builtinKinds) if (!(kind in view)) view[kind] = {};\n\tview[\"entries\"] = rest;\n\treturn blindCast(view);\n}\n/**\n* Builds one namespace's entity view: promotes the given built-in kind slots to\n* top-level for the default (`UNBOUND_NAMESPACE_ID`) namespace. Single-namespace\n* targets (Mongo, SQLite) use this to unwrap their sole namespace to the root.\n*\n* Throws if the contract has no default (`UNBOUND_NAMESPACE_ID`) namespace.\n*/\nfunction buildSingleNamespaceView(storage, builtinKinds) {\n\tconst defaultNs = storage.namespaces[UNBOUND_NAMESPACE_ID];\n\tif (defaultNs === void 0) throw new InternalError(`ContractView: contract has no default namespace (${UNBOUND_NAMESPACE_ID})`);\n\treturn promoteBuiltinKinds(blindCast(defaultNs.entries), builtinKinds);\n}\n/**\n* Builds the namespace-keyed entity-view map (`{ <nsId>: SingleNamespaceView }`)\n* for every namespace in the storage, keyed by raw namespace id. Mirrors\n* `buildNamespacedEnums(domain)` — the storage-side twin.\n*/\nfunction buildNamespacedEntities(storage, builtinKinds) {\n\tconst out = {};\n\tfor (const [nsId, ns] of Object.entries(storage.namespaces)) out[nsId] = promoteBuiltinKinds(blindCast(ns.entries), builtinKinds);\n\treturn blindCast(out);\n}\n//#endregion\n//#region src/ir/domain.ts\n/**\n* Lazy walk over every named domain entity in a {@link ApplicationDomain},\n* yielded as {@link EntityCoordinate} tuples with `plane: 'domain'`.\n*\n* Same structural rules as {@link elementCoordinates} over storage: skip\n* scalar `id`; each other object-valued property is an entity-kind slot.\n*/\nfunction* domainElementCoordinates(domain) {\n\tfor (const [namespaceId, ns] of Object.entries(domain.namespaces)) for (const [entityKind, slot] of Object.entries(ns)) {\n\t\tif (entityKind === \"id\") continue;\n\t\tif (slot === null || typeof slot !== \"object\") continue;\n\t\tfor (const entityName of Object.keys(slot)) yield {\n\t\t\tplane: \"domain\",\n\t\t\tnamespaceId,\n\t\t\tentityKind,\n\t\t\tentityName\n\t\t};\n\t}\n}\n//#endregion\n//#region src/ir/entity-kind.ts\n/**\n* Hydrates a namespace's entities from raw JSON maps into IR class instances.\n*\n* For each kind in `entries`: if the descriptor map has a descriptor,\n* construct each inner-map value; otherwise freeze-and-carry (`'carry'`)\n* or throw naming the kind and nsId (`'fail'`).\n*\n* The single boundary cast hands `value` to `descriptor.construct` as its\n* `Input`. The value satisfies the kind's `Input` either by the\n* entries-input contract at authoring time or by prior `validateStorage`\n* validation at hydration time.\n*/\nfunction hydrateNamespaceEntities(entries, kinds, onUnknown, nsId) {\n\tconst result = {};\n\tfor (const [kind, rawMap] of Object.entries(entries)) {\n\t\tconst descriptor = kinds.get(kind);\n\t\tif (descriptor !== void 0) {\n\t\t\tconst built = {};\n\t\t\tfor (const [name, value] of Object.entries(rawMap)) built[name] = descriptor.construct(blindCast(value));\n\t\t\tresult[kind] = Object.freeze(built);\n\t\t} else if (onUnknown === \"carry\") result[kind] = Object.freeze(rawMap);\n\t\telse throw runtimeError(\"CONTRACT.ENTITY_KIND_UNKNOWN\", `Unknown entries key \"${kind}\" in namespace \"${nsId ?? \"?\"}\"; no hydration factory registered for this entity kind`);\n\t}\n\treturn result;\n}\n//#endregion\n//#region src/ir/storage.ts\n/**\n* Lazy walk over every named storage entity in a `Storage`-shaped\n* value, yielded as {@link EntityCoordinate} tuples with\n* `plane: 'storage'` (the parameter type binds the plane).\n*\n* Iterates each namespace's `entries` kind maps structurally. Skips\n* non-object `entries`; `id` and `kind` are not walked (`kind` is\n* non-enumerable on concretions). For every entity-kind key under\n* `entries` whose value is a non-null object, yields one coordinate per\n* entity name in that map. No family-specific kind vocabulary is required.\n*/\nfunction* elementCoordinates(storage) {\n\tfor (const [namespaceId, ns] of Object.entries(storage.namespaces)) {\n\t\tconst entries = ns.entries;\n\t\tif (entries === null || typeof entries !== \"object\") continue;\n\t\tfor (const [entityKind, kindMap] of Object.entries(entries)) {\n\t\t\tif (kindMap === null || typeof kindMap !== \"object\") continue;\n\t\t\tfor (const entityName of Object.keys(kindMap)) yield {\n\t\t\t\tplane: \"storage\",\n\t\t\t\tnamespaceId,\n\t\t\t\tentityKind,\n\t\t\t\tentityName\n\t\t\t};\n\t\t}\n\t}\n}\n/**\n* Canonical, collision-safe key for an {@link EntityCoordinate}. Encodes each\n* axis individually with `JSON.stringify` before joining with `-`, so no\n* namespace id, entity kind, or entity name can forge a collision by\n* embedding the delimiter itself (e.g. a delimiter of `:` would let\n* `('a', 'b:c', 'd')` collide with `('a:b', 'c', 'd')`) — each component is\n* quoted, and any `-` or `\"` inside it is escaped or safely inside those\n* quotes.\n*\n* The single shared key every coordinate-driven ownership/omission/collision\n* check should use — `contract infer`'s pack-described-element omission and\n* the migration tools' cross-space disjointness check both key on this.\n*/\nfunction coordinateKey(coordinate) {\n\treturn [\n\t\tcoordinate.namespaceId,\n\t\tcoordinate.entityKind,\n\t\tcoordinate.entityName\n\t].map((value) => JSON.stringify(value)).join(\"-\");\n}\n/**\n* Looks up a single entity in a `Storage`-shaped value by its full coordinate.\n* Returns `undefined` if the namespace, entity kind, or entity name is absent.\n* The type parameter is a caller assertion — the walk itself is structural\n* and cannot verify the entity's shape.\n*/\nfunction entityAt(storage, coord) {\n\tconst ns = storage.namespaces[coord.namespaceId];\n\tif (ns === void 0) return void 0;\n\tconst entries = ns.entries;\n\tif (!isPlainRecord(entries)) return void 0;\n\tconst kindMap = entries[coord.entityKind];\n\tif (!isPlainRecord(kindMap)) return void 0;\n\tif (!Object.hasOwn(kindMap, coord.entityName)) return void 0;\n\treturn blindCast(kindMap[coord.entityName]);\n}\n//#endregion\nexport { IRNodeBase, NamespaceBase, UNBOUND_NAMESPACE_ID, buildNamespacedEntities, buildSingleNamespaceView, coordinateKey, domainElementCoordinates, elementCoordinates, entityAt, freezeNode, hydrateNamespaceEntities, isPlainRecord, promoteBuiltinKinds };\n\n//# sourceMappingURL=ir.mjs.map"],"mappings":";;;;;AAKA,IAAI,aAAa,MAAM,CAAC;;;;;;;;;;AAUxB,SAAS,WAAW,MAAM;CACzB,OAAO,OAAO,IAAI;CAClB,OAAO;AACR;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,uBAAuB;AAC7B,IAAI,gBAAgB,cAAc,WAAW;;;;;;CAM5C,IAAI,YAAY;EACf,OAAO,KAAK,OAAO;CACpB;AACD;;;;;;;AASA,SAAS,oBAAoB,SAAS,cAAc;CACnD,MAAM,OAAO,CAAC;CACd,MAAM,OAAO,CAAC;CACd,KAAK,MAAM,CAAC,MAAM,YAAY,OAAO,QAAQ,OAAO,GAAG,IAAI,aAAa,SAAS,IAAI,GAAG,KAAK,QAAQ;MAChG,KAAK,QAAQ;CAClB,KAAK,MAAM,QAAQ,cAAc,IAAI,EAAE,QAAQ,OAAO,KAAK,QAAQ,CAAC;CACpE,KAAK,aAAa;CAClB,OAAO,UAAU,IAAI;AACtB;;;;;;;;AAQA,SAAS,yBAAyB,SAAS,cAAc;CACxD,MAAM,YAAY,QAAQ,WAAW;CACrC,IAAI,cAAc,KAAK,GAAG,MAAM,IAAI,cAAc,oDAAoD,qBAAqB,EAAE;CAC7H,OAAO,oBAAoB,UAAU,UAAU,OAAO,GAAG,YAAY;AACtE;;;;;;AAMA,SAAS,wBAAwB,SAAS,cAAc;CACvD,MAAM,MAAM,CAAC;CACb,KAAK,MAAM,CAAC,MAAM,OAAO,OAAO,QAAQ,QAAQ,UAAU,GAAG,IAAI,QAAQ,oBAAoB,UAAU,GAAG,OAAO,GAAG,YAAY;CAChI,OAAO,UAAU,GAAG;AACrB;;;;;;;;AAUA,UAAU,yBAAyB,QAAQ;CAC1C,KAAK,MAAM,CAAC,aAAa,OAAO,OAAO,QAAQ,OAAO,UAAU,GAAG,KAAK,MAAM,CAAC,YAAY,SAAS,OAAO,QAAQ,EAAE,GAAG;EACvH,IAAI,eAAe,MAAM;EACzB,IAAI,SAAS,QAAQ,OAAO,SAAS,UAAU;EAC/C,KAAK,MAAM,cAAc,OAAO,KAAK,IAAI,GAAG,MAAM;GACjD,OAAO;GACP;GACA;GACA;EACD;CACD;AACD;;;;;;;;;;;;;AAeA,SAAS,yBAAyB,SAAS,OAAO,WAAW,MAAM;CAClE,MAAM,SAAS,CAAC;CAChB,KAAK,MAAM,CAAC,MAAM,WAAW,OAAO,QAAQ,OAAO,GAAG;EACrD,MAAM,aAAa,MAAM,IAAI,IAAI;EACjC,IAAI,eAAe,KAAK,GAAG;GAC1B,MAAM,QAAQ,CAAC;GACf,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,MAAM,GAAG,MAAM,QAAQ,WAAW,UAAU,UAAU,KAAK,CAAC;GACvG,OAAO,QAAQ,OAAO,OAAO,KAAK;EACnC,OAAO,IAAI,cAAc,SAAS,OAAO,QAAQ,OAAO,OAAO,MAAM;OAChE,MAAM,aAAa,gCAAgC,wBAAwB,KAAK,kBAAkB,QAAQ,IAAI,wDAAwD;CAC5K;CACA,OAAO;AACR;;;;;;;;;;;;AAcA,UAAU,mBAAmB,SAAS;CACrC,KAAK,MAAM,CAAC,aAAa,OAAO,OAAO,QAAQ,QAAQ,UAAU,GAAG;EACnE,MAAM,UAAU,GAAG;EACnB,IAAI,YAAY,QAAQ,OAAO,YAAY,UAAU;EACrD,KAAK,MAAM,CAAC,YAAY,YAAY,OAAO,QAAQ,OAAO,GAAG;GAC5D,IAAI,YAAY,QAAQ,OAAO,YAAY,UAAU;GACrD,KAAK,MAAM,cAAc,OAAO,KAAK,OAAO,GAAG,MAAM;IACpD,OAAO;IACP;IACA;IACA;GACD;EACD;CACD;AACD;;;;;;;;;;;;;;AAcA,SAAS,cAAc,YAAY;CAClC,OAAO;EACN,WAAW;EACX,WAAW;EACX,WAAW;CACZ,CAAC,CAAC,KAAK,UAAU,KAAK,UAAU,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG;AACjD;;;;;;;AAOA,SAAS,SAAS,SAAS,OAAO;CACjC,MAAM,KAAK,QAAQ,WAAW,MAAM;CACpC,IAAI,OAAO,KAAK,GAAG,OAAO,KAAK;CAC/B,MAAM,UAAU,GAAG;CACnB,IAAI,CAAC,cAAc,OAAO,GAAG,OAAO,KAAK;CACzC,MAAM,UAAU,QAAQ,MAAM;CAC9B,IAAI,CAAC,cAAc,OAAO,GAAG,OAAO,KAAK;CACzC,IAAI,CAAC,OAAO,OAAO,SAAS,MAAM,UAAU,GAAG,OAAO,KAAK;CAC3D,OAAO,UAAU,QAAQ,MAAM,WAAW;AAC3C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region ../../../1-framework/0-foundation/contract/dist/is-plain-record.d.mts
|
|
2
|
+
//#region src/is-plain-record.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Strict plain-object guard: accepts only objects with `Object.prototype`
|
|
5
|
+
* or `null` as their prototype. Rejects arrays, class instances, and other
|
|
6
|
+
* non-plain objects. Used to distinguish raw-data records from IR class
|
|
7
|
+
* instances in validation and hydration paths.
|
|
8
|
+
*/
|
|
9
|
+
declare function isPlainRecord(value: unknown): value is Readonly<Record<string, unknown>>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { isPlainRecord as t };
|
|
12
|
+
//# sourceMappingURL=is-plain-record-C9BWiqcw.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-plain-record-C9BWiqcw.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/is-plain-record.d.mts"],"mappings":";;;;;;;;iBAOiB,cAAc,iBAAiB,SAAS,SAAS"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region ../../../1-framework/0-foundation/contract/dist/is-plain-record-CUofyVQ7.mjs
|
|
2
|
+
/**
|
|
3
|
+
* Strict plain-object guard: accepts only objects with `Object.prototype`
|
|
4
|
+
* or `null` as their prototype. Rejects arrays, class instances, and other
|
|
5
|
+
* non-plain objects. Used to distinguish raw-data records from IR class
|
|
6
|
+
* instances in validation and hydration paths.
|
|
7
|
+
*/
|
|
8
|
+
function isPlainRecord(value) {
|
|
9
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
10
|
+
const proto = Object.getPrototypeOf(value);
|
|
11
|
+
return proto === Object.prototype || proto === null;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { isPlainRecord as t };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=is-plain-record-CUofyVQ7-DWEzdhIx.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-plain-record-CUofyVQ7-DWEzdhIx.mjs","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/is-plain-record-CUofyVQ7.mjs"],"sourcesContent":["//#region src/is-plain-record.ts\n/**\n* Strict plain-object guard: accepts only objects with `Object.prototype`\n* or `null` as their prototype. Rejects arrays, class instances, and other\n* non-plain objects. Used to distinguish raw-data records from IR class\n* instances in validation and hydration paths.\n*/\nfunction isPlainRecord(value) {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) return false;\n\tconst proto = Object.getPrototypeOf(value);\n\treturn proto === Object.prototype || proto === null;\n}\n//#endregion\nexport { isPlainRecord as t };\n\n//# sourceMappingURL=is-plain-record-CUofyVQ7.mjs.map"],"mappings":";;;;;;;AAOA,SAAS,cAAc,OAAO;CAC7B,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,MAAM,QAAQ,KAAK,GAAG,OAAO;CAChF,MAAM,QAAQ,OAAO,eAAe,KAAK;CACzC,OAAO,UAAU,OAAO,aAAa,UAAU;AAChD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region ../../../1-framework/0-foundation/utils/dist/json.d.mts
|
|
2
|
+
//#region src/json.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Structural types for values that can be losslessly round-tripped through
|
|
5
|
+
* `JSON.stringify` / `JSON.parse`.
|
|
6
|
+
*
|
|
7
|
+
* These are *structural* (no nominal brand): a value satisfying `JsonObject`
|
|
8
|
+
* is guaranteed only to have JSON-stringifiable shape, not to carry any
|
|
9
|
+
* particular semantic identity. Use these as the type of opaque "JSON-shaped"
|
|
10
|
+
* data crossing API boundaries when the consumer needs the JSON-cleanness
|
|
11
|
+
* promise but does not need a domain-specific shape.
|
|
12
|
+
*
|
|
13
|
+
* Notable consumers of `JsonObject` include the framework's
|
|
14
|
+
* `ContractSerializer` SPI: `serializeContract` returns `JsonObject` so that
|
|
15
|
+
* call sites can stringify, hash, or feed the result into another SPI without
|
|
16
|
+
* re-asserting JSON-cleanness.
|
|
17
|
+
*/
|
|
18
|
+
type JsonPrimitive = string | number | boolean | null;
|
|
19
|
+
type JsonArray = readonly JsonValue[];
|
|
20
|
+
type JsonObject = {
|
|
21
|
+
readonly [key: string]: JsonValue;
|
|
22
|
+
};
|
|
23
|
+
type JsonValue = JsonPrimitive | JsonArray | JsonObject;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { JsonValue as i, JsonObject as n, JsonPrimitive as r, JsonArray as t };
|
|
26
|
+
//# sourceMappingURL=json-Dkqr3say.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-Dkqr3say.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/utils/dist/json.d.mts"],"mappings":";;;;;;;;;;;;;;;;;KAgBK;KACA,qBAAqB;KACrB;YACO,cAAc;;KAErB,YAAY,gBAAgB,YAAY"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { t as CliStructuredError } from "./control-Ftiau058-CCeJcAVQ.mjs";
|
|
2
|
+
//#region ../../../1-framework/1-core/errors/dist/migration.mjs
|
|
3
|
+
/**
|
|
4
|
+
* A scaffolded migration contains a placeholder slot that was never filled in.
|
|
5
|
+
*
|
|
6
|
+
* Thrown at emit time (when `check.source()` or `run()` is invoked) via the
|
|
7
|
+
* `placeholder(...)` utility. The `slot` identifies the exact location the
|
|
8
|
+
* author still needs to edit, e.g. `"backfill-product-status:check.source"`.
|
|
9
|
+
*/
|
|
10
|
+
function errorUnfilledPlaceholder(slot) {
|
|
11
|
+
return new CliStructuredError("MIGRATION.UNFILLED_PLACEHOLDER", "Unfilled migration placeholder", {
|
|
12
|
+
why: `The migration contains a placeholder that has not been filled in: ${slot}`,
|
|
13
|
+
fix: "Open migration.ts and replace the `placeholder(...)` call with your actual query.",
|
|
14
|
+
meta: { slot }
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Scaffolded `migration.ts` files call this wherever the scaffolder couldn't
|
|
19
|
+
* emit a real query and the author is expected to fill one in. Always throws
|
|
20
|
+
* a structured migration error (`MIGRATION.UNFILLED_PLACEHOLDER`).
|
|
21
|
+
*
|
|
22
|
+
* The return type `never` makes it assignable to any expected return type, so
|
|
23
|
+
* a scaffolded `() => placeholder('...')` satisfies signatures like
|
|
24
|
+
* `() => MongoQueryPlan` without polluting them with a sentinel union arm.
|
|
25
|
+
*/
|
|
26
|
+
function placeholder(slot) {
|
|
27
|
+
throw errorUnfilledPlaceholder(slot);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A `dataTransform(endContract, …)` factory was handed a `SqlQueryPlan` whose
|
|
31
|
+
* `meta.storageHash` does not match the `endContract.storage.storageHash` it
|
|
32
|
+
* was configured with. This almost always means the user's query-builder
|
|
33
|
+
* (`sql({ context: createExecutionContext({ contract: endContract, … }) })`)
|
|
34
|
+
* was instantiated from a different contract reference than the one passed
|
|
35
|
+
* to `dataTransform(endContract, …)`.
|
|
36
|
+
*
|
|
37
|
+
* Distinct from `errorHashMismatch` (`CONTRACT.MARKER_MISMATCH`) which
|
|
38
|
+
* rejects a plan at runtime execution; this is an authoring-time rejection
|
|
39
|
+
* so it lives in the `MIGRATION` namespace.
|
|
40
|
+
*/
|
|
41
|
+
function errorDataTransformContractMismatch(options) {
|
|
42
|
+
return new CliStructuredError("MIGRATION.DATA_TRANSFORM_CONTRACT_MISMATCH", "dataTransform query plan built against wrong contract", {
|
|
43
|
+
why: `Data transform "${options.dataTransformName}" produced a query plan whose storage hash (${options.actual}) does not match the migration's contract (${options.expected}). The query builder was configured with a different contract than the one passed to dataTransform(endContract, ...).`,
|
|
44
|
+
fix: "Ensure the `endContract` imported at module scope (used for both `dataTransform(endContract, …)` and `sql({ context: createExecutionContext({ contract: endContract, … }) })`) is the same reference.",
|
|
45
|
+
meta: {
|
|
46
|
+
dataTransformName: options.dataTransformName,
|
|
47
|
+
expected: options.expected,
|
|
48
|
+
actual: options.actual
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* `migration.ts` was expected at the given package directory but could not be
|
|
54
|
+
* located. Thrown when consumers attempt to read a migration package that is
|
|
55
|
+
* missing its source file.
|
|
56
|
+
*/
|
|
57
|
+
function errorMigrationFileMissing(dir) {
|
|
58
|
+
return new CliStructuredError("MIGRATION.FILE_MISSING", "migration.ts not found", {
|
|
59
|
+
why: `No migration.ts file was found at "${dir}"`,
|
|
60
|
+
fix: "Scaffold one with `prisma-next migration new` or `prisma-next migration plan`.",
|
|
61
|
+
meta: { dir }
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The `migration.ts` at the given package directory does not default-export a
|
|
66
|
+
* valid migration shape. Two shapes are accepted: a `Migration` subclass, or a
|
|
67
|
+
* factory function returning a `MigrationPlan`-shaped object (with at least
|
|
68
|
+
* an `operations` array, plus `targetId` and `destination`). Thrown when the
|
|
69
|
+
* default export is missing, is not a constructor/function, does not extend
|
|
70
|
+
* `Migration`, or (for factory functions) returns a value that is not
|
|
71
|
+
* `MigrationPlan`-shaped.
|
|
72
|
+
*/
|
|
73
|
+
function errorMigrationInvalidDefaultExport(dir, actualExportDescription) {
|
|
74
|
+
return new CliStructuredError("MIGRATION.INVALID_DEFAULT_EXPORT", "migration.ts default export is not a valid migration", {
|
|
75
|
+
why: actualExportDescription !== void 0 ? `migration.ts at "${dir}" must default-export a Migration subclass or a factory function returning a MigrationPlan-shaped object; got ${actualExportDescription}` : `migration.ts at "${dir}" must default-export a Migration subclass or a factory function returning a MigrationPlan-shaped object.`,
|
|
76
|
+
fix: "Use `export default class extends Migration { ... }` or `export default () => ({ targetId, destination, operations })`.",
|
|
77
|
+
meta: {
|
|
78
|
+
dir,
|
|
79
|
+
...actualExportDescription !== void 0 ? { actualExport: actualExportDescription } : {}
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The migration class declares one `targetId` but the loaded
|
|
85
|
+
* `prisma-next.config.ts` declares another. Thrown by `MigrationCLI.run`
|
|
86
|
+
* when a migration script is invoked against a config whose target
|
|
87
|
+
* descriptor disagrees with the migration's own `targetId`. Distinct from generic
|
|
88
|
+
* config-validation errors because the mismatch is between two valid
|
|
89
|
+
* artifacts (the script and the config), not a malformed input.
|
|
90
|
+
*/
|
|
91
|
+
function errorMigrationTargetMismatch(options) {
|
|
92
|
+
return new CliStructuredError("MIGRATION.TARGET_MISMATCH", "Migration target does not match config target", {
|
|
93
|
+
why: `This migration is for target "${options.migrationTargetId}" but the loaded prisma-next.config.ts declares target "${options.configTargetId}". The migration script can only be run against a config that targets the same database.`,
|
|
94
|
+
fix: "Switch to a config whose `target` matches the migration's target, or pass `--config <path>` to point at the right config file.",
|
|
95
|
+
meta: {
|
|
96
|
+
migrationTargetId: options.migrationTargetId,
|
|
97
|
+
configTargetId: options.configTargetId
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* A `Migration.operations` getter returned a value that is not an array. Used
|
|
103
|
+
* by emit capabilities after instantiating the authored migration.
|
|
104
|
+
*/
|
|
105
|
+
function errorMigrationPlanNotArray(dir, actualValueDescription) {
|
|
106
|
+
return new CliStructuredError("MIGRATION.PLAN_NOT_ARRAY", "Migration.operations must be an array of operations", {
|
|
107
|
+
why: actualValueDescription !== void 0 ? `Migration.operations for migration.ts at "${dir}" was ${actualValueDescription}; an array of operations is required.` : `Migration.operations for migration.ts at "${dir}" is not an array of operations.`,
|
|
108
|
+
fix: "Ensure your `operations` getter returns an array of operations; see the data-migrations authoring guide.",
|
|
109
|
+
meta: {
|
|
110
|
+
dir,
|
|
111
|
+
...actualValueDescription !== void 0 ? { actualValue: actualValueDescription } : {}
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
//#endregion
|
|
116
|
+
export { errorMigrationTargetMismatch as a, errorMigrationPlanNotArray as i, errorMigrationFileMissing as n, errorUnfilledPlaceholder as o, errorMigrationInvalidDefaultExport as r, placeholder as s, errorDataTransformContractMismatch as t };
|
|
117
|
+
|
|
118
|
+
//# sourceMappingURL=migration-4VOHVEzx.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-4VOHVEzx.mjs","names":[],"sources":["../../../../1-framework/1-core/errors/dist/migration.mjs"],"sourcesContent":["import { t as CliStructuredError } from \"./control-Ftiau058.mjs\";\n//#region src/migration.ts\n/**\n* A scaffolded migration contains a placeholder slot that was never filled in.\n*\n* Thrown at emit time (when `check.source()` or `run()` is invoked) via the\n* `placeholder(...)` utility. The `slot` identifies the exact location the\n* author still needs to edit, e.g. `\"backfill-product-status:check.source\"`.\n*/\nfunction errorUnfilledPlaceholder(slot) {\n\treturn new CliStructuredError(\"MIGRATION.UNFILLED_PLACEHOLDER\", \"Unfilled migration placeholder\", {\n\t\twhy: `The migration contains a placeholder that has not been filled in: ${slot}`,\n\t\tfix: \"Open migration.ts and replace the `placeholder(...)` call with your actual query.\",\n\t\tmeta: { slot }\n\t});\n}\n/**\n* Scaffolded `migration.ts` files call this wherever the scaffolder couldn't\n* emit a real query and the author is expected to fill one in. Always throws\n* a structured migration error (`MIGRATION.UNFILLED_PLACEHOLDER`).\n*\n* The return type `never` makes it assignable to any expected return type, so\n* a scaffolded `() => placeholder('...')` satisfies signatures like\n* `() => MongoQueryPlan` without polluting them with a sentinel union arm.\n*/\nfunction placeholder(slot) {\n\tthrow errorUnfilledPlaceholder(slot);\n}\n/**\n* A `dataTransform(endContract, …)` factory was handed a `SqlQueryPlan` whose\n* `meta.storageHash` does not match the `endContract.storage.storageHash` it\n* was configured with. This almost always means the user's query-builder\n* (`sql({ context: createExecutionContext({ contract: endContract, … }) })`)\n* was instantiated from a different contract reference than the one passed\n* to `dataTransform(endContract, …)`.\n*\n* Distinct from `errorHashMismatch` (`CONTRACT.MARKER_MISMATCH`) which\n* rejects a plan at runtime execution; this is an authoring-time rejection\n* so it lives in the `MIGRATION` namespace.\n*/\nfunction errorDataTransformContractMismatch(options) {\n\treturn new CliStructuredError(\"MIGRATION.DATA_TRANSFORM_CONTRACT_MISMATCH\", \"dataTransform query plan built against wrong contract\", {\n\t\twhy: `Data transform \"${options.dataTransformName}\" produced a query plan whose storage hash (${options.actual}) does not match the migration's contract (${options.expected}). The query builder was configured with a different contract than the one passed to dataTransform(endContract, ...).`,\n\t\tfix: \"Ensure the `endContract` imported at module scope (used for both `dataTransform(endContract, …)` and `sql({ context: createExecutionContext({ contract: endContract, … }) })`) is the same reference.\",\n\t\tmeta: {\n\t\t\tdataTransformName: options.dataTransformName,\n\t\t\texpected: options.expected,\n\t\t\tactual: options.actual\n\t\t}\n\t});\n}\n/**\n* `migration.ts` was expected at the given package directory but could not be\n* located. Thrown when consumers attempt to read a migration package that is\n* missing its source file.\n*/\nfunction errorMigrationFileMissing(dir) {\n\treturn new CliStructuredError(\"MIGRATION.FILE_MISSING\", \"migration.ts not found\", {\n\t\twhy: `No migration.ts file was found at \"${dir}\"`,\n\t\tfix: \"Scaffold one with `prisma-next migration new` or `prisma-next migration plan`.\",\n\t\tmeta: { dir }\n\t});\n}\n/**\n* The `migration.ts` at the given package directory does not default-export a\n* valid migration shape. Two shapes are accepted: a `Migration` subclass, or a\n* factory function returning a `MigrationPlan`-shaped object (with at least\n* an `operations` array, plus `targetId` and `destination`). Thrown when the\n* default export is missing, is not a constructor/function, does not extend\n* `Migration`, or (for factory functions) returns a value that is not\n* `MigrationPlan`-shaped.\n*/\nfunction errorMigrationInvalidDefaultExport(dir, actualExportDescription) {\n\treturn new CliStructuredError(\"MIGRATION.INVALID_DEFAULT_EXPORT\", \"migration.ts default export is not a valid migration\", {\n\t\twhy: actualExportDescription !== void 0 ? `migration.ts at \"${dir}\" must default-export a Migration subclass or a factory function returning a MigrationPlan-shaped object; got ${actualExportDescription}` : `migration.ts at \"${dir}\" must default-export a Migration subclass or a factory function returning a MigrationPlan-shaped object.`,\n\t\tfix: \"Use `export default class extends Migration { ... }` or `export default () => ({ targetId, destination, operations })`.\",\n\t\tmeta: {\n\t\t\tdir,\n\t\t\t...actualExportDescription !== void 0 ? { actualExport: actualExportDescription } : {}\n\t\t}\n\t});\n}\n/**\n* The migration class declares one `targetId` but the loaded\n* `prisma-next.config.ts` declares another. Thrown by `MigrationCLI.run`\n* when a migration script is invoked against a config whose target\n* descriptor disagrees with the migration's own `targetId`. Distinct from generic\n* config-validation errors because the mismatch is between two valid\n* artifacts (the script and the config), not a malformed input.\n*/\nfunction errorMigrationTargetMismatch(options) {\n\treturn new CliStructuredError(\"MIGRATION.TARGET_MISMATCH\", \"Migration target does not match config target\", {\n\t\twhy: `This migration is for target \"${options.migrationTargetId}\" but the loaded prisma-next.config.ts declares target \"${options.configTargetId}\". The migration script can only be run against a config that targets the same database.`,\n\t\tfix: \"Switch to a config whose `target` matches the migration's target, or pass `--config <path>` to point at the right config file.\",\n\t\tmeta: {\n\t\t\tmigrationTargetId: options.migrationTargetId,\n\t\t\tconfigTargetId: options.configTargetId\n\t\t}\n\t});\n}\n/**\n* A `Migration.operations` getter returned a value that is not an array. Used\n* by emit capabilities after instantiating the authored migration.\n*/\nfunction errorMigrationPlanNotArray(dir, actualValueDescription) {\n\treturn new CliStructuredError(\"MIGRATION.PLAN_NOT_ARRAY\", \"Migration.operations must be an array of operations\", {\n\t\twhy: actualValueDescription !== void 0 ? `Migration.operations for migration.ts at \"${dir}\" was ${actualValueDescription}; an array of operations is required.` : `Migration.operations for migration.ts at \"${dir}\" is not an array of operations.`,\n\t\tfix: \"Ensure your `operations` getter returns an array of operations; see the data-migrations authoring guide.\",\n\t\tmeta: {\n\t\t\tdir,\n\t\t\t...actualValueDescription !== void 0 ? { actualValue: actualValueDescription } : {}\n\t\t}\n\t});\n}\n//#endregion\nexport { errorDataTransformContractMismatch, errorMigrationFileMissing, errorMigrationInvalidDefaultExport, errorMigrationPlanNotArray, errorMigrationTargetMismatch, errorUnfilledPlaceholder, placeholder };\n\n//# sourceMappingURL=migration.mjs.map"],"mappings":";;;;;;;;;AASA,SAAS,yBAAyB,MAAM;CACvC,OAAO,IAAI,mBAAmB,kCAAkC,kCAAkC;EACjG,KAAK,qEAAqE;EAC1E,KAAK;EACL,MAAM,EAAE,KAAK;CACd,CAAC;AACF;;;;;;;;;;AAUA,SAAS,YAAY,MAAM;CAC1B,MAAM,yBAAyB,IAAI;AACpC;;;;;;;;;;;;;AAaA,SAAS,mCAAmC,SAAS;CACpD,OAAO,IAAI,mBAAmB,8CAA8C,yDAAyD;EACpI,KAAK,mBAAmB,QAAQ,kBAAkB,8CAA8C,QAAQ,OAAO,6CAA6C,QAAQ,SAAS;EAC7K,KAAK;EACL,MAAM;GACL,mBAAmB,QAAQ;GAC3B,UAAU,QAAQ;GAClB,QAAQ,QAAQ;EACjB;CACD,CAAC;AACF;;;;;;AAMA,SAAS,0BAA0B,KAAK;CACvC,OAAO,IAAI,mBAAmB,0BAA0B,0BAA0B;EACjF,KAAK,sCAAsC,IAAI;EAC/C,KAAK;EACL,MAAM,EAAE,IAAI;CACb,CAAC;AACF;;;;;;;;;;AAUA,SAAS,mCAAmC,KAAK,yBAAyB;CACzE,OAAO,IAAI,mBAAmB,oCAAoC,wDAAwD;EACzH,KAAK,4BAA4B,KAAK,IAAI,oBAAoB,IAAI,gHAAgH,4BAA4B,oBAAoB,IAAI;EACtO,KAAK;EACL,MAAM;GACL;GACA,GAAG,4BAA4B,KAAK,IAAI,EAAE,cAAc,wBAAwB,IAAI,CAAC;EACtF;CACD,CAAC;AACF;;;;;;;;;AASA,SAAS,6BAA6B,SAAS;CAC9C,OAAO,IAAI,mBAAmB,6BAA6B,iDAAiD;EAC3G,KAAK,iCAAiC,QAAQ,kBAAkB,0DAA0D,QAAQ,eAAe;EACjJ,KAAK;EACL,MAAM;GACL,mBAAmB,QAAQ;GAC3B,gBAAgB,QAAQ;EACzB;CACD,CAAC;AACF;;;;;AAKA,SAAS,2BAA2B,KAAK,wBAAwB;CAChE,OAAO,IAAI,mBAAmB,4BAA4B,uDAAuD;EAChH,KAAK,2BAA2B,KAAK,IAAI,6CAA6C,IAAI,QAAQ,uBAAuB,yCAAyC,6CAA6C,IAAI;EACnN,KAAK;EACL,MAAM;GACL;GACA,GAAG,2BAA2B,KAAK,IAAI,EAAE,aAAa,uBAAuB,IAAI,CAAC;EACnF;CACD,CAAC;AACF"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { r as CliStructuredError } from "./control-B87KWI_K-C_R8WfEr.mjs";
|
|
2
|
+
//#region ../../../1-framework/1-core/errors/dist/migration.d.mts
|
|
3
|
+
//#region src/migration.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* A scaffolded migration contains a placeholder slot that was never filled in.
|
|
6
|
+
*
|
|
7
|
+
* Thrown at emit time (when `check.source()` or `run()` is invoked) via the
|
|
8
|
+
* `placeholder(...)` utility. The `slot` identifies the exact location the
|
|
9
|
+
* author still needs to edit, e.g. `"backfill-product-status:check.source"`.
|
|
10
|
+
*/
|
|
11
|
+
declare function errorUnfilledPlaceholder(slot: string): CliStructuredError;
|
|
12
|
+
/**
|
|
13
|
+
* Scaffolded `migration.ts` files call this wherever the scaffolder couldn't
|
|
14
|
+
* emit a real query and the author is expected to fill one in. Always throws
|
|
15
|
+
* a structured migration error (`MIGRATION.UNFILLED_PLACEHOLDER`).
|
|
16
|
+
*
|
|
17
|
+
* The return type `never` makes it assignable to any expected return type, so
|
|
18
|
+
* a scaffolded `() => placeholder('...')` satisfies signatures like
|
|
19
|
+
* `() => MongoQueryPlan` without polluting them with a sentinel union arm.
|
|
20
|
+
*/
|
|
21
|
+
declare function placeholder(slot: string): never;
|
|
22
|
+
/**
|
|
23
|
+
* A `dataTransform(endContract, …)` factory was handed a `SqlQueryPlan` whose
|
|
24
|
+
* `meta.storageHash` does not match the `endContract.storage.storageHash` it
|
|
25
|
+
* was configured with. This almost always means the user's query-builder
|
|
26
|
+
* (`sql({ context: createExecutionContext({ contract: endContract, … }) })`)
|
|
27
|
+
* was instantiated from a different contract reference than the one passed
|
|
28
|
+
* to `dataTransform(endContract, …)`.
|
|
29
|
+
*
|
|
30
|
+
* Distinct from `errorHashMismatch` (`CONTRACT.MARKER_MISMATCH`) which
|
|
31
|
+
* rejects a plan at runtime execution; this is an authoring-time rejection
|
|
32
|
+
* so it lives in the `MIGRATION` namespace.
|
|
33
|
+
*/
|
|
34
|
+
declare function errorDataTransformContractMismatch(options: {
|
|
35
|
+
readonly dataTransformName: string;
|
|
36
|
+
readonly expected: string;
|
|
37
|
+
readonly actual: string;
|
|
38
|
+
}): CliStructuredError;
|
|
39
|
+
/**
|
|
40
|
+
* `migration.ts` was expected at the given package directory but could not be
|
|
41
|
+
* located. Thrown when consumers attempt to read a migration package that is
|
|
42
|
+
* missing its source file.
|
|
43
|
+
*/
|
|
44
|
+
declare function errorMigrationFileMissing(dir: string): CliStructuredError;
|
|
45
|
+
/**
|
|
46
|
+
* The `migration.ts` at the given package directory does not default-export a
|
|
47
|
+
* valid migration shape. Two shapes are accepted: a `Migration` subclass, or a
|
|
48
|
+
* factory function returning a `MigrationPlan`-shaped object (with at least
|
|
49
|
+
* an `operations` array, plus `targetId` and `destination`). Thrown when the
|
|
50
|
+
* default export is missing, is not a constructor/function, does not extend
|
|
51
|
+
* `Migration`, or (for factory functions) returns a value that is not
|
|
52
|
+
* `MigrationPlan`-shaped.
|
|
53
|
+
*/
|
|
54
|
+
declare function errorMigrationInvalidDefaultExport(dir: string, actualExportDescription?: string): CliStructuredError;
|
|
55
|
+
/**
|
|
56
|
+
* The migration class declares one `targetId` but the loaded
|
|
57
|
+
* `prisma-next.config.ts` declares another. Thrown by `MigrationCLI.run`
|
|
58
|
+
* when a migration script is invoked against a config whose target
|
|
59
|
+
* descriptor disagrees with the migration's own `targetId`. Distinct from generic
|
|
60
|
+
* config-validation errors because the mismatch is between two valid
|
|
61
|
+
* artifacts (the script and the config), not a malformed input.
|
|
62
|
+
*/
|
|
63
|
+
declare function errorMigrationTargetMismatch(options: {
|
|
64
|
+
readonly migrationTargetId: string;
|
|
65
|
+
readonly configTargetId: string;
|
|
66
|
+
}): CliStructuredError;
|
|
67
|
+
/**
|
|
68
|
+
* A `Migration.operations` getter returned a value that is not an array. Used
|
|
69
|
+
* by emit capabilities after instantiating the authored migration.
|
|
70
|
+
*/
|
|
71
|
+
declare function errorMigrationPlanNotArray(dir: string, actualValueDescription?: string): CliStructuredError;
|
|
72
|
+
//#endregion
|
|
73
|
+
export { errorMigrationTargetMismatch as a, errorMigrationPlanNotArray as i, errorMigrationFileMissing as n, errorUnfilledPlaceholder as o, errorMigrationInvalidDefaultExport as r, placeholder as s, errorDataTransformContractMismatch as t };
|
|
74
|
+
//# sourceMappingURL=migration-DKbDzBwy.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-DKbDzBwy.d.mts","names":[],"sources":["../../../../1-framework/1-core/errors/dist/migration.d.mts"],"mappings":";;;;;;;;;;iBASiB,yBAAyB,eAAe;;;;;;;;;;iBAUxC,YAAY;;;;;;;;;;;;;iBAaZ,mCAAmC;WACzC;WACA;WACA;IACP;;;;;;iBAMa,0BAA0B,cAAc;;;;;;;;;;iBAUxC,mCAAmC,aAAa,mCAAmC;;;;;;;;;iBASnF,6BAA6B;WACnC;WACA;IACP;;;;;iBAKa,2BAA2B,aAAa,kCAAkC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { t as blindCast } from "./casts-DpaahrlC-Bd5n2coI.mjs";
|
|
2
|
+
//#region ../../../1-framework/0-foundation/contract/dist/namespace-id-asbWpwMw.mjs
|
|
3
|
+
function asNamespaceId(value) {
|
|
4
|
+
return blindCast(value);
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
export { asNamespaceId as t };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=namespace-id-asbWpwMw-3yxn-tRe.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namespace-id-asbWpwMw-3yxn-tRe.mjs","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/namespace-id-asbWpwMw.mjs"],"sourcesContent":["import { blindCast } from \"@internal/utils/casts\";\n//#region src/namespace-id.ts\nfunction asNamespaceId(value) {\n\treturn blindCast(value);\n}\n//#endregion\nexport { asNamespaceId as t };\n\n//# sourceMappingURL=namespace-id-asbWpwMw.mjs.map"],"mappings":";;AAEA,SAAS,cAAc,OAAO;CAC7B,OAAO,UAAU,KAAK;AACvB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//#region ../../../1-framework/1-core/operations/dist/index.d.mts
|
|
2
|
+
//#region src/index.d.ts
|
|
3
|
+
interface ParamSpec {
|
|
4
|
+
readonly codecId?: string;
|
|
5
|
+
readonly traits?: readonly string[];
|
|
6
|
+
readonly nullable: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface ReturnSpec {
|
|
9
|
+
readonly codecId: string;
|
|
10
|
+
readonly nullable: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* What an operation attaches to: a concrete codec identity, a set of codec
|
|
14
|
+
* traits the field's codec must carry, or list-typed (`many`) fields.
|
|
15
|
+
*
|
|
16
|
+
* Families refine this structurally — a family self spec may add its own
|
|
17
|
+
* members (for example element-level trait gating on the list variant) as
|
|
18
|
+
* long as every variant stays assignable to one here.
|
|
19
|
+
*/
|
|
20
|
+
type SelfSpec = {
|
|
21
|
+
readonly codecId: string;
|
|
22
|
+
readonly traits?: never;
|
|
23
|
+
readonly many?: never;
|
|
24
|
+
} | {
|
|
25
|
+
readonly traits: readonly string[];
|
|
26
|
+
readonly codecId?: never;
|
|
27
|
+
readonly many?: never;
|
|
28
|
+
} | {
|
|
29
|
+
readonly many: true;
|
|
30
|
+
readonly codecId?: never;
|
|
31
|
+
readonly traits?: never;
|
|
32
|
+
};
|
|
33
|
+
interface OperationEntry {
|
|
34
|
+
readonly self?: SelfSpec;
|
|
35
|
+
readonly impl: (...args: never[]) => unknown;
|
|
36
|
+
}
|
|
37
|
+
type OperationDescriptor<T extends OperationEntry = OperationEntry> = T;
|
|
38
|
+
type OperationDescriptors<T extends OperationEntry = OperationEntry> = Readonly<Record<string, OperationDescriptor<T>>>;
|
|
39
|
+
interface OperationRegistry<T extends OperationEntry = OperationEntry> {
|
|
40
|
+
register(name: string, descriptor: OperationDescriptor<T>): void;
|
|
41
|
+
entries(): Readonly<Record<string, T>>;
|
|
42
|
+
}
|
|
43
|
+
declare function createOperationRegistry<T extends OperationEntry = OperationEntry>(): OperationRegistry<T>;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { OperationDescriptor, OperationDescriptors, OperationEntry, OperationRegistry, ParamSpec, ReturnSpec, SelfSpec, createOperationRegistry };
|
|
46
|
+
//# sourceMappingURL=operations.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.d.mts","names":[],"sources":["../../../../1-framework/1-core/operations/dist/index.d.mts"],"mappings":";;UACU;WACC;WACA;WACA;;UAED;WACC;WACA;;;;;;;;;;KAUN;WACM;WACA;WACA;;WAEA;WACA;WACA;;WAEA;WACA;WACA;;UAED;WACC,OAAO;WACP,UAAU;;KAEhB,oBAAoB,UAAU,iBAAiB,kBAAkB;KACjE,qBAAqB,UAAU,iBAAiB,kBAAkB,SAAS,eAAe,oBAAoB;UACzG,kBAAkB,UAAU,iBAAiB;EACrD,SAAS,cAAc,YAAY,oBAAoB;EACvD,WAAW,SAAS,eAAe;;iBAEpB,wBAAwB,UAAU,iBAAiB,mBAAmB,kBAAkB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { a as structuredError } from "./structured-error-H6WU9Kjt.mjs";
|
|
2
|
+
//#region ../../../1-framework/1-core/operations/dist/index.mjs
|
|
3
|
+
function contractError(code, message, options) {
|
|
4
|
+
return structuredError(code, message, options);
|
|
5
|
+
}
|
|
6
|
+
function createOperationRegistry() {
|
|
7
|
+
const operations = Object.create(null);
|
|
8
|
+
return {
|
|
9
|
+
register(name, descriptor) {
|
|
10
|
+
if (name in operations) throw contractError("CONTRACT.PACK_CONTRIBUTION_INVALID", `Operation "${name}" is already registered`, { meta: { operation: name } });
|
|
11
|
+
if (descriptor.self) {
|
|
12
|
+
const hasCodecId = descriptor.self.codecId !== void 0;
|
|
13
|
+
const hasTraits = descriptor.self.traits !== void 0 && descriptor.self.traits.length > 0;
|
|
14
|
+
const targetsMany = descriptor.self.many === true;
|
|
15
|
+
if (!hasCodecId && !hasTraits && !targetsMany) throw contractError("CONTRACT.PACK_CONTRIBUTION_INVALID", `Operation "${name}" self has none of codecId, traits, or many`, { meta: { operation: name } });
|
|
16
|
+
if (hasCodecId && hasTraits) throw contractError("CONTRACT.PACK_CONTRIBUTION_INVALID", `Operation "${name}" self has both codecId and traits`, { meta: { operation: name } });
|
|
17
|
+
}
|
|
18
|
+
operations[name] = descriptor;
|
|
19
|
+
},
|
|
20
|
+
entries() {
|
|
21
|
+
return Object.freeze({ ...operations });
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { createOperationRegistry };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=operations.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.mjs","names":[],"sources":["../../../../1-framework/1-core/operations/dist/index.mjs"],"sourcesContent":["import { 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/index.ts\nfunction createOperationRegistry() {\n\tconst operations = Object.create(null);\n\treturn {\n\t\tregister(name, descriptor) {\n\t\t\tif (name in operations) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Operation \"${name}\" is already registered`, { meta: { operation: name } });\n\t\t\tif (descriptor.self) {\n\t\t\t\tconst hasCodecId = descriptor.self.codecId !== void 0;\n\t\t\t\tconst hasTraits = descriptor.self.traits !== void 0 && descriptor.self.traits.length > 0;\n\t\t\t\tconst targetsMany = descriptor.self.many === true;\n\t\t\t\tif (!hasCodecId && !hasTraits && !targetsMany) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Operation \"${name}\" self has none of codecId, traits, or many`, { meta: { operation: name } });\n\t\t\t\tif (hasCodecId && hasTraits) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Operation \"${name}\" self has both codecId and traits`, { meta: { operation: name } });\n\t\t\t}\n\t\t\toperations[name] = descriptor;\n\t\t},\n\t\tentries() {\n\t\t\treturn Object.freeze({ ...operations });\n\t\t}\n\t};\n}\n//#endregion\nexport { createOperationRegistry };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;AAEA,SAAS,cAAc,MAAM,SAAS,SAAS;CAC9C,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C;AAGA,SAAS,0BAA0B;CAClC,MAAM,aAAa,OAAO,OAAO,IAAI;CACrC,OAAO;EACN,SAAS,MAAM,YAAY;GAC1B,IAAI,QAAQ,YAAY,MAAM,cAAc,sCAAsC,cAAc,KAAK,0BAA0B,EAAE,MAAM,EAAE,WAAW,KAAK,EAAE,CAAC;GAC5J,IAAI,WAAW,MAAM;IACpB,MAAM,aAAa,WAAW,KAAK,YAAY,KAAK;IACpD,MAAM,YAAY,WAAW,KAAK,WAAW,KAAK,KAAK,WAAW,KAAK,OAAO,SAAS;IACvF,MAAM,cAAc,WAAW,KAAK,SAAS;IAC7C,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,aAAa,MAAM,cAAc,sCAAsC,cAAc,KAAK,8CAA8C,EAAE,MAAM,EAAE,WAAW,KAAK,EAAE,CAAC;IACvM,IAAI,cAAc,WAAW,MAAM,cAAc,sCAAsC,cAAc,KAAK,qCAAqC,EAAE,MAAM,EAAE,WAAW,KAAK,EAAE,CAAC;GAC7K;GACA,WAAW,QAAQ;EACpB;EACA,UAAU;GACT,OAAO,OAAO,OAAO,EAAE,GAAG,WAAW,CAAC;EACvC;CACD;AACD"}
|