@prisma/orm-family-mongo 8.0.0-rc.8-dev.2 → 8.0.0-rc.8-dev.4

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.
@@ -1,2 +1,2 @@
1
- import { n as derivePolymorphicJsonSchema, r as interpretPslDocumentToMongoContract, t as deriveJsonSchema } from "./interpreter-BxbUTQ3k-ClR98Ned.mjs";
1
+ import { n as derivePolymorphicJsonSchema, r as interpretPslDocumentToMongoContract, t as deriveJsonSchema } from "./interpreter-O09WlHk7-BiV9gBae.mjs";
2
2
  export { deriveJsonSchema, derivePolymorphicJsonSchema, interpretPslDocumentToMongoContract };
@@ -1,4 +1,4 @@
1
- import { r as interpretPslDocumentToMongoContract } from "./interpreter-BxbUTQ3k-ClR98Ned.mjs";
1
+ import { r as interpretPslDocumentToMongoContract } from "./interpreter-O09WlHk7-BiV9gBae.mjs";
2
2
  import { collectScalarTypeConstructors } from "@prisma/orm-framework/components/authoring";
3
3
  import { buildSymbolTable, rangeToPslSpan } from "@prisma/orm-framework/psl-parser";
4
4
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
@@ -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-BxbUTQ3k.mjs\";\nimport { collectScalarTypeConstructors } from \"@internal/framework-components/authoring\";\nimport { buildSymbolTable, rangeToPslSpan } from \"@internal/psl-parser\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { notOk } from \"@internal/utils/result\";\nimport { readFile } from \"node:fs/promises\";\nimport { withSeedDiagnostics } from \"@internal/psl-parser/interpret\";\nimport { parse } from \"@internal/psl-parser/syntax\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/provider.ts\nfunction collectScalarTypeCodecIds(namespace) {\n\treturn new Map([...collectScalarTypeConstructors(namespace)].map(([name, output]) => [name, output.codecId]));\n}\nfunction mapParseDiagnostics(diagnostics, sourceFile, sourceId) {\n\treturn diagnostics.map((diagnostic) => ({\n\t\tcode: diagnostic.code,\n\t\tmessage: diagnostic.message,\n\t\tsourceId,\n\t\tspan: rangeToPslSpan(diagnostic.range, sourceFile)\n\t}));\n}\nfunction 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\tsymbolTable: input.symbolTable,\n\t\t\t\t\tsourceFile: input.sourceFile,\n\t\t\t\t\tsourceId: input.sourceId,\n\t\t\t\t\tseedDiagnostics: [],\n\t\t\t\t\tscalarTypeCodecIds: collectScalarTypeCodecIds(context.authoringContributions.type),\n\t\t\t\t\tcodecLookup: context.codecLookup,\n\t\t\t\t\tauthoringContributions: context.authoringContributions,\n\t\t\t\t\t...ifDefined(\"enumInferenceCodecs\", options?.enumInferenceCodecs)\n\t\t\t\t});\n\t\t\t},\n\t\t\tasync load(context) {\n\t\t\t\tconst [absoluteSchemaPath] = context.resolvedInputs;\n\t\t\t\tif (absoluteSchemaPath === void 0) throw new InternalError(\"mongoContract: context.resolvedInputs is empty. The CLI config loader should populate it positional-matched with source.inputs.\");\n\t\t\t\tlet schema;\n\t\t\t\ttry {\n\t\t\t\t\tschema = await readFile(absoluteSchemaPath, \"utf-8\");\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst message = String(error);\n\t\t\t\t\treturn notOk({\n\t\t\t\t\t\tsummary: `Failed to read Prisma schema at \"${schemaPath}\"`,\n\t\t\t\t\t\tdiagnostics: [{\n\t\t\t\t\t\t\tcode: \"PSL_SCHEMA_READ_FAILED\",\n\t\t\t\t\t\t\tmessage,\n\t\t\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t\t\t}],\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tschemaPath,\n\t\t\t\t\t\t\tabsoluteSchemaPath,\n\t\t\t\t\t\t\tcause: message\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tconst { document, sourceFile, diagnostics: parseDiagnostics } = parse(schema);\n\t\t\t\tconst { table: symbolTable, diagnostics: symbolTableDiagnostics } = buildSymbolTable({\n\t\t\t\t\tdocument,\n\t\t\t\t\tsourceFile,\n\t\t\t\t\tpslBlockDescriptors: context.authoringContributions.pslBlockDescriptors\n\t\t\t\t});\n\t\t\t\tconst seedDiagnostics = [...mapParseDiagnostics(parseDiagnostics, sourceFile, schemaPath), ...mapParseDiagnostics(symbolTableDiagnostics, sourceFile, schemaPath)];\n\t\t\t\treturn withSeedDiagnostics(this.interpret({\n\t\t\t\t\tdocument,\n\t\t\t\t\tsourceFile,\n\t\t\t\t\tsymbolTable,\n\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t}, context), seedDiagnostics);\n\t\t\t}\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,oBAAoB,aAAa,YAAY,UAAU;CAC/D,OAAO,YAAY,KAAK,gBAAgB;EACvC,MAAM,WAAW;EACjB,SAAS,WAAW;EACpB;EACA,MAAM,eAAe,WAAW,OAAO,UAAU;CAClD,EAAE;AACH;AACA,SAAS,cAAc,YAAY,SAAS;CAC3C,OAAO;EACN,QAAQ;GACP,QAAQ;GACR,QAAQ,CAAC,UAAU;GACnB,UAAU,OAAO,SAAS;IACzB,OAAO,oCAAoC;KAC1C,aAAa,MAAM;KACnB,YAAY,MAAM;KAClB,UAAU,MAAM;KAChB,iBAAiB,CAAC;KAClB,oBAAoB,0BAA0B,QAAQ,uBAAuB,IAAI;KACjF,aAAa,QAAQ;KACrB,wBAAwB,QAAQ;KAChC,GAAG,UAAU,uBAAuB,SAAS,mBAAmB;IACjE,CAAC;GACF;GACA,MAAM,KAAK,SAAS;IACnB,MAAM,CAAC,sBAAsB,QAAQ;IACrC,IAAI,uBAAuB,KAAK,GAAG,MAAM,IAAI,cAAc,iIAAiI;IAC5L,IAAI;IACJ,IAAI;KACH,SAAS,MAAM,SAAS,oBAAoB,OAAO;IACpD,SAAS,OAAO;KACf,MAAM,UAAU,OAAO,KAAK;KAC5B,OAAO,MAAM;MACZ,SAAS,oCAAoC,WAAW;MACxD,aAAa,CAAC;OACb,MAAM;OACN;OACA,UAAU;MACX,CAAC;MACD,MAAM;OACL;OACA;OACA,OAAO;MACR;KACD,CAAC;IACF;IACA,MAAM,EAAE,UAAU,YAAY,aAAa,qBAAqB,MAAM,MAAM;IAC5E,MAAM,EAAE,OAAO,aAAa,aAAa,2BAA2B,iBAAiB;KACpF;KACA;KACA,qBAAqB,QAAQ,uBAAuB;IACrD,CAAC;IACD,MAAM,kBAAkB,CAAC,GAAG,oBAAoB,kBAAkB,YAAY,UAAU,GAAG,GAAG,oBAAoB,wBAAwB,YAAY,UAAU,CAAC;IACjK,OAAO,oBAAoB,KAAK,UAAU;KACzC;KACA;KACA;KACA,UAAU;IACX,GAAG,OAAO,GAAG,eAAe;GAC7B;EACD;EACA,GAAG,UAAU,UAAU,SAAS,MAAM;CACvC;AACD"}
1
+ {"version":3,"file":"contract-psl__provider.mjs","names":[],"sources":["../../../../2-mongo-family/2-authoring/contract-psl/dist/exports/provider.mjs"],"sourcesContent":["import { t as interpretPslDocumentToMongoContract } from \"../interpreter-O09WlHk7.mjs\";\nimport { collectScalarTypeConstructors } from \"@internal/framework-components/authoring\";\nimport { buildSymbolTable, rangeToPslSpan } from \"@internal/psl-parser\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { notOk } from \"@internal/utils/result\";\nimport { readFile } from \"node:fs/promises\";\nimport { withSeedDiagnostics } from \"@internal/psl-parser/interpret\";\nimport { parse } from \"@internal/psl-parser/syntax\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/provider.ts\nfunction collectScalarTypeCodecIds(namespace) {\n\treturn new Map([...collectScalarTypeConstructors(namespace)].map(([name, output]) => [name, output.codecId]));\n}\nfunction mapParseDiagnostics(diagnostics, sourceFile, sourceId) {\n\treturn diagnostics.map((diagnostic) => ({\n\t\tcode: diagnostic.code,\n\t\tmessage: diagnostic.message,\n\t\tsourceId,\n\t\tspan: rangeToPslSpan(diagnostic.range, sourceFile)\n\t}));\n}\nfunction 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\tsymbolTable: input.symbolTable,\n\t\t\t\t\tsourceFile: input.sourceFile,\n\t\t\t\t\tsourceId: input.sourceId,\n\t\t\t\t\tseedDiagnostics: [],\n\t\t\t\t\tscalarTypeCodecIds: collectScalarTypeCodecIds(context.authoringContributions.type),\n\t\t\t\t\tcodecLookup: context.codecLookup,\n\t\t\t\t\tauthoringContributions: context.authoringContributions,\n\t\t\t\t\t...ifDefined(\"enumInferenceCodecs\", options?.enumInferenceCodecs)\n\t\t\t\t});\n\t\t\t},\n\t\t\tasync load(context) {\n\t\t\t\tconst [absoluteSchemaPath] = context.resolvedInputs;\n\t\t\t\tif (absoluteSchemaPath === void 0) throw new InternalError(\"mongoContract: context.resolvedInputs is empty. The CLI config loader should populate it positional-matched with source.inputs.\");\n\t\t\t\tlet schema;\n\t\t\t\ttry {\n\t\t\t\t\tschema = await readFile(absoluteSchemaPath, \"utf-8\");\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst message = String(error);\n\t\t\t\t\treturn notOk({\n\t\t\t\t\t\tsummary: `Failed to read Prisma schema at \"${schemaPath}\"`,\n\t\t\t\t\t\tdiagnostics: [{\n\t\t\t\t\t\t\tcode: \"PSL_SCHEMA_READ_FAILED\",\n\t\t\t\t\t\t\tmessage,\n\t\t\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t\t\t}],\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tschemaPath,\n\t\t\t\t\t\t\tabsoluteSchemaPath,\n\t\t\t\t\t\t\tcause: message\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tconst { document, sourceFile, diagnostics: parseDiagnostics } = parse(schema);\n\t\t\t\tconst { table: symbolTable, diagnostics: symbolTableDiagnostics } = buildSymbolTable({\n\t\t\t\t\tdocument,\n\t\t\t\t\tsourceFile,\n\t\t\t\t\tpslBlockDescriptors: context.authoringContributions.pslBlockDescriptors\n\t\t\t\t});\n\t\t\t\tconst seedDiagnostics = [...mapParseDiagnostics(parseDiagnostics, sourceFile, schemaPath), ...mapParseDiagnostics(symbolTableDiagnostics, sourceFile, schemaPath)];\n\t\t\t\treturn withSeedDiagnostics(this.interpret({\n\t\t\t\t\tdocument,\n\t\t\t\t\tsourceFile,\n\t\t\t\t\tsymbolTable,\n\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t}, context), seedDiagnostics);\n\t\t\t}\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,oBAAoB,aAAa,YAAY,UAAU;CAC/D,OAAO,YAAY,KAAK,gBAAgB;EACvC,MAAM,WAAW;EACjB,SAAS,WAAW;EACpB;EACA,MAAM,eAAe,WAAW,OAAO,U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