@powerlines/plugin-prisma 0.2.244 → 0.2.245

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/dist/api/client/client.gen.d.cts +7 -0
  2. package/dist/api/client/client.gen.d.cts.map +1 -0
  3. package/dist/api/client/client.gen.d.mts +7 -0
  4. package/dist/api/client/client.gen.d.mts.map +1 -0
  5. package/dist/api/client/client.gen.mjs +2 -1
  6. package/dist/api/client/client.gen.mjs.map +1 -0
  7. package/dist/api/client/index.d.cts +8 -0
  8. package/dist/api/client/index.d.mts +8 -0
  9. package/dist/api/client/types.gen.d.cts +131 -0
  10. package/dist/api/client/types.gen.d.cts.map +1 -0
  11. package/dist/api/client/types.gen.d.mts +131 -0
  12. package/dist/api/client/types.gen.d.mts.map +1 -0
  13. package/dist/api/client/utils.gen.d.cts +44 -0
  14. package/dist/api/client/utils.gen.d.cts.map +1 -0
  15. package/dist/api/client/utils.gen.d.mts +44 -0
  16. package/dist/api/client/utils.gen.d.mts.map +1 -0
  17. package/dist/api/client/utils.gen.mjs +2 -1
  18. package/dist/api/client/utils.gen.mjs.map +1 -0
  19. package/dist/api/client.gen.d.cts +19 -0
  20. package/dist/api/client.gen.d.cts.map +1 -0
  21. package/dist/api/client.gen.d.mts +19 -0
  22. package/dist/api/client.gen.d.mts.map +1 -0
  23. package/dist/api/client.gen.mjs +2 -1
  24. package/dist/api/client.gen.mjs.map +1 -0
  25. package/dist/api/core/auth.gen.d.cts +24 -0
  26. package/dist/api/core/auth.gen.d.cts.map +1 -0
  27. package/dist/api/core/auth.gen.d.mts +24 -0
  28. package/dist/api/core/auth.gen.d.mts.map +1 -0
  29. package/dist/api/core/auth.gen.mjs +2 -1
  30. package/dist/api/core/auth.gen.mjs.map +1 -0
  31. package/dist/api/core/bodySerializer.gen.d.cts +32 -0
  32. package/dist/api/core/bodySerializer.gen.d.cts.map +1 -0
  33. package/dist/api/core/bodySerializer.gen.d.mts +32 -0
  34. package/dist/api/core/bodySerializer.gen.d.mts.map +1 -0
  35. package/dist/api/core/bodySerializer.gen.mjs +2 -1
  36. package/dist/api/core/bodySerializer.gen.mjs.map +1 -0
  37. package/dist/api/core/params.gen.d.cts +49 -0
  38. package/dist/api/core/params.gen.d.cts.map +1 -0
  39. package/dist/api/core/params.gen.d.mts +49 -0
  40. package/dist/api/core/params.gen.d.mts.map +1 -0
  41. package/dist/api/core/params.gen.mjs +2 -1
  42. package/dist/api/core/params.gen.mjs.map +1 -0
  43. package/dist/api/core/pathSerializer.gen.d.cts +56 -0
  44. package/dist/api/core/pathSerializer.gen.d.cts.map +1 -0
  45. package/dist/api/core/pathSerializer.gen.d.mts +56 -0
  46. package/dist/api/core/pathSerializer.gen.d.mts.map +1 -0
  47. package/dist/api/core/pathSerializer.gen.mjs +2 -1
  48. package/dist/api/core/pathSerializer.gen.mjs.map +1 -0
  49. package/dist/api/core/queryKeySerializer.gen.d.cts +23 -0
  50. package/dist/api/core/queryKeySerializer.gen.d.cts.map +1 -0
  51. package/dist/api/core/queryKeySerializer.gen.d.mts +23 -0
  52. package/dist/api/core/queryKeySerializer.gen.d.mts.map +1 -0
  53. package/dist/api/core/queryKeySerializer.gen.mjs +2 -1
  54. package/dist/api/core/queryKeySerializer.gen.mjs.map +1 -0
  55. package/dist/api/core/serverSentEvents.gen.d.cts +91 -0
  56. package/dist/api/core/serverSentEvents.gen.d.cts.map +1 -0
  57. package/dist/api/core/serverSentEvents.gen.d.mts +91 -0
  58. package/dist/api/core/serverSentEvents.gen.d.mts.map +1 -0
  59. package/dist/api/core/serverSentEvents.gen.mjs +2 -1
  60. package/dist/api/core/serverSentEvents.gen.mjs.map +1 -0
  61. package/dist/api/core/types.gen.d.cts +80 -0
  62. package/dist/api/core/types.gen.d.cts.map +1 -0
  63. package/dist/api/core/types.gen.d.mts +80 -0
  64. package/dist/api/core/types.gen.d.mts.map +1 -0
  65. package/dist/api/core/utils.gen.d.cts +34 -0
  66. package/dist/api/core/utils.gen.d.cts.map +1 -0
  67. package/dist/api/core/utils.gen.d.mts +34 -0
  68. package/dist/api/core/utils.gen.d.mts.map +1 -0
  69. package/dist/api/core/utils.gen.mjs +2 -1
  70. package/dist/api/core/utils.gen.mjs.map +1 -0
  71. package/dist/api/sdk.gen.d.cts +226 -0
  72. package/dist/api/sdk.gen.d.cts.map +1 -0
  73. package/dist/api/sdk.gen.d.mts +226 -0
  74. package/dist/api/sdk.gen.d.mts.map +1 -0
  75. package/dist/api/sdk.gen.mjs +2 -1
  76. package/dist/api/sdk.gen.mjs.map +1 -0
  77. package/dist/api/types.gen.d.cts +2365 -0
  78. package/dist/api/types.gen.d.cts.map +1 -0
  79. package/dist/api/types.gen.d.mts +2365 -0
  80. package/dist/api/types.gen.d.mts.map +1 -0
  81. package/dist/helpers/get-schema.d.cts +14 -0
  82. package/dist/helpers/get-schema.d.cts.map +1 -0
  83. package/dist/helpers/get-schema.d.mts +14 -0
  84. package/dist/helpers/get-schema.d.mts.map +1 -0
  85. package/dist/helpers/get-schema.mjs +2 -1
  86. package/dist/helpers/get-schema.mjs.map +1 -0
  87. package/dist/helpers/index.d.cts +4 -0
  88. package/dist/helpers/index.d.mts +4 -0
  89. package/dist/helpers/prisma-postgres.d.cts +65 -0
  90. package/dist/helpers/prisma-postgres.d.cts.map +1 -0
  91. package/dist/helpers/prisma-postgres.d.mts +65 -0
  92. package/dist/helpers/prisma-postgres.d.mts.map +1 -0
  93. package/dist/helpers/prisma-postgres.mjs +2 -1
  94. package/dist/helpers/prisma-postgres.mjs.map +1 -0
  95. package/dist/helpers/schema-creator.d.cts +21 -0
  96. package/dist/helpers/schema-creator.d.cts.map +1 -0
  97. package/dist/helpers/schema-creator.d.mts +21 -0
  98. package/dist/helpers/schema-creator.d.mts.map +1 -0
  99. package/dist/helpers/schema-creator.mjs +2 -1
  100. package/dist/helpers/schema-creator.mjs.map +1 -0
  101. package/dist/index.cjs +18 -24
  102. package/dist/index.d.cts +24 -0
  103. package/dist/index.d.cts.map +1 -0
  104. package/dist/index.d.mts +24 -0
  105. package/dist/index.d.mts.map +1 -0
  106. package/dist/index.mjs +16 -21
  107. package/dist/index.mjs.map +1 -0
  108. package/dist/types/index.d.cts +3 -0
  109. package/dist/types/index.d.mts +3 -0
  110. package/dist/types/plugin.d.cts +91 -0
  111. package/dist/types/plugin.d.cts.map +1 -0
  112. package/dist/types/plugin.d.mts +91 -0
  113. package/dist/types/plugin.d.mts.map +1 -0
  114. package/dist/types/prisma.d.cts +85 -0
  115. package/dist/types/prisma.d.cts.map +1 -0
  116. package/dist/types/prisma.d.mts +85 -0
  117. package/dist/types/prisma.d.mts.map +1 -0
  118. package/package.json +8 -7
