@prisma/orm-family-sql 8.0.0-rc.9-dev.1 → 8.0.0-rc.9-dev.3

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 (155) hide show
  1. package/dist/{ast-PAXgfA8z.d.mts → ast-DuLukI6f.d.mts} +3 -3
  2. package/dist/{ast-PAXgfA8z.d.mts.map → ast-DuLukI6f.d.mts.map} +1 -1
  3. package/dist/{authoring-type-constructors-BD-XuavC-CB5uCmck.mjs → authoring-type-constructors-BD-XuavC-Dh-K7Ocl.mjs} +2 -2
  4. package/dist/{authoring-type-constructors-BD-XuavC-CB5uCmck.mjs.map → authoring-type-constructors-BD-XuavC-Dh-K7Ocl.mjs.map} +1 -1
  5. package/dist/builder.d.mts +2 -2
  6. package/dist/builder__runtime.d.mts +8 -8
  7. package/dist/builder__runtime.mjs +2 -2
  8. package/dist/builder__types.d.mts +2 -2
  9. package/dist/{codec-descriptor-registry-N0dhtKaH.mjs → codec-descriptor-registry-ECZ4ohtG.mjs} +2 -2
  10. package/dist/{codec-descriptor-registry-N0dhtKaH.mjs.map → codec-descriptor-registry-ECZ4ohtG.mjs.map} +1 -1
  11. package/dist/{config-types-DHDQ3dST.mjs → config-types-AbijI3Ys.mjs} +2 -2
  12. package/dist/{config-types-DHDQ3dST.mjs.map → config-types-AbijI3Ys.mjs.map} +1 -1
  13. package/dist/{config-types-D9fdKG3g.d.mts → config-types-Bd3ud-mX.d.mts} +3 -3
  14. package/dist/{config-types-D9fdKG3g.d.mts.map → config-types-Bd3ud-mX.d.mts.map} +1 -1
  15. package/dist/{contract-builder-CZSaZ6Vi.mjs → contract-builder-DYDnIGyM.mjs} +24 -5
  16. package/dist/contract-builder-DYDnIGyM.mjs.map +1 -0
  17. package/dist/{contract-builder-CG_tGDbB.d.mts → contract-builder-De_sioHE.d.mts} +15 -3
  18. package/dist/contract-builder-De_sioHE.d.mts.map +1 -0
  19. package/dist/contract-emitter.mjs +1 -1
  20. package/dist/contract-psl.d.mts +1 -1
  21. package/dist/contract-psl.mjs +1 -1
  22. package/dist/contract-psl__provider.d.mts +1 -1
  23. package/dist/contract-psl__provider.mjs +3 -3
  24. package/dist/contract-psl__provider.mjs.map +1 -1
  25. package/dist/contract-ts.d.mts +3 -3
  26. package/dist/contract-ts.mjs +3 -3
  27. package/dist/contract-ts__config-types.d.mts +1 -1
  28. package/dist/contract-ts__config-types.mjs +1 -1
  29. package/dist/contract-ts__contract-builder.d.mts +2 -2
  30. package/dist/contract-ts__contract-builder.mjs +2 -2
  31. package/dist/contract.d.mts +3 -3
  32. package/dist/contract.mjs +3 -3
  33. package/dist/contract__types.d.mts +2 -2
  34. package/dist/contract__types.mjs +2 -2
  35. package/dist/contract__validators.d.mts +2 -2
  36. package/dist/contract__validators.mjs +2 -2
  37. package/dist/{control-DJi35XO2.mjs → control-CMYPT7Ek.mjs} +6 -6
  38. package/dist/{control-DJi35XO2.mjs.map → control-CMYPT7Ek.mjs.map} +1 -1
  39. package/dist/{control-adapter-C99J7aEF-gFfCQmwC.d.mts → control-adapter-C99J7aEF-GODO43Ai.d.mts} +5 -5
  40. package/dist/{control-adapter-C99J7aEF-gFfCQmwC.d.mts.map → control-adapter-C99J7aEF-GODO43Ai.d.mts.map} +1 -1
  41. package/dist/control-adapter-DzTFiMaG.d.mts +1 -0
  42. package/dist/{control-_b_fvUSh.d.mts → control-b-6t8eI_.d.mts} +9 -9
  43. package/dist/{control-_b_fvUSh.d.mts.map → control-b-6t8eI_.d.mts.map} +1 -1
  44. package/dist/{db-BhQdL6Za-DuaPJ5bQ.d.mts → db-BhQdL6Za-DubRGJvv.d.mts} +7 -7
  45. package/dist/{db-BhQdL6Za-DuaPJ5bQ.d.mts.map → db-BhQdL6Za-DubRGJvv.d.mts.map} +1 -1
  46. package/dist/{ddl-types-CXx4vPz6-BsgrnSUY.d.mts → ddl-types-CXx4vPz6-Dko-GTTj.d.mts} +3 -3
  47. package/dist/{ddl-types-CXx4vPz6-BsgrnSUY.d.mts.map → ddl-types-CXx4vPz6-Dko-GTTj.d.mts.map} +1 -1
  48. package/dist/{derived-checks-DPdD01O0-DGqOFjs6.d.mts → derived-checks-DPdD01O0-DNBs1ZDA.d.mts} +2 -2
  49. package/dist/{derived-checks-DPdD01O0-DGqOFjs6.d.mts.map → derived-checks-DPdD01O0-DNBs1ZDA.d.mts.map} +1 -1
  50. package/dist/{derived-checks-BzL102Q0-0nIMlEux.mjs → derived-checks-D_-1X7be-lGe8VdId.mjs} +37 -7
  51. package/dist/derived-checks-D_-1X7be-lGe8VdId.mjs.map +1 -0
  52. package/dist/{diff-ClD1mImE.d.mts → diff-CN1ou7vM.d.mts} +5 -5
  53. package/dist/{diff-ClD1mImE.d.mts.map → diff-CN1ou7vM.d.mts.map} +1 -1
  54. package/dist/{dist-ZK6oeI5e.mjs → dist-D5__KJs-.mjs} +2 -1
  55. package/dist/dist-D5__KJs-.mjs.map +1 -0
  56. package/dist/{expression-DmQbErXU.mjs → expression-B2Ox7zKM.mjs} +2 -2
  57. package/dist/{expression-DmQbErXU.mjs.map → expression-B2Ox7zKM.mjs.map} +1 -1
  58. package/dist/{expression-PL-Tra28.d.mts → expression-mku9I7Ue.d.mts} +5 -5
  59. package/dist/{expression-PL-Tra28.d.mts.map → expression-mku9I7Ue.d.mts.map} +1 -1
  60. package/dist/family.d.mts +9 -9
  61. package/dist/family.mjs +3 -3
  62. package/dist/family__control-adapter.d.mts +2 -2
  63. package/dist/family__control.d.mts +3 -3
  64. package/dist/family__control.mjs +2 -2
  65. package/dist/family__diff.d.mts +2 -2
  66. package/dist/family__diff.mjs +1 -1
  67. package/dist/family__ir.d.mts +1 -1
  68. package/dist/family__ir.mjs +1 -1
  69. package/dist/family__migration.d.mts +1 -1
  70. package/dist/family__pack.mjs +1 -1
  71. package/dist/family__runtime.d.mts +1 -1
  72. package/dist/{index-C5I8D-MB.d.mts → index-CLAshwKN.d.mts} +2 -2
  73. package/dist/{index-C5I8D-MB.d.mts.map → index-CLAshwKN.d.mts.map} +1 -1
  74. package/dist/{index-CrsJm0Rv.d.mts → index-DzBzeTAy.d.mts} +10 -10
  75. package/dist/{index-CrsJm0Rv.d.mts.map → index-DzBzeTAy.d.mts.map} +1 -1
  76. package/dist/{interpreter-BPl_7Cv5-B8FaNBLQ.mjs → interpreter-_KWQDsAm-B2goMgB0.mjs} +53 -7
  77. package/dist/interpreter-_KWQDsAm-B2goMgB0.mjs.map +1 -0
  78. package/dist/ir-I-xciGUH.mjs.map +1 -1
  79. package/dist/{ir-Bghjt-FG.d.mts → ir-R9GE8gsm.d.mts} +2 -2
  80. package/dist/{ir-Bghjt-FG.d.mts.map → ir-R9GE8gsm.d.mts.map} +1 -1
  81. package/dist/{middleware-AhTz1BOW-th-Suxuf.d.mts → middleware-AhTz1BOW-CtQWS4mb.d.mts} +2 -2
  82. package/dist/{middleware-AhTz1BOW-th-Suxuf.d.mts.map → middleware-AhTz1BOW-CtQWS4mb.d.mts.map} +1 -1
  83. package/dist/middleware-Cev-ZFyS.d.mts +1 -0
  84. package/dist/{migration-Chb4Qg0T.d.mts → migration-Bhce5i_m.d.mts} +3 -3
  85. package/dist/{migration-Chb4Qg0T.d.mts.map → migration-Bhce5i_m.d.mts.map} +1 -1
  86. package/dist/operations.d.mts +1 -1
  87. package/dist/orm-client.d.mts +49 -57
  88. package/dist/orm-client.d.mts.map +1 -1
  89. package/dist/orm-client.mjs +26 -69
  90. package/dist/orm-client.mjs.map +1 -1
  91. package/dist/plan-C7VP7jOh.d.mts +2 -0
  92. package/dist/{plan-CDxduYaN-pLIyyJaB.d.mts → plan-CDxduYaN-B2kMLIQQ.d.mts} +3 -3
  93. package/dist/{plan-CDxduYaN-pLIyyJaB.d.mts.map → plan-CDxduYaN-B2kMLIQQ.d.mts.map} +1 -1
  94. package/dist/{prepared-statement-9QpkE6JG-ti591XdQ.d.mts → prepared-statement-9QpkE6JG-B9xqBu5T.d.mts} +16 -16
  95. package/dist/{prepared-statement-9QpkE6JG-ti591XdQ.d.mts.map → prepared-statement-9QpkE6JG-B9xqBu5T.d.mts.map} +1 -1
  96. package/dist/query-lane-context-CGdMIEuv.d.mts +1 -0
  97. package/dist/{query-lane-context-Qa-eddrE-kuZ8Z86-.d.mts → query-lane-context-Qa-eddrE-BQV6J9nV.d.mts} +4 -4
  98. package/dist/{query-lane-context-Qa-eddrE-kuZ8Z86-.d.mts.map → query-lane-context-Qa-eddrE-BQV6J9nV.d.mts.map} +1 -1
  99. package/dist/relational-core.d.mts +11 -11
  100. package/dist/relational-core.mjs +1 -1
  101. package/dist/relational-core__aggregate-descriptor-registry.d.mts +1 -1
  102. package/dist/relational-core__ast.d.mts +3 -3
  103. package/dist/relational-core__codec-descriptor-registry.d.mts +3 -3
  104. package/dist/relational-core__codec-descriptor-registry.mjs +1 -1
  105. package/dist/relational-core__contract-free.d.mts +3 -3
  106. package/dist/relational-core__expression.d.mts +1 -1
  107. package/dist/relational-core__expression.mjs +1 -1
  108. package/dist/relational-core__middleware.d.mts +2 -2
  109. package/dist/relational-core__plan.d.mts +3 -3
  110. package/dist/relational-core__query-lane-context.d.mts +2 -2
  111. package/dist/relational-core__types.d.mts +2 -2
  112. package/dist/{runtime-C88G8y1X.d.mts → runtime-CzCx0TKe.d.mts} +3 -3
  113. package/dist/{runtime-C88G8y1X.d.mts.map → runtime-CzCx0TKe.d.mts.map} +1 -1
  114. package/dist/runtime.d.mts +4 -4
  115. package/dist/runtime.mjs +2 -2
  116. package/dist/runtime__internal__prepared-query.d.mts +1 -1
  117. package/dist/{schema-differ-DpG_gnur-DFAtGezx.d.mts → schema-differ-DpG_gnur-BICVtTHY.d.mts} +2 -2
  118. package/dist/{schema-differ-DpG_gnur-DFAtGezx.d.mts.map → schema-differ-DpG_gnur-BICVtTHY.d.mts.map} +1 -1
  119. package/dist/{schema-verify-C_PEdlAr-Dxxjm6EM.mjs → schema-verify-C_PEdlAr-CmXrFuW1.mjs} +2 -2
  120. package/dist/{schema-verify-C_PEdlAr-Dxxjm6EM.mjs.map → schema-verify-C_PEdlAr-CmXrFuW1.mjs.map} +1 -1
  121. package/dist/{sql-contract-serializer-2oBWuxTe-DKZTf2n8.mjs → sql-contract-serializer-Bxu4a5oQ-D0lKpb4a.mjs} +24 -5
  122. package/dist/sql-contract-serializer-Bxu4a5oQ-D0lKpb4a.mjs.map +1 -0
  123. package/dist/{sql-execution-plan--jKyLpe5-CMGhgO0M.d.mts → sql-execution-plan--jKyLpe5-Bcz9QM2s.d.mts} +2 -2
  124. package/dist/{sql-execution-plan--jKyLpe5-CMGhgO0M.d.mts.map → sql-execution-plan--jKyLpe5-Bcz9QM2s.d.mts.map} +1 -1
  125. package/dist/{types-UcHa2cTe.d.mts → types-C36_3E6_.d.mts} +3 -2
  126. package/dist/types-C36_3E6_.d.mts.map +1 -0
  127. package/dist/{types-CyxGtOOh-BggSa6Fe.d.mts → types-CyxGtOOh-BJnoWm0f.d.mts} +8 -8
  128. package/dist/{types-CyxGtOOh-BggSa6Fe.d.mts.map → types-CyxGtOOh-BJnoWm0f.d.mts.map} +1 -1
  129. package/dist/{types-CUsJrvEl.mjs → types-D0B65hip.mjs} +3 -2
  130. package/dist/types-D0B65hip.mjs.map +1 -0
  131. package/dist/types-DvsoMNLs.d.mts +1 -0
  132. package/dist/{types-IqZMLrFC-BfiR0oFc.d.mts → types-IqZMLrFC-BIRftuU7.d.mts} +4 -4
  133. package/dist/{types-IqZMLrFC-BfiR0oFc.d.mts.map → types-IqZMLrFC-BIRftuU7.d.mts.map} +1 -1
  134. package/dist/{types-v3qxLLxo-DCeKv7yY.d.mts → types-v3qxLLxo-Clw_yBAh.d.mts} +2 -2
  135. package/dist/{types-v3qxLLxo-DCeKv7yY.d.mts.map → types-v3qxLLxo-Clw_yBAh.d.mts.map} +1 -1
  136. package/dist/{validators-Belo8QqM.d.mts → validators-CbqMxQfW.d.mts} +23 -4
  137. package/dist/validators-CbqMxQfW.d.mts.map +1 -0
  138. package/dist/{validators-CrWD6bSP.mjs → validators-DD98VrpC.mjs} +0 -0
  139. package/dist/validators-DD98VrpC.mjs.map +1 -0
  140. package/package.json +17 -17
  141. package/dist/contract-builder-CG_tGDbB.d.mts.map +0 -1
  142. package/dist/contract-builder-CZSaZ6Vi.mjs.map +0 -1
  143. package/dist/control-adapter-D-2mthVg.d.mts +0 -1
  144. package/dist/derived-checks-BzL102Q0-0nIMlEux.mjs.map +0 -1
  145. package/dist/dist-ZK6oeI5e.mjs.map +0 -1
  146. package/dist/interpreter-BPl_7Cv5-B8FaNBLQ.mjs.map +0 -1
  147. package/dist/middleware--TtoxUiW.d.mts +0 -1
  148. package/dist/plan-BHLdb0Z7.d.mts +0 -2
  149. package/dist/query-lane-context-XMvk7fmY.d.mts +0 -1
  150. package/dist/sql-contract-serializer-2oBWuxTe-DKZTf2n8.mjs.map +0 -1
  151. package/dist/types-B0msOnBM.d.mts +0 -1
  152. package/dist/types-CUsJrvEl.mjs.map +0 -1
  153. package/dist/types-UcHa2cTe.d.mts.map +0 -1
  154. package/dist/validators-Belo8QqM.d.mts.map +0 -1
  155. package/dist/validators-CrWD6bSP.mjs.map +0 -1
