@stryke/prisma-trpc-generator 0.9.1 → 0.9.3

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.
@@ -6874,15 +6874,16 @@ var ModelAction = /* @__PURE__ */ function(ModelAction2) {
6874
6874
  return ModelAction2;
6875
6875
  }(ModelAction || {});
6876
6876
  var modelActionEnum = z.nativeEnum(ModelAction);
6877
+ var configBoolean = z.string().trim().transform((value) => !value || value.toLowerCase() === "false" || value.toLowerCase() === "n" || value.toLowerCase() === "no" || value === "0" ? false : value.toLowerCase() === "true" || value.toLowerCase() === "y" || value.toLowerCase() === "yes" || value === "1" ? true : value);
6877
6878
  var configSchema = z.object({
6878
- debug: z.coerce.boolean().or(z.string()).default(false),
6879
- withMiddleware: z.coerce.boolean().or(z.string()).default(false),
6880
- withShield: z.coerce.boolean().or(z.string()).default(true),
6881
- withZod: z.coerce.boolean().or(z.string()).default(true),
6882
- withNext: z.coerce.boolean().or(z.string()).default(true),
6883
- contextPath: z.string().default("../context"),
6884
- trpcOptions: z.coerce.boolean().or(z.string()).default(true),
6885
- showModelNameInProcedure: z.coerce.boolean().or(z.string()).default(true),
6879
+ debug: configBoolean.default("false"),
6880
+ withMiddleware: configBoolean.default("false"),
6881
+ withShield: configBoolean.default("true"),
6882
+ withZod: configBoolean.default("true"),
6883
+ withNext: configBoolean.default("true"),
6884
+ contextPath: z.string().trim().default("../context"),
6885
+ trpcOptions: configBoolean.default("true"),
6886
+ showModelNameInProcedure: configBoolean.default("true"),
6886
6887
  generateModelActions: z.string().default(Object.values(ModelAction).join(",")).transform((arg) => {
6887
6888
  return arg.split(",").map((action) => modelActionEnum.parse(action.trim()));
6888
6889
  })
@@ -11532,7 +11533,7 @@ async function generate(options) {
11532
11533
  console.log(`[STORM]: Validating configuration options
11533
11534
  `);
11534
11535
  const outputDir = internals.parseEnvValue(options.generator.output);
11535
- const results = configSchema.safeParse(options.generator.config);
11536
+ const results = await configSchema.safeParseAsync(options.generator.config);
11536
11537
  if (!results.success) {
11537
11538
  throw new Error("Invalid options passed");
11538
11539
  }
package/dist/generator.js CHANGED
@@ -6879,15 +6879,16 @@ var ModelAction = /* @__PURE__ */ function(ModelAction2) {
6879
6879
  return ModelAction2;
6880
6880
  }(ModelAction || {});
6881
6881
  var modelActionEnum = z.nativeEnum(ModelAction);
6882
+ var configBoolean = z.string().trim().transform((value) => !value || value.toLowerCase() === "false" || value.toLowerCase() === "n" || value.toLowerCase() === "no" || value === "0" ? false : value.toLowerCase() === "true" || value.toLowerCase() === "y" || value.toLowerCase() === "yes" || value === "1" ? true : value);
6882
6883
  var configSchema = z.object({
6883
- debug: z.coerce.boolean().or(z.string()).default(false),
6884
- withMiddleware: z.coerce.boolean().or(z.string()).default(false),
6885
- withShield: z.coerce.boolean().or(z.string()).default(true),
6886
- withZod: z.coerce.boolean().or(z.string()).default(true),
6887
- withNext: z.coerce.boolean().or(z.string()).default(true),
6888
- contextPath: z.string().default("../context"),
6889
- trpcOptions: z.coerce.boolean().or(z.string()).default(true),
6890
- showModelNameInProcedure: z.coerce.boolean().or(z.string()).default(true),
6884
+ debug: configBoolean.default("false"),
6885
+ withMiddleware: configBoolean.default("false"),
6886
+ withShield: configBoolean.default("true"),
6887
+ withZod: configBoolean.default("true"),
6888
+ withNext: configBoolean.default("true"),
6889
+ contextPath: z.string().trim().default("../context"),
6890
+ trpcOptions: configBoolean.default("true"),
6891
+ showModelNameInProcedure: configBoolean.default("true"),
6891
6892
  generateModelActions: z.string().default(Object.values(ModelAction).join(",")).transform((arg) => {
6892
6893
  return arg.split(",").map((action) => modelActionEnum.parse(action.trim()));
6893
6894
  })
@@ -11537,7 +11538,7 @@ async function generate(options) {
11537
11538
  console.log(`[STORM]: Validating configuration options
11538
11539
  `);
11539
11540
  const outputDir = internals.parseEnvValue(options.generator.output);
11540
- const results = configSchema.safeParse(options.generator.config);
11541
+ const results = await configSchema.safeParseAsync(options.generator.config);
11541
11542
  if (!results.success) {
11542
11543
  throw new Error("Invalid options passed");
11543
11544
  }
package/dist/index.cjs CHANGED
@@ -6870,15 +6870,16 @@ var ModelAction = /* @__PURE__ */ function(ModelAction2) {
6870
6870
  return ModelAction2;
6871
6871
  }(ModelAction || {});
6872
6872
  var modelActionEnum = z.nativeEnum(ModelAction);
6873
+ var configBoolean = z.string().trim().transform((value) => !value || value.toLowerCase() === "false" || value.toLowerCase() === "n" || value.toLowerCase() === "no" || value === "0" ? false : value.toLowerCase() === "true" || value.toLowerCase() === "y" || value.toLowerCase() === "yes" || value === "1" ? true : value);
6873
6874
  var configSchema = z.object({
6874
- debug: z.coerce.boolean().or(z.string()).default(false),
6875
- withMiddleware: z.coerce.boolean().or(z.string()).default(false),
6876
- withShield: z.coerce.boolean().or(z.string()).default(true),
6877
- withZod: z.coerce.boolean().or(z.string()).default(true),
6878
- withNext: z.coerce.boolean().or(z.string()).default(true),
6879
- contextPath: z.string().default("../context"),
6880
- trpcOptions: z.coerce.boolean().or(z.string()).default(true),
6881
- showModelNameInProcedure: z.coerce.boolean().or(z.string()).default(true),
6875
+ debug: configBoolean.default("false"),
6876
+ withMiddleware: configBoolean.default("false"),
6877
+ withShield: configBoolean.default("true"),
6878
+ withZod: configBoolean.default("true"),
6879
+ withNext: configBoolean.default("true"),
6880
+ contextPath: z.string().trim().default("../context"),
6881
+ trpcOptions: configBoolean.default("true"),
6882
+ showModelNameInProcedure: configBoolean.default("true"),
6882
6883
  generateModelActions: z.string().default(Object.values(ModelAction).join(",")).transform((arg) => {
6883
6884
  return arg.split(",").map((action) => modelActionEnum.parse(action.trim()));
6884
6885
  })
@@ -11528,7 +11529,7 @@ async function generate(options) {
11528
11529
  console.log(`[STORM]: Validating configuration options
11529
11530
  `);
11530
11531
  const outputDir = internals.parseEnvValue(options.generator.output);
11531
- const results = configSchema.safeParse(options.generator.config);
11532
+ const results = await configSchema.safeParseAsync(options.generator.config);
11532
11533
  if (!results.success) {
11533
11534
  throw new Error("Invalid options passed");
11534
11535
  }
package/dist/index.js CHANGED
@@ -6875,15 +6875,16 @@ var ModelAction = /* @__PURE__ */ function(ModelAction2) {
6875
6875
  return ModelAction2;
6876
6876
  }(ModelAction || {});
6877
6877
  var modelActionEnum = z.nativeEnum(ModelAction);
6878
+ var configBoolean = z.string().trim().transform((value) => !value || value.toLowerCase() === "false" || value.toLowerCase() === "n" || value.toLowerCase() === "no" || value === "0" ? false : value.toLowerCase() === "true" || value.toLowerCase() === "y" || value.toLowerCase() === "yes" || value === "1" ? true : value);
6878
6879
  var configSchema = z.object({
6879
- debug: z.coerce.boolean().or(z.string()).default(false),
6880
- withMiddleware: z.coerce.boolean().or(z.string()).default(false),
6881
- withShield: z.coerce.boolean().or(z.string()).default(true),
6882
- withZod: z.coerce.boolean().or(z.string()).default(true),
6883
- withNext: z.coerce.boolean().or(z.string()).default(true),
6884
- contextPath: z.string().default("../context"),
6885
- trpcOptions: z.coerce.boolean().or(z.string()).default(true),
6886
- showModelNameInProcedure: z.coerce.boolean().or(z.string()).default(true),
6880
+ debug: configBoolean.default("false"),
6881
+ withMiddleware: configBoolean.default("false"),
6882
+ withShield: configBoolean.default("true"),
6883
+ withZod: configBoolean.default("true"),
6884
+ withNext: configBoolean.default("true"),
6885
+ contextPath: z.string().trim().default("../context"),
6886
+ trpcOptions: configBoolean.default("true"),
6887
+ showModelNameInProcedure: configBoolean.default("true"),
6887
6888
  generateModelActions: z.string().default(Object.values(ModelAction).join(",")).transform((arg) => {
6888
6889
  return arg.split(",").map((action) => modelActionEnum.parse(action.trim()));
6889
6890
  })
@@ -11533,7 +11534,7 @@ async function generate(options) {
11533
11534
  console.log(`[STORM]: Validating configuration options
11534
11535
  `);
11535
11536
  const outputDir = internals.parseEnvValue(options.generator.output);
11536
- const results = configSchema.safeParse(options.generator.config);
11537
+ const results = await configSchema.safeParseAsync(options.generator.config);
11537
11538
  if (!results.success) {
11538
11539
  throw new Error("Invalid options passed");
11539
11540
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/prisma-trpc-generator",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "type": "module",
5
5
  "description": "A fork of the prisma-trpc-generator code to work in ESM with Prisma v6.",
6
6
  "repository": {