Configuration Types
Type definitions for schemas, masking, transforms, and related configuration objects.
Schema Types
RowOpsSchema
type RowOpsSchema = {
id: string;
name: string;
description?: string | null;
fields: RowOpsSchemaField[];
versionId?: string;
version?: number;
tier?: "free" | "pro" | "scale" | "enterprise";
maskConfig?: MaskConfig;
validationConfig?: Record<string, any>;
transformConfig?: TransformPipelineConfig;
};
| Field | Type | Description |
|---|---|---|
id | string | Unique schema identifier |
name | string | Display name |
description | string | null | Optional description |
fields | RowOpsSchemaField[] | Field definitions |
versionId | string | Version identifier |
version | number | Version number |
tier | Tier | Tier this schema targets |
maskConfig | MaskConfig | Embedded masking configuration |
transformConfig | TransformPipelineConfig | Embedded transform configuration |
SemanticType
type SemanticType =
| "email"
| "phone"
| "url"
| "ssn"
| "zipcode"
| "creditcard"
| "uuid"
| "ipv4"
| "ipv6"
| "date"
| "currency"
| "ip_address";
RowOpsSchemaField
type RowOpsSchemaField = {
key: string;
label: string;
required?: boolean;
type?: "string" | "number" | "date" | "boolean";
regex?: string;
semanticType?: SemanticType;
enumValues?: string[];
transforms?: TransformRule[];
min?: number;
max?: number;
minLength?: number;
maxLength?: number;
};
| Field | Type | Description |
|---|---|---|
key | string | Internal field identifier |
label | string | Display name |
required | boolean | Whether field must have value |
type | FieldType | Expected data type |
regex | string | Validation pattern |
semanticType | SemanticType | Built-in semantic validation target |
enumValues | string[] | Allowed values |
transforms | TransformRule[] | Field-level transforms |
min | number | Minimum value for numeric fields |
max | number | Maximum value for numeric fields |
minLength | number | Minimum length for string fields |
maxLength | number | Maximum length for string fields |
TransformRule
type TransformRule = "trim" | "lowercase" | "uppercase";
Masking Types
MaskConfig
type MaskConfig = {
autoDetectPII?: boolean;
defaultStrategy?: MaskStrategy;
projectSecret?: string;
emailStrategy?: MaskStrategy;
phoneStrategy?: MaskStrategy;
cardStrategy?: MaskStrategy;
ipStrategy?: MaskStrategy;
ssnStrategy?: MaskStrategy;
passportStrategy?: MaskStrategy;
columnRules?: Record<string, MaskStrategy | { strategy: MaskStrategy; options?: MaskRuleOptions }>;
};
| Field | Type | Description |
|---|---|---|
autoDetectPII | boolean | Enable automatic PII detection |
defaultStrategy | MaskStrategy | Default strategy for unmatched fields |
projectSecret | string | Secret for deterministic hashing |
emailStrategy | MaskStrategy | Strategy for email fields |
phoneStrategy | MaskStrategy | Strategy for phone fields |
cardStrategy | MaskStrategy | Strategy for credit card fields |
ipStrategy | MaskStrategy | Strategy for IP addresses (Scale+) |
ssnStrategy | MaskStrategy | Strategy for SSN (Pro+) |
passportStrategy | MaskStrategy | Strategy for passport (Pro+) |
columnRules | Record | Per-column masking rules |
MaskStrategy
type MaskStrategy =
| "none"
| "redact"
| "hash"
| "deterministic"
| "partial"
| "fixed"
| "null"
| "shuffle"
| "email"
| "phone"
| "ssn"
| "creditcard"
| "regex"
| "tokenize";
| Strategy | Description |
|---|---|
none | No masking applied |
redact | Replace with placeholder |
hash | One-way hash |
deterministic | Consistent hash per value |
partial | Partial visibility (e.g., last 4 digits) |
fixed | Replace with fixed string |
null | Replace with null |
shuffle | Shuffle characters |
MaskRule
type MaskRule = {
fields?: string[];
strategy: MaskStrategy;
options?: {
first?: number;
last?: number;
fixed?: string;
projectSecret?: string;
pattern?: string;
replacement?: string;
};
};
Transform Types
TransformPipelineConfig
type TransformPipelineConfig = {
version?: number;
operations: Array<{
kind: "cast" | "rename" | "derive" | "filter" | "lookup" | "conditional";
[key: string]: unknown;
}>;
lookups?: Array<{
tableId: number;
name: string;
keyColumn: string;
onMissing?: "null" | "error" | "keep";
}>;
};
| Field | Type | Description |
|---|---|---|
version | number | Config version |
operations | Array | Transform operations |
lookups | Array | Lookup table definitions |
BulkTransform
type BulkTransform =
| { type: "trim" }
| { type: "case_upper" }
| { type: "case_lower" }
| { type: "case_title" }
| { type: "find_replace"; find: string; replace: string; caseSensitive?: boolean }
| { type: "delete_rows"; condition: "empty" | "duplicates" | "error" }
| { type: "fill_empty"; value: string }
| { type: "regex_replace"; pattern: string; replacement: string };
Profile Types
HistogramBin (Scale+)
type HistogramBin = {
min: number;
max: number;
count: number;
};
NumericStats (Scale+)
type NumericStats = {
min: number;
max: number;
mean: number;
median: number;
stdDev: number;
mode?: number;
};
StringStats (Scale+)
type StringStats = {
minLength: number;
maxLength: number;
avgLength: number;
};
OutlierStats (Scale+)
type OutlierStats = {
count: number;
q1: number;
q3: number;
iqr: number;
lowerBound: number;
upperBound: number;
zScoreOutliers: number;
};
CategoryFrequency (Scale+)
type CategoryFrequency = {
value: string;
count: number;
percentage: number;
};
QualityGrade (Scale+)
type QualityGrade = "A+" | "A" | "B" | "C" | "D" | "F";
ColumnProfile
type ColumnProfile = {
field: string;
totalCount: number;
nonNullCount: number;
nullCount: number;
distinctCount: number;
topValues: { value: string; count: number }[];
minNumeric?: number;
maxNumeric?: number;
minLength?: number;
maxLength?: number;
inferredType?: "string" | "number" | "boolean" | "date" | "email" | "text";
mean?: number;
median?: number;
stddev?: number;
semanticType?: SemanticType;
quality?: QualityGrade;
numericStats?: NumericStats;
stringStats?: StringStats;
histogram?: HistogramBin[];
outliers?: OutlierStats;
topCategories?: CategoryFrequency[];
};
ProfileReport
type ProfileReport = {
tier: string;
topN: number;
profiles: ColumnProfile[];
generatedAt?: string;
};
Import Types
ParsedRow
type ParsedRow = Record<string, any>;
RunMeta
type RunMeta = {
importRunId: string;
importSessionId?: string;
datasetRef?: string;
datasetNonce?: string;
};
SyncTarget
type SyncTarget<Row = Record<string, unknown>> = {
id: string;
label: string;
description?: string;
sendBatch: (batch: Row[], ctx: SyncTargetContext) => Promise<void>;
};
SyncTargetContext
type SyncTargetContext = {
schemaId: string;
projectId?: string;
runId?: string;
};
SyncRunSummary
type SyncRunSummary = {
targetId: string;
sourceMode: "full" | "diff";
totalRows: number;
sentRows: number;
batchCount: number;
durationMs: number;
};
RowLimitPolicy
type RowLimitPolicy = "stop_with_warning" | "hard_error";
ImporterProps
type ImporterProps = {
projectId: string;
schemaId: string;
publishableKey?: string;
onComplete?: (result: ImportResult) => void;
mappingPresetId?: string;
validationPresetId?: string;
transformPresetId?: string;
maskPresetId?: string;
organizationId?: string;
maskConfig?: MaskConfig;
rowLimitPolicy?: RowLimitPolicy;
onBatchValidate?: (req: ExternalBatchValidationRequest) => Promise<ExternalBatchValidationResult>;
externalValidationConfig?: ExternalValidationConfig;
onExternalValidationError?: (err: {
batchIndex: number;
cause: "timeout" | "exception";
error?: unknown;
}) => void;
onMetrics?: (metrics: ImportMetrics) => void;
onProfileTelemetry?: (telemetry: SafeProfileTelemetry) => void | Promise<void>;
onExportErrors?: () => void;
onExportValid?: () => void;
onExportIpcChunk?: (bytes: Uint8Array, chunkIndex: number) => void | Promise<void>;
onExportChunk?: (chunk: ParsedRow[], progress: { current: number; total: number }) => void | Promise<void>;
onExportComplete?: (summary: {
totalRows: number;
totalChunks: number;
runMeta: RunMeta;
}) => void;
transformPipeline?: TransformPipelineConfig;
validateOperation?: (operation: "import" | "export", rowCount: number) => Promise<{ allowed: boolean; reason?: string }>;
enableUnify?: boolean;
unifyConfig?: {
keys?: string[];
fuzzy: Array<{ field: string; weight: number; method?: "jaro" | "levenshtein" | "exact" }>;
threshold: number;
};
onUnifyComplete?: (result: {
runMeta: RunMeta;
totalClusters: number;
totalRecords: number;
dedupRatio: number;
sampleCanonicals: Array<{ entityId: string; sourceIds: string[] }>;
}) => void;
syncTargets?: SyncTarget[];
syncOptions?: {
batchSize?: number;
maxConcurrency?: number;
maxRetries?: number;
sourceMode?: "full" | "diff";
};
onSyncComplete?: (result: SyncRunSummary & { runMeta: RunMeta }) => void;
sampleFileUrl?: string;
sampleFileLabel?: string;
};
ImportResult
type ImportResult = {
datasetRef: string;
datasetNonce: number;
totalRows: number;
runMeta: RunMeta;
summary?: ImportSummary;
profile?: ProfileReport;
};
ImportSummary
type ImportSummary = {
totalRows: number;
validRows: number;
invalidRows: number;
};
ImportMetrics
type ImportMetrics = {
runMeta: RunMeta;
fileSize: number;
fileName: string;
fileType: string;
totalRows: number;
validRows: number;
invalidRows: number;
skippedRows: number;
warningRows: number;
duplicateRows: number;
parseStartTime: number;
parseEndTime: number;
parseDuration: number;
validationStartTime: number;
validationEndTime: number;
validationDuration: number;
totalDuration: number;
totalColumns: number;
columnsMapped: number;
autoMappedColumns: number;
unmappedColumns: number;
totalErrors: number;
errorsPerColumn: Record<string, number>;
errorTypes: Record<string, number>;
totalWarnings: number;
warningsPerColumn: Record<string, number>;
patchesApplied: number;
columnStats: Record<string, {
fillRate: number;
errorCount: number;
warningCount: number;
}>;
};
SafeProfileTelemetry
type SafeTelemetryHistogramBucket = {
min?: number;
max?: number;
count: number;
};
type SafeProfileColumnTelemetry = {
columnKey: string;
columnNameHash?: string;
nullCount: number;
nonNullCount: number;
nullRatio: number;
distinctCountApprox?: number;
histogram?: SafeTelemetryHistogramBucket[];
};
type SafeProfileTelemetry = {
schemaId?: string;
schemaVersionId?: string | null;
generatedAt: string;
rowCount: number;
validRowCount: number;
invalidRowCount: number;
columns: SafeProfileColumnTelemetry[];
};
Validation Types
ExternalBatchValidationRequest
type ExternalBatchValidationRequest<Row = ParsedRow> = {
runMeta: RunMeta;
batchIndex: number;
batchSize: number;
totalBatches: number;
totalRows: number;
validatableRowCount: number;
rows: Array<{
rowId: string;
rowIndex: number;
values: Row;
}>;
};
ExternalBatchValidationError
type ExternalBatchValidationError = {
rowId?: string;
rowIndex?: number;
field?: string;
message: string;
code?: string;
severity?: "error" | "warning";
};
ExternalBatchValidationResult
type ExternalBatchValidationResult = {
errors: ExternalBatchValidationError[];
patches?: Array<{
rowId: string;
updates: Record<string, any>;
}>;
};
Export Types
ExportFormat
type ExportFormat = "csv" | "xlsx";