@fjell/express-router 4.4.71 → 4.4.73

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.
@@ -1 +1 @@
1
- {"version":3,"file":"PItemRouter.d.ts","sourceRoot":"","sources":["../src/PItemRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgD,IAAI,EAA4B,MAAM,EAA2B,MAAM,aAAa,CAAC;AAC5I,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAiB,MAAM,YAAY,CAAC;AAMpD,qBAAa,WAAW,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAE,SAAQ,UAAU,CAAC,CAAC,CAAC;gBAErE,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAE,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAM;IAI1G,KAAK,CAAC,GAAG,EAAE,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC;IAM/B,UAAU,GAAU,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,OAAO,GAAG,mBAmEhE;IAEF,SAAS,CAAC,SAAS,GAAU,KAAK,OAAO,EAAE,KAAK,QAAQ,mBA4FtD;CAEH"}
1
+ {"version":3,"file":"PItemRouter.d.ts","sourceRoot":"","sources":["../src/PItemRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgD,IAAI,EAA4B,MAAM,EAA2B,MAAM,aAAa,CAAC;AAC5I,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAiB,MAAM,YAAY,CAAC;AAMpD,qBAAa,WAAW,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAE,SAAQ,UAAU,CAAC,CAAC,CAAC;gBAErE,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAE,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAM;IAI1G,KAAK,CAAC,GAAG,EAAE,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC;IAM/B,UAAU,GAAU,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,OAAO,GAAG,mBAmEhE;IAEF,SAAS,CAAC,SAAS,GAAU,KAAK,OAAO,EAAE,KAAK,QAAQ,mBAuOtD;CAEH"}
@@ -40,6 +40,10 @@ class PItemRouter extends ItemRouter {
40
40
  }
41
41
  };
42
42
  findItems = async (req, res) => {
43
+ console.log("=== FIND ITEMS CALLED ===");
44
+ console.log("Query:", JSON.stringify(req.query));
45
+ console.log("Path:", req.path);
46
+ console.log("Method:", req.method);
43
47
  const libOperations = this.lib.operations;
44
48
  this.logger.default("Finding Items", { query: req.query, params: req.params, locals: res.locals });
45
49
  try {
@@ -48,6 +52,10 @@ class PItemRouter extends ItemRouter {
48
52
  const finderParams = query["finderParams"];
49
53
  const one = query["one"];
50
54
  if (finder) {
55
+ console.log("=== FINDER REQUEST ===");
56
+ console.log("Finder:", finder);
57
+ console.log("Finder Params:", finderParams);
58
+ console.log("One:", one);
51
59
  this.logger.default("Finding Items with Finder %s %j one:%s", finder, finderParams, one);
52
60
  let parsedParams;
53
61
  try {
@@ -77,12 +85,63 @@ class PItemRouter extends ItemRouter {
77
85
  };
78
86
  res.json(result);
79
87
  } else {
80
- const result = await libOperations.find(finder, parsedParams, [], findOptions);
81
- const validatedItems = validatePK(result.items, this.getPkType());
88
+ console.log("=== CALLING libOperations.find ===");
89
+ console.log("Finder:", finder);
90
+ console.log("Parsed Params:", JSON.stringify(parsedParams));
91
+ console.log("Find Options:", JSON.stringify(findOptions));
92
+ let result;
93
+ try {
94
+ console.log("About to call libOperations.find...");
95
+ result = await libOperations.find(finder, parsedParams, [], findOptions);
96
+ console.log("libOperations.find SUCCESS - got result:", {
97
+ itemCount: result?.items?.length,
98
+ total: result?.metadata?.total
99
+ });
100
+ } catch (findError) {
101
+ console.error("=== ERROR IN libOperations.find ===");
102
+ console.error("Error:", findError);
103
+ console.error("Error Message:", findError?.message);
104
+ console.error("Error Stack:", findError?.stack);
105
+ this.logger.error("Error calling libOperations.find", {
106
+ finder,
107
+ parsedParams,
108
+ findOptions,
109
+ errorMessage: findError?.message,
110
+ errorName: findError?.name,
111
+ errorStack: findError?.stack,
112
+ errorCause: findError?.cause
113
+ });
114
+ throw findError;
115
+ }
116
+ console.log("=== VALIDATING ITEMS ===");
117
+ console.log("Item count:", result.items?.length);
118
+ let validatedItems;
119
+ try {
120
+ validatedItems = validatePK(result.items, this.getPkType());
121
+ console.log("Validation SUCCESS - validated items:", validatedItems.length);
122
+ } catch (validationError) {
123
+ console.error("=== ERROR IN VALIDATION ===");
124
+ console.error("Validation Error:", validationError);
125
+ console.error("Error Message:", validationError?.message);
126
+ console.error("Error Stack:", validationError?.stack);
127
+ this.logger.error("Error validating items from find result", {
128
+ finder,
129
+ itemCount: result.items?.length,
130
+ firstItem: result.items?.[0],
131
+ errorMessage: validationError?.message,
132
+ errorName: validationError?.name,
133
+ errorStack: validationError?.stack
134
+ });
135
+ throw validationError;
136
+ }
137
+ console.log("=== SENDING RESPONSE ===");
138
+ console.log("Items:", validatedItems.length);
139
+ console.log("Metadata:", JSON.stringify(result.metadata));
82
140
  res.json({
83
141
  items: validatedItems,
84
142
  metadata: result.metadata
85
143
  });
144
+ console.log("=== RESPONSE SENT ===");
86
145
  }
87
146
  } else {
88
147
  const itemQuery = paramsToQuery(req.query);
@@ -102,11 +161,74 @@ class PItemRouter extends ItemRouter {
102
161
  });
103
162
  }
104
163
  } catch (error) {
105
- this.logger.error("Error in findItems", { error });
164
+ const originalError = error?.cause || error;
165
+ const errorMessage = error?.message || originalError?.message || String(error) || "Internal server error";
166
+ const errorProps = {};
167
+ if (error) {
168
+ Object.getOwnPropertyNames(error).forEach((key) => {
169
+ try {
170
+ const value = error[key];
171
+ if (typeof value !== "function" && typeof value !== "object") {
172
+ errorProps[key] = value;
173
+ } else if (key === "stack" || key === "message" || key === "cause") {
174
+ errorProps[key] = value;
175
+ }
176
+ } catch {
177
+ }
178
+ });
179
+ }
180
+ const errorDetails = {
181
+ errorMessage,
182
+ errorName: error?.name || originalError?.name,
183
+ errorCode: error?.code || originalError?.code,
184
+ errorStack: error?.stack || originalError?.stack,
185
+ errorString: String(error),
186
+ errorType: error?.constructor?.name,
187
+ errorProps,
188
+ errorCause: error?.cause ? {
189
+ message: error.cause?.message,
190
+ name: error.cause?.name,
191
+ stack: error.cause?.stack
192
+ } : void 0,
193
+ finder: req.query?.finder,
194
+ finderParams: req.query?.finderParams,
195
+ requestPath: req.path,
196
+ requestMethod: req.method
197
+ };
198
+ console.error("=== ERROR IN findItems ===");
199
+ console.error("Error object:", error);
200
+ console.error("Error message:", errorMessage);
201
+ console.error("Error name:", error?.name);
202
+ console.error("Error code:", error?.code);
203
+ console.error("Error stack:", error?.stack);
204
+ console.error("Error cause:", error?.cause);
205
+ console.error("Error string:", String(error));
206
+ console.error("Full error details:", JSON.stringify(errorDetails, null, 2));
207
+ console.error("=== END ERROR ===\n\n");
208
+ this.logger.error("Error in findItems", {
209
+ errorMessage,
210
+ errorName: errorDetails.errorName,
211
+ errorCode: errorDetails.errorCode,
212
+ errorStack: errorDetails.errorStack,
213
+ errorType: errorDetails.errorType,
214
+ errorProps: errorDetails.errorProps,
215
+ errorCause: errorDetails.errorCause,
216
+ finder: errorDetails.finder,
217
+ finderParams: errorDetails.finderParams,
218
+ requestPath: errorDetails.requestPath,
219
+ requestMethod: errorDetails.requestMethod
220
+ });
106
221
  if (error instanceof NotFoundError || error?.name === "NotFoundError") {
107
- res.status(404).json({ error: error.message || "Item not found" });
222
+ res.status(404).json({ error: errorMessage });
108
223
  } else {
109
- res.status(500).json({ error: error.message || "Internal server error" });
224
+ const isDevelopment = process.env.NODE_ENV === "development";
225
+ res.status(500).json({
226
+ error: errorMessage,
227
+ ...isDevelopment && {
228
+ details: errorDetails.errorName,
229
+ stack: errorDetails.errorStack
230
+ }
231
+ });
110
232
  }
111
233
  }
112
234
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/PItemRouter.ts"],
4
- "sourcesContent": ["import { AllOptions, FindOperationResult, FindOptions, Item, ItemQuery, paramsToQuery, PriKey, QueryParams, validatePK } from \"@fjell/core\";\nimport { Request, Response } from \"express\";\nimport { ItemRouter, ItemRouterOptions } from \"./ItemRouter.js\";\nimport { Library, NotFoundError } from \"@fjell/lib\";\n\ninterface ParsedQuery {\n [key: string]: undefined | string | string[] | ParsedQuery | ParsedQuery[];\n}\n\nexport class PItemRouter<T extends Item<S>, S extends string> extends ItemRouter<S> {\n\n constructor(lib: Library<T, S>, keyType: S, options: ItemRouterOptions<S, never, never, never, never, never> = {}) {\n super(lib as any, keyType, options);\n }\n\n public getIk(res: Response): PriKey<S> {\n const pri = this.getPk(res) as PriKey<S>;\n return pri\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n public createItem = async (req: Request, res: Response, next?: any) => {\n const libOperations = this.lib.operations;\n this.logger.default('Creating Item', { body: req.body, query: req.query, params: req.params, locals: res.locals });\n\n try {\n const itemToCreate = this.convertDates(req.body as Item<S>);\n let item = validatePK(await libOperations.create(itemToCreate), this.getPkType()) as Item<S>;\n item = await this.postCreateItem(item);\n this.logger.default('Created Item %j', item);\n res.status(201).json(item);\n } catch (error: any) {\n // Check for validation errors - check multiple patterns\n // Also check error.cause since errors may be wrapped\n const originalError = error?.cause || error;\n \n // Log error details for debugging\n this.logger.error('Error in createItem', {\n error,\n errorName: error?.name,\n errorMessage: error?.message,\n originalErrorName: originalError?.name,\n originalErrorMessage: originalError?.message,\n errorCode: error?.errorInfo?.code,\n originalErrorCode: originalError?.errorInfo?.code\n });\n const isValidationError =\n error.name === 'CreateValidationError' ||\n originalError?.name === 'CreateValidationError' ||\n error.name === 'ValidationError' ||\n originalError?.name === 'ValidationError' ||\n error.name === 'SequelizeValidationError' ||\n originalError?.name === 'SequelizeValidationError' ||\n error?.errorInfo?.code === 'VALIDATION_ERROR' ||\n originalError?.errorInfo?.code === 'VALIDATION_ERROR' ||\n (error.message && (\n error.message.includes('validation') ||\n error.message.includes('required') ||\n error.message.includes('cannot be null') ||\n error.message.includes('notNull Violation') ||\n error.message.includes('Required field') ||\n error.message.includes('Referenced item does not exist') ||\n error.message.includes('Foreign key constraint') ||\n error.message.includes('Operation failed') ||\n error.message.includes('preCreate') ||\n error.message.includes('preUpdate') ||\n error.message.includes('Create Validation Failed')\n )) ||\n (originalError?.message && (\n originalError.message.includes('validation') ||\n originalError.message.includes('required') ||\n originalError.message.includes('cannot be null') ||\n originalError.message.includes('notNull Violation') ||\n originalError.message.includes('Required field') ||\n originalError.message.includes('Referenced item does not exist') ||\n originalError.message.includes('Foreign key constraint') ||\n originalError.message.includes('preCreate') ||\n originalError.message.includes('preUpdate') ||\n originalError.message.includes('Create Validation Failed')\n ));\n \n if (isValidationError) {\n const errorMessage = originalError?.message || error.message || \"Validation failed\";\n res.status(400).json({ success: false, error: errorMessage });\n } else {\n res.status(500).json({ success: false, error: error.message || \"Internal server error\" });\n }\n }\n };\n\n protected findItems = async (req: Request, res: Response) => {\n const libOperations = this.lib.operations;\n this.logger.default('Finding Items', { query: req.query, params: req.params, locals: res.locals });\n\n try {\n const query: ParsedQuery = req.query as unknown as ParsedQuery;\n const finder = query['finder'] as string;\n const finderParams = query['finderParams'] as string;\n const one = query['one'] as string;\n\n if (finder) {\n // If finder is defined? Call a finder.\n this.logger.default('Finding Items with Finder %s %j one:%s', finder, finderParams, one);\n\n let parsedParams: any;\n try {\n parsedParams = finderParams ? JSON.parse(finderParams) : {};\n } catch (parseError: any) {\n res.status(400).json({\n error: 'Invalid JSON in finderParams',\n message: parseError.message\n });\n return;\n }\n\n // Parse pagination options from query parameters\n const findOptions: FindOptions | undefined =\n (req.query.limit || req.query.offset) ? {\n ...(req.query.limit && { limit: parseInt(req.query.limit as string, 10) }),\n ...(req.query.offset && { offset: parseInt(req.query.offset as string, 10) }),\n } : (void 0);\n\n if (one === 'true') {\n const item = await (this.lib as any).findOne(finder, parsedParams);\n // Wrap findOne result in FindOperationResult format\n const validatedItem = item ? (validatePK(item, this.getPkType()) as Item<S>) : null;\n const result: FindOperationResult<Item<S>> = {\n items: validatedItem ? [validatedItem] : [],\n metadata: {\n total: validatedItem ? 1 : 0,\n returned: validatedItem ? 1 : 0,\n offset: 0,\n hasMore: false\n }\n };\n res.json(result);\n } else {\n // Call find() with pagination options - it returns FindOperationResult\n const result = await libOperations.find(finder, parsedParams, [], findOptions);\n \n // Validate items - validatePK can handle arrays\n const validatedItems = validatePK(result.items, this.getPkType()) as Item<S>[];\n \n res.json({\n items: validatedItems,\n metadata: result.metadata\n });\n }\n } else {\n // TODO: This is once of the more important places to perform some validaation and feedback\n const itemQuery: ItemQuery = paramsToQuery(req.query as QueryParams);\n this.logger.default('Finding Items with a query %j', itemQuery);\n \n // Parse pagination options from query params\n const allOptions: AllOptions = {};\n if (req.query.limit) {\n allOptions.limit = parseInt(req.query.limit as string, 10);\n }\n if (req.query.offset) {\n allOptions.offset = parseInt(req.query.offset as string, 10);\n }\n \n // libOperations.all() now returns AllOperationResult<V>\n const result = await libOperations.all(itemQuery, [], allOptions);\n \n // Validate PKs on returned items\n const validatedItems = result.items.map((item: Item<S>) => validatePK(item, this.getPkType()));\n \n // Return full AllOperationResult structure with validated items\n res.json({\n items: validatedItems,\n metadata: result.metadata\n });\n }\n } catch (error: any) {\n this.logger.error('Error in findItems', { error });\n if (error instanceof NotFoundError || error?.name === 'NotFoundError') {\n res.status(404).json({ error: error.message || 'Item not found' });\n } else {\n res.status(500).json({ error: error.message || 'Internal server error' });\n }\n }\n };\n\n}\n"],
5
- "mappings": "AAAA,SAAwE,eAAoC,kBAAkB;AAE9H,SAAS,kBAAqC;AAC9C,SAAkB,qBAAqB;AAMhC,MAAM,oBAAyD,WAAc;AAAA,EAElF,YAAY,KAAoB,SAAY,UAAmE,CAAC,GAAG;AACjH,UAAM,KAAY,SAAS,OAAO;AAAA,EACpC;AAAA,EAEO,MAAM,KAA0B;AACrC,UAAM,MAAM,KAAK,MAAM,GAAG;AAC1B,WAAO;AAAA,EACT;AAAA;AAAA,EAGO,aAAa,OAAO,KAAc,KAAe,SAAe;AACrE,UAAM,gBAAgB,KAAK,IAAI;AAC/B,SAAK,OAAO,QAAQ,iBAAiB,EAAE,MAAM,IAAI,MAAM,OAAO,IAAI,OAAO,QAAQ,IAAI,QAAQ,QAAQ,IAAI,OAAO,CAAC;AAEjH,QAAI;AACF,YAAM,eAAe,KAAK,aAAa,IAAI,IAAe;AAC1D,UAAI,OAAO,WAAW,MAAM,cAAc,OAAO,YAAY,GAAG,KAAK,UAAU,CAAC;AAChF,aAAO,MAAM,KAAK,eAAe,IAAI;AACrC,WAAK,OAAO,QAAQ,mBAAmB,IAAI;AAC3C,UAAI,OAAO,GAAG,EAAE,KAAK,IAAI;AAAA,IAC3B,SAAS,OAAY;AAGnB,YAAM,gBAAgB,OAAO,SAAS;AAGtC,WAAK,OAAO,MAAM,uBAAuB;AAAA,QACvC;AAAA,QACA,WAAW,OAAO;AAAA,QAClB,cAAc,OAAO;AAAA,QACrB,mBAAmB,eAAe;AAAA,QAClC,sBAAsB,eAAe;AAAA,QACrC,WAAW,OAAO,WAAW;AAAA,QAC7B,mBAAmB,eAAe,WAAW;AAAA,MAC/C,CAAC;AACD,YAAM,oBACJ,MAAM,SAAS,2BACf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BAAiB,WAAW,OAAO,OAAO,KAAK,UAAU,CAAC;AAEhE,cAAI,KAAK;AAAA,YACP,OAAO;AAAA,YACP,UAAU,OAAO;AAAA,UACnB,CAAC;AAAA,QACH;AAAA,MACF,OAAO;AAEL,cAAM,YAAuB,cAAc,IAAI,KAAoB;AACnE,aAAK,OAAO,QAAQ,iCAAiC,SAAS;AAG9D,cAAM,aAAyB,CAAC;AAChC,YAAI,IAAI,MAAM,OAAO;AACnB,qBAAW,QAAQ,SAAS,IAAI,MAAM,OAAiB,EAAE;AAAA,QAC3D;AACA,YAAI,IAAI,MAAM,QAAQ;AACpB,qBAAW,SAAS,SAAS,IAAI,MAAM,QAAkB,EAAE;AAAA,QAC7D;AAGA,cAAM,SAAS,MAAM,cAAc,IAAI,WAAW,CAAC,GAAG,UAAU;AAGhE,cAAM,iBAAiB,OAAO,MAAM,IAAI,CAAC,SAAkB,WAAW,MAAM,KAAK,UAAU,CAAC,CAAC;AAG7F,YAAI,KAAK;AAAA,UACP,OAAO;AAAA,UACP,UAAU,OAAO;AAAA,QACnB,CAAC;AAAA,MACH;AAAA,IACF,SAAS,OAAY;AACnB,WAAK,OAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC;AACjD,UAAI,iBAAiB,iBAAiB,OAAO,SAAS,iBAAiB;AACrE,YAAI,OAAO,GAAG,EAAE,KAAK,EAAE,OAAO,MAAM,WAAW,iBAAiB,CAAC;AAAA,MACnE,OAAO;AACL,YAAI,OAAO,GAAG,EAAE,KAAK,EAAE,OAAO,MAAM,WAAW,wBAAwB,CAAC;AAAA,MAC1E;AAAA,IACF;AAAA,EACF;AAEF;",
4
+ "sourcesContent": ["import { AllOptions, FindOperationResult, FindOptions, Item, ItemQuery, paramsToQuery, PriKey, QueryParams, validatePK } from \"@fjell/core\";\nimport { Request, Response } from \"express\";\nimport { ItemRouter, ItemRouterOptions } from \"./ItemRouter.js\";\nimport { Library, NotFoundError } from \"@fjell/lib\";\n\ninterface ParsedQuery {\n [key: string]: undefined | string | string[] | ParsedQuery | ParsedQuery[];\n}\n\nexport class PItemRouter<T extends Item<S>, S extends string> extends ItemRouter<S> {\n\n constructor(lib: Library<T, S>, keyType: S, options: ItemRouterOptions<S, never, never, never, never, never> = {}) {\n super(lib as any, keyType, options);\n }\n\n public getIk(res: Response): PriKey<S> {\n const pri = this.getPk(res) as PriKey<S>;\n return pri\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n public createItem = async (req: Request, res: Response, next?: any) => {\n const libOperations = this.lib.operations;\n this.logger.default('Creating Item', { body: req.body, query: req.query, params: req.params, locals: res.locals });\n\n try {\n const itemToCreate = this.convertDates(req.body as Item<S>);\n let item = validatePK(await libOperations.create(itemToCreate), this.getPkType()) as Item<S>;\n item = await this.postCreateItem(item);\n this.logger.default('Created Item %j', item);\n res.status(201).json(item);\n } catch (error: any) {\n // Check for validation errors - check multiple patterns\n // Also check error.cause since errors may be wrapped\n const originalError = error?.cause || error;\n\n // Log error details for debugging\n this.logger.error('Error in createItem', {\n error,\n errorName: error?.name,\n errorMessage: error?.message,\n originalErrorName: originalError?.name,\n originalErrorMessage: originalError?.message,\n errorCode: error?.errorInfo?.code,\n originalErrorCode: originalError?.errorInfo?.code\n });\n const isValidationError =\n error.name === 'CreateValidationError' ||\n originalError?.name === 'CreateValidationError' ||\n error.name === 'ValidationError' ||\n originalError?.name === 'ValidationError' ||\n error.name === 'SequelizeValidationError' ||\n originalError?.name === 'SequelizeValidationError' ||\n error?.errorInfo?.code === 'VALIDATION_ERROR' ||\n originalError?.errorInfo?.code === 'VALIDATION_ERROR' ||\n (error.message && (\n error.message.includes('validation') ||\n error.message.includes('required') ||\n error.message.includes('cannot be null') ||\n error.message.includes('notNull Violation') ||\n error.message.includes('Required field') ||\n error.message.includes('Referenced item does not exist') ||\n error.message.includes('Foreign key constraint') ||\n error.message.includes('Operation failed') ||\n error.message.includes('preCreate') ||\n error.message.includes('preUpdate') ||\n error.message.includes('Create Validation Failed')\n )) ||\n (originalError?.message && (\n originalError.message.includes('validation') ||\n originalError.message.includes('required') ||\n originalError.message.includes('cannot be null') ||\n originalError.message.includes('notNull Violation') ||\n originalError.message.includes('Required field') ||\n originalError.message.includes('Referenced item does not exist') ||\n originalError.message.includes('Foreign key constraint') ||\n originalError.message.includes('preCreate') ||\n originalError.message.includes('preUpdate') ||\n originalError.message.includes('Create Validation Failed')\n ));\n\n if (isValidationError) {\n const errorMessage = originalError?.message || error.message || \"Validation failed\";\n res.status(400).json({ success: false, error: errorMessage });\n } else {\n res.status(500).json({ success: false, error: error.message || \"Internal server error\" });\n }\n }\n };\n\n protected findItems = async (req: Request, res: Response) => {\n console.log('=== FIND ITEMS CALLED ===');\n console.log('Query:', JSON.stringify(req.query));\n console.log('Path:', req.path);\n console.log('Method:', req.method);\n\n const libOperations = this.lib.operations;\n this.logger.default('Finding Items', { query: req.query, params: req.params, locals: res.locals });\n\n try {\n const query: ParsedQuery = req.query as unknown as ParsedQuery;\n const finder = query['finder'] as string;\n const finderParams = query['finderParams'] as string;\n const one = query['one'] as string;\n\n if (finder) {\n // If finder is defined? Call a finder.\n console.log('=== FINDER REQUEST ===');\n console.log('Finder:', finder);\n console.log('Finder Params:', finderParams);\n console.log('One:', one);\n this.logger.default('Finding Items with Finder %s %j one:%s', finder, finderParams, one);\n\n let parsedParams: any;\n try {\n parsedParams = finderParams ? JSON.parse(finderParams) : {};\n } catch (parseError: any) {\n res.status(400).json({\n error: 'Invalid JSON in finderParams',\n message: parseError.message\n });\n return;\n }\n\n // Parse pagination options from query parameters\n const findOptions: FindOptions | undefined =\n (req.query.limit || req.query.offset) ? {\n ...(req.query.limit && { limit: parseInt(req.query.limit as string, 10) }),\n ...(req.query.offset && { offset: parseInt(req.query.offset as string, 10) }),\n } : (void 0);\n\n if (one === 'true') {\n const item = await (this.lib as any).findOne(finder, parsedParams);\n // Wrap findOne result in FindOperationResult format\n const validatedItem = item ? (validatePK(item, this.getPkType()) as Item<S>) : null;\n const result: FindOperationResult<Item<S>> = {\n items: validatedItem ? [validatedItem] : [],\n metadata: {\n total: validatedItem ? 1 : 0,\n returned: validatedItem ? 1 : 0,\n offset: 0,\n hasMore: false\n }\n };\n res.json(result);\n } else {\n // Call find() with pagination options - it returns FindOperationResult\n console.log('=== CALLING libOperations.find ===');\n console.log('Finder:', finder);\n console.log('Parsed Params:', JSON.stringify(parsedParams));\n console.log('Find Options:', JSON.stringify(findOptions));\n\n let result: FindOperationResult<Item<S>>;\n try {\n console.log('About to call libOperations.find...');\n result = await libOperations.find(finder, parsedParams, [], findOptions);\n console.log('libOperations.find SUCCESS - got result:', {\n itemCount: result?.items?.length,\n total: result?.metadata?.total\n });\n } catch (findError: any) {\n console.error('=== ERROR IN libOperations.find ===');\n console.error('Error:', findError);\n console.error('Error Message:', findError?.message);\n console.error('Error Stack:', findError?.stack);\n this.logger.error('Error calling libOperations.find', {\n finder,\n parsedParams,\n findOptions,\n errorMessage: findError?.message,\n errorName: findError?.name,\n errorStack: findError?.stack,\n errorCause: findError?.cause\n });\n throw findError;\n }\n\n // Validate items - validatePK can handle arrays\n console.log('=== VALIDATING ITEMS ===');\n console.log('Item count:', result.items?.length);\n\n let validatedItems: Item<S>[];\n try {\n validatedItems = validatePK(result.items, this.getPkType()) as Item<S>[];\n console.log('Validation SUCCESS - validated items:', validatedItems.length);\n } catch (validationError: any) {\n console.error('=== ERROR IN VALIDATION ===');\n console.error('Validation Error:', validationError);\n console.error('Error Message:', validationError?.message);\n console.error('Error Stack:', validationError?.stack);\n this.logger.error('Error validating items from find result', {\n finder,\n itemCount: result.items?.length,\n firstItem: result.items?.[0],\n errorMessage: validationError?.message,\n errorName: validationError?.name,\n errorStack: validationError?.stack\n });\n throw validationError;\n }\n\n console.log('=== SENDING RESPONSE ===');\n console.log('Items:', validatedItems.length);\n console.log('Metadata:', JSON.stringify(result.metadata));\n\n res.json({\n items: validatedItems,\n metadata: result.metadata\n });\n\n console.log('=== RESPONSE SENT ===');\n }\n } else {\n // TODO: This is once of the more important places to perform some validaation and feedback\n const itemQuery: ItemQuery = paramsToQuery(req.query as QueryParams);\n this.logger.default('Finding Items with a query %j', itemQuery);\n\n // Parse pagination options from query params\n const allOptions: AllOptions = {};\n if (req.query.limit) {\n allOptions.limit = parseInt(req.query.limit as string, 10);\n }\n if (req.query.offset) {\n allOptions.offset = parseInt(req.query.offset as string, 10);\n }\n\n // libOperations.all() now returns AllOperationResult<V>\n const result = await libOperations.all(itemQuery, [], allOptions);\n\n // Validate PKs on returned items\n const validatedItems = result.items.map((item: Item<S>) => validatePK(item, this.getPkType()));\n\n // Return full AllOperationResult structure with validated items\n res.json({\n items: validatedItems,\n metadata: result.metadata\n });\n }\n } catch (error: any) {\n // Enhanced error logging to capture the actual error details\n const originalError = error?.cause || error;\n const errorMessage = error?.message || originalError?.message || String(error) || 'Internal server error';\n // Extract all error properties that can be serialized\n const errorProps: Record<string, any> = {};\n if (error) {\n Object.getOwnPropertyNames(error).forEach(key => {\n try {\n const value = (error as any)[key];\n // Only include serializable values\n if (typeof value !== 'function' && typeof value !== 'object') {\n errorProps[key] = value;\n } else if (key === 'stack' || key === 'message' || key === 'cause') {\n errorProps[key] = value;\n }\n } catch {\n // Skip properties that can't be accessed\n }\n });\n }\n\n const errorDetails = {\n errorMessage,\n errorName: error?.name || originalError?.name,\n errorCode: error?.code || originalError?.code,\n errorStack: error?.stack || originalError?.stack,\n errorString: String(error),\n errorType: error?.constructor?.name,\n errorProps,\n errorCause: error?.cause ? {\n message: error.cause?.message,\n name: error.cause?.name,\n stack: error.cause?.stack\n } : void 0,\n finder: (req.query as any)?.finder,\n finderParams: (req.query as any)?.finderParams,\n requestPath: req.path,\n requestMethod: req.method\n };\n\n // Log with multiple levels to ensure we see it\n // Serialize error properly - errors don't serialize well, so log each property separately\n console.error('=== ERROR IN findItems ===');\n console.error('Error object:', error);\n console.error('Error message:', errorMessage);\n console.error('Error name:', error?.name);\n console.error('Error code:', error?.code);\n console.error('Error stack:', error?.stack);\n console.error('Error cause:', error?.cause);\n console.error('Error string:', String(error));\n console.error('Full error details:', JSON.stringify(errorDetails, null, 2));\n console.error('=== END ERROR ===\\n\\n');\n\n // Log to structured logger with serializable data only (don't pass errorDetails directly)\n this.logger.error('Error in findItems', {\n errorMessage,\n errorName: errorDetails.errorName,\n errorCode: errorDetails.errorCode,\n errorStack: errorDetails.errorStack,\n errorType: errorDetails.errorType,\n errorProps: errorDetails.errorProps,\n errorCause: errorDetails.errorCause,\n finder: errorDetails.finder,\n finderParams: errorDetails.finderParams,\n requestPath: errorDetails.requestPath,\n requestMethod: errorDetails.requestMethod\n });\n\n if (error instanceof NotFoundError || error?.name === 'NotFoundError') {\n res.status(404).json({ error: errorMessage });\n } else {\n // Include more details in development, but keep it generic in production\n const isDevelopment = process.env.NODE_ENV === 'development';\n res.status(500).json({\n error: errorMessage,\n ...(isDevelopment && {\n details: errorDetails.errorName,\n stack: errorDetails.errorStack\n })\n });\n }\n }\n };\n\n}\n"],
5
+ "mappings": "AAAA,SAAwE,eAAoC,kBAAkB;AAE9H,SAAS,kBAAqC;AAC9C,SAAkB,qBAAqB;AAMhC,MAAM,oBAAyD,WAAc;AAAA,EAElF,YAAY,KAAoB,SAAY,UAAmE,CAAC,GAAG;AACjH,UAAM,KAAY,SAAS,OAAO;AAAA,EACpC;AAAA,EAEO,MAAM,KAA0B;AACrC,UAAM,MAAM,KAAK,MAAM,GAAG;AAC1B,WAAO;AAAA,EACT;AAAA;AAAA,EAGO,aAAa,OAAO,KAAc,KAAe,SAAe;AACrE,UAAM,gBAAgB,KAAK,IAAI;AAC/B,SAAK,OAAO,QAAQ,iBAAiB,EAAE,MAAM,IAAI,MAAM,OAAO,IAAI,OAAO,QAAQ,IAAI,QAAQ,QAAQ,IAAI,OAAO,CAAC;AAEjH,QAAI;AACF,YAAM,eAAe,KAAK,aAAa,IAAI,IAAe;AAC1D,UAAI,OAAO,WAAW,MAAM,cAAc,OAAO,YAAY,GAAG,KAAK,UAAU,CAAC;AAChF,aAAO,MAAM,KAA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"4.4.71",
4
+ "version": "4.4.73",
5
5
  "keywords": [
6
6
  "express",
7
7
  "router",
@@ -34,10 +34,10 @@
34
34
  "docs:test": "cd docs && npm run test"
35
35
  },
36
36
  "dependencies": {
37
- "@fjell/core": "^4.4.66",
38
- "@fjell/lib": "^4.4.75",
37
+ "@fjell/core": "^4.4.68",
38
+ "@fjell/lib": "^4.4.77",
39
39
  "@fjell/logging": "^4.4.59",
40
- "@fjell/registry": "^4.4.72",
40
+ "@fjell/registry": "^4.4.74",
41
41
  "deepmerge": "^4.3.1",
42
42
  "express": "^5.1.0"
43
43
  },