@campxdev/server-shared 2.1.39 → 2.1.41
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/dist/common/filters/unhandled-exception.filter.d.ts +16 -0
- package/dist/common/filters/unhandled-exception.filter.d.ts.map +1 -0
- package/dist/common/filters/unhandled-exception.filter.js +50 -0
- package/dist/common/filters/unhandled-exception.filter.js.map +1 -0
- package/dist/common/index.d.ts +1 -0
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +1 -0
- package/dist/common/index.js.map +1 -1
- package/dist/sentry/sentry-http.filter.js +22 -22
- package/dist/sentry/sentry-http.filter.js.map +1 -1
- package/dist/sentry/sentry-rpc.filter.d.ts +9 -1
- package/dist/sentry/sentry-rpc.filter.d.ts.map +1 -1
- package/dist/sentry/sentry-rpc.filter.js +55 -22
- package/dist/sentry/sentry-rpc.filter.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ArgumentsHost, ExceptionFilter } from '@nestjs/common';
|
|
2
|
+
/**
|
|
3
|
+
* Fallback RPC exception filter for microservices.
|
|
4
|
+
* Use this when Sentry is not configured or you want to disable Sentry error tracking.
|
|
5
|
+
*
|
|
6
|
+
* USAGE (in microservice main.ts):
|
|
7
|
+
* app.useGlobalFilters(new UnhandledExceptionFilter());
|
|
8
|
+
*
|
|
9
|
+
* NOTE: This is mutually exclusive with SentryRpcFilter.
|
|
10
|
+
* Use one or the other — never both at the same time.
|
|
11
|
+
* When using SentryRpcFilter (via APP_FILTER in app.module.ts), keep this commented out.
|
|
12
|
+
*/
|
|
13
|
+
export declare class UnhandledExceptionFilter<T extends Error> implements ExceptionFilter {
|
|
14
|
+
catch(exception: T, host: ArgumentsHost): void;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=unhandled-exception.filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unhandled-exception.filter.d.ts","sourceRoot":"","sources":["../../../src/common/filters/unhandled-exception.filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAS,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGvE;;;;;;;;;;GAUG;AACH,qBACa,wBAAwB,CAAC,CAAC,SAAS,KAAK,CAAE,YAAW,eAAe;IAC/E,KAAK,CAAC,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,aAAa;CAuBxC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.UnhandledExceptionFilter = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
/**
|
|
13
|
+
* Fallback RPC exception filter for microservices.
|
|
14
|
+
* Use this when Sentry is not configured or you want to disable Sentry error tracking.
|
|
15
|
+
*
|
|
16
|
+
* USAGE (in microservice main.ts):
|
|
17
|
+
* app.useGlobalFilters(new UnhandledExceptionFilter());
|
|
18
|
+
*
|
|
19
|
+
* NOTE: This is mutually exclusive with SentryRpcFilter.
|
|
20
|
+
* Use one or the other — never both at the same time.
|
|
21
|
+
* When using SentryRpcFilter (via APP_FILTER in app.module.ts), keep this commented out.
|
|
22
|
+
*/
|
|
23
|
+
let UnhandledExceptionFilter = class UnhandledExceptionFilter {
|
|
24
|
+
catch(exception, host) {
|
|
25
|
+
console.log(exception);
|
|
26
|
+
const status = exception['status'];
|
|
27
|
+
const response = exception['response'];
|
|
28
|
+
if (status && response) {
|
|
29
|
+
throw new microservices_1.RpcException({
|
|
30
|
+
statusCode: status,
|
|
31
|
+
response: response,
|
|
32
|
+
message: exception.message,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
throw new microservices_1.RpcException({
|
|
36
|
+
statusCode: 500,
|
|
37
|
+
response: {
|
|
38
|
+
statusCode: 500,
|
|
39
|
+
error: 'Internal Server Error',
|
|
40
|
+
message: exception.message,
|
|
41
|
+
},
|
|
42
|
+
message: exception.message,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.UnhandledExceptionFilter = UnhandledExceptionFilter;
|
|
47
|
+
exports.UnhandledExceptionFilter = UnhandledExceptionFilter = __decorate([
|
|
48
|
+
(0, common_1.Catch)()
|
|
49
|
+
], UnhandledExceptionFilter);
|
|
50
|
+
//# sourceMappingURL=unhandled-exception.filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unhandled-exception.filter.js","sourceRoot":"","sources":["../../../src/common/filters/unhandled-exception.filter.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAuE;AACvE,yDAAqD;AAErD;;;;;;;;;;GAUG;AAEI,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACnC,KAAK,CAAC,SAAY,EAAE,IAAmB;QACrC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACvB,MAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;QACnC,MAAM,QAAQ,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;QAEvC,IAAI,MAAM,IAAI,QAAQ,EAAE,CAAC;YACvB,MAAM,IAAI,4BAAY,CAAC;gBACrB,UAAU,EAAE,MAAM;gBAClB,QAAQ,EAAE,QAAQ;gBAClB,OAAO,EAAE,SAAS,CAAC,OAAO;aAC3B,CAAC,CAAC;QACL,CAAC;QAED,MAAM,IAAI,4BAAY,CAAC;YACrB,UAAU,EAAE,GAAG;YACf,QAAQ,EAAE;gBACR,UAAU,EAAE,GAAG;gBACf,KAAK,EAAE,uBAAuB;gBAC9B,OAAO,EAAE,SAAS,CAAC,OAAO;aAC3B;YACD,OAAO,EAAE,SAAS,CAAC,OAAO;SAC3B,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAxBY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,cAAK,GAAE;GACK,wBAAwB,CAwBpC"}
|
package/dist/common/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './decorators/batch-validation.decorator';
|
|
2
2
|
export * from './decorators/request.decorators';
|
|
3
3
|
export * from './decorators/time-validation.decorator';
|
|
4
|
+
export * from './filters/unhandled-exception.filter';
|
|
4
5
|
export * from './guards/guard';
|
|
5
6
|
export * from './interceptors/request.interceptor';
|
|
6
7
|
export * from './interfaces/context.interface';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,yCAAyC,CAAC;AACxD,cAAc,iCAAiC,CAAC;AAChD,cAAc,wCAAwC,CAAC;AACvD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,yCAAyC,CAAC;AACxD,cAAc,iCAAiC,CAAC;AAChD,cAAc,wCAAwC,CAAC;AACvD,cAAc,sCAAsC,CAAC;AACrD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC"}
|
package/dist/common/index.js
CHANGED
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./decorators/batch-validation.decorator"), exports);
|
|
18
18
|
__exportStar(require("./decorators/request.decorators"), exports);
|
|
19
19
|
__exportStar(require("./decorators/time-validation.decorator"), exports);
|
|
20
|
+
__exportStar(require("./filters/unhandled-exception.filter"), exports);
|
|
20
21
|
__exportStar(require("./guards/guard"), exports);
|
|
21
22
|
__exportStar(require("./interceptors/request.interceptor"), exports);
|
|
22
23
|
__exportStar(require("./interfaces/context.interface"), exports);
|
package/dist/common/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0EAAwD;AACxD,kEAAgD;AAChD,yEAAuD;AACvD,iDAA+B;AAC/B,qEAAmD;AACnD,iEAA+C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0EAAwD;AACxD,kEAAgD;AAChD,yEAAuD;AACvD,uEAAqD;AACrD,iDAA+B;AAC/B,qEAAmD;AACnD,iEAA+C"}
|
|
@@ -50,28 +50,28 @@ let SentryHttpFilter = class SentryHttpFilter {
|
|
|
50
50
|
const response = ctx.getResponse();
|
|
51
51
|
const request = ctx.getRequest();
|
|
52
52
|
const status = exception instanceof common_1.HttpException ? exception.getStatus() : common_1.HttpStatus.INTERNAL_SERVER_ERROR;
|
|
53
|
-
/**
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
53
|
+
/** Capture 3xx, 4xx, 5xx to Sentry — ignore 2xx success responses */
|
|
54
|
+
if (status >= 300) {
|
|
55
|
+
Sentry.withScope((scope) => {
|
|
56
|
+
const user = (0, user_context_1.getUserData)();
|
|
57
|
+
const tenant = (0, tenant_context_1.getTenantDetailsIfExists)();
|
|
58
|
+
if (user) {
|
|
59
|
+
scope.setUser({
|
|
60
|
+
id: String(user.userId || user.id),
|
|
61
|
+
email: user.email,
|
|
62
|
+
username: user.fullName || user.username,
|
|
63
|
+
});
|
|
64
|
+
scope.setTag('user_db_id', String(user.id));
|
|
65
|
+
}
|
|
66
|
+
if (tenant) {
|
|
67
|
+
scope.setTag('tenant_id', tenant.id);
|
|
68
|
+
scope.setTag('tenant_name', tenant.name);
|
|
69
|
+
}
|
|
70
|
+
scope.setTag('http.method', request.method);
|
|
71
|
+
scope.setTag('http.url', request.url);
|
|
72
|
+
Sentry.captureException(exception);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
75
|
/** Re-throw or send response as Nest would */
|
|
76
76
|
if (exception instanceof common_1.HttpException) {
|
|
77
77
|
return response.status(status).json(exception.getResponse());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentry-http.filter.js","sourceRoot":"","sources":["../../src/sentry/sentry-http.filter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAkG;AAClG,uDAAyC;AAEzC,6EAAoF;AACpF,yEAAqE;AAG9D,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAC3B,KAAK,CAAC,SAAc,EAAE,IAAmB;QACvC,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAChC,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,EAAY,CAAC;QAC7C,MAAM,OAAO,GAAG,GAAG,CAAC,UAAU,EAAW,CAAC;QAE1C,MAAM,MAAM,GAAG,SAAS,YAAY,sBAAa,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC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C;oBACX,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;oBACrC,KAAK,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;gBAC3C,CAAC;gBAED,KAAK,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;gBAC5C,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;gBAEtC,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;YACrC,CAAC,CAAC,CAAC;QACL,CAAC;QAED,8CAA8C;QAC9C,IAAI,SAAS,YAAY,sBAAa,EAAE,CAAC;YACvC,OAAO,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC;QAC/D,CAAC;QAED,OAAO,QAAQ,CAAC,MAAM,CAAC,mBAAU,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC;YAC5D,UAAU,EAAE,mBAAU,CAAC,qBAAqB;YAC5C,OAAO,EAAE,SAAS,CAAC,OAAO,IAAI,uBAAuB;SACtD,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AA7CY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,cAAK,GAAE;GACK,gBAAgB,CA6C5B"}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { ArgumentsHost, ExceptionFilter } from '@nestjs/common';
|
|
2
|
+
/**
|
|
3
|
+
* Enhanced Sentry RPC Filter that replaces the old UnhandledExceptionFilter.
|
|
4
|
+
* It captures 5xx exceptions to Sentry with full context and ensures the original
|
|
5
|
+
* status code and response are preserved for the API Gateway.
|
|
6
|
+
*
|
|
7
|
+
* IMPORTANT: Uses synchronous `throw` (not `throwError` Observable) so NestJS's
|
|
8
|
+
* RabbitMQ transport correctly serializes the RpcException back to the gateway.
|
|
9
|
+
*/
|
|
2
10
|
export declare class SentryRpcFilter implements ExceptionFilter {
|
|
3
|
-
catch(exception: any, host: ArgumentsHost):
|
|
11
|
+
catch(exception: any, host: ArgumentsHost): void;
|
|
4
12
|
}
|
|
5
13
|
//# sourceMappingURL=sentry-rpc.filter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentry-rpc.filter.d.ts","sourceRoot":"","sources":["../../src/sentry/sentry-rpc.filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAS,eAAe,
|
|
1
|
+
{"version":3,"file":"sentry-rpc.filter.d.ts","sourceRoot":"","sources":["../../src/sentry/sentry-rpc.filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAS,eAAe,EAAiB,MAAM,gBAAgB,CAAC;AAMtF;;;;;;;GAOG;AACH,qBACa,eAAgB,YAAW,eAAe;IACrD,KAAK,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa;CAyD1C"}
|
|
@@ -43,33 +43,66 @@ exports.SentryRpcFilter = void 0;
|
|
|
43
43
|
const common_1 = require("@nestjs/common");
|
|
44
44
|
const microservices_1 = require("@nestjs/microservices");
|
|
45
45
|
const Sentry = __importStar(require("@sentry/nestjs"));
|
|
46
|
-
const rxjs_1 = require("rxjs");
|
|
47
46
|
const tenant_context_1 = require("../request-store/contexts/tenant-context");
|
|
48
47
|
const user_context_1 = require("../request-store/contexts/user-context");
|
|
48
|
+
/**
|
|
49
|
+
* Enhanced Sentry RPC Filter that replaces the old UnhandledExceptionFilter.
|
|
50
|
+
* It captures 5xx exceptions to Sentry with full context and ensures the original
|
|
51
|
+
* status code and response are preserved for the API Gateway.
|
|
52
|
+
*
|
|
53
|
+
* IMPORTANT: Uses synchronous `throw` (not `throwError` Observable) so NestJS's
|
|
54
|
+
* RabbitMQ transport correctly serializes the RpcException back to the gateway.
|
|
55
|
+
*/
|
|
49
56
|
let SentryRpcFilter = class SentryRpcFilter {
|
|
50
57
|
catch(exception, host) {
|
|
51
|
-
/**
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
58
|
+
/** 1. Extract status and response from the exception */
|
|
59
|
+
const status = exception instanceof common_1.HttpException
|
|
60
|
+
? exception.getStatus()
|
|
61
|
+
: (exception['status'] || 500);
|
|
62
|
+
const response = exception instanceof common_1.HttpException
|
|
63
|
+
? exception.getResponse()
|
|
64
|
+
: (exception['response'] || null);
|
|
65
|
+
/** 2. Report to Sentry for 3xx, 4xx, 5xx — ignore 2xx success responses */
|
|
66
|
+
if (status >= 300 || !(exception instanceof common_1.HttpException)) {
|
|
67
|
+
Sentry.withScope((scope) => {
|
|
68
|
+
const user = (0, user_context_1.getUserData)();
|
|
69
|
+
const tenant = (0, tenant_context_1.getTenantDetailsIfExists)();
|
|
70
|
+
if (user) {
|
|
71
|
+
scope.setUser({
|
|
72
|
+
id: String(user.userId || user.id),
|
|
73
|
+
email: user.email,
|
|
74
|
+
});
|
|
75
|
+
scope.setTag('user_db_id', String(user.id));
|
|
76
|
+
}
|
|
77
|
+
if (tenant) {
|
|
78
|
+
scope.setTag('tenant_id', tenant.id);
|
|
79
|
+
}
|
|
80
|
+
scope.setTag('transport', 'microservice');
|
|
81
|
+
Sentry.captureException(exception);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
/** 3. Already an RpcException — re-throw as-is */
|
|
85
|
+
if (exception instanceof microservices_1.RpcException) {
|
|
86
|
+
throw exception;
|
|
71
87
|
}
|
|
72
|
-
|
|
88
|
+
/** 4. HttpException (400, 404, 422, 500, etc.) — wrap with statusCode + response preserved */
|
|
89
|
+
if (status && response) {
|
|
90
|
+
throw new microservices_1.RpcException({
|
|
91
|
+
statusCode: status,
|
|
92
|
+
response: response,
|
|
93
|
+
message: exception.message,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/** 5. Unknown error fallback */
|
|
97
|
+
throw new microservices_1.RpcException({
|
|
98
|
+
statusCode: 500,
|
|
99
|
+
response: {
|
|
100
|
+
statusCode: 500,
|
|
101
|
+
error: 'Internal Server Error',
|
|
102
|
+
message: exception.message,
|
|
103
|
+
},
|
|
104
|
+
message: exception.message,
|
|
105
|
+
});
|
|
73
106
|
}
|
|
74
107
|
};
|
|
75
108
|
exports.SentryRpcFilter = SentryRpcFilter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentry-rpc.filter.js","sourceRoot":"","sources":["../../src/sentry/sentry-rpc.filter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"sentry-rpc.filter.js","sourceRoot":"","sources":["../../src/sentry/sentry-rpc.filter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAsF;AACtF,yDAAqD;AACrD,uDAAyC;AACzC,6EAAoF;AACpF,yEAAqE;AAErE;;;;;;;GAOG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,KAAK,CAAC,SAAc,EAAE,IAAmB;QACvC,wDAAwD;QACxD,MAAM,MAAM,GAAG,SAAS,YAAY,sBAAa;YAC/C,CAAC,CAAC,SAAS,CAAC,SAAS,EAAE;YACvB,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,CAAC;QACjC,MAAM,QAAQ,GAAG,SAAS,YAAY,sBAAa;YACjD,CAAC,CAAC,SAAS,CAAC,WAAW,EAAE;YACzB,CAAC,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,CAAC;QAEpC,2EAA2E;QAC3E,IAAI,MA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