@prisma/orm-family-sql 8.0.0-rc.22-dev.11 → 8.0.0-rc.22-dev.13

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-BhWwV_Uu.d.mts → attribute-specs-67xYCptU.d.mts} +2 -2
  2. package/dist/{attribute-specs-BhWwV_Uu.d.mts.map → attribute-specs-67xYCptU.d.mts.map} +1 -1
  3. package/dist/{config-types-YRGsoUT7.mjs → config-types-BSn4oo7q.mjs} +2 -2
  4. package/dist/{config-types-YRGsoUT7.mjs.map → config-types-BSn4oo7q.mjs.map} +1 -1
  5. package/dist/{contract-builder-BwPOolrg.mjs → contract-builder-BX4vfJCt.mjs} +2 -2
  6. package/dist/{contract-builder-BwPOolrg.mjs.map → contract-builder-BX4vfJCt.mjs.map} +1 -1
  7. package/dist/contract-prisma7__provider.mjs +4 -4
  8. package/dist/contract-psl.d.mts +4 -2
  9. package/dist/contract-psl.d.mts.map +1 -1
  10. package/dist/contract-psl.mjs +1 -1
  11. package/dist/contract-psl__attribute-specs.d.mts +1 -1
  12. package/dist/contract-psl__attribute-specs.mjs +1 -1
  13. package/dist/contract-psl__provider.mjs +4 -3
  14. package/dist/contract-psl__provider.mjs.map +1 -1
  15. package/dist/contract-ts.mjs +3 -3
  16. package/dist/contract-ts__config-types.mjs +1 -1
  17. package/dist/contract-ts__contract-builder.mjs +2 -2
  18. package/dist/{control-Ltpja41u.mjs → control-9kQv_V31.mjs} +15 -6
  19. package/dist/control-9kQv_V31.mjs.map +1 -0
  20. package/dist/{control-DBsrhNV2.d.mts → control-CaWlb92W.d.mts} +3 -3
  21. package/dist/{control-DBsrhNV2.d.mts.map → control-CaWlb92W.d.mts.map} +1 -1
  22. package/dist/{derived-checks-D__agoFB-DxuPwZ7v.mjs → derived-checks-zjkmqsa_-D7VKKK_q.mjs} +3 -3
  23. package/dist/{derived-checks-D__agoFB-DxuPwZ7v.mjs.map → derived-checks-zjkmqsa_-D7VKKK_q.mjs.map} +1 -1
  24. package/dist/family.d.mts +2 -2
  25. package/dist/family.mjs +2 -2
  26. package/dist/family__control.d.mts +1 -1
  27. package/dist/family__control.mjs +1 -1
  28. package/dist/family__pack.d.mts +1 -1
  29. package/dist/family__pack.mjs +2 -2
  30. package/dist/{generator-functions-Hy4pDDr9-DlmTbI_c.mjs → generator-functions-Hy4pDDr9-N4PMe9ob.mjs} +2 -2
  31. package/dist/{generator-functions-Hy4pDDr9-DlmTbI_c.mjs.map → generator-functions-Hy4pDDr9-N4PMe9ob.mjs.map} +1 -1
  32. package/dist/{interpreter-Ct1zWXKw-CLQnlWhR.mjs → interpreter-Cpal-yJC-mQRY-mo3.mjs} +40 -10
  33. package/dist/interpreter-Cpal-yJC-mQRY-mo3.mjs.map +1 -0
  34. package/dist/{pack-DXK_yIeS.d.mts → pack-Cnw2IEkm.d.mts} +2 -2
  35. package/dist/{pack-DXK_yIeS.d.mts.map → pack-Cnw2IEkm.d.mts.map} +1 -1
  36. package/dist/{psl-column-resolution-djGEITmJ-BEln16CX.d.mts → psl-column-resolution-Bv_-TDHZ-CLGqCPXA.d.mts} +2 -2
  37. package/dist/psl-column-resolution-Bv_-TDHZ-CLGqCPXA.d.mts.map +1 -0
  38. package/dist/{psl-field-resolution-BnusQmZy-_QYc6Ywf.mjs → psl-field-resolution-GN4iup8d-CcMRk9It.mjs} +7 -5
  39. package/dist/psl-field-resolution-GN4iup8d-CcMRk9It.mjs.map +1 -0
  40. package/package.json +18 -18
  41. package/dist/control-Ltpja41u.mjs.map +0 -1
  42. package/dist/interpreter-Ct1zWXKw-CLQnlWhR.mjs.map +0 -1
  43. package/dist/psl-column-resolution-djGEITmJ-BEln16CX.d.mts.map +0 -1
  44. package/dist/psl-field-resolution-BnusQmZy-_QYc6Ywf.mjs.map +0 -1
