@prisma/orm-family-sql 8.0.0-rc.24-dev.29 → 8.0.0-rc.24-dev.30

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.
Files changed (42) hide show
  1. package/dist/{config-types-BVrGV95W.mjs → config-types-CGDhWE3o.mjs} +2 -2
  2. package/dist/{config-types-BVrGV95W.mjs.map → config-types-CGDhWE3o.mjs.map} +1 -1
  3. package/dist/{contract-builder-q2-4IVcW.mjs → contract-builder-BqswyknO.mjs} +3 -3
  4. package/dist/{contract-builder-q2-4IVcW.mjs.map → contract-builder-BqswyknO.mjs.map} +1 -1
  5. package/dist/contract-prisma7__provider.mjs +5 -5
  6. package/dist/contract-psl.mjs +1 -1
  7. package/dist/contract-psl__attribute-specs.mjs +1 -1
  8. package/dist/contract-psl__provider.mjs +2 -2
  9. package/dist/contract-ts.mjs +3 -3
  10. package/dist/contract-ts__config-types.mjs +1 -1
  11. package/dist/contract-ts__contract-builder.mjs +2 -2
  12. package/dist/contract.d.mts +1 -1
  13. package/dist/contract.mjs +1 -1
  14. package/dist/contract__validators.d.mts +1 -1
  15. package/dist/contract__validators.mjs +1 -1
  16. package/dist/{control-L4h4N5uy.d.mts → control-BwL5tCj4.d.mts} +2 -2
  17. package/dist/{control-L4h4N5uy.d.mts.map → control-BwL5tCj4.d.mts.map} +1 -1
  18. package/dist/{control-Mh99W3HI.mjs → control-DUbuxp4j.mjs} +5 -5
  19. package/dist/{control-Mh99W3HI.mjs.map → control-DUbuxp4j.mjs.map} +1 -1
  20. package/dist/{derived-checks-BoHNzt-a-CK4ceMbs.mjs → derived-checks-BoHNzt-a-4Vi-QMdx.mjs} +2 -2
  21. package/dist/{derived-checks-BoHNzt-a-CK4ceMbs.mjs.map → derived-checks-BoHNzt-a-4Vi-QMdx.mjs.map} +1 -1
  22. package/dist/family.d.mts +2 -2
  23. package/dist/family.mjs +4 -4
  24. package/dist/family__control.d.mts +2 -2
  25. package/dist/family__control.mjs +2 -2
  26. package/dist/family__ir.mjs +1 -1
  27. package/dist/family__pack.mjs +2 -2
  28. package/dist/{generator-functions-Bze9nVHL-q4YmMS5B.mjs → generator-functions-Bze9nVHL-Bg9PVsti.mjs} +2 -2
  29. package/dist/{generator-functions-Bze9nVHL-q4YmMS5B.mjs.map → generator-functions-Bze9nVHL-Bg9PVsti.mjs.map} +1 -1
  30. package/dist/{interpreter-DoQwVOyS-DXYLj31g.mjs → interpreter-DoQwVOyS-BMiOIZcg.mjs} +4 -4
  31. package/dist/{interpreter-DoQwVOyS-DXYLj31g.mjs.map → interpreter-DoQwVOyS-BMiOIZcg.mjs.map} +1 -1
  32. package/dist/{psl-field-resolution-CpxUePg1-COJnJkDs.mjs → psl-field-resolution-CpxUePg1-tvt3yqqs.mjs} +3 -3
  33. package/dist/{psl-field-resolution-CpxUePg1-COJnJkDs.mjs.map → psl-field-resolution-CpxUePg1-tvt3yqqs.mjs.map} +1 -1
  34. package/dist/{sql-contract-serializer-sMY3prTx-CIDal1t1.mjs → sql-contract-serializer-sMY3prTx-hb9EW6FW.mjs} +2 -2
  35. package/dist/{sql-contract-serializer-sMY3prTx-CIDal1t1.mjs.map → sql-contract-serializer-sMY3prTx-hb9EW6FW.mjs.map} +1 -1
  36. package/dist/{validators-DbCIebZb.mjs → validators-CcR6gGf_.mjs} +12 -2
  37. package/dist/validators-CcR6gGf_.mjs.map +1 -0
  38. package/dist/{validators-Dt-19ywK.d.mts → validators-Dq7g7udF.d.mts} +10 -2
  39. package/dist/validators-Dq7g7udF.d.mts.map +1 -0
  40. package/package.json +19 -19
  41. package/dist/validators-DbCIebZb.mjs.map +0 -1
  42. package/dist/validators-Dt-19ywK.d.mts.map +0 -1
