@prisma/orm-family-sql 8.0.0-rc.22-dev.7 → 8.0.0-rc.22-dev.9

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 (47) hide show
  1. package/dist/{canonicalization-hooks-Ce1v_TDl.mjs → canonicalization-hooks-BeJHD713.mjs} +18 -1
  2. package/dist/canonicalization-hooks-BeJHD713.mjs.map +1 -0
  3. package/dist/{check-expressions-DuWjvG4h.d.mts → check-expressions-Bh5KC2X5.d.mts} +8 -2
  4. package/dist/{check-expressions-DuWjvG4h.d.mts.map → check-expressions-Bh5KC2X5.d.mts.map} +1 -1
  5. package/dist/{check-expressions-BDsLvzqN.mjs → check-expressions-Mmzgx0XE.mjs} +4 -3
  6. package/dist/check-expressions-Mmzgx0XE.mjs.map +1 -0
  7. package/dist/{config-types-BCXwEBZH.mjs → config-types-YRGsoUT7.mjs} +2 -2
  8. package/dist/{config-types-BCXwEBZH.mjs.map → config-types-YRGsoUT7.mjs.map} +1 -1
  9. package/dist/{contract-builder-Y2rB4xMf.mjs → contract-builder-BwPOolrg.mjs} +2 -2
  10. package/dist/{contract-builder-Y2rB4xMf.mjs.map → contract-builder-BwPOolrg.mjs.map} +1 -1
  11. package/dist/contract-prisma7__provider.mjs +4 -4
  12. package/dist/contract-psl.mjs +1 -1
  13. package/dist/contract-psl__attribute-specs.mjs +1 -1
  14. package/dist/contract-psl__provider.mjs +2 -2
  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/contract.d.mts +2 -2
  19. package/dist/contract.mjs +3 -3
  20. package/dist/contract__canonicalization-hooks.mjs +1 -1
  21. package/dist/contract__check-expressions.d.mts +2 -2
  22. package/dist/contract__check-expressions.mjs +2 -2
  23. package/dist/{control-CdumaQYh.d.mts → control-CyJM0mMS.d.mts} +372 -26
  24. package/dist/control-CyJM0mMS.d.mts.map +1 -0
  25. package/dist/{control-BSX7UWk2.mjs → control-Ltpja41u.mjs} +1159 -59
  26. package/dist/control-Ltpja41u.mjs.map +1 -0
  27. package/dist/{derived-checks-D__agoFB-Boa1MHcA.mjs → derived-checks-D__agoFB-DxuPwZ7v.mjs} +3 -3
  28. package/dist/{derived-checks-D__agoFB-Boa1MHcA.mjs.map → derived-checks-D__agoFB-DxuPwZ7v.mjs.map} +1 -1
  29. package/dist/family.d.mts +2 -2
  30. package/dist/family.mjs +4 -4
  31. package/dist/family__control.d.mts +2 -2
  32. package/dist/family__control.mjs +2 -2
  33. package/dist/family__ir.mjs +1 -1
  34. package/dist/family__pack.mjs +2 -2
  35. package/dist/{generator-functions-Hy4pDDr9-HEQuSSaK.mjs → generator-functions-Hy4pDDr9-DlmTbI_c.mjs} +2 -2
  36. package/dist/{generator-functions-Hy4pDDr9-HEQuSSaK.mjs.map → generator-functions-Hy4pDDr9-DlmTbI_c.mjs.map} +1 -1
  37. package/dist/{interpreter-Ct1zWXKw-CRkWwRAw.mjs → interpreter-Ct1zWXKw-CLQnlWhR.mjs} +4 -4
  38. package/dist/{interpreter-Ct1zWXKw-CRkWwRAw.mjs.map → interpreter-Ct1zWXKw-CLQnlWhR.mjs.map} +1 -1
  39. package/dist/{psl-field-resolution-BnusQmZy-CX0b0mPk.mjs → psl-field-resolution-BnusQmZy-_QYc6Ywf.mjs} +2 -2
  40. package/dist/{psl-field-resolution-BnusQmZy-CX0b0mPk.mjs.map → psl-field-resolution-BnusQmZy-_QYc6Ywf.mjs.map} +1 -1
  41. package/dist/{sql-contract-serializer-sMY3prTx-CBHrlt9O.mjs → sql-contract-serializer-sMY3prTx-BfYfhVR_.mjs} +2 -2
  42. package/dist/{sql-contract-serializer-sMY3prTx-CBHrlt9O.mjs.map → sql-contract-serializer-sMY3prTx-BfYfhVR_.mjs.map} +1 -1
  43. package/package.json +18 -18
  44. package/dist/canonicalization-hooks-Ce1v_TDl.mjs.map +0 -1
  45. package/dist/check-expressions-BDsLvzqN.mjs.map +0 -1
  46. package/dist/control-BSX7UWk2.mjs.map +0 -1
  47. package/dist/control-CdumaQYh.d.mts.map +0 -1
