This library provides TypeScript type definitions and conversion utilities for the IVMS101 (interVASP Messaging Standard) in both its original 2020 version and the updated 2023 version.
- Type definitions for IVMS101 2020 and 2023 versions
- Conversion functions between 2020 and 2023 formats
- Version detection and automatic conversion
npm install ivms101
import { IVMS101, ensureVersion, PayloadVersionCode } from 'ivms101';
import { IVMS101, ensureVersion, PayloadVersionCode } from 'ivms101';
// Assuming you have some IVMS101 data
const ivmsData: IVMS101 = { /* ... */ };
// Convert to 2023 version (default)
const ivms2023 = ensureVersion(ivmsData); // Defaults to 2023 version
// Or explicitly specify version
const ivms2023Explicit = ensureVersion(PayloadVersionCode.V2023, ivmsData);
// Convert to 2020 version
const ivms2020 = ensureVersion(PayloadVersionCode.V2020, ivmsData);
The library provides type definitions for both versions, allowing for type-safe usage in TypeScript projects.
import { IVMS101_2020, IVMS101_2023 } from 'ivms101';
function processIVMS101(data: IVMS101_2020.IVMS101 | IVMS101_2023.IVMS101) {
// Process the data...
}
Converts the given IVMS101 data to the specified version. Defaults to 2023 version if no version is specified.
Detects the version of the given IVMS101 data.
Converts IVMS101 2020 data to 2023 format.
Converts IVMS101 2023 data back to 2020 format.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.