@@ -4,10 +4,10 @@ import { n as declaredBackingObjectName, r as declaredIndexesServeForeignKey } f
4
4
  import { h as storedSqlText } from "./sql-expression-CKgKznXS.mjs";
5
5
  import { p as validateSqlStorageConsistency, u as validateModelStorageReferences } from "./validators-qcQteqs2.mjs";
6
6
  import { t as deriveValueSetFromEntity } from "./value-set-derivation-hook-HVaxhALD.mjs";
7
- import { n as buildSqlContractFromDefinition, t as applySqlSpecifierControlPolicy } from "./derived-checks-D__agoFB-DxuPwZ7v.mjs";
8
- import { o as composedExtensionPackRefs } from "./contract-builder-BwPOolrg.mjs";
9
- import { c as instantiateFieldTypeConstructor, i as defaultFunctionCall, v as readDataTypeDefault } from "./psl-field-resolution-BnusQmZy-_QYc6Ywf.mjs";
10
- import { a as normalizeReferentialAction, n as buildEntityTypesByDiscriminator, r as indexFkRelations, t as applyBackrelationCandidates } from "./interpreter-Ct1zWXKw-CLQnlWhR.mjs";
7
+ import { n as buildSqlContractFromDefinition, t as applySqlSpecifierControlPolicy } from "./derived-checks-zjkmqsa_-D7VKKK_q.mjs";
8
+ import { o as composedExtensionPackRefs } from "./contract-builder-BX4vfJCt.mjs";
9
+ import { c as instantiateFieldTypeConstructor, i as defaultFunctionCall, v as readDataTypeDefault } from "./psl-field-resolution-GN4iup8d-CcMRk9It.mjs";
10
+ import { a as normalizeReferentialAction, n as buildEntityTypesByDiscriminator, r as indexFkRelations, t as applyBackrelationCandidates } from "./interpreter-Cpal-yJC-mQRY-mo3.mjs";
11
11
  import { isStructuredError } from "@prisma/orm-framework/utils/structured-error";
12
12
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
13
13
  import { entryForTag, getAuthoringTypeChoice, getAuthoringTypeConstructor, instantiateAuthoringEntityType, instantiateAuthoringTypeConstructorFromValues, resolveAuthoringTypeChoice } from "@prisma/orm-framework/components/authoring";
@@ -1,6 +1,6 @@
1
1
  import { a as SqlNamespaceBase, c as SqlNamespaceInput } from "./sql-storage-B_AM6tU1-BOPQxXo7.mjs";
2
2
  import "./types-CXRxo_TK.mjs";
3
- import { t as ColumnDescriptor } from "./psl-column-resolution-djGEITmJ-BEln16CX.mjs";
3
+ import { t as ColumnDescriptor } from "./psl-column-resolution-Bv_-TDHZ-CLGqCPXA.mjs";
4
4
  import { AuthoringContributions, DataTypeSupport } from "@prisma/orm-framework/components/authoring";
5
5
  import { Contract } from "@prisma/orm-framework/contract/types";
6
6
  import { CodecLookupWithDescriptors } from "@prisma/orm-framework/components/codec";
@@ -10,7 +10,7 @@ import { Result } from "@prisma/orm-framework/utils/result";
10
10
  import { ControlMutationDefaults, ControlMutationDefaults as ControlMutationDefaults$1, DefaultFunctionLoweringContext, MutationDefaultGeneratorDescriptor } from "@prisma/orm-framework/components/control";
11
11
  import { Binder, SymbolTable } from "@prisma/orm-framework/psl-parser";
12
12
  import { ContractSourceDiagnostic, ContractSourceDiagnostics } from "@prisma/orm-framework/config/config-types";
13
- //#region ../../../2-sql-family/2-authoring/contract-psl/dist/interpreter-DGoHOGSu.d.mts
13
+ //#region ../../../2-sql-family/2-authoring/contract-psl/dist/interpreter-DdrXv-on.d.mts
14
14
  //#region src/interpreter.d.ts
15
15
  interface InterpretPslDocumentToSqlContractInput {
16
16
  readonly documents: readonly DocumentAst[];
@@ -47,6 +47,8 @@ interface InterpretPslDocumentToSqlContractInput {
47
47
  readonly int: string;
48
48
  };
49
49
  readonly capabilities: CapabilityMatrix;
50
+ /** Receives a warning for each field or type alias typed with a deprecated type name. */
51
+ readonly reportWarning?: (diagnostic: ContractSourceDiagnostic) => void;
50
52
  }
