jr-common-micro 1.1.28 → 1.1.29

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.
@@ -49,7 +49,7 @@ export declare function fetchScrappingData<T>(fetchFn: (params: any) => Promise<
49
49
  data: string;
50
50
  }>): Promise<T>;
51
51
  export declare function getGrpcClient(packageName: string, grpcHost: string, grpcPort: string): import("@nestjs/microservices").ClientGrpcProxy;
52
- export declare function getStatus(codeSuccess: number, codeError: number, logger: any, data: any, text: string, logOnSuccess?: boolean): {
52
+ export declare function getStatus(codeSuccess: number, codeError: number, logger: any, data: any, text: string, logOnSuccess?: boolean, elasticsearchService?: any, elasticsearch_logs_index?: string, methodName?: string): {
53
53
  code: number;
54
54
  };
55
55
  export declare const getPrismaLogMessage: (functionName: string, options?: {
@@ -349,8 +349,17 @@ function getGrpcClient(packageName, grpcHost, grpcPort) {
349
349
  },
350
350
  });
351
351
  }
352
- function getStatus(codeSuccess, codeError, logger, data, text, logOnSuccess = false) {
352
+ function getStatus(codeSuccess, codeError, logger, data, text, logOnSuccess = false, elasticsearchService, elasticsearch_logs_index, methodName) {
353
353
  if (isEmptyAtAll(data)) {
354
+ if (elasticsearchService && elasticsearch_logs_index) {
355
+ elasticsearchService.log(elasticsearch_logs_index, {
356
+ action: 'getStatus',
357
+ method: methodName,
358
+ status: 'error',
359
+ message: `getStatus function Error: ${text}`,
360
+ timestamp: new Date(),
361
+ });
362
+ }
354
363
  logger.error(`getStatus function Error: ${text} `);
355
364
  return {
356
365
  code: codeError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jr-common-micro",
3
- "version": "1.1.28",
3
+ "version": "1.1.29",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,