{"id":18927761,"url":"https://github.com/observertc/schemas","last_synced_at":"2025-10-15T21:52:17.131Z","repository":{"id":38242800,"uuid":"373443440","full_name":"ObserveRTC/schemas","owner":"ObserveRTC","description":"Communication Schemas","archived":false,"fork":false,"pushed_at":"2025-04-03T07:46:48.000Z","size":1404,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T08:33:54.635Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@observertc/schemas","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ObserveRTC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-03T08:57:57.000Z","updated_at":"2022-07-15T12:54:30.000Z","dependencies_parsed_at":"2024-06-21T15:36:19.476Z","dependency_job_id":"72370994-2a3d-45a8-a637-708824d620fd","html_url":"https://github.com/ObserveRTC/schemas","commit_stats":{"total_commits":156,"total_committers":2,"mean_commits":78.0,"dds":"0.17948717948717952","last_synced_commit":"8ccf4ebea684b03ebc605ed946f8cfb529f71dcf"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ObserveRTC%2Fschemas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ObserveRTC%2Fschemas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ObserveRTC%2Fschemas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ObserveRTC%2Fschemas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ObserveRTC","download_url":"https://codeload.github.com/ObserveRTC/schemas/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248557101,"owners_count":21124156,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T11:20:24.140Z","updated_at":"2025-10-15T21:52:17.122Z","avatar_url":"https://github.com/ObserveRTC.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ObserveRTC Schemas\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nA comprehensive schema generator for WebRTC observability that creates type-safe language bindings and data structures for monitoring and analyzing WebRTC applications.\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Features](#features)\n- [Generated Projects](#generated-projects)\n- [Schema Structure](#schema-structure)\n- [Development](#development)\n- [Versioning](#versioning)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Overview\n\nObserveRTC Schemas provides a standardized way to describe WebRTC statistics, events, and metrics across different programming languages and data storage systems. The schema generator processes Avro schema definitions and creates type-safe bindings for TypeScript/JavaScript, SQL schemas for databases, and other format outputs.\n\n## Features\n\n- 📊 **Comprehensive WebRTC Stats Coverage** - Complete schema definitions for all WebRTC statistics\n- 🔧 **Multi-Language Support** - Generates TypeScript/JavaScript, SQL, CSV, and Protocol Buffer bindings\n- 🛡️ **Type Safety** - Provides full type safety across all generated languages\n- 📈 **Real-time Monitoring** - Optimized for real-time WebRTC observability and monitoring\n- 🔄 **Version Controlled** - Semantic versioning with clear upgrade paths\n- 🏗️ **Extensible Architecture** - Support for custom fields and extensions\n\n## Generated Projects\n\nThe schema generator produces several standalone npm packages and output formats:\n\n### NPM Packages\n\n| Package                                               | Description                                 | Repository               |\n| ----------------------------------------------------- | ------------------------------------------- | ------------------------ |\n| [`@observertc/schemas`](npm-samples-lib/)             | Core TypeScript/JavaScript type definitions | `./npm-samples-lib/`     |\n| [`@observertc/samples-encoder`](npm-samples-encoder/) | Binary encoding utilities for samples       | `./npm-samples-encoder/` |\n| [`@observertc/samples-decoder`](npm-samples-decoder/) | Binary decoding utilities for samples       | `./npm-samples-decoder/` |\n\n### Database Schemas\n\n| Format         | Description                       | Location                  |\n| -------------- | --------------------------------- | ------------------------- |\n| **BigQuery**   | Google BigQuery table schemas     | `outputs/sql/bigquery/`   |\n| **Redshift**   | Amazon Redshift table definitions | `outputs/sql/redshift/`   |\n| **PostgreSQL** | Standard SQL DDL statements       | `outputs/sql/postgresql/` |\n\n### Other Formats\n\n| Format               | Description                                     | Location         |\n| -------------------- | ----------------------------------------------- | ---------------- |\n| **Protocol Buffers** | `.proto` files for cross-language serialization | `outputs/proto/` |\n| **CSV**              | Column headers and format specifications        | `outputs/csv/`   |\n| **Avro**             | Compiled Avro schema definitions                | `outputs/avsc/`  |\n\n## Schema Structure\n\nThe schemas are organized into several main sample types:\n\n### Core Sample Types\n\n| Schema                 | Description                             |\n| ---------------------- | --------------------------------------- |\n| `ClientSample`         | End-user client statistics and metrics  |\n| `PeerConnectionSample` | WebRTC peer connection statistics       |\n| `SfuSample`            | Selective Forwarding Unit (SFU) metrics |\n| `TurnSample`           | TURN server statistics                  |\n\n### Nested Statistics\n\n- **RTP Statistics** - Inbound/outbound RTP stream metrics\n- **ICE Statistics** - ICE candidate and transport information\n- **Media Statistics** - Audio/video codec and quality metrics\n- **Transport Statistics** - Network transport layer information\n\n### Key Features\n\n- **Score Fields** - Quality scoring with detailed reasoning (`score` + `scoreReasons`)\n- **Extensible Attachments** - Custom metadata support via `attachments` fields\n- **Timestamp Precision** - High-resolution timing information\n- **Comprehensive Coverage** - All WebRTC standard statistics\n\n## Development\n\n### Prerequisites\n\n- Node.js 16+\n- npm or yarn\n\n### Setup\n\n```bash\ngit clone https://github.com/observertc/schemas.git\ncd schemas\nnpm install\n```\n\n### Code Generation\n\nGenerate all language bindings and output formats from the Avro schema definitions:\n\n```bash\nnode index.js\n```\n\nThis command will:\n\n1. Read and validate the Avro schema files from `sources/samples/`\n2. Generate TypeScript/JavaScript type definitions and npm packages\n3. Create SQL table schemas for BigQuery, Redshift, and PostgreSQL\n4. Generate Protocol Buffer definitions for cross-language serialization\n5. Create CSV format specifications and column headers\n6. Compile Avro schemas for runtime validation\n7. Output all generated files to their respective directories in `outputs/`\n\nThe generator processes the schema definitions and creates:\n\n- Type-safe TypeScript interfaces in `npm-samples-lib/`\n- Binary encoder/decoder utilities in `npm-samples-encoder/` and `npm-samples-decoder/`\n- Database-specific DDL statements in `outputs/sql/`\n- Protocol Buffer `.proto` files in `outputs/proto/`\n- CSV specifications in `outputs/csv/`\n\n### Building All Outputs\n\nGenerate all language bindings and formats:\n\n```bash\nnpm run compile\n```\n\nThis will:\n\n1. Process Avro schema definitions in `sources/samples/`\n2. Generate TypeScript types and npm packages\n3. Create SQL table schemas for multiple databases\n4. Generate Protocol Buffer definitions\n5. Create CSV format specifications\n\n### Project Structure\n\n```\n├── sources/                 # Source Avro schema definitions\n│   └── samples/            # Sample schema files (.avsc)\n├── outputs/                # Generated outputs\n│   ├── typescript/         # Generated TS/JS code\n│   ├── sql/               # Database schemas\n│   ├── proto/             # Protocol Buffer files\n│   ├── csv/               # CSV format specs\n│   └── avsc/              # Compiled Avro schemas\n├── npm-samples-lib/        # Generated core TypeScript library\n├── npm-samples-encoder/    # Generated encoding utilities\n├── npm-samples-decoder/    # Generated decoding utilities\n└── scripts/               # Build and generation scripts\n```\n\n### Adding New Fields\n\n1. Edit the appropriate `.avsc` file in `sources/samples/`\n2. Add documentation for the new field\n3. Run `npm run compile` to regenerate all outputs\n4. Test the generated code\n5. Update version numbers as appropriate\n\n### Schema Guidelines\n\n- All fields should have clear documentation\n- Use appropriate Avro types (`null` unions for optional fields)\n- Follow naming conventions (camelCase for field names)\n- Add `attachments` field for extensibility where appropriate\n\n## Versioning\n\nObserveRTC Schemas uses [Semantic Versioning](https://semver.org/) with the following conventions:\n\n- **MAJOR.MINOR.PATCH** format\n- **PATCH** - Library bugfixes and improvements\n- **MINOR** - New fields, schema updates (typically matches WebRTC draft date: YYYYMMDD)\n- **MAJOR** - Breaking changes to schema structure\n\n### Current Version: 3.0.0\n\nBased on WebRTC Statistics API specifications and optimized for real-world WebRTC monitoring scenarios.\n\n## Contributing\n\nWe welcome contributions! Please follow these steps:\n\n### Getting Started\n\n1. Fork the repository\n2. Create a feature branch: `git checkout -b feature/amazing-feature`\n3. Make your changes to the schema files in `sources/`\n4. Run the build: `npm run compile`\n5. Test all generated outputs\n6. Commit your changes: `git commit -m 'Add amazing feature'`\n7. Push to the branch: `git push origin feature/amazing-feature`\n8. Open a Pull Request\n\n### Code Style\n\n- Follow existing schema structure and naming conventions\n- Add comprehensive documentation for new fields\n- Include examples in field descriptions where helpful\n- Test generated code in multiple target languages\n\n## License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.\n\n---\n\n**ObserveRTC Schemas** - The foundation for standardized WebRTC observability across languages and platforms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobservertc%2Fschemas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobservertc%2Fschemas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobservertc%2Fschemas/lists"}