@prisma/orm-family-sql 8.0.0-rc.8-dev.18 → 8.0.0-rc.8-dev.20

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 (32) hide show
  1. package/dist/{authoring-type-constructors-Blqoa2Ua-CFFAzyES.mjs → authoring-type-constructors-BD-XuavC-CB5uCmck.mjs} +9 -3
  2. package/dist/authoring-type-constructors-BD-XuavC-CB5uCmck.mjs.map +1 -0
  3. package/dist/contract-psl.mjs +1 -1
  4. package/dist/contract-psl__attribute-specs.d.mts +15 -15
  5. package/dist/contract-psl__attribute-specs.d.mts.map +1 -1
  6. package/dist/contract-psl__attribute-specs.mjs +1 -1
  7. package/dist/contract-psl__provider.mjs +1 -1
  8. package/dist/contract-psl__provider.mjs.map +1 -1
  9. package/dist/{control-DheONC4E.mjs → control-DJi35XO2.mjs} +3 -3
  10. package/dist/{control-DheONC4E.mjs.map → control-DJi35XO2.mjs.map} +1 -1
  11. package/dist/{control-CCQP4VFK.d.mts → control-_b_fvUSh.d.mts} +35 -31
  12. package/dist/control-_b_fvUSh.d.mts.map +1 -0
  13. package/dist/family.d.mts +1 -2
  14. package/dist/family.mjs +1 -1
  15. package/dist/family__control.d.mts +1 -1
  16. package/dist/family__control.mjs +1 -1
  17. package/dist/family__pack.d.mts +321 -2
  18. package/dist/family__pack.d.mts.map +1 -0
  19. package/dist/family__pack.mjs +2 -2
  20. package/dist/family__pack.mjs.map +1 -1
  21. package/dist/{interpreter-DQIdQxL1-DyNYhhep.mjs → interpreter-BPl_7Cv5-B8FaNBLQ.mjs} +3 -3
  22. package/dist/{interpreter-DQIdQxL1-DyNYhhep.mjs.map → interpreter-BPl_7Cv5-B8FaNBLQ.mjs.map} +1 -1
  23. package/dist/{sql-attribute-specs-Cr8_u9ma-ENY2C_np.mjs → sql-attribute-specs-BbZ53xbF-CiX6O5aY.mjs} +18 -25
  24. package/dist/sql-attribute-specs-BbZ53xbF-CiX6O5aY.mjs.map +1 -0
  25. package/package.json +17 -17
  26. package/dist/authoring-type-constructors-Blqoa2Ua-CFFAzyES.mjs.map +0 -1
  27. package/dist/control-CCQP4VFK.d.mts.map +0 -1
  28. package/dist/index-DrcrDbOI-BlARY_6q.d.mts +0 -536
  29. package/dist/index-DrcrDbOI-BlARY_6q.d.mts.map +0 -1
  30. package/dist/pack-Chia4J0l.d.mts +0 -317
  31. package/dist/pack-Chia4J0l.d.mts.map +0 -1
  32. package/dist/sql-attribute-specs-Cr8_u9ma-ENY2C_np.mjs.map +0 -1
@@ -1,7 +1,8 @@
1
1
  import { o as enumType } from "./contract-builder-CZSaZ6Vi.mjs";
2
2
  import { resolveEnumCodecId } from "@prisma/orm-framework/components/authoring";
3
3
  import { blindCast } from "@prisma/orm-framework/utils/casts";
4
- //#region ../../../2-sql/9-family/dist/authoring-type-constructors-Blqoa2Ua.mjs
4
+ import { blockAttribute, str } from "@prisma/orm-framework/psl-parser";
5
+ //#region ../../../2-sql/9-family/dist/authoring-type-constructors-BD-XuavC.mjs
5
6
  const sqlFamilyEntityTypes = { enum: {
6
7
  kind: "entity",
7
8
  discriminator: "enum",
@@ -112,13 +113,18 @@ const sqlFamilyEntityTypes = { enum: {
112
113
  })));
113
114
  } }
114
115
  } };
116
+ const enumTypeBlockAttribute = blockAttribute("type", { positional: [{
117
+ key: "codecId",
118
+ type: str()
119
+ }] });
115
120
  const sqlFamilyPslBlockDescriptors = { enum: {
116
121
  kind: "pslBlock",
117
122
  keyword: "enum",
118
123
  discriminator: "enum",
119
124
  name: { required: true },
120
125
  parameters: {},
121
- variadicParameters: true
126
+ variadicParameters: true,
127
+ attributes: { type: () => enumTypeBlockAttribute }
122
128
  } };
