@yolo-croket-dev/core 1.7.13 → 1.7.15

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.
@@ -188,7 +188,7 @@ let LoggingServiceInterceptor = class LoggingServiceInterceptor {
188
188
  }));
189
189
  }
190
190
  };
191
- exports.LoggingServiceInterceptor = LoggingServiceInterceptor;
192
- exports.LoggingServiceInterceptor = LoggingServiceInterceptor = __decorate([
191
+ LoggingServiceInterceptor = __decorate([
193
192
  (0, common_1.Injectable)()
194
193
  ], LoggingServiceInterceptor);
194
+ exports.LoggingServiceInterceptor = LoggingServiceInterceptor;
@@ -5,7 +5,6 @@ import { GracefulShutdownService } from '../modules/graceful-shutdown/graceful-s
5
5
  export declare class RPCInterceptor implements NestInterceptor {
6
6
  private readonly reflector;
7
7
  private readonly gracefulShutdownService;
8
- private readonly STATIC_NOT_DEFINE_RETRY_ATTEMPT;
9
8
  constructor(reflector: Reflector, gracefulShutdownService: GracefulShutdownService);
10
9
  private maxLengthOverShorten;
11
10
  private updateMaxLengthArrayShorten;
@@ -52,7 +52,6 @@ let RPCInterceptor = class RPCInterceptor {
52
52
  constructor(reflector, gracefulShutdownService) {
53
53
  this.reflector = reflector;
54
54
  this.gracefulShutdownService = gracefulShutdownService;
55
- this.STATIC_NOT_DEFINE_RETRY_ATTEMPT = 3;
56
55
  }
57
56
  maxLengthOverShorten(data) {
58
57
  if (typeof data !== 'string') {
@@ -160,11 +159,11 @@ let RPCInterceptor = class RPCInterceptor {
160
159
  if (this.gracefulShutdownService.isApplicationExit) {
161
160
  msaLogger.debug('RPCInterceptor isApplicationExit called', { traceId: 'IS_APPLICATION_EXIT' });
162
161
  channel.cancel(message.fields.consumerTag);
163
- return new rxjs_1.Observable();
162
+ return rxjs_1.EMPTY;
164
163
  }
165
164
  if (!staticRetryCount && reDeliveryCount > 0) {
166
165
  // 직접 메시지가 재시도 처리가 된 경우에는 로그만 남기고 처리하지 않음
167
- msaLogger.debug(`RETRY_COUNT_ZERO_OR_NO_RETRY 발생 전, 재시도 처리 (${reDeliveryCount}/${this.STATIC_NOT_DEFINE_RETRY_ATTEMPT})`, { traceId: ((_b = content.data.param) === null || _b === void 0 ? void 0 : _b.traceId) || 'RETRY_COUNT_ZERO_OR_NO_RETRY' }, {
166
+ msaLogger.debug('RETRY_COUNT_ZERO_OR_NO_RETRY 발생 전, redelivery 발생', { traceId: ((_b = content.data.param) === null || _b === void 0 ? void 0 : _b.traceId) || 'RETRY_COUNT_ZERO_OR_NO_RETRY' }, {
168
167
  messagePattern: method,
169
168
  properties: message.properties,
170
169
  fields: message.fields,
@@ -172,20 +171,9 @@ let RPCInterceptor = class RPCInterceptor {
172
171
  reDeliveryCount,
173
172
  staticRetryCount,
174
173
  });
175
- // 무한 재시도가 일어날 수 있으므로 재시도 카운트가 지정되지 않은 이벤트의 경우에는 횟수로 재실행 할 수 있도록
176
- if (reDeliveryCount >= this.STATIC_NOT_DEFINE_RETRY_ATTEMPT) {
177
- channel.sendToQueue(message.properties.replyTo, Buffer.from(JSON.stringify({
178
- isError: true,
179
- message: 'RETRY_COUNT_ZERO_OR_NO_RETRY',
180
- status: 500,
181
- duration: Date.now() - now,
182
- arg,
183
- timestamp: new Date(),
184
- })), { correlationId: message.properties.correlationId });
185
- channel.nack(message, false, false); /** 아마도 기본 30분 타임아웃이 지나고 새로 들어오면 발생할 예정, DLQ로 이동 */
186
- message.properties.replyTo = undefined; /** replyTo가 존재하면 sendToQueue가 호출되므로, 삭제해주기 */
187
- return new rxjs_1.Observable();
188
- }
174
+ channel.nack(message, false, false); /** 아마도 기본 30분 타임아웃이 지나고 새로 들어오면 발생할 예정, DLQ로 이동 */
175
+ message.properties.replyTo = undefined; /** replyTo가 존재하면 sendToQueue가 호출되므로, 삭제해주기 */
176
+ return rxjs_1.EMPTY;
189
177
  }
190
178
  const noAck = message.fields.routingKey.includes('ASYNC');
191
179
  let localErrorProcessor = async (err) => {
@@ -252,7 +240,7 @@ let RPCInterceptor = class RPCInterceptor {
252
240
  if (!noAck && !isAck) {
253
241
  channel.ack(message);
254
242
  }
255
- return new rxjs_1.Observable();
243
+ return rxjs_1.EMPTY;
256
244
  };
257
245
  localErrorProcessor = localErrorProcessor.bind(this);
258
246
  /** 파일 객체 처리 */
@@ -273,7 +261,7 @@ let RPCInterceptor = class RPCInterceptor {
273
261
  }
274
262
  catch (err) {
275
263
  await localErrorProcessor(err);
276
- return new rxjs_1.Observable();
264
+ return rxjs_1.EMPTY;
277
265
  }
278
266
  }
279
267
  if (content.pattern === 'UPLOAD_FILE') {
@@ -314,9 +302,9 @@ let RPCInterceptor = class RPCInterceptor {
314
302
  }));
315
303
  }
316
304
  };
317
- exports.RPCInterceptor = RPCInterceptor;
318
- exports.RPCInterceptor = RPCInterceptor = __decorate([
305
+ RPCInterceptor = __decorate([
319
306
  (0, common_1.Injectable)(),
320
307
  __metadata("design:paramtypes", [core_1.Reflector,
321
308
  graceful_shutdown_service_1.GracefulShutdownService])
322
309
  ], RPCInterceptor);
310
+ exports.RPCInterceptor = RPCInterceptor;
@@ -18,10 +18,9 @@ var ErrActionTypeEnum;
18
18
  ErrActionTypeEnum["LEGACY_SHOW_TOAST"] = "LEGACY_SHOW_TOAST";
19
19
  ErrActionTypeEnum["FORCE_UPDATE"] = "FORCE_UPDATE";
20
20
  ErrActionTypeEnum["UPDATE_ACCESS_TOKEN"] = "UPDATE_ACCESS_TOKEN";
21
- })(ErrActionTypeEnum || (exports.ErrActionTypeEnum = ErrActionTypeEnum = {}));
21
+ })(ErrActionTypeEnum = exports.ErrActionTypeEnum || (exports.ErrActionTypeEnum = {}));
22
22
  class ErrAction {
23
23
  }
24
- exports.ErrAction = ErrAction;
25
24
  __decorate([
26
25
  (0, swagger_1.ApiProperty)({
27
26
  description: '액션 타입',
@@ -58,9 +57,9 @@ __decorate([
58
57
  }),
59
58
  __metadata("design:type", String)
60
59
  ], ErrAction.prototype, "webViewUrl", void 0);
60
+ exports.ErrAction = ErrAction;
61
61
  class ErrInfo {
62
62
  }
63
- exports.ErrInfo = ErrInfo;
64
63
  __decorate([
65
64
  (0, swagger_1.ApiProperty)({
66
65
  description: '에러 종류 식별자',
@@ -82,3 +81,4 @@ __decorate([
82
81
  }),
83
82
  __metadata("design:type", ErrAction)
84
83
  ], ErrInfo.prototype, "action", void 0);
84
+ exports.ErrInfo = ErrInfo;
@@ -1,4 +1,5 @@
1
1
  import { Method } from 'axios';
2
+ import { ErrInfo } from './exception';
2
3
  export interface ExternalTokenValue {
3
4
  provider: string;
4
5
  client_id: string;
@@ -18,6 +19,20 @@ export interface RequestLog {
18
19
  method: Method;
19
20
  endpoint: string;
20
21
  }
22
+ /** 최신 에러 정보 */
23
+ export interface AbstractErrorResult {
24
+ code: string;
25
+ type: string;
26
+ message: string;
27
+ detail?: {
28
+ detail: string;
29
+ message: string;
30
+ duration: number;
31
+ };
32
+ timestamp: string;
33
+ errInfo: ErrInfo;
34
+ traceId: string;
35
+ }
21
36
  export interface AbstractParam {
22
37
  traceId: string;
23
38
  isAdmin?: boolean;
@@ -11,11 +11,11 @@ const common_1 = require("@nestjs/common");
11
11
  const graceful_shutdown_service_1 = require("./graceful-shutdown.service");
12
12
  let GracefulShutdownModule = class GracefulShutdownModule {
13
13
  };
14
- exports.GracefulShutdownModule = GracefulShutdownModule;
15
- exports.GracefulShutdownModule = GracefulShutdownModule = __decorate([
14
+ GracefulShutdownModule = __decorate([
16
15
  (0, common_1.Global)(),
17
16
  (0, common_1.Module)({
18
17
  providers: [graceful_shutdown_service_1.GracefulShutdownService],
19
18
  exports: [graceful_shutdown_service_1.GracefulShutdownService],
20
19
  })
21
20
  ], GracefulShutdownModule);
21
+ exports.GracefulShutdownModule = GracefulShutdownModule;
@@ -1,7 +1,7 @@
1
1
  import { RmqOptions, ServerRMQ } from '@nestjs/microservices';
2
2
  import { Channel } from 'amqp-connection-manager';
3
3
  import { ConsumeMessage } from 'amqplib';
4
- export type GracefulRmqOptions = RmqOptions['options'] & {
4
+ export declare type GracefulRmqOptions = RmqOptions['options'] & {
5
5
  waitingEndingHandlersTimeoutMs?: number;
6
6
  waitingEndingHandlersIntervalMs?: number;
7
7
  };
@@ -94,7 +94,7 @@ let GracefulShutdownService = class GracefulShutdownService {
94
94
  }
95
95
  }
96
96
  };
97
- exports.GracefulShutdownService = GracefulShutdownService;
98
- exports.GracefulShutdownService = GracefulShutdownService = __decorate([
97
+ GracefulShutdownService = __decorate([
99
98
  (0, common_1.Injectable)()
100
99
  ], GracefulShutdownService);
100
+ exports.GracefulShutdownService = GracefulShutdownService;
@@ -15,10 +15,10 @@ const redisProvider = {
15
15
  };
16
16
  let RedisModule = class RedisModule {
17
17
  };
18
- exports.RedisModule = RedisModule;
19
- exports.RedisModule = RedisModule = __decorate([
18
+ RedisModule = __decorate([
20
19
  (0, common_1.Module)({
21
20
  providers: [redisProvider],
22
21
  exports: [redisProvider],
23
22
  })
24
23
  ], RedisModule);
24
+ exports.RedisModule = RedisModule;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yolo-croket-dev/core",
3
- "version": "1.7.13",
3
+ "version": "1.7.15",
4
4
  "author": "Yolo Co., Ltd.",
5
5
  "description": "Yolo commonization module",
6
6
  "main": "index.js",
@@ -31,8 +31,8 @@ let ValidationPipe = class ValidationPipe {
31
31
  return value;
32
32
  }
33
33
  };
34
- exports.ValidationPipe = ValidationPipe;
35
- exports.ValidationPipe = ValidationPipe = __decorate([
34
+ ValidationPipe = __decorate([
36
35
  (0, common_1.Injectable)(),
37
36
  __metadata("design:paramtypes", [Object])
38
37
  ], ValidationPipe);
38
+ exports.ValidationPipe = ValidationPipe;