prisma-generator-express 1.16.0 → 1.16.1

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.
@@ -81,7 +81,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
81
81
 
82
82
 
83
83
  if (config.enableAll || config?.findFirst) {
84
- const { before = [], after = [], inputValidator, outputValidator) = config.findFirst || defaultBeforeAfter;
84
+ const { before = [], after = [], inputValidator, outputValidator } = config.findFirst || defaultBeforeAfter;
85
85
  setupRoute('/first', 'get', before, ${modelName}FindFirst as RequestHandler, inputValidator, outputValidator);
86
86
  if (after.length) {
87
87
  router.use(basePath + '/first', ...after);
@@ -89,7 +89,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
89
89
  }
90
90
 
91
91
  if (config.enableAll || config?.findMany) {
92
- const { before = [], after = [], inputValidator, outputValidator) = config.findMany || defaultBeforeAfter;
92
+ const { before = [], after = [], inputValidator, outputValidator } = config.findMany || defaultBeforeAfter;
93
93
  setupRoute('/', 'get', before, ${modelName}FindMany as RequestHandler, inputValidator, outputValidator);
94
94
  if (after.length) {
95
95
  router.use(basePath + '/', ...after);
@@ -97,7 +97,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
97
97
  }
98
98
 
99
99
  if (config.enableAll || config?.findUnique) {
100
- const { before = [], after = [], inputValidator, outputValidator) = config.findUnique || defaultBeforeAfter;
100
+ const { before = [], after = [], inputValidator, outputValidator } = config.findUnique || defaultBeforeAfter;
101
101
  setupRoute('/:id', 'get', before, ${modelName}FindUnique as any, inputValidator, outputValidator);
102
102
  if (after.length) {
103
103
  router.use(basePath + '/:id', ...after);
@@ -105,7 +105,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
105
105
  }
106
106
 
107
107
  if (config.enableAll || config?.create) {
108
- const { before = [], after = [], inputValidator, outputValidator) = config.create || defaultBeforeAfter;
108
+ const { before = [], after = [], inputValidator, outputValidator } = config.create || defaultBeforeAfter;
109
109
  setupRoute('/', 'post', before, ${modelName}Create as RequestHandler, inputValidator, outputValidator);
110
110
  if (after.length) {
111
111
  router.use(basePath + '/', ...after);
@@ -113,7 +113,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
113
113
  }
114
114
 
115
115
  if (config.enableAll || config?.createMany) {
116
- const { before = [], after = [], inputValidator, outputValidator) = config.createMany || defaultBeforeAfter;
116
+ const { before = [], after = [], inputValidator, outputValidator } = config.createMany || defaultBeforeAfter;
117
117
  setupRoute('/many', 'post', before, ${modelName}CreateMany as RequestHandler, inputValidator, outputValidator);
118
118
  if (after.length) {
119
119
  router.use(basePath + '/many', ...after);
@@ -121,7 +121,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
121
121
  }
122
122
 
123
123
  if (config.enableAll || config?.update) {
124
- const { before = [], after = [], inputValidator, outputValidator) = config.update || defaultBeforeAfter;
124
+ const { before = [], after = [], inputValidator, outputValidator } = config.update || defaultBeforeAfter;
125
125
  setupRoute('/', 'put', before, ${modelName}Update as RequestHandler, inputValidator, outputValidator);
126
126
  if (after.length) {
127
127
  router.use(basePath + '/', ...after);
@@ -129,7 +129,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
129
129
  }
130
130
 
131
131
  if (config.enableAll || config?.updateMany) {
132
- const { before = [], after = [], inputValidator, outputValidator) = config.updateMany || defaultBeforeAfter;
132
+ const { before = [], after = [], inputValidator, outputValidator } = config.updateMany || defaultBeforeAfter;
133
133
  setupRoute('/many', 'put', before, ${modelName}UpdateMany as RequestHandler, inputValidator, outputValidator);
134
134
  if (after.length) {
135
135
  router.use(basePath + '/many', ...after);
@@ -137,7 +137,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
137
137
  }
138
138
 
139
139
  if (config.enableAll || config?.upsert) {
140
- const { before = [], after = [], inputValidator, outputValidator) = config.upsert || defaultBeforeAfter;
140
+ const { before = [], after = [], inputValidator, outputValidator } = config.upsert || defaultBeforeAfter;
141
141
  setupRoute('/', 'patch', before, ${modelName}Upsert as RequestHandler, inputValidator, outputValidator);
142
142
  if (after.length) {
143
143
  router.use(basePath + '/', ...after);
@@ -145,7 +145,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
145
145
  }
146
146
 
147
147
  if (config.enableAll || config?.delete) {
148
- const { before = [], after = [], inputValidator, outputValidator) = config.delete || defaultBeforeAfter;
148
+ const { before = [], after = [], inputValidator, outputValidator } = config.delete || defaultBeforeAfter;
149
149
  setupRoute('/', 'delete', before, ${modelName}Delete as RequestHandler, inputValidator, outputValidator);
150
150
  if (after.length) {
151
151
  router.use(basePath + '/', ...after);
@@ -153,7 +153,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
153
153
  }
154
154
 
155
155
  if (config.enableAll || config?.deleteMany) {
156
- const { before = [], after = [], inputValidator, outputValidator) = config.deleteMany || defaultBeforeAfter;
156
+ const { before = [], after = [], inputValidator, outputValidator } = config.deleteMany || defaultBeforeAfter;
157
157
  setupRoute('/many', 'delete', before, ${modelName}DeleteMany as RequestHandler, inputValidator, outputValidator);
158
158
  if (after.length) {
159
159
  router.use(basePath + '/many', ...after);
@@ -161,7 +161,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
161
161
  }
162
162
 
163
163
  if (config.enableAll || config?.aggregate) {
164
- const { before = [], after = [], inputValidator, outputValidator) = config.aggregate || defaultBeforeAfter;
164
+ const { before = [], after = [], inputValidator, outputValidator } = config.aggregate || defaultBeforeAfter;
165
165
  setupRoute('/aggregate', 'get', before, ${modelName}Aggregate as RequestHandler, inputValidator, outputValidator);
166
166
  if (after.length) {
167
167
  router.use(basePath + '/aggregate', ...after);
@@ -169,7 +169,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
169
169
  }
170
170
 
171
171
  if (config.enableAll || config?.count) {
172
- const { before = [], after = [], inputValidator, outputValidator) = config.count || defaultBeforeAfter;
172
+ const { before = [], after = [], inputValidator, outputValidator } = config.count || defaultBeforeAfter;
173
173
  setupRoute('/count', 'get', before, ${modelName}Count as RequestHandler, inputValidator, outputValidator);
174
174
  if (after.length) {
175
175
  router.use(basePath + '/count', ...after);
@@ -177,7 +177,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
177
177
  }
178
178
 
179
179
  if (config.enableAll || config?.groupBy) {
180
- const { before = [], after = [], inputValidator, outputValidator) = config.groupBy || defaultBeforeAfter;
180
+ const { before = [], after = [], inputValidator, outputValidator } = config.groupBy || defaultBeforeAfter;
181
181
  setupRoute('/groupby', 'get', before, ${modelName}GroupBy as RequestHandler, inputValidator, outputValidator);
182
182
  if (after.length) {
183
183
  router.use(basePath + '/groupby', ...after);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "prisma-generator-express",
3
3
  "description": "Prisma generator of Express CRUD API",
4
- "version": "1.16.0",
4
+ "version": "1.16.1",
5
5
  "main": "dist/generator.js",
6
6
  "license": "MIT",
7
7
  "bin": {
@@ -85,7 +85,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
85
85
 
86
86
 
87
87
  if (config.enableAll || config?.findFirst) {
88
- const { before = [], after = [], inputValidator, outputValidator) = config.findFirst || defaultBeforeAfter;
88
+ const { before = [], after = [], inputValidator, outputValidator } = config.findFirst || defaultBeforeAfter;
89
89
  setupRoute('/first', 'get', before, ${modelName}FindFirst as RequestHandler, inputValidator, outputValidator);
90
90
  if (after.length) {
91
91
  router.use(basePath + '/first', ...after);
@@ -93,7 +93,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
93
93
  }
94
94
 
95
95
  if (config.enableAll || config?.findMany) {
96
- const { before = [], after = [], inputValidator, outputValidator) = config.findMany || defaultBeforeAfter;
96
+ const { before = [], after = [], inputValidator, outputValidator } = config.findMany || defaultBeforeAfter;
97
97
  setupRoute('/', 'get', before, ${modelName}FindMany as RequestHandler, inputValidator, outputValidator);
98
98
  if (after.length) {
99
99
  router.use(basePath + '/', ...after);
@@ -101,7 +101,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
101
101
  }
102
102
 
103
103
  if (config.enableAll || config?.findUnique) {
104
- const { before = [], after = [], inputValidator, outputValidator) = config.findUnique || defaultBeforeAfter;
104
+ const { before = [], after = [], inputValidator, outputValidator } = config.findUnique || defaultBeforeAfter;
105
105
  setupRoute('/:id', 'get', before, ${modelName}FindUnique as any, inputValidator, outputValidator);
106
106
  if (after.length) {
107
107
  router.use(basePath + '/:id', ...after);
@@ -109,7 +109,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
109
109
  }
110
110
 
111
111
  if (config.enableAll || config?.create) {
112
- const { before = [], after = [], inputValidator, outputValidator) = config.create || defaultBeforeAfter;
112
+ const { before = [], after = [], inputValidator, outputValidator } = config.create || defaultBeforeAfter;
113
113
  setupRoute('/', 'post', before, ${modelName}Create as RequestHandler, inputValidator, outputValidator);
114
114
  if (after.length) {
115
115
  router.use(basePath + '/', ...after);
@@ -117,7 +117,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
117
117
  }
118
118
 
119
119
  if (config.enableAll || config?.createMany) {
120
- const { before = [], after = [], inputValidator, outputValidator) = config.createMany || defaultBeforeAfter;
120
+ const { before = [], after = [], inputValidator, outputValidator } = config.createMany || defaultBeforeAfter;
121
121
  setupRoute('/many', 'post', before, ${modelName}CreateMany as RequestHandler, inputValidator, outputValidator);
122
122
  if (after.length) {
123
123
  router.use(basePath + '/many', ...after);
@@ -125,7 +125,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
125
125
  }
126
126
 
127
127
  if (config.enableAll || config?.update) {
128
- const { before = [], after = [], inputValidator, outputValidator) = config.update || defaultBeforeAfter;
128
+ const { before = [], after = [], inputValidator, outputValidator } = config.update || defaultBeforeAfter;
129
129
  setupRoute('/', 'put', before, ${modelName}Update as RequestHandler, inputValidator, outputValidator);
130
130
  if (after.length) {
131
131
  router.use(basePath + '/', ...after);
@@ -133,7 +133,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
133
133
  }
134
134
 
135
135
  if (config.enableAll || config?.updateMany) {
136
- const { before = [], after = [], inputValidator, outputValidator) = config.updateMany || defaultBeforeAfter;
136
+ const { before = [], after = [], inputValidator, outputValidator } = config.updateMany || defaultBeforeAfter;
137
137
  setupRoute('/many', 'put', before, ${modelName}UpdateMany as RequestHandler, inputValidator, outputValidator);
138
138
  if (after.length) {
139
139
  router.use(basePath + '/many', ...after);
@@ -141,7 +141,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
141
141
  }
142
142
 
143
143
  if (config.enableAll || config?.upsert) {
144
- const { before = [], after = [], inputValidator, outputValidator) = config.upsert || defaultBeforeAfter;
144
+ const { before = [], after = [], inputValidator, outputValidator } = config.upsert || defaultBeforeAfter;
145
145
  setupRoute('/', 'patch', before, ${modelName}Upsert as RequestHandler, inputValidator, outputValidator);
146
146
  if (after.length) {
147
147
  router.use(basePath + '/', ...after);
@@ -149,7 +149,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
149
149
  }
150
150
 
151
151
  if (config.enableAll || config?.delete) {
152
- const { before = [], after = [], inputValidator, outputValidator) = config.delete || defaultBeforeAfter;
152
+ const { before = [], after = [], inputValidator, outputValidator } = config.delete || defaultBeforeAfter;
153
153
  setupRoute('/', 'delete', before, ${modelName}Delete as RequestHandler, inputValidator, outputValidator);
154
154
  if (after.length) {
155
155
  router.use(basePath + '/', ...after);
@@ -157,7 +157,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
157
157
  }
158
158
 
159
159
  if (config.enableAll || config?.deleteMany) {
160
- const { before = [], after = [], inputValidator, outputValidator) = config.deleteMany || defaultBeforeAfter;
160
+ const { before = [], after = [], inputValidator, outputValidator } = config.deleteMany || defaultBeforeAfter;
161
161
  setupRoute('/many', 'delete', before, ${modelName}DeleteMany as RequestHandler, inputValidator, outputValidator);
162
162
  if (after.length) {
163
163
  router.use(basePath + '/many', ...after);
@@ -165,7 +165,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
165
165
  }
166
166
 
167
167
  if (config.enableAll || config?.aggregate) {
168
- const { before = [], after = [], inputValidator, outputValidator) = config.aggregate || defaultBeforeAfter;
168
+ const { before = [], after = [], inputValidator, outputValidator } = config.aggregate || defaultBeforeAfter;
169
169
  setupRoute('/aggregate', 'get', before, ${modelName}Aggregate as RequestHandler, inputValidator, outputValidator);
170
170
  if (after.length) {
171
171
  router.use(basePath + '/aggregate', ...after);
@@ -173,7 +173,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
173
173
  }
174
174
 
175
175
  if (config.enableAll || config?.count) {
176
- const { before = [], after = [], inputValidator, outputValidator) = config.count || defaultBeforeAfter;
176
+ const { before = [], after = [], inputValidator, outputValidator } = config.count || defaultBeforeAfter;
177
177
  setupRoute('/count', 'get', before, ${modelName}Count as RequestHandler, inputValidator, outputValidator);
178
178
  if (after.length) {
179
179
  router.use(basePath + '/count', ...after);
@@ -181,7 +181,7 @@ export function ${routerFunctionName}(config: RouteConfig<RequestHandler>) {
181
181
  }
182
182
 
183
183
  if (config.enableAll || config?.groupBy) {
184
- const { before = [], after = [], inputValidator, outputValidator) = config.groupBy || defaultBeforeAfter;
184
+ const { before = [], after = [], inputValidator, outputValidator } = config.groupBy || defaultBeforeAfter;
185
185
  setupRoute('/groupby', 'get', before, ${modelName}GroupBy as RequestHandler, inputValidator, outputValidator);
186
186
  if (after.length) {
187
187
  router.use(basePath + '/groupby', ...after);