@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 @@
|
|
|
1
|
+
{"version":3,"file":"control-CBvTj7Ia.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/control.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA6BU,mBAAmB;;;;;;;;;;;;EAY3B,oBAAoB,UAAU,YAAY,WAAW,gBAAgB;;;;;;;;;;EAUrE,kBAAkB,UAAU,YAAY;;;;;;;;WAQ/B,sBAAsB;;;;;;;;WAQtB,cAAc;;;;cAIX;;iBAEG,eAAe;;iBAEf,8BAA8B,6BAA6B;;iBAE3D,+BAA+B,6BAA6B;;;;;;;;;;KAUxE;WACM;WACA;;UAED,gBAAgB,cAAc,eAAe;;WAE5C;;WAEA,WAAW;;WAEX,SAAS;;;;;;;;WAQT;;;;;;;;;;;;;;;;KAgBN;;;;;;;iBAOY,aAAa,OAAO,kBAAkB;;;;;;;;;;;;;;;UAe7C;WACC;WACA;;;;;;;WAOA,qBAAqB;EAC9B,UAAU,OA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EpD,oBAAoB,0BAA0B,WAAW,UAAU,sBAAsB,WAAW,aAAa,YAAY,sBAAsB,WAAW,aAAa;;;;;;;;;;;;;KAavL;;;;;;;;;;;;;;;;;UAiBK;EACR,2BAA2B,OAAO,kBAAkB;EACpD,mBAAmB,OAAO;;iBAEX,2BAA2B,0BAA0B,WAAW,UAAU,sBAAsB,WAAW,aAAa,YAAY,sBAAsB,WAAW,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2BlL,0BAA0B,cAAc,eAAe,cAAc,iBAAiB,gBAAgB,oBAAoB,gBAAgB;;;;;;;;;;;;;;;;;;UAkBjJ,eAAe,WAAW;EAClC,aAAa,SAAS,oBAAoB,WAAW,WAAW;;;;;;;;UAQxD,oBAAoB,WAAW;WAC9B,UAAU;WACV,QAAQ;;;;;;;;UAQT;WACC;WACA,iBAAiB;;;;KAIvB;KACA,kBAAkB;;;;;;;;;;;;;;;;;KAiBlB;;;;;;;;;;iBAUY,uBAAuB,eAAe,eAAe,UAAU,wBAAwB"}
|
|
@@ -0,0 +1,621 @@
|
|
|
1
|
+
import { t as blindCast } from "./casts-DpaahrlC-Bd5n2coI.mjs";
|
|
2
|
+
import { t as InternalError } from "./internal-error-BIc-ehme-ouBQPoEL.mjs";
|
|
3
|
+
import { _ as mergeAuthoringNamespaces, a as collectScalarTypeConstructors, i as collectContributedDescriptorPaths, n as assertResolvableTypeConstructorTemplates, t as assertNoCrossRegistryCollisions } from "./framework-authoring-CDEvlouU-mlMWSksD.mjs";
|
|
4
|
+
import { n as materializeCodec, r as resolveCodecDescriptorOrThrow, t as CONTRACT_CODEC_DESCRIPTOR_MISSING } from "./resolve-codec-BZF8TZh_-D-xORT9Q.mjs";
|
|
5
|
+
import { t as mergeCapabilityMatrices } from "./capabilities-CPj7MfXO-GRkp0Q_D.mjs";
|
|
6
|
+
//#region ../../../1-framework/1-core/framework-components/dist/control.mjs
|
|
7
|
+
const CONTRACT_SNAPSHOTS_DIRNAME = "snapshots";
|
|
8
|
+
const STORAGE_HASH_PATTERN = /^[0-9a-f]{64}$/;
|
|
9
|
+
/** Validate a storage hash for use as a directory name. */
|
|
10
|
+
function storageHashHex(storageHash) {
|
|
11
|
+
if (!STORAGE_HASH_PATTERN.test(storageHash)) throw new InternalError(`Invalid storage hash "${storageHash}": expected 64 lowercase hex characters`);
|
|
12
|
+
return storageHash;
|
|
13
|
+
}
|
|
14
|
+
/** Module specifier for the store's `contract.json`, POSIX separators. */
|
|
15
|
+
function contractSnapshotJsonSpecifier(snapshotsImportPath, storageHash) {
|
|
16
|
+
return `${snapshotsImportPath}/${storageHashHex(storageHash)}/contract.json`;
|
|
17
|
+
}
|
|
18
|
+
/** Type-only module specifier for the store's `contract.d.ts` (no extension). */
|
|
19
|
+
function contractSnapshotTypesSpecifier(snapshotsImportPath, storageHash) {
|
|
20
|
+
return `${snapshotsImportPath}/${storageHashHex(storageHash)}/contract`;
|
|
21
|
+
}
|
|
22
|
+
function hasMigrations(target) {
|
|
23
|
+
return "migrations" in target && !!target["migrations"];
|
|
24
|
+
}
|
|
25
|
+
function hasSchemaView(instance) {
|
|
26
|
+
return "toSchemaView" in instance && typeof instance["toSchemaView"] === "function";
|
|
27
|
+
}
|
|
28
|
+
function hasPslContractInfer(instance) {
|
|
29
|
+
return "inferPslContract" in instance && typeof instance["inferPslContract"] === "function";
|
|
30
|
+
}
|
|
31
|
+
function hasOperationPreview(instance) {
|
|
32
|
+
return "toOperationPreview" in instance && typeof instance["toOperationPreview"] === "function";
|
|
33
|
+
}
|
|
34
|
+
function hasSchemaSubjectClassifier(instance) {
|
|
35
|
+
return "classifySubjectGranularity" in instance && typeof instance["classifySubjectGranularity"] === "function" && "classifyEntityKind" in instance && typeof instance["classifyEntityKind"] === "function";
|
|
36
|
+
}
|
|
37
|
+
const VERIFY_CODE_MARKER_MISSING = "CONTRACT.MARKER_MISSING";
|
|
38
|
+
const VERIFY_CODE_HASH_MISMATCH = "CONTRACT.MARKER_MISMATCH";
|
|
39
|
+
const VERIFY_CODE_TARGET_MISMATCH = "CONTRACT.TARGET_MISMATCH";
|
|
40
|
+
const VERIFY_CODE_SCHEMA_FAILURE = "CONTRACT.SCHEMA_VERIFICATION_FAILED";
|
|
41
|
+
var SchemaTreeNode = class {
|
|
42
|
+
kind;
|
|
43
|
+
id;
|
|
44
|
+
label;
|
|
45
|
+
meta;
|
|
46
|
+
children;
|
|
47
|
+
constructor(options) {
|
|
48
|
+
this.kind = options.kind;
|
|
49
|
+
this.id = options.id;
|
|
50
|
+
this.label = options.label;
|
|
51
|
+
if (options.meta !== void 0) this.meta = options.meta;
|
|
52
|
+
if (options.children !== void 0) this.children = options.children;
|
|
53
|
+
Object.freeze(this);
|
|
54
|
+
}
|
|
55
|
+
accept(visitor) {
|
|
56
|
+
return visitor.visit(this);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Canonical control-plane identifiers for contract spaces.
|
|
61
|
+
*
|
|
62
|
+
* A contract space is the disjoint `(contract.json, migration-graph)` unit
|
|
63
|
+
* the per-space planner / runner / verifier (project: extension contract
|
|
64
|
+
* spaces, TML-2397) operates on. The application owns one well-known
|
|
65
|
+
* space — the value below — and each loaded extension that contributes
|
|
66
|
+
* schema owns a uniquely-named space.
|
|
67
|
+
*
|
|
68
|
+
* Lives in `framework-components/control` so every layer that has to
|
|
69
|
+
* reason about space identity (the migration tooling, the SQL runtime's
|
|
70
|
+
* marker reader, target-side statement builders, target-side adapters)
|
|
71
|
+
* can import a single value rather than duplicating the literal. Raw
|
|
72
|
+
* `'app'` string literals in framework / target / runtime / adapter
|
|
73
|
+
* source code are forbidden and policed by
|
|
74
|
+
* `scripts/lint-app-space-id.mjs` (wired into `pnpm lint:deps`).
|
|
75
|
+
*
|
|
76
|
+
* @see specs/framework-mechanism.spec.md § 3 — Layout convention (γ).
|
|
77
|
+
*/
|
|
78
|
+
const APP_SPACE_ID = "app";
|
|
79
|
+
function addUniqueId(ids, seen, id) {
|
|
80
|
+
if (!seen.has(id)) {
|
|
81
|
+
ids.push(id);
|
|
82
|
+
seen.add(id);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function assertUniqueCodecOwner(options) {
|
|
86
|
+
const existingOwner = options.owners.get(options.codecId);
|
|
87
|
+
if (existingOwner !== void 0) throw new InternalError(`Duplicate ${options.entityLabel} for codecId "${options.codecId}". Descriptor "${options.descriptorId}" conflicts with "${existingOwner}". Each codecId can only have one ${options.entityOwnershipLabel}.`);
|
|
88
|
+
}
|
|
89
|
+
function extractCodecTypeImports(descriptors) {
|
|
90
|
+
const imports = [];
|
|
91
|
+
for (const descriptor of descriptors) {
|
|
92
|
+
const codecTypes = descriptor.types?.codecTypes;
|
|
93
|
+
if (codecTypes?.import) imports.push(codecTypes.import);
|
|
94
|
+
if (codecTypes?.typeImports) imports.push(...codecTypes.typeImports);
|
|
95
|
+
}
|
|
96
|
+
return imports;
|
|
97
|
+
}
|
|
98
|
+
function extractQueryOperationTypeImports(descriptors) {
|
|
99
|
+
const imports = [];
|
|
100
|
+
for (const descriptor of descriptors) {
|
|
101
|
+
const queryOperationTypes = descriptor.types?.queryOperationTypes;
|
|
102
|
+
if (queryOperationTypes?.import) imports.push(queryOperationTypes.import);
|
|
103
|
+
}
|
|
104
|
+
return imports;
|
|
105
|
+
}
|
|
106
|
+
function extractComponentIds(family, target, adapter, extensions) {
|
|
107
|
+
const ids = [];
|
|
108
|
+
const seen = /* @__PURE__ */ new Set();
|
|
109
|
+
addUniqueId(ids, seen, family.id);
|
|
110
|
+
addUniqueId(ids, seen, target.id);
|
|
111
|
+
if (adapter) addUniqueId(ids, seen, adapter.id);
|
|
112
|
+
for (const ext of extensions) addUniqueId(ids, seen, ext.id);
|
|
113
|
+
return ids;
|
|
114
|
+
}
|
|
115
|
+
function assembleAuthoringContributions(descriptors) {
|
|
116
|
+
const field = {};
|
|
117
|
+
const type = {};
|
|
118
|
+
const entityTypes = {};
|
|
119
|
+
const pslBlockDescriptors = {};
|
|
120
|
+
const modelAttributes = {};
|
|
121
|
+
const pathOwners = /* @__PURE__ */ new Map();
|
|
122
|
+
const claimContributedPaths = (namespace, descriptorKind, label, descriptorId) => {
|
|
123
|
+
for (const path of collectContributedDescriptorPaths(namespace, descriptorKind)) {
|
|
124
|
+
const key = `${label}:${path}`;
|
|
125
|
+
const existingOwner = pathOwners.get(key);
|
|
126
|
+
if (existingOwner !== void 0) throw new InternalError(`Duplicate authoring ${label} helper "${path}". Descriptor "${descriptorId}" conflicts with "${existingOwner}".`);
|
|
127
|
+
pathOwners.set(key, descriptorId);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
let valueObjectStorageDeclaration;
|
|
131
|
+
for (const descriptor of descriptors) {
|
|
132
|
+
const descriptorId = descriptor.id ?? "<unknown>";
|
|
133
|
+
const declaredValueObjectStorageType = descriptor.authoring?.valueObjectStorageType;
|
|
134
|
+
if (declaredValueObjectStorageType !== void 0) {
|
|
135
|
+
if (valueObjectStorageDeclaration !== void 0) throw new InternalError(`Duplicate authoring valueObjectStorageType declaration. Descriptor "${descriptorId}" conflicts with "${valueObjectStorageDeclaration.ownerId}". Exactly one composed component may declare the value-object storage type.`);
|
|
136
|
+
valueObjectStorageDeclaration = {
|
|
137
|
+
name: declaredValueObjectStorageType,
|
|
138
|
+
ownerId: descriptorId
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
if (descriptor.authoring?.field) {
|
|
142
|
+
claimContributedPaths(descriptor.authoring.field, "fieldPreset", "field", descriptorId);
|
|
143
|
+
mergeAuthoringNamespaces(field, descriptor.authoring.field, [], "fieldPreset", "field");
|
|
144
|
+
}
|
|
145
|
+
if (descriptor.authoring?.type) {
|
|
146
|
+
claimContributedPaths(descriptor.authoring.type, "typeConstructor", "type", descriptorId);
|
|
147
|
+
assertResolvableTypeConstructorTemplates(descriptor.authoring.type, descriptorId);
|
|
148
|
+
mergeAuthoringNamespaces(type, descriptor.authoring.type, [], "typeConstructor", "type");
|
|
149
|
+
}
|
|
150
|
+
if (descriptor.authoring?.entityTypes) {
|
|
151
|
+
claimContributedPaths(descriptor.authoring.entityTypes, "entity", "entity", descriptorId);
|
|
152
|
+
mergeAuthoringNamespaces(entityTypes, descriptor.authoring.entityTypes, [], "entity", "entity");
|
|
153
|
+
}
|
|
154
|
+
if (descriptor.authoring?.pslBlockDescriptors) {
|
|
155
|
+
claimContributedPaths(descriptor.authoring.pslBlockDescriptors, "pslBlock", "pslBlock", descriptorId);
|
|
156
|
+
mergeAuthoringNamespaces(pslBlockDescriptors, descriptor.authoring.pslBlockDescriptors, [], "pslBlock", "pslBlock");
|
|
157
|
+
}
|
|
158
|
+
if (descriptor.authoring?.modelAttributes) mergeAuthoringNamespaces(modelAttributes, descriptor.authoring.modelAttributes, [], "modelAttribute", "modelAttribute");
|
|
159
|
+
}
|
|
160
|
+
const fieldNamespace = field;
|
|
161
|
+
const typeNamespace = type;
|
|
162
|
+
const entityTypeNamespace = entityTypes;
|
|
163
|
+
const pslBlockDescriptorNamespace = blindCast(pslBlockDescriptors);
|
|
164
|
+
const modelAttributeNamespace = blindCast(modelAttributes);
|
|
165
|
+
assertNoCrossRegistryCollisions(typeNamespace, fieldNamespace, entityTypeNamespace, pslBlockDescriptorNamespace, modelAttributeNamespace);
|
|
166
|
+
if (valueObjectStorageDeclaration !== void 0 && !collectScalarTypeConstructors(typeNamespace).has(valueObjectStorageDeclaration.name)) throw new InternalError(`Invalid authoring valueObjectStorageType "${valueObjectStorageDeclaration.name}" declared by descriptor "${valueObjectStorageDeclaration.ownerId}". The name must be a top-level bare-eligible type constructor in the assembled authoring namespace.`);
|
|
167
|
+
return {
|
|
168
|
+
field: fieldNamespace,
|
|
169
|
+
type: typeNamespace,
|
|
170
|
+
entityTypes: entityTypeNamespace,
|
|
171
|
+
pslBlockDescriptors: pslBlockDescriptorNamespace,
|
|
172
|
+
modelAttributes: modelAttributeNamespace,
|
|
173
|
+
...valueObjectStorageDeclaration !== void 0 ? { valueObjectStorageType: valueObjectStorageDeclaration.name } : {}
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
function assembleControlMutationDefaults(descriptors) {
|
|
177
|
+
const defaultFunctionRegistry = /* @__PURE__ */ new Map();
|
|
178
|
+
const functionOwners = /* @__PURE__ */ new Map();
|
|
179
|
+
const generatorMap = /* @__PURE__ */ new Map();
|
|
180
|
+
const generatorOwners = /* @__PURE__ */ new Map();
|
|
181
|
+
for (const descriptor of descriptors) {
|
|
182
|
+
const contributions = descriptor.controlMutationDefaults;
|
|
183
|
+
if (!contributions) continue;
|
|
184
|
+
const descriptorId = descriptor.id ?? "<unknown>";
|
|
185
|
+
for (const generatorDescriptor of contributions.generatorDescriptors) {
|
|
186
|
+
const existingOwner = generatorOwners.get(generatorDescriptor.id);
|
|
187
|
+
if (existingOwner !== void 0) throw new InternalError(`Duplicate mutation default generator id "${generatorDescriptor.id}". Descriptor "${descriptorId}" conflicts with "${existingOwner}".`);
|
|
188
|
+
generatorMap.set(generatorDescriptor.id, generatorDescriptor);
|
|
189
|
+
generatorOwners.set(generatorDescriptor.id, descriptorId);
|
|
190
|
+
}
|
|
191
|
+
for (const [functionName, handler] of contributions.defaultFunctionRegistry) {
|
|
192
|
+
const existingOwner = functionOwners.get(functionName);
|
|
193
|
+
if (existingOwner !== void 0) throw new InternalError(`Duplicate mutation default function "${functionName}". Descriptor "${descriptorId}" conflicts with "${existingOwner}".`);
|
|
194
|
+
defaultFunctionRegistry.set(functionName, handler);
|
|
195
|
+
functionOwners.set(functionName, descriptorId);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return {
|
|
199
|
+
defaultFunctionRegistry,
|
|
200
|
+
generatorDescriptors: Array.from(generatorMap.values())
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
function extractCodecLookup(descriptors) {
|
|
204
|
+
const byId = /* @__PURE__ */ new Map();
|
|
205
|
+
const descriptorsById = /* @__PURE__ */ new Map();
|
|
206
|
+
const targetTypesById = /* @__PURE__ */ new Map();
|
|
207
|
+
const renderersById = /* @__PURE__ */ new Map();
|
|
208
|
+
const inputRenderersById = /* @__PURE__ */ new Map();
|
|
209
|
+
const valueLiteralRenderersById = /* @__PURE__ */ new Map();
|
|
210
|
+
const owners = /* @__PURE__ */ new Map();
|
|
211
|
+
for (const descriptor of descriptors) {
|
|
212
|
+
const codecTypes = descriptor.types?.codecTypes;
|
|
213
|
+
const descriptorId = descriptor.id;
|
|
214
|
+
for (const codecDescriptor of codecTypes?.codecDescriptors ?? []) {
|
|
215
|
+
assertUniqueCodecOwner({
|
|
216
|
+
codecId: codecDescriptor.codecId,
|
|
217
|
+
owners,
|
|
218
|
+
descriptorId,
|
|
219
|
+
entityLabel: "codec descriptor",
|
|
220
|
+
entityOwnershipLabel: "codec descriptor provider"
|
|
221
|
+
});
|
|
222
|
+
owners.set(codecDescriptor.codecId, descriptorId);
|
|
223
|
+
descriptorsById.set(codecDescriptor.codecId, codecDescriptor);
|
|
224
|
+
if (Array.isArray(codecDescriptor.targetTypes)) targetTypesById.set(codecDescriptor.codecId, codecDescriptor.targetTypes);
|
|
225
|
+
if (typeof codecDescriptor.renderOutputType === "function") renderersById.set(codecDescriptor.codecId, codecDescriptor.renderOutputType);
|
|
226
|
+
if (typeof codecDescriptor.renderInputType === "function") inputRenderersById.set(codecDescriptor.codecId, codecDescriptor.renderInputType);
|
|
227
|
+
if (typeof codecDescriptor.renderValueLiteral === "function") valueLiteralRenderersById.set(codecDescriptor.codecId, codecDescriptor.renderValueLiteral);
|
|
228
|
+
if (!byId.has(codecDescriptor.codecId)) if (codecDescriptor.isParameterized) try {
|
|
229
|
+
const representative = codecDescriptor.factory({})({ name: `<lookup:${codecDescriptor.codecId}>` });
|
|
230
|
+
byId.set(codecDescriptor.codecId, representative);
|
|
231
|
+
} catch {}
|
|
232
|
+
else {
|
|
233
|
+
const representative = codecDescriptor.factory(void 0)({ name: `<lookup:${codecDescriptor.codecId}>` });
|
|
234
|
+
byId.set(codecDescriptor.codecId, representative);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return {
|
|
239
|
+
get: (id) => byId.get(id),
|
|
240
|
+
forCodecRef(ref) {
|
|
241
|
+
return materializeCodec(resolveCodecDescriptorOrThrow((id) => descriptorsById.get(id), ref, CONTRACT_CODEC_DESCRIPTOR_MISSING), ref, { name: `<ref:${ref.codecId}>` });
|
|
242
|
+
},
|
|
243
|
+
forColumn: () => void 0,
|
|
244
|
+
targetTypesFor: (id) => targetTypesById.get(id),
|
|
245
|
+
renderOutputTypeFor: (id, params) => renderersById.get(id)?.(params),
|
|
246
|
+
renderInputTypeFor: (id, params) => inputRenderersById.get(id)?.(params),
|
|
247
|
+
renderValueLiteralFor: (id, value, side) => valueLiteralRenderersById.get(id)?.(value, side),
|
|
248
|
+
descriptorFor: (id) => descriptorsById.get(id)
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
function assembleExtensionContracts(extensions) {
|
|
252
|
+
const result = /* @__PURE__ */ new Map();
|
|
253
|
+
for (const ext of extensions) {
|
|
254
|
+
if (ext.contractSpace === void 0) continue;
|
|
255
|
+
result.set(ext.id, ext.contractSpace.contractJson);
|
|
256
|
+
}
|
|
257
|
+
return result;
|
|
258
|
+
}
|
|
259
|
+
function readDeclaredDependencyIds(descriptor) {
|
|
260
|
+
const packs = descriptor.contractSpace?.contractJson?.extensions;
|
|
261
|
+
if (packs === null || typeof packs !== "object") return [];
|
|
262
|
+
return Object.keys(packs);
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Builds a dependency-respecting load order for the given extension descriptors
|
|
266
|
+
* using Kahn's topological sort algorithm. Dependencies (packs declared in
|
|
267
|
+
* `contractSpace.contractJson.extensions`) are placed before the extensions
|
|
268
|
+
* that depend on them.
|
|
269
|
+
*
|
|
270
|
+
* Throws if the dependency graph contains a cycle, with an error message that
|
|
271
|
+
* names every extension involved in the cycle.
|
|
272
|
+
*
|
|
273
|
+
* Throws if any extension declares a dependency on a pack ID that is not present
|
|
274
|
+
* in the provided list — add the missing pack to the `extensions` list to
|
|
275
|
+
* resolve the error.
|
|
276
|
+
*/
|
|
277
|
+
function buildExtensionLoadOrder(extensions) {
|
|
278
|
+
if (extensions.length === 0) return [];
|
|
279
|
+
const idSet = new Set(extensions.map((e) => e.id));
|
|
280
|
+
const inDegree = /* @__PURE__ */ new Map();
|
|
281
|
+
const dependents = /* @__PURE__ */ new Map();
|
|
282
|
+
for (const ext of extensions) {
|
|
283
|
+
if (!inDegree.has(ext.id)) inDegree.set(ext.id, 0);
|
|
284
|
+
if (!dependents.has(ext.id)) dependents.set(ext.id, []);
|
|
285
|
+
}
|
|
286
|
+
for (const ext of extensions) for (const depId of readDeclaredDependencyIds(ext)) {
|
|
287
|
+
if (!idSet.has(depId)) throw new InternalError(`Extension "${ext.id}" declares a dependency on "${depId}", but "${depId}" is not in the provided extension set. Add the missing space to extensions.`);
|
|
288
|
+
inDegree.set(ext.id, (inDegree.get(ext.id) ?? 0) + 1);
|
|
289
|
+
const list = dependents.get(depId);
|
|
290
|
+
if (list !== void 0) list.push(ext.id);
|
|
291
|
+
}
|
|
292
|
+
const queue = [];
|
|
293
|
+
for (const [id, deg] of inDegree) if (deg === 0) queue.push(id);
|
|
294
|
+
queue.sort();
|
|
295
|
+
const result = [];
|
|
296
|
+
while (queue.length > 0) {
|
|
297
|
+
const id = queue.shift();
|
|
298
|
+
if (id === void 0) break;
|
|
299
|
+
result.push(id);
|
|
300
|
+
const children = dependents.get(id) ?? [];
|
|
301
|
+
children.sort();
|
|
302
|
+
for (const childId of children) {
|
|
303
|
+
const newDeg = (inDegree.get(childId) ?? 1) - 1;
|
|
304
|
+
inDegree.set(childId, newDeg);
|
|
305
|
+
if (newDeg === 0) queue.push(childId);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
if (result.length < extensions.length) throw new InternalError(`Extension dependency cycle detected. Cycle members: ${extensions.map((e) => e.id).filter((id) => !result.includes(id)).sort().map((id) => `"${id}"`).join(", ")}.`);
|
|
309
|
+
return result;
|
|
310
|
+
}
|
|
311
|
+
function createControlStack(input) {
|
|
312
|
+
const { family, target, adapter, driver, extensions = [] } = input;
|
|
313
|
+
const orderedIds = buildExtensionLoadOrder(extensions);
|
|
314
|
+
const extensionById = new Map(extensions.map((ext) => [ext.id, ext]));
|
|
315
|
+
const orderedExtensions = orderedIds.map((id) => extensionById.get(id)).filter((ext) => ext !== void 0);
|
|
316
|
+
const allDescriptors = [
|
|
317
|
+
family,
|
|
318
|
+
target,
|
|
319
|
+
...adapter ? [adapter] : [],
|
|
320
|
+
...orderedExtensions
|
|
321
|
+
];
|
|
322
|
+
const codecLookup = extractCodecLookup(allDescriptors);
|
|
323
|
+
const authoringContributions = assembleAuthoringContributions(allDescriptors);
|
|
324
|
+
return {
|
|
325
|
+
family,
|
|
326
|
+
target,
|
|
327
|
+
adapter,
|
|
328
|
+
driver,
|
|
329
|
+
extensions: orderedExtensions,
|
|
330
|
+
extensionContracts: assembleExtensionContracts(orderedExtensions),
|
|
331
|
+
codecTypeImports: extractCodecTypeImports(allDescriptors),
|
|
332
|
+
queryOperationTypeImports: extractQueryOperationTypeImports(allDescriptors),
|
|
333
|
+
extensionIds: extractComponentIds(family, target, adapter, orderedExtensions),
|
|
334
|
+
codecLookup,
|
|
335
|
+
authoringContributions,
|
|
336
|
+
scalarTypes: [...collectScalarTypeConstructors(authoringContributions.type).keys()],
|
|
337
|
+
controlMutationDefaults: assembleControlMutationDefaults(allDescriptors),
|
|
338
|
+
capabilities: mergeCapabilityMatrices({}, [
|
|
339
|
+
target,
|
|
340
|
+
...adapter ? [adapter] : [],
|
|
341
|
+
...orderedExtensions
|
|
342
|
+
])
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
const PATH_DELIMITER = " ";
|
|
346
|
+
function pathKey(path) {
|
|
347
|
+
return path.join(PATH_DELIMITER);
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Whether an issue's op builds its subject up (create or alter) rather than
|
|
351
|
+
* only tearing it down. The differ sets `expected` on every create (`not-found`)
|
|
352
|
+
* and alter (`not-equal`) issue and leaves it absent on a pure drop
|
|
353
|
+
* (`not-expected`). This is the single signal the ordering law reads for edge
|
|
354
|
+
* direction — never `reason`.
|
|
355
|
+
*/
|
|
356
|
+
function buildsUp(issue) {
|
|
357
|
+
return issue.expected !== void 0;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* The nearest strict-ancestor bucket of `path` — the surviving parent entity a
|
|
361
|
+
* child is contained by. Walks the path's proper prefixes from longest to
|
|
362
|
+
* shortest and returns the first prefix that maps to a bucket; a gap (a prefix
|
|
363
|
+
* with no bucket) is skipped so containment always attaches to the closest real
|
|
364
|
+
* parent.
|
|
365
|
+
*
|
|
366
|
+
* Returns a list because a path prefix can be shared by two siblings of
|
|
367
|
+
* different `nodeKind` (a role and a namespace named alike); linking the child
|
|
368
|
+
* to every candidate over-constrains safely (the extra edge points at a same-
|
|
369
|
+
* direction op and never forms a cycle, since a parent never depends on its
|
|
370
|
+
* child) rather than risk picking the wrong one.
|
|
371
|
+
*/
|
|
372
|
+
function nearestAncestors(path, byPath) {
|
|
373
|
+
for (let end = path.length - 1; end >= 1; end -= 1) {
|
|
374
|
+
const bucket = byPath.get(pathKey(path.slice(0, end)));
|
|
375
|
+
if (bucket !== void 0) return bucket;
|
|
376
|
+
}
|
|
377
|
+
return [];
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Orders schema-diff issues so that every dependency's op precedes its
|
|
381
|
+
* dependent on the way up and follows it on the way down, breaking ties
|
|
382
|
+
* deterministically by path.
|
|
383
|
+
*
|
|
384
|
+
* Edges come from two sources:
|
|
385
|
+
* - **`dependsOn` cross-links** — the resolved issue-to-issue paths the differ
|
|
386
|
+
* mirrors onto each issue (a node's declared structural prerequisites). A
|
|
387
|
+
* path that resolves to no issue in this list is skipped (the dependency is
|
|
388
|
+
* satisfied by reality); a path shared by two same-id/different-kind siblings
|
|
389
|
+
* links to every match, over-constraining safely.
|
|
390
|
+
* - **containment** — every issue depends on its nearest strict-ancestor issue
|
|
391
|
+
* (a child entity on the parent entity that owns it). Subtree coalescing has
|
|
392
|
+
* already removed the descendants of a whole create/drop, so this only links
|
|
393
|
+
* the parent/child pairs that legitimately survive together.
|
|
394
|
+
*
|
|
395
|
+
* The ordering law reads each dependent's presence for direction: an issue that
|
|
396
|
+
* builds up (`expected` present — a create or alter) needs its dependency
|
|
397
|
+
* first; a pure drop needs its dependent removed first, so the edge reverses.
|
|
398
|
+
* The graph is a DAG by construction (dependencies point from dependents to
|
|
399
|
+
* their prerequisites, and prerequisites never point back), so a cycle is a
|
|
400
|
+
* derivation or authoring bug: the topological sort asserts acyclicity and
|
|
401
|
+
* throws, naming the issues it could not place.
|
|
402
|
+
*/
|
|
403
|
+
function orderIssuesByDependencies(issues) {
|
|
404
|
+
if (issues.length <= 1) return issues;
|
|
405
|
+
const nodes = issues.map((issue) => ({
|
|
406
|
+
issue,
|
|
407
|
+
key: pathKey(issue.path),
|
|
408
|
+
buildsUp: buildsUp(issue),
|
|
409
|
+
outgoing: /* @__PURE__ */ new Set(),
|
|
410
|
+
inDegree: 0
|
|
411
|
+
}));
|
|
412
|
+
const nodesByPath = /* @__PURE__ */ new Map();
|
|
413
|
+
for (const node of nodes) {
|
|
414
|
+
const bucket = nodesByPath.get(node.key);
|
|
415
|
+
if (bucket === void 0) nodesByPath.set(node.key, [node]);
|
|
416
|
+
else bucket.push(node);
|
|
417
|
+
}
|
|
418
|
+
const addEdge = (before, after) => {
|
|
419
|
+
if (before.outgoing.has(after)) return;
|
|
420
|
+
before.outgoing.add(after);
|
|
421
|
+
after.inDegree += 1;
|
|
422
|
+
};
|
|
423
|
+
const addDependency = (dependent, dependency) => {
|
|
424
|
+
if (dependent === dependency) return;
|
|
425
|
+
if (dependent.buildsUp) addEdge(dependency, dependent);
|
|
426
|
+
else addEdge(dependent, dependency);
|
|
427
|
+
};
|
|
428
|
+
for (const node of nodes) {
|
|
429
|
+
for (const targetPath of node.issue.dependsOn ?? []) for (const target of nodesByPath.get(pathKey(targetPath)) ?? []) addDependency(node, target);
|
|
430
|
+
for (const ancestor of nearestAncestors(node.issue.path, nodesByPath)) addDependency(node, ancestor);
|
|
431
|
+
}
|
|
432
|
+
const ready = nodes.filter((node) => node.inDegree === 0);
|
|
433
|
+
const order = [];
|
|
434
|
+
while (ready.length > 0) {
|
|
435
|
+
let best;
|
|
436
|
+
for (const candidate of ready) if (best === void 0 || candidate.key < best.key) best = candidate;
|
|
437
|
+
if (best === void 0) break;
|
|
438
|
+
ready.splice(ready.indexOf(best), 1);
|
|
439
|
+
order.push(best);
|
|
440
|
+
for (const next of best.outgoing) {
|
|
441
|
+
next.inDegree -= 1;
|
|
442
|
+
if (next.inDegree === 0) ready.push(next);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
if (order.length !== nodes.length) {
|
|
446
|
+
const placed = new Set(order);
|
|
447
|
+
throw new InternalError(`orderIssuesByDependencies: dependency cycle among schema-diff issues (unresolved: ${nodes.filter((node) => !placed.has(node)).map((node) => node.issue.path.join("/")).join(", ")})`);
|
|
448
|
+
}
|
|
449
|
+
return order.map((node) => node.issue);
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* The outcome an issue represents, discriminated by presence rather than any
|
|
453
|
+
* stored field — the single source of truth every consumer reads. An issue
|
|
454
|
+
* always carries at least one side by construction; neither is a malformed
|
|
455
|
+
* issue and throws.
|
|
456
|
+
*/
|
|
457
|
+
function issueOutcome(issue) {
|
|
458
|
+
const hasExpected = issue.expected !== void 0;
|
|
459
|
+
const hasActual = issue.actual !== void 0;
|
|
460
|
+
if (hasExpected && hasActual) return "not-equal";
|
|
461
|
+
if (hasExpected) return "not-found";
|
|
462
|
+
if (hasActual) return "not-expected";
|
|
463
|
+
throw new InternalError(`issueOutcome: issue at "${issue.path.join("/")}" carries neither an expected nor an actual node`);
|
|
464
|
+
}
|
|
465
|
+
/** Delimiter joining `nodeKind` and `id` into one sibling-map key. Every `nodeKind` is a code-defined literal (kebab-case-style), so a null character can never appear in one. */
|
|
466
|
+
const SIBLING_KEY_DELIMITER = "\0";
|
|
467
|
+
function siblingKey(node) {
|
|
468
|
+
return `${node.nodeKind}${SIBLING_KEY_DELIMITER}${node.id}`;
|
|
469
|
+
}
|
|
470
|
+
function insertNode(map, node) {
|
|
471
|
+
const key = siblingKey(node);
|
|
472
|
+
if (map.has(key)) throw new InternalError(`diffSchemas: duplicate id among siblings: ${node.nodeKind}/${node.id}`);
|
|
473
|
+
map.set(key, node);
|
|
474
|
+
}
|
|
475
|
+
function emitMissingSubtree(node, parentPath) {
|
|
476
|
+
const path = [...parentPath, node.id];
|
|
477
|
+
return [{
|
|
478
|
+
path,
|
|
479
|
+
expected: node
|
|
480
|
+
}, ...node.children().flatMap((c) => emitMissingSubtree(c, path))];
|
|
481
|
+
}
|
|
482
|
+
function emitExtraSubtree(node, parentPath) {
|
|
483
|
+
const path = [...parentPath, node.id];
|
|
484
|
+
return [{
|
|
485
|
+
path,
|
|
486
|
+
actual: node
|
|
487
|
+
}, ...node.children().flatMap((c) => emitExtraSubtree(c, path))];
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* Diff two schema trees starting from their roots.
|
|
491
|
+
*
|
|
492
|
+
* The differ is **total**: every node-level difference is reported. An unmatched
|
|
493
|
+
* non-leaf node emits its own issue and descends, emitting an issue for every
|
|
494
|
+
* node in the missing/extra subtree. Coalescing a parent change over its
|
|
495
|
+
* children is the planner's responsibility. Ownership filtering (dropping `extra`
|
|
496
|
+
* issues in namespaces a contract doesn't own) is the caller's responsibility.
|
|
497
|
+
*/
|
|
498
|
+
function diffSchemas(expected, actual) {
|
|
499
|
+
return mirrorDependsOnOntoIssues(diffPair(expected, actual, []));
|
|
500
|
+
}
|
|
501
|
+
function schemaNodeRefKey(ref) {
|
|
502
|
+
return ref.map((step) => step.id).join(SIBLING_KEY_DELIMITER);
|
|
503
|
+
}
|
|
504
|
+
function issuePathKey(path) {
|
|
505
|
+
return path.join(SIBLING_KEY_DELIMITER);
|
|
506
|
+
}
|
|
507
|
+
function terminalNodeKind(issue) {
|
|
508
|
+
return (issue.expected ?? issue.actual)?.nodeKind;
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* Copies each issue's node's `dependsOn` refs onto the issue itself, as
|
|
512
|
+
* issue-to-issue path references. A ref is kept only when some emitted issue
|
|
513
|
+
* sits at that exact path AND that issue's node `nodeKind` matches the ref's
|
|
514
|
+
* last step — otherwise the ref is dropped (its target either didn't
|
|
515
|
+
* change, or was never part of either tree; either way the dependency is
|
|
516
|
+
* satisfied by reality, not by an operation this diff will produce).
|
|
517
|
+
*
|
|
518
|
+
* The path index is a multimap: two siblings may share an `id` under
|
|
519
|
+
* different `nodeKind`s (a role and a namespace named alike), so an id-path
|
|
520
|
+
* alone is ambiguous. The ref's terminal `nodeKind` disambiguates — the ref
|
|
521
|
+
* resolves only against a same-path issue whose own node carries that kind.
|
|
522
|
+
*/
|
|
523
|
+
function mirrorDependsOnOntoIssues(issues) {
|
|
524
|
+
const issuesByPath = /* @__PURE__ */ new Map();
|
|
525
|
+
for (const issue of issues) {
|
|
526
|
+
const key = issuePathKey(issue.path);
|
|
527
|
+
const bucket = issuesByPath.get(key);
|
|
528
|
+
if (bucket === void 0) issuesByPath.set(key, [issue]);
|
|
529
|
+
else bucket.push(issue);
|
|
530
|
+
}
|
|
531
|
+
return issues.map((issue) => {
|
|
532
|
+
const refs = (issue.expected ?? issue.actual)?.dependsOn;
|
|
533
|
+
if (refs === void 0 || refs.length === 0) return issue;
|
|
534
|
+
const dependsOn = refs.flatMap((ref) => {
|
|
535
|
+
const lastStep = ref[ref.length - 1];
|
|
536
|
+
if (lastStep === void 0) return [];
|
|
537
|
+
if (!(issuesByPath.get(schemaNodeRefKey(ref)) ?? []).some((c) => terminalNodeKind(c) === lastStep.nodeKind)) return [];
|
|
538
|
+
return [ref.map((step) => step.id)];
|
|
539
|
+
});
|
|
540
|
+
if (dependsOn.length === 0) return issue;
|
|
541
|
+
return {
|
|
542
|
+
...issue,
|
|
543
|
+
dependsOn
|
|
544
|
+
};
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
function diffPair(expected, actual, parentPath) {
|
|
548
|
+
const path = [...parentPath, expected.id];
|
|
549
|
+
const issues = [];
|
|
550
|
+
if (!expected.isEqualTo(actual)) issues.push({
|
|
551
|
+
path,
|
|
552
|
+
expected,
|
|
553
|
+
actual
|
|
554
|
+
});
|
|
555
|
+
issues.push(...diffChildren(expected.children(), actual.children(), path));
|
|
556
|
+
return issues;
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* Align one level of nodes by `(nodeKind, id)`; emit issues in input order
|
|
560
|
+
* and recurse.
|
|
561
|
+
*
|
|
562
|
+
* A missing node emits one issue for itself and one for every node in its
|
|
563
|
+
* subtree (total descent). Same for extra nodes. A matched pair recurses via
|
|
564
|
+
* `diffPair`.
|
|
565
|
+
*/
|
|
566
|
+
function diffChildren(expected, actual, parentPath) {
|
|
567
|
+
const expectedMap = /* @__PURE__ */ new Map();
|
|
568
|
+
for (const node of expected) insertNode(expectedMap, node);
|
|
569
|
+
const actualMap = /* @__PURE__ */ new Map();
|
|
570
|
+
for (const node of actual) insertNode(actualMap, node);
|
|
571
|
+
const issues = [];
|
|
572
|
+
for (const [key, expectedNode] of expectedMap) {
|
|
573
|
+
const actualNode = actualMap.get(key);
|
|
574
|
+
if (actualNode === void 0) issues.push(...emitMissingSubtree(expectedNode, parentPath));
|
|
575
|
+
else issues.push(...diffPair(expectedNode, actualNode, parentPath));
|
|
576
|
+
}
|
|
577
|
+
for (const [key, actualNode] of actualMap) if (!expectedMap.has(key)) issues.push(...emitExtraSubtree(actualNode, parentPath));
|
|
578
|
+
return issues;
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* The result of diffing a contract's expected schema against the introspected
|
|
582
|
+
* actual schema: one node-typed issue list. Carries no verdict, verification
|
|
583
|
+
* tree, or counts — those are the verifier's own presentation, built from the
|
|
584
|
+
* same underlying comparison.
|
|
585
|
+
*
|
|
586
|
+
* `TNode` is the concrete schema-IR node the issues carry; it defaults to
|
|
587
|
+
* `DiffableNode`, so this is purely additive — a caller that wants the
|
|
588
|
+
* concrete node opts in (the Postgres planner uses the concrete node type),
|
|
589
|
+
* everyone else keeps the default unchanged.
|
|
590
|
+
*/
|
|
591
|
+
var SchemaDiff = class SchemaDiff {
|
|
592
|
+
issues;
|
|
593
|
+
constructor(issues) {
|
|
594
|
+
this.issues = issues;
|
|
595
|
+
}
|
|
596
|
+
/** Returns a new `SchemaDiff` narrowed to the issues `keep` returns true for. */
|
|
597
|
+
filter(keep) {
|
|
598
|
+
return new SchemaDiff(this.issues.filter(keep));
|
|
599
|
+
}
|
|
600
|
+
};
|
|
601
|
+
/**
|
|
602
|
+
* Grades a target-neutral issue category against a control policy.
|
|
603
|
+
*
|
|
604
|
+
* - `observed` warns on everything.
|
|
605
|
+
* - `tolerated` suppresses only an extra nested element (everything else fails).
|
|
606
|
+
* - `external` suppresses every extra category and value drift (existence and
|
|
607
|
+
* declared-shape divergences still fail).
|
|
608
|
+
* - `managed` (and any other) fails.
|
|
609
|
+
*/
|
|
610
|
+
function dispositionForCategory(controlPolicy, category) {
|
|
611
|
+
if (controlPolicy === "observed") return "warn";
|
|
612
|
+
if (controlPolicy === "tolerated" && category === "extraNestedElement") return "suppress";
|
|
613
|
+
if (controlPolicy === "external") {
|
|
614
|
+
if (category === "extraNestedElement" || category === "extraAuxiliary" || category === "extraTopLevelObject" || category === "valueDrift") return "suppress";
|
|
615
|
+
}
|
|
616
|
+
return "fail";
|
|
617
|
+
}
|
|
618
|
+
//#endregion
|
|
619
|
+
export { hasOperationPreview as C, issueOutcome as D, hasSchemaView as E, orderIssuesByDependencies as O, hasMigrations as S, hasSchemaSubjectClassifier as T, dispositionForCategory as _, VERIFY_CODE_HASH_MISMATCH as a, extractComponentIds as b, VERIFY_CODE_TARGET_MISMATCH as c, assertUniqueCodecOwner as d, buildExtensionLoadOrder as f, diffSchemas as g, createControlStack as h, SchemaTreeNode as i, storageHashHex as k, assembleAuthoringContributions as l, contractSnapshotTypesSpecifier as m, CONTRACT_SNAPSHOTS_DIRNAME as n, VERIFY_CODE_MARKER_MISSING as o, contractSnapshotJsonSpecifier as p, SchemaDiff as r, VERIFY_CODE_SCHEMA_FAILURE as s, APP_SPACE_ID as t, assembleControlMutationDefaults as u, extractCodecLookup as v, hasPslContractInfer as w, extractQueryOperationTypeImports as x, extractCodecTypeImports as y };
|
|
620
|
+
|
|
621
|
+
//# sourceMappingURL=control-DTouE89s.mjs.map
|