123
129
  /**
124
130
  * Family-level SQL authoring field presets.
@@ -313,4 +319,4 @@ const sqlFamilyAuthoringTypes = { sql: { String: {
313
319
  //#endregion
314
320
  export { sqlFamilyPslBlockDescriptors as i, sqlFamilyAuthoringTypes as n, sqlFamilyEntityTypes as r, sqlFamilyAuthoringFieldPresets as t };
315
321
 
316
- //# sourceMappingURL=authoring-type-constructors-Blqoa2Ua-CFFAzyES.mjs.map
322
+ //# sourceMappingURL=authoring-type-constructors-BD-XuavC-CB5uCmck.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authoring-type-constructors-BD-XuavC-CB5uCmck.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/authoring-type-constructors-BD-XuavC.mjs"],"sourcesContent":["import { resolveEnumCodecId } from \"@internal/framework-components/authoring\";\nimport { blockAttribute, str } from \"@internal/psl-parser\";\nimport { enumType } from \"@internal/sql-contract-ts/contract-builder\";\nimport { blindCast } from \"@internal/utils/casts\";\nconst sqlFamilyEntityTypes = { enum: {\n\tkind: \"entity\",\n\tdiscriminator: \"enum\",\n\toutput: { factory: (block, ctx) => {\n\t\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\t\tconst diagnostics = ctx.diagnostics;\n\t\tconst resolved = resolveEnumCodecId(block, ctx);\n\t\tif (resolved === void 0) return;\n\t\tconst { codecId, codecSpan } = resolved;\n\t\tconst nativeType = ctx.codecLookup?.targetTypesFor(codecId)?.[0];\n\t\tif (nativeType === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type references unknown codec \"${codecId}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst codec = ctx.codecLookup?.get(codecId);\n\t\tif (codec === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type codec \"${codecId}\" resolves in targetTypesFor but is absent from codecLookup.get`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst seenValues = /* @__PURE__ */ new Set();\n\t\tconst members = [];\n\t\tlet memberError = false;\n\t\tfor (const [memberName, paramValue] of Object.entries(block.parameters)) {\n\t\t\tlet value;\n\t\t\tif (paramValue.kind === \"bare\") try {\n\t\t\t\tvalue = codec.decodeJson(memberName);\n\t\t\t} catch {\n\t\t\t\tdiagnostics?.push({\n\t\t\t\t\tcode: \"PSL_ENUM_BARE_MEMBER_NON_STRING_CODEC\",\n\t\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" has no value and codec \"${codecId}\" does not accept a bare name as input`,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tspan: paramValue.span\n\t\t\t\t});\n\t\t\t\tmemberError = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse if (paramValue.kind === \"value\") {\n\t\t\t\tlet jsonValue;\n\t\t\t\ttry {\n\t\t\t\t\tjsonValue = JSON.parse(paramValue.raw);\n\t\t\t\t} catch {\n\t\t\t\t\tdiagnostics?.push({\n\t\t\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" value \"${paramValue.raw}\" is not valid JSON`,\n\t\t\t\t\t\tsourceId,\n\t\t\t\t\t\tspan: paramValue.span\n\t\t\t\t\t});\n\t\t\t\t\tmemberError = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tvalue = codec.decodeJson(blindCast(jsonValue));\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconst reason = err instanceof Error ? err.message : String(err);\n\t\t\t\t\tdiagnostics?.push({\n\t\t\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" was rejected by codec \"${codecId}\": ${reason}`,\n\t\t\t\t\t\tsourceId,\n\t\t\t\t\t\tspan: paramValue.span\n\t\t\t\t\t});\n\t\t\t\t\tmemberError = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else continue;\n\t\t\tconst valueKey = String(value);\n\t\t\tif (seenValues.has(valueKey)) {\n\t\t\t\tdiagnostics?.push({\n\t\t\t\t\tcode: \"PSL_ENUM_DUPLICATE_MEMBER_VALUE\",\n\t\t\t\t\tmessage: `enum \"${block.name}\": duplicate member value \"${valueKey}\"`,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tspan: paramValue.span\n\t\t\t\t});\n\t\t\t\tmemberError = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tseenValues.add(valueKey);\n\t\t\tmembers.push({\n\t\t\t\tname: memberName,\n\t\t\t\tvalue\n\t\t\t});\n\t\t}\n\t\tif (memberError) return void 0;\n\t\tif (members.length === 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_ENUM_MISSING_TYPE\",\n\t\t\t\tmessage: `enum \"${block.name}\" must have at least one member`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: block.span\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\treturn enumType(block.name, {\n\t\t\tcodecId,\n\t\t\tnativeType\n\t\t}, ...members.map((m) => ({\n\t\t\tname: m.name,\n\t\t\tvalue: m.value\n\t\t})));\n\t} }\n} };\nconst enumTypeBlockAttribute = blockAttribute(\"type\", { positional: [{\n\tkey: \"codecId\",\n\ttype: str()\n}] });\nconst sqlFamilyPslBlockDescriptors = { enum: {\n\tkind: \"pslBlock\",\n\tkeyword: \"enum\",\n\tdiscriminator: \"enum\",\n\tname: { required: true },\n\tparameters: {},\n\tvariadicParameters: true,\n\tattributes: { type: () => enumTypeBlockAttribute }\n} };\n//#endregion\n//#region src/core/authoring-field-presets.ts\n/**\n* Family-level SQL authoring field presets.\n*\n* Only presets whose codec IDs align with the ID generator metadata live here\n* (see `@internal/ids`). These presets are target-agnostic because the\n* generator metadata fixes their codec/native-type to `sql/char@1`\n* (`character`) regardless of target, and the PSL interpreter lets the\n* generator override the scalar descriptor.\n*\n* The `uuidString` / `id.uuidv4String` / `id.uuidv7String` presets store UUID\n* values as `character(36)` — portable across all SQL targets. For a native\n* Postgres `uuid` column use `uuidNative` / `id.uuidv4Native` /\n* `id.uuidv7Native` from `@internal/target-postgres`.\n*\n* Scalar presets that map to target-specific codecs (e.g. `text`, `int`,\n* `boolean`, `dateTime`) are contributed by the target pack (see\n* `postgresAuthoringFieldPresets` in `@internal/target-postgres`) so the\n* TS callback surface and the PSL scalar surface lower to byte-identical\n* contracts for the active target.\n*/\nconst CHARACTER_CODEC_ID = \"sql/char@1\";\nconst CHARACTER_NATIVE_TYPE = \"character\";\nconst nanoidOptionsArgument = {\n\tkind: \"object\",\n\toptional: true,\n\tproperties: { size: {\n\t\tkind: \"number\",\n\t\toptional: true,\n\t\tinteger: true,\n\t\tminimum: 2,\n\t\tmaximum: 255\n\t} }\n};\nconst sqlFamilyAuthoringFieldPresets = {\n\tuuidString: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 36 }\n\t\t}\n\t},\n\tulid: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 26 }\n\t\t}\n\t},\n\tnanoid: {\n\t\tkind: \"fieldPreset\",\n\t\targs: [nanoidOptionsArgument],\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0,\n\t\t\t\tpath: [\"size\"],\n\t\t\t\tdefault: 21\n\t\t\t} }\n\t\t}\n\t},\n\tcuid2: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 24 }\n\t\t}\n\t},\n\tksuid: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 27 }\n\t\t}\n\t},\n\tid: {\n\t\tuuidv4String: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 36 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv4\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tuuidv7String: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 36 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv7\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tulid: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 26 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"ulid\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tnanoid: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\targs: [nanoidOptionsArgument],\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: {\n\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\tindex: 0,\n\t\t\t\t\tpath: [\"size\"],\n\t\t\t\t\tdefault: 21\n\t\t\t\t} },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"nanoid\",\n\t\t\t\t\tparams: { size: {\n\t\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\t\tindex: 0,\n\t\t\t\t\t\tpath: [\"size\"]\n\t\t\t\t\t} }\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tcuid2: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 24 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"cuid2\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tksuid: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 27 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"ksuid\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t}\n\t}\n};\n//#endregion\n//#region src/core/authoring-type-constructors.ts\nconst sqlFamilyAuthoringTypes = { sql: { String: {\n\tkind: \"typeConstructor\",\n\targs: [{\n\t\tkind: \"number\",\n\t\tname: \"length\",\n\t\tinteger: true,\n\t\tminimum: 1,\n\t\tmaximum: 10485760\n\t}],\n\toutput: {\n\t\tcodecId: \"sql/varchar@1\",\n\t\tnativeType: \"character varying\",\n\t\ttypeParams: { length: {\n\t\t\tkind: \"arg\",\n\t\t\tindex: 0\n\t\t} }\n\t}\n} } };\n//#endregion\nexport { sqlFamilyPslBlockDescriptors as i, sqlFamilyAuthoringFieldPresets as n, sqlFamilyEntityTypes as r, sqlFamilyAuthoringTypes as t };\n\n//# sourceMappingURL=authoring-type-constructors-BD-XuavC.mjs.map"],"mappings":";;;;;AAIA,MAAM,uBAAuB,EAAE,MAAM;CACpC,MAAM;CACN,eAAe;CACf,QAAQ,EAAE,UAAU,OAAO,QAAQ;EAClC,MAAM,WAAW,IAAI,YAAY;EACjC,MAAM,cAAc,IAAI;EACxB,MAAM,WAAW,mBAAmB,OAAO,GAAG;EAC9C,IAAI,aAAa,KAAK,GAAG;EACzB,MAAM,EAAE,SAAS,cAAc;EAC/B,MAAM,aAAa,IAAI,aAAa,eAAe,OAAO,CAAC,GAAG;EAC9D,IAAI,eAAe,KAAK,GAAG;GAC1B,aAAa,KAAK;IACjB,MAAM;IACN,SAAS,SAAS,MAAM,KAAK,qCAAqC,QAAQ;IAC1E;IACA,MAAM;GACP,CAAC;GACD;EACD;EACA,MAAM,QAAQ,IAAI,aAAa,IAAI,OAAO;EAC1C,IAAI,UAAU,KAAK,GAAG;GACrB,aAAa,KAAK;IACjB,MAAM;IACN,SAAS,SAAS,MAAM,KAAK,kBAAkB,QAAQ;IACvD;IACA,MAAM;GACP,CAAC;GACD;EACD;EACA,MAAM,6BAA6B,IAAI,IAAI;EAC3C,MAAM,UAAU,CAAC;EACjB,IAAI,cAAc;EAClB,KAAK,MAAM,CAAC,YAAY,eAAe,OAAO,QAAQ,MAAM,UAAU,GAAG;GACxE,IAAI;GACJ,IAAI,WAAW,SAAS,QAAQ,IAAI;IACnC,QAAQ,MAAM,WAAW,UAAU;GACpC,QAAQ;IACP,aAAa,KAAK;KACjB,MAAM;KACN,SAAS,SAAS,MAAM,KAAK,YAAY,WAAW,4BAA4B,QAAQ;KACxF;KACA,MAAM,WAAW;IAClB,CAAC;IACD,cAAc;IACd;GACD;QACK,IAA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lContract } from "./interpreter-DQIdQxL1-DyNYhhep.mjs";
1
+ import { t as interpretPslDocumentToSqlContract } from "./interpreter-BPl_7Cv5-B8FaNBLQ.mjs";
2
2
  export { interpretPslDocumentToSqlContract };
@@ -1,4 +1,4 @@
1
- import { AttributeSpec, FieldAttributeSpecContext, TypedFuncCall } from "@prisma/orm-framework/psl-parser";
1
+ import { AttributeSpec, FieldAttributeCtx, FieldAttributeSpecContext, ModelAttributeCtx, TypedFuncCall } from "@prisma/orm-framework/psl-parser";
2
2
  import "@prisma/orm-framework/components/control";
3
3
  import "@prisma/orm-framework/components/psl-ast";
4
4
  //#region ../../../2-sql/2-authoring/contract-psl/dist/attribute-specs.d.mts
@@ -6,20 +6,20 @@ import "@prisma/orm-framework/components/psl-ast";
6
6
  type DefaultArgValue = string | number | boolean | (string | number | boolean)[] | TypedFuncCall;
7
7
  declare function defaultFieldSpec(ctx: FieldAttributeSpecContext): AttributeSpec<{
8
8
  value: DefaultArgValue;
9
- }>;
9
+ }, FieldAttributeCtx>;
10
10
  declare const sqlAttributeSpecs: {
11
11
  readonly model: {
12
12
  readonly map: () => AttributeSpec<{
13
13
  name: string;
14
- }>;
14
+ }, ModelAttributeCtx>;
15
15
  readonly id: () => AttributeSpec<{
16
16
  fields: string[];
17
17
  readonly map?: string;
18
- }>;
18
+ }, ModelAttributeCtx>;
19
19
  readonly unique: () => AttributeSpec<{
20
20
  fields: string[];
21
21
  readonly map?: string;
22
- }>;
22
+ }, ModelAttributeCtx>;
23
23
  readonly index: () => AttributeSpec<{
24
24
  fields?: string[];
25
25
  readonly expression?: string;
@@ -29,37 +29,37 @@ declare const sqlAttributeSpecs: {
29
29
  readonly map?: string;
30
30
  readonly type?: string;
31
31
  readonly options?: Record<string, string>;
32
- }>;
32
+ }, ModelAttributeCtx>;
33
33
  readonly check: () => AttributeSpec<{
34
34
  readonly expression: string;
35
35
  readonly name?: string;
36
36
  readonly map?: string;
37
- }>;
37
+ }, ModelAttributeCtx>;
38
38
  readonly control: () => AttributeSpec<{
39
39
  policy: "managed" | "tolerated" | "external" | "observed";
40
- }>;
40
+ }, ModelAttributeCtx>;
41
41
  readonly discriminator: () => AttributeSpec<{
42
42
  field: string;
43
- }>;
43
+ }, ModelAttributeCtx>;
44
44
  readonly base: () => AttributeSpec<{
45
45
  base: string;
46
46
  value: string;
47
- }>;
47
+ }, ModelAttributeCtx>;
48
48
  };
