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
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ npm install xarf
```typescript
import { parse } from 'xarf';

// Missing first_seen and source_port produce validation errors.
const { report, errors, warnings } = parse({
xarf_version: '4.2.0',
report_id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
timestamp: '2024-01-15T10:30:00Z',
// first_seen: '2024-01-15T10:00:00Z',
reporter: {
org: 'Security Team',
contact: 'abuse@example.com',
Expand All @@ -44,6 +46,7 @@ const { report, errors, warnings } = parse({
domain: 'example.com',
},
source_identifier: '192.0.2.100',
// source_port: 1234,
category: 'connection',
type: 'ddos',
evidence_source: 'honeypot',
Expand Down Expand Up @@ -179,10 +182,6 @@ schemaRegistry.getTypesForCategory('connection');
// Check if a category/type combination is valid
schemaRegistry.isValidType('connection', 'ddos'); // true

// Get valid evidence sources
schemaRegistry.getEvidenceSources();
// Set { 'honeypot', 'spamtrap', 'user_report', ... }

// Get field metadata including descriptions
schemaRegistry.getFieldMetadata('confidence');
// { description: '...', required: false, recommended: true, ... }
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "xarf",
"name": "@xarf/xarf",
"version": "1.0.0",
"description": "XARF v4 (eXtended Abuse Reporting Format) parser and generator for JavaScript/TypeScript - supports XARF spec v4.2.0 with backward compatibility for v3",
"xarfSpec": {
Expand Down
Loading