Skip to content

Commit df7424a

Browse files
SK-2116: update masking method enum to support blackbox masking method (#216)
* SK-2116: update masking method enum to support blackbox masking method * SK-2116: fix the unit test
1 parent e235fb3 commit df7424a

5 files changed

Lines changed: 19 additions & 12 deletions

File tree

src/ _generated_/rest/api/resources/files/types/DeidentifyImageRequestMaskingMethod.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
/**
66
* Method to mask the entities in the image.
77
*/
8-
export type DeidentifyImageRequestMaskingMethod = "blackout" | "blur";
8+
export type DeidentifyImageRequestMaskingMethod = "blackbox" | "blur";
99
export const DeidentifyImageRequestMaskingMethod = {
10-
Blackout: "blackout",
10+
Blackbox: "blackbox",
1111
Blur: "blur",
1212
} as const;

src/ _generated_/rest/api/types/DeidentifyStatusResponseOutputType.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
/**
66
* How the output file is specified.
77
*/
8-
export type DeidentifyStatusResponseOutputType = "base64" | "efs_path";
8+
export type DeidentifyStatusResponseOutputType = "BASE64" | "EFS_PATH" | "UNKNOWN";
99
export const DeidentifyStatusResponseOutputType = {
10-
Base64: "base64",
11-
EfsPath: "efs_path",
10+
Base64: "BASE64",
11+
EfsPath: "EFS_PATH",
12+
Unknown: "UNKNOWN",
1213
} as const;

src/ _generated_/rest/api/types/DeidentifyStatusResponseStatus.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
/**
66
* Status of the detect run.
77
*/
8-
export type DeidentifyStatusResponseStatus = "failed" | "in_progress" | "success";
8+
export type DeidentifyStatusResponseStatus = "FAILED" | "IN_PROGRESS" | "SUCCESS";
99
export const DeidentifyStatusResponseStatus = {
10-
Failed: "failed",
11-
InProgress: "in_progress",
12-
Success: "success",
10+
Failed: "FAILED",
11+
InProgress: "IN_PROGRESS",
12+
Success: "SUCCESS",
1313
} as const;

src/utils/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export enum DetectOutputTranscription {
131131
}
132132

133133
export enum MaskingMethod{
134-
Blackout= "blackout",
134+
Blackbox= "blackbox",
135135
Blur= "blur",
136136
}
137137

test/vault/utils/utils.test.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,16 +451,22 @@ describe('getToken', () => {
451451

452452
describe('getBearerToken', () => {
453453
const logLevel = LogLevel.INFO;
454+
const originalEnv = process.env;
454455

455456
beforeEach(() => {
456457
jest.clearAllMocks();
457-
process.env.SKYFLOW_CREDENTIALS = undefined;
458+
process.env = { ...originalEnv };
459+
delete process.env.SKYFLOW_CREDENTIALS;
460+
});
461+
462+
afterEach(() => {
463+
process.env = originalEnv;
458464
});
459465

460466
test('should throw error if no credentials and no env variable', async () => {
461467
await expect(getBearerToken(undefined, logLevel))
462468
.rejects
463-
.toThrow();
469+
.toThrow(errorMessages.CREDENTIALS_REQUIRED);
464470
});
465471

466472
test('should use environment variable when credentials not provided', async () => {

0 commit comments

Comments
 (0)