package/dist/index.mjs CHANGED
@@ -6,12 +6,9 @@ import { getSchema } from "./helpers/get-schema.mjs";
6
6
  import { PrismaSchemaCreator } from "./helpers/schema-creator.mjs";
7
7
  import { execute, executePackage } from "@stryke/cli/execute";
8
8
  import { existsSync } from "@stryke/fs/exists";
9
- import { isPackageListed } from "@stryke/fs/package-fns";
10
9
  import { joinPaths } from "@stryke/path/join-paths";
11
- import { replacePath } from "@stryke/path/replace";
12
10
  import defu from "defu";
13
- import { getConfigPath } from "powerlines/plugin-utils/get-config-path";
14
- import { replacePathTokens } from "powerlines/plugin-utils/paths";
11
+ import { getConfigPath, replacePathTokens } from "powerlines/plugin-utils";
15
12
 
16
13
  //#region src/index.ts
17
14
  /**
@@ -25,7 +22,7 @@ const plugin = (options = {}) => {
25
22
  name: "prisma",
26
23
  config() {
27
24
  return { prisma: defu(options, {
28
- schema: joinPaths(this.config.projectRoot, "prisma", "schema.prisma"),
25
+ schema: joinPaths(this.config.root, "prisma", "schema.prisma"),
29
26
  configFile: options.configFile || getConfigPath(this, "prisma.config"),
30
27
  outputPath: joinPaths("{builtinPath}", "prisma"),
31
28
  prismaPostgres: options?.prismaPostgres ? {
@@ -55,14 +52,12 @@ const plugin = (options = {}) => {
55
52
  }
56
53
  }));
57
54
  this.prisma.api = new PrismaClient({ client: client$1 });
58
- await this.prisma.api.createDatabase({
59
- path: { projectId: this.config.prisma.prismaPostgres.projectId },
60
- body: {
61
- isDefault: false,
62
- name: this.config.prisma.prismaPostgres.databaseName || `${this.config.prisma.prismaPostgres.region}.${this.config.mode}.${this.config.name}`,
63
- region: this.config.prisma.prismaPostgres.region
64
- }
65
- }).then((response) => response.data.data);
55
+ await this.prisma.api.createDatabase({ body: {
56
+ isDefault: false,
57
+ name: this.config.prisma.prismaPostgres.databaseName || `${this.config.prisma.prismaPostgres.region}.${this.config.mode}.${this.config.name}`,
58
+ projectId: this.config.prisma.prismaPostgres.projectId,
59
+ region: this.config.prisma.prismaPostgres.region
60
+ } }).then((response) => response.data?.data);
66
61
  }
67
62
  if (!this.config.prisma.outputPath) throw new Error(`Prisma generated path is not defined. Please specify a valid path in the plugin configuration.`);
68
63
  this.config.prisma.outputPath = replacePathTokens(this, this.config.prisma.outputPath);
@@ -73,11 +68,11 @@ const plugin = (options = {}) => {
73
68
  warnings: []
74
69
  };
75
70
  else this.prisma.schema = await getSchema({ datamodel: this.config.prisma.schema });
76
- const generator = this.prisma.schema.generators.find((gen) => gen.provider.value === "prisma-client-js");
71
+ const generator = this.prisma.schema.generators.find((gen) => gen.provider.value === "prisma-client");
77
72
  if (!generator) this.prisma.schema.generators.push({
78
- name: "prisma-client-js",
73
+ name: "prisma-client",
79
74
  provider: {
80
- value: "prisma-client-js",
75
+ value: "prisma-client",
81
76
  fromEnvVar: null
82
77
  },
83
78
  output: {
@@ -103,13 +98,12 @@ const plugin = (options = {}) => {
103
98
  this.config.prisma.schema
104
99
  ];
105
100
  if (!this.config.prisma.prismaPath) {
106
- const isPrismaListed = await isPackageListed("prisma", this.config.projectRoot);
107
- args.unshift(isPrismaListed ? replacePath(this.config.sourceRoot, this.config.projectRoot) : this.config.sourceRoot);
108
- const result = await executePackage("prisma", args, joinPaths(this.workspaceConfig.workspaceRoot, this.config.projectRoot));
101
+ args.unshift(this.config.root);
102
+ const result = await executePackage("prisma", args, joinPaths(this.workspaceConfig.workspaceRoot, this.config.root));
109
103
  if (result.failed) throw new Error(`Prisma process exited with code ${result.exitCode}.`);
110
104
  } else {
111
105
  args.unshift(this.config.prisma.prismaPath);
112
- const result = await execute(args.join(" "), this.config.projectRoot);
106
+ const result = await execute(args.join(" "), this.config.root);
113
107
  if (result.failed) throw new Error(`Prisma process exited with code ${result.exitCode}.`);
114
108
  }
115
109
  }
@@ -118,4 +112,5 @@ const plugin = (options = {}) => {
118
112
  var src_default = plugin;
119
113
 
120
114
  //#endregion
121
- export { PrismaClient, client, src_default as default, plugin };
115
+ export { PrismaClient, client, src_default as default, plugin };
116
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["client"],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { execute, executePackage } from \"@stryke/cli/execute\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport { getConfigPath, replacePathTokens } from \"powerlines/plugin-utils\";\nimport { createClient } from \"./api/client/client.gen\";\nimport type { ClientOptions } from \"./api/client/types.gen\";\nimport { createConfig } from \"./api/client/utils.gen\";\nimport { Options, PrismaClient } from \"./api/sdk.gen\";\nimport { CreateDatabaseData } from \"./api/types.gen\";\nimport { getSchema } from \"./helpers/get-schema\";\nimport { PrismaSchemaCreator } from \"./helpers/schema-creator\";\nimport {\n PrismaPluginContext,\n PrismaPluginOptions,\n PrismaPluginUserConfig\n} from \"./types/plugin\";\n\nexport * from \"./api/client.gen\";\nexport * from \"./api/sdk.gen\";\nexport * from \"./api/types.gen\";\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n export interface UserConfig {\n prisma?: PrismaPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to integrate Prisma for code generation.\n *\n * @param options - The plugin options.\n * @returns A Powerlines plugin instance.\n */\nexport const plugin = <\n TContext extends PrismaPluginContext = PrismaPluginContext\n>(\n options: PrismaPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"prisma\",\n config() {\n return {\n prisma: defu(options, {\n schema: joinPaths(this.config.root, \"prisma\", \"schema.prisma\"),\n configFile:\n options.configFile || getConfigPath(this, \"prisma.config\"),\n outputPath: joinPaths(\"{builtinPath}\", \"prisma\"),\n prismaPostgres: options?.prismaPostgres\n ? {\n projectId: this.config.name,\n region: \"us-east-1\"\n }\n : undefined\n })\n } as Partial<PrismaPluginUserConfig>;\n },\n async configResolved() {\n this.dependencies[\"@prisma/client\"] = \"latest\";\n\n this.config.prisma.configFile = replacePathTokens(\n this,\n this.config.prisma.configFile\n );\n\n if (!this.config.prisma.schema) {\n throw new Error(\n `Prisma schema path is not defined. Please specify a valid path in the plugin configuration.`\n );\n }\n\n this.config.prisma.schema = replacePathTokens(\n this,\n this.config.prisma.schema\n );\n\n if (this.config.prisma.prismaPostgres) {\n let serviceToken = process.env.PRISMA_SERVICE_TOKEN;\n if (!serviceToken) {\n serviceToken = options.serviceToken;\n if (serviceToken) {\n this.warn(\n \"If possible, please use the `PRISMA_SERVICE_TOKEN` environment variable instead of using the `serviceToken` option directly. The `serviceToken` option will work; however, this is a less secure method of configuration.\"\n );\n } else {\n throw new Error(\n \"Unable to determine the Prisma service token. Please set the `PRISMA_SERVICE_TOKEN` environment variable.\"\n );\n }\n }\n\n const client = createClient(\n createConfig<ClientOptions>({\n baseUrl: \"https://api.prisma.io\",\n throwOnError: true,\n headers: {\n Authorization: `Bearer ${serviceToken}`,\n \"User-Agent\": \"powerlines/1.0\"\n }\n })\n );\n\n this.prisma.api = new PrismaClient({\n client\n });\n\n await this.prisma.api\n .createDatabase({\n body: {\n isDefault: false,\n name:\n this.config.prisma.prismaPostgres.databaseName ||\n `${this.config.prisma.prismaPostgres.region}.${this.config.mode}.${this.config.name}`,\n projectId: this.config.prisma.prismaPostgres.projectId,\n region: this.config.prisma.prismaPostgres.region\n }\n } as Options<CreateDatabaseData>)\n .then(response => response.data?.data);\n }\n\n if (!this.config.prisma.outputPath) {\n throw new Error(\n `Prisma generated path is not defined. Please specify a valid path in the plugin configuration.`\n );\n }\n\n this.config.prisma.outputPath = replacePathTokens(\n this,\n this.config.prisma.outputPath\n );\n\n this.prisma ??= {} as TContext[\"prisma\"];\n if (!existsSync(this.config.prisma.schema)) {\n this.prisma.schema ??= {\n generators: [],\n datasources: [],\n warnings: []\n };\n } else {\n this.prisma.schema = await getSchema({\n datamodel: this.config.prisma.schema\n });\n }\n\n const generator = this.prisma.schema.generators.find(\n gen => gen.provider.value === \"prisma-client\"\n );\n if (!generator) {\n this.prisma.schema.generators.push({\n name: \"prisma-client\",\n provider: {\n value: \"prisma-client\",\n fromEnvVar: null\n },\n output: {\n value: this.config.prisma.outputPath,\n fromEnvVar: null\n },\n config: {},\n binaryTargets: [],\n previewFeatures: [],\n sourceFilePath: this.config.prisma.schema\n });\n } else {\n generator.output ??= {\n value: this.config.prisma.outputPath,\n fromEnvVar: null\n };\n }\n\n this.prisma.builder = new PrismaSchemaCreator(this);\n },\n async prepare() {\n // Write the schema file before invoking Prisma - Generate\n await this.prisma.builder.write();\n\n const args = [\"generate\", \"--schema\", this.config.prisma.schema];\n if (!this.config.prisma.prismaPath) {\n args.unshift(this.config.root);\n\n const result = await executePackage(\n \"prisma\",\n args,\n joinPaths(this.workspaceConfig.workspaceRoot, this.config.root)\n );\n if (result.failed) {\n throw new Error(\n `Prisma process exited with code ${result.exitCode}.`\n );\n }\n } else {\n args.unshift(this.config.prisma.prismaPath);\n\n const result = await execute(args.join(\" \"), this.config.root);\n if (result.failed) {\n throw new Error(\n `Prisma process exited with code ${result.exitCode}.`\n );\n }\n }\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAsDA,MAAa,UAGX,UAA+B,EAAE,KACZ;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,UAAO,EACL,QAAQ,KAAK,SAAS;IACpB,QAAQ,UAAU,KAAK,OAAO,MAAM,UAAU,gBAAgB;IAC9D,YACE,QAAQ,cAAc,cAAc,MAAM,gBAAgB;IAC5D,YAAY,UAAU,iBAAiB,SAAS;IAChD,gBAAgB,SAAS,iBACrB;KACE,WAAW,KAAK,OAAO;KACvB,QAAQ;KACT,GACD;IACL,CAAC,EACH;;EAEH,MAAM,iBAAiB;AACrB,QAAK,aAAa,oBAAoB;AAEtC,QAAK,OAAO,OAAO,aAAa,kBAC9B,MACA,KAAK,OAAO,OAAO,WACpB;AAED,OAAI,CAAC,KAAK,OAAO,OAAO,OACtB,OAAM,IAAI,MACR,8FACD;AAGH,QAAK,OAAO,OAAO,SAAS,kBAC1B,MACA,KAAK,OAAO,OAAO,OACpB;AAED,OAAI,KAAK,OAAO,OAAO,gBAAgB;IACrC,IAAI,eAAe,QAAQ,IAAI;AAC/B,QAAI,CAAC,cAAc;AACjB,oBAAe,QAAQ;AACvB,SAAI,aACF,MAAK,KACH,4NACD;SAED,OAAM,IAAI,MACR,4GACD;;IAIL,MAAMA,WAAS,aACb,aAA4B;KAC1B,SAAS;KACT,cAAc;KACd,SAAS;MACP,eAAe,UAAU;MACzB,cAAc;MACf;KACF,CAAC,CACH;AAED,SAAK,OAAO,MAAM,IAAI,aAAa,EACjC,kBACD,CAAC;AAEF,UAAM,KAAK,OAAO,IACf,eAAe,EACd,MAAM;KACJ,WAAW;KACX,MACE,KAAK,OAAO,OAAO,eAAe,gBAClC,GAAG,KAAK,OAAO,OAAO,eAAe,OAAO,GAAG,KAAK,OAAO,KAAK,GAAG,KAAK,OAAO;KACjF,WAAW,KAAK,OAAO,OAAO,eAAe;KAC7C,QAAQ,KAAK,OAAO,OAAO,eAAe;KAC3C,EACF,CAAgC,CAChC,MAAK,aAAY,SAAS,MAAM,KAAK;;AAG1C,OAAI,CAAC,KAAK,OAAO,OAAO,WACtB,OAAM,IAAI,MACR,iGACD;AAGH,QAAK,OAAO,OAAO,aAAa,kBAC9B,MACA,KAAK,OAAO,OAAO,WACpB;AAED,QAAK,WAAW,EAAE;AAClB,OAAI,CAAC,WAAW,KAAK,OAAO,OAAO,OAAO,CACxC,MAAK,OAAO,WAAW;IACrB,YAAY,EAAE;IACd,aAAa,EAAE;IACf,UAAU,EAAE;IACb;OAED,MAAK,OAAO,SAAS,MAAM,UAAU,EACnC,WAAW,KAAK,OAAO,OAAO,QAC/B,CAAC;GAGJ,MAAM,YAAY,KAAK,OAAO,OAAO,WAAW,MAC9C,QAAO,IAAI,SAAS,UAAU,gBAC/B;AACD,OAAI,CAAC,UACH,MAAK,OAAO,OAAO,WAAW,KAAK;IACjC,MAAM;IACN,UAAU;KACR,OAAO;KACP,YAAY;KACb;IACD,QAAQ;KACN,OAAO,KAAK,OAAO,OAAO;KAC1B,YAAY;KACb;IACD,QAAQ,EAAE;IACV,eAAe,EAAE;IACjB,iBAAiB,EAAE;IACnB,gBAAgB,KAAK,OAAO,OAAO;IACpC,CAAC;OAEF,WAAU,WAAW;IACnB,OAAO,KAAK,OAAO,OAAO;IAC1B,YAAY;IACb;AAGH,QAAK,OAAO,UAAU,IAAI,oBAAoB,KAAK;;EAErD,MAAM,UAAU;AAEd,SAAM,KAAK,OAAO,QAAQ,OAAO;GAEjC,MAAM,OAAO;IAAC;IAAY;IAAY,KAAK,OAAO,OAAO;IAAO;AAChE,OAAI,CAAC,KAAK,OAAO,OAAO,YAAY;AAClC,SAAK,QAAQ,KAAK,OAAO,KAAK;IAE9B,MAAM,SAAS,MAAM,eACnB,UACA,MACA,UAAU,KAAK,gBAAgB,eAAe,KAAK,OAAO,KAAK,CAChE;AACD,QAAI,OAAO,OACT,OAAM,IAAI,MACR,mCAAmC,OAAO,SAAS,GACpD;UAEE;AACL,SAAK,QAAQ,KAAK,OAAO,OAAO,WAAW;IAE3C,MAAM,SAAS,MAAM,QAAQ,KAAK,KAAK,IAAI,EAAE,KAAK,OAAO,KAAK;AAC9D,QAAI,OAAO,OACT,OAAM,IAAI,MACR,mCAAmC,OAAO,SAAS,GACpD;;;EAIR;;AAGH,kBAAe"}
@@ -0,0 +1,3 @@
1
+ import { ActiveConnectorType, BinaryTargetsEnvValue, ConnectorType, DataSource, EnvPaths, EnvValue, GeneratorConfig, GetSchemaOptions, GetSchemaResponse, MultipleSchemas, PrismaSchema, SchemaFileInput, __ΩActiveConnectorType, __ΩBinaryTargetsEnvValue, __ΩConnectorType, __ΩDataSource, __ΩEnvPaths, __ΩEnvValue, __ΩGeneratorConfig, __ΩGetSchemaOptions, __ΩGetSchemaResponse, __ΩMultipleSchemas, __ΩPrismaSchema, __ΩSchemaFileInput } from "./prisma.cjs";
2
+ import { PrismaPluginContext, PrismaPluginOptions, PrismaPluginResolvedConfig, PrismaPluginUserConfig, PrismaPostgresPrismaPluginOptions, __ΩPrismaPluginContext, __ΩPrismaPluginOptions, __ΩPrismaPluginResolvedConfig, __ΩPrismaPluginUserConfig, __ΩPrismaPostgresPrismaPluginOptions } from "./plugin.cjs";
3
+ export { ActiveConnectorType, BinaryTargetsEnvValue, ConnectorType, DataSource, EnvPaths, EnvValue, GeneratorConfig, GetSchemaOptions, GetSchemaResponse, MultipleSchemas, PrismaPluginContext, PrismaPluginOptions, PrismaPluginResolvedConfig, PrismaPluginUserConfig, PrismaPostgresPrismaPluginOptions, PrismaSchema, SchemaFileInput, __ΩActiveConnectorType, __ΩBinaryTargetsEnvValue, __ΩConnectorType, __ΩDataSource, __ΩEnvPaths, __ΩEnvValue, __ΩGeneratorConfig, __ΩGetSchemaOptions, __ΩGetSchemaResponse, __ΩMultipleSchemas, __ΩPrismaPluginContext, __ΩPrismaPluginOptions, __ΩPrismaPluginResolvedConfig, __ΩPrismaPluginUserConfig, __ΩPrismaPostgresPrismaPluginOptions, __ΩPrismaSchema, __ΩSchemaFileInput };
@@ -0,0 +1,3 @@
1
+ import { ActiveConnectorType, BinaryTargetsEnvValue, ConnectorType, DataSource, EnvPaths, EnvValue, GeneratorConfig, GetSchemaOptions, GetSchemaResponse, MultipleSchemas, PrismaSchema, SchemaFileInput, __ΩActiveConnectorType, __ΩBinaryTargetsEnvValue, __ΩConnectorType, __ΩDataSource, __ΩEnvPaths, __ΩEnvValue, __ΩGeneratorConfig, __ΩGetSchemaOptions, __ΩGetSchemaResponse, __ΩMultipleSchemas, __ΩPrismaSchema, __ΩSchemaFileInput } from "./prisma.mjs";
2
+ import { PrismaPluginContext, PrismaPluginOptions, PrismaPluginResolvedConfig, PrismaPluginUserConfig, PrismaPostgresPrismaPluginOptions, __ΩPrismaPluginContext, __ΩPrismaPluginOptions, __ΩPrismaPluginResolvedConfig, __ΩPrismaPluginUserConfig, __ΩPrismaPostgresPrismaPluginOptions } from "./plugin.mjs";
3
+ export { ActiveConnectorType, BinaryTargetsEnvValue, ConnectorType, DataSource, EnvPaths, EnvValue, GeneratorConfig, GetSchemaOptions, GetSchemaResponse, MultipleSchemas, PrismaPluginContext, PrismaPluginOptions, PrismaPluginResolvedConfig, PrismaPluginUserConfig, PrismaPostgresPrismaPluginOptions, PrismaSchema, SchemaFileInput, __ΩActiveConnectorType, __ΩBinaryTargetsEnvValue, __ΩConnectorType, __ΩDataSource, __ΩEnvPaths, __ΩEnvValue, __ΩGeneratorConfig, __ΩGetSchemaOptions, __ΩGetSchemaResponse, __ΩMultipleSchemas, __ΩPrismaPluginContext, __ΩPrismaPluginOptions, __ΩPrismaPluginResolvedConfig, __ΩPrismaPluginUserConfig, __ΩPrismaPostgresPrismaPluginOptions, __ΩPrismaSchema, __ΩSchemaFileInput };
@@ -0,0 +1,91 @@
1
+ import { PrismaClient } from "../api/sdk.gen.cjs";
2
+ import { PrismaSchema } from "./prisma.cjs";
3
+ import { PrismaSchemaCreator } from "../helpers/schema-creator.cjs";
4
+ import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
5
+
6
+ //#region src/types/plugin.d.ts
7
+ interface PrismaPostgresPrismaPluginOptions {
8
+ /**
9
+ * The Prisma project name
10
+ *
11
+ * @defaultValue "\{name\}"
12
+ */
13
+ projectId?: string;
14
+ /**
15
+ * The region to deploy the database to
16
+ *
17
+ * @defaultValue "us-east-1"
18
+ */
19
+ region?: "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2" | "af-south-1" | "ap-east-1" | "ap-south-1" | "ap-south-2" | "ap-southeast-1" | "ap-southeast-2" | "ap-southeast-3" | "ap-southeast-4" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ca-central-1" | "ca-west-1" | "eu-central-1" | "eu-central-2" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-north-1" | "eu-south-1" | "eu-south-2" | "il-central-1" | "me-south-1" | "me-central-1" | "sa-east-1";
20
+ /**
21
+ * The database name
22
+ *
23
+ * @defaultValue "\{region\}.\{mode\}.\{name\}"
24
+ */
25
+ databaseName?: string;
26
+ }
27
+ interface PrismaPluginOptions {
28
+ /**
29
+ * The path to the Prisma schema file (PSL).
30
+ *
31
+ * @defaultValue "\{projectRoot\}/prisma/schema.prisma"
32
+ */
33
+ schema?: string;
34
+ /**
35
+ * The path to a custom Prisma configuration file.
36
+ *
37
+ * @remarks
38
+ * This field allows the use of the "\{projectRoot\}" token to refer to the project's root directory - the value will be replaced with the correct file path by the plugin.
39
+ *
40
+ * @defaultValue "\{projectRoot\}/prisma.config.ts"
41
+ */
42
+ configFile?: string;
43
+ /**
44
+ * The path to the output file generated by the plugin.
45
+ *
46
+ * @remarks
47
+ * If using the default value, the file can be imported from "powerlines:prisma/module-name". This field allows the use of the "\{builtinPath\}" token to refer to the built-in Powerlines plugins directory - the value will be replaced with the correct file path by the plugin.
48
+ *
49
+ * @defaultValue "\{builtinPath\}/prisma"
50
+ */
51
+ outputPath?: string;
52
+ /**
53
+ * Additional parameters to pass to the Prisma CLI
54
+ */
55
+ params?: string;
56
+ /**
57
+ * The path to the Prisma binary
58
+ */
59
+ prismaPath?: string;
60
+ /**
61
+ * The service token to use for the Prisma API
62
+ */
63
+ serviceToken?: string;
64
+ /**
65
+ * Configuration parameters to manage a Prisma Postgres database
66
+ */
67
+ prismaPostgres?: PrismaPostgresPrismaPluginOptions | true;
68
+ }
69
+ type PrismaPluginUserConfig = UserConfig & {
70
+ prisma?: Omit<PrismaPluginOptions, "schema" | "outputPath" | "configFile"> & Required<Pick<PrismaPluginOptions, "schema" | "outputPath" | "configFile">>;
71
+ };
72
+ type PrismaPluginResolvedConfig = ResolvedConfig & {
73
+ prisma: Omit<PrismaPluginOptions, "schema" | "outputPath" | "configFile" | "prismaPostgres"> & Required<Pick<PrismaPluginOptions, "schema" | "outputPath" | "configFile">> & {
74
+ prismaPostgres?: Required<PrismaPostgresPrismaPluginOptions>;
75
+ };
76
+ };
77
+ type PrismaPluginContext<TResolvedConfig extends PrismaPluginResolvedConfig = PrismaPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
78
+ prisma: {
79
+ schema: PrismaSchema;
80
+ builder: PrismaSchemaCreator;
81
+ api: PrismaClient;
82
+ };
83
+ };
84
+ declare type __ΩPrismaPostgresPrismaPluginOptions = any[];
85
+ declare type __ΩPrismaPluginOptions = any[];
86
+ declare type __ΩPrismaPluginUserConfig = any[];
87
+ declare type __ΩPrismaPluginResolvedConfig = any[];
88
+ declare type __ΩPrismaPluginContext = any[];
89
+ //#endregion
90
+ export { PrismaPluginContext, PrismaPluginOptions, PrismaPluginResolvedConfig, PrismaPluginUserConfig, PrismaPostgresPrismaPluginOptions, __ΩPrismaPluginContext, __ΩPrismaPluginOptions, __ΩPrismaPluginResolvedConfig, __ΩPrismaPluginUserConfig, __ΩPrismaPostgresPrismaPluginOptions };
91
+ //# sourceMappingURL=plugin.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;UAuBiB,iCAAA;;AAAjB;AAoDA;AAiDA;;EACgB,SAAA,CAAA,EAAA,MAAA;EAAL;;;;;EAIC,MAAA,CAAA,EAAA,WAAA,GAAA,WAA0B,GAAA,WAAA,GAAA,WAAA,GAAA,YAAA,GAAA,WAAA,GAAA,YAAA,GAAA,YAAA,GAAA,gBAAA,GAAA,gBAAA,GAAA,gBAAA,GAAA,gBAAA,GAAA,gBAAA,GAAA,gBAAA,GAAA,gBAAA,GAAA,cAAA,GAAA,WAAA,GAAA,cAAA,GAAA,cAAA,GAAA,WAAA,GAAA,WAAA,GAAA,WAAA,GAAA,YAAA,GAAA,YAAA,GAAA,YAAA,GAAA,cAAA,GAAA,YAAA,GAAA,cAAA,GAAA,WAAA;EAAG;;;;;EAKrC,YAAA,CAAA,EAAA,MAAA;;AAGmB,UA9DN,mBAAA,CA8DM;EAAQ;AAI/B;;;;EAGI,MAAA,CAAA,EAAA,MAAA;EAEQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAzBO;;KAGP,sBAAA,GAAyB;WAC1B,KAAK,+DACZ,SAAS,KAAK;;KAGN,0BAAA,GAA6B;UAC/B,KACN,kFAGA,SACE,KAAK;qBAEY,SAAS;;;KAIpB,4CACc,6BACtB,8BACA,cAAc;;YAEN;aACC;SACJ"}
@@ -0,0 +1,91 @@
1
+ import { PrismaClient } from "../api/sdk.gen.mjs";
2
+ import { PrismaSchema } from "./prisma.mjs";
3
+ import { PrismaSchemaCreator } from "../helpers/schema-creator.mjs";
4
+ import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
5
+
6
+ //#region src/types/plugin.d.ts
7
+ interface PrismaPostgresPrismaPluginOptions {
8
+ /**
9
+ * The Prisma project name
10
+ *
11
+ * @defaultValue "\{name\}"
12
+ */
13
+ projectId?: string;
14
+ /**
15
+ * The region to deploy the database to
16
+ *
17
+ * @defaultValue "us-east-1"
18
+ */
19
+ region?: "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2" | "af-south-1" | "ap-east-1" | "ap-south-1" | "ap-south-2" | "ap-southeast-1" | "ap-southeast-2" | "ap-southeast-3" | "ap-southeast-4" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ca-central-1" | "ca-west-1" | "eu-central-1" | "eu-central-2" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-north-1" | "eu-south-1" | "eu-south-2" | "il-central-1" | "me-south-1" | "me-central-1" | "sa-east-1";
20
+ /**
21
+ * The database name
22
+ *
23
+ * @defaultValue "\{region\}.\{mode\}.\{name\}"
24
+ */
25
+ databaseName?: string;
26
+ }
27
+ interface PrismaPluginOptions {
28
+ /**
29
+ * The path to the Prisma schema file (PSL).
30
+ *
31
+ * @defaultValue "\{projectRoot\}/prisma/schema.prisma"
32
+ */
33
+ schema?: string;
34
+ /**
35
+ * The path to a custom Prisma configuration file.
36
+ *
37
+ * @remarks
38
+ * This field allows the use of the "\{projectRoot\}" token to refer to the project's root directory - the value will be replaced with the correct file path by the plugin.
39
+ *
40
+ * @defaultValue "\{projectRoot\}/prisma.config.ts"
41
+ */
42
+ configFile?: string;
43
+ /**
44
+ * The path to the output file generated by the plugin.
45
+ *
46
+ * @remarks
47
+ * If using the default value, the file can be imported from "powerlines:prisma/module-name". This field allows the use of the "\{builtinPath\}" token to refer to the built-in Powerlines plugins directory - the value will be replaced with the correct file path by the plugin.
48
+ *
49
+ * @defaultValue "\{builtinPath\}/prisma"
50
+ */
51
+ outputPath?: string;
52
+ /**
53
+ * Additional parameters to pass to the Prisma CLI
54
+ */
55
+ params?: string;
56
+ /**
57
+ * The path to the Prisma binary
58
+ */
59
+ prismaPath?: string;
60
+ /**
61
+ * The service token to use for the Prisma API
62
+ */
63
+ serviceToken?: string;
64
+ /**
65
+ * Configuration parameters to manage a Prisma Postgres database
66
+ */
67
+ prismaPostgres?: PrismaPostgresPrismaPluginOptions | true;
68
+ }
69
+ type PrismaPluginUserConfig = UserConfig & {
70
+ prisma?: Omit<PrismaPluginOptions, "schema" | "outputPath" | "configFile"> & Required<Pick<PrismaPluginOptions, "schema" | "outputPath" | "configFile">>;
71
+ };
72
+ type PrismaPluginResolvedConfig = ResolvedConfig & {
73
+ prisma: Omit<PrismaPluginOptions, "schema" | "outputPath" | "configFile" | "prismaPostgres"> & Required<Pick<PrismaPluginOptions, "schema" | "outputPath" | "configFile">> & {
74
+ prismaPostgres?: Required<PrismaPostgresPrismaPluginOptions>;
75
+ };
76
+ };
77
+ type PrismaPluginContext<TResolvedConfig extends PrismaPluginResolvedConfig = PrismaPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
78
+ prisma: {
79
+ schema: PrismaSchema;
80
+ builder: PrismaSchemaCreator;
81
+ api: PrismaClient;
82
+ };
83
+ };
84
+ declare type __ΩPrismaPostgresPrismaPluginOptions = any[];
85
+ declare type __ΩPrismaPluginOptions = any[];
86
+ declare type __ΩPrismaPluginUserConfig = any[];
87
+ declare type __ΩPrismaPluginResolvedConfig = any[];
88
+ declare type __ΩPrismaPluginContext = any[];
89
+ //#endregion
90
+ export { PrismaPluginContext, PrismaPluginOptions, PrismaPluginResolvedConfig, PrismaPluginUserConfig, PrismaPostgresPrismaPluginOptions, __ΩPrismaPluginContext, __ΩPrismaPluginOptions, __ΩPrismaPluginResolvedConfig, __ΩPrismaPluginUserConfig, __ΩPrismaPostgresPrismaPluginOptions };
91
+ //# sourceMappingURL=plugin.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;UAuBiB,iCAAA;;AAAjB;AAoDA;AAiDA;;EACgB,SAAA,CAAA,EAAA,MAAA;EAAL;;;;;EAIC,MAAA,CAAA,EAAA,WAAA,GAAA,WAA0B,GAAA,WAAA,GAAA,WAAA,GAAA,YAAA,GAAA,WAAA,GAAA,YAAA,GAAA,YAAA,GAAA,gBAAA,GAAA,gBAAA,GAAA,gBAAA,GAAA,gBAAA,GAAA,gBAAA,GAAA,gBAAA,GAAA,gBAAA,GAAA,cAAA,GAAA,WAAA,GAAA,cAAA,GAAA,cAAA,GAAA,WAAA,GAAA,WAAA,GAAA,WAAA,GAAA,YAAA,GAAA,YAAA,GAAA,YAAA,GAAA,cAAA,GAAA,YAAA,GAAA,cAAA,GAAA,WAAA;EAAG;;;;;EAKrC,YAAA,CAAA,EAAA,MAAA;;AAGmB,UA9DN,mBAAA,CA8DM;EAAQ;AAI/B;;;;EAGI,MAAA,CAAA,EAAA,MAAA;EAEQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAzBO;;KAGP,sBAAA,GAAyB;WAC1B,KAAK,+DACZ,SAAS,KAAK;;KAGN,0BAAA,GAA6B;UAC/B,KACN,kFAGA,SACE,KAAK;qBAEY,SAAS;;;KAIpB,4CACc,6BACtB,8BACA,cAAc;;YAEN;aACC;SACJ"}
@@ -0,0 +1,85 @@
1
+ //#region src/types/prisma.d.ts
2
+ type MultipleSchemas = Array<[filename: string, content: string]>;
3
+ type SchemaFileInput = string | [filename: string, content: string];
4
+ type ConnectorType = "mysql" | "mongodb" | "sqlite" | "postgresql" | "postgres" | "prisma+postgres" | "sqlserver" | "cockroachdb";
5
+ type ActiveConnectorType = Exclude<ConnectorType, "postgres" | "prisma+postgres">;
6
+ interface EnvValue {
7
+ fromEnvVar: null | string;
8
+ value: null | string;
9
+ }
10
+ interface DataSource {
11
+ name: string;
12
+ provider: ConnectorType;
13
+ activeProvider: ActiveConnectorType;
14
+ url: EnvValue;
15
+ directUrl?: EnvValue;
16
+ schemas: string[] | [];
17
+ sourceFilePath: string;
18
+ }
19
+ interface GetSchemaResponse {
20
+ config: PrismaSchema;
21
+ errors: GetSchemaValidationError[];
22
+ }
23
+ interface EnvValue {
24
+ fromEnvVar: null | string;
25
+ value: null | string;
26
+ }
27
+ interface EnvPaths {
28
+ rootEnvPath: string | null;
29
+ schemaEnvPath: string | undefined;
30
+ }
31
+ interface BinaryTargetsEnvValue {
32
+ fromEnvVar: string | null;
33
+ value: string;
34
+ native?: boolean;
35
+ }
36
+ interface GeneratorConfig {
37
+ name: string;
38
+ output: EnvValue | null;
39
+ isCustomOutput?: boolean;
40
+ provider: EnvValue;
41
+ config: {
42
+ /** `output` is a reserved name and will only be available directly at `generator.output` */
43
+ output?: never;
44
+ /** `provider` is a reserved name and will only be available directly at `generator.provider` */
45
+ provider?: never;
46
+ /** `binaryTargets` is a reserved name and will only be available directly at `generator.binaryTargets` */
47
+ binaryTargets?: never;
48
+ /** `previewFeatures` is a reserved name and will only be available directly at `generator.previewFeatures` */
49
+ previewFeatures?: never;
50
+ } & {
51
+ [key: string]: string | string[] | undefined;
52
+ };
53
+ binaryTargets: BinaryTargetsEnvValue[];
54
+ previewFeatures: string[];
55
+ envPaths?: EnvPaths;
56
+ sourceFilePath: string;
57
+ }
58
+ interface PrismaSchema {
59
+ datasources: DataSource[];
60
+ generators: GeneratorConfig[];
61
+ warnings: string[];
62
+ }
63
+ interface GetSchemaValidationError {
64
+ fileName: string | null;
65
+ message: string;
66
+ }
67
+ interface GetSchemaOptions {
68
+ datamodel: SchemaFileInput;
69
+ ignoreEnvVarErrors?: boolean;
70
+ }
71
+ declare type __ΩMultipleSchemas = any[];
72
+ declare type __ΩSchemaFileInput = any[];
73
+ declare type __ΩConnectorType = any[];
74
+ declare type __ΩActiveConnectorType = any[];
75
+ declare type __ΩEnvValue = any[];
76
+ declare type __ΩDataSource = any[];
77
+ declare type __ΩGetSchemaResponse = any[];
78
+ declare type __ΩEnvPaths = any[];
79
+ declare type __ΩBinaryTargetsEnvValue = any[];
80
+ declare type __ΩGeneratorConfig = any[];
81
+ declare type __ΩPrismaSchema = any[];
82
+ declare type __ΩGetSchemaOptions = any[];
83
+ //#endregion
84
+ export { ActiveConnectorType, BinaryTargetsEnvValue, ConnectorType, DataSource, EnvPaths, EnvValue, GeneratorConfig, GetSchemaOptions, GetSchemaResponse, MultipleSchemas, PrismaSchema, SchemaFileInput, __ΩActiveConnectorType, __ΩBinaryTargetsEnvValue, __ΩConnectorType, __ΩDataSource, __ΩEnvPaths, __ΩEnvValue, __ΩGeneratorConfig, __ΩGetSchemaOptions, __ΩGetSchemaResponse, __ΩMultipleSchemas, __ΩPrismaSchema, __ΩSchemaFileInput };
85
+ //# sourceMappingURL=prisma.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prisma.d.cts","names":[],"sources":["../../src/types/prisma.ts"],"sourcesContent":[],"mappings":";KAkBY,eAAA,GAAkB;AAAlB,KACA,eAAA,GADe,MAAG,GAAK,CAAA,QAAA,EAAA,MAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AACvB,KAEA,aAAA,GAFe,OAAA,GAAA,SAAA,GAAA,QAAA,GAAA,YAAA,GAAA,UAAA,GAAA,iBAAA,GAAA,WAAA,GAAA,aAAA;AAEf,KAUA,mBAAA,GAAsB,OAVT,CAWvB,aAXuB,EAAA,UAAA,GAAA,iBAAA,CAAA;AAUb,UAKK,QAAA,CALc;EAKd,UAAA,EAAQ,IAAA,GAAA,MAAA;EAKR,KAAA,EAAA,IAAA,GAAU,MAAA;;AAIT,UAJD,UAAA,CAIC;EACX,IAAA,EAAA,MAAA;EACO,QAAA,EAJF,aAIE;EAAQ,cAAA,EAFJ,mBAEI;EAKL,GAAA,EANV,QAMU;EAKA,SAAA,CAAA,EAVH,QAUW;EAKR,OAAA,EAAA,MAAQ,EAAA,GAAA,EAAA;EAKR,cAAA,EAAA,MAAA;AAMjB;AAEU,UAvBO,iBAAA,CAuBP;EAEE,MAAA,EAxBF,YAwBE;EAaK,MAAA,EApCP,wBAoCO,EAAA;;AAEI,UAnCJ,QAAA,CAmCI;EAIJ,UAAA,EAAA,IAAY,GAAA,MAAA;EAMnB,KAAA,EAAA,IAAA,GAAA,MAAA;AAKV;UA7CiB,QAAA;;;;UAKA,qBAAA;;;;;UAMA,eAAA;;UAEP;;YAEE;;;;;;;;;;;;;iBAaK;;aAEJ;;;UAII,YAAA;eACF;cACD;;;UAIJ,wBAAA;;;;UAKO,gBAAA;aACJ"}
@@ -0,0 +1,85 @@
1
+ //#region src/types/prisma.d.ts
2
+ type MultipleSchemas = Array<[filename: string, content: string]>;
3
+ type SchemaFileInput = string | [filename: string, content: string];
4
+ type ConnectorType = "mysql" | "mongodb" | "sqlite" | "postgresql" | "postgres" | "prisma+postgres" | "sqlserver" | "cockroachdb";
5
+ type ActiveConnectorType = Exclude<ConnectorType, "postgres" | "prisma+postgres">;
6
+ interface EnvValue {
7
+ fromEnvVar: null | string;
8
+ value: null | string;
9
+ }
10
+ interface DataSource {
11
+ name: string;
12
+ provider: ConnectorType;
13
+ activeProvider: ActiveConnectorType;
14
+ url: EnvValue;
15
+ directUrl?: EnvValue;
16
+ schemas: string[] | [];
17
+ sourceFilePath: string;
18
+ }
19
+ interface GetSchemaResponse {
20
+ config: PrismaSchema;
21
+ errors: GetSchemaValidationError[];
22
+ }
23
+ interface EnvValue {
24
+ fromEnvVar: null | string;
25
+ value: null | string;
26
+ }
27
+ interface EnvPaths {
28
+ rootEnvPath: string | null;
29
+ schemaEnvPath: string | undefined;
30
+ }
31
+ interface BinaryTargetsEnvValue {
32
+ fromEnvVar: string | null;
33
+ value: string;
34
+ native?: boolean;
35
+ }
36
+ interface GeneratorConfig {
37
+ name: string;
38
+ output: EnvValue | null;
39
+ isCustomOutput?: boolean;
40
+ provider: EnvValue;
41
+ config: {
42
+ /** `output` is a reserved name and will only be available directly at `generator.output` */
43
+ output?: never;
44
+ /** `provider` is a reserved name and will only be available directly at `generator.provider` */
45
+ provider?: never;
46
+ /** `binaryTargets` is a reserved name and will only be available directly at `generator.binaryTargets` */
47
+ binaryTargets?: never;
48
+ /** `previewFeatures` is a reserved name and will only be available directly at `generator.previewFeatures` */
49
+ previewFeatures?: never;
50
+ } & {
51
+ [key: string]: string | string[] | undefined;
52
+ };
53
+ binaryTargets: BinaryTargetsEnvValue[];
54
+ previewFeatures: string[];
55
+ envPaths?: EnvPaths;
56
+ sourceFilePath: string;
57
+ }
58
+ interface PrismaSchema {
59
+ datasources: DataSource[];
60
+ generators: GeneratorConfig[];
61
+ warnings: string[];
62
+ }
63
+ interface GetSchemaValidationError {
64
+ fileName: string | null;
65
+ message: string;
66
+ }
67
+ interface GetSchemaOptions {
68
+ datamodel: SchemaFileInput;
69
+ ignoreEnvVarErrors?: boolean;
70
+ }
71
+ declare type __ΩMultipleSchemas = any[];
72
+ declare type __ΩSchemaFileInput = any[];
73
+ declare type __ΩConnectorType = any[];
74
+ declare type __ΩActiveConnectorType = any[];
75
+ declare type __ΩEnvValue = any[];
76
+ declare type __ΩDataSource = any[];
77
+ declare type __ΩGetSchemaResponse = any[];
78
+ declare type __ΩEnvPaths = any[];
79
+ declare type __ΩBinaryTargetsEnvValue = any[];
80
+ declare type __ΩGeneratorConfig = any[];
81
+ declare type __ΩPrismaSchema = any[];
82
+ declare type __ΩGetSchemaOptions = any[];
83
+ //#endregion
84
+ export { ActiveConnectorType, BinaryTargetsEnvValue, ConnectorType, DataSource, EnvPaths, EnvValue, GeneratorConfig, GetSchemaOptions, GetSchemaResponse, MultipleSchemas, PrismaSchema, SchemaFileInput, __ΩActiveConnectorType, __ΩBinaryTargetsEnvValue, __ΩConnectorType, __ΩDataSource, __ΩEnvPaths, __ΩEnvValue, __ΩGeneratorConfig, __ΩGetSchemaOptions, __ΩGetSchemaResponse, __ΩMultipleSchemas, __ΩPrismaSchema, __ΩSchemaFileInput };
85
+ //# sourceMappingURL=prisma.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prisma.d.mts","names":[],"sources":["../../src/types/prisma.ts"],"sourcesContent":[],"mappings":";KAkBY,eAAA,GAAkB;AAAlB,KACA,eAAA,GADe,MAAG,GAAK,CAAA,QAAA,EAAA,MAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AACvB,KAEA,aAAA,GAFe,OAAA,GAAA,SAAA,GAAA,QAAA,GAAA,YAAA,GAAA,UAAA,GAAA,iBAAA,GAAA,WAAA,GAAA,aAAA;AAEf,KAUA,mBAAA,GAAsB,OAVT,CAWvB,aAXuB,EAAA,UAAA,GAAA,iBAAA,CAAA;AAUb,UAKK,QAAA,CALc;EAKd,UAAA,EAAQ,IAAA,GAAA,MAAA;EAKR,KAAA,EAAA,IAAA,GAAU,MAAA;;AAIT,UAJD,UAAA,CAIC;EACX,IAAA,EAAA,MAAA;EACO,QAAA,EAJF,aAIE;EAAQ,cAAA,EAFJ,mBAEI;EAKL,GAAA,EANV,QAMU;EAKA,SAAA,CAAA,EAVH,QAUW;EAKR,OAAA,EAAA,MAAQ,EAAA,GAAA,EAAA;EAKR,cAAA,EAAA,MAAA;AAMjB;AAEU,UAvBO,iBAAA,CAuBP;EAEE,MAAA,EAxBF,YAwBE;EAaK,MAAA,EApCP,wBAoCO,EAAA;;AAEI,UAnCJ,QAAA,CAmCI;EAIJ,UAAA,EAAA,IAAY,GAAA,MAAA;EAMnB,KAAA,EAAA,IAAA,GAAA,MAAA;AAKV;UA7CiB,QAAA;;;;UAKA,qBAAA;;;;;UAMA,eAAA;;UAEP;;YAEE;;;;;;;;;;;;;iBAaK;;aAEJ;;;UAII,YAAA;eACF;cACD;;;UAIJ,wBAAA;;;;UAKO,gBAAA;aACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-prisma",
3
- "version": "0.2.244",
3
+ "version": "0.2.245",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to generate project code and a Prisma client from a Prisma schema (PSL).",
6
6
  "repository": {
@@ -55,6 +55,7 @@
55
55
  "default": "./dist/index.mjs"
56
56
  }
