LDIF byte-preserving records and offline structural checks in MoonBit
node dist/moonldif.js compare examples/snapshots/before.ldif examples/snapshots/after.ldif --format markdownnode dist/moonldif.js batch examples/01-directory-export.ldif examples/02-account-changes.ldif examples/03-migration-plan.ldif --deny-delete --deny-clear --deny-rename --format jsonnpm --prefix web ci
npm --prefix web run build
npm --prefix web run previewnode scripts/demo.mjsnode dist/moonldif.js check examples/01-directory-export.ldif
node dist/moonldif.js inspect examples/03-migration-plan.ldif --format json
node dist/moonldif.js review examples/02-account-changes.ldif --deny-delete --deny-clear --format markdown
node dist/moonldif.js check examples/02-account-changes.ldif --deny-delete
node dist/moonldif.js format examples/01-directory-export.ldif --output normalized.ldif| 退出码 | 解释 |
|---|---|
| 0 | 支持范围内检查完成,启用的策略未拦截 |
| 1 | 检查完成,启用的风险策略拦截 |
| 2 | 输入或运行错误,或存在未能完整分析的结构/外部值;优先于 1 |
git clone https://github.com/WeiR-h/moonldif.git
cd moonldif
npm run build
npm test
npm run verifypython scripts/reference-verify.py
python scripts/snapshot-verify.py
python scripts/openldap-verify.py
python scripts/sdk-verify.py
python scripts/rfc-verify.py
python scripts/package-verify.py
node scripts/benchmark.mjs
python scripts/prepare-moonldap.py
node scripts/test-moonldap.mjslet report = @ldif.check_text("version: 1\ndn: cn=Demo\ncn: Demo\n")
println(report.to_text())
if report.exit_code() == 0 {
let normalized = report.format() // 可抛出 WriteError
println(normalized)
}pub struct BatchReview {
// private fields
}fn BatchReview::add_bytes(self : BatchReview, label : String, data : Bytes, input_sha256 : String) -> Unitfn BatchReview::new(options? : Options, risk_policy? : RiskPolicy, legacy_dn_spaces? : Bool) -> BatchReviewpub(all) struct Review {
items : Array[ReviewItem]
total_items : Int
truncated : Bool
analysis_complete : Bool
input_exit_code : Int
record_count : Int
} derive(Eq)pub(all) struct ReviewMetadata {
input_sha256 : String
input_byte_length : Int
options : Options
legacy_dn_spaces : Bool
risk_policy : RiskPolicy
} derive(Eq)pub struct SnapshotDiff {
// private fields
}fn check(data : Bytes, options? : Options, legacy_dn_spaces? : Bool, risk_policy? : RiskPolicy) -> Reportfn check_text(text : String, options? : Options, legacy_dn_spaces? : Bool, risk_policy? : RiskPolicy) -> Reportfn compare_snapshots(before : Bytes, after : Bytes, allow_missing_version? : Bool, legacy_dn_spaces? : Bool, before_sha256? : String?, after_sha256? : String?) -> SnapshotDifffn same_attribute_description(a : String, b : String) -> BoolInstall
Download zipLDIF byte-preserving records and offline structural checks in MoonBit