@mahe_pkm/buzl-capi 0.1.2 โ†’ 0.1.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/CHANGELOG.md CHANGED
@@ -1,83 +1,109 @@
1
- # Changelog
2
-
3
- All notable changes to the **Buzl Tracker & Conversions API (CAPI)** project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ---
9
-
10
- ## [0.1.2] - 2026-09-14
11
-
12
- ### Changed & Improved
13
- - **100% Dynamic Test Lead Generation**:
14
- - Removed all hardcoded mock client data (`9585950059`, `Sports Injury Rehabilitation`, `samya-sports-clinic`, `Bengaluru`, `Test Patient`).
15
- - `tester.js`: `domain` dynamically resolves from `config.domain`, URL hostname, or folder name (`path.basename(rootDir)`).
16
- - `tester.js`: `phone`, `service`, `location`, and `email` dynamically pull from detected website metadata and actual form fields with clean neutral fallbacks.
17
- - `scanner.js`: Removed hardcoded `Bengaluru` fallback, dynamically extracts `detectedDomain` and `detectedService`.
18
- - `app.js` & `index.html`: Web GUI test cards dynamically pre-fill phone, service, and location from live site scan results instead of static mock strings.
19
- - `bin/cli.js`: CLI version output dynamically loads from `package.json`.
20
- - **Enhanced Test Suite Resilience**:
21
- - `multipage.test.js`: Added transient in-process HTTP mock server to guarantee 100% offline self-contained test execution.
22
- - Added Test 13 in `injector.test.js` verifying dynamic test lead dispatch parameters.
23
-
24
- ---
25
-
26
- ## [1.0.0] - 2026-09-14
27
-
28
- ### Initial Release
29
-
30
- #### ๐Ÿš€ Core Features & CLI Architecture
31
- - **Interactive Terminal Wizard**: Guided CLI setup via `npx buzl-tracker` with input validation, intelligent defaults, and instant test verification.
32
- - **Zero-Dependency Web GUI**: Embedded local dashboard on `http://localhost:3333` (`npx buzl-tracker --gui`) for visual configuration, live site state inspection, and per-form test dispatches.
33
- - **Universal Multi-Page Scanner**:
34
- - Automatically crawls directories at any depth.
35
- - Automatically resolves relative asset paths (e.g. `assets/js/buzl-tracking.js`, `../assets/js/...`, `../../assets/js/...`) to ensure tracking scripts execute on every page.
36
- - Groups forms into shared archetypes across multi-page sites.
37
- - **Universal WhatsApp Auto-Fetch**:
38
- - Discovers site WhatsApp numbers from call-to-action buttons, `wa.me`, and `api.whatsapp.com` links.
39
- - Generates pre-filled dynamic chat routing so submissions hand off to WhatsApp with lead details intact.
40
- - **AST-Safe Injection Engine**:
41
- - Injects Google Tag Manager (GTM) `<head>` container and `<body> <noscript>` fallback with deferred loading options.
42
- - Initializes Meta Pixel & Meta Conversions API (CAPI) client runtime with cross-event `leadId` deduplication.
43
- - Hooks form submissions via non-destructive JavaScript event interceptors with zero HTML layout breakage.
44
- - Supports selective service uninstallation (`removeService`) and complete uninstallation (`--uninstall`).
45
- - **Unified `.buzl/snapshots/` Rollback & Backup System**:
46
- - Unifies backup storage under `.buzl/snapshots/<timestamp>_<hash>` to prevent root-level clutter and align with `@mahe_pkm/buzl-html-editor`.
47
- - Computes 8-character cryptographic SHA-1 content hashes for tamper-proof verification.
48
- - Automatically creates snapshots before modifying any file, with instant rollback (`--restore [name]`).
49
- - Supports named snapshots (`--backup [name]`), inspection (`--list-backups`), and backward compatibility with legacy backups.
50
-
51
- #### ๐Ÿ“Š Resilient Google Sheets CRM Engine (`GoogleAppsScript.gs`)
52
- - **Forward Operational Layout**:
53
- - Repositions `Handled By` (Column F) and `Comments` (Column G) directly next to `Lead Stage` (Column E) for rapid operational lead qualification.
54
- - **Official Buzl Navy Blue Header Row**:
55
- - Styled with official Buzl Navy (`#1E4E9E`), bold white text (`#FFFFFF`), and 32px height (> 8.5:1 WCAG AAA contrast ratio).
56
- - **Universal Fuzzy Column Matcher**:
57
- - Case-insensitive, symbol-tolerant header detection (`replace(/[^a-z0-9]/g, '')`) ensures zero data loss during schema upgrades across legacy sheets.
58
- - **Full-Row Conditional Formatting**:
59
- - Anchors stage status rules across columns `A2:Z` (`=$E2="Stage"`) so entire rows illuminate according to stage color.
60
- - **Global 12-Hour Timestamps & Dates**:
61
- - Dynamically detects spreadsheet timezone and formats event timestamps as `dd-MMM-yyyy hh:mm a` and qualification dates as `dd-MMM-yyyy`.
62
- - **Top Row Insertion (Row 2)**:
63
- - New leads automatically insert at Row 2 (top of sheet) immediately below the header.
64
- - **Shift-Proof Sub-Tab Formulas**:
65
- - Sub-tabs use `INDIRECT()` filter formulas to query master data without formula displacement when rows insert at top.
66
- - **Dynamic Team Member Tabs**:
67
- - Team member tabs named cleanly (strips legacy `"Rep -"` prefix).
68
- - Strictly moves all team member tabs to the very end of the sheet bar (`moveActiveSheet(ss.getNumSheets())`).
69
- - Auto-prunes and deletes empty team tabs when a rep has 0 leads.
70
- - **Full-Column Dropdown Validations**:
71
- - Applies dropdown validations across entire column ranges (Rows 2 to 1000) for `Lead Stage`, `Is Qualified`, and `Is Spam` across Master and all Sub-Tabs.
72
- - Dynamic `Handled By` dropdown list in Master Sheet combining `DEFAULT_TEAM_MEMBERS` with existing assigned team members.
73
- - **Professional Column Widths**:
74
- - Auto-configures optimal readable column widths for Name, Phone, Email, Service, Comments, and Event Time.
75
- - **โšก Buzl Lead CRM Menu**:
76
- - 1-click sheet management: Initialize/Upgrade CRM tabs, Sort newest-first, Color-code, Sync team tabs, and Apply dropdowns.
77
-
78
- #### ๐Ÿงช Testing & Reliability
79
- - 100% test coverage with 37 automated unit and integration tests across:
80
- - Core injection & rollback (`tests/injector.test.js`)
81
- - Multi-page relative asset handling (`tests/multipage.test.js`)
82
- - WhatsApp dynamic discovery (`tests/whatsapp-autofetch.test.js`)
83
- - Google Apps Script template integrity (`tests/gas-template.test.js`)
1
+ # Changelog
2
+
3
+ All notable changes to the **Buzl Tracker & Conversions API (CAPI)** project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ---
9
+
10
+ ## [0.1.3] - 2026-09-14
11
+
12
+ ### Added & Redesigned
13
+ - **Locations Design System Web GUI**:
14
+ - Implemented token-driven UI matching `web.gobuzl.com` with `--font-family-primary`, structured spacing, and accessible semantic colors.
15
+ - Full WCAG 2.2 AA compliance: high-contrast interactive borders (3:1 minimum), clear 2px focus rings (`--color-brand-primary`), and minimum 24x24px click targets.
16
+ - **Pixel-Perfect Official Brand Vectors**:
17
+ - **Buzl Emblem (`#icon-brand-buzl`)**: Extracted directly from production asset `buzl-logo.svg`, rendering the authentic 3-person lead circular mark in crisp white on primary action buttons and brand navy elsewhere.
18
+ - **Meta Logo (`#icon-brand-meta`)**: Replaced clipped SVG with official unclipped infinity ribbon (`viewBox="0 0 16 16"`).
19
+ - **Google Tag Manager Logo (`#icon-brand-gtm`)**: Replaced distorted shapes with official geometric vectors (`viewBox="0 0 256 256"`).
20
+ - **WhatsApp Logo (`#icon-brand-whatsapp`)**: Replaced generic dialer badge with official speech bubble mark (`#25D366`) and white telephone handset (`#FFFFFF`).
21
+ - **Structured CAPI Staging Console Log**:
22
+ - Implemented `formatCapiExecutionLog` in `tester.js` and `app.js` matching user staging reference layout:
23
+ - Standardized audit borders, status tags, domain labels, and UUID lead identifiers.
24
+ - Semantic syntax highlighting for keys, values, URLs, JSON payloads, and HTTP 201 Created pills.
25
+ - **Automated Verification Reporting (PDF & JSON)**:
26
+ - Added one-click structured JSON export (`#btnExportJson`).
27
+ - Added native A4 printable PDF export (`#btnExportPdf`) via isolated iframe with corporate letterhead and embedded audit logs.
28
+ - **Blocked & Copyable Multi-OS User Handbook**:
29
+ - Created `USER_HANDBOOK.md` in repository root with copy-ready command blocks for Windows (PowerShell & CMD), macOS (zsh), and Linux (bash).
30
+ - Created standalone printable `USER_HANDBOOK.html` with 1-click **"Print / Save as PDF"** export (100% vector copyable text).
31
+ - Added `--handbook` flag to `bin/cli.js` to open the handbook in the default browser.
32
+ - Added Handbook modal inside the Web GUI with live copy buttons.
33
+
34
+ ---
35
+
36
+ ## [0.1.2] - 2026-09-14
37
+
38
+ ### Changed & Improved
39
+ - **100% Dynamic Test Lead Generation**:
40
+ - Removed all hardcoded mock client data (`9585950059`, `Sports Injury Rehabilitation`, `samya-sports-clinic`, `Bengaluru`, `Test Patient`).
41
+ - `tester.js`: `domain` dynamically resolves from `config.domain`, URL hostname, or folder name (`path.basename(rootDir)`).
42
+ - `tester.js`: `phone`, `service`, `location`, and `email` dynamically pull from detected website metadata and actual form fields with clean neutral fallbacks.
43
+ - `scanner.js`: Removed hardcoded `Bengaluru` fallback, dynamically extracts `detectedDomain` and `detectedService`.
44
+ - `app.js` & `index.html`: Web GUI test cards dynamically pre-fill phone, service, and location from live site scan results instead of static mock strings.
45
+ - `bin/cli.js`: CLI version output dynamically loads from `package.json`.
46
+ - **Enhanced Test Suite Resilience**:
47
+ - `multipage.test.js`: Added transient in-process HTTP mock server to guarantee 100% offline self-contained test execution.
48
+ - Added Test 13 in `injector.test.js` verifying dynamic test lead dispatch parameters.
49
+
50
+ ---
51
+
52
+ ## [1.0.0] - 2026-09-14
53
+
54
+ ### Initial Release
55
+
56
+ #### ๐Ÿš€ Core Features & CLI Architecture
57
+ - **Interactive Terminal Wizard**: Guided CLI setup via `npx buzl-tracker` with input validation, intelligent defaults, and instant test verification.
58
+ - **Zero-Dependency Web GUI**: Embedded local dashboard on `http://localhost:3333` (`npx buzl-tracker --gui`) for visual configuration, live site state inspection, and per-form test dispatches.
59
+ - **Universal Multi-Page Scanner**:
60
+ - Automatically crawls directories at any depth.
61
+ - Automatically resolves relative asset paths (e.g. `assets/js/buzl-tracking.js`, `../assets/js/...`, `../../assets/js/...`) to ensure tracking scripts execute on every page.
62
+ - Groups forms into shared archetypes across multi-page sites.
63
+ - **Universal WhatsApp Auto-Fetch**:
64
+ - Discovers site WhatsApp numbers from call-to-action buttons, `wa.me`, and `api.whatsapp.com` links.
65
+ - Generates pre-filled dynamic chat routing so submissions hand off to WhatsApp with lead details intact.
66
+ - **AST-Safe Injection Engine**:
67
+ - Injects Google Tag Manager (GTM) `<head>` container and `<body> <noscript>` fallback with deferred loading options.
68
+ - Initializes Meta Pixel & Meta Conversions API (CAPI) client runtime with cross-event `leadId` deduplication.
69
+ - Hooks form submissions via non-destructive JavaScript event interceptors with zero HTML layout breakage.
70
+ - Supports selective service uninstallation (`removeService`) and complete uninstallation (`--uninstall`).
71
+ - **Unified `.buzl/snapshots/` Rollback & Backup System**:
72
+ - Unifies backup storage under `.buzl/snapshots/<timestamp>_<hash>` to prevent root-level clutter and align with `@mahe_pkm/buzl-html-editor`.
73
+ - Computes 8-character cryptographic SHA-1 content hashes for tamper-proof verification.
74
+ - Automatically creates snapshots before modifying any file, with instant rollback (`--restore [name]`).
75
+ - Supports named snapshots (`--backup [name]`), inspection (`--list-backups`), and backward compatibility with legacy backups.
76
+
77
+ #### ๐Ÿ“Š Resilient Google Sheets CRM Engine (`GoogleAppsScript.gs`)
78
+ - **Forward Operational Layout**:
79
+ - Repositions `Handled By` (Column F) and `Comments` (Column G) directly next to `Lead Stage` (Column E) for rapid operational lead qualification.
80
+ - **Official Buzl Navy Blue Header Row**:
81
+ - Styled with official Buzl Navy (`#1E4E9E`), bold white text (`#FFFFFF`), and 32px height (> 8.5:1 WCAG AAA contrast ratio).
82
+ - **Universal Fuzzy Column Matcher**:
83
+ - Case-insensitive, symbol-tolerant header detection (`replace(/[^a-z0-9]/g, '')`) ensures zero data loss during schema upgrades across legacy sheets.
84
+ - **Full-Row Conditional Formatting**:
85
+ - Anchors stage status rules across columns `A2:Z` (`=$E2="Stage"`) so entire rows illuminate according to stage color.
86
+ - **Global 12-Hour Timestamps & Dates**:
87
+ - Dynamically detects spreadsheet timezone and formats event timestamps as `dd-MMM-yyyy hh:mm a` and qualification dates as `dd-MMM-yyyy`.
88
+ - **Top Row Insertion (Row 2)**:
89
+ - New leads automatically insert at Row 2 (top of sheet) immediately below the header.
90
+ - **Shift-Proof Sub-Tab Formulas**:
91
+ - Sub-tabs use `INDIRECT()` filter formulas to query master data without formula displacement when rows insert at top.
92
+ - **Dynamic Team Member Tabs**:
93
+ - Team member tabs named cleanly (strips legacy `"Rep -"` prefix).
94
+ - Strictly moves all team member tabs to the very end of the sheet bar (`moveActiveSheet(ss.getNumSheets())`).
95
+ - Auto-prunes and deletes empty team tabs when a rep has 0 leads.
96
+ - **Full-Column Dropdown Validations**:
97
+ - Applies dropdown validations across entire column ranges (Rows 2 to 1000) for `Lead Stage`, `Is Qualified`, and `Is Spam` across Master and all Sub-Tabs.
98
+ - Dynamic `Handled By` dropdown list in Master Sheet combining `DEFAULT_TEAM_MEMBERS` with existing assigned team members.
99
+ - **Professional Column Widths**:
100
+ - Auto-configures optimal readable column widths for Name, Phone, Email, Service, Comments, and Event Time.
101
+ - **โšก Buzl Lead CRM Menu**:
102
+ - 1-click sheet management: Initialize/Upgrade CRM tabs, Sort newest-first, Color-code, Sync team tabs, and Apply dropdowns.
103
+
104
+ #### ๐Ÿงช Testing & Reliability
105
+ - 100% test coverage with 37 automated unit and integration tests across:
106
+ - Core injection & rollback (`tests/injector.test.js`)
107
+ - Multi-page relative asset handling (`tests/multipage.test.js`)
108
+ - WhatsApp dynamic discovery (`tests/whatsapp-autofetch.test.js`)
109
+ - Google Apps Script template integrity (`tests/gas-template.test.js`)
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Buzl Digital Solutions
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Buzl Digital Solutions
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.