Pure MoonBit iCalendar parser, validator, recurrence, alarm, report, and diff toolkit.
moon add WYT-ai-nb/mooncalguardmatch @cal.parse_calendar(text) {
Ok(calendar) => {
let report = @cal.validate_calendar(calendar, @cal.ValidationOptions::strict())
println(@cal.render_validation(report))
}
Err(err) => println(err.message())
}import {
"WYT-ai-nb/mooncalguard" @cal
}moon fmt --check
moon check --deny-warn
moon build
moon test --deny-warn
moon info
moon run src/cmd/demoWYT-ai-nb/mooncalguardmoon fmt --check
moon check --deny-warn
moon build
moon test --deny-warn
moon info
moon run src/cmd/demo
moon login
moon publish --dry-runpub(all) suberror CalError {
EmptyInput
MissingColon(Int, String)
BadPropertyName(Int, String)
BadParameter(Int, String)
UnexpectedEnd(String)
MismatchedEnd(String, String)
NestedCalendar
MissingCalendar
MultipleCalendars
PropertyOutsideCalendar(String)
ComponentOutsideCalendar(String)
}pub(all) suberror DurationError {
EmptyDuration
MissingDurationPrefix
BadDurationNumber(String)
BadDurationDesignator(String)
MixedWeekAndDateTime
EmptyDurationBody
}pub(all) suberror RecurrenceError {
EmptyRule
MissingFrequency
DuplicatePart(String)
UnknownPart(String)
BadFrequency(String)
BadInteger(String)
BadWeekday(String)
BadUntil(String)
BadByDay(String)
ConflictingLimit
}pub(all) struct AlarmSummary {
action : AlarmAction
trigger : String
description : String?
summary : String?
attendee_count : Int
} derive(Eq, Debug)pub(all) struct CalendarChange {
kind : ChangeKind
uid : String
before : String?
after : String?
breaking : Bool
} derive(Eq, Debug)pub(all) struct CalendarStats {
calendar_properties : Int
top_level_components : Int
total_components : Int
total_properties : Int
events : Int
todos : Int
journals : Int
timezones : Int
observances : Int
alarms : Int
recurring_components : Int
components_with_uid : Int
unknown_properties : Int
unsupported_properties : Int
} derive(Eq, Debug)pub(all) struct PropertySpec {
name : String
kind : ValueKind
cardinality : PropertyCardinality
in_calendar : Bool
in_event : Bool
in_todo : Bool
in_journal : Bool
in_timezone : Bool
in_observance : Bool
in_alarm : Bool
note : String
} derive(Eq, Debug)fn create_email_alarm(trigger : String, summary : String, description : String, attendee : String) -> Componentfn property_allowed_in_component(name : String, component_name : String) -> Boolfn recurrence_rule_from_parts(frequency : RecurrenceFrequency, interval : Int, count : Int?, until : String?) -> RecurrenceRulePure MoonBit iCalendar parser, validator, recurrence, alarm, report, and diff toolkit.