cdp-edge 2.5.2 → 2.5.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/README.md CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  **Padrão Quantum Tracking: 100% Cloudflare Edge.** Sem GTM. Sem Stape. Sem cookies de terceiros.
4
4
 
5
- > **v2.5.2** — Auditoria Completa + Sync Total de Agentes + Fix D1 (15 de Abril de 2026) 🔧
6
- > **v2.5.1** — SDK Bundle + Diagnóstico Pós-Deploy + Gap Fixes (15 de Abril de 2026) 🛠️
5
+ > **v2.5.3** — Auditoria Completa + Sync Total de Agentes + Fix D1 (25 de Abril de 2026) 🔧
6
+ > **v2.5.1** — SDK Bundle + Diagnóstico Pós-Deploy + Gap Fixes (25 de Abril de 2026) 🛠️
7
7
  > **v2.3.9** — Quiz Scoring Engine + Sales Engine (14 de Abril de 2026) 🤖💰
8
8
 
9
9
  ---
10
10
 
11
- ## 📋 CHANGELOG v2.5.2 — Auditoria Completa + Sync Total de Agentes + Fix D1 (15 de Abril de 2026) 🔧
11
+ ## 📋 CHANGELOG v2.5.3 — Auditoria Completa + Sync Total de Agentes + Fix D1 (25 de Abril de 2026) 🔧
12
12
 
13
13
  ### Bug Fix Crítico
14
14
  - `schema-ltv-feedback.sql` adicionado à ordem de migração — `recordLtvFeedback()` falhava silenciosamente em todo Purchase, quebrando o ciclo preditivo LTV
@@ -17,7 +17,7 @@
17
17
  - `schema-utm.sql`: `ADD COLUMN IF NOT EXISTS` → `ADD COLUMN` — D1/SQLite não suporta IF NOT EXISTS em ALTER TABLE
18
18
 
19
19
  ### Sincronização Total de Agentes
20
- - `contracts/agent-versions.json`: worker_version `2.2.3 → 2.5.2`, 49 agentes registrados (eram 26), `depends_on` `.js → .ts`, event count `19 → 25`, table count `24 → 31`
20
+ - `contracts/agent-versions.json`: worker_version `2.2.3 → 2.5.3`, 49 agentes registrados (eram 26), `depends_on` `.js → .ts`, event count `19 → 25`, table count `24 → 31`
21
21
  - `database-agent.md`: `main = "worker.js" → "index.ts"`, 24 → 31 tabelas, roadmap atualizado
22
22
  - `devops-agent.md`: `RESEND_API_KEY`, `RESEND_FROM_EMAIL`, `WEBHOOK_SECRET_TICTO` adicionados ao `*secrets`
23
23
 
@@ -27,7 +27,7 @@
27
27
 
28
28
  ---
29
29
 
30
- ## 📋 CHANGELOG v2.5.1 — SDK Bundle + Diagnóstico Pós-Deploy + Gap Fixes (15 de Abril de 2026) 🛠️
30
+ ## 📋 CHANGELOG v2.5.1 — SDK Bundle + Diagnóstico Pós-Deploy + Gap Fixes (25 de Abril de 2026) 🛠️
31
31
 
32
32
  ### SDK Bundle — cdpTrack.min.js pronto para `<script src="">`
33
33
  - `npm run sdk:build` → `dist/sdk/cdpTrack.min.js` (41.6 kB, IIFE, `window.cdpTrack`)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "_comment": "Fonte de verdade para versões dos agent files. Atualizar quando modules/ ou index.ts mudarem. Use scripts/validate-agents.js para detectar drifts.",
3
- "worker_version": "2.5.2",
3
+ "worker_version": "2.5.3",
4
4
  "worker_hash_date": "2026-04-15",
