nestlens 0.14.2 → 0.14.3
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/api/api.controller.js +1 -1
- package/dist/api/dto/clear-entries.dto.js +3 -3
- package/dist/api/dto/cursor-query.dto.d.ts +4 -0
- package/dist/api/dto/cursor-query.dto.js +59 -58
- package/dist/api/dto/entries-query.dto.d.ts +1 -16
- package/dist/api/dto/entries-query.dto.js +28 -26
- package/dist/api/dto/tags.dto.js +4 -4
- package/dist/api/dto/transformers/query-transformers.d.ts +8 -2
- package/dist/api/dto/transformers/query-transformers.js +42 -16
- package/dist/api/dto/transformers/query-validators.d.ts +69 -0
- package/dist/api/dto/transformers/query-validators.js +172 -1
- package/dist/api/pipes/nestlens-validation.pipe.js +11 -1
- package/dist/dashboard/public/assets/{BatchDetailView-DQf7rhdt.js → BatchDetailView-BdQe3DAT.js} +1 -1
- package/dist/dashboard/public/assets/{BatchesPage-W8k8XEu3.js → BatchesPage-B9wO2Ncf.js} +1 -1
- package/dist/dashboard/public/assets/{CacheDetailView-D1W5C-eK.js → CacheDetailView-CMAxDfBy.js} +1 -1
- package/dist/dashboard/public/assets/{CachePage-CwEDXyxJ.js → CachePage-DJ8SiKoa.js} +1 -1
- package/dist/dashboard/public/assets/{CommandDetailView-DKQLM96e.js → CommandDetailView-Dj3SmHuj.js} +1 -1
- package/dist/dashboard/public/assets/{CommandsPage-B4XMyz_K.js → CommandsPage-C5EJj66E.js} +1 -1
- package/dist/dashboard/public/assets/{CopyButton-DfPqcshv.js → CopyButton-8NQFvMIW.js} +1 -1
- package/dist/dashboard/public/assets/{DashboardPage-Ce497zS8.js → DashboardPage-C2qvsAiz.js} +1 -1
- package/dist/dashboard/public/assets/{DataTable-Cz2phOFe.js → DataTable-ChUNEmWG.js} +1 -1
- package/dist/dashboard/public/assets/{DetailRow-DKG3Vf9j.js → DetailRow-BX0zpKTe.js} +1 -1
- package/dist/dashboard/public/assets/{DumpDetailView-BU9RRxWv.js → DumpDetailView-DtxmGLVH.js} +1 -1
- package/dist/dashboard/public/assets/{DumpsPage-ldSDznQa.js → DumpsPage-CMl3tRmM.js} +1 -1
- package/dist/dashboard/public/assets/{EntryDetailPage-BdBZLbAf.js → EntryDetailPage-NLzBL3a7.js} +3 -3
- package/dist/dashboard/public/assets/{EntrySearchInput-BF9N_f7y.js → EntrySearchInput-Cl30X6WS.js} +1 -1
- package/dist/dashboard/public/assets/{EventDetailView-CmV2uByp.js → EventDetailView-mqZ3406I.js} +1 -1
- package/dist/dashboard/public/assets/{EventsPage-TlQQA-mn.js → EventsPage-CRJQVA8A.js} +1 -1
- package/dist/dashboard/public/assets/{ExceptionDetailView-B5aRNZz5.js → ExceptionDetailView-CgGWCY9S.js} +1 -1
- package/dist/dashboard/public/assets/{ExceptionsPage-DqiQXiJK.js → ExceptionsPage-XejTTGZo.js} +1 -1
- package/dist/dashboard/public/assets/{GateDetailView-BPd0sJpT.js → GateDetailView-RDlBU8AZ.js} +1 -1
- package/dist/dashboard/public/assets/{GatesPage-D4s1Ogo-.js → GatesPage-CugJC28p.js} +1 -1
- package/dist/dashboard/public/assets/{GraphQLDetailView-Dd_pgjdZ.js → GraphQLDetailView-BFAJoQfl.js} +1 -1
- package/dist/dashboard/public/assets/{GraphQLPage-AOD9WXa5.js → GraphQLPage-BIhJneVf.js} +1 -1
- package/dist/dashboard/public/assets/{HttpClientDetailView-CR7RujPI.js → HttpClientDetailView-BQDbioP0.js} +1 -1
- package/dist/dashboard/public/assets/{HttpClientPage-CUNDLZdF.js → HttpClientPage-Ul44nXQ1.js} +1 -1
- package/dist/dashboard/public/assets/{JobDetailView-C3U9nJFo.js → JobDetailView-BOHzBDsg.js} +1 -1
- package/dist/dashboard/public/assets/{JobsPage-DX0A5Til.js → JobsPage-DUu59mJu.js} +1 -1
- package/dist/dashboard/public/assets/{LogDetailView-V_x94h-I.js → LogDetailView-DU_wZ8pq.js} +1 -1
- package/dist/dashboard/public/assets/{LogsPage-Cvrcv7tq.js → LogsPage-C98bcWXx.js} +1 -1
- package/dist/dashboard/public/assets/MailDetailView-B6KE8HV0.js +9 -0
- package/dist/dashboard/public/assets/{MailPage-BZbVLHHN.js → MailPage-Ca_c3Mbx.js} +1 -1
- package/dist/dashboard/public/assets/{ModelDetailView-CUEA5nRD.js → ModelDetailView-DSW4FtAE.js} +1 -1
- package/dist/dashboard/public/assets/{ModelsPage-CKUeCZLn.js → ModelsPage-Db-cZ_tz.js} +1 -1
- package/dist/dashboard/public/assets/{NotificationDetailView-CT4EIDa3.js → NotificationDetailView-B4LoEIas.js} +1 -1
- package/dist/dashboard/public/assets/{NotificationsPage-CVnjoHST.js → NotificationsPage-B4GN3KiM.js} +1 -1
- package/dist/dashboard/public/assets/{PageHeader-DR_M5h7z.js → PageHeader-CwpXbfba.js} +1 -1
- package/dist/dashboard/public/assets/{QueriesPage-DR3EHxfO.js → QueriesPage-CQfaBmXe.js} +1 -1
- package/dist/dashboard/public/assets/{QueryDetailView-dWmmR_nP.js → QueryDetailView-B4wcgIki.js} +1 -1
- package/dist/dashboard/public/assets/{RedisDetailView-PALK5x6N.js → RedisDetailView-DtJd51k9.js} +1 -1
- package/dist/dashboard/public/assets/{RedisPage-D-9y0o0o.js → RedisPage-DYRX-6Tf.js} +1 -1
- package/dist/dashboard/public/assets/{RequestDetailView-DiS1WZ4m.js → RequestDetailView-BKlhzTF2.js} +1 -1
- package/dist/dashboard/public/assets/{RequestsPage-CCSIr_jW.js → RequestsPage-ClUJnaiz.js} +1 -1
- package/dist/dashboard/public/assets/{ScheduleDetailView-G86hV8Ed.js → ScheduleDetailView-BA3IBVOs.js} +1 -1
- package/dist/dashboard/public/assets/{SchedulePage-CQVmVvYe.js → SchedulePage-C9Sf4Nzg.js} +1 -1
- package/dist/dashboard/public/assets/{UserCard-Bp6Bf3OI.js → UserCard-BiPMOHC2.js} +1 -1
- package/dist/dashboard/public/assets/{ViewDetailView-D-dBm6G6.js → ViewDetailView-CLcKQAzy.js} +1 -1
- package/dist/dashboard/public/assets/{ViewsPage-ErK5Vmy0.js → ViewsPage-Bpg9xsiQ.js} +1 -1
- package/dist/dashboard/public/assets/{calendar-BfDDUQSW.js → calendar-9taI7KIF.js} +1 -1
- package/dist/dashboard/public/assets/{circle-alert-DJ_9D_4c.js → circle-alert-3qwz1WcZ.js} +1 -1
- package/dist/dashboard/public/assets/{circle-check-big-CiGeQW9J.js → circle-check-big-DcP6kxnu.js} +1 -1
- package/dist/dashboard/public/assets/{circle-x-B-V5s-zK.js → circle-x-C5FZ5L0I.js} +1 -1
- package/dist/dashboard/public/assets/{eye-LljylR_O.js → eye-7S1ZlGkA.js} +1 -1
- package/dist/dashboard/public/assets/{index-HxcGVcSo.js → index-CC9YqlAO.js} +2 -2
- package/dist/dashboard/public/assets/{search-VPXcw9Ki.js → search-DlyuMX5Q.js} +1 -1
- package/dist/dashboard/public/assets/{send-CdCk9jQ5.js → send-C8jkJh8C.js} +1 -1
- package/dist/dashboard/public/assets/{timer-I7o5QV6X.js → timer-DiBZzrwD.js} +1 -1
- package/dist/dashboard/public/assets/{types-BMBEhoQ2.js → types-7eWhJMm7.js} +1 -1
- package/dist/dashboard/public/assets/{users-CFzKwpf2.js → users-G6Z4vIpX.js} +1 -1
- package/dist/dashboard/public/assets/{zap-DMB3w7zm.js → zap-DaVFRg-y.js} +1 -1
- package/dist/dashboard/public/index.html +1 -1
- package/package.json +1 -1
- package/dist/dashboard/public/assets/MailDetailView-CYCQI9Z8.js +0 -9
|
@@ -10,6 +10,7 @@ exports.TransformSequence = TransformSequence;
|
|
|
10
10
|
exports.TransformOffset = TransformOffset;
|
|
11
11
|
exports.TransformDate = TransformDate;
|
|
12
12
|
const class_transformer_1 = require("class-transformer");
|
|
13
|
+
const query_validators_1 = require("./query-validators");
|
|
13
14
|
/**
|
|
14
15
|
* Pagination limits to prevent DoS
|
|
15
16
|
*/
|
|
@@ -38,9 +39,7 @@ function TransformCommaSeparatedArray() {
|
|
|
38
39
|
return (0, class_transformer_1.Transform)(({ value }) => {
|
|
39
40
|
if (value === undefined || value === null || value === '')
|
|
40
41
|
return undefined;
|
|
41
|
-
|
|
42
|
-
return value.filter(Boolean);
|
|
43
|
-
return String(value).split(',').filter(Boolean);
|
|
42
|
+
return (0, query_validators_1.listItems)(Array.isArray(value) ? value : String(value));
|
|
44
43
|
});
|
|
45
44
|
}
|
|
46
45
|
/**
|
|
@@ -63,15 +62,38 @@ function TransformCommaSeparatedNumbersOrErr() {
|
|
|
63
62
|
});
|
|
64
63
|
}
|
|
65
64
|
/**
|
|
66
|
-
*
|
|
65
|
+
* A transform for a parameter declared `boolean`, `number` or `Date`, which
|
|
66
|
+
* arrives as a string and stays one until this transform reads it.
|
|
67
|
+
*
|
|
68
|
+
* TypeScript records the declared type as `design:type`, and class-transformer's
|
|
69
|
+
* implicit conversion — NestLens' own pipe asks for it, and so does many a
|
|
70
|
+
* host's global ValidationPipe — applies `Boolean()` or `Number()` by it before
|
|
71
|
+
* any @Transform runs. `Boolean('false')` is `true`, so `?resolved=false` listed
|
|
72
|
+
* the resolved exceptions; `Number('')` is `0`, so `?limit=` asked for one entry;
|
|
73
|
+
* `new Date('')` is an Invalid Date, so a host refused `?from=` that NestLens
|
|
74
|
+
* reads as not given.
|
|
75
|
+
* `design:type` lives in the global Reflect registry, so this is the one place
|
|
76
|
+
* every copy of class-transformer reads, and it runs after the compiler's own
|
|
77
|
+
* `design:type` decorator, which TypeScript always applies first.
|
|
78
|
+
*/
|
|
79
|
+
const FromQueryString = (read) => (target, property) => {
|
|
80
|
+
(0, class_transformer_1.Transform)(({ value }) => read(value))(target, property);
|
|
81
|
+
Reflect.defineMetadata('design:type', String, target, property);
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Reads 'true' and 'false'. Anything else is left for IsBooleanLike to refuse:
|
|
85
|
+
* reading it as false — or as true, which is what `Boolean()` did — answers a
|
|
86
|
+
* question the caller did not ask.
|
|
67
87
|
*/
|
|
68
88
|
function TransformStringToBoolean() {
|
|
69
|
-
return (
|
|
70
|
-
if (value === undefined || value === null)
|
|
89
|
+
return FromQueryString((value) => {
|
|
90
|
+
if (value === undefined || value === null || value === '')
|
|
71
91
|
return undefined;
|
|
72
|
-
if (
|
|
73
|
-
return
|
|
74
|
-
|
|
92
|
+
if (value === 'true')
|
|
93
|
+
return true;
|
|
94
|
+
if (value === 'false')
|
|
95
|
+
return false;
|
|
96
|
+
return value;
|
|
75
97
|
});
|
|
76
98
|
}
|
|
77
99
|
/**
|
|
@@ -83,14 +105,18 @@ function TransformStringToBoolean() {
|
|
|
83
105
|
* no default it is left as it arrived, so the validator beside it refuses it:
|
|
84
106
|
* dropping it instead meant `?minDuration=slow` narrowed nothing and said
|
|
85
107
|
* nothing, which reads as "no entry is that slow".
|
|
108
|
+
*
|
|
109
|
+
* Read with `Number()`, which is what implicit conversion applied before this
|
|
110
|
+
* ever saw the value: `12abc` is unreadable and `1e3` is a thousand, as they
|
|
111
|
+
* always were. A blank is a parameter not given.
|
|
86
112
|
*/
|
|
87
113
|
function TransformToInt(options) {
|
|
88
|
-
return (
|
|
89
|
-
if (value === undefined || value === null || value === '') {
|
|
114
|
+
return FromQueryString((value) => {
|
|
115
|
+
if (value === undefined || value === null || String(value).trim() === '') {
|
|
90
116
|
return options?.default;
|
|
91
117
|
}
|
|
92
|
-
const parsed =
|
|
93
|
-
if (
|
|
118
|
+
const parsed = Math.trunc(Number(value));
|
|
119
|
+
if (!Number.isFinite(parsed)) {
|
|
94
120
|
return options?.default ?? value;
|
|
95
121
|
}
|
|
96
122
|
let result = parsed;
|
|
@@ -128,14 +154,14 @@ function TransformOffset() {
|
|
|
128
154
|
* different with one: SQLite threw `RangeError: Invalid time value` out of
|
|
129
155
|
* `toISOString`, which the reader saw as a 500, while the other two compared
|
|
130
156
|
* against NaN and answered with nothing. Leaving the original string in place
|
|
131
|
-
* lets `
|
|
157
|
+
* lets `IsDateLike` fail it, so an unusable date is a 400 that names the parameter.
|
|
132
158
|
*/
|
|
133
159
|
function TransformDate() {
|
|
134
|
-
return (
|
|
160
|
+
return FromQueryString((value) => {
|
|
135
161
|
if (value === undefined || value === null || value === '')
|
|
136
162
|
return undefined;
|
|
137
163
|
if (value instanceof Date)
|
|
138
|
-
return
|
|
164
|
+
return value;
|
|
139
165
|
const parsed = new Date(String(value));
|
|
140
166
|
return Number.isNaN(parsed.getTime()) ? String(value) : parsed;
|
|
141
167
|
});
|
|
@@ -37,8 +37,77 @@ export declare function IsCommaSeparatedStrings(validationOptions?: ValidationOp
|
|
|
37
37
|
* (after TransformCommaSeparatedNumbersOrErr has run).
|
|
38
38
|
*/
|
|
39
39
|
export declare function IsCommaSeparatedList(validationOptions?: ValidationOptions): PropertyDecorator;
|
|
40
|
+
/**
|
|
41
|
+
* A parameter given blank — empty, or nothing but whitespace — which is a
|
|
42
|
+
* parameter not given. `?from=` and `?type=` are what a form submits for a
|
|
43
|
+
* field left empty.
|
|
44
|
+
*/
|
|
45
|
+
export declare const isBlank: (value: unknown) => boolean;
|
|
46
|
+
/**
|
|
47
|
+
* `@IsOptional()` for a query parameter: missing, null or blank, and the
|
|
48
|
+
* property's validators do not run.
|
|
49
|
+
*
|
|
50
|
+
* `@IsOptional()` skips only null and undefined, so a host's pipe — which
|
|
51
|
+
* validates the query as the URL spelled it — refused `?type=` and `?from=`
|
|
52
|
+
* while NestLens' own pipe, which drops blank parameters first, ignored them.
|
|
53
|
+
* The same URL answered differently by application.
|
|
54
|
+
*/
|
|
55
|
+
export declare function IsOptionalParameter(validationOptions?: ValidationOptions): PropertyDecorator;
|
|
56
|
+
/**
|
|
57
|
+
* `@IsOptional()` for a parameter that narrows what a mutating route changes:
|
|
58
|
+
* left out, it means every one; given blank, it is refused.
|
|
59
|
+
*
|
|
60
|
+
* Everywhere else a blank parameter is one not given. Here that would turn an
|
|
61
|
+
* empty form field into `DELETE entries` of every type — a client that sent
|
|
62
|
+
* `?type=` by accident would clear everything. Left out entirely, the route
|
|
63
|
+
* still means what it always has.
|
|
64
|
+
*/
|
|
65
|
+
export declare function IsOptionalScope(): PropertyDecorator;
|
|
66
|
+
/** The properties of `dto` declared with {@link IsOptionalScope}, read from its metadata. */
|
|
67
|
+
export declare const blankRefusedIn: (dto: new (...args: never[]) => unknown) => ReadonlySet<string>;
|
|
68
|
+
/**
|
|
69
|
+
* `@IsIn()` that leaves a blank to {@link IsOptionalScope}, so a blank scope is
|
|
70
|
+
* refused once, for being blank, and not again for not being a type.
|
|
71
|
+
*/
|
|
72
|
+
export declare function IsInUnlessBlank(values: readonly unknown[], validationOptions?: ValidationOptions): PropertyDecorator;
|
|
73
|
+
/** A whole number from zero, as a number or as the digits of one. */
|
|
74
|
+
export declare const isWholeNumber: (value: unknown) => boolean;
|
|
40
75
|
/**
|
|
41
76
|
* Accepts a boolean or the strings 'true'/'false' (raw query param form,
|
|
42
77
|
* before TransformStringToBoolean has run).
|
|
43
78
|
*/
|
|
44
79
|
export declare function IsBooleanLike(validationOptions?: ValidationOptions): PropertyDecorator;
|
|
80
|
+
/**
|
|
81
|
+
* A whole number from zero, at most `max` when one is given, or the digits of
|
|
82
|
+
* one when @Transform did not run.
|
|
83
|
+
*/
|
|
84
|
+
export declare function IsWholeNumberLike(bounds?: {
|
|
85
|
+
max?: number;
|
|
86
|
+
}, validationOptions?: ValidationOptions): PropertyDecorator;
|
|
87
|
+
/**
|
|
88
|
+
* A Date the runtime could read, or a string it can read into one when
|
|
89
|
+
* TransformDate did not run.
|
|
90
|
+
*/
|
|
91
|
+
export declare function IsDateLike(validationOptions?: ValidationOptions): PropertyDecorator;
|
|
92
|
+
/**
|
|
93
|
+
* The items of a list parameter: an array (`?tags=a&tags=b`) or a
|
|
94
|
+
* comma-separated string (`?tags=a,b`), without the blank ones.
|
|
95
|
+
*
|
|
96
|
+
* TransformCommaSeparatedArray reads a list with this, and so do the
|
|
97
|
+
* validators that run where it did not, so `?tags=&tags=` names nothing in a
|
|
98
|
+
* host's pipe as it does in NestLens' own.
|
|
99
|
+
*/
|
|
100
|
+
export declare const listItems: (value: unknown) => unknown[] | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* A list with at least one item, or a comma-separated string naming one.
|
|
103
|
+
*/
|
|
104
|
+
export declare function IsNonEmptyListLike(validationOptions?: ValidationOptions): PropertyDecorator;
|
|
105
|
+
/**
|
|
106
|
+
* Every item a string of at most `max` characters, counted per item whether
|
|
107
|
+
* the list arrived split or as the comma-separated string.
|
|
108
|
+
*/
|
|
109
|
+
export declare function HasItemsOfMaxLength(max: number, validationOptions?: ValidationOptions): PropertyDecorator;
|
|
110
|
+
/**
|
|
111
|
+
* Refuses the property when `other` is given too. A blank one is not given.
|
|
112
|
+
*/
|
|
113
|
+
export declare function IsAbsentWith(other: string, validationOptions?: ValidationOptions): PropertyDecorator;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MAX_SEARCH_LENGTH = exports.MAX_FILTER_VALUES = void 0;
|
|
3
|
+
exports.listItems = exports.isWholeNumber = exports.blankRefusedIn = exports.isBlank = exports.MAX_SEARCH_LENGTH = exports.MAX_FILTER_VALUES = void 0;
|
|
4
4
|
exports.IsCommaSeparatedStrings = IsCommaSeparatedStrings;
|
|
5
5
|
exports.IsCommaSeparatedList = IsCommaSeparatedList;
|
|
6
|
+
exports.IsOptionalParameter = IsOptionalParameter;
|
|
7
|
+
exports.IsOptionalScope = IsOptionalScope;
|
|
8
|
+
exports.IsInUnlessBlank = IsInUnlessBlank;
|
|
6
9
|
exports.IsBooleanLike = IsBooleanLike;
|
|
10
|
+
exports.IsWholeNumberLike = IsWholeNumberLike;
|
|
11
|
+
exports.IsDateLike = IsDateLike;
|
|
12
|
+
exports.IsNonEmptyListLike = IsNonEmptyListLike;
|
|
13
|
+
exports.HasItemsOfMaxLength = HasItemsOfMaxLength;
|
|
14
|
+
exports.IsAbsentWith = IsAbsentWith;
|
|
7
15
|
const class_validator_1 = require("class-validator");
|
|
8
16
|
/**
|
|
9
17
|
* Duplicate-package-safe validators.
|
|
@@ -64,6 +72,80 @@ function IsCommaSeparatedList(validationOptions) {
|
|
|
64
72
|
},
|
|
65
73
|
}, validationOptions);
|
|
66
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* A parameter given blank — empty, or nothing but whitespace — which is a
|
|
77
|
+
* parameter not given. `?from=` and `?type=` are what a form submits for a
|
|
78
|
+
* field left empty.
|
|
79
|
+
*/
|
|
80
|
+
const isBlank = (value) => typeof value === 'string' && value.trim() === '';
|
|
81
|
+
exports.isBlank = isBlank;
|
|
82
|
+
const isGiven = (value) => value !== undefined && value !== null && !(0, exports.isBlank)(value);
|
|
83
|
+
/**
|
|
84
|
+
* `@IsOptional()` for a query parameter: missing, null or blank, and the
|
|
85
|
+
* property's validators do not run.
|
|
86
|
+
*
|
|
87
|
+
* `@IsOptional()` skips only null and undefined, so a host's pipe — which
|
|
88
|
+
* validates the query as the URL spelled it — refused `?type=` and `?from=`
|
|
89
|
+
* while NestLens' own pipe, which drops blank parameters first, ignored them.
|
|
90
|
+
* The same URL answered differently by application.
|
|
91
|
+
*/
|
|
92
|
+
function IsOptionalParameter(validationOptions) {
|
|
93
|
+
return (0, class_validator_1.ValidateIf)((_object, value) => isGiven(value), validationOptions);
|
|
94
|
+
}
|
|
95
|
+
const IS_NOT_BLANK = 'isNotBlank';
|
|
96
|
+
/**
|
|
97
|
+
* `@IsOptional()` for a parameter that narrows what a mutating route changes:
|
|
98
|
+
* left out, it means every one; given blank, it is refused.
|
|
99
|
+
*
|
|
100
|
+
* Everywhere else a blank parameter is one not given. Here that would turn an
|
|
101
|
+
* empty form field into `DELETE entries` of every type — a client that sent
|
|
102
|
+
* `?type=` by accident would clear everything. Left out entirely, the route
|
|
103
|
+
* still means what it always has.
|
|
104
|
+
*/
|
|
105
|
+
function IsOptionalScope() {
|
|
106
|
+
return (target, property) => {
|
|
107
|
+
(0, class_validator_1.IsOptional)()(target, property);
|
|
108
|
+
(0, class_validator_1.ValidateBy)({
|
|
109
|
+
name: IS_NOT_BLANK,
|
|
110
|
+
validator: {
|
|
111
|
+
validate: (value) => !(0, exports.isBlank)(value),
|
|
112
|
+
defaultMessage: (0, class_validator_1.buildMessage)(() => '$property was given blank; leave it out to mean every one'),
|
|
113
|
+
},
|
|
114
|
+
})(target, property);
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
const blankRefusedCache = new WeakMap();
|
|
118
|
+
/** The properties of `dto` declared with {@link IsOptionalScope}, read from its metadata. */
|
|
119
|
+
const blankRefusedIn = (dto) => {
|
|
120
|
+
const cached = blankRefusedCache.get(dto);
|
|
121
|
+
if (cached)
|
|
122
|
+
return cached;
|
|
123
|
+
const properties = new Set((0, class_validator_1.getMetadataStorage)()
|
|
124
|
+
.getTargetValidationMetadatas(dto, '', true, false)
|
|
125
|
+
.filter((metadata) => metadata.name === IS_NOT_BLANK)
|
|
126
|
+
.map((metadata) => metadata.propertyName));
|
|
127
|
+
blankRefusedCache.set(dto, properties);
|
|
128
|
+
return properties;
|
|
129
|
+
};
|
|
130
|
+
exports.blankRefusedIn = blankRefusedIn;
|
|
131
|
+
/**
|
|
132
|
+
* `@IsIn()` that leaves a blank to {@link IsOptionalScope}, so a blank scope is
|
|
133
|
+
* refused once, for being blank, and not again for not being a type.
|
|
134
|
+
*/
|
|
135
|
+
function IsInUnlessBlank(values, validationOptions) {
|
|
136
|
+
return (0, class_validator_1.ValidateBy)({
|
|
137
|
+
name: 'isIn',
|
|
138
|
+
constraints: [values],
|
|
139
|
+
validator: {
|
|
140
|
+
validate: (value) => (0, exports.isBlank)(value) || values.includes(value),
|
|
141
|
+
defaultMessage: (0, class_validator_1.buildMessage)((eachPrefix) => `${eachPrefix}$property must be one of the following values: $constraint1`, validationOptions),
|
|
142
|
+
},
|
|
143
|
+
}, validationOptions);
|
|
144
|
+
}
|
|
145
|
+
/** A whole number from zero, as a number or as the digits of one. */
|
|
146
|
+
const isWholeNumber = (value) => (typeof value === 'number' && Number.isInteger(value) && value >= 0) ||
|
|
147
|
+
(typeof value === 'string' && /^\d+$/.test(value));
|
|
148
|
+
exports.isWholeNumber = isWholeNumber;
|
|
67
149
|
/**
|
|
68
150
|
* Accepts a boolean or the strings 'true'/'false' (raw query param form,
|
|
69
151
|
* before TransformStringToBoolean has run).
|
|
@@ -77,3 +159,92 @@ function IsBooleanLike(validationOptions) {
|
|
|
77
159
|
},
|
|
78
160
|
}, validationOptions);
|
|
79
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* A whole number from zero, at most `max` when one is given, or the digits of
|
|
164
|
+
* one when @Transform did not run.
|
|
165
|
+
*/
|
|
166
|
+
function IsWholeNumberLike(bounds = {}, validationOptions) {
|
|
167
|
+
const { max } = bounds;
|
|
168
|
+
const withinMax = (value) => max === undefined || value <= max;
|
|
169
|
+
return (0, class_validator_1.ValidateBy)({
|
|
170
|
+
name: 'isWholeNumberLike',
|
|
171
|
+
constraints: [max],
|
|
172
|
+
validator: {
|
|
173
|
+
validate: (value) => (0, exports.isWholeNumber)(value) && withinMax(Number(value)),
|
|
174
|
+
defaultMessage: (0, class_validator_1.buildMessage)(() => max === undefined
|
|
175
|
+
? '$property must be a whole number'
|
|
176
|
+
: `$property must be a whole number no greater than ${max}`, validationOptions),
|
|
177
|
+
},
|
|
178
|
+
}, validationOptions);
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* A Date the runtime could read, or a string it can read into one when
|
|
182
|
+
* TransformDate did not run.
|
|
183
|
+
*/
|
|
184
|
+
function IsDateLike(validationOptions) {
|
|
185
|
+
return (0, class_validator_1.ValidateBy)({
|
|
186
|
+
name: 'isDateLike',
|
|
187
|
+
validator: {
|
|
188
|
+
validate: (value) => (value instanceof Date || typeof value === 'string') &&
|
|
189
|
+
!Number.isNaN(new Date(value).getTime()),
|
|
190
|
+
defaultMessage: (0, class_validator_1.buildMessage)(() => '$property must be a date', validationOptions),
|
|
191
|
+
},
|
|
192
|
+
}, validationOptions);
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* The items of a list parameter: an array (`?tags=a&tags=b`) or a
|
|
196
|
+
* comma-separated string (`?tags=a,b`), without the blank ones.
|
|
197
|
+
*
|
|
198
|
+
* TransformCommaSeparatedArray reads a list with this, and so do the
|
|
199
|
+
* validators that run where it did not, so `?tags=&tags=` names nothing in a
|
|
200
|
+
* host's pipe as it does in NestLens' own.
|
|
201
|
+
*/
|
|
202
|
+
const listItems = (value) => {
|
|
203
|
+
const named = (item) => Boolean(item) && !(0, exports.isBlank)(item);
|
|
204
|
+
if (Array.isArray(value))
|
|
205
|
+
return value.filter(named);
|
|
206
|
+
if (typeof value === 'string')
|
|
207
|
+
return value.split(',').filter(named);
|
|
208
|
+
return undefined;
|
|
209
|
+
};
|
|
210
|
+
exports.listItems = listItems;
|
|
211
|
+
/**
|
|
212
|
+
* A list with at least one item, or a comma-separated string naming one.
|
|
213
|
+
*/
|
|
214
|
+
function IsNonEmptyListLike(validationOptions) {
|
|
215
|
+
return (0, class_validator_1.ValidateBy)({
|
|
216
|
+
name: 'isNonEmptyListLike',
|
|
217
|
+
validator: {
|
|
218
|
+
validate: (value) => ((0, exports.listItems)(value)?.length ?? 0) > 0,
|
|
219
|
+
defaultMessage: (0, class_validator_1.buildMessage)(() => '$property must name at least one value', validationOptions),
|
|
220
|
+
},
|
|
221
|
+
}, validationOptions);
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Every item a string of at most `max` characters, counted per item whether
|
|
225
|
+
* the list arrived split or as the comma-separated string.
|
|
226
|
+
*/
|
|
227
|
+
function HasItemsOfMaxLength(max, validationOptions) {
|
|
228
|
+
return (0, class_validator_1.ValidateBy)({
|
|
229
|
+
name: 'hasItemsOfMaxLength',
|
|
230
|
+
constraints: [max],
|
|
231
|
+
validator: {
|
|
232
|
+
validate: (value) => (0, exports.listItems)(value)?.every((item) => typeof item === 'string' && item.length <= max) ??
|
|
233
|
+
false,
|
|
234
|
+
defaultMessage: (0, class_validator_1.buildMessage)(() => `each value in $property must be shorter than or equal to ${max} characters`, validationOptions),
|
|
235
|
+
},
|
|
236
|
+
}, validationOptions);
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Refuses the property when `other` is given too. A blank one is not given.
|
|
240
|
+
*/
|
|
241
|
+
function IsAbsentWith(other, validationOptions) {
|
|
242
|
+
return (0, class_validator_1.ValidateBy)({
|
|
243
|
+
name: 'isAbsentWith',
|
|
244
|
+
constraints: [other],
|
|
245
|
+
validator: {
|
|
246
|
+
validate: (value, args) => !isGiven(value) || !isGiven((args?.object)[other]),
|
|
247
|
+
defaultMessage: (0, class_validator_1.buildMessage)(() => `Pass ${other} or $property, not both`, validationOptions),
|
|
248
|
+
},
|
|
249
|
+
}, validationOptions);
|
|
250
|
+
}
|
|
@@ -10,6 +10,7 @@ exports.NestLensValidationPipe = void 0;
|
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const class_transformer_1 = require("class-transformer");
|
|
12
12
|
const class_validator_1 = require("class-validator");
|
|
13
|
+
const transformers_1 = require("../dto/transformers");
|
|
13
14
|
/**
|
|
14
15
|
* Drop-in replacement for Nest's ValidationPipe (transform + whitelist +
|
|
15
16
|
* implicit conversion) that is safe against duplicate class-transformer /
|
|
@@ -44,7 +45,16 @@ let NestLensValidationPipe = class NestLensValidationPipe {
|
|
|
44
45
|
`${metadata.type === 'body' ? 'body' : metadata.type} must be an object`,
|
|
45
46
|
]);
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
+
// A blank query parameter is one not given, for every parameter at once.
|
|
49
|
+
// Left in, it reached each transform and validator to be read as each of
|
|
50
|
+
// them chose: `?limit=` a default, `?type=` a 400, `?requestId=` a filter
|
|
51
|
+
// matching nothing. Kept only where it narrows a change, so its validator
|
|
52
|
+
// refuses it rather than the change widening to everything.
|
|
53
|
+
const refused = (0, transformers_1.blankRefusedIn)(metatype);
|
|
54
|
+
const input = metadata.type === 'query' && value
|
|
55
|
+
? Object.fromEntries(Object.entries(value).filter(([key, given]) => refused.has(key) || !(0, transformers_1.isBlank)(given)))
|
|
56
|
+
: value;
|
|
57
|
+
const entity = (0, class_transformer_1.plainToInstance)(metatype, input ?? {}, {
|
|
48
58
|
enableImplicitConversion: true,
|
|
49
59
|
});
|
|
50
60
|
const errors = await (0, class_validator_1.validate)(entity, {
|
package/dist/dashboard/public/assets/{BatchDetailView-DQf7rhdt.js → BatchDetailView-BdQe3DAT.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,L as o,A as y,C as u}from"./index-
|
|
1
|
+
import{j as e,L as o,A as y,C as u}from"./index-CC9YqlAO.js";import{p as n,f as v}from"./date-Dwgqy666.js";import{D as r,f as k}from"./DetailRow-BX0zpKTe.js";import{C as m}from"./types-7eWhJMm7.js";import{C as w}from"./CopyButton-8NQFvMIW.js";import{C as g}from"./circle-x-C5FZ5L0I.js";import{C as j}from"./circle-alert-3qwz1WcZ.js";import{C}from"./circle-check-big-DcP6kxnu.js";import"./vendor-DBTT3jXp.js";import"./EntryDetailPage-NLzBL3a7.js";import"./search-DlyuMX5Q.js";const p={completed:{icon:C,color:"text-green-500",bg:"bg-green-100 dark:bg-green-900/30"},partial:{icon:j,color:"text-yellow-500",bg:"bg-yellow-100 dark:bg-yellow-900/30"},failed:{icon:g,color:"text-red-500",bg:"bg-red-100 dark:bg-red-900/30"}};function h(a){return a?a<1024?`${a}B`:a<1024*1024?`${(a/1024).toFixed(1)}KB`:a<1024*1024*1024?`${(a/(1024*1024)).toFixed(1)}MB`:`${(a/(1024*1024*1024)).toFixed(1)}GB`:"-"}function E({entry:a}){const{payload:s,createdAt:c}=a,t=p[s.status]||p.completed,f=t.icon,{processedItems:x,totalItems:d,failedItems:l}=s,i=d>0?Math.round(x/d*100):0;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:`p-2 ${t.bg} rounded-lg`,children:e.jsx(o,{className:`h-5 w-5 ${t.color}`})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white font-mono",children:s.name}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Batch Operation"})]})]}),e.jsx(w,{text:s.name,label:"Copy batch name"})]})}),e.jsxs("div",{className:`grid ${s.memory!==void 0?"grid-cols-2 md:grid-cols-5":"grid-cols-2 md:grid-cols-4"} divide-x divide-gray-200 dark:divide-gray-700`,children:[e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(f,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Status"})]}),e.jsx("p",{className:`text-lg font-bold ${t.color}`,children:s.status.toUpperCase()})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(y,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Progress"})]}),e.jsxs("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:[i,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"%"})]})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(u,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Duration"})]}),e.jsxs("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:[s.duration,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"ms"})]})]}),l>0&&e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(g,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Failed"})]}),e.jsx("p",{className:"text-lg font-bold text-red-600 dark:text-red-400",children:l})]}),s.memory!==void 0&&e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(o,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Memory"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:h(s.memory)})]})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"divide-y-0",children:[e.jsx(r,{label:"Time",value:e.jsxs("span",{children:[k(n(c),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",v(n(c),{addSuffix:!0}),")"]})]})}),e.jsx(r,{label:"Name",value:e.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white",children:s.name})}),s.operation&&e.jsx(r,{label:"Operation",value:e.jsx(m,{listType:"batches",filterType:"operations",filterValue:s.operation,children:s.operation})}),e.jsx(r,{label:"Status",value:e.jsx(m,{listType:"batches",filterType:"statuses",filterValue:s.status,children:s.status.toUpperCase()})}),e.jsx(r,{label:"Progress",value:e.jsxs("div",{children:[e.jsxs("div",{className:"text-sm font-mono",children:[x," / ",d," (",i,"%)"]}),e.jsx("div",{className:"mt-2 w-full bg-gray-200 dark:bg-gray-700 rounded-full h-2",children:e.jsx("div",{className:"bg-blue-600 dark:bg-blue-500 h-2 rounded-full transition-all",style:{width:`${i}%`}})})]})}),l>0&&e.jsx(r,{label:"Failed Items",value:e.jsx("span",{className:"text-red-600 dark:text-red-400 font-mono",children:l})}),e.jsx(r,{label:"Duration",value:`${s.duration}ms`}),s.batchSize&&e.jsx(r,{label:"Batch Size",value:s.batchSize}),s.memory!==void 0&&e.jsx(r,{label:"Memory",value:h(s.memory)})]})})]}),s.errors&&s.errors.length>0&&e.jsxs("div",{className:"card border-red-200 dark:border-red-800",children:[e.jsx("div",{className:"px-4 py-3 border-b border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(j,{className:"h-5 w-5 text-red-500"}),e.jsxs("h2",{className:"text-lg font-semibold text-red-700 dark:text-red-400",children:["Errors (",s.errors.length,")"]})]})}),e.jsx("div",{className:"divide-y divide-red-200 dark:divide-red-800",children:s.errors.map((N,b)=>e.jsx("div",{className:"p-4 bg-red-50/50 dark:bg-red-900/10",children:e.jsx("pre",{className:"text-sm text-red-600 dark:text-red-400 font-mono whitespace-pre-wrap overflow-x-auto",children:N})},b))})]})]})}export{E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,L as c}from"./index-
|
|
1
|
+
import{j as t,L as c}from"./index-CC9YqlAO.js";import{e as B,b as D}from"./vendor-DBTT3jXp.js";import{f as T,p as A}from"./date-Dwgqy666.js";import{u as L,a as I,P as $,R as H,N as S,L as W}from"./PageHeader-CwpXbfba.js";import{u as q,q as O,C as h}from"./types-7eWhJMm7.js";import{T as s,D as U,b as z}from"./DataTable-ChUNEmWG.js";import"./timer-DiBZzrwD.js";function Z(){const u=B(),{addFilter:o,clearAll:p,serverFilters:x,headerFilters:m}=q("batches"),{rangeFilters:g,windowMinutes:y}=L(),{entries:f,loading:j,refreshing:i,error:b,refresh:d,newEntriesCount:C,hasMore:k,loadMore:w,loadNew:N,autoRefreshEnabled:E,live:v,setAutoRefresh:R,meta:n,isHighlighted:F}=I({type:"batch",limit:50,filters:{...x,...g},windowMinutes:y}),l=f.filter(e=>O(e)),M=D.useMemo(()=>[{key:"name",header:"Name",minWidth:"200px",render:e=>t.jsx(s,{mono:!0,truncate:!0,maxWidth:"250px",children:e.payload.name})},{key:"operation",header:"Operation",width:"150px",render:e=>{const a=e.payload.operation;return a?t.jsx(h,{onClick:r=>{r.stopPropagation(),o("operations",a)},children:a}):t.jsx(s,{secondary:!0,children:"-"})}},{key:"progress",header:"Progress",width:"150px",render:e=>{const{processedItems:a,totalItems:r}=e.payload,P=r>0?Math.round(a/r*100):0;return t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(s,{children:`${a}/${r}`}),t.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["(",P,"%)"]})]})}},{key:"status",header:"Status",width:"120px",render:e=>t.jsx(h,{onClick:a=>{a.stopPropagation(),o("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>e.payload.duration?t.jsx(U,{ms:e.payload.duration}):t.jsx(s,{secondary:!0,children:"-"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(s,{secondary:!0,className:"text-xs",children:T(A(e.createdAt),{addSuffix:!0})})}],[o]);return j&&l.length===0?t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):t.jsxs("div",{children:[t.jsx($,{title:"Batches",icon:c,iconColor:"text-blue-600 dark:text-blue-400",count:l.length,totalCount:n==null?void 0:n.total,clearable:{type:"batch",label:"batches",onCleared:d},refreshing:i,autoRefreshEnabled:E,live:v,onAutoRefreshToggle:R,filters:m,filterControls:t.jsx(H,{route:"batches"}),onClearAllFilters:p}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(S,{count:C,onClick:N,loading:i}),t.jsx(z,{columns:M,data:l,keyExtractor:e=>e.id,onRowClick:e=>u(`/batches/${e.id}`),rowClassName:e=>F(e.id)?"highlight-new":"",emptyMessage:"No batch operations recorded yet",error:b,onRetry:d,emptyIcon:t.jsx(c,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(W,{hasMore:k,onClick:w,loading:i})]})]})}export{Z as default};
|
package/dist/dashboard/public/assets/{CacheDetailView-D1W5C-eK.js → CacheDetailView-CMAxDfBy.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as h,j as e,D as d,C as g}from"./index-
|
|
1
|
+
import{c as h,j as e,D as d,C as g}from"./index-CC9YqlAO.js";import{p as o,f as p}from"./date-Dwgqy666.js";import{D as t,f as b}from"./DetailRow-BX0zpKTe.js";import{C as x}from"./types-7eWhJMm7.js";import{u as j,C as y,T as f}from"./EntryDetailPage-NLzBL3a7.js";import{C as u}from"./CopyButton-8NQFvMIW.js";import{C as N}from"./circle-check-big-DcP6kxnu.js";import{C as v}from"./circle-x-C5FZ5L0I.js";import{T as k}from"./timer-DiBZzrwD.js";import"./vendor-DBTT3jXp.js";import"./search-DlyuMX5Q.js";/**
|
|
2
2
|
* @license lucide-react v0.468.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a,H as l}from"./index-
|
|
1
|
+
import{j as a,H as l}from"./index-CC9YqlAO.js";import{e as R,b as v}from"./vendor-DBTT3jXp.js";import{f as D,p as F}from"./date-Dwgqy666.js";import{u as M,a as A,P as H,R as P,N as B,L as I}from"./PageHeader-CwpXbfba.js";import{u as L,f as S,C as n}from"./types-7eWhJMm7.js";import{T as i,D as W,b as K}from"./DataTable-ChUNEmWG.js";import"./timer-DiBZzrwD.js";function Q(){const d=R(),{clearAll:c,serverFilters:h,headerFilters:u}=L("cache"),{rangeFilters:p,windowMinutes:x}=M(),{entries:m,loading:y,refreshing:t,error:g,refresh:o,newEntriesCount:f,hasMore:j,loadMore:C,loadNew:k,autoRefreshEnabled:w,live:b,setAutoRefresh:N,meta:r,isHighlighted:T}=A({type:"cache",limit:50,filters:{...h,...p},windowMinutes:x}),s=m.filter(e=>S(e)),E=v.useMemo(()=>[{key:"operation",header:"Operation",width:"100px",render:e=>a.jsx(n,{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(n,{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(W,{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(F(e.createdAt),{addSuffix:!0})})}],[]);return y&&s.length===0?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"})}):a.jsxs("div",{children:[a.jsx(H,{title:"Cache",icon:l,iconColor:"text-cyan-600 dark:text-cyan-400",count:s.length,totalCount:r==null?void 0:r.total,clearable:{type:"cache",label:"cache",onCleared:o},refreshing:t,autoRefreshEnabled:w,live:b,onAutoRefreshToggle:N,filters:u,filterControls:a.jsx(P,{route:"cache"}),onClearAllFilters:c}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(B,{count:f,onClick:k,loading:t}),a.jsx(K,{columns:E,data:s,keyExtractor:e=>e.id,onRowClick:e=>d(`/cache/${e.id}`),rowClassName:e=>T(e.id)?"highlight-new":"",emptyMessage:"No cache operations recorded yet",error:g,onRetry:o,emptyIcon:a.jsx(l,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(I,{hasMore:j,onClick:C,loading:t})]})]})}export{Q as default};
|
package/dist/dashboard/public/assets/{CommandDetailView-DKQLM96e.js → CommandDetailView-Dj3SmHuj.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,b as m,C as p}from"./index-
|
|
1
|
+
import{j as e,b as m,C as p}from"./index-CC9YqlAO.js";import{b as v}from"./vendor-DBTT3jXp.js";import{p as h,f as N}from"./date-Dwgqy666.js";import{D as t,f as k}from"./DetailRow-BX0zpKTe.js";import{C as b}from"./types-7eWhJMm7.js";import{u as c,C as n,T as C}from"./EntryDetailPage-NLzBL3a7.js";import{C as T}from"./CopyButton-8NQFvMIW.js";import{C as w}from"./circle-check-big-DcP6kxnu.js";import{C as g}from"./circle-x-C5FZ5L0I.js";import"./search-DlyuMX5Q.js";function I({entry:u}){const{payload:a,createdAt:x}=u,d=c(),l=c(),o=c(),[i,j]=v.useState("payload"),r=a.status==="completed"?{icon:w,color:"text-green-500",bg:"bg-green-100 dark:bg-green-900/30"}:a.status==="executing"?{icon:p,color:"text-blue-500",bg:"bg-blue-100 dark:bg-blue-900/30"}:{icon:g,color:"text-red-500",bg:"bg-red-100 dark:bg-red-900/30"},y=r.icon,s=[];a.payload!==void 0&&s.push({id:"payload",label:"Payload",content:e.jsx(n,{data:a.payload,toolbarState:d.state,searchBar:d.SearchBar,maxHeight:400})}),a.result!==void 0&&s.push({id:"result",label:"Result",content:e.jsx(n,{data:a.result,toolbarState:l.state,searchBar:l.SearchBar,maxHeight:400})}),a.metadata!==void 0&&s.push({id:"metadata",label:"Metadata",content:e.jsx(n,{data:a.metadata,toolbarState:o.state,searchBar:o.SearchBar,maxHeight:400})});const f=()=>{if(i==="payload"&&a.payload!==void 0)return e.jsx(d.Toolbar,{data:a.payload});if(i==="result"&&a.result!==void 0)return e.jsx(l.Toolbar,{data:a.result});if(i==="metadata"&&a.metadata!==void 0)return e.jsx(o.Toolbar,{data:a.metadata})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:`p-2 ${r.bg} rounded-lg`,children:e.jsx(m,{className:`h-5 w-5 ${r.color}`})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white font-mono",children:a.name}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Command Execution"})]})]}),e.jsx(T,{text:a.name,label:"Copy command"})]})}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 divide-x divide-gray-200 dark:divide-gray-700",children:[e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(m,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Command"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white font-mono truncate",title:a.name,children:a.name})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(y,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Status"})]}),e.jsx("p",{className:`text-lg font-bold ${r.color}`,children:a.status.toUpperCase()})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(p,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Duration"})]}),e.jsxs("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:[a.duration,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"ms"})]})]})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"divide-y-0",children:[e.jsx(t,{label:"Time",value:e.jsxs("span",{children:[k(h(x),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",N(h(x),{addSuffix:!0}),")"]})]})}),e.jsx(t,{label:"Command",value:e.jsx(b,{listType:"commands",filterType:"names",filterValue:a.name,children:a.name})}),a.handler&&e.jsx(t,{label:"Handler",value:e.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white",children:a.handler})}),e.jsx(t,{label:"Status",value:e.jsx(b,{listType:"commands",filterType:"statuses",filterValue:a.status,children:a.status.toUpperCase()})}),e.jsx(t,{label:"Duration",value:a.duration!==void 0?`${a.duration}ms`:"-"})]})})]}),a.error&&e.jsxs("div",{className:"card border-red-200 dark:border-red-800",children:[e.jsx("div",{className:"px-4 py-3 border-b border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(g,{className:"h-5 w-5 text-red-500"}),e.jsx("h2",{className:"text-lg font-semibold text-red-700 dark:text-red-400",children:"Error"})]})}),e.jsx("div",{className:"p-4 bg-red-50/50 dark:bg-red-900/10",children:e.jsx("pre",{className:"text-sm text-red-600 dark:text-red-400 font-mono whitespace-pre-wrap overflow-x-auto",children:a.error})})]}),s.length>0&&e.jsx(C,{tabs:s,defaultTab:"payload",hashKey:"command",headerRight:f(),onTabChange:j})]})}export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a,b as d}from"./index-
|
|
1
|
+
import{j as a,b as d}from"./index-CC9YqlAO.js";import{e as T,b as D}from"./vendor-DBTT3jXp.js";import{f as M,p as P}from"./date-Dwgqy666.js";import{u as A,a as B,P as H,R as L,N as W,L as S}from"./PageHeader-CwpXbfba.js";import{u as I,o as U,C as m}from"./types-7eWhJMm7.js";import{T as i,D as $,b as q}from"./DataTable-ChUNEmWG.js";import"./timer-DiBZzrwD.js";function X(){const c=T(),{addFilter:t,clearAll:u,serverFilters:h,headerFilters:p}=I("commands"),{rangeFilters:x,windowMinutes:g}=A(),{entries:f,loading:y,refreshing:r,error:C,refresh:l,newEntriesCount:j,hasMore:k,loadMore:w,loadNew:b,autoRefreshEnabled:N,live:E,setAutoRefresh:R,meta:s,isHighlighted:v}=B({type:"command",limit:50,filters:{...h,...x},windowMinutes:g}),o=f.filter(e=>U(e)),F=D.useMemo(()=>[{key:"name",header:"Command",minWidth:"250px",render:e=>a.jsx(m,{onClick:n=>{n.stopPropagation(),t("names",e.payload.name)},className:"font-mono",children:e.payload.name})},{key:"handler",header:"Handler",minWidth:"200px",render:e=>e.payload.handler?a.jsx(i,{mono:!0,truncate:!0,maxWidth:"250px",children:e.payload.handler}):a.jsx(i,{secondary:!0,children:"-"})},{key:"status",header:"Status",width:"100px",render:e=>a.jsx(m,{onClick:n=>{n.stopPropagation(),t("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx($,{ms:e.payload.duration??0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(i,{secondary:!0,className:"text-xs",children:M(P(e.createdAt),{addSuffix:!0})})}],[t]);return y&&o.length===0?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"})}):a.jsxs("div",{children:[a.jsx(H,{title:"Commands",icon:d,iconColor:"text-green-600 dark:text-green-400",count:o.length,totalCount:s==null?void 0:s.total,clearable:{type:"command",label:"commands",onCleared:l},refreshing:r,autoRefreshEnabled:N,live:E,onAutoRefreshToggle:R,filters:p,filterControls:a.jsx(L,{route:"commands"}),onClearAllFilters:u}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(W,{count:j,onClick:b,loading:r}),a.jsx(q,{columns:F,data:o,keyExtractor:e=>e.id,onRowClick:e=>c(`/commands/${e.id}`),rowClassName:e=>v(e.id)?"highlight-new":"",emptyMessage:"No commands recorded yet",error:C,onRetry:l,emptyIcon:a.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(S,{hasMore:k,onClick:w,loading:r})]})]})}export{X as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{j as e,z as n}from"./index-
|
|
1
|
+
import{j as e,z as n}from"./index-CC9YqlAO.js";import{b as p}from"./vendor-DBTT3jXp.js";import{a as i,b as c}from"./EntryDetailPage-NLzBL3a7.js";function y({text:l,label:r="Copy",successMessage:x="Copied to clipboard!",className:t="",iconOnly:d=!1}){const[s,a]=p.useState(!1),o=async()=>{try{await navigator.clipboard.writeText(l),a(!0),n.success(x),setTimeout(()=>a(!1),2e3)}catch{n.error("Failed to copy")}};return d?e.jsx("button",{onClick:o,className:`p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors ${t}`,title:r,children:s?e.jsx(i,{className:"h-4 w-4 text-green-500"}):e.jsx(c,{className:"h-4 w-4 text-gray-500"})}):e.jsx("button",{onClick:o,className:`inline-flex items-center space-x-2 px-3 py-1.5 text-sm font-medium rounded-lg
|
|
2
2
|
bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600
|
|
3
3
|
text-gray-700 dark:text-gray-300 transition-colors ${t}`,children:s?e.jsxs(e.Fragment,{children:[e.jsx(i,{className:"h-4 w-4 text-green-500"}),e.jsx("span",{children:"Copied!"})]}):e.jsxs(e.Fragment,{children:[e.jsx(c,{className:"h-4 w-4"}),e.jsx("span",{children:r})]})})}export{y as C};
|
package/dist/dashboard/public/assets/{DashboardPage-Ce497zS8.js → DashboardPage-C2qvsAiz.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as $,g as pe,j as e,X as he,a as be,z as j,r as fe,u as ke,T as v,D as oe,C as I,A as G,G as ve,F as je,B as Ne,P as we,b as Ee,H,d as Ce,L as Se,e as Te,M as $e,f as qe,R as Pe,h as Me,S as Le,i as X,k as Y,l as Re,m as ee,n as te,o as Ae,p as ae}from"./index-
|
|
1
|
+
import{c as $,g as pe,j as e,X as he,a as be,z as j,r as fe,u as ke,T as v,D as oe,C as I,A as G,G as ve,F as je,B as Ne,P as we,b as Ee,H,d as Ce,L as Se,e as Te,M as $e,f as qe,R as Pe,h as Me,S as Le,i as X,k as Y,l as Re,m as ee,n as te,o as Ae,p as ae}from"./index-CC9YqlAO.js";import{b as d,e as De,L as Be}from"./vendor-DBTT3jXp.js";import{g as ie,f as C,p as S}from"./date-Dwgqy666.js";import{E as Ie}from"./eye-7S1ZlGkA.js";import{Z as Fe}from"./zap-DaVFRg-y.js";import{C as Ge}from"./calendar-9taI7KIF.js";/**
|
|
2
2
|
* @license lucide-react v0.468.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as F,j as e,i as z,T as R}from"./index-
|
|
1
|
+
import{c as F,j as e,i as z,T as R}from"./index-CC9YqlAO.js";import{b as c}from"./vendor-DBTT3jXp.js";import{g as m}from"./date-Dwgqy666.js";/**
|
|
2
2
|
* @license lucide-react v0.468.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|