@prisma/orm-framework 8.0.0-rc.1-dev.45 → 8.0.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -5
- package/dist/{apply-specifier-default-control-policy-CAxiXxKg.d.mts → apply-specifier-default-control-policy-C2Njpc_G.d.mts} +2 -2
- package/dist/apply-specifier-default-control-policy-C2Njpc_G.d.mts.map +1 -0
- package/dist/{assertions-Cz-GWH8P.mjs → assertions-Dw1lZz_Q.mjs} +2 -2
- package/dist/{assertions-Cz-GWH8P.mjs.map → assertions-Dw1lZz_Q.mjs.map} +1 -1
- package/dist/authoring-D2ngo2MB.d.mts +1 -0
- package/dist/{canonicalization-DFpB09nP-4OdB2nsy.d.mts → canonicalization-BAvRuZ2i-IwsqxGme.d.mts} +3 -3
- package/dist/{canonicalization-DFpB09nP-4OdB2nsy.d.mts.map → canonicalization-BAvRuZ2i-IwsqxGme.d.mts.map} +1 -1
- package/dist/{capabilities-BCEONw9w-C-lo3rF8.mjs → capabilities-BzwH_XMZ-CkgWaxF9.mjs} +3 -3
- package/dist/{capabilities-BCEONw9w-C-lo3rF8.mjs.map → capabilities-BzwH_XMZ-CkgWaxF9.mjs.map} +1 -1
- package/dist/{codec-Cd0QcxAx.mjs → codec-DWYH-Ra4.mjs} +3 -3
- package/dist/{codec-Cd0QcxAx.mjs.map → codec-DWYH-Ra4.mjs.map} +1 -1
- package/dist/{codec-Ce07W3Mz.d.mts → codec-DxAIshoO.d.mts} +6 -9
- package/dist/{codec-Ce07W3Mz.d.mts.map → codec-DxAIshoO.d.mts.map} +1 -1
- package/dist/{codec-types-D6VRj2RE-BLElXc-O.d.mts → codec-types-nVMtogur-CYBdUQUH.d.mts} +4 -4
- package/dist/{codec-types-D6VRj2RE-BLElXc-O.d.mts.map → codec-types-nVMtogur-CYBdUQUH.d.mts.map} +1 -1
- package/dist/{codec-types-DcNvNeY1-BO6kUiH0.mjs → codec-types-smcGzGq6-BohNffPc.mjs} +3 -3
- package/dist/{codec-types-DcNvNeY1-BO6kUiH0.mjs.map → codec-types-smcGzGq6-BohNffPc.mjs.map} +1 -1
- package/dist/{components-CGA_WwEG.d.mts → components-CQrZAxZu.d.mts} +4 -4
- package/dist/{components-CGA_WwEG.d.mts.map → components-CQrZAxZu.d.mts.map} +1 -1
- package/dist/{components-dZRz3T5y.mjs → components-CnV-6irM.mjs} +2 -2
- package/dist/{components-dZRz3T5y.mjs.map → components-CnV-6irM.mjs.map} +1 -1
- package/dist/components.d.mts +16 -16
- package/dist/components.mjs +10 -10
- package/dist/components__authoring.d.mts +3 -3
- package/dist/components__authoring.mjs +1 -1
- package/dist/components__codec.d.mts +2 -2
- package/dist/components__codec.mjs +3 -3
- package/dist/components__components.d.mts +3 -3
- package/dist/components__components.mjs +2 -2
- package/dist/components__control.d.mts +2 -2
- package/dist/components__control.mjs +1 -1
- package/dist/components__emission.d.mts +3 -3
- package/dist/components__execution.d.mts +1 -1
- package/dist/components__ir.d.mts +1 -1
- package/dist/components__ir.mjs +1 -1
- package/dist/components__psl-ast.d.mts +4 -4
- package/dist/components__runtime.d.mts +2 -2
- package/dist/components__runtime.mjs +2 -2
- package/dist/{config-types-CW4PDwMC.d.mts → config-types-CeduUYkY.d.mts} +12 -25
- package/dist/{config-types-CW4PDwMC.d.mts.map → config-types-CeduUYkY.d.mts.map} +1 -1
- package/dist/config-types-D_UCRNbm.mjs +38 -0
- package/dist/config-types-D_UCRNbm.mjs.map +1 -0
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +2 -2
- package/dist/config__config-types.d.mts +2 -2
- package/dist/config__config-types.mjs +2 -2
- package/dist/contract-authoring.d.mts +39 -4
- package/dist/contract-authoring.d.mts.map +1 -1
- package/dist/contract-authoring.mjs +66 -3
- package/dist/contract-authoring.mjs.map +1 -1
- package/dist/{contract-types-CkdMH7F7-9EHXSwbH.d.mts → contract-types-Bje5yT4f-0D1Z41Lq.d.mts} +7 -7
- package/dist/{contract-types-CkdMH7F7-9EHXSwbH.d.mts.map → contract-types-Bje5yT4f-0D1Z41Lq.d.mts.map} +1 -1
- package/dist/contract.d.mts +11 -11
- package/dist/contract.mjs +3 -3
- package/dist/contract__apply-specifier-default-control-policy.d.mts +1 -1
- package/dist/contract__default-namespace.mjs +1 -1
- package/dist/contract__enum-accessor.d.mts +1 -1
- package/dist/contract__hashing-utils.d.mts +1 -1
- package/dist/contract__hashing.d.mts +2 -2
- package/dist/contract__resolve-domain-model.d.mts +1 -1
- package/dist/contract__types.d.mts +5 -5
- package/dist/contract__types.mjs +2 -2
- package/dist/contract__validate-domain.d.mts +1 -1
- package/dist/contract__validate-domain.mjs +1 -1
- package/dist/{control-DLEm6u5m.mjs → control-DR0zF1b7.mjs} +12 -5
- package/dist/control-DR0zF1b7.mjs.map +1 -0
- package/dist/{control-C9JfxzPo-CxCL2sxo.mjs → control-ZdvxNTVU-cVV8u7aQ.mjs} +15 -15
- package/dist/control-ZdvxNTVU-cVV8u7aQ.mjs.map +1 -0
- package/dist/{control-BF8qzdnM.d.mts → control-eH2MIHqA.d.mts} +12 -11
- package/dist/{control-BF8qzdnM.d.mts.map → control-eH2MIHqA.d.mts.map} +1 -1
- package/dist/{control-ql9N9u4f-r3Vv41kZ.d.mts → control-ql9N9u4f-D5sGnPR-.d.mts} +2 -2
- package/dist/{control-ql9N9u4f-r3Vv41kZ.d.mts.map → control-ql9N9u4f-D5sGnPR-.d.mts.map} +1 -1
- package/dist/{default-namespace-D4vCwkXg-lzVN7gSc.mjs → default-namespace-D4vCwkXg-BEZbN38y.mjs} +2 -2
- package/dist/{default-namespace-D4vCwkXg-lzVN7gSc.mjs.map → default-namespace-D4vCwkXg-BEZbN38y.mjs.map} +1 -1
- package/dist/{dist-Dqbo77p7.mjs → dist-DUlexZHp.mjs} +3 -3
- package/dist/{dist-Dqbo77p7.mjs.map → dist-DUlexZHp.mjs.map} +1 -1
- package/dist/{domain-envelope-D6Wn9AmZ-BqZKTT9U.d.mts → domain-envelope-CENjHN4U-BIIt9bl4.d.mts} +17 -5
- package/dist/{domain-envelope-D6Wn9AmZ-BqZKTT9U.d.mts.map → domain-envelope-CENjHN4U-BIIt9bl4.d.mts.map} +1 -1
- package/dist/emission-BWD6Z6w9.d.mts +2 -0
- package/dist/{emission-types-DLXP34Ki-CFms3VrX.d.mts → emission-types-BoSJNKfQ-B_19ILPP.d.mts} +10 -6
- package/dist/emission-types-BoSJNKfQ-B_19ILPP.d.mts.map +1 -0
- package/dist/{enum-accessor-PH5vjghI.d.mts → enum-accessor-PSFq-BB1.d.mts} +3 -3
- package/dist/{enum-accessor-PH5vjghI.d.mts.map → enum-accessor-PSFq-BB1.d.mts.map} +1 -1
- package/dist/errors.d.mts +3 -3
- package/dist/errors.mjs +3 -3
- package/dist/errors__control.d.mts +1 -1
- package/dist/errors__control.mjs +1 -1
- package/dist/errors__execution.d.mts +1 -1
- package/dist/errors__execution.mjs +1 -1
- package/dist/errors__migration.d.mts +1 -1
- package/dist/errors__migration.mjs +1 -1
- package/dist/{execution-CSnQT8EX.d.mts → execution-BDzJVN0t.d.mts} +2 -2
- package/dist/{execution-CSnQT8EX.d.mts.map → execution-BDzJVN0t.d.mts.map} +1 -1
- package/dist/{execution-C_Bu-Fia.mjs → execution-BEVehm0I.mjs} +8 -8
- package/dist/execution-BEVehm0I.mjs.map +1 -0
- package/dist/{execution-Cyl2dXxX.d.mts → execution-BpT2YjbZ.d.mts} +4 -4
- package/dist/{execution-Cyl2dXxX.d.mts.map → execution-BpT2YjbZ.d.mts.map} +1 -1
- package/dist/{framework-authoring-BhctBwih-DQ_6noDM.d.mts → framework-authoring-BYgPL2X6-DMKO0Z_k.d.mts} +17 -12
- package/dist/framework-authoring-BYgPL2X6-DMKO0Z_k.d.mts.map +1 -0
- package/dist/{framework-authoring-CDEvlouU-DKklu-fL.mjs → framework-authoring-BvxZnsPY-DlD1nwU5.mjs} +34 -19
- package/dist/framework-authoring-BvxZnsPY-DlD1nwU5.mjs.map +1 -0
- package/dist/{framework-components-hZ2tO-KH-CdRXBOYd.d.mts → framework-components-CDppKaT_-DcMHokB8.d.mts} +9 -6
- package/dist/{framework-components-hZ2tO-KH-CdRXBOYd.d.mts.map → framework-components-CDppKaT_-DcMHokB8.d.mts.map} +1 -1
- package/dist/{hashing-CccSPELN.d.mts → hashing-BTx0s6Zw.d.mts} +3 -3
- package/dist/{hashing-CccSPELN.d.mts.map → hashing-BTx0s6Zw.d.mts.map} +1 -1
- package/dist/{hashing-utils-qKu59RSC.d.mts → hashing-utils-Bh9PVd4J.d.mts} +2 -2
- package/dist/{hashing-utils-qKu59RSC.d.mts.map → hashing-utils-Bh9PVd4J.d.mts.map} +1 -1
- package/dist/ids.d.mts +2 -2
- package/dist/ids.mjs +1 -1
- package/dist/ids__runtime.d.mts +1 -1
- package/dist/ids__runtime.mjs +1 -1
- package/dist/{internal-error-kK8QvlDE.d.mts → internal-error-2fJ9fcZX.d.mts} +2 -2
- package/dist/{internal-error-kK8QvlDE.d.mts.map → internal-error-2fJ9fcZX.d.mts.map} +1 -1
- package/dist/{internal-error-BIc-ehme-ouBQPoEL.mjs → internal-error-ChGYPVpq-DhUD05u0.mjs} +3 -3
- package/dist/internal-error-ChGYPVpq-DhUD05u0.mjs.map +1 -0
- package/dist/{ir-BvE7L9FK.d.mts → ir-BGaPKem0.d.mts} +2 -2
- package/dist/{ir-BvE7L9FK.d.mts.map → ir-BGaPKem0.d.mts.map} +1 -1
- package/dist/{ir-ChmSSAhX.mjs → ir-CV5d1FJ0.mjs} +2 -2
- package/dist/{ir-ChmSSAhX.mjs.map → ir-CV5d1FJ0.mjs.map} +1 -1
- package/dist/{migration-DOIs8GBr.d.mts → migration-Bdp-ucGZ.d.mts} +3 -3
- package/dist/{migration-DOIs8GBr.d.mts.map → migration-Bdp-ucGZ.d.mts.map} +1 -1
- package/dist/{migration-5zFMadnp.mjs → migration-S40Rgr7K.mjs} +5 -5
- package/dist/migration-S40Rgr7K.mjs.map +1 -0
- package/dist/operations.mjs +1 -1
- package/dist/{parse-0ZJjj_2N-DhQpSVmQ.d.mts → parse-B5xYL_oV-aGFgfM8N.d.mts} +5 -5
- package/dist/{parse-0ZJjj_2N-DhQpSVmQ.d.mts.map → parse-B5xYL_oV-aGFgfM8N.d.mts.map} +1 -1
- package/dist/{parse-GbZGfMUj-BFSrD2AN.mjs → parse-GbZGfMUj-C9tHGn-6.mjs} +2 -2
- package/dist/{parse-GbZGfMUj-BFSrD2AN.mjs.map → parse-GbZGfMUj-C9tHGn-6.mjs.map} +1 -1
- package/dist/{psl-ast-BXZoFQBk.d.mts → psl-ast-BkfQwHjE.d.mts} +4 -4
- package/dist/{psl-ast-BXZoFQBk.d.mts.map → psl-ast-BkfQwHjE.d.mts.map} +1 -1
- package/dist/{psl-ast-CWJQF8LA-Vr5JNPdn.d.mts → psl-ast-dnXw52MT-1jSUKlC9.d.mts} +4 -4
- package/dist/{psl-ast-CWJQF8LA-Vr5JNPdn.d.mts.map → psl-ast-dnXw52MT-1jSUKlC9.d.mts.map} +1 -1
- package/dist/psl-parser.d.mts +195 -74
- package/dist/psl-parser.d.mts.map +1 -1
- package/dist/psl-parser.mjs +213 -46
- package/dist/psl-parser.mjs.map +1 -1
- package/dist/psl-parser__format.mjs +2 -2
- package/dist/psl-parser__interpret.d.mts +32 -5
- package/dist/psl-parser__interpret.d.mts.map +1 -1
- package/dist/psl-parser__interpret.mjs +25 -2
- package/dist/psl-parser__interpret.mjs.map +1 -1
- package/dist/psl-parser__syntax.d.mts +1 -1
- package/dist/psl-parser__syntax.mjs +1 -1
- package/dist/psl-printer.d.mts +6 -6
- package/dist/psl-printer.mjs +20 -13
- package/dist/psl-printer.mjs.map +1 -1
- package/dist/{resolve-codec-BZF8TZh_-D-xORT9Q.mjs → resolve-codec-BLRGmP1f-CydhIhLP.mjs} +6 -9
- package/dist/{resolve-codec-BZF8TZh_-D-xORT9Q.mjs.map → resolve-codec-BLRGmP1f-CydhIhLP.mjs.map} +1 -1
- package/dist/{resolve-domain-model-BVSb5wS5-C6Yq0dsD.d.mts → resolve-domain-model-DXP2hfI2-D4fWewZQ.d.mts} +3 -3
- package/dist/resolve-domain-model-DXP2hfI2-D4fWewZQ.d.mts.map +1 -0
- package/dist/{result-CBZ8X9mU.mjs → result-C0NUq1Ok.mjs} +2 -2
- package/dist/{result-CBZ8X9mU.mjs.map → result-C0NUq1Ok.mjs.map} +1 -1
- package/dist/{runtime-Cuxw8obj.d.mts → runtime-DOHhUPFx.d.mts} +66 -4
- package/dist/{runtime-Cuxw8obj.d.mts.map → runtime-DOHhUPFx.d.mts.map} +1 -1
- package/dist/{runtime-BqzioOmU.mjs → runtime-DXmHIbAr.mjs} +7 -2
- package/dist/{runtime-BqzioOmU.mjs.map → runtime-DXmHIbAr.mjs.map} +1 -1
- package/dist/{structured-error-CgiSMpdU.mjs → structured-error-BXbihKQ-.mjs} +3 -3
- package/dist/{structured-error-CgiSMpdU.mjs.map → structured-error-BXbihKQ-.mjs.map} +1 -1
- package/dist/{structured-error-BsNT4Hun.d.mts → structured-error-Z4iE-fTI.d.mts} +4 -4
- package/dist/{structured-error-BsNT4Hun.d.mts.map → structured-error-Z4iE-fTI.d.mts.map} +1 -1
- package/dist/suppress-idle-connection-errors-CKrTbp5P.d.mts +18 -0
- package/dist/suppress-idle-connection-errors-CKrTbp5P.d.mts.map +1 -0
- package/dist/suppress-idle-connection-errors-DzApeUb3.mjs +22 -0
- package/dist/suppress-idle-connection-errors-DzApeUb3.mjs.map +1 -0
- package/dist/{symbol-table-CZ7EVCTL-CR-ncCpD.d.mts → symbol-table-BeOQBu3C-DduAXEh6.d.mts} +6 -6
- package/dist/{symbol-table-CZ7EVCTL-CR-ncCpD.d.mts.map → symbol-table-BeOQBu3C-DduAXEh6.d.mts.map} +1 -1
- package/dist/ts-render.mjs +1 -1
- package/dist/{types-ByeQhU9p.d.mts → types-BKJi4we0.d.mts} +2 -2
- package/dist/{types-ByeQhU9p.d.mts.map → types-BKJi4we0.d.mts.map} +1 -1
- package/dist/{types-BnH4zYvN.mjs → types-DG4qHrT8.mjs} +2 -2
- package/dist/{types-BnH4zYvN.mjs.map → types-DG4qHrT8.mjs.map} +1 -1
- package/dist/{types-import-spec-3mjbVBhI-DQI6BvKU.d.mts → types-import-spec-BijT0b-s-253rIcmj.d.mts} +4 -4
- package/dist/{types-import-spec-3mjbVBhI-DQI6BvKU.d.mts.map → types-import-spec-BijT0b-s-253rIcmj.d.mts.map} +1 -1
- package/dist/utils.d.mts +4 -3
- package/dist/utils.mjs +6 -5
- package/dist/utils__assertions.mjs +1 -1
- package/dist/utils__internal-error.d.mts +1 -1
- package/dist/utils__internal-error.mjs +1 -1
- package/dist/utils__result.mjs +1 -1
- package/dist/utils__structured-error.d.mts +1 -1
- package/dist/utils__structured-error.mjs +1 -1
- package/dist/utils__suppress-idle-connection-errors.d.mts +2 -0
- package/dist/utils__suppress-idle-connection-errors.mjs +2 -0
- package/dist/{validate-domain-BkvFlY3B.mjs → validate-domain-CaT6wlDH.mjs} +15 -1
- package/dist/validate-domain-CaT6wlDH.mjs.map +1 -0
- package/dist/{validate-domain-BNBs-TVv.d.mts → validate-domain-DJXNOlkP.d.mts} +9 -5
- package/dist/validate-domain-DJXNOlkP.d.mts.map +1 -0
- package/package.json +19 -18
- package/dist/apply-specifier-default-control-policy-CAxiXxKg.d.mts.map +0 -1
- package/dist/authoring-B2H-9qCv.d.mts +0 -1
- package/dist/config-types-BqhNxw0z.mjs +0 -67
- package/dist/config-types-BqhNxw0z.mjs.map +0 -1
- package/dist/control-C9JfxzPo-CxCL2sxo.mjs.map +0 -1
- package/dist/control-DLEm6u5m.mjs.map +0 -1
- package/dist/emission-CmUO03gQ.d.mts +0 -2
- package/dist/emission-types-DLXP34Ki-CFms3VrX.d.mts.map +0 -1
- package/dist/execution-C_Bu-Fia.mjs.map +0 -1
- package/dist/framework-authoring-BhctBwih-DQ_6noDM.d.mts.map +0 -1
- package/dist/framework-authoring-CDEvlouU-DKklu-fL.mjs.map +0 -1
- package/dist/internal-error-BIc-ehme-ouBQPoEL.mjs.map +0 -1
- package/dist/migration-5zFMadnp.mjs.map +0 -1
- package/dist/resolve-domain-model-BVSb5wS5-C6Yq0dsD.d.mts.map +0 -1
- package/dist/validate-domain-BNBs-TVv.d.mts.map +0 -1
- package/dist/validate-domain-BkvFlY3B.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structured-error-
|
|
1
|
+
{"version":3,"file":"structured-error-BXbihKQ-.mjs","names":[],"sources":["../../../../1-framework/0-foundation/utils/dist/structured-error.mjs"],"sourcesContent":["import { t as ifDefined } from \"./defined-BQWA85QH.mjs\";\n//#region src/structured-error.ts\nconst STRUCTURED_CODE_RE = /^[A-Z][A-Z0-9]*\\.[A-Z][A-Z0-9_]*$/;\n/** Whether a bare string is a published `NAMESPACE.SUBCODE` code. */\nfunction isStructuredErrorCode(code) {\n\treturn STRUCTURED_CODE_RE.test(code);\n}\nfunction isStructuredError(e) {\n\treturn typeof e === \"object\" && e !== null && \"code\" in e && typeof e.code === \"string\" && isStructuredErrorCode(e.code) && \"message\" in e && typeof e.message === \"string\";\n}\nfunction structuredError(code, message, options) {\n\tconst error = options?.cause !== void 0 ? new Error(message, { cause: options.cause }) : new Error(message);\n\tObject.defineProperty(error, \"name\", {\n\t\tvalue: \"StructuredError\",\n\t\tconfigurable: true\n\t});\n\treturn Object.assign(error, {\n\t\tcode,\n\t\t...ifDefined(\"why\", options?.why),\n\t\t...ifDefined(\"fix\", options?.fix),\n\t\t...ifDefined(\"nextActions\", options?.nextActions),\n\t\t...ifDefined(\"where\", options?.where),\n\t\t...ifDefined(\"severity\", options?.severity),\n\t\t...ifDefined(\"meta\", options?.meta),\n\t\t...ifDefined(\"docsUrl\", options?.docsUrl)\n\t});\n}\nconst DOCS_ERRORS_VERSION = \"v8\";\nconst DOCS_BASE = `https://docs.prisma.io/docs/orm/v8/reference/error-reference`;\nfunction docsUrlFor(code) {\n\treturn `${DOCS_BASE}#${code}`;\n}\n//#endregion\nexport { DOCS_BASE, DOCS_ERRORS_VERSION, docsUrlFor, isStructuredError, isStructuredErrorCode, structuredError };\n\n//# sourceMappingURL=structured-error.mjs.map"],"mappings":";;AAEA,MAAM,qBAAqB;;AAE3B,SAAS,sBAAsB,MAAM;CACpC,OAAO,mBAAmB,KAAK,IAAI;AACpC;AACA,SAAS,kBAAkB,GAAG;CAC7B,OAAO,OAAO,MAAM,YAAY,MAAM,QAAQ,UAAU,KAAK,OAAO,EAAE,SAAS,YAAY,sBAAsB,EAAE,IAAI,KAAK,aAAa,KAAK,OAAO,EAAE,YAAY;AACpK;AACA,SAAS,gBAAgB,MAAM,SAAS,SAAS;CAChD,MAAM,QAAQ,SAAS,UAAU,KAAK,IAAI,IAAI,MAAM,SAAS,EAAE,OAAO,QAAQ,MAAM,CAAC,IAAI,IAAI,MAAM,OAAO;CAC1G,OAAO,eAAe,OAAO,QAAQ;EACpC,OAAO;EACP,cAAc;CACf,CAAC;CACD,OAAO,OAAO,OAAO,OAAO;EAC3B;EACA,GAAG,UAAU,OAAO,SAAS,GAAG;EAChC,GAAG,UAAU,OAAO,SAAS,GAAG;EAChC,GAAG,UAAU,eAAe,SAAS,WAAW;EAChD,GAAG,UAAU,SAAS,SAAS,KAAK;EACpC,GAAG,UAAU,YAAY,SAAS,QAAQ;EAC1C,GAAG,UAAU,QAAQ,SAAS,IAAI;EAClC,GAAG,UAAU,WAAW,SAAS,OAAO;CACzC,CAAC;AACF;AACA,MAAM,sBAAsB;AAC5B,MAAM,YAAY;AAClB,SAAS,WAAW,MAAM;CACzB,OAAO,GAAG,UAAU,GAAG;AACxB"}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* human edit), `done` (nothing further is required).
|
|
11
11
|
*
|
|
12
12
|
* A `command` never hardcodes a binary name. Write `{bin}` where the binary
|
|
13
|
-
* goes — `{bin} ref set <name> <hash>` — and the surface that renders the
|
|
13
|
+
* goes — `{bin} migration ref set <name> <hash>` — and the surface that renders the
|
|
14
14
|
* action substitutes the name of the binary the user actually ran. Angle
|
|
15
15
|
* brackets mark a value only the user can supply; everything outside them is
|
|
16
16
|
* literal and runnable.
|
|
@@ -53,9 +53,9 @@ interface StructuredErrorOptions {
|
|
|
53
53
|
declare function isStructuredErrorCode(code: string): code is StructuredError['code'];
|
|
54
54
|
declare function isStructuredError(e: unknown): e is StructuredError;
|
|
55
55
|
declare function structuredError(code: StructuredError['code'], message: string, options?: StructuredErrorOptions): StructuredError;
|
|
56
|
-
declare const DOCS_ERRORS_VERSION = "
|
|
57
|
-
declare const DOCS_BASE = "https://docs.prisma.io/docs/orm/
|
|
56
|
+
declare const DOCS_ERRORS_VERSION = "v8";
|
|
57
|
+
declare const DOCS_BASE = "https://docs.prisma.io/docs/orm/v8/reference/error-reference";
|
|
58
58
|
declare function docsUrlFor(code: string): string;
|
|
59
59
|
//#endregion
|
|
60
60
|
export { StructuredErrorOptions as a, isStructuredErrorCode as c, StructuredError as i, structuredError as l, DOCS_ERRORS_VERSION as n, docsUrlFor as o, NextAction as r, isStructuredError as s, DOCS_BASE as t };
|
|
61
|
-
//# sourceMappingURL=structured-error-
|
|
61
|
+
//# sourceMappingURL=structured-error-Z4iE-fTI.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structured-error-
|
|
1
|
+
{"version":3,"file":"structured-error-Z4iE-fTI.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/utils/dist/structured-error.d.mts"],"mappings":";;;;;;;;;;;;;;;;;UAgBU;WACC;WACA;WACA;WACA;WACA;WACA;;UAED,wBAAwB;WACvB;WACA;WACA;WACA,uBAAuB;WACvB;aACE;aACA;;WAEF;WACA,OAAO;WACP;;UAED;WACC;WACA;WACA,uBAAuB;WACvB;aACE;aACA;;WAEF;WACA,OAAO;WACP;WACA;;;iBAGM,sBAAsB,eAAe,QAAQ;iBAC7C,kBAAkB,aAAa,KAAK;iBACpC,gBAAgB,MAAM,yBAAyB,iBAAiB,UAAU,yBAAyB;cACtG;cACA;iBACG,WAAW"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region ../../../1-framework/0-foundation/utils/dist/suppress-idle-connection-errors.d.mts
|
|
2
|
+
//#region src/suppress-idle-connection-errors.d.ts
|
|
3
|
+
interface ErrorEventSource {
|
|
4
|
+
on(event: 'error', listener: (err: Error) => void): unknown;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Connection libraries emit 'error' on a pool or client when an idle
|
|
8
|
+
* connection drops (database restart, pooler timeout, network blip). With no
|
|
9
|
+
* listener Node treats that as an uncaught exception and kills the process.
|
|
10
|
+
* Connect and query failures still reject their own promises, so nothing real
|
|
11
|
+
* is masked. A pool discards the dead connection and hands the next query a
|
|
12
|
+
* fresh one; a single client stays unusable and its later operations reject.
|
|
13
|
+
* Idempotent per emitter: repeated calls attach one listener.
|
|
14
|
+
*/
|
|
15
|
+
declare function suppressIdleConnectionErrors<T extends ErrorEventSource>(target: T): T;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { suppressIdleConnectionErrors as t };
|
|
18
|
+
//# sourceMappingURL=suppress-idle-connection-errors-CKrTbp5P.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suppress-idle-connection-errors-CKrTbp5P.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/utils/dist/suppress-idle-connection-errors.d.mts"],"mappings":";;UACU;EACR,GAAG,gBAAgB,WAAW,KAAK;;;;;;;;;;;iBAWpB,6BAA6B,UAAU,kBAAkB,QAAQ,IAAI"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region ../../../1-framework/0-foundation/utils/dist/suppress-idle-connection-errors.mjs
|
|
2
|
+
const suppressed = /* @__PURE__ */ new WeakSet();
|
|
3
|
+
/**
|
|
4
|
+
* Connection libraries emit 'error' on a pool or client when an idle
|
|
5
|
+
* connection drops (database restart, pooler timeout, network blip). With no
|
|
6
|
+
* listener Node treats that as an uncaught exception and kills the process.
|
|
7
|
+
* Connect and query failures still reject their own promises, so nothing real
|
|
8
|
+
* is masked. A pool discards the dead connection and hands the next query a
|
|
9
|
+
* fresh one; a single client stays unusable and its later operations reject.
|
|
10
|
+
* Idempotent per emitter: repeated calls attach one listener.
|
|
11
|
+
*/
|
|
12
|
+
function suppressIdleConnectionErrors(target) {
|
|
13
|
+
if (!suppressed.has(target)) {
|
|
14
|
+
suppressed.add(target);
|
|
15
|
+
target.on("error", () => {});
|
|
16
|
+
}
|
|
17
|
+
return target;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { suppressIdleConnectionErrors as t };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=suppress-idle-connection-errors-DzApeUb3.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suppress-idle-connection-errors-DzApeUb3.mjs","names":[],"sources":["../../../../1-framework/0-foundation/utils/dist/suppress-idle-connection-errors.mjs"],"sourcesContent":["//#region src/suppress-idle-connection-errors.ts\nconst suppressed = /* @__PURE__ */ new WeakSet();\n/**\n* Connection libraries emit 'error' on a pool or client when an idle\n* connection drops (database restart, pooler timeout, network blip). With no\n* listener Node treats that as an uncaught exception and kills the process.\n* Connect and query failures still reject their own promises, so nothing real\n* is masked. A pool discards the dead connection and hands the next query a\n* fresh one; a single client stays unusable and its later operations reject.\n* Idempotent per emitter: repeated calls attach one listener.\n*/\nfunction suppressIdleConnectionErrors(target) {\n\tif (!suppressed.has(target)) {\n\t\tsuppressed.add(target);\n\t\ttarget.on(\"error\", () => {});\n\t}\n\treturn target;\n}\n//#endregion\nexport { suppressIdleConnectionErrors };\n\n//# sourceMappingURL=suppress-idle-connection-errors.mjs.map"],"mappings":";AACA,MAAM,6BAA6B,IAAI,QAAQ;;;;;;;;;;AAU/C,SAAS,6BAA6B,QAAQ;CAC7C,IAAI,CAAC,WAAW,IAAI,MAAM,GAAG;EAC5B,WAAW,IAAI,MAAM;EACrB,OAAO,GAAG,eAAe,CAAC,CAAC;CAC5B;CACA,OAAO;AACR"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./authoring-
|
|
3
|
-
import "./psl-ast-
|
|
4
|
-
import { B as SyntaxNode, C as ModelAttributeAst, E as NamespaceDeclarationAst, F as Range, I as SourceFile, T as NamedTypeDeclarationAst, U as TypeAnnotationAst, d as DocumentAst, f as ExpressionAst, g as GenericBlockDeclarationAst, j as ParseDiagnostic, l as CompositeTypeDeclarationAst, m as FieldDeclarationAst, p as FieldAttributeAst, w as ModelDeclarationAst } from "./parse-
|
|
5
|
-
//#region ../../../1-framework/2-authoring/psl-parser/dist/symbol-table-
|
|
1
|
+
import { J as PslSpan, L as PslExtensionBlock, x as AuthoringPslBlockDescriptorNamespace } from "./framework-authoring-BYgPL2X6-DMKO0Z_k.mjs";
|
|
2
|
+
import "./authoring-D2ngo2MB.mjs";
|
|
3
|
+
import "./psl-ast-BkfQwHjE.mjs";
|
|
4
|
+
import { B as SyntaxNode, C as ModelAttributeAst, E as NamespaceDeclarationAst, F as Range, I as SourceFile, T as NamedTypeDeclarationAst, U as TypeAnnotationAst, d as DocumentAst, f as ExpressionAst, g as GenericBlockDeclarationAst, j as ParseDiagnostic, l as CompositeTypeDeclarationAst, m as FieldDeclarationAst, p as FieldAttributeAst, w as ModelDeclarationAst } from "./parse-B5xYL_oV-aGFgfM8N.mjs";
|
|
5
|
+
//#region ../../../1-framework/2-authoring/psl-parser/dist/symbol-table-BeOQBu3C.d.mts
|
|
6
6
|
//#region src/resolve.d.ts
|
|
7
7
|
interface ResolvedAttributeArg {
|
|
8
8
|
readonly kind: 'positional' | 'named';
|
|
@@ -122,4 +122,4 @@ interface SymbolTableResult {
|
|
|
122
122
|
declare function buildSymbolTable(options: BuildSymbolTableOptions): SymbolTableResult;
|
|
123
123
|
//#endregion
|
|
124
124
|
export { nodePslSpan as _, ModelSymbol as a, readResolvedAttributes as b, ResolvedAttribute as c, ResolvedTypeConstructorCall as d, SymbolTable as f, keywordPslSpan as g, buildSymbolTable as h, FieldSymbol as i, ResolvedAttributeArg as l, TopLevelScope as m, BuildSymbolTableOptions as n, NamedTypeSymbol as o, SymbolTableResult as p, CompositeTypeSymbol as r, NamespaceSymbol as s, BlockSymbol as t, ResolvedNamedTypeBinding as u, rangeToPslSpan as v, readResolvedConstructorCall as x, readResolvedAttribute as y };
|
|
125
|
-
//# sourceMappingURL=symbol-table-
|
|
125
|
+
//# sourceMappingURL=symbol-table-BeOQBu3C-DduAXEh6.d.mts.map
|
package/dist/{symbol-table-CZ7EVCTL-CR-ncCpD.d.mts.map → symbol-table-BeOQBu3C-DduAXEh6.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symbol-table-
|
|
1
|
+
{"version":3,"file":"symbol-table-BeOQBu3C-DduAXEh6.d.mts","names":[],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/symbol-table-BeOQBu3C.d.mts"],"mappings":";;;;;;UAIU;WACC;WACA;WACA;WACA,aAAa;WACb,MAAM;;UAEP;WACC;WACA,eAAe;WACf,MAAM;;UAEP;WACC;WACA,eAAe;WACf,MAAM;;iBAEA,sBAAsB,WAAW,oBAAoB,mBAAmB,YAAY,aAAa;iBACjG,uBAAuB,YAAY,SAAS,oBAAoB,oBAAoB,YAAY,sBAAsB;iBACtH,4BAA4B,YAAY,+BAA+B,YAAY,aAAa;iBAChG,YAAY,MAAM,YAAY,YAAY,aAAa;;iBAEvD,eAAe,MAAM,YAAY,iBAAiB,YAAY,aAAa;iBAC3E,eAAe,OAAO,OAAO,YAAY,aAAa;;;UAG7D;WACC,UAAU;;UAEX;WACC,YAAY,eAAe;WAC3B,YAAY,eAAe;WAC3B,QAAQ,eAAe;WACvB,QAAQ,eAAe;WACvB,gBAAgB,eAAe;;UAEhC;WACC;WACA;WACA,MAAM;WACN,MAAM;WACN,QAAQ,eAAe;WACvB,gBAAgB,eAAe;WAC/B,QAAQ,eAAe;;UAExB;WACC;WACA;WACA,MAAM;WACN,MAAM;WACN,QAAQ,eAAe;WACvB,qBAAqB;;UAEtB;WACC;WACA;WACA,MAAM;WACN,MAAM;WACN,QAAQ,eAAe;WACvB,qBAAqB;;UAEtB;WACC;WACA;WACA;WACA,MAAM;WACN,MAAM;;WAEN,OAAO;;UAER;WACC;WACA,kBAAkB;WAClB;WACA,qBAAqB;;;;;;;UAOtB,wBAAwB;WACvB;WACA;WACA,MAAM;WACN,MAAM;;UAEP;WACC;WACA;WACA,MAAM;WACN,MAAM;WACN;WACA;WACA;WACA;WACA;WACA,kBAAkB;WAClB,qBAAqB;;WAErB;;UAED;WACC,UAAU;WACV,YAAY;WACZ,qBAAqB;;UAEtB;WACC,OAAO;WACP,sBAAsB;;;;;;iBAMhB,iBAAiB,SAAS,0BAA0B"}
|
package/dist/ts-render.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as tsStringLiteral, n as jsonToTsSource, r as renderImports, t as TsExpression } from "./dist-
|
|
1
|
+
import { i as tsStringLiteral, n as jsonToTsSource, r as renderImports, t as TsExpression } from "./dist-DUlexZHp.mjs";
|
|
2
2
|
export { TsExpression, jsonToTsSource, renderImports, tsStringLiteral };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as ContractModelBase, n as ApplicationDomain, w as ContractValueObject } from "./domain-envelope-CENjHN4U-BIIt9bl4.mjs";
|
|
2
2
|
//#region ../../../1-framework/0-foundation/contract/dist/types.d.mts
|
|
3
3
|
//#region src/domain-namespace-access.d.ts
|
|
4
4
|
/**
|
|
@@ -14,4 +14,4 @@ declare function domainModelsAtDefaultNamespace(domain: ApplicationDomain): Reco
|
|
|
14
14
|
declare function domainValueObjectsAtDefaultNamespace(domain: ApplicationDomain): Record<string, ContractValueObject> | undefined;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { domainValueObjectsAtDefaultNamespace as n, domainModelsAtDefaultNamespace as t };
|
|
17
|
-
//# sourceMappingURL=types-
|
|
17
|
+
//# sourceMappingURL=types-BKJi4we0.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-BKJi4we0.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/types.d.mts"],"mappings":";;;;;;;;iBAUiB,+BAA+B,QAAQ,oBAAoB,eAAe;;;;;iBAK1E,qCAAqC,QAAQ,oBAAoB,eAAe"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as blindCast } from "./casts-DpaahrlC-Bd5n2coI.mjs";
|
|
2
|
-
import { n as contractError, r as soleDomainNamespaceId } from "./default-namespace-D4vCwkXg-
|
|
2
|
+
import { n as contractError, r as soleDomainNamespaceId } from "./default-namespace-D4vCwkXg-BEZbN38y.mjs";
|
|
3
3
|
import { t as asNamespaceId } from "./namespace-id-asbWpwMw-3yxn-tRe.mjs";
|
|
4
4
|
import { type } from "arktype";
|
|
5
5
|
//#region ../../../1-framework/0-foundation/contract/dist/types.mjs
|
|
@@ -93,4 +93,4 @@ function isExecutionMutationDefaultValue(value) {
|
|
|
93
93
|
//#endregion
|
|
94
94
|
export { domainValueObjectsAtDefaultNamespace as a, isColumnDefault as c, profileHash as d, domainModelsAtDefaultNamespace as i, isColumnDefaultLiteralInputValue as l, coreHash as n, effectiveControlPolicy as o, crossRef as r, executionHash as s, CrossReferenceSchema as t, isExecutionMutationDefaultValue as u };
|
|
95
95
|
|
|
96
|
-
//# sourceMappingURL=types-
|
|
96
|
+
//# sourceMappingURL=types-DG4qHrT8.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-DG4qHrT8.mjs","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/types.mjs"],"sourcesContent":["import { n as soleDomainNamespaceId, r as contractError, t as UNBOUND_DOMAIN_NAMESPACE_ID } from \"./default-namespace-D4vCwkXg.mjs\";\nimport { t as resolveDomainModel } from \"./resolve-domain-model-BovPAsW2.mjs\";\nimport { t as asNamespaceId } from \"./namespace-id-asbWpwMw.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { type } from \"arktype\";\n//#region src/control-policy.ts\n/**\n* Resolves the effective control policy for a storage-plane node.\n*\n* Precedence: node-level value → contract default → `'managed'`.\n*\n* Both parameters are optional raw values so this function stays node-type-agnostic\n* and can be called by any consumer (verifier, planner, etc.) without importing IR classes.\n*/\nfunction effectiveControlPolicy(nodeControl, defaultControlPolicy) {\n\treturn nodeControl ?? defaultControlPolicy ?? \"managed\";\n}\n//#endregion\n//#region src/cross-reference.ts\nconst CrossReferenceSchema = /* @__PURE__ */ blindCast(/* @__PURE__ */ type({\n\t\"+\": \"reject\",\n\tnamespace: \"string\",\n\tmodel: \"string\",\n\t\"space?\": \"string\"\n}));\nconst DEFAULT_CROSS_REF_NAMESPACE = \"__unbound__\";\nfunction crossRef(model, namespace = DEFAULT_CROSS_REF_NAMESPACE, space) {\n\treturn {\n\t\tnamespace: asNamespaceId(namespace),\n\t\tmodel,\n\t\t...space !== void 0 ? { space } : {}\n\t};\n}\n//#endregion\n//#region src/domain-namespace-access.ts\n/**\n* Models map for the contract's single domain namespace. Throws when the\n* contract does not declare exactly one namespace — bare-name access is\n* ambiguous across namespaces and must be qualified explicitly (TML-2550).\n*/\nfunction domainModelsAtDefaultNamespace(domain) {\n\tconst namespaceId = soleDomainNamespaceId(domain);\n\tconst domainNamespace = domain.namespaces[namespaceId];\n\tif (domainNamespace === void 0) throw contractError(\"CONTRACT.NAMESPACE_INVALID\", `domain namespace \"${namespaceId}\" is not present on the contract`, { meta: {\n\t\treason: \"domain-namespace-missing\",\n\t\tnamespaceId\n\t} });\n\treturn domainNamespace.models;\n}\n/**\n* Value objects for the contract's single domain namespace, when present.\n* Throws when the contract does not declare exactly one namespace.\n*/\nfunction domainValueObjectsAtDefaultNamespace(domain) {\n\treturn domain.namespaces[soleDomainNamespaceId(domain)]?.valueObjects;\n}\n//#endregion\n//#region src/types.ts\nfunction executionHash(value) {\n\treturn value;\n}\nfunction coreHash(value) {\n\treturn value;\n}\nfunction profileHash(value) {\n\treturn value;\n}\n/**\n* Runtime predicate for `ColumnDefaultLiteralInputValue`. Authoring layers\n* resolve template values from caller-supplied args (typed `unknown` at the\n* boundary) and need to validate before constructing a `ColumnDefault`.\n* Accepts JSON primitives, plain arrays/objects of JSON values, and `Date`\n* instances. Rejects functions, class instances (other than `Date`),\n* `undefined`, `bigint`, `symbol`, and arrays/objects containing those.\n*/\nfunction isColumnDefaultLiteralInputValue(value) {\n\tif (value === null) return true;\n\tconst t = typeof value;\n\tif (t === \"string\" || t === \"number\" || t === \"boolean\") return true;\n\tif (value instanceof Date) return true;\n\tif (Array.isArray(value)) return value.every(isColumnDefaultLiteralInputValue);\n\tif (t === \"object\" && Object.getPrototypeOf(value) === Object.prototype) return Object.values(value).every(isColumnDefaultLiteralInputValue);\n\treturn false;\n}\nfunction isColumnDefault(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst kind = value.kind;\n\tif (kind === \"literal\") return \"value\" in value;\n\tif (kind === \"function\") return typeof value.expression === \"string\";\n\treturn false;\n}\nfunction isExecutionMutationDefaultValue(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst candidate = value;\n\tif (candidate.kind !== \"generator\") return false;\n\tif (typeof candidate.id !== \"string\") return false;\n\tif (candidate.params !== void 0 && (typeof candidate.params !== \"object\" || candidate.params === null || Array.isArray(candidate.params))) return false;\n\treturn true;\n}\n//#endregion\nexport { CrossReferenceSchema, UNBOUND_DOMAIN_NAMESPACE_ID, asNamespaceId, coreHash, crossRef, domainModelsAtDefaultNamespace, domainValueObjectsAtDefaultNamespace, effectiveControlPolicy, executionHash, isColumnDefault, isColumnDefaultLiteralInputValue, isExecutionMutationDefaultValue, profileHash, resolveDomainModel, soleDomainNamespaceId };\n\n//# sourceMappingURL=types.mjs.map"],"mappings":";;;;;;;;;;;;;AAcA,SA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AO;CACxD,MAAM,OAAO,MAAM;CACnB,IAAI,SAAS,WAAW,OAAO,WAAW;CAC1C,IAAI,SAAS,YAAY,OAAO,OAAO,MAAM,eAAe;CAC5D,OAAO;AACR;AACA,SAAS,gCAAgC,OAAO;CAC/C,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CACxD,MAAM,YAAY;CAClB,IAAI,UAAU,SAAS,aAAa,OAAO;CAC3C,IAAI,OAAO,UAAU,OAAO,UAAU,OAAO;CAC7C,IAAI,UAAU,WAAW,KAAK,MAAM,OAAO,UAAU,WAAW,YAAY,UAAU,WAAW,QAAQ,MAAM,QAAQ,UAAU,MAAM,IAAI,OAAO;CAClJ,OAAO;AACR"}
|
package/dist/{types-import-spec-3mjbVBhI-DQI6BvKU.d.mts → types-import-spec-BijT0b-s-253rIcmj.d.mts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as CodecTrait, l as CodecRef } from "./codec-types-
|
|
3
|
-
//#region ../../../1-framework/1-core/framework-components/dist/types-import-spec-
|
|
1
|
+
import { V as JsonValue } from "./domain-envelope-CENjHN4U-BIIt9bl4.mjs";
|
|
2
|
+
import { d as CodecTrait, l as CodecRef } from "./codec-types-nVMtogur-CYBdUQUH.mjs";
|
|
3
|
+
//#region ../../../1-framework/1-core/framework-components/dist/types-import-spec-BijT0b-s.d.mts
|
|
4
4
|
//#region src/shared/aggregate-descriptor.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* How a descriptor matches the value an aggregate consumes.
|
|
@@ -110,4 +110,4 @@ interface TypesImportSpec {
|
|
|
110
110
|
}
|
|
111
111
|
//#endregion
|
|
112
112
|
export { AnyInputAggregateDescriptor as a, SelfAggregateOutput as c, aggregateDescriptorKey as d, isAggregateDescriptor as f, AggregateResultNullability as i, TypesImportSpec as l, isNoInputAggregateDescriptor as m, AggregateInputMatch as n, NamedAggregateOutput as o, isAnyInputAggregateDescriptor as p, AggregateOutputCodec as r, NoInputAggregateDescriptor as s, AggregateDescriptor as t, ValueInputAggregateDescriptor as u };
|
|
113
|
-
//# sourceMappingURL=types-import-spec-
|
|
113
|
+
//# sourceMappingURL=types-import-spec-BijT0b-s-253rIcmj.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-import-spec-
|
|
1
|
+
{"version":3,"file":"types-import-spec-BijT0b-s-253rIcmj.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/types-import-spec-BijT0b-s.d.mts"],"mappings":";;;;;;;;;;;;;;KAaK;WACM;;WAEA;WACA;;WAEA;WACA,OAAO;;WAEP;;;;;;;UAOD;WACC;WACA;WACA,cAAc,OAAO,yBAAyB;;;UAG/C;WACC;;;KAGN,uBAAuB,sBAAsB;;;;;;KAM7C;WACM;;WAEA;WACA,iBAAiB;;KAEvB,0BAA0B;;WAEpB;;;KAGN,6BAA6B;WACvB;aACE;;WAEF,QAAQ;;;KAGd,8BAA8B;WACxB;aACE;;WAEF,QAAQ;;;KAGd,gCAAgC;WAC1B;aACE;aACA;;aAEA;aACA,OAAO;;WAET,QAAQ;;;;;;;KAOd,sBAAsB,6BAA6B,8BAA8B;;;;iBAIrE,uBAAuB,YAAY;;iBAEnC,6BAA6B,YAAY,sBAAsB,cAAc;;iBAE7E,8BAA8B,YAAY,sBAAsB,cAAc;;;;iBAI9E,sBAAsB,iBAAiB,SAAS;;;;;;;UAOvD;WACC;WACA;WACA"}
|
package/dist/utils.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as JsonValue, n as JsonObject, r as JsonPrimitive, t as JsonArray } from "./json-Dkqr3say.mjs";
|
|
2
2
|
import { a as ok, i as notOk, n as Ok, o as okVoid, r as Result, t as NotOk } from "./result-Bpupv5vO.mjs";
|
|
3
|
-
import { a as StructuredErrorOptions, c as isStructuredErrorCode, i as StructuredError, l as structuredError, n as DOCS_ERRORS_VERSION, o as docsUrlFor, r as NextAction, s as isStructuredError, t as DOCS_BASE } from "./structured-error-
|
|
3
|
+
import { a as StructuredErrorOptions, c as isStructuredErrorCode, i as StructuredError, l as structuredError, n as DOCS_ERRORS_VERSION, o as docsUrlFor, r as NextAction, s as isStructuredError, t as DOCS_BASE } from "./structured-error-Z4iE-fTI.mjs";
|
|
4
4
|
import { n as UnionToIntersection, t as Simplify } from "./types-DGxlljKG.mjs";
|
|
5
5
|
import { t as abortable } from "./abortable-DBbAaT_4.mjs";
|
|
6
6
|
import { t as isArrayEqual } from "./array-equal-dUd-VPlk.mjs";
|
|
@@ -9,8 +9,9 @@ import { t as canonicalStringify } from "./canonical-stringify-Bl6agy_g.mjs";
|
|
|
9
9
|
import { n as castAs, t as blindCast } from "./casts-D29CHGrr.mjs";
|
|
10
10
|
import { t as ifDefined } from "./defined-BSXuxrnl.mjs";
|
|
11
11
|
import { t as hashContent } from "./hash-content-DwEUh-Rx.mjs";
|
|
12
|
-
import { n as assertNever, r as isInternalError, t as InternalError } from "./internal-error-
|
|
12
|
+
import { n as assertNever, r as isInternalError, t as InternalError } from "./internal-error-2fJ9fcZX.mjs";
|
|
13
13
|
import { t as isThenable } from "./promise-DHJWZv49.mjs";
|
|
14
14
|
import { n as redactDatabaseUrl, t as RedactedDatabaseUrl } from "./redact-db-url-BlaloOwt.mjs";
|
|
15
15
|
import { t as SimplifyDeep } from "./simplify-deep-Dw9I_ZUl.mjs";
|
|
16
|
-
|
|
16
|
+
import { t as suppressIdleConnectionErrors } from "./suppress-idle-connection-errors-CKrTbp5P.mjs";
|
|
17
|
+
export { DOCS_BASE, DOCS_ERRORS_VERSION, InternalError, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, type NextAction, type NotOk, type Ok, type RedactedDatabaseUrl, type Result, type Simplify, type SimplifyDeep, type StructuredError, type StructuredErrorOptions, type UnionToIntersection, abortable, assertDefined, assertNever, blindCast, canonicalStringify, castAs, docsUrlFor, hashContent, ifDefined, invariant, isArrayEqual, isInternalError, isStructuredError, isStructuredErrorCode, isThenable, notOk, ok, okVoid, redactDatabaseUrl, structuredError, suppressIdleConnectionErrors };
|
package/dist/utils.mjs
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { n as castAs, t as blindCast } from "./casts-DpaahrlC-Bd5n2coI.mjs";
|
|
2
2
|
import { t as ifDefined } from "./defined-BQWA85QH-BRSBMULx.mjs";
|
|
3
|
-
import { a as isStructuredErrorCode, i as isStructuredError, n as DOCS_ERRORS_VERSION, o as structuredError, r as docsUrlFor, t as DOCS_BASE } from "./structured-error-
|
|
3
|
+
import { a as isStructuredErrorCode, i as isStructuredError, n as DOCS_ERRORS_VERSION, o as structuredError, r as docsUrlFor, t as DOCS_BASE } from "./structured-error-BXbihKQ-.mjs";
|
|
4
4
|
import { t as isArrayEqual } from "./array-equal-28xupwIB.mjs";
|
|
5
5
|
import { t as abortable } from "./abortable-CQO6uG9F.mjs";
|
|
6
|
-
import { n as assertNever, r as isInternalError, t as InternalError } from "./internal-error-
|
|
7
|
-
import { n as invariant, t as assertDefined } from "./assertions-
|
|
6
|
+
import { n as assertNever, r as isInternalError, t as InternalError } from "./internal-error-ChGYPVpq-DhUD05u0.mjs";
|
|
7
|
+
import { n as invariant, t as assertDefined } from "./assertions-Dw1lZz_Q.mjs";
|
|
8
8
|
import { t as canonicalStringify } from "./canonical-stringify-DY4NaAJi.mjs";
|
|
9
9
|
import { t as hashContent } from "./hash-content-Bugg_nZn.mjs";
|
|
10
10
|
import { t as isThenable } from "./promise-D8meygPf.mjs";
|
|
11
11
|
import { t as redactDatabaseUrl } from "./redact-db-url-CRWJWdB1.mjs";
|
|
12
|
-
import { n as ok, r as okVoid, t as notOk } from "./result-
|
|
13
|
-
|
|
12
|
+
import { n as ok, r as okVoid, t as notOk } from "./result-C0NUq1Ok.mjs";
|
|
13
|
+
import { t as suppressIdleConnectionErrors } from "./suppress-idle-connection-errors-DzApeUb3.mjs";
|
|
14
|
+
export { DOCS_BASE, DOCS_ERRORS_VERSION, InternalError, abortable, assertDefined, assertNever, blindCast, canonicalStringify, castAs, docsUrlFor, hashContent, ifDefined, invariant, isArrayEqual, isInternalError, isStructuredError, isStructuredErrorCode, isThenable, notOk, ok, okVoid, redactDatabaseUrl, structuredError, suppressIdleConnectionErrors };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as invariant, t as assertDefined } from "./assertions-
|
|
1
|
+
import { n as invariant, t as assertDefined } from "./assertions-Dw1lZz_Q.mjs";
|
|
2
2
|
export { assertDefined, invariant };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as assertNever, r as isInternalError, t as InternalError } from "./internal-error-
|
|
1
|
+
import { n as assertNever, r as isInternalError, t as InternalError } from "./internal-error-2fJ9fcZX.mjs";
|
|
2
2
|
export { InternalError, assertNever, isInternalError };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as assertNever, r as isInternalError, t as InternalError } from "./internal-error-
|
|
1
|
+
import { n as assertNever, r as isInternalError, t as InternalError } from "./internal-error-ChGYPVpq-DhUD05u0.mjs";
|
|
2
2
|
export { InternalError, assertNever, isInternalError };
|
package/dist/utils__result.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ok, r as okVoid, t as notOk } from "./result-
|
|
1
|
+
import { n as ok, r as okVoid, t as notOk } from "./result-C0NUq1Ok.mjs";
|
|
2
2
|
export { notOk, ok, okVoid };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as StructuredErrorOptions, c as isStructuredErrorCode, i as StructuredError, l as structuredError, n as DOCS_ERRORS_VERSION, o as docsUrlFor, r as NextAction, s as isStructuredError, t as DOCS_BASE } from "./structured-error-
|
|
1
|
+
import { a as StructuredErrorOptions, c as isStructuredErrorCode, i as StructuredError, l as structuredError, n as DOCS_ERRORS_VERSION, o as docsUrlFor, r as NextAction, s as isStructuredError, t as DOCS_BASE } from "./structured-error-Z4iE-fTI.mjs";
|
|
2
2
|
export { DOCS_BASE, DOCS_ERRORS_VERSION, type NextAction, type StructuredError, type StructuredErrorOptions, docsUrlFor, isStructuredError, isStructuredErrorCode, structuredError };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as isStructuredErrorCode, i as isStructuredError, n as DOCS_ERRORS_VERSION, o as structuredError, r as docsUrlFor, t as DOCS_BASE } from "./structured-error-
|
|
1
|
+
import { a as isStructuredErrorCode, i as isStructuredError, n as DOCS_ERRORS_VERSION, o as structuredError, r as docsUrlFor, t as DOCS_BASE } from "./structured-error-BXbihKQ-.mjs";
|
|
2
2
|
export { DOCS_BASE, DOCS_ERRORS_VERSION, docsUrlFor, isStructuredError, isStructuredErrorCode, structuredError };
|
|
@@ -30,6 +30,7 @@ function validateContractDomain(contract) {
|
|
|
30
30
|
validateRoots(contract, modelIndex, errors);
|
|
31
31
|
validateVariantsAndBases(modelIndex, errors);
|
|
32
32
|
validateRelationTargets(modelIndex, errors);
|
|
33
|
+
validateRelationNullability(modelIndex, errors);
|
|
33
34
|
validateDiscriminators(modelIndex, errors);
|
|
34
35
|
validateOwnership(contract, modelIndex, errors);
|
|
35
36
|
validateValueObjectReferences(contract, errors);
|
|
@@ -79,6 +80,19 @@ function validateRelationTargets(modelIndex, errors) {
|
|
|
79
80
|
if (!lookupModel(modelIndex, relation.to)) errors.push(`Relation "${relName}" on model "${namespaceId}:${modelName}" targets "${relation.to.namespace}:${relation.to.model}" which does not exist in domain.namespaces`);
|
|
80
81
|
}
|
|
81
82
|
}
|
|
83
|
+
function relationKindLabel(relation) {
|
|
84
|
+
return relation.on === void 0 ? "embed relation" : `${relation.cardinality} relation`;
|
|
85
|
+
}
|
|
86
|
+
function validateRelationNullability(modelIndex, errors) {
|
|
87
|
+
for (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) for (const [relName, relation] of Object.entries(model.relations ?? {})) {
|
|
88
|
+
const location = `Relation "${relName}" on model "${namespaceId}:${modelName}"`;
|
|
89
|
+
if (relation.on !== void 0 && (relation.cardinality === "1:1" || relation.cardinality === "N:1")) {
|
|
90
|
+
if (relation.nullable !== void 0 && typeof relation.nullable !== "boolean") errors.push(`${location} is a ${relation.cardinality} relation and its "nullable" must be a boolean`);
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
if (relation.nullable !== void 0) errors.push(`${location} is a ${relationKindLabel(relation)} and must not carry "nullable"`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
82
96
|
function validateDiscriminators(modelIndex, errors) {
|
|
83
97
|
for (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) {
|
|
84
98
|
if (model.discriminator) {
|
|
@@ -140,4 +154,4 @@ function validateFieldModifiers(modelIndex, contract, errors) {
|
|
|
140
154
|
//#endregion
|
|
141
155
|
export { validateContractDomain as t };
|
|
142
156
|
|
|
143
|
-
//# sourceMappingURL=validate-domain-
|
|
157
|
+
//# sourceMappingURL=validate-domain-CaT6wlDH.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-domain-CaT6wlDH.mjs","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/validate-domain.mjs"],"sourcesContent":["import { t as asNamespaceId } from \"./namespace-id-asbWpwMw.mjs\";\nimport { t as ContractValidationError } from \"./contract-validation-error-DEiWp_EI.mjs\";\n//#region src/validate-domain.ts\nfunction indexDomainModels(contract) {\n\tconst index = /* @__PURE__ */ new Map();\n\tfor (const [namespaceKey, namespace] of Object.entries(contract.domain.namespaces)) {\n\t\tconst namespaceId = asNamespaceId(namespaceKey);\n\t\tlet modelsInNamespace = index.get(namespaceId);\n\t\tif (modelsInNamespace === void 0) {\n\t\t\tmodelsInNamespace = /* @__PURE__ */ new Map();\n\t\t\tindex.set(namespaceId, modelsInNamespace);\n\t\t}\n\t\tfor (const [name, model] of Object.entries(namespace.models)) modelsInNamespace.set(name, {\n\t\t\tnamespaceId,\n\t\t\tname,\n\t\t\tmodel\n\t\t});\n\t}\n\treturn index;\n}\nfunction lookupModel(index, ref) {\n\treturn index.get(ref.namespace)?.get(ref.model);\n}\nfunction* iterateIndexedModels(index) {\n\tfor (const modelsInNamespace of index.values()) for (const entry of modelsInNamespace.values()) yield entry;\n}\nfunction validateContractDomain(contract) {\n\tconst errors = [];\n\tconst modelIndex = indexDomainModels(contract);\n\tvalidateRoots(contract, modelIndex, errors);\n\tvalidateVariantsAndBases(modelIndex, errors);\n\tvalidateRelationTargets(modelIndex, errors);\n\tvalidateRelationNullability(modelIndex, errors);\n\tvalidateDiscriminators(modelIndex, errors);\n\tvalidateOwnership(contract, modelIndex, errors);\n\tvalidateValueObjectReferences(contract, errors);\n\tvalidateFieldModifiers(modelIndex, contract, errors);\n\tif (errors.length > 0) throw new ContractValidationError(`Contract domain validation failed:\\n- ${errors.join(\"\\n- \")}`, \"domain\");\n}\nfunction validateRoots(contract, modelIndex, errors) {\n\tconst seenRootTargets = /* @__PURE__ */ new Map();\n\tfor (const [rootKey, crossRef] of Object.entries(contract.roots)) {\n\t\tlet modelsInNamespace = seenRootTargets.get(crossRef.namespace);\n\t\tif (modelsInNamespace === void 0) {\n\t\t\tmodelsInNamespace = /* @__PURE__ */ new Set();\n\t\t\tseenRootTargets.set(crossRef.namespace, modelsInNamespace);\n\t\t}\n\t\tif (modelsInNamespace.has(crossRef.model)) errors.push(`Duplicate root value: \"${crossRef.namespace}:${crossRef.model}\" is mapped by multiple root keys`);\n\t\tmodelsInNamespace.add(crossRef.model);\n\t\tif (!lookupModel(modelIndex, crossRef)) errors.push(`Root \"${rootKey}\" references model \"${crossRef.namespace}:${crossRef.model}\" which does not exist in domain.namespaces`);\n\t}\n}\nfunction validateVariantsAndBases(modelIndex, errors) {\n\tfor (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) {\n\t\tif (model.variants) for (const variantName of Object.keys(model.variants)) {\n\t\t\tconst variantEntry = lookupModel(modelIndex, {\n\t\t\t\tnamespace: namespaceId,\n\t\t\t\tmodel: variantName\n\t\t\t});\n\t\t\tif (!variantEntry) {\n\t\t\t\terrors.push(`Model \"${namespaceId}:${modelName}\" lists variant \"${variantName}\" which does not exist at that namespace coordinate`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst variantBase = variantEntry.model.base;\n\t\t\tif (variantBase?.namespace !== namespaceId || variantBase?.model !== modelName) errors.push(`Variant \"${namespaceId}:${variantName}\" has base \"${variantBase?.namespace ?? \"?\"}:${variantBase?.model ?? \"(none)\"}\" but expected \"${namespaceId}:${modelName}\"`);\n\t\t}\n\t\tif (model.base) {\n\t\t\tconst baseEntry = lookupModel(modelIndex, model.base);\n\t\t\tif (!baseEntry) {\n\t\t\t\terrors.push(`Model \"${namespaceId}:${modelName}\" has base \"${model.base.namespace}:${model.base.model}\" which does not exist in domain.namespaces`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!baseEntry.model.variants || !Object.hasOwn(baseEntry.model.variants, modelName)) errors.push(`Model \"${namespaceId}:${modelName}\" has base \"${model.base.namespace}:${model.base.model}\" which does not list it as a variant`);\n\t\t}\n\t}\n}\nfunction validateRelationTargets(modelIndex, errors) {\n\tfor (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) for (const [relName, relation] of Object.entries(model.relations ?? {})) {\n\t\tif (relation.to.space !== void 0) continue;\n\t\tif (!lookupModel(modelIndex, relation.to)) errors.push(`Relation \"${relName}\" on model \"${namespaceId}:${modelName}\" targets \"${relation.to.namespace}:${relation.to.model}\" which does not exist in domain.namespaces`);\n\t}\n}\nfunction relationKindLabel(relation) {\n\treturn relation.on === void 0 ? \"embed relation\" : `${relation.cardinality} relation`;\n}\nfunction validateRelationNullability(modelIndex, errors) {\n\tfor (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) for (const [relName, relation] of Object.entries(model.relations ?? {})) {\n\t\tconst location = `Relation \"${relName}\" on model \"${namespaceId}:${modelName}\"`;\n\t\tif (relation.on !== void 0 && (relation.cardinality === \"1:1\" || relation.cardinality === \"N:1\")) {\n\t\t\tif (relation.nullable !== void 0 && typeof relation.nullable !== \"boolean\") errors.push(`${location} is a ${relation.cardinality} relation and its \"nullable\" must be a boolean`);\n\t\t\tcontinue;\n\t\t}\n\t\tif (relation.nullable !== void 0) errors.push(`${location} is a ${relationKindLabel(relation)} and must not carry \"nullable\"`);\n\t}\n}\nfunction validateDiscriminators(modelIndex, errors) {\n\tfor (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) {\n\t\tif (model.discriminator) {\n\t\t\tif (!model.variants || Object.keys(model.variants).length === 0) errors.push(`Model \"${namespaceId}:${modelName}\" has discriminator but no variants`);\n\t\t\tif (!Object.hasOwn(model.fields, model.discriminator.field)) errors.push(`Discriminator field \"${model.discriminator.field}\" is not a field on model \"${namespaceId}:${modelName}\"`);\n\t\t}\n\t\tif (model.variants && Object.keys(model.variants).length > 0 && !model.discriminator) errors.push(`Model \"${namespaceId}:${modelName}\" has variants but no discriminator`);\n\t\tif (model.base) {\n\t\t\tif (model.discriminator) errors.push(`Model \"${namespaceId}:${modelName}\" has base and must not have discriminator`);\n\t\t\tif (model.variants && Object.keys(model.variants).length > 0) errors.push(`Model \"${namespaceId}:${modelName}\" has base and must not have variants`);\n\t\t}\n\t}\n}\nfunction validateOwnership(contract, modelIndex, errors) {\n\tfor (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) {\n\t\tif (!model.owner) continue;\n\t\tif (model.owner === modelName) errors.push(`Model \"${namespaceId}:${modelName}\" cannot own itself`);\n\t\tif (!lookupModel(modelIndex, {\n\t\t\tnamespace: namespaceId,\n\t\t\tmodel: model.owner\n\t\t})) errors.push(`Model \"${namespaceId}:${modelName}\" has owner \"${namespaceId}:${model.owner}\" which does not exist in domain.namespaces`);\n\t\tfor (const [rootKey, rootRef] of Object.entries(contract.roots)) if (rootRef.namespace === namespaceId && rootRef.model === modelName) errors.push(`Owned model \"${namespaceId}:${modelName}\" must not appear in roots (found as root \"${rootKey}\")`);\n\t}\n}\nfunction validateValueObjectReferences(contract, errors) {\n\tconst voNamesByNamespace = /* @__PURE__ */ new Map();\n\tfor (const [namespaceKey, namespace] of Object.entries(contract.domain.namespaces)) {\n\t\tconst namespaceId = asNamespaceId(namespaceKey);\n\t\tvoNamesByNamespace.set(namespaceId, new Set(Object.keys(namespace.valueObjects ?? {})));\n\t}\n\tfunction checkType(type, location, namespaceId) {\n\t\tif (!type) return;\n\t\tconst voNames = voNamesByNamespace.get(namespaceId) ?? /* @__PURE__ */ new Set();\n\t\tif (type.kind === \"valueObject\" && type.name && !voNames.has(type.name)) {\n\t\t\terrors.push(`${location} references value object \"${namespaceId}:${type.name}\" which does not exist in that namespace's valueObjects`);\n\t\t\treturn;\n\t\t}\n\t\tif (type.kind === \"union\") for (const member of type.members ?? []) checkType(member, location, namespaceId);\n\t}\n\tfor (const [namespaceKey, namespace] of Object.entries(contract.domain.namespaces)) {\n\t\tconst namespaceId = asNamespaceId(namespaceKey);\n\t\tfor (const [modelName, model] of Object.entries(namespace.models)) for (const [fieldName, field] of Object.entries(model.fields)) checkType(field?.type, `Model \"${namespaceId}:${modelName}\" field \"${fieldName}\"`, namespaceId);\n\t\tfor (const [voName, vo] of Object.entries(namespace.valueObjects ?? {})) for (const [fieldName, field] of Object.entries(vo.fields)) checkType(field?.type, `Value object \"${namespaceId}:${voName}\" field \"${fieldName}\"`, namespaceId);\n\t}\n}\nfunction validateFieldModifiers(modelIndex, contract, errors) {\n\tfor (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) for (const [fieldName, field] of Object.entries(model.fields)) {\n\t\tconst f = field;\n\t\tif (f?.many && f?.dict) errors.push(`Model \"${namespaceId}:${modelName}\" field \"${fieldName}\" cannot have both \"many\" and \"dict\" modifiers`);\n\t}\n\tfor (const [namespaceKey, namespace] of Object.entries(contract.domain.namespaces)) {\n\t\tconst namespaceId = asNamespaceId(namespaceKey);\n\t\tfor (const [voName, vo] of Object.entries(namespace.valueObjects ?? {})) for (const [fieldName, field] of Object.entries(vo.fields)) {\n\t\t\tconst f = field;\n\t\t\tif (f?.many && f?.dict) errors.push(`Value object \"${namespaceId}:${voName}\" field \"${fieldName}\" cannot have both \"many\" and \"dict\" modifiers`);\n\t\t}\n\t}\n}\n//#endregion\nexport { validateContractDomain };\n\n//# sourceMappingURL=validate-domain.mjs.map"],"mappings":";;;AAGA,SAAS,kBAAkB,UAAU;CACpC,MAAM,wBAAwB,IAAI,IAAI;CACtC,KAAK,MAAM,CAAC,cAAc,cAAc,OAAO,QAAQ,SAAS,OAAO,UAAU,GAAG;EACnF,MAAM,cAAc,cAAc,YAAY;EAC9C,IAAI,oBAAoB,MAAM,IAAI,WAAW;EAC7C,IAAI,sBAAsB,KAAK,GAAG;GACjC,oCAAoC,IAAI,IAAI;GAC5C,MAAM,IAAI,aAAa,iBAAiB;EACzC;EACA,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,UAAU,MAAM,GAAG,kBAAkB,IAAI,MAAM;GACzF;GACA;GACA;EACD,CAAC;CACF;CACA,OAAO;AACR;AACA,SAAS,YAAY,OAAO,KAAK;CAChC,OAAO,MAAM,IAAI,IAAI,SAAS,CAAC,EAAE,IAAI,IAAI,KAAK;AAC/C;AACA,UAAU,qBAAqB,OAAO;CACrC,KAAK,MAAM,qBAAqB,MAAM,OAAO,GAAG,KAAK,MAAM,SAAS,kBAAkB,OAAO,GAAG,MAAM;AACvG;AACA,SAAS,uBAAuB,UAAU;CACzC,MAAM,SAAS,CAAC;CAChB,MAAM,aAAa,kBAAkB,QAAQ;CAC7C,cAAc,UAAU,YAAY,MAAM;CAC1C,yBAAyB,YAAY,MAAM;CAC3C,wBAAwB,YAAY,MAAM;CAC1C,4BAA4B,YAAY,MAAM;CAC9C,uBAAuB,YAAY,MAAM;CACzC,kBAAkB,UAAU,YAAY,MAAM;CAC9C,8BAA8B,UAAU,MAAM;CAC9C,uBAAuB,YAAY,UAAU,MAAM;CACnD,IAAI,OAAO,SAAS,GAAG,MAAM,IAAI,wBAAwB,yCAAyC,OAAO,KAAK,MAAM,KAAK,QAAQ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AiB,YAAY,GAAG,OAAO,WAAW,UAAU,IAAI,WAAW;CACxO;AACD;AACA,SAAS,uBAAuB,YAAY,UAAU,QAAQ;CAC7D,KAAK,MAAM,EAAE,aAAa,MAAM,WAAW,WAAW,qBAAqB,UAAU,GAAG,KAAK,MAAM,CAAC,WAAW,UAAU,OAAO,QAAQ,MAAM,MAAM,GAAG;EACtJ,MAAM,IAAI;EACV,IAAI,GAAG,QAAQ,GAAG,MAAM,OAAO,KAAK,UAAU,YAAY,GAAG,UAAU,WAAW,UAAU,+CAA+C;CAC5I;CACA,KAAK,MAAM,CAAC,cAAc,cAAc,OAAO,QAAQ,SAAS,OAAO,UAAU,GAAG;EACnF,MAAM,cAAc,cAAc,YAAY;EAC9C,KAAK,MAAM,CAAC,QAAQ,OAAO,OAAO,QAAQ,UAAU,gBAAgB,CAAC,CAAC,GAAG,KAAK,MAAM,CAAC,WAAW,UAAU,OAAO,QAAQ,GAAG,MAAM,GAAG;GACpI,MAAM,IAAI;GACV,IAAI,GAAG,QAAQ,GAAG,MAAM,OAAO,KAAK,iBAAiB,YAAY,GAAG,OAAO,WAAW,UAAU,+CAA+C;EAChJ;CACD;AACD"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as CrossReference, E as ContractWithDomain } from "./domain-envelope-CENjHN4U-BIIt9bl4.mjs";
|
|
2
2
|
//#region ../../../1-framework/0-foundation/contract/dist/validate-domain.d.mts
|
|
3
3
|
//#region src/validate-domain.d.ts
|
|
4
|
+
interface DomainRelationShape {
|
|
5
|
+
readonly to: CrossReference;
|
|
6
|
+
readonly cardinality?: string;
|
|
7
|
+
readonly on?: unknown;
|
|
8
|
+
readonly nullable?: unknown;
|
|
9
|
+
}
|
|
4
10
|
interface DomainModelShape {
|
|
5
11
|
readonly fields: Record<string, unknown>;
|
|
6
|
-
readonly relations?: Record<string,
|
|
7
|
-
readonly to: CrossReference;
|
|
8
|
-
}>;
|
|
12
|
+
readonly relations?: Record<string, DomainRelationShape>;
|
|
9
13
|
readonly discriminator?: {
|
|
10
14
|
readonly field: string;
|
|
11
15
|
};
|
|
@@ -19,4 +23,4 @@ interface DomainContractShape extends ContractWithDomain {
|
|
|
19
23
|
declare function validateContractDomain(contract: DomainContractShape): void;
|
|
20
24
|
//#endregion
|
|
21
25
|
export { DomainModelShape as n, validateContractDomain as r, DomainContractShape as t };
|
|
22
|
-
//# sourceMappingURL=validate-domain-
|
|
26
|
+
//# sourceMappingURL=validate-domain-DJXNOlkP.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-domain-DJXNOlkP.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/validate-domain.d.mts"],"mappings":";;;UAEU;WACC,IAAI;WACJ;WACA;WACA;;UAED;WACC,QAAQ;WACR,YAAY,eAAe;WAC3B;aACE;;WAEF,WAAW;WACX,OAAO;WACP;;UAED,4BAA4B;WAC3B,OAAO,eAAe;;iBAEhB,uBAAuB,UAAU"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/orm-framework",
|
|
3
|
-
"version": "8.0.0-rc.
|
|
3
|
+
"version": "8.0.0-rc.10",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"description": "Prisma
|
|
7
|
+
"description": "Prisma 8 target-agnostic runtime: contract, components, authoring surface",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
@@ -15,23 +15,23 @@
|
|
|
15
15
|
"uniku": "^0.5.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@internal/config": "8.0.0-rc.
|
|
19
|
-
"@internal/contract": "8.0.0-rc.
|
|
20
|
-
"@internal/contract-authoring": "8.0.0-rc.
|
|
21
|
-
"@internal/errors": "8.0.0-rc.
|
|
22
|
-
"@internal/framework-components": "8.0.0-rc.
|
|
23
|
-
"@internal/ids": "8.0.0-rc.
|
|
24
|
-
"@internal/operations": "8.0.0-rc.
|
|
25
|
-
"@internal/psl-parser": "8.0.0-rc.
|
|
26
|
-
"@internal/psl-printer": "8.0.0-rc.
|
|
27
|
-
"@internal/ts-render": "8.0.0-rc.
|
|
28
|
-
"@repo/tsconfig": "8.0.0-rc.
|
|
29
|
-
"@internal/publish-surface": "8.0.0-rc.
|
|
30
|
-
"@repo/tsdown": "8.0.0-rc.
|
|
31
|
-
"@internal/utils": "8.0.0-rc.
|
|
18
|
+
"@internal/config": "8.0.0-rc.10",
|
|
19
|
+
"@internal/contract": "8.0.0-rc.10",
|
|
20
|
+
"@internal/contract-authoring": "8.0.0-rc.10",
|
|
21
|
+
"@internal/errors": "8.0.0-rc.10",
|
|
22
|
+
"@internal/framework-components": "8.0.0-rc.10",
|
|
23
|
+
"@internal/ids": "8.0.0-rc.10",
|
|
24
|
+
"@internal/operations": "8.0.0-rc.10",
|
|
25
|
+
"@internal/psl-parser": "8.0.0-rc.10",
|
|
26
|
+
"@internal/psl-printer": "8.0.0-rc.10",
|
|
27
|
+
"@internal/ts-render": "8.0.0-rc.10",
|
|
28
|
+
"@repo/tsconfig": "8.0.0-rc.10",
|
|
29
|
+
"@internal/publish-surface": "8.0.0-rc.10",
|
|
30
|
+
"@repo/tsdown": "8.0.0-rc.10",
|
|
31
|
+
"@internal/utils": "8.0.0-rc.10",
|
|
32
32
|
"tsdown": "0.22.14",
|
|
33
33
|
"typescript": "5.9.3",
|
|
34
|
-
"vitest": "
|
|
34
|
+
"vitest": "5.0.0-rc.2"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"typescript": ">=5.9"
|
|
@@ -97,12 +97,13 @@
|
|
|
97
97
|
"./utils/result": "./dist/utils__result.mjs",
|
|
98
98
|
"./utils/simplify-deep": "./dist/utils__simplify-deep.mjs",
|
|
99
99
|
"./utils/structured-error": "./dist/utils__structured-error.mjs",
|
|
100
|
+
"./utils/suppress-idle-connection-errors": "./dist/utils__suppress-idle-connection-errors.mjs",
|
|
100
101
|
"./utils/types": "./dist/utils__types.mjs",
|
|
101
102
|
"./package.json": "./package.json"
|
|
102
103
|
},
|
|
103
104
|
"repository": {
|
|
104
105
|
"type": "git",
|
|
105
|
-
"url": "https://github.com/prisma/
|
|
106
|
+
"url": "https://github.com/prisma/orm.git",
|
|
106
107
|
"directory": "packages/9-public/@prisma/orm-framework"
|
|
107
108
|
},
|
|
108
109
|
"scripts": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apply-specifier-default-control-policy-CAxiXxKg.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/apply-specifier-default-control-policy.d.mts"],"mappings":";;;iBAEiB,mCAAmC,UAAU,UAAU,kBAAkB,4BAA4B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./framework-authoring-BhctBwih-DQ_6noDM.mjs";
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
//#region ../../../1-framework/1-core/config/dist/config-types.mjs
|
|
2
|
-
/**
|
|
3
|
-
* Default *source* directory for the contract file the user authors at `init`
|
|
4
|
-
* time. Output artefacts colocate with source per the same rule path-bearing
|
|
5
|
-
* providers apply.
|
|
6
|
-
*/
|
|
7
|
-
const DEFAULT_CONTRACT_SOURCE_DIR = "src/prisma";
|
|
8
|
-
function normalizeContractConfig(contract) {
|
|
9
|
-
const inMemoryFallbackOutput = `${DEFAULT_CONTRACT_SOURCE_DIR}/contract.json`;
|
|
10
|
-
return {
|
|
11
|
-
source: contract.source,
|
|
12
|
-
output: contract.output ?? inMemoryFallbackOutput
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Version of the config format produced by this `defineConfig`. Bumped when
|
|
17
|
-
* the config shape changes incompatibly.
|
|
18
|
-
*/
|
|
19
|
-
const CONFIG_FORMAT_VERSION = 1;
|
|
20
|
-
const CONFIG_FORMAT_VERSION_KEY = Symbol.for("prisma-next.config-format-version");
|
|
21
|
-
function stampConfigFormatVersion(config) {
|
|
22
|
-
Object.defineProperty(config, CONFIG_FORMAT_VERSION_KEY, {
|
|
23
|
-
value: 1,
|
|
24
|
-
enumerable: false,
|
|
25
|
-
configurable: false,
|
|
26
|
-
writable: false
|
|
27
|
-
});
|
|
28
|
-
return config;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Reads the config-format version stamped by `defineConfig`, or `undefined`
|
|
32
|
-
* when the value was not produced by `defineConfig`. The marker is
|
|
33
|
-
* non-enumerable and does not survive spreads: configs must export the
|
|
34
|
-
* `defineConfig` result directly.
|
|
35
|
-
*/
|
|
36
|
-
function readConfigFormatVersion(value) {
|
|
37
|
-
if (typeof value !== "object" || value === null) return;
|
|
38
|
-
const version = Reflect.get(value, CONFIG_FORMAT_VERSION_KEY);
|
|
39
|
-
return typeof version === "number" ? version : void 0;
|
|
40
|
-
}
|
|
41
|
-
function hasCurrentConfigFormatVersion(value) {
|
|
42
|
-
return readConfigFormatVersion(value) === 1;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Helper function to define a Prisma Next config.
|
|
46
|
-
* Normalizes the config and stamps it with the config-format version marker.
|
|
47
|
-
* Structural validation happens in the config loader, which reports
|
|
48
|
-
* per-section diagnostics instead of failing the whole load.
|
|
49
|
-
*
|
|
50
|
-
* Normalization:
|
|
51
|
-
* - contract.output defaults to a path colocated with DEFAULT_CONTRACT_SOURCE_DIR
|
|
52
|
-
* when missing (in-memory-only providers)
|
|
53
|
-
*
|
|
54
|
-
* @param config - Raw config input from user
|
|
55
|
-
* @returns Normalized config IR with defaults applied
|
|
56
|
-
*/
|
|
57
|
-
function defineConfig(config) {
|
|
58
|
-
if (config.contract) return stampConfigFormatVersion({
|
|
59
|
-
...config,
|
|
60
|
-
contract: normalizeContractConfig(config.contract)
|
|
61
|
-
});
|
|
62
|
-
return stampConfigFormatVersion(config);
|
|
63
|
-
}
|
|
64
|
-
//#endregion
|
|
65
|
-
export { normalizeContractConfig as a, hasCurrentConfigFormatVersion as i, DEFAULT_CONTRACT_SOURCE_DIR as n, readConfigFormatVersion as o, defineConfig as r, CONFIG_FORMAT_VERSION as t };
|
|
66
|
-
|
|
67
|
-
//# sourceMappingURL=config-types-BqhNxw0z.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-types-BqhNxw0z.mjs","names":[],"sources":["../../../../1-framework/1-core/config/dist/config-types.mjs"],"sourcesContent":["//#region src/config-types.ts\n/**\n* Default *source* directory for the contract file the user authors at `init`\n* time. Output artefacts colocate with source per the same rule path-bearing\n* providers apply.\n*/\nconst DEFAULT_CONTRACT_SOURCE_DIR = \"src/prisma\";\nfunction normalizeContractConfig(contract) {\n\tconst inMemoryFallbackOutput = `${DEFAULT_CONTRACT_SOURCE_DIR}/contract.json`;\n\treturn {\n\t\tsource: contract.source,\n\t\toutput: contract.output ?? inMemoryFallbackOutput\n\t};\n}\n/**\n* Version of the config format produced by this `defineConfig`. Bumped when\n* the config shape changes incompatibly.\n*/\nconst CONFIG_FORMAT_VERSION = 1;\nconst CONFIG_FORMAT_VERSION_KEY = Symbol.for(\"prisma-next.config-format-version\");\nfunction stampConfigFormatVersion(config) {\n\tObject.defineProperty(config, CONFIG_FORMAT_VERSION_KEY, {\n\t\tvalue: 1,\n\t\tenumerable: false,\n\t\tconfigurable: false,\n\t\twritable: false\n\t});\n\treturn config;\n}\n/**\n* Reads the config-format version stamped by `defineConfig`, or `undefined`\n* when the value was not produced by `defineConfig`. The marker is\n* non-enumerable and does not survive spreads: configs must export the\n* `defineConfig` result directly.\n*/\nfunction readConfigFormatVersion(value) {\n\tif (typeof value !== \"object\" || value === null) return;\n\tconst version = Reflect.get(value, CONFIG_FORMAT_VERSION_KEY);\n\treturn typeof version === \"number\" ? version : void 0;\n}\nfunction hasCurrentConfigFormatVersion(value) {\n\treturn readConfigFormatVersion(value) === 1;\n}\n/**\n* Helper function to define a Prisma Next config.\n* Normalizes the config and stamps it with the config-format version marker.\n* Structural validation happens in the config loader, which reports\n* per-section diagnostics instead of failing the whole load.\n*\n* Normalization:\n* - contract.output defaults to a path colocated with DEFAULT_CONTRACT_SOURCE_DIR\n* when missing (in-memory-only providers)\n*\n* @param config - Raw config input from user\n* @returns Normalized config IR with defaults applied\n*/\nfunction defineConfig(config) {\n\tif (config.contract) return stampConfigFormatVersion({\n\t\t...config,\n\t\tcontract: normalizeContractConfig(config.contract)\n\t});\n\treturn stampConfigFormatVersion(config);\n}\n//#endregion\nexport { CONFIG_FORMAT_VERSION, DEFAULT_CONTRACT_SOURCE_DIR, defineConfig, hasCurrentConfigFormatVersion, normalizeContractConfig, readConfigFormatVersion };\n\n//# sourceMappingURL=config-types.mjs.map"],"mappings":";;;;;;AAMA,MAAM,8BAA8B;AACpC,SAAS,wBAAwB,UAAU;CAC1C,MAAM,yBAAyB,GAAG,4BAA4B;CAC9D,OAAO;EACN,QAAQ,SAAS;EACjB,QAAQ,SAAS,UAAU;CAC5B;AACD;;;;;AAKA,MAAM,wBAAwB;AAC9B,MAAM,4BAA4B,OAAO,IAAI,mCAAmC;AAChF,SAAS,yBAAyB,QAAQ;CACzC,OAAO,eAAe,QAAQ,2BAA2B;EACxD,OAAO;EACP,YAAY;EACZ,cAAc;EACd,UAAU;CACX,CAAC;CACD,OAAO;AACR;;;;;;;AAOA,SAAS,wBAAwB,OAAO;CACvC,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM;CACjD,MAAM,UAAU,QAAQ,IAAI,OAAO,yBAAyB;CAC5D,OAAO,OAAO,YAAY,WAAW,UAAU,KAAK;AACrD;AACA,SAAS,8BAA8B,OAAO;CAC7C,OAAO,wBAAwB,KAAK,MAAM;AAC3C;;;;;;;;;;;;;;AAcA,SAAS,aAAa,QAAQ;CAC7B,IAAI,OAAO,UAAU,OAAO,yBAAyB;EACpD,GAAG;EACH,UAAU,wBAAwB,OAAO,QAAQ;CAClD,CAAC;CACD,OAAO,yBAAyB,MAAM;AACvC"}
|