Skip to content

Commit 4e7f525

Browse files
authored
Merge pull request #8 from nightfallai/evan/plat-1552-add-policyuuid-field-to-text-scan
Add policyUUIDs field to text scan endpoint
2 parents 80c4f31 + d5e3473 commit 4e7f525

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/nightfall.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,17 @@ export class Nightfall extends Base {
2727
* to uncover sensitive information. Returns a list equal in size to the number of provided
2828
* string payloads. The item at each list index will be a list of all matches for the provided
2929
* detectors, or an empty list if no occurrences are found.
30-
*
30+
*
3131
* @param payload An array of strings that you would like to scan
32-
* @param config The configuration to use to scan the payload
32+
* @param policy The configuration to use to scan the payload
33+
* @param policyUUIDs An array of UUIDs referring to policies built through the Nightfall dashboard
3334
* @returns A promise that contains the API response
3435
*/
35-
async scanText(payload: string[], config: ScanText.RequestConfig): Promise<NightfallResponse<ScanText.Response>> {
36+
async scanText(payload: string[], policy?: ScanText.RequestConfig, policyUUIDs?: string[]): Promise<NightfallResponse<ScanText.Response>> {
3637
try {
3738
const response = await axios.post<ScanText.Response>(
3839
`${this.API_HOST}/v3/scan`,
39-
{ payload, config },
40+
{ payload, policy, policyUUIDs },
4041
{ headers: this.AXIOS_HEADERS },
4142
)
4243

0 commit comments

Comments
 (0)