@vritti/api-sdk 0.1.7 → 0.1.8
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/README.md +22 -6
- package/dist/index.cjs +131 -413
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +351 -227
- package/dist/index.d.ts +351 -227
- package/dist/index.js +148 -429
- package/dist/index.js.map +1 -1
- package/package.json +14 -15
package/dist/index.cjs
CHANGED
|
@@ -34,7 +34,6 @@ __export(index_exports, {
|
|
|
34
34
|
AuthConfigModule: () => AuthConfigModule,
|
|
35
35
|
BadGatewayException: () => BadGatewayException,
|
|
36
36
|
BadRequestException: () => BadRequestException,
|
|
37
|
-
BaseFieldException: () => BaseFieldException,
|
|
38
37
|
ConflictException: () => ConflictException,
|
|
39
38
|
CorrelationIdMiddleware: () => CorrelationIdMiddleware,
|
|
40
39
|
DEFAULT_CORRELATION_HEADER: () => DEFAULT_CORRELATION_HEADER,
|
|
@@ -43,7 +42,7 @@ __export(index_exports, {
|
|
|
43
42
|
GoneException: () => GoneException,
|
|
44
43
|
HttpExceptionFilter: () => HttpExceptionFilter,
|
|
45
44
|
HttpLoggerInterceptor: () => HttpLoggerInterceptor,
|
|
46
|
-
|
|
45
|
+
HttpProblemException: () => HttpProblemException,
|
|
47
46
|
InternalServerErrorException: () => InternalServerErrorException3,
|
|
48
47
|
LOGGER_MODULE_OPTIONS: () => LOGGER_MODULE_OPTIONS,
|
|
49
48
|
LoggerModule: () => LoggerModule,
|
|
@@ -2189,384 +2188,217 @@ var import_common20 = require("@nestjs/common");
|
|
|
2189
2188
|
|
|
2190
2189
|
// src/exceptions/base-field.exception.ts
|
|
2191
2190
|
var import_common19 = require("@nestjs/common");
|
|
2192
|
-
var
|
|
2191
|
+
var HttpProblemException = class extends import_common19.HttpException {
|
|
2193
2192
|
static {
|
|
2194
|
-
__name(this, "
|
|
2195
|
-
}
|
|
2196
|
-
constructor(
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
{
|
|
2207
|
-
field: statusOrMessageOrErrors,
|
|
2208
|
-
message: messageOrStatus
|
|
2209
|
-
}
|
|
2210
|
-
];
|
|
2211
|
-
httpStatus = statusOrDetail;
|
|
2212
|
-
finalDetail = detail;
|
|
2213
|
-
} else if (typeof statusOrMessageOrErrors === "string") {
|
|
2214
|
-
errors = [
|
|
2215
|
-
{
|
|
2216
|
-
message: statusOrMessageOrErrors
|
|
2217
|
-
}
|
|
2218
|
-
];
|
|
2219
|
-
httpStatus = messageOrStatus;
|
|
2220
|
-
finalDetail = typeof statusOrDetail === "string" ? statusOrDetail : void 0;
|
|
2221
|
-
} else {
|
|
2222
|
-
errors = [
|
|
2223
|
-
{
|
|
2224
|
-
message: "An error occurred"
|
|
2225
|
-
}
|
|
2226
|
-
];
|
|
2227
|
-
httpStatus = statusOrMessageOrErrors;
|
|
2228
|
-
finalDetail = void 0;
|
|
2229
|
-
}
|
|
2230
|
-
const response = finalDetail !== void 0 ? {
|
|
2231
|
-
errors,
|
|
2232
|
-
detail: finalDetail
|
|
2233
|
-
} : {
|
|
2234
|
-
errors
|
|
2235
|
-
};
|
|
2236
|
-
super(response, httpStatus);
|
|
2193
|
+
__name(this, "HttpProblemException");
|
|
2194
|
+
}
|
|
2195
|
+
constructor(detailOrOptions, httpStatus) {
|
|
2196
|
+
const options = typeof detailOrOptions === "string" ? {
|
|
2197
|
+
detail: detailOrOptions
|
|
2198
|
+
} : detailOrOptions;
|
|
2199
|
+
super({
|
|
2200
|
+
type: options.type ?? "about:blank",
|
|
2201
|
+
label: options.label,
|
|
2202
|
+
detail: options.detail,
|
|
2203
|
+
errors: options.errors ?? []
|
|
2204
|
+
}, httpStatus);
|
|
2237
2205
|
}
|
|
2238
2206
|
};
|
|
2239
2207
|
|
|
2240
2208
|
// src/exceptions/bad-gateway.exception.ts
|
|
2241
|
-
var BadGatewayException = class extends
|
|
2209
|
+
var BadGatewayException = class extends HttpProblemException {
|
|
2242
2210
|
static {
|
|
2243
2211
|
__name(this, "BadGatewayException");
|
|
2244
2212
|
}
|
|
2245
|
-
constructor(
|
|
2246
|
-
|
|
2247
|
-
super(messageOrField, import_common20.HttpStatus.BAD_GATEWAY, fieldMessageOrDetail);
|
|
2248
|
-
} else if (detail !== void 0) {
|
|
2249
|
-
super(messageOrField, fieldMessageOrDetail, import_common20.HttpStatus.BAD_GATEWAY, detail);
|
|
2250
|
-
} else if (fieldMessageOrDetail) {
|
|
2251
|
-
super(messageOrField, fieldMessageOrDetail, import_common20.HttpStatus.BAD_GATEWAY);
|
|
2252
|
-
} else {
|
|
2253
|
-
super(messageOrField, import_common20.HttpStatus.BAD_GATEWAY);
|
|
2254
|
-
}
|
|
2213
|
+
constructor(detailOrOptions) {
|
|
2214
|
+
super(detailOrOptions ?? "Bad Gateway", import_common20.HttpStatus.BAD_GATEWAY);
|
|
2255
2215
|
}
|
|
2256
2216
|
};
|
|
2257
2217
|
|
|
2258
2218
|
// src/exceptions/bad-request.exception.ts
|
|
2259
2219
|
var import_common21 = require("@nestjs/common");
|
|
2260
|
-
var BadRequestException = class extends
|
|
2220
|
+
var BadRequestException = class extends HttpProblemException {
|
|
2261
2221
|
static {
|
|
2262
2222
|
__name(this, "BadRequestException");
|
|
2263
2223
|
}
|
|
2264
|
-
constructor(
|
|
2265
|
-
|
|
2266
|
-
super(messageOrField, import_common21.HttpStatus.BAD_REQUEST, fieldMessageOrDetail);
|
|
2267
|
-
} else if (detail !== void 0) {
|
|
2268
|
-
super(messageOrField, fieldMessageOrDetail, import_common21.HttpStatus.BAD_REQUEST, detail);
|
|
2269
|
-
} else if (fieldMessageOrDetail) {
|
|
2270
|
-
super(messageOrField, fieldMessageOrDetail, import_common21.HttpStatus.BAD_REQUEST);
|
|
2271
|
-
} else {
|
|
2272
|
-
super(messageOrField, import_common21.HttpStatus.BAD_REQUEST);
|
|
2273
|
-
}
|
|
2224
|
+
constructor(detailOrOptions) {
|
|
2225
|
+
super(detailOrOptions ?? "Bad Request", import_common21.HttpStatus.BAD_REQUEST);
|
|
2274
2226
|
}
|
|
2275
2227
|
};
|
|
2276
2228
|
|
|
2277
2229
|
// src/exceptions/conflict.exception.ts
|
|
2278
2230
|
var import_common22 = require("@nestjs/common");
|
|
2279
|
-
var ConflictException = class extends
|
|
2231
|
+
var ConflictException = class extends HttpProblemException {
|
|
2280
2232
|
static {
|
|
2281
2233
|
__name(this, "ConflictException");
|
|
2282
2234
|
}
|
|
2283
|
-
constructor(
|
|
2284
|
-
|
|
2285
|
-
super(messageOrField, import_common22.HttpStatus.CONFLICT, fieldMessageOrDetail);
|
|
2286
|
-
} else if (detail !== void 0) {
|
|
2287
|
-
super(messageOrField, fieldMessageOrDetail, import_common22.HttpStatus.CONFLICT, detail);
|
|
2288
|
-
} else if (fieldMessageOrDetail) {
|
|
2289
|
-
super(messageOrField, fieldMessageOrDetail, import_common22.HttpStatus.CONFLICT);
|
|
2290
|
-
} else {
|
|
2291
|
-
super(messageOrField, import_common22.HttpStatus.CONFLICT);
|
|
2292
|
-
}
|
|
2235
|
+
constructor(detailOrOptions) {
|
|
2236
|
+
super(detailOrOptions ?? "Conflict", import_common22.HttpStatus.CONFLICT);
|
|
2293
2237
|
}
|
|
2294
2238
|
};
|
|
2295
2239
|
|
|
2296
2240
|
// src/exceptions/forbidden.exception.ts
|
|
2297
2241
|
var import_common23 = require("@nestjs/common");
|
|
2298
|
-
var ForbiddenException2 = class extends
|
|
2242
|
+
var ForbiddenException2 = class extends HttpProblemException {
|
|
2299
2243
|
static {
|
|
2300
2244
|
__name(this, "ForbiddenException");
|
|
2301
2245
|
}
|
|
2302
|
-
constructor(
|
|
2303
|
-
|
|
2304
|
-
super(messageOrField, import_common23.HttpStatus.FORBIDDEN, fieldMessageOrDetail);
|
|
2305
|
-
} else if (detail !== void 0) {
|
|
2306
|
-
super(messageOrField, fieldMessageOrDetail, import_common23.HttpStatus.FORBIDDEN, detail);
|
|
2307
|
-
} else if (fieldMessageOrDetail) {
|
|
2308
|
-
super(messageOrField, fieldMessageOrDetail, import_common23.HttpStatus.FORBIDDEN);
|
|
2309
|
-
} else {
|
|
2310
|
-
super(messageOrField, import_common23.HttpStatus.FORBIDDEN);
|
|
2311
|
-
}
|
|
2246
|
+
constructor(detailOrOptions) {
|
|
2247
|
+
super(detailOrOptions ?? "Forbidden", import_common23.HttpStatus.FORBIDDEN);
|
|
2312
2248
|
}
|
|
2313
2249
|
};
|
|
2314
2250
|
|
|
2315
2251
|
// src/exceptions/gone.exception.ts
|
|
2316
2252
|
var import_common24 = require("@nestjs/common");
|
|
2317
|
-
var GoneException = class extends
|
|
2253
|
+
var GoneException = class extends HttpProblemException {
|
|
2318
2254
|
static {
|
|
2319
2255
|
__name(this, "GoneException");
|
|
2320
2256
|
}
|
|
2321
|
-
constructor(
|
|
2322
|
-
|
|
2323
|
-
super(messageOrField, import_common24.HttpStatus.GONE, fieldMessageOrDetail);
|
|
2324
|
-
} else if (detail !== void 0) {
|
|
2325
|
-
super(messageOrField, fieldMessageOrDetail, import_common24.HttpStatus.GONE, detail);
|
|
2326
|
-
} else if (fieldMessageOrDetail) {
|
|
2327
|
-
super(messageOrField, fieldMessageOrDetail, import_common24.HttpStatus.GONE);
|
|
2328
|
-
} else {
|
|
2329
|
-
super(messageOrField, import_common24.HttpStatus.GONE);
|
|
2330
|
-
}
|
|
2257
|
+
constructor(detailOrOptions) {
|
|
2258
|
+
super(detailOrOptions ?? "Gone", import_common24.HttpStatus.GONE);
|
|
2331
2259
|
}
|
|
2332
2260
|
};
|
|
2333
2261
|
|
|
2334
2262
|
// src/exceptions/internal-server-error.exception.ts
|
|
2335
2263
|
var import_common25 = require("@nestjs/common");
|
|
2336
|
-
var InternalServerErrorException3 = class extends
|
|
2264
|
+
var InternalServerErrorException3 = class extends HttpProblemException {
|
|
2337
2265
|
static {
|
|
2338
2266
|
__name(this, "InternalServerErrorException");
|
|
2339
2267
|
}
|
|
2340
|
-
constructor(
|
|
2341
|
-
|
|
2342
|
-
super(messageOrField, import_common25.HttpStatus.INTERNAL_SERVER_ERROR, fieldMessageOrDetail);
|
|
2343
|
-
} else if (detail !== void 0) {
|
|
2344
|
-
super(messageOrField, fieldMessageOrDetail, import_common25.HttpStatus.INTERNAL_SERVER_ERROR, detail);
|
|
2345
|
-
} else if (fieldMessageOrDetail) {
|
|
2346
|
-
super(messageOrField, fieldMessageOrDetail, import_common25.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
2347
|
-
} else {
|
|
2348
|
-
super(messageOrField, import_common25.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
2349
|
-
}
|
|
2268
|
+
constructor(detailOrOptions) {
|
|
2269
|
+
super(detailOrOptions ?? "Internal Server Error", import_common25.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
2350
2270
|
}
|
|
2351
2271
|
};
|
|
2352
2272
|
|
|
2353
2273
|
// src/exceptions/method-not-allowed.exception.ts
|
|
2354
2274
|
var import_common26 = require("@nestjs/common");
|
|
2355
|
-
var MethodNotAllowedException = class extends
|
|
2275
|
+
var MethodNotAllowedException = class extends HttpProblemException {
|
|
2356
2276
|
static {
|
|
2357
2277
|
__name(this, "MethodNotAllowedException");
|
|
2358
2278
|
}
|
|
2359
|
-
constructor(
|
|
2360
|
-
|
|
2361
|
-
super(messageOrField, import_common26.HttpStatus.METHOD_NOT_ALLOWED, fieldMessageOrDetail);
|
|
2362
|
-
} else if (detail !== void 0) {
|
|
2363
|
-
super(messageOrField, fieldMessageOrDetail, import_common26.HttpStatus.METHOD_NOT_ALLOWED, detail);
|
|
2364
|
-
} else if (fieldMessageOrDetail) {
|
|
2365
|
-
super(messageOrField, fieldMessageOrDetail, import_common26.HttpStatus.METHOD_NOT_ALLOWED);
|
|
2366
|
-
} else {
|
|
2367
|
-
super(messageOrField, import_common26.HttpStatus.METHOD_NOT_ALLOWED);
|
|
2368
|
-
}
|
|
2279
|
+
constructor(detailOrOptions) {
|
|
2280
|
+
super(detailOrOptions ?? "Method Not Allowed", import_common26.HttpStatus.METHOD_NOT_ALLOWED);
|
|
2369
2281
|
}
|
|
2370
2282
|
};
|
|
2371
2283
|
|
|
2372
2284
|
// src/exceptions/not-acceptable.exception.ts
|
|
2373
2285
|
var import_common27 = require("@nestjs/common");
|
|
2374
|
-
var NotAcceptableException = class extends
|
|
2286
|
+
var NotAcceptableException = class extends HttpProblemException {
|
|
2375
2287
|
static {
|
|
2376
2288
|
__name(this, "NotAcceptableException");
|
|
2377
2289
|
}
|
|
2378
|
-
constructor(
|
|
2379
|
-
|
|
2380
|
-
super(messageOrField, import_common27.HttpStatus.NOT_ACCEPTABLE, fieldMessageOrDetail);
|
|
2381
|
-
} else if (detail !== void 0) {
|
|
2382
|
-
super(messageOrField, fieldMessageOrDetail, import_common27.HttpStatus.NOT_ACCEPTABLE, detail);
|
|
2383
|
-
} else if (fieldMessageOrDetail) {
|
|
2384
|
-
super(messageOrField, fieldMessageOrDetail, import_common27.HttpStatus.NOT_ACCEPTABLE);
|
|
2385
|
-
} else {
|
|
2386
|
-
super(messageOrField, import_common27.HttpStatus.NOT_ACCEPTABLE);
|
|
2387
|
-
}
|
|
2290
|
+
constructor(detailOrOptions) {
|
|
2291
|
+
super(detailOrOptions ?? "Not Acceptable", import_common27.HttpStatus.NOT_ACCEPTABLE);
|
|
2388
2292
|
}
|
|
2389
2293
|
};
|
|
2390
2294
|
|
|
2391
2295
|
// src/exceptions/not-found.exception.ts
|
|
2392
2296
|
var import_common28 = require("@nestjs/common");
|
|
2393
|
-
var NotFoundException = class extends
|
|
2297
|
+
var NotFoundException = class extends HttpProblemException {
|
|
2394
2298
|
static {
|
|
2395
2299
|
__name(this, "NotFoundException");
|
|
2396
2300
|
}
|
|
2397
|
-
constructor(
|
|
2398
|
-
|
|
2399
|
-
super(messageOrField, import_common28.HttpStatus.NOT_FOUND, fieldMessageOrDetail);
|
|
2400
|
-
} else if (detail !== void 0) {
|
|
2401
|
-
super(messageOrField, fieldMessageOrDetail, import_common28.HttpStatus.NOT_FOUND, detail);
|
|
2402
|
-
} else if (fieldMessageOrDetail) {
|
|
2403
|
-
super(messageOrField, fieldMessageOrDetail, import_common28.HttpStatus.NOT_FOUND);
|
|
2404
|
-
} else {
|
|
2405
|
-
super(messageOrField, import_common28.HttpStatus.NOT_FOUND);
|
|
2406
|
-
}
|
|
2301
|
+
constructor(detailOrOptions) {
|
|
2302
|
+
super(detailOrOptions ?? "Not Found", import_common28.HttpStatus.NOT_FOUND);
|
|
2407
2303
|
}
|
|
2408
2304
|
};
|
|
2409
2305
|
|
|
2410
2306
|
// src/exceptions/not-implemented.exception.ts
|
|
2411
2307
|
var import_common29 = require("@nestjs/common");
|
|
2412
|
-
var NotImplementedException = class extends
|
|
2308
|
+
var NotImplementedException = class extends HttpProblemException {
|
|
2413
2309
|
static {
|
|
2414
2310
|
__name(this, "NotImplementedException");
|
|
2415
2311
|
}
|
|
2416
|
-
constructor(
|
|
2417
|
-
|
|
2418
|
-
super(messageOrField, import_common29.HttpStatus.NOT_IMPLEMENTED, fieldMessageOrDetail);
|
|
2419
|
-
} else if (detail !== void 0) {
|
|
2420
|
-
super(messageOrField, fieldMessageOrDetail, import_common29.HttpStatus.NOT_IMPLEMENTED, detail);
|
|
2421
|
-
} else if (fieldMessageOrDetail) {
|
|
2422
|
-
super(messageOrField, fieldMessageOrDetail, import_common29.HttpStatus.NOT_IMPLEMENTED);
|
|
2423
|
-
} else {
|
|
2424
|
-
super(messageOrField, import_common29.HttpStatus.NOT_IMPLEMENTED);
|
|
2425
|
-
}
|
|
2312
|
+
constructor(detailOrOptions) {
|
|
2313
|
+
super(detailOrOptions ?? "Not Implemented", import_common29.HttpStatus.NOT_IMPLEMENTED);
|
|
2426
2314
|
}
|
|
2427
2315
|
};
|
|
2428
2316
|
|
|
2429
2317
|
// src/exceptions/payload-too-large.exception.ts
|
|
2430
2318
|
var import_common30 = require("@nestjs/common");
|
|
2431
|
-
var PayloadTooLargeException = class extends
|
|
2319
|
+
var PayloadTooLargeException = class extends HttpProblemException {
|
|
2432
2320
|
static {
|
|
2433
2321
|
__name(this, "PayloadTooLargeException");
|
|
2434
2322
|
}
|
|
2435
|
-
constructor(
|
|
2436
|
-
|
|
2437
|
-
super(messageOrField, import_common30.HttpStatus.PAYLOAD_TOO_LARGE, fieldMessageOrDetail);
|
|
2438
|
-
} else if (detail !== void 0) {
|
|
2439
|
-
super(messageOrField, fieldMessageOrDetail, import_common30.HttpStatus.PAYLOAD_TOO_LARGE, detail);
|
|
2440
|
-
} else if (fieldMessageOrDetail) {
|
|
2441
|
-
super(messageOrField, fieldMessageOrDetail, import_common30.HttpStatus.PAYLOAD_TOO_LARGE);
|
|
2442
|
-
} else {
|
|
2443
|
-
super(messageOrField, import_common30.HttpStatus.PAYLOAD_TOO_LARGE);
|
|
2444
|
-
}
|
|
2323
|
+
constructor(detailOrOptions) {
|
|
2324
|
+
super(detailOrOptions ?? "Payload Too Large", import_common30.HttpStatus.PAYLOAD_TOO_LARGE);
|
|
2445
2325
|
}
|
|
2446
2326
|
};
|
|
2447
2327
|
|
|
2448
2328
|
// src/exceptions/request-timeout.exception.ts
|
|
2449
2329
|
var import_common31 = require("@nestjs/common");
|
|
2450
|
-
var RequestTimeoutException = class extends
|
|
2330
|
+
var RequestTimeoutException = class extends HttpProblemException {
|
|
2451
2331
|
static {
|
|
2452
2332
|
__name(this, "RequestTimeoutException");
|
|
2453
2333
|
}
|
|
2454
|
-
constructor(
|
|
2455
|
-
|
|
2456
|
-
super(messageOrField, import_common31.HttpStatus.REQUEST_TIMEOUT, fieldMessageOrDetail);
|
|
2457
|
-
} else if (detail !== void 0) {
|
|
2458
|
-
super(messageOrField, fieldMessageOrDetail, import_common31.HttpStatus.REQUEST_TIMEOUT, detail);
|
|
2459
|
-
} else if (fieldMessageOrDetail) {
|
|
2460
|
-
super(messageOrField, fieldMessageOrDetail, import_common31.HttpStatus.REQUEST_TIMEOUT);
|
|
2461
|
-
} else {
|
|
2462
|
-
super(messageOrField, import_common31.HttpStatus.REQUEST_TIMEOUT);
|
|
2463
|
-
}
|
|
2334
|
+
constructor(detailOrOptions) {
|
|
2335
|
+
super(detailOrOptions ?? "Request Timeout", import_common31.HttpStatus.REQUEST_TIMEOUT);
|
|
2464
2336
|
}
|
|
2465
2337
|
};
|
|
2466
2338
|
|
|
2467
2339
|
// src/exceptions/service-unavailable.exception.ts
|
|
2468
2340
|
var import_common32 = require("@nestjs/common");
|
|
2469
|
-
var ServiceUnavailableException = class extends
|
|
2341
|
+
var ServiceUnavailableException = class extends HttpProblemException {
|
|
2470
2342
|
static {
|
|
2471
2343
|
__name(this, "ServiceUnavailableException");
|
|
2472
2344
|
}
|
|
2473
|
-
constructor(
|
|
2474
|
-
|
|
2475
|
-
super(messageOrField, import_common32.HttpStatus.SERVICE_UNAVAILABLE, fieldMessageOrDetail);
|
|
2476
|
-
} else if (detail !== void 0) {
|
|
2477
|
-
super(messageOrField, fieldMessageOrDetail, import_common32.HttpStatus.SERVICE_UNAVAILABLE, detail);
|
|
2478
|
-
} else if (fieldMessageOrDetail) {
|
|
2479
|
-
super(messageOrField, fieldMessageOrDetail, import_common32.HttpStatus.SERVICE_UNAVAILABLE);
|
|
2480
|
-
} else {
|
|
2481
|
-
super(messageOrField, import_common32.HttpStatus.SERVICE_UNAVAILABLE);
|
|
2482
|
-
}
|
|
2345
|
+
constructor(detailOrOptions) {
|
|
2346
|
+
super(detailOrOptions ?? "Service Unavailable", import_common32.HttpStatus.SERVICE_UNAVAILABLE);
|
|
2483
2347
|
}
|
|
2484
2348
|
};
|
|
2485
2349
|
|
|
2486
2350
|
// src/exceptions/too-many-requests.exception.ts
|
|
2487
2351
|
var import_common33 = require("@nestjs/common");
|
|
2488
|
-
var TooManyRequestsException = class extends
|
|
2352
|
+
var TooManyRequestsException = class extends HttpProblemException {
|
|
2489
2353
|
static {
|
|
2490
2354
|
__name(this, "TooManyRequestsException");
|
|
2491
2355
|
}
|
|
2492
|
-
constructor(
|
|
2493
|
-
|
|
2494
|
-
super(messageOrField, import_common33.HttpStatus.TOO_MANY_REQUESTS, fieldMessageOrDetail);
|
|
2495
|
-
} else if (detail !== void 0) {
|
|
2496
|
-
super(messageOrField, fieldMessageOrDetail, import_common33.HttpStatus.TOO_MANY_REQUESTS, detail);
|
|
2497
|
-
} else if (fieldMessageOrDetail) {
|
|
2498
|
-
super(messageOrField, fieldMessageOrDetail, import_common33.HttpStatus.TOO_MANY_REQUESTS);
|
|
2499
|
-
} else {
|
|
2500
|
-
super(messageOrField, import_common33.HttpStatus.TOO_MANY_REQUESTS);
|
|
2501
|
-
}
|
|
2356
|
+
constructor(detailOrOptions) {
|
|
2357
|
+
super(detailOrOptions ?? "Too Many Requests", import_common33.HttpStatus.TOO_MANY_REQUESTS);
|
|
2502
2358
|
}
|
|
2503
2359
|
};
|
|
2504
2360
|
|
|
2505
2361
|
// src/exceptions/unauthorized.exception.ts
|
|
2506
2362
|
var import_common34 = require("@nestjs/common");
|
|
2507
|
-
var UnauthorizedException5 = class extends
|
|
2363
|
+
var UnauthorizedException5 = class extends HttpProblemException {
|
|
2508
2364
|
static {
|
|
2509
2365
|
__name(this, "UnauthorizedException");
|
|
2510
2366
|
}
|
|
2511
|
-
constructor(
|
|
2512
|
-
|
|
2513
|
-
super(messageOrField, import_common34.HttpStatus.UNAUTHORIZED, fieldMessageOrDetail);
|
|
2514
|
-
} else if (detail !== void 0) {
|
|
2515
|
-
super(messageOrField, fieldMessageOrDetail, import_common34.HttpStatus.UNAUTHORIZED, detail);
|
|
2516
|
-
} else if (fieldMessageOrDetail) {
|
|
2517
|
-
super(messageOrField, fieldMessageOrDetail, import_common34.HttpStatus.UNAUTHORIZED);
|
|
2518
|
-
} else {
|
|
2519
|
-
super(messageOrField, import_common34.HttpStatus.UNAUTHORIZED);
|
|
2520
|
-
}
|
|
2367
|
+
constructor(detailOrOptions) {
|
|
2368
|
+
super(detailOrOptions ?? "Unauthorized", import_common34.HttpStatus.UNAUTHORIZED);
|
|
2521
2369
|
}
|
|
2522
2370
|
};
|
|
2523
2371
|
|
|
2524
2372
|
// src/exceptions/unprocessable-entity.exception.ts
|
|
2525
2373
|
var import_common35 = require("@nestjs/common");
|
|
2526
|
-
var UnprocessableEntityException = class extends
|
|
2374
|
+
var UnprocessableEntityException = class extends HttpProblemException {
|
|
2527
2375
|
static {
|
|
2528
2376
|
__name(this, "UnprocessableEntityException");
|
|
2529
2377
|
}
|
|
2530
|
-
constructor(
|
|
2531
|
-
|
|
2532
|
-
super(messageOrField, import_common35.HttpStatus.UNPROCESSABLE_ENTITY, fieldMessageOrDetail);
|
|
2533
|
-
} else if (detail !== void 0) {
|
|
2534
|
-
super(messageOrField, fieldMessageOrDetail, import_common35.HttpStatus.UNPROCESSABLE_ENTITY, detail);
|
|
2535
|
-
} else if (fieldMessageOrDetail) {
|
|
2536
|
-
super(messageOrField, fieldMessageOrDetail, import_common35.HttpStatus.UNPROCESSABLE_ENTITY);
|
|
2537
|
-
} else {
|
|
2538
|
-
super(messageOrField, import_common35.HttpStatus.UNPROCESSABLE_ENTITY);
|
|
2539
|
-
}
|
|
2378
|
+
constructor(detailOrOptions) {
|
|
2379
|
+
super(detailOrOptions ?? "Unprocessable Entity", import_common35.HttpStatus.UNPROCESSABLE_ENTITY);
|
|
2540
2380
|
}
|
|
2541
2381
|
};
|
|
2542
2382
|
|
|
2543
2383
|
// src/exceptions/unsupported-media-type.exception.ts
|
|
2544
2384
|
var import_common36 = require("@nestjs/common");
|
|
2545
|
-
var UnsupportedMediaTypeException = class extends
|
|
2385
|
+
var UnsupportedMediaTypeException = class extends HttpProblemException {
|
|
2546
2386
|
static {
|
|
2547
2387
|
__name(this, "UnsupportedMediaTypeException");
|
|
2548
2388
|
}
|
|
2549
|
-
constructor(
|
|
2550
|
-
|
|
2551
|
-
super(messageOrField, import_common36.HttpStatus.UNSUPPORTED_MEDIA_TYPE, fieldMessageOrDetail);
|
|
2552
|
-
} else if (detail !== void 0) {
|
|
2553
|
-
super(messageOrField, fieldMessageOrDetail, import_common36.HttpStatus.UNSUPPORTED_MEDIA_TYPE, detail);
|
|
2554
|
-
} else if (fieldMessageOrDetail) {
|
|
2555
|
-
super(messageOrField, fieldMessageOrDetail, import_common36.HttpStatus.UNSUPPORTED_MEDIA_TYPE);
|
|
2556
|
-
} else {
|
|
2557
|
-
super(messageOrField, import_common36.HttpStatus.UNSUPPORTED_MEDIA_TYPE);
|
|
2558
|
-
}
|
|
2389
|
+
constructor(detailOrOptions) {
|
|
2390
|
+
super(detailOrOptions ?? "Unsupported Media Type", import_common36.HttpStatus.UNSUPPORTED_MEDIA_TYPE);
|
|
2559
2391
|
}
|
|
2560
2392
|
};
|
|
2561
2393
|
|
|
2562
2394
|
// src/exceptions/validation.exception.ts
|
|
2563
2395
|
var import_common37 = require("@nestjs/common");
|
|
2564
|
-
var ValidationException = class extends
|
|
2396
|
+
var ValidationException = class extends HttpProblemException {
|
|
2565
2397
|
static {
|
|
2566
2398
|
__name(this, "ValidationException");
|
|
2567
2399
|
}
|
|
2568
|
-
constructor(
|
|
2569
|
-
super(
|
|
2400
|
+
constructor(detailOrOptions) {
|
|
2401
|
+
super(detailOrOptions ?? "Validation Failed", import_common37.HttpStatus.BAD_REQUEST);
|
|
2570
2402
|
}
|
|
2571
2403
|
};
|
|
2572
2404
|
|
|
@@ -2595,17 +2427,23 @@ var HttpExceptionFilter = class _HttpExceptionFilter {
|
|
|
2595
2427
|
catch(exception, host) {
|
|
2596
2428
|
const ctx = host.switchToHttp();
|
|
2597
2429
|
const response = ctx.getResponse();
|
|
2430
|
+
const request = ctx.getRequest();
|
|
2598
2431
|
let status = import_common38.HttpStatus.INTERNAL_SERVER_ERROR;
|
|
2599
|
-
let
|
|
2432
|
+
let type = "about:blank";
|
|
2433
|
+
let label;
|
|
2600
2434
|
let detail = "Internal server error";
|
|
2435
|
+
let errors = [];
|
|
2601
2436
|
if (exception instanceof import_common38.HttpException) {
|
|
2602
2437
|
status = exception.getStatus();
|
|
2603
2438
|
const exceptionResponse = exception.getResponse();
|
|
2604
2439
|
if (typeof exceptionResponse === "object" && exceptionResponse !== null) {
|
|
2605
2440
|
const responseObj = exceptionResponse;
|
|
2606
|
-
if ("
|
|
2607
|
-
|
|
2608
|
-
|
|
2441
|
+
if ("type" in responseObj || "label" in responseObj || "errors" in responseObj) {
|
|
2442
|
+
const problemResponse = responseObj;
|
|
2443
|
+
type = problemResponse.type ?? "about:blank";
|
|
2444
|
+
label = problemResponse.label;
|
|
2445
|
+
detail = problemResponse.detail ?? exception.message ?? getHttpStatusTitle(status);
|
|
2446
|
+
errors = problemResponse.errors ?? [];
|
|
2609
2447
|
} else if ("message" in responseObj && Array.isArray(responseObj.message)) {
|
|
2610
2448
|
errors = responseObj.message.map((msg) => {
|
|
2611
2449
|
if (typeof msg === "object" && "property" in msg && "constraints" in msg) {
|
|
@@ -2615,159 +2453,40 @@ var HttpExceptionFilter = class _HttpExceptionFilter {
|
|
|
2615
2453
|
message: constraintValues[0] ?? "Validation failed"
|
|
2616
2454
|
};
|
|
2617
2455
|
}
|
|
2618
|
-
return
|
|
2619
|
-
|
|
2620
|
-
};
|
|
2621
|
-
});
|
|
2456
|
+
return null;
|
|
2457
|
+
}).filter((error) => error !== null);
|
|
2622
2458
|
detail = "Validation failed";
|
|
2623
2459
|
} else if ("message" in responseObj) {
|
|
2624
2460
|
const message = responseObj.message;
|
|
2625
|
-
|
|
2626
|
-
{
|
|
2627
|
-
message: Array.isArray(message) ? message.join(", ") : message
|
|
2628
|
-
}
|
|
2629
|
-
];
|
|
2630
|
-
detail = ("error" in responseObj ? responseObj.error : void 0) || exception.message;
|
|
2461
|
+
detail = Array.isArray(message) ? message.join(", ") : message;
|
|
2631
2462
|
}
|
|
2632
2463
|
} else if (typeof exceptionResponse === "string") {
|
|
2633
|
-
errors = [
|
|
2634
|
-
{
|
|
2635
|
-
message: exceptionResponse
|
|
2636
|
-
}
|
|
2637
|
-
];
|
|
2638
2464
|
detail = exceptionResponse;
|
|
2639
2465
|
}
|
|
2640
2466
|
} else {
|
|
2641
2467
|
const errorMessage = exception instanceof Error ? exception.message : "Unknown error";
|
|
2642
2468
|
const stack = exception instanceof Error ? exception.stack : void 0;
|
|
2643
2469
|
this.logger.error(`Unexpected error: ${errorMessage}`, stack);
|
|
2644
|
-
|
|
2645
|
-
{
|
|
2646
|
-
message: "An unexpected error occurred"
|
|
2647
|
-
}
|
|
2648
|
-
];
|
|
2470
|
+
detail = "An unexpected error occurred";
|
|
2649
2471
|
}
|
|
2650
2472
|
const problemDetails = {
|
|
2473
|
+
type,
|
|
2651
2474
|
title: getHttpStatusTitle(status),
|
|
2652
2475
|
status,
|
|
2476
|
+
...label && {
|
|
2477
|
+
label
|
|
2478
|
+
},
|
|
2653
2479
|
detail,
|
|
2480
|
+
instance: request.url,
|
|
2654
2481
|
errors
|
|
2655
2482
|
};
|
|
2656
|
-
response.status(status).send(problemDetails);
|
|
2483
|
+
response.header("Content-Type", "application/problem+json").status(status).send(problemDetails);
|
|
2657
2484
|
}
|
|
2658
2485
|
};
|
|
2659
2486
|
HttpExceptionFilter = _ts_decorate12([
|
|
2660
2487
|
(0, import_common38.Catch)()
|
|
2661
2488
|
], HttpExceptionFilter);
|
|
2662
2489
|
|
|
2663
|
-
// src/http/http.module.ts
|
|
2664
|
-
var import_common40 = require("@nestjs/common");
|
|
2665
|
-
|
|
2666
|
-
// src/http/guards/csrf.guard.ts
|
|
2667
|
-
var import_common39 = require("@nestjs/common");
|
|
2668
|
-
var import_core6 = require("@nestjs/core");
|
|
2669
|
-
function _ts_decorate13(decorators, target, key, desc) {
|
|
2670
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2671
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2672
|
-
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;
|
|
2673
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2674
|
-
}
|
|
2675
|
-
__name(_ts_decorate13, "_ts_decorate");
|
|
2676
|
-
function _ts_metadata8(k, v) {
|
|
2677
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
2678
|
-
}
|
|
2679
|
-
__name(_ts_metadata8, "_ts_metadata");
|
|
2680
|
-
var CsrfGuard = class _CsrfGuard {
|
|
2681
|
-
static {
|
|
2682
|
-
__name(this, "CsrfGuard");
|
|
2683
|
-
}
|
|
2684
|
-
reflector;
|
|
2685
|
-
logger = new import_common39.Logger(_CsrfGuard.name);
|
|
2686
|
-
constructor(reflector) {
|
|
2687
|
-
this.reflector = reflector;
|
|
2688
|
-
}
|
|
2689
|
-
async canActivate(context) {
|
|
2690
|
-
const skipCsrf = this.reflector.getAllAndOverride(SKIP_CSRF_KEY, [
|
|
2691
|
-
context.getHandler(),
|
|
2692
|
-
context.getClass()
|
|
2693
|
-
]);
|
|
2694
|
-
if (skipCsrf) {
|
|
2695
|
-
this.logger.debug("CSRF validation skipped due to @SkipCsrf decorator");
|
|
2696
|
-
return true;
|
|
2697
|
-
}
|
|
2698
|
-
const request = context.switchToHttp().getRequest();
|
|
2699
|
-
const reply = context.switchToHttp().getResponse();
|
|
2700
|
-
const safeMethods = [
|
|
2701
|
-
"GET",
|
|
2702
|
-
"HEAD",
|
|
2703
|
-
"OPTIONS"
|
|
2704
|
-
];
|
|
2705
|
-
if (safeMethods.includes(request.method)) {
|
|
2706
|
-
return true;
|
|
2707
|
-
}
|
|
2708
|
-
try {
|
|
2709
|
-
const fastifyInstance = request.server;
|
|
2710
|
-
if (!fastifyInstance.csrfProtection) {
|
|
2711
|
-
this.logger.error("CSRF protection plugin not found. Ensure @fastify/csrf-protection is registered.");
|
|
2712
|
-
throw new import_common39.ForbiddenException("CSRF protection not configured");
|
|
2713
|
-
}
|
|
2714
|
-
await new Promise((resolve, reject) => {
|
|
2715
|
-
fastifyInstance.csrfProtection(request, reply, (err) => {
|
|
2716
|
-
if (err) {
|
|
2717
|
-
reject(err);
|
|
2718
|
-
} else {
|
|
2719
|
-
resolve();
|
|
2720
|
-
}
|
|
2721
|
-
});
|
|
2722
|
-
});
|
|
2723
|
-
this.logger.debug(`CSRF validation successful for ${request.method} ${request.url}`);
|
|
2724
|
-
return true;
|
|
2725
|
-
} catch (error) {
|
|
2726
|
-
this.logger.warn(`CSRF validation failed for ${request.method} ${request.url}: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
2727
|
-
throw new import_common39.ForbiddenException({
|
|
2728
|
-
errors: [
|
|
2729
|
-
{
|
|
2730
|
-
field: "csrf",
|
|
2731
|
-
message: "Invalid or missing CSRF token"
|
|
2732
|
-
}
|
|
2733
|
-
],
|
|
2734
|
-
message: "CSRF validation failed"
|
|
2735
|
-
});
|
|
2736
|
-
}
|
|
2737
|
-
}
|
|
2738
|
-
};
|
|
2739
|
-
CsrfGuard = _ts_decorate13([
|
|
2740
|
-
(0, import_common39.Injectable)(),
|
|
2741
|
-
_ts_metadata8("design:type", Function),
|
|
2742
|
-
_ts_metadata8("design:paramtypes", [
|
|
2743
|
-
typeof import_core6.Reflector === "undefined" ? Object : import_core6.Reflector
|
|
2744
|
-
])
|
|
2745
|
-
], CsrfGuard);
|
|
2746
|
-
|
|
2747
|
-
// src/http/http.module.ts
|
|
2748
|
-
function _ts_decorate14(decorators, target, key, desc) {
|
|
2749
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2750
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2751
|
-
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;
|
|
2752
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2753
|
-
}
|
|
2754
|
-
__name(_ts_decorate14, "_ts_decorate");
|
|
2755
|
-
var HttpModule = class {
|
|
2756
|
-
static {
|
|
2757
|
-
__name(this, "HttpModule");
|
|
2758
|
-
}
|
|
2759
|
-
};
|
|
2760
|
-
HttpModule = _ts_decorate14([
|
|
2761
|
-
(0, import_common40.Module)({
|
|
2762
|
-
providers: [
|
|
2763
|
-
CsrfGuard
|
|
2764
|
-
],
|
|
2765
|
-
exports: [
|
|
2766
|
-
CsrfGuard
|
|
2767
|
-
]
|
|
2768
|
-
})
|
|
2769
|
-
], HttpModule);
|
|
2770
|
-
|
|
2771
2490
|
// src/utils/phone.utils.ts
|
|
2772
2491
|
var CALLING_CODE_TO_COUNTRY = {
|
|
2773
2492
|
// 3-digit codes
|
|
@@ -2979,11 +2698,11 @@ function normalizePhoneNumber(phone) {
|
|
|
2979
2698
|
__name(normalizePhoneNumber, "normalizePhoneNumber");
|
|
2980
2699
|
|
|
2981
2700
|
// src/logger/interceptors/http-logger.interceptor.ts
|
|
2982
|
-
var
|
|
2701
|
+
var import_common40 = require("@nestjs/common");
|
|
2983
2702
|
var import_operators2 = require("rxjs/operators");
|
|
2984
2703
|
|
|
2985
2704
|
// src/logger/services/logger.service.ts
|
|
2986
|
-
var
|
|
2705
|
+
var import_common39 = require("@nestjs/common");
|
|
2987
2706
|
var import_winston = require("winston");
|
|
2988
2707
|
var import_winston_daily_rotate_file = __toESM(require("winston-daily-rotate-file"), 1);
|
|
2989
2708
|
|
|
@@ -3021,17 +2740,17 @@ function addCorrelationIdToResponse(reply, correlationId, headerName = DEFAULT_C
|
|
|
3021
2740
|
__name(addCorrelationIdToResponse, "addCorrelationIdToResponse");
|
|
3022
2741
|
|
|
3023
2742
|
// src/logger/services/logger.service.ts
|
|
3024
|
-
function
|
|
2743
|
+
function _ts_decorate13(decorators, target, key, desc) {
|
|
3025
2744
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3026
2745
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
3027
2746
|
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;
|
|
3028
2747
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3029
2748
|
}
|
|
3030
|
-
__name(
|
|
3031
|
-
function
|
|
2749
|
+
__name(_ts_decorate13, "_ts_decorate");
|
|
2750
|
+
function _ts_metadata8(k, v) {
|
|
3032
2751
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3033
2752
|
}
|
|
3034
|
-
__name(
|
|
2753
|
+
__name(_ts_metadata8, "_ts_metadata");
|
|
3035
2754
|
function _ts_param4(paramIndex, decorator) {
|
|
3036
2755
|
return function(target, key) {
|
|
3037
2756
|
decorator(target, key, paramIndex);
|
|
@@ -3239,29 +2958,29 @@ ${trace}`;
|
|
|
3239
2958
|
return childLogger;
|
|
3240
2959
|
}
|
|
3241
2960
|
};
|
|
3242
|
-
LoggerService =
|
|
3243
|
-
(0,
|
|
3244
|
-
_ts_param4(0, (0,
|
|
3245
|
-
_ts_param4(1, (0,
|
|
3246
|
-
|
|
3247
|
-
|
|
2961
|
+
LoggerService = _ts_decorate13([
|
|
2962
|
+
(0, import_common39.Injectable)(),
|
|
2963
|
+
_ts_param4(0, (0, import_common39.Optional)()),
|
|
2964
|
+
_ts_param4(1, (0, import_common39.Optional)()),
|
|
2965
|
+
_ts_metadata8("design:type", Function),
|
|
2966
|
+
_ts_metadata8("design:paramtypes", [
|
|
3248
2967
|
typeof LoggerModuleOptions === "undefined" ? Object : LoggerModuleOptions,
|
|
3249
2968
|
typeof Logger === "undefined" ? Object : Logger
|
|
3250
2969
|
])
|
|
3251
2970
|
], LoggerService);
|
|
3252
2971
|
|
|
3253
2972
|
// src/logger/interceptors/http-logger.interceptor.ts
|
|
3254
|
-
function
|
|
2973
|
+
function _ts_decorate14(decorators, target, key, desc) {
|
|
3255
2974
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3256
2975
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
3257
2976
|
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;
|
|
3258
2977
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3259
2978
|
}
|
|
3260
|
-
__name(
|
|
3261
|
-
function
|
|
2979
|
+
__name(_ts_decorate14, "_ts_decorate");
|
|
2980
|
+
function _ts_metadata9(k, v) {
|
|
3262
2981
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3263
2982
|
}
|
|
3264
|
-
__name(
|
|
2983
|
+
__name(_ts_metadata9, "_ts_metadata");
|
|
3265
2984
|
function _ts_param5(paramIndex, decorator) {
|
|
3266
2985
|
return function(target, key) {
|
|
3267
2986
|
decorator(target, key, paramIndex);
|
|
@@ -3369,32 +3088,32 @@ var HttpLoggerInterceptor = class {
|
|
|
3369
3088
|
}
|
|
3370
3089
|
}
|
|
3371
3090
|
};
|
|
3372
|
-
HttpLoggerInterceptor =
|
|
3373
|
-
(0,
|
|
3374
|
-
_ts_param5(1, (0,
|
|
3375
|
-
|
|
3376
|
-
|
|
3091
|
+
HttpLoggerInterceptor = _ts_decorate14([
|
|
3092
|
+
(0, import_common40.Injectable)(),
|
|
3093
|
+
_ts_param5(1, (0, import_common40.Optional)()),
|
|
3094
|
+
_ts_metadata9("design:type", Function),
|
|
3095
|
+
_ts_metadata9("design:paramtypes", [
|
|
3377
3096
|
typeof LoggerService === "undefined" ? Object : LoggerService,
|
|
3378
3097
|
typeof HttpLoggerOptions === "undefined" ? Object : HttpLoggerOptions
|
|
3379
3098
|
])
|
|
3380
3099
|
], HttpLoggerInterceptor);
|
|
3381
3100
|
|
|
3382
3101
|
// src/logger/logger.module.ts
|
|
3383
|
-
var
|
|
3102
|
+
var import_common42 = require("@nestjs/common");
|
|
3384
3103
|
|
|
3385
3104
|
// src/logger/middleware/correlation-id.middleware.ts
|
|
3386
|
-
var
|
|
3387
|
-
function
|
|
3105
|
+
var import_common41 = require("@nestjs/common");
|
|
3106
|
+
function _ts_decorate15(decorators, target, key, desc) {
|
|
3388
3107
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3389
3108
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
3390
3109
|
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;
|
|
3391
3110
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3392
3111
|
}
|
|
3393
|
-
__name(
|
|
3394
|
-
function
|
|
3112
|
+
__name(_ts_decorate15, "_ts_decorate");
|
|
3113
|
+
function _ts_metadata10(k, v) {
|
|
3395
3114
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3396
3115
|
}
|
|
3397
|
-
__name(
|
|
3116
|
+
__name(_ts_metadata10, "_ts_metadata");
|
|
3398
3117
|
var CorrelationIdMiddleware = class {
|
|
3399
3118
|
static {
|
|
3400
3119
|
__name(this, "CorrelationIdMiddleware");
|
|
@@ -3437,22 +3156,22 @@ var CorrelationIdMiddleware = class {
|
|
|
3437
3156
|
}
|
|
3438
3157
|
}
|
|
3439
3158
|
};
|
|
3440
|
-
CorrelationIdMiddleware =
|
|
3441
|
-
(0,
|
|
3442
|
-
|
|
3443
|
-
|
|
3159
|
+
CorrelationIdMiddleware = _ts_decorate15([
|
|
3160
|
+
(0, import_common41.Injectable)(),
|
|
3161
|
+
_ts_metadata10("design:type", Function),
|
|
3162
|
+
_ts_metadata10("design:paramtypes", [
|
|
3444
3163
|
typeof CorrelationIdMiddlewareOptions === "undefined" ? Object : CorrelationIdMiddlewareOptions
|
|
3445
3164
|
])
|
|
3446
3165
|
], CorrelationIdMiddleware);
|
|
3447
3166
|
|
|
3448
3167
|
// src/logger/logger.module.ts
|
|
3449
|
-
function
|
|
3168
|
+
function _ts_decorate16(decorators, target, key, desc) {
|
|
3450
3169
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3451
3170
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
3452
3171
|
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;
|
|
3453
3172
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3454
3173
|
}
|
|
3455
|
-
__name(
|
|
3174
|
+
__name(_ts_decorate16, "_ts_decorate");
|
|
3456
3175
|
var LOGGER_MODULE_OPTIONS = Symbol("LOGGER_MODULE_OPTIONS");
|
|
3457
3176
|
var DEFAULT_LOGGER_OPTIONS = {
|
|
3458
3177
|
provider: "winston",
|
|
@@ -3541,9 +3260,9 @@ function mergeWithDefaults(options = {}) {
|
|
|
3541
3260
|
__name(mergeWithDefaults, "mergeWithDefaults");
|
|
3542
3261
|
function createDefaultLoggerProvider(options) {
|
|
3543
3262
|
return {
|
|
3544
|
-
provide:
|
|
3263
|
+
provide: import_common42.Logger,
|
|
3545
3264
|
useFactory: /* @__PURE__ */ __name(() => {
|
|
3546
|
-
const logger = new
|
|
3265
|
+
const logger = new import_common42.Logger();
|
|
3547
3266
|
if (options.level && typeof logger.setLogLevels === "function") {
|
|
3548
3267
|
const levels = getLevelsUpTo(options.level);
|
|
3549
3268
|
logger.setLogLevels(levels);
|
|
@@ -3573,7 +3292,7 @@ function createLoggerProviders(options = {}) {
|
|
|
3573
3292
|
inject: [
|
|
3574
3293
|
LOGGER_MODULE_OPTIONS,
|
|
3575
3294
|
{
|
|
3576
|
-
token:
|
|
3295
|
+
token: import_common42.Logger,
|
|
3577
3296
|
optional: true
|
|
3578
3297
|
}
|
|
3579
3298
|
]
|
|
@@ -3724,10 +3443,10 @@ var LoggerModule = class _LoggerModule {
|
|
|
3724
3443
|
...asyncProviders,
|
|
3725
3444
|
// Default logger provider
|
|
3726
3445
|
{
|
|
3727
|
-
provide:
|
|
3446
|
+
provide: import_common42.Logger,
|
|
3728
3447
|
useFactory: /* @__PURE__ */ __name((opts) => {
|
|
3729
3448
|
if (opts.provider === "default") {
|
|
3730
|
-
const logger = new
|
|
3449
|
+
const logger = new import_common42.Logger();
|
|
3731
3450
|
if (opts.level && typeof logger.setLogLevels === "function") {
|
|
3732
3451
|
const levels = getLevelsUpTo(opts.level);
|
|
3733
3452
|
logger.setLogLevels(levels);
|
|
@@ -3749,7 +3468,7 @@ var LoggerModule = class _LoggerModule {
|
|
|
3749
3468
|
inject: [
|
|
3750
3469
|
LOGGER_MODULE_OPTIONS,
|
|
3751
3470
|
{
|
|
3752
|
-
token:
|
|
3471
|
+
token: import_common42.Logger,
|
|
3753
3472
|
optional: true
|
|
3754
3473
|
}
|
|
3755
3474
|
]
|
|
@@ -3855,16 +3574,15 @@ var LoggerModule = class _LoggerModule {
|
|
|
3855
3574
|
throw new Error("LoggerModule.forRootAsync() requires one of: useFactory, useClass, or useExisting");
|
|
3856
3575
|
}
|
|
3857
3576
|
};
|
|
3858
|
-
LoggerModule =
|
|
3859
|
-
(0,
|
|
3860
|
-
(0,
|
|
3577
|
+
LoggerModule = _ts_decorate16([
|
|
3578
|
+
(0, import_common42.Global)(),
|
|
3579
|
+
(0, import_common42.Module)({})
|
|
3861
3580
|
], LoggerModule);
|
|
3862
3581
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3863
3582
|
0 && (module.exports = {
|
|
3864
3583
|
AuthConfigModule,
|
|
3865
3584
|
BadGatewayException,
|
|
3866
3585
|
BadRequestException,
|
|
3867
|
-
BaseFieldException,
|
|
3868
3586
|
ConflictException,
|
|
3869
3587
|
CorrelationIdMiddleware,
|
|
3870
3588
|
DEFAULT_CORRELATION_HEADER,
|
|
@@ -3873,7 +3591,7 @@ LoggerModule = _ts_decorate18([
|
|
|
3873
3591
|
GoneException,
|
|
3874
3592
|
HttpExceptionFilter,
|
|
3875
3593
|
HttpLoggerInterceptor,
|
|
3876
|
-
|
|
3594
|
+
HttpProblemException,
|
|
3877
3595
|
InternalServerErrorException,
|
|
3878
3596
|
LOGGER_MODULE_OPTIONS,
|
|
3879
3597
|
LoggerModule,
|