@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.
- package/interceptors/logging-service.interceptor.js +2 -2
- package/interceptors/rpc.interceptor.d.ts +0 -1
- package/interceptors/rpc.interceptor.js +9 -21
- package/interfaces/exception.js +3 -3
- package/interfaces/http.d.ts +15 -0
- package/modules/graceful-shutdown/graceful-shutdown.module.js +2 -2
- package/modules/graceful-shutdown/graceful-shutdown.rmq.d.ts +1 -1
- package/modules/graceful-shutdown/graceful-shutdown.service.js +2 -2
- package/modules/redis.module.js +2 -2
- package/package.json +1 -1
- package/pipes/rpc-validation.pipe.js +2 -2
|
@@ -188,7 +188,7 @@ let LoggingServiceInterceptor = class LoggingServiceInterceptor {
|
|
|
188
188
|
}));
|
|
189
189
|
}
|
|
190
190
|
};
|
|
191
|
-
|
|
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
|
|
162
|
+
return rxjs_1.EMPTY;
|
|
164
163
|
}
|
|
165
164
|
if (!staticRetryCount && reDeliveryCount > 0) {
|
|
166
165
|
// 직접 메시지가 재시도 처리가 된 경우에는 로그만 남기고 처리하지 않음
|
|
167
|
-
msaLogger.debug(
|
|
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
|
-
|
|
177
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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;
|
package/interfaces/exception.js
CHANGED
|
@@ -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
|
|
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;
|
package/interfaces/http.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
98
|
-
exports.GracefulShutdownService = GracefulShutdownService = __decorate([
|
|
97
|
+
GracefulShutdownService = __decorate([
|
|
99
98
|
(0, common_1.Injectable)()
|
|
100
99
|
], GracefulShutdownService);
|
|
100
|
+
exports.GracefulShutdownService = GracefulShutdownService;
|
package/modules/redis.module.js
CHANGED
|
@@ -15,10 +15,10 @@ const redisProvider = {
|
|
|
15
15
|
};
|
|
16
16
|
let RedisModule = class RedisModule {
|
|
17
17
|
};
|
|
18
|
-
|
|
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
|
@@ -31,8 +31,8 @@ let ValidationPipe = class ValidationPipe {
|
|
|
31
31
|
return value;
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
|
|
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;
|