@@ -1,6 +1,6 @@
1
- import { m as AnyQueryAst, p as AnyParamRef, ut as LoweredStatement } from "./types-v3qxLLxo-DCeKv7yY.mjs";
1
+ import { m as AnyQueryAst, p as AnyParamRef, ut as LoweredStatement } from "./types-v3qxLLxo-Clw_yBAh.mjs";
2
2
  import { c as SqlQueryable } from "./driver-types-BQtRkOJ0-Bv2RPSfr.mjs";
3
- import "./ddl-types-CXx4vPz6-BsgrnSUY.mjs";
3
+ import "./ddl-types-CXx4vPz6-Dko-GTTj.mjs";
4
4
  import { ContractMarkerRecord, JsonValue } from "@prisma/orm-framework/contract/types";
5
5
  import { CodecCallContext, CodecDescriptorImpl, CodecImpl, CodecInstanceContext } from "@prisma/orm-framework/components/codec";
6
6
  import { StandardSchemaV1 } from "@standard-schema/spec";
@@ -171,4 +171,4 @@ declare function compact<T extends Record<string, unknown>>(o: T): T;
171
171
  declare function collectOrderedParamRefs(ast: AnyQueryAst): ReadonlyArray<AnyParamRef>;
172
172
  //#endregion
173
173
  export { sqlFloatDecode as A, sqlTextDecode as B, compact as C, sqlCharEncode as D, sqlCharDescriptor as E, sqlIntColumn as F, sqlVarcharDescriptor as G, sqlTextEncode as H, sqlIntDecode as I, sqlVarcharEncode as K, sqlIntDescriptor as L, sqlFloatDescriptor as M, sqlFloatEncode as N, sqlCharRenderOutputType as O, sqlFloatEncodeJson as P, sqlIntEncode as R, collectOrderedParamRefs as S, sqlCharDecode as T, sqlVarcharColumn as U, sqlTextDescriptor as V, sqlVarcharDecode as W, SqlIntDescriptor as _, LowererContext as a, SqlVarcharCodec as b, SQL_FLOAT_CODEC_ID as c, SQL_VARCHAR_CODEC_ID as d, SqlCharCodec as f, SqlIntCodec as g, SqlFloatDescriptor as h, Lowerer as i, sqlFloatDecodeJson as j, sqlFloatColumn as k, SQL_INT_CODEC_ID as l, SqlFloatCodec as m, AdapterProfile as n, MarkerReadResult as o, SqlCharDescriptor as p, sqlVarcharRenderOutputType as q, AdapterTarget as r, SQL_CHAR_CODEC_ID as s, Adapter as t, SQL_TEXT_CODEC_ID as u, SqlTextCodec as v, sqlCharColumn as w, SqlVarcharDescriptor as x, SqlTextDescriptor as y, sqlTextColumn as z };