49
49
  readonly field: {
50
50
  readonly map: () => AttributeSpec<{
51
51
  name: string;
52
- }>;
52
+ }, FieldAttributeCtx>;
53
53
  readonly id: () => AttributeSpec<{
54
54
  readonly map?: string;
55
- }>;
55
+ }, FieldAttributeCtx>;
56
56
  readonly unique: () => AttributeSpec<{
57
57
  readonly map?: string;
58
- }>;
58
+ }, FieldAttributeCtx>;
59
59
  readonly noCheck: () => AttributeSpec<{
60
60
  first?: "membership" | "elementNotNull";
61
61
  second?: "membership" | "elementNotNull";
62
- }>;
62
+ }, FieldAttributeCtx>;
63
63
  readonly relation: () => AttributeSpec<{
64
64
  name?: string;
65
65
  readonly fields?: string[];
@@ -68,7 +68,7 @@ declare const sqlAttributeSpecs: {
68
68
  readonly onDelete?: "NoAction" | "Restrict" | "Cascade" | "SetNull" | "SetDefault";
69
69
  readonly onUpdate?: "NoAction" | "Restrict" | "Cascade" | "SetNull" | "SetDefault";
70
70
  readonly index?: boolean;
71
- }>;
71
+ }, FieldAttributeCtx>;
72
72
  readonly default: typeof defaultFieldSpec;
