@prisma-next/sql-contract-ts 0.5.0-dev.65 → 0.5.0-dev.67

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 +1 @@
1
- {"version":3,"file":"config-types.d.mts","names":[],"sources":["../src/config-types.ts"],"sourcesContent":[],"mappings":";;;;iBAMgB,kBAAA,WAA6B,4BAA4B;iBASzD,0BAAA,yCAAmE"}
1
+ {"version":3,"file":"config-types.d.mts","names":[],"sources":["../src/config-types.ts"],"mappings":";;;;iBAMgB,kBAAA,CAAmB,QAAA,EAAU,QAAA,EAAU,MAAA,YAAkB,gBAAA;AAAA,iBASzD,0BAAA,CAA2B,YAAA,UAAsB,MAAA,YAAkB,gBAAA"}
@@ -1,7 +1,6 @@
1
1
  import { ifDefined } from "@prisma-next/utils/defined";
2
2
  import { pathToFileURL } from "node:url";
3
3
  import { ok } from "@prisma-next/utils/result";
4
-
5
4
  //#region src/config-types.ts
6
5
  function typescriptContract(contract, output) {
7
6
  return {
@@ -25,7 +24,7 @@ function typescriptContractFromPath(contractPath, output) {
25
24
  ...ifDefined("output", output)
26
25
  };
27
26
  }
28
-
29
27
  //#endregion
30
28
  export { typescriptContract, typescriptContractFromPath };
29
+
31
30
  //# sourceMappingURL=config-types.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-types.mjs","names":["contract: Contract | undefined"],"sources":["../src/config-types.ts"],"sourcesContent":["import { pathToFileURL } from 'node:url';\nimport type { ContractConfig } from '@prisma-next/config/config-types';\nimport type { Contract } from '@prisma-next/contract/types';\nimport { ifDefined } from '@prisma-next/utils/defined';\nimport { ok } from '@prisma-next/utils/result';\n\nexport function typescriptContract(contract: Contract, output?: string): ContractConfig {\n return {\n source: {\n load: async () => ok(contract),\n },\n ...ifDefined('output', output),\n };\n}\n\nexport function typescriptContractFromPath(contractPath: string, output?: string): ContractConfig {\n return {\n source: {\n inputs: [contractPath],\n load: async (context) => {\n const [absolutePath] = context.resolvedInputs;\n if (absolutePath === undefined) {\n throw new Error(\n 'typescriptContractFromPath: context.resolvedInputs is empty. The CLI config loader should populate it positional-matched with source.inputs.',\n );\n }\n const mod = await import(pathToFileURL(absolutePath).href);\n const contract: Contract | undefined = mod.default ?? mod.contract;\n if (contract === undefined) {\n throw new Error(\n `typescriptContractFromPath: module at \"${absolutePath}\" has no \"default\" or \"contract\" export.`,\n );\n }\n return ok(contract);\n },\n },\n ...ifDefined('output', output),\n };\n}\n"],"mappings":";;;;;AAMA,SAAgB,mBAAmB,UAAoB,QAAiC;AACtF,QAAO;EACL,QAAQ,EACN,MAAM,YAAY,GAAG,SAAS,EAC/B;EACD,GAAG,UAAU,UAAU,OAAO;EAC/B;;AAGH,SAAgB,2BAA2B,cAAsB,QAAiC;AAChG,QAAO;EACL,QAAQ;GACN,QAAQ,CAAC,aAAa;GACtB,MAAM,OAAO,YAAY;IACvB,MAAM,CAAC,gBAAgB,QAAQ;AAC/B,QAAI,iBAAiB,OACnB,OAAM,IAAI,MACR,+IACD;IAEH,MAAM,MAAM,MAAM,OAAO,cAAc,aAAa,CAAC;IACrD,MAAMA,WAAiC,IAAI,WAAW,IAAI;AAC1D,QAAI,aAAa,OACf,OAAM,IAAI,MACR,0CAA0C,aAAa,0CACxD;AAEH,WAAO,GAAG,SAAS;;GAEtB;EACD,GAAG,UAAU,UAAU,OAAO;EAC/B"}
1
+ {"version":3,"file":"config-types.mjs","names":[],"sources":["../src/config-types.ts"],"sourcesContent":["import { pathToFileURL } from 'node:url';\nimport type { ContractConfig } from '@prisma-next/config/config-types';\nimport type { Contract } from '@prisma-next/contract/types';\nimport { ifDefined } from '@prisma-next/utils/defined';\nimport { ok } from '@prisma-next/utils/result';\n\nexport function typescriptContract(contract: Contract, output?: string): ContractConfig {\n return {\n source: {\n load: async () => ok(contract),\n },\n ...ifDefined('output', output),\n };\n}\n\nexport function typescriptContractFromPath(contractPath: string, output?: string): ContractConfig {\n return {\n source: {\n inputs: [contractPath],\n load: async (context) => {\n const [absolutePath] = context.resolvedInputs;\n if (absolutePath === undefined) {\n throw new Error(\n 'typescriptContractFromPath: context.resolvedInputs is empty. The CLI config loader should populate it positional-matched with source.inputs.',\n );\n }\n const mod = await import(pathToFileURL(absolutePath).href);\n const contract: Contract | undefined = mod.default ?? mod.contract;\n if (contract === undefined) {\n throw new Error(\n `typescriptContractFromPath: module at \"${absolutePath}\" has no \"default\" or \"contract\" export.`,\n );\n }\n return ok(contract);\n },\n },\n ...ifDefined('output', output),\n };\n}\n"],"mappings":";;;;AAMA,SAAgB,mBAAmB,UAAoB,QAAiC;CACtF,OAAO;EACL,QAAQ,EACN,MAAM,YAAY,GAAG,SAAS,EAC/B;EACD,GAAG,UAAU,UAAU,OAAO;EAC/B;;AAGH,SAAgB,2BAA2B,cAAsB,QAAiC;CAChG,OAAO;EACL,QAAQ;GACN,QAAQ,CAAC,aAAa;GACtB,MAAM,OAAO,YAAY;IACvB,MAAM,CAAC,gBAAgB,QAAQ;IAC/B,IAAI,iBAAiB,KAAA,GACnB,MAAM,IAAI,MACR,+IACD;IAEH,MAAM,MAAM,MAAM,OAAO,cAAc,aAAa,CAAC;IACrD,MAAM,WAAiC,IAAI,WAAW,IAAI;IAC1D,IAAI,aAAa,KAAA,GACf,MAAM,IAAI,MACR,0CAA0C,aAAa,0CACxD;IAEH,OAAO,GAAG,SAAS;;GAEtB;EACD,GAAG,UAAU,UAAU,OAAO;EAC/B"}