174
- //# sourceMappingURL=ast-PAXgfA8z.d.mts.map
174
+ //# sourceMappingURL=ast-DuLukI6f.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ast-PAXgfA8z.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/ast.d.mts"],"mappings":";;;;;;;;KAOK;;;;;;;KAOA;WACM;WACA,QAAQ;;WAER;;WAEA;;UAED,eAAe,gBAAgB,gBAAgB;WAC9C;WACA,QAAQ;WACR,cAAc;;;;EAIvB,WAAW,WAAW,eAAe,QAAQ;;UAErC,eAAe;WACd,UAAU;WACV;;KAEN,QAAQ,eAAe,qBAAqB,QAAQ,qBAAqB,KAAK,KAAK,SAAS,eA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D;WACA;WACA;WACA,cAAc,iBAAiB;EACxC,iBAAiB,QAAQ;EACzB,QAAQ,SAAS,gBAAgB,KAAK,yBAAyB;;cAEnD,sBAAsB;cACtB,mBAAmB,SAAS,gEAAgE,WAAW,iBAAiB;;;iBAGrH,QAAQ,UAAU,yBAAyB,GAAG,IAAI;;;;;;;;;;;iBAWlD,wBAAwB,KAAK,cAAc,cAAc"}
@@ -1,4 +1,4 @@
1
- import { o as enumType } from "./contract-builder-CZSaZ6Vi.mjs";
1
+ import { o as enumType } from "./contract-builder-DYDnIGyM.mjs";
2
2
  import { resolveEnumCodecId } from "@prisma/orm-framework/components/authoring";
3
3
  import { blindCast } from "@prisma/orm-framework/utils/casts";
4
4
  import { blockAttribute, str } from "@prisma/orm-framework/psl-parser";
