Skip to content

Commit 6efd179

Browse files
author
flopez7
committed
remove content moderation enums and related code
1 parent 8f75dca commit 6efd179

8 files changed

Lines changed: 15 additions & 425 deletions

File tree

packages/apps/job-launcher/server/src/common/constants/errors.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,6 @@ export enum ErrorJob {
2626
NoRefundFound = 'No refund found for this escrow',
2727
}
2828

29-
/**
30-
* Represents error messages associated with a job moderation.
31-
*/
32-
export enum ErrorContentModeration {
33-
ErrorProcessingDataset = 'Error processing dataset',
34-
InappropriateContent = 'Job cannot be processed due to inappropriate content',
35-
ContentModerationFailed = 'Job cannot be processed due to failure in content moderation',
36-
NoDestinationURIFound = 'No destination URI found in the response',
37-
InvalidBucketUrl = 'Invalid bucket URL',
38-
DataMustBeStoredInGCS = 'Data must be stored in Google Cloud Storage',
39-
NoResultsFound = 'No results found',
40-
ResultsParsingFailed = 'Results parsing failed',
41-
JobModerationFailed = 'Job moderation failed',
42-
ProcessContentModerationRequestFailed = 'Process content moderation request failed',
43-
CompleteContentModerationFailed = 'Complete content moderation failed',
44-
}
45-
4629
/**
4730
* Represents error messages associated to webhook.
4831
*/

packages/apps/job-launcher/server/src/common/constants/index.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ export const LOGOUT_PATH = '/auth/logout';
6666

6767
export const MUTEX_TIMEOUT = 2000; //ms
6868

69-
export const GS_PROTOCOL = 'gs://';
70-
export const GCV_CONTENT_MODERATION_ASYNC_BATCH_SIZE = 100;
71-
export const GCV_CONTENT_MODERATION_BATCH_SIZE_PER_TASK = 2000;
69+
/**
70+
* Regex for GCS URL in subdomain format: https://<bucket>.storage.googleapis.com/<object_path>
71+
*/
72+
export const GCS_HTTP_REGEX_SUBDOMAIN =
73+
/^https:\/\/([a-zA-Z0-9\-.]+)\.storage\.googleapis\.com\/?(.*)$/;
74+
75+
/**
76+
* Regex for GCS URL in path-based format: https://storage.googleapis.com/<bucket>/<object_path>
77+
*/
78+
export const GCS_HTTP_REGEX_PATH_BASED =
79+
/^https:\/\/storage\.googleapis\.com\/([^/]+)\/?(.*)$/;

packages/apps/job-launcher/server/src/common/enums/content-moderation.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/apps/job-launcher/server/src/common/enums/gcv.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/apps/job-launcher/server/src/common/utils/gcstorage.spec.ts

Lines changed: 0 additions & 191 deletions
This file was deleted.

0 commit comments

Comments
 (0)