Skip to main content

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;
};
FieldTypeDescription
idstringUnique schema identifier
namestringDisplay name
descriptionstring | nullOptional description
fieldsRowOpsSchemaField[]Field definitions
versionIdstringVersion identifier
versionnumberVersion number
tierTierTier this schema targets
maskConfigMaskConfigEmbedded masking configuration
transformConfigTransformPipelineConfigEmbedded 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;
};
FieldTypeDescription
keystringInternal field identifier
labelstringDisplay name
requiredbooleanWhether field must have value
typeFieldTypeExpected data type
regexstringValidation pattern
semanticTypeSemanticTypeBuilt-in semantic validation target
enumValuesstring[]Allowed values
transformsTransformRule[]Field-level transforms
minnumberMinimum value for numeric fields
maxnumberMaximum value for numeric fields
minLengthnumberMinimum length for string fields
maxLengthnumberMaximum 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 }>;
};
FieldTypeDescription
autoDetectPIIbooleanEnable automatic PII detection
defaultStrategyMaskStrategyDefault strategy for unmatched fields
projectSecretstringSecret for deterministic hashing
emailStrategyMaskStrategyStrategy for email fields
phoneStrategyMaskStrategyStrategy for phone fields
cardStrategyMaskStrategyStrategy for credit card fields
ipStrategyMaskStrategyStrategy for IP addresses (Scale+)
ssnStrategyMaskStrategyStrategy for SSN (Pro+)
passportStrategyMaskStrategyStrategy for passport (Pro+)
columnRulesRecordPer-column masking rules

MaskStrategy

type MaskStrategy =
| "none"
| "redact"
| "hash"
| "deterministic"
| "partial"
| "fixed"
| "null"
| "shuffle"
| "email"
| "phone"
| "ssn"
| "creditcard"
| "regex"
| "tokenize";
StrategyDescription
noneNo masking applied
redactReplace with placeholder
hashOne-way hash
deterministicConsistent hash per value
partialPartial visibility (e.g., last 4 digits)
fixedReplace with fixed string
nullReplace with null
shuffleShuffle 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";
}>;
};
FieldTypeDescription
versionnumberConfig version
operationsArrayTransform operations
lookupsArrayLookup 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";