57
57
  },
58
+ "./*": "./*",
58
59
  "./api/client": {
59
60
  "require": {
60
61
  "types": "./dist/api/client/index.d.cts",
@@ -321,7 +322,6 @@
321
322
  "default": "./dist/helpers/schema-creator.mjs"
322
323
  }
323
324
  },
324
- "./package.json": "./package.json",
325
325
  "./types": {
326
326
  "require": {
327
327
  "types": "./dist/types/index.d.cts",
@@ -379,15 +379,16 @@
379
379
  "defu": "^6.1.4",
380
380
  "fp-ts": "^2.16.11",
381
381
  "jiti": "^2.6.1",
382
- "powerlines": "^0.38.57",
382
+ "powerlines": "^0.39.0",
383
383
  "prisma-util": "^2.1.1",
384
384
  "ts-pattern": "^5.9.0"
385
385
  },
386
386
  "devDependencies": {
387
- "@powerlines/plugin-hey-api": "^0.1.244",
388
- "@powerlines/plugin-plugin": "^0.12.241",
389
- "@types/node": "^25.3.1"
387
+ "@powerlines/plugin-hey-api": "^0.1.245",
388
+ "@powerlines/plugin-plugin": "^0.12.242",
389
+ "@types/node": "^25.3.2"
390
390
  },
391
391
  "publishConfig": { "access": "public" },
392
- "gitHead": "eb3dbd19bd153aa5a988bce09a1cf05d985cb04b"
392
+ "types": "./dist/index.d.cts",
393
+ "gitHead": "0dcb16f054b8a69915b074578e6d4dfa3ecc1529"
393
394
  }