@prisma/orm-family-mongo 8.0.0-rc.12-dev.21 → 8.0.0-rc.12-dev.22

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 (82) hide show
  1. package/dist/{authoring-entity-types-DkFfee0x-DzGu9hUw.mjs → authoring-entity-types-CZX-S_hY-w2tu7EVk.mjs} +19 -6
  2. package/dist/authoring-entity-types-CZX-S_hY-w2tu7EVk.mjs.map +1 -0
  3. package/dist/codec.d.mts +1 -1
  4. package/dist/codec.mjs +1 -1
  5. package/dist/{contract-builder-DUX8KLUR.d.mts → contract-builder-CCmw_x_e.d.mts} +10 -1
  6. package/dist/contract-builder-CCmw_x_e.d.mts.map +1 -0
  7. package/dist/{contract-builder-ckSdJi66.mjs → contract-builder-DpMMVErz.mjs} +4 -1
  8. package/dist/contract-builder-DpMMVErz.mjs.map +1 -0
  9. package/dist/contract-prisma6__provider.mjs +1 -1
  10. package/dist/contract-psl.mjs +1 -1
  11. package/dist/contract-psl__provider.mjs +1 -1
  12. package/dist/contract-psl__provider.mjs.map +1 -1
  13. package/dist/contract-ts.d.mts +1 -1
  14. package/dist/contract-ts.mjs +1 -1
  15. package/dist/contract-ts__contract-builder.d.mts +1 -1
  16. package/dist/contract-ts__contract-builder.mjs +1 -1
  17. package/dist/{control-DNe7Gps7.d.mts → control-BKLGhv19.d.mts} +2 -2
  18. package/dist/{control-DNe7Gps7.d.mts.map → control-BKLGhv19.d.mts.map} +1 -1
  19. package/dist/{control-1yLRoWrD.mjs → control-DRB8P8fy.mjs} +3 -3
  20. package/dist/{control-1yLRoWrD.mjs.map → control-DRB8P8fy.mjs.map} +1 -1
  21. package/dist/{control-BqovaVpo.d.mts → control-DVqprwua.d.mts} +2 -2
  22. package/dist/{control-BqovaVpo.d.mts.map → control-DVqprwua.d.mts.map} +1 -1
  23. package/dist/{control-adapter-Bh_ZraGM-0OJf8f1R.d.mts → control-adapter-Bh_ZraGM-wsAkUbsg.d.mts} +3 -3
  24. package/dist/{control-adapter-Bh_ZraGM-0OJf8f1R.d.mts.map → control-adapter-Bh_ZraGM-wsAkUbsg.d.mts.map} +1 -1
  25. package/dist/control-adapter-DnXw3tmo.d.mts +1 -0
  26. package/dist/{dist-C7Ykq48Q.mjs → dist-CO2arS1K.mjs} +3 -1
  27. package/dist/dist-CO2arS1K.mjs.map +1 -0
  28. package/dist/{dist-Czwqx_i3.mjs → dist-CqUoKyeL.mjs} +1 -10
  29. package/dist/dist-CqUoKyeL.mjs.map +1 -0
  30. package/dist/{execution-CKnUiOfm.d.mts → execution-BRC7ECq8.d.mts} +2 -2
  31. package/dist/{execution-CKnUiOfm.d.mts.map → execution-BRC7ECq8.d.mts.map} +1 -1
  32. package/dist/family.d.mts +4 -4
  33. package/dist/family.mjs +2 -2
  34. package/dist/family__control-adapter.d.mts +2 -2
  35. package/dist/family__control.d.mts +1 -1
  36. package/dist/family__control.mjs +1 -1
  37. package/dist/family__migration.d.mts +1 -1
  38. package/dist/family__pack.mjs +2 -2
  39. package/dist/family__pack.mjs.map +1 -1
  40. package/dist/{field-accessor-DHsAPiW3-DpQqiFg4.d.mts → field-accessor-DHsAPiW3-mPtxx6Gz.d.mts} +4 -4
  41. package/dist/{field-accessor-DHsAPiW3-DpQqiFg4.d.mts.map → field-accessor-DHsAPiW3-mPtxx6Gz.d.mts.map} +1 -1
  42. package/dist/{index-Dv2PNMiG.d.mts → index--ynTw_5M.d.mts} +15 -5
  43. package/dist/index--ynTw_5M.d.mts.map +1 -0
  44. package/dist/index-9DDQlC5U.d.mts +87 -0
  45. package/dist/index-9DDQlC5U.d.mts.map +1 -0
  46. package/dist/{index-BOnCg-qJ.d.mts → index-BfTXOq5S.d.mts} +4 -4
  47. package/dist/{index-BOnCg-qJ.d.mts.map → index-BfTXOq5S.d.mts.map} +1 -1
  48. package/dist/{index-CrO8iljZ.d.mts → index-RT8HbGQG.d.mts} +5 -5
  49. package/dist/{index-CrO8iljZ.d.mts.map → index-RT8HbGQG.d.mts.map} +1 -1
  50. package/dist/{interpreter-lsgY0F-Q-BNJcdxhl.mjs → interpreter-EqDVFiIr-C-rDel_u.mjs} +20 -14
  51. package/dist/interpreter-EqDVFiIr-C-rDel_u.mjs.map +1 -0
  52. package/dist/lowering.d.mts +1 -1
  53. package/dist/{migration-CR6iaRZH.d.mts → migration-DAPtRIp2.d.mts} +2 -2
  54. package/dist/{migration-CR6iaRZH.d.mts.map → migration-DAPtRIp2.d.mts.map} +1 -1
  55. package/dist/orm.d.mts +3 -3
  56. package/dist/orm.mjs +37 -17
  57. package/dist/orm.mjs.map +1 -1
  58. package/dist/pack-BUb_cutQ.d.mts.map +1 -1
  59. package/dist/query-ast.d.mts +3 -3
  60. package/dist/query-ast__control.d.mts +2 -2
  61. package/dist/query-ast__execution.d.mts +2 -2
  62. package/dist/query-builder.d.mts +4 -4
  63. package/dist/query-builder__contract-free.d.mts +5 -5
  64. package/dist/{query-plan-C0-Yu8hf-DdilEdW6.d.mts → query-plan-C0-Yu8hf-BnYfzKMn.d.mts} +2 -2
  65. package/dist/{query-plan-C0-Yu8hf-DdilEdW6.d.mts.map → query-plan-C0-Yu8hf-BnYfzKMn.d.mts.map} +1 -1
  66. package/dist/runtime.d.mts +6 -6
  67. package/dist/runtime.mjs +7 -8
  68. package/dist/runtime.mjs.map +1 -1
  69. package/dist/value.d.mts +2 -2
  70. package/dist/value.mjs +1 -1
  71. package/dist/wire.d.mts +2 -2
  72. package/package.json +20 -20
  73. package/dist/authoring-entity-types-DkFfee0x-DzGu9hUw.mjs.map +0 -1
  74. package/dist/contract-builder-DUX8KLUR.d.mts.map +0 -1
  75. package/dist/contract-builder-ckSdJi66.mjs.map +0 -1
  76. package/dist/control-adapter-BAu56y_q.d.mts +0 -1
  77. package/dist/dist-C7Ykq48Q.mjs.map +0 -1
  78. package/dist/dist-Czwqx_i3.mjs.map +0 -1
  79. package/dist/index-Dv2PNMiG.d.mts.map +0 -1
  80. package/dist/index-wKMm41HC.d.mts +0 -30
  81. package/dist/index-wKMm41HC.d.mts.map +0 -1
  82. package/dist/interpreter-lsgY0F-Q-BNJcdxhl.mjs.map +0 -1
@@ -9,7 +9,10 @@ import { blockAttribute, str } from "@prisma/orm-framework/psl-parser";
9
9
  import "@prisma/orm-framework/utils/defined";
10
10
  import "@prisma/orm-framework/components/control";
11
11
  import "@prisma/orm-framework/utils/canonical-stringify";
