@prisma/orm-family-mongo 8.0.0-rc.12-dev.13 → 8.0.0-rc.12-dev.15
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.
- package/dist/contract-prisma6__provider.mjs +3 -3
- package/dist/contract-prisma6__provider.mjs.map +1 -1
- package/dist/contract-psl.mjs +1 -1
- package/dist/contract-psl__provider.mjs +1 -1
- package/dist/contract-psl__provider.mjs.map +1 -1
- package/dist/{control-BG0O1wDj.mjs → control-BRXfR7Ir.mjs} +2 -2
- package/dist/{control-BG0O1wDj.mjs.map → control-BRXfR7Ir.mjs.map} +1 -1
- package/dist/family.mjs +1 -1
- package/dist/family__control.mjs +1 -1
- package/dist/family__pack.mjs +1 -1
- package/dist/{interpreter-DPALasb4-BORWXsN5.mjs → interpreter-CNbTpXgT-CRfl2AwF.mjs} +8 -14
- package/dist/interpreter-CNbTpXgT-CRfl2AwF.mjs.map +1 -0
- package/package.json +20 -20
- package/dist/interpreter-DPALasb4-BORWXsN5.mjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { o as MongoIndex } from "./entity-kinds-BFgLffz7-D8WUc2oo.mjs";
|
|
2
2
|
import { c as buildMongoExecutionSection, h as validateMongoStorage, p as encodeMongoValueSets, u as buildMongoStorage } from "./dist-DsIID5AE.mjs";
|
|
3
|
-
import { a as pairMongoBackRelations } from "./interpreter-
|
|
3
|
+
import { a as pairMongoBackRelations } from "./interpreter-CNbTpXgT-CRfl2AwF.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";
|
|
@@ -940,7 +940,7 @@ function readFailure(schemaPath, message, meta) {
|
|
|
940
940
|
function prisma6Contract(schemaPath, options) {
|
|
941
941
|
return {
|
|
942
942
|
source: {
|
|
943
|
-
format: "
|
|
943
|
+
format: "psl",
|
|
944
944
|
inputs: [schemaPath],
|
|
945
945
|
async load(context) {
|
|
946
946
|
const [absolutePath] = context.resolvedInputs;
|
|
@@ -974,7 +974,7 @@ function prisma6Contract(schemaPath, options) {
|
|
|
974
974
|
cause: message
|
|
975
975
|
});
|
|
976
976
|
}
|
|
977
|
-
const { document, sources, diagnostics } = parse(schema, file.sourceId
|
|
977
|
+
const { document, sources, diagnostics } = parse(schema, file.sourceId);
|
|
978
978
|
const sourceFile = sources.sourceFileFor(document.syntax);
|
|
979
979
|
seedDiagnostics.push(...mapParseDiagnostics(diagnostics, sourceFile, file.sourceId));
|
|
980
980
|
documents.push({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-prisma6__provider.mjs","names":[],"sources":["../../../../2-mongo-family/2-authoring/contract-prisma6/dist/provider.mjs"],"sourcesContent":["import { readFile, readdir, stat } from \"node:fs/promises\";\nimport { applySpecifierDefaultControlPolicy } from \"@internal/contract/apply-specifier-default-control-policy\";\nimport { validateContractDomain } from \"@internal/contract/validate-domain\";\nimport { MongoIndex, buildMongoExecutionSection, buildMongoStorage, encodeMongoValueSets, validateMongoStorage } from \"@internal/mongo-contract\";\nimport { ArrayLiteralAst, FunctionCallAst, IdentifierAst, StringLiteralExprAst, parse } from \"@internal/psl-parser/syntax\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { isStructuredError } from \"@internal/utils/structured-error\";\nimport { basename, dirname, extname, join, normalize } from \"pathe\";\nimport { computeProfileHash } from \"@internal/contract/hashing\";\nimport { crossRef } from \"@internal/contract/types\";\nimport { resolveToOneRelationNullable } from \"@internal/contract-authoring\";\nimport { instantiateAuthoringEntityType, isAuthoringEntityTypeDescriptor } from \"@internal/framework-components/authoring\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { pairMongoBackRelations } from \"@internal/mongo-contract-psl\";\nimport { buildSymbolTable, keywordPslSpan, mapPslDiagnostics, nodePslSpan, readResolvedAttribute, readResolvedAttributes } from \"@internal/psl-parser\";\nimport { fkRelationPairKey } from \"@internal/psl-parser/interpret\";\nimport { ifDefined } from \"@internal/utils/defined\";\n//#region src/diagnostics.ts\nfunction prisma6Diagnostic(code, message, sourceId, span) {\n\treturn {\n\t\tcode,\n\t\tmessage,\n\t\tsourceId,\n\t\t...span !== void 0 ? { span } : {}\n\t};\n}\n//#endregion\n//#region src/indexes.ts\nfunction unsupported(attribute, what, span, ctx) {\n\tctx.diagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_INDEX_ARGUMENT_UNSUPPORTED\", `${ctx.owner}: ${ctx.prefix}${attribute.name} ${what}`, ctx.sourceId, span));\n}\nfunction sortDirection(expression) {\n\tif (expression === void 0) return void 0;\n\tconst token = IdentifierAst.cast(expression.syntax)?.name();\n\treturn token === \"Asc\" ? 1 : token === \"Desc\" ? -1 : void 0;\n}\n/**\n* Reads `sort:` from one index element's or `@unique`'s arguments. `length:` and every other argument are refused: a MongoDB index has no prefix length, and Prisma 6 accepts no other argument there on MongoDB.\n*/\nfunction readSort(attribute, args, ctx) {\n\tlet direction;\n\tfor (const arg of args) {\n\t\tconst key = arg.name()?.name();\n\t\tconst span = nodePslSpan(arg.syntax, ctx.sources);\n\t\tif (key !== \"sort\") return unsupported(attribute, key === \"length\" ? \"argument \\\"length\\\" is not supported: a MongoDB index has no prefix length. Remove it; Prisma 6 ignores it on MongoDB.\" : `argument \"${key ?? \"\"}\" is not supported.`, span, ctx);\n\t\tdirection = sortDirection(arg.value());\n\t\tif (direction === void 0) return unsupported(attribute, \"sort must be Asc or Desc.\", span, ctx);\n\t}\n\treturn { direction };\n}\nfunction readFields(attribute, expression, span, ctx) {\n\tconst array = expression === void 0 ? void 0 : ArrayLiteralAst.cast(expression.syntax);\n\tif (array === void 0) return unsupported(attribute, \"expects a list of field names.\", span, ctx);\n\tconst fields = [];\n\tfor (const element of array.elements()) {\n\t\tconst name = IdentifierAst.cast(element.syntax)?.name();\n\t\tif (name !== void 0) {\n\t\t\tfields.push({\n\t\t\t\tname,\n\t\t\t\tdirection: void 0\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst call = FunctionCallAst.cast(element.syntax);\n\t\tconst path = call?.path() ?? [];\n\t\tconst [callee] = path;\n\t\tif (path.length > 1) {\n\t\t\tctx.diagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_COMPOSITE_INDEX_PATH_UNSUPPORTED\", `Index path \"${path.join(\".\")}\" reaches into a composite type; indexes on composite-type fields are not supported yet. Index a top-level field or remove the index.`, ctx.sourceId, nodePslSpan(element.syntax, ctx.sources)));\n\t\t\treturn;\n\t\t}\n\t\tif (call === void 0 || callee === void 0) return unsupported(attribute, \"expects a list of field names.\", nodePslSpan(element.syntax, ctx.sources), ctx);\n\t\tconst sort = readSort(attribute, call.args(), ctx);\n\t\tif (sort === void 0) return void 0;\n\t\tfields.push({\n\t\t\tname: callee,\n\t\t\tdirection: sort.direction\n\t\t});\n\t}\n\treturn fields;\n}\n/** Reads `@@index`, `@@unique` or `@@fulltext`. `map:` and `name:` are dropped: MongoDB verify never compares index names. */\nfunction parseIndexAttribute(attribute, ctx) {\n\tlet fields;\n\tfor (const arg of attribute.args) {\n\t\tconst key = arg.kind === \"positional\" ? \"fields\" : arg.name;\n\t\tif (key === \"map\" || key === \"name\") continue;\n\t\tif (key !== \"fields\") return unsupported(attribute, `argument \"${key ?? \"\"}\" is not supported.`, arg.span, ctx);\n\t\tfields = readFields(attribute, arg.expression, arg.span, ctx);\n\t\tif (fields === void 0) return void 0;\n\t}\n\tif (fields === void 0 || fields.length === 0) return unsupported(attribute, \"expects a list of field names.\", attribute.span, ctx);\n\treturn {\n\t\tkind: attribute.name,\n\t\tfields,\n\t\tspan: attribute.span\n\t};\n}\n/** Reads a field's `@unique`: `sort:` sets the key direction; `map:` and `name:` are dropped. */\nfunction parseFieldUnique(attribute, fieldName, ctx) {\n\tlet direction;\n\tfor (const arg of attribute.args) {\n\t\tconst key = arg.kind === \"positional\" ? void 0 : arg.name;\n\t\tif (key === \"map\" || key === \"name\") continue;\n\t\tif (key === \"sort\") {\n\t\t\tdirection = sortDirection(arg.expression);\n\t\t\tif (direction === void 0) return unsupported(attribute, \"sort must be Asc or Desc.\", arg.span, ctx);\n\t\t\tcontinue;\n\t\t}\n\t\treturn unsupported(attribute, key === \"length\" ? \"argument \\\"length\\\" is not supported: a MongoDB index has no prefix length. Remove it; Prisma 6 ignores it on MongoDB.\" : `argument \"${key ?? \"\"}\" is not supported.`, arg.span, ctx);\n\t}\n\treturn {\n\t\tkind: \"unique\",\n\t\tfields: [{\n\t\t\tname: fieldName,\n\t\t\tdirection\n\t\t}],\n\t\tspan: attribute.span\n\t};\n}\n//#endregion\n//#region src/interpreter.ts\nconst SUMMARY = \"Prisma 6 MongoDB schema interpretation failed\";\nfunction stringArgument(attribute) {\n\tconst expression = (attribute.args.find((arg) => arg.kind === \"positional\") ?? attribute.args.find((arg) => arg.name === \"name\"))?.expression;\n\treturn expression === void 0 ? void 0 : StringLiteralExprAst.cast(expression.syntax)?.value();\n}\nfunction requireString(attribute, owner, sourceId, diagnostics) {\n\tconst value = stringArgument(attribute);\n\tif (value === void 0) diagnostics.push({\n\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\tmessage: `${owner}: attribute \"@${attribute.name}\" expects one string argument.`,\n\t\tsourceId,\n\t\tspan: attribute.span\n\t});\n\treturn value;\n}\nfunction attributeText(attribute) {\n\tconst args = attribute.args.map((arg) => arg.kind === \"named\" ? `${arg.name}: ${arg.value}` : arg.value);\n\treturn args.length === 0 ? `@${attribute.name}` : `@${attribute.name}(${args.join(\", \")})`;\n}\n/** `auto()` and `now()` with no arguments; any other `@default` value is `other`. */\nfunction defaultKind(attribute) {\n\tconst expression = attribute.args.find((arg) => arg.kind === \"positional\")?.expression;\n\tconst call = expression === void 0 ? void 0 : FunctionCallAst.cast(expression.syntax);\n\tif (call === void 0 || [...call.args()].length > 0) return \"other\";\n\tconst path = call.path().join(\".\");\n\treturn path === \"auto\" ? \"auto\" : path === \"now\" ? \"now\" : \"other\";\n}\nfunction unknownAttribute(owner, attribute, prefix, sourceId) {\n\treturn prisma6Diagnostic(\"PSL.PRISMA6_MONGO_UNKNOWN_ATTRIBUTE\", `${owner}: attribute \"${prefix}${attribute.name}\" is not supported by the Prisma 6 MongoDB contract source.`, sourceId, attribute.span);\n}\nfunction interpretPrisma6Documents(input) {\n\tconst { binding } = input;\n\tconst diagnostics = [...input.seedDiagnostics];\n\tconst datasources = [];\n\tconst enumBlocks = [];\n\tconst compositeTypes = [];\n\tconst models = [];\n\tconst ignoredModels = /* @__PURE__ */ new Set();\n\tconst declaredNames = /* @__PURE__ */ new Map();\n\tconst claimName = (kind, name, sourceId, span) => {\n\t\tconst previous = declaredNames.get(name);\n\t\tif (previous === void 0) {\n\t\t\tdeclaredNames.set(name, sourceId);\n\t\t\treturn true;\n\t\t}\n\t\tdiagnostics.push({\n\t\t\tcode: \"PSL_DUPLICATE_DECLARATION\",\n\t\t\tmessage: `Duplicate declaration of ${kind} \"${name}\"; first declared in ${basename(previous)}.`,\n\t\t\tsourceId,\n\t\t\tspan\n\t\t});\n\t\treturn false;\n\t};\n\tfor (const { document, sources, sourceFile, sourceId } of input.documents) {\n\t\tconst { symbolTable, diagnostics: tableDiagnostics } = buildSymbolTable({\n\t\t\tdocuments: [document],\n\t\t\tsources,\n\t\t\tpslBlockDescriptors: {}\n\t\t});\n\t\tfor (const diagnostic of tableDiagnostics) diagnostics.push({\n\t\t\tcode: diagnostic.code,\n\t\t\tmessage: diagnostic.message,\n\t\t\tsourceId,\n\t\t\tspan: sourceFile.rangeToPslSpan(diagnostic.range)\n\t\t});\n\t\tconst unsupported = (keyword, span) => {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_UNSUPPORTED_TOP_LEVEL_BLOCK\",\n\t\t\t\tmessage: `Unsupported top-level block \"${keyword}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan\n\t\t\t});\n\t\t};\n\t\tfor (const block of Object.values(symbolTable.topLevel.blocks)) switch (block.keyword) {\n\t\t\tcase \"datasource\":\n\t\t\t\tdatasources.push({\n\t\t\t\t\tsymbol: block,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tsources\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase \"generator\": break;\n\t\t\tcase \"enum\":\n\t\t\t\tif (claimName(\"enum\", block.name, sourceId, block.span)) enumBlocks.push({\n\t\t\t\t\tsymbol: block,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tsources\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase \"view\":\n\t\t\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_VIEW_UNSUPPORTED\", `View \"${block.name}\" is not supported; Prisma 8 has no views on MongoDB. Remove the view from the schema this contract source reads.`, sourceId, keywordPslSpan(block.node.syntax, block.keyword, sources)));\n\t\t\t\tbreak;\n\t\t\tdefault: unsupported(block.keyword, keywordPslSpan(block.node.syntax, block.keyword, sources));\n\t\t}\n\t\tfor (const namespace of Object.values(symbolTable.topLevel.namespaces)) for (const { span } of namespace.declarations) unsupported(\"namespace\", span);\n\t\tfor (const namedType of Object.values(symbolTable.topLevel.namedTypes)) unsupported(\"types\", namedType.span);\n\t\tfor (const symbol of Object.values(symbolTable.topLevel.compositeTypes)) if (claimName(\"type\", symbol.name, sourceId, symbol.span)) compositeTypes.push({\n\t\t\tsymbol,\n\t\t\tsourceId,\n\t\t\tsources\n\t\t});\n\t\tfor (const symbol of Object.values(symbolTable.topLevel.models)) {\n\t\t\tif (!claimName(\"model\", symbol.name, sourceId, symbol.span)) continue;\n\t\t\tif (symbol.attributes.some((attribute) => attribute.name === \"ignore\")) ignoredModels.add(symbol.name);\n\t\t\telse models.push({\n\t\t\t\tsymbol,\n\t\t\t\tsourceId,\n\t\t\t\tsources\n\t\t\t});\n\t\t}\n\t}\n\tcheckDatasource(datasources, input.documents[0]?.sourceId ?? \"schema.prisma\", binding, diagnostics);\n\tconst enums = /* @__PURE__ */ new Map();\n\tfor (const located of enumBlocks) {\n\t\tconst built = buildEnum(located, input, diagnostics);\n\t\tif (built !== void 0) enums.set(located.symbol.name, built);\n\t}\n\tconst modelNames = /* @__PURE__ */ new Set([...models.map((m) => m.symbol.name), ...ignoredModels]);\n\tconst typeContext = {\n\t\tbinding,\n\t\tenums,\n\t\tcompositeTypeNames: new Set(compositeTypes.map((c) => c.symbol.name)),\n\t\tdiagnostics\n\t};\n\tconst valueObjects = {};\n\tfor (const located of compositeTypes) valueObjects[located.symbol.name] = { fields: readCompositeFields(located, typeContext) };\n\tconst builds = /* @__PURE__ */ new Map();\n\tfor (const located of models) builds.set(located.symbol.name, readModel(located, modelNames, ignoredModels, typeContext));\n\tconst foreignKeys = [];\n\tconst invalidFkPairings = [];\n\tconst backRelations = [];\n\tfor (const build of builds.values()) readRelationFields(build, builds, {\n\t\tforeignKeys,\n\t\tinvalidFkPairings,\n\t\tbackRelations\n\t}, diagnostics);\n\tconst paired = pairMongoBackRelations({\n\t\tforeignKeys,\n\t\tcandidates: backRelations,\n\t\tinvalidFkPairings\n\t});\n\tdiagnostics.push(...mapPslDiagnostics(paired.diagnostics, mergedSources(input.documents)));\n\tfor (const { modelName, fieldName, relation } of paired.relations) {\n\t\tconst build = builds.get(modelName);\n\t\tif (build !== void 0) build.relations[fieldName] = relation;\n\t}\n\tconst collections = {};\n\tconst roots = {};\n\tconst executionDefaults = [];\n\tfor (const [modelName, build] of builds) {\n\t\tconst indexes = buildIndexes(build, diagnostics);\n\t\tconst existing = collections[build.collection];\n\t\tcollections[build.collection] = { indexes: [...existing?.indexes ?? [], ...indexes] };\n\t\troots[build.collection] = crossRef(modelName, UNBOUND_NAMESPACE_ID);\n\t\tfor (const { field, phases } of build.executionDefaults) executionDefaults.push({\n\t\t\tref: {\n\t\t\t\tnamespace: UNBOUND_NAMESPACE_ID,\n\t\t\t\tentry: build.collection,\n\t\t\t\tfield\n\t\t\t},\n\t\t\t...phases\n\t\t});\n\t\tif (!build.hasId) diagnostics.push({\n\t\t\tcode: \"PSL_MISSING_ID_FIELD\",\n\t\t\tmessage: `Model \"${modelName}\" has no field with @id attribute. Every model must have exactly one @id field.`,\n\t\t\tsourceId: build.located.sourceId,\n\t\t\tspan: build.located.symbol.span\n\t\t});\n\t}\n\tif (diagnostics.length > 0) return notOk({\n\t\tsummary: SUMMARY,\n\t\tdiagnostics\n\t});\n\treturn ok(assembleContract({\n\t\tbinding,\n\t\tbuilds,\n\t\tcollections,\n\t\troots,\n\t\tvalueObjects,\n\t\tenums,\n\t\texecutionDefaults,\n\t\tcodecLookup: input.codecLookup\n\t}));\n}\nfunction checkDatasource(datasources, fallbackSourceId, binding, diagnostics) {\n\tconst [datasource] = datasources;\n\tconst [namedProvider] = binding.providers;\n\tif (datasource === void 0) {\n\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_PROVIDER_MISMATCH\", `No datasource block found; add \\`datasource db { provider = \"${namedProvider}\" }\\`.`, fallbackSourceId, void 0));\n\t\treturn;\n\t}\n\tconst block = datasource.symbol.block;\n\tconst parameter = block.parameters[\"provider\"];\n\tlet provider;\n\tif (parameter?.kind === \"value\") try {\n\t\tconst parsed = JSON.parse(parameter.raw);\n\t\tprovider = typeof parsed === \"string\" ? parsed : void 0;\n\t} catch {\n\t\tprovider = void 0;\n\t}\n\tif (provider === void 0 || !binding.providers.includes(provider)) diagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_PROVIDER_MISMATCH\", provider === void 0 ? `The datasource block declares no string \\`provider\\`; this contract source reads Prisma 6 schemas for provider \"${namedProvider}\".` : `The datasource provider is \"${provider}\"; this contract source reads Prisma 6 schemas for provider \"${namedProvider}\".`, datasource.sourceId, parameter === void 0 ? block.span : parameter.span));\n}\nfunction buildEnum(located, input, diagnostics) {\n\tconst { symbol: block, sourceId, sources } = located;\n\tfor (const attribute of readResolvedAttributes(block.node.attributes(), sources)) {\n\t\tif (attribute.name === \"map\") continue;\n\t\tif (attribute.name === \"schema\") {\n\t\t\tdiagnostics.push(schemaUnsupported(`Enum \"${block.name}\"`, attribute, sourceId));\n\t\t\tcontinue;\n\t\t}\n\t\tdiagnostics.push(unknownAttribute(`Enum \"${block.name}\"`, attribute, \"@@\", sourceId));\n\t}\n\tconst parameters = {};\n\tfor (const entry of block.node.entries()) {\n\t\tconst name = entry.key()?.name();\n\t\tif (name === void 0) continue;\n\t\tlet value = name;\n\t\tfor (const attributeNode of entry.attributes()) {\n\t\t\tconst attribute = readResolvedAttribute(attributeNode, sources);\n\t\t\tif (attribute.name === \"map\") value = requireString(attribute, `Enum member \"${block.name}.${name}\"`, sourceId, diagnostics) ?? value;\n\t\t\telse diagnostics.push(unknownAttribute(`Enum member \"${block.name}.${name}\"`, attribute, \"@\", sourceId));\n\t\t}\n\t\tparameters[name] = {\n\t\t\tkind: \"value\",\n\t\t\traw: JSON.stringify(value),\n\t\t\tspan: nodePslSpan(entry.syntax, sources)\n\t\t};\n\t}\n\tconst descriptor = input.authoringContributions.entityTypes[\"enum\"];\n\tif (descriptor === void 0 || !isAuthoringEntityTypeDescriptor(descriptor)) {\n\t\tdiagnostics.push({\n\t\t\tcode: \"PSL_ENUM_MISSING_FACTORY\",\n\t\t\tmessage: `enum \"${block.name}\" requires an \"enum\" entityType factory in the active authoring contributions`,\n\t\t\tsourceId,\n\t\t\tspan: block.span\n\t\t});\n\t\treturn;\n\t}\n\tconst context = {\n\t\tfamily: input.binding.target.familyId,\n\t\ttarget: input.binding.target.targetId,\n\t\tcodecLookup: input.codecLookup,\n\t\tsourceId,\n\t\tenumInferenceCodecs: {\n\t\t\ttext: input.binding.scalarCodecIds.String,\n\t\t\tint: input.binding.scalarCodecIds.Int\n\t\t},\n\t\tdiagnostics: { push: (diagnostic) => {\n\t\t\tdiagnostics.push(blindCast(diagnostic));\n\t\t} }\n\t};\n\tconst handle = instantiateAuthoringEntityType(\"enum\", descriptor, [{\n\t\tkind: \"enum\",\n\t\tkeyword: \"enum\",\n\t\tname: block.name,\n\t\tparameters,\n\t\tblockAttributes: [],\n\t\tattributes: {},\n\t\tspan: block.span\n\t}], context);\n\tif (handle === void 0 || handle === null) return void 0;\n\treturn {\n\t\tcodecId: handle.codecId,\n\t\tmembers: handle.enumMembers.map((member) => ({\n\t\t\tname: member.name,\n\t\t\tvalue: member.value\n\t\t}))\n\t};\n}\nfunction schemaUnsupported(owner, attribute, sourceId) {\n\treturn prisma6Diagnostic(\"PSL.PRISMA6_MONGO_SCHEMA_UNSUPPORTED\", `${owner}: \"@@schema\" is not supported; a MongoDB contract has one database, bound by the connection string. Remove @@schema.`, sourceId, attribute.span);\n}\nfunction unsupportedTypeMessage(label, typeName, owner) {\n\tconst base = `${label} has type \"${typeName}(...)\", which has no Prisma 8 codec, so ${`${owner.kind} \"${owner.name}\"`} cannot use this contract source while it has the field. Prisma 6 rejects @ignore on an Unsupported field. Removing the field from the schema leaves its stored values in the documents, but the Prisma 6 client no longer reads or writes them.`;\n\tif (owner.kind === \"type\") return base;\n\treturn `${base} Adding @@ignore to model \"${owner.name}\" keeps the model out of the contract, but the model disappears from the Prisma 6 client too, and every relation field in another model that points to it needs @ignore, which removes that field from the Prisma 6 client as well.`;\n}\n/** The field's contract type, or `undefined` after reporting why it has none. */\nfunction resolveFieldType(field, owner, nativeType, sourceId, ctx) {\n\tconst { binding, diagnostics } = ctx;\n\tconst label = `Field \"${owner.name}.${field.name}\"`;\n\tif (field.typeConstructor !== void 0) {\n\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_UNSUPPORTED_TYPE\", unsupportedTypeMessage(label, field.typeConstructor.path.join(\".\"), owner), sourceId, field.typeConstructor.span));\n\t\treturn;\n\t}\n\tconst nativeTypeUnsupported = (attribute) => {\n\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_NATIVE_TYPE_UNSUPPORTED\", attribute.name === \"db.ObjectId\" ? `${label}: @db.ObjectId is only supported on a String field, and this field is \"${field.typeName}\". Remove @db.ObjectId, or change the field type to String.` : `${label}: native type \"@${attribute.name}\" is not supported by the Prisma 6 MongoDB contract source; only @db.ObjectId is. Remove it: the stored BSON type then follows the field type.`, sourceId, attribute.span));\n\t};\n\tconst many = field.list ? { many: true } : {};\n\tif (ctx.compositeTypeNames.has(field.typeName)) {\n\t\tif (nativeType !== void 0) return nativeTypeUnsupported(nativeType);\n\t\treturn {\n\t\t\ttype: {\n\t\t\t\tkind: \"valueObject\",\n\t\t\t\tname: field.typeName\n\t\t\t},\n\t\t\tnullable: field.optional,\n\t\t\t...many\n\t\t};\n\t}\n\tconst enumBuild = ctx.enums.get(field.typeName);\n\tif (enumBuild !== void 0) {\n\t\tif (nativeType !== void 0) return nativeTypeUnsupported(nativeType);\n\t\tconst valueSet = {\n\t\t\tplane: \"domain\",\n\t\t\tentityKind: \"enum\",\n\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\t\tentityName: field.typeName\n\t\t};\n\t\treturn {\n\t\t\ttype: {\n\t\t\t\tkind: \"scalar\",\n\t\t\t\tcodecId: enumBuild.codecId\n\t\t\t},\n\t\t\tnullable: field.optional,\n\t\t\tvalueSet,\n\t\t\t...many\n\t\t};\n\t}\n\tconst scalarCodecId = Object.hasOwn(binding.scalarCodecIds, field.typeName) ? binding.scalarCodecIds[field.typeName] : void 0;\n\tif (scalarCodecId === void 0) {\n\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_UNSUPPORTED_TYPE\", `${label} has unknown type \"${field.typeName}\": it is not a scalar type, an enum, a composite type, or a model. Correct the type name.`, sourceId, field.span));\n\t\treturn;\n\t}\n\tlet codecId = scalarCodecId;\n\tif (nativeType !== void 0) {\n\t\tif (nativeType.name !== \"db.ObjectId\" || field.typeName !== \"String\") return nativeTypeUnsupported(nativeType);\n\t\tcodecId = binding.objectIdCodecId;\n\t}\n\treturn {\n\t\ttype: {\n\t\t\tkind: \"scalar\",\n\t\t\tcodecId\n\t\t},\n\t\tnullable: field.optional,\n\t\t...many\n\t};\n}\nfunction readCompositeFields(located, ctx) {\n\tconst { symbol, sourceId } = located;\n\tfor (const attribute of symbol.attributes) ctx.diagnostics.push(unknownAttribute(`Type \"${symbol.name}\"`, attribute, \"@@\", sourceId));\n\tconst fields = {};\n\tfor (const field of Object.values(symbol.fields)) {\n\t\tif (field.malformedType) continue;\n\t\tconst label = `Field \"${symbol.name}.${field.name}\"`;\n\t\tlet nativeType;\n\t\tlet rejected = false;\n\t\tfor (const attribute of field.attributes) if (attribute.name.startsWith(\"db.\")) nativeType = attribute;\n\t\telse if (attribute.name === \"map\") {\n\t\t\tctx.diagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_COMPOSITE_MAP_UNSUPPORTED\", `${label}: @map on a field of a composite type is not supported yet. The stored field keeps the name \"${stringArgument(attribute) ?? field.name}\", so removing @map renames it in storage; keep the schema as it is until Prisma 8 supports it.`, sourceId, attribute.span));\n\t\t\trejected = true;\n\t\t} else if (attribute.name === \"default\") {\n\t\t\tctx.diagnostics.push(defaultUnsupported(label, attribute, sourceId));\n\t\t\trejected = true;\n\t\t} else {\n\t\t\tctx.diagnostics.push(unknownAttribute(label, attribute, \"@\", sourceId));\n\t\t\trejected = true;\n\t\t}\n\t\tif (rejected) continue;\n\t\tconst resolved = resolveFieldType(field, {\n\t\t\tkind: \"type\",\n\t\t\tname: symbol.name\n\t\t}, nativeType, sourceId, ctx);\n\t\tif (resolved !== void 0) fields[field.name] = resolved;\n\t}\n\treturn fields;\n}\nfunction defaultUnsupported(label, attribute, sourceId) {\n\treturn prisma6Diagnostic(\"PSL.PRISMA6_MONGO_DEFAULT_UNSUPPORTED\", `${label}: ${attributeText(attribute)} is not supported. MongoDB has no stored defaults, and Prisma 8 fills only \\`now()\\` on DateTime fields. Remove the default and set the value when you create documents.`, sourceId, attribute.span);\n}\nfunction readModel(located, modelNames, ignoredModels, ctx) {\n\tconst { symbol, sourceId, sources } = located;\n\tconst { diagnostics } = ctx;\n\tconst modelLabel = `Model \"${symbol.name}\"`;\n\tlet collection = symbol.name;\n\tconst build = {\n\t\tlocated,\n\t\tcollection: symbol.name,\n\t\tstoredNames: /* @__PURE__ */ new Map(),\n\t\tignoredFields: /* @__PURE__ */ new Set(),\n\t\trejectedFields: /* @__PURE__ */ new Set(),\n\t\tfields: {},\n\t\trelations: {},\n\t\texecutionDefaults: [],\n\t\tuniqueFields: [],\n\t\tmodelIndexes: [],\n\t\trelationFields: [],\n\t\thasId: false\n\t};\n\tconst indexContext = {\n\t\towner: modelLabel,\n\t\tprefix: \"@@\",\n\t\tsourceId,\n\t\tsources,\n\t\tdiagnostics\n\t};\n\tfor (const attribute of symbol.attributes) switch (attribute.name) {\n\t\tcase \"map\":\n\t\t\tcollection = requireString(attribute, modelLabel, sourceId, diagnostics) ?? collection;\n\t\t\tbreak;\n\t\tcase \"index\":\n\t\tcase \"unique\":\n\t\tcase \"fulltext\": {\n\t\t\tconst parsed = parseIndexAttribute({\n\t\t\t\t...attribute,\n\t\t\t\tname: attribute.name\n\t\t\t}, indexContext);\n\t\t\tif (parsed !== void 0) build.modelIndexes.push(parsed);\n\t\t\tbreak;\n\t\t}\n\t\tcase \"id\":\n\t\t\tbuild.hasId = true;\n\t\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_COMPOSITE_ID_UNSUPPORTED\", `${modelLabel}: @@id is not supported; a MongoDB document is identified by its \"_id\" field. Declare the id as \\`id String @id @default(auto()) @map(\"_id\") @db.ObjectId\\`.`, sourceId, attribute.span));\n\t\t\tbreak;\n\t\tcase \"schema\":\n\t\t\tdiagnostics.push(schemaUnsupported(modelLabel, attribute, sourceId));\n\t\t\tbreak;\n\t\tcase \"ignore\": break;\n\t\tdefault: diagnostics.push(unknownAttribute(modelLabel, attribute, \"@@\", sourceId));\n\t}\n\tfor (const field of Object.values(symbol.fields)) {\n\t\tconst reported = diagnostics.length;\n\t\treadModelField(field, build, modelNames, ignoredModels, ctx);\n\t\tif (diagnostics.length > reported) build.rejectedFields.add(field.name);\n\t}\n\treturn {\n\t\t...build,\n\t\tcollection\n\t};\n}\nfunction readModelField(field, build, modelNames, ignoredModels, ctx) {\n\tconst { symbol, sourceId, sources } = build.located;\n\tconst { diagnostics, binding } = ctx;\n\tconst label = `Field \"${symbol.name}.${field.name}\"`;\n\tconst isRelationField = modelNames.has(field.typeName) && field.typeConstructor === void 0;\n\tif (field.attributes.some((attribute) => attribute.name === \"ignore\")) {\n\t\tbuild.ignoredFields.add(field.name);\n\t\tconst unique = field.attributes.find((attribute) => attribute.name === \"unique\");\n\t\tif (unique !== void 0) diagnostics.push(ignoredFieldReferenced(symbol.name, [field.name], `@unique on field \"${symbol.name}.${field.name}\"`, sourceId, unique.span));\n\t\treturn;\n\t}\n\tif (isRelationField) {\n\t\tif (ignoredModels.has(field.typeName)) return;\n\t\tlet relation;\n\t\tfor (const attribute of field.attributes) if (attribute.name === \"relation\") relation = attribute;\n\t\telse diagnostics.push(unknownAttribute(label, attribute, \"@\", sourceId));\n\t\tbuild.relationFields.push({\n\t\t\tfield,\n\t\t\trelation\n\t\t});\n\t\treturn;\n\t}\n\tlet storedName = field.name;\n\tlet nativeType;\n\tlet idAttribute;\n\tlet defaultAttribute;\n\tlet updatedAt;\n\tfor (const attribute of field.attributes) switch (attribute.name) {\n\t\tcase \"map\":\n\t\t\tstoredName = requireString(attribute, label, sourceId, diagnostics) ?? storedName;\n\t\t\tbreak;\n\t\tcase \"id\":\n\t\t\tidAttribute = attribute;\n\t\t\tbreak;\n\t\tcase \"default\":\n\t\t\tdefaultAttribute = attribute;\n\t\t\tbreak;\n\t\tcase \"updatedAt\":\n\t\t\tupdatedAt = attribute;\n\t\t\tbreak;\n\t\tcase \"unique\": {\n\t\t\tconst parsed = parseFieldUnique(attribute, field.name, {\n\t\t\t\towner: label,\n\t\t\t\tprefix: \"@\",\n\t\t\t\tsourceId,\n\t\t\t\tsources,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (parsed !== void 0) build.uniqueFields.push(parsed);\n\t\t\tbreak;\n\t\t}\n\t\tdefault: if (attribute.name.startsWith(\"db.\")) nativeType = attribute;\n\t\telse diagnostics.push(unknownAttribute(label, attribute, \"@\", sourceId));\n\t}\n\tbuild.storedNames.set(field.name, storedName);\n\tif (field.malformedType) return;\n\tconst resolved = resolveFieldType(field, {\n\t\tkind: \"model\",\n\t\tname: symbol.name\n\t}, nativeType, sourceId, ctx);\n\tif (resolved === void 0) return;\n\tconst codecId = resolved.type.kind === \"scalar\" ? resolved.type.codecId : void 0;\n\tif (idAttribute !== void 0) {\n\t\tbuild.hasId = true;\n\t\tif (codecId !== binding.objectIdCodecId || storedName !== \"_id\" || field.optional || field.list) {\n\t\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_ID_NOT_OBJECTID\", `${label} is the model's @id, but it is not a required ObjectId stored as \"_id\". Prisma 8 identifies a MongoDB document by an ObjectId \"_id\"; declare the id as \\`${field.name} String @id @default(auto()) @map(\"_id\") @db.ObjectId\\`.`, sourceId, idAttribute.span));\n\t\t\treturn;\n\t\t}\n\t\tif (defaultAttribute !== void 0 && defaultKind(defaultAttribute) !== \"auto\") {\n\t\t\tdiagnostics.push(defaultUnsupported(label, defaultAttribute, sourceId));\n\t\t\treturn;\n\t\t}\n\t\tbuild.fields[storedName] = resolved;\n\t\treturn;\n\t}\n\tconst isDateTime = codecId === binding.scalarCodecIds.DateTime && !field.list;\n\tif (updatedAt !== void 0 && !isDateTime) {\n\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_UPDATED_AT_TYPE_UNSUPPORTED\", `${label}: @updatedAt is only supported on a DateTime field. Remove @updatedAt and set the value when you write documents.`, sourceId, updatedAt.span));\n\t\treturn;\n\t}\n\tconst defaultIsNow = defaultAttribute !== void 0 && defaultKind(defaultAttribute) === \"now\";\n\tif (defaultAttribute !== void 0 && (!defaultIsNow || !isDateTime)) {\n\t\tdiagnostics.push(defaultUnsupported(label, defaultAttribute, sourceId));\n\t\treturn;\n\t}\n\tconst generator = {\n\t\tkind: \"generator\",\n\t\tid: binding.timestampGeneratorId\n\t};\n\tconst phases = updatedAt !== void 0 ? {\n\t\tonCreate: generator,\n\t\tonUpdate: generator\n\t} : defaultIsNow ? { onCreate: generator } : void 0;\n\tif (phases !== void 0 && field.optional) {\n\t\tconst written = updatedAt ?? defaultAttribute;\n\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_OPTIONAL_GENERATED_FIELD_UNSUPPORTED\", `${label} is optional and its value comes from ${written === void 0 ? \"a generator\" : attributeText(written)}, which Prisma 8 cannot express on an optional field yet. Make the field required, or remove ${written === void 0 ? \"the generator\" : attributeText(written)} and set the value when you write documents.`, sourceId, written?.span ?? field.span));\n\t\treturn;\n\t}\n\tbuild.fields[storedName] = resolved;\n\tif (phases !== void 0) build.executionDefaults.push({\n\t\tfield: storedName,\n\t\tphases\n\t});\n}\nfunction identifierList(attributeArg) {\n\tconst expression = attributeArg.expression;\n\tconst array = expression === void 0 ? void 0 : ArrayLiteralAst.cast(expression.syntax);\n\tif (array === void 0) return void 0;\n\tconst names = [];\n\tfor (const element of array.elements()) {\n\t\tconst name = IdentifierAst.cast(element.syntax)?.name();\n\t\tif (name === void 0) return void 0;\n\t\tnames.push(name);\n\t}\n\treturn names;\n}\nfunction readRelationArguments(attribute, label, sourceId, diagnostics) {\n\tlet name;\n\tlet fields;\n\tlet references;\n\tconst invalid = (what, span) => {\n\t\tdiagnostics.push({\n\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\tmessage: `${label}: @relation ${what}.`,\n\t\t\tsourceId,\n\t\t\tspan\n\t\t});\n\t};\n\tfor (const arg of attribute.args) {\n\t\tconst key = arg.kind === \"positional\" ? \"name\" : arg.name;\n\t\tswitch (key) {\n\t\t\tcase \"name\": {\n\t\t\t\tconst expression = arg.expression;\n\t\t\t\tname = expression === void 0 ? void 0 : StringLiteralExprAst.cast(expression.syntax)?.value();\n\t\t\t\tif (name === void 0) return invalid(\"name must be a string\", arg.span);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"fields\":\n\t\t\t\tfields = identifierList(arg);\n\t\t\t\tif (fields === void 0) return invalid(\"fields must be a list of field names\", arg.span);\n\t\t\t\tbreak;\n\t\t\tcase \"references\":\n\t\t\t\treferences = identifierList(arg);\n\t\t\t\tif (references === void 0) return invalid(\"references must be a list of field names\", arg.span);\n\t\t\t\tbreak;\n\t\t\tcase \"onDelete\":\n\t\t\tcase \"onUpdate\":\n\t\t\tcase \"map\":\n\t\t\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_REFERENTIAL_ACTION_UNSUPPORTED\", key === \"map\" ? `${label}: @relation argument \"map\" is not supported; it names a foreign key constraint, and MongoDB has none. Remove \"map\".` : `${label}: @relation argument \"${key}\" is not supported; Prisma 8 enforces no referential actions on MongoDB. Remove \"${key}\" and handle related documents in application code.`, sourceId, arg.span));\n\t\t\t\treturn;\n\t\t\tdefault: return invalid(`argument \"${key ?? \"\"}\" is not supported`, arg.span);\n\t\t}\n\t}\n\treturn {\n\t\tname,\n\t\tfields,\n\t\treferences\n\t};\n}\nfunction ignoredFieldReferenced(modelName, fieldNames, usedBy, sourceId, span) {\n\tconst one = fieldNames.length === 1;\n\tconst fields = fieldNames.map((name) => `\"${modelName}.${name}\"`).join(\", \");\n\treturn prisma6Diagnostic(\"PSL.PRISMA6_MONGO_IGNORED_FIELD_REFERENCED\", `${one ? \"Field\" : \"Fields\"} ${fields} ${one ? \"is\" : \"are\"} marked @ignore, but ${usedBy} uses ${one ? \"it\" : \"them\"}. Remove @ignore from ${fields}, or remove ${usedBy}.`, sourceId, span);\n}\nfunction readRelationFields(build, builds, out, diagnostics) {\n\tconst { symbol, sourceId, sources } = build.located;\n\tfor (const { field, relation } of build.relationFields) {\n\t\tconst label = `Relation field \"${symbol.name}.${field.name}\"`;\n\t\tconst reject = () => {\n\t\t\tout.invalidFkPairings.push({\n\t\t\t\tpairKey: fkRelationPairKey(symbol.name, field.typeName),\n\t\t\t\t...ifDefined(\"relationName\", relation === void 0 ? void 0 : stringArgument(relation))\n\t\t\t});\n\t\t};\n\t\tconst args = relation === void 0 ? void 0 : readRelationArguments(relation, label, sourceId, diagnostics);\n\t\tif (relation !== void 0 && args === void 0) {\n\t\t\treject();\n\t\t\tcontinue;\n\t\t}\n\t\tconst target = builds.get(field.typeName);\n\t\tif (target === void 0) continue;\n\t\tif (!(args?.fields !== void 0 || args?.references !== void 0)) {\n\t\t\tout.backRelations.push({\n\t\t\t\tmodelName: symbol.name,\n\t\t\t\tfield,\n\t\t\t\ttargetModelName: field.typeName,\n\t\t\t\t...ifDefined(\"relationName\", args?.name),\n\t\t\t\tcardinality: field.list ? \"1:N\" : \"1:1\",\n\t\t\t\tsources\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (field.list) {\n\t\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_LIST_RELATION_UNSUPPORTED\", `${label} is a list relation that stores its keys in a list field (a many-to-many relation on MongoDB), which Prisma 8 does not support yet. Remove the relation fields from the schema this contract source reads and keep the key list as a plain field.`, sourceId, relation?.span ?? field.span));\n\t\t\treject();\n\t\t\tcontinue;\n\t\t}\n\t\tconst localNames = args?.fields ?? [];\n\t\tconst targetNames = args?.references ?? [];\n\t\tconst ignoredLocal = localNames.filter((name) => build.ignoredFields.has(name));\n\t\tif (ignoredLocal.length > 0) {\n\t\t\tdiagnostics.push(ignoredFieldReferenced(symbol.name, ignoredLocal, `relation field \"${symbol.name}.${field.name}\"`, sourceId, relation?.span ?? field.span));\n\t\t\treject();\n\t\t\tcontinue;\n\t\t}\n\t\tconst ignoredTarget = targetNames.filter((name) => target.ignoredFields.has(name));\n\t\tif (ignoredTarget.length > 0) {\n\t\t\tdiagnostics.push(ignoredFieldReferenced(target.located.symbol.name, ignoredTarget, `relation field \"${symbol.name}.${field.name}\"`, sourceId, relation?.span ?? field.span));\n\t\t\treject();\n\t\t\tcontinue;\n\t\t}\n\t\tconst localFields = localNames.map((name) => build.storedNames.get(name));\n\t\tconst targetFields = targetNames.map((name) => target.storedNames.get(name));\n\t\tif (localFields.some((name) => name === void 0) || targetFields.some((name) => name === void 0) || localNames.length !== targetNames.length || localNames.length === 0) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\t\tmessage: `${label}: @relation fields and references must name the same number of scalar fields of \"${symbol.name}\" and \"${field.typeName}\".`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: relation?.span ?? field.span\n\t\t\t});\n\t\t\treject();\n\t\t\tcontinue;\n\t\t}\n\t\tif (resolveToOneRelationNullable({\n\t\t\tdeclaredNullable: field.optional,\n\t\t\tlocalFieldNullability: localNames.map((name) => symbol.fields[name]?.optional === true),\n\t\t\townsReference: true\n\t\t}).contradiction !== void 0) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_RELATION_NULLABILITY_MISMATCH\",\n\t\t\t\tmessage: field.optional ? `${label} is optional but every field in @relation(fields: [...]) is required. Make one of those fields optional with \"?\" or remove \"?\" from \"${field.name}\".` : `${label} is required but a field in @relation(fields: [...]) is optional. Add \"?\" to \"${field.name}\" or make those fields required.`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: field.span\n\t\t\t});\n\t\t\treject();\n\t\t\tcontinue;\n\t\t}\n\t\tconst local = localFields.filter((name) => name !== void 0);\n\t\tconst referenced = targetFields.filter((name) => name !== void 0);\n\t\tbuild.relations[field.name] = {\n\t\t\tto: crossRef(field.typeName, UNBOUND_NAMESPACE_ID),\n\t\t\tcardinality: \"N:1\",\n\t\t\tnullable: field.optional,\n\t\t\ton: {\n\t\t\t\tlocalFields: local,\n\t\t\t\ttargetFields: referenced\n\t\t\t}\n\t\t};\n\t\tout.foreignKeys.push({\n\t\t\tdeclaringModel: symbol.name,\n\t\t\ttargetModel: field.typeName,\n\t\t\t...ifDefined(\"relationName\", args?.name),\n\t\t\tlocalFields: local,\n\t\t\ttargetFields: referenced\n\t\t});\n\t}\n}\nfunction buildIndexes(build, diagnostics) {\n\tconst { symbol, sourceId } = build.located;\n\tconst indexes = [];\n\tlet textIndexes = 0;\n\tconst keyFor = (field, text) => ({\n\t\tfield: build.storedNames.get(field.name) ?? field.name,\n\t\tdirection: field.direction ?? (text ? \"text\" : 1)\n\t});\n\tfor (const attribute of [...build.uniqueFields, ...build.modelIndexes]) {\n\t\tconst names = attribute.fields.map((field) => field.name);\n\t\tconst usedBy = build.uniqueFields.includes(attribute) ? `@unique on field \"${symbol.name}.${attribute.fields[0]?.name ?? \"\"}\"` : `@@${attribute.kind} on model \"${symbol.name}\"`;\n\t\tconst ignored = names.filter((name) => build.ignoredFields.has(name));\n\t\tif (ignored.length > 0) {\n\t\t\tdiagnostics.push(ignoredFieldReferenced(symbol.name, ignored, usedBy, sourceId, attribute.span));\n\t\t\tcontinue;\n\t\t}\n\t\tif (names.some((name) => build.rejectedFields.has(name))) continue;\n\t\tconst unknown = names.find((name) => !build.storedNames.has(name));\n\t\tif (unknown !== void 0) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INDEX_FIELD_NOT_FOUND\",\n\t\t\t\tmessage: `Index on model \"${symbol.name}\" references unknown field \"${unknown}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: attribute.span\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (attribute.kind === \"fulltext\") {\n\t\t\ttextIndexes++;\n\t\t\tif (textIndexes > 1) {\n\t\t\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_TEXT_INDEX_LIMIT\", `Model \"${symbol.name}\" has more than one @@fulltext; MongoDB allows one text index per collection. Merge the fields into one @@fulltext.`, sourceId, attribute.span));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tindexes.push(new MongoIndex({\n\t\t\tkeys: attribute.fields.map((field) => keyFor(field, attribute.kind === \"fulltext\")),\n\t\t\t...attribute.kind === \"unique\" ? { unique: true } : {}\n\t\t}));\n\t}\n\treturn indexes;\n}\nfunction assembleContract(input) {\n\tconst target = input.binding.target.targetId;\n\tconst targetFamily = input.binding.target.familyId;\n\tconst builtEnums = {};\n\tfor (const [enumName, built] of input.enums) builtEnums[enumName] = {\n\t\tcodecId: built.codecId,\n\t\tmembers: built.members.map((member) => ({\n\t\t\tname: member.name,\n\t\t\tvalue: blindCast(member.value)\n\t\t}))\n\t};\n\tconst collections = {};\n\tfor (const [name, collection] of Object.entries(input.collections)) collections[name] = collection.indexes.length > 0 ? { indexes: collection.indexes } : {};\n\tconst storage = blindCast(buildMongoStorage({\n\t\tcollections,\n\t\tvalueSets: encodeMongoValueSets(Object.fromEntries(input.enums), input.codecLookup)\n\t}));\n\tconst models = {};\n\tfor (const [modelName, build] of input.builds) models[modelName] = {\n\t\tfields: build.fields,\n\t\trelations: build.relations,\n\t\tstorage: { collection: build.collection }\n\t};\n\tconst capabilities = {};\n\tconst execution = buildMongoExecutionSection(input.executionDefaults);\n\treturn {\n\t\ttargetFamily,\n\t\ttarget,\n\t\troots: input.roots,\n\t\tdomain: { namespaces: { [UNBOUND_NAMESPACE_ID]: {\n\t\t\tmodels: blindCast(models),\n\t\t\t...Object.keys(input.valueObjects).length > 0 ? { valueObjects: input.valueObjects } : {},\n\t\t\t...Object.keys(builtEnums).length > 0 ? { enum: builtEnums } : {}\n\t\t} } },\n\t\tstorage,\n\t\textensions: {},\n\t\tcapabilities,\n\t\tprofileHash: computeProfileHash({\n\t\t\ttarget,\n\t\t\ttargetFamily,\n\t\t\tcapabilities\n\t\t}),\n\t\tmeta: {},\n\t\t...execution !== void 0 ? { execution } : {}\n\t};\n}\nfunction mergedSources(documents) {\n\tconst [first, ...rest] = documents.map((document) => document.sources);\n\tif (first === void 0) throw new InternalError(\"A Prisma 6 schema has at least one document\");\n\treturn first.merge(...rest);\n}\n//#endregion\n//#region src/provider.ts\nfunction defaultOutputFromSchemaPath(schemaPath) {\n\treturn join(dirname(schemaPath), \"contract.json\");\n}\nfunction mapParseDiagnostics(diagnostics, sourceFile, sourceId) {\n\treturn diagnostics.map((diagnostic) => ({\n\t\tcode: diagnostic.code,\n\t\tmessage: diagnostic.message,\n\t\tsourceId,\n\t\tspan: sourceFile.rangeToPslSpan(diagnostic.range)\n\t}));\n}\n/**\n* The files a Prisma 6 schema input names: the file itself, or every regular `.prisma` file under the directory, nested directories and symbolic links included, as Prisma 6 reads a schema directory. Sorted by path so duplicate detection blames the later file deterministically.\n*/\nasync function listSchemaFiles(absolutePath, displayPath) {\n\tif (!(await stat(absolutePath)).isDirectory()) return [{\n\t\tsourceId: displayPath,\n\t\tabsolutePath\n\t}];\n\tconst entries = await readdir(absolutePath, { recursive: true });\n\tconst files = [];\n\tfor (const entry of entries.filter((name) => extname(name) === \".prisma\").map((name) => normalize(name)).sort()) {\n\t\tconst entryPath = join(absolutePath, entry);\n\t\tif ((await stat(entryPath)).isFile()) files.push({\n\t\t\tsourceId: join(displayPath, entry),\n\t\t\tabsolutePath: entryPath\n\t\t});\n\t}\n\treturn files;\n}\nfunction readFailure(schemaPath, message, meta) {\n\treturn notOk({\n\t\tsummary: `Failed to read Prisma 6 schema at \"${schemaPath}\"`,\n\t\tdiagnostics: [prisma6Diagnostic(\"PSL.PRISMA6_MONGO_SCHEMA_READ_FAILED\", message, schemaPath, void 0)],\n\t\tmeta\n\t});\n}\n/**\n* A `ContractConfig` that reads a Prisma 6 MongoDB `schema.prisma` (a file, or a directory of `.prisma` files) as the contract source.\n*/\nfunction prisma6Contract(schemaPath, options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"prisma6\",\n\t\t\tinputs: [schemaPath],\n\t\t\tasync load(context) {\n\t\t\t\tconst [absolutePath] = context.resolvedInputs;\n\t\t\t\tif (absolutePath === void 0) throw new InternalError(\"prisma6Contract: context.resolvedInputs is empty. The CLI config loader should populate it from source.inputs.\");\n\t\t\t\tlet files;\n\t\t\t\ttry {\n\t\t\t\t\tfiles = await listSchemaFiles(absolutePath, schemaPath);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst message = String(error);\n\t\t\t\t\treturn readFailure(schemaPath, message, {\n\t\t\t\t\t\tschemaPath,\n\t\t\t\t\t\tabsolutePath,\n\t\t\t\t\t\tcause: message\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (files.length === 0) return readFailure(schemaPath, `The schema directory \"${schemaPath}\" contains no .prisma file.`, {\n\t\t\t\t\tschemaPath,\n\t\t\t\t\tabsolutePath\n\t\t\t\t});\n\t\t\t\tconst documents = [];\n\t\t\t\tconst seedDiagnostics = [];\n\t\t\t\tfor (const file of files) {\n\t\t\t\t\tlet schema;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tschema = await readFile(file.absolutePath, \"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\treturn readFailure(file.sourceId, message, {\n\t\t\t\t\t\t\tschemaPath: file.sourceId,\n\t\t\t\t\t\t\tabsoluteSchemaPath: file.absolutePath,\n\t\t\t\t\t\t\tcause: message\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tconst { document, sources, diagnostics } = parse(schema, file.sourceId, { grammar: \"prisma7\" });\n\t\t\t\t\tconst sourceFile = sources.sourceFileFor(document.syntax);\n\t\t\t\t\tseedDiagnostics.push(...mapParseDiagnostics(diagnostics, sourceFile, file.sourceId));\n\t\t\t\t\tdocuments.push({\n\t\t\t\t\t\tdocument,\n\t\t\t\t\t\tsources,\n\t\t\t\t\t\tsourceFile,\n\t\t\t\t\t\tsourceId: file.sourceId\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tlet contract;\n\t\t\t\ttry {\n\t\t\t\t\tconst interpreted = interpretPrisma6Documents({\n\t\t\t\t\t\tdocuments,\n\t\t\t\t\t\tseedDiagnostics,\n\t\t\t\t\t\tbinding: options.binding,\n\t\t\t\t\t\tauthoringContributions: context.authoringContributions,\n\t\t\t\t\t\tcodecLookup: context.codecLookup\n\t\t\t\t\t});\n\t\t\t\t\tif (!interpreted.ok) return interpreted;\n\t\t\t\t\tcontract = applySpecifierDefaultControlPolicy(interpreted.value, options.defaultControlPolicy);\n\t\t\t\t\tvalidateContractDomain(contract);\n\t\t\t\t\tvalidateMongoStorage(blindCast(contract));\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (!isStructuredError(error)) throw error;\n\t\t\t\t\treturn notOk({\n\t\t\t\t\t\tsummary: \"Prisma 6 MongoDB schema interpretation failed\",\n\t\t\t\t\t\tdiagnostics: [prisma6Diagnostic(\"PSL.PRISMA6_MONGO_CONTRACT_INVALID\", `This schema gives a contract that Prisma 8 rejects, and the Prisma 6 MongoDB contract source has no specific diagnostic for the cause: ${error.message.replace(/\\.$/, \"\")}. This is a bug in Prisma ORM; please report it with this schema.`, schemaPath, void 0)],\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tschemaPath,\n\t\t\t\t\t\t\tcode: error.code\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn ok(contract);\n\t\t\t}\n\t\t},\n\t\toutput: options.output ?? defaultOutputFromSchemaPath(schemaPath)\n\t};\n}\n//#endregion\nexport { prisma6Contract };\n\n//# sourceMappingURL=provider.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoBA,SAAS,kBAAkB,MAAM,SAAS,UAAU,MAAM;CACzD,OAAO;EACN;EACA;EACA;EACA,GAAG,SAAS,KAAK,IAAI,EAAE,KAAK,IAAI,CAAC;CAClC;AACD;AAGA,SAAS,YAAY,WAAW,MAAM,MAAM,KAAK;CAChD,IAAI,YAAY,KAAK,kBAAkB,gDAAgD,GAAG,IAAI,MAAM,IAAI,IA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AI,OAAO;KAC5B,WAAW,mCAAmC,YAAY,OAAO,QAAQ,oBAAoB;KAC7F,uBAAuB,QAAQ;KAC/B,qBAAqB,UAAU,QAAQ,CAAC;IACzC,SAAS,OAAO;KACf,IAAI,CAAC,kBAAkB,KAAK,GAAG,MAAM;KACrC,OAAO,MAAM;MACZ,SAAS;MACT,aAAa,CAAC,kBAAkB,sCAAsC,0IAA0I,MAAM,QAAQ,QAAQ,OAAO,EAAE,EAAE,oEAAoE,YAAY,KAAK,CAAC,CAAC;MACxU,MAAM;OACL;OACA,MAAM,MAAM;MACb;KACD,CAAC;IACF;IACA,OAAO,GAAG,QAAQ;GACnB;EACD;EACA,QAAQ,QAAQ,UAAU,4BAA4B,UAAU;CACjE;AACD"}
|
|
1
|
+
{"version":3,"file":"contract-prisma6__provider.mjs","names":[],"sources":["../../../../2-mongo-family/2-authoring/contract-prisma6/dist/provider.mjs"],"sourcesContent":["import { readFile, readdir, stat } from \"node:fs/promises\";\nimport { applySpecifierDefaultControlPolicy } from \"@internal/contract/apply-specifier-default-control-policy\";\nimport { validateContractDomain } from \"@internal/contract/validate-domain\";\nimport { MongoIndex, buildMongoExecutionSection, buildMongoStorage, encodeMongoValueSets, validateMongoStorage } from \"@internal/mongo-contract\";\nimport { ArrayLiteralAst, FunctionCallAst, IdentifierAst, StringLiteralExprAst, parse } from \"@internal/psl-parser/syntax\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { isStructuredError } from \"@internal/utils/structured-error\";\nimport { basename, dirname, extname, join, normalize } from \"pathe\";\nimport { computeProfileHash } from \"@internal/contract/hashing\";\nimport { crossRef } from \"@internal/contract/types\";\nimport { resolveToOneRelationNullable } from \"@internal/contract-authoring\";\nimport { instantiateAuthoringEntityType, isAuthoringEntityTypeDescriptor } from \"@internal/framework-components/authoring\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { pairMongoBackRelations } from \"@internal/mongo-contract-psl\";\nimport { buildSymbolTable, keywordPslSpan, mapPslDiagnostics, nodePslSpan, readResolvedAttribute, readResolvedAttributes } from \"@internal/psl-parser\";\nimport { fkRelationPairKey } from \"@internal/psl-parser/interpret\";\nimport { ifDefined } from \"@internal/utils/defined\";\n//#region src/diagnostics.ts\nfunction prisma6Diagnostic(code, message, sourceId, span) {\n\treturn {\n\t\tcode,\n\t\tmessage,\n\t\tsourceId,\n\t\t...span !== void 0 ? { span } : {}\n\t};\n}\n//#endregion\n//#region src/indexes.ts\nfunction unsupported(attribute, what, span, ctx) {\n\tctx.diagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_INDEX_ARGUMENT_UNSUPPORTED\", `${ctx.owner}: ${ctx.prefix}${attribute.name} ${what}`, ctx.sourceId, span));\n}\nfunction sortDirection(expression) {\n\tif (expression === void 0) return void 0;\n\tconst token = IdentifierAst.cast(expression.syntax)?.name();\n\treturn token === \"Asc\" ? 1 : token === \"Desc\" ? -1 : void 0;\n}\n/**\n* Reads `sort:` from one index element's or `@unique`'s arguments. `length:` and every other argument are refused: a MongoDB index has no prefix length, and Prisma 6 accepts no other argument there on MongoDB.\n*/\nfunction readSort(attribute, args, ctx) {\n\tlet direction;\n\tfor (const arg of args) {\n\t\tconst key = arg.name()?.name();\n\t\tconst span = nodePslSpan(arg.syntax, ctx.sources);\n\t\tif (key !== \"sort\") return unsupported(attribute, key === \"length\" ? \"argument \\\"length\\\" is not supported: a MongoDB index has no prefix length. Remove it; Prisma 6 ignores it on MongoDB.\" : `argument \"${key ?? \"\"}\" is not supported.`, span, ctx);\n\t\tdirection = sortDirection(arg.value());\n\t\tif (direction === void 0) return unsupported(attribute, \"sort must be Asc or Desc.\", span, ctx);\n\t}\n\treturn { direction };\n}\nfunction readFields(attribute, expression, span, ctx) {\n\tconst array = expression === void 0 ? void 0 : ArrayLiteralAst.cast(expression.syntax);\n\tif (array === void 0) return unsupported(attribute, \"expects a list of field names.\", span, ctx);\n\tconst fields = [];\n\tfor (const element of array.elements()) {\n\t\tconst name = IdentifierAst.cast(element.syntax)?.name();\n\t\tif (name !== void 0) {\n\t\t\tfields.push({\n\t\t\t\tname,\n\t\t\t\tdirection: void 0\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst call = FunctionCallAst.cast(element.syntax);\n\t\tconst path = call?.path() ?? [];\n\t\tconst [callee] = path;\n\t\tif (path.length > 1) {\n\t\t\tctx.diagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_COMPOSITE_INDEX_PATH_UNSUPPORTED\", `Index path \"${path.join(\".\")}\" reaches into a composite type; indexes on composite-type fields are not supported yet. Index a top-level field or remove the index.`, ctx.sourceId, nodePslSpan(element.syntax, ctx.sources)));\n\t\t\treturn;\n\t\t}\n\t\tif (call === void 0 || callee === void 0) return unsupported(attribute, \"expects a list of field names.\", nodePslSpan(element.syntax, ctx.sources), ctx);\n\t\tconst sort = readSort(attribute, call.args(), ctx);\n\t\tif (sort === void 0) return void 0;\n\t\tfields.push({\n\t\t\tname: callee,\n\t\t\tdirection: sort.direction\n\t\t});\n\t}\n\treturn fields;\n}\n/** Reads `@@index`, `@@unique` or `@@fulltext`. `map:` and `name:` are dropped: MongoDB verify never compares index names. */\nfunction parseIndexAttribute(attribute, ctx) {\n\tlet fields;\n\tfor (const arg of attribute.args) {\n\t\tconst key = arg.kind === \"positional\" ? \"fields\" : arg.name;\n\t\tif (key === \"map\" || key === \"name\") continue;\n\t\tif (key !== \"fields\") return unsupported(attribute, `argument \"${key ?? \"\"}\" is not supported.`, arg.span, ctx);\n\t\tfields = readFields(attribute, arg.expression, arg.span, ctx);\n\t\tif (fields === void 0) return void 0;\n\t}\n\tif (fields === void 0 || fields.length === 0) return unsupported(attribute, \"expects a list of field names.\", attribute.span, ctx);\n\treturn {\n\t\tkind: attribute.name,\n\t\tfields,\n\t\tspan: attribute.span\n\t};\n}\n/** Reads a field's `@unique`: `sort:` sets the key direction; `map:` and `name:` are dropped. */\nfunction parseFieldUnique(attribute, fieldName, ctx) {\n\tlet direction;\n\tfor (const arg of attribute.args) {\n\t\tconst key = arg.kind === \"positional\" ? void 0 : arg.name;\n\t\tif (key === \"map\" || key === \"name\") continue;\n\t\tif (key === \"sort\") {\n\t\t\tdirection = sortDirection(arg.expression);\n\t\t\tif (direction === void 0) return unsupported(attribute, \"sort must be Asc or Desc.\", arg.span, ctx);\n\t\t\tcontinue;\n\t\t}\n\t\treturn unsupported(attribute, key === \"length\" ? \"argument \\\"length\\\" is not supported: a MongoDB index has no prefix length. Remove it; Prisma 6 ignores it on MongoDB.\" : `argument \"${key ?? \"\"}\" is not supported.`, arg.span, ctx);\n\t}\n\treturn {\n\t\tkind: \"unique\",\n\t\tfields: [{\n\t\t\tname: fieldName,\n\t\t\tdirection\n\t\t}],\n\t\tspan: attribute.span\n\t};\n}\n//#endregion\n//#region src/interpreter.ts\nconst SUMMARY = \"Prisma 6 MongoDB schema interpretation failed\";\nfunction stringArgument(attribute) {\n\tconst expression = (attribute.args.find((arg) => arg.kind === \"positional\") ?? attribute.args.find((arg) => arg.name === \"name\"))?.expression;\n\treturn expression === void 0 ? void 0 : StringLiteralExprAst.cast(expression.syntax)?.value();\n}\nfunction requireString(attribute, owner, sourceId, diagnostics) {\n\tconst value = stringArgument(attribute);\n\tif (value === void 0) diagnostics.push({\n\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\tmessage: `${owner}: attribute \"@${attribute.name}\" expects one string argument.`,\n\t\tsourceId,\n\t\tspan: attribute.span\n\t});\n\treturn value;\n}\nfunction attributeText(attribute) {\n\tconst args = attribute.args.map((arg) => arg.kind === \"named\" ? `${arg.name}: ${arg.value}` : arg.value);\n\treturn args.length === 0 ? `@${attribute.name}` : `@${attribute.name}(${args.join(\", \")})`;\n}\n/** `auto()` and `now()` with no arguments; any other `@default` value is `other`. */\nfunction defaultKind(attribute) {\n\tconst expression = attribute.args.find((arg) => arg.kind === \"positional\")?.expression;\n\tconst call = expression === void 0 ? void 0 : FunctionCallAst.cast(expression.syntax);\n\tif (call === void 0 || [...call.args()].length > 0) return \"other\";\n\tconst path = call.path().join(\".\");\n\treturn path === \"auto\" ? \"auto\" : path === \"now\" ? \"now\" : \"other\";\n}\nfunction unknownAttribute(owner, attribute, prefix, sourceId) {\n\treturn prisma6Diagnostic(\"PSL.PRISMA6_MONGO_UNKNOWN_ATTRIBUTE\", `${owner}: attribute \"${prefix}${attribute.name}\" is not supported by the Prisma 6 MongoDB contract source.`, sourceId, attribute.span);\n}\nfunction interpretPrisma6Documents(input) {\n\tconst { binding } = input;\n\tconst diagnostics = [...input.seedDiagnostics];\n\tconst datasources = [];\n\tconst enumBlocks = [];\n\tconst compositeTypes = [];\n\tconst models = [];\n\tconst ignoredModels = /* @__PURE__ */ new Set();\n\tconst declaredNames = /* @__PURE__ */ new Map();\n\tconst claimName = (kind, name, sourceId, span) => {\n\t\tconst previous = declaredNames.get(name);\n\t\tif (previous === void 0) {\n\t\t\tdeclaredNames.set(name, sourceId);\n\t\t\treturn true;\n\t\t}\n\t\tdiagnostics.push({\n\t\t\tcode: \"PSL_DUPLICATE_DECLARATION\",\n\t\t\tmessage: `Duplicate declaration of ${kind} \"${name}\"; first declared in ${basename(previous)}.`,\n\t\t\tsourceId,\n\t\t\tspan\n\t\t});\n\t\treturn false;\n\t};\n\tfor (const { document, sources, sourceFile, sourceId } of input.documents) {\n\t\tconst { symbolTable, diagnostics: tableDiagnostics } = buildSymbolTable({\n\t\t\tdocuments: [document],\n\t\t\tsources,\n\t\t\tpslBlockDescriptors: {}\n\t\t});\n\t\tfor (const diagnostic of tableDiagnostics) diagnostics.push({\n\t\t\tcode: diagnostic.code,\n\t\t\tmessage: diagnostic.message,\n\t\t\tsourceId,\n\t\t\tspan: sourceFile.rangeToPslSpan(diagnostic.range)\n\t\t});\n\t\tconst unsupported = (keyword, span) => {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_UNSUPPORTED_TOP_LEVEL_BLOCK\",\n\t\t\t\tmessage: `Unsupported top-level block \"${keyword}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan\n\t\t\t});\n\t\t};\n\t\tfor (const block of Object.values(symbolTable.topLevel.blocks)) switch (block.keyword) {\n\t\t\tcase \"datasource\":\n\t\t\t\tdatasources.push({\n\t\t\t\t\tsymbol: block,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tsources\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase \"generator\": break;\n\t\t\tcase \"enum\":\n\t\t\t\tif (claimName(\"enum\", block.name, sourceId, block.span)) enumBlocks.push({\n\t\t\t\t\tsymbol: block,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tsources\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase \"view\":\n\t\t\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_VIEW_UNSUPPORTED\", `View \"${block.name}\" is not supported; Prisma 8 has no views on MongoDB. Remove the view from the schema this contract source reads.`, sourceId, keywordPslSpan(block.node.syntax, block.keyword, sources)));\n\t\t\t\tbreak;\n\t\t\tdefault: unsupported(block.keyword, keywordPslSpan(block.node.syntax, block.keyword, sources));\n\t\t}\n\t\tfor (const namespace of Object.values(symbolTable.topLevel.namespaces)) for (const { span } of namespace.declarations) unsupported(\"namespace\", span);\n\t\tfor (const namedType of Object.values(symbolTable.topLevel.namedTypes)) unsupported(\"types\", namedType.span);\n\t\tfor (const symbol of Object.values(symbolTable.topLevel.compositeTypes)) if (claimName(\"type\", symbol.name, sourceId, symbol.span)) compositeTypes.push({\n\t\t\tsymbol,\n\t\t\tsourceId,\n\t\t\tsources\n\t\t});\n\t\tfor (const symbol of Object.values(symbolTable.topLevel.models)) {\n\t\t\tif (!claimName(\"model\", symbol.name, sourceId, symbol.span)) continue;\n\t\t\tif (symbol.attributes.some((attribute) => attribute.name === \"ignore\")) ignoredModels.add(symbol.name);\n\t\t\telse models.push({\n\t\t\t\tsymbol,\n\t\t\t\tsourceId,\n\t\t\t\tsources\n\t\t\t});\n\t\t}\n\t}\n\tcheckDatasource(datasources, input.documents[0]?.sourceId ?? \"schema.prisma\", binding, diagnostics);\n\tconst enums = /* @__PURE__ */ new Map();\n\tfor (const located of enumBlocks) {\n\t\tconst built = buildEnum(located, input, diagnostics);\n\t\tif (built !== void 0) enums.set(located.symbol.name, built);\n\t}\n\tconst modelNames = /* @__PURE__ */ new Set([...models.map((m) => m.symbol.name), ...ignoredModels]);\n\tconst typeContext = {\n\t\tbinding,\n\t\tenums,\n\t\tcompositeTypeNames: new Set(compositeTypes.map((c) => c.symbol.name)),\n\t\tdiagnostics\n\t};\n\tconst valueObjects = {};\n\tfor (const located of compositeTypes) valueObjects[located.symbol.name] = { fields: readCompositeFields(located, typeContext) };\n\tconst builds = /* @__PURE__ */ new Map();\n\tfor (const located of models) builds.set(located.symbol.name, readModel(located, modelNames, ignoredModels, typeContext));\n\tconst foreignKeys = [];\n\tconst invalidFkPairings = [];\n\tconst backRelations = [];\n\tfor (const build of builds.values()) readRelationFields(build, builds, {\n\t\tforeignKeys,\n\t\tinvalidFkPairings,\n\t\tbackRelations\n\t}, diagnostics);\n\tconst paired = pairMongoBackRelations({\n\t\tforeignKeys,\n\t\tcandidates: backRelations,\n\t\tinvalidFkPairings\n\t});\n\tdiagnostics.push(...mapPslDiagnostics(paired.diagnostics, mergedSources(input.documents)));\n\tfor (const { modelName, fieldName, relation } of paired.relations) {\n\t\tconst build = builds.get(modelName);\n\t\tif (build !== void 0) build.relations[fieldName] = relation;\n\t}\n\tconst collections = {};\n\tconst roots = {};\n\tconst executionDefaults = [];\n\tfor (const [modelName, build] of builds) {\n\t\tconst indexes = buildIndexes(build, diagnostics);\n\t\tconst existing = collections[build.collection];\n\t\tcollections[build.collection] = { indexes: [...existing?.indexes ?? [], ...indexes] };\n\t\troots[build.collection] = crossRef(modelName, UNBOUND_NAMESPACE_ID);\n\t\tfor (const { field, phases } of build.executionDefaults) executionDefaults.push({\n\t\t\tref: {\n\t\t\t\tnamespace: UNBOUND_NAMESPACE_ID,\n\t\t\t\tentry: build.collection,\n\t\t\t\tfield\n\t\t\t},\n\t\t\t...phases\n\t\t});\n\t\tif (!build.hasId) diagnostics.push({\n\t\t\tcode: \"PSL_MISSING_ID_FIELD\",\n\t\t\tmessage: `Model \"${modelName}\" has no field with @id attribute. Every model must have exactly one @id field.`,\n\t\t\tsourceId: build.located.sourceId,\n\t\t\tspan: build.located.symbol.span\n\t\t});\n\t}\n\tif (diagnostics.length > 0) return notOk({\n\t\tsummary: SUMMARY,\n\t\tdiagnostics\n\t});\n\treturn ok(assembleContract({\n\t\tbinding,\n\t\tbuilds,\n\t\tcollections,\n\t\troots,\n\t\tvalueObjects,\n\t\tenums,\n\t\texecutionDefaults,\n\t\tcodecLookup: input.codecLookup\n\t}));\n}\nfunction checkDatasource(datasources, fallbackSourceId, binding, diagnostics) {\n\tconst [datasource] = datasources;\n\tconst [namedProvider] = binding.providers;\n\tif (datasource === void 0) {\n\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_PROVIDER_MISMATCH\", `No datasource block found; add \\`datasource db { provider = \"${namedProvider}\" }\\`.`, fallbackSourceId, void 0));\n\t\treturn;\n\t}\n\tconst block = datasource.symbol.block;\n\tconst parameter = block.parameters[\"provider\"];\n\tlet provider;\n\tif (parameter?.kind === \"value\") try {\n\t\tconst parsed = JSON.parse(parameter.raw);\n\t\tprovider = typeof parsed === \"string\" ? parsed : void 0;\n\t} catch {\n\t\tprovider = void 0;\n\t}\n\tif (provider === void 0 || !binding.providers.includes(provider)) diagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_PROVIDER_MISMATCH\", provider === void 0 ? `The datasource block declares no string \\`provider\\`; this contract source reads Prisma 6 schemas for provider \"${namedProvider}\".` : `The datasource provider is \"${provider}\"; this contract source reads Prisma 6 schemas for provider \"${namedProvider}\".`, datasource.sourceId, parameter === void 0 ? block.span : parameter.span));\n}\nfunction buildEnum(located, input, diagnostics) {\n\tconst { symbol: block, sourceId, sources } = located;\n\tfor (const attribute of readResolvedAttributes(block.node.attributes(), sources)) {\n\t\tif (attribute.name === \"map\") continue;\n\t\tif (attribute.name === \"schema\") {\n\t\t\tdiagnostics.push(schemaUnsupported(`Enum \"${block.name}\"`, attribute, sourceId));\n\t\t\tcontinue;\n\t\t}\n\t\tdiagnostics.push(unknownAttribute(`Enum \"${block.name}\"`, attribute, \"@@\", sourceId));\n\t}\n\tconst parameters = {};\n\tfor (const entry of block.node.entries()) {\n\t\tconst name = entry.key()?.name();\n\t\tif (name === void 0) continue;\n\t\tlet value = name;\n\t\tfor (const attributeNode of entry.attributes()) {\n\t\t\tconst attribute = readResolvedAttribute(attributeNode, sources);\n\t\t\tif (attribute.name === \"map\") value = requireString(attribute, `Enum member \"${block.name}.${name}\"`, sourceId, diagnostics) ?? value;\n\t\t\telse diagnostics.push(unknownAttribute(`Enum member \"${block.name}.${name}\"`, attribute, \"@\", sourceId));\n\t\t}\n\t\tparameters[name] = {\n\t\t\tkind: \"value\",\n\t\t\traw: JSON.stringify(value),\n\t\t\tspan: nodePslSpan(entry.syntax, sources)\n\t\t};\n\t}\n\tconst descriptor = input.authoringContributions.entityTypes[\"enum\"];\n\tif (descriptor === void 0 || !isAuthoringEntityTypeDescriptor(descriptor)) {\n\t\tdiagnostics.push({\n\t\t\tcode: \"PSL_ENUM_MISSING_FACTORY\",\n\t\t\tmessage: `enum \"${block.name}\" requires an \"enum\" entityType factory in the active authoring contributions`,\n\t\t\tsourceId,\n\t\t\tspan: block.span\n\t\t});\n\t\treturn;\n\t}\n\tconst context = {\n\t\tfamily: input.binding.target.familyId,\n\t\ttarget: input.binding.target.targetId,\n\t\tcodecLookup: input.codecLookup,\n\t\tsourceId,\n\t\tenumInferenceCodecs: {\n\t\t\ttext: input.binding.scalarCodecIds.String,\n\t\t\tint: input.binding.scalarCodecIds.Int\n\t\t},\n\t\tdiagnostics: { push: (diagnostic) => {\n\t\t\tdiagnostics.push(blindCast(diagnostic));\n\t\t} }\n\t};\n\tconst handle = instantiateAuthoringEntityType(\"enum\", descriptor, [{\n\t\tkind: \"enum\",\n\t\tkeyword: \"enum\",\n\t\tname: block.name,\n\t\tparameters,\n\t\tblockAttributes: [],\n\t\tattributes: {},\n\t\tspan: block.span\n\t}], context);\n\tif (handle === void 0 || handle === null) return void 0;\n\treturn {\n\t\tcodecId: handle.codecId,\n\t\tmembers: handle.enumMembers.map((member) => ({\n\t\t\tname: member.name,\n\t\t\tvalue: member.value\n\t\t}))\n\t};\n}\nfunction schemaUnsupported(owner, attribute, sourceId) {\n\treturn prisma6Diagnostic(\"PSL.PRISMA6_MONGO_SCHEMA_UNSUPPORTED\", `${owner}: \"@@schema\" is not supported; a MongoDB contract has one database, bound by the connection string. Remove @@schema.`, sourceId, attribute.span);\n}\nfunction unsupportedTypeMessage(label, typeName, owner) {\n\tconst base = `${label} has type \"${typeName}(...)\", which has no Prisma 8 codec, so ${`${owner.kind} \"${owner.name}\"`} cannot use this contract source while it has the field. Prisma 6 rejects @ignore on an Unsupported field. Removing the field from the schema leaves its stored values in the documents, but the Prisma 6 client no longer reads or writes them.`;\n\tif (owner.kind === \"type\") return base;\n\treturn `${base} Adding @@ignore to model \"${owner.name}\" keeps the model out of the contract, but the model disappears from the Prisma 6 client too, and every relation field in another model that points to it needs @ignore, which removes that field from the Prisma 6 client as well.`;\n}\n/** The field's contract type, or `undefined` after reporting why it has none. */\nfunction resolveFieldType(field, owner, nativeType, sourceId, ctx) {\n\tconst { binding, diagnostics } = ctx;\n\tconst label = `Field \"${owner.name}.${field.name}\"`;\n\tif (field.typeConstructor !== void 0) {\n\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_UNSUPPORTED_TYPE\", unsupportedTypeMessage(label, field.typeConstructor.path.join(\".\"), owner), sourceId, field.typeConstructor.span));\n\t\treturn;\n\t}\n\tconst nativeTypeUnsupported = (attribute) => {\n\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_NATIVE_TYPE_UNSUPPORTED\", attribute.name === \"db.ObjectId\" ? `${label}: @db.ObjectId is only supported on a String field, and this field is \"${field.typeName}\". Remove @db.ObjectId, or change the field type to String.` : `${label}: native type \"@${attribute.name}\" is not supported by the Prisma 6 MongoDB contract source; only @db.ObjectId is. Remove it: the stored BSON type then follows the field type.`, sourceId, attribute.span));\n\t};\n\tconst many = field.list ? { many: true } : {};\n\tif (ctx.compositeTypeNames.has(field.typeName)) {\n\t\tif (nativeType !== void 0) return nativeTypeUnsupported(nativeType);\n\t\treturn {\n\t\t\ttype: {\n\t\t\t\tkind: \"valueObject\",\n\t\t\t\tname: field.typeName\n\t\t\t},\n\t\t\tnullable: field.optional,\n\t\t\t...many\n\t\t};\n\t}\n\tconst enumBuild = ctx.enums.get(field.typeName);\n\tif (enumBuild !== void 0) {\n\t\tif (nativeType !== void 0) return nativeTypeUnsupported(nativeType);\n\t\tconst valueSet = {\n\t\t\tplane: \"domain\",\n\t\t\tentityKind: \"enum\",\n\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\t\tentityName: field.typeName\n\t\t};\n\t\treturn {\n\t\t\ttype: {\n\t\t\t\tkind: \"scalar\",\n\t\t\t\tcodecId: enumBuild.codecId\n\t\t\t},\n\t\t\tnullable: field.optional,\n\t\t\tvalueSet,\n\t\t\t...many\n\t\t};\n\t}\n\tconst scalarCodecId = Object.hasOwn(binding.scalarCodecIds, field.typeName) ? binding.scalarCodecIds[field.typeName] : void 0;\n\tif (scalarCodecId === void 0) {\n\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_UNSUPPORTED_TYPE\", `${label} has unknown type \"${field.typeName}\": it is not a scalar type, an enum, a composite type, or a model. Correct the type name.`, sourceId, field.span));\n\t\treturn;\n\t}\n\tlet codecId = scalarCodecId;\n\tif (nativeType !== void 0) {\n\t\tif (nativeType.name !== \"db.ObjectId\" || field.typeName !== \"String\") return nativeTypeUnsupported(nativeType);\n\t\tcodecId = binding.objectIdCodecId;\n\t}\n\treturn {\n\t\ttype: {\n\t\t\tkind: \"scalar\",\n\t\t\tcodecId\n\t\t},\n\t\tnullable: field.optional,\n\t\t...many\n\t};\n}\nfunction readCompositeFields(located, ctx) {\n\tconst { symbol, sourceId } = located;\n\tfor (const attribute of symbol.attributes) ctx.diagnostics.push(unknownAttribute(`Type \"${symbol.name}\"`, attribute, \"@@\", sourceId));\n\tconst fields = {};\n\tfor (const field of Object.values(symbol.fields)) {\n\t\tif (field.malformedType) continue;\n\t\tconst label = `Field \"${symbol.name}.${field.name}\"`;\n\t\tlet nativeType;\n\t\tlet rejected = false;\n\t\tfor (const attribute of field.attributes) if (attribute.name.startsWith(\"db.\")) nativeType = attribute;\n\t\telse if (attribute.name === \"map\") {\n\t\t\tctx.diagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_COMPOSITE_MAP_UNSUPPORTED\", `${label}: @map on a field of a composite type is not supported yet. The stored field keeps the name \"${stringArgument(attribute) ?? field.name}\", so removing @map renames it in storage; keep the schema as it is until Prisma 8 supports it.`, sourceId, attribute.span));\n\t\t\trejected = true;\n\t\t} else if (attribute.name === \"default\") {\n\t\t\tctx.diagnostics.push(defaultUnsupported(label, attribute, sourceId));\n\t\t\trejected = true;\n\t\t} else {\n\t\t\tctx.diagnostics.push(unknownAttribute(label, attribute, \"@\", sourceId));\n\t\t\trejected = true;\n\t\t}\n\t\tif (rejected) continue;\n\t\tconst resolved = resolveFieldType(field, {\n\t\t\tkind: \"type\",\n\t\t\tname: symbol.name\n\t\t}, nativeType, sourceId, ctx);\n\t\tif (resolved !== void 0) fields[field.name] = resolved;\n\t}\n\treturn fields;\n}\nfunction defaultUnsupported(label, attribute, sourceId) {\n\treturn prisma6Diagnostic(\"PSL.PRISMA6_MONGO_DEFAULT_UNSUPPORTED\", `${label}: ${attributeText(attribute)} is not supported. MongoDB has no stored defaults, and Prisma 8 fills only \\`now()\\` on DateTime fields. Remove the default and set the value when you create documents.`, sourceId, attribute.span);\n}\nfunction readModel(located, modelNames, ignoredModels, ctx) {\n\tconst { symbol, sourceId, sources } = located;\n\tconst { diagnostics } = ctx;\n\tconst modelLabel = `Model \"${symbol.name}\"`;\n\tlet collection = symbol.name;\n\tconst build = {\n\t\tlocated,\n\t\tcollection: symbol.name,\n\t\tstoredNames: /* @__PURE__ */ new Map(),\n\t\tignoredFields: /* @__PURE__ */ new Set(),\n\t\trejectedFields: /* @__PURE__ */ new Set(),\n\t\tfields: {},\n\t\trelations: {},\n\t\texecutionDefaults: [],\n\t\tuniqueFields: [],\n\t\tmodelIndexes: [],\n\t\trelationFields: [],\n\t\thasId: false\n\t};\n\tconst indexContext = {\n\t\towner: modelLabel,\n\t\tprefix: \"@@\",\n\t\tsourceId,\n\t\tsources,\n\t\tdiagnostics\n\t};\n\tfor (const attribute of symbol.attributes) switch (attribute.name) {\n\t\tcase \"map\":\n\t\t\tcollection = requireString(attribute, modelLabel, sourceId, diagnostics) ?? collection;\n\t\t\tbreak;\n\t\tcase \"index\":\n\t\tcase \"unique\":\n\t\tcase \"fulltext\": {\n\t\t\tconst parsed = parseIndexAttribute({\n\t\t\t\t...attribute,\n\t\t\t\tname: attribute.name\n\t\t\t}, indexContext);\n\t\t\tif (parsed !== void 0) build.modelIndexes.push(parsed);\n\t\t\tbreak;\n\t\t}\n\t\tcase \"id\":\n\t\t\tbuild.hasId = true;\n\t\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_COMPOSITE_ID_UNSUPPORTED\", `${modelLabel}: @@id is not supported; a MongoDB document is identified by its \"_id\" field. Declare the id as \\`id String @id @default(auto()) @map(\"_id\") @db.ObjectId\\`.`, sourceId, attribute.span));\n\t\t\tbreak;\n\t\tcase \"schema\":\n\t\t\tdiagnostics.push(schemaUnsupported(modelLabel, attribute, sourceId));\n\t\t\tbreak;\n\t\tcase \"ignore\": break;\n\t\tdefault: diagnostics.push(unknownAttribute(modelLabel, attribute, \"@@\", sourceId));\n\t}\n\tfor (const field of Object.values(symbol.fields)) {\n\t\tconst reported = diagnostics.length;\n\t\treadModelField(field, build, modelNames, ignoredModels, ctx);\n\t\tif (diagnostics.length > reported) build.rejectedFields.add(field.name);\n\t}\n\treturn {\n\t\t...build,\n\t\tcollection\n\t};\n}\nfunction readModelField(field, build, modelNames, ignoredModels, ctx) {\n\tconst { symbol, sourceId, sources } = build.located;\n\tconst { diagnostics, binding } = ctx;\n\tconst label = `Field \"${symbol.name}.${field.name}\"`;\n\tconst isRelationField = modelNames.has(field.typeName) && field.typeConstructor === void 0;\n\tif (field.attributes.some((attribute) => attribute.name === \"ignore\")) {\n\t\tbuild.ignoredFields.add(field.name);\n\t\tconst unique = field.attributes.find((attribute) => attribute.name === \"unique\");\n\t\tif (unique !== void 0) diagnostics.push(ignoredFieldReferenced(symbol.name, [field.name], `@unique on field \"${symbol.name}.${field.name}\"`, sourceId, unique.span));\n\t\treturn;\n\t}\n\tif (isRelationField) {\n\t\tif (ignoredModels.has(field.typeName)) return;\n\t\tlet relation;\n\t\tfor (const attribute of field.attributes) if (attribute.name === \"relation\") relation = attribute;\n\t\telse diagnostics.push(unknownAttribute(label, attribute, \"@\", sourceId));\n\t\tbuild.relationFields.push({\n\t\t\tfield,\n\t\t\trelation\n\t\t});\n\t\treturn;\n\t}\n\tlet storedName = field.name;\n\tlet nativeType;\n\tlet idAttribute;\n\tlet defaultAttribute;\n\tlet updatedAt;\n\tfor (const attribute of field.attributes) switch (attribute.name) {\n\t\tcase \"map\":\n\t\t\tstoredName = requireString(attribute, label, sourceId, diagnostics) ?? storedName;\n\t\t\tbreak;\n\t\tcase \"id\":\n\t\t\tidAttribute = attribute;\n\t\t\tbreak;\n\t\tcase \"default\":\n\t\t\tdefaultAttribute = attribute;\n\t\t\tbreak;\n\t\tcase \"updatedAt\":\n\t\t\tupdatedAt = attribute;\n\t\t\tbreak;\n\t\tcase \"unique\": {\n\t\t\tconst parsed = parseFieldUnique(attribute, field.name, {\n\t\t\t\towner: label,\n\t\t\t\tprefix: \"@\",\n\t\t\t\tsourceId,\n\t\t\t\tsources,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (parsed !== void 0) build.uniqueFields.push(parsed);\n\t\t\tbreak;\n\t\t}\n\t\tdefault: if (attribute.name.startsWith(\"db.\")) nativeType = attribute;\n\t\telse diagnostics.push(unknownAttribute(label, attribute, \"@\", sourceId));\n\t}\n\tbuild.storedNames.set(field.name, storedName);\n\tif (field.malformedType) return;\n\tconst resolved = resolveFieldType(field, {\n\t\tkind: \"model\",\n\t\tname: symbol.name\n\t}, nativeType, sourceId, ctx);\n\tif (resolved === void 0) return;\n\tconst codecId = resolved.type.kind === \"scalar\" ? resolved.type.codecId : void 0;\n\tif (idAttribute !== void 0) {\n\t\tbuild.hasId = true;\n\t\tif (codecId !== binding.objectIdCodecId || storedName !== \"_id\" || field.optional || field.list) {\n\t\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_ID_NOT_OBJECTID\", `${label} is the model's @id, but it is not a required ObjectId stored as \"_id\". Prisma 8 identifies a MongoDB document by an ObjectId \"_id\"; declare the id as \\`${field.name} String @id @default(auto()) @map(\"_id\") @db.ObjectId\\`.`, sourceId, idAttribute.span));\n\t\t\treturn;\n\t\t}\n\t\tif (defaultAttribute !== void 0 && defaultKind(defaultAttribute) !== \"auto\") {\n\t\t\tdiagnostics.push(defaultUnsupported(label, defaultAttribute, sourceId));\n\t\t\treturn;\n\t\t}\n\t\tbuild.fields[storedName] = resolved;\n\t\treturn;\n\t}\n\tconst isDateTime = codecId === binding.scalarCodecIds.DateTime && !field.list;\n\tif (updatedAt !== void 0 && !isDateTime) {\n\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_UPDATED_AT_TYPE_UNSUPPORTED\", `${label}: @updatedAt is only supported on a DateTime field. Remove @updatedAt and set the value when you write documents.`, sourceId, updatedAt.span));\n\t\treturn;\n\t}\n\tconst defaultIsNow = defaultAttribute !== void 0 && defaultKind(defaultAttribute) === \"now\";\n\tif (defaultAttribute !== void 0 && (!defaultIsNow || !isDateTime)) {\n\t\tdiagnostics.push(defaultUnsupported(label, defaultAttribute, sourceId));\n\t\treturn;\n\t}\n\tconst generator = {\n\t\tkind: \"generator\",\n\t\tid: binding.timestampGeneratorId\n\t};\n\tconst phases = updatedAt !== void 0 ? {\n\t\tonCreate: generator,\n\t\tonUpdate: generator\n\t} : defaultIsNow ? { onCreate: generator } : void 0;\n\tif (phases !== void 0 && field.optional) {\n\t\tconst written = updatedAt ?? defaultAttribute;\n\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_OPTIONAL_GENERATED_FIELD_UNSUPPORTED\", `${label} is optional and its value comes from ${written === void 0 ? \"a generator\" : attributeText(written)}, which Prisma 8 cannot express on an optional field yet. Make the field required, or remove ${written === void 0 ? \"the generator\" : attributeText(written)} and set the value when you write documents.`, sourceId, written?.span ?? field.span));\n\t\treturn;\n\t}\n\tbuild.fields[storedName] = resolved;\n\tif (phases !== void 0) build.executionDefaults.push({\n\t\tfield: storedName,\n\t\tphases\n\t});\n}\nfunction identifierList(attributeArg) {\n\tconst expression = attributeArg.expression;\n\tconst array = expression === void 0 ? void 0 : ArrayLiteralAst.cast(expression.syntax);\n\tif (array === void 0) return void 0;\n\tconst names = [];\n\tfor (const element of array.elements()) {\n\t\tconst name = IdentifierAst.cast(element.syntax)?.name();\n\t\tif (name === void 0) return void 0;\n\t\tnames.push(name);\n\t}\n\treturn names;\n}\nfunction readRelationArguments(attribute, label, sourceId, diagnostics) {\n\tlet name;\n\tlet fields;\n\tlet references;\n\tconst invalid = (what, span) => {\n\t\tdiagnostics.push({\n\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\tmessage: `${label}: @relation ${what}.`,\n\t\t\tsourceId,\n\t\t\tspan\n\t\t});\n\t};\n\tfor (const arg of attribute.args) {\n\t\tconst key = arg.kind === \"positional\" ? \"name\" : arg.name;\n\t\tswitch (key) {\n\t\t\tcase \"name\": {\n\t\t\t\tconst expression = arg.expression;\n\t\t\t\tname = expression === void 0 ? void 0 : StringLiteralExprAst.cast(expression.syntax)?.value();\n\t\t\t\tif (name === void 0) return invalid(\"name must be a string\", arg.span);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"fields\":\n\t\t\t\tfields = identifierList(arg);\n\t\t\t\tif (fields === void 0) return invalid(\"fields must be a list of field names\", arg.span);\n\t\t\t\tbreak;\n\t\t\tcase \"references\":\n\t\t\t\treferences = identifierList(arg);\n\t\t\t\tif (references === void 0) return invalid(\"references must be a list of field names\", arg.span);\n\t\t\t\tbreak;\n\t\t\tcase \"onDelete\":\n\t\t\tcase \"onUpdate\":\n\t\t\tcase \"map\":\n\t\t\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_REFERENTIAL_ACTION_UNSUPPORTED\", key === \"map\" ? `${label}: @relation argument \"map\" is not supported; it names a foreign key constraint, and MongoDB has none. Remove \"map\".` : `${label}: @relation argument \"${key}\" is not supported; Prisma 8 enforces no referential actions on MongoDB. Remove \"${key}\" and handle related documents in application code.`, sourceId, arg.span));\n\t\t\t\treturn;\n\t\t\tdefault: return invalid(`argument \"${key ?? \"\"}\" is not supported`, arg.span);\n\t\t}\n\t}\n\treturn {\n\t\tname,\n\t\tfields,\n\t\treferences\n\t};\n}\nfunction ignoredFieldReferenced(modelName, fieldNames, usedBy, sourceId, span) {\n\tconst one = fieldNames.length === 1;\n\tconst fields = fieldNames.map((name) => `\"${modelName}.${name}\"`).join(\", \");\n\treturn prisma6Diagnostic(\"PSL.PRISMA6_MONGO_IGNORED_FIELD_REFERENCED\", `${one ? \"Field\" : \"Fields\"} ${fields} ${one ? \"is\" : \"are\"} marked @ignore, but ${usedBy} uses ${one ? \"it\" : \"them\"}. Remove @ignore from ${fields}, or remove ${usedBy}.`, sourceId, span);\n}\nfunction readRelationFields(build, builds, out, diagnostics) {\n\tconst { symbol, sourceId, sources } = build.located;\n\tfor (const { field, relation } of build.relationFields) {\n\t\tconst label = `Relation field \"${symbol.name}.${field.name}\"`;\n\t\tconst reject = () => {\n\t\t\tout.invalidFkPairings.push({\n\t\t\t\tpairKey: fkRelationPairKey(symbol.name, field.typeName),\n\t\t\t\t...ifDefined(\"relationName\", relation === void 0 ? void 0 : stringArgument(relation))\n\t\t\t});\n\t\t};\n\t\tconst args = relation === void 0 ? void 0 : readRelationArguments(relation, label, sourceId, diagnostics);\n\t\tif (relation !== void 0 && args === void 0) {\n\t\t\treject();\n\t\t\tcontinue;\n\t\t}\n\t\tconst target = builds.get(field.typeName);\n\t\tif (target === void 0) continue;\n\t\tif (!(args?.fields !== void 0 || args?.references !== void 0)) {\n\t\t\tout.backRelations.push({\n\t\t\t\tmodelName: symbol.name,\n\t\t\t\tfield,\n\t\t\t\ttargetModelName: field.typeName,\n\t\t\t\t...ifDefined(\"relationName\", args?.name),\n\t\t\t\tcardinality: field.list ? \"1:N\" : \"1:1\",\n\t\t\t\tsources\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (field.list) {\n\t\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_LIST_RELATION_UNSUPPORTED\", `${label} is a list relation that stores its keys in a list field (a many-to-many relation on MongoDB), which Prisma 8 does not support yet. Remove the relation fields from the schema this contract source reads and keep the key list as a plain field.`, sourceId, relation?.span ?? field.span));\n\t\t\treject();\n\t\t\tcontinue;\n\t\t}\n\t\tconst localNames = args?.fields ?? [];\n\t\tconst targetNames = args?.references ?? [];\n\t\tconst ignoredLocal = localNames.filter((name) => build.ignoredFields.has(name));\n\t\tif (ignoredLocal.length > 0) {\n\t\t\tdiagnostics.push(ignoredFieldReferenced(symbol.name, ignoredLocal, `relation field \"${symbol.name}.${field.name}\"`, sourceId, relation?.span ?? field.span));\n\t\t\treject();\n\t\t\tcontinue;\n\t\t}\n\t\tconst ignoredTarget = targetNames.filter((name) => target.ignoredFields.has(name));\n\t\tif (ignoredTarget.length > 0) {\n\t\t\tdiagnostics.push(ignoredFieldReferenced(target.located.symbol.name, ignoredTarget, `relation field \"${symbol.name}.${field.name}\"`, sourceId, relation?.span ?? field.span));\n\t\t\treject();\n\t\t\tcontinue;\n\t\t}\n\t\tconst localFields = localNames.map((name) => build.storedNames.get(name));\n\t\tconst targetFields = targetNames.map((name) => target.storedNames.get(name));\n\t\tif (localFields.some((name) => name === void 0) || targetFields.some((name) => name === void 0) || localNames.length !== targetNames.length || localNames.length === 0) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\t\tmessage: `${label}: @relation fields and references must name the same number of scalar fields of \"${symbol.name}\" and \"${field.typeName}\".`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: relation?.span ?? field.span\n\t\t\t});\n\t\t\treject();\n\t\t\tcontinue;\n\t\t}\n\t\tif (resolveToOneRelationNullable({\n\t\t\tdeclaredNullable: field.optional,\n\t\t\tlocalFieldNullability: localNames.map((name) => symbol.fields[name]?.optional === true),\n\t\t\townsReference: true\n\t\t}).contradiction !== void 0) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_RELATION_NULLABILITY_MISMATCH\",\n\t\t\t\tmessage: field.optional ? `${label} is optional but every field in @relation(fields: [...]) is required. Make one of those fields optional with \"?\" or remove \"?\" from \"${field.name}\".` : `${label} is required but a field in @relation(fields: [...]) is optional. Add \"?\" to \"${field.name}\" or make those fields required.`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: field.span\n\t\t\t});\n\t\t\treject();\n\t\t\tcontinue;\n\t\t}\n\t\tconst local = localFields.filter((name) => name !== void 0);\n\t\tconst referenced = targetFields.filter((name) => name !== void 0);\n\t\tbuild.relations[field.name] = {\n\t\t\tto: crossRef(field.typeName, UNBOUND_NAMESPACE_ID),\n\t\t\tcardinality: \"N:1\",\n\t\t\tnullable: field.optional,\n\t\t\ton: {\n\t\t\t\tlocalFields: local,\n\t\t\t\ttargetFields: referenced\n\t\t\t}\n\t\t};\n\t\tout.foreignKeys.push({\n\t\t\tdeclaringModel: symbol.name,\n\t\t\ttargetModel: field.typeName,\n\t\t\t...ifDefined(\"relationName\", args?.name),\n\t\t\tlocalFields: local,\n\t\t\ttargetFields: referenced\n\t\t});\n\t}\n}\nfunction buildIndexes(build, diagnostics) {\n\tconst { symbol, sourceId } = build.located;\n\tconst indexes = [];\n\tlet textIndexes = 0;\n\tconst keyFor = (field, text) => ({\n\t\tfield: build.storedNames.get(field.name) ?? field.name,\n\t\tdirection: field.direction ?? (text ? \"text\" : 1)\n\t});\n\tfor (const attribute of [...build.uniqueFields, ...build.modelIndexes]) {\n\t\tconst names = attribute.fields.map((field) => field.name);\n\t\tconst usedBy = build.uniqueFields.includes(attribute) ? `@unique on field \"${symbol.name}.${attribute.fields[0]?.name ?? \"\"}\"` : `@@${attribute.kind} on model \"${symbol.name}\"`;\n\t\tconst ignored = names.filter((name) => build.ignoredFields.has(name));\n\t\tif (ignored.length > 0) {\n\t\t\tdiagnostics.push(ignoredFieldReferenced(symbol.name, ignored, usedBy, sourceId, attribute.span));\n\t\t\tcontinue;\n\t\t}\n\t\tif (names.some((name) => build.rejectedFields.has(name))) continue;\n\t\tconst unknown = names.find((name) => !build.storedNames.has(name));\n\t\tif (unknown !== void 0) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INDEX_FIELD_NOT_FOUND\",\n\t\t\t\tmessage: `Index on model \"${symbol.name}\" references unknown field \"${unknown}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: attribute.span\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (attribute.kind === \"fulltext\") {\n\t\t\ttextIndexes++;\n\t\t\tif (textIndexes > 1) {\n\t\t\t\tdiagnostics.push(prisma6Diagnostic(\"PSL.PRISMA6_MONGO_TEXT_INDEX_LIMIT\", `Model \"${symbol.name}\" has more than one @@fulltext; MongoDB allows one text index per collection. Merge the fields into one @@fulltext.`, sourceId, attribute.span));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tindexes.push(new MongoIndex({\n\t\t\tkeys: attribute.fields.map((field) => keyFor(field, attribute.kind === \"fulltext\")),\n\t\t\t...attribute.kind === \"unique\" ? { unique: true } : {}\n\t\t}));\n\t}\n\treturn indexes;\n}\nfunction assembleContract(input) {\n\tconst target = input.binding.target.targetId;\n\tconst targetFamily = input.binding.target.familyId;\n\tconst builtEnums = {};\n\tfor (const [enumName, built] of input.enums) builtEnums[enumName] = {\n\t\tcodecId: built.codecId,\n\t\tmembers: built.members.map((member) => ({\n\t\t\tname: member.name,\n\t\t\tvalue: blindCast(member.value)\n\t\t}))\n\t};\n\tconst collections = {};\n\tfor (const [name, collection] of Object.entries(input.collections)) collections[name] = collection.indexes.length > 0 ? { indexes: collection.indexes } : {};\n\tconst storage = blindCast(buildMongoStorage({\n\t\tcollections,\n\t\tvalueSets: encodeMongoValueSets(Object.fromEntries(input.enums), input.codecLookup)\n\t}));\n\tconst models = {};\n\tfor (const [modelName, build] of input.builds) models[modelName] = {\n\t\tfields: build.fields,\n\t\trelations: build.relations,\n\t\tstorage: { collection: build.collection }\n\t};\n\tconst capabilities = {};\n\tconst execution = buildMongoExecutionSection(input.executionDefaults);\n\treturn {\n\t\ttargetFamily,\n\t\ttarget,\n\t\troots: input.roots,\n\t\tdomain: { namespaces: { [UNBOUND_NAMESPACE_ID]: {\n\t\t\tmodels: blindCast(models),\n\t\t\t...Object.keys(input.valueObjects).length > 0 ? { valueObjects: input.valueObjects } : {},\n\t\t\t...Object.keys(builtEnums).length > 0 ? { enum: builtEnums } : {}\n\t\t} } },\n\t\tstorage,\n\t\textensions: {},\n\t\tcapabilities,\n\t\tprofileHash: computeProfileHash({\n\t\t\ttarget,\n\t\t\ttargetFamily,\n\t\t\tcapabilities\n\t\t}),\n\t\tmeta: {},\n\t\t...execution !== void 0 ? { execution } : {}\n\t};\n}\nfunction mergedSources(documents) {\n\tconst [first, ...rest] = documents.map((document) => document.sources);\n\tif (first === void 0) throw new InternalError(\"A Prisma 6 schema has at least one document\");\n\treturn first.merge(...rest);\n}\n//#endregion\n//#region src/provider.ts\nfunction defaultOutputFromSchemaPath(schemaPath) {\n\treturn join(dirname(schemaPath), \"contract.json\");\n}\nfunction mapParseDiagnostics(diagnostics, sourceFile, sourceId) {\n\treturn diagnostics.map((diagnostic) => ({\n\t\tcode: diagnostic.code,\n\t\tmessage: diagnostic.message,\n\t\tsourceId,\n\t\tspan: sourceFile.rangeToPslSpan(diagnostic.range)\n\t}));\n}\n/**\n* The files a Prisma 6 schema input names: the file itself, or every regular `.prisma` file under the directory, nested directories and symbolic links included, as Prisma 6 reads a schema directory. Sorted by path so duplicate detection blames the later file deterministically.\n*/\nasync function listSchemaFiles(absolutePath, displayPath) {\n\tif (!(await stat(absolutePath)).isDirectory()) return [{\n\t\tsourceId: displayPath,\n\t\tabsolutePath\n\t}];\n\tconst entries = await readdir(absolutePath, { recursive: true });\n\tconst files = [];\n\tfor (const entry of entries.filter((name) => extname(name) === \".prisma\").map((name) => normalize(name)).sort()) {\n\t\tconst entryPath = join(absolutePath, entry);\n\t\tif ((await stat(entryPath)).isFile()) files.push({\n\t\t\tsourceId: join(displayPath, entry),\n\t\t\tabsolutePath: entryPath\n\t\t});\n\t}\n\treturn files;\n}\nfunction readFailure(schemaPath, message, meta) {\n\treturn notOk({\n\t\tsummary: `Failed to read Prisma 6 schema at \"${schemaPath}\"`,\n\t\tdiagnostics: [prisma6Diagnostic(\"PSL.PRISMA6_MONGO_SCHEMA_READ_FAILED\", message, schemaPath, void 0)],\n\t\tmeta\n\t});\n}\n/**\n* A `ContractConfig` that reads a Prisma 6 MongoDB `schema.prisma` (a file, or a directory of `.prisma` files) as the contract source.\n*/\nfunction prisma6Contract(schemaPath, options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"psl\",\n\t\t\tinputs: [schemaPath],\n\t\t\tasync load(context) {\n\t\t\t\tconst [absolutePath] = context.resolvedInputs;\n\t\t\t\tif (absolutePath === void 0) throw new InternalError(\"prisma6Contract: context.resolvedInputs is empty. The CLI config loader should populate it from source.inputs.\");\n\t\t\t\tlet files;\n\t\t\t\ttry {\n\t\t\t\t\tfiles = await listSchemaFiles(absolutePath, schemaPath);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst message = String(error);\n\t\t\t\t\treturn readFailure(schemaPath, message, {\n\t\t\t\t\t\tschemaPath,\n\t\t\t\t\t\tabsolutePath,\n\t\t\t\t\t\tcause: message\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (files.length === 0) return readFailure(schemaPath, `The schema directory \"${schemaPath}\" contains no .prisma file.`, {\n\t\t\t\t\tschemaPath,\n\t\t\t\t\tabsolutePath\n\t\t\t\t});\n\t\t\t\tconst documents = [];\n\t\t\t\tconst seedDiagnostics = [];\n\t\t\t\tfor (const file of files) {\n\t\t\t\t\tlet schema;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tschema = await readFile(file.absolutePath, \"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\treturn readFailure(file.sourceId, message, {\n\t\t\t\t\t\t\tschemaPath: file.sourceId,\n\t\t\t\t\t\t\tabsoluteSchemaPath: file.absolutePath,\n\t\t\t\t\t\t\tcause: message\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tconst { document, sources, diagnostics } = parse(schema, file.sourceId);\n\t\t\t\t\tconst sourceFile = sources.sourceFileFor(document.syntax);\n\t\t\t\t\tseedDiagnostics.push(...mapParseDiagnostics(diagnostics, sourceFile, file.sourceId));\n\t\t\t\t\tdocuments.push({\n\t\t\t\t\t\tdocument,\n\t\t\t\t\t\tsources,\n\t\t\t\t\t\tsourceFile,\n\t\t\t\t\t\tsourceId: file.sourceId\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tlet contract;\n\t\t\t\ttry {\n\t\t\t\t\tconst interpreted = interpretPrisma6Documents({\n\t\t\t\t\t\tdocuments,\n\t\t\t\t\t\tseedDiagnostics,\n\t\t\t\t\t\tbinding: options.binding,\n\t\t\t\t\t\tauthoringContributions: context.authoringContributions,\n\t\t\t\t\t\tcodecLookup: context.codecLookup\n\t\t\t\t\t});\n\t\t\t\t\tif (!interpreted.ok) return interpreted;\n\t\t\t\t\tcontract = applySpecifierDefaultControlPolicy(interpreted.value, options.defaultControlPolicy);\n\t\t\t\t\tvalidateContractDomain(contract);\n\t\t\t\t\tvalidateMongoStorage(blindCast(contract));\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (!isStructuredError(error)) throw error;\n\t\t\t\t\treturn notOk({\n\t\t\t\t\t\tsummary: \"Prisma 6 MongoDB schema interpretation failed\",\n\t\t\t\t\t\tdiagnostics: [prisma6Diagnostic(\"PSL.PRISMA6_MONGO_CONTRACT_INVALID\", `This schema gives a contract that Prisma 8 rejects, and the Prisma 6 MongoDB contract source has no specific diagnostic for the cause: ${error.message.replace(/\\.$/, \"\")}. This is a bug in Prisma ORM; please report it with this schema.`, schemaPath, void 0)],\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tschemaPath,\n\t\t\t\t\t\t\tcode: error.code\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn ok(contract);\n\t\t\t}\n\t\t},\n\t\toutput: options.output ?? defaultOutputFromSchemaPath(schemaPath)\n\t};\n}\n//#endregion\nexport { prisma6Contract };\n\n//# sourceMappingURL=provider.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoBA,SAAS,kBAAkB,MAAM,SAAS,UAAU,MAAM;CACzD,OAAO;EACN;EACA;EACA;EACA,GAAG,SAAS,KAAK,IAAI,EAAE,KAAK,IAAI,CAAC;CAClC;AACD;AAGA,SAAS,YAAY,WAAW,MAAM,MAAM,KAAK;CAChD,IAAI,YAAY,KAAK,kBAAkB,gDAAgD,GAAG,IAAI,MAAM,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,WAAW,mCAAmC,YAAY,OAAO,QAAQ,oBAAoB;KAC7F,uBAAuB,QAAQ;KAC/B,qBAAqB,UAAU,QAAQ,CAAC;IACzC,SAAS,OAAO;KACf,IAAI,CAAC,kBAAkB,KAAK,GAAG,MAAM;KACrC,OAAO,MAAM;MACZ,SAAS;MACT,aAAa,CAAC,kBAAkB,sCAAsC,0IAA0I,MAAM,QAAQ,QAAQ,OAAO,EAAE,EAAE,oEAAoE,YAAY,KAAK,CAAC,CAAC;MACxU,MAAM;OACL;OACA,MAAM,MAAM;MACb;KACD,CAAC;IACF;IACA,OAAO,GAAG,QAAQ;GACnB;EACD;EACA,QAAQ,QAAQ,UAAU,4BAA4B,UAAU;CACjE;AACD"}
|
package/dist/contract-psl.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as pairMongoBackRelations, i as mongoAttributeSpecs, n as derivePolymorphicJsonSchema, r as interpretPslDocumentToMongoContract, t as deriveJsonSchema } from "./interpreter-
|
|
1
|
+
import { a as pairMongoBackRelations, i as mongoAttributeSpecs, n as derivePolymorphicJsonSchema, r as interpretPslDocumentToMongoContract, t as deriveJsonSchema } from "./interpreter-CNbTpXgT-CRfl2AwF.mjs";
|
|
2
2
|
export { deriveJsonSchema, derivePolymorphicJsonSchema, interpretPslDocumentToMongoContract, mongoAttributeSpecs, pairMongoBackRelations };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as interpretPslDocumentToMongoContract } from "./interpreter-
|
|
1
|
+
import { r as interpretPslDocumentToMongoContract } from "./interpreter-CNbTpXgT-CRfl2AwF.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-
|
|
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-CNbTpXgT.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;KAClB,oBAAo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O,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,5 +1,5 @@
|
|
|
1
1
|
import { t as mongoContractCanonicalizationHooks } from "./canonicalization-hooks-CRVM-Kqh-Qi-VmEVg.mjs";
|
|
2
|
-
import { i as mongoAttributeSpecs } from "./interpreter-
|
|
2
|
+
import { i as mongoAttributeSpecs } from "./interpreter-CNbTpXgT-CRfl2AwF.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
5
|
import { n as mongoFamilyPslBlockDescriptors, t as mongoFamilyEntityTypes } from "./authoring-entity-types-DkFfee0x-DzGu9hUw.mjs";
|
|
@@ -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-
|
|
405
|
+
//# sourceMappingURL=control-BRXfR7Ir.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-BG0O1wDj.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":";;;;;;;;;;;;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Ac;IACxC;IACA,MAAM;KACL;KACA,GAAG,UAAU,cAAc,UAAU;IACtC;IACA,SAAS,EAAE,OAAO,KAAK,IAAI,IAAI,UAAU;GAC1C;EACD;EACA,MAAM,WAAW,SAAS;GACzB,OAAO,kBAAkB,CAAC,CAAC,WAAW,cAAc,QAAQ,MAAM,GAAG,QAAQ,KAAK;EACnF;EACA,MAAM,eAAe,SAAS;GAC7B,OAAO,kBAAkB,CAAC,CAAC,eAAe,cAAc,QAAQ,MAAM,CAAC;EACxE;EACA,MAAM,WAAW,SAAS;GACzB,OAAO,kBAAkB,CAAC,CAAC,WAAW,cAAc,QAAQ,MAAM,GAAG,QAAQ,KAAK;EACnF;EACA,MAAM,WAAW,SAAS;GACzB,OAAO,kBAAkB,CAAC,CAAC,iBAAiB,cAAc,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-BRXfR7Ir.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,OAA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AAC,eAAe,cAAc,QAAQ,MAAM,CAAC;EACxE;EACA,MAAM,WAAW,SAAS;GACzB,OAAO,kBAAkB,CAAC,CAAC,WAAW,cAAc,QAAQ,MAAM,GAAG,QAAQ,KAAK;EACnF;EACA,MAAM,WAAW,SAAS;GACzB,OAAO,kBAAkB,CAAC,CAAC,iBAAiB,cAAc,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"}
|
package/dist/family.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { d as defaultMongoDomainNamespaceId, f as defaultMongoStorageNamespaceId
|
|
|
2
2
|
import { i as verifyMongoSchema, n as contractToMongoSchemaIR, r as diffMongoSchemas, t as canonicalizeSchemasForVerification } from "./verify-mongo-schema-B0bMHQW0-BuK0Jv5S.mjs";
|
|
3
3
|
import { n as mongoFamilyPslBlockDescriptors, t as mongoFamilyEntityTypes } from "./authoring-entity-types-DkFfee0x-DzGu9hUw.mjs";
|
|
4
4
|
import { n as MongoContractSerializerBase, t as MongoContractSerializer } from "./mongo-contract-serializer-DC_DM9_Y-CDk1Veya.mjs";
|
|
5
|
-
import { i as mongoOperationsToPreview, n as formatMongoOperations, r as mongoFamilyDescriptor, t as createMongoFamilyInstance } from "./control-
|
|
5
|
+
import { i as mongoOperationsToPreview, n as formatMongoOperations, r as mongoFamilyDescriptor, t as createMongoFamilyInstance } from "./control-BRXfR7Ir.mjs";
|
|
6
6
|
import { t as MongoContractView$1 } from "./mongo-contract-view-JZOa0Ry--BL8lTjbw.mjs";
|
|
7
7
|
import { t as MongoSchemaVerifierBase } from "./ir-vZWjElPY.mjs";
|
|
8
8
|
import { t as MongoMigration } from "./migration-DofqFxoZ.mjs";
|
package/dist/family__control.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as contractToMongoSchemaIR, r as diffMongoSchemas, t as canonicalizeSchemasForVerification } from "./verify-mongo-schema-B0bMHQW0-BuK0Jv5S.mjs";
|
|
2
|
-
import { i as mongoOperationsToPreview, n as formatMongoOperations, r as mongoFamilyDescriptor, t as createMongoFamilyInstance } from "./control-
|
|
2
|
+
import { i as mongoOperationsToPreview, n as formatMongoOperations, r as mongoFamilyDescriptor, t as createMongoFamilyInstance } from "./control-BRXfR7Ir.mjs";
|
|
3
3
|
export { canonicalizeSchemasForVerification, contractToMongoSchemaIR, createMongoFamilyInstance, diffMongoSchemas, formatMongoOperations, mongoFamilyDescriptor, mongoOperationsToPreview };
|
package/dist/family__pack.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as mongoAttributeSpecs } from "./interpreter-
|
|
1
|
+
import { i as mongoAttributeSpecs } from "./interpreter-CNbTpXgT-CRfl2AwF.mjs";
|
|
2
2
|
import { n as mongoFamilyPslBlockDescriptors, t as mongoFamilyEntityTypes } from "./authoring-entity-types-DkFfee0x-DzGu9hUw.mjs";
|
|
3
3
|
//#region ../../../2-mongo-family/9-family/dist/pack.mjs
|
|
4
4
|
const mongoFamilyPack = {
|