n8n-nodes-redactor 4.0.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +0,0 @@
1
- export declare function encryptVaultData(jsonData: string, passphrase: string): Buffer;
2
- export declare function decryptVaultData(data: Buffer, passphrase: string): string;
3
- export declare function isEncryptedVault(data: Buffer): boolean;
4
- export declare function isPlaintextVault(data: Buffer): boolean;
@@ -1,6 +0,0 @@
1
- import { IVault } from './vault';
2
- import { RedactionContext, RedactionHit, RedactionReport } from './types';
3
- export declare function redactValue(value: unknown, ctx: RedactionContext, vault: IVault, sessionId: string, hits: RedactionHit[], itemIndex: number, currentPath?: string, siblingKeys?: string[]): unknown;
4
- export declare function restoreValue(value: unknown, vault: IVault, sessionId: string): unknown;
5
- export declare function enhanceWithPresidio(data: Record<string, unknown>, ctx: RedactionContext, vault: IVault, sessionId: string, hits: RedactionHit[], itemIndex: number): Promise<Record<string, unknown>>;
6
- export declare function buildReport(sessionId: string, hits: RedactionHit[]): RedactionReport;
@@ -1,20 +0,0 @@
1
- export type InjectionAction = 'BLOCK' | 'FLAG' | 'LOG_ONLY' | 'CLEAN';
2
- export type InjectionSeverity = 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
3
- export interface InjectionMatch {
4
- category: string;
5
- pattern: string;
6
- matchedText: string;
7
- severity: InjectionSeverity;
8
- score: number;
9
- }
10
- export interface PromptInjectionResult {
11
- detected: boolean;
12
- score: number;
13
- action: InjectionAction;
14
- matchedPatterns: InjectionMatch[];
15
- encodedPayloadsFound: boolean;
16
- zeroWidthCharsFound: boolean;
17
- message: string;
18
- }
19
- export declare function detectPromptInjection(text: string): PromptInjectionResult;
20
- export declare function scanForInjection(data: Record<string, unknown>, currentPath?: string): PromptInjectionResult;
@@ -1,8 +0,0 @@
1
- export declare const FIRST_NAMES: Set<string>;
2
- export declare const LAST_NAMES: Set<string>;
3
- export declare function detectNamesInText(text: string): Array<{
4
- name: string;
5
- start: number;
6
- end: number;
7
- }>;
8
- export declare const NAME_CONTEXT_WORDS: string[];
@@ -1,8 +0,0 @@
1
- import { PiiPattern } from './types';
2
- export declare const PII_PATTERNS: PiiPattern[];
3
- export declare function getPatternOptions(): Array<{
4
- name: string;
5
- value: string;
6
- description: string;
7
- }>;
8
- export declare function getPatternsByNames(names: string[]): PiiPattern[];
@@ -1,36 +0,0 @@
1
- export type PresidioRequester = (options: {
2
- method: 'GET' | 'POST';
3
- url: string;
4
- body?: object;
5
- timeout: number;
6
- }) => Promise<{
7
- statusCode: number;
8
- body: unknown;
9
- }>;
10
- export interface PresidioEntity {
11
- entity_type: string;
12
- start: number;
13
- end: number;
14
- score: number;
15
- analysis_explanation?: {
16
- recognizer: string;
17
- pattern_name?: string;
18
- pattern?: string;
19
- original_score: number;
20
- score: number;
21
- textual_explanation?: string;
22
- score_context_improvement?: number;
23
- supportive_context_word?: string;
24
- validation_result?: number;
25
- };
26
- recognition_metadata?: {
27
- recognizer_name: string;
28
- recognizer_identifier?: string;
29
- };
30
- }
31
- export declare function resetCircuitBreaker(): void;
32
- export declare function checkPresidioHealth(baseUrl: string, request?: PresidioRequester): Promise<boolean>;
33
- export declare function analyzeWithPresidio(baseUrl: string, text: string, language?: string, scoreThreshold?: number, timeoutMs?: number, request?: PresidioRequester): Promise<PresidioEntity[]>;
34
- export declare function getRedactorLabel(presidioEntityType: string): string;
35
- export declare function getRedactorCategory(presidioEntityType: string): string;
36
- export declare function getPresidioEntities(baseUrl: string, request?: PresidioRequester): Promise<string[]>;
@@ -1,20 +0,0 @@
1
- import { RedactionMode, CustomPattern, AllowDenyEntry, FieldRule } from './types';
2
- export interface TenantProfile {
3
- profileId?: string;
4
- displayName?: string;
5
- enabledPatterns?: string[];
6
- customPatterns?: CustomPattern[];
7
- confidenceThreshold?: number;
8
- redactionMode?: RedactionMode;
9
- dedup?: boolean;
10
- fieldMode?: 'all' | 'allowlist' | 'denylist';
11
- fieldRules?: FieldRule[];
12
- allowList?: AllowDenyEntry[];
13
- denyList?: AllowDenyEntry[];
14
- region?: string;
15
- retentionMinutes?: number;
16
- auditLog?: boolean;
17
- createdAt?: string;
18
- updatedAt?: string;
19
- }
20
- export declare function parseTenantProfile(input: unknown, knownPatterns?: string[]): TenantProfile;
@@ -1 +0,0 @@
1
- export declare function generatePseudonym(sessionId: string, original: string, label: string): string;
@@ -1,51 +0,0 @@
1
- import { RedactionHit } from './types';
2
- import { ClassificationLabel } from './classification';
3
- export interface RopaController {
4
- name: string;
5
- contactEmail: string;
6
- representative?: string;
7
- dpo?: string;
8
- }
9
- export interface RopaThirdCountryTransfer {
10
- country: string;
11
- organization: string;
12
- safeguards: string;
13
- }
14
- export interface RopaRecord {
15
- recordId: string;
16
- version: string;
17
- generatedAt: string;
18
- generatedBy: string;
19
- controller: RopaController;
20
- processingPurposes: string[];
21
- legalBasis: string;
22
- dataSubjectCategories: string[];
23
- personalDataCategories: Array<{
24
- category: string;
25
- count: number;
26
- patternLabels: string[];
27
- }>;
28
- recipientCategories: string[];
29
- thirdCountryTransfers: RopaThirdCountryTransfer[];
30
- retentionPolicy: {
31
- vaultTtlMinutes: number;
32
- auditLogRetentionDays: number;
33
- description: string;
34
- };
35
- securityMeasures: {
36
- encryptionAtRest: boolean;
37
- encryptionAlgorithm: string;
38
- pseudonymization: boolean;
39
- accessControl: string;
40
- auditLogging: boolean;
41
- };
42
- processingSummary: {
43
- totalItemsProcessed: number;
44
- totalPiiDetected: number;
45
- redactionMode: string;
46
- patternsUsed: number;
47
- classificationLevel: string;
48
- hitsByCategory: Record<string, number>;
49
- };
50
- }
51
- export declare function generateRopaRecord(hits: RedactionHit[], classification: ClassificationLabel, itemCount: number, patternsUsed: number, redactionMode: string, vaultTtlMinutes: number, encryptionEnabled: boolean, auditLogEnabled: boolean, controller: RopaController, processingPurposes: string[], legalBasis: string, dataSubjectCategories: string[], recipientCategories: string[], thirdCountryTransfers: RopaThirdCountryTransfer[]): RopaRecord;
@@ -1,73 +0,0 @@
1
- import type { PresidioRequester } from './presidio';
2
- export interface PiiPattern {
3
- name: string;
4
- label: string;
5
- category: PiiCategory;
6
- regex: RegExp;
7
- validate?: (match: string) => boolean;
8
- description?: string;
9
- contextWords?: string[];
10
- baseConfidence?: number;
11
- }
12
- export type PiiCategory = 'identity' | 'financial' | 'contact' | 'network' | 'location' | 'temporal' | 'medical' | 'crypto' | 'enterprise' | 'vehicle' | 'biometric' | 'other';
13
- export type RedactionMode = 'token' | 'mask' | 'hash' | 'redact' | 'pseudonymize' | 'blackout' | 'remove';
14
- export type VaultStorage = 'memory' | 'workflow' | 'file';
15
- export interface RedactionHit {
16
- token: string;
17
- original: string;
18
- patternName: string;
19
- patternLabel: string;
20
- category: PiiCategory;
21
- field: string;
22
- itemIndex: number;
23
- confidence: number;
24
- }
25
- export interface RedactionReport {
26
- sessionId: string;
27
- timestamp: string;
28
- totalHits: number;
29
- hitsByCategory: Record<string, number>;
30
- hitsByPattern: Record<string, number>;
31
- hits: RedactionHit[];
32
- }
33
- export interface VaultEntry {
34
- token: string;
35
- original: string;
36
- patternLabel: string;
37
- category: PiiCategory;
38
- createdAt: string;
39
- }
40
- export interface VaultSession {
41
- sessionId: string;
42
- entries: Record<string, VaultEntry>;
43
- createdAt: string;
44
- ttl: number;
45
- }
46
- export interface CustomPattern {
47
- label: string;
48
- regex: string;
49
- category?: string;
50
- }
51
- export interface FieldRule {
52
- field: string;
53
- mode: 'include' | 'exclude';
54
- }
55
- export interface AllowDenyEntry {
56
- value: string;
57
- type: 'exact' | 'contains' | 'regex';
58
- }
59
- export interface RedactionContext {
60
- enabledPatterns: string[];
61
- customPatterns: CustomPattern[];
62
- mode: RedactionMode;
63
- dedup: boolean;
64
- fieldRules: FieldRule[];
65
- fieldMode: 'all' | 'allowlist' | 'denylist';
66
- skipSemantic?: boolean;
67
- allowList?: AllowDenyEntry[];
68
- denyList?: AllowDenyEntry[];
69
- confidenceThreshold?: number;
70
- presidioUrl?: string;
71
- presidioLanguage?: string;
72
- presidioRequest?: PresidioRequester;
73
- }
@@ -1,57 +0,0 @@
1
- import { VaultEntry, VaultSession } from './types';
2
- export interface IVault {
3
- getOrCreateSession(sessionId: string, ttl: number): VaultSession;
4
- getSession(sessionId: string): VaultSession | null;
5
- addEntry(sessionId: string, entry: VaultEntry): void;
6
- findByOriginal(sessionId: string, original: string): VaultEntry | undefined;
7
- deleteSession(sessionId: string): void;
8
- listSessions(): Array<{
9
- sessionId: string;
10
- entryCount: number;
11
- createdAt: string;
12
- ttl: number;
13
- }>;
14
- save(sessionId: string): void;
15
- cleanup(): number;
16
- }
17
- export declare class MemoryVault implements IVault {
18
- getOrCreateSession(sessionId: string, ttl: number): VaultSession;
19
- getSession(sessionId: string): VaultSession | null;
20
- addEntry(sessionId: string, entry: VaultEntry): void;
21
- findByOriginal(sessionId: string, original: string): VaultEntry | undefined;
22
- deleteSession(sessionId: string): void;
23
- listSessions(): Array<{
24
- sessionId: string;
25
- entryCount: number;
26
- createdAt: string;
27
- ttl: number;
28
- }>;
29
- save(): void;
30
- cleanup(): number;
31
- }
32
- export type VaultStore = Record<string, unknown>;
33
- export declare class WorkflowVault implements IVault {
34
- private store;
35
- private passphrase;
36
- private cache;
37
- constructor(store: VaultStore, passphrase?: string);
38
- private get sessions();
39
- private key;
40
- private decode;
41
- private load;
42
- getOrCreateSession(sessionId: string, ttl: number): VaultSession;
43
- getSession(sessionId: string): VaultSession | null;
44
- addEntry(sessionId: string, entry: VaultEntry): void;
45
- findByOriginal(sessionId: string, original: string): VaultEntry | undefined;
46
- deleteSession(sessionId: string): void;
47
- listSessions(): Array<{
48
- sessionId: string;
49
- entryCount: number;
50
- createdAt: string;
51
- ttl: number;
52
- }>;
53
- save(sessionId: string): void;
54
- private evictIfFull;
55
- cleanup(): number;
56
- }
57
- export declare function createVault(storage: string, store?: VaultStore, passphrase?: string): IVault;