Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions node/term-guard/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,4 @@ serde_json = "1"
thiserror = "2"

[build-dependencies]
napi-build = "2"

[profile.release]
lto = true
strip = true
opt-level = 3
napi-build = "2"
111 changes: 87 additions & 24 deletions node/term-guard/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,90 @@
/* tslint:disable */
/* eslint-disable */

/* auto-generated by NAPI-RS */

export interface TermGuardInfo {
name: string;
version: string;
rustVersion: string;
export const enum Level {
Error = 0,
Warning = 1,
Info = 2
}
export interface ValidationIssue {
checkName: string
level: string
message: string
}
export interface ValidationReport {
suiteName: string
totalChecks: number
passedChecks: number
failedChecks: number
issues: Array<ValidationIssue>
}
export interface PerformanceMetrics {
totalDurationMs: number
checksPerSecond: number
}
export interface ValidationResult {
status: string
report: ValidationReport
metrics?: PerformanceMetrics
}
export const enum ConstraintStatus {
Success = 0,
Failure = 1,
Skipped = 2
}
export declare function helloTerm(): string
export declare function getVersion(): string
export interface ValidationInfo {
name: string
version: string
rustVersion: string
}
export declare function getInfo(): ValidationInfo
/** Example usage function demonstrating the full API */
export declare function validateSampleData(path: string): Promise<string>
export declare class Check {
get name(): string
get level(): Level
get description(): string | null
}
export declare class CheckBuilder {
constructor(name: string)
level(level: Level): this
description(desc: string): this
isComplete(column: string, ratio?: number | undefined | null): Check
hasMin(column: string, minValue: number): Check
hasMax(column: string, maxValue: number): Check
isUnique(column: string): Check
hasMean(column: string, expected: number, tolerance?: number | undefined | null): Check
build(): Check
}
export declare class DataSource {
static fromParquet(path: string): Promise<DataSource>
static fromCsv(path: string): Promise<DataSource>
static fromJson(path: string): Promise<DataSource>
getRowCount(): Promise<number>
getColumnNames(): Promise<Array<string>>
get tableName(): string
}
export declare class DataSourceBuilder {
constructor()
registerParquet(name: string, path: string): Promise<void>
registerCsv(name: string, path: string): Promise<void>
build(): DataSource
}
export declare class ValidationSuite {
static builder(name: string): ValidationSuite
get name(): string
get description(): string | null
run(data: DataSource): Promise<ValidationResult>
get checkCount(): number
}
export declare class ValidationSuiteBuilder {
constructor(name: string)
description(desc: string): this
addCheck(check: Check): this
addChecks(checks: Array<Check>): this
build(): ValidationSuite
}

/**
* Returns a greeting from Term Guard
*/
export function helloTerm(): string;

/**
* Returns the current version of Term Guard
*/
export function getVersion(): string;

/**
* Returns information about the Term Guard library
*/
export function getInfo(): TermGuardInfo;

/**
* Validates sample data asynchronously
*/
export function validateSampleData(): Promise<string>;
Loading
Loading