@prisma/orm-family-sql 8.0.0-rc.18-dev.1 → 8.0.0-rc.18-dev.2

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 (44) hide show
  1. package/dist/{attribute-specs-Dp4My87B.d.mts → attribute-specs-BgdwJoq3.d.mts} +2 -2
  2. package/dist/{attribute-specs-Dp4My87B.d.mts.map → attribute-specs-BgdwJoq3.d.mts.map} +1 -1
  3. package/dist/{authoring-type-constructors-0Iv2zdwS-ZTBL7w8X.mjs → authoring-type-constructors-0Iv2zdwS-zu35z-Tg.mjs} +2 -2
  4. package/dist/{authoring-type-constructors-0Iv2zdwS-ZTBL7w8X.mjs.map → authoring-type-constructors-0Iv2zdwS-zu35z-Tg.mjs.map} +1 -1
  5. package/dist/{config-types-DiCetrJe.mjs → config-types-DyZXyiNb.mjs} +2 -2
  6. package/dist/{config-types-DiCetrJe.mjs.map → config-types-DyZXyiNb.mjs.map} +1 -1
  7. package/dist/{contract-builder-D84f__Oc.mjs → contract-builder-B_oFvMWk.mjs} +2 -2
  8. package/dist/{contract-builder-D84f__Oc.mjs.map → contract-builder-B_oFvMWk.mjs.map} +1 -1
  9. package/dist/contract-prisma7__provider.mjs +4 -4
  10. package/dist/contract-prisma7__provider.mjs.map +1 -1
  11. package/dist/contract-psl.d.mts +2 -2
  12. package/dist/contract-psl.d.mts.map +1 -1
  13. package/dist/contract-psl.mjs +1 -1
  14. package/dist/contract-psl__attribute-specs.d.mts +1 -1
  15. package/dist/contract-psl__attribute-specs.mjs +1 -1
  16. package/dist/contract-psl__provider.mjs +2 -2
  17. package/dist/contract-psl__provider.mjs.map +1 -1
  18. package/dist/contract-ts.mjs +3 -3
  19. package/dist/contract-ts__config-types.mjs +1 -1
  20. package/dist/contract-ts__contract-builder.mjs +2 -2
  21. package/dist/{control-Bvnz4Uk4.mjs → control-CFhsCA5g.mjs} +3 -3
  22. package/dist/{control-Bvnz4Uk4.mjs.map → control-CFhsCA5g.mjs.map} +1 -1
  23. package/dist/{control-CkV_zSCA.d.mts → control-CyY2Ijms.d.mts} +2 -2
  24. package/dist/{control-CkV_zSCA.d.mts.map → control-CyY2Ijms.d.mts.map} +1 -1
  25. package/dist/{derived-checks-CYz041Ol-TjL7rPxe.mjs → derived-checks-BPWwhTds-Cy93UfrT.mjs} +4 -3
  26. package/dist/{derived-checks-CYz041Ol-TjL7rPxe.mjs.map → derived-checks-BPWwhTds-Cy93UfrT.mjs.map} +1 -1
  27. package/dist/family.d.mts +2 -2
  28. package/dist/family.mjs +1 -1
  29. package/dist/family__control.d.mts +1 -1
  30. package/dist/family__control.mjs +1 -1
  31. package/dist/family__pack.d.mts +1 -1
  32. package/dist/family__pack.mjs +2 -2
  33. package/dist/{interpreter-BbopSq2f-y_JBQJFT.mjs → interpreter-C3Ltz47m-BM7A_CmQ.mjs} +8 -8
  34. package/dist/interpreter-C3Ltz47m-BM7A_CmQ.mjs.map +1 -0
  35. package/dist/{pack-mniK_gmN.d.mts → pack-DOLmsrEs.d.mts} +2 -2
  36. package/dist/{pack-mniK_gmN.d.mts.map → pack-DOLmsrEs.d.mts.map} +1 -1
  37. package/dist/{psl-column-resolution-Dm5LhN9b-BwyDcxSb.d.mts → psl-column-resolution-Cj4gkj9H-Cu2xVY6w.d.mts} +3 -3
  38. package/dist/psl-column-resolution-Cj4gkj9H-Cu2xVY6w.d.mts.map +1 -0
  39. package/dist/{psl-field-resolution-D4jnVVTd-B396sZmO.mjs → psl-field-resolution-ztVU6TV2-BSBajXoF.mjs} +24 -19
  40. package/dist/psl-field-resolution-ztVU6TV2-BSBajXoF.mjs.map +1 -0
  41. package/package.json +18 -18
  42. package/dist/interpreter-BbopSq2f-y_JBQJFT.mjs.map +0 -1
  43. package/dist/psl-column-resolution-Dm5LhN9b-BwyDcxSb.d.mts.map +0 -1
  44. package/dist/psl-field-resolution-D4jnVVTd-B396sZmO.mjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { a as SqlNamespaceBase, c as SqlNamespaceInput } from "./sql-storage-BTlJLUID-CGy3wuH4.mjs";
2
2
  import "./types-Uv3oTMAb.mjs";
