Skip to content

@nestarc/data-subject/lint API reference ​

Inspect Prisma schemas with parsePrismaSchema and lintPrismaSchema, format findings, and decide whether policy lint should fail a check. Use these helpers when validating entity-policy coverage.

Browse all @nestarc/data-subject import paths.

Interfaces ​

DataSubjectLintConfig ​

Defined in: src/lint/types.ts:42

Properties ​

checkRelations? ​
ts
optional checkRelations?: boolean;

Defined in: src/lint/types.ts:53

Validate declared relations and child-before-parent dependencies. Defaults true with definitions.

definitions? ​
ts
optional definitions?: EntityDefinition[];

Defined in: src/lint/types.ts:44

The same JSON-compatible definitions passed to Registry.registerDefinition.

piiFieldPatterns? ​
ts
optional piiFieldPatterns?: string[];

Defined in: src/lint/types.ts:47

registry? ​
ts
optional registry?: DataSubjectLintRegistryEntry[];

Defined in: src/lint/types.ts:46

Legacy configuration. Prefer definitions for a shared runtime/lint source.

requireTenantField? ​
ts
optional requireTenantField?: boolean;

Defined in: src/lint/types.ts:49

strictCoverage? ​
ts
optional strictCoverage?: boolean;

Defined in: src/lint/types.ts:51

Check every scalar, including newly added fields without PII-like names. Defaults true with definitions.

suppressions? ​
ts
optional suppressions?: DataSubjectLintSuppression[];

Defined in: src/lint/types.ts:48


DataSubjectLintFinding ​

Defined in: src/lint/types.ts:21

Properties ​

code ​
ts
code: DataSubjectLintCode;

Defined in: src/lint/types.ts:23

field? ​
ts
optional field?: string;

Defined in: src/lint/types.ts:25

message ​
ts
message: string;

Defined in: src/lint/types.ts:26

model ​
ts
model: string;

Defined in: src/lint/types.ts:24

severity ​
ts
severity: DataSubjectLintSeverity;

Defined in: src/lint/types.ts:22


DataSubjectLintRegistryEntry ​

Defined in: src/lint/types.ts:29

Extends ​

Properties ​

dependsOn? ​
ts
optional dependsOn?: string[];

Defined in: src/policy-compiler.ts:19

Parent entities: this entity is erased before each named parent.

Inherited from ​

PolicySpec.dependsOn

entityName ​
ts
entityName: string;

Defined in: src/policy-compiler.ts:10

Inherited from ​

PolicySpec.entityName

exportFields? ​
ts
optional exportFields?: string[];

Defined in: src/policy-compiler.ts:15

Explicit top-level export allowlist. Omit for an erase-only entity.

Inherited from ​

PolicySpec.exportFields

fields ​
ts
fields: Record<string, PolicyEntry>;

Defined in: src/policy-compiler.ts:13

Inherited from ​

PolicySpec.fields

ignoredFields? ​
ts
optional ignoredFields?: Record<string, string>;

Defined in: src/lint/types.ts:32

relations? ​
ts
optional relations?: string[];

Defined in: src/lint/types.ts:33

rowLevel? ​
ts
optional rowLevel?: "delete-row" | "delete-fields";

Defined in: src/policy-compiler.ts:12

Inherited from ​

PolicySpec.rowLevel

singleTenantId? ​
ts
optional singleTenantId?: string;

Defined in: src/lint/types.ts:31

stableIdField? ​
ts
optional stableIdField?: string;

Defined in: src/policy-compiler.ts:17

Immutable row identity used for post-write verification.

Inherited from ​

PolicySpec.stableIdField

subjectField ​
ts
subjectField: string;

Defined in: src/policy-compiler.ts:11

Inherited from ​

PolicySpec.subjectField

tenantField? ​
ts
optional tenantField?: string;

Defined in: src/lint/types.ts:30


DataSubjectLintReport ​

Defined in: src/lint/types.ts:56

Properties ​

findings ​
ts
findings: DataSubjectLintFinding[];

Defined in: src/lint/types.ts:58

ok ​
ts
ok: boolean;

Defined in: src/lint/types.ts:57


DataSubjectLintSuppression ​

Defined in: src/lint/types.ts:36

Properties ​

field? ​
ts
optional field?: string;

Defined in: src/lint/types.ts:38

model ​
ts
model: string;

Defined in: src/lint/types.ts:37

reason ​
ts
reason: string;

Defined in: src/lint/types.ts:39

Type Aliases ​

DataSubjectLintCode ​

ts
type DataSubjectLintCode =
  | "dsr_lint_unregistered_model"
  | "dsr_lint_missing_policy_field"
  | "dsr_lint_missing_tenant_field"
  | "dsr_lint_empty_suppression_reason"
  | "dsr_lint_invalid_policy"
  | "dsr_lint_subject_field_missing"
  | "dsr_lint_schema_unsupported"
  | "dsr_lint_nonnullable_write"
  | "dsr_lint_unmapped_relation"
  | "dsr_lint_relation_conflict"
  | "dsr_lint_retention_conflict"
  | "dsr_lint_dependency_order"
  | "dsr_lint_dependency_cycle";

Defined in: src/lint/types.ts:6


DataSubjectLintSeverity ​

ts
type DataSubjectLintSeverity = "warning" | "error";

Defined in: src/lint/types.ts:4

References ​

formatLintReport ​

Re-exports formatLintReport


lintPrismaSchema ​

Re-exports lintPrismaSchema


parsePrismaSchema ​

Re-exports parsePrismaSchema


shouldFailLint ​

Re-exports shouldFailLint

Documentation site: MIT License. Check each package for its license.