@feardread/fear 1.0.1
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/FEAR.js +459 -0
- package/FEARServer.js +280 -0
- package/controllers/agent.js +438 -0
- package/controllers/auth/index.js +345 -0
- package/controllers/auth/token.js +50 -0
- package/controllers/blog.js +105 -0
- package/controllers/brand.js +10 -0
- package/controllers/cart.js +425 -0
- package/controllers/category.js +9 -0
- package/controllers/coupon.js +63 -0
- package/controllers/crud/crud.js +508 -0
- package/controllers/crud/index.js +36 -0
- package/controllers/email.js +34 -0
- package/controllers/enquiry.js +65 -0
- package/controllers/events.js +9 -0
- package/controllers/order.js +125 -0
- package/controllers/payment.js +31 -0
- package/controllers/product.js +147 -0
- package/controllers/review.js +247 -0
- package/controllers/tag.js +10 -0
- package/controllers/task.js +10 -0
- package/controllers/upload.js +41 -0
- package/controllers/user.js +401 -0
- package/index.js +7 -0
- package/libs/agent/index.js +561 -0
- package/libs/agent/modules/ai/ai.js +285 -0
- package/libs/agent/modules/ai/chat.js +518 -0
- package/libs/agent/modules/ai/config.js +688 -0
- package/libs/agent/modules/ai/operations.js +787 -0
- package/libs/agent/modules/analyze/api.js +546 -0
- package/libs/agent/modules/analyze/dorks.js +395 -0
- package/libs/agent/modules/ccard/README.md +454 -0
- package/libs/agent/modules/ccard/audit.js +479 -0
- package/libs/agent/modules/ccard/checker.js +674 -0
- package/libs/agent/modules/ccard/payment-processors.json +16 -0
- package/libs/agent/modules/ccard/validator.js +629 -0
- package/libs/agent/modules/code/analyzer.js +303 -0
- package/libs/agent/modules/code/jquery.js +1093 -0
- package/libs/agent/modules/code/react.js +1536 -0
- package/libs/agent/modules/code/refactor.js +499 -0
- package/libs/agent/modules/crypto/exchange.js +564 -0
- package/libs/agent/modules/net/proxy.js +409 -0
- package/libs/agent/modules/security/cve.js +442 -0
- package/libs/agent/modules/security/monitor.js +360 -0
- package/libs/agent/modules/security/scanner.js +300 -0
- package/libs/agent/modules/security/vulnerability.js +506 -0
- package/libs/agent/modules/security/web.js +465 -0
- package/libs/agent/modules/utils/browser.js +492 -0
- package/libs/agent/modules/utils/colorizer.js +285 -0
- package/libs/agent/modules/utils/manager.js +478 -0
- package/libs/cloud/index.js +228 -0
- package/libs/config/db.js +21 -0
- package/libs/config/validator.js +82 -0
- package/libs/db/index.js +318 -0
- package/libs/emailer/imap.js +126 -0
- package/libs/emailer/info.js +41 -0
- package/libs/emailer/smtp.js +77 -0
- package/libs/handler/async.js +3 -0
- package/libs/handler/error.js +66 -0
- package/libs/handler/index.js +161 -0
- package/libs/logger/index.js +49 -0
- package/libs/logger/morgan.js +24 -0
- package/libs/passport/passport.js +109 -0
- package/libs/search/api.js +384 -0
- package/libs/search/features.js +219 -0
- package/libs/search/service.js +64 -0
- package/libs/swagger/config.js +18 -0
- package/libs/swagger/index.js +35 -0
- package/libs/validator/index.js +254 -0
- package/models/blog.js +31 -0
- package/models/brand.js +12 -0
- package/models/cart.js +14 -0
- package/models/category.js +11 -0
- package/models/coupon.js +9 -0
- package/models/customer.js +0 -0
- package/models/enquiry.js +29 -0
- package/models/events.js +13 -0
- package/models/order.js +94 -0
- package/models/product.js +32 -0
- package/models/review.js +14 -0
- package/models/tag.js +10 -0
- package/models/task.js +11 -0
- package/models/user.js +68 -0
- package/package.json +12 -0
- package/routes/agent.js +615 -0
- package/routes/auth.js +13 -0
- package/routes/blog.js +19 -0
- package/routes/brand.js +15 -0
- package/routes/cart.js +105 -0
- package/routes/category.js +16 -0
- package/routes/coupon.js +15 -0
- package/routes/enquiry.js +14 -0
- package/routes/events.js +16 -0
- package/routes/mail.js +170 -0
- package/routes/order.js +19 -0
- package/routes/product.js +22 -0
- package/routes/review.js +11 -0
- package/routes/task.js +12 -0
- package/routes/user.js +17 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
// modules/colorizer.js - Terminal Color Utilities
|
|
2
|
+
// Centralized color management for all modules
|
|
3
|
+
|
|
4
|
+
const Colorizer = function() {
|
|
5
|
+
// ANSI color codes
|
|
6
|
+
this.codes = {
|
|
7
|
+
reset: '\x1b[0m',
|
|
8
|
+
bright: '\x1b[1m',
|
|
9
|
+
dim: '\x1b[2m',
|
|
10
|
+
underscore: '\x1b[4m',
|
|
11
|
+
blink: '\x1b[5m',
|
|
12
|
+
reverse: '\x1b[7m',
|
|
13
|
+
hidden: '\x1b[8m',
|
|
14
|
+
|
|
15
|
+
// Foreground colors
|
|
16
|
+
black: '\x1b[30m',
|
|
17
|
+
red: '\x1b[31m',
|
|
18
|
+
green: '\x1b[32m',
|
|
19
|
+
yellow: '\x1b[33m',
|
|
20
|
+
blue: '\x1b[34m',
|
|
21
|
+
magenta: '\x1b[35m',
|
|
22
|
+
cyan: '\x1b[36m',
|
|
23
|
+
white: '\x1b[37m',
|
|
24
|
+
gray: '\x1b[90m',
|
|
25
|
+
|
|
26
|
+
// Background colors
|
|
27
|
+
bgBlack: '\x1b[40m',
|
|
28
|
+
bgRed: '\x1b[41m',
|
|
29
|
+
bgGreen: '\x1b[42m',
|
|
30
|
+
bgYellow: '\x1b[43m',
|
|
31
|
+
bgBlue: '\x1b[44m',
|
|
32
|
+
bgMagenta: '\x1b[45m',
|
|
33
|
+
bgCyan: '\x1b[46m',
|
|
34
|
+
bgWhite: '\x1b[47m'
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// Check if colors are disabled
|
|
38
|
+
this.enabled = process.env.NO_COLOR !== '1' && process.stdout.isTTY;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
Colorizer.prototype = {
|
|
42
|
+
// Color text with specified color
|
|
43
|
+
color(text, color) {
|
|
44
|
+
if (!this.enabled) return text;
|
|
45
|
+
const code = this.codes[color] || this.codes.reset;
|
|
46
|
+
return code + text + this.codes.reset;
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
// Predefined color methods
|
|
50
|
+
red(text) {
|
|
51
|
+
return this.color(text, 'red');
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
green(text) {
|
|
55
|
+
return this.color(text, 'green');
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
yellow(text) {
|
|
59
|
+
return this.color(text, 'yellow');
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
blue(text) {
|
|
63
|
+
return this.color(text, 'blue');
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
magenta(text) {
|
|
67
|
+
return this.color(text, 'magenta');
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
cyan(text) {
|
|
71
|
+
return this.color(text, 'cyan');
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
white(text) {
|
|
75
|
+
return this.color(text, 'white');
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
gray(text) {
|
|
79
|
+
return this.color(text, 'gray');
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
black(text) {
|
|
83
|
+
return this.color(text, 'black');
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
bright(text) {
|
|
87
|
+
if (!this.enabled) return text;
|
|
88
|
+
return this.codes.bright + text + this.codes.reset;
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
dim(text) {
|
|
92
|
+
if (!this.enabled) return text;
|
|
93
|
+
return this.codes.dim + text + this.codes.reset;
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
underscore(text) {
|
|
97
|
+
if (!this.enabled) return text;
|
|
98
|
+
return this.codes.underscore + text + this.codes.reset;
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
// Status indicators
|
|
102
|
+
success(text) {
|
|
103
|
+
return this.green('[SUCCESS] ' + text);
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
error(text) {
|
|
107
|
+
return this.red('[ERROR] ' + text);
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
warning(text) {
|
|
111
|
+
return this.yellow('[WARNING] ' + text);
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
info(text) {
|
|
115
|
+
return this.cyan('[INFO] ' + text);
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
// Severity levels
|
|
119
|
+
critical(text) {
|
|
120
|
+
return this.bright(this.red('[CRITICAL] ' + text));
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
high(text) {
|
|
124
|
+
return this.bright(this.yellow('[HIGH] ' + text));
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
medium(text) {
|
|
128
|
+
return this.yellow('[MEDIUM] ' + text);
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
low(text) {
|
|
132
|
+
return this.green('[LOW] ' + text);
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
// Headers and sections
|
|
136
|
+
header(text) {
|
|
137
|
+
return this.bright(this.cyan('\n' + text));
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
subheader(text) {
|
|
141
|
+
return this.cyan(text);
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
section(text) {
|
|
145
|
+
return this.bright(this.white('\n' + text));
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
// Lists and bullets
|
|
149
|
+
bullet(text) {
|
|
150
|
+
return this.dim(' • ') + text;
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
numbered(num, text) {
|
|
154
|
+
return this.dim(' ' + num + '. ') + text;
|
|
155
|
+
},
|
|
156
|
+
|
|
157
|
+
// Borders and separators
|
|
158
|
+
separator(char = '═', length = 55) {
|
|
159
|
+
return this.cyan(char.repeat(length));
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
box(text, width = 55) {
|
|
163
|
+
const topBottom = this.cyan('═'.repeat(width));
|
|
164
|
+
const lines = text.split('\n');
|
|
165
|
+
const boxed = lines.map(line => {
|
|
166
|
+
const padding = ' '.repeat(Math.max(0, width - line.length - 2));
|
|
167
|
+
return this.cyan('║ ') + line + padding + this.cyan(' ║');
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
return '\n' + this.cyan('╔') + topBottom + this.cyan('╗') + '\n' +
|
|
171
|
+
boxed.join('\n') + '\n' +
|
|
172
|
+
this.cyan('╚') + topBottom + this.cyan('╝') + '\n';
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
// Code highlighting
|
|
176
|
+
code(text) {
|
|
177
|
+
return this.gray(text);
|
|
178
|
+
},
|
|
179
|
+
|
|
180
|
+
keyword(text) {
|
|
181
|
+
return this.magenta(text);
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
string(text) {
|
|
185
|
+
return this.green(text);
|
|
186
|
+
},
|
|
187
|
+
|
|
188
|
+
number(text) {
|
|
189
|
+
return this.blue(text);
|
|
190
|
+
},
|
|
191
|
+
|
|
192
|
+
// Links and URLs
|
|
193
|
+
link(text) {
|
|
194
|
+
return this.underscore(this.blue(text));
|
|
195
|
+
},
|
|
196
|
+
|
|
197
|
+
// File paths
|
|
198
|
+
path(text) {
|
|
199
|
+
return this.dim(text);
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
// Command/action text
|
|
203
|
+
command(text) {
|
|
204
|
+
return this.bright(this.white(text));
|
|
205
|
+
},
|
|
206
|
+
|
|
207
|
+
// Progress indicators
|
|
208
|
+
progress(current, total, message) {
|
|
209
|
+
const percentage = Math.floor((current / total) * 100);
|
|
210
|
+
const bar = '█'.repeat(Math.floor(percentage / 5)) + '░'.repeat(20 - Math.floor(percentage / 5));
|
|
211
|
+
return this.cyan('[') + this.green(bar) + this.cyan(']') + ' ' +
|
|
212
|
+
this.bright(percentage + '%') + ' ' + this.dim(message);
|
|
213
|
+
},
|
|
214
|
+
|
|
215
|
+
// Table helpers
|
|
216
|
+
tableHeader(text) {
|
|
217
|
+
return this.bright(this.cyan(text));
|
|
218
|
+
},
|
|
219
|
+
|
|
220
|
+
tableRow(cells) {
|
|
221
|
+
return cells.map(cell => this.dim('│ ') + cell).join(' ') + this.dim(' │');
|
|
222
|
+
},
|
|
223
|
+
|
|
224
|
+
// Background colors
|
|
225
|
+
bgGreen(text) {
|
|
226
|
+
if (!this.enabled) return text;
|
|
227
|
+
return this.codes.bgGreen + text + this.codes.reset;
|
|
228
|
+
},
|
|
229
|
+
|
|
230
|
+
bgRed(text) {
|
|
231
|
+
if (!this.enabled) return text;
|
|
232
|
+
return this.codes.bgRed + text + this.codes.reset;
|
|
233
|
+
},
|
|
234
|
+
|
|
235
|
+
bgYellow(text) {
|
|
236
|
+
if (!this.enabled) return text;
|
|
237
|
+
return this.codes.bgYellow + text + this.codes.reset;
|
|
238
|
+
},
|
|
239
|
+
|
|
240
|
+
bgCyan(text) {
|
|
241
|
+
if (!this.enabled) return text;
|
|
242
|
+
return this.codes.bgCyan + text + this.codes.reset;
|
|
243
|
+
},
|
|
244
|
+
|
|
245
|
+
// Status badges
|
|
246
|
+
badge(text, type) {
|
|
247
|
+
const badges = {
|
|
248
|
+
success: this.bgGreen(this.black(' ' + text + ' ')),
|
|
249
|
+
error: this.bgRed(this.white(' ' + text + ' ')),
|
|
250
|
+
warning: this.bgYellow(this.black(' ' + text + ' ')),
|
|
251
|
+
info: this.bgCyan(this.black(' ' + text + ' '))
|
|
252
|
+
};
|
|
253
|
+
return badges[type] || text;
|
|
254
|
+
},
|
|
255
|
+
|
|
256
|
+
// Disable colors
|
|
257
|
+
disable() {
|
|
258
|
+
this.enabled = false;
|
|
259
|
+
},
|
|
260
|
+
|
|
261
|
+
// Enable colors
|
|
262
|
+
enable() {
|
|
263
|
+
this.enabled = process.stdout.isTTY;
|
|
264
|
+
},
|
|
265
|
+
|
|
266
|
+
// Strip colors from text
|
|
267
|
+
strip(text) {
|
|
268
|
+
return text.replace(/\x1b\[[0-9;]*m/g, '');
|
|
269
|
+
},
|
|
270
|
+
|
|
271
|
+
// Get color code directly
|
|
272
|
+
getCode(colorName) {
|
|
273
|
+
return this.enabled ? (this.codes[colorName] || '') : '';
|
|
274
|
+
},
|
|
275
|
+
|
|
276
|
+
getColors() {
|
|
277
|
+
return this.codes;
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
// Create singleton instance
|
|
283
|
+
exports.colorizer = new Colorizer();
|
|
284
|
+
|
|
285
|
+
module.exports = exports.colorizer;
|