@stryke/prisma-trpc-generator 0.4.5 → 0.4.6
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/generator.cjs +7 -7
- package/dist/generator.js +7 -7
- package/dist/index.cjs +7 -7
- package/dist/index.js +7 -7
- package/package.json +1 -1
package/dist/generator.cjs
CHANGED
|
@@ -6853,10 +6853,8 @@ var ModelAction = /* @__PURE__ */ function(ModelAction2) {
|
|
|
6853
6853
|
ModelAction2["findMany"] = "findMany";
|
|
6854
6854
|
ModelAction2["create"] = "create";
|
|
6855
6855
|
ModelAction2["createMany"] = "createMany";
|
|
6856
|
-
ModelAction2["createManyAndReturn"] = "createManyAndReturn";
|
|
6857
6856
|
ModelAction2["update"] = "update";
|
|
6858
6857
|
ModelAction2["updateMany"] = "updateMany";
|
|
6859
|
-
ModelAction2["updateManyAndReturn"] = "updateManyAndReturn";
|
|
6860
6858
|
ModelAction2["upsert"] = "upsert";
|
|
6861
6859
|
ModelAction2["delete"] = "delete";
|
|
6862
6860
|
ModelAction2["deleteMany"] = "deleteMany";
|
|
@@ -6873,11 +6871,11 @@ var configBoolean = z.enum([
|
|
|
6873
6871
|
]).transform((arg) => JSON.parse(arg));
|
|
6874
6872
|
var configMiddleware = z.union([
|
|
6875
6873
|
configBoolean,
|
|
6876
|
-
z.string().default("
|
|
6874
|
+
z.string().default("../../../src/middleware")
|
|
6877
6875
|
]);
|
|
6878
6876
|
var configShield = z.union([
|
|
6879
6877
|
configBoolean,
|
|
6880
|
-
z.string().default("
|
|
6878
|
+
z.string().default("../../../src/shield")
|
|
6881
6879
|
]);
|
|
6882
6880
|
var modelActionEnum = z.nativeEnum(ModelAction);
|
|
6883
6881
|
var configSchema = z.object({
|
|
@@ -6885,7 +6883,7 @@ var configSchema = z.object({
|
|
|
6885
6883
|
withMiddleware: configMiddleware.default("true"),
|
|
6886
6884
|
withShield: configShield.default("true"),
|
|
6887
6885
|
withZod: configBoolean.default("true"),
|
|
6888
|
-
contextPath: z.string().default("
|
|
6886
|
+
contextPath: z.string().default("../../../src/context"),
|
|
6889
6887
|
trpcOptionsPath: z.string().optional(),
|
|
6890
6888
|
showModelNameInProcedure: configBoolean.default("true"),
|
|
6891
6889
|
generateModelActions: z.string().default(Object.values(ModelAction).join(",")).transform((arg) => {
|
|
@@ -11658,8 +11656,10 @@ async function generate(options) {
|
|
|
11658
11656
|
);
|
|
11659
11657
|
for (const opType of modelActions) {
|
|
11660
11658
|
const opNameWithModel = operations[opType];
|
|
11661
|
-
|
|
11662
|
-
|
|
11659
|
+
if (opNameWithModel) {
|
|
11660
|
+
const baseOpType = opType.replace("OrThrow", "");
|
|
11661
|
+
generateProcedure(modelRouter, opNameWithModel, getInputTypeByOpName(baseOpType, model), model, opType, baseOpType, config);
|
|
11662
|
+
}
|
|
11663
11663
|
}
|
|
11664
11664
|
modelRouter.addStatements(
|
|
11665
11665
|
/* ts */
|
package/dist/generator.js
CHANGED
|
@@ -6858,10 +6858,8 @@ var ModelAction = /* @__PURE__ */ function(ModelAction2) {
|
|
|
6858
6858
|
ModelAction2["findMany"] = "findMany";
|
|
6859
6859
|
ModelAction2["create"] = "create";
|
|
6860
6860
|
ModelAction2["createMany"] = "createMany";
|
|
6861
|
-
ModelAction2["createManyAndReturn"] = "createManyAndReturn";
|
|
6862
6861
|
ModelAction2["update"] = "update";
|
|
6863
6862
|
ModelAction2["updateMany"] = "updateMany";
|
|
6864
|
-
ModelAction2["updateManyAndReturn"] = "updateManyAndReturn";
|
|
6865
6863
|
ModelAction2["upsert"] = "upsert";
|
|
6866
6864
|
ModelAction2["delete"] = "delete";
|
|
6867
6865
|
ModelAction2["deleteMany"] = "deleteMany";
|
|
@@ -6878,11 +6876,11 @@ var configBoolean = z.enum([
|
|
|
6878
6876
|
]).transform((arg) => JSON.parse(arg));
|
|
6879
6877
|
var configMiddleware = z.union([
|
|
6880
6878
|
configBoolean,
|
|
6881
|
-
z.string().default("
|
|
6879
|
+
z.string().default("../../../src/middleware")
|
|
6882
6880
|
]);
|
|
6883
6881
|
var configShield = z.union([
|
|
6884
6882
|
configBoolean,
|
|
6885
|
-
z.string().default("
|
|
6883
|
+
z.string().default("../../../src/shield")
|
|
6886
6884
|
]);
|
|
6887
6885
|
var modelActionEnum = z.nativeEnum(ModelAction);
|
|
6888
6886
|
var configSchema = z.object({
|
|
@@ -6890,7 +6888,7 @@ var configSchema = z.object({
|
|
|
6890
6888
|
withMiddleware: configMiddleware.default("true"),
|
|
6891
6889
|
withShield: configShield.default("true"),
|
|
6892
6890
|
withZod: configBoolean.default("true"),
|
|
6893
|
-
contextPath: z.string().default("
|
|
6891
|
+
contextPath: z.string().default("../../../src/context"),
|
|
6894
6892
|
trpcOptionsPath: z.string().optional(),
|
|
6895
6893
|
showModelNameInProcedure: configBoolean.default("true"),
|
|
6896
6894
|
generateModelActions: z.string().default(Object.values(ModelAction).join(",")).transform((arg) => {
|
|
@@ -11663,8 +11661,10 @@ async function generate(options) {
|
|
|
11663
11661
|
);
|
|
11664
11662
|
for (const opType of modelActions) {
|
|
11665
11663
|
const opNameWithModel = operations[opType];
|
|
11666
|
-
|
|
11667
|
-
|
|
11664
|
+
if (opNameWithModel) {
|
|
11665
|
+
const baseOpType = opType.replace("OrThrow", "");
|
|
11666
|
+
generateProcedure(modelRouter, opNameWithModel, getInputTypeByOpName(baseOpType, model), model, opType, baseOpType, config);
|
|
11667
|
+
}
|
|
11668
11668
|
}
|
|
11669
11669
|
modelRouter.addStatements(
|
|
11670
11670
|
/* ts */
|
package/dist/index.cjs
CHANGED
|
@@ -6849,10 +6849,8 @@ var ModelAction = /* @__PURE__ */ function(ModelAction2) {
|
|
|
6849
6849
|
ModelAction2["findMany"] = "findMany";
|
|
6850
6850
|
ModelAction2["create"] = "create";
|
|
6851
6851
|
ModelAction2["createMany"] = "createMany";
|
|
6852
|
-
ModelAction2["createManyAndReturn"] = "createManyAndReturn";
|
|
6853
6852
|
ModelAction2["update"] = "update";
|
|
6854
6853
|
ModelAction2["updateMany"] = "updateMany";
|
|
6855
|
-
ModelAction2["updateManyAndReturn"] = "updateManyAndReturn";
|
|
6856
6854
|
ModelAction2["upsert"] = "upsert";
|
|
6857
6855
|
ModelAction2["delete"] = "delete";
|
|
6858
6856
|
ModelAction2["deleteMany"] = "deleteMany";
|
|
@@ -6869,11 +6867,11 @@ var configBoolean = z.enum([
|
|
|
6869
6867
|
]).transform((arg) => JSON.parse(arg));
|
|
6870
6868
|
var configMiddleware = z.union([
|
|
6871
6869
|
configBoolean,
|
|
6872
|
-
z.string().default("
|
|
6870
|
+
z.string().default("../../../src/middleware")
|
|
6873
6871
|
]);
|
|
6874
6872
|
var configShield = z.union([
|
|
6875
6873
|
configBoolean,
|
|
6876
|
-
z.string().default("
|
|
6874
|
+
z.string().default("../../../src/shield")
|
|
6877
6875
|
]);
|
|
6878
6876
|
var modelActionEnum = z.nativeEnum(ModelAction);
|
|
6879
6877
|
var configSchema = z.object({
|
|
@@ -6881,7 +6879,7 @@ var configSchema = z.object({
|
|
|
6881
6879
|
withMiddleware: configMiddleware.default("true"),
|
|
6882
6880
|
withShield: configShield.default("true"),
|
|
6883
6881
|
withZod: configBoolean.default("true"),
|
|
6884
|
-
contextPath: z.string().default("
|
|
6882
|
+
contextPath: z.string().default("../../../src/context"),
|
|
6885
6883
|
trpcOptionsPath: z.string().optional(),
|
|
6886
6884
|
showModelNameInProcedure: configBoolean.default("true"),
|
|
6887
6885
|
generateModelActions: z.string().default(Object.values(ModelAction).join(",")).transform((arg) => {
|
|
@@ -11654,8 +11652,10 @@ async function generate(options) {
|
|
|
11654
11652
|
);
|
|
11655
11653
|
for (const opType of modelActions) {
|
|
11656
11654
|
const opNameWithModel = operations[opType];
|
|
11657
|
-
|
|
11658
|
-
|
|
11655
|
+
if (opNameWithModel) {
|
|
11656
|
+
const baseOpType = opType.replace("OrThrow", "");
|
|
11657
|
+
generateProcedure(modelRouter, opNameWithModel, getInputTypeByOpName(baseOpType, model), model, opType, baseOpType, config);
|
|
11658
|
+
}
|
|
11659
11659
|
}
|
|
11660
11660
|
modelRouter.addStatements(
|
|
11661
11661
|
/* ts */
|
package/dist/index.js
CHANGED
|
@@ -6854,10 +6854,8 @@ var ModelAction = /* @__PURE__ */ function(ModelAction2) {
|
|
|
6854
6854
|
ModelAction2["findMany"] = "findMany";
|
|
6855
6855
|
ModelAction2["create"] = "create";
|
|
6856
6856
|
ModelAction2["createMany"] = "createMany";
|
|
6857
|
-
ModelAction2["createManyAndReturn"] = "createManyAndReturn";
|
|
6858
6857
|
ModelAction2["update"] = "update";
|
|
6859
6858
|
ModelAction2["updateMany"] = "updateMany";
|
|
6860
|
-
ModelAction2["updateManyAndReturn"] = "updateManyAndReturn";
|
|
6861
6859
|
ModelAction2["upsert"] = "upsert";
|
|
6862
6860
|
ModelAction2["delete"] = "delete";
|
|
6863
6861
|
ModelAction2["deleteMany"] = "deleteMany";
|
|
@@ -6874,11 +6872,11 @@ var configBoolean = z.enum([
|
|
|
6874
6872
|
]).transform((arg) => JSON.parse(arg));
|
|
6875
6873
|
var configMiddleware = z.union([
|
|
6876
6874
|
configBoolean,
|
|
6877
|
-
z.string().default("
|
|
6875
|
+
z.string().default("../../../src/middleware")
|
|
6878
6876
|
]);
|
|
6879
6877
|
var configShield = z.union([
|
|
6880
6878
|
configBoolean,
|
|
6881
|
-
z.string().default("
|
|
6879
|
+
z.string().default("../../../src/shield")
|
|
6882
6880
|
]);
|
|
6883
6881
|
var modelActionEnum = z.nativeEnum(ModelAction);
|
|
6884
6882
|
var configSchema = z.object({
|
|
@@ -6886,7 +6884,7 @@ var configSchema = z.object({
|
|
|
6886
6884
|
withMiddleware: configMiddleware.default("true"),
|
|
6887
6885
|
withShield: configShield.default("true"),
|
|
6888
6886
|
withZod: configBoolean.default("true"),
|
|
6889
|
-
contextPath: z.string().default("
|
|
6887
|
+
contextPath: z.string().default("../../../src/context"),
|
|
6890
6888
|
trpcOptionsPath: z.string().optional(),
|
|
6891
6889
|
showModelNameInProcedure: configBoolean.default("true"),
|
|
6892
6890
|
generateModelActions: z.string().default(Object.values(ModelAction).join(",")).transform((arg) => {
|
|
@@ -11659,8 +11657,10 @@ async function generate(options) {
|
|
|
11659
11657
|
);
|
|
11660
11658
|
for (const opType of modelActions) {
|
|
11661
11659
|
const opNameWithModel = operations[opType];
|
|
11662
|
-
|
|
11663
|
-
|
|
11660
|
+
if (opNameWithModel) {
|
|
11661
|
+
const baseOpType = opType.replace("OrThrow", "");
|
|
11662
|
+
generateProcedure(modelRouter, opNameWithModel, getInputTypeByOpName(baseOpType, model), model, opType, baseOpType, config);
|
|
11663
|
+
}
|
|
11664
11664
|
}
|
|
11665
11665
|
modelRouter.addStatements(
|
|
11666
11666
|
/* ts */
|