cdp-edge 2.2.2 → 2.2.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
@@ -103,8 +103,8 @@ Meu ecossistema opera como um Cérebro de Conversão Privado na borda. Quando um
103
103
 
104
104
  ### 🔧 Fix: `wrangler.toml` atualizado
105
105
  - Todos os placeholders (`SEU_D1_DATABASE_ID`, `SEU_KV_NAMESPACE_ID`) substituídos pelos IDs reais da conta Cloudflare
106
- - D1: `7867d38f-5fa8-4c17-b465-386211422c09`
107
- - KV: `821b6c1ccb4b475985439b801c1fdbe0`
106
+ - D1: `SEU_DATABASE_ID`
107
+ - KV: `SEU_KV_ID`
108
108
 
109
109
  ---
110
110
 
@@ -13,7 +13,7 @@ export async function runServer(dir) {
13
13
  const spinner = ora('Gerando infraestrutura...').start();
14
14
 
15
15
  try {
16
- // Gerar worker.js
16
+ // Gerar index.js
17
17
  await generateWorker(dir);
18
18
 
19
19
  // Gerar schema.sql
@@ -25,7 +25,7 @@ export async function runServer(dir) {
25
25
  spinner.succeed(chalk.green('Infraestrutura gerada!'));
26
26
 
27
27
  console.log('\n' + chalk.yellow('Arquivos gerados:'));
28
- console.log(` ${chalk.gray('├─')} worker.js`);
28
+ console.log(` ${chalk.gray('├─')} index.js`);
29
29
  console.log(` ${chalk.gray('├─')} schema.sql`);
30
30
  console.log(` ${chalk.gray('└─')} wrangler.toml`);
31
31
 
@@ -44,7 +44,7 @@ export async function runServer(dir) {
44
44
  }
45
45
 
46
46
  async function generateWorker(dir) {
47
- const workerPath = join(dir, 'worker.js');
47
+ const workerPath = join(dir, 'index.js');
48
48
  await fs.writeFile(workerPath, generateWorkerCode());
49
49
  }
50
50
 
@@ -163,7 +163,7 @@ function generateWranglerCode() {
163
163
  # Auto-generated by cdp-edge npx
164
164
 
165
165
  name = "cdp-edge-worker"
166
- main = "worker.js"
166
+ main = "index.js"
167
167
  compatibility_date = "2024-01-01"
168
168
 
169
169
  [[d1_databases]]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cdp-edge",
3
- "version": "2.2.2",
3
+ "version": "2.2.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",
@@ -23,11 +23,12 @@
23
23
  "build": "node build.js",
24
24
  "dev": "node build.js --watch",
25
25
  "test": "node test.js",
26
- "test:unit": "node tests/unit/normalization.test.js && node tests/unit/hashing.test.js && node tests/unit/deduplication.test.js && node tests/unit/payload-validation.test.js && node tests/unit/new-features.test.js",
26
+ "test:unit": "node tests/unit/normalization.test.js && node tests/unit/hashing.test.js && node tests/unit/deduplication.test.js && node tests/unit/payload-validation.test.js && node tests/unit/new-features.test.js && node tests/unit/utils.test.js",
27
27
  "test:unit:normalize": "node tests/unit/normalization.test.js",
28
28
  "test:unit:hash": "node tests/unit/hashing.test.js",
29
29
  "test:unit:dedup": "node tests/unit/deduplication.test.js",
30
30
  "test:unit:payload": "node tests/unit/payload-validation.test.js",
31
+ "test:unit:utils": "node tests/unit/utils.test.js",
31
32
  "test:all": "npm run test:unit",
32
33
  "test:integration": "cd tests/integration && npx vitest run",
33
34
  "agents:check": "node scripts/validate-agents.js",
@@ -298,7 +298,7 @@ wrangler d1 execute cdp-edge-db --remote --command="SELECT event_name, email, ci
298
298
  ```
299
299
  ERROR: Can't deploy routes that are assigned to another worker.
300
300
  "server-edge-tracker" is already assigned to routes:
301
- - lancamentosabc.com.br/track*
301
+ - SEU_DOMINIO/track*
302
302
  ```
303
303
 
304
304
  ### SOLUÇÃO 1 — Via Painel Cloudflare (RECOMENDADO):
@@ -306,7 +306,7 @@ ERROR: Can't deploy routes that are assigned to another worker.
306
306
  1. Acesse: https://dash.cloudflare.com/[ID_DA_CONTA]/workers/overview
307
307
  2. Clique no worker que está usando as rotas do seu domínio
308
308
  3. Vá em Settings → Triggers → Routes
309
- 4. Clique "Delete" nas rotas do domínio `lancamentosabc.com.br`
309
+ 4. Clique "Delete" nas rotas do domínio `SEU_DOMINIO`
310
310
  5. Repita o `wrangler deploy`
311
311
 
312
312
  ### SOLUÇÃO 2 — Via Wrangler CLI:
@@ -325,11 +325,11 @@ Se não quiser remover rotas existentes, use sufixo:
325
325
 
326
326
  ```toml
327
327
  [[routes]]
328
- pattern = "lancamentosabc.com.br/track-worker-novo*"
329
- zone_name = "lancamentosabc.com.br"
328
+ pattern = "SEU_DOMINIO/track-worker-novo*"
329
+ zone_name = "SEU_DOMINIO"
330
330
  ```
331
331
 
332
- **URL do tracking:** `https://lancamentosabc.com.br/track-worker-novo`
332
+ **URL do tracking:** `https://SEU_DOMINIO/track-worker-novo`
333
333
 
334
334
  ---
335
335
 
@@ -17,19 +17,19 @@ workers_dev = true
17
17
  # zone_name = "SEU_DOMINIO"
18
18
 
19
19
  [[routes]]
20
- pattern = "lancamentosabc.com.br/track*"
21
- zone_name = "lancamentosabc.com.br"
20
+ pattern = "SEU_DOMINIO/track*"
21
+ zone_name = "SEU_DOMINIO"
22
22
 
23
23
  [[routes]]
24
- pattern = "*.lancamentosabc.com.br/track*"
25
- zone_name = "lancamentosabc.com.br"
24
+ pattern = "*.SEU_DOMINIO/track*"
25
+ zone_name = "SEU_DOMINIO"
26
26
 
27
27
  # ── Variáveis públicas (não são segredos) ─────────────────────────────────────
28
28
  [vars]
29
- META_PIXEL_ID = "1583939052660159"
30
- GA4_MEASUREMENT_ID = "G-G7VEN1MNH1"
31
- TIKTOK_PIXEL_ID = "D71D6T3C77U56RM5VF0G"
32
- SITE_DOMAIN = "lancamentosabc.com.br"
29
+ META_PIXEL_ID = ""
30
+ GA4_MEASUREMENT_ID = ""
31
+ TIKTOK_PIXEL_ID = ""
32
+ SITE_DOMAIN = "SEU_DOMINIO"
33
33
 
34
34
  # ── Banco D1 ──────────────────────────────────────────────────────────────────
35
35
  # Após criar o banco com "wrangler d1 create cdp-edge-db",
@@ -37,7 +37,7 @@ SITE_DOMAIN = "lancamentosabc.com.br"
37
37
  [[d1_databases]]
38
38
  binding = "DB"
39
39
  database_name = "cdp-edge-db"
40
- database_id = "7867d38f-5fa8-4c17-b465-386211422c09"
40
+ database_id = "SEU_DATABASE_ID"
41
41
 
42
42
  # ── Queues — Retry + Dead Letter Queue ───────────────────────────────────────
43
43
  # Produtor: worker envia eventos com falha para cdp-edge-retry