Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CURRENT_STATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ integration examples, and contributor onboarding.
- ✅ CLI: ci + anonymize + diff commands (Issue #88)
- ✅ Integration examples — 4 example projects (Issue #89)
- ✅ Contribution guide + 5 good-first-issues (Issue #90)
- ✅ v0.3 docs content — 5 new + 3 updated docs pages (Issue #91)

## What's Next

Expand Down
67 changes: 67 additions & 0 deletions apps/web/src/app/docs/anonymize/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
export default function AnonymizePage() {
return (
<div>
<h1>Anonymize</h1>
<p>
The <code>ocpp-debugkit anonymize</code> command strips sensitive fields from a trace file,
making it safe to share for debugging or support purposes.
</p>

<h2>Usage</h2>
<pre>
<code>{`# Output to stdout
ocpp-debugkit anonymize trace.json

# Write to file
ocpp-debugkit anonymize trace.json -o trace-anon.json`}</code>
</pre>

<h2>What Gets Anonymized</h2>
<ul>
<li>
<code>idTag</code> — replaced with <code>&quot;anonymized&quot;</code>
</li>
<li>
<code>chargePointSerialNumber</code> / <code>chargeBoxSerialNumber</code> — replaced with{' '}
<code>&quot;station-anon&quot;</code>
</li>
<li>
<code>stationId</code> — replaced with <code>&quot;station-anon&quot;</code>
</li>
<li>
<code>transactionId</code> — replaced with sequential integers (1, 2, 3...)
</li>
<li>
<code>identifier</code> — replaced with <code>&quot;anonymized&quot;</code>
</li>
<li>
Email addresses — replaced with <code>[redacted-email]</code>
</li>
<li>
Phone numbers — replaced with <code>[redacted-phone]</code>
</li>
<li>
IP addresses — replaced with <code>[redacted-ip]</code>
</li>
</ul>

<h2>Privacy Considerations</h2>
<p>
Anonymization is performed locally — no data is uploaded. The anonymized trace is safe to
share in issue reports, support tickets, or public forums.
</p>
<p>
<strong>Note:</strong> Anonymization is a best-effort process. Always review the output
before sharing to ensure no sensitive data remains.
</p>

<h2>What Is NOT Anonymized</h2>
<ul>
<li>Timestamps — preserved for debugging timeline issues</li>
<li>OCPP action names — preserved for structural understanding</li>
<li>Meter values — preserved for analysis (they don&apos;t identify users)</li>
<li>Error codes and descriptions — preserved for debugging</li>
</ul>
</div>
);
}
79 changes: 79 additions & 0 deletions apps/web/src/app/docs/ci-mode/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
export default function CiModePage() {
return (
<div>
<h1>CI Mode</h1>
<p>
The <code>ocpp-debugkit ci</code> command runs all built-in scenarios (and optional external
scenario files) and exits with code 0 if all pass, 1 if any fail. This is designed for
integration into CI/CD pipelines.
</p>

<h2>Basic Usage</h2>
<pre>
<code>{`# Run all built-in scenarios
ocpp-debugkit ci

# Also run external scenarios from a directory
ocpp-debugkit ci ./scenarios

# JSON output for CI tooling
ocpp-debugkit ci --format json`}</code>
</pre>

<h2>GitHub Actions Integration</h2>
<p>Add the following step to your workflow:</p>
<pre>
<code>{`- name: Run OCPP scenario tests
run: ocpp-debugkit ci --format json`}</code>
</pre>
<p>
The command exits 0 (pass) or 1 (fail). The JSON output can be parsed for dashboards or
notifications.
</p>

<h2>External Scenario Files</h2>
<p>
Create JSON scenario files in a directory and pass the directory path to the <code>ci</code>{' '}
command:
</p>
<pre>
<code>{`ocpp-debugkit ci ./scenarios`}</code>
</pre>
<p>Scenario file format:</p>
<pre>
<code>{`{
"name": "my-scenario",
"description": "Custom scenario for CI testing",
"trace": { ... },
"expectedFailures": ["FAILED_AUTHORIZATION"],
"assertions": [
{ "type": "event_order", "params": { "actions": ["BootNotification", "Authorize"] } }
]
}`}</code>
</pre>

<h2>JSON Output Format</h2>
<pre>
<code>{`{
"results": [
{
"name": "normal-session",
"passed": true,
"detectedFailures": [],
"expectedFailures": [],
"assertionResults": []
},
...
],
"allPassed": true
}`}</code>
</pre>

<h2>Example Workflow</h2>
<p>
See the <code>examples/ci-example/</code> directory for a complete GitHub Actions workflow
with scenario files.
</p>
</div>
);
}
66 changes: 66 additions & 0 deletions apps/web/src/app/docs/cli/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,72 @@ export default function CliReferencePage() {
analysis engine only. It is not active endpoint testing, WebSocket simulation, or live
station/CSMS testing.
</p>
<h3>External Scenario Files</h3>
<p>Load and run an external scenario file (JSON format) instead of a built-in scenario:</p>
<pre>
<code>{`ocpp-debugkit scenario run --file ./my-scenario.json`}</code>
</pre>

<h2>ci</h2>
<p>
Run all built-in scenarios (and optional external scenario files from a directory), exit 0
if all pass, 1 if any fail. Designed for CI/CD pipelines.
</p>
<pre>
<code>{`ocpp-debugkit ci [dir] [options]`}</code>
</pre>
<h3>Options</h3>
<ul>
<li>
<code>--format &lt;format&gt;</code> — Output format: text (default) or json
</li>
</ul>
<p>Examples:</p>
<pre>
<code>{`# Run all built-in scenarios
ocpp-debugkit ci

# Also run external scenarios from a directory
ocpp-debugkit ci ./scenarios

# JSON output for CI tooling
ocpp-debugkit ci --format json`}</code>
</pre>

<h2>anonymize</h2>
<p>
Strip sensitive fields from a trace file. Anonymizes idTag, chargePointSerialNumber,
stationId, transactionId, and email/phone/IP patterns.
</p>
<pre>
<code>{`ocpp-debugkit anonymize <file> [options]`}</code>
</pre>
<h3>Options</h3>
<ul>
<li>
<code>-o, --output &lt;file&gt;</code> — Write anonymized trace to file (default: stdout)
</li>
</ul>
<p>Example:</p>
<pre>
<code>{`ocpp-debugkit anonymize trace.json -o trace-anon.json`}</code>
</pre>

<h2>diff</h2>
<p>Compare two trace files and show differences in events, failures, and summaries.</p>
<pre>
<code>{`ocpp-debugkit diff <a> <b> [options]`}</code>
</pre>
<h3>Options</h3>
<ul>
<li>
<code>--format &lt;format&gt;</code> — Output format: text (default) or json
</li>
</ul>
<p>Example:</p>
<pre>
<code>{`ocpp-debugkit diff trace-a.json trace-b.json`}</code>
</pre>

<h2>Global Options</h2>
<ul>
Expand Down
57 changes: 57 additions & 0 deletions apps/web/src/app/docs/examples/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import Link from 'next/link';

export default function ExamplesPage() {
return (
<div>
<h1>Examples</h1>
<p>
Integration examples showing how to use <code>@ocpp-debugkit/toolkit</code> in your
projects. Each example is a standalone project in the <code>examples/</code> directory of
the repository.
</p>

<h2>Available Examples</h2>
<ul>
<li>
<strong>simple-trace</strong> — Parse a trace, detect failures, generate a Markdown
report. Demonstrates the core analysis pipeline.
</li>
<li>
<strong>simple-csms</strong> — Validate incoming traces (CSMS mock), check for failures.
Demonstrates message validation.
</li>
<li>
<strong>simulator-output</strong> — Process JSONL simulator output, generate an HTML
report. Demonstrates JSONL parsing and HTML report generation.
</li>
<li>
<strong>ci-example</strong> — Use <code>ocpp-debugkit ci</code> in GitHub Actions
workflows. Demonstrates CI integration with scenario files.
</li>
</ul>

<h2>Running Examples</h2>
<p>Each example is standalone. Clone the repo and run:</p>
<pre>
<code>{`cd examples/simple-trace
npm install
npm start`}</code>
</pre>

<h2>Links</h2>
<ul>
<li>
<Link href="/docs/quickstart">Quick Start</Link> — Get started with the toolkit
</li>
<li>
<Link href="/docs/cli">CLI Reference</Link> — Full command reference
</li>
<li>
<a href="https://github.com/ocpp-debugkit/ocpp-debugkit/tree/main/examples">
Examples on GitHub
</a>
</li>
</ul>
</div>
);
}
15 changes: 15 additions & 0 deletions apps/web/src/app/docs/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@ export default function DocsPage() {
<li>
<Link href="/docs/scenarios">Scenarios</Link> — Predefined test scenarios
</li>
<li>
<Link href="/docs/trace-diffing">Trace Diffing</Link> — Compare two traces
</li>
<li>
<Link href="/docs/scenario-assertions">Scenario Assertions</Link> — Rich assertion format
</li>
<li>
<Link href="/docs/ci-mode">CI Mode</Link> — Run scenario tests in CI pipelines
</li>
<li>
<Link href="/docs/anonymize">Anonymize</Link> — Strip sensitive fields from traces
</li>
<li>
<Link href="/docs/examples">Examples</Link> — Integration examples
</li>
</ul>
</div>
);
Expand Down
Loading
Loading