@@ -11,7 +11,8 @@ import {
1111 TokenFormat ,
1212 TokenType ,
1313 Transformations ,
14- DetectEntities
14+ DetectEntities ,
15+ DeidentifyTextResponse
1516} from 'skyflow-node' ;
1617
1718/**
@@ -55,10 +56,10 @@ async function performDeidentifyText() {
5556 ) ;
5657
5758 // Step 5: Configure DeidentifyTextOptions
58- const optionsText = new DeidentifyTextOptions ( ) ;
59+ const options = new DeidentifyTextOptions ( ) ;
5960
6061 // setEntities: Specify which entities to deidentify
61- optionsText . setEntities ( [ DetectEntities . CREDIT_CARD , DetectEntities . SSN ] ) ;
62+ options . setEntities ( [ DetectEntities . CREDIT_CARD , DetectEntities . SSN ] ) ;
6263
6364 // setAllowRegexList: Allowlist regex patterns (entities matching these will not be deidentified)
6465 // optionsText.setAllowRegexList(['<YOUR_REGEX_PATTERN>']);
@@ -69,7 +70,7 @@ async function performDeidentifyText() {
6970 // setTokenFormat: Specify the token format for deidentified entities
7071 const tokenFormat = new TokenFormat ( ) ;
7172 tokenFormat . setDefault ( TokenType . VAULT_TOKEN ) ;
72- optionsText . setTokenFormat ( tokenFormat ) ;
73+ options . setTokenFormat ( tokenFormat ) ;
7374
7475 // setTransformations: Specify custom transformations for entities
7576 const transformations = new Transformations ( ) ;
@@ -78,12 +79,12 @@ async function performDeidentifyText() {
7879 min : 30 , // Minimum shift days
7980 entities : [ DetectEntities . DOB ] , // Entities to apply the shift
8081 } ) ;
81- optionsText . setTransformations ( transformations ) ;
82+ options . setTransformations ( transformations ) ;
8283
8384 // Step 6: Call deidentifyText API
84- const response = await skyflowClient
85+ const response : DeidentifyTextResponse = await skyflowClient
8586 . detect ( primaryVaultConfig . vaultId )
86- . deidentifyText ( deidentifyTextRequest , optionsText ) ;
87+ . deidentifyText ( deidentifyTextRequest , options ) ;
8788
8889 // Handle Successful Response
8990 console . log ( 'Deidentify Text Response:' , response ) ;
0 commit comments