Skip to main content

QFakerAnonymizeEngine

@quik/faker


@quik/faker / QFakerAnonymizeEngine

Class: QFakerAnonymizeEngine

Defined in: faker/src/engine/QFakerAnonymizeEngine.ts:19

Replaces PII values in existing database rows without changing PKs or FKs.

Extends

  • QObject

Constructors

Constructor

new QFakerAnonymizeEngine(): QFakerAnonymizeEngine

Returns

QFakerAnonymizeEngine

Inherited from

QObject.constructor

Accessors

logger

Get Signature

get protected logger(): IQLogger

Defined in: core/src/QObject.ts:15

The logger getter for the object.

Returns

IQLogger

Inherited from

QObject.logger


name

Get Signature

get name(): string

Defined in: core/src/QObject.ts:8

Returns

string

Inherited from

QObject.name

Methods

endSpan()

protected endSpan(span): void

Defined in: core/src/QObject.ts:35

End a span returned by startSpan.

Parameters

span

TelemetrySpan

The span to end.

Returns

void

Inherited from

QObject.endSpan


recordSpanError()

protected recordSpanError(span, err): void

Defined in: core/src/QObject.ts:45

Record an exception on an active span.

Parameters

span

TelemetrySpan

The span to record the error on.

err

unknown

The error to record.

Returns

void

Inherited from

QObject.recordSpanError


run()

run(spec, modelName): Promise<void>

Defined in: faker/src/engine/QFakerAnonymizeEngine.ts:41

Anonymizes a single named model.

Parameters

spec

QFakerSpec

Faker spec document

modelName

string

Key of the model inside spec.models

Returns

Promise<void>

Throws

When the model is not found in the spec or has the wrong mode


runAll()

runAll(spec): Promise<void>

Defined in: faker/src/engine/QFakerAnonymizeEngine.ts:25

Anonymizes every model in the spec that uses mode: "anonymize".

Parameters

spec

QFakerSpec

Faker spec document

Returns

Promise<void>


runModel()

protected runModel(faker, _spec, modelName, modelSpec): Promise<void>

Defined in: faker/src/engine/QFakerAnonymizeEngine.ts:54

Parameters

faker

Faker

_spec

QFakerSpec

modelName

string

modelSpec

QFakerModelSpec

Returns

Promise<void>


setSpanAttribute()

protected setSpanAttribute(span, key, value): void

Defined in: core/src/QObject.ts:64

Set a single attribute on an active span.

Parameters

span

TelemetrySpan

The span to update.

key

string

Attribute key.

value

string | number | boolean

Attribute value.

Returns

void

Inherited from

QObject.setSpanAttribute


startSpan()

protected startSpan(spanName, options?): TelemetrySpan

Defined in: core/src/QObject.ts:26

Start a telemetry span for the given operation name. Returns undefined when no telemetry provider is active.

Parameters

spanName

string

Name of the span.

options?

TelemetrySpanOptions

Optional span attributes and kind.

Returns

TelemetrySpan

Inherited from

QObject.startSpan