12
- //#region ../../../2-mongo-family/9-family/dist/authoring-entity-types-DkFfee0x.mjs
12
+ //#region ../../../2-mongo-family/9-family/dist/authoring-entity-types-CZX-S_hY.mjs
13
+ function typeArgumentSpan(block) {
14
+ return block.blockAttributes.find((attribute) => attribute.name === "type")?.args[0]?.span;
15
+ }
13
16
  const mongoFamilyEntityTypes = { enum: {
14
17
  kind: "entity",
15
18
  discriminator: "enum",
@@ -19,13 +22,23 @@ const mongoFamilyEntityTypes = { enum: {
19
22
  const resolved = resolveEnumCodecId(block, ctx);
20
23
  if (resolved === void 0) return;
21
24
  const { codecId, codecSpan } = resolved;
22
- const nativeType = ctx.codecLookup?.targetTypesFor(codecId)?.[0];
23
- if (nativeType === void 0) {
25
+ const bsonTypes = ctx.codecLookup?.targetTypesFor(codecId);
26
+ if (bsonTypes === void 0) {
24
27
  diagnostics?.push({
25
28
  code: "PSL_EXTENSION_INVALID_VALUE",
26
29
  message: `enum "${block.name}" @@type references unknown codec "${codecId}"`,
27
30
  sourceId,
28
- span: codecSpan
31
+ span: typeArgumentSpan(block) ?? codecSpan
32
+ });
33
+ return;
34
+ }
35
+ const [bsonType, ...otherBsonTypes] = bsonTypes;
36
+ if (bsonType === void 0 || otherBsonTypes.length > 0) {
37
+ diagnostics?.push({
38
+ code: "PSL_EXTENSION_INVALID_VALUE",
39
+ message: `enum "${block.name}" @@type codec "${codecId}" declares ${bsonTypes.length} BSON types; an enum needs exactly one`,
40
+ sourceId,
41
+ span: typeArgumentSpan(block) ?? codecSpan
29
42
  });
30
43
  return;
31
44
  }
@@ -113,7 +126,7 @@ const mongoFamilyEntityTypes = { enum: {
113
126
  }
114
127
  return enumType(block.name, {
115
128
  codecId,
116
- nativeType
129
+ nativeType: bsonType
117
130
  }, ...members.map((m) => ({
118
131
  name: m.name,
119
132
  value: m.value
@@ -141,4 +154,4 @@ const mongoFamilyPslBlockDescriptors = { enum: {
141
154
  //#endregion
142
155
  export { mongoFamilyPslBlockDescriptors as n, mongoFamilyEntityTypes as t };
143
156
 
144
- //# sourceMappingURL=authoring-entity-types-DkFfee0x-DzGu9hUw.mjs.map
157
+ //# sourceMappingURL=authoring-entity-types-CZX-S_hY-w2tu7EVk.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authoring-entity-types-CZX-S_hY-w2tu7EVk.mjs","names":[],"sources":["../../../../2-mongo-family/9-family/dist/authoring-entity-types-CZX-S_hY.mjs"],"sourcesContent":["import \"@internal/utils/defined\";\nimport { resolveEnumCodecId } from \"@internal/framework-components/authoring\";\nimport \"@internal/contract/hashing\";\nimport \"@internal/contract/types\";\nimport { enumType } from \"@internal/contract-authoring\";\nimport \"@internal/errors/control\";\nimport \"@internal/framework-components/control\";\nimport \"@internal/framework-components/ir\";\nimport \"@internal/mongo-contract\";\nimport \"@internal/mongo-contract/canonicalization-hooks\";\nimport \"@internal/utils/canonical-stringify\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { blockAttribute, str } from \"@internal/psl-parser\";\n//#region src/core/authoring-entity-types.ts\nfunction typeArgumentSpan(block) {\n\treturn block.blockAttributes.find((attribute) => attribute.name === \"type\")?.args[0]?.span;\n}\nconst mongoFamilyEntityTypes = { 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 bsonTypes = ctx.codecLookup?.targetTypesFor(codecId);\n\t\tif (bsonTypes === 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: typeArgumentSpan(block) ?? codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst [bsonType, ...otherBsonTypes] = bsonTypes;\n\t\tif (bsonType === void 0 || otherBsonTypes.length > 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}\" declares ${bsonTypes.length} BSON types; an enum needs exactly one`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: typeArgumentSpan(block) ?? 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: bsonType\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\", {\n\tdocumentation: \"Selects the storage codec for this enum.\",\n\tpositional: [{\n\t\tkey: \"codecId\",\n\t\ttype: str(),\n\t\tdocumentation: \"The fully qualified codec identifier used to store enum values.\"\n\t}]\n});\nconst mongoFamilyPslBlockDescriptors = { enum: {\n\tkind: \"pslBlock\",\n\tkeyword: \"enum\",\n\tdocumentation: \"Defines an enum with named values and an inferred or explicitly selected storage codec.\",\n\tdiscriminator: \"enum\",\n\tname: { required: true },\n\tparameters: {},\n\tvariadicParameters: true,\n\tattributes: { type: () => enumTypeBlockAttribute }\n} };\n//#endregion\nexport { mongoFamilyPslBlockDescriptors as n, mongoFamilyEntityTypes as t };\n\n//# sourceMappingURL=authoring-entity-types-CZX-S_hY.mjs.map"],"mappings":";;;;;;;;;;;;AAcA,SAAS,iBAAiB,OAAO;CAChC,OAAO,MAAM,gBAAgB,MAAM,cAAc,UAAU,SAAS,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE;AACvF;AACA,MAAM,yBAAyB,EAAE,MAAM;CACtC,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,M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}
package/dist/codec.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as mongoCodec, i as MongoCodecTrait, n as MongoCodecInput, o as newMongoCodecRegistry, r as MongoCodecRegistry, t as MongoCodec } from "./index-Dv2PNMiG.mjs";
1
+ import { a as mongoCodec, i as MongoCodecTrait, n as MongoCodecInput, o as newMongoCodecRegistry, r as MongoCodecRegistry, t as MongoCodec } from "./index--ynTw_5M.mjs";
2
2
  export { type MongoCodec, type MongoCodecInput, type MongoCodecRegistry, type MongoCodecTrait, mongoCodec, newMongoCodecRegistry };
package/dist/codec.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { n as newMongoCodecRegistry, t as mongoCodec } from "./dist-Czwqx_i3.mjs";
1
+ import { n as newMongoCodecRegistry, t as mongoCodec } from "./dist-CqUoKyeL.mjs";
2
2
  export { mongoCodec, newMongoCodecRegistry };
@@ -1,5 +1,6 @@
1
1
  import { E as MongoIndexAuthoringInput, F as MongoIndexOptionsInput, J as MongoTypeMaps, O as MongoIndexFields, W as MongoStorageShape, v as MongoCollection, w as MongoContractWithTypeMaps, x as MongoCollectionOptionsAuthoringInput } from "./mongo-value-set-BngSUlOh-BhDGXjM_.mjs";
2
2
  import "./index-CLPkwReD.mjs";
3
+ import { r as BsonValue, t as BsonInputValue } from "./index-9DDQlC5U.mjs";
3
4
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
4
5
  import { ContractExecutionSection, ContractFieldType, ControlPolicy, CrossReference, ExecutionHashBase, ExecutionMutationDefault, ExecutionMutationDefaultPhases, JsonValue, ProfileHashBase, StorageHashBase } from "@prisma/orm-framework/contract/types";
5
6
  import { BoundEnumType, CodecTypeMap, EntityHelpersFromNamespace, EnumMember, EnumTypeHandle, ExtractAuthoringNamespaceFromPack, MergeExtensionAuthoringNamespaces, ResolveTemplateValue, TupleFromArgumentDescriptors, bindEnumType, enumType as enumType$1, isEnumTypeHandle, member } from "@prisma/orm-framework/contract-authoring";
@@ -70,6 +71,10 @@ type MongoCodecTypes = {
70
71
  readonly input: JsonValue;
71
72
  readonly output: JsonValue;
72
73
  };
74
+ readonly 'mongo/bson@1': {
75
+ readonly input: BsonInputValue;
76
+ readonly output: BsonValue;
77
+ };
73
78
  };
74
79
  type MergeExtensionCodecTypes<Packs extends Record<string, unknown>> = UnionToIntersection<{ [K in keyof Packs]: ExtractCodecTypesFromPack<Packs[K]>; }[keyof Packs]>;
75
80
  type MergeExtensionCodecTypesSafe<Packs> = Packs extends Record<string, unknown> ? keyof Packs extends never ? Record<string, never> : MergeExtensionCodecTypes<Packs> : Record<string, never>;
@@ -425,6 +430,10 @@ declare const field: {
425
430
  readonly kind: "scalar";
426
431
  readonly codecId: "mongo/json@1";
427
432
  } & EmptyObject, false, false, EnumTypeHandle<string, readonly unknown[], readonly string[], Record<string, unknown>> | undefined, undefined>;
433
+ readonly bson: () => FieldBuilder<{
434
+ readonly kind: "scalar";
435
+ readonly codecId: "mongo/bson@1";
436
+ } & EmptyObject, false, false, EnumTypeHandle<string, readonly unknown[], readonly string[], Record<string, unknown>> | undefined, undefined>;
428
437
  readonly vector: <const TypeParams extends Record<string, unknown> | undefined = undefined>(options?: {
429
438
  readonly typeParams?: TypeParams;
430
439
  }) => FieldBuilder<{
@@ -539,4 +548,4 @@ declare function defineContract<const Definition extends ContractScaffold<Family
539
548
  }>(definition: Definition, factory: (helpers: ContractAuthoringHelpers<Definition['family'], Definition['target'], ScaffoldExtensions<Definition>>) => Built): MongoContractResult<Definition & Built>;
540
549
  //#endregion
541
550
  export { model as C, member as S, valueObject as T, defineContract as _, ContractScaffold as a, index as b, ExtractCodecTypesFromPack as c, ModelBuilder as d, MongoContractResult as f, buildBoundContract as g, bindEnumType as h, ContractFactory as i, FieldBuilder as l, ValueObjectBuilder as m, CodecTypeMap as n, EnumMember as o, RelationBuilder as p, ContractDefinition as r, EnumTypeHandle as s, BoundEnumType as t, FieldReference as u, enumType$1 as v, rel as w, isEnumTypeHandle as x, field as y };
542
- //# sourceMappingURL=contract-builder-DUX8KLUR.d.mts.map
551
+ //# sourceMappingURL=contract-builder-CCmw_x_e.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract-builder-CCmw_x_e.d.mts","names":[],"sources":["../../../../2-mongo-family/2-authoring/contract-ts/dist/contract-builder.d.mts"],"mappings":";;;;;;;;;;KAQK;WACM;;KAEN;WACM;;KAEN;KACA,QAAQ,KAAK,QAAQ;KACrB,cAAc;KACd,SAAS,QAAQ,WAAW,IAAI,EAAE,QAAQ;KAC1C,QAAQ,QAAQ,WAAW,IAAI,EAAE;KACjC,YAAY,QAAQ,SAAS,SAAS,QAAQ,OAAO,cAAc,cAAc;KACjF,oBAAoB,UAAU,yBAAyB,OAAO,kCAAkC,aAAa,yBAAyB;KACtI,0BAA0B,KAAK;EAClC,qBAAqB;IACnB,mBAAmB;EACrB;KACG,aAAa,wBAAwB;KACrC;WACM;aACE;aACA;;WAEF;aACE;aACA;;WAEF;aACE;aACA;;WAEF;aACE;aACA;;WAEF;aACE;aACA;;WAEF;aACE,OAAO;aACP,QAAQ;;WAEV;aACE;aACA;;WAEF;aACE;aACA;;WAEF;aACE;aACA;;WAEF;aACE,OAAO;aACP,QAAQ;;WAEV;aACE,OAAO;aACP,QAAQ;;WAEV;aACE,OAAO;aACP,QAAQ;;;KAGhB,yBAAyB,cAAc,2BAA2B,uBAAuB,WAAW,QAAQ,0BAA0B,MAAM,aAAa;KACzJ,6BAA6B,SAAS,cAAc,gCAAgC,sBAAsB,wBAAwB,yBAAyB,SAAS;UAC/J,aAAa,aAAa,oBAAoB,mBAAmB,oCAAoC,gCAAgC,eAAe,6BAA6B,4BAA4B,0BAA0B;WACtO;WACA,QAAQ;WACR,YAAY;WACZ,QAAQ;WACR,cAAc;WACd,sBAAsB;EAC/B,YAAY,aAAa,YAAY,MAAM,QAAQ;EACnD,QAAQ,aAAa,MAAM,gBAAgB,QAAQ;;UAE3C,mBAAmB,8BAA8B,eAAe,eAAe,mBAAmB,eAAe;WA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,mBAAmB,qBAAqB,eAAe,kBAAkB,eAAe,wBAAwB,eAAe,+CAA+C,eAAe,oCAAoC;WACtV,SAAS,eAAe;WACxB,eAAe,eAAe;WAC9B,QAAQ,eAAe;GAC/B,QAAQ,GAAG,QAAQ,GAAG,YAAY,YAAY,UAAU,SAAS,yBAAyB,GAAG,GAAG,YAAY,+BAA+B,QAAQ,oBAAoB,iBAAiB,aAAa,OAAO,GAAG;iBACjM,qBAAqB,mBAAmB,mBAAmB,uBAAuB,+BAA+B,eAAe,kBAAkB,eAAe,wBAAwB,eAAe,+CAA+C,eAAe,8BAA8B,YAAY,aAAa,oBAAoB;iBACjV,qBAAqB,mBAAmB,iBAAiB,uBAAuB,+BAA+B,eAAe,+CAA+C,eAAe,oCAAoC;WACtO,SAAS,eAAe;WACxB,eAAe,eAAe;WAC9B,QAAQ,eAAe;GAC/B,YAAY,YAAY,UAAU,SAAS,yBAAyB,sBAAsB,sBAAsB,mBAAmB,iBAAiB,QAAQ,oBAAoB,aAAa"}
@@ -170,6 +170,9 @@ const field = {
170
170
  json() {
171
171
  return createScalarFieldBuilder("mongo/json@1");
172
172
  },
173
+ bson() {
174
+ return createScalarFieldBuilder("mongo/bson@1");
175
+ },
173
176
  vector(options) {
174
177
  return createScalarFieldBuilder("mongo/vector@1", options);
175
178
  },
@@ -769,4 +772,4 @@ function defineContract(definition, factory) {
769
772
  //#endregion
770
773
  export { field as a, member as c, valueObject as d, enumType$1 as i, model as l, buildBoundContract as n, index as o, defineContract as r, isEnumTypeHandle as s, bindEnumType as t, rel as u };
771
774
 
772
- //# sourceMappingURL=contract-builder-ckSdJi66.mjs.map
775
+ //# sourceMappingURL=contract-builder-DpMMVErz.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract-builder-DpMMVErz.mjs","names":[],"sources":["../../../../2-mongo-family/2-authoring/contract-ts/dist/contract-builder.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { buildExecutionSection, computeProfileHash, computeStorageHash } from \"@internal/contract/hashing\";\nimport { crossRef } from \"@internal/contract/types\";\nimport { bindEnumType, composePackAuthoringNamespace, createEntityHelpersFromNamespace, createFieldHelpersFromNamespace, enumType, isEnumTypeHandle, member, resolveToOneRelationNullable } from \"@internal/contract-authoring\";\nimport { errorEnumCodecNotInPackStack } from \"@internal/errors/control\";\nimport { assertNoCrossRegistryCollisions, instantiateAuthoringFieldPreset, validateAuthoringHelperArguments } from \"@internal/framework-components/authoring\";\nimport { extractCodecLookup } from \"@internal/framework-components/control\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { MongoCollectionOptions, MongoIndex, MongoStorage, applyPolymorphicScopeToMongoIndex, buildMongoNamespace } from \"@internal/mongo-contract\";\nimport { mongoContractCanonicalizationHooks } from \"@internal/mongo-contract/canonicalization-hooks\";\nimport { canonicalStringify } from \"@internal/utils/canonical-stringify\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\n//#region src/contract-builder.ts\n/**\n* Encode an authored enum value to its codec-encoded JSON form, mirroring SQL's `build-contract`.\n*\n* The codec is resolved by id from the lookup built from the contract's target pack, so a\n* non-identity `encodeJson` (permitted by the `mongoCodec` factory) is respected. A codecId the\n* lookup cannot resolve is a hard error: the enum uses a codec that is not part of the contract's\n* pack stack.\n*/\nfunction encodeEnumValue(value, codecId, codecLookup) {\n\tconst codec = codecLookup.get(codecId);\n\tif (!codec) throw errorEnumCodecNotInPackStack({ codecId });\n\treturn codec.encodeJson(value);\n}\nfunction stableStringify(value) {\n\tif (Array.isArray(value)) return `[${value.map(stableStringify).join(\",\")}]`;\n\tif (value && typeof value === \"object\") return `{${Object.entries(value).sort(([left], [right]) => left.localeCompare(right)).map(([key, entry]) => `${JSON.stringify(key)}:${stableStringify(entry)}`).join(\",\")}}`;\n\treturn JSON.stringify(value);\n}\nconst MONGO_RESERVED_HELPER_KEYS = [\n\t\"field\",\n\t\"index\",\n\t\"model\",\n\t\"rel\",\n\t\"valueObject\"\n];\nfunction buildFieldPreset(helperPath, descriptor, args) {\n\tvalidateAuthoringHelperArguments(helperPath, descriptor.args, args);\n\tconst preset = instantiateAuthoringFieldPreset(descriptor, args);\n\tconst unsupported = [\n\t\t...preset.default !== void 0 ? [\"default\"] : [],\n\t\t...preset.id ? [\"id\"] : [],\n\t\t...preset.unique ? [\"unique\"] : []\n\t];\n\tif (unsupported.length > 0) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Field preset \"${helperPath}\" contributes ${unsupported.join(\", \")}, which Mongo does not support. Mongo supports presets that set a codec and execution defaults only.`, { meta: {\n\t\thelperPath,\n\t\treason: \"preset-contribution-unsupported\",\n\t\tcontribution: unsupported\n\t} });\n\treturn createFieldBuilder({\n\t\ttype: {\n\t\t\tkind: \"scalar\",\n\t\t\tcodecId: preset.descriptor.codecId,\n\t\t\t...normalizeOptionalTypeParams(preset.descriptor.typeParams)\n\t\t},\n\t\tnullable: preset.nullable,\n\t\tmany: false\n\t}, void 0, preset.executionDefaults);\n}\nfunction composeMongoFieldHelpers(fieldNamespace) {\n\tconst presetHelpers = createFieldHelpersFromNamespace(fieldNamespace, ({ helperPath, descriptor }) => (...args) => buildFieldPreset(helperPath, descriptor, args));\n\tconst collisions = Object.keys(presetHelpers).filter((name) => Object.hasOwn(field, name));\n\tif (collisions.length > 0) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Pack-contributed field preset(s) ${collisions.map((c) => `\"${c}\"`).join(\", \")} collide with the built-in Mongo field helper(s) of the same name.`, { meta: {\n\t\treason: \"core-field-helper-collision\",\n\t\tcontribution: collisions\n\t} });\n\treturn {\n\t\t...field,\n\t\t...presetHelpers\n\t};\n}\nfunction composeMongoAuthoringHelpers(family, target, extensions) {\n\tconst components = [\n\t\tfamily,\n\t\ttarget,\n\t\t...Object.values(extensions ?? {})\n\t];\n\tconst entityNamespace = composePackAuthoringNamespace(components, \"entityTypes\");\n\tconst fieldNamespace = composePackAuthoringNamespace(components, \"field\");\n\tassertNoCrossRegistryCollisions({}, fieldNamespace, entityNamespace);\n\tconst collisions = Object.keys(entityNamespace).filter((name) => MONGO_RESERVED_HELPER_KEYS.includes(name));\n\tif (collisions.length > 0) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Pack-contributed entity type(s) ${collisions.map((c) => `\"${c}\"`).join(\", \")} collide with the reserved built-in helper key(s) on the Mongo composed helpers surface. Reserved keys: ${MONGO_RESERVED_HELPER_KEYS.map((k) => `\"${k}\"`).join(\", \")}.`, { meta: {\n\t\treason: \"reserved-helper-key-collision\",\n\t\tcontribution: collisions\n\t} });\n\treturn blindCast({\n\t\t...createEntityHelpersFromNamespace(entityNamespace, { ctx: {\n\t\t\tfamily: family.familyId,\n\t\t\ttarget: target.targetId\n\t\t} }),\n\t\tfield: composeMongoFieldHelpers(fieldNamespace),\n\t\tindex,\n\t\tmodel,\n\t\trel,\n\t\tvalueObject\n\t});\n}\nfunction createFieldBuilder(spec, enumHandle, executionDefaults) {\n\treturn {\n\t\t__kind: \"field\",\n\t\t...ifDefined(\"__executionDefaults\", executionDefaults),\n\t\t__type: spec.type,\n\t\t__nullable: spec.nullable,\n\t\t__many: spec.many,\n\t\t__enumHandle: blindCast(enumHandle),\n\t\toptional() {\n\t\t\treturn createFieldBuilder({\n\t\t\t\ttype: spec.type,\n\t\t\t\tnullable: true,\n\t\t\t\tmany: spec.many\n\t\t\t}, enumHandle, executionDefaults);\n\t\t},\n\t\tmany() {\n\t\t\treturn createFieldBuilder({\n\t\t\t\ttype: spec.type,\n\t\t\t\tnullable: spec.nullable,\n\t\t\t\tmany: true\n\t\t\t}, enumHandle, executionDefaults);\n\t\t}\n\t};\n}\nfunction normalizeOptionalTypeParams(typeParams) {\n\tif (!typeParams) return {};\n\treturn { typeParams };\n}\nfunction createScalarFieldBuilder(codecId, options) {\n\treturn createFieldBuilder({\n\t\ttype: blindCast({\n\t\t\tkind: \"scalar\",\n\t\t\tcodecId,\n\t\t\t...normalizeOptionalTypeParams(options?.typeParams)\n\t\t}),\n\t\tnullable: false,\n\t\tmany: false\n\t});\n}\nconst field = {\n\tscalar: createScalarFieldBuilder,\n\tobjectId() {\n\t\treturn createScalarFieldBuilder(\"mongo/objectId@1\");\n\t},\n\tstring() {\n\t\treturn createScalarFieldBuilder(\"mongo/string@1\");\n\t},\n\tdouble() {\n\t\treturn createScalarFieldBuilder(\"mongo/double@1\");\n\t},\n\tint32() {\n\t\treturn createScalarFieldBuilder(\"mongo/int32@1\");\n\t},\n\tbool() {\n\t\treturn createScalarFieldBuilder(\"mongo/bool@1\");\n\t},\n\tdate() {\n\t\treturn createScalarFieldBuilder(\"mongo/date@1\");\n\t},\n\tint64() {\n\t\treturn createScalarFieldBuilder(\"mongo/int64@1\");\n\t},\n\tdecimal128() {\n\t\treturn createScalarFieldBuilder(\"mongo/decimal128@1\");\n\t},\n\tbinary() {\n\t\treturn createScalarFieldBuilder(\"mongo/binary@1\");\n\t},\n\tjson() {\n\t\treturn createScalarFieldBuilder(\"mongo/json@1\");\n\t},\n\tbson() {\n\t\treturn createScalarFieldBuilder(\"mongo/bson@1\");\n\t},\n\tvector(options) {\n\t\treturn createScalarFieldBuilder(\"mongo/vector@1\", options);\n\t},\n\tvalueObject(valueObjectName) {\n\t\treturn createFieldBuilder({\n\t\t\ttype: blindCast({\n\t\t\t\tkind: \"valueObject\",\n\t\t\t\tname: resolveValueObjectName(valueObjectName)\n\t\t\t}),\n\t\t\tnullable: false,\n\t\t\tmany: false\n\t\t});\n\t},\n\tnamedType(handle) {\n\t\treturn createFieldBuilder({\n\t\t\ttype: blindCast({\n\t\t\t\tkind: \"scalar\",\n\t\t\t\tcodecId: handle.codecId\n\t\t\t}),\n\t\t\tnullable: false,\n\t\t\tmany: false\n\t\t}, handle);\n\t}\n};\nfunction index(fields, options) {\n\treturn {\n\t\tfields,\n\t\t...options ? { options } : {}\n\t};\n}\nfunction createFieldReference(modelName, fieldName) {\n\treturn {\n\t\t__kind: \"fieldRef\",\n\t\tmodelName,\n\t\tfieldName\n\t};\n}\nfunction isFieldReference(value) {\n\treturn typeof value === \"object\" && value !== null && \"__kind\" in value && value.__kind === \"fieldRef\";\n}\nfunction resolveModelName(value) {\n\treturn typeof value === \"string\" ? value : value.__name;\n}\nfunction resolveValueObjectName(value) {\n\treturn typeof value === \"string\" ? value : value.__name;\n}\nfunction normalizeStringList(value) {\n\treturn typeof value === \"string\" ? [value] : [...value];\n}\nfunction normalizeTargetField(targetModelName, value) {\n\tif (!isFieldReference(value)) return value;\n\tif (value.modelName !== targetModelName) throw contractError(\"CONTRACT.RELATION_INVALID\", `Relation target \"${targetModelName}\" cannot reference field \"${value.modelName}.${value.fieldName}\".`, { meta: {\n\t\tmodelName: targetModelName,\n\t\treason: \"cross-model-field-reference\",\n\t\treferencedModel: value.modelName,\n\t\treferencedField: value.fieldName\n\t} });\n\treturn value.fieldName;\n}\nfunction normalizeTargetFields(targetModelName, value) {\n\tif (typeof value === \"string\") return [value];\n\tif (isFieldReference(value)) return [normalizeTargetField(targetModelName, value)];\n\treturn value.map((entry) => normalizeTargetField(targetModelName, entry));\n}\nfunction createRelationBuilder(spec) {\n\treturn {\n\t\t__kind: \"relation\",\n\t\t__to: spec.to,\n\t\t__cardinality: spec.cardinality,\n\t\t__on: spec.on,\n\t\t__nullable: spec.nullable\n\t};\n}\nfunction createReferenceRelationBuilder(target, cardinality, options, nullable) {\n\tconst targetModelName = resolveModelName(target);\n\treturn createRelationBuilder({\n\t\tto: blindCast(targetModelName),\n\t\tcardinality,\n\t\ton: {\n\t\t\tlocalFields: blindCast(normalizeStringList(options.from)),\n\t\t\ttargetFields: blindCast(normalizeTargetFields(targetModelName, options.to))\n\t\t},\n\t\tnullable\n\t});\n}\nfunction createEmbedRelationBuilder(target, cardinality) {\n\treturn createRelationBuilder({\n\t\tto: blindCast(resolveModelName(target)),\n\t\tcardinality,\n\t\ton: void 0,\n\t\tnullable: void 0\n\t});\n}\nfunction hasOne(target, options) {\n\tif (!options) return createEmbedRelationBuilder(target, \"1:1\");\n\treturn createReferenceRelationBuilder(target, \"1:1\", options, true);\n}\nfunction hasMany(target, options) {\n\tif (!options) return createEmbedRelationBuilder(target, \"1:N\");\n\treturn createReferenceRelationBuilder(target, \"1:N\", options, void 0);\n}\nfunction belongsTo(target, options) {\n\treturn createReferenceRelationBuilder(target, \"N:1\", options, options.optional);\n}\nconst rel = {\n\tbelongsTo,\n\thasMany,\n\thasOne\n};\nfunction valueObject(name, input) {\n\treturn {\n\t\t__kind: \"valueObject\",\n\t\t__name: name,\n\t\t__fields: input.fields\n\t};\n}\nfunction model(name, input) {\n\treturn {\n\t\t__kind: \"model\",\n\t\t__name: name,\n\t\t__fields: input.fields,\n\t\t__relations: blindCast(input.relations ?? {}),\n\t\t__indexes: input.indexes,\n\t\t__collectionOptions: input.collectionOptions,\n\t\t__controlPolicy: input.controlPolicy,\n\t\t__collection: blindCast(input.collection),\n\t\t__owner: blindCast(input.owner ? resolveModelName(input.owner) : void 0),\n\t\t__base: blindCast(input.base ? resolveModelName(input.base) : void 0),\n\t\t__storageRelations: blindCast(input.storageRelations),\n\t\t__discriminator: blindCast(input.discriminator ? { field: input.discriminator.field } : void 0),\n\t\t__variants: blindCast(input.discriminator?.variants),\n\t\tref(fieldName) {\n\t\t\treturn createFieldReference(name, fieldName);\n\t\t}\n\t};\n}\nfunction validateTargetPackRef(family, target) {\n\tif (family.familyId !== \"mongo\") throw contractError(\"CONTRACT.PACK_FAMILY_MISMATCH\", `defineContract only accepts Mongo family packs. Received family \"${family.familyId}\".`, { meta: {\n\t\tpackId: family.id,\n\t\tpackFamilyId: family.familyId,\n\t\tcontractFamilyId: \"mongo\"\n\t} });\n\tif (target.familyId !== family.familyId) throw contractError(\"CONTRACT.PACK_FAMILY_MISMATCH\", `target pack \"${target.id}\" targets family \"${target.familyId}\" but contract family is \"${family.familyId}\".`, { meta: {\n\t\tpackId: target.id,\n\t\tpackFamilyId: target.familyId,\n\t\tcontractFamilyId: family.familyId\n\t} });\n}\nfunction validateExtensionPackRefs(target, extensions) {\n\tif (!extensions) return;\n\tfor (const packRef of Object.values(extensions)) {\n\t\tif (packRef.kind !== \"extension\") throw contractError(\"CONTRACT.PACK_REF_INVALID\", `defineContract only accepts extension pack refs in extensions. Received kind \"${packRef.kind}\".`, { meta: {\n\t\t\tpackId: packRef.id,\n\t\t\tkind: packRef.kind\n\t\t} });\n\t\tif (packRef.familyId !== target.familyId) throw contractError(\"CONTRACT.PACK_FAMILY_MISMATCH\", `extension pack \"${packRef.id}\" targets family \"${packRef.familyId}\" but contract target family is \"${target.familyId}\".`, { meta: {\n\t\t\tpackId: packRef.id,\n\t\t\tpackFamilyId: packRef.familyId,\n\t\t\tcontractFamilyId: target.familyId\n\t\t} });\n\t\tif (packRef.targetId && packRef.targetId !== target.targetId) throw contractError(\"CONTRACT.PACK_TARGET_MISMATCH\", `extension pack \"${packRef.id}\" targets \"${packRef.targetId}\" but contract target is \"${target.targetId}\".`, { meta: {\n\t\t\tpackId: packRef.id,\n\t\t\tpackTargetId: packRef.targetId,\n\t\t\tcontractTargetId: target.targetId\n\t\t} });\n\t}\n}\nfunction isContractScaffold(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\treturn \"family\" in value && \"target\" in value;\n}\nfunction buildContractField(builder) {\n\tconst valueSet = builder.__enumHandle ? {\n\t\tplane: \"domain\",\n\t\tentityKind: \"enum\",\n\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\tentityName: builder.__enumHandle.enumName\n\t} : void 0;\n\treturn builder.__many ? {\n\t\ttype: builder.__type,\n\t\tnullable: builder.__nullable,\n\t\tmany: true,\n\t\t...ifDefined(\"valueSet\", valueSet)\n\t} : {\n\t\ttype: builder.__type,\n\t\tnullable: builder.__nullable,\n\t\t...ifDefined(\"valueSet\", valueSet)\n\t};\n}\nfunction buildFields(fields) {\n\tconst builtFields = {};\n\tfor (const [fieldName, fieldBuilder] of Object.entries(fields)) builtFields[fieldName] = buildContractField(fieldBuilder);\n\treturn builtFields;\n}\nfunction toOneRelationNullable(modelName, relationName, relationBuilder, on, fields) {\n\tconst location = `Relation \"${modelName}.${relationName}\"`;\n\tconst ownsForeignKey = relationBuilder.__cardinality !== \"1:1\";\n\tconst localFields = ownsForeignKey ? on.localFields.map((fieldName) => {\n\t\tconst localField = fields[fieldName];\n\t\tif (localField === void 0) throw contractError(\"CONTRACT.RELATION_INVALID\", `${location} joins on local field \"${fieldName}\", which model \"${modelName}\" does not declare`, { meta: {\n\t\t\tmodelName,\n\t\t\trelationName,\n\t\t\tfieldName,\n\t\t\treason: \"local-field-unknown\"\n\t\t} });\n\t\treturn localField;\n\t}) : [];\n\tconst { nullable, contradiction } = resolveToOneRelationNullable({\n\t\tdeclaredNullable: relationBuilder.__nullable,\n\t\tlocalFieldNullability: localFields.map((localField) => localField.__nullable === true),\n\t\townsReference: ownsForeignKey\n\t});\n\tif (contradiction !== void 0) throw contractError(\"CONTRACT.RELATION_INVALID\", !ownsForeignKey ? `${location} is required but does not own the foreign key, so nothing in storage guarantees the related document exists` : contradiction === \"declared-optional\" ? `${location} is optional but every local field it joins on is required` : `${location} is required but a local field it joins on is nullable`, { meta: {\n\t\tmodelName,\n\t\trelationName,\n\t\treason: \"to-one-nullability-mismatch\"\n\t} });\n\treturn nullable;\n}\nfunction buildRelation(modelName, relationName, relationBuilder, fields) {\n\tconst to = crossRef(relationBuilder.__to, UNBOUND_NAMESPACE_ID);\n\tconst on = relationBuilder.__on;\n\tif (on === void 0) return {\n\t\tto,\n\t\tcardinality: relationBuilder.__cardinality\n\t};\n\tif (relationBuilder.__cardinality === \"1:N\") return {\n\t\tto,\n\t\tcardinality: \"1:N\",\n\t\ton\n\t};\n\treturn {\n\t\tto,\n\t\tcardinality: relationBuilder.__cardinality,\n\t\tnullable: toOneRelationNullable(modelName, relationName, relationBuilder, on, fields),\n\t\ton\n\t};\n}\nfunction buildRelations(modelName, relations, fields) {\n\tconst builtRelations = {};\n\tfor (const [relationName, relationBuilder] of Object.entries(relations)) builtRelations[relationName] = buildRelation(modelName, relationName, relationBuilder, fields);\n\treturn builtRelations;\n}\nfunction buildValueObjects(valueObjects) {\n\tconst builtValueObjects = {};\n\tfor (const valueObjectBuilder of Object.values(valueObjects ?? {})) {\n\t\tif (valueObjectBuilder.__name in builtValueObjects) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `Duplicate value object name \"${valueObjectBuilder.__name}\" in defineContract().`, { meta: {\n\t\t\tkind: \"valueObject\",\n\t\t\tname: valueObjectBuilder.__name\n\t\t} });\n\t\tbuiltValueObjects[valueObjectBuilder.__name] = { fields: buildFields(valueObjectBuilder.__fields) };\n\t}\n\treturn builtValueObjects;\n}\nfunction buildModels(models) {\n\tconst builtModels = {};\n\tfor (const modelBuilder of Object.values(models ?? {})) {\n\t\tif (modelBuilder.__name in builtModels) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `Duplicate model name \"${modelBuilder.__name}\" in defineContract().`, { meta: {\n\t\t\tkind: \"model\",\n\t\t\tname: modelBuilder.__name\n\t\t} });\n\t\tconst storage = {\n\t\t\t...modelBuilder.__collection ? { collection: modelBuilder.__collection } : {},\n\t\t\t...modelBuilder.__storageRelations ? { relations: modelBuilder.__storageRelations } : {}\n\t\t};\n\t\tbuiltModels[modelBuilder.__name] = {\n\t\t\tfields: buildFields(modelBuilder.__fields),\n\t\t\trelations: buildRelations(modelBuilder.__name, modelBuilder.__relations, modelBuilder.__fields),\n\t\t\tstorage,\n\t\t\t...modelBuilder.__owner ? { owner: modelBuilder.__owner } : {},\n\t\t\t...modelBuilder.__base ? { base: crossRef(modelBuilder.__base, UNBOUND_NAMESPACE_ID) } : {},\n\t\t\t...modelBuilder.__discriminator ? { discriminator: modelBuilder.__discriminator } : {},\n\t\t\t...modelBuilder.__variants ? { variants: modelBuilder.__variants } : {}\n\t\t};\n\t}\n\treturn builtModels;\n}\nfunction deriveRoots(models) {\n\tconst roots = {};\n\tfor (const modelBuilder of Object.values(models ?? {})) {\n\t\tif (!modelBuilder.__collection || modelBuilder.__owner || modelBuilder.__base) continue;\n\t\troots[modelBuilder.__collection] = crossRef(modelBuilder.__name, UNBOUND_NAMESPACE_ID);\n\t}\n\treturn roots;\n}\nfunction normalizeRoots(roots) {\n\tconst normalizedRoots = {};\n\tfor (const [rootName, rootValue] of Object.entries(roots ?? {})) normalizedRoots[rootName] = crossRef(resolveModelName(rootValue), UNBOUND_NAMESPACE_ID);\n\treturn normalizedRoots;\n}\nfunction toStorageIndex(index) {\n\tconst input = { keys: Object.entries(index.fields).map(([field, direction]) => ({\n\t\tfield,\n\t\tdirection\n\t})) };\n\tif (index.options) {\n\t\tfor (const [key, value] of Object.entries(index.options)) if (value !== void 0) input[key] = value;\n\t}\n\treturn new MongoIndex(blindCast(input));\n}\nfunction toStorageCollectionOptions(opts) {\n\treturn new MongoCollectionOptions({\n\t\t...opts.capped ? { capped: {\n\t\t\tsize: opts.size ?? 0,\n\t\t\t...opts.max != null && { max: opts.max }\n\t\t} } : {},\n\t\t...ifDefined(\"storageEngine\", opts.storageEngine),\n\t\t...ifDefined(\"indexOptionDefaults\", opts.indexOptionDefaults),\n\t\t...ifDefined(\"collation\", opts.collation),\n\t\t...ifDefined(\"timeseries\", opts.timeseries),\n\t\t...opts.clusteredIndex !== void 0 && { clusteredIndex: opts.clusteredIndex.name !== void 0 ? { name: opts.clusteredIndex.name } : {} },\n\t\t...ifDefined(\"expireAfterSeconds\", opts.expireAfterSeconds),\n\t\t...ifDefined(\"changeStreamPreAndPostImages\", opts.changeStreamPreAndPostImages)\n\t});\n}\nfunction findMissingIndexField(index, modelFields) {\n\tfor (const fieldName of Object.keys(index.fields)) {\n\t\tconst wildcardMatch = fieldName.match(/^(.+)\\.\\$\\*\\*$/);\n\t\tconst lookupName = wildcardMatch ? wildcardMatch[1] : fieldName;\n\t\tif (lookupName === void 0 || lookupName.length === 0) continue;\n\t\tif (lookupName === \"$**\") continue;\n\t\tif (!Object.hasOwn(modelFields, lookupName)) return lookupName;\n\t}\n}\nfunction resolveVariantScope(modelBuilder, modelsByName) {\n\tif (!modelBuilder.__base) return void 0;\n\tconst baseBuilder = modelsByName[modelBuilder.__base];\n\tif (!baseBuilder) return void 0;\n\tconst discriminatorField = baseBuilder.__discriminator?.field;\n\tconst variantValue = baseBuilder.__variants?.[modelBuilder.__name]?.value;\n\tif (!discriminatorField || variantValue === void 0) return void 0;\n\treturn {\n\t\tdiscriminatorField,\n\t\tdiscriminatorValue: variantValue\n\t};\n}\nfunction scopeVariantIndex(storageIndex, scope, variantName, authoredIndex) {\n\tconst result = applyPolymorphicScopeToMongoIndex(storageIndex, scope);\n\tif (result.kind === \"conflict\") {\n\t\tconst indexLabel = authoredIndex ? canonicalStringify(authoredIndex) : \"<unknown>\";\n\t\tthrow contractError(\"CONTRACT.INDEX_INVALID\", `Variant model \"${variantName}\" index ${indexLabel} conflicts with discriminator scope: ${result.reason}`, { meta: {\n\t\t\tvariantName,\n\t\t\tindexLabel,\n\t\t\treason: result.reason\n\t\t} });\n\t}\n\treturn result.index;\n}\nfunction buildCollections(models) {\n\tconst intermediate = {};\n\tconst declaredIndexOwners = /* @__PURE__ */ new Map();\n\tconst modelMap = models ?? {};\n\tconst modelsByName = {};\n\tfor (const builder of Object.values(modelMap)) modelsByName[builder.__name] = builder;\n\tfor (const modelBuilder of Object.values(modelMap)) {\n\t\tif (!modelBuilder.__collection) {\n\t\t\tif (modelBuilder.__indexes && modelBuilder.__indexes.length > 0) throw contractError(\"CONTRACT.COLLECTION_INVALID\", `Model \"${modelBuilder.__name}\" defines indexes but has no collection to attach them to.`, { meta: {\n\t\t\t\tmodelName: modelBuilder.__name,\n\t\t\t\treason: \"indexes-without-collection\"\n\t\t\t} });\n\t\t\tif (modelBuilder.__collectionOptions) throw contractError(\"CONTRACT.COLLECTION_INVALID\", `Model \"${modelBuilder.__name}\" defines collectionOptions but has no collection to attach them to.`, { meta: {\n\t\t\t\tmodelName: modelBuilder.__name,\n\t\t\t\treason: \"collectionOptions-without-collection\"\n\t\t\t} });\n\t\t\tif (modelBuilder.__controlPolicy) throw contractError(\"CONTRACT.COLLECTION_INVALID\", `Model \"${modelBuilder.__name}\" defines controlPolicy but has no collection to attach it to.`, { meta: {\n\t\t\t\tmodelName: modelBuilder.__name,\n\t\t\t\treason: \"controlPolicy-without-collection\"\n\t\t\t} });\n\t\t\tcontinue;\n\t\t}\n\t\tconst existingCollection = intermediate[modelBuilder.__collection] ?? {};\n\t\tconst existingIndexes = existingCollection.indexes ?? [];\n\t\tif (existingCollection.options && modelBuilder.__collectionOptions) throw contractError(\"CONTRACT.COLLECTION_INVALID\", `Collection \"${modelBuilder.__collection}\" has collectionOptions declared by multiple models. Author collectionOptions on a single model per collection.`, { meta: {\n\t\t\tmodelName: modelBuilder.__name,\n\t\t\tcollection: modelBuilder.__collection,\n\t\t\treason: \"collectionOptions-declared-by-multiple-models\"\n\t\t} });\n\t\tif (existingCollection.control !== void 0 && modelBuilder.__controlPolicy) throw contractError(\"CONTRACT.COLLECTION_INVALID\", `Collection \"${modelBuilder.__collection}\" has controlPolicy declared by multiple models. Author controlPolicy on a single model per collection.`, { meta: {\n\t\t\tmodelName: modelBuilder.__name,\n\t\t\tcollection: modelBuilder.__collection,\n\t\t\treason: \"controlPolicy-declared-by-multiple-models\"\n\t\t} });\n\t\tfor (const collectionIndex of modelBuilder.__indexes ?? []) {\n\t\t\tconst missingField = findMissingIndexField(collectionIndex, modelBuilder.__fields);\n\t\t\tif (missingField !== void 0) {\n\t\t\t\tconst indexSignature = canonicalStringify(collectionIndex);\n\t\t\t\tthrow contractError(\"CONTRACT.FIELD_UNKNOWN\", `Model \"${modelBuilder.__name}\" index ${indexSignature} references unknown field \"${missingField}\".`, { meta: {\n\t\t\t\t\tmodelName: modelBuilder.__name,\n\t\t\t\t\tfieldName: missingField,\n\t\t\t\t\tindexSignature\n\t\t\t\t} });\n\t\t\t}\n\t\t}\n\t\tconst polymorphicScope = resolveVariantScope(modelBuilder, modelsByName);\n\t\tconst rawStorageIndexes = (modelBuilder.__indexes ?? []).map(toStorageIndex);\n\t\tconst storageIndexes = polymorphicScope ? rawStorageIndexes.map((idx, i) => scopeVariantIndex(idx, polymorphicScope, modelBuilder.__name, modelBuilder.__indexes?.[i])) : rawStorageIndexes;\n\t\tfor (let i = 0; i < storageIndexes.length; i++) {\n\t\t\tconst storageIndex = storageIndexes[i];\n\t\t\tif (storageIndex === void 0) continue;\n\t\t\tconst indexSignature = stableStringify(storageIndex);\n\t\t\tconst collectionIndexKey = `${modelBuilder.__collection}:${indexSignature}`;\n\t\t\tconst firstOwner = declaredIndexOwners.get(collectionIndexKey);\n\t\t\tif (firstOwner) {\n\t\t\t\tconst authoredIndex = modelBuilder.__indexes?.[i];\n\t\t\t\tconst reportedSignature = authoredIndex ? canonicalStringify(authoredIndex) : indexSignature;\n\t\t\t\tthrow contractError(\"CONTRACT.NAME_DUPLICATE\", `Collection \"${modelBuilder.__collection}\" defines duplicate index ${reportedSignature}. First declared on model \"${firstOwner}\" and duplicated on model \"${modelBuilder.__name}\".`, { meta: {\n\t\t\t\t\tkind: \"index\",\n\t\t\t\t\tname: reportedSignature,\n\t\t\t\t\tcollection: modelBuilder.__collection,\n\t\t\t\t\tfirst: firstOwner,\n\t\t\t\t\tsecond: modelBuilder.__name\n\t\t\t\t} });\n\t\t\t}\n\t\t\tdeclaredIndexOwners.set(collectionIndexKey, modelBuilder.__name);\n\t\t}\n\t\tconst storageOptions = modelBuilder.__collectionOptions ? toStorageCollectionOptions(modelBuilder.__collectionOptions) : void 0;\n\t\tconst controlPatch = modelBuilder.__controlPolicy !== void 0 ? { control: modelBuilder.__controlPolicy } : {};\n\t\tintermediate[modelBuilder.__collection] = storageIndexes.length > 0 ? {\n\t\t\t...existingCollection,\n\t\t\tindexes: [...existingIndexes, ...storageIndexes],\n\t\t\t...storageOptions ? { options: storageOptions } : {},\n\t\t\t...controlPatch\n\t\t} : storageOptions ? {\n\t\t\t...existingCollection,\n\t\t\toptions: storageOptions,\n\t\t\t...controlPatch\n\t\t} : Object.keys(controlPatch).length > 0 ? {\n\t\t\t...existingCollection,\n\t\t\t...controlPatch\n\t\t} : existingCollection;\n\t}\n\treturn intermediate;\n}\nfunction executionDefaultError(modelName, fieldName, reason, message) {\n\treturn contractError(\"CONTRACT.DEFAULT_INVALID\", `Field \"${modelName}.${fieldName}\" ${message}`, { meta: {\n\t\tmodelName,\n\t\tfieldName,\n\t\treason\n\t} });\n}\nfunction hasExecutionDefaults(fieldBuilder) {\n\tconst phases = fieldBuilder.__executionDefaults;\n\treturn phases?.onCreate !== void 0 || phases?.onUpdate !== void 0;\n}\nfunction assertNoValueObjectExecutionDefaults(valueObjects) {\n\tfor (const valueObjectBuilder of Object.values(valueObjects ?? {})) for (const [fieldName, fieldBuilder] of Object.entries(valueObjectBuilder.__fields)) if (hasExecutionDefaults(fieldBuilder)) throw executionDefaultError(valueObjectBuilder.__name, fieldName, \"executionDefaults-on-value-object\", \"has executionDefaults, but it belongs to a value object. Generated values are only supported on model fields.\");\n}\nfunction buildExecutionDefaults(models) {\n\tconst modelBuilders = Object.values(models ?? {});\n\tconst collectionByModelName = new Map(modelBuilders.map((modelBuilder) => [modelBuilder.__name, modelBuilder.__collection]));\n\tconst byRef = /* @__PURE__ */ new Map();\n\tconst defaults = [];\n\tfor (const modelBuilder of modelBuilders) for (const [fieldName, fieldBuilder] of Object.entries(modelBuilder.__fields)) {\n\t\tconst phases = fieldBuilder.__executionDefaults;\n\t\tif (!phases || !hasExecutionDefaults(fieldBuilder)) continue;\n\t\tconst modelName = modelBuilder.__name;\n\t\tif (fieldBuilder.__nullable) throw executionDefaultError(modelName, fieldName, \"nullable-with-executionDefaults\", \"cannot be nullable when executionDefaults are present.\");\n\t\tif (fieldBuilder.__many) throw executionDefaultError(modelName, fieldName, \"many-with-executionDefaults\", \"cannot be a list when executionDefaults are present.\");\n\t\tif (modelBuilder.__base !== void 0) {\n\t\t\tconst collection = modelBuilder.__collection ?? collectionByModelName.get(modelBuilder.__base);\n\t\t\tthrow executionDefaultError(modelName, fieldName, \"executionDefaults-on-variant\", `has executionDefaults, but \"${modelName}\" is a variant of \"${modelBuilder.__base}\". Execution defaults apply to every document in collection \"${collection}\", so declare them on the base model.`);\n\t\t}\n\t\tconst entry = modelBuilder.__collection;\n\t\tif (entry === void 0) throw executionDefaultError(modelName, fieldName, \"executionDefaults-without-collection\", \"has executionDefaults, but its model has no collection. Generated values are only supported on fields of a model stored in a collection.\");\n\t\tconst refKey = JSON.stringify([entry, fieldName]);\n\t\tconst phasesKey = canonicalStringify(phases);\n\t\tconst existing = byRef.get(refKey);\n\t\tif (existing !== void 0) {\n\t\t\tif (existing.phasesKey !== phasesKey) throw executionDefaultError(modelName, fieldName, \"executionDefaults-conflict\", `has different executionDefaults than \"${existing.modelName}.${fieldName}\", which is stored in the same collection \"${entry}\". Use the same executionDefaults on both models.`);\n\t\t\tcontinue;\n\t\t}\n\t\tbyRef.set(refKey, {\n\t\t\tmodelName,\n\t\t\tphasesKey\n\t\t});\n\t\tdefaults.push({\n\t\t\tref: {\n\t\t\t\tnamespace: UNBOUND_NAMESPACE_ID,\n\t\t\t\tentry,\n\t\t\t\tfield: fieldName\n\t\t\t},\n\t\t\t...phases\n\t\t});\n\t}\n\treturn defaults;\n}\nfunction buildContractFromDefinition(definition) {\n\tvalidateTargetPackRef(definition.family, definition.target);\n\tvalidateExtensionPackRefs(definition.target, definition.extensions);\n\tconst builtModels = buildModels(definition.models);\n\tconst builtValueObjects = buildValueObjects(definition.valueObjects);\n\tconst roots = definition.roots ? normalizeRoots(definition.roots) : deriveRoots(definition.models);\n\tconst capabilities = {};\n\tconst collections = buildCollections(definition.models);\n\tassertNoValueObjectExecutionDefaults(definition.valueObjects);\n\tconst execution = buildExecutionSection({\n\t\ttarget: definition.target.targetId,\n\t\ttargetFamily: definition.family.familyId,\n\t\tdefaults: buildExecutionDefaults(definition.models)\n\t});\n\tconst codecLookup = extractCodecLookup([definition.target]);\n\tconst storageValueSets = {};\n\tfor (const [enumName, handle] of Object.entries(definition.enums ?? {})) storageValueSets[enumName] = {\n\t\tkind: \"valueSet\",\n\t\tvalues: handle.values.map((v) => encodeEnumValue(v, handle.codecId, codecLookup))\n\t};\n\tconst unboundNamespace = buildMongoNamespace({\n\t\tid: UNBOUND_NAMESPACE_ID,\n\t\tentries: {\n\t\t\tcollection: collections,\n\t\t\t...ifDefined(\"valueSet\", Object.keys(storageValueSets).length > 0 ? storageValueSets : void 0)\n\t\t}\n\t});\n\tconst storageBody = { namespaces: { [UNBOUND_NAMESPACE_ID]: {\n\t\tid: UNBOUND_NAMESPACE_ID,\n\t\tcollections: unboundNamespace.entries.collection,\n\t\t...ifDefined(\"valueSet\", unboundNamespace.entries.valueSet)\n\t} } };\n\tconst storage = new MongoStorage({\n\t\tstorageHash: computeStorageHash({\n\t\t\ttarget: definition.target.targetId,\n\t\t\ttargetFamily: definition.family.familyId,\n\t\t\tstorage: storageBody,\n\t\t\t...mongoContractCanonicalizationHooks\n\t\t}),\n\t\tnamespaces: { [UNBOUND_NAMESPACE_ID]: unboundNamespace }\n\t});\n\tconst builtEnums = {};\n\tfor (const [enumName, handle] of Object.entries(definition.enums ?? {})) {\n\t\tif (enumName !== handle.enumName) throw contractError(\"CONTRACT.ENUM_INVALID\", `enum declaration key \"${enumName}\" must match enumType name \"${handle.enumName}\". Aliases are not supported.`, { meta: {\n\t\t\tenumName: handle.enumName,\n\t\t\tdeclaredKey: enumName,\n\t\t\treason: \"declaration-key-mismatch\"\n\t\t} });\n\t\tbuiltEnums[enumName] = {\n\t\t\tcodecId: handle.codecId,\n\t\t\tmembers: handle.enumMembers.map((m) => ({\n\t\t\t\tname: m.name,\n\t\t\t\tvalue: encodeEnumValue(m.value, handle.codecId, codecLookup)\n\t\t\t}))\n\t\t};\n\t}\n\tconst hasEnums = Object.keys(builtEnums).length > 0;\n\tfor (const [modelName, modelBuilder] of Object.entries(definition.models ?? {})) for (const [fieldName, fieldBuilder] of Object.entries(modelBuilder.__fields)) {\n\t\tconst handle = fieldBuilder.__enumHandle;\n\t\tif (handle && !(handle.enumName in builtEnums)) throw contractError(\"CONTRACT.ENUM_UNKNOWN\", `Model \"${modelName}\" field \"${fieldName}\" references enum \"${handle.enumName}\" which is not declared in defineContract({ enums: { ... } }).`, { meta: {\n\t\t\tmodelName,\n\t\t\tfieldName,\n\t\t\tenumName: handle.enumName\n\t\t} });\n\t}\n\treturn blindCast({\n\t\ttarget: definition.target.targetId,\n\t\ttargetFamily: definition.family.familyId,\n\t\t...ifDefined(\"defaultControlPolicy\", definition.defaultControlPolicy),\n\t\troots,\n\t\tdomain: { namespaces: { [UNBOUND_NAMESPACE_ID]: {\n\t\t\tmodels: builtModels,\n\t\t\t...Object.keys(builtValueObjects).length > 0 ? { valueObjects: builtValueObjects } : {},\n\t\t\t...hasEnums ? { enum: builtEnums } : {}\n\t\t} } },\n\t\tstorage,\n\t\tcapabilities,\n\t\textensions: definition.extensions ?? {},\n\t\tprofileHash: computeProfileHash({\n\t\t\ttarget: definition.target.targetId,\n\t\t\ttargetFamily: definition.family.familyId,\n\t\t\tcapabilities\n\t\t}),\n\t\tmeta: {},\n\t\t...ifDefined(\"execution\", execution)\n\t});\n}\n/** Implementation. */\nfunction buildBoundContract(family, target, definition, factory) {\n\tconst full = {\n\t\t...definition,\n\t\tfamily,\n\t\ttarget\n\t};\n\tif (factory !== void 0) {\n\t\tconst built = factory(composeMongoAuthoringHelpers(family, target, definition.extensions));\n\t\treturn buildContractFromDefinition({\n\t\t\t...full,\n\t\t\t...ifDefined(\"models\", built.models),\n\t\t\t...ifDefined(\"valueObjects\", built.valueObjects),\n\t\t\t...ifDefined(\"roots\", built.roots)\n\t\t});\n\t}\n\treturn buildContractFromDefinition(full);\n}\nfunction defineContract(definition, factory) {\n\tif (!isContractScaffold(definition)) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", \"defineContract expects a contract definition object. Define your contract with defineContract({ family, target, models, ... }).\");\n\tif (factory !== void 0) return buildBoundContract(definition.family, definition.target, definition, factory);\n\treturn buildBoundContract(definition.family, definition.target, definition);\n}\n//#endregion\nexport { bindEnumType, buildBoundContract, defineContract, enumType, field, index, isEnumTypeHandle, member, model, rel, valueObject };\n\n//# sourceMappingURL=contract-builder.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAS,gBAAgB,OAAO,SAAS,aAAa;CACrD,MAAM,QAAQ,YAAY,IAAI,OAAO;CACrC,IAAI,CAAC,OAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC;CAC1D,OAAO,MAAM,WAAW,KAAK;AAC9B;AACA,SAAS,gBAAgB,OAAO;CAC/B,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,IAAI,MAAM,IAAI,eAAe,CAAC,CAAC,KAAK,GAAG,EAAE;CAC1E,IAAI,SAAS,OAAO,UAAU,UAAU,OAAO,IAAI,OAAO,QAAQ,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,KAAK,cAAc,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,WAAW,GAAG,KAAK,UAAU,GAAG,EAAE,GAAG,gBAAgB,KAAK,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;CAClN,OAAO,KAAK,UAAU,KAAK;AAC5B;AACA,MAAM,6BAA6B;CAClC;CACA;CACA;CACA;CACA;AACD;AACA,SAAS,iBAAiB,YAAY,YAAY,MAAM;CACvD,iCAAiC,YAAY,WAAW,MAAM,IAAI;CAClE,MAAM,SAAS,gCAAgC,YAAY,IAAI;CAC/D,MAAM,cAAc;EACnB,GAAG,OAAO,YAAY,KAAK,IAAI,CAAC,SAAS,IAAI,CAAC;EAC9C,GAAG,OAAO,KAAK,CAAC,IAAI,IAAI,CAAC;EACzB,GAAG,OAAO,SAAS,CAAC,QAAQ,IAAI,CAAC;CAClC;CACA,IAAI,YAAY,SAAS,GAAG,MAAM,cAAc,sCAAsC,iBAAiB,WAAW,gBAAgB,YAAY,K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AACxC;AACA,SAAS,eAAe,YAAY,SAAS;CAC5C,IAAI,CAAC,mBAAmB,UAAU,GAAG,MAAM,cAAc,6BAA6B,iIAAiI;CACvN,IAAI,YAAY,KAAK,GAAG,OAAO,mBAAmB,WAAW,QAAQ,WAAW,QAAQ,YAAY,OAAO;CAC3G,OAAO,mBAAmB,WAAW,QAAQ,WAAW,QAAQ,UAAU;AAC3E"}
@@ -1,6 +1,6 @@
1
1
  import { o as MongoIndex } from "./entity-kinds-BFgLffz7-D8WUc2oo.mjs";
2
2
  import { f as encodeMongoValueSets, l as buildMongoStorage, m as validateMongoStorage } from "./dist-Dvr-nVtl.mjs";
3
- import { a as pairMongoBackRelations } from "./interpreter-lsgY0F-Q-BNJcdxhl.mjs";
3
+ import { a as pairMongoBackRelations } from "./interpreter-EqDVFiIr-C-rDel_u.mjs";
4
4
  import { isStructuredError } from "@prisma/orm-framework/utils/structured-error";
5
5
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
6
6
  import { crossRef } from "@prisma/orm-framework/contract/types";
@@ -1,2 +1,2 @@
1
- import { a as pairMongoBackRelations, i as mongoAttributeSpecs, n as derivePolymorphicJsonSchema, r as interpretPslDocumentToMongoContract, t as deriveJsonSchema } from "./interpreter-lsgY0F-Q-BNJcdxhl.mjs";
1
+ import { a as pairMongoBackRelations, i as mongoAttributeSpecs, n as derivePolymorphicJsonSchema, r as interpretPslDocumentToMongoContract, t as deriveJsonSchema } from "./interpreter-EqDVFiIr-C-rDel_u.mjs";
2
2
  export { deriveJsonSchema, derivePolymorphicJsonSchema, interpretPslDocumentToMongoContract, mongoAttributeSpecs, pairMongoBackRelations };
@@ -1,4 +1,4 @@
1
- import { r as interpretPslDocumentToMongoContract } from "./interpreter-lsgY0F-Q-BNJcdxhl.mjs";
1
+ import { r as interpretPslDocumentToMongoContract } from "./interpreter-EqDVFiIr-C-rDel_u.mjs";
2
2
  import { readFile } from "node:fs/promises";
3
3
  import { parse } from "@prisma/orm-framework/psl-parser/syntax";
4
4
  import { notOk } from "@prisma/orm-framework/utils/result";
@@ -1 +1 @@
1
- {"version":3,"file":"contract-psl__provider.mjs","names":[],"sources":["../../../../2-mongo-family/2-authoring/contract-psl/dist/exports/provider.mjs"],"sourcesContent":["import { t as interpretPslDocumentToMongoContract } from \"../interpreter-lsgY0F-Q.mjs\";\nimport { collectScalarTypeConstructors } from \"@internal/framework-components/authoring\";\nimport { buildSymbolTable, isPrismaNextSchema, mapPslDiagnostics } from \"@internal/psl-parser\";\nimport { withSeedDiagnostics } from \"@internal/psl-parser/interpret\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { notOk } from \"@internal/utils/result\";\nimport { readFile } from \"node:fs/promises\";\nimport { parse } from \"@internal/psl-parser/syntax\";\n//#region src/provider.ts\nfunction collectScalarTypeCodecIds(namespace) {\n\treturn new Map([...collectScalarTypeConstructors(namespace)].map(([name, output]) => [name, output.codecId]));\n}\nfunction mongoContract(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\treturn interpretPslDocumentToMongoContract({\n\t\t\t\t\tdocuments: input.documents,\n\t\t\t\t\tsymbolTable: input.symbolTable,\n\t\t\t\t\tsources: input.sources,\n\t\t\t\t\tseedDiagnostics: [],\n\t\t\t\t\tscalarTypeCodecIds: collectScalarTypeCodecIds(context.authoringContributions.type),\n\t\t\t\t\tcontrolMutationDefaults: {\n\t\t\t\t\t\t...context.controlMutationDefaults,\n\t\t\t\t\t\tdataTypeEntries: context.authoringContributions.dataTypes\n\t\t\t\t\t},\n\t\t\t\t\tcodecLookup: context.codecLookup,\n\t\t\t\t\tauthoringContributions: context.authoringContributions,\n\t\t\t\t\tcomposedExtensions: context.composedExtensions,\n\t\t\t\t\t...ifDefined(\"enumInferenceCodecs\", options?.enumInferenceCodecs),\n\t\t\t\t\t...ifDefined(\"reportWarning\", context.reportWarning)\n\t\t\t\t});\n\t\t\t},\n\t\t\tasync load(context) {\n\t\t\t\tconst candidates = [...new Set(context.resolvedInputs)].sort();\n\t\t\t\tif (candidates.length === 0) return notOk({\n\t\t\t\t\tsummary: \"No schema files matched the configured contract source\",\n\t\t\t\t\tdiagnostics: [{\n\t\t\t\t\t\tcode: \"PSL_NO_SCHEMA_FILES_MATCHED\",\n\t\t\t\t\t\tmessage: `No files matched the configured pattern \"${schemaPath}\"`,\n\t\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t\tconst readDiagnostics = [];\n\t\t\t\tconst members = [];\n\t\t\t\tconst undirected = [];\n\t\t\t\tfor (const path of candidates) {\n\t\t\t\t\tlet text;\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttext = await readFile(path, \"utf-8\");\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconst message = String(error);\n\t\t\t\t\t\treadDiagnostics.push({\n\t\t\t\t\t\t\tcode: \"PSL_SCHEMA_READ_FAILED\",\n\t\t\t\t\t\t\tmessage,\n\t\t\t\t\t\t\tsourceId: path\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (isPrismaNextSchema(text)) members.push({\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\ttext\n\t\t\t\t\t});\n\t\t\t\t\telse undirected.push(path);\n\t\t\t\t}\n\t\t\t\tif (members.length === 0) {\n\t\t\t\t\tif (undirected.length === 0) return notOk({\n\t\t\t\t\t\tsummary: \"Failed to read Prisma schema files\",\n\t\t\t\t\t\tdiagnostics: readDiagnostics\n\t\t\t\t\t});\n\t\t\t\t\treturn notOk({\n\t\t\t\t\t\tsummary: \"No schema file carries the \\\"// use prisma-8\\\" directive\",\n\t\t\t\t\t\tdiagnostics: [...readDiagnostics, {\n\t\t\t\t\t\t\tcode: \"PSL_NO_OPTED_IN_SCHEMA_FILES\",\n\t\t\t\t\t\t\tmessage: `None of the matched files carry the \"// use prisma-8\" directive: ${undirected.join(\", \")}`,\n\t\t\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tconst parsed = members.map(({ path, text }) => parse(text, path));\n\t\t\t\tconst documents = parsed.map(({ document }) => document);\n\t\t\t\tconst [firstSources, ...restSources] = parsed.map(({ sources }) => sources);\n\t\t\t\tassertDefined(firstSources, \"mongoContract requires at least one parsed schema file\");\n\t\t\t\tconst sources = firstSources.merge(...restSources);\n\t\t\t\tconst { symbolTable, diagnostics: symbolTableDiagnostics } = buildSymbolTable({\n\t\t\t\t\tdocuments,\n\t\t\t\t\tsources,\n\t\t\t\t\tpslBlockDescriptors: context.authoringContributions.pslBlockDescriptors\n\t\t\t\t});\n\t\t\t\tconst seedDiagnostics = [...readDiagnostics, ...mapPslDiagnostics([...parsed.flatMap(({ diagnostics }) => diagnostics), ...symbolTableDiagnostics], sources)];\n\t\t\t\treturn withSeedDiagnostics(this.interpret({\n\t\t\t\t\tdocuments,\n\t\t\t\t\tsources,\n\t\t\t\t\tsymbolTable\n\t\t\t\t}, context), seedDiagnostics);\n\t\t\t}\n\t\t},\n\t\t...ifDefined(\"output\", options?.output)\n\t};\n}\n//#endregion\nexport { mongoContract };\n\n//# sourceMappingURL=provider.mjs.map"],"mappings":";;;;;;;;;;AAUA,SAAS,0BAA0B,WAAW;CAC7C,OAAO,IAAI,IAAI,CAAC,GAAG,8BAA8B,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,YAAY,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;AAC7G;AACA,SAAS,cAAc,YAAY,SAAS;CAC3C,OAAO;EACN,QAAQ;GACP,QAAQ;GACR,QAAQ,CAAC,UAAU;GACnB,UAAU,OAAO,SAAS;IACzB,OAAO,oCAAoC;KAC1C,WAAW,MAAM;KACjB,aAAa,MAAM;KACnB,SAAS,MAAM;KACf,iBAAiB,CAAC;KACl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AAY,OAAO,KAAK,EAAE,eAAe,QAAQ;IACvD,MAAM,CAAC,cAAc,GAAG,eAAe,OAAO,KAAK,EAAE,cAAc,OAAO;IAC1E,cAAc,cAAc,wDAAwD;IACpF,MAAM,UAAU,aAAa,MAAM,GAAG,WAAW;IACjD,MAAM,EAAE,aAAa,aAAa,2BAA2B,iBAAiB;KAC7E;KACA;KACA,qBAAqB,QAAQ,uBAAuB;IACrD,CAAC;IACD,MAAM,kBAAkB,CAAC,GAAG,iBAAiB,GAAG,kBAAkB,CAAC,GAAG,OAAO,SAAS,EAAE,kBAAkB,WAAW,GAAG,GAAG,sBAAsB,GAAG,OAAO,CAAC;IAC5J,OAAO,oBAAoB,KAAK,UAAU;KACzC;KACA;KACA;IACD,GAAG,OAAO,GAAG,eAAe;GAC7B;EACD;EACA,GAAG,UAAU,UAAU,SAAS,MAAM;CACvC;AACD"}
1
+ {"version":3,"file":"contract-psl__provider.mjs","names":[],"sources":["../../../../2-mongo-family/2-authoring/contract-psl/dist/exports/provider.mjs"],"sourcesContent":["import { t as interpretPslDocumentToMongoContract } from \"../interpreter-EqDVFiIr.mjs\";\nimport { collectScalarTypeConstructors } from \"@internal/framework-components/authoring\";\nimport { buildSymbolTable, isPrismaNextSchema, mapPslDiagnostics } from \"@internal/psl-parser\";\nimport { withSeedDiagnostics } from \"@internal/psl-parser/interpret\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { notOk } from \"@internal/utils/result\";\nimport { readFile } from \"node:fs/promises\";\nimport { parse } from \"@internal/psl-parser/syntax\";\n//#region src/provider.ts\nfunction collectScalarTypeCodecIds(namespace) {\n\treturn new Map([...collectScalarTypeConstructors(namespace)].map(([name, output]) => [name, output.codecId]));\n}\nfunction mongoContract(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\treturn interpretPslDocumentToMongoContract({\n\t\t\t\t\tdocuments: input.documents,\n\t\t\t\t\tsymbolTable: input.symbolTable,\n\t\t\t\t\tsources: input.sources,\n\t\t\t\t\tseedDiagnostics: [],\n\t\t\t\t\tscalarTypeCodecIds: collectScalarTypeCodecIds(context.authoringContributions.type),\n\t\t\t\t\tcontrolMutationDefaults: {\n\t\t\t\t\t\t...context.controlMutationDefaults,\n\t\t\t\t\t\tdataTypeEntries: context.authoringContributions.dataTypes\n\t\t\t\t\t},\n\t\t\t\t\tcodecLookup: context.codecLookup,\n\t\t\t\t\tauthoringContributions: context.authoringContributions,\n\t\t\t\t\tcomposedExtensions: context.composedExtensions,\n\t\t\t\t\t...ifDefined(\"enumInferenceCodecs\", options?.enumInferenceCodecs),\n\t\t\t\t\t...ifDefined(\"reportWarning\", context.reportWarning)\n\t\t\t\t});\n\t\t\t},\n\t\t\tasync load(context) {\n\t\t\t\tconst candidates = [...new Set(context.resolvedInputs)].sort();\n\t\t\t\tif (candidates.length === 0) return notOk({\n\t\t\t\t\tsummary: \"No schema files matched the configured contract source\",\n\t\t\t\t\tdiagnostics: [{\n\t\t\t\t\t\tcode: \"PSL_NO_SCHEMA_FILES_MATCHED\",\n\t\t\t\t\t\tmessage: `No files matched the configured pattern \"${schemaPath}\"`,\n\t\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t\tconst readDiagnostics = [];\n\t\t\t\tconst members = [];\n\t\t\t\tconst undirected = [];\n\t\t\t\tfor (const path of candidates) {\n\t\t\t\t\tlet text;\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttext = await readFile(path, \"utf-8\");\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconst message = String(error);\n\t\t\t\t\t\treadDiagnostics.push({\n\t\t\t\t\t\t\tcode: \"PSL_SCHEMA_READ_FAILED\",\n\t\t\t\t\t\t\tmessage,\n\t\t\t\t\t\t\tsourceId: path\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (isPrismaNextSchema(text)) members.push({\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\ttext\n\t\t\t\t\t});\n\t\t\t\t\telse undirected.push(path);\n\t\t\t\t}\n\t\t\t\tif (members.length === 0) {\n\t\t\t\t\tif (undirected.length === 0) return notOk({\n\t\t\t\t\t\tsummary: \"Failed to read Prisma schema files\",\n\t\t\t\t\t\tdiagnostics: readDiagnostics\n\t\t\t\t\t});\n\t\t\t\t\treturn notOk({\n\t\t\t\t\t\tsummary: \"No schema file carries the \\\"// use prisma-8\\\" directive\",\n\t\t\t\t\t\tdiagnostics: [...readDiagnostics, {\n\t\t\t\t\t\t\tcode: \"PSL_NO_OPTED_IN_SCHEMA_FILES\",\n\t\t\t\t\t\t\tmessage: `None of the matched files carry the \"// use prisma-8\" directive: ${undirected.join(\", \")}`,\n\t\t\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tconst parsed = members.map(({ path, text }) => parse(text, path));\n\t\t\t\tconst documents = parsed.map(({ document }) => document);\n\t\t\t\tconst [firstSources, ...restSources] = parsed.map(({ sources }) => sources);\n\t\t\t\tassertDefined(firstSources, \"mongoContract requires at least one parsed schema file\");\n\t\t\t\tconst sources = firstSources.merge(...restSources);\n\t\t\t\tconst { symbolTable, diagnostics: symbolTableDiagnostics } = buildSymbolTable({\n\t\t\t\t\tdocuments,\n\t\t\t\t\tsources,\n\t\t\t\t\tpslBlockDescriptors: context.authoringContributions.pslBlockDescriptors\n\t\t\t\t});\n\t\t\t\tconst seedDiagnostics = [...readDiagnostics, ...mapPslDiagnostics([...parsed.flatMap(({ diagnostics }) => diagnostics), ...symbolTableDiagnostics], sources)];\n\t\t\t\treturn withSeedDiagnostics(this.interpret({\n\t\t\t\t\tdocuments,\n\t\t\t\t\tsources,\n\t\t\t\t\tsymbolTable\n\t\t\t\t}, context), seedDiagnostics);\n\t\t\t}\n\t\t},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ACpB,MAAM;OACN;OACA,UAAU;MACX,CAAC;MACD;KACD;KACA,IAAI,mBAAmB,IAAI,GAAG,QAAQ,KAAK;MAC1C;MACA;KACD,CAAC;UACI,WAAW,KAAK,IAAI;IAC1B;IACA,IAAI,QAAQ,WAAW,GAAG;KACzB,IAAI,WAAW,WAAW,GAAG,OAAO,MAAM;MACzC,SAAS;MACT,aAAa;KACd,CAAC;KACD,OAAO,MAAM;MACZ,SAAS;MACT,aAAa,CAAC,GAAG,iBAAiB;OACjC,MAAM;OACN,SAAS,oEAAoE,WAAW,KAAK,IAAI;OACjG,UAAU;MACX,CAAC;KACF,CAAC;IACF;IACA,MAAM,SAAS,QAAQ,KAAK,EAAE,MAAM,WAAW,MAAM,MAAM,IAAI,CAAC;IAChE,MAAM,YAAY,OAAO,KAAK,EAAE,eAAe,QAAQ;IACvD,MAAM,CAAC,cAAc,GAAG,eAAe,OAAO,KAAK,EAAE,cAAc,OAAO;IAC1E,cAAc,cAAc,wDAAwD;IACpF,MAAM,UAAU,aAAa,MAAM,GAAG,WAAW;IACjD,MAAM,EAAE,aAAa,aAAa,2BAA2B,iBAAiB;KAC7E;KACA;KACA,qBAAqB,QAAQ,uBAAuB;IACrD,CAAC;IACD,MAAM,kBAAkB,CAAC,GAAG,iBAAiB,GAAG,kBAAkB,CAAC,GAAG,OAAO,SAAS,EAAE,kBAAkB,WAAW,GAAG,GAAG,sBAAsB,GAAG,OAAO,CAAC;IAC5J,OAAO,oBAAoB,KAAK,UAAU;KACzC;KACA;KACA;IACD,GAAG,OAAO,GAAG,eAAe;GAC7B;EACD;EACA,GAAG,UAAU,UAAU,SAAS,MAAM;CACvC;AACD"}
@@ -1,3 +1,3 @@
1
1
  import { n as typescriptContract, r as typescriptContractFromPath, t as ContractConfig } from "./config-types-CQOf5N7R.mjs";
2
- import { C as model, S as member, T as valueObject, _ as defineContract, a as ContractScaffold, b as index, c as ExtractCodecTypesFromPack, d as ModelBuilder, f as MongoContractResult, g as buildBoundContract, h as bindEnumType, i as ContractFactory, l as FieldBuilder, m as ValueObjectBuilder, n as CodecTypeMap, o as EnumMember, p as RelationBuilder, r as ContractDefinition, s as EnumTypeHandle, t as BoundEnumType, u as FieldReference, v as enumType, w as rel, x as isEnumTypeHandle, y as field } from "./contract-builder-DUX8KLUR.mjs";
2
+ import { C as model, S as member, T as valueObject, _ as defineContract, a as ContractScaffold, b as index, c as ExtractCodecTypesFromPack, d as ModelBuilder, f as MongoContractResult, g as buildBoundContract, h as bindEnumType, i as ContractFactory, l as FieldBuilder, m as ValueObjectBuilder, n as CodecTypeMap, o as EnumMember, p as RelationBuilder, r as ContractDefinition, s as EnumTypeHandle, t as BoundEnumType, u as FieldReference, v as enumType, w as rel, x as isEnumTypeHandle, y as field } from "./contract-builder-CCmw_x_e.mjs";
3
3
  export { type BoundEnumType, type CodecTypeMap, type ContractConfig, type ContractDefinition, type ContractFactory, type ContractScaffold, type EnumMember, type EnumTypeHandle, type ExtractCodecTypesFromPack, type FieldBuilder, type FieldReference, type ModelBuilder, type MongoContractResult, type RelationBuilder, type ValueObjectBuilder, bindEnumType, buildBoundContract, defineContract, enumType, field, index, isEnumTypeHandle, member, model, rel, typescriptContract, typescriptContractFromPath, valueObject };
@@ -1,3 +1,3 @@
1
1
  import { n as typescriptContractFromPath, t as typescriptContract } from "./config-types-x4rKdA0F.mjs";
2
- import { a as field, c as member, d as valueObject, i as enumType, l as model, n as buildBoundContract, o as index, r as defineContract, s as isEnumTypeHandle, t as bindEnumType, u as rel } from "./contract-builder-ckSdJi66.mjs";
2
+ import { a as field, c as member, d as valueObject, i as enumType, l as model, n as buildBoundContract, o as index, r as defineContract, s as isEnumTypeHandle, t as bindEnumType, u as rel } from "./contract-builder-DpMMVErz.mjs";
3
3
  export { bindEnumType, buildBoundContract, defineContract, enumType, field, index, isEnumTypeHandle, member, model, rel, typescriptContract, typescriptContractFromPath, valueObject };
@@ -1,2 +1,2 @@
1
- import { C as model, S as member, T as valueObject, _ as defineContract, a as ContractScaffold, b as index, c as ExtractCodecTypesFromPack, d as ModelBuilder, f as MongoContractResult, g as buildBoundContract, h as bindEnumType, i as ContractFactory, l as FieldBuilder, m as ValueObjectBuilder, n as CodecTypeMap, o as EnumMember, p as RelationBuilder, r as ContractDefinition, s as EnumTypeHandle, t as BoundEnumType, u as FieldReference, v as enumType, w as rel, x as isEnumTypeHandle, y as field } from "./contract-builder-DUX8KLUR.mjs";
1
+ import { C as model, S as member, T as valueObject, _ as defineContract, a as ContractScaffold, b as index, c as ExtractCodecTypesFromPack, d as ModelBuilder, f as MongoContractResult, g as buildBoundContract, h as bindEnumType, i as ContractFactory, l as FieldBuilder, m as ValueObjectBuilder, n as CodecTypeMap, o as EnumMember, p as RelationBuilder, r as ContractDefinition, s as EnumTypeHandle, t as BoundEnumType, u as FieldReference, v as enumType, w as rel, x as isEnumTypeHandle, y as field } from "./contract-builder-CCmw_x_e.mjs";
2
2
  export { type BoundEnumType, type CodecTypeMap, type ContractDefinition, type ContractFactory, type ContractScaffold, type EnumMember, type EnumTypeHandle, type ExtractCodecTypesFromPack, type FieldBuilder, type FieldReference, type ModelBuilder, type MongoContractResult, type RelationBuilder, type ValueObjectBuilder, bindEnumType, buildBoundContract, defineContract, enumType, field, index, isEnumTypeHandle, member, model, rel, valueObject };
@@ -1,2 +1,2 @@
1
- import { a as field, c as member, d as valueObject, i as enumType, l as model, n as buildBoundContract, o as index, r as defineContract, s as isEnumTypeHandle, t as bindEnumType, u as rel } from "./contract-builder-ckSdJi66.mjs";
1
+ import { a as field, c as member, d as valueObject, i as enumType, l as model, n as buildBoundContract, o as index, r as defineContract, s as isEnumTypeHandle, t as bindEnumType, u as rel } from "./contract-builder-DpMMVErz.mjs";
2
2
  export { bindEnumType, buildBoundContract, defineContract, enumType, field, index, isEnumTypeHandle, member, model, rel, valueObject };
@@ -1,7 +1,7 @@
1
1
  import { n as CreateCollectionOptions$1, r as CreateIndexesOptions, t as CollationOptions } from "./mongodb-types-B4HmhF1S.mjs";
2
2
  import { A as MongoIndexKey, j as MongoIndexKeyDirection } from "./mongo-value-set-BngSUlOh-BhDGXjM_.mjs";
3
3
  import "./index-CLPkwReD.mjs";
4
- import { B as MongoFilterExpr, D as MongoAstNode, rt as MongoQueryPlan } from "./query-plan-C0-Yu8hf-DdilEdW6.mjs";
4
+ import { B as MongoFilterExpr, D as MongoAstNode, rt as MongoQueryPlan } from "./query-plan-C0-Yu8hf-BnYfzKMn.mjs";
5
5
  import { MigrationPlanOperation } from "@prisma/orm-framework/components/control";
6
6
  //#region ../../../2-mongo-family/4-query/query-ast/dist/exports/control.d.mts
7
7
  //#region src/inspection-commands.d.ts
@@ -190,4 +190,4 @@ interface MongoDataTransformOperation extends MigrationPlanOperation {
190
190
  type AnyMongoMigrationOperation = MongoMigrationPlanOperation | MongoDataTransformOperation;
191
191
  //#endregion
192
192
  export { keysToKeySpec as C, defaultMongoIndexName as S, MongoInspectionCommandVisitor as _, CollModOptions as a, MongoMigrationStep as b, CreateIndexCommand as c, DropIndexCommand as d, ListCollectionsCommand as f, MongoDdlCommandVisitor as g, MongoDataTransformOperation as h, CollModCommand as i, CreateIndexOptions as l, MongoDataTransformCheck as m, AnyMongoInspectionCommand as n, CreateCollectionCommand as o, ListIndexesCommand as p, AnyMongoMigrationOperation as r, CreateCollectionOptions as s, AnyMongoDdlCommand as t, DropCollectionCommand as u, MongoMigrationCheck as v, buildIndexOpId as x, MongoMigrationPlanOperation as y };
193
- //# sourceMappingURL=control-DNe7Gps7.d.mts.map
193
+ //# sourceMappingURL=control-BKLGhv19.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"control-DNe7Gps7.d.mts","names":[],"sources":["../../../../2-mongo-family/4-query/query-ast/dist/exports/control.d.mts"],"mappings":";;;;;;;cAKc,2BAA2B;WAC9B;WACA;EACT,YAAY;EACZ,OAAO,GAAG,SAAS,8BAA8B,KAAK;;cAE1C,+BAA+B;WAClC;EACT;EACA,OAAO,GAAG,SAAS,8BAA8B,KAAK;;KAEnD,4BA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,qBAAqB,mBAAmB,0BAA0B,wBAAwB;;;iBAGnG,eAAe,yBAAyB,oBAAoB,MAAM,cAAc;iBAChF,sBAAsB,MAAM,cAAc;iBAC1C,cAAc,MAAM,cAAc,iBAAmB,eAAe;;;UAG3E;WACC;WACA,QAAQ;WACR,QAAQ;WACR;;UAED;WACC;WACA,SAAS;;UAEV,oCAAoC;WACnC,mBAAmB;WACnB,kBAAkB;WAClB,oBAAoB;;UAErB;WACC;WACA,QAAQ;WACR,QAAQ;WACR;;UAED,oCAAoC;WACnC;;;;WAIA;;;;;;WAMA;WACA,mBAAmB;WACnB,cAAc;WACd,oBAAoB;;KAE1B,6BAA6B,8BAA8B"}
1
+ {"version":3,"file":"control-BKLGhv19.d.mts","names":[],"sources":["../../../../2-mongo-family/4-query/query-ast/dist/exports/control.d.mts"],"mappings":";;;;;;;cAKc,2BAA2B;WAC9B;WACA;EACT,YAAY;EACZ,OAAO,GAAG,SAAS,8BAA8B,KAAK;;cAE1C,+BAA+B;WAClC;EACT;EACA,OAAO,GAAG,SAAS,8BAA8B,KAAK;;KAEnD,4BAA4B,qBAAqB;;;UAG5C,uBAAuB;EAC/B,YAAY,SAAS,qBAAqB;EAC1C,UAAU,SAAS,mBAAmB;EACtC,iBAAiB,SAAS,0BAA0B;EACpD,eAAe,SAAS,wBAAwB;EAChD,QAAQ,SAAS,iBAAiB;;UAE1B,8BAA8B;EACtC,YAAY,SAAS,qBAAqB;EAC1C,gBAAgB,SAAS,yBAAyB;;;;UAI1C;WACC;WACA;WACA;WACA,0BAA0B;WAC1B;WACA,qBAAqB;WACrB,YAAY;WACZ,UAAU;WACV;WACA;;cAEG,2BAA2B,wBAAwB;WACtD;WACA;WACA,MAAM,cAAc;WACpB;WACA;WACA;WACA,0BAA0B;WAC1B;WACA,qBAAqB;WACrB,YAAY;WACZ,UAAU;WACV;WACA;EACT,YAAY,oBAAoB,MAAM,cAAc,gBAAkB,UAAU;EAChF,OAAO,GAAG,SAAS,uBAAuB,KAAK;;cAEnC,yBAAyB;WAC5B;WACA;WACA;EACT,YAAY,oBAAoB;EAChC,OAAO,GAAG,SAAS,uBAAuB,KAAK;;UAEvC;WACC,YAAY;WACZ;WACA;WACA;WACA;WACA;WACA;IACP;IACA;IACA;;WAEO,YAAY;WACZ;IACP;;WAEO;IACP,KAAK;IACL;IACA;;;cAGU,gCAAgC,wBAAwB;WAC3D;WACA;WACA,YAAY;WACZ;WACA;WACA;WACA;WACA;WACA;IACP;IACA;IACA;;WAEO,YAAY;WACZ;IACP;;WAEO;IACP,KAAK;IACL;IACA;;EAEF,YAAY,oBAAoB,UAAU;EAC1C,OAAO,GAAG,SAAS,uBAAuB,KAAK;;cAEnC,8BAA8B;WACjC;WACA;EACT,YAAY;EACZ,OAAO,GAAG,SAAS,uBAAuB,KAAK;;UAEvC;WACC,YAAY;WACZ;WACA;WACA;IACP;;;cAGU,uBAAuB;WAC1B;WACA;WACA,YAAY;WACZ;WACA;WACA;IACP;;EAEF,YAAY,oBAAoB,SAAS;EACzC,OAAO,GAAG,SAAS,uBAAuB,KAAK;;KAE5C,qBAAqB,qBAAqB,mBAAmB,0BAA0B,wBAAwB;;;iBAGnG,eAAe,yBAAyB,oBAAoB,MAAM,cAAc;iBAChF,sBAAsB,MAAM,cAAc;iBAC1C,cAAc,MAAM,cAAc,iBAAmB,eAAe;;;UAG3E;WACC;WACA,QAAQ;WACR,QAAQ;WACR;;UAED;WACC;WACA,SAAS;;UAEV,oCAAoC;WACnC,mBAAmB;WACnB,kBAAkB;WAClB,oBAAoB;;UAErB;WACC;WACA,QAAQ;WACR,QAAQ;WACR;;UAED,oCAAoC;WACnC;;;;WAIA;;;;;;WAMA;WACA,mBAAmB;WACnB,cAAc;WACd,oBAAoB;;KAE1B,6BAA6B,8BAA8B"}
@@ -1,8 +1,8 @@
1
1
  import { t as mongoContractCanonicalizationHooks } from "./canonicalization-hooks-CRVM-Kqh-Qi-VmEVg.mjs";
2
- import { i as mongoAttributeSpecs } from "./interpreter-lsgY0F-Q-BNJcdxhl.mjs";
2
+ import { i as mongoAttributeSpecs } from "./interpreter-EqDVFiIr-C-rDel_u.mjs";
3
3
  import { t as mongoEmission } from "./exports-BSUZo1ZX.mjs";
4
4
  import { i as verifyMongoSchema } from "./verify-mongo-schema-B0bMHQW0-BuK0Jv5S.mjs";
5
- import { n as mongoFamilyPslBlockDescriptors, t as mongoFamilyEntityTypes } from "./authoring-entity-types-DkFfee0x-DzGu9hUw.mjs";
5
+ import { n as mongoFamilyPslBlockDescriptors, t as mongoFamilyEntityTypes } from "./authoring-entity-types-CZX-S_hY-w2tu7EVk.mjs";
6
6
  import { t as MongoContractSerializer } from "./mongo-contract-serializer-DC_DM9_Y-BCyJeFBM.mjs";
7
7
  import { structuredError } from "@prisma/orm-framework/utils/structured-error";
8
8
  import { blindCast } from "@prisma/orm-framework/utils/casts";
@@ -402,4 +402,4 @@ const mongoFamilyDescriptor = new MongoFamilyDescriptor();
402
402
  //#endregion
403
403
  export { mongoOperationsToPreview as i, formatMongoOperations as n, mongoFamilyDescriptor as r, createMongoFamilyInstance as t };
404
404
 
405
- //# sourceMappingURL=control-1yLRoWrD.mjs.map
405
+ //# sourceMappingURL=control-DRB8P8fy.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"control-1yLRoWrD.mjs","names":[],"sources":["../../../../2-mongo-family/9-family/dist/control.mjs"],"sourcesContent":["import { i as contractToMongoSchemaIR, n as canonicalizeSchemasForVerification, r as diffMongoSchemas, t as verifyMongoSchema } from \"./verify-mongo-schema-B0bMHQW0.mjs\";\nimport { n as mongoFamilyPslBlockDescriptors, t as mongoFamilyEntityTypes } from \"./authoring-entity-types-DkFfee0x.mjs\";\nimport { t as MongoContractSerializer } from \"./mongo-contract-serializer-DC_DM9_Y.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { mongoAttributeSpecs } from \"@internal/mongo-contract-psl\";\nimport { mongoEmission } from \"@internal/mongo-emitter\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { APP_SPACE_ID, SchemaTreeNode, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_TARGET_MISMATCH } from \"@internal/framework-components/control\";\nimport { mongoContractCanonicalizationHooks } from \"@internal/mongo-contract/canonicalization-hooks\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { assertDescriptorSelfConsistency } from \"@internal/migration-tools/spaces\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/core/operation-preview.ts\nfunction formatKeySpec(keys) {\n\treturn `{ ${keys.map((k) => `${JSON.stringify(k.field)}: ${JSON.stringify(k.direction)}`).join(\", \")} }`;\n}\nconst COMMAND_META_KEYS = /* @__PURE__ */ new Set([\n\t\"kind\",\n\t\"collection\",\n\t\"keys\"\n]);\nfunction formatOptionEntries(cmd) {\n\tconst parts = Object.entries(cmd).filter(([key, value]) => !COMMAND_META_KEYS.has(key) && value !== void 0).map(([key, value]) => `${key}: ${JSON.stringify(value)}`);\n\tif (parts.length === 0) return void 0;\n\treturn `{ ${parts.join(\", \")} }`;\n}\nfunction formatOptions(cmd) {\n\treturn formatOptionEntries(cmd);\n}\nfunction formatCreateCollectionOptions(cmd) {\n\treturn formatOptionEntries(cmd);\n}\nvar MongoDdlCommandFormatter = class {\n\tcreateIndex(cmd) {\n\t\tconst keySpec = formatKeySpec(cmd.keys);\n\t\tconst opts = formatOptions(cmd);\n\t\treturn opts ? `db.${cmd.collection}.createIndex(${keySpec}, ${opts})` : `db.${cmd.collection}.createIndex(${keySpec})`;\n\t}\n\tdropIndex(cmd) {\n\t\treturn `db.${cmd.collection}.dropIndex(${JSON.stringify(cmd.name)})`;\n\t}\n\tcreateCollection(cmd) {\n\t\tconst opts = formatCreateCollectionOptions(cmd);\n\t\treturn opts ? `db.createCollection(${JSON.stringify(cmd.collection)}, ${opts})` : `db.createCollection(${JSON.stringify(cmd.collection)})`;\n\t}\n\tdropCollection(cmd) {\n\t\treturn `db.${cmd.collection}.drop()`;\n\t}\n\tcollMod(cmd) {\n\t\tconst parts = [`collMod: ${JSON.stringify(cmd.collection)}`];\n\t\tfor (const [key, value] of Object.entries(cmd)) if (!COMMAND_META_KEYS.has(key) && value !== void 0) parts.push(`${key}: ${JSON.stringify(value)}`);\n\t\treturn `db.runCommand({ ${parts.join(\", \")} })`;\n\t}\n};\nconst formatter = new MongoDdlCommandFormatter();\nfunction formatMongoOperations(operations) {\n\tconst statements = [];\n\tfor (const operation of operations) {\n\t\tconst candidate = operation;\n\t\tif (!(\"execute\" in candidate) || !Array.isArray(candidate[\"execute\"])) continue;\n\t\tfor (const step of candidate[\"execute\"]) if (step.command && typeof step.command.accept === \"function\") statements.push(step.command.accept(formatter));\n\t}\n\treturn statements;\n}\n/**\n* Wraps `formatMongoOperations` into the family-agnostic\n* `OperationPreview` shape. Each statement carries\n* `language: 'mongodb-shell'`. Mirrors `sqlOperationsToPreview`.\n*/\nfunction mongoOperationsToPreview(operations) {\n\treturn { statements: formatMongoOperations(operations).map((text) => ({\n\t\ttext,\n\t\tlanguage: \"mongodb-shell\"\n\t})) };\n}\n//#endregion\n//#region src/core/schema-to-view.ts\nfunction mongoSchemaToView(schema) {\n\tconst collectionNodes = schema.collections.map((collection) => collectionToSchemaNode(collection.name, collection));\n\treturn { root: new SchemaTreeNode({\n\t\tkind: \"root\",\n\t\tid: \"mongo-schema\",\n\t\tlabel: \"database\",\n\t\t...ifDefined(\"children\", collectionNodes.length > 0 ? collectionNodes : void 0)\n\t}) };\n}\nfunction collectionToSchemaNode(name, collection) {\n\tconst children = [];\n\tfor (const index of collection.indexes) {\n\t\tconst keysSummary = index.keys.map((k) => {\n\t\t\tif (k.direction === 1) return k.field;\n\t\t\tif (k.direction === -1) return `${k.field} desc`;\n\t\t\treturn `${k.field} ${k.direction}`;\n\t\t}).join(\", \");\n\t\tconst prefix = index.unique ? \"unique index\" : \"index\";\n\t\tconst options = [];\n\t\tif (index.sparse) options.push(\"sparse\");\n\t\tif (index.expireAfterSeconds != null) options.push(`ttl: ${index.expireAfterSeconds}s`);\n\t\tif (index.partialFilterExpression) options.push(\"partial\");\n\t\tconst optsSuffix = options.length > 0 ? ` (${options.join(\", \")})` : \"\";\n\t\tchildren.push(new SchemaTreeNode({\n\t\t\tkind: \"index\",\n\t\t\tid: `index-${name}-${index.keys.map((k) => `${k.field}_${k.direction}`).join(\"_\")}`,\n\t\t\tlabel: `${prefix} (${keysSummary})${optsSuffix}`,\n\t\t\tmeta: {\n\t\t\t\tkeys: index.keys,\n\t\t\t\tunique: index.unique,\n\t\t\t\t...ifDefined(\"sparse\", index.sparse || void 0),\n\t\t\t\t...ifDefined(\"expireAfterSeconds\", index.expireAfterSeconds ?? void 0),\n\t\t\t\t...ifDefined(\"partialFilterExpression\", index.partialFilterExpression ?? void 0)\n\t\t\t}\n\t\t}));\n\t}\n\tif (collection.validator) {\n\t\tconst validatorChildren = [];\n\t\tconst jsonSchema = blindCast(collection.validator.jsonSchema);\n\t\tconst properties = jsonSchema.properties;\n\t\tconst required = new Set(jsonSchema.required ?? []);\n\t\tif (properties) for (const [propName, propDef] of Object.entries(properties)) {\n\t\t\tconst bsonType = propDef.bsonType === void 0 ? \"any\" : String(propDef.bsonType);\n\t\t\tconst suffix = required.has(propName) ? \" (required)\" : \"\";\n\t\t\tvalidatorChildren.push(new SchemaTreeNode({\n\t\t\t\tkind: \"field\",\n\t\t\t\tid: `field-${name}-${propName}`,\n\t\t\t\tlabel: `${propName}: ${bsonType}${suffix}`\n\t\t\t}));\n\t\t}\n\t\tchildren.push(new SchemaTreeNode({\n\t\t\tkind: \"field\",\n\t\t\tid: `validator-${name}`,\n\t\t\tlabel: `validator (level: ${collection.validator.validationLevel}, action: ${collection.validator.validationAction})`,\n\t\t\tmeta: {\n\t\t\t\tvalidationLevel: collection.validator.validationLevel,\n\t\t\t\tvalidationAction: collection.validator.validationAction,\n\t\t\t\tjsonSchema: collection.validator.jsonSchema\n\t\t\t},\n\t\t\t...ifDefined(\"children\", validatorChildren.length > 0 ? validatorChildren : void 0)\n\t\t}));\n\t}\n\tif (collection.options) {\n\t\tconst opts = collection.options;\n\t\tconst optLabels = [];\n\t\tif (opts.capped) optLabels.push(\"capped\");\n\t\tif (opts.timeseries) optLabels.push(\"timeseries\");\n\t\tif (opts.collation) optLabels.push(\"collation\");\n\t\tif (opts.changeStreamPreAndPostImages) optLabels.push(\"changeStreamPreAndPostImages\");\n\t\tif (opts.clusteredIndex) optLabels.push(\"clusteredIndex\");\n\t\tif (optLabels.length > 0) children.push(new SchemaTreeNode({\n\t\t\tkind: \"field\",\n\t\t\tid: `options-${name}`,\n\t\t\tlabel: `options (${optLabels.join(\", \")})`,\n\t\t\tmeta: {\n\t\t\t\t...ifDefined(\"capped\", opts.capped ?? void 0),\n\t\t\t\t...ifDefined(\"timeseries\", opts.timeseries ?? void 0),\n\t\t\t\t...ifDefined(\"collation\", opts.collation ?? void 0),\n\t\t\t\t...ifDefined(\"changeStreamPreAndPostImages\", opts.changeStreamPreAndPostImages ?? void 0),\n\t\t\t\t...ifDefined(\"clusteredIndex\", opts.clusteredIndex ?? void 0)\n\t\t\t}\n\t\t}));\n\t}\n\treturn new SchemaTreeNode({\n\t\tkind: \"collection\",\n\t\tid: `collection-${name}`,\n\t\tlabel: `collection ${name}`,\n\t\t...ifDefined(\"children\", children.length > 0 ? children : void 0)\n\t});\n}\n//#endregion\n//#region src/core/control-instance.ts\nfunction deserializeMongoContract(contractJson) {\n\treturn new MongoContractSerializer().deserializeContract(contractJson);\n}\n/**\n* Family-method contract input. By the time control-plane methods\n* (`verify`, `verifySchema`, `sign`, …) are invoked through the CLI\n* control client (`client.ts`), the input has already been threaded\n* through `familyInstance.deserializeContract`. The value is therefore a\n* class-form `MongoTargetContract` (or a structurally-equivalent\n* envelope post-deserialization) and must NOT be re-fed through\n* structural validation (arktype rejects extra keys like `namespaces`).\n*\n* The parameter type on the framework SPI is `unknown` for variance\n* reasons (so the family can express its own contract type without\n* leaking it to the framework). This helper recovers the validated\n* shape with a single narrow cast.\n*/\nfunction asValidatedMongoContract(contract) {\n\treturn blindCast(contract);\n}\nfunction buildVerifyResult(opts) {\n\treturn {\n\t\tok: opts.ok,\n\t\t...ifDefined(\"code\", opts.code),\n\t\tsummary: opts.summary,\n\t\tcontract: {\n\t\t\tstorageHash: opts.contractStorageHash,\n\t\t\t...ifDefined(\"profileHash\", opts.contractProfileHash)\n\t\t},\n\t\t...ifDefined(\"marker\", opts.marker ? {\n\t\t\tstorageHash: opts.marker.storageHash,\n\t\t\tprofileHash: opts.marker.profileHash\n\t\t} : void 0),\n\t\ttarget: {\n\t\t\texpected: opts.expectedTargetId,\n\t\t\t...ifDefined(\"actual\", opts.actualTargetId)\n\t\t},\n\t\tmeta: {\n\t\t\tcontractPath: opts.contractPath,\n\t\t\t...ifDefined(\"configPath\", opts.configPath)\n\t\t},\n\t\ttimings: { total: opts.totalTime }\n\t};\n}\nfunction createMongoFamilyInstance(controlStack) {\n\tconst extensions = blindCast(controlStack.extensions ?? []);\n\tfor (const extension of extensions) if (extension.contractSpace) {\n\t\tconst { contractJson, headRef } = extension.contractSpace;\n\t\tassertDescriptorSelfConsistency({\n\t\t\textensionId: extension.id,\n\t\t\ttarget: contractJson.target,\n\t\t\ttargetFamily: contractJson.targetFamily,\n\t\t\tstorage: contractJson.storage,\n\t\t\theadRefHash: headRef.hash,\n\t\t\t...mongoContractCanonicalizationHooks\n\t\t});\n\t}\n\tconst adapter = blindCast(controlStack.adapter);\n\tconst getControlAdapter = () => {\n\t\tif (!adapter) throw new InternalError(\"Mongo family requires an adapter descriptor in ControlStack\");\n\t\treturn adapter.create(blindCast(controlStack));\n\t};\n\tfunction isMongoTargetDriver(driver) {\n\t\treturn driver.targetId === \"mongo\";\n\t}\n\tfunction asMongoDriver(driver) {\n\t\tif (!isMongoTargetDriver(driver)) throw structuredError(\"CONTRACT.TARGET_MISMATCH\", `Expected Mongo control driver with targetId 'mongo', got '${driver.targetId}'`);\n\t\treturn driver;\n\t}\n\treturn {\n\t\tfamilyId: \"mongo\",\n\t\tdeserializeContract(contractJson) {\n\t\t\treturn blindCast(deserializeMongoContract(contractJson));\n\t\t},\n\t\tasync verify(options) {\n\t\t\tconst { driver, contract: rawContract, expectedTargetId, contractPath, configPath } = options;\n\t\t\tconst startTime = Date.now();\n\t\t\tconst contract = asValidatedMongoContract(rawContract);\n\t\t\tconst contractStorageHash = contract.storage.storageHash;\n\t\t\tconst contractProfileHash = contract.profileHash;\n\t\t\tconst contractTarget = contract.target;\n\t\t\tconst baseOpts = {\n\t\t\t\tcontractStorageHash,\n\t\t\t\tcontractProfileHash,\n\t\t\t\texpectedTargetId,\n\t\t\t\tcontractPath,\n\t\t\t\t...ifDefined(\"configPath\", configPath)\n\t\t\t};\n\t\t\tif (contractTarget !== expectedTargetId) return buildVerifyResult({\n\t\t\t\t...baseOpts,\n\t\t\t\tok: false,\n\t\t\t\tcode: VERIFY_CODE_TARGET_MISMATCH,\n\t\t\t\tsummary: \"Target mismatch\",\n\t\t\t\tactualTargetId: contractTarget,\n\t\t\t\ttotalTime: Date.now() - startTime\n\t\t\t});\n\t\t\tconst marker = await getControlAdapter().readMarker(asMongoDriver(driver), APP_SPACE_ID);\n\t\t\tif (!marker) return buildVerifyResult({\n\t\t\t\t...baseOpts,\n\t\t\t\tok: false,\n\t\t\t\tcode: VERIFY_CODE_MARKER_MISSING,\n\t\t\t\tsummary: \"Marker missing\",\n\t\t\t\ttotalTime: Date.now() - startTime\n\t\t\t});\n\t\t\tif (marker.storageHash !== contractStorageHash) return buildVerifyResult({\n\t\t\t\t...baseOpts,\n\t\t\t\tok: false,\n\t\t\t\tcode: VERIFY_CODE_HASH_MISMATCH,\n\t\t\t\tsummary: \"Hash mismatch\",\n\t\t\t\tmarker,\n\t\t\t\ttotalTime: Date.now() - startTime\n\t\t\t});\n\t\t\tif (contractProfileHash && marker.profileHash !== contractProfileHash) return buildVerifyResult({\n\t\t\t\t...baseOpts,\n\t\t\t\tok: false,\n\t\t\t\tcode: VERIFY_CODE_HASH_MISMATCH,\n\t\t\t\tsummary: \"Hash mismatch\",\n\t\t\t\tmarker,\n\t\t\t\ttotalTime: Date.now() - startTime\n\t\t\t});\n\t\t\treturn buildVerifyResult({\n\t\t\t\t...baseOpts,\n\t\t\t\tok: true,\n\t\t\t\tsummary: \"Database matches contract\",\n\t\t\t\tmarker,\n\t\t\t\ttotalTime: Date.now() - startTime\n\t\t\t});\n\t\t},\n\t\tverifySchema(options) {\n\t\t\treturn verifyMongoSchema({\n\t\t\t\tcontract: asValidatedMongoContract(options.contract),\n\t\t\t\tschema: options.schema,\n\t\t\t\tstrict: options.strict,\n\t\t\t\tframeworkComponents: options.frameworkComponents\n\t\t\t});\n\t\t},\n\t\tasync sign(options) {\n\t\t\tconst { driver, contract: rawContract, contractPath, configPath } = options;\n\t\t\tconst startTime = Date.now();\n\t\t\tconst contract = asValidatedMongoContract(rawContract);\n\t\t\tconst contractStorageHash = contract.storage.storageHash;\n\t\t\tconst contractProfileHash = contract.profileHash;\n\t\t\tconst controlAdapter = getControlAdapter();\n\t\t\tconst mongoDriver = asMongoDriver(driver);\n\t\t\tconst existingMarker = await controlAdapter.readMarker(mongoDriver, APP_SPACE_ID);\n\t\t\tlet markerCreated = false;\n\t\t\tlet markerUpdated = false;\n\t\t\tlet previousHashes;\n\t\t\tif (!existingMarker) {\n\t\t\t\tawait controlAdapter.initMarker(mongoDriver, APP_SPACE_ID, {\n\t\t\t\t\tstorageHash: contractStorageHash,\n\t\t\t\t\tprofileHash: contractProfileHash\n\t\t\t\t});\n\t\t\t\tmarkerCreated = true;\n\t\t\t} else {\n\t\t\t\tconst storageHashMatches = existingMarker.storageHash === contractStorageHash;\n\t\t\t\tconst profileHashMatches = existingMarker.profileHash === contractProfileHash;\n\t\t\t\tif (!storageHashMatches || !profileHashMatches) {\n\t\t\t\t\tpreviousHashes = {\n\t\t\t\t\t\tstorageHash: existingMarker.storageHash,\n\t\t\t\t\t\tprofileHash: existingMarker.profileHash\n\t\t\t\t\t};\n\t\t\t\t\tif (!await controlAdapter.updateMarker(mongoDriver, APP_SPACE_ID, existingMarker.storageHash, {\n\t\t\t\t\t\tstorageHash: contractStorageHash,\n\t\t\t\t\t\tprofileHash: contractProfileHash\n\t\t\t\t\t})) throw structuredError(\"MIGRATION.MARKER_CAS_FAILURE\", \"CAS conflict: marker was modified by another process during sign\");\n\t\t\t\t\tmarkerUpdated = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet summary;\n\t\t\tif (markerCreated) summary = \"Database signed (marker created)\";\n\t\t\telse if (markerUpdated) summary = `Database signed (marker updated from ${previousHashes?.storageHash ?? \"unknown\"})`;\n\t\t\telse summary = \"Database already signed with this contract\";\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tsummary,\n\t\t\t\tcontract: {\n\t\t\t\t\tstorageHash: contractStorageHash,\n\t\t\t\t\tprofileHash: contractProfileHash\n\t\t\t\t},\n\t\t\t\ttarget: {\n\t\t\t\t\texpected: contract.target,\n\t\t\t\t\tactual: contract.target\n\t\t\t\t},\n\t\t\t\tmarker: {\n\t\t\t\t\tcreated: markerCreated,\n\t\t\t\t\tupdated: markerUpdated,\n\t\t\t\t\t...ifDefined(\"previous\", previousHashes)\n\t\t\t\t},\n\t\t\t\tmeta: {\n\t\t\t\t\tcontractPath,\n\t\t\t\t\t...ifDefined(\"configPath\", configPath)\n\t\t\t\t},\n\t\t\t\ttimings: { total: Date.now() - startTime }\n\t\t\t};\n\t\t},\n\t\tasync readMarker(options) {\n\t\t\treturn getControlAdapter().readMarker(asMongoDriver(options.driver), options.space);\n\t\t},\n\t\tasync readAllMarkers(options) {\n\t\t\treturn getControlAdapter().readAllMarkers(asMongoDriver(options.driver));\n\t\t},\n\t\tasync readLedger(options) {\n\t\t\treturn getControlAdapter().readLedger(asMongoDriver(options.driver), options.space);\n\t\t},\n\t\tasync introspect(options) {\n\t\t\treturn getControlAdapter().introspectSchema(asMongoDriver(options.driver));\n\t\t},\n\t\tcreateRunnerDependencies(options) {\n\t\t\treturn getControlAdapter().createRunnerDependencies(asMongoDriver(options.driver));\n\t\t},\n\t\ttoSchemaView(schema) {\n\t\t\treturn mongoSchemaToView(schema);\n\t\t},\n\t\ttoOperationPreview(operations) {\n\t\t\treturn mongoOperationsToPreview(operations);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/core/control-descriptor.ts\nconst mongoFamilyAttributeSpecs = mongoAttributeSpecs;\nvar MongoFamilyDescriptor = class {\n\tkind = \"family\";\n\tid = \"mongo\";\n\tfamilyId = \"mongo\";\n\tversion = \"0.0.1\";\n\temission = mongoEmission;\n\tauthoring = {\n\t\tentityTypes: mongoFamilyEntityTypes,\n\t\tpslBlockDescriptors: mongoFamilyPslBlockDescriptors,\n\t\tattributeSpecs: mongoFamilyAttributeSpecs\n\t};\n\tcreate(stack) {\n\t\treturn createMongoFamilyInstance(stack);\n\t}\n};\nconst mongoFamilyDescriptor = new MongoFamilyDescriptor();\n//#endregion\nexport { canonicalizeSchemasForVerification, contractToMongoSchemaIR, createMongoFamilyInstance, diffMongoSchemas, formatMongoOperations, mongoFamilyDescriptor, mongoOperationsToPreview };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,SAAS,cAAc,MAAM;CAC5B,OAAO,KAAK,KAAK,KAAK,MAAM,GAAG,KAAK,UAAU,EAAE,KAAK,EAAE,IAAI,KAAK,UAAU,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE;AACtG;AACA,MAAM,oCAAoC,IAAI,IAAI;CACjD;CACA;CACA;AACD,CAAC;AACD,SAAS,oBAAoB,KAAK;CACjC,MAAM,QAAQ,OAAO,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,KAAK,WAAW,CAAC,kBAAkB,IAAI,GAAG,KAAK,UAAU,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,WAAW,GAAG,IAAI,IAAI,KAAK,UAAU,KAAK,GAAG;CACpK,IAAI,MAAM,WAAW,GAAG,OAAO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,QAAQ,MAAM,CAAC;EAC1E;EACA,yBAAyB,SAAS;GACjC,OAAO,kBAAkB,CAAC,CAAC,yBAAyB,cAAc,QAAQ,MAAM,CAAC;EAClF;EACA,aAAa,QAAQ;GACpB,OAAO,kBAAkB,MAAM;EAChC;EACA,mBAAmB,YAAY;GAC9B,OAAO,yBAAyB,UAAU;EAC3C;CACD;AACD;AAGA,MAAM,4BAA4B;AAClC,IAAI,wBAAwB,MAAM;CACjC,OAAO;CACP,KAAK;CACL,WAAW;CACX,UAAU;CACV,WAAW;CACX,YAAY;EACX,aAAa;EACb,qBAAqB;EACrB,gBAAgB;CACjB;CACA,OAAO,OAAO;EACb,OAAO,0BAA0B,KAAK;CACvC;AACD;AACA,MAAM,wBAAwB,IAAI,sBAAsB"}
1
+ {"version":3,"file":"control-DRB8P8fy.mjs","names":[],"sources":["../../../../2-mongo-family/9-family/dist/control.mjs"],"sourcesContent":["import { i as contractToMongoSchemaIR, n as canonicalizeSchemasForVerification, r as diffMongoSchemas, t as verifyMongoSchema } from \"./verify-mongo-schema-B0bMHQW0.mjs\";\nimport { n as mongoFamilyPslBlockDescriptors, t as mongoFamilyEntityTypes } from \"./authoring-entity-types-CZX-S_hY.mjs\";\nimport { t as MongoContractSerializer } from \"./mongo-contract-serializer-DC_DM9_Y.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { mongoAttributeSpecs } from \"@internal/mongo-contract-psl\";\nimport { mongoEmission } from \"@internal/mongo-emitter\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { APP_SPACE_ID, SchemaTreeNode, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_TARGET_MISMATCH } from \"@internal/framework-components/control\";\nimport { mongoContractCanonicalizationHooks } from \"@internal/mongo-contract/canonicalization-hooks\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { assertDescriptorSelfConsistency } from \"@internal/migration-tools/spaces\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/core/operation-preview.ts\nfunction formatKeySpec(keys) {\n\treturn `{ ${keys.map((k) => `${JSON.stringify(k.field)}: ${JSON.stringify(k.direction)}`).join(\", \")} }`;\n}\nconst COMMAND_META_KEYS = /* @__PURE__ */ new Set([\n\t\"kind\",\n\t\"collection\",\n\t\"keys\"\n]);\nfunction formatOptionEntries(cmd) {\n\tconst parts = Object.entries(cmd).filter(([key, value]) => !COMMAND_META_KEYS.has(key) && value !== void 0).map(([key, value]) => `${key}: ${JSON.stringify(value)}`);\n\tif (parts.length === 0) return void 0;\n\treturn `{ ${parts.join(\", \")} }`;\n}\nfunction formatOptions(cmd) {\n\treturn formatOptionEntries(cmd);\n}\nfunction formatCreateCollectionOptions(cmd) {\n\treturn formatOptionEntries(cmd);\n}\nvar MongoDdlCommandFormatter = class {\n\tcreateIndex(cmd) {\n\t\tconst keySpec = formatKeySpec(cmd.keys);\n\t\tconst opts = formatOptions(cmd);\n\t\treturn opts ? `db.${cmd.collection}.createIndex(${keySpec}, ${opts})` : `db.${cmd.collection}.createIndex(${keySpec})`;\n\t}\n\tdropIndex(cmd) {\n\t\treturn `db.${cmd.collection}.dropIndex(${JSON.stringify(cmd.name)})`;\n\t}\n\tcreateCollection(cmd) {\n\t\tconst opts = formatCreateCollectionOptions(cmd);\n\t\treturn opts ? `db.createCollection(${JSON.stringify(cmd.collection)}, ${opts})` : `db.createCollection(${JSON.stringify(cmd.collection)})`;\n\t}\n\tdropCollection(cmd) {\n\t\treturn `db.${cmd.collection}.drop()`;\n\t}\n\tcollMod(cmd) {\n\t\tconst parts = [`collMod: ${JSON.stringify(cmd.collection)}`];\n\t\tfor (const [key, value] of Object.entries(cmd)) if (!COMMAND_META_KEYS.has(key) && value !== void 0) parts.push(`${key}: ${JSON.stringify(value)}`);\n\t\treturn `db.runCommand({ ${parts.join(\", \")} })`;\n\t}\n};\nconst formatter = new MongoDdlCommandFormatter();\nfunction formatMongoOperations(operations) {\n\tconst statements = [];\n\tfor (const operation of operations) {\n\t\tconst candidate = operation;\n\t\tif (!(\"execute\" in candidate) || !Array.isArray(candidate[\"execute\"])) continue;\n\t\tfor (const step of candidate[\"execute\"]) if (step.command && typeof step.command.accept === \"function\") statements.push(step.command.accept(formatter));\n\t}\n\treturn statements;\n}\n/**\n* Wraps `formatMongoOperations` into the family-agnostic\n* `OperationPreview` shape. Each statement carries\n* `language: 'mongodb-shell'`. Mirrors `sqlOperationsToPreview`.\n*/\nfunction mongoOperationsToPreview(operations) {\n\treturn { statements: formatMongoOperations(operations).map((text) => ({\n\t\ttext,\n\t\tlanguage: \"mongodb-shell\"\n\t})) };\n}\n//#endregion\n//#region src/core/schema-to-view.ts\nfunction mongoSchemaToView(schema) {\n\tconst collectionNodes = schema.collections.map((collection) => collectionToSchemaNode(collection.name, collection));\n\treturn { root: new SchemaTreeNode({\n\t\tkind: \"root\",\n\t\tid: \"mongo-schema\",\n\t\tlabel: \"database\",\n\t\t...ifDefined(\"children\", collectionNodes.length > 0 ? collectionNodes : void 0)\n\t}) };\n}\nfunction collectionToSchemaNode(name, collection) {\n\tconst children = [];\n\tfor (const index of collection.indexes) {\n\t\tconst keysSummary = index.keys.map((k) => {\n\t\t\tif (k.direction === 1) return k.field;\n\t\t\tif (k.direction === -1) return `${k.field} desc`;\n\t\t\treturn `${k.field} ${k.direction}`;\n\t\t}).join(\", \");\n\t\tconst prefix = index.unique ? \"unique index\" : \"index\";\n\t\tconst options = [];\n\t\tif (index.sparse) options.push(\"sparse\");\n\t\tif (index.expireAfterSeconds != null) options.push(`ttl: ${index.expireAfterSeconds}s`);\n\t\tif (index.partialFilterExpression) options.push(\"partial\");\n\t\tconst optsSuffix = options.length > 0 ? ` (${options.join(\", \")})` : \"\";\n\t\tchildren.push(new SchemaTreeNode({\n\t\t\tkind: \"index\",\n\t\t\tid: `index-${name}-${index.keys.map((k) => `${k.field}_${k.direction}`).join(\"_\")}`,\n\t\t\tlabel: `${prefix} (${keysSummary})${optsSuffix}`,\n\t\t\tmeta: {\n\t\t\t\tkeys: index.keys,\n\t\t\t\tunique: index.unique,\n\t\t\t\t...ifDefined(\"sparse\", index.sparse || void 0),\n\t\t\t\t...ifDefined(\"expireAfterSeconds\", index.expireAfterSeconds ?? void 0),\n\t\t\t\t...ifDefined(\"partialFilterExpression\", index.partialFilterExpression ?? void 0)\n\t\t\t}\n\t\t}));\n\t}\n\tif (collection.validator) {\n\t\tconst validatorChildren = [];\n\t\tconst jsonSchema = blindCast(collection.validator.jsonSchema);\n\t\tconst properties = jsonSchema.properties;\n\t\tconst required = new Set(jsonSchema.required ?? []);\n\t\tif (properties) for (const [propName, propDef] of Object.entries(properties)) {\n\t\t\tconst bsonType = propDef.bsonType === void 0 ? \"any\" : String(propDef.bsonType);\n\t\t\tconst suffix = required.has(propName) ? \" (required)\" : \"\";\n\t\t\tvalidatorChildren.push(new SchemaTreeNode({\n\t\t\t\tkind: \"field\",\n\t\t\t\tid: `field-${name}-${propName}`,\n\t\t\t\tlabel: `${propName}: ${bsonType}${suffix}`\n\t\t\t}));\n\t\t}\n\t\tchildren.push(new SchemaTreeNode({\n\t\t\tkind: \"field\",\n\t\t\tid: `validator-${name}`,\n\t\t\tlabel: `validator (level: ${collection.validator.validationLevel}, action: ${collection.validator.validationAction})`,\n\t\t\tmeta: {\n\t\t\t\tvalidationLevel: collection.validator.validationLevel,\n\t\t\t\tvalidationAction: collection.validator.validationAction,\n\t\t\t\tjsonSchema: collection.validator.jsonSchema\n\t\t\t},\n\t\t\t...ifDefined(\"children\", validatorChildren.length > 0 ? validatorChildren : void 0)\n\t\t}));\n\t}\n\tif (collection.options) {\n\t\tconst opts = collection.options;\n\t\tconst optLabels = [];\n\t\tif (opts.capped) optLabels.push(\"capped\");\n\t\tif (opts.timeseries) optLabels.push(\"timeseries\");\n\t\tif (opts.collation) optLabels.push(\"collation\");\n\t\tif (opts.changeStreamPreAndPostImages) optLabels.push(\"changeStreamPreAndPostImages\");\n\t\tif (opts.clusteredIndex) optLabels.push(\"clusteredIndex\");\n\t\tif (optLabels.length > 0) children.push(new SchemaTreeNode({\n\t\t\tkind: \"field\",\n\t\t\tid: `options-${name}`,\n\t\t\tlabel: `options (${optLabels.join(\", \")})`,\n\t\t\tmeta: {\n\t\t\t\t...ifDefined(\"capped\", opts.capped ?? void 0),\n\t\t\t\t...ifDefined(\"timeseries\", opts.timeseries ?? void 0),\n\t\t\t\t...ifDefined(\"collation\", opts.collation ?? void 0),\n\t\t\t\t...ifDefined(\"changeStreamPreAndPostImages\", opts.changeStreamPreAndPostImages ?? void 0),\n\t\t\t\t...ifDefined(\"clusteredIndex\", opts.clusteredIndex ?? void 0)\n\t\t\t}\n\t\t}));\n\t}\n\treturn new SchemaTreeNode({\n\t\tkind: \"collection\",\n\t\tid: `collection-${name}`,\n\t\tlabel: `collection ${name}`,\n\t\t...ifDefined(\"children\", children.length > 0 ? children : void 0)\n\t});\n}\n//#endregion\n//#region src/core/control-instance.ts\nfunction deserializeMongoContract(contractJson) {\n\treturn new MongoContractSerializer().deserializeContract(contractJson);\n}\n/**\n* Family-method contract input. By the time control-plane methods\n* (`verify`, `verifySchema`, `sign`, …) are invoked through the CLI\n* control client (`client.ts`), the input has already been threaded\n* through `familyInstance.deserializeContract`. The value is therefore a\n* class-form `MongoTargetContract` (or a structurally-equivalent\n* envelope post-deserialization) and must NOT be re-fed through\n* structural validation (arktype rejects extra keys like `namespaces`).\n*\n* The parameter type on the framework SPI is `unknown` for variance\n* reasons (so the family can express its own contract type without\n* leaking it to the framework). This helper recovers the validated\n* shape with a single narrow cast.\n*/\nfunction asValidatedMongoContract(contract) {\n\treturn blindCast(contract);\n}\nfunction buildVerifyResult(opts) {\n\treturn {\n\t\tok: opts.ok,\n\t\t...ifDefined(\"code\", opts.code),\n\t\tsummary: opts.summary,\n\t\tcontract: {\n\t\t\tstorageHash: opts.contractStorageHash,\n\t\t\t...ifDefined(\"profileHash\", opts.contractProfileHash)\n\t\t},\n\t\t...ifDefined(\"marker\", opts.marker ? {\n\t\t\tstorageHash: opts.marker.storageHash,\n\t\t\tprofileHash: opts.marker.profileHash\n\t\t} : void 0),\n\t\ttarget: {\n\t\t\texpected: opts.expectedTargetId,\n\t\t\t...ifDefined(\"actual\", opts.actualTargetId)\n\t\t},\n\t\tmeta: {\n\t\t\tcontractPath: opts.contractPath,\n\t\t\t...ifDefined(\"configPath\", opts.configPath)\n\t\t},\n\t\ttimings: { total: opts.totalTime }\n\t};\n}\nfunction createMongoFamilyInstance(controlStack) {\n\tconst extensions = blindCast(controlStack.extensions ?? []);\n\tfor (const extension of extensions) if (extension.contractSpace) {\n\t\tconst { contractJson, headRef } = extension.contractSpace;\n\t\tassertDescriptorSelfConsistency({\n\t\t\textensionId: extension.id,\n\t\t\ttarget: contractJson.target,\n\t\t\ttargetFamily: contractJson.targetFamily,\n\t\t\tstorage: contractJson.storage,\n\t\t\theadRefHash: headRef.hash,\n\t\t\t...mongoContractCanonicalizationHooks\n\t\t});\n\t}\n\tconst adapter = blindCast(controlStack.adapter);\n\tconst getControlAdapter = () => {\n\t\tif (!adapter) throw new InternalError(\"Mongo family requires an adapter descriptor in ControlStack\");\n\t\treturn adapter.create(blindCast(controlStack));\n\t};\n\tfunction isMongoTargetDriver(driver) {\n\t\treturn driver.targetId === \"mongo\";\n\t}\n\tfunction asMongoDriver(driver) {\n\t\tif (!isMongoTargetDriver(driver)) throw structuredError(\"CONTRACT.TARGET_MISMATCH\", `Expected Mongo control driver with targetId 'mongo', got '${driver.targetId}'`);\n\t\treturn driver;\n\t}\n\treturn {\n\t\tfamilyId: \"mongo\",\n\t\tdeserializeContract(contractJson) {\n\t\t\treturn blindCast(deserializeMongoContract(contractJson));\n\t\t},\n\t\tasync verify(options) {\n\t\t\tconst { driver, contract: rawContract, expectedTargetId, contractPath, configPath } = options;\n\t\t\tconst startTime = Date.now();\n\t\t\tconst contract = asValidatedMongoContract(rawContract);\n\t\t\tconst contractStorageHash = contract.storage.storageHash;\n\t\t\tconst contractProfileHash = contract.profileHash;\n\t\t\tconst contractTarget = contract.target;\n\t\t\tconst baseOpts = {\n\t\t\t\tcontractStorageHash,\n\t\t\t\tcontractProfileHash,\n\t\t\t\texpectedTargetId,\n\t\t\t\tcontractPath,\n\t\t\t\t...ifDefined(\"configPath\", configPath)\n\t\t\t};\n\t\t\tif (contractTarget !== expectedTargetId) return buildVerifyResult({\n\t\t\t\t...baseOpts,\n\t\t\t\tok: false,\n\t\t\t\tcode: VERIFY_CODE_TARGET_MISMATCH,\n\t\t\t\tsummary: \"Target mismatch\",\n\t\t\t\tactualTargetId: contractTarget,\n\t\t\t\ttotalTime: Date.now() - startTime\n\t\t\t});\n\t\t\tconst marker = await getControlAdapter().readMarker(asMongoDriver(driver), APP_SPACE_ID);\n\t\t\tif (!marker) return buildVerifyResult({\n\t\t\t\t...baseOpts,\n\t\t\t\tok: false,\n\t\t\t\tcode: VERIFY_CODE_MARKER_MISSING,\n\t\t\t\tsummary: \"Marker missing\",\n\t\t\t\ttotalTime: Date.now() - startTime\n\t\t\t});\n\t\t\tif (marker.storageHash !== contractStorageHash) return buildVerifyResult({\n\t\t\t\t...baseOpts,\n\t\t\t\tok: false,\n\t\t\t\tcode: VERIFY_CODE_HASH_MISMATCH,\n\t\t\t\tsummary: \"Hash mismatch\",\n\t\t\t\tmarker,\n\t\t\t\ttotalTime: Date.now() - startTime\n\t\t\t});\n\t\t\tif (contractProfileHash && marker.profileHash !== contractProfileHash) return buildVerifyResult({\n\t\t\t\t...baseOpts,\n\t\t\t\tok: false,\n\t\t\t\tcode: VERIFY_CODE_HASH_MISMATCH,\n\t\t\t\tsummary: \"Hash mismatch\",\n\t\t\t\tmarker,\n\t\t\t\ttotalTime: Date.now() - startTime\n\t\t\t});\n\t\t\treturn buildVerifyResult({\n\t\t\t\t...baseOpts,\n\t\t\t\tok: true,\n\t\t\t\tsummary: \"Database matches contract\",\n\t\t\t\tmarker,\n\t\t\t\ttotalTime: Date.now() - startTime\n\t\t\t});\n\t\t},\n\t\tverifySchema(options) {\n\t\t\treturn verifyMongoSchema({\n\t\t\t\tcontract: asValidatedMongoContract(options.contract),\n\t\t\t\tschema: options.schema,\n\t\t\t\tstrict: options.strict,\n\t\t\t\tframeworkComponents: options.frameworkComponents\n\t\t\t});\n\t\t},\n\t\tasync sign(options) {\n\t\t\tconst { driver, contract: rawContract, contractPath, configPath } = options;\n\t\t\tconst startTime = Date.now();\n\t\t\tconst contract = asValidatedMongoContract(rawContract);\n\t\t\tconst contractStorageHash = contract.storage.storageHash;\n\t\t\tconst contractProfileHash = contract.profileHash;\n\t\t\tconst controlAdapter = getControlAdapter();\n\t\t\tconst mongoDriver = asMongoDriver(driver);\n\t\t\tconst existingMarker = await controlAdapter.readMarker(mongoDriver, APP_SPACE_ID);\n\t\t\tlet markerCreated = false;\n\t\t\tlet markerUpdated = false;\n\t\t\tlet previousHashes;\n\t\t\tif (!existingMarker) {\n\t\t\t\tawait controlAdapter.initMarker(mongoDriver, APP_SPACE_ID, {\n\t\t\t\t\tstorageHash: contractStorageHash,\n\t\t\t\t\tprofileHash: contractProfileHash\n\t\t\t\t});\n\t\t\t\tmarkerCreated = true;\n\t\t\t} else {\n\t\t\t\tconst storageHashMatches = existingMarker.storageHash === contractStorageHash;\n\t\t\t\tconst profileHashMatches = existingMarker.profileHash === contractProfileHash;\n\t\t\t\tif (!storageHashMatches || !profileHashMatches) {\n\t\t\t\t\tpreviousHashes = {\n\t\t\t\t\t\tstorageHash: existingMarker.storageHash,\n\t\t\t\t\t\tprofileHash: existingMarker.profileHash\n\t\t\t\t\t};\n\t\t\t\t\tif (!await controlAdapter.updateMarker(mongoDriver, APP_SPACE_ID, existingMarker.storageHash, {\n\t\t\t\t\t\tstorageHash: contractStorageHash,\n\t\t\t\t\t\tprofileHash: contractProfileHash\n\t\t\t\t\t})) throw structuredError(\"MIGRATION.MARKER_CAS_FAILURE\", \"CAS conflict: marker was modified by another process during sign\");\n\t\t\t\t\tmarkerUpdated = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet summary;\n\t\t\tif (markerCreated) summary = \"Database signed (marker created)\";\n\t\t\telse if (markerUpdated) summary = `Database signed (marker updated from ${previousHashes?.storageHash ?? \"unknown\"})`;\n\t\t\telse summary = \"Database already signed with this contract\";\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tsummary,\n\t\t\t\tcontract: {\n\t\t\t\t\tstorageHash: contractStorageHash,\n\t\t\t\t\tprofileHash: contractProfileHash\n\t\t\t\t},\n\t\t\t\ttarget: {\n\t\t\t\t\texpected: contract.target,\n\t\t\t\t\tactual: contract.target\n\t\t\t\t},\n\t\t\t\tmarker: {\n\t\t\t\t\tcreated: markerCreated,\n\t\t\t\t\tupdated: markerUpdated,\n\t\t\t\t\t...ifDefined(\"previous\", previousHashes)\n\t\t\t\t},\n\t\t\t\tmeta: {\n\t\t\t\t\tcontractPath,\n\t\t\t\t\t...ifDefined(\"configPath\", configPath)\n\t\t\t\t},\n\t\t\t\ttimings: { total: Date.now() - startTime }\n\t\t\t};\n\t\t},\n\t\tasync readMarker(options) {\n\t\t\treturn getControlAdapter().readMarker(asMongoDriver(options.driver), options.space);\n\t\t},\n\t\tasync readAllMarkers(options) {\n\t\t\treturn getControlAdapter().readAllMarkers(asMongoDriver(options.driver));\n\t\t},\n\t\tasync readLedger(options) {\n\t\t\treturn getControlAdapter().readLedger(asMongoDriver(options.driver), options.space);\n\t\t},\n\t\tasync introspect(options) {\n\t\t\treturn getControlAdapter().introspectSchema(asMongoDriver(options.driver));\n\t\t},\n\t\tcreateRunnerDependencies(options) {\n\t\t\treturn getControlAdapter().createRunnerDependencies(asMongoDriver(options.driver));\n\t\t},\n\t\ttoSchemaView(schema) {\n\t\t\treturn mongoSchemaToView(schema);\n\t\t},\n\t\ttoOperationPreview(operations) {\n\t\t\treturn mongoOperationsToPreview(operations);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/core/control-descriptor.ts\nconst mongoFamilyAttributeSpecs = mongoAttributeSpecs;\nvar MongoFamilyDescriptor = class {\n\tkind = \"family\";\n\tid = \"mongo\";\n\tfamilyId = \"mongo\";\n\tversion = \"0.0.1\";\n\temission = mongoEmission;\n\tauthoring = {\n\t\tentityTypes: mongoFamilyEntityTypes,\n\t\tpslBlockDescriptors: mongoFamilyPslBlockDescriptors,\n\t\tattributeSpecs: mongoFamilyAttributeSpecs\n\t};\n\tcreate(stack) {\n\t\treturn createMongoFamilyInstance(stack);\n\t}\n};\nconst mongoFamilyDescriptor = new MongoFamilyDescriptor();\n//#endregion\nexport { canonicalizeSchemasForVerification, contractToMongoSchemaIR, createMongoFamilyInstance, diffMongoSchemas, formatMongoOperations, mongoFamilyDescriptor, mongoOperationsToPreview };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,SAAS,cAAc,MAAM;CAC5B,OAAO,KAAK,KAAK,KAAK,MAAM,GAAG,KAAK,UAAU,EAAE,KAAK,EAAE,IAAI,KAAK,UAAU,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE;AACtG;AACA,MAAM,oCAAoC,IAAI,IAAI;CACjD;CACA;CACA;AACD,CAAC;AACD,SAAS,oBAAoB,KAAK;CACjC,MAAM,QAAQ,OAAO,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,KAAK,WAAW,CAAC,kBAAkB,IAAI,GAAG,KAAK,UAAU,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,WAAW,GAAG,IAAI,IAAI,KAAK,UAAU,KAAK,GAAG;CACpK,IAAI,MAAM,WAAW,GAAG,OAAO,KAAK;CACpC,OAAO,KAAK,MAAM,KAAK,IAAI,EAAE;AAC9B;AACA,SAAS,cAAc,KAAK;CAC3B,OAAO,oBAAoB,GAAG;AAC/B;AACA,SAAS,8BAA8B,KAAK;CAC3C,OAAO,oBAAoB,GAAG;AAC/B;AACA,IAAI,2BAA2B,MAAM;CACpC,YAAY,KAAK;EAChB,MAAM,UAAU,cAAc,IAAI,IAAI;EACtC,MAAM,OAAO,cAAc,GAAG;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C,OAAO;CACP,KAAK;CACL,WAAW;CACX,UAAU;CACV,WAAW;CACX,YAAY;EACX,aAAa;EACb,qBAAqB;EACrB,gBAAgB;CACjB;CACA,OAAO,OAAO;EACb,OAAO,0BAA0B,KAAK;CACvC;AACD;AACA,MAAM,wBAAwB,IAAI,sBAAsB"}
@@ -1,7 +1,7 @@
1
1
  import { C as MongoContract, W as MongoStorageShape } from "./mongo-value-set-BngSUlOh-BhDGXjM_.mjs";
2
2
  import "./index-CLPkwReD.mjs";
3
3
  import { o as MongoSchemaIR } from "./index-CaoieUeB.mjs";
4
- import { i as MongoRunnerDependencies } from "./control-adapter-Bh_ZraGM-0OJf8f1R.mjs";
4
+ import { i as MongoRunnerDependencies } from "./control-adapter-Bh_ZraGM-wsAkUbsg.mjs";
5
5
  import { Contract, ControlPolicy } from "@prisma/orm-framework/contract/types";
6
6
  import { ContractSerializer, ContractSpace, ControlDriverInstance, ControlExtensionDescriptor, ControlFamilyDescriptor, ControlFamilyInstance, ControlStack, MigratableTargetDescriptor, MigrationPlanOperation, OperationPreview, OperationPreviewCapable, SchemaDiffIssue, SchemaVerifier, SchemaViewCapable } from "@prisma/orm-framework/components/control";
7
7
  //#region ../../../2-mongo-family/9-family/dist/control.d.mts
@@ -105,4 +105,4 @@ interface CanonicalizedSchemas {
105
105
  declare function canonicalizeSchemasForVerification(live: MongoSchemaIR, expected: MongoSchemaIR): CanonicalizedSchemas;
106
106
  //#endregion
107
107
  export { contractToMongoSchemaIR as a, formatMongoOperations as c, canonicalizeSchemasForVerification as i, mongoFamilyDescriptor as l, MongoControlFamilyInstance as n, createMongoFamilyInstance as o, MongoControlTargetDescriptor as r, diffMongoSchemas as s, MongoControlExtensionDescriptor as t, mongoOperationsToPreview as u };
108
- //# sourceMappingURL=control-BqovaVpo.d.mts.map
108
+ //# sourceMappingURL=control-DVqprwua.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"control-BqovaVpo.d.mts","names":[],"sources":["../../../../2-mongo-family/9-family/dist/control.d.mts"],"mappings":";;;;;;;;iBAMiB,wBAAwB,UAAU,uBAAuB;;;UAGhE,mCAAmC,+BAA+B,gBAAgB,kBAAkB,gBAAgB;;;;;;;;;;;EAW5H,oBAAoB,wBAAwB;;;;EAI5C,yBAAyB;aACd,QAAQ;MACf;;iBAEW,0BAA0B,cAAc,eAAe;;;cAG1D,uBAAuB,iCAAiC;;;;;;;;;;;;;;;UAe5D,6BAA6B,kBAAkB,gBAAgB,uBAAuB,6CAA6C;WAClI,oBAAoB,mBAAmB;WACvC,gBAAgB,eAAe,WAAW;;;;;;;;;;;;;;;;;;;UAmB3C,wCAAwC;WACvC,gBAAgB,cAAc,cAAc;;;;iBAItC,sBAAsB,qBAAqB;;;;;;iBAM3C,yBAAyB,qBAAqB,2BAA2B;;;;;;;;;;;;;UAahF;WACC,mBAAmB;WACnB,mBAAmB;;iBAEb,iBAAiB,MAAM,eAAe,UAAU,eAAe,iBAAiB,0BAA0B,2BAA2B,gBAAgB;;;UAG5J;WACC,MAAM;WACN,UAAU;;iBAEJ,mCAAmC,MAAM,eAAe,UAAU,gBAAgB"}
1
+ {"version":3,"file":"control-DVqprwua.d.mts","names":[],"sources":["../../../../2-mongo-family/9-family/dist/control.d.mts"],"mappings":";;;;;;;;iBAMiB,wBAAwB,UAAU,uBAAuB;;;UAGhE,mCAAmC,+BAA+B,gBAAgB,kBAAkB,gBAAgB;;;;;;;;;;;EAW5H,oBAAoB,wBAAwB;;;;EAI5C,yBAAyB;aACd,QAAQ;MACf;;iBAEW,0BAA0B,cAAc,eAAe;;;cAG1D,uBAAuB,iCAAiC;;;;;;;;;;;;;;;UAe5D,6BAA6B,kBAAkB,gBAAgB,uBAAuB,6CAA6C;WAClI,oBAAoB,mBAAmB;WACvC,gBAAgB,eAAe,WAAW;;;;;;;;;;;;;;;;;;;UAmB3C,wCAAwC;WACvC,gBAAgB,cAAc,cAAc;;;;iBAItC,sBAAsB,qBAAqB;;;;;;iBAM3C,yBAAyB,qBAAqB,2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