cdp-edge 1.25.0 → 1.25.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cdp-edge",
3
- "version": "1.25.0",
3
+ "version": "1.25.1",
4
4
  "description": "CDP Edge - Quantum Tracking - Sistema multi-agente para tracking digital Cloudflare Native (Workers + D1)",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -282,7 +282,9 @@ export default {
282
282
  }
283
283
 
284
284
  // ── Sanitização e Validação de Campos String ──────────────────────
285
- const SANITIZE_FIELDS = {
285
+ type SanitizeResult = { error?: string; sanitized: string | null };
286
+
287
+ const SANITIZE_FIELDS: Record<string, (val: string) => SanitizeResult> = {
286
288
  email: (val: string) => {
287
289
  if (!isValidEmail(val)) return { error: 'email inválido (formato incorreto)' };
288
290
  return { sanitized: val.toLowerCase().trim() };
@@ -342,8 +344,9 @@ export default {
342
344
  }
343
345
 
344
346
  // Sanitiza campos de string restantes
345
- const STR_FIELDS = ['transactionId', 'fbclid', 'ttclid', 'gclid'];
346
- for (const field of STR_FIELDS) {
347
+ const TRACKING_ID_FIELDS = ['transactionId', 'fbclid', 'ttclid', 'gclid'];
348
+
349
+ for (const field of TRACKING_ID_FIELDS) {
347
350
  const value = trackPayload[field as keyof TrackPayload];
348
351
  if (value !== undefined && value !== null) {
349
352
  if (typeof value !== 'string') {