Update to vcon-core-01 compliance#5
Conversation
- Update types.ts with full vcon-core-01 interfaces (DialogType, DialogDisposition, Encoding, etc.) - Update Dialog class with DIALOG_TYPES, DISPOSITIONS, VALID_ENCODINGS constants - Update Attachment class with new params-based constructor and validation - Update Party class with sip, did, timezone fields and validation methods - Update Vcon class with extension support, groups, and enhanced API - Add comprehensive tests for all new features (61 tests passing) - Add 3 tutorial examples: text-chat, call-recording, video-conference - Update README.md with complete API reference and tutorials - Add CLAUDE.md for AI assistant instructions Breaking changes: - Encoding type now only allows 'base64url', 'json', 'none' (not 'base64') - Attachment constructor now takes params object instead of positional args - Dialog type values are now 'recording', 'text', 'transfer', 'incomplete' 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
| */ | ||
| getPrimaryIdentifier(): string | undefined { | ||
| return this.tel || this.sip || this.mailto || this.did || this.uuid; | ||
| } |
There was a problem hiding this comment.
Bug: Missing stir in getPrimaryIdentifier method
The getPrimaryIdentifier() method returns this.tel || this.sip || this.mailto || this.did || this.uuid but omits this.stir, while hasIdentifier() includes stir in its check. This inconsistency means a party with only a stir identifier will return true for hasIdentifier() but undefined for getPrimaryIdentifier().
| this.data.critical.push(name); | ||
| this.addExtension(name); | ||
| } | ||
| } |
There was a problem hiding this comment.
Bug: Critical extension addition skips updating timestamp
The addCriticalExtension method pushes to the critical array and then calls addExtension(name). However, if the extension already exists in the extensions array, addExtension returns early without updating updated_at. This means when promoting an existing extension to critical status, the critical array is modified but the updated_at timestamp is not updated, breaking modification tracking.
- Remove duplicate Encoding type definition (kept vcon-core-01 compliant version) - Restore Redacted interface for redaction references - Restore Amended interface for amendment references - VCON_VERSION constant already restored in previous commit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Summary
Changes
Core Library
Documentation
Breaking Changes
Test plan
npm test)npm run build)npm run examples)🤖 Generated with Claude Code
Note
Implements full vcon-core-01 compliance across types and classes with validation and extension support, updates APIs (incl. attachments), adds 3 examples, expands tests, docs, and bumps version to 0.2.0.
src/types.tsto vcon-core-01 (DialogType,DialogDisposition,SessionId, refinedEncoding,Group, redaction/amendment, etc.).src/index.ts(incl.VCON_VERSION).Dialog: addsDIALOG_TYPES,DISPOSITIONS,VALID_ENCODINGS, new fields (mediatype,content_hash,session_id, etc.),addExternalData/addInlineData, type-check helpers, andvalidate().Attachment: switch to params-based constructor; supportpurpose,dialogrefs, external/inline data helpers,VALID_ENCODINGS, andvalidate().Party: adds identifiers (sip,did),timezone, helpershasIdentifier(),getPrimaryIdentifier(),validate();PartyHistoryacceptsDate|stringand addsfromDict().Vcon: RFC3339 timestamps,vcondefaults toVCON_VERSION, extension APIs (addExtension,addCriticalExtension,hasExtension,isCriticalExtension),addGroup, enhancedaddAnalysis/addAttachment, updated getters/setters.Encoding: onlybase64url,json,none(dropsbase64).Attachmentconstructor now accepts a params object.recording|text|transfer|incompleteandmediatypereplacesmimetypeusage.CLAUDE.md.examples/01-text-chat.ts,02-call-recording.ts,03-video-conference.ts; new npm scripts to run them.0.2.0.Written by Cursor Bugbot for commit d6d344b. Configure here.