3
- import { t as ColumnDescriptor } from "./psl-column-resolution-Dm5LhN9b-BwyDcxSb.mjs";
3
+ import { t as ColumnDescriptor } from "./psl-column-resolution-Cj4gkj9H-Cu2xVY6w.mjs";
4
4
  import { AuthoringContributions, DataTypeSupport } from "@prisma/orm-framework/components/authoring";
5
5
  import { CodecLookupWithDescriptors } from "@prisma/orm-framework/components/codec";
6
6
  import { Contract } from "@prisma/orm-framework/contract/types";
@@ -10,7 +10,7 @@ import { Result } from "@prisma/orm-framework/utils/result";
10
10
  import { Binder, SymbolTable } from "@prisma/orm-framework/psl-parser";
11
11
  import { ControlMutationDefaults, ControlMutationDefaults as ControlMutationDefaults$1, DefaultFunctionLoweringContext, MutationDefaultGeneratorDescriptor } from "@prisma/orm-framework/components/control";
12
12
  import { ContractSourceDiagnostic, ContractSourceDiagnostics } from "@prisma/orm-framework/config/config-types";
13
- //#region ../../../2-sql/2-authoring/contract-psl/dist/interpreter-DY9C1wx8.d.mts
13
+ //#region ../../../2-sql/2-authoring/contract-psl/dist/interpreter-NgmcfICL.d.mts
14
14
  //#region src/interpreter.d.ts