51
53
  declare function interpretPslDocumentToSqlContract(input: InterpretPslDocumentToSqlContractInput): Result<Contract, ContractSourceDiagnostics>;
52
54
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"contract-psl.d.mts","names":[],"sources":["../../../../2-sql-family/2-authoring/contract-psl/dist/interpreter-DGoHOGSu.d.mts"],"mappings":";;;;;;;;;;;;;;UAYU;WACC,oBAAoB;WACpB,aAAa;WACb,SAAS;WACT,QAAQ;WACR,QAAQ;WACR,yBAAyB,oBAAoB;WAC7C;WACA,qCAAqC;WACrC,0BAA0B;;WAE1B,oBAAoB;;WAEpB,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-family/2-authoring/contract-psl/dist/interpreter-DdrXv-on.d.mts"],"mappings":";;;;;;;;;;;;;;UAYU;WACC,oBAAoB;WACpB,aAAa;WACb,SAAS;WACT,QAAQ;WACR,QAAQ;WACR,yBAAyB,oBAAoB;WAC7C;WACA,qCAAqC;WACrC,0BAA0B;;WAE1B,oBAAoB;;WAEpB,WAAW;WACX,yBAAyB;;;;;;;;;;WAUzB,4BAA4B,oBAAoB;;WAEhD,kBAAkB,OAAO,sBAAsB;WAC/C,aAAa;WACb,2BAA2B;;WAE3B;aACE;aACA;;WAEF,cAAc;;WAEd,iBAAiB,YAAY;;iBASvB,kCAAkC,OAAO,yCAAyC,OAAO,UAAU"}
@@ -1,2 +1,2 @@
1
- import { i as interpretPslDocumentToSqlContract } from "./interpreter-Ct1zWXKw-CLQnlWhR.mjs";
1
+ import { i as interpretPslDocumentToSqlContract } from "./interpreter-Cpal-yJC-mQRY-mo3.mjs";
2
2
  export { interpretPslDocumentToSqlContract };
@@ -1,2 +1,2 @@
1
- import { a as EnumMemberListDefault, c as sqlAttributeSpecs, i as EnumMemberDefault, n as DefaultFunctionCall, o as ParsedNullLiteral, r as DefaultFunctionSignature, s as defaultFunctionCall, t as describeUnsupportedSqlAttribute } from "./attribute-specs-BhWwV_Uu.mjs";
1
+ import { a as EnumMemberListDefault, c as sqlAttributeSpecs, i as EnumMemberDefault, n as DefaultFunctionCall, o as ParsedNullLiteral, r as DefaultFunctionSignature, s as defaultFunctionCall, t as describeUnsupportedSqlAttribute } from "./attribute-specs-67xYCptU.mjs";
2
2
  export { type DefaultFunctionCall, type DefaultFunctionSignature, type EnumMemberDefault, type EnumMemberListDefault, type ParsedNullLiteral, defaultFunctionCall, describeUnsupportedSqlAttribute, sqlAttributeSpecs };
@@ -1,2 +1,2 @@
1
- import { a as describeUnsupportedSqlAttribute, b as sqlAttributeSpecs, i as defaultFunctionCall } from "./psl-field-resolution-BnusQmZy-_QYc6Ywf.mjs";
1
+ import { a as describeUnsupportedSqlAttribute, b as sqlAttributeSpecs, i as defaultFunctionCall } from "./psl-field-resolution-GN4iup8d-CcMRk9It.mjs";
2
2
  export { defaultFunctionCall, describeUnsupportedSqlAttribute, sqlAttributeSpecs };
@@ -1,5 +1,5 @@
1
- import { t as applySqlSpecifierControlPolicy } from "./derived-checks-D__agoFB-DxuPwZ7v.mjs";
2
- import { i as interpretPslDocumentToSqlContract } from "./interpreter-Ct1zWXKw-CLQnlWhR.mjs";
1
+ import { t as applySqlSpecifierControlPolicy } from "./derived-checks-zjkmqsa_-D7VKKK_q.mjs";
2
+ import { i as interpretPslDocumentToSqlContract } from "./interpreter-Cpal-yJC-mQRY-mo3.mjs";
3
3
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
4
4
  import { collectScalarTypeConstructors } from "@prisma/orm-framework/components/authoring";
