prorm API Reference
    Preparing search index...

    Class PseudonymizationService

    Index
    configure: (cfg: PseudonymizationConfig) => Promise<void> = configure

    Type Declaration

    tokenize: (value: string) => Promise<string> = tokenize

    Type Declaration

      • (value: string): Promise<string>
      • Tokenize a value (replace with a pseudonym/token). Returns the same token for the same input (deterministic).

        Parameters

        • value: string

        Returns Promise<string>

    detokenize: (token: string) => Promise<string | null> = detokenize

    Type Declaration

      • (token: string): Promise<string | null>
      • Detokenize (reverse) a token to get the original value.

        Parameters

        • token: string

        Returns Promise<string | null>

    exists: (token: string) => Promise<boolean> = exists

    Type Declaration

      • (token: string): Promise<boolean>
      • Check if a token exists.

        Parameters

        • token: string

        Returns Promise<boolean>

    removeToken: (token: string) => Promise<boolean> = removeToken

    Type Declaration

      • (token: string): Promise<boolean>
      • Delete a token (irreversible — useful for right to erasure).

        Parameters

        • token: string

        Returns Promise<boolean>

    removeOriginal: (original: string) => Promise<boolean> = removeOriginal

    Type Declaration

      • (original: string): Promise<boolean>
      • Delete tokens for a specific original value.

        Parameters

        • original: string

        Returns Promise<boolean>

    applyHooks: (Model: any, field: string) => void = applyHooks

    Type Declaration

      • (Model: any, field: string): void
      • Wire hooks onto a model to auto-tokenize the specified field on write and auto-detokenize on read.

        Parameters

        • Model: any

          The model class

        • field: string

          The field to pseudonymize

        Returns void