@@ -50,6 +50,23 @@ const preserveEmptyPatterns = [
50
50
  "*",
51
51
  "default",
52
52
  "value"
53
+ ],
54
+ [
55
+ "domain",
56
+ "namespaces",
57
+ "*",
58
+ "models",
59
+ "*",
60
+ "fields"
61
+ ],
62
+ [
63
+ "domain",
64
+ "namespaces",
65
+ "*",
66
+ "models",
67
+ "*",
68
+ "storage",
69
+ "fields"
53
70
  ]
54
71
  ];
55
72
  const columnDefaultValuePrefix = [
@@ -88,4 +105,4 @@ const sqlContractCanonicalizationHooks = {
88
105
  //#endregion
89
106
  export { sqlContractCanonicalizationHooks as t };
90
107
 
91
- //# sourceMappingURL=canonicalization-hooks-Ce1v_TDl.mjs.map
108
+ //# sourceMappingURL=canonicalization-hooks-BeJHD713.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canonicalization-hooks-BeJHD713.mjs","names":[],"sources":["../../../../2-sql-family/1-core/contract/dist/canonicalization-hooks.mjs"],"sourcesContent":["import { createPreserveEmptyPredicate, createStorageSort, matchesPathPattern } from \"@internal/contract/hashing-utils\";\n//#region src/canonicalization-hooks.ts\nconst preserveEmptyPatterns = [\n\t[\n\t\t\"storage\",\n\t\t\"namespaces\",\n\t\t\"*\",\n\t\t\"entries\",\n\t\t\"table\"\n\t],\n\t[\n\t\t\"storage\",\n\t\t\"namespaces\",\n\t\t\"*\",\n\t\t\"entries\",\n\t\t\"table\",\n\t\t\"*\"\n\t],\n\t[\n\t\t\"storage\",\n\t\t\"namespaces\",\n\t\t\"*\",\n\t\t\"entries\",\n\t\t\"table\",\n\t\t\"*\",\n\t\t[\n\t\t\t\"uniques\",\n\t\t\t\"indexes\",\n\t\t\t\"foreignKeys\"\n\t\t]\n\t],\n\t[\n\t\t\"storage\",\n\t\t\"namespaces\",\n\t\t\"*\",\n\t\t\"entries\",\n\t\t\"table\",\n\t\t\"*\",\n\t\t\"indexes\",\n\t\t\"unique\"\n\t],\n\t[\n\t\t\"storage\",\n\t\t\"namespaces\",\n\t\t\"*\",\n\t\t\"entries\",\n\t\t\"table\",\n\t\t\"*\",\n\t\t\"columns\",\n\t\t\"*\",\n\t\t\"default\",\n\t\t\"value\"\n\t],\n\t[\n\t\t\"domain\",\n\t\t\"namespaces\",\n\t\t\"*\",\n\t\t\"models\",\n\t\t\"*\",\n\t\t\"fields\"\n\t],\n\t[\n\t\t\"domain\",\n\t\t\"namespaces\",\n\t\t\"*\",\n\t\t\"models\",\n\t\t\"*\",\n\t\t\"storage\",\n\t\t\"fields\"\n\t]\n];\nconst columnDefaultValuePrefix = [\n\t\"storage\",\n\t\"namespaces\",\n\t\"*\",\n\t\"entries\",\n\t\"table\",\n\t\"*\",\n\t\"columns\",\n\t\"*\",\n\t\"default\",\n\t\"value\"\n];\nconst isColumnDefaultValuePath = (path) => path.length >= columnDefaultValuePrefix.length && matchesPathPattern(path.slice(0, columnDefaultValuePrefix.length), columnDefaultValuePrefix);\nconst sortTargets = [{\n\tpath: [\n\t\t\"namespaces\",\n\t\t\"*\",\n\t\t\"entries\",\n\t\t\"table\",\n\t\t\"*\"\n\t],\n\tarrayKeys: [\n\t\t\"checks\",\n\t\t\"indexes\",\n\t\t\"uniques\"\n\t]\n}];\nconst matchesPreserveEmptyPattern = createPreserveEmptyPredicate(preserveEmptyPatterns);\nconst shouldPreserveEmpty = (path) => isColumnDefaultValuePath(path) || matchesPreserveEmptyPattern(path);\nconst sqlContractCanonicalizationHooks = {\n\tshouldPreserveEmpty,\n\tsortStorage: createStorageSort(sortTargets)\n};\n//#endregion\nexport { sqlContractCanonicalizationHooks };\n\n//# sourceMappingURL=canonicalization-hooks.mjs.map"],"mappings":";;AAEA,MAAM,wBAAwB;CAC7B;EACC;EACA;EACA;EACA;EACA;CACD;CACA;EACC;EACA;EACA;EACA;EACA;EACA;CACD;CACA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;GACC;GACA;GACA;EACD;CACD;CACA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;CACA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;CACA;EACC;EACA;EACA;EACA;EACA;EACA;CACD;CACA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;CACD;AACD;AACA,MAAM,2BAA2B;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AACA,MAAM,4BAA4B,SAAS,KAAK,UAAU,yBAAyB,UAAU,mBAAmB,KAAK,MAAM,GAAG,yBAAyB,MAAM,GAAG,wBAAwB;AACxL,MAAM,cAAc,CAAC;CACpB,MAAM;EACL;EACA;EACA;EACA;EACA;CACD;CACA,WAAW;EACV;EACA;EACA;CACD;AACD,CAAC;AACD,MAAM,8BAA8B,6BAA6B,qBAAqB;AACtF,MAAM,uBAAuB,SAAS,yBAAyB,IAAI,KAAK,4BAA4B,IAAI;AACxG,MAAM,mCAAmC;CACxC;CACA,aAAa,kBAAkB,WAAW;AAC3C"}
@@ -77,6 +77,12 @@ declare function discriminatorValueSet(baseModelName: string, discriminatorField
77
77
  * The value object a reference names, with nested value objects inlined, enum members' values read from their storage value sets, and each scalar member's JSON type read from its codec.
78
78
  */
79
79
  declare function resolveValueObject(storage: Pick<StorageBase, 'namespaces'>, reference: EntityCoordinate<'storage', 'valueObject'>, codecs: CodecDescriptors): ResolvedValueObject;
80
+ /**
81
+ * Whether `from` is one of `targets`, or refers to one through its own fields or nested ones. While resolving, `targets` holds the value objects on the path, each of which refers to `from`, so this holds exactly when `from` is in a group of value objects that contain each other which the path has already entered.
82
+ */
83
+ declare function reachesAny(storage: Pick<StorageBase, 'namespaces'>, from: EntityCoordinate<'storage', 'valueObject'>, targets: ReadonlySet<string>): boolean;
84
+ /** The key `reachesAny` knows a value object by. */
85
+ declare function referenceKey(reference: EntityCoordinate<'storage', 'valueObject'>): string;
80
86
  //#endregion
81
- export { ResolvedValueObject as a, discriminatorValueSet as c, ResolvedColumnValueObject as i, resolveColumnValueObject as l, CheckExpressionInput as n, ResolvedValueObjectField as o, CheckExpressionRenderer as r, ResolvedValueObjectFieldType as s, CheckExpressionCandidate as t, resolveValueObject as u };
82
- //# sourceMappingURL=check-expressions-DuWjvG4h.d.mts.map
87
+ export { ResolvedValueObject as a, discriminatorValueSet as c, resolveColumnValueObject as d, resolveValueObject as f, ResolvedColumnValueObject as i, reachesAny as l, CheckExpressionInput as n, ResolvedValueObjectField as o, CheckExpressionRenderer as r, ResolvedValueObjectFieldType as s, CheckExpressionCandidate as t, referenceKey as u };
88
+ //# sourceMappingURL=check-expressions-Bh5KC2X5.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"check-expressions-DuWjvG4h.d.mts","names":[],"sources":["../../../../2-sql-family/1-core/contract/dist/check-expressions.d.mts"],"mappings":";;;;;;KAKK,mBAAmB,KAAK;;UAEnB;WACC,QAAQ,SAAS,eAAe;;UAEjC;WACC;WACA;aACE;;WAEF,MAAM;;;;;KAKZ;WACM;WACA,UAAU;WACV;;WAEA;WACA,aAAa;;WAEb;;;UAGD;WACC;WACA;WACA;aACE;;;WAGF;;WAEA,aAAa;;;UAGd;WACC;WACA;aACE;;WAEF,aAAa;;;UAGd;WACC,MAAM;WACN;WACA;;KAEN,2BAA2B,OAAO,yBAAyB,cAAc;;;;iBAI7D,yBAAyB,SAAS,KAAK,4BAA4B;WACzE,WAAW;WACX;WACA;aACE;;GAEV,QAAQ,mBAAmB;;;;iBAIb,sBAAsB,uBAAuB,4BAA4B;WAC/E;WACA;;;;;iBAKM,mBAAmB,SAAS,KAAK,4BAA4B,WAAW,4CAA4C,QAAQ,mBAAmB"}
1
+ {"version":3,"file":"check-expressions-Bh5KC2X5.d.mts","names":[],"sources":["../../../../2-sql-family/1-core/contract/dist/check-expressions.d.mts"],"mappings":";;;;;;KAKK,mBAAmB,KAAK;;UAEnB;WACC,QAAQ,SAAS,eAAe;;UAEjC;WACC;WACA;aACE;;WAEF,MAAM;;;;;KAKZ;WACM;WACA,UAAU;WACV;;WAEA;WACA,aAAa;;WAEb;;;UAGD;WACC;WACA;WACA;aACE;;;WAGF;;WAEA,aAAa;;;UAGd;WACC;WACA;aACE;;WAEF,aAAa;;;UAGd;WACC,MAAM;WACN;WACA;;KAEN,2BAA2B,OAAO,yBAAyB,cAAc;;;;iBAI7D,yBAAyB,SAAS,KAAK,4BAA4B;WACzE,WAAW;WACX;WACA;aACE;;GAEV,QAAQ,mBAAmB;;;;iBAIb,sBAAsB,uBAAuB,4BAA4B;WAC/E;WACA;;;;;iBAKM,mBAAmB,SAAS,KAAK,4BAA4B,WAAW,4CAA4C,QAAQ,mBAAmB;;;;iBAI/I,WAAW,SAAS,KAAK,4BAA4B,MAAM,4CAA4C,SAAS;;iBAEhH,aAAa,WAAW"}
@@ -75,7 +75,7 @@ function memberJsonType(member, codecId, codecs) {
75
75
  });
76
76
  }
77
77
  /**
78
- * Whether `from` refers, through its own fields or nested ones, to a value object on the path being resolved. Each value object on the path refers to `from`, so this holds exactly when `from` is in a group of value objects that contain each other which the path has already entered.
78
+ * Whether `from` is one of `targets`, or refers to one through its own fields or nested ones. While resolving, `targets` holds the value objects on the path, each of which refers to `from`, so this holds exactly when `from` is in a group of value objects that contain each other which the path has already entered.
79
79
  */
80
80
  function reachesAny(storage, from, targets) {
81
81
  const seen = /* @__PURE__ */ new Set();
@@ -99,10 +99,11 @@ function valueSetValues(storage, reference) {
99
99
  invariant(isStorageValueSet(valueSet), `value set "${reference.entityName}" in namespace "${reference.namespaceId}" is not in storage; the contract validators refuse a value object member whose value set is missing`);
100
100
  return valueSet.values.filter((value) => typeof value === "string" || typeof value === "number");
101
101
  }
102
+ /** The key `reachesAny` knows a value object by. */
102
103
  function referenceKey(reference) {
103
104
  return JSON.stringify([reference.namespaceId, reference.entityName]);
104
105
  }
105
106
  //#endregion
106
- export { resolveColumnValueObject as n, resolveValueObject as r, discriminatorValueSet as t };
107
+ export { resolveValueObject as a, resolveColumnValueObject as i, reachesAny as n, referenceKey as r, discriminatorValueSet as t };
107
108
 
108
- //# sourceMappingURL=check-expressions-BDsLvzqN.mjs.map
109
+ //# sourceMappingURL=check-expressions-Mmzgx0XE.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-expressions-Mmzgx0XE.mjs","names":[],"sources":["../../../../2-sql-family/1-core/contract/dist/check-expressions.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { n as declaredJsonType } from \"./codec-json-type-DUWyBtJk.mjs\";\nimport { n as isStorageValueSet } from \"./storage-value-set-uGUEBAMJ.mjs\";\nimport { valueObjectAt } from \"@internal/contract/types\";\nimport { invariant } from \"@internal/utils/assertions\";\n//#region src/check-expressions.ts\n/**\n* What the check of a column that holds a value object reads. The contract build and `contract print` both derive it here, so print recognises exactly the check the build writes.\n*/\nfunction resolveColumnValueObject(storage, column, codecs) {\n\treturn {\n\t\tnullable: column.nullable,\n\t\tmany: column.many,\n\t\tvalueObject: resolveValueObject(storage, column.reference, codecs)\n\t};\n}\n/**\n* The value set a discriminator column names (ADR 309): keyed `<Base>.<field>`, and holding the variants' values sorted, so the order variants are declared in does not change the storage hash. The contract build writes it and `contract print` compares a contract's value set with it.\n*/\nfunction discriminatorValueSet(baseModelName, discriminatorField, variantValues) {\n\treturn {\n\t\tname: `${baseModelName}.${discriminatorField}`,\n\t\tvalues: [...variantValues].sort()\n\t};\n}\n/**\n* The value object a reference names, with nested value objects inlined, enum members' values read from their storage value sets, and each scalar member's JSON type read from its codec.\n*/\nfunction resolveValueObject(storage, reference, codecs) {\n\treturn resolveEntered(storage, reference, [referenceKey(reference)], codecs);\n}\nfunction resolveEntered(storage, reference, path, codecs) {\n\tconst valueObject = requiredValueObject(storage, reference);\n\treturn { fields: Object.fromEntries(Object.entries(valueObject.fields).map(([name, field]) => [name, {\n\t\tnullable: field.nullable,\n\t\tmany: field.many ?? false,\n\t\ttype: resolveFieldType(storage, {\n\t\t\treference,\n\t\t\tname,\n\t\t\tfield\n\t\t}, path, codecs)\n\t}])) };\n}\nfunction resolveFieldType(storage, member, path, codecs) {\n\tconst { field } = member;\n\tconst { type } = field;\n\tinvariant(type.kind !== \"union\" && field.dict !== true, \"a SQL value object member is never a union or a dictionary\");\n\tif (type.kind === \"scalar\") return {\n\t\tkind: \"scalar\",\n\t\tjsonType: memberJsonType(member, type.codecId, codecs),\n\t\tvalues: field.valueSet === void 0 ? void 0 : valueSetValues(storage, field.valueSet)\n\t};\n\tconst key = referenceKey(type);\n\tif (reachesAny(storage, type, new Set(path))) return { kind: \"anyObject\" };\n\treturn {\n\t\tkind: \"valueObject\",\n\t\tvalueObject: resolveEntered(storage, type, [...path, key], codecs)\n\t};\n}\nfunction memberJsonType(member, codecId, codecs) {\n\tconst descriptor = codecs.descriptorFor(codecId);\n\tinvariant(descriptor !== void 0, `value object member codec \"${codecId}\" is not a codec of the stack; the contract validators refuse a codec the stack does not register`);\n\tconst jsonType = declaredJsonType(descriptor);\n\tif (jsonType !== void 0) return jsonType;\n\tconst valueObject = `${member.reference.namespaceId}:${member.reference.entityName}`;\n\tthrow contractError(\"CONTRACT.CODEC_JSON_TYPE_MISSING\", `The codec \"${codecId}\" of value object \"${valueObject}\" member \"${member.name}\" declares no jsonType, so the check of the value object cannot be derived.`, {\n\t\twhy: \"The check of a value object column requires each member to be of the JSON type its codec declares, and this codec declares none.\",\n\t\tfix: `The author of the codec \"${codecId}\" adds a jsonType to its descriptor, the JSON type its value is written as inside a JSON document.`,\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\tvalueObject,\n\t\t\tmember: member.name,\n\t\t\tproperty: \"jsonType\"\n\t\t}\n\t});\n}\n/**\n* Whether `from` is one of `targets`, or refers to one through its own fields or nested ones. While resolving, `targets` holds the value objects on the path, each of which refers to `from`, so this holds exactly when `from` is in a group of value objects that contain each other which the path has already entered.\n*/\nfunction reachesAny(storage, from, targets) {\n\tconst seen = /* @__PURE__ */ new Set();\n\tconst pending = [from];\n\tfor (let next = pending.pop(); next !== void 0; next = pending.pop()) {\n\t\tconst key = referenceKey(next);\n\t\tif (targets.has(key)) return true;\n\t\tif (seen.has(key)) continue;\n\t\tseen.add(key);\n\t\tfor (const field of Object.values(requiredValueObject(storage, next).fields)) if (field.type.kind === \"valueObject\") pending.push(field.type);\n\t}\n\treturn false;\n}\nfunction requiredValueObject(storage, reference) {\n\tconst valueObject = valueObjectAt(storage, reference);\n\tinvariant(valueObject !== void 0, `value object \"${reference.entityName}\" in namespace \"${reference.namespaceId}\" is not in storage; the contract validators refuse a reference to a missing value object`);\n\treturn valueObject;\n}\nfunction valueSetValues(storage, reference) {\n\tconst valueSet = Object.hasOwn(storage.namespaces, reference.namespaceId) ? storage.namespaces[reference.namespaceId]?.entries?.[\"valueSet\"]?.[reference.entityName] : void 0;\n\tinvariant(isStorageValueSet(valueSet), `value set \"${reference.entityName}\" in namespace \"${reference.namespaceId}\" is not in storage; the contract validators refuse a value object member whose value set is missing`);\n\treturn valueSet.values.filter((value) => typeof value === \"string\" || typeof value === \"number\");\n}\n/** The key `reachesAny` knows a value object by. */\nfunction referenceKey(reference) {\n\treturn JSON.stringify([reference.namespaceId, reference.entityName]);\n}\n//#endregion\nexport { discriminatorValueSet, reachesAny, referenceKey, resolveColumnValueObject, resolveValueObject };\n\n//# sourceMappingURL=check-expressions.mjs.map"],"mappings":";;;;;;;;;AASA,SAAS,yBAAyB,SAAS,QAAQ,QAAQ;CAC1D,OAAO;EACN,UAAU,OAAO;EACjB,MAAM,OAAO;EACb,aAAa,mBAAmB,SAAS,OAAO,WAAW,MAAM;CAClE;AACD;;;;AAIA,SAAS,sBAAsB,eAAe,oBAAoB,eAAe;CAChF,OAAO;EACN,MAAM,GAAG,cAAc,GAAG;EAC1B,QAAQ,CAAC,GAAG,aAAa,CAAC,CAAC,KAAK;CACjC;AACD;;;;AAIA,SAAS,mBAAmB,SAAS,WAAW,QAAQ;CACvD,OAAO,eAAe,SAAS,WAAW,CAAC,aA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ition, r as contractError, t as applySqlSpecifierControlPolicy } from "./derived-checks-D__agoFB-Boa1MHcA.mjs";
1
+ import { n as buildSqlContractFromDefinition, r as contractError, t as applySqlSpecifierControlPolicy } from "./derived-checks-D__agoFB-DxuPwZ7v.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";
@@ -65,4 +65,4 @@ function typescriptContractFromPath(contractPath, output, options) {
65
65
  //#endregion
66
66
  export { typescriptContract as n, typescriptContractFromPath as r, emptyContract as t };
67
67
 
68
- //# sourceMappingURL=config-types-BCXwEBZH.mjs.map
68
+ //# sourceMappingURL=config-types-YRGsoUT7.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-types-BCXwEBZH.mjs","names":[],"sources":["../../../../2-sql-family/2-authoring/contract-ts/dist/config-types.mjs"],"sourcesContent":["import { n as buildSqlContractFromDefinition, s as contractError, t as applySqlSpecifierControlPolicy } from \"./derived-checks-D__agoFB.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 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}\nfunction typescriptContractFromPath(contractPath, output, 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\tconst contract = mod.default ?? mod.contract;\n\t\t\t\tif (contract === void 0) throw contractError(\"CONTRACT.MODULE_EXPORT_MISSING\", `typescriptContractFromPath: module at \"${absolutePath}\" has no \"default\" or \"contract\" export.`, { meta: { path: absolutePath } });\n\t\t\t\treturn ok(options === void 0 ? contract : applySqlSpecifierControlPolicy(contract, options.defaultControlPolicy, options.createNamespace));\n\t\t\t}\n\t\t},\n\t\toutput: output ?? defaultOutputFromContractPath(contractPath)\n\t};\n}\n//#endregion\nexport { emptyContract, typescriptContract, typescriptContractFromPath };\n\n//# sourceMappingURL=config-types.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,SAAS,8BAA8B,cAAc;CACpD,MAAM,MAAM,QAA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1I;EACD;EACA,QAAQ,UAAU,8BAA8B,YAAY;CAC7D;AACD"}
1
+ {"version":3,"file":"config-types-YRGsoUT7.mjs","names":[],"sources":["../../../../2-sql-family/2-authoring/contract-ts/dist/config-types.mjs"],"sourcesContent":["import { n as buildSqlContractFromDefinition, s as contractError, t as applySqlSpecifierControlPolicy } from \"./derived-checks-D__agoFB.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 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}\nfunction typescriptContractFromPath(contractPath, output, 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\tconst contract = mod.default ?? mod.contract;\n\t\t\t\tif (contract === void 0) throw contractError(\"CONTRACT.MODULE_EXPORT_MISSING\", `typescriptContractFromPath: module at \"${absolutePath}\" has no \"default\" or \"contract\" export.`, { meta: { path: absolutePath } });\n\t\t\t\treturn ok(options === void 0 ? contract : applySqlSpecifierControlPolicy(contract, options.defaultControlPolicy, options.createNamespace));\n\t\t\t}\n\t\t},\n\t\toutput: output ?? defaultOutputFromContractPath(contractPath)\n\t};\n}\n//#endregion\nexport { emptyContract, 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,cAAc,SAAS;CAC/B,OAAO;EACN,QAAQ;GACP,QAAQ;GACR,MAAM,YAAY;IACjB,OAAO,GAAG,+BAA+B,+BAA+B;KACvE,UAAU,KAAK;KACf,QAAQ,QAAQ;KAChB,iBAAiB,QAAQ;KACzB,QAAQ,CAAC;IACV,GAAG;KACF,GAAG;KACH,qBAAqB,KAAK;IAC3B,GAAG,qBAAqB,CAAC,CAAC,CAAC,GAAG,QAAQ,sBAAsB,QAAQ,eAAe,CAAC;GACrF;EACD;EACA,GAAG,UAAU,UAAU,QAAQ,MAAM;CACtC;AACD;AACA,SAAS,mBAAmB,UAAU,QAAQ,SAAS;CACtD,OAAO;EACN,QAAQ;GACP,QAAQ;GACR,MAAM,YAAY,GAAG,YAAY,KAAK,IAAI,WAAW,+BAA+B,UAAU,QAAQ,sBAAsB,QAAQ,eAAe,CAAC;EACrJ;EACA,GAAG,UAAU,UAAU,MAAM;CAC9B;AACD;AACA,SAAS,2BAA2B,cAAc,QAAQ,SAAS;CAClE,OAAO;EACN,QAAQ;GACP,QAAQ;GACR,QAAQ,CAAC,YAAY;GACrB,MAAM,OAAO,YAAY;IACxB,MAAM,CAAC,gBAAgB,QAAQ;IAC/B,IAAI,iBAAiB,KAAK,GAAG,MAAM,IAAI,cAAc,2HAA2H;IAChL,MAAM,MAAM,MAAM,OAAO,cAAc,YAAY,CAAC,CAAC;IACrD,MAAM,WAAW,IAAI,WAAW,IAAI;IACpC,IAAI,aAAa,KAAK,GAAG,MAAM,cAAc,kCAAkC,0CAA0C,aAAa,2CAA2C,EAAE,MAAM,EAAE,MAAM,aAAa,EAAE,CAAC;IACjN,OAAO,GAAG,YAAY,KAAK,IAAI,WAAW,+BAA+B,UAAU,QAAQ,sBAAsB,QAAQ,eAAe,CAAC;GAC1I;EACD;EACA,QAAQ,UAAU,8BAA8B,YAAY;CAC7D;AACD"}
@@ -4,7 +4,7 @@ import { n as generatedIdColumnAliases, t as GENERATED_ID_COLUMN_ALIAS_NAMESPACE
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
6
  import { n as checkSqlDefaultText, o as reservedSqlDefaultText } from "./validators-qcQteqs2.mjs";
7
- import { a as refuseTypesKey, n as buildSqlContractFromDefinition, r as contractError, s as toOneNullabilityContradictionMessage } from "./derived-checks-D__agoFB-Boa1MHcA.mjs";
7
+ import { a as refuseTypesKey, n as buildSqlContractFromDefinition, r as contractError, s as toOneNullabilityContradictionMessage } from "./derived-checks-D__agoFB-DxuPwZ7v.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";
@@ -1945,4 +1945,4 @@ function autoincrement() {
1945
1945
  //#endregion
1946
1946
  export { check as a, defineContract as c, field as d, member as f, 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 };
1947
1947
 
1948
- //# sourceMappingURL=contract-builder-Y2rB4xMf.mjs.map
1948
+ //# sourceMappingURL=contract-builder-BwPOolrg.mjs.map