73
73
  };
74
74
  };
@@ -1 +1 @@
1
- {"version":3,"file":"contract-psl__attribute-specs.d.mts","names":[],"sources":["../../../../2-sql/2-authoring/contract-psl/dist/attribute-specs.d.mts"],"mappings":";;;;;KAMK,8EAA8E;iBAClE,iBAAiB,KAAK,4BAA4B;EACjE,OAAO;;cAEK;WACH;aACE,WAAW;MAClB;;aAEO,UAAU;MACjB;eACS;;aAEF,cAAc;MACrB;eACS;;aAEF,aAAa;MACpB;eACS;eACA;eACA;eACA;eACA;eACA;eACA,UAAU;;aAEZ,aAAa;eACX;eACA;eACA;;aAEF,eAAe;MACtB;;aAEO,qBAAqB;MAC5B;;aAEO,YAAY;MACnB;MACA;;;WAGK;aACE,WAAW;MAClB;;aAEO,UAAU;eACR;;aAEF,cAAc;eACZ;;aAEF,eAAe;MACtB;MACA;;aAEO,gBAAgB;MACvB;eACS;eACA;eACA;eACA;eACA;eACA;;aAEF,gBAAgB"}
1
+ {"version":3,"file":"contract-psl__attribute-specs.d.mts","names":[],"sources":["../../../../2-sql/2-authoring/contract-psl/dist/attribute-specs.d.mts"],"mappings":";;;;;KAMK,8EAA8E;iBAClE,iBAAiB,KAAK,4BAA4B;EACjE,OAAO;GACN;cACW;WACH;aACE,WAAW;MAClB;OACC;aACM,UAAU;MACjB;eACS;OACR;aACM,cAAc;MACrB;eACS;OACR;aACM,aAAa;MACpB;eACS;eACA;eACA;eACA;eACA;eACA;eACA,UAAU;OAClB;aACM,aAAa;eACX;eACA;eACA;OACR;aACM,eAAe;MACtB;OACC;aACM,qBAAqB;MAC5B;OACC;aACM,YAAY;MACnB;MACA;OACC;;WAEI;aACE,WAAW;MAClB;OACC;aACM,UAAU;eACR;OACR;aACM,cAAc;eACZ;OACR;aACM,eAAe;MACtB;MACA;OACC;aACM,gBAAgB;MACvB;eACS;eACA;eACA;eACA;eACA;eACA;OACR;aACM,gBAAgB"}
@@ -1,2 +1,2 @@
1
- import { s as sqlAttributeSpecs } from "./sql-attribute-specs-Cr8_u9ma-ENY2C_np.mjs";
1
+ import { s as sqlAttributeSpecs } from "./sql-attribute-specs-BbZ53xbF-CiX6O5aY.mjs";
2
2
  export { sqlAttributeSpecs };
