@empline/preflight 1.1.58 → 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.
Files changed (62) hide show
  1. package/dist/checks/accessibility/accessibility-validation.d.ts.map +1 -1
  2. package/dist/checks/accessibility/accessibility-validation.js +131 -14
  3. package/dist/checks/accessibility/accessibility-validation.js.map +1 -1
  4. package/dist/checks/accessibility/wcag-advanced-validation.d.ts +10 -0
  5. package/dist/checks/accessibility/wcag-advanced-validation.d.ts.map +1 -0
  6. package/dist/checks/accessibility/wcag-advanced-validation.js +622 -0
  7. package/dist/checks/accessibility/wcag-advanced-validation.js.map +1 -0
  8. package/dist/checks/business/auto-approval-system-validation.d.ts +25 -0
  9. package/dist/checks/business/auto-approval-system-validation.d.ts.map +1 -0
  10. package/dist/checks/business/auto-approval-system-validation.js +458 -0
  11. package/dist/checks/business/auto-approval-system-validation.js.map +1 -0
  12. package/dist/checks/business/listing-submission-flow-validation.d.ts +21 -0
  13. package/dist/checks/business/listing-submission-flow-validation.d.ts.map +1 -0
  14. package/dist/checks/business/listing-submission-flow-validation.js +394 -0
  15. package/dist/checks/business/listing-submission-flow-validation.js.map +1 -0
  16. package/dist/checks/business/multi-user-sync-validation.d.ts +21 -0
  17. package/dist/checks/business/multi-user-sync-validation.d.ts.map +1 -0
  18. package/dist/checks/business/multi-user-sync-validation.js +383 -0
  19. package/dist/checks/business/multi-user-sync-validation.js.map +1 -0
  20. package/dist/checks/consolidated/ui-spacing-standards.js +59 -0
  21. package/dist/checks/consolidated/ui-spacing-standards.js.map +1 -1
  22. package/dist/checks/data-integrity/catalog-image-protection-validation.d.ts +38 -0
  23. package/dist/checks/data-integrity/catalog-image-protection-validation.d.ts.map +1 -0
  24. package/dist/checks/data-integrity/catalog-image-protection-validation.js +368 -0
  25. package/dist/checks/data-integrity/catalog-image-protection-validation.js.map +1 -0
  26. package/dist/checks/data-integrity/image-url-validation.d.ts +22 -0
  27. package/dist/checks/data-integrity/image-url-validation.d.ts.map +1 -0
  28. package/dist/checks/data-integrity/image-url-validation.js +310 -0
  29. package/dist/checks/data-integrity/image-url-validation.js.map +1 -0
  30. package/dist/checks/database/query-performance-validation.d.ts +10 -0
  31. package/dist/checks/database/query-performance-validation.d.ts.map +1 -0
  32. package/dist/checks/database/query-performance-validation.js +544 -0
  33. package/dist/checks/database/query-performance-validation.js.map +1 -0
  34. package/dist/checks/performance/async-batch-concurrency.d.ts +10 -0
  35. package/dist/checks/performance/async-batch-concurrency.d.ts.map +1 -0
  36. package/dist/checks/performance/async-batch-concurrency.js +352 -0
  37. package/dist/checks/performance/async-batch-concurrency.js.map +1 -0
  38. package/dist/checks/react/react-patterns-validation.d.ts +10 -0
  39. package/dist/checks/react/react-patterns-validation.d.ts.map +1 -0
  40. package/dist/checks/react/react-patterns-validation.js +559 -0
  41. package/dist/checks/react/react-patterns-validation.js.map +1 -0
  42. package/dist/checks/security/deprecated-node-apis-validation.d.ts +31 -0
  43. package/dist/checks/security/deprecated-node-apis-validation.d.ts.map +1 -0
  44. package/dist/checks/security/deprecated-node-apis-validation.js +324 -0
  45. package/dist/checks/security/deprecated-node-apis-validation.js.map +1 -0
  46. package/dist/checks/security/security-headers-validation.d.ts +10 -0
  47. package/dist/checks/security/security-headers-validation.d.ts.map +1 -0
  48. package/dist/checks/security/security-headers-validation.js +594 -0
  49. package/dist/checks/security/security-headers-validation.js.map +1 -0
  50. package/dist/reporters/github-reporter.d.ts +35 -0
  51. package/dist/reporters/github-reporter.d.ts.map +1 -0
  52. package/dist/reporters/github-reporter.js +397 -0
  53. package/dist/reporters/github-reporter.js.map +1 -0
  54. package/dist/reporters/html-report.d.ts +12 -0
  55. package/dist/reporters/html-report.d.ts.map +1 -0
  56. package/dist/reporters/html-report.js +469 -0
  57. package/dist/reporters/html-report.js.map +1 -0
  58. package/dist/reporters/index.d.ts +8 -0
  59. package/dist/reporters/index.d.ts.map +1 -0
  60. package/dist/reporters/index.js +18 -0
  61. package/dist/reporters/index.js.map +1 -0
  62. package/package.json +1 -1
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env tsx
2
+ /**
3
+ * Catalog Image Protection Validation Preflight
4
+ *
5
+ * CRITICAL: Ensures catalog images are protected from orphan detection.
6
+ *
7
+ * Background:
8
+ * The admin image mapping page (/admin/images?tab=mapping) identifies "orphaned" images
9
+ * that are not linked to any active listings. However, catalog entries (products) exist
10
+ * independently of listings - a product can have official images even if no one is
11
+ * currently selling it.
12
+ *
13
+ * This preflight ensures:
14
+ * 1. The orphan detection queries ALL catalog tables for images
15
+ * 2. Catalog images are excluded from orphan detection
16
+ * 3. Both direct image URLs and responsive variants are protected
17
+ *
18
+ * Catalog tables with images:
19
+ * - CatalogSportsCards (officialImageUrl, officialBackImageUrl)
20
+ * - CatalogNonSportsCards (officialImageUrl, officialBackImageUrl)
21
+ * - CatalogTcgCards (officialImageUrl, officialBackImageUrl)
22
+ * - CatalogVideoGames (coverImageUrl, coverBackImageUrl)
23
+ * - CatalogTickets (officialImageUrl, officialBackImageUrl)
24
+ * - CatalogAutographs (officialImageUrl, officialBackImageUrl)
25
+ * - CatalogMemorabilia (officialImageUrl, officialBackImageUrl)
26
+ *
27
+ * If this preflight fails, catalog product images could be accidentally deleted
28
+ * when cleaning up orphaned images, causing data loss.
29
+ */
30
+ export declare const id = "data-integrity/catalog-image-protection-validation";
31
+ export declare const name = "Catalog Image Protection Validation";
32
+ export declare const description = "Ensures catalog product images are protected from orphan detection and accidental deletion";
33
+ export declare const category = "data-integrity";
34
+ export declare const blocking = true;
35
+ export declare const tags: string[];
36
+ declare function main(): Promise<void>;
37
+ export { main as run };
38
+ //# sourceMappingURL=catalog-image-protection-validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog-image-protection-validation.d.ts","sourceRoot":"","sources":["../../../src/checks/data-integrity/catalog-image-protection-validation.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AASH,eAAO,MAAM,EAAE,uDAAuD,CAAC;AACvE,eAAO,MAAM,IAAI,wCAAwC,CAAC;AAC1D,eAAO,MAAM,WAAW,+FACsE,CAAC;AAC/F,eAAO,MAAM,QAAQ,mBAAmB,CAAC;AACzC,eAAO,MAAM,QAAQ,OAAO,CAAC;AAC7B,eAAO,MAAM,IAAI,UAA8E,CAAC;AAqDhG,iBAAe,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAuRnC;AAUD,OAAO,EAAE,IAAI,IAAI,GAAG,EAAE,CAAC"}
@@ -0,0 +1,368 @@
1
+ #!/usr/bin/env tsx
2
+ "use strict";
3
+ /**
4
+ * Catalog Image Protection Validation Preflight
5
+ *
6
+ * CRITICAL: Ensures catalog images are protected from orphan detection.
7
+ *
8
+ * Background:
9
+ * The admin image mapping page (/admin/images?tab=mapping) identifies "orphaned" images
10
+ * that are not linked to any active listings. However, catalog entries (products) exist
11
+ * independently of listings - a product can have official images even if no one is
12
+ * currently selling it.
13
+ *
14
+ * This preflight ensures:
15
+ * 1. The orphan detection queries ALL catalog tables for images
16
+ * 2. Catalog images are excluded from orphan detection
17
+ * 3. Both direct image URLs and responsive variants are protected
18
+ *
19
+ * Catalog tables with images:
20
+ * - CatalogSportsCards (officialImageUrl, officialBackImageUrl)
21
+ * - CatalogNonSportsCards (officialImageUrl, officialBackImageUrl)
22
+ * - CatalogTcgCards (officialImageUrl, officialBackImageUrl)
23
+ * - CatalogVideoGames (coverImageUrl, coverBackImageUrl)
24
+ * - CatalogTickets (officialImageUrl, officialBackImageUrl)
25
+ * - CatalogAutographs (officialImageUrl, officialBackImageUrl)
26
+ * - CatalogMemorabilia (officialImageUrl, officialBackImageUrl)
27
+ *
28
+ * If this preflight fails, catalog product images could be accidentally deleted
29
+ * when cleaning up orphaned images, causing data loss.
30
+ */
31
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
32
+ if (k2 === undefined) k2 = k;
33
+ var desc = Object.getOwnPropertyDescriptor(m, k);
34
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
35
+ desc = { enumerable: true, get: function() { return m[k]; } };
36
+ }
37
+ Object.defineProperty(o, k2, desc);
38
+ }) : (function(o, m, k, k2) {
39
+ if (k2 === undefined) k2 = k;
40
+ o[k2] = m[k];
41
+ }));
42
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
43
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
44
+ }) : function(o, v) {
45
+ o["default"] = v;
46
+ });
47
+ var __importStar = (this && this.__importStar) || (function () {
48
+ var ownKeys = function(o) {
49
+ ownKeys = Object.getOwnPropertyNames || function (o) {
50
+ var ar = [];
51
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
52
+ return ar;
53
+ };
54
+ return ownKeys(o);
55
+ };
56
+ return function (mod) {
57
+ if (mod && mod.__esModule) return mod;
58
+ var result = {};
59
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
60
+ __setModuleDefault(result, mod);
61
+ return result;
62
+ };
63
+ })();
64
+ Object.defineProperty(exports, "__esModule", { value: true });
65
+ exports.tags = exports.blocking = exports.category = exports.description = exports.name = exports.id = void 0;
66
+ exports.run = main;
67
+ const fs = __importStar(require("node:fs"));
68
+ const path = __importStar(require("node:path"));
69
+ const console_chars_1 = require("../../utils/console-chars");
70
+ const universal_progress_reporter_1 = require("../system/universal-progress-reporter");
71
+ // PREFLIGHT METADATA
72
+ exports.id = "data-integrity/catalog-image-protection-validation";
73
+ exports.name = "Catalog Image Protection Validation";
74
+ exports.description = "Ensures catalog product images are protected from orphan detection and accidental deletion";
75
+ exports.category = "data-integrity";
76
+ exports.blocking = true;
77
+ exports.tags = ["data-integrity", "images", "catalog", "orphan", "protection", "critical"];
78
+ const results = [];
79
+ const TRADING_CARD_SYSTEM_PATH = path.resolve(__dirname, "../../../../trading-card-system");
80
+ function addResult(result) {
81
+ results.push(result);
82
+ const icon = result.passed ? console_chars_1.emoji.success : (result.severity === "warning" ? console_chars_1.emoji.warning : console_chars_1.emoji.error);
83
+ const location = result.file ? ` (${result.file}${result.line ? `:${result.line}` : ""})` : "";
84
+ console.log(` ${icon} ${result.message}${location}`);
85
+ }
86
+ function fileExists(filePath) {
87
+ const fullPath = path.join(TRADING_CARD_SYSTEM_PATH, filePath);
88
+ return fs.existsSync(fullPath);
89
+ }
90
+ function fileContains(filePath, pattern) {
91
+ const fullPath = path.join(TRADING_CARD_SYSTEM_PATH, filePath);
92
+ if (!fs.existsSync(fullPath)) {
93
+ return { found: false };
94
+ }
95
+ const content = fs.readFileSync(fullPath, "utf8");
96
+ const lines = content.split("\n");
97
+ for (let i = 0; i < lines.length; i++) {
98
+ const lineContent = lines[i] || "";
99
+ const match = lineContent.match(pattern);
100
+ if (match) {
101
+ return { found: true, line: i + 1, match: match[0] };
102
+ }
103
+ }
104
+ // Check full content for multi-line patterns
105
+ const fullMatch = content.match(pattern);
106
+ if (fullMatch) {
107
+ return { found: true, match: fullMatch[0] };
108
+ }
109
+ return { found: false };
110
+ }
111
+ async function main() {
112
+ const reporter = (0, universal_progress_reporter_1.createUniversalProgressReporter)(exports.name);
113
+ console.log(`\n${console_chars_1.emoji.rocket} CATALOG IMAGE PROTECTION VALIDATION PREFLIGHT`);
114
+ console.log((0, console_chars_1.createDivider)(60, "heavy"));
115
+ console.log(`${console_chars_1.emoji.info} Validating catalog images are protected from orphan detection...\n`);
116
+ // ---
117
+ // 1. Image Mapping API Route Exists
118
+ // ---
119
+ console.log(`${console_chars_1.emoji.folder} Checking image-mapping API route...`);
120
+ const imageMappingPath = "app/api/admin/image-mapping/route.ts";
121
+ if (!fileExists(imageMappingPath)) {
122
+ addResult({
123
+ passed: false,
124
+ message: "Missing image-mapping API route",
125
+ file: imageMappingPath,
126
+ });
127
+ }
128
+ else {
129
+ addResult({
130
+ passed: true,
131
+ message: "image-mapping API route exists",
132
+ file: imageMappingPath,
133
+ });
134
+ // ---
135
+ // 2. CatalogSportsCards Protection
136
+ // ---
137
+ console.log(`\n${console_chars_1.emoji.folder} Checking CatalogSportsCards image protection...`);
138
+ const hasSportsCardsQuery = fileContains(imageMappingPath, /catalogSportsCards\.findMany/);
139
+ addResult({
140
+ passed: hasSportsCardsQuery.found,
141
+ message: hasSportsCardsQuery.found
142
+ ? "Queries CatalogSportsCards for images"
143
+ : "CRITICAL: Missing CatalogSportsCards image query - sports card images could be orphaned!",
144
+ file: imageMappingPath,
145
+ line: hasSportsCardsQuery.line,
146
+ });
147
+ const hasSportsCardsOfficialImage = fileContains(imageMappingPath, /catalogSportsCards.*officialImageUrl/is);
148
+ addResult({
149
+ passed: hasSportsCardsOfficialImage.found,
150
+ message: hasSportsCardsOfficialImage.found
151
+ ? "Checks CatalogSportsCards.officialImageUrl"
152
+ : "Missing officialImageUrl check for CatalogSportsCards",
153
+ file: imageMappingPath,
154
+ line: hasSportsCardsOfficialImage.line,
155
+ });
156
+ // ---
157
+ // 3. CatalogNonSportsCards Protection
158
+ // ---
159
+ console.log(`\n${console_chars_1.emoji.folder} Checking CatalogNonSportsCards image protection...`);
160
+ const hasMasterCatalogQuery = fileContains(imageMappingPath, /catalogNonSportsCards\.findMany/);
161
+ addResult({
162
+ passed: hasMasterCatalogQuery.found,
163
+ message: hasMasterCatalogQuery.found
164
+ ? "Queries CatalogNonSportsCards for images"
165
+ : "CRITICAL: Missing CatalogNonSportsCards image query - master catalog images could be orphaned!",
166
+ file: imageMappingPath,
167
+ line: hasMasterCatalogQuery.line,
168
+ });
169
+ // ---
170
+ // 4. CatalogTcgCards Protection
171
+ // ---
172
+ console.log(`\n${console_chars_1.emoji.folder} Checking CatalogTcgCards image protection...`);
173
+ const hasTcgCardsQuery = fileContains(imageMappingPath, /catalogTcgCards\.findMany/);
174
+ addResult({
175
+ passed: hasTcgCardsQuery.found,
176
+ message: hasTcgCardsQuery.found
177
+ ? "Queries CatalogTcgCards for images"
178
+ : "CRITICAL: Missing CatalogTcgCards image query - TCG card images could be orphaned!",
179
+ file: imageMappingPath,
180
+ line: hasTcgCardsQuery.line,
181
+ });
182
+ // ---
183
+ // 5. CatalogVideoGames Protection
184
+ // ---
185
+ console.log(`\n${console_chars_1.emoji.folder} Checking CatalogVideoGames image protection...`);
186
+ const hasVideoGamesQuery = fileContains(imageMappingPath, /catalogVideoGames\.findMany/);
187
+ addResult({
188
+ passed: hasVideoGamesQuery.found,
189
+ message: hasVideoGamesQuery.found
190
+ ? "Queries CatalogVideoGames for images"
191
+ : "CRITICAL: Missing CatalogVideoGames image query - video game images could be orphaned!",
192
+ file: imageMappingPath,
193
+ line: hasVideoGamesQuery.line,
194
+ });
195
+ const hasVideoGamesCoverImage = fileContains(imageMappingPath, /coverImageUrl/);
196
+ addResult({
197
+ passed: hasVideoGamesCoverImage.found,
198
+ message: hasVideoGamesCoverImage.found
199
+ ? "Checks CatalogVideoGames.coverImageUrl"
200
+ : "Missing coverImageUrl check for CatalogVideoGames",
201
+ file: imageMappingPath,
202
+ line: hasVideoGamesCoverImage.line,
203
+ });
204
+ // ---
205
+ // 6. CatalogTickets Protection
206
+ // ---
207
+ console.log(`\n${console_chars_1.emoji.folder} Checking CatalogTickets image protection...`);
208
+ const hasTicketsQuery = fileContains(imageMappingPath, /catalogTickets\.findMany/);
209
+ addResult({
210
+ passed: hasTicketsQuery.found,
211
+ message: hasTicketsQuery.found
212
+ ? "Queries CatalogTickets for images"
213
+ : "CRITICAL: Missing CatalogTickets image query - ticket images could be orphaned!",
214
+ file: imageMappingPath,
215
+ line: hasTicketsQuery.line,
216
+ });
217
+ // ---
218
+ // 7. CatalogAutographs Protection
219
+ // ---
220
+ console.log(`\n${console_chars_1.emoji.folder} Checking CatalogAutographs image protection...`);
221
+ const hasAutographsQuery = fileContains(imageMappingPath, /catalogAutographs\.findMany/);
222
+ addResult({
223
+ passed: hasAutographsQuery.found,
224
+ message: hasAutographsQuery.found
225
+ ? "Queries CatalogAutographs for images"
226
+ : "CRITICAL: Missing CatalogAutographs image query - autograph images could be orphaned!",
227
+ file: imageMappingPath,
228
+ line: hasAutographsQuery.line,
229
+ });
230
+ // ---
231
+ // 8. CatalogMemorabilia Protection
232
+ // ---
233
+ console.log(`\n${console_chars_1.emoji.folder} Checking CatalogMemorabilia image protection...`);
234
+ const hasMemorabiliaQuery = fileContains(imageMappingPath, /catalogMemorabilia\.findMany/);
235
+ addResult({
236
+ passed: hasMemorabiliaQuery.found,
237
+ message: hasMemorabiliaQuery.found
238
+ ? "Queries CatalogMemorabilia for images"
239
+ : "CRITICAL: Missing CatalogMemorabilia image query - memorabilia images could be orphaned!",
240
+ file: imageMappingPath,
241
+ line: hasMemorabiliaQuery.line,
242
+ });
243
+ // ---
244
+ // 9. Catalog Image Keys Set
245
+ // ---
246
+ console.log(`\n${console_chars_1.emoji.folder} Checking catalog image protection mechanism...`);
247
+ const hasCatalogImageKeys = fileContains(imageMappingPath, /catalogImageKeys/);
248
+ addResult({
249
+ passed: hasCatalogImageKeys.found,
250
+ message: hasCatalogImageKeys.found
251
+ ? "Has catalogImageKeys set for tracking catalog images"
252
+ : "Missing catalogImageKeys set - catalog images not being tracked!",
253
+ file: imageMappingPath,
254
+ line: hasCatalogImageKeys.line,
255
+ });
256
+ // ---
257
+ // 10. Catalog Check in Orphan Filter
258
+ // ---
259
+ console.log(`\n${console_chars_1.emoji.folder} Checking orphan filter excludes catalog images...`);
260
+ const hasIsInCatalogCheck = fileContains(imageMappingPath, /isInCatalog/);
261
+ addResult({
262
+ passed: hasIsInCatalogCheck.found,
263
+ message: hasIsInCatalogCheck.found
264
+ ? "Orphan filter checks isInCatalog"
265
+ : "CRITICAL: Orphan filter missing isInCatalog check - catalog images will be orphaned!",
266
+ file: imageMappingPath,
267
+ line: hasIsInCatalogCheck.line,
268
+ });
269
+ const hasCatalogVariantCheck = fileContains(imageMappingPath, /isCatalogVariant/);
270
+ addResult({
271
+ passed: hasCatalogVariantCheck.found,
272
+ message: hasCatalogVariantCheck.found
273
+ ? "Orphan filter checks isCatalogVariant for responsive images"
274
+ : "Missing isCatalogVariant check - catalog image variants could be orphaned",
275
+ file: imageMappingPath,
276
+ line: hasCatalogVariantCheck.line,
277
+ severity: hasCatalogVariantCheck.found ? undefined : "warning",
278
+ });
279
+ // ---
280
+ // 11. Catalog Base Image Names
281
+ // ---
282
+ const hasCatalogBaseImageNames = fileContains(imageMappingPath, /catalogBaseImageNames/);
283
+ addResult({
284
+ passed: hasCatalogBaseImageNames.found,
285
+ message: hasCatalogBaseImageNames.found
286
+ ? "Has catalogBaseImageNames for responsive variant protection"
287
+ : "Missing catalogBaseImageNames - responsive variants of catalog images not protected",
288
+ file: imageMappingPath,
289
+ line: hasCatalogBaseImageNames.line,
290
+ severity: hasCatalogBaseImageNames.found ? undefined : "warning",
291
+ });
292
+ // ---
293
+ // 12. Back Image Protection
294
+ // ---
295
+ console.log(`\n${console_chars_1.emoji.folder} Checking back image protection...`);
296
+ const hasOfficialBackImageUrl = fileContains(imageMappingPath, /officialBackImageUrl/);
297
+ addResult({
298
+ passed: hasOfficialBackImageUrl.found,
299
+ message: hasOfficialBackImageUrl.found
300
+ ? "Protects officialBackImageUrl (back of card images)"
301
+ : "Missing officialBackImageUrl protection - back images could be orphaned",
302
+ file: imageMappingPath,
303
+ line: hasOfficialBackImageUrl.line,
304
+ });
305
+ const hasCoverBackImageUrl = fileContains(imageMappingPath, /coverBackImageUrl/);
306
+ addResult({
307
+ passed: hasCoverBackImageUrl.found,
308
+ message: hasCoverBackImageUrl.found
309
+ ? "Protects coverBackImageUrl (game back cover images)"
310
+ : "Missing coverBackImageUrl protection - game back covers could be orphaned",
311
+ file: imageMappingPath,
312
+ line: hasCoverBackImageUrl.line,
313
+ });
314
+ }
315
+ // ---
316
+ // SUMMARY
317
+ // ---
318
+ console.log("\n" + (0, console_chars_1.createDivider)(60, "heavy"));
319
+ console.log(`${console_chars_1.emoji.chart} VALIDATION SUMMARY`);
320
+ console.log((0, console_chars_1.createDivider)(60, "heavy"));
321
+ const passed = results.filter((r) => r.passed).length;
322
+ const failed = results.filter((r) => !r.passed && r.severity !== "warning").length;
323
+ const warnings = results.filter((r) => !r.passed && r.severity === "warning").length;
324
+ const total = results.length;
325
+ console.log(`${console_chars_1.emoji.success} Passed: ${passed}/${total}`);
326
+ if (failed > 0) {
327
+ console.log(`${console_chars_1.emoji.error} Failed: ${failed}`);
328
+ }
329
+ if (warnings > 0) {
330
+ console.log(`${console_chars_1.emoji.warning} Warnings: ${warnings}`);
331
+ }
332
+ // Show summary
333
+ reporter.showSummary({
334
+ filesProcessed: total,
335
+ issuesFound: failed + warnings,
336
+ errors: failed,
337
+ warnings: warnings,
338
+ });
339
+ console.log((0, console_chars_1.createDivider)(60, "heavy"));
340
+ if (failed > 0) {
341
+ console.log(`\n${console_chars_1.emoji.error} CATALOG IMAGE PROTECTION VALIDATION FAILED`);
342
+ console.log(`\n${console_chars_1.emoji.info} CRITICAL: Catalog images are NOT fully protected from orphan detection!`);
343
+ console.log(`\n${console_chars_1.emoji.hint} This could cause catalog product images to be accidentally deleted.`);
344
+ console.log(`\n${console_chars_1.emoji.hint} To fix:`);
345
+ console.log(` 1. Ensure image-mapping API queries ALL catalog tables for images`);
346
+ console.log(` 2. Ensure catalogImageKeys set includes all catalog image URLs`);
347
+ console.log(` 3. Ensure orphan filter checks isInCatalog before marking as orphaned`);
348
+ console.log(` 4. Ensure responsive variants of catalog images are also protected`);
349
+ process.exit(1);
350
+ }
351
+ else if (warnings > 0) {
352
+ console.log(`\n${console_chars_1.emoji.warning} CATALOG IMAGE PROTECTION VALIDATION PASSED WITH WARNINGS`);
353
+ process.exit(0);
354
+ }
355
+ else {
356
+ console.log(`\n${console_chars_1.emoji.success} CATALOG IMAGE PROTECTION VALIDATION PASSED`);
357
+ console.log(`\n${console_chars_1.emoji.info} All catalog images are protected from orphan detection.`);
358
+ process.exit(0);
359
+ }
360
+ }
361
+ // Run if called directly
362
+ if (require.main === module) {
363
+ main().catch((error) => {
364
+ console.error(`${console_chars_1.emoji.error} Fatal error:`, error);
365
+ process.exit(1);
366
+ });
367
+ }
368
+ //# sourceMappingURL=catalog-image-protection-validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog-image-protection-validation.js","sourceRoot":"","sources":["../../../src/checks/data-integrity/catalog-image-protection-validation.ts"],"names":[],"mappings":";;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqWc,mBAAG;AAnWpB,4CAA8B;AAC9B,gDAAkC;AAClC,6DAAiE;AACjE,uFAAwF;AAExF,qBAAqB;AAER,QAAA,EAAE,GAAG,oDAAoD,CAAC;AAC1D,QAAA,IAAI,GAAG,qCAAqC,CAAC;AAC7C,QAAA,WAAW,GACtB,4FAA4F,CAAC;AAClF,QAAA,QAAQ,GAAG,gBAAgB,CAAC;AAC5B,QAAA,QAAQ,GAAG,IAAI,CAAC;AAChB,QAAA,IAAI,GAAG,CAAC,gBAAgB,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAYhG,MAAM,OAAO,GAAuB,EAAE,CAAC;AACvC,MAAM,wBAAwB,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,iCAAiC,CAAC,CAAC;AAE5F,SAAS,SAAS,CAAC,MAAwB;IACzC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACrB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,qBAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,qBAAK,CAAC,OAAO,CAAC,CAAC,CAAC,qBAAK,CAAC,KAAK,CAAC,CAAC;IAC3G,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,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Listing APIs validate imageUrls are proper R2 URLs (not base64)
7
+ * 2. R2 storage utilities include base64 detection helpers
8
+ * 3. Frontend upload flows prefer cloud uploads over base64 fallbacks
9
+ * 4. No listings in database contain base64 imageUrls (data integrity)
10
+ *
11
+ * This prevents the issue where base64 image data gets stored in listings,
12
+ * causing image approval to fail since moveApprovedListingImages expects R2 URLs.
13
+ */
14
+ export declare const id = "data/image-url-validation";
15
+ export declare const name = "Image URL Validation";
16
+ export declare const description = "Validates that imageUrls in listings are proper R2 URLs, not base64 data. Prevents image approval failures.";
17
+ export declare const category = "data";
18
+ export declare const blocking = true;
19
+ export declare const tags: string[];
20
+ declare function main(): Promise<void>;
21
+ export { main as run };
22
+ //# sourceMappingURL=image-url-validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-url-validation.d.ts","sourceRoot":"","sources":["../../../src/checks/data-integrity/image-url-validation.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;GAWG;AASH,eAAO,MAAM,EAAE,8BAA8B,CAAC;AAC9C,eAAO,MAAM,IAAI,yBAAyB,CAAC;AAC3C,eAAO,MAAM,WAAW,gHACuF,CAAC;AAChH,eAAO,MAAM,QAAQ,SAAS,CAAC;AAC/B,eAAO,MAAM,QAAQ,OAAO,CAAC;AAC7B,eAAO,MAAM,IAAI,UAAyE,CAAC;AA0D3F,iBAAe,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CA0NnC;AAUD,OAAO,EAAE,IAAI,IAAI,GAAG,EAAE,CAAC"}