Skip to content

Commit dbe2b39

Browse files
committed
[deps] Update eslint monorepo to v10 - Fix breaking changes in backend sources
1 parent ba2649a commit dbe2b39

File tree

8 files changed

+12
-12
lines changed

8 files changed

+12
-12
lines changed

opencti-platform/opencti-graphql/src/database/file-storage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ export const ALL_MERGEABLE_FOLDERS = [IMPORT_STORAGE_PATH, EXPORT_STORAGE_PATH,
712712
*/
713713
export const deleteAllObjectFiles = async (context: AuthContext, user: AuthUser, element: BasicStoreObject) => {
714714
logApp.debug(`[FILE STORAGE] deleting all storage files for ${element.internal_id}`);
715-
let ids = [];
715+
let ids: string[];
716716
if (element.entity_type === ENTITY_TYPE_SUPPORT_PACKAGE) {
717717
const supportPath = `${SUPPORT_STORAGE_PATH}/${element.internal_id}`;
718718
const supportFiles = await allFilesForPaths(context, user, [supportPath]);

opencti-platform/opencti-graphql/src/modules/ai/ai-domain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export const generateContainerReport = async (context: AuthContext, user: AuthUs
181181
const container = await storeLoadById(context, user, containerId, ENTITY_TYPE_CONTAINER) as BasicStoreEntity;
182182
const { relationshipsSentences, entitiesInvolved } = await getContainerKnowledge(context, user, containerId);
183183
// Meaningful type
184-
let meaningfulType = '';
184+
let meaningfulType: string;
185185
if (container.entity_type === ENTITY_TYPE_CONTAINER_REPORT) {
186186
meaningfulType = `cyber threat intelligence report published on ${container.published}`;
187187
} else if (container.entity_type === ENTITY_TYPE_CONTAINER_CASE_INCIDENT) {

opencti-platform/opencti-graphql/src/modules/disseminationList/disseminationList-domain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export const sendDisseminationEmail = async (
7474
const settings = await getEntityFromCache<BasicStoreSettings>(context, user, ENTITY_TYPE_SETTINGS);
7575
const sentFiles = [];
7676
const attachmentListForSendMail = [];
77-
let generatedEmailBody = '';
77+
let generatedEmailBody: string;
7878
const allowedTypesInAttachment = ['application/pdf', 'text/html'];
7979
const allowedTypesInBody = ['text/html'];
8080
const emailTemplate = opts.useOctiTemplate ? OCTI_EMAIL_TEMPLATE : BASIC_EMAIL_TEMPLATE;

opencti-platform/opencti-graphql/src/modules/internal/csvMapper/csvMapper-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const isCsvValidRepresentationType = (representation: CsvMapperRepresenta
5353
};
5454

5555
export const parseCsvMapper = (mapper: any): CsvMapperParsed => {
56-
let representations: CsvMapperRepresentation[] = [];
56+
let representations: CsvMapperRepresentation[];
5757
if (typeof mapper?.representations === 'string') {
5858
try {
5959
representations = JSON.parse(mapper.representations);

opencti-platform/opencti-graphql/src/modules/internal/jsonMapper/jsonMapper-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import { isStixRelationshipExceptRef } from '../../../schema/stixRelationship';
3636
import { isStixObject } from '../../../schema/stixCoreObject';
3737

3838
export const parseJsonMapper = (mapper: any): JsonMapperParsed => {
39-
let representations: JsonMapperRepresentation[] = [];
39+
let representations: JsonMapperRepresentation[];
4040
if (typeof mapper?.representations === 'string') {
4141
try {
4242
representations = JSON.parse(mapper.representations);

opencti-platform/opencti-graphql/src/utils/filtering/filtering-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export const extractFilterGroupValues = (
169169
pushAll(keysToKeep, [INSTANCE_DYNAMIC_REGARDING_OF, RELATION_DYNAMIC_TO_FILTER, RELATION_DYNAMIC_FROM_FILTER]);
170170
}
171171
const { filters = [], filterGroups = [] } = inputFilters;
172-
let filteredFilters = [];
172+
let filteredFilters: Filter[];
173173
if (key) {
174174
filteredFilters = reverse
175175
// we prefer to handle single key and multi keys here, but theoretically it should be arrays every time
@@ -216,7 +216,7 @@ export const extractFilterGroupValues = (
216216
export const extractDynamicFilterGroupValues = (inputFilters: FilterGroup, key: string | string[] | null = null, reverse = false): FilterGroup[] => {
217217
const keysToKeep = Array.isArray(key) ? key : [key];
218218
const { filters = [], filterGroups = [] } = inputFilters;
219-
let filteredFilters = [];
219+
let filteredFilters: Filter[];
220220
if (key) {
221221
filteredFilters = reverse
222222
// we prefer to handle single key and multi keys here, but theoretically it should be arrays every time

opencti-platform/opencti-graphql/src/utils/safeEjs.client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ export const safeRender = async (template: string, data: Data, options?: SafeRen
9999
} catch (error) {
100100
// Enhance error messages
101101
if (!(error instanceof Error)) {
102-
throw new Error('Unknown rendering error');
102+
throw new Error('Unknown rendering error', { cause: error });
103103
}
104104
if (error.message.includes('Worker terminated')) {
105-
throw new Error('Rendering exceeded memory limits');
105+
throw new Error('Rendering exceeded memory limits', { cause: error });
106106
}
107107
throw error;
108108
} finally {

opencti-platform/opencti-graphql/src/utils/vulnerabilities.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ export const parseCvssVector = (
394394
const { codeToOpencti } = config;
395395
if (isEmptyField(vector)) {
396396
const nullFields: CvssFieldUpdate[] = Object.values(codeToOpencti).map((key) => ({ key, value: [null] }));
397-
let result: CvssFieldUpdate[] = [];
397+
let result: CvssFieldUpdate[];
398398
if (version === 'cvss2') {
399399
result = [
400400
{ key: config.baseVectorKey, value: [null] },
@@ -438,7 +438,7 @@ export const parseCvssVector = (
438438
} else if (version === 'cvss4') {
439439
scores = new Cvss4P0(vector!).calculateScores();
440440
}
441-
let result: CvssFieldUpdate[] = [];
441+
let result: CvssFieldUpdate[];
442442
if (version === 'cvss2') {
443443
if (isEmptyField(initialScore)) {
444444
result = [
@@ -517,7 +517,7 @@ export const updateCvssVector = (
517517
} else if (version === 'cvss4') {
518518
scores = new Cvss4P0(updatedVector).calculateScores();
519519
}
520-
let result: CvssFieldUpdate[] = [];
520+
let result: CvssFieldUpdate[];
521521
if (version === 'cvss2') {
522522
if (isEmptyField(initialScore)) {
523523
result = [

0 commit comments

Comments
 (0)