@@ -1,5 +1,5 @@
1
1
  import { t as applySqlSpecifierControlPolicy } from "./derived-checks-BzL102Q0-0nIMlEux.mjs";
2
- import { t as interpretPslDocumentToSqlContract } from "./interpreter-DQIdQxL1-DyNYhhep.mjs";
2
+ import { t as interpretPslDocumentToSqlContract } from "./interpreter-BPl_7Cv5-B8FaNBLQ.mjs";
3
3
  import { collectScalarTypeConstructors } from "@prisma/orm-framework/components/authoring";
4
4
  import { InternalError } from "@prisma/orm-framework/utils/internal-error";
5
5
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
@@ -1 +1 @@
1
- {"version":3,"file":"contract-psl__provider.mjs","names":[],"sources":["../../../../2-sql/2-authoring/contract-psl/dist/provider.mjs"],"sourcesContent":["import { t as interpretPslDocumentToSqlContract } from \"./interpreter-DQIdQxL1.mjs\";\nimport { buildSymbolTable, rangeToPslSpan } from \"@internal/psl-parser\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { collectScalarTypeConstructors } from \"@internal/framework-components/authoring\";\nimport { applySqlSpecifierControlPolicy } from \"@internal/sql-contract-ts/contract-builder\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { readFile } from \"node:fs/promises\";\nimport { withSeedDiagnostics } from \"@internal/psl-parser/interpret\";\nimport { parse } from \"@internal/psl-parser/syntax\";\nimport { basename, extname } from \"pathe\";\n//#region src/provider.ts\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`). The provider owns this because it is the\n* only 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\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 mapParseDiagnostics(diagnostics, sourceFile, sourceId) {\n\treturn diagnostics.map((diagnostic) => ({\n\t\tcode: diagnostic.code,\n\t\tmessage: diagnostic.message,\n\t\tsourceId,\n\t\tspan: rangeToPslSpan(diagnostic.range, sourceFile)\n\t}));\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\tsymbolTable: input.symbolTable,\n\t\t\t\t\tsourceFile: input.sourceFile,\n\t\t\t\t\tsourceId: input.sourceId,\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\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 [absoluteSchemaPath] = context.resolvedInputs;\n\t\t\t\tif (absoluteSchemaPath === void 0) throw new InternalError(\"prismaContract: context.resolvedInputs is empty. The CLI config loader should populate it positional-matched with source.inputs.\");\n\t\t\t\tlet schema;\n\t\t\t\ttry {\n\t\t\t\t\tschema = await readFile(absoluteSchemaPath, \"utf-8\");\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst message = String(error);\n\t\t\t\t\treturn notOk({\n\t\t\t\t\t\tsummary: `Failed to read Prisma schema at \"${schemaPath}\"`,\n\t\t\t\t\t\tdiagnostics: [{\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: schemaPath\n\t\t\t\t\t\t}],\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tschemaPath,\n\t\t\t\t\t\t\tabsoluteSchemaPath,\n\t\t\t\t\t\t\tcause: message\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tconst { document, sourceFile, diagnostics: parseDiagnostics } = parse(schema);\n\t\t\t\tconst { table: symbolTable, diagnostics: symbolTableDiagnostics } = buildSymbolTable({\n\t\t\t\t\tdocument,\n\t\t\t\t\tsourceFile,\n\t\t\t\t\tpslBlockDescriptors: context.authoringContributions.pslBlockDescriptors\n\t\t\t\t});\n\t\t\t\tconst seedDiagnostics = [...mapParseDiagnostics(parseDiagnostics, sourceFile, schemaPath), ...mapParseDiagnostics(symbolTableDiagnostics, sourceFile, schemaPath)];\n\t\t\t\tconst interpreted = withSeedDiagnostics(this.interpret({\n\t\t\t\t\tdocument,\n\t\t\t\t\tsourceFile,\n\t\t\t\t\tsymbolTable,\n\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t}, context), seedDiagnostics);\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,4BAA4B,YAAY;CAChD,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,oBAAoB,aAAa,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AAE,OAAO,aAAa,aAAa,2BAA2B,iBAAiB;KACpF;KACA;KACA,qBAAqB,QAAQ,uBAAuB;IACrD,CAAC;IACD,MAAM,kBAAkB,CAAC,GAAG,oBAAoB,kBAAkB,YAAY,UAAU,GAAG,GAAG,oBAAoB,wBAAwB,YAAY,UAAU,CAAC;IACjK,MAAM,cAAc,oBAAoB,KAAK,UAAU;KACtD;KACA;KACA;KACA,UAAU;IACX,GAAG,OAAO,GAAG,eAAe;IAC5B,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 { t as interpretPslDocumentToSqlContract } from \"./interpreter-BPl_7Cv5.mjs\";\nimport { buildSymbolTable, rangeToPslSpan } from \"@internal/psl-parser\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { collectScalarTypeConstructors } from \"@internal/framework-components/authoring\";\nimport { applySqlSpecifierControlPolicy } from \"@internal/sql-contract-ts/contract-builder\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { readFile } from \"node:fs/promises\";\nimport { withSeedDiagnostics } from \"@internal/psl-parser/interpret\";\nimport { parse } from \"@internal/psl-parser/syntax\";\nimport { basename, extname } from \"pathe\";\n//#region src/provider.ts\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`). The provider owns this because it is the\n* only 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\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 mapParseDiagnostics(diagnostics, sourceFile, sourceId) {\n\treturn diagnostics.map((diagnostic) => ({\n\t\tcode: diagnostic.code,\n\t\tmessage: diagnostic.message,\n\t\tsourceId,\n\t\tspan: rangeToPslSpan(diagnostic.range, sourceFile)\n\t}));\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\tsymbolTable: input.symbolTable,\n\t\t\t\t\tsourceFile: input.sourceFile,\n\t\t\t\t\tsourceId: input.sourceId,\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\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 [absoluteSchemaPath] = context.resolvedInputs;\n\t\t\t\tif (absoluteSchemaPath === void 0) throw new InternalError(\"prismaContract: context.resolvedInputs is empty. The CLI config loader should populate it positional-matched with source.inputs.\");\n\t\t\t\tlet schema;\n\t\t\t\ttry {\n\t\t\t\t\tschema = await readFile(absoluteSchemaPath, \"utf-8\");\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst message = String(error);\n\t\t\t\t\treturn notOk({\n\t\t\t\t\t\tsummary: `Failed to read Prisma schema at \"${schemaPath}\"`,\n\t\t\t\t\t\tdiagnostics: [{\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: schemaPath\n\t\t\t\t\t\t}],\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tschemaPath,\n\t\t\t\t\t\t\tabsoluteSchemaPath,\n\t\t\t\t\t\t\tcause: message\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tconst { document, sourceFile, diagnostics: parseDiagnostics } = parse(schema);\n\t\t\t\tconst { table: symbolTable, diagnostics: symbolTableDiagnostics } = buildSymbolTable({\n\t\t\t\t\tdocument,\n\t\t\t\t\tsourceFile,\n\t\t\t\t\tpslBlockDescriptors: context.authoringContributions.pslBlockDescriptors\n\t\t\t\t});\n\t\t\t\tconst seedDiagnostics = [...mapParseDiagnostics(parseDiagnostics, sourceFile, schemaPath), ...mapParseDiagnostics(symbolTableDiagnostics, sourceFile, schemaPath)];\n\t\t\t\tconst interpreted = withSeedDiagnostics(this.interpret({\n\t\t\t\t\tdocument,\n\t\t\t\t\tsourceFile,\n\t\t\t\t\tsymbolTable,\n\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t}, context), seedDiagnostics);\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.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AkI;IAC7L,IAAI;IACJ,IAAI;KACH,SAAS,MAAM,SAAS,oBAAoB,OAAO;IACpD,SAAS,OAAO;KACf,MAAM,UAAU,OAAO,KAAK;KAC5B,OAAO,MAAM;MACZ,SAAS,oCAAoC,WAAW;MACxD,aAAa,CAAC;OACb,MAAM;OACN;OACA,UAAU;MACX,CAAC;MACD,MAAM;OACL;OACA;OACA,OAAO;MACR;KACD,CAAC;IACF;IACA,MAAM,EAAE,UAAU,YAAY,aAAa,qBAAqB,MAAM,MAAM;IAC5E,MAAM,EAAE,OAAO,aAAa,aAAa,2BAA2B,iBAAiB;KACpF;KACA;KACA,qBAAqB,QAAQ,uBAAuB;IACrD,CAAC;IACD,MAAM,kBAAkB,CAAC,GAAG,oBAAoB,kBAAkB,YAAY,UAAU,GAAG,GAAG,oBAAoB,wBAAwB,YAAY,UAAU,CAAC;IACjK,MAAM,cAAc,oBAAoB,KAAK,UAAU;KACtD;KACA;KACA;KACA,UAAU;IACX,GAAG,OAAO,GAAG,eAAe;IAC5B,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"}
@@ -3,9 +3,9 @@ import { t as sqlContractCanonicalizationHooks } from "./canonicalization-hooks-
3
3
  import { c as StorageTable } from "./storage-table-ZzbR-xzQ-BRoTQE_2.mjs";
4
4
  import { l as isStorageTypeInstance } from "./types-CUsJrvEl.mjs";
5
5
  import { c as SqlSchemaIR, n as RelationalSchemaNodeKind, u as SqlTableIR } from "./types-BvupgHcG-c8QDupnu.mjs";
6
- import { s as sqlAttributeSpecs } from "./sql-attribute-specs-Cr8_u9ma-ENY2C_np.mjs";
6
+ import { s as sqlAttributeSpecs } from "./sql-attribute-specs-BbZ53xbF-CiX6O5aY.mjs";
7
7
  import { t as sqlEmission } from "./dist-ZK6oeI5e.mjs";
8
- import { i as sqlFamilyPslBlockDescriptors, n as sqlFamilyAuthoringTypes, r as sqlFamilyEntityTypes, t as sqlFamilyAuthoringFieldPresets } from "./authoring-type-constructors-Blqoa2Ua-CFFAzyES.mjs";
8
+ import { i as sqlFamilyPslBlockDescriptors, n as sqlFamilyAuthoringTypes, r as sqlFamilyEntityTypes, t as sqlFamilyAuthoringFieldPresets } from "./authoring-type-constructors-BD-XuavC-CB5uCmck.mjs";
9
9
  import { n as classifyDiffSubjectGranularity, o as extractCodecControlHooks, s as verifySqlSchemaByDiff, t as classifyDiffEntityKind } from "./schema-verify-C_PEdlAr-Dxxjm6EM.mjs";
10
10
  import { t as sqlFamilyError } from "./errors-B5g0xWro-mWH2C07F.mjs";
11
11
  import { t as SqlContractSerializer } from "./sql-contract-serializer-2oBWuxTe-DKZTf2n8.mjs";
@@ -1266,4 +1266,4 @@ var control_default = new SqlFamilyDescriptor();
1266
1266
  //#endregion
1267
1267
  export { contractToSchemaIR as a, createMigrationPlan as c, partitionIssuesByControlPolicy as d, planFieldEventOperations as f, runnerSuccess as g, runnerFailure as h, contractNamespaceToSchemaIR as i, detectDestructiveChanges as l, plannerSuccess as m, assembleAuthoringContributions as n, controlPolicyForCall as o, plannerFailure as p, buildNativeTypeExpander as r, control_default as s, INIT_ADDITIVE_POLICY as t, partitionCallsByControlPolicy as u };
1268
1268
 
1269
- //# sourceMappingURL=control-DheONC4E.mjs.map
1269
+ //# sourceMappingURL=control-DJi35XO2.mjs.map