15
15
  interface InterpretPslDocumentToSqlContractInput {
16
16
  readonly documents: readonly DocumentAst[];
@@ -1 +1 @@
1
- {"version":3,"file":"contract-psl.d.mts","names":[],"sources":["../../../../2-sql/2-authoring/contract-psl/dist/interpreter-DY9C1wx8.d.mts"],"mappings":";;;;;;;;;;;;;;UAYU;WACC,oBAAoB;WACpB,aAAa;WACb,SAAS;WACT,QAAQ;WACR,QAAQ;WACR,yBAAyB,oBAAoB;WAC7C;WACA,qCAAqC;WACrC,0BAA0B;;WAE1B,WAAW;WACX,yBAAyB;;;;;;;;;;WAUzB,4BAA4B,oBAAoB;;WAEhD,kBAAkB,OAAO,sBAAsB;WAC/C,aAAa;WACb,2BAA2B;;WAE3B;aACE;aACA;;WAEF,cAAc;;iBASR,kCAAkC,OAAO,yCAAyC,OAAO,UAAU"}
1
+ {"version":3,"file":"contract-psl.d.mts","names":[],"sources":["../../../../2-sql/2-authoring/contract-psl/dist/interpreter-NgmcfICL.d.mts"],"mappings":";;;;;;;;;;;;;;UAYU;WACC,oBAAoB;WACpB,aAAa;WACb,SAAS;WACT,QAAQ;WACR,QAAQ;WACR,yBAAyB,oBAAoB;WAC7C;WACA,qCAAqC;WACrC,0BAA0B;;WAE1B,WAAW;WACX,yBAAyB;;;;;;;;;;WAUzB,4BAA4B,oBAAoB;;WAEhD,kBAAkB,OAAO,sBAAsB;WAC/C,aAAa;WACb,2BAA2B;;WAE3B;aACE;aACA;;WAEF,cAAc;;iBASR,kCAAkC,OAAO,yCAAyC,OAAO,UAAU"}
@@ -1,2 +1,2 @@
1
- import { i as interpretPslDocumentToSqlContract } from "./interpreter-BbopSq2f-y_JBQJFT.mjs";
1
+ import { i as interpretPslDocumentToSqlContract } from "./interpreter-C3Ltz47m-BM7A_CmQ.mjs";
2
2
  export { interpretPslDocumentToSqlContract };
@@ -1,2 +1,2 @@
1
- import { a as ParsedNullLiteral, i as EnumMemberListDefault, n as DefaultFunctionCall, o as sqlAttributeSpecs, r as EnumMemberDefault, t as describeUnsupportedSqlAttribute } from "./attribute-specs-Dp4My87B.mjs";
1
+ import { a as ParsedNullLiteral, i as EnumMemberListDefault, n as DefaultFunctionCall, o as sqlAttributeSpecs, r as EnumMemberDefault, t as describeUnsupportedSqlAttribute } from "./attribute-specs-BgdwJoq3.mjs";
2
2
  export { type DefaultFunctionCall, type EnumMemberDefault, type EnumMemberListDefault, type ParsedNullLiteral, describeUnsupportedSqlAttribute, sqlAttributeSpecs };
@@ -1,2 +1,2 @@
1
- import { S as sqlAttributeSpecs, a as describeUnsupportedSqlAttribute } from "./psl-field-resolution-D4jnVVTd-B396sZmO.mjs";
1
+ import { S as sqlAttributeSpecs, a as describeUnsupportedSqlAttribute } from "./psl-field-resolution-ztVU6TV2-BSBajXoF.mjs";
2
2
  export { describeUnsupportedSqlAttribute, sqlAttributeSpecs };
@@ -1,5 +1,5 @@
1
- import { t as applySqlSpecifierControlPolicy } from "./derived-checks-CYz041Ol-TjL7rPxe.mjs";
2
- import { i as interpretPslDocumentToSqlContract } from "./interpreter-BbopSq2f-y_JBQJFT.mjs";
1
+ import { t as applySqlSpecifierControlPolicy } from "./derived-checks-BPWwhTds-Cy93UfrT.mjs";
2
+ import { i as interpretPslDocumentToSqlContract } from "./interpreter-C3Ltz47m-BM7A_CmQ.mjs";
3
3
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
4
4
  import { collectScalarTypeConstructors } from "@prisma/orm-framework/components/authoring";
5
5
  import { readFile } from "node:fs/promises";
@@ -1 +1 @@
1
- {"version":3,"file":"contract-psl__provider.mjs","names":[],"sources":["../../../../2-sql/2-authoring/contract-psl/dist/provider.mjs"],"sourcesContent":["import { n as interpretPslDocumentToSqlContract } from \"./interpreter-BbopSq2f.mjs\";\nimport { buildSymbolTable, createBinder, isPrismaNextSchema, mapPslDiagnostics } from \"@internal/psl-parser\";\nimport { applySqlSpecifierControlPolicy } from \"@internal/sql-contract-ts/contract-builder\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { collectScalarTypeConstructors } from \"@internal/framework-components/authoring\";\nimport { withSeedDiagnostics } from \"@internal/psl-parser/interpret\";\nimport { parse } from \"@internal/psl-parser/syntax\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { readFile } from \"node:fs/promises\";\nimport { basename, extname } from \"pathe\";\nimport { isDynamicPattern } from \"tinyglobby\";\n//#region src/provider.ts\n/**\n* The directory portion of `pattern` before its first glob-magic segment,\n* joined back with `/` (e.g. a `prisma` directory holding a recursive\n* `.prisma` glob derives `./prisma`). A rootless pattern with no static\n* segments yields `''`.\n*/\nfunction staticPrefixDirectory(pattern) {\n\tconst staticSegments = [];\n\tfor (const segment of pattern.replaceAll(\"\\\\\", \"/\").split(\"/\")) {\n\t\tif (isDynamicPattern(segment)) break;\n\t\tstaticSegments.push(segment);\n\t}\n\treturn staticSegments.join(\"/\");\n}\n/**\n* Derives the emit output path from the schema input path so artefacts land\n* colocated with the source (e.g. `src/contract/schema.prisma` →\n* `src/contract/contract.json`). A glob-shaped path derives from its static\n* prefix directory instead (a recursive glob under `prisma` derives\n* `./prisma/contract.json`). The provider owns this because it is the only\n* layer that knows the input path; the upstream `normalizeContractConfig`\n* default is a last-resort fallback for providers that don't carry one.\n*/\nfunction defaultOutputFromSchemaPath(schemaPath) {\n\tif (isDynamicPattern(schemaPath)) {\n\t\tconst prefix = staticPrefixDirectory(schemaPath);\n\t\treturn prefix.length === 0 ? \"contract.json\" : `${prefix}/contract.json`;\n\t}\n\tconst ext = extname(schemaPath);\n\tif (ext.length === 0) return `${schemaPath}.json`;\n\tconst base = schemaPath.slice(0, -ext.length);\n\tif (basename(base) === \"schema\") return `${base.slice(0, -6)}contract.json`;\n\treturn `${base}.json`;\n}\nfunction prismaContract(schemaPath, options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"psl\",\n\t\t\tinputs: [schemaPath],\n\t\t\tinterpret(input, context) {\n\t\t\t\tconst scalarColumnDescriptors = collectScalarTypeConstructors(context.authoringContributions.type);\n\t\t\t\treturn interpretPslDocumentToSqlContract({\n\t\t\t\t\tdocuments: input.documents,\n\t\t\t\t\tsymbolTable: input.symbolTable,\n\t\t\t\t\tsources: input.sources,\n\t\t\t\t\tbinder: input.binder,\n\t\t\t\t\tseedDiagnostics: [],\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\tauthoringContributions: context.authoringContributions,\n\t\t\t\t\tscalarColumnDescriptors,\n\t\t\t\t\t...ifDefined(\"composedExtensions\", context.composedExtensions.length > 0 ? [...context.composedExtensions] : void 0),\n\t\t\t\t\tcomposedExtensionContracts: context.composedExtensionContracts,\n\t\t\t\t\t...ifDefined(\"composedExtensionPackRefs\", options.composedExtensionPackRefs?.length ? options.composedExtensionPackRefs : void 0),\n\t\t\t\t\tcontrolMutationDefaults: context.controlMutationDefaults,\n\t\t\t\t\tcreateNamespace: options.createNamespace,\n\t\t\t\t\tcapabilities: context.capabilities,\n\t\t\t\t\tcodecLookup: context.codecLookup,\n\t\t\t\t\tdataTypes: context.dataTypes,\n\t\t\t\t\t...ifDefined(\"enumInferenceCodecs\", options.enumInferenceCodecs)\n\t\t\t\t});\n\t\t\t},\n\t\t\tasync load(context) {\n\t\t\t\tconst candidates = [...new Set(context.resolvedInputs)].sort();\n\t\t\t\tif (candidates.length === 0) return notOk({\n\t\t\t\t\tsummary: \"No schema files matched the configured contract source\",\n\t\t\t\t\tdiagnostics: [{\n\t\t\t\t\t\tcode: \"PSL_NO_SCHEMA_FILES_MATCHED\",\n\t\t\t\t\t\tmessage: `No files matched the configured pattern \"${schemaPath}\"`,\n\t\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t\tconst readDiagnostics = [];\n\t\t\t\tconst members = [];\n\t\t\t\tconst undirected = [];\n\t\t\t\tfor (const path of candidates) {\n\t\t\t\t\tlet text;\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttext = await readFile(path, \"utf-8\");\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconst message = String(error);\n\t\t\t\t\t\treadDiagnostics.push({\n\t\t\t\t\t\t\tcode: \"PSL_SCHEMA_READ_FAILED\",\n\t\t\t\t\t\t\tmessage,\n\t\t\t\t\t\t\tsourceId: path\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (isPrismaNextSchema(text)) members.push({\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\ttext\n\t\t\t\t\t});\n\t\t\t\t\telse undirected.push(path);\n\t\t\t\t}\n\t\t\t\tif (members.length === 0) {\n\t\t\t\t\tif (undirected.length === 0) return notOk({\n\t\t\t\t\t\tsummary: \"Failed to read Prisma schema files\",\n\t\t\t\t\t\tdiagnostics: readDiagnostics\n\t\t\t\t\t});\n\t\t\t\t\treturn notOk({\n\t\t\t\t\t\tsummary: \"No schema file carries the \\\"// use prisma-8\\\" directive\",\n\t\t\t\t\t\tdiagnostics: [...readDiagnostics, {\n\t\t\t\t\t\t\tcode: \"PSL_NO_OPTED_IN_SCHEMA_FILES\",\n\t\t\t\t\t\t\tmessage: `None of the matched files carry the \"// use prisma-8\" directive: ${undirected.join(\", \")}`,\n\t\t\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tconst parsed = members.map(({ path, text }) => parse(text, path));\n\t\t\t\tconst documents = parsed.map(({ document }) => document);\n\t\t\t\tconst [firstSources, ...restSources] = parsed.map(({ sources }) => sources);\n\t\t\t\tassertDefined(firstSources, \"prismaContract requires at least one parsed schema file\");\n\t\t\t\tconst sources = firstSources.merge(...restSources);\n\t\t\t\tconst seedDiagnostics = [...readDiagnostics, ...mapPslDiagnostics(parsed.flatMap(({ diagnostics }) => diagnostics), sources)];\n\t\t\t\tconst { symbolTable, diagnostics: symbolTableDiagnostics } = buildSymbolTable({\n\t\t\t\t\tdocuments,\n\t\t\t\t\tsources,\n\t\t\t\t\tdefaultNamespaceId: context.defaultNamespaceId\n\t\t\t\t});\n\t\t\t\tconst { binder, diagnostics: binderDiagnostics } = createBinder({\n\t\t\t\t\tsymbolTable,\n\t\t\t\t\tsources,\n\t\t\t\t\tcontext\n\t\t\t\t});\n\t\t\t\tconst interpreted = withSeedDiagnostics(this.interpret({\n\t\t\t\t\tdocuments,\n\t\t\t\t\tsources,\n\t\t\t\t\tsymbolTable,\n\t\t\t\t\tbinder\n\t\t\t\t}, context), [...seedDiagnostics, ...mapPslDiagnostics([...symbolTableDiagnostics, ...binderDiagnostics], sources)]);\n\t\t\t\tif (!interpreted.ok) return interpreted;\n\t\t\t\treturn ok(applySqlSpecifierControlPolicy(interpreted.value, options.defaultControlPolicy, options.createNamespace));\n\t\t\t}\n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vD,MAAM,CAAC,cAAc,GAAG,eAAe,OAAO,KAAK,EAAE,cAAc,OAAO;IAC1E,cAAc,cAAc,yDAAyD;IACrF,MAAM,UAAU,aAAa,MAAM,GAAG,WAAW;IACjD,MAAM,kBAAkB,CAAC,GAAG,iBAAiB,GAAG,kBAAkB,OAAO,SAAS,EAAE,kBAAkB,WAAW,GAAG,OAAO,CAAC;IAC5H,MAAM,EAAE,aAAa,aAAa,2BAA2B,iBAAiB;KAC7E;KACA;KACA,oBAAoB,QAAQ;IAC7B,CAAC;IACD,MAAM,EAAE,QAAQ,aAAa,sBAAsB,aAAa;KAC/D;KACA;KACA;IACD,CAAC;IACD,MAAM,cAAc,oBAAoB,KAAK,UAAU;KACtD;KACA;KACA;KACA;IACD,GAAG,OAAO,GAAG,CAAC,GAAG,iBAAiB,GAAG,kBAAkB,CAAC,GAAG,wBAAwB,GAAG,iBAAiB,GAAG,OAAO,CAAC,CAAC;IACnH,IAAI,CAAC,YAAY,IAAI,OAAO;IAC5B,OAAO,GAAG,+BAA+B,YAAY,OAAO,QAAQ,sBAAsB,QAAQ,eAAe,CAAC;GACnH;EACD;EACA,QAAQ,QAAQ,UAAU,4BAA4B,UAAU;CACjE;AACD"}
1
+ {"version":3,"file":"contract-psl__provider.mjs","names":[],"sources":["../../../../2-sql/2-authoring/contract-psl/dist/provider.mjs"],"sourcesContent":["import { n as interpretPslDocumentToSqlContract } from \"./interpreter-C3Ltz47m.mjs\";\nimport { buildSymbolTable, createBinder, isPrismaNextSchema, mapPslDiagnostics } from \"@internal/psl-parser\";\nimport { applySqlSpecifierControlPolicy } from \"@internal/sql-contract-ts/contract-builder\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { collectScalarTypeConstructors } from \"@internal/framework-components/authoring\";\nimport { withSeedDiagnostics } from \"@internal/psl-parser/interpret\";\nimport { parse } from \"@internal/psl-parser/syntax\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { readFile } from \"node:fs/promises\";\nimport { basename, extname } from \"pathe\";\nimport { isDynamicPattern } from \"tinyglobby\";\n//#region src/provider.ts\n/**\n* The directory portion of `pattern` before its first glob-magic segment,\n* joined back with `/` (e.g. a `prisma` directory holding a recursive\n* `.prisma` glob derives `./prisma`). A rootless pattern with no static\n* segments yields `''`.\n*/\nfunction staticPrefixDirectory(pattern) {\n\tconst staticSegments = [];\n\tfor (const segment of pattern.replaceAll(\"\\\\\", \"/\").split(\"/\")) {\n\t\tif (isDynamicPattern(segment)) break;\n\t\tstaticSegments.push(segment);\n\t}\n\treturn staticSegments.join(\"/\");\n}\n/**\n* Derives the emit output path from the schema input path so artefacts land\n* colocated with the source (e.g. `src/contract/schema.prisma` →\n* `src/contract/contract.json`). A glob-shaped path derives from its static\n* prefix directory instead (a recursive glob under `prisma` derives\n* `./prisma/contract.json`). The provider owns this because it is the only\n* layer that knows the input path; the upstream `normalizeContractConfig`\n* default is a last-resort fallback for providers that don't carry one.\n*/\nfunction defaultOutputFromSchemaPath(schemaPath) {\n\tif (isDynamicPattern(schemaPath)) {\n\t\tconst prefix = staticPrefixDirectory(schemaPath);\n\t\treturn prefix.length === 0 ? \"contract.json\" : `${prefix}/contract.json`;\n\t}\n\tconst ext = extname(schemaPath);\n\tif (ext.length === 0) return `${schemaPath}.json`;\n\tconst base = schemaPath.slice(0, -ext.length);\n\tif (basename(base) === \"schema\") return `${base.slice(0, -6)}contract.json`;\n\treturn `${base}.json`;\n}\nfunction prismaContract(schemaPath, options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"psl\",\n\t\t\tinputs: [schemaPath],\n\t\t\tinterpret(input, context) {\n\t\t\t\tconst scalarColumnDescriptors = collectScalarTypeConstructors(context.authoringContributions.type);\n\t\t\t\treturn interpretPslDocumentToSqlContract({\n\t\t\t\t\tdocuments: input.documents,\n\t\t\t\t\tsymbolTable: input.symbolTable,\n\t\t\t\t\tsources: input.sources,\n\t\t\t\t\tbinder: input.binder,\n\t\t\t\t\tseedDiagnostics: [],\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\tauthoringContributions: context.authoringContributions,\n\t\t\t\t\tscalarColumnDescriptors,\n\t\t\t\t\t...ifDefined(\"composedExtensions\", context.composedExtensions.length > 0 ? [...context.composedExtensions] : void 0),\n\t\t\t\t\tcomposedExtensionContracts: context.composedExtensionContracts,\n\t\t\t\t\t...ifDefined(\"composedExtensionPackRefs\", options.composedExtensionPackRefs?.length ? options.composedExtensionPackRefs : void 0),\n\t\t\t\t\tcontrolMutationDefaults: context.controlMutationDefaults,\n\t\t\t\t\tcreateNamespace: options.createNamespace,\n\t\t\t\t\tcapabilities: context.capabilities,\n\t\t\t\t\tcodecLookup: context.codecLookup,\n\t\t\t\t\tdataTypes: context.dataTypes,\n\t\t\t\t\t...ifDefined(\"enumInferenceCodecs\", options.enumInferenceCodecs)\n\t\t\t\t});\n\t\t\t},\n\t\t\tasync load(context) {\n\t\t\t\tconst candidates = [...new Set(context.resolvedInputs)].sort();\n\t\t\t\tif (candidates.length === 0) return notOk({\n\t\t\t\t\tsummary: \"No schema files matched the configured contract source\",\n\t\t\t\t\tdiagnostics: [{\n\t\t\t\t\t\tcode: \"PSL_NO_SCHEMA_FILES_MATCHED\",\n\t\t\t\t\t\tmessage: `No files matched the configured pattern \"${schemaPath}\"`,\n\t\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t\tconst readDiagnostics = [];\n\t\t\t\tconst members = [];\n\t\t\t\tconst undirected = [];\n\t\t\t\tfor (const path of candidates) {\n\t\t\t\t\tlet text;\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttext = await readFile(path, \"utf-8\");\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconst message = String(error);\n\t\t\t\t\t\treadDiagnostics.push({\n\t\t\t\t\t\t\tcode: \"PSL_SCHEMA_READ_FAILED\",\n\t\t\t\t\t\t\tmessage,\n\t\t\t\t\t\t\tsourceId: path\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (isPrismaNextSchema(text)) members.push({\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\ttext\n\t\t\t\t\t});\n\t\t\t\t\telse undirected.push(path);\n\t\t\t\t}\n\t\t\t\tif (members.length === 0) {\n\t\t\t\t\tif (undirected.length === 0) return notOk({\n\t\t\t\t\t\tsummary: \"Failed to read Prisma schema files\",\n\t\t\t\t\t\tdiagnostics: readDiagnostics\n\t\t\t\t\t});\n\t\t\t\t\treturn notOk({\n\t\t\t\t\t\tsummary: \"No schema file carries the \\\"// use prisma-8\\\" directive\",\n\t\t\t\t\t\tdiagnostics: [...readDiagnostics, {\n\t\t\t\t\t\t\tcode: \"PSL_NO_OPTED_IN_SCHEMA_FILES\",\n\t\t\t\t\t\t\tmessage: `None of the matched files carry the \"// use prisma-8\" directive: ${undirected.join(\", \")}`,\n\t\t\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tconst parsed = members.map(({ path, text }) => parse(text, path));\n\t\t\t\tconst documents = parsed.map(({ document }) => document);\n\t\t\t\tconst [firstSources, ...restSources] = parsed.map(({ sources }) => sources);\n\t\t\t\tassertDefined(firstSources, \"prismaContract requires at least one parsed schema file\");\n\t\t\t\tconst sources = firstSources.merge(...restSources);\n\t\t\t\tconst seedDiagnostics = [...readDiagnostics, ...mapPslDiagnostics(parsed.flatMap(({ diagnostics }) => diagnostics), sources)];\n\t\t\t\tconst { symbolTable, diagnostics: symbolTableDiagnostics } = buildSymbolTable({\n\t\t\t\t\tdocuments,\n\t\t\t\t\tsources,\n\t\t\t\t\tdefaultNamespaceId: context.defaultNamespaceId\n\t\t\t\t});\n\t\t\t\tconst { binder, diagnostics: binderDiagnostics } = createBinder({\n\t\t\t\t\tsymbolTable,\n\t\t\t\t\tsources,\n\t\t\t\t\tcontext\n\t\t\t\t});\n\t\t\t\tconst interpreted = withSeedDiagnostics(this.interpret({\n\t\t\t\t\tdocuments,\n\t\t\t\t\tsources,\n\t\t\t\t\tsymbolTable,\n\t\t\t\t\tbinder\n\t\t\t\t}, context), [...seedDiagnostics, ...mapPslDiagnostics([...symbolTableDiagnostics, ...binderDiagnostics], sources)]);\n\t\t\t\tif (!interpreted.ok) return interpreted;\n\t\t\t\treturn ok(applySqlSpecifierControlPolicy(interpreted.value, options.defaultControlPolicy, options.createNamespace));\n\t\t\t}\n\t\t},\n\t\toutput: options.output ?? defaultOutputFromSchemaPath(schemaPath)\n\t};\n}\n//#endregion\nexport { prismaContract };\n\n//# sourceMappingURL=provider.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,SAAS,sBAAsB,SAAS;CACvC,MAAM,iBAAiB,CAAC;CACxB,KAAK,MAAM,WAAW,QAAQ,WAAW,MAAM,GAAG,CAAC,CAAC,MAAM,GAAG,GAAG;EAC/D,IAAI,iBAAiB,OAAO,GAAG;EAC/B,eAAe,KAAK,OAAO;CAC5B;CACA,OAAO,eAAe,KAAK,GAAG;AAC/B;;;;;;;;;;AAUA,SAAS,4BAA4B,YAAY;CAChD,IAAI,iBAAiB,UAAU,GAAG;EACjC,MAAM,SAAS,sBAAsB,UAAU;EAC/C,OAAO,OAAO,WAAW,IAAI,kBAAkB,GAAG,OAAO;CAC1D;CACA,MAAM,MAAM,QAAQ,UAAU;CAC9B,IAAI,IAAI,WAAW,GAAG,OAAO,GAAG,WAAW;CAC3C,MAAM,OAAO,WAAW,MAAM,GAAG,CAAC,IAAI,MAAM;CAC5C,IAAI,SAAS,IAAI,MAAM,UAAU,OAAO,GAAG,KAAK,MAAM,GAAG,EAAE,EAAE;CAC7D,OAAO,GAAG,KAAK;AAChB;AACA,SAAS,eAAe,YAAY,SAAS;CAC5C,OAAO;EACN,QAAQ;GACP,QAAQ;GACR,QAAQ,CAAC,UAAU;GACnB,UAAU,OAAO,SAAS;IACzB,MAAM,0BAA0B,8BAA8B,QAAQ,uBA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S;MACT,aAAa;KACd,CAAC;KACD,OAAO,MAAM;MACZ,SAAS;MACT,aAAa,CAAC,GAAG,iBAAiB;OACjC,MAAM;OACN,SAAS,oEAAoE,WAAW,KAAK,IAAI;OACjG,UAAU;MACX,CAAC;KACF,CAAC;IACF;IACA,MAAM,SAAS,QAAQ,KAAK,EAAE,MAAM,WAAW,MAAM,MAAM,IAAI,CAAC;IAChE,MAAM,YAAY,OAAO,KAAK,EAAE,eAAe,QAAQ;IACvD,MAAM,CAAC,cAAc,GAAG,eAAe,OAAO,KAAK,EAAE,cAAc,OAAO;IAC1E,cAAc,cAAc,yDAAyD;IACrF,MAAM,UAAU,aAAa,MAAM,GAAG,WAAW;IACjD,MAAM,kBAAkB,CAAC,GAAG,iBAAiB,GAAG,kBAAkB,OAAO,SAAS,EAAE,kBAAkB,WAAW,GAAG,OAAO,CAAC;IAC5H,MAAM,EAAE,aAAa,aAAa,2BAA2B,iBAAiB;KAC7E;KACA;KACA,oBAAoB,QAAQ;IAC7B,CAAC;IACD,MAAM,EAAE,QAAQ,aAAa,sBAAsB,aAAa;KAC/D;KACA;KACA;IACD,CAAC;IACD,MAAM,cAAc,oBAAoB,KAAK,UAAU;KACtD;KACA;KACA;KACA;IACD,GAAG,OAAO,GAAG,CAAC,GAAG,iBAAiB,GAAG,kBAAkB,CAAC,GAAG,wBAAwB,GAAG,iBAAiB,GAAG,OAAO,CAAC,CAAC;IACnH,IAAI,CAAC,YAAY,IAAI,OAAO;IAC5B,OAAO,GAAG,+BAA+B,YAAY,OAAO,QAAQ,sBAAsB,QAAQ,eAAe,CAAC;GACnH;EACD;EACA,QAAQ,QAAQ,UAAU,4BAA4B,UAAU;CACjE;AACD"}
@@ -1,5 +1,5 @@
1
1
  import { u as sql } from "./sql-expression-DSRILiU2.mjs";
2
- import { a as storedAsListColumn, i as isValueObjectMember, n as buildSqlContractFromDefinition, t as applySqlSpecifierControlPolicy } from "./derived-checks-CYz041Ol-TjL7rPxe.mjs";
3
- import { a as check, c as enumType, d as member, f as model, i as buildContractDefinition, l as extensionModel, m as rel, n as bindEnumType, o as createComposedAuthoringHelpers, p as now, r as buildBoundContract, s as defineContract, t as autoincrement, u as field } from "./contract-builder-D84f__Oc.mjs";
4
- import { n as typescriptContract, r as typescriptContractFromPath, t as emptyContract } from "./config-types-DiCetrJe.mjs";
2
+ import { a as storedAsListColumn, i as isValueObjectMember, n as buildSqlContractFromDefinition, t as applySqlSpecifierControlPolicy } from "./derived-checks-BPWwhTds-Cy93UfrT.mjs";
3
+ import { a as check, c as enumType, d as member, f as model, i as buildContractDefinition, l as extensionModel, m as rel, n as bindEnumType, o as createComposedAuthoringHelpers, p as now, r as buildBoundContract, s as defineContract, t as autoincrement, u as field } from "./contract-builder-B_oFvMWk.mjs";
4
+ import { n as typescriptContract, r as typescriptContractFromPath, t as emptyContract } from "./config-types-DyZXyiNb.mjs";
5
5
  export { applySqlSpecifierControlPolicy, autoincrement, bindEnumType, buildBoundContract, buildContractDefinition, buildSqlContractFromDefinition, check, createComposedAuthoringHelpers, defineContract, emptyContract, enumType, extensionModel, field, isValueObjectMember, member, model, now, rel, sql, storedAsListColumn, typescriptContract, typescriptContractFromPath };
@@ -1,2 +1,2 @@
1
- import { n as typescriptContract, r as typescriptContractFromPath, t as emptyContract } from "./config-types-DiCetrJe.mjs";
1
+ import { n as typescriptContract, r as typescriptContractFromPath, t as emptyContract } from "./config-types-DyZXyiNb.mjs";
2
2
  export { emptyContract, typescriptContract, typescriptContractFromPath };
@@ -1,4 +1,4 @@
1
1
  import { u as sql } from "./sql-expression-DSRILiU2.mjs";
2
- import { a as storedAsListColumn, i as isValueObjectMember, n as buildSqlContractFromDefinition, t as applySqlSpecifierControlPolicy } from "./derived-checks-CYz041Ol-TjL7rPxe.mjs";
3
- import { a as check, c as enumType, d as member, f as model, i as buildContractDefinition, l as extensionModel, m as rel, n as bindEnumType, o as createComposedAuthoringHelpers, p as now, r as buildBoundContract, s as defineContract, t as autoincrement, u as field } from "./contract-builder-D84f__Oc.mjs";
2
+ import { a as storedAsListColumn, i as isValueObjectMember, n as buildSqlContractFromDefinition, t as applySqlSpecifierControlPolicy } from "./derived-checks-BPWwhTds-Cy93UfrT.mjs";
3
+ import { a as check, c as enumType, d as member, f as model, i as buildContractDefinition, l as extensionModel, m as rel, n as bindEnumType, o as createComposedAuthoringHelpers, p as now, r as buildBoundContract, s as defineContract, t as autoincrement, u as field } from "./contract-builder-B_oFvMWk.mjs";
4
4
  export { applySqlSpecifierControlPolicy, autoincrement, bindEnumType, buildBoundContract, buildContractDefinition, buildSqlContractFromDefinition, check, createComposedAuthoringHelpers, defineContract, enumType, extensionModel, field, isValueObjectMember, member, model, now, rel, sql, storedAsListColumn };
@@ -6,9 +6,9 @@ import { c as SqlSchemaIR, n as RelationalSchemaNodeKind, u as SqlTableIR } from
6
6
  import { p as sqlExpressionRegistration } from "./sql-expression-DSRILiU2.mjs";
7
7
  import { u as isStorageTypeInstance } from "./types-DXrO0fxT.mjs";
8
8
  import { g as valueObjectStorageTypeMissingMessage } from "./validators-BMWQ7-5D.mjs";
9
- import { S as sqlAttributeSpecs, a as describeUnsupportedSqlAttribute } from "./psl-field-resolution-D4jnVVTd-B396sZmO.mjs";
9
+ import { S as sqlAttributeSpecs, a as describeUnsupportedSqlAttribute } from "./psl-field-resolution-ztVU6TV2-BSBajXoF.mjs";
10
10
  import { t as sqlEmission } from "./dist-D8EkCena.mjs";
11
- import { i as sqlFamilyPslBlockDescriptors, n as sqlFamilyAuthoringTypes, r as sqlFamilyEntityTypes, t as sqlFamilyAuthoringFieldPresets } from "./authoring-type-constructors-0Iv2zdwS-ZTBL7w8X.mjs";
11
+ import { i as sqlFamilyPslBlockDescriptors, n as sqlFamilyAuthoringTypes, r as sqlFamilyEntityTypes, t as sqlFamilyAuthoringFieldPresets } from "./authoring-type-constructors-0Iv2zdwS-zu35z-Tg.mjs";
12
12
  import { c as verifySqlSchemaByDiff, n as classifyDiffSubjectGranularity, o as enforceSqlDataTypeInvariants, t as classifyDiffEntityKind } from "./schema-verify-DIfHSB4I-Du0-5I8k.mjs";
13
13
  import { t as sqlFamilyError } from "./errors-B5g0xWro-mWH2C07F.mjs";
14
14
  import { t as SqlContractSerializer } from "./sql-contract-serializer-DDaAVCQr-BAb4jKvV.mjs";
@@ -2421,4 +2421,4 @@ var control_default = new SqlFamilyDescriptor();
2421
2421
  //#endregion
2422
2422
  export { plannerFailure as A, runnerSuccess as B, isUnfilledSlot as C, planFieldEventCalls as D, partitionIssuesByControlPolicy as E, resolveColumnRenameAgainst as F, subjectsOfCalls as G, sqlOfSlot as H, resolveTableRenameAgainst as I, unconvertedFieldOf as J, temporalCodecPresetWithPrecision as K, rowsWithoutValueFailure as L, requiredColumnMeta as M, requiredColumnOf as N, planFieldEventOperations as O, requiredColumnsOfMigration as P, rowsWithoutValueSummary as R, fieldStatementColumns as S, partitionCallsByControlPolicy as T, sqlTypeLookupsOf as U, slotSource as V, storageNameOfOperation as W, unmatchedColumnRename as X, unknownCallNames as Y, unmatchedTableRename as Z, detectDestructiveChanges as _, assembleAuthoringContributions as a, fieldOfColumn as b, columnTakesTemporaryValue as c, controlPolicyForCall as d, control_default as f, createSqlTextSources as g, createMigrationPlan as h, appliedStatementsInOrder as i, plannerSuccess as j, planStatements as k, contractNamespaceToSchemaIR as l, convertedColumnOf as m, INIT_ADDITIVE_POLICY as n, backfillOfDefaultedField as o, convertedColumnMeta as p, temporalStringAuthoringPresets as q, TABLE_NAME_CASE_CHANGED_CODE as r, checkSqlExpressionText as s, COLUMN_RENAME_UNMATCHED_CODE as t, contractToSchemaIR as u, detectTableNameCaseChanges as v, modelRenameStorageEffect as w, fieldRenameStorageEffect as x, fieldEventStorage as y, runnerFailure as z };
2423
2423
 
2424
- //# sourceMappingURL=control-Bvnz4Uk4.mjs.map
2424
+ //# sourceMappingURL=control-CFhsCA5g.mjs.map