nestlens 0.8.11 → 0.8.13

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.
Files changed (105) hide show
  1. package/dist/api/api.controller.d.ts +2 -4
  2. package/dist/api/api.controller.js +1 -1
  3. package/dist/api/dto/api-response.dto.d.ts +0 -8
  4. package/dist/api/dto/api-response.dto.js +0 -33
  5. package/dist/api/dto/cursor-query.dto.d.ts +5 -0
  6. package/dist/api/dto/cursor-query.dto.js +1 -0
  7. package/dist/api/dto/index.d.ts +2 -2
  8. package/dist/api/dto/index.js +2 -2
  9. package/dist/api/dto/recording.dto.d.ts +12 -0
  10. package/dist/api/dto/{filters/event-filters.dto.js → recording.dto.js} +16 -9
  11. package/dist/api/dto/tags.dto.d.ts +14 -0
  12. package/dist/api/dto/{filters/common-filters.dto.js → tags.dto.js} +14 -9
  13. package/dist/api/dto/transformers/query-transformers.d.ts +0 -4
  14. package/dist/api/dto/transformers/query-transformers.js +0 -7
  15. package/dist/api/dto/transformers/query-validators.d.ts +12 -0
  16. package/dist/api/dto/transformers/query-validators.js +22 -5
  17. package/dist/api/tag.controller.d.ts +4 -9
  18. package/dist/api/tag.controller.js +6 -3
  19. package/dist/core/collector.service.d.ts +12 -1
  20. package/dist/core/collector.service.js +31 -5
  21. package/dist/core/data-masker.service.d.ts +10 -0
  22. package/dist/core/data-masker.service.js +8 -1
  23. package/dist/dashboard/public/assets/{BatchesPage-CXmoIF_Y.js → BatchesPage-DEz38KR5.js} +1 -1
  24. package/dist/dashboard/public/assets/{CachePage-DvWundpY.js → CachePage-CZxLvTJq.js} +1 -1
  25. package/dist/dashboard/public/assets/{ClickableBadge-BarmxSYZ.js → ClickableBadge-DVTcykCM.js} +1 -1
  26. package/dist/dashboard/public/assets/{CommandsPage-DOwnJ4l2.js → CommandsPage-DnUHcHF_.js} +1 -1
  27. package/dist/dashboard/public/assets/{DashboardPage-D8nhz-ez.js → DashboardPage-BxTgQDmh.js} +1 -1
  28. package/dist/dashboard/public/assets/{DumpsPage-DiDddClI.js → DumpsPage-DNXepzfv.js} +1 -1
  29. package/dist/dashboard/public/assets/{EntryDetailPage-Cp5B-X6d.js → EntryDetailPage-0WBhBUsh.js} +1 -1
  30. package/dist/dashboard/public/assets/{EntrySearchInput-D7Dxf_wV.js → EntrySearchInput-BKjIppvt.js} +1 -1
  31. package/dist/dashboard/public/assets/{EventsPage-BnpKQ6p7.js → EventsPage-xPiqDte_.js} +1 -1
  32. package/dist/dashboard/public/assets/{ExceptionsPage-D_gsHnpI.js → ExceptionsPage-ZJNqTX3Q.js} +1 -1
  33. package/dist/dashboard/public/assets/{GatesPage-DzMd_1CR.js → GatesPage-CdvK6bSz.js} +1 -1
  34. package/dist/dashboard/public/assets/{GraphQLPage-CqVnXpDg.js → GraphQLPage-DaLLpAf8.js} +1 -1
  35. package/dist/dashboard/public/assets/{HttpClientPage-CTSIgzku.js → HttpClientPage-e8BqONkc.js} +1 -1
  36. package/dist/dashboard/public/assets/{JobsPage-Cv-diNRz.js → JobsPage-CjHsAC5o.js} +1 -1
  37. package/dist/dashboard/public/assets/{LogsPage-CW_0EFJN.js → LogsPage-ny3e-b51.js} +1 -1
  38. package/dist/dashboard/public/assets/{MailPage-Bi9mMqQa.js → MailPage-dpbs1DH3.js} +1 -1
  39. package/dist/dashboard/public/assets/{ModelsPage-lOvZP4f2.js → ModelsPage-DZaU9bdR.js} +1 -1
  40. package/dist/dashboard/public/assets/{NotificationsPage-BRP047pV.js → NotificationsPage-xKjgSJyj.js} +1 -1
  41. package/dist/dashboard/public/assets/{PageHeader-D1r_yubB.js → PageHeader-yPvqJXYA.js} +1 -1
  42. package/dist/dashboard/public/assets/{QueriesPage-XKlTB1xh.js → QueriesPage-DsMLeBtH.js} +1 -1
  43. package/dist/dashboard/public/assets/{RedisPage-B-mzc5bF.js → RedisPage-Daw6beWw.js} +1 -1
  44. package/dist/dashboard/public/assets/{RequestsPage-DY8zLF_K.js → RequestsPage-CDMXEx7M.js} +1 -1
  45. package/dist/dashboard/public/assets/{SchedulePage-Cy4Ei5gu.js → SchedulePage-CkbyutFW.js} +1 -1
  46. package/dist/dashboard/public/assets/{ViewsPage-CSqu0-BK.js → ViewsPage-B7fHFzy2.js} +1 -1
  47. package/dist/dashboard/public/assets/{calendar-BPu8wUO2.js → calendar-DfnYRiPH.js} +1 -1
  48. package/dist/dashboard/public/assets/{circle-check-big-BKLpQUc5.js → circle-check-big-CdzBeD3-.js} +1 -1
  49. package/dist/dashboard/public/assets/{eye-4cUjoavP.js → eye-BwC2X41m.js} +1 -1
  50. package/dist/dashboard/public/assets/index-DDZJvSAq.css +1 -0
  51. package/dist/dashboard/public/assets/{index-xwOGvDKf.js → index-jX7JpX7L.js} +2 -2
  52. package/dist/dashboard/public/assets/{search-BwCiATAL.js → search-CyCRC3Aj.js} +1 -1
  53. package/dist/dashboard/public/assets/{types-CQp6Bct8.js → types-C1scQJYx.js} +1 -1
  54. package/dist/dashboard/public/assets/{zap-bPiGWdj2.js → zap-yEefbKzX.js} +1 -1
  55. package/dist/dashboard/public/index.html +2 -2
  56. package/dist/nestlens.config.d.ts +0 -13
  57. package/dist/nestlens.module.js +13 -0
  58. package/dist/watchers/query/types.d.ts +0 -5
  59. package/dist/watchers/query/types.js +0 -13
  60. package/package.json +1 -1
  61. package/dist/api/dto/filters/batch-filters.dto.d.ts +0 -4
  62. package/dist/api/dto/filters/batch-filters.dto.js +0 -31
  63. package/dist/api/dto/filters/cache-filters.dto.d.ts +0 -3
  64. package/dist/api/dto/filters/cache-filters.dto.js +0 -24
  65. package/dist/api/dto/filters/command-filters.dto.d.ts +0 -4
  66. package/dist/api/dto/filters/command-filters.dto.js +0 -31
  67. package/dist/api/dto/filters/common-filters.dto.d.ts +0 -4
  68. package/dist/api/dto/filters/dump-filters.dto.d.ts +0 -5
  69. package/dist/api/dto/filters/dump-filters.dto.js +0 -38
  70. package/dist/api/dto/filters/event-filters.dto.d.ts +0 -3
  71. package/dist/api/dto/filters/exception-filters.dto.d.ts +0 -4
  72. package/dist/api/dto/filters/exception-filters.dto.js +0 -30
  73. package/dist/api/dto/filters/gate-filters.dto.d.ts +0 -4
  74. package/dist/api/dto/filters/gate-filters.dto.js +0 -31
  75. package/dist/api/dto/filters/graphql-filters.dto.d.ts +0 -6
  76. package/dist/api/dto/filters/graphql-filters.dto.js +0 -43
  77. package/dist/api/dto/filters/http-client-filters.dto.d.ts +0 -6
  78. package/dist/api/dto/filters/http-client-filters.dto.js +0 -10
  79. package/dist/api/dto/filters/index.d.ts +0 -20
  80. package/dist/api/dto/filters/index.js +0 -36
  81. package/dist/api/dto/filters/job-filters.dto.d.ts +0 -5
  82. package/dist/api/dto/filters/job-filters.dto.js +0 -38
  83. package/dist/api/dto/filters/log-filters.dto.d.ts +0 -4
  84. package/dist/api/dto/filters/log-filters.dto.js +0 -31
  85. package/dist/api/dto/filters/mail-filters.dto.d.ts +0 -3
  86. package/dist/api/dto/filters/mail-filters.dto.js +0 -24
  87. package/dist/api/dto/filters/model-filters.dto.d.ts +0 -5
  88. package/dist/api/dto/filters/model-filters.dto.js +0 -38
  89. package/dist/api/dto/filters/notification-filters.dto.d.ts +0 -4
  90. package/dist/api/dto/filters/notification-filters.dto.js +0 -31
  91. package/dist/api/dto/filters/query-filters.dto.d.ts +0 -5
  92. package/dist/api/dto/filters/query-filters.dto.js +0 -37
  93. package/dist/api/dto/filters/redis-filters.dto.d.ts +0 -4
  94. package/dist/api/dto/filters/redis-filters.dto.js +0 -31
  95. package/dist/api/dto/filters/request-filters.dto.d.ts +0 -8
  96. package/dist/api/dto/filters/request-filters.dto.js +0 -58
  97. package/dist/api/dto/filters/schedule-filters.dto.d.ts +0 -4
  98. package/dist/api/dto/filters/schedule-filters.dto.js +0 -31
  99. package/dist/api/dto/filters/view-filters.dto.d.ts +0 -4
  100. package/dist/api/dto/filters/view-filters.dto.js +0 -31
  101. package/dist/api/dto/pagination.dto.d.ts +0 -12
  102. package/dist/api/dto/pagination.dto.js +0 -81
  103. package/dist/core/input-validator.d.ts +0 -61
  104. package/dist/core/input-validator.js +0 -141
  105. package/dist/dashboard/public/assets/index-FAG28XEI.css +0 -1