@@ -319,4 +319,4 @@ const sqlFamilyAuthoringTypes = { sql: { String: {
319
319
  //#endregion
320
320
  export { sqlFamilyPslBlockDescriptors as i, sqlFamilyAuthoringTypes as n, sqlFamilyEntityTypes as r, sqlFamilyAuthoringFieldPresets as t };
321
321
 
322
- //# sourceMappingURL=authoring-type-constructors-BD-XuavC-CB5uCmck.mjs.map
322
+ //# sourceMappingURL=authoring-type-constructors-BD-XuavC-Dh-K7Ocl.mjs.map
@@ -1 +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,KAA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AM;GACN,QAAQ;IACP,SAAS;IACT,YAAY;IACZ,YAAY,EAAE,QAAQ,GAAG;IACzB,mBAAmB,EAAE,UAAU;KAC9B,MAAM;KACN,IAAI;IACL,EAAE;IACF,IAAI;GACL;EACD;EACA,OAAO;GACN,MAAM;GACN,QAAQ;IACP,SAAS;IACT,YAAY;IACZ,YAAY,EAAE,QAAQ,GAAG;IACzB,mBAAmB,EAAE,UAAU;KAC9B,MAAM;KACN,IAAI;IACL,EAAE;IACF,IAAI;GACL;EACD;CACD;AACD;AAGA,MAAM,0BAA0B,EAAE,KAAK,EAAE,QAAQ;CAChD,MAAM;CACN,MAAM,CAAC;EACN,MAAM;EACN,MAAM;EACN,SAAS;EACT,SAAS;EACT,SAAS;CACV,CAAC;CACD,QAAQ;EACP,SAAS;EACT,YAAY;EACZ,YAAY,EAAE,QAAQ;GACrB,MAAM;GACN,OAAO;EACR,EAAE;CACH;AACD,EAAE,EAAE"}
1
+ {"version":3,"file":"authoring-type-constructors-BD-XuavC-Dh-K7Ocl.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,kBA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S;IACT,YAAY;IACZ,YAAY,EAAE,QAAQ,GAAG;IACzB,mBAAmB,EAAE,UAAU;KAC9B,MAAM;KACN,IAAI;IACL,EAAE;IACF,IAAI;GACL;EACD;CACD;AACD;AAGA,MAAM,0BAA0B,EAAE,KAAK,EAAE,QAAQ;CAChD,MAAM;CACN,MAAM,CAAC;EACN,MAAM;EACN,MAAM;EACN,SAAS;EACT,SAAS;EACT,SAAS;CACV,CAAC;CACD,QAAQ;EACP,SAAS;EACT,YAAY;EACZ,YAAY,EAAE,QAAQ;GACrB,MAAM;GACN,OAAO;EACR,EAAE;CACH;AACD,EAAE,EAAE"}
@@ -1,3 +1,3 @@
1
- import { o as Expression, x as ScopeField } from "./expression-PL-Tra28.mjs";
2
- import { T as WhereFilter, _ as SelectQuery, a as DeleteQuery, c as GatedMethod, f as QueryContext, g as Scope, h as ResolveRow, i as Db, l as GroupedQuery, s as Functions, t as AggregateFunctions, u as InsertQuery, v as Subquery, w as UpdateQuery, x as TableProxy } from "./db-BhQdL6Za-DuaPJ5bQ.mjs";
1
+ import { o as Expression, x as ScopeField } from "./expression-mku9I7Ue.mjs";
2
+ import { T as WhereFilter, _ as SelectQuery, a as DeleteQuery, c as GatedMethod, f as QueryContext, g as Scope, h as ResolveRow, i as Db, l as GroupedQuery, s as Functions, t as AggregateFunctions, u as InsertQuery, v as Subquery, w as UpdateQuery, x as TableProxy } from "./db-BhQdL6Za-DubRGJvv.mjs";
3
3
  export type { AggregateFunctions, Db, DeleteQuery, Expression, Functions, GatedMethod, GroupedQuery, InsertQuery, QueryContext, ResolveRow, Scope, ScopeField, SelectQuery, Subquery, TableProxy, UpdateQuery, WhereFilter };
@@ -1,12 +1,12 @@
1
1
  import { c as SqlStorage } from "./sql-storage-8LqxeLAY-DH4DdUXx.mjs";
2
- import "./types-UcHa2cTe.mjs";
3
- import { i as SqlOperationEntry } from "./index-C5I8D-MB.mjs";
4
- import { s as AnyExpression } from "./types-v3qxLLxo-DCeKv7yY.mjs";
5
- import "./ast-PAXgfA8z.mjs";
6
- import { l as RawCodecInferer, o as Expression, x as ScopeField } from "./expression-PL-Tra28.mjs";
7
- import { S as TableProxyContract, f as QueryContext, g as Scope, i as Db, o as FieldProxy, p as RawLane, s as Functions, t as AggregateFunctions } from "./db-BhQdL6Za-DuaPJ5bQ.mjs";
8
- import { c as SqlAggregateDescriptorRegistry, r as ExecutionContext } from "./query-lane-context-Qa-eddrE-kuZ8Z86-.mjs";
9
- import "./query-lane-context-XMvk7fmY.mjs";
2
+ import "./types-C36_3E6_.mjs";
3
+ import { i as SqlOperationEntry } from "./index-CLAshwKN.mjs";
4
+ import { s as AnyExpression } from "./types-v3qxLLxo-Clw_yBAh.mjs";
5
+ import "./ast-DuLukI6f.mjs";
6
+ import { l as RawCodecInferer, o as Expression, x as ScopeField } from "./expression-mku9I7Ue.mjs";
7
+ import { S as TableProxyContract, f as QueryContext, g as Scope, i as Db, o as FieldProxy, p as RawLane, s as Functions, t as AggregateFunctions } from "./db-BhQdL6Za-DubRGJvv.mjs";
8
+ import { c as SqlAggregateDescriptorRegistry, r as ExecutionContext } from "./query-lane-context-Qa-eddrE-BQV6J9nV.mjs";
9
+ import "./query-lane-context-CGdMIEuv.mjs";
10
10
  import { Contract } from "@prisma/orm-framework/contract/types";
11
11
  import { CodecRef } from "@prisma/orm-framework/components/codec";
12
12
  //#region ../../../2-sql/4-lanes/sql-builder/dist/runtime/index.d.mts
@@ -1,7 +1,7 @@
1
1
  import { C as LiteralExpr, D as OrExpr, F as SubqueryExpr, I as TableSource, L as UpdateAst, O as OrderByItem, P as SelectAst, S as ListExpression, T as NullCheckExpr, V as isAggregateFn, _ as InsertAst, c as DeleteAst, g as IdentifierRef, j as ProjectionItem, k as ParamRef, l as DerivedTableSource, n as AndExpr, o as ColumnRef, p as ExistsExpr, r as BinaryExpr, t as AggregateExpr, y as JoinAst } from "./types-Dt4e_jC--COeP8xzN.mjs";
2
2
  import { t as collectOrderedParamRefs } from "./util-DQQgv2j1-D6INZaRG.mjs";
3
- import { a as toExpr, n as codecOf, r as createRawSql } from "./expression-DmQbErXU.mjs";
4
- import { n as codecRefForStorageColumn } from "./codec-descriptor-registry-N0dhtKaH.mjs";
3
+ import { a as toExpr, n as codecOf, r as createRawSql } from "./expression-B2Ox7zKM.mjs";
4
+ import { n as codecRefForStorageColumn } from "./codec-descriptor-registry-ECZ4ohtG.mjs";
5
5
  import { assertAnnotationsApplicable } from "@prisma/orm-framework/components/runtime";
6
6
  //#region ../../../2-sql/4-lanes/sql-builder/dist/runtime/index.mjs
7
7
  /**
@@ -1,3 +1,3 @@
1
- import { o as Expression, x as ScopeField } from "./expression-PL-Tra28.mjs";
2
- import { C as UnboundTables, S as TableProxyContract, T as WhereFilter, _ as SelectQuery, a as DeleteQuery, b as TableNamesAcrossNamespaces, c as GatedMethod, d as Namespace, f as QueryContext, g as Scope, h as ResolveRow, i as Db, l as GroupedQuery, m as RawTagFor, n as BooleanCodecType, p as RawLane, r as ContractRawTag, s as Functions, t as AggregateFunctions, u as InsertQuery, v as Subquery, w as UpdateQuery, x as TableProxy, y as TableInAnyNamespace } from "./db-BhQdL6Za-DuaPJ5bQ.mjs";
1
+ import { o as Expression, x as ScopeField } from "./expression-mku9I7Ue.mjs";
2
+ import { C as UnboundTables, S as TableProxyContract, T as WhereFilter, _ as SelectQuery, a as DeleteQuery, b as TableNamesAcrossNamespaces, c as GatedMethod, d as Namespace, f as QueryContext, g as Scope, h as ResolveRow, i as Db, l as GroupedQuery, m as RawTagFor, n as BooleanCodecType, p as RawLane, r as ContractRawTag, s as Functions, t as AggregateFunctions, u as InsertQuery, v as Subquery, w as UpdateQuery, x as TableProxy, y as TableInAnyNamespace } from "./db-BhQdL6Za-DubRGJvv.mjs";
3
3
  export type { AggregateFunctions, BooleanCodecType, ContractRawTag, Db, DeleteQuery, Expression, Functions, GatedMethod, GroupedQuery, InsertQuery, Namespace, QueryContext, RawLane, RawTagFor, ResolveRow, Scope, ScopeField, SelectQuery, Subquery, TableInAnyNamespace, TableNamesAcrossNamespaces, TableProxy, TableProxyContract, UnboundTables, UpdateQuery, WhereFilter };
@@ -1,5 +1,5 @@
1
1
  import { t as resolveStorageTable } from "./resolve-storage-table-DZsfnzeW.mjs";
2
- import { l as isStorageTypeInstance } from "./types-CUsJrvEl.mjs";
2
+ import { u as isStorageTypeInstance } from "./types-D0B65hip.mjs";
3
3
  import { structuredError } from "@prisma/orm-framework/utils/structured-error";
4
4
  import { blindCast } from "@prisma/orm-framework/utils/casts";
5
5
  //#region ../../../2-sql/4-lanes/relational-core/dist/exports/codec-descriptor-registry.mjs
@@ -93,4 +93,4 @@ function buildCodecDescriptorRegistry(allDescriptors, storage) {
93
93
  //#endregion
94
94
  export { codecRefForStorageColumn as n, buildCodecDescriptorRegistry as t };
95
95
 
96
- //# sourceMappingURL=codec-descriptor-registry-N0dhtKaH.mjs.map
96
+ //# sourceMappingURL=codec-descriptor-registry-ECZ4ohtG.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"codec-descriptor-registry-N0dhtKaH.mjs","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/codec-descriptor-registry.mjs"],"sourcesContent":["import { structuredError } from \"@internal/utils/structured-error\";\nimport { resolveStorageTable } from \"@internal/sql-contract/resolve-storage-table\";\nimport { isStorageTypeInstance } from \"@internal/sql-contract/types\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/codec-ref-for-column.ts\n/**\n* Derive the canonical {@link CodecRef} for a `(table, column)` pair against a {@link SqlStorage}. This is the build-time path every column-bound `ParamRef` / `ProjectionItem` uses to stamp its `codec` slot before the AST is handed to the runtime — the runtime resolver then materialises a memoised {@link import('@internal/sql-relational-core/ast').Codec} for the same `CodecRef` via `forCodecRef`.\n*\n* Resolution rules over namespace `entries.table[table].columns[column]`:\n*\n* - `typeRef` column → `{codecId, typeParams}` from `storage.types[typeRef]` (multiple columns sharing the typeRef share one ref → one memoised codec).\n* - inline `typeParams` column → `{codecId, typeParams}` from the column itself.\n* - non-parameterized column → `{codecId}` with `typeParams` undefined.\n*\n* Returns `undefined` when the table or column is unknown, or when a `typeRef` column references a `storage.types` entry that does not exist.\n*\n* `namespaceId` leads the coordinate args and is always supplied: every\n* model/table sits in an explicit namespace, so the table is resolved strictly\n* within that namespace (see {@link resolveStorageTable}).\n*/\nfunction codecRefForStorageColumn(storage, namespaceId, tableName, columnName) {\n\tconst resolved = resolveStorageTable(storage, tableName, namespaceId);\n\tif (resolved === void 0) return void 0;\n\tconst columnDef = resolved.table.columns[columnName];\n\tif (!columnDef) return void 0;\n\tif (columnDef.typeRef !== void 0) {\n\t\tconst instance = storage.types?.[columnDef.typeRef];\n\t\tif (!instance) return void 0;\n\t\tif (isStorageTypeInstance(instance)) {\n\t\t\tconst instanceParams = instance.typeParams;\n\t\t\treturn instanceParams !== void 0 && Object.keys(instanceParams).length > 0 ? {\n\t\t\t\tcodecId: instance.codecId,\n\t\t\t\ttypeParams: instanceParams\n\t\t\t} : { codecId: instance.codecId };\n\t\t}\n\t\treturn;\n\t}\n\tif (columnDef.typeParams !== void 0 && Object.keys(columnDef.typeParams).length > 0) {\n\t\tconst typeParams = blindCast(columnDef.typeParams);\n\t\treturn columnDef.many ? {\n\t\t\tcodecId: columnDef.codecId,\n\t\t\ttypeParams,\n\t\t\tmany: true\n\t\t} : {\n\t\t\tcodecId: columnDef.codecId,\n\t\t\ttypeParams\n\t\t};\n\t}\n\treturn columnDef.many ? {\n\t\tcodecId: columnDef.codecId,\n\t\tmany: true\n\t} : { codecId: columnDef.codecId };\n}\n//#endregion\n//#region src/codec-descriptor-registry.ts\n/**\n* Build a {@link CodecDescriptorRegistry} from a flat descriptor list.\n*\n* Used by:\n* - Each codec-shipping package's `core/registry.ts` to expose a package-scoped registry as the public consumer surface (replacing raw descriptor-array exports). See ADR 208.\n* - The runtime's `buildExecutionContext` to construct the contract-bound combined registry from every contributor's `codecs:` slot.\n*\n* The descriptor map is heterogeneous in `P` — each codec id has its own params shape. The public {@link CodecDescriptorRegistry} interface widens to `CodecDescriptor<unknown>` and consumers narrow per codec id at the call site (the descriptor's `paramsSchema` validates JSON-sourced params before the factory ever sees them, so the runtime narrow is safe). The cast at registration goes through `unknown` because\n* `CodecDescriptor<P>` is invariant in `P` (the `factory` and `renderOutputType` slots use `P` contravariantly).\n*/\nfunction buildCodecDescriptorRegistry(allDescriptors, storage) {\n\tconst byId = /* @__PURE__ */ new Map();\n\tconst byTargetType = /* @__PURE__ */ new Map();\n\tfor (const descriptor of allDescriptors) {\n\t\tif (byId.has(descriptor.codecId)) throw structuredError(\"RUNTIME.DUPLICATE_CODEC\", `Duplicate codec descriptor id: '${descriptor.codecId}' — registered twice during registry construction. Each codecId must be contributed by exactly one component (target / adapter / extension pack).`, { meta: { codecId: descriptor.codecId } });\n\t\tconst widened = descriptor;\n\t\tbyId.set(descriptor.codecId, widened);\n\t\tfor (const targetType of descriptor.targetTypes) {\n\t\t\tconst list = byTargetType.get(targetType);\n\t\t\tif (list) list.push(widened);\n\t\t\telse byTargetType.set(targetType, [widened]);\n\t\t}\n\t}\n\treturn {\n\t\tdescriptorFor(codecId) {\n\t\t\treturn byId.get(codecId);\n\t\t},\n\t\tcodecRefForColumn(namespaceId, table, column) {\n\t\t\tif (!storage) return void 0;\n\t\t\treturn codecRefForStorageColumn(storage, namespaceId, table, column);\n\t\t},\n\t\t*values() {\n\t\t\tyield* byId.values();\n\t\t},\n\t\tbyTargetType(targetType) {\n\t\t\treturn byTargetType.get(targetType) ?? Object.freeze([]);\n\t\t}\n\t};\n}\n//#endregion\nexport { buildCodecDescriptorRegistry, codecRefForStorageColumn };\n\n//# sourceMappingURL=codec-descriptor-registry.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,SAAS,yBAAyB,SAAS,aAAa,WAAW,YAAY;CAC9E,MAAM,WAAW,oBAAoB,SAAS,WAAW,WAAW;CACpE,IAAI,aAAa,KAAK,GAAG,OAAO,KAAK;CACrC,MAAM,YAAY,SAAS,MAAM,QAAQ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O,KAAK,IAAI,OAAO;EACxB;EACA,kBAAkB,aAAa,OAAO,QAAQ;GAC7C,IAAI,CAAC,SAAS,OAAO,KAAK;GAC1B,OAAO,yBAAyB,SAAS,aAAa,OAAO,MAAM;EACpE;EACA,CAAC,SAAS;GACT,OAAO,KAAK,OAAO;EACpB;EACA,aAAa,YAAY;GACxB,OAAO,aAAa,IAAI,UAAU,KAAK,OAAO,OAAO,CAAC,CAAC;EACxD;CACD;AACD"}
1
+ {"version":3,"file":"codec-descriptor-registry-ECZ4ohtG.mjs","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/codec-descriptor-registry.mjs"],"sourcesContent":["import { structuredError } from \"@internal/utils/structured-error\";\nimport { resolveStorageTable } from \"@internal/sql-contract/resolve-storage-table\";\nimport { isStorageTypeInstance } from \"@internal/sql-contract/types\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/codec-ref-for-column.ts\n/**\n* Derive the canonical {@link CodecRef} for a `(table, column)` pair against a {@link SqlStorage}. This is the build-time path every column-bound `ParamRef` / `ProjectionItem` uses to stamp its `codec` slot before the AST is handed to the runtime — the runtime resolver then materialises a memoised {@link import('@internal/sql-relational-core/ast').Codec} for the same `CodecRef` via `forCodecRef`.\n*\n* Resolution rules over namespace `entries.table[table].columns[column]`:\n*\n* - `typeRef` column → `{codecId, typeParams}` from `storage.types[typeRef]` (multiple columns sharing the typeRef share one ref → one memoised codec).\n* - inline `typeParams` column → `{codecId, typeParams}` from the column itself.\n* - non-parameterized column → `{codecId}` with `typeParams` undefined.\n*\n* Returns `undefined` when the table or column is unknown, or when a `typeRef` column references a `storage.types` entry that does not exist.\n*\n* `namespaceId` leads the coordinate args and is always supplied: every\n* model/table sits in an explicit namespace, so the table is resolved strictly\n* within that namespace (see {@link resolveStorageTable}).\n*/\nfunction codecRefForStorageColumn(storage, namespaceId, tableName, columnName) {\n\tconst resolved = resolveStorageTable(storage, tableName, namespaceId);\n\tif (resolved === void 0) return void 0;\n\tconst columnDef = resolved.table.columns[columnName];\n\tif (!columnDef) return void 0;\n\tif (columnDef.typeRef !== void 0) {\n\t\tconst instance = storage.types?.[columnDef.typeRef];\n\t\tif (!instance) return void 0;\n\t\tif (isStorageTypeInstance(instance)) {\n\t\t\tconst instanceParams = instance.typeParams;\n\t\t\treturn instanceParams !== void 0 && Object.keys(instanceParams).length > 0 ? {\n\t\t\t\tcodecId: instance.codecId,\n\t\t\t\ttypeParams: instanceParams\n\t\t\t} : { codecId: instance.codecId };\n\t\t}\n\t\treturn;\n\t}\n\tif (columnDef.typeParams !== void 0 && Object.keys(columnDef.typeParams).length > 0) {\n\t\tconst typeParams = blindCast(columnDef.typeParams);\n\t\treturn columnDef.many ? {\n\t\t\tcodecId: columnDef.codecId,\n\t\t\ttypeParams,\n\t\t\tmany: true\n\t\t} : {\n\t\t\tcodecId: columnDef.codecId,\n\t\t\ttypeParams\n\t\t};\n\t}\n\treturn columnDef.many ? {\n\t\tcodecId: columnDef.codecId,\n\t\tmany: true\n\t} : { codecId: columnDef.codecId };\n}\n//#endregion\n//#region src/codec-descriptor-registry.ts\n/**\n* Build a {@link CodecDescriptorRegistry} from a flat descriptor list.\n*\n* Used by:\n* - Each codec-shipping package's `core/registry.ts` to expose a package-scoped registry as the public consumer surface (replacing raw descriptor-array exports). See ADR 208.\n* - The runtime's `buildExecutionContext` to construct the contract-bound combined registry from every contributor's `codecs:` slot.\n*\n* The descriptor map is heterogeneous in `P` — each codec id has its own params shape. The public {@link CodecDescriptorRegistry} interface widens to `CodecDescriptor<unknown>` and consumers narrow per codec id at the call site (the descriptor's `paramsSchema` validates JSON-sourced params before the factory ever sees them, so the runtime narrow is safe). The cast at registration goes through `unknown` because\n* `CodecDescriptor<P>` is invariant in `P` (the `factory` and `renderOutputType` slots use `P` contravariantly).\n*/\nfunction buildCodecDescriptorRegistry(allDescriptors, storage) {\n\tconst byId = /* @__PURE__ */ new Map();\n\tconst byTargetType = /* @__PURE__ */ new Map();\n\tfor (const descriptor of allDescriptors) {\n\t\tif (byId.has(descriptor.codecId)) throw structuredError(\"RUNTIME.DUPLICATE_CODEC\", `Duplicate codec descriptor id: '${descriptor.codecId}' — registered twice during registry construction. Each codecId must be contributed by exactly one component (target / adapter / extension pack).`, { meta: { codecId: descriptor.codecId } });\n\t\tconst widened = descriptor;\n\t\tbyId.set(descriptor.codecId, widened);\n\t\tfor (const targetType of descriptor.targetTypes) {\n\t\t\tconst list = byTargetType.get(targetType);\n\t\t\tif (list) list.push(widened);\n\t\t\telse byTargetType.set(targetType, [widened]);\n\t\t}\n\t}\n\treturn {\n\t\tdescriptorFor(codecId) {\n\t\t\treturn byId.get(codecId);\n\t\t},\n\t\tcodecRefForColumn(namespaceId, table, column) {\n\t\t\tif (!storage) return void 0;\n\t\t\treturn codecRefForStorageColumn(storage, namespaceId, table, column);\n\t\t},\n\t\t*values() {\n\t\t\tyield* byId.values();\n\t\t},\n\t\tbyTargetType(targetType) {\n\t\t\treturn byTargetType.get(targetType) ?? Object.freeze([]);\n\t\t}\n\t};\n}\n//#endregion\nexport { buildCodecDescriptorRegistry, codecRefForStorageColumn };\n\n//# sourceMappingURL=codec-descriptor-registry.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,SAAS,yBAAyB,SAAS,aAAa,WAAW,YAAY;CAC9E,MAAM,WAAW,oBAAoB,SAAS,WAAW,WAAW;CACpE,IAAI,aAAa,KAAK,GAAG,OAAO,KAAK;CACrC,MAAM,YAAY,SAAS,MAAM,QAAQ;CACzC,IAAI,CAAC,WAAW,OAAO,KAAK;CAC5B,IAAI,UAAU,YAAY,KAAK,GAAG;EACjC,MAAM,WAAW,QAAQ,QAAQ,UAAU;EAC3C,IAAI,CAAC,UAAU,OAAO,KAAK;EAC3B,IAAI,sBAAsB,QAAQ,GAAG;GACpC,MAAM,iBAAiB,SAAS;GAChC,OAAO,mBAAmB,KAAK,KAAK,OAAO,KAAK,cAAc,CAAC,CAAC,SAAS,IAAI;IAC5E,SAAS,SAAS;IAClB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- import { n as buildSqlContractFromDefinition, r as contractError, t as applySqlSpecifierControlPolicy } from "./derived-checks-BzL102Q0-0nIMlEux.mjs";
1
+ import { n as buildSqlContractFromDefinition, r as contractError, t as applySqlSpecifierControlPolicy } from "./derived-checks-D_-1X7be-lGe8VdId.mjs";
2
2
  import { InternalError } from "@prisma/orm-framework/utils/internal-error";
3
3
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
4
4
  import { ok } from "@prisma/orm-framework/utils/result";
@@ -61,4 +61,4 @@ function typescriptContractFromPath(contractPath, output, options) {
61
61
  //#endregion
62
62
  export { typescriptContract as n, typescriptContractFromPath as r, emptyContract as t };
63
63
 
64
- //# sourceMappingURL=config-types-DHDQ3dST.mjs.map
64
+ //# sourceMappingURL=config-types-AbijI3Ys.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-types-DHDQ3dST.mjs","names":[],"sources":["../../../../2-sql/2-authoring/contract-ts/dist/config-types.mjs"],"sourcesContent":["import { n as buildSqlContractFromDefinition, r as contractError, t as applySqlSpecifierControlPolicy } from \"./derived-checks-BzL102Q0.mjs\";\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}), 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 positional-matched with 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":";;;;;;;;;;;;;AAaA,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,CAAC,GAAG,QAAQ,sBAAsB,QAAQ,eAAe,CAAC;GAC3D;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,8IAA8I;IACnM,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"}
1
+ {"version":3,"file":"config-types-AbijI3Ys.mjs","names":[],"sources":["../../../../2-sql/2-authoring/contract-ts/dist/config-types.mjs"],"sourcesContent":["import { i as contractError, n as buildSqlContractFromDefinition, t as applySqlSpecifierControlPolicy } from \"./derived-checks-D_-1X7be.mjs\";\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}), 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 positional-matched with 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":";;;;;;;;;;;;;AAaA,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,CAAC,GAAG,QAAQ,sBAAsB,QAAQ,eAAe,CAAC;GAC3D;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,8IAA8I;IACnM,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"}
@@ -1,6 +1,6 @@
1
1
  import { i as SqlNamespaceBase, s as SqlNamespaceInput } from "./sql-storage-8LqxeLAY-DH4DdUXx.mjs";
2
- import "./types-UcHa2cTe.mjs";
3
- import { t as SqlNamespaceFactory } from "./derived-checks-DPdD01O0-DGqOFjs6.mjs";
2
+ import "./types-C36_3E6_.mjs";
3
+ import { t as SqlNamespaceFactory } from "./derived-checks-DPdD01O0-DNBs1ZDA.mjs";
4
4
  import { Contract, ControlPolicy } from "@prisma/orm-framework/contract/types";
5
5
  import { TargetPackRef } from "@prisma/orm-framework/components/components";
6
6
  import { ContractConfig, ContractConfig as ContractConfig$1 } from "@prisma/orm-framework/config/config-types";
@@ -25,4 +25,4 @@ declare function typescriptContract(contract: Contract, output?: string, options
25
25
  declare function typescriptContractFromPath(contractPath: string, output?: string, options?: TypeScriptContractSpecifierOptions): ContractConfig;
26
26
  //#endregion
27
27
  export { typescriptContractFromPath as i, emptyContract as n, typescriptContract as r, ContractConfig$1 as t };
28
- //# sourceMappingURL=config-types-D9fdKG3g.d.mts.map
28
+ //# sourceMappingURL=config-types-Bd3ud-mX.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-types-D9fdKG3g.d.mts","names":[],"sources":["../../../../2-sql/2-authoring/contract-ts/dist/config-types.d.mts"],"mappings":";;;;;;;;;;;;;UAWU;WACC,sBAAsB;WACtB,iBAAiB;;iBAEX,cAAc;WACpB;WACA,QAAQ;WACR,kBAAkB,OAAO,sBAAsB;WAC/C,uBAAuB;IAC9B;iBACa,mBAAmB,UAAU,UAAU,iBAAiB,UAAU,qCAAqC;iBACvG,2BAA2B,sBAAsB,iBAAiB,UAAU,qCAAqC"}
1
+ {"version":3,"file":"config-types-Bd3ud-mX.d.mts","names":[],"sources":["../../../../2-sql/2-authoring/contract-ts/dist/config-types.d.mts"],"mappings":";;;;;;;;;;;;;UAWU;WACC,sBAAsB;WACtB,iBAAiB;;iBAEX,cAAc;WACpB;WACA,QAAQ;WACR,kBAAkB,OAAO,sBAAsB;WAC/C,uBAAuB;IAC9B;iBACa,mBAAmB,UAAU,UAAU,iBAAiB,UAAU,qCAAqC;iBACvG,2BAA2B,sBAAsB,iBAAiB,UAAU,qCAAqC"}
@@ -1,12 +1,12 @@
1
1
  import { t as providesEntityHandleLowering } from "./entity-handle-lowering-hook-DwLIKNiS.mjs";
2
- import { u as toStorageTypeInstance } from "./types-CUsJrvEl.mjs";
3
- import { n as buildSqlContractFromDefinition, r as contractError } from "./derived-checks-BzL102Q0-0nIMlEux.mjs";
2
+ import { d as toStorageTypeInstance } from "./types-D0B65hip.mjs";
3
+ import { i as toOneNullabilityContradictionMessage, n as buildSqlContractFromDefinition, r as contractError } from "./derived-checks-D_-1X7be-lGe8VdId.mjs";
4
4
  import { assertNoCrossRegistryCollisions, instantiateAuthoringFieldPreset, instantiateAuthoringTypeConstructor, isAuthoringEntityTypeDescriptor, isAuthoringFieldPresetDescriptor, isAuthoringTypeConstructorDescriptor, mergeAuthoringNamespaces, validateAuthoringHelperArguments } from "@prisma/orm-framework/components/authoring";
5
5
  import { InternalError } from "@prisma/orm-framework/utils/internal-error";
6
6
  import { isColumnDefault } from "@prisma/orm-framework/contract/types";
7
7
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
8
8
  import { blindCast } from "@prisma/orm-framework/utils/casts";
9
- import { bindEnumType, createEntityHelpersFromNamespace, enumType, isEnumTypeHandle, member } from "@prisma/orm-framework/contract-authoring";
9
+ import { bindEnumType, createEntityHelpersFromNamespace, enumType, isEnumTypeHandle, member, resolveToOneRelationNullable } from "@prisma/orm-framework/contract-authoring";
10
10
  //#region ../../../2-sql/2-authoring/contract-ts/dist/contract-builder.mjs
11
11
  function isNamedConstraintOptionsLike(value) {
12
12
  if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
@@ -564,6 +564,7 @@ function belongsTo(toModel, options) {
564
564
  toModel: normalizeRelationModelSource(toModel),
565
565
  from: options.from,
566
566
  to: options.to,
567
+ ...ifDefined("optional", options.optional),
567
568
  ...crossSpaceCoordinate !== void 0 ? crossSpaceCoordinate : {}
568
569
  });
569
570
  }
@@ -1005,6 +1006,19 @@ function resolveRelationAnchorFields(spec) {
1005
1006
  reason: "missing-anchor-id"
1006
1007
  } });
1007
1008
  }
1009
+ function belongsToNullable(relationName, declaredNullable, spec, fieldNames) {
1010
+ const { nullable, contradiction } = resolveToOneRelationNullable({
1011
+ declaredNullable,
1012
+ localFieldNullability: fieldNames.map((fieldName) => spec.fieldBuilders[fieldName]?.build().nullable === true),
1013
+ ownsReference: true
1014
+ });
1015
+ if (contradiction !== void 0) throw contractError("CONTRACT.RELATION_INVALID", toOneNullabilityContradictionMessage(`Relation "${spec.modelName}.${relationName}"`, contradiction), { meta: {
1016
+ modelName: spec.modelName,
1017
+ relationName,
1018
+ reason: "to-one-nullability-mismatch"
1019
+ } });
1020
+ return nullable;
1021
+ }
1008
1022
  function lowerBelongsToRelation(relationName, relation, currentSpec, allSpecs, extensions) {
1009
1023
  const targetModelName = resolveRelationModelName(relation.toModel);
1010
1024
  const fromFields = normalizeRelationFieldNames(relation.from);
@@ -1026,6 +1040,7 @@ function lowerBelongsToRelation(relationName, relation, currentSpec, allSpecs, e
1026
1040
  toModel: targetModelName,
1027
1041
  toTable: targetTable,
1028
1042
  cardinality: "N:1",
1043
+ nullable: belongsToNullable(relationName, relation.optional, currentSpec, fromFields),
1029
1044
  spaceId: relation.spaceId,
1030
1045
  ...relation.namespaceId !== void 0 ? { namespaceId: relation.namespaceId } : {},
1031
1046
  on: {
@@ -1047,6 +1062,7 @@ function lowerBelongsToRelation(relationName, relation, currentSpec, allSpecs, e
1047
1062
  toModel: targetModelName,
1048
1063
  toTable: targetSpec.tableName,
1049
1064
  cardinality: "N:1",
1065
+ nullable: belongsToNullable(relationName, relation.optional, currentSpec, fromFields),
1050
1066
  on: {
1051
1067
  parentTable: currentSpec.tableName,
1052
1068
  parentColumns: mapFieldNamesToColumnNames(currentSpec.modelName, fromFields, currentSpec.fieldToColumn),
@@ -1077,7 +1093,10 @@ function lowerHasOwnershipRelation(relationName, relation, currentSpec, allSpecs
1077
1093
  fieldName: relationName,
1078
1094
  toModel: targetModelName,
1079
1095
  toTable: targetSpec.tableName,
1080
- cardinality: relation.kind === "hasMany" ? "1:N" : "1:1",
1096
+ ...relation.kind === "hasMany" ? { cardinality: "1:N" } : {
1097
+ cardinality: "1:1",
1098
+ nullable: true
1099
+ },
1081
1100
  on: {
1082
1101
  parentTable: currentSpec.tableName,
1083
1102
  parentColumns: mapFieldNamesToColumnNames(currentSpec.modelName, parentFields, currentSpec.fieldToColumn),
@@ -1647,4 +1666,4 @@ function defineContract(definition, factory) {
1647
1666
  //#endregion
1648
1667
  export { defineContract as a, field as c, rel as d, check as i, member as l, buildBoundContract as n, enumType as o, buildContractDefinition as r, extensionModel as s, bindEnumType as t, model as u };
1649
1668
 
1650
- //# sourceMappingURL=contract-builder-CZSaZ6Vi.mjs.map
1669
+ //# sourceMappingURL=contract-builder-DYDnIGyM.mjs.map