@empline/preflight 1.1.59 → 1.1.60
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/checks/business/auto-approval-system-validation.d.ts +25 -0
- package/dist/checks/business/auto-approval-system-validation.d.ts.map +1 -0
- package/dist/checks/business/auto-approval-system-validation.js +458 -0
- package/dist/checks/business/auto-approval-system-validation.js.map +1 -0
- package/dist/checks/business/listing-submission-flow-validation.d.ts +21 -0
- package/dist/checks/business/listing-submission-flow-validation.d.ts.map +1 -0
- package/dist/checks/business/listing-submission-flow-validation.js +394 -0
- package/dist/checks/business/listing-submission-flow-validation.js.map +1 -0
- package/dist/checks/business/multi-user-sync-validation.d.ts +21 -0
- package/dist/checks/business/multi-user-sync-validation.d.ts.map +1 -0
- package/dist/checks/business/multi-user-sync-validation.js +383 -0
- package/dist/checks/business/multi-user-sync-validation.js.map +1 -0
- package/dist/checks/consolidated/ui-spacing-standards.js +59 -0
- package/dist/checks/consolidated/ui-spacing-standards.js.map +1 -1
- package/dist/checks/data-integrity/catalog-image-protection-validation.d.ts +38 -0
- package/dist/checks/data-integrity/catalog-image-protection-validation.d.ts.map +1 -0
- package/dist/checks/data-integrity/catalog-image-protection-validation.js +368 -0
- package/dist/checks/data-integrity/catalog-image-protection-validation.js.map +1 -0
- package/dist/checks/data-integrity/image-url-validation.d.ts +22 -0
- package/dist/checks/data-integrity/image-url-validation.d.ts.map +1 -0
- package/dist/checks/data-integrity/image-url-validation.js +310 -0
- package/dist/checks/data-integrity/image-url-validation.js.map +1 -0
- package/dist/checks/performance/async-batch-concurrency.d.ts +10 -0
- package/dist/checks/performance/async-batch-concurrency.d.ts.map +1 -0
- package/dist/checks/performance/async-batch-concurrency.js +352 -0
- package/dist/checks/performance/async-batch-concurrency.js.map +1 -0
- package/dist/checks/security/deprecated-node-apis-validation.d.ts +31 -0
- package/dist/checks/security/deprecated-node-apis-validation.d.ts.map +1 -0
- package/dist/checks/security/deprecated-node-apis-validation.js +324 -0
- package/dist/checks/security/deprecated-node-apis-validation.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env tsx
|
|
2
|
+
/**
|
|
3
|
+
* Auto-Approval System Validation Preflight
|
|
4
|
+
*
|
|
5
|
+
* Ensures the auto-approval system for catalog-matched listings is properly implemented:
|
|
6
|
+
* 1. Configuration with environment variables
|
|
7
|
+
* 2. Variant matching by product type (sports vs TCG)
|
|
8
|
+
* 3. Confidence threshold validation
|
|
9
|
+
* 4. Integration with listing submission APIs
|
|
10
|
+
* 5. Audit logging for decisions
|
|
11
|
+
*
|
|
12
|
+
* This prevents regressions in the auto-approval logic that could:
|
|
13
|
+
* - Auto-approve cards that should require review
|
|
14
|
+
* - Block auto-approval for valid catalog matches
|
|
15
|
+
* - Cause variant mismatches (e.g., base card matched to holo)
|
|
16
|
+
*/
|
|
17
|
+
export declare const id = "business/auto-approval-system-validation";
|
|
18
|
+
export declare const name = "Auto-Approval System Validation";
|
|
19
|
+
export declare const description = "Validates the auto-approval system for catalog-matched listings with variant matching";
|
|
20
|
+
export declare const category = "business";
|
|
21
|
+
export declare const blocking = true;
|
|
22
|
+
export declare const tags: string[];
|
|
23
|
+
declare function main(): Promise<void>;
|
|
24
|
+
export { main as run };
|
|
25
|
+
//# sourceMappingURL=auto-approval-system-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-approval-system-validation.d.ts","sourceRoot":"","sources":["../../../src/checks/business/auto-approval-system-validation.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;GAcG;AASH,eAAO,MAAM,EAAE,6CAA6C,CAAC;AAC7D,eAAO,MAAM,IAAI,oCAAoC,CAAC;AACtD,eAAO,MAAM,WAAW,0FACiE,CAAC;AAC1F,eAAO,MAAM,QAAQ,aAAa,CAAC;AACnC,eAAO,MAAM,QAAQ,OAAO,CAAC;AAC7B,eAAO,MAAM,IAAI,UAAkF,CAAC;AAqDpG,iBAAe,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CA8XnC;AAUD,OAAO,EAAE,IAAI,IAAI,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
#!/usr/bin/env tsx
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* Auto-Approval System Validation Preflight
|
|
5
|
+
*
|
|
6
|
+
* Ensures the auto-approval system for catalog-matched listings is properly implemented:
|
|
7
|
+
* 1. Configuration with environment variables
|
|
8
|
+
* 2. Variant matching by product type (sports vs TCG)
|
|
9
|
+
* 3. Confidence threshold validation
|
|
10
|
+
* 4. Integration with listing submission APIs
|
|
11
|
+
* 5. Audit logging for decisions
|
|
12
|
+
*
|
|
13
|
+
* This prevents regressions in the auto-approval logic that could:
|
|
14
|
+
* - Auto-approve cards that should require review
|
|
15
|
+
* - Block auto-approval for valid catalog matches
|
|
16
|
+
* - Cause variant mismatches (e.g., base card matched to holo)
|
|
17
|
+
*/
|
|
18
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
21
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
22
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
23
|
+
}
|
|
24
|
+
Object.defineProperty(o, k2, desc);
|
|
25
|
+
}) : (function(o, m, k, k2) {
|
|
26
|
+
if (k2 === undefined) k2 = k;
|
|
27
|
+
o[k2] = m[k];
|
|
28
|
+
}));
|
|
29
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
30
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
31
|
+
}) : function(o, v) {
|
|
32
|
+
o["default"] = v;
|
|
33
|
+
});
|
|
34
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
35
|
+
var ownKeys = function(o) {
|
|
36
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
37
|
+
var ar = [];
|
|
38
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
39
|
+
return ar;
|
|
40
|
+
};
|
|
41
|
+
return ownKeys(o);
|
|
42
|
+
};
|
|
43
|
+
return function (mod) {
|
|
44
|
+
if (mod && mod.__esModule) return mod;
|
|
45
|
+
var result = {};
|
|
46
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
47
|
+
__setModuleDefault(result, mod);
|
|
48
|
+
return result;
|
|
49
|
+
};
|
|
50
|
+
})();
|
|
51
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
|
+
exports.tags = exports.blocking = exports.category = exports.description = exports.name = exports.id = void 0;
|
|
53
|
+
exports.run = main;
|
|
54
|
+
const fs = __importStar(require("node:fs"));
|
|
55
|
+
const path = __importStar(require("node:path"));
|
|
56
|
+
const console_chars_1 = require("../../utils/console-chars");
|
|
57
|
+
const universal_progress_reporter_1 = require("../system/universal-progress-reporter");
|
|
58
|
+
// PREFLIGHT METADATA
|
|
59
|
+
exports.id = "business/auto-approval-system-validation";
|
|
60
|
+
exports.name = "Auto-Approval System Validation";
|
|
61
|
+
exports.description = "Validates the auto-approval system for catalog-matched listings with variant matching";
|
|
62
|
+
exports.category = "business";
|
|
63
|
+
exports.blocking = true;
|
|
64
|
+
exports.tags = ["business", "auto-approval", "catalog", "variant", "listing", "configuration"];
|
|
65
|
+
const results = [];
|
|
66
|
+
const TRADING_CARD_SYSTEM_PATH = path.resolve(__dirname, "../../../../trading-card-system");
|
|
67
|
+
function addResult(result) {
|
|
68
|
+
results.push(result);
|
|
69
|
+
const icon = result.passed ? console_chars_1.emoji.success : (result.severity === "warning" ? console_chars_1.emoji.warning : console_chars_1.emoji.error);
|
|
70
|
+
const location = result.file ? ` (${result.file}${result.line ? `:${result.line}` : ""})` : "";
|
|
71
|
+
console.log(` ${icon} ${result.message}${location}`);
|
|
72
|
+
}
|
|
73
|
+
function fileExists(filePath) {
|
|
74
|
+
const fullPath = path.join(TRADING_CARD_SYSTEM_PATH, filePath);
|
|
75
|
+
return fs.existsSync(fullPath);
|
|
76
|
+
}
|
|
77
|
+
function fileContains(filePath, pattern) {
|
|
78
|
+
const fullPath = path.join(TRADING_CARD_SYSTEM_PATH, filePath);
|
|
79
|
+
if (!fs.existsSync(fullPath)) {
|
|
80
|
+
return { found: false };
|
|
81
|
+
}
|
|
82
|
+
const content = fs.readFileSync(fullPath, "utf8");
|
|
83
|
+
const lines = content.split("\n");
|
|
84
|
+
for (let i = 0; i < lines.length; i++) {
|
|
85
|
+
const lineContent = lines[i] || "";
|
|
86
|
+
const match = lineContent.match(pattern);
|
|
87
|
+
if (match) {
|
|
88
|
+
return { found: true, line: i + 1, match: match[0] };
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
// Check full content for multi-line patterns
|
|
92
|
+
const fullMatch = content.match(pattern);
|
|
93
|
+
if (fullMatch) {
|
|
94
|
+
return { found: true, match: fullMatch[0] };
|
|
95
|
+
}
|
|
96
|
+
return { found: false };
|
|
97
|
+
}
|
|
98
|
+
async function main() {
|
|
99
|
+
const reporter = (0, universal_progress_reporter_1.createUniversalProgressReporter)(exports.name);
|
|
100
|
+
console.log(`\n${console_chars_1.emoji.rocket} AUTO-APPROVAL SYSTEM VALIDATION PREFLIGHT`);
|
|
101
|
+
console.log((0, console_chars_1.createDivider)(60, "heavy"));
|
|
102
|
+
console.log(`${console_chars_1.emoji.info} Validating auto-approval logic and configuration...\n`);
|
|
103
|
+
// ---
|
|
104
|
+
// 1. Auto-Approval Core Module
|
|
105
|
+
// ---
|
|
106
|
+
console.log(`${console_chars_1.emoji.folder} Checking auto-approval core module...`);
|
|
107
|
+
const autoApprovalPath = "lib/auto-approval.ts";
|
|
108
|
+
if (!fileExists(autoApprovalPath)) {
|
|
109
|
+
addResult({
|
|
110
|
+
passed: false,
|
|
111
|
+
message: "Missing auto-approval.ts module",
|
|
112
|
+
file: autoApprovalPath,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
addResult({
|
|
117
|
+
passed: true,
|
|
118
|
+
message: "auto-approval.ts module exists",
|
|
119
|
+
file: autoApprovalPath,
|
|
120
|
+
});
|
|
121
|
+
// Check for getAutoApprovalConfig function
|
|
122
|
+
const hasConfig = fileContains(autoApprovalPath, /getAutoApprovalConfig/);
|
|
123
|
+
addResult({
|
|
124
|
+
passed: hasConfig.found,
|
|
125
|
+
message: hasConfig.found
|
|
126
|
+
? "Has getAutoApprovalConfig function"
|
|
127
|
+
: "Missing getAutoApprovalConfig - can't read configuration",
|
|
128
|
+
file: autoApprovalPath,
|
|
129
|
+
line: hasConfig.line,
|
|
130
|
+
});
|
|
131
|
+
// Check for evaluateAutoApproval function
|
|
132
|
+
const hasEvaluate = fileContains(autoApprovalPath, /evaluateAutoApproval/);
|
|
133
|
+
addResult({
|
|
134
|
+
passed: hasEvaluate.found,
|
|
135
|
+
message: hasEvaluate.found
|
|
136
|
+
? "Has evaluateAutoApproval function"
|
|
137
|
+
: "Missing evaluateAutoApproval - can't evaluate listings",
|
|
138
|
+
file: autoApprovalPath,
|
|
139
|
+
line: hasEvaluate.line,
|
|
140
|
+
});
|
|
141
|
+
// Check for variantsMatch function
|
|
142
|
+
const hasVariantMatch = fileContains(autoApprovalPath, /variantsMatch/);
|
|
143
|
+
addResult({
|
|
144
|
+
passed: hasVariantMatch.found,
|
|
145
|
+
message: hasVariantMatch.found
|
|
146
|
+
? "Has variantsMatch function"
|
|
147
|
+
: "Missing variantsMatch - could match base cards to holo catalog entries",
|
|
148
|
+
file: autoApprovalPath,
|
|
149
|
+
line: hasVariantMatch.line,
|
|
150
|
+
});
|
|
151
|
+
// Check for VARIANT_ATTRIBUTES_BY_TYPE
|
|
152
|
+
const hasVariantAttributes = fileContains(autoApprovalPath, /VARIANT_ATTRIBUTES_BY_TYPE/);
|
|
153
|
+
addResult({
|
|
154
|
+
passed: hasVariantAttributes.found,
|
|
155
|
+
message: hasVariantAttributes.found
|
|
156
|
+
? "Has product-type-specific variant attributes"
|
|
157
|
+
: "Missing VARIANT_ATTRIBUTES_BY_TYPE - variant matching may be incorrect",
|
|
158
|
+
file: autoApprovalPath,
|
|
159
|
+
line: hasVariantAttributes.line,
|
|
160
|
+
});
|
|
161
|
+
// Check for hologram attribute (sports cards)
|
|
162
|
+
const hasHologram = fileContains(autoApprovalPath, /hologram/);
|
|
163
|
+
addResult({
|
|
164
|
+
passed: hasHologram.found,
|
|
165
|
+
message: hasHologram.found
|
|
166
|
+
? "Checks hologram attribute"
|
|
167
|
+
: "Missing hologram check - refractors could match base cards",
|
|
168
|
+
file: autoApprovalPath,
|
|
169
|
+
line: hasHologram.line,
|
|
170
|
+
});
|
|
171
|
+
// Check for foil attribute (TCG cards)
|
|
172
|
+
const hasFoil = fileContains(autoApprovalPath, /foil/);
|
|
173
|
+
addResult({
|
|
174
|
+
passed: hasFoil.found,
|
|
175
|
+
message: hasFoil.found
|
|
176
|
+
? "Checks foil attribute for TCG cards"
|
|
177
|
+
: "Missing foil check - TCG foils could match non-foil cards",
|
|
178
|
+
file: autoApprovalPath,
|
|
179
|
+
line: hasFoil.line,
|
|
180
|
+
});
|
|
181
|
+
// Check for autographed attribute
|
|
182
|
+
const hasAutographed = fileContains(autoApprovalPath, /autographed/);
|
|
183
|
+
addResult({
|
|
184
|
+
passed: hasAutographed.found,
|
|
185
|
+
message: hasAutographed.found
|
|
186
|
+
? "Checks autographed attribute"
|
|
187
|
+
: "Missing autographed check - could match autos to base cards",
|
|
188
|
+
file: autoApprovalPath,
|
|
189
|
+
line: hasAutographed.line,
|
|
190
|
+
});
|
|
191
|
+
// Check for serialNumbered attribute
|
|
192
|
+
const hasSerialNumbered = fileContains(autoApprovalPath, /serialNumbered/);
|
|
193
|
+
addResult({
|
|
194
|
+
passed: hasSerialNumbered.found,
|
|
195
|
+
message: hasSerialNumbered.found
|
|
196
|
+
? "Checks serialNumbered attribute"
|
|
197
|
+
: "Missing serialNumbered check - numbered cards could match non-numbered",
|
|
198
|
+
file: autoApprovalPath,
|
|
199
|
+
line: hasSerialNumbered.line,
|
|
200
|
+
});
|
|
201
|
+
// Check for confidence threshold validation
|
|
202
|
+
const hasConfidenceCheck = fileContains(autoApprovalPath, /confidenceThreshold|confidence.*threshold/i);
|
|
203
|
+
addResult({
|
|
204
|
+
passed: hasConfidenceCheck.found,
|
|
205
|
+
message: hasConfidenceCheck.found
|
|
206
|
+
? "Has confidence threshold checking"
|
|
207
|
+
: "Missing confidence threshold - low confidence cards might auto-approve",
|
|
208
|
+
file: autoApprovalPath,
|
|
209
|
+
line: hasConfidenceCheck.line,
|
|
210
|
+
});
|
|
211
|
+
// Check for processAutoApproval function
|
|
212
|
+
const hasProcessApproval = fileContains(autoApprovalPath, /processAutoApproval/);
|
|
213
|
+
addResult({
|
|
214
|
+
passed: hasProcessApproval.found,
|
|
215
|
+
message: hasProcessApproval.found
|
|
216
|
+
? "Has processAutoApproval function for image processing"
|
|
217
|
+
: "Missing processAutoApproval - images won't be processed for auto-approved listings",
|
|
218
|
+
file: autoApprovalPath,
|
|
219
|
+
line: hasProcessApproval.line,
|
|
220
|
+
});
|
|
221
|
+
// Check for audit logging
|
|
222
|
+
const hasAuditLog = fileContains(autoApprovalPath, /persistAutoApprovalDecision|logAutoApprovalDecision/);
|
|
223
|
+
addResult({
|
|
224
|
+
passed: hasAuditLog.found,
|
|
225
|
+
message: hasAuditLog.found
|
|
226
|
+
? "Has audit logging for decisions"
|
|
227
|
+
: "Missing audit logging - can't track auto-approval decisions",
|
|
228
|
+
file: autoApprovalPath,
|
|
229
|
+
line: hasAuditLog.line,
|
|
230
|
+
});
|
|
231
|
+
// Check for environment variable validation
|
|
232
|
+
const hasEnvValidation = fileContains(autoApprovalPath, /Number\.isNaN|isNaN|parseFloat.*\|\|/);
|
|
233
|
+
addResult({
|
|
234
|
+
passed: hasEnvValidation.found,
|
|
235
|
+
message: hasEnvValidation.found
|
|
236
|
+
? "Has environment variable validation"
|
|
237
|
+
: "Missing env var validation - invalid config could cause issues",
|
|
238
|
+
file: autoApprovalPath,
|
|
239
|
+
line: hasEnvValidation.line,
|
|
240
|
+
severity: hasEnvValidation.found ? undefined : "warning",
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
// ---
|
|
244
|
+
// 2. Submit-Single API Integration
|
|
245
|
+
// ---
|
|
246
|
+
console.log(`\n${console_chars_1.emoji.folder} Checking submit-single API integration...`);
|
|
247
|
+
const submitSinglePath = "app/api/listings/submit-single/route.ts";
|
|
248
|
+
if (!fileExists(submitSinglePath)) {
|
|
249
|
+
addResult({
|
|
250
|
+
passed: false,
|
|
251
|
+
message: "Missing submit-single API route",
|
|
252
|
+
file: submitSinglePath,
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
// Check for evaluateAutoApproval import/usage
|
|
257
|
+
const usesEvaluate = fileContains(submitSinglePath, /evaluateAutoApproval/);
|
|
258
|
+
addResult({
|
|
259
|
+
passed: usesEvaluate.found,
|
|
260
|
+
message: usesEvaluate.found
|
|
261
|
+
? "submit-single uses evaluateAutoApproval"
|
|
262
|
+
: "submit-single doesn't use evaluateAutoApproval - auto-approval disabled",
|
|
263
|
+
file: submitSinglePath,
|
|
264
|
+
line: usesEvaluate.line,
|
|
265
|
+
});
|
|
266
|
+
// Check for processAutoApproval usage
|
|
267
|
+
const usesProcess = fileContains(submitSinglePath, /processAutoApproval/);
|
|
268
|
+
addResult({
|
|
269
|
+
passed: usesProcess.found,
|
|
270
|
+
message: usesProcess.found
|
|
271
|
+
? "submit-single processes approved listings"
|
|
272
|
+
: "submit-single doesn't process auto-approved listings",
|
|
273
|
+
file: submitSinglePath,
|
|
274
|
+
line: usesProcess.line,
|
|
275
|
+
});
|
|
276
|
+
// Check for ACTIVE status setting
|
|
277
|
+
const setsActiveStatus = fileContains(submitSinglePath, /listingStatus.*ACTIVE|ACTIVE.*listingStatus/);
|
|
278
|
+
addResult({
|
|
279
|
+
passed: setsActiveStatus.found,
|
|
280
|
+
message: setsActiveStatus.found
|
|
281
|
+
? "Can set listings to ACTIVE status"
|
|
282
|
+
: "Doesn't set ACTIVE status - auto-approved listings won't go live",
|
|
283
|
+
file: submitSinglePath,
|
|
284
|
+
line: setsActiveStatus.line,
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
// ---
|
|
288
|
+
// 3. Bulk-Create API Integration
|
|
289
|
+
// ---
|
|
290
|
+
console.log(`\n${console_chars_1.emoji.folder} Checking bulk-create API integration...`);
|
|
291
|
+
const bulkCreatePath = "app/api/listings/bulk-create/route.ts";
|
|
292
|
+
if (!fileExists(bulkCreatePath)) {
|
|
293
|
+
addResult({
|
|
294
|
+
passed: false,
|
|
295
|
+
message: "Missing bulk-create API route",
|
|
296
|
+
file: bulkCreatePath,
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
// Check for evaluateAutoApproval import/usage
|
|
301
|
+
const usesEvaluate = fileContains(bulkCreatePath, /evaluateAutoApproval/);
|
|
302
|
+
addResult({
|
|
303
|
+
passed: usesEvaluate.found,
|
|
304
|
+
message: usesEvaluate.found
|
|
305
|
+
? "bulk-create uses evaluateAutoApproval"
|
|
306
|
+
: "bulk-create doesn't use evaluateAutoApproval - auto-approval disabled for bulk",
|
|
307
|
+
file: bulkCreatePath,
|
|
308
|
+
line: usesEvaluate.line,
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
// ---
|
|
312
|
+
// 4. Environment Configuration
|
|
313
|
+
// ---
|
|
314
|
+
console.log(`\n${console_chars_1.emoji.folder} Checking environment configuration...`);
|
|
315
|
+
const envExamplePath = ".env.example";
|
|
316
|
+
if (fileExists(envExamplePath)) {
|
|
317
|
+
// Check for AUTO_APPROVAL_ENABLED
|
|
318
|
+
const hasEnabledVar = fileContains(envExamplePath, /AUTO_APPROVAL_ENABLED/);
|
|
319
|
+
addResult({
|
|
320
|
+
passed: hasEnabledVar.found,
|
|
321
|
+
message: hasEnabledVar.found
|
|
322
|
+
? "Has AUTO_APPROVAL_ENABLED in .env.example"
|
|
323
|
+
: "Missing AUTO_APPROVAL_ENABLED in .env.example",
|
|
324
|
+
file: envExamplePath,
|
|
325
|
+
line: hasEnabledVar.line,
|
|
326
|
+
severity: hasEnabledVar.found ? undefined : "warning",
|
|
327
|
+
});
|
|
328
|
+
// Check for AUTO_APPROVAL_CONFIDENCE_THRESHOLD
|
|
329
|
+
const hasThresholdVar = fileContains(envExamplePath, /AUTO_APPROVAL_CONFIDENCE_THRESHOLD/);
|
|
330
|
+
addResult({
|
|
331
|
+
passed: hasThresholdVar.found,
|
|
332
|
+
message: hasThresholdVar.found
|
|
333
|
+
? "Has AUTO_APPROVAL_CONFIDENCE_THRESHOLD in .env.example"
|
|
334
|
+
: "Missing AUTO_APPROVAL_CONFIDENCE_THRESHOLD in .env.example",
|
|
335
|
+
file: envExamplePath,
|
|
336
|
+
line: hasThresholdVar.line,
|
|
337
|
+
severity: hasThresholdVar.found ? undefined : "warning",
|
|
338
|
+
});
|
|
339
|
+
// Check for AUTO_APPROVAL_MAX_PRICE
|
|
340
|
+
const hasMaxPriceVar = fileContains(envExamplePath, /AUTO_APPROVAL_MAX_PRICE/);
|
|
341
|
+
addResult({
|
|
342
|
+
passed: hasMaxPriceVar.found,
|
|
343
|
+
message: hasMaxPriceVar.found
|
|
344
|
+
? "Has AUTO_APPROVAL_MAX_PRICE in .env.example"
|
|
345
|
+
: "Missing AUTO_APPROVAL_MAX_PRICE in .env.example",
|
|
346
|
+
file: envExamplePath,
|
|
347
|
+
line: hasMaxPriceVar.line,
|
|
348
|
+
severity: hasMaxPriceVar.found ? undefined : "warning",
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
// ---
|
|
352
|
+
// 5. Unit Tests
|
|
353
|
+
// ---
|
|
354
|
+
console.log(`\n${console_chars_1.emoji.folder} Checking unit tests...`);
|
|
355
|
+
const testPath = "tests/unit/listings/auto-approval.test.ts";
|
|
356
|
+
if (fileExists(testPath)) {
|
|
357
|
+
addResult({
|
|
358
|
+
passed: true,
|
|
359
|
+
message: "Has auto-approval unit tests",
|
|
360
|
+
file: testPath,
|
|
361
|
+
});
|
|
362
|
+
// Check for variant matching tests
|
|
363
|
+
const hasVariantTests = fileContains(testPath, /variant.*match|hologram.*differ/i);
|
|
364
|
+
addResult({
|
|
365
|
+
passed: hasVariantTests.found,
|
|
366
|
+
message: hasVariantTests.found
|
|
367
|
+
? "Tests variant matching scenarios"
|
|
368
|
+
: "Missing variant matching tests",
|
|
369
|
+
file: testPath,
|
|
370
|
+
line: hasVariantTests.line,
|
|
371
|
+
});
|
|
372
|
+
// Check for confidence threshold tests
|
|
373
|
+
const hasConfidenceTests = fileContains(testPath, /confidence.*threshold|below.*threshold/i);
|
|
374
|
+
addResult({
|
|
375
|
+
passed: hasConfidenceTests.found,
|
|
376
|
+
message: hasConfidenceTests.found
|
|
377
|
+
? "Tests confidence threshold scenarios"
|
|
378
|
+
: "Missing confidence threshold tests",
|
|
379
|
+
file: testPath,
|
|
380
|
+
line: hasConfidenceTests.line,
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
else {
|
|
384
|
+
addResult({
|
|
385
|
+
passed: false,
|
|
386
|
+
message: "Missing auto-approval unit tests",
|
|
387
|
+
file: testPath,
|
|
388
|
+
severity: "warning",
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
// ---
|
|
392
|
+
// 6. Database Audit Table
|
|
393
|
+
// ---
|
|
394
|
+
console.log(`\n${console_chars_1.emoji.folder} Checking database audit logging...`);
|
|
395
|
+
const schemaPath = "prisma/schema.prisma";
|
|
396
|
+
if (fileExists(schemaPath)) {
|
|
397
|
+
const hasAuditModel = fileContains(schemaPath, /AutoApprovalLogs|auto_approval_logs/);
|
|
398
|
+
addResult({
|
|
399
|
+
passed: hasAuditModel.found,
|
|
400
|
+
message: hasAuditModel.found
|
|
401
|
+
? "Has AutoApprovalLogs model in schema"
|
|
402
|
+
: "Missing AutoApprovalLogs model - can't persist audit trail",
|
|
403
|
+
file: schemaPath,
|
|
404
|
+
line: hasAuditModel.line,
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
// ---
|
|
408
|
+
// SUMMARY
|
|
409
|
+
// ---
|
|
410
|
+
console.log("\n" + (0, console_chars_1.createDivider)(60, "heavy"));
|
|
411
|
+
console.log(`${console_chars_1.emoji.chart} VALIDATION SUMMARY`);
|
|
412
|
+
console.log((0, console_chars_1.createDivider)(60, "heavy"));
|
|
413
|
+
const passed = results.filter((r) => r.passed).length;
|
|
414
|
+
const failed = results.filter((r) => !r.passed && r.severity !== "warning").length;
|
|
415
|
+
const warnings = results.filter((r) => !r.passed && r.severity === "warning").length;
|
|
416
|
+
const total = results.length;
|
|
417
|
+
console.log(`${console_chars_1.emoji.success} Passed: ${passed}/${total}`);
|
|
418
|
+
if (failed > 0) {
|
|
419
|
+
console.log(`${console_chars_1.emoji.error} Failed: ${failed}`);
|
|
420
|
+
}
|
|
421
|
+
if (warnings > 0) {
|
|
422
|
+
console.log(`${console_chars_1.emoji.warning} Warnings: ${warnings}`);
|
|
423
|
+
}
|
|
424
|
+
// Show summary
|
|
425
|
+
reporter.showSummary({
|
|
426
|
+
filesProcessed: total,
|
|
427
|
+
issuesFound: failed + warnings,
|
|
428
|
+
errors: failed,
|
|
429
|
+
warnings: warnings,
|
|
430
|
+
});
|
|
431
|
+
console.log((0, console_chars_1.createDivider)(60, "heavy"));
|
|
432
|
+
if (failed > 0) {
|
|
433
|
+
console.log(`\n${console_chars_1.emoji.error} AUTO-APPROVAL SYSTEM VALIDATION FAILED`);
|
|
434
|
+
console.log(`\n${console_chars_1.emoji.info} Auto-approval may not work correctly!`);
|
|
435
|
+
console.log(`\n${console_chars_1.emoji.hint} To fix:`);
|
|
436
|
+
console.log(` 1. Ensure lib/auto-approval.ts has all required functions`);
|
|
437
|
+
console.log(` 2. Ensure variant matching checks all attributes by product type`);
|
|
438
|
+
console.log(` 3. Ensure submit-single and bulk-create integrate auto-approval`);
|
|
439
|
+
console.log(` 4. Run: pnpm test tests/unit/listings/auto-approval.test.ts`);
|
|
440
|
+
process.exit(1);
|
|
441
|
+
}
|
|
442
|
+
else if (warnings > 0) {
|
|
443
|
+
console.log(`\n${console_chars_1.emoji.warning} AUTO-APPROVAL SYSTEM VALIDATION PASSED WITH WARNINGS`);
|
|
444
|
+
process.exit(0);
|
|
445
|
+
}
|
|
446
|
+
else {
|
|
447
|
+
console.log(`\n${console_chars_1.emoji.success} AUTO-APPROVAL SYSTEM VALIDATION PASSED`);
|
|
448
|
+
process.exit(0);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
// Run if called directly
|
|
452
|
+
if (require.main === module) {
|
|
453
|
+
main().catch((error) => {
|
|
454
|
+
console.error(`${console_chars_1.emoji.error} Fatal error:`, error);
|
|
455
|
+
process.exit(1);
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
//# sourceMappingURL=auto-approval-system-validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-approval-system-validation.js","sourceRoot":"","sources":["../../../src/checks/business/auto-approval-system-validation.ts"],"names":[],"mappings":";;AACA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4cc,mBAAG;AA1cpB,4CAA8B;AAC9B,gDAAkC;AAClC,6DAAiE;AACjE,uFAAwF;AAExF,qBAAqB;AAER,QAAA,EAAE,GAAG,0CAA0C,CAAC;AAChD,QAAA,IAAI,GAAG,iCAAiC,CAAC;AACzC,QAAA,WAAW,GACtB,uFAAuF,CAAC;AAC7E,QAAA,QAAQ,GAAG,UAAU,CAAC;AACtB,QAAA,QAAQ,GAAG,IAAI,CAAC;AAChB,QAAA,IAAI,GAAG,CAAC,UAAU,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AClF,OAAO,CAAC,GAAG,CAAC,mEAAmE,CAAC,CAAC;QACjF,OAAO,CAAC,GAAG,CAAC,+DAA+D,CAAC,CAAC;QAC7E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;SAAM,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;QACxB,OAAO,CAAC,GAAG,CAAC,KAAK,qBAAK,CAAC,OAAO,uDAAuD,CAAC,CAAC;QACvF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,KAAK,qBAAK,CAAC,OAAO,yCAAyC,CAAC,CAAC;QACzE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,yBAAyB;AACzB,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACrB,OAAO,CAAC,KAAK,CAAC,GAAG,qBAAK,CAAC,KAAK,eAAe,EAAE,KAAK,CAAC,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env tsx
|
|
2
|
+
/**
|
|
3
|
+
* Listing Submission Flow Validation Preflight
|
|
4
|
+
*
|
|
5
|
+
* Ensures the listing submission flow is properly implemented:
|
|
6
|
+
* 1. Confirmation page shows immediately when last card is submitted (no flash)
|
|
7
|
+
* 2. Optimistic UI updates are properly implemented
|
|
8
|
+
* 3. Submission tracking state is correct
|
|
9
|
+
* 4. Error handling reverts state properly
|
|
10
|
+
*
|
|
11
|
+
* This prevents UI regressions like flashing the dropzone before confirmation.
|
|
12
|
+
*/
|
|
13
|
+
export declare const id = "business/listing-submission-flow-validation";
|
|
14
|
+
export declare const name = "Listing Submission Flow Validation";
|
|
15
|
+
export declare const description = "Validates the listing submission flow for proper UI transitions and state management";
|
|
16
|
+
export declare const category = "business";
|
|
17
|
+
export declare const blocking = true;
|
|
18
|
+
export declare const tags: string[];
|
|
19
|
+
declare function main(): Promise<void>;
|
|
20
|
+
export { main as run };
|
|
21
|
+
//# sourceMappingURL=listing-submission-flow-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listing-submission-flow-validation.d.ts","sourceRoot":"","sources":["../../../src/checks/business/listing-submission-flow-validation.ts"],"names":[],"mappings":";AACA;;;;;;;;;;GAUG;AASH,eAAO,MAAM,EAAE,gDAAgD,CAAC;AAChE,eAAO,MAAM,IAAI,uCAAuC,CAAC;AACzD,eAAO,MAAM,WAAW,yFACgE,CAAC;AACzF,eAAO,MAAM,QAAQ,aAAa,CAAC;AACnC,eAAO,MAAM,QAAQ,OAAO,CAAC;AAC7B,eAAO,MAAM,IAAI,UAAiF,CAAC;AAqDnG,iBAAe,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CA+TnC;AAUD,OAAO,EAAE,IAAI,IAAI,GAAG,EAAE,CAAC"}
|