@@ -3,7 +3,7 @@ import { PruningService } from '../core';
3
3
  import { CollectorService } from '../core';
4
4
  import { NestLensConfig } from '../nestlens.config';
5
5
  import { EntryType, CursorPaginatedResponse, Entry } from '../types';
6
- import { CursorQueryDto } from './dto';
6
+ import { CursorQueryDto, PauseRecordingDto } from './dto';
7
7
  /**
8
8
  * Every handler here takes an unused `@Res() _res` parameter. It is not a
9
9
  * mistake and the value is never touched: its presence is how a handler tells
@@ -165,9 +165,7 @@ export declare class NestLensApiController {
165
165
  /**
166
166
  * Pause recording
167
167
  */
168
- pauseRecording(body: {
169
- reason?: string;
170
- }, _res?: unknown): Promise<{
168
+ pauseRecording(body: PauseRecordingDto, _res?: unknown): Promise<{
171
169
  success: boolean;
172
170
  data: {
173
171
  isPaused: boolean;
@@ -444,7 +444,7 @@ __decorate([
444
444
  __param(0, (0, common_1.Body)()),
445
445
  __param(1, (0, common_1.Res)()),
446
446
  __metadata("design:type", Function),
447
- __metadata("design:paramtypes", [Object, Object]),
447
+ __metadata("design:paramtypes", [dto_1.PauseRecordingDto, Object]),
448
448
  __metadata("design:returntype", Promise)
449
449
  ], NestLensApiController.prototype, "pauseRecording", null);
450
450
  __decorate([
@@ -68,11 +68,3 @@ export interface CursorPaginatedApiResponse<T> extends ApiResponse<T[]> {
68
68
  };
69
69
  };
70
70
  }
71
- /**
72
- * Helper to create a success response.
73
- */
74
- export declare function createSuccessResponse<T>(data: T, meta?: Partial<ResponseMeta>): ApiResponse<T>;
75
- /**
76
- * Helper to create an error response.
77
- */
78
- export declare function createErrorResponse(code: ErrorCode, message: string, details?: Record<string, unknown>): ApiResponse<null>;
@@ -1,35 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createSuccessResponse = createSuccessResponse;
4
- exports.createErrorResponse = createErrorResponse;
5
- /**
6
- * Helper to create a success response.
7
- */
8
- function createSuccessResponse(data, meta) {
9
- return {
10
- success: true,
11
- data,
12
- error: null,
13
- meta: {
14
- timestamp: new Date().toISOString(),
15
- ...meta,
16
- },
17
- };
18
- }
19
- /**
20
- * Helper to create an error response.
21
- */
22
- function createErrorResponse(code, message, details) {
23
- return {
24
- success: false,
25
- data: null,
26
- error: {
27
- code,
28
- message,
29
- details,
30
- },
31
- meta: {
32
- timestamp: new Date().toISOString(),
33
- },
34
- };
35
- }
@@ -52,6 +52,11 @@ export declare class CursorQueryDto {
52
52
  hasErrors?: boolean;
53
53
  hasN1?: boolean;
54
54
  tags?: string[];
55
+ /**
56
+ * Capped for the same reason the filter arrays are: every entry's payload is
57
+ * stringified and searched, and `security.validation.maxSearchLength` was
58
+ * documented while nothing enforced it.
59
+ */
55
60
  search?: string;
56
61
  /**
57
62
  * Keys that are pagination params (not filters)
@@ -347,5 +347,6 @@ __decorate([
347
347
  __decorate([
348
348
  (0, class_validator_1.IsOptional)(),
349
349
  (0, class_validator_1.IsString)(),
350
+ (0, class_validator_1.MaxLength)(transformers_1.MAX_SEARCH_LENGTH),
350
351
  __metadata("design:type", String)
351
352
  ], CursorQueryDto.prototype, "search", void 0);
@@ -1,5 +1,5 @@
1
- export * from './pagination.dto';
2
1
  export * from './cursor-query.dto';
3
2
  export * from './transformers';
4
- export * from './filters';
5
3
  export * from './api-response.dto';
4
+ export * from './recording.dto';
5
+ export * from './tags.dto';
@@ -14,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./pagination.dto"), exports);
18
17
  __exportStar(require("./cursor-query.dto"), exports);
19
18
  __exportStar(require("./transformers"), exports);
20
- __exportStar(require("./filters"), exports);
21
19
  __exportStar(require("./api-response.dto"), exports);
20
+ __exportStar(require("./recording.dto"), exports);
21
+ __exportStar(require("./tags.dto"), exports);
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Body of `POST recording/pause`.
3
+ *
4
+ * Every field is optional, which is the point: pausing without saying why is a
5
+ * reasonable thing to ask for, and used to answer
6
+ * `500 Cannot read properties of undefined (reading 'reason')` because the
7
+ * handler read the body without one arriving. The validation pipe substitutes
8
+ * an empty object for a missing body, so a bodyless POST now pauses.
9
+ */
10
+ export declare class PauseRecordingDto {
11
+ reason?: string;
12
+ }
@@ -9,16 +9,23 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.EventFiltersDto = void 0;
12
+ exports.PauseRecordingDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
- const transformers_1 = require("../transformers");
15
- class EventFiltersDto {
14
+ /**
15
+ * Body of `POST recording/pause`.
16
+ *
17
+ * Every field is optional, which is the point: pausing without saying why is a
18
+ * reasonable thing to ask for, and used to answer
19
+ * `500 Cannot read properties of undefined (reading 'reason')` because the
20
+ * handler read the body without one arriving. The validation pipe substitutes
21
+ * an empty object for a missing body, so a bodyless POST now pauses.
22
+ */
23
+ class PauseRecordingDto {
16
24
  }
17
- exports.EventFiltersDto = EventFiltersDto;
25
+ exports.PauseRecordingDto = PauseRecordingDto;
18
26
  __decorate([
19
27
  (0, class_validator_1.IsOptional)(),
20
- (0, transformers_1.TransformCommaSeparatedArray)(),
21
- (0, class_validator_1.IsArray)(),
22
- (0, class_validator_1.IsString)({ each: true }),
23
- __metadata("design:type", Array)
24
- ], EventFiltersDto.prototype, "eventNames", void 0);
28
+ (0, class_validator_1.IsString)(),
29
+ (0, class_validator_1.MaxLength)(500),
30
+ __metadata("design:type", String)
31
+ ], PauseRecordingDto.prototype, "reason", void 0);
@@ -0,0 +1,14 @@
1
+ /** Body of the endpoints that add or remove an entry's tags. */
2
+ export declare class EntryTagsDto {
3
+ /**
4
+ * Required, and now said so: a bodyless POST answered
5
+ * `500 Cannot read properties of undefined (reading 'tags')`, which reports a
6
+ * caller's mistake as a server fault and names an implementation detail
7
+ * instead of the missing field.
8
+ */
9
+ tags: string[];
10
+ }
11
+ /** Body of `POST monitored`. */
12
+ export declare class MonitoredTagDto {
13
+ tag: string;
14
+ }
@@ -9,21 +9,26 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.CommonFiltersDto = void 0;
12
+ exports.MonitoredTagDto = exports.EntryTagsDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
- const transformers_1 = require("../transformers");
15
- class CommonFiltersDto {
14
+ /** Body of the endpoints that add or remove an entry's tags. */
15
+ class EntryTagsDto {
16
16
  }
17
- exports.CommonFiltersDto = CommonFiltersDto;
17
+ exports.EntryTagsDto = EntryTagsDto;
18
18
  __decorate([
19
- (0, class_validator_1.IsOptional)(),
20
- (0, transformers_1.TransformCommaSeparatedArray)(),
21
19
  (0, class_validator_1.IsArray)(),
20
+ (0, class_validator_1.ArrayNotEmpty)(),
22
21
  (0, class_validator_1.IsString)({ each: true }),
22
+ (0, class_validator_1.MaxLength)(100, { each: true }),
23
23
  __metadata("design:type", Array)
24
- ], CommonFiltersDto.prototype, "tags", void 0);
24
+ ], EntryTagsDto.prototype, "tags", void 0);
25
+ /** Body of `POST monitored`. */
26
+ class MonitoredTagDto {
27
+ }
28
+ exports.MonitoredTagDto = MonitoredTagDto;
25
29
  __decorate([
26
- (0, class_validator_1.IsOptional)(),
27
30
  (0, class_validator_1.IsString)(),
31
+ (0, class_validator_1.IsNotEmpty)(),
32
+ (0, class_validator_1.MaxLength)(100),
28
33
  __metadata("design:type", String)
29
- ], CommonFiltersDto.prototype, "search", void 0);
34
+ ], MonitoredTagDto.prototype, "tag", void 0);
@@ -31,10 +31,6 @@ export declare function TransformToInt(options?: {
31
31
  * Transforms limit query parameter with bounds
32
32
  */
33
33
  export declare function TransformLimit(): PropertyDecorator;
34
- /**
35
- * Transforms offset query parameter
36
- */
37
- export declare function TransformOffset(): PropertyDecorator;
38
34
  /**
39
35
  * Transforms sequence number for cursor pagination
40
36
  */
@@ -6,7 +6,6 @@ exports.TransformCommaSeparatedNumbersOrErr = TransformCommaSeparatedNumbersOrEr
6
6
  exports.TransformStringToBoolean = TransformStringToBoolean;
7
7
  exports.TransformToInt = TransformToInt;
8
8
  exports.TransformLimit = TransformLimit;
9
- exports.TransformOffset = TransformOffset;
10
9
  exports.TransformSequence = TransformSequence;
11
10
  const class_transformer_1 = require("class-transformer");
12
11
  /**
@@ -84,12 +83,6 @@ function TransformToInt(options) {
84
83
  function TransformLimit() {
85
84
  return TransformToInt({ min: 1, max: exports.MAX_LIMIT, default: exports.DEFAULT_LIMIT });
86
85
  }
87
- /**
88
- * Transforms offset query parameter
89
- */
90
- function TransformOffset() {
91
- return TransformToInt({ min: 0, default: 0 });
92
- }
93
86
  /**
94
87
  * Transforms sequence number for cursor pagination
95
88
  */
@@ -19,6 +19,18 @@ import { ValidationOptions } from 'class-validator';
19
19
  * Accepts a comma-separated string (raw query param) or an array of strings
20
20
  * (after TransformCommaSeparatedArray has run).
21
21
  */
22
+ /**
23
+ * How many values one filter may carry.
24
+ *
25
+ * Documented under `security.validation.maxFilterArrayLength` and enforced
26
+ * nowhere: a request asking for two thousand statuses was answered, and every
27
+ * value becomes another `IN` placeholder or another comparison per entry. The
28
+ * limit lives with the validators the filters already run through, so it covers
29
+ * every filter field at once rather than one decorator at a time.
30
+ */
31
+ export declare const MAX_FILTER_VALUES = 100;
32
+ /** How long a search term may be, for the same reason. */
33
+ export declare const MAX_SEARCH_LENGTH = 500;
22
34
  export declare function IsCommaSeparatedStrings(validationOptions?: ValidationOptions): PropertyDecorator;
23
35
  /**
24
36
  * Accepts a comma-separated string (raw query param) or an array
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MAX_SEARCH_LENGTH = exports.MAX_FILTER_VALUES = void 0;
3
4
  exports.IsCommaSeparatedStrings = IsCommaSeparatedStrings;
4
5
  exports.IsCommaSeparatedList = IsCommaSeparatedList;
5
6
  exports.IsBooleanLike = IsBooleanLike;
@@ -24,13 +25,28 @@ const class_validator_1 = require("class-validator");
24
25
  * Accepts a comma-separated string (raw query param) or an array of strings
25
26
  * (after TransformCommaSeparatedArray has run).
26
27
  */
28
+ /**
29
+ * How many values one filter may carry.
30
+ *
31
+ * Documented under `security.validation.maxFilterArrayLength` and enforced
32
+ * nowhere: a request asking for two thousand statuses was answered, and every
33
+ * value becomes another `IN` placeholder or another comparison per entry. The
34
+ * limit lives with the validators the filters already run through, so it covers
35
+ * every filter field at once rather than one decorator at a time.
36
+ */
37
+ exports.MAX_FILTER_VALUES = 100;
38
+ /** How long a search term may be, for the same reason. */
39
+ exports.MAX_SEARCH_LENGTH = 500;
40
+ const withinFilterLimit = (value) => !Array.isArray(value) || value.length <= exports.MAX_FILTER_VALUES;
27
41
  function IsCommaSeparatedStrings(validationOptions) {
28
42
  return (0, class_validator_1.ValidateBy)({
29
43
  name: 'isCommaSeparatedStrings',
30
44
  validator: {
31
- validate: (value) => typeof value === 'string' ||
32
- (Array.isArray(value) && value.every((item) => typeof item === 'string')),
33
- defaultMessage: (0, class_validator_1.buildMessage)((eachPrefix) => `${eachPrefix}$property must be a comma-separated string or an array of strings`, validationOptions),
45
+ validate: (value) => withinFilterLimit(value) &&
46
+ (typeof value === 'string' ||
47
+ (Array.isArray(value) && value.every((item) => typeof item === 'string'))),
48
+ defaultMessage: (0, class_validator_1.buildMessage)((eachPrefix) => `${eachPrefix}$property must be a comma-separated string or an array of strings, ` +
49
+ `with at most ${exports.MAX_FILTER_VALUES} values`, validationOptions),
34
50
  },
35
51
  }, validationOptions);
36
52
  }
@@ -42,8 +58,9 @@ function IsCommaSeparatedList(validationOptions) {
42
58
  return (0, class_validator_1.ValidateBy)({
43
59
  name: 'isCommaSeparatedList',
44
60
  validator: {
45
- validate: (value) => typeof value === 'string' || Array.isArray(value),
46
- defaultMessage: (0, class_validator_1.buildMessage)((eachPrefix) => `${eachPrefix}$property must be a comma-separated string or an array`, validationOptions),
61
+ validate: (value) => withinFilterLimit(value) && (typeof value === 'string' || Array.isArray(value)),
62
+ defaultMessage: (0, class_validator_1.buildMessage)((eachPrefix) => `${eachPrefix}$property must be a comma-separated string or an array, ` +
63
+ `with at most ${exports.MAX_FILTER_VALUES} values`, validationOptions),
47
64
  },
48
65
  }, validationOptions);
49
66
  }
@@ -1,4 +1,5 @@
1
1
  import { TagService } from '../core/tag.service';
2
+ import { EntryTagsDto, MonitoredTagDto } from './dto';
2
3
  /**
3
4
  * Every handler here takes an unused `@Res() _res` parameter — see
4
5
  * `NestLensApiController` for why: it tells Nest the response is already
@@ -29,18 +30,14 @@ export declare class TagController {
29
30
  /**
30
31
  * Add tags to an entry
31
32
  */
32
- addTagsToEntry(id: number, body: {
33
- tags: string[];
34
- }, _res?: unknown): Promise<{
33
+ addTagsToEntry(id: number, body: EntryTagsDto, _res?: unknown): Promise<{
35
34
  success: boolean;
36
35
  data: string[];
37
36
  }>;
38
37
  /**
39
38
  * Remove tags from an entry
40
39
  */
41
- removeTagsFromEntry(id: number, body: {
42
- tags: string[];
43
- }, _res?: unknown): Promise<{
40
+ removeTagsFromEntry(id: number, body: EntryTagsDto, _res?: unknown): Promise<{
44
41
  success: boolean;
45
42
  data: string[];
46
43
  }>;
@@ -55,9 +52,7 @@ export declare class TagController {
55
52
  /**
56
53
  * Add a monitored tag
57
54
  */
58
- addMonitoredTag(body: {
59
- tag: string;
60
- }, _res?: unknown): Promise<{
55
+ addMonitoredTag(body: MonitoredTagDto, _res?: unknown): Promise<{
61
56
  success: boolean;
62
57
  data: import("..").MonitoredTag;
63
58
  }>;
@@ -16,9 +16,11 @@ exports.TagController = void 0;
16
16
  const common_1 = require("@nestjs/common");
17
17
  const tag_service_1 = require("../core/tag.service");
18
18
  const nestlens_config_1 = require("../nestlens.config");
19
+ const dto_1 = require("./dto");
19
20
  const api_guard_1 = require("./api.guard");
20
21
  const api_exception_filter_1 = require("./filters/api-exception.filter");
21
22
  const api_response_interceptor_1 = require("./interceptors/api-response.interceptor");
23
+ const pipes_1 = require("./pipes");
22
24
  /**
23
25
  * Every handler here takes an unused `@Res() _res` parameter — see
24
26
  * `NestLensApiController` for why: it tells Nest the response is already
@@ -125,7 +127,7 @@ __decorate([
125
127
  __param(1, (0, common_1.Body)()),
126
128
  __param(2, (0, common_1.Res)()),
127
129
  __metadata("design:type", Function),
128
- __metadata("design:paramtypes", [Number, Object, Object]),
130
+ __metadata("design:paramtypes", [Number, dto_1.EntryTagsDto, Object]),
129
131
  __metadata("design:returntype", Promise)
130
132
  ], TagController.prototype, "addTagsToEntry", null);
131
133
  __decorate([
@@ -134,7 +136,7 @@ __decorate([
134
136
  __param(1, (0, common_1.Body)()),
135
137
  __param(2, (0, common_1.Res)()),
136
138
  __metadata("design:type", Function),
137
- __metadata("design:paramtypes", [Number, Object, Object]),
139
+ __metadata("design:paramtypes", [Number, dto_1.EntryTagsDto, Object]),
138
140
  __metadata("design:returntype", Promise)
139
141
  ], TagController.prototype, "removeTagsFromEntry", null);
140
142
  __decorate([
@@ -149,7 +151,7 @@ __decorate([
149
151
  __param(0, (0, common_1.Body)()),
150
152
  __param(1, (0, common_1.Res)()),
151
153
  __metadata("design:type", Function),
152
- __metadata("design:paramtypes", [Object, Object]),
154
+ __metadata("design:paramtypes", [dto_1.MonitoredTagDto, Object]),
153
155
  __metadata("design:returntype", Promise)
154
156
  ], TagController.prototype, "addMonitoredTag", null);
155
157
  __decorate([
@@ -162,6 +164,7 @@ __decorate([
162
164
  ], TagController.prototype, "removeMonitoredTag", null);
163
165
  exports.TagController = TagController = __decorate([
164
166
  (0, common_1.Controller)(`${nestlens_config_1.NESTLENS_API_PREFIX}/api/tags`),
167
+ (0, common_1.UsePipes)(new pipes_1.NestLensValidationPipe()),
165
168
  (0, common_1.UseGuards)(api_guard_1.NestLensGuard),
166
169
  (0, common_1.UseFilters)(api_exception_filter_1.NestLensApiExceptionFilter),
167
170
  (0, common_1.UseInterceptors)(api_response_interceptor_1.NestLensApiResponseInterceptor),
@@ -1,6 +1,7 @@
1
1
  import { OnModuleDestroy } from '@nestjs/common';
2
2
  import { Observable } from 'rxjs';
3
3
  import { Entry, EntryType } from '../types';
4
+ import { DataMaskerService } from './data-masker.service';
4
5
  import { StorageInterface } from './storage/storage.interface';
5
6
  import { TagService } from './tag.service';
6
7
  import { FamilyHashService } from './family-hash.service';
@@ -8,6 +9,7 @@ import { NestLensConfig } from '../nestlens.config';
8
9
  export declare class CollectorService implements OnModuleDestroy {
9
10
  private readonly storage;
10
11
  private readonly config;
12
+ private readonly dataMasker?;
11
13
  private readonly tagService?;
12
14
  private readonly familyHashService?;
13
15
  private readonly logger;
@@ -42,7 +44,7 @@ export declare class CollectorService implements OnModuleDestroy {
42
44
  /** Observable that emits every entry right after it is persisted. */
43
45
  get entryStream$(): Observable<Entry>;
44
46
  private emit;
45
- constructor(storage: StorageInterface, config: NestLensConfig, tagService?: TagService | undefined, familyHashService?: FamilyHashService | undefined);
47
+ constructor(storage: StorageInterface, config: NestLensConfig, dataMasker?: DataMaskerService | undefined, tagService?: TagService | undefined, familyHashService?: FamilyHashService | undefined);
46
48
  /**
47
49
  * Apply filter to an entry
48
50
  */
@@ -85,6 +87,15 @@ export declare class CollectorService implements OnModuleDestroy {
85
87
  * Save entries with retry logic
86
88
  */
87
89
  private saveWithRetry;
90
+ /**
91
+ * Masks an entry's payload on its way in.
92
+ *
93
+ * Here rather than in each watcher: this is the one place every entry passes
94
+ * through, so a payload cannot reach storage — or the live tail, or a webhook
95
+ * — unmasked because a watcher forgot. It is also the flow the architecture
96
+ * note has always described: watcher → collect() → DataMasker → storage.
97
+ */
98
+ private mask;
88
99
  /**
89
100
  * Flush buffer to storage
90
101
  */
@@ -16,6 +16,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.CollectorService = void 0;
17
17
  const common_1 = require("@nestjs/common");
18
18
  const rxjs_1 = require("rxjs");
19
+ const data_masker_service_1 = require("./data-masker.service");
19
20
  const request_context_1 = require("./request-context");
20
21
  const storage_interface_1 = require("./storage/storage.interface");
21
22
  const tag_service_1 = require("./tag.service");
@@ -31,9 +32,10 @@ let CollectorService = CollectorService_1 = class CollectorService {
31
32
  // (SSE, alerting) is responsible for swallowing its own errors.
32
33
  this.entrySubject.next(entry);
33
34
  }
34
- constructor(storage, config, tagService, familyHashService) {
35
+ constructor(storage, config, dataMasker, tagService, familyHashService) {
35
36
  this.storage = storage;
36
37
  this.config = config;
38
+ this.dataMasker = dataMasker;
37
39
  this.tagService = tagService;
38
40
  this.familyHashService = familyHashService;
39
41
  this.logger = new common_1.Logger(CollectorService_1.name);
@@ -133,12 +135,14 @@ let CollectorService = CollectorService_1 = class CollectorService {
133
135
  // ends up on the detail page of the request that ran it.
134
136
  requestId: requestId ?? (0, request_context_1.currentRequestId)(),
135
137
  };
136
- // Apply filter
138
+ // The filter callback runs in the application's own process against its own
139
+ // data, so it sees the entry as recorded; what gets buffered — and from
140
+ // there stored, streamed and posted to webhooks — is masked.
137
141
  const shouldCollect = await this.applyFilter(entry);
138
142
  if (!shouldCollect) {
139
143
  return;
140
144
  }
141
- this.buffer.push(entry);
145
+ this.buffer.push(this.mask(entry));
142
146
  this.enforceBufferLimit();
143
147
  // Flush if buffer is full — unless storage is already failing, in which
144
148
  // case the periodic timer retries and the caller is not made to wait.
@@ -167,7 +171,7 @@ let CollectorService = CollectorService_1 = class CollectorService {
167
171
  return null;
168
172
  }
169
173
  try {
170
- const savedEntry = await this.storage.save(entry);
174
+ const savedEntry = await this.storage.save(this.mask(entry));
171
175
  // Apply auto-tagging and family hash after saving
172
176
  await this.applyAutoTagging(savedEntry);
173
177
  this.emit(savedEntry);
@@ -223,6 +227,26 @@ let CollectorService = CollectorService_1 = class CollectorService {
223
227
  // This should never be reached, but TypeScript needs it
224
228
  throw new Error('Unreachable code');
225
229
  }
230
+ /**
231
+ * Masks an entry's payload on its way in.
232
+ *
233
+ * Here rather than in each watcher: this is the one place every entry passes
234
+ * through, so a payload cannot reach storage — or the live tail, or a webhook
235
+ * — unmasked because a watcher forgot. It is also the flow the architecture
236
+ * note has always described: watcher → collect() → DataMasker → storage.
237
+ */
238
+ mask(entry) {
239
+ if (!this.dataMasker) {
240
+ return entry;
241
+ }
242
+ const masked = this.dataMasker.maskBody(entry.payload);
243
+ // An exception's stack is part of its payload and is the one field the
244
+ // masker treats by shape rather than by name.
245
+ if (masked && typeof masked === 'object' && typeof masked.stack === 'string') {
246
+ masked.stack = this.dataMasker.sanitizeStackTrace(masked.stack);
247
+ }
248
+ return { ...entry, payload: masked };
249
+ }
226
250
  /**
227
251
  * Flush buffer to storage
228
252
  */
@@ -317,6 +341,8 @@ exports.CollectorService = CollectorService = CollectorService_1 = __decorate([
317
341
  __param(1, (0, common_1.Inject)(nestlens_config_1.NESTLENS_CONFIG)),
318
342
  __param(2, (0, common_1.Optional)()),
319
343
  __param(3, (0, common_1.Optional)()),
320
- __metadata("design:paramtypes", [Object, Object, tag_service_1.TagService,
344
+ __param(4, (0, common_1.Optional)()),
345
+ __metadata("design:paramtypes", [Object, Object, data_masker_service_1.DataMaskerService,
346
+ tag_service_1.TagService,
321
347
  family_hash_service_1.FamilyHashService])
322
348
  ], CollectorService);
@@ -12,13 +12,23 @@ export interface DataMaskerConfig {
12
12
  maskReplacement?: string;
13
13
  /** Whether to sanitize stack traces in production */
14
14
  sanitizeStackTraces?: boolean;
15
+ /**
16
+ * How much of a stack trace to keep, as documented under
17
+ * `security.stackTraceSanitization`.
18
+ *
19
+ * `none` keeps it whole, `partial` drops absolute paths and keeps the first
20
+ * frames, `full` removes it. Overrides `sanitizeStackTraces` when given.
21
+ */
22
+ stackTraceSanitization?: StackTraceSanitization;
15
23
  }
24
+ export type StackTraceSanitization = 'none' | 'partial' | 'full';
16
25
  export declare class DataMaskerService {
17
26
  private readonly sensitiveHeaders;
18
27
  private readonly sensitiveParams;
19
28
  private readonly sensitiveUserFields;
20
29
  private readonly maskReplacement;
21
30
  private readonly sanitizeStackTraces;
31
+ private readonly stackTraceSanitization;
22
32
  private readonly isProduction;
23
33
  constructor(config?: DataMaskerConfig);
24
34
  /**
@@ -103,6 +103,8 @@ let DataMaskerService = class DataMaskerService {
103
103
  this.sensitiveUserFields = userFields.map(normalizeFieldName);
104
104
  this.maskReplacement = config?.maskReplacement ?? DEFAULT_MASK;
105
105
  this.sanitizeStackTraces = config?.sanitizeStackTraces ?? true;
106
+ this.stackTraceSanitization =
107
+ config?.stackTraceSanitization ?? (this.sanitizeStackTraces ? 'partial' : 'none');
106
108
  this.isProduction = process.env.NODE_ENV === 'production';
107
109
  }
108
110
  /**
@@ -203,7 +205,12 @@ let DataMaskerService = class DataMaskerService {
203
205
  if (!stack) {
204
206
  return undefined;
205
207
  }
206
- if (!this.sanitizeStackTraces || !this.isProduction) {
208
+ if (this.stackTraceSanitization === 'full') {
209
+ return undefined;
210
+ }
211
+ // `partial` is about what leaves a production machine; in development the
212
+ // paths are the useful part.
213
+ if (this.stackTraceSanitization === 'none' || !this.isProduction) {
207
214
  return stack;
208
215
  }
209
216
  // In production, simplify the stack trace
@@ -1 +1 @@
1
- import{j as a,L as d}from"./index-xwOGvDKf.js";import{e as D,b as F}from"./vendor-DBTT3jXp.js";import{u as M,C as c,f as T,p as A}from"./ClickableBadge-BarmxSYZ.js";import{u as L,P as R,N as $,L as I}from"./PageHeader-D1r_yubB.js";import{s as H,T as s,D as S,b as W}from"./types-CQp6Bct8.js";function J(){const h=D(),{addFilter:r,clearAll:p,serverFilters:u,headerFilters:x,hasFilters:m}=M("batches"),{entries:g,loading:y,refreshing:o,newEntriesCount:f,hasMore:j,loadMore:b,loadNew:k,autoRefreshEnabled:C,live:N,setAutoRefresh:w,meta:i,isHighlighted:E}=L({type:"batch",limit:50,filters:u}),n=g.filter(e=>H(e)),v=F.useMemo(()=>[{key:"name",header:"Name",minWidth:"200px",render:e=>a.jsx(s,{mono:!0,truncate:!0,maxWidth:"250px",children:e.payload.name})},{key:"operation",header:"Operation",width:"150px",render:e=>e.payload.operation?a.jsx(c,{onClick:t=>{t.stopPropagation(),r("operations",e.payload.operation)},children:e.payload.operation}):a.jsx(s,{secondary:!0,children:"-"})},{key:"progress",header:"Progress",width:"150px",render:e=>{const{processedItems:t,totalItems:l}=e.payload,B=l>0?Math.round(t/l*100):0;return a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(s,{children:`${t}/${l}`}),a.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["(",B,"%)"]})]})}},{key:"status",header:"Status",width:"120px",render:e=>a.jsx(c,{onClick:t=>{t.stopPropagation(),r("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>e.payload.duration?a.jsx(S,{ms:e.payload.duration}):a.jsx(s,{secondary:!0,children:"-"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(s,{secondary:!0,className:"text-xs",children:T(A(e.createdAt),{addSuffix:!0})})}],[r]);if(y&&n.length===0)return a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const P=m?"pt-28":"pt-16";return a.jsxs("div",{children:[a.jsx(R,{title:"Batches",icon:d,iconColor:"text-blue-600 dark:text-blue-400",count:n.length,totalCount:i==null?void 0:i.total,refreshing:o,autoRefreshEnabled:C,live:N,onAutoRefreshToggle:w,filters:x,onClearAllFilters:p}),a.jsxs("div",{className:`${P} space-y-4 transition-all duration-200`,children:[a.jsx($,{count:f,onClick:k,loading:o}),a.jsx(W,{columns:v,data:n,keyExtractor:e=>e.id,onRowClick:e=>h(`/batches/${e.id}`),rowClassName:e=>E(e.id)?"highlight-new":"",emptyMessage:"No batch operations recorded yet",emptyIcon:a.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(I,{hasMore:j,onClick:b,loading:o})]})]})}export{J as default};
1
+ import{j as a,L as d}from"./index-jX7JpX7L.js";import{e as D,b as F}from"./vendor-DBTT3jXp.js";import{u as M,C as c,f as T,p as A}from"./ClickableBadge-DVTcykCM.js";import{u as L,P as R,N as $,L as I}from"./PageHeader-yPvqJXYA.js";import{s as H,T as s,D as S,b as W}from"./types-C1scQJYx.js";function J(){const h=D(),{addFilter:r,clearAll:p,serverFilters:u,headerFilters:x,hasFilters:m}=M("batches"),{entries:g,loading:y,refreshing:o,newEntriesCount:f,hasMore:j,loadMore:b,loadNew:k,autoRefreshEnabled:C,live:N,setAutoRefresh:w,meta:i,isHighlighted:E}=L({type:"batch",limit:50,filters:u}),n=g.filter(e=>H(e)),v=F.useMemo(()=>[{key:"name",header:"Name",minWidth:"200px",render:e=>a.jsx(s,{mono:!0,truncate:!0,maxWidth:"250px",children:e.payload.name})},{key:"operation",header:"Operation",width:"150px",render:e=>e.payload.operation?a.jsx(c,{onClick:t=>{t.stopPropagation(),r("operations",e.payload.operation)},children:e.payload.operation}):a.jsx(s,{secondary:!0,children:"-"})},{key:"progress",header:"Progress",width:"150px",render:e=>{const{processedItems:t,totalItems:l}=e.payload,B=l>0?Math.round(t/l*100):0;return a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(s,{children:`${t}/${l}`}),a.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["(",B,"%)"]})]})}},{key:"status",header:"Status",width:"120px",render:e=>a.jsx(c,{onClick:t=>{t.stopPropagation(),r("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>e.payload.duration?a.jsx(S,{ms:e.payload.duration}):a.jsx(s,{secondary:!0,children:"-"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(s,{secondary:!0,className:"text-xs",children:T(A(e.createdAt),{addSuffix:!0})})}],[r]);if(y&&n.length===0)return a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const P=m?"pt-28":"pt-16";return a.jsxs("div",{children:[a.jsx(R,{title:"Batches",icon:d,iconColor:"text-blue-600 dark:text-blue-400",count:n.length,totalCount:i==null?void 0:i.total,refreshing:o,autoRefreshEnabled:C,live:N,onAutoRefreshToggle:w,filters:x,onClearAllFilters:p}),a.jsxs("div",{className:`${P} space-y-4 transition-all duration-200`,children:[a.jsx($,{count:f,onClick:k,loading:o}),a.jsx(W,{columns:v,data:n,keyExtractor:e=>e.id,onRowClick:e=>h(`/batches/${e.id}`),rowClassName:e=>E(e.id)?"highlight-new":"",emptyMessage:"No batch operations recorded yet",emptyIcon:a.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(I,{hasMore:j,onClick:b,loading:o})]})]})}export{J as default};
@@ -1 +1 @@
1
- import{j as a,H as o}from"./index-xwOGvDKf.js";import{e as T,b as E}from"./vendor-DBTT3jXp.js";import{u as v,C as l,f as D,p as M}from"./ClickableBadge-BarmxSYZ.js";import{u as R,P as A,N as F,L as H}from"./PageHeader-D1r_yubB.js";import{h as P,T as i,D as B,b as I}from"./types-CQp6Bct8.js";function O(){const n=T(),{clearAll:d,serverFilters:c,headerFilters:h,hasFilters:p}=v("cache"),{entries:u,loading:x,refreshing:t,newEntriesCount:y,hasMore:m,loadMore:g,loadNew:f,autoRefreshEnabled:j,live:k,setAutoRefresh:C,meta:r,isHighlighted:w}=R({type:"cache",limit:50,filters:c}),s=u.filter(e=>P(e)),N=E.useMemo(()=>[{key:"operation",header:"Operation",width:"100px",render:e=>a.jsx(l,{listType:"cache",filterType:"operations",children:e.payload.operation})},{key:"key",header:"Key",minWidth:"200px",render:e=>a.jsx(i,{mono:!0,truncate:!0,maxWidth:"400px",children:e.payload.key.length>50?e.payload.key.substring(0,50)+"...":e.payload.key})},{key:"result",header:"Result",width:"80px",align:"center",render:e=>e.payload.operation==="get"?a.jsx(l,{listType:"cache",filterType:"tags",filterValue:e.payload.hit?"hit":"miss",children:e.payload.hit?"HIT":"MISS"}):a.jsx(i,{secondary:!0,children:"—"})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx(B,{ms:e.payload.duration||0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(i,{secondary:!0,className:"text-xs",children:D(M(e.createdAt),{addSuffix:!0})})}],[]);if(x&&s.length===0)return a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const b=p?"pt-28":"pt-16";return a.jsxs("div",{children:[a.jsx(A,{title:"Cache",icon:o,iconColor:"text-cyan-600 dark:text-cyan-400",count:s.length,totalCount:r==null?void 0:r.total,refreshing:t,autoRefreshEnabled:j,live:k,onAutoRefreshToggle:C,filters:h,onClearAllFilters:d}),a.jsxs("div",{className:`${b} space-y-4 transition-all duration-200`,children:[a.jsx(F,{count:y,onClick:f,loading:t}),a.jsx(I,{columns:N,data:s,keyExtractor:e=>e.id,onRowClick:e=>n(`/cache/${e.id}`),rowClassName:e=>w(e.id)?"highlight-new":"",emptyMessage:"No cache operations recorded yet",emptyIcon:a.jsx(o,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(H,{hasMore:m,onClick:g,loading:t})]})]})}export{O as default};
1
+ import{j as a,H as o}from"./index-jX7JpX7L.js";import{e as T,b as E}from"./vendor-DBTT3jXp.js";import{u as v,C as l,f as D,p as M}from"./ClickableBadge-DVTcykCM.js";import{u as R,P as A,N as F,L as H}from"./PageHeader-yPvqJXYA.js";import{h as P,T as i,D as B,b as I}from"./types-C1scQJYx.js";function O(){const n=T(),{clearAll:d,serverFilters:c,headerFilters:h,hasFilters:p}=v("cache"),{entries:u,loading:x,refreshing:t,newEntriesCount:y,hasMore:m,loadMore:g,loadNew:f,autoRefreshEnabled:j,live:k,setAutoRefresh:C,meta:r,isHighlighted:w}=R({type:"cache",limit:50,filters:c}),s=u.filter(e=>P(e)),N=E.useMemo(()=>[{key:"operation",header:"Operation",width:"100px",render:e=>a.jsx(l,{listType:"cache",filterType:"operations",children:e.payload.operation})},{key:"key",header:"Key",minWidth:"200px",render:e=>a.jsx(i,{mono:!0,truncate:!0,maxWidth:"400px",children:e.payload.key.length>50?e.payload.key.substring(0,50)+"...":e.payload.key})},{key:"result",header:"Result",width:"80px",align:"center",render:e=>e.payload.operation==="get"?a.jsx(l,{listType:"cache",filterType:"tags",filterValue:e.payload.hit?"hit":"miss",children:e.payload.hit?"HIT":"MISS"}):a.jsx(i,{secondary:!0,children:"—"})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx(B,{ms:e.payload.duration||0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(i,{secondary:!0,className:"text-xs",children:D(M(e.createdAt),{addSuffix:!0})})}],[]);if(x&&s.length===0)return a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const b=p?"pt-28":"pt-16";return a.jsxs("div",{children:[a.jsx(A,{title:"Cache",icon:o,iconColor:"text-cyan-600 dark:text-cyan-400",count:s.length,totalCount:r==null?void 0:r.total,refreshing:t,autoRefreshEnabled:j,live:k,onAutoRefreshToggle:C,filters:h,onClearAllFilters:d}),a.jsxs("div",{className:`${b} space-y-4 transition-all duration-200`,children:[a.jsx(F,{count:y,onClick:f,loading:t}),a.jsx(I,{columns:N,data:s,keyExtractor:e=>e.id,onRowClick:e=>n(`/cache/${e.id}`),rowClassName:e=>w(e.id)?"highlight-new":"",emptyMessage:"No cache operations recorded yet",emptyIcon:a.jsx(o,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(H,{hasMore:m,onClick:g,loading:t})]})]})}export{O as default};