5
5
  "agents": {
6
6
  "master-orchestrator": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cdp-edge",
3
- "version": "2.5.2",
3
+ "version": "2.5.3",
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",
@@ -59,31 +59,31 @@
59
59
  "license": "MIT",
60
60
  "repository": {
61
61
  "type": "git",
62
- "url": "https://github.com/ricardosoli777/CDP-Edge-Premium"
62
+ "url": "https://github.com/ricardosoli777/CDP-Edge-Premium.ts"
63
63
  },
64
64
  "bugs": {
65
- "url": "https://github.com/ricardosoli777/CDP-Edge-Premium/issues"
65
+ "url": "https://github.com/ricardosoli777/CDP-Edge-Premium.ts/issues"
66
66
  },
67
- "homepage": "https://github.com/ricardosoli777/CDP-Edge-Premium#readme",
67
+ "homepage": "https://github.com/ricardosoli777/CDP-Edge-Premium.ts#readme",
68
68
  "engines": {
69
69
  "node": ">=18.0.0"
70
70
  },
71
71
  "dependencies": {
72
72
  "chalk": "^5.3.0",
73
- "commander": "^12.0.0",
74
- "inquirer": "^9.2.0",
75
- "ora": "^8.0.0"
73
+ "commander": "^14.0.3",
74
+ "inquirer": "^13.4.2",
75
+ "ora": "^9.4.0"
76
76
  },
77
77
  "devDependencies": {
78
- "@cloudflare/workers-types": "^4.20260412.1",
78
+ "@cloudflare/workers-types": "^4.20260425.1",
79
79
  "@semantic-release/changelog": "^6.0.3",
80
80
  "@semantic-release/commit-analyzer": "^13.0.1",
81
81
  "@semantic-release/github": "^12.0.6",
82
82
  "@semantic-release/npm": "^13.1.5",
83
83
  "@semantic-release/release-notes-generator": "^14.1.0",
84
- "@types/node": "^20.19.39",
84
+ "@types/node": "^25.6.0",
85
85
  "esbuild": "^0.28.0",
86
86
  "semantic-release": "^25.0.3",
87
- "typescript": "^6.0.2"
87
+ "typescript": "^6.0.3"
88
88
  }
89
89
  }
@@ -0,0 +1,5 @@
1
+ DATABASE_ID=
2
+ SITE_DOMAIN=
3
+ META_PIXEL_ID=
4
+ GA4_MEASUREMENT_ID=
5
+ TIKTOK_PIXEL_ID=
@@ -99,9 +99,9 @@ export async function sendWhatsApp(env: Env, tipo: string, payload: TrackPayload
99
99
  }
100
100
 
101
101
  // Text fallback (dentro da janela de 24h)
102
- const nome = [payload.firstName, payload.lastName].filter(Boolean).join(' ') || 'sem nome';
103
- const valor = payload.value ? `R$ ${parseFloat(String(payload.value)).toFixed(2)}` : '—';
104
- const utm = payload.utmSource || 'direto';
102
+ const nome = [payload.firstName, payload.lastName].filter(Boolean).join(' ') || 'sem nome';
103
+ const valor = payload.value ? `R$ ${parseFloat(String(payload.value)).toFixed(2)}` : '—';
104
+ const utm = payload.utmSource || 'direto';
105
105
  const produto = payload.contentName || '';
106
106
 
107
107
  let texto = '';
@@ -127,7 +127,7 @@ export async function sendWhatsApp(env: Env, tipo: string, payload: TrackPayload
127
127
  async function _sendWARequest(env: Env, body: Record<string, any>): Promise<any> {
128
128
  try {
129
129
  const phoneNumberId = resolvePhoneNumberId(env);
130
- const accessToken = resolveAccessToken(env);
130
+ const accessToken = resolveAccessToken(env);
131
131
  const res = await fetch(`https://graph.facebook.com/v22.0/${phoneNumberId}/messages`, {
132
132
  method: 'POST',
133
133
  headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${accessToken}` },
@@ -169,14 +169,14 @@ export async function processWhatsAppWebhook(env: Env, body: any, request: Reque
169
169
  const results: any[] = [];
170
170
 
171
171
  for (const message of messages) {
172
- const phone = message.from;
173
- const wamid = message.id;
174
- const referral = message.referral || {};
175
- const ctwaClid = referral.ctwa_clid || null;
176
- const adId = referral.source_id || null;
177
- const sourceUrl = referral.source_url || null;
178
- const headline = referral.headline || null;
179
- const messageBody = message.text?.body || message.type || '';
172
+ const phone = message.from;
173
+ const wamid = message.id;
174
+ const referral = message.referral || {};
175
+ const ctwaClid = referral.ctwa_clid || null;
176
+ const adId = referral.source_id || null;
177
+ const sourceUrl = referral.source_url || null;
178
+ const headline = referral.headline || null;
179
+ const messageBody = message.text?.body || message.type || '';
180
180
 
181
181
  if (!phone) { results.push({ skipped: 'no phone' }); continue; }
182
182
 
@@ -202,9 +202,9 @@ export async function processWhatsAppWebhook(env: Env, body: any, request: Reque
202
202
  }
203
203
 
204
204
  const capiEvent: Record<string, any> = {
205
- event_name: 'Contact',
206
- event_time: Math.floor(Date.now() / 1000),
207
- event_id: eventId,
205
+ event_name: 'Contact',
206
+ event_time: Math.floor(Date.now() / 1000),
207
+ event_id: eventId,
208
208
  action_source: 'chat',
209
209
  user_data: {
210
210
  ph: phoneHash,