@@ -1,4 +1,4 @@
1
- import { i as contractError, n as buildSqlContractFromDefinition, t as applySqlSpecifierControlPolicy } from "./derived-checks-BoHNzt-a-CK4ceMbs.mjs";
1
+ import { i as contractError, n as buildSqlContractFromDefinition, t as applySqlSpecifierControlPolicy } from "./derived-checks-BoHNzt-a-4Vi-QMdx.mjs";
2
2
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
3
3
  import { createDataTypeLookup, emptyCodecLookup } from "@prisma/orm-framework/components/codec";
4
4
  import { InternalError } from "@prisma/orm-framework/utils/internal-error";
@@ -144,4 +144,4 @@ function typescriptContractFromPath(contractPath, output, options) {
144
144
  //#endregion
145
145
  export { typescriptContractFromPath as i, refuseOtherTargetOnLoad as n, typescriptContract as r, emptyContract as t };
146
146
 
147
- //# sourceMappingURL=config-types-BVrGV95W.mjs.map
147
+ //# sourceMappingURL=config-types-CGDhWE3o.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-types-BVrGV95W.mjs","names":[],"sources":["../../../../2-sql-family/2-authoring/contract-ts/dist/config-types.mjs"],"sourcesContent":["import { l as contractError, n as buildSqlContractFromDefinition, t as applySqlSpecifierControlPolicy } from \"./derived-checks-BoHNzt-a.mjs\";\nimport { createDataTypeLookup, emptyCodecLookup } from \"@internal/framework-components/codec\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { pathToFileURL } from \"node:url\";\nimport { ok } from \"@internal/utils/result\";\nimport { extname } from \"pathe\";\n//#region src/config-types.ts\n/**\n* Derives the emit output path from the TS contract input so artefacts land\n* colocated with the source (e.g. `prisma/contract.ts` →\n* `prisma/contract.json`). Mirrors the same default-derivation logic in\n* `@internal/sql-contract-psl/provider`.\n*/\nfunction defaultOutputFromContractPath(contractPath) {\n\tconst ext = extname(contractPath);\n\tif (ext.length === 0) return `${contractPath}.json`;\n\treturn `${contractPath.slice(0, -ext.length)}.json`;\n}\nfunction describeContract({ format, inputs }) {\n\tconst kind = format === \"typescript\" ? \"The TypeScript contract\" : \"The contract\";\n\tconst path = inputs?.[0];\n\treturn path === void 0 ? `${kind} in the config` : `${kind} \"${path}\"`;\n}\nfunction otherTargetGuidance({ format, inputs }, actual, expected) {\n\tif (format === \"psl\") return {\n\t\twhy: `The contract config read the schema for target \"${actual}\".`,\n\t\tfix: `Pass the schema's path as \\`contract\\`, so the config reads it for target \"${expected.target.targetId}\".`\n\t};\n\tif (inputs?.[0] === void 0) return {\n\t\twhy: `The contract was built for target \"${actual}\".`,\n\t\tfix: `Pass a contract built with defineContract imported from ${expected.contractBuilderModule}.`\n\t};\n\treturn {\n\t\twhy: `The contract file imports defineContract from the package for target \"${actual}\".`,\n\t\tfix: `Import defineContract from ${expected.contractBuilderModule}.`\n\t};\n}\nfunction refuseOtherTarget(origin, loaded, expected) {\n\tconst actual = loaded[\"target\"];\n\tconst configured = expected.target.targetId;\n\tif (typeof actual !== \"string\" || actual === configured) return;\n\tthrow contractError(\"CONTRACT.TARGET_MISMATCH\", `${describeContract(origin)} was built for target \"${actual}\", but the config is for target \"${configured}\".`, {\n\t\t...otherTargetGuidance(origin, actual, expected),\n\t\tmeta: {\n\t\t\t...ifDefined(\"contract\", origin.inputs?.[0]),\n\t\t\texpected: configured,\n\t\t\tactual\n\t\t}\n\t});\n}\n/** A ready contract config whose loaded contract is refused when it was built for another target than the config's. Any other result passes through unchanged. */\nfunction refuseOtherTargetOnLoad(config, expected) {\n\tconst { source } = config;\n\treturn {\n\t\t...config,\n\t\tsource: {\n\t\t\t...source,\n\t\t\tload: async (context) => {\n\t\t\t\tconst result = await source.load(context);\n\t\t\t\tconst loaded = isRecord(result) && result.ok === true ? result.value : void 0;\n\t\t\t\tif (isRecord(loaded)) refuseOtherTarget(source, loaded, expected);\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t};\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nconst isNonEmptyString = (value) => typeof value === \"string\" && value.length > 0;\nfunction isContractOfAnyFamily(value) {\n\tif (!isRecord(value)) return false;\n\tconst storage = value[\"storage\"];\n\treturn isNonEmptyString(value[\"targetFamily\"]) && isNonEmptyString(value[\"target\"]) && isRecord(storage) && isRecord(storage[\"namespaces\"]);\n}\nfunction isSqlContract(value) {\n\treturn isContractOfAnyFamily(value) && value[\"targetFamily\"] === \"sql\";\n}\nfunction emptyContract(options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"typescript\",\n\t\t\tload: async () => {\n\t\t\t\treturn ok(applySqlSpecifierControlPolicy(buildSqlContractFromDefinition({\n\t\t\t\t\twarnings: void 0,\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\tcreateNamespace: options.createNamespace,\n\t\t\t\t\tmodels: []\n\t\t\t\t}, {\n\t\t\t\t\t...emptyCodecLookup,\n\t\t\t\t\tdescriptorFor: () => void 0\n\t\t\t\t}, createDataTypeLookup([])), options.defaultControlPolicy, options.createNamespace));\n\t\t\t}\n\t\t},\n\t\t...ifDefined(\"output\", options.output)\n\t};\n}\nfunction typescriptContract(contract, output, options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"typescript\",\n\t\t\tload: async () => ok(options === void 0 ? contract : applySqlSpecifierControlPolicy(contract, options.defaultControlPolicy, options.createNamespace))\n\t\t},\n\t\t...ifDefined(\"output\", output)\n\t};\n}\n/** A contract loaded from the TypeScript module at `contractPath`, refused when it was built for another target than the config's. */\nfunction typescriptContractFromPath(contractPath, output, options) {\n\tconst policy = options.defaultControlPolicy === void 0 ? void 0 : options;\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"typescript\",\n\t\t\tinputs: [contractPath],\n\t\t\tload: async (context) => {\n\t\t\t\tconst [absolutePath] = context.resolvedInputs;\n\t\t\t\tif (absolutePath === void 0) throw new InternalError(\"typescriptContractFromPath: context.resolvedInputs is empty. The CLI config loader should populate it from source.inputs.\");\n\t\t\t\tconst mod = await import(pathToFileURL(absolutePath).href);\n\t\t\t\tif (mod.default === void 0 && mod.contract === void 0) throw contractError(\"CONTRACT.MODULE_EXPORT_MISSING\", `The contract file \"${contractPath}\" has no default export or named export \\`contract\\`.`, {\n\t\t\t\t\tfix: \"Export the contract that defineContract returns as the default export or as `export const contract`.\",\n\t\t\t\t\tmeta: { path: absolutePath }\n\t\t\t\t});\n\t\t\t\tconst exported = mod.default ?? mod.contract;\n\t\t\t\tconst origin = {\n\t\t\t\t\tformat: \"typescript\",\n\t\t\t\t\tinputs: [contractPath]\n\t\t\t\t};\n\t\t\t\tif (isContractOfAnyFamily(exported)) refuseOtherTarget(origin, exported, options);\n\t\t\t\tif (!isSqlContract(exported)) throw contractError(\"CONTRACT.EXPORT_INVALID\", `The TypeScript contract \"${contractPath}\" exports a value that is not a SQL contract.`, {\n\t\t\t\t\twhy: \"A contract file must export the contract that defineContract returns, and this export is something else.\",\n\t\t\t\t\tfix: `Import defineContract from ${options.contractBuilderModule} and export the contract it returns as the default export or as \\`export const contract\\`.`,\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tpath: absolutePath,\n\t\t\t\t\t\treason: \"not-a-contract\"\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tconst contract = exported;\n\t\t\t\treturn ok(policy === void 0 ? contract : applySqlSpecifierControlPolicy(contract, policy.defaultControlPolicy, policy.createNamespace));\n\t\t\t}\n\t\t},\n\t\toutput: output ?? defaultOutputFromContractPath(contractPath)\n\t};\n}\n//#endregion\nexport { emptyContract, refuseOtherTargetOnLoad, typescriptContract, typescriptContractFromPath };\n\n//# sourceMappingURL=config-types.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,SAAS,8BAA8B,cAAc;CACpD,MAAM,MAAM,QAAQ,YAAY;CAChC,IAAI,IAAI,WAAW,GAAG,OAAO,GAAG,aAAa;CAC7C,OAAO,GAAG,aAAa,MAAM,GAAG,CAAC,IAAI,MAAM,EAAE;AAC9C;AACA,SAAS,iBAAiB,EAAE,QAAQ,UAAU;CAC7C,MAAM,OAAO,WAAW,eAAe,4BAA4B;CACnE,MAAM,OAAO,SAAS;CACtB,OAAO,SAAS,KAAK,IAAI,GAAG,KAAK,kBAAkB,GAAG,KAAK,IAAI,KAAK;AACrE;AACA,SAAS,oBAAoB,EAAE,QAAQ,UAAU,QAAQ,UAAU;CAClE,IAAI,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MAAM,aAAa;IAC5B,CAAC;IACD,MAAM,WAAW,IAAI,WAAW,IAAI;IACpC,MAAM,SAAS;KACd,QAAQ;KACR,QAAQ,CAAC,YAAY;IACtB;IACA,IAAI,sBAAsB,QAAQ,GAAG,kBAAkB,QAAQ,UAAU,OAAO;IAChF,IAAI,CAAC,cAAc,QAAQ,GAAG,MAAM,cAAc,2BAA2B,4BAA4B,aAAa,gDAAgD;KACrK,KAAK;KACL,KAAK,8BAA8B,QAAQ,sBAAsB;KACjE,MAAM;MACL,MAAM;MACN,QAAQ;KACT;IACD,CAAC;IACD,MAAM,WAAW;IACjB,OAAO,GAAG,WAAW,KAAK,IAAI,WAAW,+BAA+B,UAAU,OAAO,sBAAsB,OAAO,eAAe,CAAC;GACvI;EACD;EACA,QAAQ,UAAU,8BAA8B,YAAY;CAC7D;AACD"}
1
+ {"version":3,"file":"config-types-CGDhWE3o.mjs","names":[],"sources":["../../../../2-sql-family/2-authoring/contract-ts/dist/config-types.mjs"],"sourcesContent":["import { l as contractError, n as buildSqlContractFromDefinition, t as applySqlSpecifierControlPolicy } from \"./derived-checks-BoHNzt-a.mjs\";\nimport { createDataTypeLookup, emptyCodecLookup } from \"@internal/framework-components/codec\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { pathToFileURL } from \"node:url\";\nimport { ok } from \"@internal/utils/result\";\nimport { extname } from \"pathe\";\n//#region src/config-types.ts\n/**\n* Derives the emit output path from the TS contract input so artefacts land\n* colocated with the source (e.g. `prisma/contract.ts` →\n* `prisma/contract.json`). Mirrors the same default-derivation logic in\n* `@internal/sql-contract-psl/provider`.\n*/\nfunction defaultOutputFromContractPath(contractPath) {\n\tconst ext = extname(contractPath);\n\tif (ext.length === 0) return `${contractPath}.json`;\n\treturn `${contractPath.slice(0, -ext.length)}.json`;\n}\nfunction describeContract({ format, inputs }) {\n\tconst kind = format === \"typescript\" ? \"The TypeScript contract\" : \"The contract\";\n\tconst path = inputs?.[0];\n\treturn path === void 0 ? `${kind} in the config` : `${kind} \"${path}\"`;\n}\nfunction otherTargetGuidance({ format, inputs }, actual, expected) {\n\tif (format === \"psl\") return {\n\t\twhy: `The contract config read the schema for target \"${actual}\".`,\n\t\tfix: `Pass the schema's path as \\`contract\\`, so the config reads it for target \"${expected.target.targetId}\".`\n\t};\n\tif (inputs?.[0] === void 0) return {\n\t\twhy: `The contract was built for target \"${actual}\".`,\n\t\tfix: `Pass a contract built with defineContract imported from ${expected.contractBuilderModule}.`\n\t};\n\treturn {\n\t\twhy: `The contract file imports defineContract from the package for target \"${actual}\".`,\n\t\tfix: `Import defineContract from ${expected.contractBuilderModule}.`\n\t};\n}\nfunction refuseOtherTarget(origin, loaded, expected) {\n\tconst actual = loaded[\"target\"];\n\tconst configured = expected.target.targetId;\n\tif (typeof actual !== \"string\" || actual === configured) return;\n\tthrow contractError(\"CONTRACT.TARGET_MISMATCH\", `${describeContract(origin)} was built for target \"${actual}\", but the config is for target \"${configured}\".`, {\n\t\t...otherTargetGuidance(origin, actual, expected),\n\t\tmeta: {\n\t\t\t...ifDefined(\"contract\", origin.inputs?.[0]),\n\t\t\texpected: configured,\n\t\t\tactual\n\t\t}\n\t});\n}\n/** A ready contract config whose loaded contract is refused when it was built for another target than the config's. Any other result passes through unchanged. */\nfunction refuseOtherTargetOnLoad(config, expected) {\n\tconst { source } = config;\n\treturn {\n\t\t...config,\n\t\tsource: {\n\t\t\t...source,\n\t\t\tload: async (context) => {\n\t\t\t\tconst result = await source.load(context);\n\t\t\t\tconst loaded = isRecord(result) && result.ok === true ? result.value : void 0;\n\t\t\t\tif (isRecord(loaded)) refuseOtherTarget(source, loaded, expected);\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t};\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nconst isNonEmptyString = (value) => typeof value === \"string\" && value.length > 0;\nfunction isContractOfAnyFamily(value) {\n\tif (!isRecord(value)) return false;\n\tconst storage = value[\"storage\"];\n\treturn isNonEmptyString(value[\"targetFamily\"]) && isNonEmptyString(value[\"target\"]) && isRecord(storage) && isRecord(storage[\"namespaces\"]);\n}\nfunction isSqlContract(value) {\n\treturn isContractOfAnyFamily(value) && value[\"targetFamily\"] === \"sql\";\n}\nfunction emptyContract(options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"typescript\",\n\t\t\tload: async () => {\n\t\t\t\treturn ok(applySqlSpecifierControlPolicy(buildSqlContractFromDefinition({\n\t\t\t\t\twarnings: void 0,\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\tcreateNamespace: options.createNamespace,\n\t\t\t\t\tmodels: []\n\t\t\t\t}, {\n\t\t\t\t\t...emptyCodecLookup,\n\t\t\t\t\tdescriptorFor: () => void 0\n\t\t\t\t}, createDataTypeLookup([])), options.defaultControlPolicy, options.createNamespace));\n\t\t\t}\n\t\t},\n\t\t...ifDefined(\"output\", options.output)\n\t};\n}\nfunction typescriptContract(contract, output, options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"typescript\",\n\t\t\tload: async () => ok(options === void 0 ? contract : applySqlSpecifierControlPolicy(contract, options.defaultControlPolicy, options.createNamespace))\n\t\t},\n\t\t...ifDefined(\"output\", output)\n\t};\n}\n/** A contract loaded from the TypeScript module at `contractPath`, refused when it was built for another target than the config's. */\nfunction typescriptContractFromPath(contractPath, output, options) {\n\tconst policy = options.defaultControlPolicy === void 0 ? void 0 : options;\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"typescript\",\n\t\t\tinputs: [contractPath],\n\t\t\tload: async (context) => {\n\t\t\t\tconst [absolutePath] = context.resolvedInputs;\n\t\t\t\tif (absolutePath === void 0) throw new InternalError(\"typescriptContractFromPath: context.resolvedInputs is empty. The CLI config loader should populate it from source.inputs.\");\n\t\t\t\tconst mod = await import(pathToFileURL(absolutePath).href);\n\t\t\t\tif (mod.default === void 0 && mod.contract === void 0) throw contractError(\"CONTRACT.MODULE_EXPORT_MISSING\", `The contract file \"${contractPath}\" has no default export or named export \\`contract\\`.`, {\n\t\t\t\t\tfix: \"Export the contract that defineContract returns as the default export or as `export const contract`.\",\n\t\t\t\t\tmeta: { path: absolutePath }\n\t\t\t\t});\n\t\t\t\tconst exported = mod.default ?? mod.contract;\n\t\t\t\tconst origin = {\n\t\t\t\t\tformat: \"typescript\",\n\t\t\t\t\tinputs: [contractPath]\n\t\t\t\t};\n\t\t\t\tif (isContractOfAnyFamily(exported)) refuseOtherTarget(origin, exported, options);\n\t\t\t\tif (!isSqlContract(exported)) throw contractError(\"CONTRACT.EXPORT_INVALID\", `The TypeScript contract \"${contractPath}\" exports a value that is not a SQL contract.`, {\n\t\t\t\t\twhy: \"A contract file must export the contract that defineContract returns, and this export is something else.\",\n\t\t\t\t\tfix: `Import defineContract from ${options.contractBuilderModule} and export the contract it returns as the default export or as \\`export const contract\\`.`,\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tpath: absolutePath,\n\t\t\t\t\t\treason: \"not-a-contract\"\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tconst contract = exported;\n\t\t\t\treturn ok(policy === void 0 ? contract : applySqlSpecifierControlPolicy(contract, policy.defaultControlPolicy, policy.createNamespace));\n\t\t\t}\n\t\t},\n\t\toutput: output ?? defaultOutputFromContractPath(contractPath)\n\t};\n}\n//#endregion\nexport { emptyContract, refuseOtherTargetOnLoad, typescriptContract, typescriptContractFromPath };\n\n//# sourceMappingURL=config-types.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,SAAS,8BAA8B,cAAc;CACpD,MAAM,MAAM,QAAQ,YAAY;CAChC,IAAI,IAAI,WAAW,GAAG,OAAO,GAAG,aAAa;CAC7C,OAAO,GAAG,aAAa,MAAM,GAAG,CAAC,IAAI,MAAM,EAAE;AAC9C;AACA,SAAS,iBAAiB,EAAE,QAAQ,UAAU;CAC7C,MAAM,OAAO,WAAW,eAAe,4BAA4B;CACnE,MAAM,OAAO,SAAS;CACtB,OAAO,S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ACrD,IAAI,IAAI,YAAY,KAAK,KAAK,IAAI,aAAa,KAAK,GAAG,MAAM,cAAc,kCAAkC,sBAAsB,aAAa,wDAAwD;KACvM,KAAK;KACL,MAAM,EAAE,MAAM,aAAa;IAC5B,CAAC;IACD,MAAM,WAAW,IAAI,WAAW,IAAI;IACpC,MAAM,SAAS;KACd,QAAQ;KACR,QAAQ,CAAC,YAAY;IACtB;IACA,IAAI,sBAAsB,QAAQ,GAAG,kBAAkB,QAAQ,UAAU,OAAO;IAChF,IAAI,CAAC,cAAc,QAAQ,GAAG,MAAM,cAAc,2BAA2B,4BAA4B,aAAa,gDAAgD;KACrK,KAAK;KACL,KAAK,8BAA8B,QAAQ,sBAAsB;KACjE,MAAM;MACL,MAAM;MACN,QAAQ;KACT;IACD,CAAC;IACD,MAAM,WAAW;IACjB,OAAO,GAAG,WAAW,KAAK,IAAI,WAAW,+BAA+B,UAAU,OAAO,sBAAsB,OAAO,eAAe,CAAC;GACvI;EACD;EACA,QAAQ,UAAU,8BAA8B,YAAY;CAC7D;AACD"}
@@ -3,8 +3,8 @@ import { t as providesEntityHandleLowering } from "./entity-handle-lowering-hook
3
3
  import { n as generatedIdColumnAliases, t as GENERATED_ID_COLUMN_ALIAS_NAMESPACES } from "./generated-id-column-aliases-DPUii1fN.mjs";
4
4
  import { a as isSqlExpression, c as requireSqlExpression, r as SqlExpression, s as readSqlExpression } from "./sql-expression-CKgKznXS.mjs";
5
5
  import { t as CODEC_INSTANCE_KIND } from "./types-CISwoRED.mjs";
6
- import { n as checkSqlDefaultText, o as reservedSqlDefaultText } from "./validators-DbCIebZb.mjs";
7
- import { i as contractError, l as toOneNullabilityContradictionMessage, n as buildSqlContractFromDefinition, s as refuseTypesKey } from "./derived-checks-BoHNzt-a-CK4ceMbs.mjs";
6
+ import { n as checkSqlDefaultText, o as reservedSqlDefaultText } from "./validators-CcR6gGf_.mjs";
7
+ import { i as contractError, l as toOneNullabilityContradictionMessage, n as buildSqlContractFromDefinition, s as refuseTypesKey } from "./derived-checks-BoHNzt-a-4Vi-QMdx.mjs";
8
8
  import { isStructuredError } from "@prisma/orm-framework/utils/structured-error";
9
9
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
10
10
  import { assembleDataTypeSupport, assertNoCrossRegistryCollisions, assertTypeAliasesValid, assertTypeChoicesValid, describeAdmittedForms, instantiateAuthoringTypeAlias, instantiateAuthoringTypeCall, instantiateAuthoringTypeConstructor, isAuthoringEntityTypeDescriptor, isAuthoringTypeAliasDescriptor, isAuthoringTypeChoiceDescriptor, isAuthoringTypeConstructorDescriptor, isAuthoringTypeDescriptor, readWrittenValueAs, resolveAuthoringTypeChoice, typeChoiceArgumentsFromObject, typeConstructorLookup, validateAuthoringHelperArguments, validateAuthoringTypeChoiceParams, validateAuthoringTypeParams } from "@prisma/orm-framework/components/authoring";
@@ -1947,4 +1947,4 @@ const unbound = Symbol.for("prisma.namespace.unbound");
1947
1947
  //#endregion
1948
1948
  export { check as a, defineContract as c, field as d, member as f, unbound as g, rel as h, buildContractDefinition as i, enumType as l, now as m, bindEnumType as n, composedExtensionPackRefs as o, model as p, buildBoundContract as r, createComposedAuthoringHelpers as s, autoincrement as t, extensionModel as u };
1949
1949
 
1950
- //# sourceMappingURL=contract-builder-q2-4IVcW.mjs.map
1950
+ //# sourceMappingURL=contract-builder-BqswyknO.mjs.map