5
5
  import { assertDefined } from "@prisma/orm-framework/utils/assertions";
@@ -70,7 +70,8 @@ function prismaContract(schemaPath, options) {
70
70
  capabilities: context.capabilities,
71
71
  codecLookup: context.codecLookup,
72
72
  dataTypes: context.dataTypes,
73
- ...ifDefined("enumInferenceCodecs", options.enumInferenceCodecs)
73
+ ...ifDefined("enumInferenceCodecs", options.enumInferenceCodecs),
74
+ ...ifDefined("reportWarning", context.reportWarning)
74
75
  });
75
76
  },
76
77
  async load(context) {
@@ -1 +1 @@
1
- {"version":3,"file":"contract-psl__provider.mjs","names":[],"sources":["../../../../2-sql-family/2-authoring/contract-psl/dist/provider.mjs"],"sourcesContent":["import { n as interpretPslDocumentToSqlContract } from \"./interpreter-Ct1zWXKw.mjs\";\nimport { buildSymbolTable, createBinder, isPrismaNextSchema, mapPslDiagnostics } from \"@internal/psl-parser\";\nimport { applySqlSpecifierControlPolicy } from \"@internal/sql-contract-ts/contract-builder\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { assertDefined } from \"@internal/utils/assertions\";\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\tgeneratorFunctions: context.generatorFunctions,\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,IA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G,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-family/2-authoring/contract-psl/dist/provider.mjs"],"sourcesContent":["import { n as interpretPslDocumentToSqlContract } from \"./interpreter-Cpal-yJC.mjs\";\nimport { buildSymbolTable, createBinder, isPrismaNextSchema, mapPslDiagnostics } from \"@internal/psl-parser\";\nimport { applySqlSpecifierControlPolicy } from \"@internal/sql-contract-ts/contract-builder\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { assertDefined } from \"@internal/utils/assertions\";\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\tgeneratorFunctions: context.generatorFunctions,\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\t...ifDefined(\"reportWarning\", context.reportWarning)\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,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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 { l as sql } from "./sql-expression-CKgKznXS.mjs";
2
- import { i as isValueObjectMember, n as buildSqlContractFromDefinition, o as storedAsListColumn, t as applySqlSpecifierControlPolicy } from "./derived-checks-D__agoFB-DxuPwZ7v.mjs";
3
- import { a as check, c as defineContract, d as field, f as member, h as rel, i as buildContractDefinition, l as enumType, m as now, n as bindEnumType, o as composedExtensionPackRefs, p as model, r as buildBoundContract, s as createComposedAuthoringHelpers, t as autoincrement, u as extensionModel } from "./contract-builder-BwPOolrg.mjs";
4
- import { n as typescriptContract, r as typescriptContractFromPath, t as emptyContract } from "./config-types-YRGsoUT7.mjs";
2
+ import { i as isValueObjectMember, n as buildSqlContractFromDefinition, o as storedAsListColumn, t as applySqlSpecifierControlPolicy } from "./derived-checks-zjkmqsa_-D7VKKK_q.mjs";
3
+ import { a as check, c as defineContract, d as field, f as member, h as rel, i as buildContractDefinition, l as enumType, m as now, n as bindEnumType, o as composedExtensionPackRefs, p as model, r as buildBoundContract, s as createComposedAuthoringHelpers, t as autoincrement, u as extensionModel } from "./contract-builder-BX4vfJCt.mjs";
4
+ import { n as typescriptContract, r as typescriptContractFromPath, t as emptyContract } from "./config-types-BSn4oo7q.mjs";
5
5
  export { applySqlSpecifierControlPolicy, autoincrement, bindEnumType, buildBoundContract, buildContractDefinition, buildSqlContractFromDefinition, check, composedExtensionPackRefs, 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-YRGsoUT7.mjs";
1
+ import { n as typescriptContract, r as typescriptContractFromPath, t as emptyContract } from "./config-types-BSn4oo7q.mjs";
2
2
  export { emptyContract, typescriptContract, typescriptContractFromPath };
@@ -1,4 +1,4 @@
1
1
  import { l as sql } from "./sql-expression-CKgKznXS.mjs";
2
- import { i as isValueObjectMember, n as buildSqlContractFromDefinition, o as storedAsListColumn, t as applySqlSpecifierControlPolicy } from "./derived-checks-D__agoFB-DxuPwZ7v.mjs";
3
- import { a as check, c as defineContract, d as field, f as member, h as rel, i as buildContractDefinition, l as enumType, m as now, n as bindEnumType, o as composedExtensionPackRefs, p as model, r as buildBoundContract, s as createComposedAuthoringHelpers, t as autoincrement, u as extensionModel } from "./contract-builder-BwPOolrg.mjs";
2
+ import { i as isValueObjectMember, n as buildSqlContractFromDefinition, o as storedAsListColumn, t as applySqlSpecifierControlPolicy } from "./derived-checks-zjkmqsa_-D7VKKK_q.mjs";
3
+ import { a as check, c as defineContract, d as field, f as member, h as rel, i as buildContractDefinition, l as enumType, m as now, n as bindEnumType, o as composedExtensionPackRefs, p as model, r as buildBoundContract, s as createComposedAuthoringHelpers, t as autoincrement, u as extensionModel } from "./contract-builder-BX4vfJCt.mjs";
4
4
  export { applySqlSpecifierControlPolicy, autoincrement, bindEnumType, buildBoundContract, buildContractDefinition, buildSqlContractFromDefinition, check, composedExtensionPackRefs, createComposedAuthoringHelpers, defineContract, enumType, extensionModel, field, isValueObjectMember, member, model, now, rel, sql, storedAsListColumn };
@@ -9,17 +9,17 @@ import { c as SqlSchemaIR, n as RelationalSchemaNodeKind, u as SqlTableIR } from
9
9
  import { f as sqlExpressionRegistration, m as sqlTextsReadBack, o as printSqlExpressionLiteral } from "./sql-expression-CKgKznXS.mjs";
10
10
  import { d as nonEmptyTypeParams, u as isStorageTypeInstance } from "./types-CISwoRED.mjs";
11
11
  import { g as valueObjectStorageTypeMissingMessage } from "./validators-qcQteqs2.mjs";
12
- import { a as describeUnsupportedSqlAttribute, b as sqlAttributeSpecs } from "./psl-field-resolution-BnusQmZy-_QYc6Ywf.mjs";
12
+ import { a as describeUnsupportedSqlAttribute, b as sqlAttributeSpecs } from "./psl-field-resolution-GN4iup8d-CcMRk9It.mjs";
13
13
  import { t as describeUnresolvedSqlType } from "./diagnostics-CSrneG0n.mjs";
14
14
  import { t as sqlEmission } from "./dist-BJjqJT_M.mjs";
15
- import { a as sqlFamilyGeneratorFunctions, i as sqlFamilyGeneratorDescriptors, n as sqlFamilyAuthoringTypes, o as sqlFamilyPslBlockDescriptors, r as sqlFamilyEntityTypes } from "./generator-functions-Hy4pDDr9-DlmTbI_c.mjs";
15
+ import { a as sqlFamilyGeneratorFunctions, i as sqlFamilyGeneratorDescriptors, n as sqlFamilyAuthoringTypes, o as sqlFamilyPslBlockDescriptors, r as sqlFamilyEntityTypes } from "./generator-functions-Hy4pDDr9-N4PMe9ob.mjs";
16
16
  import { c as verifySqlSchemaByDiff, n as classifyDiffSubjectGranularity, o as enforceSqlDataTypeInvariants, t as classifyDiffEntityKind } from "./schema-verify-C3wbdviw-nQ4tG9N7.mjs";
17
17
  import { t as sqlFamilyError } from "./errors-B5g0xWro-C8plbqga.mjs";
18
18
  import { t as SqlContractSerializer } from "./sql-contract-serializer-sMY3prTx-BfYfhVR_.mjs";
19
19
  import { t as collectSupportedCodecTypeIds } from "./verify-BVk5bjdH-DhKm6hB3.mjs";
20
20
  import { isStructuredError, structuredError } from "@prisma/orm-framework/utils/structured-error";
21
21
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
22
- import { collectScalarTypeConstructors, tsTaggedTemplateSource } from "@prisma/orm-framework/components/authoring";
22
+ import { collectScalarTypeConstructors, isAuthoringTypeChoiceDescriptor, isAuthoringTypeConstructorDescriptor, tsTaggedTemplateSource } from "@prisma/orm-framework/components/authoring";
23
23
  import { ContractValidationError } from "@prisma/orm-framework/contract/contract-validation-error";
24
24
  import { UNBOUND_NAMESPACE_ID, isPlainRecord } from "@prisma/orm-framework/components/ir";
25
25
  import { asNamespaceId, governingControlPolicy, valueObjectAt, valueObjectsWithCoordinates } from "@prisma/orm-framework/contract/types";
@@ -2915,9 +2915,18 @@ function fieldOfColumn(contract, table, column) {
2915
2915
  if (new Set(fields.map(({ storageNamespace }) => storageNamespace)).size !== 1) return void 0;
2916
2916
  return (fields.find(({ isRoot }) => isRoot) ?? fields[0])?.subject;
2917
2917
  }
2918
- /** The name each scalar type constructor of `namespace` is written as, by the codec it makes; the first declared wins. */
2918
+ /** The name a schema writes for each codec of `namespace`: a convenience type whose defaults make it, else the first explicit type, never a deprecated one. */
2919
2919
  function scalarTypeNamesOf(namespace) {
2920
- const constructors = [...collectScalarTypeConstructors(namespace)];
2920
+ const isTypeChoice = (name) => {
2921
+ const member = namespace[name];
2922
+ return member !== void 0 && isAuthoringTypeChoiceDescriptor(member);
2923
+ };
2924
+ const isDeprecated = (name) => {
2925
+ const member = namespace[name];
2926
+ return member !== void 0 && isAuthoringTypeConstructorDescriptor(member) && member.deprecated !== void 0;
2927
+ };
2928
+ const current = [...collectScalarTypeConstructors(namespace)].filter(([name]) => !isDeprecated(name));
2929
+ const constructors = [...current.filter(([name]) => isTypeChoice(name)), ...current.filter(([name]) => !isTypeChoice(name))];
2921
2930
  return (codecRef) => constructors.find(([, output]) => output.codecId === codecRef.codecId && JSON.stringify(output.typeParams ?? {}) === JSON.stringify(codecRef.typeParams ?? {}))?.[0];
2922
2931
  }
2923
2932
  function fieldNamed(contract, text) {
@@ -4245,4 +4254,4 @@ var control_default = new SqlFamilyDescriptor();
4245
4254
  //#endregion
4246
4255
  export { requiredColumnsOfMigration as $, jsonPathText as A, planFieldEventOperations as B, fieldEventStorage as C, fillKeyProblem as D, fieldStatementColumns as E, parseJsonPath as F, planVariantRowRewrites as G, planStoredRewrites as H, partitionCallsByControlPolicy as I, readColumnDefault as J, plannerFailure as K, partitionIssuesByControlPolicy as L, keyPathOf as M, modelRenameStorageEffect as N, fillValueProblem as O, otherSpaceDeclaring as P, requiredColumnOf as Q, planEnumValueRewrites as R, encodeStoredValue as S, unnamedFieldFillOf as St, fieldRenameStorageEffect as T, planValueObjectFieldFills as U, planStatements as V, planValueObjectFieldRewrites as W, removalsOfMigration as X, readReportedDefault as Y, requiredColumnMeta as Z, convertedColumnOf as _, subjectsOfCalls as _t, UnfilledValue as a, rowsWithoutValueFailure as at, detectDestructiveChanges as b, unmatchedColumnRename as bt, assembleAuthoringContributions$1 as c, runnerSuccess as ct, columnTakesTemporaryValue as d, sqlDefaultFunctions as dt, resolveColumnRenameAgainst as et, contractColumns as f, sqlOfSlot as ft, convertedColumnMeta as g, storedValueSubjects as gt, control_default as h, storedValueOperationIndexes as ht, TABLE_NAME_CASE_CHANGED_CODE as i, rowsHoldingValueOf as it, keepRowsEdit as j, isUnfilledSlot as k, backfillOfDefaultedField as l, scalarTypeNamesOf as lt, contractToSchemaIR as m, storageNameOfOperation as mt, INIT_ADDITIVE_POLICY as n, rowsHoldingValueFailure as nt, acceptedByDataType as o, rowsWithoutValueSummary as ot, contractNamespaceToSchemaIR as p, sqlTypeLookupsOf as pt, plannerSuccess as q, NO_RENAMED_ORIGINS as r, rowsHoldingValueMeta as rt, appliedStatementsInOrder as s, runnerFailure as st, COLUMN_RENAME_UNMATCHED_CODE as t, resolveTableRenameAgainst as tt, checkSqlExpressionText as u, slotSource as ut, createMigrationPlan as v, unconvertedFieldOf as vt, fieldOfColumn as w, detectTableNameCaseChanges as x, unmatchedTableRename as xt, createSqlTextSources as y, unknownCallNames as yt, planFieldEventCalls as z };
4247
4256
 
4248
- //# sourceMappingURL=control-Ltpja41u.mjs.map
4257
+ //# sourceMappingURL=control-9kQv_V31.mjs.map