prisma-generator-express 1.56.1 → 1.56.2

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.
@@ -128,7 +128,7 @@ ${validationLines}
128
128
 
129
129
  export async function findMany(ctx: OperationContext): Promise<unknown> {
130
130
  const rawQuery = ctx.parsedQuery || {}
131
- const query = applyPaginationLimits(rawQuery, ctx.paginationConfig)
131
+ const query = applyPaginationLimits(rawQuery, ctx.paginationConfig, !!ctx.guardShape)
132
132
  const extended = await getExtendedClient(ctx)
133
133
  const delegate = getDelegate(extended, '${modelNameLower}')
134
134
  if (ctx.guardShape) {
@@ -144,7 +144,7 @@ export async function findManyPaginated(
144
144
  ctx: OperationContext,
145
145
  ): Promise<{ data: unknown[]; total: number; hasMore: boolean }> {
146
146
  const rawQuery = ctx.parsedQuery || {}
147
- const query = applyPaginationLimits(rawQuery, ctx.paginationConfig)
147
+ const query = applyPaginationLimits(rawQuery, ctx.paginationConfig, !!ctx.guardShape)
148
148
  const extended = await getExtendedClient(ctx)
149
149
  const shape = ctx.guardShape
150
150
  const caller = ctx.guardCaller
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "prisma-generator-express",
3
3
  "description": "Prisma generator for Express, Fastify, and Hono CRUD APIs with OpenAPI documentation",
4
- "version": "1.56.1",
4
+ "version": "1.56.2",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "MIT",
@@ -780,7 +780,7 @@ async function runAutoIncludeMany(
780
780
  if (isClientGone()) return
781
781
 
782
782
  const rootDelegate = getDelegate(extended, delegateKey)
783
- const rootArgs = applyPaginationLimits(plan.rootArgs, ctx.paginationConfig)
783
+ const rootArgs = applyPaginationLimits(plan.rootArgs, ctx.paginationConfig, !!ctx.guardShape)
784
784
 
785
785
  let rootResult: unknown
786
786
  try {
@@ -848,7 +848,7 @@ async function runAutoIncludePaginated(
848
848
  const extended = await getExtendedClient(ctx)
849
849
  if (isClientGone()) return
850
850
 
851
- const rootArgs = applyPaginationLimits(plan.rootArgs, ctx.paginationConfig)
851
+ const rootArgs = applyPaginationLimits(plan.rootArgs, ctx.paginationConfig, !!ctx.guardShape)
852
852
  const mode: FindManyPaginatedMode = ctx.findManyPaginatedMode ?? 'promiseAll'
853
853
 
854
854
  let rootRows: unknown[]
@@ -246,8 +246,9 @@ export function requireBodyField(body: Record<string, unknown>, field: string):
246
246
  export function applyPaginationLimits(
247
247
  query: Record<string, unknown>,
248
248
  config?: PaginationConfig,
249
+ hasGuardShape?: boolean,
249
250
  ): Record<string, unknown> {
250
- if (!config) return query
251
+ if (!config || hasGuardShape) return query
251
252
  const result: Record<string, unknown> = { ...query }
252
253
  if (result.take === undefined && config.defaultLimit !== undefined) {
253
254
  result.take = config.defaultLimit
@@ -154,7 +154,7 @@ ${validationLines}
154
154
 
155
155
  export async function findMany(ctx: OperationContext): Promise<unknown> {
156
156
  const rawQuery = ctx.parsedQuery || {}
157
- const query = applyPaginationLimits(rawQuery, ctx.paginationConfig)
157
+ const query = applyPaginationLimits(rawQuery, ctx.paginationConfig, !!ctx.guardShape)
158
158
  const extended = await getExtendedClient(ctx)
159
159
  const delegate = getDelegate(extended, '${modelNameLower}')
160
160
  if (ctx.guardShape) {
@@ -170,7 +170,7 @@ export async function findManyPaginated(
170
170
  ctx: OperationContext,
171
171
  ): Promise<{ data: unknown[]; total: number; hasMore: boolean }> {
172
172
  const rawQuery = ctx.parsedQuery || {}
173
- const query = applyPaginationLimits(rawQuery, ctx.paginationConfig)
173
+ const query = applyPaginationLimits(rawQuery, ctx.paginationConfig, !!ctx.guardShape)
174
174
  const extended = await getExtendedClient(ctx)
175
175
  const shape = ctx.guardShape
176
176
  const caller = ctx.guardCaller